@kong-ui-public/analytics-chart 10.32.0 → 10.32.2-pr.3844.848a8700a.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/chart-plugins/ChartLegend.vue.d.ts.map +1 -1
- package/dist/types/components/chart-types/ScatterChart.vue.d.ts +7 -0
- package/dist/types/components/chart-types/ScatterChart.vue.d.ts.map +1 -1
- package/dist/types/composables/useScatterChartOptions.d.ts +28 -0
- package/dist/types/composables/useScatterChartOptions.d.ts.map +1 -1
- package/dist/types/composables/useScatterDatasets.d.ts +1 -1
- package/dist/types/composables/useScatterDatasets.d.ts.map +1 -1
- package/dist/types/types/chartjs-options.d.ts +2 -0
- package/dist/types/types/chartjs-options.d.ts.map +1 -1
- package/dist/types/types/scatter-data.d.ts +6 -0
- package/dist/types/types/scatter-data.d.ts.map +1 -1
- package/dist/types/utils/commonOptions.d.ts +1 -1
- package/dist/types/utils/commonOptions.d.ts.map +1 -1
- package/dist/types/utils/scatter-adapters.d.ts +1 -1
- package/dist/types/utils/scatter-adapters.d.ts.map +1 -1
- package/dist/vitals-chart.es.js +6150 -6097
- package/dist/vitals-chart.umd.js +27 -27
- package/package.json +3 -3
package/dist/vitals-chart.umd.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
(function(Yt,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("vue"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/analytics-metric-provider")):typeof define=="function"&&define.amd?define(["exports","vue","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/analytics-metric-provider"],p):(Yt=typeof globalThis<"u"?globalThis:Yt||self,p(Yt["kong-ui-publicvitals-chart"]={},Yt.Vue,Yt.KongIcons,Yt["kong-ui-public-i18n"],Yt["kong-ui-public-analytics-metric-provider"]))})(this,(function(Yt,p,Ts,Xf,tr){"use strict";var gt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.NINETY_DAY="90d",n.ONE_HUNDRED_EIGHTY_DAY="180d",n.ONE_YEAR="365d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.CURRENT_YEAR="current_year",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n.PREVIOUS_YEAR="previous_year",n))(gt||{});const Vb=["in","not_in","selector"],Yb=["empty","not_empty"],qb=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],er=n=>n.filter(t=>t!=="time"),Zf=["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"],Qf=er(Zf),jb=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],Jf=[...Zf,"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"],th=er(Jf),Gb=[...jb,"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"],Kb=["control_plane","control_plane_group","ai_gateway","gateway_service","consumer","ai_gateway_consumer","ai_gateway_consumer_group","application","oidc_credential","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin","principal","cache_status","ai_gateway_mcp_server","ai_gateway_model","ai_gateway_agent","ai_gateway_data_plane_node"],eh=er(Kb),Xb=["a2a_context_id","a2a_error","a2a_method","a2a_task_id","api","api_package","api_product","api_product_version","application","auth_type","bot_info_action","bot_info_detection_reason","bot_info_ja4_fingerprint","bot_info_ban_type","bot_info_header_names","cache_status","client_ip","consumer","ai_gateway_consumer","consumer_group","ai_gateway_consumer_group","control_plane","control_plane_group","ai_gateway","country_code","data_plane_node","data_plane_node_version","ai_gateway_data_plane_node","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_uri","upstream_status_code_grouped","websocket"],Zb=er(Xb),Qb=["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"],Jb=Qb,tx=["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"],ex=er(tx),nx=["platform","platform_usage"],ix=n=>nx.includes(n),rx=[...Jf.filter(n=>n!=="consumer_group"),"a2a_context_id","a2a_error","a2a_method","a2a_task_id","a2a_task_state","ai_gateway_agent","ai_gateway_mcp_server","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],nh=er(rx);[...Gb];const sx=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],ih=er(sx);new Set(Qf),new Set(th),new Set(eh),new Set(nh),new Set(ih);const rh=[{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"}];rh.map(n=>n.code);const sh=n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:Vb},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:Yb}},required:["field","operator"],additionalProperties:!1}]}}),ox=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];sh(Array.from(new Set([...Zb,...Jb,...ex]))),sh([...new Set([...th,...Qf,...eh,...nh,...ox,...ih])]);const ax={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"}},lx=(n,t,e)=>{let i;const r=ax[n];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function _c(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const cx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ux={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},fx={date:_c({formats:cx,defaultWidth:"full"}),time:_c({formats:ux,defaultWidth:"full"}),dateTime:_c({formats:dx,defaultWidth:"full"})},hx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},px=(n,t,e,i)=>hx[n];function Ms(n){return(t,e)=>{const i=e?.context?String(e.context):"standalone";let r;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,l=e?.width?String(e.width):a;r=n.formattingValues[l]||n.formattingValues[a]}else{const a=n.defaultWidth,l=e?.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(t):t;return r[s]}}const gx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},mx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},yx={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"]},_x={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"]},bx={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"}},xx={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"}},wx=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},vx={ordinalNumber:wx,era:Ms({values:gx,defaultWidth:"wide"}),quarter:Ms({values:mx,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ms({values:yx,defaultWidth:"wide"}),day:Ms({values:_x,defaultWidth:"wide"}),dayPeriod:Ms({values:bx,defaultWidth:"wide",formattingValues:xx,defaultFormattingWidth:"wide"})};function ks(n){return(t,e={})=>{const i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],l=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(l)?Tx(l,g=>g.test(a)):Sx(l,g=>g.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const f=t.slice(a.length);return{value:d,rest:f}}}function Sx(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Tx(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Mx(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const r=i[0],s=t.match(n.parsePattern);if(!s)return null;let a=n.valueCallback?n.valueCallback(s[0]):s[0];a=e.valueCallback?e.valueCallback(a):a;const l=t.slice(r.length);return{value:a,rest:l}}}const kx=/^(\d+)(th|st|nd|rd)?/i,Dx=/\d+/i,Cx={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},Ox={any:[/^b/i,/^(a|c)/i]},Ax={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ex={any:[/1/i,/2/i,/3/i,/4/i]},Rx={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Px={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]},Ix={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Lx={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Nx={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},Bx={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}},Fx={ordinalNumber:Mx({matchPattern:kx,parsePattern:Dx,valueCallback:n=>parseInt(n,10)}),era:ks({matchPatterns:Cx,defaultMatchWidth:"wide",parsePatterns:Ox,defaultParseWidth:"any"}),quarter:ks({matchPatterns:Ax,defaultMatchWidth:"wide",parsePatterns:Ex,defaultParseWidth:"any",valueCallback:n=>n+1}),month:ks({matchPatterns:Rx,defaultMatchWidth:"wide",parsePatterns:Px,defaultParseWidth:"any"}),day:ks({matchPatterns:Ix,defaultMatchWidth:"wide",parsePatterns:Lx,defaultParseWidth:"any"}),dayPeriod:ks({matchPatterns:Nx,defaultMatchWidth:"any",parsePatterns:Bx,defaultParseWidth:"any"})},zx={code:"en-US",formatDistance:lx,formatLong:fx,formatRelative:px,localize:vx,match:Fx,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Ux={};function Ds(){return Ux}const oh=6048e5,Hx=864e5,Wx=60,$x=3600,ah=Symbol.for("constructDateFrom");function Sn(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&ah in n?n[ah](t):n instanceof Date?new n.constructor(t):new Date(t)}function ze(n,t){return Sn(t||n,n)}function lh(n){const t=ze(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Vx(n,...t){const e=Sn.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Rr(n,t){const e=ze(n,t?.in);return e.setHours(0,0,0,0),e}function Yx(n,t,e){const[i,r]=Vx(e?.in,n,t),s=Rr(i),a=Rr(r),l=+s-lh(s),u=+a-lh(a);return Math.round((l-u)/Hx)}function qx(n,t){const e=ze(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function jx(n,t){const e=ze(n,t?.in);return Yx(e,qx(e))+1}function Jn(n,t){const e=Ds(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=ze(n,t?.in),s=r.getDay(),a=(s<i?7:0)+s-i;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function Jo(n,t){return Jn(n,{...t,weekStartsOn:1})}function ch(n,t){const e=ze(n,t?.in),i=e.getFullYear(),r=Sn(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Jo(r),a=Sn(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Jo(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function Gx(n,t){const e=ch(n,t),i=Sn(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Jo(i)}function Kx(n,t){const e=ze(n,t?.in),i=+Jo(e)-+Gx(e);return Math.round(i/oh)+1}function uh(n,t){const e=ze(n,t?.in),i=e.getFullYear(),r=Ds(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=Sn(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=Jn(a,t),u=Sn(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=Jn(u,t);return+e>=+l?i+1:+e>=+d?i:i-1}function Xx(n,t){const e=Ds(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=uh(n,t),s=Sn(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Jn(s,t)}function Zx(n,t){const e=ze(n,t?.in),i=+Jn(e,t)-+Xx(e,t);return Math.round(i/oh)+1}function Xt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const vi={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Xt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Xt(e+1,2)},d(n,t){return Xt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Xt(n.getHours()%12||12,t.length)},H(n,t){return Xt(n.getHours(),t.length)},m(n,t){return Xt(n.getMinutes(),t.length)},s(n,t){return Xt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),r=Math.trunc(i*Math.pow(10,e-3));return Xt(r,t.length)}},Pr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},dh={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),r=i>0?i:1-i;return e.ordinalNumber(r,{unit:"year"})}return vi.y(n,t)},Y:function(n,t,e,i){const r=uh(n,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Xt(a,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):Xt(s,t.length)},R:function(n,t){const e=ch(n);return Xt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Xt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Xt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Xt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return vi.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Xt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const r=Zx(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Xt(r,t.length)},I:function(n,t,e){const i=Kx(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Xt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):vi.d(n,t)},D:function(n,t,e){const i=jx(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Xt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Xt(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Xt(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Xt(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let r;switch(i===12?r=Pr.noon:i===0?r=Pr.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let r;switch(i>=17?r=Pr.evening:i>=12?r=Pr.afternoon:i>=4?r=Pr.morning:r=Pr.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return vi.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):vi.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Xt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Xt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):vi.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):vi.s(n,t)},S:function(n,t){return vi.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return hh(i);case"XXXX":case"XX":return nr(i);default:return nr(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return hh(i);case"xxxx":case"xx":return nr(i);default:return nr(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+fh(i,":");default:return"GMT"+nr(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+fh(i,":");default:return"GMT"+nr(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Xt(i,t.length)},T:function(n,t,e){return Xt(+n,t.length)}};function fh(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.trunc(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Xt(s,2)}function hh(n,t){return n%60===0?(n>0?"-":"+")+Xt(Math.abs(n)/60,2):nr(n,t)}function nr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Xt(Math.trunc(i/60),2),s=Xt(i%60,2);return e+r+t+s}const ph=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},gh=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Qx=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return ph(n,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",ph(i,t)).replace("{{time}}",gh(r,t))},Jx={p:gh,P:Qx},tw=/^D+$/,ew=/^Y+$/,nw=["D","DD","YY","YYYY"];function iw(n){return tw.test(n)}function rw(n){return ew.test(n)}function sw(n,t,e){const i=ow(n,t,e);if(console.warn(i),nw.includes(n))throw new RangeError(i)}function ow(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function aw(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function lw(n){return!(!aw(n)&&typeof n!="number"||isNaN(+ze(n)))}const cw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,uw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,dw=/^'([^]*?)'?$/,fw=/''/g,hw=/[a-zA-Z]/;function pw(n,t,e){const i=Ds(),r=e?.locale??i.locale??zx,s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=ze(n,e?.in);if(!lw(l))throw new RangeError("Invalid time value");let u=t.match(uw).map(f=>{const g=f[0];if(g==="p"||g==="P"){const m=Jx[g];return m(f,r.formatLong)}return f}).join("").match(cw).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const g=f[0];if(g==="'")return{isToken:!1,value:gw(f)};if(dh[g])return{isToken:!0,value:f};if(g.match(hw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:f}});r.localize.preprocessor&&(u=r.localize.preprocessor(l,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(f=>{if(!f.isToken)return f.value;const g=f.value;(!e?.useAdditionalWeekYearTokens&&rw(g)||!e?.useAdditionalDayOfYearTokens&&iw(g))&&sw(g,t,String(n));const m=dh[g[0]];return m(l,g,r.localize,d)}).join("")}function gw(n){const t=n.match(dw);return t?t[1].replace(fw,"'"):n}function ta(n,t,e){const i=ze(n,e?.in);return isNaN(t)?Sn(n,NaN):(i.setDate(i.getDate()+t),i)}function mh(n,t,e){const i=ze(n,e?.in);if(isNaN(t))return Sn(n,NaN);if(!t)return i;const r=i.getDate(),s=Sn(n,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function mw(n,t,e){return mh(n,t*3,e)}function Ir(n,t){const e=ze(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function Lr(n,t){const e=ze(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function yw(n,t){const e=ze(n,t?.in),i=e.getFullYear(),r=e.getMonth(),s=Sn(e,0);return s.setFullYear(i,r+1,0),s.setHours(0,0,0,0),s.getDate()}function _w(){return Object.assign({},Ds())}function yh(n){return Math.trunc(n*$x)}function bw(n){const t=n/Wx;return Math.trunc(t)}function _h(n,t,e){return mh(n,-1,e)}function bh(n,t,e){return mw(n,-1,e)}function xh(n,t,e){const i=_w(),r=vw(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?xw(r,t):ww(r,t)}function xw(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function ww(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function vw(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Sw(n,t){const e=Cw(t);return"formatToParts"in e?Mw(e,n):kw(e,n)}const Tw={year:0,month:1,day:2,hour:3,minute:4,second:5};function Mw(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=Tw[e[r].type];s!==void 0&&(i[s]=parseInt(e[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function kw(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const bc={},wh=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")),Dw=wh==="06/25/2014, 00:00:00"||wh==="06/25/2014 00:00:00";function Cw(n){return bc[n]||(bc[n]=Dw?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),bc[n]}function xc(n,t,e,i,r,s,a){const l=new Date(0);return l.setUTCFullYear(n,t,e),l.setUTCHours(i,r,s,a),l}const vh=36e5,Ow=6e4,wc={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Cs(n,t,e){if(!n)return 0;let i=wc.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=wc.timezoneHH.exec(n),i)return r=parseInt(i[1],10),Sh(r)?-(r*vh):NaN;if(i=wc.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Sh(r,a)?(s=Math.abs(r)*vh+a*Ow,i[1]==="+"?-s:s):NaN}if(Rw(n)){t=new Date(t||Date.now());const a=e?t:Aw(t),l=vc(a,n);return-(e?l:Ew(t,l,n))}return NaN}function Aw(n){return xc(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function vc(n,t){const e=Sw(n,t),i=xc(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let r=n.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function Ew(n,t,e){let i=n.getTime()-t;const r=vc(new Date(i),e);if(t===r)return t;i-=r-t;const s=vc(new Date(i),e);return r===s?r:Math.max(r,s)}function Sh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Th={};function Rw(n){if(Th[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Th[n]=!0,!0}catch{return!1}}const Pw=60*1e3,Iw={X:function(n,t,e){const i=Sc(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Mh(i);case"XXXX":case"XX":return Nr(i);default:return Nr(i,":")}},x:function(n,t,e){const i=Sc(e.timeZone,n);switch(t){case"x":return Mh(i);case"xxxx":case"xx":return Nr(i);default:return Nr(i,":")}},O:function(n,t,e){const i=Sc(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Lw(i,":");default:return"GMT"+Nr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return xh("short",n,e);default:return xh("long",n,e)}}};function Sc(n,t){const e=n?Cs(n,t,!0)/Pw:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function ea(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Nr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=ea(Math.floor(i/60),2),s=ea(Math.floor(i%60),2);return e+r+t+s}function Mh(n,t){return n%60===0?(n>0?"-":"+")+ea(Math.abs(n)/60,2):Nr(n,t)}function Lw(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+ea(s,2)}function kh(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const Dh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Tc=36e5,Ch=6e4,Nw=2,Ke={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:Dh};function na(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?Nw:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=Bw(n),{year:r,restDateString:s}=Fw(i.date,e),a=zw(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const l=a.getTime();let u=0,d;if(i.time&&(u=Uw(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Cs(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=kh(new Date(l+u)),d=kh(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function Bw(n){const t={};let e=Ke.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Ke.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=Ke.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function Fw(n,t){if(n){const e=Ke.YYY[t],i=Ke.YYYYY[t];let r=Ke.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=Ke.YY.exec(n)||e.exec(n),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}}return{year:null}}function zw(n,t){if(t===null)return null;let e,i,r;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let s=Ke.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,Eh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=Ke.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return $w(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=Ke.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return Eh(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=Ke.Www.exec(n),s)return r=parseInt(s[1],10)-1,Rh(r)?Oh(t,r):new Date(NaN);if(s=Ke.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return Rh(r,a)?Oh(t,r,a):new Date(NaN)}return null}function Uw(n){let t,e,i=Ke.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Mc(t)?t%24*Tc:NaN;if(i=Ke.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Mc(t,e)?t%24*Tc+e*Ch:NaN;if(i=Ke.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Mc(t,e,r)?t%24*Tc+e*Ch+r*1e3:NaN}return null}function Oh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const Hw=[31,28,31,30,31,30,31,31,30,31,30,31],Ww=[31,29,31,30,31,30,31,31,30,31,30,31];function Ah(n){return n%400===0||n%4===0&&n%100!==0}function Eh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Ah(n);if(i&&e>Ww[t]||!i&&e>Hw[t])return!1}return!0}function $w(n,t){if(t<1)return!1;const e=Ah(n);return!(e&&t>366||!e&&t>365)}function Rh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Mc(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Vw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Yw(n,t,e={}){t=String(t);const i=t.match(Vw);if(i){const r=na(e.originalDate||n,e);t=i.reduce(function(s,a){if(a[0]==="'")return s;const l=s.indexOf(a),u=s[l-1]==="'",d=s.replace(a,"'"+Iw[a[0]](r,a,e)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return pw(n,t,e)}function Ph(n,t,e){n=na(n,e);const i=Cs(t,n,!0),r=new Date(n.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function Ih(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Yw(Ph(n,t,{timeZone:i.timeZone}),e,i)}function qw(n,t,e){if(typeof n=="string"&&!n.match(Dh))return na(n,{...e,timeZone:t});n=na(n,e);const i=xc(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),r=Cs(t,new Date(i));return new Date(i+r)}function jw(n,t){return-Cs(n,t)}function Lh(n,t={}){const e=t?.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;let i="MMM dd, yyy hh:mm a";switch(t.format){case"short":i="MMM dd, yyyy";break;case"default":i="MMM dd, yyyy hh:mm a";break;case"full":i="MMM dd, yyyy hh:mm:ss.SSS a";break}return t.includeTZ&&(i+=" (z)"),Ih(n,e,i)}function Gw(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const r=new Date(n);return Ih(r,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const Kw={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 ia(n){return n&&qb.find(t=>n<=Kw[t])||null}var ra=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},sa={exports:{}};sa.exports;var Nh;function Xw(){return Nh||(Nh=1,(function(n,t){var e=200,i="__lodash_hash_undefined__",r=9007199254740991,s="[object Arguments]",a="[object Array]",l="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Function]",g="[object GeneratorFunction]",m="[object Map]",_="[object Number]",x="[object Object]",S="[object Promise]",T="[object RegExp]",C="[object Set]",A="[object String]",F="[object Symbol]",P="[object WeakMap]",I="[object ArrayBuffer]",L="[object DataView]",N="[object Float32Array]",w="[object Float64Array]",M="[object Int8Array]",O="[object Int16Array]",B="[object Int32Array]",W="[object Uint8Array]",J="[object Uint8ClampedArray]",ut="[object Uint16Array]",ft="[object Uint32Array]",K=/[\\^$.*+?()[\]{}|]/g,nt=/\w*$/,rt=/^\[object .+?Constructor\]$/,it=/^(?:0|[1-9]\d*)$/,at={};at[s]=at[a]=at[I]=at[L]=at[l]=at[u]=at[N]=at[w]=at[M]=at[O]=at[B]=at[m]=at[_]=at[x]=at[T]=at[C]=at[A]=at[F]=at[W]=at[J]=at[ut]=at[ft]=!0,at[d]=at[f]=at[P]=!1;var H=typeof ra=="object"&&ra&&ra.Object===Object&&ra,q=typeof self=="object"&&self&&self.Object===Object&&self,X=H||q||Function("return this")(),_t=t&&!t.nodeType&&t,j=_t&&!0&&n&&!n.nodeType&&n,V=j&&j.exports===_t;function st(D,$){return D.set($[0],$[1]),D}function ot(D,$){return D.add($),D}function lt(D,$){for(var tt=-1,mt=D?D.length:0;++tt<mt&&$(D[tt],tt,D)!==!1;);return D}function pt(D,$){for(var tt=-1,mt=$.length,Te=D.length;++tt<mt;)D[Te+tt]=$[tt];return D}function dt(D,$,tt,mt){for(var Te=-1,qe=D?D.length:0;++Te<qe;)tt=$(tt,D[Te],Te,D);return tt}function It(D,$){for(var tt=-1,mt=Array(D);++tt<D;)mt[tt]=$(tt);return mt}function zt(D,$){return D?.[$]}function vt(D){var $=!1;if(D!=null&&typeof D.toString!="function")try{$=!!(D+"")}catch{}return $}function Ct(D){var $=-1,tt=Array(D.size);return D.forEach(function(mt,Te){tt[++$]=[Te,mt]}),tt}function Dt(D,$){return function(tt){return D($(tt))}}function ve(D){var $=-1,tt=Array(D.size);return D.forEach(function(mt){tt[++$]=mt}),tt}var bt=Array.prototype,jt=Function.prototype,Oe=Object.prototype,Ae=X["__core-js_shared__"],oe=(function(){var D=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||"");return D?"Symbol(src)_1."+D:""})(),ln=jt.toString,$t=Oe.hasOwnProperty,Le=Oe.toString,ie=RegExp("^"+ln.call($t).replace(K,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Se=V?X.Buffer:void 0,Ee=X.Symbol,gn=X.Uint8Array,Hi=Dt(Object.getPrototypeOf,Object),Dn=Object.create,Ye=Oe.propertyIsEnumerable,In=bt.splice,ui=Object.getOwnPropertySymbols,So=Se?Se.isBuffer:void 0,To=Dt(Object.keys,Object),xr=Gn(X,"DataView"),di=Gn(X,"Map"),Mo=Gn(X,"Promise"),ko=Gn(X,"Set"),Do=Gn(X,"WeakMap"),Wi=Gn(Object,"create"),pl=hi(xr),fd=hi(di),hd=hi(Mo),pd=hi(ko),gd=hi(Do),Co=Ee?Ee.prototype:void 0,gl=Co?Co.valueOf:void 0;function fi(D){var $=-1,tt=D?D.length:0;for(this.clear();++$<tt;){var mt=D[$];this.set(mt[0],mt[1])}}function md(){this.__data__=Wi?Wi(null):{}}function Oo(D){return this.has(D)&&delete this.__data__[D]}function yd(D){var $=this.__data__;if(Wi){var tt=$[D];return tt===i?void 0:tt}return $t.call($,D)?$[D]:void 0}function Ao(D){var $=this.__data__;return Wi?$[D]!==void 0:$t.call($,D)}function _d(D,$){var tt=this.__data__;return tt[D]=Wi&&$===void 0?i:$,this}fi.prototype.clear=md,fi.prototype.delete=Oo,fi.prototype.get=yd,fi.prototype.has=Ao,fi.prototype.set=_d;function Ln(D){var $=-1,tt=D?D.length:0;for(this.clear();++$<tt;){var mt=D[$];this.set(mt[0],mt[1])}}function bd(){this.__data__=[]}function xd(D){var $=this.__data__,tt=wr($,D);if(tt<0)return!1;var mt=$.length-1;return tt==mt?$.pop():In.call($,tt,1),!0}function wd(D){var $=this.__data__,tt=wr($,D);return tt<0?void 0:$[tt][1]}function ml(D){return wr(this.__data__,D)>-1}function vd(D,$){var tt=this.__data__,mt=wr(tt,D);return mt<0?tt.push([D,$]):tt[mt][1]=$,this}Ln.prototype.clear=bd,Ln.prototype.delete=xd,Ln.prototype.get=wd,Ln.prototype.has=ml,Ln.prototype.set=vd;function $i(D){var $=-1,tt=D?D.length:0;for(this.clear();++$<tt;){var mt=D[$];this.set(mt[0],mt[1])}}function yl(){this.__data__={hash:new fi,map:new(di||Ln),string:new fi}}function Sd(D){return vr(this,D).delete(D)}function Td(D){return vr(this,D).get(D)}function Md(D){return vr(this,D).has(D)}function kd(D,$){return vr(this,D).set(D,$),this}$i.prototype.clear=yl,$i.prototype.delete=Sd,$i.prototype.get=Td,$i.prototype.has=Md,$i.prototype.set=kd;function Vi(D){this.__data__=new Ln(D)}function Dd(){this.__data__=new Ln}function ns(D){return this.__data__.delete(D)}function Cd(D){return this.__data__.get(D)}function is(D){return this.__data__.has(D)}function Od(D,$){var tt=this.__data__;if(tt instanceof Ln){var mt=tt.__data__;if(!di||mt.length<e-1)return mt.push([D,$]),this;tt=this.__data__=new $i(mt)}return tt.set(D,$),this}Vi.prototype.clear=Dd,Vi.prototype.delete=ns,Vi.prototype.get=Cd,Vi.prototype.has=is,Vi.prototype.set=Od;function Ad(D,$){var tt=Lo(D)||El(D)?It(D.length,String):[],mt=tt.length,Te=!!mt;for(var qe in D)$t.call(D,qe)&&!(Te&&(qe=="length"||Dl(qe,mt)))&&tt.push(qe);return tt}function _l(D,$,tt){var mt=D[$];(!($t.call(D,$)&&Al(mt,tt))||tt===void 0&&!($ in D))&&(D[$]=tt)}function wr(D,$){for(var tt=D.length;tt--;)if(Al(D[tt][0],$))return tt;return-1}function bl(D,$){return D&&Ro($,No($),D)}function rs(D,$,tt,mt,Te,qe,Nn){var Ne;if(mt&&(Ne=qe?mt(D,Te,qe,Nn):mt(D)),Ne!==void 0)return Ne;if(!cs(D))return D;var Pl=Lo(D);if(Pl){if(Ne=Ml(D),!$)return Tl(D,Ne)}else{var ce=cn(D),us=ce==f||ce==g;if(Hd(D))return wl(D,$);if(ce==x||ce==s||us&&!qe){if(vt(D))return qe?D:{};if(Ne=kl(us?{}:D),!$)return Po(D,bl(Ne,D))}else{if(!at[ce])return qe?D:{};Ne=Fd(D,ce,rs,$)}}Nn||(Nn=new Vi);var Kn=Nn.get(D);if(Kn)return Kn;if(Nn.set(D,Ne),!Pl)var Bo=tt?Bd(D):No(D);return lt(Bo||D,function(Sr,Be){Bo&&(Be=Sr,Sr=D[Be]),_l(Ne,Be,rs(Sr,$,tt,mt,Be,D,Nn))}),Ne}function Ed(D){return cs(D)?Dn(D):{}}function Rd(D,$,tt){var mt=$(D);return Lo(D)?mt:pt(mt,tt(D))}function Pd(D){return Le.call(D)}function Id(D){if(!cs(D)||Ol(D))return!1;var $=ls(D)||vt(D)?ie:rt;return $.test(hi(D))}function xl(D){if(!Io(D))return To(D);var $=[];for(var tt in Object(D))$t.call(D,tt)&&tt!="constructor"&&$.push(tt);return $}function wl(D,$){if($)return D.slice();var tt=new D.constructor(D.length);return D.copy(tt),tt}function ss(D){var $=new D.constructor(D.byteLength);return new gn($).set(new gn(D)),$}function Eo(D,$){var tt=$?ss(D.buffer):D.buffer;return new D.constructor(tt,D.byteOffset,D.byteLength)}function Ld(D,$,tt){var mt=$?tt(Ct(D),!0):Ct(D);return dt(mt,st,new D.constructor)}function vl(D){var $=new D.constructor(D.source,nt.exec(D));return $.lastIndex=D.lastIndex,$}function os(D,$,tt){var mt=$?tt(ve(D),!0):ve(D);return dt(mt,ot,new D.constructor)}function Sl(D){return gl?Object(gl.call(D)):{}}function Nd(D,$){var tt=$?ss(D.buffer):D.buffer;return new D.constructor(tt,D.byteOffset,D.length)}function Tl(D,$){var tt=-1,mt=D.length;for($||($=Array(mt));++tt<mt;)$[tt]=D[tt];return $}function Ro(D,$,tt,mt){tt||(tt={});for(var Te=-1,qe=$.length;++Te<qe;){var Nn=$[Te],Ne=void 0;_l(tt,Nn,Ne===void 0?D[Nn]:Ne)}return tt}function Po(D,$){return Ro(D,as(D),$)}function Bd(D){return Rd(D,No,as)}function vr(D,$){var tt=D.__data__;return Cl($)?tt[typeof $=="string"?"string":"hash"]:tt.map}function Gn(D,$){var tt=zt(D,$);return Id(tt)?tt:void 0}var as=ui?Dt(ui,Object):Vd,cn=Pd;(xr&&cn(new xr(new ArrayBuffer(1)))!=L||di&&cn(new di)!=m||Mo&&cn(Mo.resolve())!=S||ko&&cn(new ko)!=C||Do&&cn(new Do)!=P)&&(cn=function(D){var $=Le.call(D),tt=$==x?D.constructor:void 0,mt=tt?hi(tt):void 0;if(mt)switch(mt){case pl:return L;case fd:return m;case hd:return S;case pd:return C;case gd:return P}return $});function Ml(D){var $=D.length,tt=D.constructor($);return $&&typeof D[0]=="string"&&$t.call(D,"index")&&(tt.index=D.index,tt.input=D.input),tt}function kl(D){return typeof D.constructor=="function"&&!Io(D)?Ed(Hi(D)):{}}function Fd(D,$,tt,mt){var Te=D.constructor;switch($){case I:return ss(D);case l:case u:return new Te(+D);case L:return Eo(D,mt);case N:case w:case M:case O:case B:case W:case J:case ut:case ft:return Nd(D,mt);case m:return Ld(D,mt,tt);case _:case A:return new Te(D);case T:return vl(D);case C:return os(D,mt,tt);case F:return Sl(D)}}function Dl(D,$){return $=$??r,!!$&&(typeof D=="number"||it.test(D))&&D>-1&&D%1==0&&D<$}function Cl(D){var $=typeof D;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?D!=="__proto__":D===null}function Ol(D){return!!oe&&oe in D}function Io(D){var $=D&&D.constructor,tt=typeof $=="function"&&$.prototype||Oe;return D===tt}function hi(D){if(D!=null){try{return ln.call(D)}catch{}try{return D+""}catch{}}return""}function zd(D){return rs(D,!0,!0)}function Al(D,$){return D===$||D!==D&&$!==$}function El(D){return Ud(D)&&$t.call(D,"callee")&&(!Ye.call(D,"callee")||Le.call(D)==s)}var Lo=Array.isArray;function Rl(D){return D!=null&&Wd(D.length)&&!ls(D)}function Ud(D){return $d(D)&&Rl(D)}var Hd=So||ee;function ls(D){var $=cs(D)?Le.call(D):"";return $==f||$==g}function Wd(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=r}function cs(D){var $=typeof D;return!!D&&($=="object"||$=="function")}function $d(D){return!!D&&typeof D=="object"}function No(D){return Rl(D)?Ad(D):xl(D)}function Vd(){return[]}function ee(){return!1}n.exports=zd})(sa,sa.exports)),sa.exports}Xw();const Tn=(n,t)=>new Date(n.getTime()-jw(t,n));class De{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 e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=168&&e.add("hourly"),i>=48&&e.add("daily"),i>=672&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=qw(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Ph(e,t)}}class Zw extends De{rawStart(t){let e=Jn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*7}}class Qw extends De{rawStart(t){let e=Lr(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*31}}class Jw extends De{rawStart(t){let e=Ir(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*92}}class tv extends De{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*366}}class ev extends De{rawEnd(t){let e=Jn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Tn(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=Jn(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Tn(i,t)),i}}class nv extends De{rawEnd(t){let e=Ir(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}rawStart(t){let e=Ir(bh(this.tzAdjustedDate(t)));return t&&(e=Tn(e,t)),e}}class iv extends De{rawEnd(t){let e=Lr(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}rawStart(t){let e=Lr(_h(this.tzAdjustedDate(t)));return t&&(e=Tn(e,t)),e}}class rv extends De{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Tn(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=Tn(e,t)),e}}gt.FIFTEEN_MIN,new De({key:gt.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"]}),gt.ONE_HOUR,new De({key:gt.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"]}),gt.SIX_HOUR,new De({key:gt.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"]}),gt.TWELVE_HOUR,new De({key:gt.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"]}),gt.ONE_DAY,new De({key:gt.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"]}),gt.SEVEN_DAY,new De({key:gt.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"]}),gt.THIRTY_DAY,new De({key:gt.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"]}),gt.NINETY_DAY,new De({key:gt.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"]}),gt.ONE_HUNDRED_EIGHTY_DAY,new De({key:gt.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"]}),gt.ONE_YEAR,new De({key:gt.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"]}),gt.CURRENT_WEEK,new Zw({key:gt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=Jn(new Date,{weekStartsOn:1});return(Rr(ta(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),gt.CURRENT_MONTH,new Qw({key:gt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Lr(new Date);return(Rr(ta(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.CURRENT_QUARTER,new Jw({key:gt.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Ir(new Date);return(Rr(ta(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.CURRENT_YEAR,new tv({key:gt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1);return(Rr(ta(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.PREVIOUS_WEEK,new ev({key:gt.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"]}),gt.PREVIOUS_MONTH,new iv({key:gt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Lr(new Date),e=Lr(_h(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Bh(t,e)),3600*24*yw(new Date().setMonth(new Date().getMonth()-1))+yh(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.PREVIOUS_QUARTER,new nv({key:gt.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Ir(new Date),t=Ir(bh(new Date));return(n.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.PREVIOUS_YEAR,new rv({key:gt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let e=0;return n.getTimezoneOffset()!==t.getTimezoneOffset()&&(e=Bh(n,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+yh(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Bh(n,t){return bw(n.getTimezoneOffset()-t.getTimezoneOffset())}gt.FIFTEEN_MIN,gt.ONE_HOUR,gt.SIX_HOUR,gt.TWELVE_HOUR,gt.ONE_DAY,gt.SEVEN_DAY,gt.FIFTEEN_MIN,gt.ONE_HOUR,gt.SIX_HOUR,gt.TWELVE_HOUR,gt.ONE_DAY,gt.SEVEN_DAY,gt.THIRTY_DAY,gt.NINETY_DAY,gt.ONE_HUNDRED_EIGHTY_DAY,gt.ONE_YEAR,gt.CURRENT_WEEK,gt.CURRENT_MONTH,gt.CURRENT_QUARTER,gt.CURRENT_YEAR,gt.PREVIOUS_WEEK,gt.PREVIOUS_MONTH,gt.PREVIOUS_QUARTER,gt.PREVIOUS_YEAR;const sv=new Map(rh.map(n=>[n.code,{code:n.code,name:n.name}])),kc=n=>sv.get(n)?.name||n,Fh=1e3,ov=1e4,zh=1e6,Uh=1e9,Hh=1e12,oa=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((r,s)=>{s&&s%3===0&&i.push(e),i.push(r)}),i.reverse().join("")},Os=(n,t,e)=>{const i=n/t,r=e.round?"round":"floor";if(e.decimal===!1)return Math[r](i).toString();let s;e.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function aa(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const r=t.min10k?ov:Fh;return n<r||t.precision&&t.precision>Math.log10(n)?e=oa(Os(n,1,t),t):n<zh?e=`${Os(n,Fh,t)}k`:n<Uh?e=`${Os(n,zh,t)}m`:n<Hh?e=`${oa(Os(n,Uh,t),t)}b`:e=`${oa(Os(n,Hh,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}aa.addCommas=oa;const av=typeof document<"u"&&document.documentElement?.lang||"en-US",la=new Intl.NumberFormat(av);function ti({i18n:n}){const t=(i,r)=>{if(isNaN(i))return"0 B";const s=r?Math.pow(2,50):1e15,a=r?Math.pow(2,40):1e12,l=r?Math.pow(2,30):1e9,u=r?Math.pow(2,20):1e6,d=r?Math.pow(2,10):1e3;let f;return i>=s?f=n.formatNumber(Number.parseFloat((i/s).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?f=n.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=l?f=n.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=u?f=n.formatNumber(Number.parseFloat((i/u).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=d?f=n.formatNumber(Number.parseFloat((i/d).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):f=n.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),f.replace(/([a-zA-Z]*)$/," $1")},e=(i,r="USD")=>isNaN(i)?r==="USD"?"$0.00":`${i}`:i>=.01||r!=="USD"?n.formatNumber(i,{style:"currency",currency:r}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,r,{isBytes1024:s=!1,currency:a="USD",approximate:l=!1,translateUnit:u=d=>d}={})=>{const d=u(r,i);switch(r){case"bytes":return t(i,s);case"usd":return e(i,a);default:return isNaN(i)?`${i}`:l?`${aa(i,{capital:!0})} ${d}`:i>=.01?`${la.format(Number.parseFloat(i.toFixed(2)))} ${d}`:`${Number.parseFloat(i.toPrecision(4))} ${d}`}},formatBytes:t,formatCost:e,formatRange:(i,r,s,{isBytes1024:a=!1,currency:l="USD",approximate:u=!1,translateUnit:d=f=>f}={})=>{const f=d(s,r);switch(s){case"bytes":return`${t(i,a)} - ${t(r,a)}`;case"usd":return`${e(i,l)} - ${e(r,l)}`;default:if(isNaN(i)||isNaN(r))return`${i} - ${r}`;if(u)return`${aa(i,{capital:!0})} - ${aa(r,{capital:!0})} ${f}`}const g=i>=.01?`${la.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,m=r>=.01?`${la.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`;return`${g} - ${m} ${f}`}}}const Wh="#d60027",$h="#ffe5e5",lv="#f1f0ff",cv="#e0e4ea",Vh="#6c7489",uv="#afb7c5",Yh="#0d0e14",dv="#d60027",fv="#ad000e",Dc="#6c7489",qh="#52596e",hv="#007d60",pv="#995c00",gv="#ffc400",mv="'Inter', Roboto, Helvetica, sans-serif",As="16px",yv="20px",_v="#bee2ff",bv="#8fc1ff",xv="#5f9aff",wv="#306fff",vv="#b5ffee",Sv="#00fabe",Tv="#00d6a4",Mv="#00a17b",kv="#007d60",Dv="#005944",Cv="#b5ffee",Ov="#00fabe",Av="#b5ffee",Ev="#00a17b",Rv="#fff296",Pv="#ffe04b",Iv="#ffc400",Lv="#b37600",Nv="#995c00",Bv="#804400",Fv="#fff296",zv="#ffe04b",Uv="#ffc2b3",Hv="#ff9877",Wv="#ff723c",$v="#f75008",Vv="#d13500",Yv="#a31f00",qv="#ffc2b3",jv="#ff9877",Gv="#ff723c",Kv="#f75008",Xv="#d13500",Zv="#a31f00",Qv="#ffc2b3",Jv="#ff9877",t1="#ff723c",e1="#f75008",n1="#d13500",i1="#a31f00",r1="#ffc2b3",s1="#ff9877",o1="#ff723c",a1="#f75008",l1="#d13500",c1="#a31f00",u1="#ffc2b3",d1="#ff9877",f1="#ff723c",h1="#f75008",p1="#d13500",g1="#ffabab",m1="#ff7272",y1="#ff3954",_1="#f50045",b1="#d60027",x1="#ad000e",w1="#ffabab",v1="#ff7272",S1="#ff3954",T1="#f50045",M1="#d60027",k1="#eefaff",D1="#ecfffb",C1="#fffce0",O1="#fff1ef",A1="#ffe5e5",E1="#5f9aff",R1="#00d6a4",P1="#ffc400",I1="#ff723c",L1="#ff3954",jh=6048e5,N1=864e5,Es=6e4,Br=36e5,B1=1e3,Gh=Symbol.for("constructDateFrom");function he(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Gh in n?n[Gh](t):n instanceof Date?new n.constructor(t):new Date(t)}function At(n,t){return he(t||n,n)}function ca(n,t,e){const i=At(n,e?.in);return isNaN(t)?he(e?.in||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function Cc(n,t,e){const i=At(n,e?.in);if(isNaN(t))return he(n,NaN);if(!t)return i;const r=i.getDate(),s=he(n,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function Oc(n,t,e){return he(n,+At(n)+t)}function F1(n,t,e){return Oc(n,t*Br)}let z1={};function ir(){return z1}function Wn(n,t){const e=ir(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=At(n,t?.in),s=r.getDay(),a=(s<i?7:0)+s-i;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function Fr(n,t){return Wn(n,{...t,weekStartsOn:1})}function Kh(n,t){const e=At(n,t?.in),i=e.getFullYear(),r=he(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Fr(r),a=he(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Fr(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function ua(n){const t=At(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function rr(n,...t){const e=he.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ac(n,t){const e=At(n,t?.in);return e.setHours(0,0,0,0),e}function Xh(n,t,e){const[i,r]=rr(e?.in,n,t),s=Ac(i),a=Ac(r),l=+s-ua(s),u=+a-ua(a);return Math.round((l-u)/N1)}function U1(n,t){const e=Kh(n,t),i=he(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Fr(i)}function H1(n,t,e){const i=At(n,e?.in);return i.setTime(i.getTime()+t*Es),i}function W1(n,t,e){return Cc(n,t*3,e)}function $1(n,t,e){return Oc(n,t*1e3)}function V1(n,t,e){return ca(n,t*7,e)}function Y1(n,t,e){return Cc(n,t*12,e)}function Rs(n,t){const e=+At(n)-+At(t);return e<0?-1:e>0?1:e}function q1(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Ec(n){return!(!q1(n)&&typeof n!="number"||isNaN(+At(n)))}function j1(n,t,e){const[i,r]=rr(e?.in,n,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function G1(n,t,e){const[i,r]=rr(e?.in,n,t);return i.getFullYear()-r.getFullYear()}function Zh(n,t,e){const[i,r]=rr(e?.in,n,t),s=Qh(i,r),a=Math.abs(Xh(i,r));i.setDate(i.getDate()-s*a);const l=+(Qh(i,r)===-s),u=s*(a-l);return u===0?0:u}function Qh(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Ps(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function K1(n,t,e){const[i,r]=rr(e?.in,n,t),s=(+i-+r)/Br;return Ps(e?.roundingMethod)(s)}function Rc(n,t){return+At(n)-+At(t)}function X1(n,t,e){const i=Rc(n,t)/Es;return Ps(e?.roundingMethod)(i)}function Jh(n,t){const e=At(n,t?.in);return e.setHours(23,59,59,999),e}function tp(n,t){const e=At(n,t?.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function Z1(n,t){const e=At(n,t?.in);return+Jh(e,t)==+tp(e,t)}function ep(n,t,e){const[i,r,s]=rr(e?.in,n,n,t),a=Rs(r,s),l=Math.abs(j1(r,s));if(l<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*l);let u=Rs(r,s)===-a;Z1(i)&&l===1&&Rs(i,s)===1&&(u=!1);const d=a*(l-+u);return d===0?0:d}function Q1(n,t,e){const i=ep(n,t,e)/3;return Ps(e?.roundingMethod)(i)}function J1(n,t,e){const i=Rc(n,t)/1e3;return Ps(e?.roundingMethod)(i)}function tS(n,t,e){const i=Zh(n,t,e)/7;return Ps(e?.roundingMethod)(i)}function eS(n,t,e){const[i,r]=rr(e?.in,n,t),s=Rs(i,r),a=Math.abs(G1(i,r));i.setFullYear(1584),r.setFullYear(1584);const l=Rs(i,r)===-s,u=s*(a-+l);return u===0?0:u}function nS(n,t){const e=At(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function iS(n,t){const e=At(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function rS(n,t){const e=At(n,t?.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function np(n,t){const e=At(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function sS(n,t){const e=At(n,t?.in);return e.setMinutes(59,59,999),e}function oS(n,t){const e=ir(),i=e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=At(n,t?.in),s=r.getDay(),a=(s<i?-7:0)+6-(s-i);return r.setDate(r.getDate()+a),r.setHours(23,59,59,999),r}function aS(n,t){const e=At(n,t?.in);return e.setSeconds(59,999),e}function lS(n,t){const e=At(n,t?.in),i=e.getMonth(),r=i-i%3+3;return e.setMonth(r,0),e.setHours(23,59,59,999),e}function cS(n,t){const e=At(n,t?.in);return e.setMilliseconds(999),e}const uS={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"}},dS=(n,t,e)=>{let i;const r=uS[n];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Pc(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const fS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},hS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},pS={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},gS={date:Pc({formats:fS,defaultWidth:"full"}),time:Pc({formats:hS,defaultWidth:"full"}),dateTime:Pc({formats:pS,defaultWidth:"full"})},mS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},yS=(n,t,e,i)=>mS[n];function Is(n){return(t,e)=>{const i=e?.context?String(e.context):"standalone";let r;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,l=e?.width?String(e.width):a;r=n.formattingValues[l]||n.formattingValues[a]}else{const a=n.defaultWidth,l=e?.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(t):t;return r[s]}}const _S={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},bS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},xS={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"]},wS={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"]},vS={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"}},SS={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"}},TS={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Is({values:_S,defaultWidth:"wide"}),quarter:Is({values:bS,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Is({values:xS,defaultWidth:"wide"}),day:Is({values:wS,defaultWidth:"wide"}),dayPeriod:Is({values:vS,defaultWidth:"wide",formattingValues:SS,defaultFormattingWidth:"wide"})};function Ls(n){return(t,e={})=>{const i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],l=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(l)?kS(l,g=>g.test(a)):MS(l,g=>g.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const f=t.slice(a.length);return{value:d,rest:f}}}function MS(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function kS(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function DS(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const r=i[0],s=t.match(n.parsePattern);if(!s)return null;let a=n.valueCallback?n.valueCallback(s[0]):s[0];a=e.valueCallback?e.valueCallback(a):a;const l=t.slice(r.length);return{value:a,rest:l}}}const CS=/^(\d+)(th|st|nd|rd)?/i,OS=/\d+/i,AS={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},ES={any:[/^b/i,/^(a|c)/i]},RS={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},PS={any:[/1/i,/2/i,/3/i,/4/i]},IS={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},LS={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]},NS={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},BS={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]},FS={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},zS={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}},US={ordinalNumber:DS({matchPattern:CS,parsePattern:OS,valueCallback:n=>parseInt(n,10)}),era:Ls({matchPatterns:AS,defaultMatchWidth:"wide",parsePatterns:ES,defaultParseWidth:"any"}),quarter:Ls({matchPatterns:RS,defaultMatchWidth:"wide",parsePatterns:PS,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Ls({matchPatterns:IS,defaultMatchWidth:"wide",parsePatterns:LS,defaultParseWidth:"any"}),day:Ls({matchPatterns:NS,defaultMatchWidth:"wide",parsePatterns:BS,defaultParseWidth:"any"}),dayPeriod:Ls({matchPatterns:FS,defaultMatchWidth:"any",parsePatterns:zS,defaultParseWidth:"any"})},ip={code:"en-US",formatDistance:dS,formatLong:gS,formatRelative:yS,localize:TS,match:US,options:{weekStartsOn:0,firstWeekContainsDate:1}};function HS(n,t){const e=At(n,t?.in);return Xh(e,np(e))+1}function rp(n,t){const e=At(n,t?.in),i=+Fr(e)-+U1(e);return Math.round(i/jh)+1}function Ic(n,t){const e=At(n,t?.in),i=e.getFullYear(),r=ir(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=he(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=Wn(a,t),u=he(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=Wn(u,t);return+e>=+l?i+1:+e>=+d?i:i-1}function WS(n,t){const e=ir(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=Ic(n,t),s=he(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Wn(s,t)}function sp(n,t){const e=At(n,t?.in),i=+Wn(e,t)-+WS(e,t);return Math.round(i/jh)+1}function Zt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Si={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Zt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Zt(e+1,2)},d(n,t){return Zt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Zt(n.getHours()%12||12,t.length)},H(n,t){return Zt(n.getHours(),t.length)},m(n,t){return Zt(n.getMinutes(),t.length)},s(n,t){return Zt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),r=Math.trunc(i*Math.pow(10,e-3));return Zt(r,t.length)}},zr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},op={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),r=i>0?i:1-i;return e.ordinalNumber(r,{unit:"year"})}return Si.y(n,t)},Y:function(n,t,e,i){const r=Ic(n,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Zt(a,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):Zt(s,t.length)},R:function(n,t){const e=Kh(n);return Zt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Zt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Zt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Zt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Si.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Zt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const r=sp(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Zt(r,t.length)},I:function(n,t,e){const i=rp(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Zt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Si.d(n,t)},D:function(n,t,e){const i=HS(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Zt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Zt(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Zt(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Zt(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const r=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let r;switch(i===12?r=zr.noon:i===0?r=zr.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let r;switch(i>=17?r=zr.evening:i>=12?r=zr.afternoon:i>=4?r=zr.morning:r=zr.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Si.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Si.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Si.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Si.s(n,t)},S:function(n,t){return Si.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return lp(i);case"XXXX":case"XX":return sr(i);default:return sr(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return lp(i);case"xxxx":case"xx":return sr(i);default:return sr(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ap(i,":");default:return"GMT"+sr(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ap(i,":");default:return"GMT"+sr(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Zt(i,t.length)},T:function(n,t,e){return Zt(+n,t.length)}};function ap(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.trunc(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Zt(s,2)}function lp(n,t){return n%60===0?(n>0?"-":"+")+Zt(Math.abs(n)/60,2):sr(n,t)}function sr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Zt(Math.trunc(i/60),2),s=Zt(i%60,2);return e+r+t+s}const cp=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},up=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Lc={p:up,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return cp(n,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",cp(i,t)).replace("{{time}}",up(r,t))}},$S=/^D+$/,VS=/^Y+$/,YS=["D","DD","YY","YYYY"];function dp(n){return $S.test(n)}function fp(n){return VS.test(n)}function Nc(n,t,e){const i=qS(n,t,e);if(console.warn(i),YS.includes(n))throw new RangeError(i)}function qS(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const jS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,GS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,KS=/^'([^]*?)'?$/,XS=/''/g,ZS=/[a-zA-Z]/;function da(n,t,e){const i=ir(),r=e?.locale??i.locale??ip,s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=At(n,e?.in);if(!Ec(l))throw new RangeError("Invalid time value");let u=t.match(GS).map(f=>{const g=f[0];if(g==="p"||g==="P"){const m=Lc[g];return m(f,r.formatLong)}return f}).join("").match(jS).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const g=f[0];if(g==="'")return{isToken:!1,value:QS(f)};if(op[g])return{isToken:!0,value:f};if(g.match(ZS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:f}});r.localize.preprocessor&&(u=r.localize.preprocessor(l,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(f=>{if(!f.isToken)return f.value;const g=f.value;(!e?.useAdditionalWeekYearTokens&&fp(g)||!e?.useAdditionalDayOfYearTokens&&dp(g))&&Nc(g,t,String(n));const m=op[g[0]];return m(l,g,r.localize,d)}).join("")}function QS(n){const t=n.match(KS);return t?t[1].replace(XS,"'"):n}function hp(){return Object.assign({},ir())}function JS(n,t){const e=At(n,t?.in).getDay();return e===0?7:e}function tT(n,t){const e=eT(t)?new t(0):he(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function eT(n){return typeof n=="function"&&n.prototype?.constructor===n}const nT=10;class pp{subPriority=0;validate(t,e){return!0}}class iT extends pp{constructor(t,e,i,r,s){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=r,s&&(this.subPriority=s)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class rT extends pp{priority=nT;subPriority=-1;constructor(t,e){super(),this.context=t||(i=>he(e,i))}set(t,e){return e.timestampIsSet?t:he(t,tT(t,this.context))}}class Wt{run(t,e,i,r){const s=this.parse(t,e,i,r);return s?{setter:new iT(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,e,i){return!0}}class sT extends Wt{priority=140;parse(t,e,i){switch(e){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,e,i){return e.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const me={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}/},$n={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 ye(n,t){return n&&{value:t(n.value),rest:n.rest}}function de(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Vn(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,r=e[2]?parseInt(e[2],10):0,s=e[3]?parseInt(e[3],10):0,a=e[5]?parseInt(e[5],10):0;return{value:i*(r*Br+s*Es+a*B1),rest:t.slice(e[0].length)}}function gp(n){return de(me.anyDigitsSigned,n)}function pe(n,t){switch(n){case 1:return de(me.singleDigit,t);case 2:return de(me.twoDigits,t);case 3:return de(me.threeDigits,t);case 4:return de(me.fourDigits,t);default:return de(new RegExp("^\\d{1,"+n+"}"),t)}}function fa(n,t){switch(n){case 1:return de(me.singleDigitSigned,t);case 2:return de(me.twoDigitsSigned,t);case 3:return de(me.threeDigitsSigned,t);case 4:return de(me.fourDigitsSigned,t);default:return de(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Bc(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function mp(n,t){const e=t>0,i=e?t:1-t;let r;if(i<=50)r=n||100;else{const s=i+50,a=Math.trunc(s/100)*100,l=n>=s%100;r=n+a-(l?100:0)}return e?r:1-r}function yp(n){return n%400===0||n%4===0&&n%100!==0}class oT extends Wt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="yy"});switch(e){case"y":return ye(pe(4,t),r);case"yo":return ye(i.ordinalNumber(t,{unit:"year"}),r);default:return ye(pe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i){const r=t.getFullYear();if(i.isTwoDigitYear){const a=mp(i.year,r);return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}const s=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class aT extends Wt{priority=130;parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="YY"});switch(e){case"Y":return ye(pe(4,t),r);case"Yo":return ye(i.ordinalNumber(t,{unit:"year"}),r);default:return ye(pe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i,r){const s=Ic(t,r);if(i.isTwoDigitYear){const l=mp(i.year,s);return t.setFullYear(l,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Wn(t,r)}const a=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(a,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Wn(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class lT extends Wt{priority=130;parse(t,e){return fa(e==="R"?4:e.length,t)}set(t,e,i){const r=he(t,0);return r.setFullYear(i,0,4),r.setHours(0,0,0,0),Fr(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class cT extends Wt{priority=130;parse(t,e){return fa(e==="u"?4:e.length,t)}set(t,e,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 uT extends Wt{priority=120;parse(t,e,i){switch(e){case"Q":case"QQ":return pe(e.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,e){return e>=1&&e<=4}set(t,e,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 dT extends Wt{priority=120;parse(t,e,i){switch(e){case"q":case"qq":return pe(e.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,e){return e>=1&&e<=4}set(t,e,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 fT extends Wt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"M":return ye(de(me.month,t),r);case"MM":return ye(pe(2,t),r);case"Mo":return ye(i.ordinalNumber(t,{unit:"month"}),r);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,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}}class hT extends Wt{priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"L":return ye(de(me.month,t),r);case"LL":return ye(pe(2,t),r);case"Lo":return ye(i.ordinalNumber(t,{unit:"month"}),r);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,e){return e>=0&&e<=11}set(t,e,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 pT(n,t,e){const i=At(n,e?.in),r=sp(i,e)-t;return i.setDate(i.getDate()-r*7),At(i,e?.in)}class gT extends Wt{priority=100;parse(t,e,i){switch(e){case"w":return de(me.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i,r){return Wn(pT(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function mT(n,t,e){const i=At(n,e?.in),r=rp(i,e)-t;return i.setDate(i.getDate()-r*7),i}class yT extends Wt{priority=100;parse(t,e,i){switch(e){case"I":return de(me.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i){return Fr(mT(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const _T=[31,28,31,30,31,30,31,31,30,31,30,31],bT=[31,29,31,30,31,30,31,31,30,31,30,31];class xT extends Wt{priority=90;subPriority=1;parse(t,e,i){switch(e){case"d":return de(me.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const i=t.getFullYear(),r=yp(i),s=t.getMonth();return r?e>=1&&e<=bT[s]:e>=1&&e<=_T[s]}set(t,e,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 wT extends Wt{priority=90;subpriority=1;parse(t,e,i){switch(e){case"D":case"DD":return de(me.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const i=t.getFullYear();return yp(i)?e>=1&&e<=366:e>=1&&e<=365}set(t,e,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 Fc(n,t,e){const i=ir(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=At(n,e?.in),a=s.getDay(),u=(t%7+7)%7,d=7-r,f=t<0||t>6?t-(a+d)%7:(u+d)%7-(a+d)%7;return ca(s,f,e)}class vT extends Wt{priority=90;parse(t,e,i){switch(e){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,e){return e>=0&&e<=6}set(t,e,i,r){return t=Fc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class ST extends Wt{priority=90;parse(t,e,i,r){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(e){case"e":case"ee":return ye(pe(e.length,t),s);case"eo":return ye(i.ordinalNumber(t,{unit:"day"}),s);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,e){return e>=0&&e<=6}set(t,e,i,r){return t=Fc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class TT extends Wt{priority=90;parse(t,e,i,r){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(e){case"c":case"cc":return ye(pe(e.length,t),s);case"co":return ye(i.ordinalNumber(t,{unit:"day"}),s);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,e){return e>=0&&e<=6}set(t,e,i,r){return t=Fc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function MT(n,t,e){const i=At(n,e?.in),r=JS(i,e),s=t-r;return ca(i,s,e)}class kT extends Wt{priority=90;parse(t,e,i){const r=s=>s===0?7:s;switch(e){case"i":case"ii":return pe(e.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return ye(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return ye(i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return ye(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);default:return ye(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"}),r)}}validate(t,e){return e>=1&&e<=7}set(t,e,i){return t=MT(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 DT extends Wt{priority=80;parse(t,e,i){switch(e){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,e,i){return t.setHours(Bc(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class CT extends Wt{priority=80;parse(t,e,i){switch(e){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,e,i){return t.setHours(Bc(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class OT extends Wt{priority=80;parse(t,e,i){switch(e){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,e,i){return t.setHours(Bc(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class AT extends Wt{priority=70;parse(t,e,i){switch(e){case"h":return de(me.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,i){const r=t.getHours()>=12;return r&&i<12?t.setHours(i+12,0,0,0):!r&&i===12?t.setHours(0,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class ET extends Wt{priority=70;parse(t,e,i){switch(e){case"H":return de(me.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class RT extends Wt{priority=70;parse(t,e,i){switch(e){case"K":return de(me.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,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 PT extends Wt{priority=70;parse(t,e,i){switch(e){case"k":return de(me.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,i){const r=i<=24?i%24:i;return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class IT extends Wt{priority=60;parse(t,e,i){switch(e){case"m":return de(me.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]}class LT extends Wt{priority=50;parse(t,e,i){switch(e){case"s":return de(me.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]}class NT extends Wt{priority=30;parse(t,e){const i=r=>Math.trunc(r*Math.pow(10,-e.length+3));return ye(pe(e.length,t),i)}set(t,e,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class BT extends Wt{priority=10;parse(t,e){switch(e){case"X":return Vn($n.basicOptionalMinutes,t);case"XX":return Vn($n.basic,t);case"XXXX":return Vn($n.basicOptionalSeconds,t);case"XXXXX":return Vn($n.extendedOptionalSeconds,t);default:return Vn($n.extended,t)}}set(t,e,i){return e.timestampIsSet?t:he(t,t.getTime()-ua(t)-i)}incompatibleTokens=["t","T","x"]}class FT extends Wt{priority=10;parse(t,e){switch(e){case"x":return Vn($n.basicOptionalMinutes,t);case"xx":return Vn($n.basic,t);case"xxxx":return Vn($n.basicOptionalSeconds,t);case"xxxxx":return Vn($n.extendedOptionalSeconds,t);default:return Vn($n.extended,t)}}set(t,e,i){return e.timestampIsSet?t:he(t,t.getTime()-ua(t)-i)}incompatibleTokens=["t","T","X"]}class zT extends Wt{priority=40;parse(t){return gp(t)}set(t,e,i){return[he(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class UT extends Wt{priority=20;parse(t){return gp(t)}set(t,e,i){return[he(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const HT={G:new sT,y:new oT,Y:new aT,R:new lT,u:new cT,Q:new uT,q:new dT,M:new fT,L:new hT,w:new gT,I:new yT,d:new xT,D:new wT,E:new vT,e:new ST,c:new TT,i:new kT,a:new DT,b:new CT,B:new OT,h:new AT,H:new ET,K:new RT,k:new PT,m:new IT,s:new LT,S:new NT,X:new BT,x:new FT,t:new zT,T:new UT},WT=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$T=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,VT=/^'([^]*?)'?$/,YT=/''/g,qT=/\S/,jT=/[a-zA-Z]/;function GT(n,t,e,i){const r=()=>he(i?.in||e,NaN),s=hp(),a=i?.locale??s.locale??ip,l=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,u=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0;if(!t)return n?r():At(e,i?.in);const d={firstWeekContainsDate:l,weekStartsOn:u,locale:a},f=[new rT(i?.in,e)],g=t.match($T).map(T=>{const C=T[0];if(C in Lc){const A=Lc[C];return A(T,a.formatLong)}return T}).join("").match(WT),m=[];for(let T of g){!i?.useAdditionalWeekYearTokens&&fp(T)&&Nc(T,t,n),!i?.useAdditionalDayOfYearTokens&&dp(T)&&Nc(T,t,n);const C=T[0],A=HT[C];if(A){const{incompatibleTokens:F}=A;if(Array.isArray(F)){const I=m.find(L=>F.includes(L.token)||L.token===C);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${T}\` at the same time`)}else if(A.incompatibleTokens==="*"&&m.length>0)throw new RangeError(`The format string mustn't contain \`${T}\` and any other token at the same time`);m.push({token:C,fullToken:T});const P=A.run(n,T,a.match,d);if(!P)return r();f.push(P.setter),n=P.rest}else{if(C.match(jT))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");if(T==="''"?T="'":C==="'"&&(T=KT(T)),n.indexOf(T)===0)n=n.slice(T.length);else return r()}}if(n.length>0&&qT.test(n))return r();const _=f.map(T=>T.priority).sort((T,C)=>C-T).filter((T,C,A)=>A.indexOf(T)===C).map(T=>f.filter(C=>C.priority===T).sort((C,A)=>A.subPriority-C.subPriority)).map(T=>T[0]);let x=At(e,i?.in);if(isNaN(+x))return r();const S={};for(const T of _){if(!T.validate(x,d))return r();const C=T.set(x,S,d);Array.isArray(C)?(x=C[0],Object.assign(S,C[1])):x=C}return x}function KT(n){return n.match(VT)[1].replace(YT,"'")}function XT(n,t){const e=At(n,t?.in);return e.setMinutes(0,0,0),e}function ZT(n,t){const e=At(n,t?.in);return e.setSeconds(0,0),e}function QT(n,t){const e=At(n,t?.in);return e.setMilliseconds(0),e}function _p(n){const t=n/Br;return Math.trunc(t)}function bp(n,t){const e=()=>he(t?.in,NaN),i=t?.additionalDigits??2,r=nM(n);let s;if(r.date){const d=iM(r.date,i);s=rM(d.restDateString,d.year)}if(!s||isNaN(+s))return e();const a=+s;let l=0,u;if(r.time&&(l=sM(r.time),isNaN(l)))return e();if(r.timezone){if(u=oM(r.timezone),isNaN(u))return e()}else{const d=new Date(a+l),f=At(0,t?.in);return f.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),f.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),f}return At(a+l+u,t?.in)}const ha={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},JT=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,tM=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,eM=/^([+-])(\d{2})(?::?(\d{2}))?$/;function nM(n){const t={},e=n.split(ha.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],ha.timeZoneDelimiter.test(t.date)&&(t.date=n.split(ha.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const r=ha.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function iM(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const r=i[1]?parseInt(i[1]):null,s=i[2]?parseInt(i[2]):null;return{year:s===null?r:s*100,restDateString:n.slice((i[1]||i[2]).length)}}function rM(n,t){if(t===null)return new Date(NaN);const e=n.match(JT);if(!e)return new Date(NaN);const i=!!e[4],r=Ns(e[1]),s=Ns(e[2])-1,a=Ns(e[3]),l=Ns(e[4]),u=Ns(e[5])-1;if(i)return dM(t,l,u)?aM(t,l,u):new Date(NaN);{const d=new Date(0);return!cM(t,s,a)||!uM(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function Ns(n){return n?parseInt(n):1}function sM(n){const t=n.match(tM);if(!t)return NaN;const e=zc(t[1]),i=zc(t[2]),r=zc(t[3]);return fM(e,i,r)?e*Br+i*Es+r*1e3:NaN}function zc(n){return n&&parseFloat(n.replace(",","."))||0}function oM(n){if(n==="Z")return 0;const t=n.match(eM);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return hM(i,r)?e*(i*Br+r*Es):NaN}function aM(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=(t-1)*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const lM=[31,null,31,30,31,30,31,31,30,31,30,31];function xp(n){return n%400===0||n%4===0&&n%100!==0}function cM(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(lM[t]||(xp(n)?29:28))}function uM(n,t){return t>=1&&t<=(xp(n)?366:365)}function dM(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function fM(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function hM(n,t){return t>=0&&t<=59}const wp={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"},csvExport:{dataError:"Error loading data",noDataRange:"No data in selected range",noDataRetry:"Please adjust the time period and try again",timeRangeSelected:"selected",exportPreview:"Export preview",exportAsCsv:"Export as CSV",exportTimeRange:"Time range",exportDescription:"Exports a CSV of the data represented in the chart.",maximumRecordAmount:"The number of groups is limited to {value}",previewRows:"Previewing {rowsMax} of {rowsTotal} row{plural}",downloadButton:"Export",cancelButton:"Cancel",UtcOffset:"UTC offset",Timestamp:"Timestamp"},query_errors:{forbidden:{message:"Data request forbidden",details:"To access this data, either filter for an entity you have access to or request analytics viewer access from your administrator."},time_range_exceeded:{message:"Time range exceeded",details:"The time range for this report is outside of your organization's data retention period"},timeout:{message:"Data request timed out",details:"We're sorry, the request timed out. Please consider using a shorter time period or try again later."},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_data_plane_node:"AI gateway data plane node",ai_gateway_mcp_server:"AI gateway MCP server",ai_gateway_model:"AI gateway model",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",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:"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)","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)",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)"}},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 pM(){const n=Xf.createI18n("en-us",wp);return{i18n:n,i18nT:Xf.i18nTComponent(n)}}function Bs(n){return n+.5|0}const Ti=(n,t,e)=>Math.max(Math.min(n,e),t);function Fs(n){return Ti(Bs(n*2.55),0,255)}function Mi(n){return Ti(Bs(n*255),0,255)}function ei(n){return Ti(Bs(n/2.55)/100,0,1)}function vp(n){return Ti(Bs(n*100),0,100)}const Mn={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},Uc=[..."0123456789ABCDEF"],gM=n=>Uc[n&15],mM=n=>Uc[(n&240)>>4]+Uc[n&15],pa=n=>(n&240)>>4===(n&15),yM=n=>pa(n.r)&&pa(n.g)&&pa(n.b)&&pa(n.a);function _M(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&Mn[n[1]]*17,g:255&Mn[n[2]]*17,b:255&Mn[n[3]]*17,a:t===5?Mn[n[4]]*17:255}:(t===7||t===9)&&(e={r:Mn[n[1]]<<4|Mn[n[2]],g:Mn[n[3]]<<4|Mn[n[4]],b:Mn[n[5]]<<4|Mn[n[6]],a:t===9?Mn[n[7]]<<4|Mn[n[8]]:255})),e}const bM=(n,t)=>n<255?t(n):"";function xM(n){var t=yM(n)?gM:mM;return n?"#"+t(n.r)+t(n.g)+t(n.b)+bM(n.a,t):void 0}const wM=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Sp(n,t,e){const i=t*Math.min(e,1-e),r=(s,a=(s+n/30)%12)=>e-i*Math.max(Math.min(a-3,9-a,1),-1);return[r(0),r(8),r(4)]}function vM(n,t,e){const i=(r,s=(r+n/60)%6)=>e-e*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function SM(n,t,e){const i=Sp(n,1,.5);let r;for(t+e>1&&(r=1/(t+e),t*=r,e*=r),r=0;r<3;r++)i[r]*=1-t-e,i[r]+=t;return i}function TM(n,t,e,i,r){return n===r?(t-e)/i+(t<e?6:0):t===r?(e-n)/i+2:(n-t)/i+4}function Hc(n){const e=n.r/255,i=n.g/255,r=n.b/255,s=Math.max(e,i,r),a=Math.min(e,i,r),l=(s+a)/2;let u,d,f;return s!==a&&(f=s-a,d=l>.5?f/(2-s-a):f/(s+a),u=TM(e,i,r,f,s),u=u*60+.5),[u|0,d||0,l]}function Wc(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(Mi)}function $c(n,t,e){return Wc(Sp,n,t,e)}function MM(n,t,e){return Wc(SM,n,t,e)}function kM(n,t,e){return Wc(vM,n,t,e)}function Tp(n){return(n%360+360)%360}function DM(n){const t=wM.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Fs(+t[5]):Mi(+t[5]));const r=Tp(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=MM(r,s,a):t[1]==="hsv"?i=kM(r,s,a):i=$c(r,s,a),{r:i[0],g:i[1],b:i[2],a:e}}function CM(n,t){var e=Hc(n);e[0]=Tp(e[0]+t),e=$c(e),n.r=e[0],n.g=e[1],n.b=e[2]}function OM(n){if(!n)return;const t=Hc(n),e=t[0],i=vp(t[1]),r=vp(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${r}%, ${ei(n.a)})`:`hsl(${e}, ${i}%, ${r}%)`}const Mp={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"},kp={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 AM(){const n={},t=Object.keys(kp),e=Object.keys(Mp);let i,r,s,a,l;for(i=0;i<t.length;i++){for(a=l=t[i],r=0;r<e.length;r++)s=e[r],l=l.replace(s,Mp[s]);s=parseInt(kp[a],16),n[l]=[s>>16&255,s>>8&255,s&255]}return n}let ga;function EM(n){ga||(ga=AM(),ga.transparent=[0,0,0,0]);const t=ga[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const RM=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function PM(n){const t=RM.exec(n);let e=255,i,r,s;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?Fs(a):Ti(a*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?Fs(i):Ti(i,0,255)),r=255&(t[4]?Fs(r):Ti(r,0,255)),s=255&(t[6]?Fs(s):Ti(s,0,255)),{r:i,g:r,b:s,a:e}}}function IM(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ei(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Vc=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Ur=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function LM(n,t,e){const i=Ur(ei(n.r)),r=Ur(ei(n.g)),s=Ur(ei(n.b));return{r:Mi(Vc(i+e*(Ur(ei(t.r))-i))),g:Mi(Vc(r+e*(Ur(ei(t.g))-r))),b:Mi(Vc(s+e*(Ur(ei(t.b))-s))),a:n.a+e*(t.a-n.a)}}function ma(n,t,e){if(n){let i=Hc(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=$c(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Dp(n,t){return n&&Object.assign(t||{},n)}function Cp(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=Mi(n[3]))):(t=Dp(n,{r:0,g:0,b:0,a:1}),t.a=Mi(t.a)),t}function NM(n){return n.charAt(0)==="r"?PM(n):DM(n)}class zs{constructor(t){if(t instanceof zs)return t;const e=typeof t;let i;e==="object"?i=Cp(t):e==="string"&&(i=_M(t)||EM(t)||NM(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Dp(this._rgb);return t&&(t.a=ei(t.a)),t}set rgb(t){this._rgb=Cp(t)}rgbString(){return this._valid?IM(this._rgb):void 0}hexString(){return this._valid?xM(this._rgb):void 0}hslString(){return this._valid?OM(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,r=t.rgb;let s;const a=e===s?.5:e,l=2*a-1,u=i.a-r.a,d=((l*u===-1?l:(l+u)/(1+l*u))+1)/2;s=1-d,i.r=255&d*i.r+s*r.r+.5,i.g=255&d*i.g+s*r.g+.5,i.b=255&d*i.b+s*r.b+.5,i.a=a*i.a+(1-a)*r.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=LM(this._rgb,t._rgb,e)),this}clone(){return new zs(this.rgb)}alpha(t){return this._rgb.a=Mi(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Bs(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ma(this._rgb,2,t),this}darken(t){return ma(this._rgb,2,-t),this}saturate(t){return ma(this._rgb,1,t),this}desaturate(t){return ma(this._rgb,1,-t),this}rotate(t){return CM(this._rgb,t),this}}function ni(){}const BM=(()=>{let n=0;return()=>n++})();function xt(n){return n==null}function qt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Pt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function ae(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function pn(n,t){return ae(n)?n:t}function kt(n,t){return typeof n>"u"?t:n}const FM=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Op=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function Qt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Jt(n,t,e,i){let r,s,a;if(qt(n))for(s=n.length,r=0;r<s;r++)t.call(e,n[r],r);else if(Pt(n))for(a=Object.keys(n),s=a.length,r=0;r<s;r++)t.call(e,n[a[r]],a[r])}function ya(n,t){let e,i,r,s;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(r=n[e],s=t[e],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function _a(n){if(qt(n))return n.map(_a);if(Pt(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let r=0;for(;r<i;++r)t[e[r]]=_a(n[e[r]]);return t}return n}function Ap(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function zM(n,t,e,i){if(!Ap(n))return;const r=t[n],s=e[n];Pt(r)&&Pt(s)?Us(r,s,i):t[n]=_a(s)}function Us(n,t,e){const i=qt(t)?t:[t],r=i.length;if(!Pt(n))return n;e=e||{};const s=e.merger||zM;let a;for(let l=0;l<r;++l){if(a=i[l],!Pt(a))continue;const u=Object.keys(a);for(let d=0,f=u.length;d<f;++d)s(u[d],n,a,e)}return n}function Hs(n,t){return Us(n,t,{merger:UM})}function UM(n,t,e){if(!Ap(n))return;const i=t[n],r=e[n];Pt(i)&&Pt(r)?Hs(i,r):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=_a(r))}const Ep={"":n=>n,x:n=>n.x,y:n=>n.y};function HM(n){const t=n.split("."),e=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function WM(n){const t=HM(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function ki(n,t){return(Ep[t]||(Ep[t]=WM(t)))(n)}function Yc(n){return n.charAt(0).toUpperCase()+n.slice(1)}const en=n=>typeof n<"u",nn=n=>typeof n=="function",Rp=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function $M(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Et=Math.PI,te=2*Et,VM=te+Et,ba=Number.POSITIVE_INFINITY,qc=Et/180,re=Et/2,kn=Et/4,xa=Et*2/3,Di=Math.log10,Yn=Math.sign;function Ws(n,t,e){return Math.abs(n-t)<e}function Pp(n){const t=Math.round(n);n=Ws(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(Di(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function YM(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((r,s)=>r-s).pop(),t}function qM(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function Ci(n){return!qM(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function jM(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Ip(n,t,e){let i,r,s;for(i=0,r=n.length;i<r;i++)s=n[i][e],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function xe(n){return n*(Et/180)}function wa(n){return n*(180/Et)}function Lp(n){if(!ae(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function va(n,t){const e=t.x-n.x,i=t.y-n.y,r=Math.sqrt(e*e+i*i);let s=Math.atan2(i,e);return s<-.5*Et&&(s+=te),{angle:s,distance:r}}function Hr(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function GM(n,t){return(n-t+VM)%te-Et}function Ue(n){return(n%te+te)%te}function $s(n,t,e,i){const r=Ue(n),s=Ue(t),a=Ue(e),l=Ue(s-r),u=Ue(a-r),d=Ue(r-s),f=Ue(r-a);return r===s||r===a||i&&s===a||l>u&&d<f}function Ce(n,t,e){return Math.max(t,Math.min(e,n))}function KM(n){return Ce(n,-32768,32767)}function ii(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function jc(n,t,e){e=e||(a=>n[a]<t);let i=n.length-1,r=0,s;for(;i-r>1;)s=r+i>>1,e(s)?r=s:i=s;return{lo:r,hi:i}}const ri=(n,t,e,i)=>jc(n,e,i?r=>{const s=n[r][t];return s<e||s===e&&n[r+1][t]===e}:r=>n[r][t]<e),XM=(n,t,e)=>jc(n,e,i=>n[i][t]>=e);function ZM(n,t,e){let i=0,r=n.length;for(;i<r&&n[i]<t;)i++;for(;r>i&&n[r-1]>e;)r--;return i>0||r<n.length?n.slice(i,r):n}const Np=["push","pop","shift","splice","unshift"];function QM(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Np.forEach(e=>{const i="_onData"+Yc(e),r=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...s){const a=r.apply(this,s);return n._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...s)}),a}})})}function Bp(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(Np.forEach(s=>{delete n[s]}),delete n._chartjs)}function Fp(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const zp=(function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame})();function Up(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,zp.call(window,()=>{i=!1,n.apply(t,e)}))}}function JM(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Gc=n=>n==="start"?"left":n==="end"?"right":"center",He=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,tk=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Hp(n,t,e){const i=t.length;let r=0,s=i;if(n._sorted){const{iScale:a,vScale:l,_parsed:u}=n,d=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,f=a.axis,{min:g,max:m,minDefined:_,maxDefined:x}=a.getUserBounds();if(_){if(r=Math.min(ri(u,f,g).lo,e?i:ri(t,f,a.getPixelForValue(g)).lo),d){const S=u.slice(0,r+1).reverse().findIndex(T=>!xt(T[l.axis]));r-=Math.max(0,S)}r=Ce(r,0,i-1)}if(x){let S=Math.max(ri(u,a.axis,m,!0).hi+1,e?0:ri(t,f,a.getPixelForValue(m),!0).hi+1);if(d){const T=u.slice(S-1).findIndex(C=>!xt(C[l.axis]));S+=Math.max(0,T)}s=Ce(S,r,i)-r}else s=i-r}return{start:r,count:s}}function Wp(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,r={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=r,!0;const s=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,r),s}const Sa=n=>n===0||n===1,$p=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*te/e)),Vp=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*te/e)+1,Vs={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*re)+1,easeOutSine:n=>Math.sin(n*re),easeInOutSine:n=>-.5*(Math.cos(Et*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Sa(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Sa(n)?n:$p(n,.075,.3),easeOutElastic:n=>Sa(n)?n:Vp(n,.075,.3),easeInOutElastic(n){return Sa(n)?n:n<.5?.5*$p(n*2,.1125,.45):.5+.5*Vp(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Vs.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Vs.easeInBounce(n*2)*.5:Vs.easeOutBounce(n*2-1)*.5+.5};function Kc(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ta(n){return Kc(n)?n:new zs(n)}function Xc(n){return Kc(n)?n:new zs(n).saturate(.5).darken(.1).hexString()}const ek=["x","y","borderWidth","radius","tension"],nk=["color","borderColor","backgroundColor"];function ik(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:nk},numbers:{type:"number",properties:ek}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function rk(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Yp=new Map;function sk(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Yp.get(e);return i||(i=new Intl.NumberFormat(n,t),Yp.set(e,i)),i}function Ys(n,t,e){return sk(t,e).format(n)}const qp={values(n){return qt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let r,s=n;if(e.length>1){const d=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(d<1e-4||d>1e15)&&(r="scientific"),s=ok(n,e)}const a=Di(Math.abs(s)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),u={notation:r,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(u,this.options.ticks.format),Ys(n,i,u)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(Di(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?qp.numeric.call(this,n,t,e):""}};function ok(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var Ma={formatters:qp};function ak(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ma.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const or=Object.create(null),Zc=Object.create(null);function qs(n,t){if(!t)return n;const e=t.split(".");for(let i=0,r=e.length;i<r;++i){const s=e[i];n=n[s]||(n[s]=Object.create(null))}return n}function Qc(n,t,e){return typeof t=="string"?Us(qs(n,t),e):Us(qs(n,""),t)}class lk{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>Xc(r.backgroundColor),this.hoverBorderColor=(i,r)=>Xc(r.borderColor),this.hoverColor=(i,r)=>Xc(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Qc(this,t,e)}get(t){return qs(this,t)}describe(t,e){return Qc(Zc,t,e)}override(t,e){return Qc(or,t,e)}route(t,e,i,r){const s=qs(this,t),a=qs(this,i),l="_"+e;Object.defineProperties(s,{[l]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const u=this[l],d=a[r];return Pt(u)?Object.assign({},d,u):kt(u,d)},set(u){this[l]=u}}})}apply(t){t.forEach(e=>e(this))}}var se=new lk({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[ik,rk,ak]);function ck(n){return!n||xt(n.size)||xt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ka(n,t,e,i,r){let s=t[r];return s||(s=t[r]=n.measureText(r).width,e.push(r)),s>i&&(i=s),i}function uk(n,t,e,i){i=i||{};let r=i.data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},s=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let a=0;const l=e.length;let u,d,f,g,m;for(u=0;u<l;u++)if(g=e[u],g!=null&&!qt(g))a=ka(n,r,s,a,g);else if(qt(g))for(d=0,f=g.length;d<f;d++)m=g[d],m!=null&&!qt(m)&&(a=ka(n,r,s,a,m));n.restore();const _=s.length/2;if(_>e.length){for(u=0;u<_;u++)delete r[s[u]];s.splice(0,_)}return a}function ar(n,t,e){const i=n.currentDevicePixelRatio,r=e!==0?Math.max(e/2,.5):0;return Math.round((t-r)*i)/i+r}function jp(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Jc(n,t,e,i){Gp(n,t,e,i,null)}function Gp(n,t,e,i,r){let s,a,l,u,d,f,g,m;const _=t.pointStyle,x=t.rotation,S=t.radius;let T=(x||0)*qc;if(_&&typeof _=="object"&&(s=_.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(T),n.drawImage(_,-_.width/2,-_.height/2,_.width,_.height),n.restore();return}if(!(isNaN(S)||S<=0)){switch(n.beginPath(),_){default:r?n.ellipse(e,i,r/2,S,0,0,te):n.arc(e,i,S,0,te),n.closePath();break;case"triangle":f=r?r/2:S,n.moveTo(e+Math.sin(T)*f,i-Math.cos(T)*S),T+=xa,n.lineTo(e+Math.sin(T)*f,i-Math.cos(T)*S),T+=xa,n.lineTo(e+Math.sin(T)*f,i-Math.cos(T)*S),n.closePath();break;case"rectRounded":d=S*.516,u=S-d,a=Math.cos(T+kn)*u,g=Math.cos(T+kn)*(r?r/2-d:u),l=Math.sin(T+kn)*u,m=Math.sin(T+kn)*(r?r/2-d:u),n.arc(e-g,i-l,d,T-Et,T-re),n.arc(e+m,i-a,d,T-re,T),n.arc(e+g,i+l,d,T,T+re),n.arc(e-m,i+a,d,T+re,T+Et),n.closePath();break;case"rect":if(!x){u=Math.SQRT1_2*S,f=r?r/2:u,n.rect(e-f,i-u,2*f,2*u);break}T+=kn;case"rectRot":g=Math.cos(T)*(r?r/2:S),a=Math.cos(T)*S,l=Math.sin(T)*S,m=Math.sin(T)*(r?r/2:S),n.moveTo(e-g,i-l),n.lineTo(e+m,i-a),n.lineTo(e+g,i+l),n.lineTo(e-m,i+a),n.closePath();break;case"crossRot":T+=kn;case"cross":g=Math.cos(T)*(r?r/2:S),a=Math.cos(T)*S,l=Math.sin(T)*S,m=Math.sin(T)*(r?r/2:S),n.moveTo(e-g,i-l),n.lineTo(e+g,i+l),n.moveTo(e+m,i-a),n.lineTo(e-m,i+a);break;case"star":g=Math.cos(T)*(r?r/2:S),a=Math.cos(T)*S,l=Math.sin(T)*S,m=Math.sin(T)*(r?r/2:S),n.moveTo(e-g,i-l),n.lineTo(e+g,i+l),n.moveTo(e+m,i-a),n.lineTo(e-m,i+a),T+=kn,g=Math.cos(T)*(r?r/2:S),a=Math.cos(T)*S,l=Math.sin(T)*S,m=Math.sin(T)*(r?r/2:S),n.moveTo(e-g,i-l),n.lineTo(e+g,i+l),n.moveTo(e+m,i-a),n.lineTo(e-m,i+a);break;case"line":a=r?r/2:Math.cos(T)*S,l=Math.sin(T)*S,n.moveTo(e-a,i-l),n.lineTo(e+a,i+l);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(T)*(r?r/2:S),i+Math.sin(T)*S);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function si(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function js(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Gs(n){n.restore()}function dk(n,t,e,i,r){if(!t)return n.lineTo(e.x,e.y);if(r==="middle"){const s=(t.x+e.x)/2;n.lineTo(s,t.y),n.lineTo(s,e.y)}else r==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function fk(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function hk(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),xt(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function pk(n,t,e,i,r){if(r.strikethrough||r.underline){const s=n.measureText(i),a=t-s.actualBoundingBoxLeft,l=t+s.actualBoundingBoxRight,u=e-s.actualBoundingBoxAscent,d=e+s.actualBoundingBoxDescent,f=r.strikethrough?(u+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=r.decorationWidth||2,n.moveTo(a,f),n.lineTo(l,f),n.stroke()}}function gk(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function lr(n,t,e,i,r,s={}){const a=qt(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!=="";let u,d;for(n.save(),n.font=r.string,hk(n,s),u=0;u<a.length;++u)d=a[u],s.backdrop&&gk(n,s.backdrop),l&&(s.strokeColor&&(n.strokeStyle=s.strokeColor),xt(s.strokeWidth)||(n.lineWidth=s.strokeWidth),n.strokeText(d,e,i,s.maxWidth)),n.fillText(d,e,i,s.maxWidth),pk(n,e,i,d,s),i+=Number(r.lineHeight);n.restore()}function Wr(n,t){const{x:e,y:i,w:r,h:s,radius:a}=t;n.arc(e+a.topLeft,i+a.topLeft,a.topLeft,1.5*Et,Et,!0),n.lineTo(e,i+s-a.bottomLeft),n.arc(e+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,Et,re,!0),n.lineTo(e+r-a.bottomRight,i+s),n.arc(e+r-a.bottomRight,i+s-a.bottomRight,a.bottomRight,re,0,!0),n.lineTo(e+r,i+a.topRight),n.arc(e+r-a.topRight,i+a.topRight,a.topRight,0,-re,!0),n.lineTo(e+a.topLeft,i)}const mk=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,yk=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function _k(n,t){const e=(""+n).match(mk);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const bk=n=>+n||0;function tu(n,t){const e={},i=Pt(t),r=i?Object.keys(t):t,s=Pt(n)?i?a=>kt(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of r)e[a]=bk(s(a));return e}function Kp(n){return tu(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Oi(n){return tu(n,["topLeft","topRight","bottomLeft","bottomRight"])}function we(n){const t=Kp(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function le(n,t){n=n||{},t=t||se.font;let e=kt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=kt(n.style,t.style);i&&!(""+i).match(yk)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:kt(n.family,t.family),lineHeight:_k(kt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:kt(n.weight,t.weight),string:""};return r.string=ck(r),r}function Ks(n,t,e,i){let r,s,a;for(r=0,s=n.length;r<s;++r)if(a=n[r],a!==void 0&&a!==void 0)return a}function xk(n,t,e){const{min:i,max:r}=n,s=Op(t,(r-i)/2),a=(l,u)=>e&&l===0?0:l+u;return{min:a(i,-Math.abs(s)),max:a(r,s)}}function Ai(n,t){return Object.assign(Object.create(n),t)}function eu(n,t=[""],e,i,r=()=>n[0]){const s=e||n;typeof i>"u"&&(i=tg("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>eu([l,...n],t,s,i)};return new Proxy(a,{deleteProperty(l,u){return delete l[u],delete l._keys,delete n[0][u],!0},get(l,u){return Zp(l,u,()=>Ck(u,t,n,l))},getOwnPropertyDescriptor(l,u){return Reflect.getOwnPropertyDescriptor(l._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,u){return eg(l).includes(u)},ownKeys(l){return eg(l)},set(l,u,d){const f=l._storage||(l._storage=r());return l[u]=f[u]=d,delete l._keys,!0}})}function $r(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Xp(n,i),setContext:s=>$r(n,s,e,i),override:s=>$r(n.override(s),t,e,i)};return new Proxy(r,{deleteProperty(s,a){return delete s[a],delete n[a],!0},get(s,a,l){return Zp(s,a,()=>vk(s,a,l))},getOwnPropertyDescriptor(s,a){return s._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(s,a,l){return n[a]=l,delete s[a],!0}})}function Xp(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=n;return{allKeys:r,scriptable:e,indexable:i,isScriptable:nn(e)?e:()=>e,isIndexable:nn(i)?i:()=>i}}const wk=(n,t)=>n?n+Yc(t):t,nu=(n,t)=>Pt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Zp(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function vk(n,t,e){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=n;let l=i[t];return nn(l)&&a.isScriptable(t)&&(l=Sk(t,l,n,e)),qt(l)&&l.length&&(l=Tk(t,l,n,a.isIndexable)),nu(t,l)&&(l=$r(l,r,s&&s[t],a)),l}function Sk(n,t,e,i){const{_proxy:r,_context:s,_subProxy:a,_stack:l}=e;if(l.has(n))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+n);l.add(n);let u=t(s,a||i);return l.delete(n),nu(n,u)&&(u=iu(r._scopes,r,n,u)),u}function Tk(n,t,e,i){const{_proxy:r,_context:s,_subProxy:a,_descriptors:l}=e;if(typeof s.index<"u"&&i(n))return t[s.index%t.length];if(Pt(t[0])){const u=t,d=r._scopes.filter(f=>f!==u);t=[];for(const f of u){const g=iu(d,r,n,f);t.push($r(g,s,a&&a[n],l))}}return t}function Qp(n,t,e){return nn(n)?n(t,e):n}const Mk=(n,t)=>n===!0?t:typeof n=="string"?ki(t,n):void 0;function kk(n,t,e,i,r){for(const s of t){const a=Mk(e,s);if(a){n.add(a);const l=Qp(a._fallback,e,r);if(typeof l<"u"&&l!==e&&l!==i)return l}else if(a===!1&&typeof i<"u"&&e!==i)return null}return!1}function iu(n,t,e,i){const r=t._rootScopes,s=Qp(t._fallback,e,i),a=[...n,...r],l=new Set;l.add(i);let u=Jp(l,a,e,s||e,i);return u===null||typeof s<"u"&&s!==e&&(u=Jp(l,a,s,u,i),u===null)?!1:eu(Array.from(l),[""],r,s,()=>Dk(t,e,i))}function Jp(n,t,e,i,r){for(;e;)e=kk(n,t,e,i,r);return e}function Dk(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return qt(r)&&Pt(e)?e:r||{}}function Ck(n,t,e,i){let r;for(const s of t)if(r=tg(wk(s,n),e),typeof r<"u")return nu(n,r)?iu(e,i,n,r):r}function tg(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function eg(n){let t=n._keys;return t||(t=n._keys=Ok(n._scopes)),t}function Ok(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function ng(n,t,e,i){const{iScale:r}=n,{key:s="r"}=this._parsing,a=new Array(i);let l,u,d,f;for(l=0,u=i;l<u;++l)d=l+e,f=t[d],a[l]={r:r.parse(ki(f,s),d)};return a}const Ak=Number.EPSILON||1e-14,Vr=(n,t)=>t<n.length&&!n[t].skip&&n[t],ig=n=>n==="x"?"y":"x";function Ek(n,t,e,i){const r=n.skip?t:n,s=t,a=e.skip?t:e,l=Hr(s,r),u=Hr(a,s);let d=l/(l+u),f=u/(l+u);d=isNaN(d)?0:d,f=isNaN(f)?0:f;const g=i*d,m=i*f;return{previous:{x:s.x-g*(a.x-r.x),y:s.y-g*(a.y-r.y)},next:{x:s.x+m*(a.x-r.x),y:s.y+m*(a.y-r.y)}}}function Rk(n,t,e){const i=n.length;let r,s,a,l,u,d=Vr(n,0);for(let f=0;f<i-1;++f)if(u=d,d=Vr(n,f+1),!(!u||!d)){if(Ws(t[f],0,Ak)){e[f]=e[f+1]=0;continue}r=e[f]/t[f],s=e[f+1]/t[f],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(a=3/Math.sqrt(l),e[f]=r*a*t[f],e[f+1]=s*a*t[f])}}function Pk(n,t,e="x"){const i=ig(e),r=n.length;let s,a,l,u=Vr(n,0);for(let d=0;d<r;++d){if(a=l,l=u,u=Vr(n,d+1),!l)continue;const f=l[e],g=l[i];a&&(s=(f-a[e])/3,l[`cp1${e}`]=f-s,l[`cp1${i}`]=g-s*t[d]),u&&(s=(u[e]-f)/3,l[`cp2${e}`]=f+s,l[`cp2${i}`]=g+s*t[d])}}function Ik(n,t="x"){const e=ig(t),i=n.length,r=Array(i).fill(0),s=Array(i);let a,l,u,d=Vr(n,0);for(a=0;a<i;++a)if(l=u,u=d,d=Vr(n,a+1),!!u){if(d){const f=d[t]-u[t];r[a]=f!==0?(d[e]-u[e])/f:0}s[a]=l?d?Yn(r[a-1])!==Yn(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}Rk(n,r,s),Pk(n,s,t)}function Da(n,t,e){return Math.max(Math.min(n,e),t)}function Lk(n,t){let e,i,r,s,a,l=si(n[0],t);for(e=0,i=n.length;e<i;++e)a=s,s=l,l=e<i-1&&si(n[e+1],t),s&&(r=n[e],a&&(r.cp1x=Da(r.cp1x,t.left,t.right),r.cp1y=Da(r.cp1y,t.top,t.bottom)),l&&(r.cp2x=Da(r.cp2x,t.left,t.right),r.cp2y=Da(r.cp2y,t.top,t.bottom)))}function Nk(n,t,e,i,r){let s,a,l,u;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")Ik(n,r);else{let d=i?n[n.length-1]:n[0];for(s=0,a=n.length;s<a;++s)l=n[s],u=Ek(d,l,n[Math.min(s+1,a-(i?0:1))%a],t.tension),l.cp1x=u.previous.x,l.cp1y=u.previous.y,l.cp2x=u.next.x,l.cp2y=u.next.y,d=l}t.capBezierPoints&&Lk(n,e)}function ru(){return typeof window<"u"&&typeof document<"u"}function su(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ca(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const Oa=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Bk(n,t){return Oa(n).getPropertyValue(t)}const Fk=["top","right","bottom","left"];function cr(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const s=Fk[r];i[s]=parseFloat(n[t+"-"+s+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const zk=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Uk(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:s}=i;let a=!1,l,u;if(zk(r,s,n.target))l=r,u=s;else{const d=t.getBoundingClientRect();l=i.clientX-d.left,u=i.clientY-d.top,a=!0}return{x:l,y:u,box:a}}function Ei(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,r=Oa(e),s=r.boxSizing==="border-box",a=cr(r,"padding"),l=cr(r,"border","width"),{x:u,y:d,box:f}=Uk(n,e),g=a.left+(f&&l.left),m=a.top+(f&&l.top);let{width:_,height:x}=t;return s&&(_-=a.width+l.width,x-=a.height+l.height),{x:Math.round((u-g)/_*e.width/i),y:Math.round((d-m)/x*e.height/i)}}function Hk(n,t,e){let i,r;if(t===void 0||e===void 0){const s=n&&su(n);if(!s)t=n.clientWidth,e=n.clientHeight;else{const a=s.getBoundingClientRect(),l=Oa(s),u=cr(l,"border","width"),d=cr(l,"padding");t=a.width-d.width-u.width,e=a.height-d.height-u.height,i=Ca(l.maxWidth,s,"clientWidth"),r=Ca(l.maxHeight,s,"clientHeight")}}return{width:t,height:e,maxWidth:i||ba,maxHeight:r||ba}}const Ri=n=>Math.round(n*10)/10;function Wk(n,t,e,i){const r=Oa(n),s=cr(r,"margin"),a=Ca(r.maxWidth,n,"clientWidth")||ba,l=Ca(r.maxHeight,n,"clientHeight")||ba,u=Hk(n,t,e);let{width:d,height:f}=u;if(r.boxSizing==="content-box"){const m=cr(r,"border","width"),_=cr(r,"padding");d-=_.width+m.width,f-=_.height+m.height}return d=Math.max(0,d-s.width),f=Math.max(0,i?d/i:f-s.height),d=Ri(Math.min(d,a,u.maxWidth)),f=Ri(Math.min(f,l,u.maxHeight)),d&&!f&&(f=Ri(d/2)),(t!==void 0||e!==void 0)&&i&&u.height&&f>u.height&&(f=u.height,d=Ri(Math.floor(f*i))),{width:d,height:f}}function rg(n,t,e){const i=t||1,r=Ri(n.height*i),s=Ri(n.width*i);n.height=Ri(n.height),n.width=Ri(n.width);const a=n.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${n.height}px`,a.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||a.height!==r||a.width!==s?(n.currentDevicePixelRatio=i,a.height=r,a.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const $k=(function(){let n=!1;try{const t={get passive(){return n=!0,!1}};ru()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n})();function sg(n,t){const e=Bk(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function ur(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Vk(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function Yk(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},s={x:t.cp1x,y:t.cp1y},a=ur(n,r,e),l=ur(r,s,e),u=ur(s,t,e),d=ur(a,l,e),f=ur(l,u,e);return ur(d,f,e)}const qk=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},jk=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function Yr(n,t,e){return n?qk(t,e):jk()}function og(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function ag(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function lg(n){return n==="angle"?{between:$s,compare:GM,normalize:Ue}:{between:ii,compare:(t,e)=>t-e,normalize:t=>t}}function cg({start:n,end:t,count:e,loop:i,style:r}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:r}}function Gk(n,t,e){const{property:i,start:r,end:s}=e,{between:a,normalize:l}=lg(i),u=t.length;let{start:d,end:f,loop:g}=n,m,_;if(g){for(d+=u,f+=u,m=0,_=u;m<_&&a(l(t[d%u][i]),r,s);++m)d--,f--;d%=u,f%=u}return f<d&&(f+=u),{start:d,end:f,loop:g,style:n.style}}function ug(n,t,e){if(!e)return[n];const{property:i,start:r,end:s}=e,a=t.length,{compare:l,between:u,normalize:d}=lg(i),{start:f,end:g,loop:m,style:_}=Gk(n,t,e),x=[];let S=!1,T=null,C,A,F;const P=()=>u(r,F,C)&&l(r,F)!==0,I=()=>l(s,C)===0||u(s,F,C),L=()=>S||P(),N=()=>!S||I();for(let w=f,M=f;w<=g;++w)A=t[w%a],!A.skip&&(C=d(A[i]),C!==F&&(S=u(C,r,s),T===null&&L()&&(T=l(C,r)===0?w:M),T!==null&&N()&&(x.push(cg({start:T,end:w,loop:m,count:a,style:_})),T=null),M=w,F=C));return T!==null&&x.push(cg({start:T,end:g,loop:m,count:a,style:_})),x}function dg(n,t){const e=[],i=n.segments;for(let r=0;r<i.length;r++){const s=ug(i[r],n.points,t);s.length&&e.push(...s)}return e}function Kk(n,t,e,i){let r=0,s=t-1;if(e&&!i)for(;r<t&&!n[r].skip;)r++;for(;r<t&&n[r].skip;)r++;for(r%=t,e&&(s+=r);s>r&&n[s%t].skip;)s--;return s%=t,{start:r,end:s}}function Xk(n,t,e,i){const r=n.length,s=[];let a=t,l=n[t],u;for(u=t+1;u<=e;++u){const d=n[u%r];d.skip||d.stop?l.skip||(i=!1,s.push({start:t%r,end:(u-1)%r,loop:i}),t=a=d.stop?u:null):(a=u,l.skip&&(t=u)),l=d}return a!==null&&s.push({start:t%r,end:a%r,loop:i}),s}function Zk(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const s=!!n._loop,{start:a,end:l}=Kk(e,r,s,i);if(i===!0)return fg(n,[{start:a,end:l,loop:s}],e,t);const u=l<a?l+r:l,d=!!n._fullLoop&&a===0&&l===r-1;return fg(n,Xk(e,a,u,d),e,t)}function fg(n,t,e,i){return!i||!i.setContext||!e?t:Qk(n,t,e,i)}function Qk(n,t,e,i){const r=n._chart.getContext(),s=hg(n.options),{_datasetIndex:a,options:{spanGaps:l}}=n,u=e.length,d=[];let f=s,g=t[0].start,m=g;function _(x,S,T,C){const A=l?-1:1;if(x!==S){for(x+=u;e[x%u].skip;)x-=A;for(;e[S%u].skip;)S+=A;x%u!==S%u&&(d.push({start:x%u,end:S%u,loop:T,style:C}),f=C,g=S%u)}}for(const x of t){g=l?g:x.start;let S=e[g%u],T;for(m=g+1;m<=x.end;m++){const C=e[m%u];T=hg(i.setContext(Ai(r,{type:"segment",p0:S,p1:C,p0DataIndex:(m-1)%u,p1DataIndex:m%u,datasetIndex:a}))),Jk(T,f)&&_(g,m-1,x.loop,f),S=C,f=T}g<m-1&&_(g,m-1,x.loop,f)}return d}function hg(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Jk(n,t){if(!t)return!1;const e=[],i=function(r,s){return Kc(s)?(e.includes(s)||e.push(s),e.indexOf(s)):s};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function Aa(n,t,e){return n.options.clip?n[e]:t[e]}function tD(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Aa(e,t,"left"),right:Aa(e,t,"right"),top:Aa(i,t,"top"),bottom:Aa(i,t,"bottom")}:t}function pg(n,t){const e=t._clip;if(e.disabled)return!1;const i=tD(t,n.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?n.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?n.height:i.bottom+(e.bottom===!0?0:e.bottom)}}class eD{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,r){const s=e.listeners[r],a=e.duration;s.forEach(l=>l({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=zp.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const s=i.items;let a=s.length-1,l=!1,u;for(;a>=0;--a)u=s[a],u._active?(u._total>i.duration&&(i.duration=u._total),u.tick(t),l=!0):(s[a]=s[s.length-1],s.pop());l&&(r.draw(),this._notify(r,i,t,"progress")),s.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var oi=new eD;const gg="transparent",nD={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Ta(n||gg),r=i.valid&&Ta(t||gg);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class iD{constructor(t,e,i,r){const s=e[i];r=Ks([t.to,r,s,t.from]);const a=Ks([t.from,s,r]);this._active=!0,this._fn=t.fn||nD[t.type||typeof a],this._easing=Vs[t.easing]||Vs.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const r=this._target[this._prop],s=i-this._start,a=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=Ks([t.to,e,r,t.from]),this._from=Ks([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,r=this._prop,s=this._from,a=this._loop,l=this._to;let u;if(this._active=s!==l&&(a||e<i),!this._active){this._target[r]=l,this._notify(!0);return}if(e<0){this._target[r]=s;return}u=e/i%2,u=a&&u>1?2-u:u,u=this._easing(Math.min(1,Math.max(0,u))),this._target[r]=this._fn(s,l,u)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][e]()}}class ou{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!Pt(t))return;const e=Object.keys(se.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!Pt(s))return;const a={};for(const l of e)a[l]=s[l];(qt(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!i.has(l))&&i.set(l,a)})})}_animateOptions(t,e){const i=e.options,r=sD(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&rD(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,r=[],s=t.$animations||(t.$animations={}),a=Object.keys(e),l=Date.now();let u;for(u=a.length-1;u>=0;--u){const d=a[u];if(d.charAt(0)==="$")continue;if(d==="options"){r.push(...this._animateOptions(t,e));continue}const f=e[d];let g=s[d];const m=i.get(d);if(g)if(m&&g.active()){g.update(m,f,l);continue}else g.cancel();if(!m||!m.duration){t[d]=f;continue}s[d]=g=new iD(m,t,d,f),r.push(g)}return r}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return oi.add(this._chart,i),!0}}function rD(n,t){const e=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const s=n[i[r]];s&&s.active()&&e.push(s.wait())}return Promise.all(e)}function sD(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function mg(n,t){const e=n&&n.options||{},i=e.reverse,r=e.min===void 0?t:0,s=e.max===void 0?t:0;return{start:i?s:r,end:i?r:s}}function oD(n,t,e){if(e===!1)return!1;const i=mg(n,e),r=mg(t,e);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function aD(n){let t,e,i,r;return Pt(n)?(t=n.top,e=n.right,i=n.bottom,r=n.left):t=e=i=r=n,{top:t,right:e,bottom:i,left:r,disabled:n===!1}}function yg(n,t){const e=[],i=n._getSortedDatasetMetas(t);let r,s;for(r=0,s=i.length;r<s;++r)e.push(i[r].index);return e}function _g(n,t,e,i={}){const r=n.keys,s=i.mode==="single";let a,l,u,d;if(t===null)return;let f=!1;for(a=0,l=r.length;a<l;++a){if(u=+r[a],u===e){if(f=!0,i.all)continue;break}d=n.values[u],ae(d)&&(s||t===0||Yn(t)===Yn(d))&&(t+=d)}return!f&&!i.all?0:t}function lD(n,t){const{iScale:e,vScale:i}=t,r=e.axis==="x"?"x":"y",s=i.axis==="x"?"x":"y",a=Object.keys(n),l=new Array(a.length);let u,d,f;for(u=0,d=a.length;u<d;++u)f=a[u],l[u]={[r]:f,[s]:n[f]};return l}function au(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function cD(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function uD(n){const{min:t,max:e,minDefined:i,maxDefined:r}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?e:Number.POSITIVE_INFINITY}}function dD(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function bg(n,t,e,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const s=n[r.index];if(e&&s>0||!e&&s<0)return r.index}return null}function xg(n,t){const{chart:e,_cachedMeta:i}=n,r=e._stacks||(e._stacks={}),{iScale:s,vScale:a,index:l}=i,u=s.axis,d=a.axis,f=cD(s,a,i),g=t.length;let m;for(let _=0;_<g;++_){const x=t[_],{[u]:S,[d]:T}=x,C=x._stacks||(x._stacks={});m=C[d]=dD(r,f,S),m[l]=T,m._top=bg(m,a,!0,i.type),m._bottom=bg(m,a,!1,i.type);const A=m._visualValues||(m._visualValues={});A[l]=T}}function lu(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function fD(n,t){return Ai(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function hD(n,t,e){return Ai(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Xs(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const r of t){const s=r._stacks;if(!s||s[i]===void 0||s[i][e]===void 0)return;delete s[i][e],s[i]._visualValues!==void 0&&s[i]._visualValues[e]!==void 0&&delete s[i]._visualValues[e]}}}const cu=n=>n==="reset"||n==="none",wg=(n,t)=>t?n:Object.assign({},n),pD=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:yg(e,!0),values:null};class Pi{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=au(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&&Xs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(g,m,_,x)=>g==="x"?m:g==="r"?x:_,s=e.xAxisID=kt(i.xAxisID,lu(t,"x")),a=e.yAxisID=kt(i.yAxisID,lu(t,"y")),l=e.rAxisID=kt(i.rAxisID,lu(t,"r")),u=e.indexAxis,d=e.iAxisID=r(u,s,a,l),f=e.vAxisID=r(u,a,s,l);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(l),e.iScale=this.getScaleForId(d),e.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Bp(this._data,this),t._stacked&&Xs(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Pt(e)){const r=this._cachedMeta;this._data=lD(e,r)}else if(i!==e){if(i){Bp(i,this);const r=this._cachedMeta;Xs(r),r._parsed=[]}e&&Object.isExtensible(e)&&QM(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const s=e._stacked;e._stacked=au(e.vScale,e),e.stack!==i.stack&&(r=!0,Xs(e),e.stack=i.stack),this._resyncElements(t),(r||s!==e._stacked)&&(xg(this,e._parsed),e._stacked=au(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:a}=i,l=s.axis;let u=t===0&&e===r.length?!0:i._sorted,d=t>0&&i._parsed[t-1],f,g,m;if(this._parsing===!1)i._parsed=r,i._sorted=!0,m=r;else{qt(r[t])?m=this.parseArrayData(i,r,t,e):Pt(r[t])?m=this.parseObjectData(i,r,t,e):m=this.parsePrimitiveData(i,r,t,e);const _=()=>g[l]===null||d&&g[l]<d[l];for(f=0;f<e;++f)i._parsed[f+t]=g=m[f],u&&(_()&&(u=!1),d=g);i._sorted=u}a&&xg(this,m)}parsePrimitiveData(t,e,i,r){const{iScale:s,vScale:a}=t,l=s.axis,u=a.axis,d=s.getLabels(),f=s===a,g=new Array(r);let m,_,x;for(m=0,_=r;m<_;++m)x=m+i,g[m]={[l]:f||s.parse(d[x],x),[u]:a.parse(e[x],x)};return g}parseArrayData(t,e,i,r){const{xScale:s,yScale:a}=t,l=new Array(r);let u,d,f,g;for(u=0,d=r;u<d;++u)f=u+i,g=e[f],l[u]={x:s.parse(g[0],f),y:a.parse(g[1],f)};return l}parseObjectData(t,e,i,r){const{xScale:s,yScale:a}=t,{xAxisKey:l="x",yAxisKey:u="y"}=this._parsing,d=new Array(r);let f,g,m,_;for(f=0,g=r;f<g;++f)m=f+i,_=e[m],d[f]={x:s.parse(ki(_,l),m),y:a.parse(ki(_,u),m)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const r=this.chart,s=this._cachedMeta,a=e[t.axis],l={keys:yg(r,!0),values:e._stacks[t.axis]._visualValues};return _g(l,a,s.index,{mode:i})}updateRangeFromParsed(t,e,i,r){const s=i[e.axis];let a=s===null?NaN:s;const l=r&&i._stacks[e.axis];r&&l&&(r.values=l,a=_g(r,s,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,r=i._parsed,s=i._sorted&&t===i.iScale,a=r.length,l=this._getOtherScale(t),u=pD(e,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:g}=uD(l);let m,_;function x(){_=r[m];const S=_[l.axis];return!ae(_[t.axis])||f>S||g<S}for(m=0;m<a&&!(!x()&&(this.updateRangeFromParsed(d,t,_,u),s));++m);if(s){for(m=a-1;m>=0;--m)if(!x()){this.updateRangeFromParsed(d,t,_,u);break}}return d}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let r,s,a;for(r=0,s=e.length;r<s;++r)a=e[r][t.axis],ae(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,r=e.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=aD(kt(this.options.clip,oD(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,r=i.data||[],s=e.chartArea,a=[],l=this._drawStart||0,u=this._drawCount||r.length-l,d=this.options.drawActiveElementsOnTop;let f;for(i.dataset&&i.dataset.draw(t,s,l,u),f=l;f<l+u;++f){const g=r[f];g.hidden||(g.active&&d?a.push(g):g.draw(t,s))}for(f=0;f<a.length;++f)a[f].draw(t,s)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const r=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];s=a.$context||(a.$context=hD(this.getContext(),t,a)),s.parsed=this.getParsed(t),s.raw=r.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=fD(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!e,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const r=e==="active",s=this._cachedDataOpts,a=t+"-"+e,l=s[a],u=this.enableOptionSharing&&en(i);if(l)return wg(l,u);const d=this.chart.config,f=d.datasetElementScopeKeys(this._type,t),g=r?[`${t}Hover`,"hover",t,""]:[t,""],m=d.getOptionScopes(this.getDataset(),f),_=Object.keys(se.elements[t]),x=()=>this.getContext(i,r,e),S=d.resolveNamedOptions(m,_,x,g);return S.$shared&&(S.$shared=u,s[a]=Object.freeze(wg(S,u))),S}_resolveAnimations(t,e,i){const r=this.chart,s=this._cachedDataOpts,a=`animation-${e}`,l=s[a];if(l)return l;let u;if(r.options.animation!==!1){const f=this.chart.config,g=f.datasetAnimationScopeKeys(this._type,e),m=f.getOptionScopes(this.getDataset(),g);u=f.createResolver(m,this.getContext(t,i,e))}const d=new ou(r,u&&u.animations);return u&&u._cacheable&&(s[a]=Object.freeze(d)),d}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||cu(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,s=this.getSharedOptions(i),a=this.includeOptions(e,s)||s!==r;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:a}}updateElement(t,e,i,r){cu(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!cu(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;const s=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[l,u,d]of this._syncList)this[l](u,d);this._syncList=[];const r=i.length,s=e.length,a=Math.min(s,r);a&&this.parse(0,a),s>r?this._insertElements(r,s-r,t):s<r&&this._removeElements(s,r-s)}_insertElements(t,e,i=!0){const r=this._cachedMeta,s=r.data,a=t+e;let l;const u=d=>{for(d.length+=e,l=d.length-1;l>=a;l--)d[l]=d[l-e]};for(u(s),l=t;l<a;++l)s[l]=new this.dataElementType;this._parsing&&u(r._parsed),this.parse(t,e),i&&this.updateElements(s,t,e,"reset")}updateElements(t,e,i,r){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,e);i._stacked&&Xs(i,r)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,r]=t;this[e](i,r)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function gD(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let r=0,s=e.length;r<s;r++)i=i.concat(e[r].controller.getAllParsedValues(n));n._cache.$bar=Fp(i.sort((r,s)=>r-s))}return n._cache.$bar}function mD(n){const t=n.iScale,e=gD(t,n.type);let i=t._length,r,s,a,l;const u=()=>{a===32767||a===-32768||(en(l)&&(i=Math.min(i,Math.abs(a-l)||i)),l=a)};for(r=0,s=e.length;r<s;++r)a=t.getPixelForValue(e[r]),u();for(l=void 0,r=0,s=t.ticks.length;r<s;++r)a=t.getPixelForTick(r),u();return i}function yD(n,t,e,i){const r=e.barThickness;let s,a;return xt(r)?(s=t.min*e.categoryPercentage,a=e.barPercentage):(s=r*i,a=1),{chunk:s/i,ratio:a,start:t.pixels[n]-s/2}}function _D(n,t,e,i){const r=t.pixels,s=r[n];let a=n>0?r[n-1]:null,l=n<r.length-1?r[n+1]:null;const u=e.categoryPercentage;a===null&&(a=s-(l===null?t.end-t.start:l-s)),l===null&&(l=s+s-a);const d=s-(s-Math.min(a,l))/2*u;return{chunk:Math.abs(l-a)/2*u/i,ratio:e.barPercentage,start:d}}function bD(n,t,e,i){const r=e.parse(n[0],i),s=e.parse(n[1],i),a=Math.min(r,s),l=Math.max(r,s);let u=a,d=l;Math.abs(a)>Math.abs(l)&&(u=l,d=a),t[e.axis]=d,t._custom={barStart:u,barEnd:d,start:r,end:s,min:a,max:l}}function vg(n,t,e,i){return qt(n)?bD(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Sg(n,t,e,i){const r=n.iScale,s=n.vScale,a=r.getLabels(),l=r===s,u=[];let d,f,g,m;for(d=e,f=e+i;d<f;++d)m=t[d],g={},g[r.axis]=l||r.parse(a[d],d),u.push(vg(m,g,s,d));return u}function uu(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function xD(n,t,e){return n!==0?Yn(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function wD(n){let t,e,i,r,s;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(r="end",s="start"):(r="start",s="end"),{start:e,end:i,reverse:t,top:r,bottom:s}}function vD(n,t,e,i){let r=t.borderSkipped;const s={};if(!r){n.borderSkipped=s;return}if(r===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:u,top:d,bottom:f}=wD(n);r==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?r=d:(e._bottom||0)===i?r=f:(s[Tg(f,a,l,u)]=!0,r=d)),s[Tg(r,a,l,u)]=!0,n.borderSkipped=s}function Tg(n,t,e,i){return i?(n=SD(n,t,e),n=Mg(n,e,t)):n=Mg(n,t,e),n}function SD(n,t,e){return n===t?e:n===e?t:n}function Mg(n,t,e){return n==="start"?t:n==="end"?e:n}function TD(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class kg extends Pi{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,e,i,r){return Sg(t,e,i,r)}parseArrayData(t,e,i,r){return Sg(t,e,i,r)}parseObjectData(t,e,i,r){const{iScale:s,vScale:a}=t,{xAxisKey:l="x",yAxisKey:u="y"}=this._parsing,d=s.axis==="x"?l:u,f=a.axis==="x"?l:u,g=[];let m,_,x,S;for(m=i,_=i+r;m<_;++m)S=e[m],x={},x[s.axis]=s.parse(ki(S,d),m),g.push(vg(ki(S,f),x,a,m));return g}updateRangeFromParsed(t,e,i,r){super.updateRangeFromParsed(t,e,i,r);const s=i._custom;s&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:r}=e,s=this.getParsed(t),a=s._custom,l=uu(a)?"["+a.start+", "+a.end+"]":""+r.getLabelForValue(s[r.axis]);return{label:""+i.getLabelForValue(s[i.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,r){const s=r==="reset",{index:a,_cachedMeta:{vScale:l}}=this,u=l.getBasePixel(),d=l.isHorizontal(),f=this._getRuler(),{sharedOptions:g,includeOptions:m}=this._getSharedOptions(e,r);for(let _=e;_<e+i;_++){const x=this.getParsed(_),S=s||xt(x[l.axis])?{base:u,head:u}:this._calculateBarValuePixels(_),T=this._calculateBarIndexPixels(_,f),C=(x._stacks||{})[l.axis],A={horizontal:d,base:S.base,enableBorderRadius:!C||uu(x._custom)||a===C._top||a===C._bottom,x:d?S.head:T.center,y:d?T.center:S.head,height:d?T.size:Math.abs(S.size),width:d?Math.abs(S.size):T.size};m&&(A.options=g||this.resolveDataElementOptions(_,t[_].active?"active":r));const F=A.options||t[_].options;vD(A,F,C,a),TD(A,F,f.ratio),this.updateElement(t[_],_,A,r)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(f=>f.controller.options.grouped),s=i.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(e),u=l&&l[i.axis],d=f=>{const g=f._parsed.find(_=>_[i.axis]===u),m=g&&g[f.vScale.axis];if(xt(m)||isNaN(m))return!0};for(const f of r)if(!(e!==void 0&&d(f))&&((s===!1||a.indexOf(f.stack)===-1||s===void 0&&f.stack===void 0)&&a.push(f.stack),f.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[kt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const r=this._getStacks(t,i),s=e!==void 0?r.indexOf(e):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,r=[];let s,a;for(s=0,a=e.data.length;s<a;++s)r.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const l=t.barThickness;return{min:l||mD(e),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:r},options:{base:s,minBarLength:a}}=this,l=s||0,u=this.getParsed(t),d=u._custom,f=uu(d);let g=u[e.axis],m=0,_=i?this.applyStack(e,u,i):g,x,S;_!==g&&(m=_-g,_=g),f&&(g=d.barStart,_=d.barEnd-d.barStart,g!==0&&Yn(g)!==Yn(d.barEnd)&&(m=0),m+=g);const T=!xt(s)&&!f?s:m;let C=e.getPixelForValue(T);if(this.chart.getDataVisibility(t)?x=e.getPixelForValue(m+_):x=C,S=x-C,Math.abs(S)<a){S=xD(S,e,l)*a,g===l&&(C-=S/2);const A=e.getPixelForDecimal(0),F=e.getPixelForDecimal(1),P=Math.min(A,F),I=Math.max(A,F);C=Math.max(Math.min(C,I),P),x=C+S,i&&!f&&(u._stacks[e.axis]._visualValues[r]=e.getValueForPixel(x)-e.getValueForPixel(C))}if(C===e.getPixelForValue(l)){const A=Yn(S)*e.getLineWidthForValue(l)/2;C+=A,S-=A}return{size:S,base:C,head:x,center:x+S/2}}_calculateBarIndexPixels(t,e){const i=e.scale,r=this.options,s=r.skipNull,a=kt(r.maxBarThickness,1/0);let l,u;const d=this._getAxisCount();if(e.grouped){const f=s?this._getStackCount(t):e.stackCount,g=r.barThickness==="flex"?_D(t,e,r,f*d):yD(t,e,r,f*d),m=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,_=this._getAxis().indexOf(kt(m,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+_;l=g.start+g.chunk*x+g.chunk/2,u=Math.min(a,g.chunk*g.ratio)}else l=i.getPixelForValue(this.getParsed(t)[i.axis],t),u=Math.min(a,e.min*e.ratio);return{base:l-u/2,head:l+u/2,center:l,size:u}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,r=i.length;let s=0;for(;s<r;++s)this.getParsed(s)[e.axis]!==null&&!i[s].hidden&&i[s].draw(this._ctx)}}class MD extends Pi{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,e,i,r){const s=super.parsePrimitiveData(t,e,i,r);for(let a=0;a<s.length;a++)s[a]._custom=this.resolveDataElementOptions(a+i).radius;return s}parseArrayData(t,e,i,r){const s=super.parseArrayData(t,e,i,r);for(let a=0;a<s.length;a++){const l=e[i+a];s[a]._custom=kt(l[2],this.resolveDataElementOptions(a+i).radius)}return s}parseObjectData(t,e,i,r){const s=super.parseObjectData(t,e,i,r);for(let a=0;a<s.length;a++){const l=e[i+a];s[a]._custom=kt(l&&l.r&&+l.r,this.resolveDataElementOptions(a+i).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=e,a=this.getParsed(t),l=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y),d=a._custom;return{label:i[t]||"",value:"("+l+", "+u+(d?", "+d:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,r),f=a.axis,g=l.axis;for(let m=e;m<e+i;m++){const _=t[m],x=!s&&this.getParsed(m),S={},T=S[f]=s?a.getPixelForDecimal(.5):a.getPixelForValue(x[f]),C=S[g]=s?l.getBasePixel():l.getPixelForValue(x[g]);S.skip=isNaN(T)||isNaN(C),d&&(S.options=u||this.resolveDataElementOptions(m,_.active?"active":r),s&&(S.options.radius=0)),this.updateElement(_,m,S,r)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,e);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const s=r.radius;return e!=="active"&&(r.radius=0),r.radius+=kt(i&&i._custom,s),r}}function kD(n,t,e){let i=1,r=1,s=0,a=0;if(t<te){const l=n,u=l+t,d=Math.cos(l),f=Math.sin(l),g=Math.cos(u),m=Math.sin(u),_=(F,P,I)=>$s(F,l,u,!0)?1:Math.max(P,P*e,I,I*e),x=(F,P,I)=>$s(F,l,u,!0)?-1:Math.min(P,P*e,I,I*e),S=_(0,d,g),T=_(re,f,m),C=x(Et,d,g),A=x(Et+re,f,m);i=(S-C)/2,r=(T-A)/2,s=-(S+C)/2,a=-(T+A)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:a}}class Zs extends Pi{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 e=t.data,{labels:{pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((u,d)=>{const g=t.getDatasetMeta(0).controller.getStyle(d);return{text:u,fillStyle:g.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(d),lineDash:g.borderDash,lineDashOffset:g.borderDashOffset,lineJoin:g.borderJoinStyle,lineWidth:g.borderWidth,strokeStyle:g.borderColor,textAlign:r,pointStyle:i,borderRadius:a&&(l||g.borderRadius),index:d}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let s=u=>+i[u];if(Pt(i[t])){const{key:u="value"}=this._parsing;s=d=>+ki(i[d],u)}let a,l;for(a=t,l=t+e;a<l;++a)r._parsed[a]=s(a)}}_getRotation(){return xe(this.options.rotation-90)}_getCircumference(){return xe(this.options.circumference)}_getRotationExtents(){let t=te,e=-te;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,s=r._getRotation(),a=r._getCircumference();t=Math.min(t,s),e=Math.max(e,s+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,r=this._cachedMeta,s=r.data,a=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(i.width,i.height)-a)/2,0),u=Math.min(FM(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:f,rotation:g}=this._getRotationExtents(),{ratioX:m,ratioY:_,offsetX:x,offsetY:S}=kD(g,f,u),T=(i.width-a)/m,C=(i.height-a)/_,A=Math.max(Math.min(T,C)/2,0),F=Op(this.options.radius,A),P=Math.max(F*u,0),I=(F-P)/this._getVisibleDatasetWeightTotal();this.offsetX=x*F,this.offsetY=S*F,r.total=this.calculateTotal(),this.outerRadius=F-I*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-I*d,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,r=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*s/te)}updateElements(t,e,i,r){const s=r==="reset",a=this.chart,l=a.chartArea,d=a.options.animation,f=(l.left+l.right)/2,g=(l.top+l.bottom)/2,m=s&&d.animateScale,_=m?0:this.innerRadius,x=m?0:this.outerRadius,{sharedOptions:S,includeOptions:T}=this._getSharedOptions(e,r);let C=this._getRotation(),A;for(A=0;A<e;++A)C+=this._circumference(A,s);for(A=e;A<e+i;++A){const F=this._circumference(A,s),P=t[A],I={x:f+this.offsetX,y:g+this.offsetY,startAngle:C,endAngle:C+F,circumference:F,outerRadius:x,innerRadius:_};T&&(I.options=S||this.resolveDataElementOptions(A,P.active?"active":r)),C+=F,this.updateElement(P,A,I,r)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,r;for(r=0;r<e.length;r++){const s=t._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!e[r].hidden&&(i+=Math.abs(s))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?te*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=Ys(e._parsed[t],i.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let r,s,a,l,u;if(!t){for(r=0,s=i.data.datasets.length;r<s;++r)if(i.isDatasetVisible(r)){a=i.getDatasetMeta(r),t=a.data,l=a.controller;break}}if(!t)return 0;for(r=0,s=t.length;r<s;++r)u=l.resolveDataElementOptions(r),u.borderAlign!=="inner"&&(e=Math.max(e,u.borderWidth||0,u.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,r=t.length;i<r;++i){const s=this.resolveDataElementOptions(i);e=Math.max(e,s.offset||0,s.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(kt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Dg extends Pi{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 e=this._cachedMeta,{dataset:i,data:r=[],_dataset:s}=e,a=this.chart._animationsDisabled;let{start:l,count:u}=Hp(e,r,a);this._drawStart=l,this._drawCount=u,Wp(e)&&(l=0,u=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=r;const d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:d},t),this.updateElements(r,l,u,t)}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:d}=this._cachedMeta,{sharedOptions:f,includeOptions:g}=this._getSharedOptions(e,r),m=a.axis,_=l.axis,{spanGaps:x,segment:S}=this.options,T=Ci(x)?x:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||s||r==="none",A=e+i,F=t.length;let P=e>0&&this.getParsed(e-1);for(let I=0;I<F;++I){const L=t[I],N=C?L:{};if(I<e||I>=A){N.skip=!0;continue}const w=this.getParsed(I),M=xt(w[_]),O=N[m]=a.getPixelForValue(w[m],I),B=N[_]=s||M?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,w,u):w[_],I);N.skip=isNaN(O)||isNaN(B)||M,N.stop=I>0&&Math.abs(w[m]-P[m])>T,S&&(N.parsed=w,N.raw=d.data[I]),g&&(N.options=f||this.resolveDataElementOptions(I,L.active?"active":r)),C||this.updateElement(L,I,N,r),P=w}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const s=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,s,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class Cg extends Pi{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 e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((s,a)=>{const u=t.getDatasetMeta(0).controller.getStyle(a);return{text:s,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=Ys(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:s}}parseObjectData(t,e,i,r){return ng.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,r)=>{const s=this.getParsed(r).r;!isNaN(s)&&this.chart.getDataVisibility(r)&&(s<e.min&&(e.min=s),s>e.max&&(e.max=s))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(r/2,0),a=Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0),l=(s-a)/t.getVisibleDatasetCount();this.outerRadius=s-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,e,i,r){const s=r==="reset",a=this.chart,u=a.options.animation,d=this._cachedMeta.rScale,f=d.xCenter,g=d.yCenter,m=d.getIndexAngle(0)-.5*Et;let _=m,x;const S=360/this.countVisibleElements();for(x=0;x<e;++x)_+=this._computeAngle(x,r,S);for(x=e;x<e+i;x++){const T=t[x];let C=_,A=_+this._computeAngle(x,r,S),F=a.getDataVisibility(x)?d.getDistanceFromCenterForValue(this.getParsed(x).r):0;_=A,s&&(u.animateScale&&(F=0),u.animateRotate&&(C=A=m));const P={x:f,y:g,innerRadius:0,outerRadius:F,startAngle:C,endAngle:A,options:this.resolveDataElementOptions(x,T.active?"active":r)};this.updateElement(T,x,P,r)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?xe(this.resolveDataElementOptions(t,e).angle||i):0}}class DD extends Zs{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class CD extends Pi{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 e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,r){return ng.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta,i=e.dataset,r=e.data||[],s=e.iScale.getLabels();if(i.points=r,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const l={_loop:!0,_fullLoop:s.length===r.length,options:a};this.updateElement(i,void 0,l,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,i,r){const s=this._cachedMeta.rScale,a=r==="reset";for(let l=e;l<e+i;l++){const u=t[l],d=this.resolveDataElementOptions(l,u.active?"active":r),f=s.getPointPositionForValue(l,this.getParsed(l).r),g=a?s.xCenter:f.x,m=a?s.yCenter:f.y,_={x:g,y:m,angle:f.angle,skip:isNaN(g)||isNaN(m),options:d};this.updateElement(u,l,_,r)}}}class Og extends Pi{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 e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=e,a=this.getParsed(t),l=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y);return{label:i[t]||"",value:"("+l+", "+u+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,r=this.chart._animationsDisabled;let{start:s,count:a}=Hp(e,i,r);if(this._drawStart=s,this._drawCount=a,Wp(e)&&(s=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:u}=e;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!u._decimated,l.points=i;const d=this.resolveDatasetElementOptions(t);d.segment=this.options.segment,this.updateElement(l,void 0,{animated:!r,options:d},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,s,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:d}=this._cachedMeta,f=this.resolveDataElementOptions(e,r),g=this.getSharedOptions(f),m=this.includeOptions(r,g),_=a.axis,x=l.axis,{spanGaps:S,segment:T}=this.options,C=Ci(S)?S:Number.POSITIVE_INFINITY,A=this.chart._animationsDisabled||s||r==="none";let F=e>0&&this.getParsed(e-1);for(let P=e;P<e+i;++P){const I=t[P],L=this.getParsed(P),N=A?I:{},w=xt(L[x]),M=N[_]=a.getPixelForValue(L[_],P),O=N[x]=s||w?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,L,u):L[x],P);N.skip=isNaN(M)||isNaN(O)||w,N.stop=P>0&&Math.abs(L[_]-F[_])>C,T&&(N.parsed=L,N.raw=d.data[P]),m&&(N.options=g||this.resolveDataElementOptions(P,I.active?"active":r)),A||this.updateElement(I,P,N,r),F=L}this.updateSharedOptions(g,r,f)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let l=0;for(let u=e.length-1;u>=0;--u)l=Math.max(l,e[u].size(this.resolveDataElementOptions(u))/2);return l>0&&l}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;const s=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,s,a)/2}}var OD=Object.freeze({__proto__:null,BarController:kg,BubbleController:MD,DoughnutController:Zs,LineController:Dg,PieController:DD,PolarAreaController:Cg,RadarController:CD,ScatterController:Og});function dr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class du{static override(t){Object.assign(du.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return dr()}parse(){return dr()}format(){return dr()}add(){return dr()}diff(){return dr()}startOf(){return dr()}endOf(){return dr()}}var Ag={_date:du};function AD(n,t,e,i){const{controller:r,data:s,_sorted:a}=n,l=r._cachedMeta.iScale,u=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(l&&t===l.axis&&t!=="r"&&a&&s.length){const d=l._reversePixels?XM:ri;if(i){if(r._sharedOptions){const f=s[0],g=typeof f.getRange=="function"&&f.getRange(t);if(g){const m=d(s,t,e-g),_=d(s,t,e+g);return{lo:m.lo,hi:_.hi}}}}else{const f=d(s,t,e);if(u){const{vScale:g}=r._cachedMeta,{_parsed:m}=n,_=m.slice(0,f.lo+1).reverse().findIndex(S=>!xt(S[g.axis]));f.lo-=Math.max(0,_);const x=m.slice(f.hi).findIndex(S=>!xt(S[g.axis]));f.hi+=Math.max(0,x)}return f}}return{lo:0,hi:s.length-1}}function Qs(n,t,e,i,r){const s=n.getSortedVisibleDatasetMetas(),a=e[t];for(let l=0,u=s.length;l<u;++l){const{index:d,data:f}=s[l],{lo:g,hi:m}=AD(s[l],t,a,r);for(let _=g;_<=m;++_){const x=f[_];x.skip||i(x,d,_)}}}function ED(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,r){const s=t?Math.abs(i.x-r.x):0,a=e?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(a,2))}}function fu(n,t,e,i,r){const s=[];return!r&&!n.isPointInArea(t)||Qs(n,e,t,function(l,u,d){!r&&!si(l,n.chartArea,0)||l.inRange(t.x,t.y,i)&&s.push({element:l,datasetIndex:u,index:d})},!0),s}function RD(n,t,e,i){let r=[];function s(a,l,u){const{startAngle:d,endAngle:f}=a.getProps(["startAngle","endAngle"],i),{angle:g}=va(a,{x:t.x,y:t.y});$s(g,d,f)&&r.push({element:a,datasetIndex:l,index:u})}return Qs(n,e,t,s),r}function PD(n,t,e,i,r,s){let a=[];const l=ED(e);let u=Number.POSITIVE_INFINITY;function d(f,g,m){const _=f.inRange(t.x,t.y,r);if(i&&!_)return;const x=f.getCenterPoint(r);if(!(!!s||n.isPointInArea(x))&&!_)return;const T=l(t,x);T<u?(a=[{element:f,datasetIndex:g,index:m}],u=T):T===u&&a.push({element:f,datasetIndex:g,index:m})}return Qs(n,e,t,d),a}function hu(n,t,e,i,r,s){return!s&&!n.isPointInArea(t)?[]:e==="r"&&!i?RD(n,t,e,r):PD(n,t,e,i,r,s)}function Eg(n,t,e,i,r){const s=[],a=e==="x"?"inXRange":"inYRange";let l=!1;return Qs(n,e,t,(u,d,f)=>{u[a]&&u[a](t[e],r)&&(s.push({element:u,datasetIndex:d,index:f}),l=l||u.inRange(t.x,t.y,r))}),i&&!l?[]:s}var pu={evaluateInteractionItems:Qs,modes:{index(n,t,e,i){const r=Ei(t,n),s=e.axis||"x",a=e.includeInvisible||!1,l=e.intersect?fu(n,r,s,i,a):hu(n,r,s,!1,i,a),u=[];return l.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const f=l[0].index,g=d.data[f];g&&!g.skip&&u.push({element:g,datasetIndex:d.index,index:f})}),u):[]},dataset(n,t,e,i){const r=Ei(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;let l=e.intersect?fu(n,r,s,i,a):hu(n,r,s,!1,i,a);if(l.length>0){const u=l[0].datasetIndex,d=n.getDatasetMeta(u).data;l=[];for(let f=0;f<d.length;++f)l.push({element:d[f],datasetIndex:u,index:f})}return l},point(n,t,e,i){const r=Ei(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return fu(n,r,s,i,a)},nearest(n,t,e,i){const r=Ei(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return hu(n,r,s,e.intersect,i,a)},x(n,t,e,i){const r=Ei(t,n);return Eg(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=Ei(t,n);return Eg(n,r,"y",e.intersect,i)}}};const Rg=["left","top","right","bottom"];function Js(n,t){return n.filter(e=>e.pos===t)}function Pg(n,t){return n.filter(e=>Rg.indexOf(e.pos)===-1&&e.box.axis===t)}function to(n,t){return n.sort((e,i)=>{const r=t?i:e,s=t?e:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function ID(n){const t=[];let e,i,r,s,a,l;for(e=0,i=(n||[]).length;e<i;++e)r=n[e],{position:s,options:{stack:a,stackWeight:l=1}}=r,t.push({index:e,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&s+a,stackWeight:l});return t}function LD(n){const t={};for(const e of n){const{stack:i,pos:r,stackWeight:s}=e;if(!i||!Rg.includes(r))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=s}return t}function ND(n,t){const e=LD(n),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let s,a,l;for(s=0,a=n.length;s<a;++s){l=n[s];const{fullSize:u}=l.box,d=e[l.stack],f=d&&l.stackWeight/d.weight;l.horizontal?(l.width=f?f*i:u&&t.availableWidth,l.height=r):(l.width=i,l.height=f?f*r:u&&t.availableHeight)}return e}function BD(n){const t=ID(n),e=to(t.filter(d=>d.box.fullSize),!0),i=to(Js(t,"left"),!0),r=to(Js(t,"right")),s=to(Js(t,"top"),!0),a=to(Js(t,"bottom")),l=Pg(t,"x"),u=Pg(t,"y");return{fullSize:e,leftAndTop:i.concat(s),rightAndBottom:r.concat(u).concat(a).concat(l),chartArea:Js(t,"chartArea"),vertical:i.concat(r).concat(u),horizontal:s.concat(a).concat(l)}}function Ig(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Lg(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function FD(n,t,e,i){const{pos:r,box:s}=e,a=n.maxPadding;if(!Pt(r)){e.size&&(n[r]-=e.size);const g=i[e.stack]||{size:0,count:1};g.size=Math.max(g.size,e.horizontal?s.height:s.width),e.size=g.size/g.count,n[r]+=e.size}s.getPadding&&Lg(a,s.getPadding());const l=Math.max(0,t.outerWidth-Ig(a,n,"left","right")),u=Math.max(0,t.outerHeight-Ig(a,n,"top","bottom")),d=l!==n.w,f=u!==n.h;return n.w=l,n.h=u,e.horizontal?{same:d,other:f}:{same:f,other:d}}function zD(n){const t=n.maxPadding;function e(i){const r=Math.max(t[i]-n[i],0);return n[i]+=r,r}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function UD(n,t){const e=t.maxPadding;function i(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(a=>{s[a]=Math.max(t[a],e[a])}),s}return i(n?["left","right"]:["top","bottom"])}function eo(n,t,e,i){const r=[];let s,a,l,u,d,f;for(s=0,a=n.length,d=0;s<a;++s){l=n[s],u=l.box,u.update(l.width||t.w,l.height||t.h,UD(l.horizontal,t));const{same:g,other:m}=FD(t,e,l,i);d|=g&&r.length,f=f||m,u.fullSize||r.push(l)}return d&&eo(r,t,e,i)||f}function Ea(n,t,e,i,r){n.top=e,n.left=t,n.right=t+i,n.bottom=e+r,n.width=i,n.height=r}function Ng(n,t,e,i){const r=e.padding;let{x:s,y:a}=t;for(const l of n){const u=l.box,d=i[l.stack]||{placed:0,weight:1},f=l.stackWeight/d.weight||1;if(l.horizontal){const g=t.w*f,m=d.size||u.height;en(d.start)&&(a=d.start),u.fullSize?Ea(u,r.left,a,e.outerWidth-r.right-r.left,m):Ea(u,t.left+d.placed,a,g,m),d.start=a,d.placed+=g,a=u.bottom}else{const g=t.h*f,m=d.size||u.width;en(d.start)&&(s=d.start),u.fullSize?Ea(u,s,r.top,m,e.outerHeight-r.bottom-r.top):Ea(u,s,t.top+d.placed,m,g),d.start=s,d.placed+=g,s=u.right}}t.x=s,t.y=a}var We={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const r=we(n.options.layout.padding),s=Math.max(t-r.width,0),a=Math.max(e-r.height,0),l=BD(n.boxes),u=l.vertical,d=l.horizontal;Jt(n.boxes,S=>{typeof S.beforeLayout=="function"&&S.beforeLayout()});const f=u.reduce((S,T)=>T.box.options&&T.box.options.display===!1?S:S+1,0)||1,g=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/f,hBoxMaxHeight:a/2}),m=Object.assign({},r);Lg(m,we(i));const _=Object.assign({maxPadding:m,w:s,h:a,x:r.left,y:r.top},r),x=ND(u.concat(d),g);eo(l.fullSize,_,g,x),eo(u,_,g,x),eo(d,_,g,x)&&eo(u,_,g,x),zD(_),Ng(l.leftAndTop,_,g,x),_.x+=_.w,_.y+=_.h,Ng(l.rightAndBottom,_,g,x),n.chartArea={left:_.left,top:_.top,right:_.left+_.w,bottom:_.top+_.h,height:_.h,width:_.w},Jt(l.chartArea,S=>{const T=S.box;Object.assign(T,n.chartArea),T.update(_.w,_.h,{left:0,top:0,right:0,bottom:0})})}};class Bg{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class HD extends Bg{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ra="$chartjs",WD={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Fg=n=>n===null||n==="";function $D(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[Ra]={initial:{height:i,width:r,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Fg(r)){const s=sg(n,"width");s!==void 0&&(n.width=s)}if(Fg(i))if(n.style.height==="")n.height=n.width/(t||2);else{const s=sg(n,"height");s!==void 0&&(n.height=s)}return n}const zg=$k?{passive:!0}:!1;function VD(n,t,e){n&&n.addEventListener(t,e,zg)}function YD(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,zg)}function qD(n,t){const e=WD[n.type]||n.type,{x:i,y:r}=Ei(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Pa(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function jD(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||Pa(l.addedNodes,i),a=a&&!Pa(l.removedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function GD(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||Pa(l.removedNodes,i),a=a&&!Pa(l.addedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const no=new Map;let Ug=0;function Hg(){const n=window.devicePixelRatio;n!==Ug&&(Ug=n,no.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function KD(n,t){no.size||window.addEventListener("resize",Hg),no.set(n,t)}function XD(n){no.delete(n),no.size||window.removeEventListener("resize",Hg)}function ZD(n,t,e){const i=n.canvas,r=i&&su(i);if(!r)return;const s=Up((l,u)=>{const d=r.clientWidth;e(l,u),d<r.clientWidth&&e()},window),a=new ResizeObserver(l=>{const u=l[0],d=u.contentRect.width,f=u.contentRect.height;d===0&&f===0||s(d,f)});return a.observe(r),KD(n,s),a}function gu(n,t,e){e&&e.disconnect(),t==="resize"&&XD(n)}function QD(n,t,e){const i=n.canvas,r=Up(s=>{n.ctx!==null&&e(qD(s,n))},n);return VD(i,t,r),r}class JD extends Bg{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?($D(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ra])return!1;const i=e[Ra].initial;["height","width"].forEach(s=>{const a=i[s];xt(a)?e.removeAttribute(s):e.setAttribute(s,a)});const r=i.style||{};return Object.keys(r).forEach(s=>{e.style[s]=r[s]}),e.width=e.width,delete e[Ra],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),a={attach:jD,detach:GD,resize:ZD}[e]||QD;r[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;({attach:gu,detach:gu,resize:gu}[e]||YD)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return Wk(t,e,i,r)}isAttached(t){const e=t&&su(t);return!!(e&&e.isConnected)}}function tC(n){return!ru()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?HD:JD}class $e{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Ci(this.x)&&Ci(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const r={};return t.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}}function eC(n,t){const e=n.options.ticks,i=nC(n),r=Math.min(e.maxTicksLimit||i,i),s=e.major.enabled?rC(t):[],a=s.length,l=s[0],u=s[a-1],d=[];if(a>r)return sC(t,d,s,a/r),d;const f=iC(s,t,r);if(a>0){let g,m;const _=a>1?Math.round((u-l)/(a-1)):null;for(Ia(t,d,f,xt(_)?0:l-_,l),g=0,m=a-1;g<m;g++)Ia(t,d,f,s[g],s[g+1]);return Ia(t,d,f,u,xt(_)?t.length:u+_),d}return Ia(t,d,f),d}function nC(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),r=n._maxLength/e;return Math.floor(Math.min(i,r))}function iC(n,t,e){const i=oC(n),r=t.length/e;if(!i)return Math.max(r,1);const s=YM(i);for(let a=0,l=s.length-1;a<l;a++){const u=s[a];if(u>r)return u}return Math.max(r,1)}function rC(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function sC(n,t,e,i){let r=0,s=e[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===s&&(t.push(n[a]),r++,s=e[r*i])}function Ia(n,t,e,i,r){const s=kt(i,0),a=Math.min(kt(r,n.length),n.length);let l=0,u,d,f;for(e=Math.ceil(e),r&&(u=r-i,e=u/Math.floor(u/e)),f=s;f<0;)l++,f=Math.round(s+l*e);for(d=Math.max(s,0);d<a;d++)d===f&&(t.push(n[d]),l++,f=Math.round(s+l*e))}function oC(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const aC=n=>n==="left"?"right":n==="right"?"left":n,Wg=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,$g=(n,t)=>Math.min(t||n,n);function Vg(n,t){const e=[],i=n.length/t,r=n.length;let s=0;for(;s<r;s+=i)e.push(n[Math.floor(s)]);return e}function lC(n,t,e){const i=n.ticks.length,r=Math.min(t,i-1),s=n._startPixel,a=n._endPixel,l=1e-6;let u=n.getPixelForTick(r),d;if(!(e&&(i===1?d=Math.max(u-s,a-u):t===0?d=(n.getPixelForTick(1)-u)/2:d=(u-n.getPixelForTick(r-1))/2,u+=r<t?d:-d,u<s-l||u>a+l)))return u}function cC(n,t){Jt(n,e=>{const i=e.gc,r=i.length/2;let s;if(r>t){for(s=0;s<r;++s)delete e.data[i[s]];i.splice(0,r)}})}function io(n){return n.drawTicks?n.tickLength:0}function Yg(n,t){if(!n.display)return 0;const e=le(n.font,t),i=we(n.padding);return(qt(n.text)?n.text.length:1)*e.lineHeight+i.height}function uC(n,t){return Ai(n,{scale:t,type:"scale"})}function dC(n,t,e){return Ai(n,{tick:e,index:t,type:"tick"})}function fC(n,t,e){let i=Gc(n);return(e&&t!=="right"||!e&&t==="right")&&(i=aC(i)),i}function hC(n,t,e,i){const{top:r,left:s,bottom:a,right:l,chart:u}=n,{chartArea:d,scales:f}=u;let g=0,m,_,x;const S=a-r,T=l-s;if(n.isHorizontal()){if(_=He(i,s,l),Pt(e)){const C=Object.keys(e)[0],A=e[C];x=f[C].getPixelForValue(A)+S-t}else e==="center"?x=(d.bottom+d.top)/2+S-t:x=Wg(n,e,t);m=l-s}else{if(Pt(e)){const C=Object.keys(e)[0],A=e[C];_=f[C].getPixelForValue(A)-T+t}else e==="center"?_=(d.left+d.right)/2-T+t:_=Wg(n,e,t);x=He(i,a,r),g=e==="left"?-re:re}return{titleX:_,titleY:x,maxWidth:m,rotation:g}}class fr extends $e{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:r}=this;return t=pn(t,Number.POSITIVE_INFINITY),e=pn(e,Number.NEGATIVE_INFINITY),i=pn(i,Number.POSITIVE_INFINITY),r=pn(r,Number.NEGATIVE_INFINITY),{min:pn(t,i),max:pn(e,r),minDefined:ae(t),maxDefined:ae(e)}}getMinMax(t){let{min:e,max:i,minDefined:r,maxDefined:s}=this.getUserBounds(),a;if(r&&s)return{min:e,max:i};const l=this.getMatchingVisibleMetas();for(let u=0,d=l.length;u<d;++u)a=l[u].controller.getMinMax(this,t),r||(e=Math.min(e,a.min)),s||(i=Math.max(i,a.max));return e=s&&e>i?i:e,i=r&&e>i?e:i,{min:pn(e,pn(i,e)),max:pn(i,pn(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Qt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:r,grace:s,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=xk(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=l<this.ticks.length;this._convertTicksToLabels(u?Vg(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=eC(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),u&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Qt(this.options.afterUpdate,[this])}beforeSetDimensions(){Qt(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(){Qt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Qt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Qt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,r,s;for(i=0,r=t.length;i<r;i++)s=t[i],s.label=Qt(e.callback,[s.value,i,t],this)}afterTickToLabelConversion(){Qt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Qt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=$g(this.ticks.length,t.ticks.maxTicksLimit),r=e.minRotation||0,s=e.maxRotation;let a=r,l,u,d;if(!this._isVisible()||!e.display||r>=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const f=this._getLabelSizes(),g=f.widest.width,m=f.highest.height,_=Ce(this.chart.width-g,0,this.maxWidth);l=t.offset?this.maxWidth/i:_/(i-1),g+6>l&&(l=_/(i-(t.offset?.5:1)),u=this.maxHeight-io(t.grid)-e.padding-Yg(t.title,this.chart.options.font),d=Math.sqrt(g*g+m*m),a=wa(Math.min(Math.asin(Ce((f.highest.height+6)/l,-1,1)),Math.asin(Ce(u/d,-1,1))-Math.asin(Ce(m/d,-1,1)))),a=Math.max(r,Math.min(s,a))),this.labelRotation=a}afterCalculateLabelRotation(){Qt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Qt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:s}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const u=Yg(r,e.options.font);if(l?(t.width=this.maxWidth,t.height=io(s)+u):(t.height=this.maxHeight,t.width=io(s)+u),i.display&&this.ticks.length){const{first:d,last:f,widest:g,highest:m}=this._getLabelSizes(),_=i.padding*2,x=xe(this.labelRotation),S=Math.cos(x),T=Math.sin(x);if(l){const C=i.mirror?0:T*g.width+S*m.height;t.height=Math.min(this.maxHeight,t.height+C+_)}else{const C=i.mirror?0:S*g.width+T*m.height;t.width=Math.min(this.maxWidth,t.width+C+_)}this._calculatePadding(d,f,T,S)}}this._handleMargins(),l?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,r){const{ticks:{align:s,padding:a},position:l}=this.options,u=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,g=this.right-this.getPixelForTick(this.ticks.length-1);let m=0,_=0;u?d?(m=r*t.width,_=i*e.height):(m=i*t.height,_=r*e.width):s==="start"?_=e.width:s==="end"?m=t.width:s!=="inner"&&(m=t.width/2,_=e.width/2),this.paddingLeft=Math.max((m-f+a)*this.width/(this.width-f),0),this.paddingRight=Math.max((_-g+a)*this.width/(this.width-g),0)}else{let f=e.height/2,g=t.height/2;s==="start"?(f=0,g=t.height):s==="end"&&(f=e.height,g=0),this.paddingTop=f+a,this.paddingBottom=g+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(){Qt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)xt(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Vg(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:r,_longestTextCache:s}=this,a=[],l=[],u=Math.floor(e/$g(e,i));let d=0,f=0,g,m,_,x,S,T,C,A,F,P,I;for(g=0;g<e;g+=u){if(x=t[g].label,S=this._resolveTickFontOptions(g),r.font=T=S.string,C=s[T]=s[T]||{data:{},gc:[]},A=S.lineHeight,F=P=0,!xt(x)&&!qt(x))F=ka(r,C.data,C.gc,F,x),P=A;else if(qt(x))for(m=0,_=x.length;m<_;++m)I=x[m],!xt(I)&&!qt(I)&&(F=ka(r,C.data,C.gc,F,I),P+=A);a.push(F),l.push(P),d=Math.max(F,d),f=Math.max(P,f)}cC(s,e);const L=a.indexOf(d),N=l.indexOf(f),w=M=>({width:a[M]||0,height:l[M]||0});return{first:w(0),last:w(e-1),widest:w(L),highest:w(N),widths:a,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return KM(this._alignToPixels?ar(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=dC(this.getContext(),t,i))}return this.$context||(this.$context=uC(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=xe(this.labelRotation),i=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),s=this._getLabelSizes(),a=t.autoSkipPadding||0,l=s?s.widest.width+a:0,u=s?s.highest.height+a:0;return this.isHorizontal()?u*i>l*r?l/i:u/r:u*r<l*i?u/i:l/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,r=this.options,{grid:s,position:a,border:l}=r,u=s.offset,d=this.isHorizontal(),g=this.ticks.length+(u?1:0),m=io(s),_=[],x=l.setContext(this.getContext()),S=x.display?x.width:0,T=S/2,C=function(K){return ar(i,K,S)};let A,F,P,I,L,N,w,M,O,B,W,J;if(a==="top")A=C(this.bottom),N=this.bottom-m,M=A-T,B=C(t.top)+T,J=t.bottom;else if(a==="bottom")A=C(this.top),B=t.top,J=C(t.bottom)-T,N=A+T,M=this.top+m;else if(a==="left")A=C(this.right),L=this.right-m,w=A-T,O=C(t.left)+T,W=t.right;else if(a==="right")A=C(this.left),O=t.left,W=C(t.right)-T,L=A+T,w=this.left+m;else if(e==="x"){if(a==="center")A=C((t.top+t.bottom)/2+.5);else if(Pt(a)){const K=Object.keys(a)[0],nt=a[K];A=C(this.chart.scales[K].getPixelForValue(nt))}B=t.top,J=t.bottom,N=A+T,M=N+m}else if(e==="y"){if(a==="center")A=C((t.left+t.right)/2);else if(Pt(a)){const K=Object.keys(a)[0],nt=a[K];A=C(this.chart.scales[K].getPixelForValue(nt))}L=A-T,w=L-m,O=t.left,W=t.right}const ut=kt(r.ticks.maxTicksLimit,g),ft=Math.max(1,Math.ceil(g/ut));for(F=0;F<g;F+=ft){const K=this.getContext(F),nt=s.setContext(K),rt=l.setContext(K),it=nt.lineWidth,at=nt.color,H=rt.dash||[],q=rt.dashOffset,X=nt.tickWidth,_t=nt.tickColor,j=nt.tickBorderDash||[],V=nt.tickBorderDashOffset;P=lC(this,F,u),P!==void 0&&(I=ar(i,P,it),d?L=w=O=W=I:N=M=B=J=I,_.push({tx1:L,ty1:N,tx2:w,ty2:M,x1:O,y1:B,x2:W,y2:J,width:it,color:at,borderDash:H,borderDashOffset:q,tickWidth:X,tickColor:_t,tickBorderDash:j,tickBorderDashOffset:V}))}return this._ticksLength=g,this._borderValue=A,_}_computeLabelItems(t){const e=this.axis,i=this.options,{position:r,ticks:s}=i,a=this.isHorizontal(),l=this.ticks,{align:u,crossAlign:d,padding:f,mirror:g}=s,m=io(i.grid),_=m+f,x=g?-f:_,S=-xe(this.labelRotation),T=[];let C,A,F,P,I,L,N,w,M,O,B,W,J="middle";if(r==="top")L=this.bottom-x,N=this._getXAxisLabelAlignment();else if(r==="bottom")L=this.top+x,N=this._getXAxisLabelAlignment();else if(r==="left"){const ft=this._getYAxisLabelAlignment(m);N=ft.textAlign,I=ft.x}else if(r==="right"){const ft=this._getYAxisLabelAlignment(m);N=ft.textAlign,I=ft.x}else if(e==="x"){if(r==="center")L=(t.top+t.bottom)/2+_;else if(Pt(r)){const ft=Object.keys(r)[0],K=r[ft];L=this.chart.scales[ft].getPixelForValue(K)+_}N=this._getXAxisLabelAlignment()}else if(e==="y"){if(r==="center")I=(t.left+t.right)/2-_;else if(Pt(r)){const ft=Object.keys(r)[0],K=r[ft];I=this.chart.scales[ft].getPixelForValue(K)}N=this._getYAxisLabelAlignment(m).textAlign}e==="y"&&(u==="start"?J="top":u==="end"&&(J="bottom"));const ut=this._getLabelSizes();for(C=0,A=l.length;C<A;++C){F=l[C],P=F.label;const ft=s.setContext(this.getContext(C));w=this.getPixelForTick(C)+s.labelOffset,M=this._resolveTickFontOptions(C),O=M.lineHeight,B=qt(P)?P.length:1;const K=B/2,nt=ft.color,rt=ft.textStrokeColor,it=ft.textStrokeWidth;let at=N;a?(I=w,N==="inner"&&(C===A-1?at=this.options.reverse?"left":"right":C===0?at=this.options.reverse?"right":"left":at="center"),r==="top"?d==="near"||S!==0?W=-B*O+O/2:d==="center"?W=-ut.highest.height/2-K*O+O:W=-ut.highest.height+O/2:d==="near"||S!==0?W=O/2:d==="center"?W=ut.highest.height/2-K*O:W=ut.highest.height-B*O,g&&(W*=-1),S!==0&&!ft.showLabelBackdrop&&(I+=O/2*Math.sin(S))):(L=w,W=(1-B)*O/2);let H;if(ft.showLabelBackdrop){const q=we(ft.backdropPadding),X=ut.heights[C],_t=ut.widths[C];let j=W-q.top,V=0-q.left;switch(J){case"middle":j-=X/2;break;case"bottom":j-=X;break}switch(N){case"center":V-=_t/2;break;case"right":V-=_t;break;case"inner":C===A-1?V-=_t:C>0&&(V-=_t/2);break}H={left:V,top:j,width:_t+q.width,height:X+q.height,color:ft.backdropColor}}T.push({label:P,font:M,textOffset:W,options:{rotation:S,color:nt,strokeColor:rt,strokeWidth:it,textAlign:at,textBaseline:J,translation:[I,L],backdrop:H}})}return T}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-xe(this.labelRotation))return t==="top"?"left":"right";let r="center";return e.align==="start"?r="left":e.align==="end"?r="right":e.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,a=this._getLabelSizes(),l=t+s,u=a.widest.width;let d,f;return e==="left"?r?(f=this.right+s,i==="near"?d="left":i==="center"?(d="center",f+=u/2):(d="right",f+=u)):(f=this.right-l,i==="near"?d="right":i==="center"?(d="center",f-=u/2):(d="left",f=this.left)):e==="right"?r?(f=this.left+s,i==="near"?d="right":i==="center"?(d="center",f-=u/2):(d="left",f-=u)):(f=this.left+l,i==="near"?d="left":i==="center"?(d="center",f+=u/2):(d="right",f=this.right)):d="right",{textAlign:d,x:f}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:r,width:s,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,r,s,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?e.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,a;const l=(u,d,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(u.x,u.y),i.lineTo(d.x,d.y),i.stroke(),i.restore())};if(e.display)for(s=0,a=r.length;s<a;++s){const u=r[s];e.drawOnChartArea&&l({x:u.x1,y:u.y1},{x:u.x2,y:u.y2},u),e.drawTicks&&l({x:u.tx1,y:u.ty1},{x:u.tx2,y:u.ty2},{color:u.tickColor,width:u.tickWidth,borderDash:u.tickBorderDash,borderDashOffset:u.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:r}}=this,s=i.setContext(this.getContext()),a=i.display?s.width:0;if(!a)return;const l=r.setContext(this.getContext(0)).lineWidth,u=this._borderValue;let d,f,g,m;this.isHorizontal()?(d=ar(t,this.left,a)-a/2,f=ar(t,this.right,l)+l/2,g=m=u):(g=ar(t,this.top,a)-a/2,m=ar(t,this.bottom,l)+l/2,d=f=u),e.save(),e.lineWidth=s.width,e.strokeStyle=s.color,e.beginPath(),e.moveTo(d,g),e.lineTo(f,m),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&js(i,r);const s=this.getLabelItems(t);for(const a of s){const l=a.options,u=a.font,d=a.label,f=a.textOffset;lr(i,d,0,f,u,l)}r&&Gs(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:r}}=this;if(!i.display)return;const s=le(i.font),a=we(i.padding),l=i.align;let u=s.lineHeight/2;e==="bottom"||e==="center"||Pt(e)?(u+=a.bottom,qt(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;const{titleX:d,titleY:f,maxWidth:g,rotation:m}=hC(this,u,e,l);lr(t,i.text,0,0,s,{color:i.color,maxWidth:g,rotation:m,textAlign:fC(l,e,r),textBaseline:"middle",translation:[d,f]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=kt(t.grid&&t.grid.z,-1),r=kt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==fr.prototype.draw?[{z:e,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,a;for(s=0,a=e.length;s<a;++s){const l=e[s];l[i]===this.id&&(!t||l.type===t)&&r.push(l)}return r}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return le(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class La{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;mC(e)&&(i=this.register(e));const r=this.items,s=t.id,a=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in r||(r[s]=t,pC(t,a,i),this.override&&se.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,r=this.scope;i in e&&delete e[i],r&&i in se[r]&&(delete se[r][i],this.override&&delete or[i])}}function pC(n,t,e){const i=Us(Object.create(null),[e?se.get(e):{},se.get(t),n.defaults]);se.set(t,i),n.defaultRoutes&&gC(t,n.defaultRoutes),n.descriptors&&se.describe(t,n.descriptors)}function gC(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),r=i.pop(),s=[n].concat(i).join("."),a=t[e].split("."),l=a.pop(),u=a.join(".");se.route(s,r,u,l)})}function mC(n){return"id"in n&&"defaults"in n}class yC{constructor(){this.controllers=new La(Pi,"datasets",!0),this.elements=new La($e,"elements"),this.plugins=new La(Object,"plugins"),this.scales=new La(fr,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):Jt(r,a=>{const l=i||this._getRegistryForType(a);this._exec(t,l,a)})})}_exec(t,e,i){const r=Yc(t);Qt(i["before"+r],[],i),e[t](i),Qt(i["after"+r],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const r=e.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var qn=new yC;class _C{constructor(){this._init=void 0}notify(t,e,i,r){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const s=r?this._descriptors(t).filter(r):this._descriptors(t),a=this._notify(s,t,e,i);return e==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,e,i,r){r=r||{};for(const s of t){const a=s.plugin,l=a[i],u=[e,r,s.options];if(Qt(l,u,a)===!1&&r.cancelable)return!1}return!0}invalidate(){xt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,r=kt(i.options&&i.options.plugins,{}),s=bC(i);return r===!1&&!e?[]:wC(t,s,r,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,r=(s,a)=>s.filter(l=>!a.some(u=>l.plugin.id===u.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}}function bC(n){const t={},e=[],i=Object.keys(qn.plugins.items);for(let s=0;s<i.length;s++)e.push(qn.getPlugin(i[s]));const r=n.plugins||[];for(let s=0;s<r.length;s++){const a=r[s];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function xC(n,t){return!t&&n===!1?null:n===!0?{}:n}function wC(n,{plugins:t,localIds:e},i,r){const s=[],a=n.getContext();for(const l of t){const u=l.id,d=xC(i[u],r);d!==null&&s.push({plugin:l,options:vC(n.config,{plugin:l,local:e[u]},d,a)})}return s}function vC(n,{plugin:t,local:e},i,r){const s=n.pluginScopeKeys(t),a=n.getOptionScopes(i,s);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function mu(n,t){const e=se.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function SC(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function TC(n,t){return n===t?"_index_":"_value_"}function qg(n){if(n==="x"||n==="y"||n==="r")return n}function MC(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function yu(n,...t){if(qg(n))return n;for(const e of t){const i=e.axis||MC(e.position)||n.length>1&&qg(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function jg(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function kC(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return jg(n,"x",e[0])||jg(n,"y",e[0])}return{}}function DC(n,t){const e=or[n.type]||{scales:{}},i=t.scales||{},r=mu(n.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!Pt(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const u=yu(a,l,kC(a,n),se.scales[l.type]),d=TC(u,r),f=e.scales||{};s[a]=Hs(Object.create(null),[{axis:u},l,f[u],f[d]])}),n.data.datasets.forEach(a=>{const l=a.type||n.type,u=a.indexAxis||mu(l,t),f=(or[l]||{}).scales||{};Object.keys(f).forEach(g=>{const m=SC(g,u),_=a[m+"AxisID"]||m;s[_]=s[_]||Object.create(null),Hs(s[_],[{axis:m},i[_],f[g]])})}),Object.keys(s).forEach(a=>{const l=s[a];Hs(l,[se.scales[l.type],se.scale])}),s}function Gg(n){const t=n.options||(n.options={});t.plugins=kt(t.plugins,{}),t.scales=DC(n,t)}function Kg(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function CC(n){return n=n||{},n.data=Kg(n.data),Gg(n),n}const Xg=new Map,Zg=new Set;function Na(n,t){let e=Xg.get(n);return e||(e=t(),Xg.set(n,e),Zg.add(e)),e}const ro=(n,t,e)=>{const i=ki(t,e);i!==void 0&&n.add(i)};class OC{constructor(t){this._config=CC(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=Kg(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(),Gg(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Na(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Na(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Na(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Na(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){const{options:r,type:s}=this,a=this._cachedScopes(t,i),l=a.get(e);if(l)return l;const u=new Set;e.forEach(f=>{t&&(u.add(t),f.forEach(g=>ro(u,t,g))),f.forEach(g=>ro(u,r,g)),f.forEach(g=>ro(u,or[s]||{},g)),f.forEach(g=>ro(u,se,g)),f.forEach(g=>ro(u,Zc,g))});const d=Array.from(u);return d.length===0&&d.push(Object.create(null)),Zg.has(e)&&a.set(e,d),d}chartOptionScopes(){const{options:t,type:e}=this;return[t,or[e]||{},se.datasets[e]||{},{type:e},se,Zc]}resolveNamedOptions(t,e,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:l}=Qg(this._resolverCache,t,r);let u=a;if(EC(a,e)){s.$shared=!1,i=nn(i)?i():i;const d=this.createResolver(t,i,l);u=$r(a,i,d)}for(const d of e)s[d]=u[d];return s}createResolver(t,e,i=[""],r){const{resolver:s}=Qg(this._resolverCache,t,i);return Pt(e)?$r(s,e,void 0,r):s}}function Qg(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const r=e.join();let s=i.get(r);return s||(s={resolver:eu(t,e),subPrefixes:e.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const AC=n=>Pt(n)&&Object.getOwnPropertyNames(n).some(t=>nn(n[t]));function EC(n,t){const{isScriptable:e,isIndexable:i}=Xp(n);for(const r of t){const s=e(r),a=i(r),l=(a||s)&&n[r];if(s&&(nn(l)||AC(l))||a&&qt(l))return!0}return!1}var RC="4.5.1";const PC=["top","bottom","left","right","chartArea"];function Jg(n,t){return n==="top"||n==="bottom"||PC.indexOf(n)===-1&&t==="x"}function tm(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function em(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Qt(e&&e.onComplete,[n],t)}function IC(n){const t=n.chart,e=t.options.animation;Qt(e&&e.onProgress,[n],t)}function nm(n){return ru()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Ba={},im=n=>{const t=nm(n);return Object.values(Ba).filter(e=>e.canvas===t).pop()};function LC(n,t,e){const i=Object.keys(n);for(const r of i){const s=+r;if(s>=t){const a=n[r];delete n[r],(e>0||s>t)&&(n[s+e]=a)}}}function NC(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let rn=class{static defaults=se;static instances=Ba;static overrides=or;static registry=qn;static version=RC;static getChart=im;static register(...t){qn.add(...t),rm()}static unregister(...t){qn.remove(...t),rm()}constructor(t,e){const i=this.config=new OC(e),r=nm(t),s=im(r);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||tC(r)),this.platform.updateConfig(i);const l=this.platform.acquireContext(r,a.aspectRatio),u=l&&l.canvas,d=u&&u.height,f=u&&u.width;if(this.id=BM(),this.ctx=l,this.canvas=u,this.width=f,this.height=d,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 _C,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=JM(g=>this.update(g),a.resizeDelay||0),this._dataChanges=[],Ba[this.id]=this,!l||!u){console.error("Failed to create chart: can't acquire context from the given item");return}oi.listen(this,"complete",em),oi.listen(this,"progress",IC),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:s}=this;return xt(t)?e&&s?s:r?i/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return qn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():rg(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return jp(this.canvas,this.ctx),this}stop(){return oi.stop(this),this}resize(t,e){oi.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,t,e,s),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,rg(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),Qt(i.onResize,[this,a],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Jt(e,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((a,l)=>(a[l]=!1,a),{});let s=[];e&&(s=s.concat(Object.keys(e).map(a=>{const l=e[a],u=yu(a,l),d=u==="r",f=u==="x";return{options:l,dposition:d?"chartArea":f?"bottom":"left",dtype:d?"radialLinear":f?"category":"linear"}}))),Jt(s,a=>{const l=a.options,u=l.id,d=yu(u,l),f=kt(l.type,a.dtype);(l.position===void 0||Jg(l.position,d)!==Jg(a.dposition))&&(l.position=a.dposition),r[u]=!0;let g=null;if(u in i&&i[u].type===f)g=i[u];else{const m=qn.getScale(f);g=new m({id:u,type:f,ctx:this.ctx,chart:this}),i[g.id]=g}g.init(l,t)}),Jt(r,(a,l)=>{a||delete i[l]}),Jt(i,a=>{We.configure(this,a,a.options),We.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((r,s)=>r.index-s.index),i>e){for(let r=e;r<i;++r)this._destroyDatasetMeta(r);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(tm("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,r)=>{e.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=e.length;i<r;i++){const s=e[i];let a=this.getDatasetMeta(i);const l=s.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=l,a.indexAxis=s.indexAxis||mu(l,this.options),a.order=s.order||0,a.index=i,a.label=""+s.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const u=qn.getController(l),{datasetElementType:d,dataElementType:f}=se.datasets[l];Object.assign(u,{dataElementType:qn.getElement(f),datasetElementType:d&&qn.getElement(d)}),a.controller=new u(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Jt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let d=0,f=this.data.datasets.length;d<f;d++){const{controller:g}=this.getDatasetMeta(d),m=!r&&s.indexOf(g)===-1;g.buildOrUpdateElements(m),a=Math.max(+g.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),r||Jt(s,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(tm("z","_idx"));const{_active:l,_lastEvent:u}=this;u?this._eventHandler(u,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Jt(this.scales,t=>{We.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Rp(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of e){const a=i==="_removeElements"?-s:s;LC(t,r,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=s=>new Set(t.filter(a=>a[0]===s).map((a,l)=>l+","+a.splice(1).join(","))),r=i(0);for(let s=1;s<e;s++)if(!Rp(r,i(s)))return;return Array.from(r).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;We.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Jt(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,nn(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(e),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(oi.has(this)?this.attached&&!oi.running(this)&&oi.start(this):(this.draw(),em({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,r)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let r,s;for(r=0,s=e.length;r<s;++r){const a=e[r];(!t||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},r=pg(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(r&&js(e,r),t.controller.draw(),r&&Gs(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return si(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const s=pu.modes[e];return typeof s=="function"?s(this,t,i,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let r=i.filter(s=>s&&s._dataset===e).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=Ai(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const r=i?"show":"hide",s=this.getDatasetMeta(t),a=s.controller._resolveAnimations(void 0,r);en(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(s,{visible:i}),this.update(l=>l.datasetIndex===t?r:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),oi.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),jp(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ba[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(s,a)=>{e.addEventListener(this,s,a),t[s]=a},r=(s,a,l)=>{s.offsetX=a,s.offsetY=l,this._eventHandler(s)};Jt(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(u,d)=>{e.addEventListener(this,u,d),t[u]=d},r=(u,d)=>{t[u]&&(e.removeEventListener(this,u,d),delete t[u])},s=(u,d)=>{this.canvas&&this.resize(u,d)};let a;const l=()=>{r("attach",l),this.attached=!0,this.resize(),i("resize",s),i("detach",a)};a=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),i("attach",l)},e.isAttached(this.canvas)?l():a()}unbindEvents(){Jt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Jt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const r=i?"set":"remove";let s,a,l,u;for(e==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),l=0,u=t.length;l<u;++l){a=t[l];const d=a&&this.getDatasetMeta(a.datasetIndex).controller;d&&d[r+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:s,index:a})=>{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[a],index:a}});!ya(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const r=this.options.hover,s=(u,d)=>u.filter(f=>!d.some(g=>f.datasetIndex===g.datasetIndex&&f.index===g.index)),a=s(e,t),l=i?t:s(t,e);a.length&&this.updateHoverStyle(a,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:r=[],options:s}=this,a=e,l=this._getActiveElements(t,r,i,a),u=$M(t),d=NC(t,this._lastEvent,i,u);i&&(this._lastEvent=null,Qt(s.onHover,[t,l,this],this),u&&Qt(s.onClick,[t,l,this],this));const f=!ya(l,r);return(f||e)&&(this._active=l,this._updateHoverStyles(l,r,e)),this._lastEvent=d,f}_getActiveElements(t,e,i,r){if(t.type==="mouseout")return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}};function rm(){return Jt(rn.instances,n=>n._plugins.invalidate())}function BC(n,t,e){const{startAngle:i,x:r,y:s,outerRadius:a,innerRadius:l,options:u}=t,{borderWidth:d,borderJoinStyle:f}=u,g=Math.min(d/a,Ue(i-e));if(n.beginPath(),n.arc(r,s,a-d/2,i+g/2,e-g/2),l>0){const m=Math.min(d/l,Ue(i-e));n.arc(r,s,l+d/2,e-m/2,i+m/2,!0)}else{const m=Math.min(d/2,a*Ue(i-e));if(f==="round")n.arc(r,s,m,e-Et/2,i+Et/2,!0);else if(f==="bevel"){const _=2*m*m,x=-_*Math.cos(e+Et/2)+r,S=-_*Math.sin(e+Et/2)+s,T=_*Math.cos(i+Et/2)+r,C=_*Math.sin(i+Et/2)+s;n.lineTo(x,S),n.lineTo(T,C)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function FC(n,t,e){const{startAngle:i,pixelMargin:r,x:s,y:a,outerRadius:l,innerRadius:u}=t;let d=r/l;n.beginPath(),n.arc(s,a,l,i-d,e+d),u>r?(d=r/u,n.arc(s,a,u,e+d,i-d,!0)):n.arc(s,a,r,e+re,i-re),n.closePath(),n.clip()}function zC(n){return tu(n,["outerStart","outerEnd","innerStart","innerEnd"])}function UC(n,t,e,i){const r=zC(n.options.borderRadius),s=(e-t)/2,a=Math.min(s,i*t/2),l=u=>{const d=(e-Math.min(s,u))*i/2;return Ce(u,0,Math.min(s,d))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:Ce(r.innerStart,0,a),innerEnd:Ce(r.innerEnd,0,a)}}function qr(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Fa(n,t,e,i,r,s){const{x:a,y:l,startAngle:u,pixelMargin:d,innerRadius:f}=t,g=Math.max(t.outerRadius+i+e-d,0),m=f>0?f+i+e+d:0;let _=0;const x=r-u;if(i){const ft=f>0?f-i:0,K=g>0?g-i:0,nt=(ft+K)/2,rt=nt!==0?x*nt/(nt+i):x;_=(x-rt)/2}const S=Math.max(.001,x*g-e/Et)/g,T=(x-S)/2,C=u+T+_,A=r-T-_,{outerStart:F,outerEnd:P,innerStart:I,innerEnd:L}=UC(t,m,g,A-C),N=g-F,w=g-P,M=C+F/N,O=A-P/w,B=m+I,W=m+L,J=C+I/B,ut=A-L/W;if(n.beginPath(),s){const ft=(M+O)/2;if(n.arc(a,l,g,M,ft),n.arc(a,l,g,ft,O),P>0){const it=qr(w,O,a,l);n.arc(it.x,it.y,P,O,A+re)}const K=qr(W,A,a,l);if(n.lineTo(K.x,K.y),L>0){const it=qr(W,ut,a,l);n.arc(it.x,it.y,L,A+re,ut+Math.PI)}const nt=(A-L/m+(C+I/m))/2;if(n.arc(a,l,m,A-L/m,nt,!0),n.arc(a,l,m,nt,C+I/m,!0),I>0){const it=qr(B,J,a,l);n.arc(it.x,it.y,I,J+Math.PI,C-re)}const rt=qr(N,C,a,l);if(n.lineTo(rt.x,rt.y),F>0){const it=qr(N,M,a,l);n.arc(it.x,it.y,F,C-re,M)}}else{n.moveTo(a,l);const ft=Math.cos(M)*g+a,K=Math.sin(M)*g+l;n.lineTo(ft,K);const nt=Math.cos(O)*g+a,rt=Math.sin(O)*g+l;n.lineTo(nt,rt)}n.closePath()}function HC(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:l}=t;let u=t.endAngle;if(s){Fa(n,t,e,i,u,r);for(let d=0;d<s;++d)n.fill();isNaN(l)||(u=a+(l%te||te))}return Fa(n,t,e,i,u,r),n.fill(),u}function WC(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:l,options:u}=t,{borderWidth:d,borderJoinStyle:f,borderDash:g,borderDashOffset:m,borderRadius:_}=u,x=u.borderAlign==="inner";if(!d)return;n.setLineDash(g||[]),n.lineDashOffset=m,x?(n.lineWidth=d*2,n.lineJoin=f||"round"):(n.lineWidth=d,n.lineJoin=f||"bevel");let S=t.endAngle;if(s){Fa(n,t,e,i,S,r);for(let T=0;T<s;++T)n.stroke();isNaN(l)||(S=a+(l%te||te))}x&&FC(n,t,S),u.selfJoin&&S-a>=Et&&_===0&&f!=="miter"&&BC(n,t,S),s||(Fa(n,t,e,i,S,r),n.stroke())}class $C extends $e{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,e,i){const r=this.getProps(["x","y"],i),{angle:s,distance:a}=va(r,{x:t,y:e}),{startAngle:l,endAngle:u,innerRadius:d,outerRadius:f,circumference:g}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),m=(this.options.spacing+this.options.borderWidth)/2,_=kt(g,u-l),x=$s(s,l,u)&&l!==u,S=_>=te||x,T=ii(a,d+m,f+m);return S&&T}getCenterPoint(t){const{x:e,y:i,startAngle:r,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:u,spacing:d}=this.options,f=(r+s)/2,g=(a+l+d+u)/2;return{x:e+Math.cos(f)*g,y:i+Math.sin(f)*g}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,r=(e.offset||0)/4,s=(e.spacing||0)/2,a=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>te?Math.floor(i/te):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const l=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(l)*r,Math.sin(l)*r);const u=1-Math.sin(Math.min(Et,i||0)),d=r*u;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,HC(t,this,d,s,a),WC(t,this,d,s,a),t.restore()}}function sm(n,t,e=t){n.lineCap=kt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(kt(e.borderDash,t.borderDash)),n.lineDashOffset=kt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=kt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=kt(e.borderWidth,t.borderWidth),n.strokeStyle=kt(e.borderColor,t.borderColor)}function VC(n,t,e){n.lineTo(e.x,e.y)}function YC(n){return n.stepped?dk:n.tension||n.cubicInterpolationMode==="monotone"?fk:VC}function om(n,t,e={}){const i=n.length,{start:r=0,end:s=i-1}=e,{start:a,end:l}=t,u=Math.max(r,a),d=Math.min(s,l),f=r<a&&s<a||r>l&&s>l;return{count:i,start:u,loop:t.loop,ilen:d<u&&!f?i+d-u:d-u}}function qC(n,t,e,i){const{points:r,options:s}=t,{count:a,start:l,loop:u,ilen:d}=om(r,e,i),f=YC(s);let{move:g=!0,reverse:m}=i||{},_,x,S;for(_=0;_<=d;++_)x=r[(l+(m?d-_:_))%a],!x.skip&&(g?(n.moveTo(x.x,x.y),g=!1):f(n,S,x,m,s.stepped),S=x);return u&&(x=r[(l+(m?d:0))%a],f(n,S,x,m,s.stepped)),!!u}function jC(n,t,e,i){const r=t.points,{count:s,start:a,ilen:l}=om(r,e,i),{move:u=!0,reverse:d}=i||{};let f=0,g=0,m,_,x,S,T,C;const A=P=>(a+(d?l-P:P))%s,F=()=>{S!==T&&(n.lineTo(f,T),n.lineTo(f,S),n.lineTo(f,C))};for(u&&(_=r[A(0)],n.moveTo(_.x,_.y)),m=0;m<=l;++m){if(_=r[A(m)],_.skip)continue;const P=_.x,I=_.y,L=P|0;L===x?(I<S?S=I:I>T&&(T=I),f=(g*f+P)/++g):(F(),n.lineTo(P,I),x=L,g=0,S=T=I),C=I}F()}function _u(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?jC:qC}function GC(n){return n.stepped?Vk:n.tension||n.cubicInterpolationMode==="monotone"?Yk:ur}function KC(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),sm(n,t.options),n.stroke(r)}function XC(n,t,e,i){const{segments:r,options:s}=t,a=_u(t);for(const l of r)sm(n,s,l.style),n.beginPath(),a(n,t,l,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const ZC=typeof Path2D=="function";function QC(n,t,e,i){ZC&&!t.options.segment?KC(n,t,e,i):XC(n,t,e,i)}class za extends $e{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,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;Nk(this._points,i,t,r,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Zk(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,r=t[e],s=this.points,a=dg(this,{property:e,start:r,end:r});if(!a.length)return;const l=[],u=GC(i);let d,f;for(d=0,f=a.length;d<f;++d){const{start:g,end:m}=a[d],_=s[g],x=s[m];if(_===x){l.push(_);continue}const S=Math.abs((r-_[e])/(x[e]-_[e])),T=u(_,x,S,i.stepped);T[e]=t[e],l.push(T)}return l.length===1?l[0]:l}pathSegment(t,e,i){return _u(this)(t,this,e,i)}path(t,e,i){const r=this.segments,s=_u(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const l of r)a&=s(t,this,l,{start:e,end:e+i-1});return!!a}draw(t,e,i,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),QC(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function am(n,t,e,i){const r=n.options,{[e]:s}=n.getProps([e],i);return Math.abs(t-s)<r.radius+r.hitRadius}class JC extends $e{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,e,i){const r=this.options,{x:s,y:a}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(t,e){return am(this,t,"x",e)}inYRange(t,e){return am(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const i=e&&t.borderWidth||0;return(e+i)*2}draw(t,e){const i=this.options;this.skip||i.radius<.1||!si(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Jc(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function lm(n,t){const{x:e,y:i,base:r,width:s,height:a}=n.getProps(["x","y","base","width","height"],t);let l,u,d,f,g;return n.horizontal?(g=a/2,l=Math.min(e,r),u=Math.max(e,r),d=i-g,f=i+g):(g=s/2,l=e-g,u=e+g,d=Math.min(i,r),f=Math.max(i,r)),{left:l,top:d,right:u,bottom:f}}function Ii(n,t,e,i){return n?0:Ce(t,e,i)}function tO(n,t,e){const i=n.options.borderWidth,r=n.borderSkipped,s=Kp(i);return{t:Ii(r.top,s.top,0,e),r:Ii(r.right,s.right,0,t),b:Ii(r.bottom,s.bottom,0,e),l:Ii(r.left,s.left,0,t)}}function eO(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,s=Oi(r),a=Math.min(t,e),l=n.borderSkipped,u=i||Pt(r);return{topLeft:Ii(!u||l.top||l.left,s.topLeft,0,a),topRight:Ii(!u||l.top||l.right,s.topRight,0,a),bottomLeft:Ii(!u||l.bottom||l.left,s.bottomLeft,0,a),bottomRight:Ii(!u||l.bottom||l.right,s.bottomRight,0,a)}}function nO(n){const t=lm(n),e=t.right-t.left,i=t.bottom-t.top,r=tO(n,e/2,i/2),s=eO(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:e-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function bu(n,t,e,i){const r=t===null,s=e===null,l=n&&!(r&&s)&&lm(n,i);return l&&(r||ii(t,l.left,l.right))&&(s||ii(e,l.top,l.bottom))}function iO(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function rO(n,t){n.rect(t.x,t.y,t.w,t.h)}function xu(n,t,e={}){const i=n.x!==e.x?-t:0,r=n.y!==e.y?-t:0,s=(n.x+n.w!==e.x+e.w?t:0)-i,a=(n.y+n.h!==e.y+e.h?t:0)-r;return{x:n.x+i,y:n.y+r,w:n.w+s,h:n.h+a,radius:n.radius}}class sO extends $e{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:e,options:{borderColor:i,backgroundColor:r}}=this,{inner:s,outer:a}=nO(this),l=iO(a.radius)?Wr:rO;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),l(t,xu(a,e,s)),t.clip(),l(t,xu(s,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),l(t,xu(s,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,i){return bu(this,t,e,i)}inXRange(t,e){return bu(this,t,null,e)}inYRange(t,e){return bu(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(e+r)/2:e,y:s?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var oO=Object.freeze({__proto__:null,ArcElement:$C,BarElement:sO,LineElement:za,PointElement:JC});const wu=["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)"],cm=wu.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function um(n){return wu[n%wu.length]}function dm(n){return cm[n%cm.length]}function aO(n,t){return n.borderColor=um(t),n.backgroundColor=dm(t),++t}function lO(n,t){return n.backgroundColor=n.data.map(()=>um(t++)),t}function cO(n,t){return n.backgroundColor=n.data.map(()=>dm(t++)),t}function uO(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof Zs?t=lO(e,t):r instanceof Cg?t=cO(e,t):r&&(t=aO(e,t))}}function fm(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function dO(n){return n&&(n.borderColor||n.backgroundColor)}function fO(){return se.borderColor!=="rgba(0,0,0,0.1)"||se.backgroundColor!=="rgba(0,0,0,0.1)"}var hO={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:r}=n.config,{elements:s}=r,a=fm(i)||dO(r)||s&&fm(s)||fO();if(!e.forceOverride&&a)return;const l=uO(n);i.forEach(l)}};function pO(n,t,e,i,r){const s=r.samples||i;if(s>=e)return n.slice(t,t+e);const a=[],l=(e-2)/(s-2);let u=0;const d=t+e-1;let f=t,g,m,_,x,S;for(a[u++]=n[f],g=0;g<s-2;g++){let T=0,C=0,A;const F=Math.floor((g+1)*l)+1+t,P=Math.min(Math.floor((g+2)*l)+1,e)+t,I=P-F;for(A=F;A<P;A++)T+=n[A].x,C+=n[A].y;T/=I,C/=I;const L=Math.floor(g*l)+1+t,N=Math.min(Math.floor((g+1)*l)+1,e)+t,{x:w,y:M}=n[f];for(_=x=-1,A=L;A<N;A++)x=.5*Math.abs((w-T)*(n[A].y-M)-(w-n[A].x)*(C-M)),x>_&&(_=x,m=n[A],S=A);a[u++]=m,f=S}return a[u++]=n[d],a}function gO(n,t,e,i){let r=0,s=0,a,l,u,d,f,g,m,_,x,S;const T=[],C=t+e-1,A=n[t].x,P=n[C].x-A;for(a=t;a<t+e;++a){l=n[a],u=(l.x-A)/P*i,d=l.y;const I=u|0;if(I===f)d<x?(x=d,g=a):d>S&&(S=d,m=a),r=(s*r+l.x)/++s;else{const L=a-1;if(!xt(g)&&!xt(m)){const N=Math.min(g,m),w=Math.max(g,m);N!==_&&N!==L&&T.push({...n[N],x:r}),w!==_&&w!==L&&T.push({...n[w],x:r})}a>0&&L!==_&&T.push(n[L]),T.push(l),f=I,s=0,x=S=d,g=m=_=a}}return T}function hm(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function pm(n){n.data.datasets.forEach(t=>{hm(t)})}function mO(n,t){const e=t.length;let i=0,r;const{iScale:s}=n,{min:a,max:l,minDefined:u,maxDefined:d}=s.getUserBounds();return u&&(i=Ce(ri(t,s.axis,a).lo,0,e-1)),d?r=Ce(ri(t,s.axis,l).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var yO={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){pm(n);return}const i=n.width;n.data.datasets.forEach((r,s)=>{const{_data:a,indexAxis:l}=r,u=n.getDatasetMeta(s),d=a||r.data;if(Ks([l,n.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const f=n.scales[u.xAxisID];if(f.type!=="linear"&&f.type!=="time"||n.options.parsing)return;let{start:g,count:m}=mO(u,d);const _=e.threshold||4*i;if(m<=_){hm(r);return}xt(a)&&(r._data=d,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(S){this._data=S}}));let x;switch(e.algorithm){case"lttb":x=pO(d,g,m,i,e);break;case"min-max":x=gO(d,g,m,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=x})},destroy(n){pm(n)}};function _O(n,t,e){const i=n.segments,r=n.points,s=t.points,a=[];for(const l of i){let{start:u,end:d}=l;d=Ua(u,d,r);const f=vu(e,r[u],r[d],l.loop);if(!t.segments){a.push({source:l,target:f,start:r[u],end:r[d]});continue}const g=dg(t,f);for(const m of g){const _=vu(e,s[m.start],s[m.end],m.loop),x=ug(l,r,_);for(const S of x)a.push({source:S,target:m,start:{[e]:gm(f,_,"start",Math.max)},end:{[e]:gm(f,_,"end",Math.min)}})}}return a}function vu(n,t,e,i){if(i)return;let r=t[n],s=e[n];return n==="angle"&&(r=Ue(r),s=Ue(s)),{property:n,start:r,end:s}}function bO(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,s=[];return t.segments.forEach(({start:a,end:l})=>{l=Ua(a,l,r);const u=r[a],d=r[l];i!==null?(s.push({x:u.x,y:i}),s.push({x:d.x,y:i})):e!==null&&(s.push({x:e,y:u.y}),s.push({x:e,y:d.y}))}),s}function Ua(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function gm(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function mm(n,t){let e=[],i=!1;return qt(n)?(i=!0,e=n):e=bO(n,t),e.length?new za({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function ym(n){return n&&n.fill!==!1}function xO(n,t,e){let r=n[t].fill;const s=[t];let a;if(!e)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!ae(r))return r;if(a=n[r],!a)return!1;if(a.visible)return r;s.push(r),r=a.fill}return!1}function wO(n,t,e){const i=MO(n);if(Pt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return ae(r)&&Math.floor(r)===r?vO(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function vO(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function SO(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:Pt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function TO(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:Pt(n)?i=n.value:i=t.getBaseValue(),i}function MO(n){const t=n.options,e=t.fill;let i=kt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function kO(n){const{scale:t,index:e,line:i}=n,r=[],s=i.segments,a=i.points,l=DO(t,e);l.push(mm({x:null,y:t.bottom},i));for(let u=0;u<s.length;u++){const d=s[u];for(let f=d.start;f<=d.end;f++)CO(r,a[f],l)}return new za({points:r,options:{}})}function DO(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const s=i[r];if(s.index===t)break;s.hidden||e.unshift(s.dataset)}return e}function CO(n,t,e){const i=[];for(let r=0;r<e.length;r++){const s=e[r],{first:a,last:l,point:u}=OO(s,t,"x");if(!(!u||a&&l)){if(a)i.unshift(u);else if(n.push(u),!l)break}}n.push(...i)}function OO(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const r=i[e],s=n.segments,a=n.points;let l=!1,u=!1;for(let d=0;d<s.length;d++){const f=s[d],g=a[f.start][e],m=a[f.end][e];if(ii(r,g,m)){l=r===g,u=r===m;break}}return{first:l,last:u,point:i}}class _m{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:r,y:s,radius:a}=this;return e=e||{start:0,end:te},t.arc(r,s,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:r}=this,s=t.angle;return{x:e+Math.cos(s)*r,y:i+Math.sin(s)*r,angle:s}}}function AO(n){const{chart:t,fill:e,line:i}=n;if(ae(e))return EO(t,e);if(e==="stack")return kO(n);if(e==="shape")return!0;const r=RO(n);return r instanceof _m?r:mm(r,i)}function EO(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function RO(n){return(n.scale||{}).getPointPositionForValue?IO(n):PO(n)}function PO(n){const{scale:t={},fill:e}=n,i=SO(e,t);if(ae(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function IO(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=TO(e,t,s),l=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,s);return new _m({x:u.x,y:u.y,radius:t.getDistanceFromCenterForValue(a)})}for(let u=0;u<r;++u)l.push(t.getPointPositionForValue(u,a));return l}function Su(n,t,e){const i=AO(t),{chart:r,index:s,line:a,scale:l,axis:u}=t,d=a.options,f=d.fill,g=d.backgroundColor,{above:m=g,below:_=g}=f||{},x=r.getDatasetMeta(s),S=pg(r,x);i&&a.points.length&&(js(n,e),LO(n,{line:a,target:i,above:m,below:_,area:e,scale:l,axis:u,clip:S}),Gs(n))}function LO(n,t){const{line:e,target:i,above:r,below:s,area:a,scale:l,clip:u}=t,d=e._loop?"angle":t.axis;n.save();let f=s;s!==r&&(d==="x"?(bm(n,i,a.top),Tu(n,{line:e,target:i,color:r,scale:l,property:d,clip:u}),n.restore(),n.save(),bm(n,i,a.bottom)):d==="y"&&(xm(n,i,a.left),Tu(n,{line:e,target:i,color:s,scale:l,property:d,clip:u}),n.restore(),n.save(),xm(n,i,a.right),f=r)),Tu(n,{line:e,target:i,color:f,scale:l,property:d,clip:u}),n.restore()}function bm(n,t,e){const{segments:i,points:r}=t;let s=!0,a=!1;n.beginPath();for(const l of i){const{start:u,end:d}=l,f=r[u],g=r[Ua(u,d,r)];s?(n.moveTo(f.x,f.y),s=!1):(n.lineTo(f.x,e),n.lineTo(f.x,f.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(g.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function xm(n,t,e){const{segments:i,points:r}=t;let s=!0,a=!1;n.beginPath();for(const l of i){const{start:u,end:d}=l,f=r[u],g=r[Ua(u,d,r)];s?(n.moveTo(f.x,f.y),s=!1):(n.lineTo(e,f.y),n.lineTo(f.x,f.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(e,g.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function Tu(n,t){const{line:e,target:i,property:r,color:s,scale:a,clip:l}=t,u=_O(e,i,r);for(const{source:d,target:f,start:g,end:m}of u){const{style:{backgroundColor:_=s}={}}=d,x=i!==!0;n.save(),n.fillStyle=_,NO(n,a,l,x&&vu(r,g,m)),n.beginPath();const S=!!e.pathSegment(n,d);let T;if(x){S?n.closePath():wm(n,i,m,r);const C=!!i.pathSegment(n,f,{move:S,reverse:!0});T=S&&C,T||wm(n,i,g,r)}n.closePath(),n.fill(T?"evenodd":"nonzero"),n.restore()}}function NO(n,t,e,i){const r=t.chart.chartArea,{property:s,start:a,end:l}=i||{};if(s==="x"||s==="y"){let u,d,f,g;s==="x"?(u=a,d=r.top,f=l,g=r.bottom):(u=r.left,d=a,f=r.right,g=l),n.beginPath(),e&&(u=Math.max(u,e.left),f=Math.min(f,e.right),d=Math.max(d,e.top),g=Math.min(g,e.bottom)),n.rect(u,d,f-u,g-d),n.clip()}}function wm(n,t,e,i){const r=t.interpolate(e,i);r&&n.lineTo(r.x,r.y)}var BO={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,r=[];let s,a,l,u;for(a=0;a<i;++a)s=n.getDatasetMeta(a),l=s.dataset,u=null,l&&l.options&&l instanceof za&&(u={visible:n.isDatasetVisible(a),index:a,fill:wO(l,a,i),chart:n,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=u,r.push(u);for(a=0;a<i;++a)u=r[a],!(!u||u.fill===!1)&&(u.fill=xO(r,a,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",r=n.getSortedVisibleDatasetMetas(),s=n.chartArea;for(let a=r.length-1;a>=0;--a){const l=r[a].$filler;l&&(l.line.updateControlPoints(s,l.axis),i&&l.fill&&Su(n.ctx,l,s))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const s=i[r].$filler;ym(s)&&Su(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!ym(i)||e.drawTime!=="beforeDatasetDraw"||Su(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const vm=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},FO=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Sm extends $e{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Qt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=le(i.font),s=r.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:u}=vm(i,s);let d,f;e.font=r.string,this.isHorizontal()?(d=this.maxWidth,f=this._fitRows(a,s,l,u)+10):(f=this.maxHeight,d=this._fitCols(a,r,l,u)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(f,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,r){const{ctx:s,maxWidth:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.lineWidths=[0],f=r+l;let g=t;s.textAlign="left",s.textBaseline="middle";let m=-1,_=-f;return this.legendItems.forEach((x,S)=>{const T=i+e/2+s.measureText(x.text).width;(S===0||d[d.length-1]+T+2*l>a)&&(g+=f,d[d.length-(S>0?0:1)]=0,_+=f,m++),u[S]={left:0,top:_,row:m,width:T,height:r},d[d.length-1]+=T+l}),g}_fitCols(t,e,i,r){const{ctx:s,maxHeight:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.columnSizes=[],f=a-t;let g=l,m=0,_=0,x=0,S=0;return this.legendItems.forEach((T,C)=>{const{itemWidth:A,itemHeight:F}=zO(i,e,s,T,r);C>0&&_+F+2*l>f&&(g+=m+l,d.push({width:m,height:_}),x+=m+l,S++,m=_=0),u[C]={left:x,top:_,col:S,width:A,height:F},m=Math.max(m,A),_+=F+l}),g+=m,d.push({width:m,height:_}),g}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:s}}=this,a=Yr(s,this.left,this.width);if(this.isHorizontal()){let l=0,u=He(i,this.left+r,this.right-this.lineWidths[l]);for(const d of e)l!==d.row&&(l=d.row,u=He(i,this.left+r,this.right-this.lineWidths[l])),d.top+=this.top+t+r,d.left=a.leftForLtr(a.x(u),d.width),u+=d.width+r}else{let l=0,u=He(i,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const d of e)d.col!==l&&(l=d.col,u=He(i,this.top+t+r,this.bottom-this.columnSizes[l].height)),d.top=u,d.left+=this.left+r,d.left=a.leftForLtr(a.x(d.left),d.width),u+=d.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;js(t,this),this._draw(),Gs(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:s,labels:a}=t,l=se.color,u=Yr(t.rtl,this.left,this.width),d=le(a.font),{padding:f}=a,g=d.size,m=g/2;let _;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=d.string;const{boxWidth:x,boxHeight:S,itemHeight:T}=vm(a,g),C=function(L,N,w){if(isNaN(x)||x<=0||isNaN(S)||S<0)return;r.save();const M=kt(w.lineWidth,1);if(r.fillStyle=kt(w.fillStyle,l),r.lineCap=kt(w.lineCap,"butt"),r.lineDashOffset=kt(w.lineDashOffset,0),r.lineJoin=kt(w.lineJoin,"miter"),r.lineWidth=M,r.strokeStyle=kt(w.strokeStyle,l),r.setLineDash(kt(w.lineDash,[])),a.usePointStyle){const O={radius:S*Math.SQRT2/2,pointStyle:w.pointStyle,rotation:w.rotation,borderWidth:M},B=u.xPlus(L,x/2),W=N+m;Gp(r,O,B,W,a.pointStyleWidth&&x)}else{const O=N+Math.max((g-S)/2,0),B=u.leftForLtr(L,x),W=Oi(w.borderRadius);r.beginPath(),Object.values(W).some(J=>J!==0)?Wr(r,{x:B,y:O,w:x,h:S,radius:W}):r.rect(B,O,x,S),r.fill(),M!==0&&r.stroke()}r.restore()},A=function(L,N,w){lr(r,w.text,L,N+T/2,d,{strikethrough:w.hidden,textAlign:u.textAlign(w.textAlign)})},F=this.isHorizontal(),P=this._computeTitleHeight();F?_={x:He(s,this.left+f,this.right-i[0]),y:this.top+f+P,line:0}:_={x:this.left+f,y:He(s,this.top+P+f,this.bottom-e[0].height),line:0},og(this.ctx,t.textDirection);const I=T+f;this.legendItems.forEach((L,N)=>{r.strokeStyle=L.fontColor,r.fillStyle=L.fontColor;const w=r.measureText(L.text).width,M=u.textAlign(L.textAlign||(L.textAlign=a.textAlign)),O=x+m+w;let B=_.x,W=_.y;u.setWidth(this.width),F?N>0&&B+O+f>this.right&&(W=_.y+=I,_.line++,B=_.x=He(s,this.left+f,this.right-i[_.line])):N>0&&W+I>this.bottom&&(B=_.x=B+e[_.line].width+f,_.line++,W=_.y=He(s,this.top+P+f,this.bottom-e[_.line].height));const J=u.x(B);if(C(J,W,L),B=tk(M,B+x+m,F?B+O:this.right,t.rtl),A(u.x(B),W,L),F)_.x+=O+f;else if(typeof L.text!="string"){const ut=d.lineHeight;_.y+=Tm(L,ut)+f}else _.y+=I}),ag(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=le(e.font),r=we(e.padding);if(!e.display)return;const s=Yr(t.rtl,this.left,this.width),a=this.ctx,l=e.position,u=i.size/2,d=r.top+u;let f,g=this.left,m=this.width;if(this.isHorizontal())m=Math.max(...this.lineWidths),f=this.top+d,g=He(t.align,g,this.right-m);else{const x=this.columnSizes.reduce((S,T)=>Math.max(S,T.height),0);f=d+He(t.align,this.top,this.bottom-x-t.labels.padding-this._computeTitleHeight())}const _=He(l,g,g+m);a.textAlign=s.textAlign(Gc(l)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,lr(a,e.text,_,f,i)}_computeTitleHeight(){const t=this.options.title,e=le(t.font),i=we(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,s;if(ii(t,this.left,this.right)&&ii(e,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(r=s[i],ii(t,r.left,r.left+r.width)&&ii(e,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!WO(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=FO(r,i);r&&!s&&Qt(e.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!s&&Qt(e.onHover,[t,i,this],this)}else i&&Qt(e.onClick,[t,i,this],this)}}function zO(n,t,e,i,r){const s=UO(i,n,t,e),a=HO(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function UO(n,t,e,i){let r=n.text;return r&&typeof r!="string"&&(r=r.reduce((s,a)=>s.length>a.length?s:a)),t+e.size/2+i.measureText(r).width}function HO(n,t,e){let i=n;return typeof t.text!="string"&&(i=Tm(t,e)),i}function Tm(n,t){const e=n.text?n.text.length:0;return t*e}function WO(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var $O={id:"legend",_element:Sm,start(n,t,e){const i=n.legend=new Sm({ctx:n.ctx,options:e,chart:n});We.configure(n,i,e),We.addBox(n,i)},stop(n){We.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;We.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,r=e.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=n.legend.options;return n._getSortedDatasetMetas().map(u=>{const d=u.controller.getStyle(e?0:void 0),f=we(d.borderWidth);return{text:t[u.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!u.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(f.width+f.height)/4,strokeStyle:d.borderColor,pointStyle:i||d.pointStyle,rotation:d.rotation,textAlign:r||d.textAlign,borderRadius:a&&(l||d.borderRadius),datasetIndex:u.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class Mu extends $e{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const r=qt(i.text)?i.text.length:1;this._padding=we(i.padding);const s=r*le(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:r,right:s,options:a}=this,l=a.align;let u=0,d,f,g;return this.isHorizontal()?(f=He(l,i,s),g=e+t,d=s-i):(a.position==="left"?(f=i+t,g=He(l,r,e),u=Et*-.5):(f=s-t,g=He(l,e,r),u=Et*.5),d=r-e),{titleX:f,titleY:g,maxWidth:d,rotation:u}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=le(e.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:u,rotation:d}=this._drawArgs(s);lr(t,e.text,0,0,i,{color:e.color,maxWidth:u,rotation:d,textAlign:Gc(e.align),textBaseline:"middle",translation:[a,l]})}}function VO(n,t){const e=new Mu({ctx:n.ctx,options:t,chart:n});We.configure(n,e,t),We.addBox(n,e),n.titleBlock=e}var YO={id:"title",_element:Mu,start(n,t,e){VO(n,e)},stop(n){const t=n.titleBlock;We.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;We.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ha=new WeakMap;var qO={id:"subtitle",start(n,t,e){const i=new Mu({ctx:n.ctx,options:e,chart:n});We.configure(n,i,e),We.addBox(n,i),Ha.set(n,i)},stop(n){We.removeBox(n,Ha.get(n)),Ha.delete(n)},beforeUpdate(n,t,e){const i=Ha.get(n);We.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const so={average(n){if(!n.length)return!1;let t,e,i=new Set,r=0,s=0;for(t=0,e=n.length;t<e;++t){const l=n[t].element;if(l&&l.hasValue()){const u=l.tooltipPosition();i.add(u.x),r+=u.y,++s}}return s===0||i.size===0?!1:{x:[...i].reduce((l,u)=>l+u)/i.size,y:r/s}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,r=Number.POSITIVE_INFINITY,s,a,l;for(s=0,a=n.length;s<a;++s){const u=n[s].element;if(u&&u.hasValue()){const d=u.getCenterPoint(),f=Hr(t,d);f<r&&(r=f,l=u)}}if(l){const u=l.tooltipPosition();e=u.x,i=u.y}return{x:e,y:i}}};function jn(n,t){return t&&(qt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function ai(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
1
|
+
(function(Yt,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("vue"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/analytics-metric-provider")):typeof define=="function"&&define.amd?define(["exports","vue","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/analytics-metric-provider"],p):(Yt=typeof globalThis<"u"?globalThis:Yt||self,p(Yt["kong-ui-publicvitals-chart"]={},Yt.Vue,Yt.KongIcons,Yt["kong-ui-public-i18n"],Yt["kong-ui-public-analytics-metric-provider"]))})(this,(function(Yt,p,Ms,Xf,Ji){"use strict";var gt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.NINETY_DAY="90d",n.ONE_HUNDRED_EIGHTY_DAY="180d",n.ONE_YEAR="365d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.CURRENT_YEAR="current_year",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n.PREVIOUS_YEAR="previous_year",n))(gt||{});const Yb=["in","not_in","selector"],qb=["empty","not_empty"],jb=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],tr=n=>n.filter(t=>t!=="time"),Zf=["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"],Qf=tr(Zf),Gb=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],Jf=[...Zf,"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"],th=tr(Jf),Kb=[...Gb,"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"],Xb=["control_plane","control_plane_group","ai_gateway","gateway_service","consumer","ai_gateway_consumer","ai_gateway_consumer_group","application","oidc_credential","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin","principal","cache_status","ai_gateway_mcp_server","ai_gateway_model","ai_gateway_agent","ai_gateway_data_plane_node"],eh=tr(Xb),Zb=["a2a_context_id","a2a_error","a2a_method","a2a_task_id","api","api_package","api_product","api_product_version","application","auth_type","bot_info_action","bot_info_detection_reason","bot_info_ja4_fingerprint","bot_info_ban_type","bot_info_header_names","cache_status","client_ip","consumer","ai_gateway_consumer","consumer_group","ai_gateway_consumer_group","control_plane","control_plane_group","ai_gateway","country_code","data_plane_node","data_plane_node_version","ai_gateway_data_plane_node","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_uri","upstream_status_code_grouped","websocket"],Qb=tr(Zb),Jb=["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"],tx=Jb,ex=["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"],nx=tr(ex),ix=["platform","platform_usage"],rx=n=>ix.includes(n),sx=[...Jf.filter(n=>n!=="consumer_group"),"a2a_context_id","a2a_error","a2a_method","a2a_task_id","a2a_task_state","ai_gateway_agent","ai_gateway_mcp_server","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],nh=tr(sx);[...Kb];const ox=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],ih=tr(ox);new Set(Qf),new Set(th),new Set(eh),new Set(nh),new Set(ih);const rh=[{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"}];rh.map(n=>n.code);const sh=n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:Yb},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:qb}},required:["field","operator"],additionalProperties:!1}]}}),ax=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];sh(Array.from(new Set([...Qb,...tx,...nx]))),sh([...new Set([...th,...Qf,...eh,...nh,...ax,...ih])]);const lx={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"}},cx=(n,t,e)=>{let i;const r=lx[n];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function mc(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const ux={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},dx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},fx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},hx={date:mc({formats:ux,defaultWidth:"full"}),time:mc({formats:dx,defaultWidth:"full"}),dateTime:mc({formats:fx,defaultWidth:"full"})},px={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},gx=(n,t,e,i)=>px[n];function ks(n){return(t,e)=>{const i=e?.context?String(e.context):"standalone";let r;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,l=e?.width?String(e.width):a;r=n.formattingValues[l]||n.formattingValues[a]}else{const a=n.defaultWidth,l=e?.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(t):t;return r[s]}}const mx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},_x={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"]},bx={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"]},xx={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"}},wx={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"}},vx=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},Sx={ordinalNumber:vx,era:ks({values:mx,defaultWidth:"wide"}),quarter:ks({values:yx,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ks({values:_x,defaultWidth:"wide"}),day:ks({values:bx,defaultWidth:"wide"}),dayPeriod:ks({values:xx,defaultWidth:"wide",formattingValues:wx,defaultFormattingWidth:"wide"})};function Ds(n){return(t,e={})=>{const i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],l=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(l)?Mx(l,g=>g.test(a)):Tx(l,g=>g.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const f=t.slice(a.length);return{value:d,rest:f}}}function Tx(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Mx(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function kx(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const r=i[0],s=t.match(n.parsePattern);if(!s)return null;let a=n.valueCallback?n.valueCallback(s[0]):s[0];a=e.valueCallback?e.valueCallback(a):a;const l=t.slice(r.length);return{value:a,rest:l}}}const Dx=/^(\d+)(th|st|nd|rd)?/i,Cx=/\d+/i,Ox={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},Ax={any:[/^b/i,/^(a|c)/i]},Rx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ex={any:[/1/i,/2/i,/3/i,/4/i]},Px={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},Ix={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]},Lx={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},Nx={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]},Bx={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},Fx={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}},zx={ordinalNumber:kx({matchPattern:Dx,parsePattern:Cx,valueCallback:n=>parseInt(n,10)}),era:Ds({matchPatterns:Ox,defaultMatchWidth:"wide",parsePatterns:Ax,defaultParseWidth:"any"}),quarter:Ds({matchPatterns:Rx,defaultMatchWidth:"wide",parsePatterns:Ex,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Ds({matchPatterns:Px,defaultMatchWidth:"wide",parsePatterns:Ix,defaultParseWidth:"any"}),day:Ds({matchPatterns:Lx,defaultMatchWidth:"wide",parsePatterns:Nx,defaultParseWidth:"any"}),dayPeriod:Ds({matchPatterns:Bx,defaultMatchWidth:"any",parsePatterns:Fx,defaultParseWidth:"any"})},Ux={code:"en-US",formatDistance:cx,formatLong:hx,formatRelative:gx,localize:Sx,match:zx,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Hx={};function Cs(){return Hx}const oh=6048e5,Wx=864e5,$x=60,Vx=3600,ah=Symbol.for("constructDateFrom");function Sn(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&ah in n?n[ah](t):n instanceof Date?new n.constructor(t):new Date(t)}function ze(n,t){return Sn(t||n,n)}function lh(n){const t=ze(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Yx(n,...t){const e=Sn.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Er(n,t){const e=ze(n,t?.in);return e.setHours(0,0,0,0),e}function qx(n,t,e){const[i,r]=Yx(e?.in,n,t),s=Er(i),a=Er(r),l=+s-lh(s),u=+a-lh(a);return Math.round((l-u)/Wx)}function jx(n,t){const e=ze(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function Gx(n,t){const e=ze(n,t?.in);return qx(e,jx(e))+1}function Jn(n,t){const e=Cs(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=ze(n,t?.in),s=r.getDay(),a=(s<i?7:0)+s-i;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function Jo(n,t){return Jn(n,{...t,weekStartsOn:1})}function ch(n,t){const e=ze(n,t?.in),i=e.getFullYear(),r=Sn(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Jo(r),a=Sn(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Jo(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function Kx(n,t){const e=ch(n,t),i=Sn(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Jo(i)}function Xx(n,t){const e=ze(n,t?.in),i=+Jo(e)-+Kx(e);return Math.round(i/oh)+1}function uh(n,t){const e=ze(n,t?.in),i=e.getFullYear(),r=Cs(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=Sn(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=Jn(a,t),u=Sn(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=Jn(u,t);return+e>=+l?i+1:+e>=+d?i:i-1}function Zx(n,t){const e=Cs(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=uh(n,t),s=Sn(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Jn(s,t)}function Qx(n,t){const e=ze(n,t?.in),i=+Jn(e,t)-+Zx(e,t);return Math.round(i/oh)+1}function Xt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const vi={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Xt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Xt(e+1,2)},d(n,t){return Xt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Xt(n.getHours()%12||12,t.length)},H(n,t){return Xt(n.getHours(),t.length)},m(n,t){return Xt(n.getMinutes(),t.length)},s(n,t){return Xt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),r=Math.trunc(i*Math.pow(10,e-3));return Xt(r,t.length)}},Pr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},dh={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),r=i>0?i:1-i;return e.ordinalNumber(r,{unit:"year"})}return vi.y(n,t)},Y:function(n,t,e,i){const r=uh(n,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Xt(a,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):Xt(s,t.length)},R:function(n,t){const e=ch(n);return Xt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Xt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Xt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Xt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return vi.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Xt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const r=Qx(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Xt(r,t.length)},I:function(n,t,e){const i=Xx(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Xt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):vi.d(n,t)},D:function(n,t,e){const i=Gx(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Xt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Xt(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Xt(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Xt(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let r;switch(i===12?r=Pr.noon:i===0?r=Pr.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let r;switch(i>=17?r=Pr.evening:i>=12?r=Pr.afternoon:i>=4?r=Pr.morning:r=Pr.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return vi.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):vi.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Xt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Xt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):vi.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):vi.s(n,t)},S:function(n,t){return vi.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return hh(i);case"XXXX":case"XX":return er(i);default:return er(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return hh(i);case"xxxx":case"xx":return er(i);default:return er(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+fh(i,":");default:return"GMT"+er(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+fh(i,":");default:return"GMT"+er(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Xt(i,t.length)},T:function(n,t,e){return Xt(+n,t.length)}};function fh(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.trunc(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Xt(s,2)}function hh(n,t){return n%60===0?(n>0?"-":"+")+Xt(Math.abs(n)/60,2):er(n,t)}function er(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Xt(Math.trunc(i/60),2),s=Xt(i%60,2);return e+r+t+s}const ph=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},gh=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Jx=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return ph(n,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",ph(i,t)).replace("{{time}}",gh(r,t))},tw={p:gh,P:Jx},ew=/^D+$/,nw=/^Y+$/,iw=["D","DD","YY","YYYY"];function rw(n){return ew.test(n)}function sw(n){return nw.test(n)}function ow(n,t,e){const i=aw(n,t,e);if(console.warn(i),iw.includes(n))throw new RangeError(i)}function aw(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function lw(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function cw(n){return!(!lw(n)&&typeof n!="number"||isNaN(+ze(n)))}const uw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,fw=/^'([^]*?)'?$/,hw=/''/g,pw=/[a-zA-Z]/;function gw(n,t,e){const i=Cs(),r=e?.locale??i.locale??Ux,s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=ze(n,e?.in);if(!cw(l))throw new RangeError("Invalid time value");let u=t.match(dw).map(f=>{const g=f[0];if(g==="p"||g==="P"){const m=tw[g];return m(f,r.formatLong)}return f}).join("").match(uw).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const g=f[0];if(g==="'")return{isToken:!1,value:mw(f)};if(dh[g])return{isToken:!0,value:f};if(g.match(pw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:f}});r.localize.preprocessor&&(u=r.localize.preprocessor(l,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(f=>{if(!f.isToken)return f.value;const g=f.value;(!e?.useAdditionalWeekYearTokens&&sw(g)||!e?.useAdditionalDayOfYearTokens&&rw(g))&&ow(g,t,String(n));const m=dh[g[0]];return m(l,g,r.localize,d)}).join("")}function mw(n){const t=n.match(fw);return t?t[1].replace(hw,"'"):n}function ta(n,t,e){const i=ze(n,e?.in);return isNaN(t)?Sn(n,NaN):(i.setDate(i.getDate()+t),i)}function mh(n,t,e){const i=ze(n,e?.in);if(isNaN(t))return Sn(n,NaN);if(!t)return i;const r=i.getDate(),s=Sn(n,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function yw(n,t,e){return mh(n,t*3,e)}function Ir(n,t){const e=ze(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function Lr(n,t){const e=ze(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function _w(n,t){const e=ze(n,t?.in),i=e.getFullYear(),r=e.getMonth(),s=Sn(e,0);return s.setFullYear(i,r+1,0),s.setHours(0,0,0,0),s.getDate()}function bw(){return Object.assign({},Cs())}function yh(n){return Math.trunc(n*Vx)}function xw(n){const t=n/$x;return Math.trunc(t)}function _h(n,t,e){return mh(n,-1,e)}function bh(n,t,e){return yw(n,-1,e)}function xh(n,t,e){const i=bw(),r=Sw(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?ww(r,t):vw(r,t)}function ww(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function vw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Sw(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Tw(n,t){const e=Ow(t);return"formatToParts"in e?kw(e,n):Dw(e,n)}const Mw={year:0,month:1,day:2,hour:3,minute:4,second:5};function kw(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=Mw[e[r].type];s!==void 0&&(i[s]=parseInt(e[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function Dw(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const yc={},wh=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")),Cw=wh==="06/25/2014, 00:00:00"||wh==="06/25/2014 00:00:00";function Ow(n){return yc[n]||(yc[n]=Cw?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),yc[n]}function _c(n,t,e,i,r,s,a){const l=new Date(0);return l.setUTCFullYear(n,t,e),l.setUTCHours(i,r,s,a),l}const vh=36e5,Aw=6e4,bc={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Os(n,t,e){if(!n)return 0;let i=bc.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=bc.timezoneHH.exec(n),i)return r=parseInt(i[1],10),Sh(r)?-(r*vh):NaN;if(i=bc.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Sh(r,a)?(s=Math.abs(r)*vh+a*Aw,i[1]==="+"?-s:s):NaN}if(Pw(n)){t=new Date(t||Date.now());const a=e?t:Rw(t),l=xc(a,n);return-(e?l:Ew(t,l,n))}return NaN}function Rw(n){return _c(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function xc(n,t){const e=Tw(n,t),i=_c(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let r=n.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function Ew(n,t,e){let i=n.getTime()-t;const r=xc(new Date(i),e);if(t===r)return t;i-=r-t;const s=xc(new Date(i),e);return r===s?r:Math.max(r,s)}function Sh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Th={};function Pw(n){if(Th[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Th[n]=!0,!0}catch{return!1}}const Iw=60*1e3,Lw={X:function(n,t,e){const i=wc(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Mh(i);case"XXXX":case"XX":return Nr(i);default:return Nr(i,":")}},x:function(n,t,e){const i=wc(e.timeZone,n);switch(t){case"x":return Mh(i);case"xxxx":case"xx":return Nr(i);default:return Nr(i,":")}},O:function(n,t,e){const i=wc(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Nw(i,":");default:return"GMT"+Nr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return xh("short",n,e);default:return xh("long",n,e)}}};function wc(n,t){const e=n?Os(n,t,!0)/Iw:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function ea(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Nr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=ea(Math.floor(i/60),2),s=ea(Math.floor(i%60),2);return e+r+t+s}function Mh(n,t){return n%60===0?(n>0?"-":"+")+ea(Math.abs(n)/60,2):Nr(n,t)}function Nw(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+ea(s,2)}function kh(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const Dh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,vc=36e5,Ch=6e4,Bw=2,Ke={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:Dh};function na(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?Bw:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=Fw(n),{year:r,restDateString:s}=zw(i.date,e),a=Uw(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const l=a.getTime();let u=0,d;if(i.time&&(u=Hw(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Os(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=kh(new Date(l+u)),d=kh(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function Fw(n){const t={};let e=Ke.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Ke.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=Ke.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function zw(n,t){if(n){const e=Ke.YYY[t],i=Ke.YYYYY[t];let r=Ke.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=Ke.YY.exec(n)||e.exec(n),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}}return{year:null}}function Uw(n,t){if(t===null)return null;let e,i,r;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let s=Ke.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,Rh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=Ke.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return Vw(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=Ke.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return Rh(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=Ke.Www.exec(n),s)return r=parseInt(s[1],10)-1,Eh(r)?Oh(t,r):new Date(NaN);if(s=Ke.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return Eh(r,a)?Oh(t,r,a):new Date(NaN)}return null}function Hw(n){let t,e,i=Ke.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Sc(t)?t%24*vc:NaN;if(i=Ke.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Sc(t,e)?t%24*vc+e*Ch:NaN;if(i=Ke.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Sc(t,e,r)?t%24*vc+e*Ch+r*1e3:NaN}return null}function Oh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const Ww=[31,28,31,30,31,30,31,31,30,31,30,31],$w=[31,29,31,30,31,30,31,31,30,31,30,31];function Ah(n){return n%400===0||n%4===0&&n%100!==0}function Rh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Ah(n);if(i&&e>$w[t]||!i&&e>Ww[t])return!1}return!0}function Vw(n,t){if(t<1)return!1;const e=Ah(n);return!(e&&t>366||!e&&t>365)}function Eh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Sc(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Yw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function qw(n,t,e={}){t=String(t);const i=t.match(Yw);if(i){const r=na(e.originalDate||n,e);t=i.reduce(function(s,a){if(a[0]==="'")return s;const l=s.indexOf(a),u=s[l-1]==="'",d=s.replace(a,"'"+Lw[a[0]](r,a,e)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return gw(n,t,e)}function Ph(n,t,e){n=na(n,e);const i=Os(t,n,!0),r=new Date(n.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function Ih(n,t,e,i){return i={...i,timeZone:t,originalDate:n},qw(Ph(n,t,{timeZone:i.timeZone}),e,i)}function jw(n,t,e){if(typeof n=="string"&&!n.match(Dh))return na(n,{...e,timeZone:t});n=na(n,e);const i=_c(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),r=Os(t,new Date(i));return new Date(i+r)}function Gw(n,t){return-Os(n,t)}function Lh(n,t={}){const e=t?.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;let i="MMM dd, yyy hh:mm a";switch(t.format){case"short":i="MMM dd, yyyy";break;case"default":i="MMM dd, yyyy hh:mm a";break;case"full":i="MMM dd, yyyy hh:mm:ss.SSS a";break}return t.includeTZ&&(i+=" (z)"),Ih(n,e,i)}function Kw(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const r=new Date(n);return Ih(r,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const Xw={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 ia(n){return n&&jb.find(t=>n<=Xw[t])||null}var ra=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},sa={exports:{}};sa.exports;var Nh;function Zw(){return Nh||(Nh=1,(function(n,t){var e=200,i="__lodash_hash_undefined__",r=9007199254740991,s="[object Arguments]",a="[object Array]",l="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Function]",g="[object GeneratorFunction]",m="[object Map]",_="[object Number]",x="[object Object]",w="[object Promise]",v="[object RegExp]",C="[object Set]",A="[object String]",F="[object Symbol]",I="[object WeakMap]",L="[object ArrayBuffer]",N="[object DataView]",B="[object Float32Array]",k="[object Float64Array]",T="[object Int8Array]",O="[object Int16Array]",E="[object Int32Array]",W="[object Uint8Array]",J="[object Uint8ClampedArray]",at="[object Uint16Array]",lt="[object Uint32Array]",G=/[\\^$.*+?()[\]{}|]/g,rt=/\w*$/,st=/^\[object .+?Constructor\]$/,nt=/^(?:0|[1-9]\d*)$/,ct={};ct[s]=ct[a]=ct[L]=ct[N]=ct[l]=ct[u]=ct[B]=ct[k]=ct[T]=ct[O]=ct[E]=ct[m]=ct[_]=ct[x]=ct[v]=ct[C]=ct[A]=ct[F]=ct[W]=ct[J]=ct[at]=ct[lt]=!0,ct[d]=ct[f]=ct[I]=!1;var H=typeof ra=="object"&&ra&&ra.Object===Object&&ra,q=typeof self=="object"&&self&&self.Object===Object&&self,X=H||q||Function("return this")(),_t=t&&!t.nodeType&&t,dt=_t&&!0&&n&&!n.nodeType&&n,tt=dt&&dt.exports===_t;function pt(D,$){return D.set($[0],$[1]),D}function ft(D,$){return D.add($),D}function Y(D,$){for(var Q=-1,mt=D?D.length:0;++Q<mt&&$(D[Q],Q,D)!==!1;);return D}function et(D,$){for(var Q=-1,mt=$.length,Te=D.length;++Q<mt;)D[Te+Q]=$[Q];return D}function ot(D,$,Q,mt){for(var Te=-1,qe=D?D.length:0;++Te<qe;)Q=$(Q,D[Te],Te,D);return Q}function xt(D,$){for(var Q=-1,mt=Array(D);++Q<D;)mt[Q]=$(Q);return mt}function Lt(D,$){return D?.[$]}function wt(D){var $=!1;if(D!=null&&typeof D.toString!="function")try{$=!!(D+"")}catch{}return $}function Ot(D){var $=-1,Q=Array(D.size);return D.forEach(function(mt,Te){Q[++$]=[Te,mt]}),Q}function kt(D,$){return function(Q){return D($(Q))}}function ve(D){var $=-1,Q=Array(D.size);return D.forEach(function(mt){Q[++$]=mt}),Q}var bt=Array.prototype,jt=Function.prototype,Oe=Object.prototype,Ae=X["__core-js_shared__"],oe=(function(){var D=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||"");return D?"Symbol(src)_1."+D:""})(),ln=jt.toString,$t=Oe.hasOwnProperty,Le=Oe.toString,ie=RegExp("^"+ln.call($t).replace(G,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Se=tt?X.Buffer:void 0,Re=X.Symbol,gn=X.Uint8Array,Ui=kt(Object.getPrototypeOf,Object),Dn=Object.create,Ye=Oe.propertyIsEnumerable,In=bt.splice,ui=Object.getOwnPropertySymbols,So=Se?Se.isBuffer:void 0,To=kt(Object.keys,Object),xr=Gn(X,"DataView"),di=Gn(X,"Map"),Mo=Gn(X,"Promise"),ko=Gn(X,"Set"),Do=Gn(X,"WeakMap"),Hi=Gn(Object,"create"),fl=hi(xr),fd=hi(di),hd=hi(Mo),pd=hi(ko),gd=hi(Do),Co=Re?Re.prototype:void 0,hl=Co?Co.valueOf:void 0;function fi(D){var $=-1,Q=D?D.length:0;for(this.clear();++$<Q;){var mt=D[$];this.set(mt[0],mt[1])}}function md(){this.__data__=Hi?Hi(null):{}}function Oo(D){return this.has(D)&&delete this.__data__[D]}function yd(D){var $=this.__data__;if(Hi){var Q=$[D];return Q===i?void 0:Q}return $t.call($,D)?$[D]:void 0}function Ao(D){var $=this.__data__;return Hi?$[D]!==void 0:$t.call($,D)}function _d(D,$){var Q=this.__data__;return Q[D]=Hi&&$===void 0?i:$,this}fi.prototype.clear=md,fi.prototype.delete=Oo,fi.prototype.get=yd,fi.prototype.has=Ao,fi.prototype.set=_d;function Ln(D){var $=-1,Q=D?D.length:0;for(this.clear();++$<Q;){var mt=D[$];this.set(mt[0],mt[1])}}function bd(){this.__data__=[]}function xd(D){var $=this.__data__,Q=wr($,D);if(Q<0)return!1;var mt=$.length-1;return Q==mt?$.pop():In.call($,Q,1),!0}function wd(D){var $=this.__data__,Q=wr($,D);return Q<0?void 0:$[Q][1]}function pl(D){return wr(this.__data__,D)>-1}function vd(D,$){var Q=this.__data__,mt=wr(Q,D);return mt<0?Q.push([D,$]):Q[mt][1]=$,this}Ln.prototype.clear=bd,Ln.prototype.delete=xd,Ln.prototype.get=wd,Ln.prototype.has=pl,Ln.prototype.set=vd;function Wi(D){var $=-1,Q=D?D.length:0;for(this.clear();++$<Q;){var mt=D[$];this.set(mt[0],mt[1])}}function gl(){this.__data__={hash:new fi,map:new(di||Ln),string:new fi}}function Sd(D){return vr(this,D).delete(D)}function Td(D){return vr(this,D).get(D)}function Md(D){return vr(this,D).has(D)}function kd(D,$){return vr(this,D).set(D,$),this}Wi.prototype.clear=gl,Wi.prototype.delete=Sd,Wi.prototype.get=Td,Wi.prototype.has=Md,Wi.prototype.set=kd;function $i(D){this.__data__=new Ln(D)}function Dd(){this.__data__=new Ln}function is(D){return this.__data__.delete(D)}function Cd(D){return this.__data__.get(D)}function rs(D){return this.__data__.has(D)}function Od(D,$){var Q=this.__data__;if(Q instanceof Ln){var mt=Q.__data__;if(!di||mt.length<e-1)return mt.push([D,$]),this;Q=this.__data__=new Wi(mt)}return Q.set(D,$),this}$i.prototype.clear=Dd,$i.prototype.delete=is,$i.prototype.get=Cd,$i.prototype.has=rs,$i.prototype.set=Od;function Ad(D,$){var Q=Lo(D)||Ol(D)?xt(D.length,String):[],mt=Q.length,Te=!!mt;for(var qe in D)$t.call(D,qe)&&!(Te&&(qe=="length"||Ml(qe,mt)))&&Q.push(qe);return Q}function ml(D,$,Q){var mt=D[$];(!($t.call(D,$)&&Cl(mt,Q))||Q===void 0&&!($ in D))&&(D[$]=Q)}function wr(D,$){for(var Q=D.length;Q--;)if(Cl(D[Q][0],$))return Q;return-1}function yl(D,$){return D&&Eo($,No($),D)}function ss(D,$,Q,mt,Te,qe,Nn){var Ne;if(mt&&(Ne=qe?mt(D,Te,qe,Nn):mt(D)),Ne!==void 0)return Ne;if(!us(D))return D;var Rl=Lo(D);if(Rl){if(Ne=Sl(D),!$)return vl(D,Ne)}else{var ce=cn(D),ds=ce==f||ce==g;if(Hd(D))return bl(D,$);if(ce==x||ce==s||ds&&!qe){if(wt(D))return qe?D:{};if(Ne=Tl(ds?{}:D),!$)return Po(D,yl(Ne,D))}else{if(!ct[ce])return qe?D:{};Ne=Fd(D,ce,ss,$)}}Nn||(Nn=new $i);var Kn=Nn.get(D);if(Kn)return Kn;if(Nn.set(D,Ne),!Rl)var Bo=Q?Bd(D):No(D);return Y(Bo||D,function(Sr,Be){Bo&&(Be=Sr,Sr=D[Be]),ml(Ne,Be,ss(Sr,$,Q,mt,Be,D,Nn))}),Ne}function Rd(D){return us(D)?Dn(D):{}}function Ed(D,$,Q){var mt=$(D);return Lo(D)?mt:et(mt,Q(D))}function Pd(D){return Le.call(D)}function Id(D){if(!us(D)||Dl(D))return!1;var $=cs(D)||wt(D)?ie:st;return $.test(hi(D))}function _l(D){if(!Io(D))return To(D);var $=[];for(var Q in Object(D))$t.call(D,Q)&&Q!="constructor"&&$.push(Q);return $}function bl(D,$){if($)return D.slice();var Q=new D.constructor(D.length);return D.copy(Q),Q}function os(D){var $=new D.constructor(D.byteLength);return new gn($).set(new gn(D)),$}function Ro(D,$){var Q=$?os(D.buffer):D.buffer;return new D.constructor(Q,D.byteOffset,D.byteLength)}function Ld(D,$,Q){var mt=$?Q(Ot(D),!0):Ot(D);return ot(mt,pt,new D.constructor)}function xl(D){var $=new D.constructor(D.source,rt.exec(D));return $.lastIndex=D.lastIndex,$}function as(D,$,Q){var mt=$?Q(ve(D),!0):ve(D);return ot(mt,ft,new D.constructor)}function wl(D){return hl?Object(hl.call(D)):{}}function Nd(D,$){var Q=$?os(D.buffer):D.buffer;return new D.constructor(Q,D.byteOffset,D.length)}function vl(D,$){var Q=-1,mt=D.length;for($||($=Array(mt));++Q<mt;)$[Q]=D[Q];return $}function Eo(D,$,Q,mt){Q||(Q={});for(var Te=-1,qe=$.length;++Te<qe;){var Nn=$[Te],Ne=void 0;ml(Q,Nn,Ne===void 0?D[Nn]:Ne)}return Q}function Po(D,$){return Eo(D,ls(D),$)}function Bd(D){return Ed(D,No,ls)}function vr(D,$){var Q=D.__data__;return kl($)?Q[typeof $=="string"?"string":"hash"]:Q.map}function Gn(D,$){var Q=Lt(D,$);return Id(Q)?Q:void 0}var ls=ui?kt(ui,Object):Vd,cn=Pd;(xr&&cn(new xr(new ArrayBuffer(1)))!=N||di&&cn(new di)!=m||Mo&&cn(Mo.resolve())!=w||ko&&cn(new ko)!=C||Do&&cn(new Do)!=I)&&(cn=function(D){var $=Le.call(D),Q=$==x?D.constructor:void 0,mt=Q?hi(Q):void 0;if(mt)switch(mt){case fl:return N;case fd:return m;case hd:return w;case pd:return C;case gd:return I}return $});function Sl(D){var $=D.length,Q=D.constructor($);return $&&typeof D[0]=="string"&&$t.call(D,"index")&&(Q.index=D.index,Q.input=D.input),Q}function Tl(D){return typeof D.constructor=="function"&&!Io(D)?Rd(Ui(D)):{}}function Fd(D,$,Q,mt){var Te=D.constructor;switch($){case L:return os(D);case l:case u:return new Te(+D);case N:return Ro(D,mt);case B:case k:case T:case O:case E:case W:case J:case at:case lt:return Nd(D,mt);case m:return Ld(D,mt,Q);case _:case A:return new Te(D);case v:return xl(D);case C:return as(D,mt,Q);case F:return wl(D)}}function Ml(D,$){return $=$??r,!!$&&(typeof D=="number"||nt.test(D))&&D>-1&&D%1==0&&D<$}function kl(D){var $=typeof D;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?D!=="__proto__":D===null}function Dl(D){return!!oe&&oe in D}function Io(D){var $=D&&D.constructor,Q=typeof $=="function"&&$.prototype||Oe;return D===Q}function hi(D){if(D!=null){try{return ln.call(D)}catch{}try{return D+""}catch{}}return""}function zd(D){return ss(D,!0,!0)}function Cl(D,$){return D===$||D!==D&&$!==$}function Ol(D){return Ud(D)&&$t.call(D,"callee")&&(!Ye.call(D,"callee")||Le.call(D)==s)}var Lo=Array.isArray;function Al(D){return D!=null&&Wd(D.length)&&!cs(D)}function Ud(D){return $d(D)&&Al(D)}var Hd=So||ee;function cs(D){var $=us(D)?Le.call(D):"";return $==f||$==g}function Wd(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=r}function us(D){var $=typeof D;return!!D&&($=="object"||$=="function")}function $d(D){return!!D&&typeof D=="object"}function No(D){return Al(D)?Ad(D):_l(D)}function Vd(){return[]}function ee(){return!1}n.exports=zd})(sa,sa.exports)),sa.exports}Zw();const Tn=(n,t)=>new Date(n.getTime()-Gw(t,n));class De{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 e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=168&&e.add("hourly"),i>=48&&e.add("daily"),i>=672&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=jw(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Ph(e,t)}}class Qw extends De{rawStart(t){let e=Jn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*7}}class Jw extends De{rawStart(t){let e=Lr(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*31}}class tv extends De{rawStart(t){let e=Ir(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*92}}class ev extends De{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Tn(e,t)),e}maximumTimeframeLength(){return 3600*24*366}}class nv extends De{rawEnd(t){let e=Jn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Tn(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=Jn(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Tn(i,t)),i}}class iv extends De{rawEnd(t){let e=Ir(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}rawStart(t){let e=Ir(bh(this.tzAdjustedDate(t)));return t&&(e=Tn(e,t)),e}}class rv extends De{rawEnd(t){let e=Lr(this.tzAdjustedDate(t));return t&&(e=Tn(e,t)),e}rawStart(t){let e=Lr(_h(this.tzAdjustedDate(t)));return t&&(e=Tn(e,t)),e}}class sv extends De{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Tn(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=Tn(e,t)),e}}gt.FIFTEEN_MIN,new De({key:gt.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"]}),gt.ONE_HOUR,new De({key:gt.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"]}),gt.SIX_HOUR,new De({key:gt.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"]}),gt.TWELVE_HOUR,new De({key:gt.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"]}),gt.ONE_DAY,new De({key:gt.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"]}),gt.SEVEN_DAY,new De({key:gt.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"]}),gt.THIRTY_DAY,new De({key:gt.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"]}),gt.NINETY_DAY,new De({key:gt.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"]}),gt.ONE_HUNDRED_EIGHTY_DAY,new De({key:gt.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"]}),gt.ONE_YEAR,new De({key:gt.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"]}),gt.CURRENT_WEEK,new Qw({key:gt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=Jn(new Date,{weekStartsOn:1});return(Er(ta(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),gt.CURRENT_MONTH,new Jw({key:gt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Lr(new Date);return(Er(ta(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.CURRENT_QUARTER,new tv({key:gt.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Ir(new Date);return(Er(ta(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.CURRENT_YEAR,new ev({key:gt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1);return(Er(ta(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.PREVIOUS_WEEK,new nv({key:gt.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"]}),gt.PREVIOUS_MONTH,new rv({key:gt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Lr(new Date),e=Lr(_h(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Bh(t,e)),3600*24*_w(new Date().setMonth(new Date().getMonth()-1))+yh(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.PREVIOUS_QUARTER,new iv({key:gt.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Ir(new Date),t=Ir(bh(new Date));return(n.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.PREVIOUS_YEAR,new sv({key:gt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let e=0;return n.getTimezoneOffset()!==t.getTimezoneOffset()&&(e=Bh(n,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+yh(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Bh(n,t){return xw(n.getTimezoneOffset()-t.getTimezoneOffset())}gt.FIFTEEN_MIN,gt.ONE_HOUR,gt.SIX_HOUR,gt.TWELVE_HOUR,gt.ONE_DAY,gt.SEVEN_DAY,gt.FIFTEEN_MIN,gt.ONE_HOUR,gt.SIX_HOUR,gt.TWELVE_HOUR,gt.ONE_DAY,gt.SEVEN_DAY,gt.THIRTY_DAY,gt.NINETY_DAY,gt.ONE_HUNDRED_EIGHTY_DAY,gt.ONE_YEAR,gt.CURRENT_WEEK,gt.CURRENT_MONTH,gt.CURRENT_QUARTER,gt.CURRENT_YEAR,gt.PREVIOUS_WEEK,gt.PREVIOUS_MONTH,gt.PREVIOUS_QUARTER,gt.PREVIOUS_YEAR;const ov=new Map(rh.map(n=>[n.code,{code:n.code,name:n.name}])),Tc=n=>ov.get(n)?.name||n,Fh=1e3,av=1e4,zh=1e6,Uh=1e9,Hh=1e12,oa=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((r,s)=>{s&&s%3===0&&i.push(e),i.push(r)}),i.reverse().join("")},As=(n,t,e)=>{const i=n/t,r=e.round?"round":"floor";if(e.decimal===!1)return Math[r](i).toString();let s;e.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function aa(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const r=t.min10k?av:Fh;return n<r||t.precision&&t.precision>Math.log10(n)?e=oa(As(n,1,t),t):n<zh?e=`${As(n,Fh,t)}k`:n<Uh?e=`${As(n,zh,t)}m`:n<Hh?e=`${oa(As(n,Uh,t),t)}b`:e=`${oa(As(n,Hh,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}aa.addCommas=oa;const lv=typeof document<"u"&&document.documentElement?.lang||"en-US",la=new Intl.NumberFormat(lv);function ti({i18n:n}){const t=(i,r)=>{if(isNaN(i))return"0 B";const s=r?Math.pow(2,50):1e15,a=r?Math.pow(2,40):1e12,l=r?Math.pow(2,30):1e9,u=r?Math.pow(2,20):1e6,d=r?Math.pow(2,10):1e3;let f;return i>=s?f=n.formatNumber(Number.parseFloat((i/s).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?f=n.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=l?f=n.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=u?f=n.formatNumber(Number.parseFloat((i/u).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=d?f=n.formatNumber(Number.parseFloat((i/d).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):f=n.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),f.replace(/([a-zA-Z]*)$/," $1")},e=(i,r="USD")=>isNaN(i)?r==="USD"?"$0.00":`${i}`:i>=.01||r!=="USD"?n.formatNumber(i,{style:"currency",currency:r}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,r,{isBytes1024:s=!1,currency:a="USD",approximate:l=!1,translateUnit:u=d=>d}={})=>{const d=u(r,i);switch(r){case"bytes":return t(i,s);case"usd":return e(i,a);default:return isNaN(i)?`${i}`:l?`${aa(i,{capital:!0})} ${d}`:i>=.01?`${la.format(Number.parseFloat(i.toFixed(2)))} ${d}`:`${Number.parseFloat(i.toPrecision(4))} ${d}`}},formatBytes:t,formatCost:e,formatRange:(i,r,s,{isBytes1024:a=!1,currency:l="USD",approximate:u=!1,translateUnit:d=f=>f}={})=>{const f=d(s,r);switch(s){case"bytes":return`${t(i,a)} - ${t(r,a)}`;case"usd":return`${e(i,l)} - ${e(r,l)}`;default:if(isNaN(i)||isNaN(r))return`${i} - ${r}`;if(u)return`${aa(i,{capital:!0})} - ${aa(r,{capital:!0})} ${f}`}const g=i>=.01?`${la.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,m=r>=.01?`${la.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`;return`${g} - ${m} ${f}`}}}const Wh="#d60027",$h="#ffe5e5",cv="#f1f0ff",uv="#e0e4ea",Vh="#6c7489",dv="#afb7c5",Yh="#0d0e14",fv="#d60027",hv="#ad000e",Mc="#6c7489",qh="#52596e",pv="#007d60",gv="#995c00",mv="#ffc400",yv="'Inter', Roboto, Helvetica, sans-serif",Rs="16px",_v="20px",bv="#bee2ff",xv="#8fc1ff",wv="#5f9aff",vv="#306fff",Sv="#b5ffee",Tv="#00fabe",Mv="#00d6a4",kv="#00a17b",Dv="#007d60",Cv="#005944",Ov="#b5ffee",Av="#00fabe",Rv="#b5ffee",Ev="#00a17b",Pv="#fff296",Iv="#ffe04b",Lv="#ffc400",Nv="#b37600",Bv="#995c00",Fv="#804400",zv="#fff296",Uv="#ffe04b",Hv="#ffc2b3",Wv="#ff9877",$v="#ff723c",Vv="#f75008",Yv="#d13500",qv="#a31f00",jv="#ffc2b3",Gv="#ff9877",Kv="#ff723c",Xv="#f75008",Zv="#d13500",Qv="#a31f00",Jv="#ffc2b3",t1="#ff9877",e1="#ff723c",n1="#f75008",i1="#d13500",r1="#a31f00",s1="#ffc2b3",o1="#ff9877",a1="#ff723c",l1="#f75008",c1="#d13500",u1="#a31f00",d1="#ffc2b3",f1="#ff9877",h1="#ff723c",p1="#f75008",g1="#d13500",m1="#ffabab",y1="#ff7272",_1="#ff3954",b1="#f50045",x1="#d60027",w1="#ad000e",v1="#ffabab",S1="#ff7272",T1="#ff3954",M1="#f50045",k1="#d60027",D1="#eefaff",C1="#ecfffb",O1="#fffce0",A1="#fff1ef",R1="#ffe5e5",E1="#5f9aff",P1="#00d6a4",I1="#ffc400",L1="#ff723c",N1="#ff3954",jh=6048e5,B1=864e5,Es=6e4,Br=36e5,F1=1e3,Gh=Symbol.for("constructDateFrom");function he(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Gh in n?n[Gh](t):n instanceof Date?new n.constructor(t):new Date(t)}function Rt(n,t){return he(t||n,n)}function ca(n,t,e){const i=Rt(n,e?.in);return isNaN(t)?he(e?.in||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function kc(n,t,e){const i=Rt(n,e?.in);if(isNaN(t))return he(n,NaN);if(!t)return i;const r=i.getDate(),s=he(n,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function Dc(n,t,e){return he(n,+Rt(n)+t)}function z1(n,t,e){return Dc(n,t*Br)}let U1={};function nr(){return U1}function Wn(n,t){const e=nr(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=Rt(n,t?.in),s=r.getDay(),a=(s<i?7:0)+s-i;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function Fr(n,t){return Wn(n,{...t,weekStartsOn:1})}function Kh(n,t){const e=Rt(n,t?.in),i=e.getFullYear(),r=he(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Fr(r),a=he(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Fr(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function ua(n){const t=Rt(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function ir(n,...t){const e=he.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Cc(n,t){const e=Rt(n,t?.in);return e.setHours(0,0,0,0),e}function Xh(n,t,e){const[i,r]=ir(e?.in,n,t),s=Cc(i),a=Cc(r),l=+s-ua(s),u=+a-ua(a);return Math.round((l-u)/B1)}function H1(n,t){const e=Kh(n,t),i=he(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Fr(i)}function W1(n,t,e){const i=Rt(n,e?.in);return i.setTime(i.getTime()+t*Es),i}function $1(n,t,e){return kc(n,t*3,e)}function V1(n,t,e){return Dc(n,t*1e3)}function Y1(n,t,e){return ca(n,t*7,e)}function q1(n,t,e){return kc(n,t*12,e)}function Ps(n,t){const e=+Rt(n)-+Rt(t);return e<0?-1:e>0?1:e}function j1(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Oc(n){return!(!j1(n)&&typeof n!="number"||isNaN(+Rt(n)))}function G1(n,t,e){const[i,r]=ir(e?.in,n,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function K1(n,t,e){const[i,r]=ir(e?.in,n,t);return i.getFullYear()-r.getFullYear()}function Zh(n,t,e){const[i,r]=ir(e?.in,n,t),s=Qh(i,r),a=Math.abs(Xh(i,r));i.setDate(i.getDate()-s*a);const l=+(Qh(i,r)===-s),u=s*(a-l);return u===0?0:u}function Qh(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Is(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function X1(n,t,e){const[i,r]=ir(e?.in,n,t),s=(+i-+r)/Br;return Is(e?.roundingMethod)(s)}function Ac(n,t){return+Rt(n)-+Rt(t)}function Z1(n,t,e){const i=Ac(n,t)/Es;return Is(e?.roundingMethod)(i)}function Jh(n,t){const e=Rt(n,t?.in);return e.setHours(23,59,59,999),e}function tp(n,t){const e=Rt(n,t?.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function Q1(n,t){const e=Rt(n,t?.in);return+Jh(e,t)==+tp(e,t)}function ep(n,t,e){const[i,r,s]=ir(e?.in,n,n,t),a=Ps(r,s),l=Math.abs(G1(r,s));if(l<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*l);let u=Ps(r,s)===-a;Q1(i)&&l===1&&Ps(i,s)===1&&(u=!1);const d=a*(l-+u);return d===0?0:d}function J1(n,t,e){const i=ep(n,t,e)/3;return Is(e?.roundingMethod)(i)}function tS(n,t,e){const i=Ac(n,t)/1e3;return Is(e?.roundingMethod)(i)}function eS(n,t,e){const i=Zh(n,t,e)/7;return Is(e?.roundingMethod)(i)}function nS(n,t,e){const[i,r]=ir(e?.in,n,t),s=Ps(i,r),a=Math.abs(K1(i,r));i.setFullYear(1584),r.setFullYear(1584);const l=Ps(i,r)===-s,u=s*(a-+l);return u===0?0:u}function iS(n,t){const e=Rt(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function rS(n,t){const e=Rt(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function sS(n,t){const e=Rt(n,t?.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function np(n,t){const e=Rt(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function oS(n,t){const e=Rt(n,t?.in);return e.setMinutes(59,59,999),e}function aS(n,t){const e=nr(),i=e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=Rt(n,t?.in),s=r.getDay(),a=(s<i?-7:0)+6-(s-i);return r.setDate(r.getDate()+a),r.setHours(23,59,59,999),r}function lS(n,t){const e=Rt(n,t?.in);return e.setSeconds(59,999),e}function cS(n,t){const e=Rt(n,t?.in),i=e.getMonth(),r=i-i%3+3;return e.setMonth(r,0),e.setHours(23,59,59,999),e}function uS(n,t){const e=Rt(n,t?.in);return e.setMilliseconds(999),e}const dS={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"}},fS=(n,t,e)=>{let i;const r=dS[n];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Rc(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const hS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},pS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},gS={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},mS={date:Rc({formats:hS,defaultWidth:"full"}),time:Rc({formats:pS,defaultWidth:"full"}),dateTime:Rc({formats:gS,defaultWidth:"full"})},yS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_S=(n,t,e,i)=>yS[n];function Ls(n){return(t,e)=>{const i=e?.context?String(e.context):"standalone";let r;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,l=e?.width?String(e.width):a;r=n.formattingValues[l]||n.formattingValues[a]}else{const a=n.defaultWidth,l=e?.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(t):t;return r[s]}}const bS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},xS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},wS={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"]},vS={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"]},SS={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"}},TS={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"}},MS={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Ls({values:bS,defaultWidth:"wide"}),quarter:Ls({values:xS,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ls({values:wS,defaultWidth:"wide"}),day:Ls({values:vS,defaultWidth:"wide"}),dayPeriod:Ls({values:SS,defaultWidth:"wide",formattingValues:TS,defaultFormattingWidth:"wide"})};function Ns(n){return(t,e={})=>{const i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],l=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(l)?DS(l,g=>g.test(a)):kS(l,g=>g.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const f=t.slice(a.length);return{value:d,rest:f}}}function kS(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function DS(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function CS(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const r=i[0],s=t.match(n.parsePattern);if(!s)return null;let a=n.valueCallback?n.valueCallback(s[0]):s[0];a=e.valueCallback?e.valueCallback(a):a;const l=t.slice(r.length);return{value:a,rest:l}}}const OS=/^(\d+)(th|st|nd|rd)?/i,AS=/\d+/i,RS={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},ES={any:[/^b/i,/^(a|c)/i]},PS={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},IS={any:[/1/i,/2/i,/3/i,/4/i]},LS={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},NS={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]},BS={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},FS={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]},zS={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},US={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}},HS={ordinalNumber:CS({matchPattern:OS,parsePattern:AS,valueCallback:n=>parseInt(n,10)}),era:Ns({matchPatterns:RS,defaultMatchWidth:"wide",parsePatterns:ES,defaultParseWidth:"any"}),quarter:Ns({matchPatterns:PS,defaultMatchWidth:"wide",parsePatterns:IS,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Ns({matchPatterns:LS,defaultMatchWidth:"wide",parsePatterns:NS,defaultParseWidth:"any"}),day:Ns({matchPatterns:BS,defaultMatchWidth:"wide",parsePatterns:FS,defaultParseWidth:"any"}),dayPeriod:Ns({matchPatterns:zS,defaultMatchWidth:"any",parsePatterns:US,defaultParseWidth:"any"})},ip={code:"en-US",formatDistance:fS,formatLong:mS,formatRelative:_S,localize:MS,match:HS,options:{weekStartsOn:0,firstWeekContainsDate:1}};function WS(n,t){const e=Rt(n,t?.in);return Xh(e,np(e))+1}function rp(n,t){const e=Rt(n,t?.in),i=+Fr(e)-+H1(e);return Math.round(i/jh)+1}function Ec(n,t){const e=Rt(n,t?.in),i=e.getFullYear(),r=nr(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=he(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=Wn(a,t),u=he(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=Wn(u,t);return+e>=+l?i+1:+e>=+d?i:i-1}function $S(n,t){const e=nr(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=Ec(n,t),s=he(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Wn(s,t)}function sp(n,t){const e=Rt(n,t?.in),i=+Wn(e,t)-+$S(e,t);return Math.round(i/jh)+1}function Zt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Si={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Zt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Zt(e+1,2)},d(n,t){return Zt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Zt(n.getHours()%12||12,t.length)},H(n,t){return Zt(n.getHours(),t.length)},m(n,t){return Zt(n.getMinutes(),t.length)},s(n,t){return Zt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),r=Math.trunc(i*Math.pow(10,e-3));return Zt(r,t.length)}},zr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},op={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),r=i>0?i:1-i;return e.ordinalNumber(r,{unit:"year"})}return Si.y(n,t)},Y:function(n,t,e,i){const r=Ec(n,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Zt(a,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):Zt(s,t.length)},R:function(n,t){const e=Kh(n);return Zt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Zt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Zt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Zt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Si.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Zt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const r=sp(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Zt(r,t.length)},I:function(n,t,e){const i=rp(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Zt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Si.d(n,t)},D:function(n,t,e){const i=WS(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Zt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Zt(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const r=n.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Zt(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Zt(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const r=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let r;switch(i===12?r=zr.noon:i===0?r=zr.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let r;switch(i>=17?r=zr.evening:i>=12?r=zr.afternoon:i>=4?r=zr.morning:r=zr.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Si.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Si.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Zt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Si.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Si.s(n,t)},S:function(n,t){return Si.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return lp(i);case"XXXX":case"XX":return rr(i);default:return rr(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return lp(i);case"xxxx":case"xx":return rr(i);default:return rr(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ap(i,":");default:return"GMT"+rr(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ap(i,":");default:return"GMT"+rr(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Zt(i,t.length)},T:function(n,t,e){return Zt(+n,t.length)}};function ap(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.trunc(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Zt(s,2)}function lp(n,t){return n%60===0?(n>0?"-":"+")+Zt(Math.abs(n)/60,2):rr(n,t)}function rr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Zt(Math.trunc(i/60),2),s=Zt(i%60,2);return e+r+t+s}const cp=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},up=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Pc={p:up,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return cp(n,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",cp(i,t)).replace("{{time}}",up(r,t))}},VS=/^D+$/,YS=/^Y+$/,qS=["D","DD","YY","YYYY"];function dp(n){return VS.test(n)}function fp(n){return YS.test(n)}function Ic(n,t,e){const i=jS(n,t,e);if(console.warn(i),qS.includes(n))throw new RangeError(i)}function jS(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const GS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,KS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,XS=/^'([^]*?)'?$/,ZS=/''/g,QS=/[a-zA-Z]/;function da(n,t,e){const i=nr(),r=e?.locale??i.locale??ip,s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=Rt(n,e?.in);if(!Oc(l))throw new RangeError("Invalid time value");let u=t.match(KS).map(f=>{const g=f[0];if(g==="p"||g==="P"){const m=Pc[g];return m(f,r.formatLong)}return f}).join("").match(GS).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const g=f[0];if(g==="'")return{isToken:!1,value:JS(f)};if(op[g])return{isToken:!0,value:f};if(g.match(QS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:f}});r.localize.preprocessor&&(u=r.localize.preprocessor(l,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(f=>{if(!f.isToken)return f.value;const g=f.value;(!e?.useAdditionalWeekYearTokens&&fp(g)||!e?.useAdditionalDayOfYearTokens&&dp(g))&&Ic(g,t,String(n));const m=op[g[0]];return m(l,g,r.localize,d)}).join("")}function JS(n){const t=n.match(XS);return t?t[1].replace(ZS,"'"):n}function hp(){return Object.assign({},nr())}function tT(n,t){const e=Rt(n,t?.in).getDay();return e===0?7:e}function eT(n,t){const e=nT(t)?new t(0):he(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function nT(n){return typeof n=="function"&&n.prototype?.constructor===n}const iT=10;class pp{subPriority=0;validate(t,e){return!0}}class rT extends pp{constructor(t,e,i,r,s){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=r,s&&(this.subPriority=s)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class sT extends pp{priority=iT;subPriority=-1;constructor(t,e){super(),this.context=t||(i=>he(e,i))}set(t,e){return e.timestampIsSet?t:he(t,eT(t,this.context))}}class Wt{run(t,e,i,r){const s=this.parse(t,e,i,r);return s?{setter:new rT(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,e,i){return!0}}class oT extends Wt{priority=140;parse(t,e,i){switch(e){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,e,i){return e.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const me={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}/},$n={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 ye(n,t){return n&&{value:t(n.value),rest:n.rest}}function de(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Vn(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,r=e[2]?parseInt(e[2],10):0,s=e[3]?parseInt(e[3],10):0,a=e[5]?parseInt(e[5],10):0;return{value:i*(r*Br+s*Es+a*F1),rest:t.slice(e[0].length)}}function gp(n){return de(me.anyDigitsSigned,n)}function pe(n,t){switch(n){case 1:return de(me.singleDigit,t);case 2:return de(me.twoDigits,t);case 3:return de(me.threeDigits,t);case 4:return de(me.fourDigits,t);default:return de(new RegExp("^\\d{1,"+n+"}"),t)}}function fa(n,t){switch(n){case 1:return de(me.singleDigitSigned,t);case 2:return de(me.twoDigitsSigned,t);case 3:return de(me.threeDigitsSigned,t);case 4:return de(me.fourDigitsSigned,t);default:return de(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Lc(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function mp(n,t){const e=t>0,i=e?t:1-t;let r;if(i<=50)r=n||100;else{const s=i+50,a=Math.trunc(s/100)*100,l=n>=s%100;r=n+a-(l?100:0)}return e?r:1-r}function yp(n){return n%400===0||n%4===0&&n%100!==0}class aT extends Wt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="yy"});switch(e){case"y":return ye(pe(4,t),r);case"yo":return ye(i.ordinalNumber(t,{unit:"year"}),r);default:return ye(pe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i){const r=t.getFullYear();if(i.isTwoDigitYear){const a=mp(i.year,r);return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}const s=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class lT extends Wt{priority=130;parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="YY"});switch(e){case"Y":return ye(pe(4,t),r);case"Yo":return ye(i.ordinalNumber(t,{unit:"year"}),r);default:return ye(pe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i,r){const s=Ec(t,r);if(i.isTwoDigitYear){const l=mp(i.year,s);return t.setFullYear(l,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Wn(t,r)}const a=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(a,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Wn(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class cT extends Wt{priority=130;parse(t,e){return fa(e==="R"?4:e.length,t)}set(t,e,i){const r=he(t,0);return r.setFullYear(i,0,4),r.setHours(0,0,0,0),Fr(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class uT extends Wt{priority=130;parse(t,e){return fa(e==="u"?4:e.length,t)}set(t,e,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 dT extends Wt{priority=120;parse(t,e,i){switch(e){case"Q":case"QQ":return pe(e.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,e){return e>=1&&e<=4}set(t,e,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 fT extends Wt{priority=120;parse(t,e,i){switch(e){case"q":case"qq":return pe(e.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,e){return e>=1&&e<=4}set(t,e,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 hT extends Wt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"M":return ye(de(me.month,t),r);case"MM":return ye(pe(2,t),r);case"Mo":return ye(i.ordinalNumber(t,{unit:"month"}),r);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,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}}class pT extends Wt{priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"L":return ye(de(me.month,t),r);case"LL":return ye(pe(2,t),r);case"Lo":return ye(i.ordinalNumber(t,{unit:"month"}),r);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,e){return e>=0&&e<=11}set(t,e,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 gT(n,t,e){const i=Rt(n,e?.in),r=sp(i,e)-t;return i.setDate(i.getDate()-r*7),Rt(i,e?.in)}class mT extends Wt{priority=100;parse(t,e,i){switch(e){case"w":return de(me.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i,r){return Wn(gT(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function yT(n,t,e){const i=Rt(n,e?.in),r=rp(i,e)-t;return i.setDate(i.getDate()-r*7),i}class _T extends Wt{priority=100;parse(t,e,i){switch(e){case"I":return de(me.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i){return Fr(yT(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const bT=[31,28,31,30,31,30,31,31,30,31,30,31],xT=[31,29,31,30,31,30,31,31,30,31,30,31];class wT extends Wt{priority=90;subPriority=1;parse(t,e,i){switch(e){case"d":return de(me.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const i=t.getFullYear(),r=yp(i),s=t.getMonth();return r?e>=1&&e<=xT[s]:e>=1&&e<=bT[s]}set(t,e,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 vT extends Wt{priority=90;subpriority=1;parse(t,e,i){switch(e){case"D":case"DD":return de(me.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const i=t.getFullYear();return yp(i)?e>=1&&e<=366:e>=1&&e<=365}set(t,e,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 Nc(n,t,e){const i=nr(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=Rt(n,e?.in),a=s.getDay(),u=(t%7+7)%7,d=7-r,f=t<0||t>6?t-(a+d)%7:(u+d)%7-(a+d)%7;return ca(s,f,e)}class ST extends Wt{priority=90;parse(t,e,i){switch(e){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,e){return e>=0&&e<=6}set(t,e,i,r){return t=Nc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class TT extends Wt{priority=90;parse(t,e,i,r){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(e){case"e":case"ee":return ye(pe(e.length,t),s);case"eo":return ye(i.ordinalNumber(t,{unit:"day"}),s);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,e){return e>=0&&e<=6}set(t,e,i,r){return t=Nc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class MT extends Wt{priority=90;parse(t,e,i,r){const s=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(e){case"c":case"cc":return ye(pe(e.length,t),s);case"co":return ye(i.ordinalNumber(t,{unit:"day"}),s);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,e){return e>=0&&e<=6}set(t,e,i,r){return t=Nc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function kT(n,t,e){const i=Rt(n,e?.in),r=tT(i,e),s=t-r;return ca(i,s,e)}class DT extends Wt{priority=90;parse(t,e,i){const r=s=>s===0?7:s;switch(e){case"i":case"ii":return pe(e.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return ye(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return ye(i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return ye(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);default:return ye(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"}),r)}}validate(t,e){return e>=1&&e<=7}set(t,e,i){return t=kT(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 CT extends Wt{priority=80;parse(t,e,i){switch(e){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,e,i){return t.setHours(Lc(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class OT extends Wt{priority=80;parse(t,e,i){switch(e){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,e,i){return t.setHours(Lc(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class AT extends Wt{priority=80;parse(t,e,i){switch(e){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,e,i){return t.setHours(Lc(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class RT extends Wt{priority=70;parse(t,e,i){switch(e){case"h":return de(me.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,i){const r=t.getHours()>=12;return r&&i<12?t.setHours(i+12,0,0,0):!r&&i===12?t.setHours(0,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class ET extends Wt{priority=70;parse(t,e,i){switch(e){case"H":return de(me.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class PT extends Wt{priority=70;parse(t,e,i){switch(e){case"K":return de(me.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,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 IT extends Wt{priority=70;parse(t,e,i){switch(e){case"k":return de(me.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,i){const r=i<=24?i%24:i;return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class LT extends Wt{priority=60;parse(t,e,i){switch(e){case"m":return de(me.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]}class NT extends Wt{priority=50;parse(t,e,i){switch(e){case"s":return de(me.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]}class BT extends Wt{priority=30;parse(t,e){const i=r=>Math.trunc(r*Math.pow(10,-e.length+3));return ye(pe(e.length,t),i)}set(t,e,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class FT extends Wt{priority=10;parse(t,e){switch(e){case"X":return Vn($n.basicOptionalMinutes,t);case"XX":return Vn($n.basic,t);case"XXXX":return Vn($n.basicOptionalSeconds,t);case"XXXXX":return Vn($n.extendedOptionalSeconds,t);default:return Vn($n.extended,t)}}set(t,e,i){return e.timestampIsSet?t:he(t,t.getTime()-ua(t)-i)}incompatibleTokens=["t","T","x"]}class zT extends Wt{priority=10;parse(t,e){switch(e){case"x":return Vn($n.basicOptionalMinutes,t);case"xx":return Vn($n.basic,t);case"xxxx":return Vn($n.basicOptionalSeconds,t);case"xxxxx":return Vn($n.extendedOptionalSeconds,t);default:return Vn($n.extended,t)}}set(t,e,i){return e.timestampIsSet?t:he(t,t.getTime()-ua(t)-i)}incompatibleTokens=["t","T","X"]}class UT extends Wt{priority=40;parse(t){return gp(t)}set(t,e,i){return[he(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class HT extends Wt{priority=20;parse(t){return gp(t)}set(t,e,i){return[he(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const WT={G:new oT,y:new aT,Y:new lT,R:new cT,u:new uT,Q:new dT,q:new fT,M:new hT,L:new pT,w:new mT,I:new _T,d:new wT,D:new vT,E:new ST,e:new TT,c:new MT,i:new DT,a:new CT,b:new OT,B:new AT,h:new RT,H:new ET,K:new PT,k:new IT,m:new LT,s:new NT,S:new BT,X:new FT,x:new zT,t:new UT,T:new HT},$T=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,VT=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,YT=/^'([^]*?)'?$/,qT=/''/g,jT=/\S/,GT=/[a-zA-Z]/;function KT(n,t,e,i){const r=()=>he(i?.in||e,NaN),s=hp(),a=i?.locale??s.locale??ip,l=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,u=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0;if(!t)return n?r():Rt(e,i?.in);const d={firstWeekContainsDate:l,weekStartsOn:u,locale:a},f=[new sT(i?.in,e)],g=t.match(VT).map(v=>{const C=v[0];if(C in Pc){const A=Pc[C];return A(v,a.formatLong)}return v}).join("").match($T),m=[];for(let v of g){!i?.useAdditionalWeekYearTokens&&fp(v)&&Ic(v,t,n),!i?.useAdditionalDayOfYearTokens&&dp(v)&&Ic(v,t,n);const C=v[0],A=WT[C];if(A){const{incompatibleTokens:F}=A;if(Array.isArray(F)){const L=m.find(N=>F.includes(N.token)||N.token===C);if(L)throw new RangeError(`The format string mustn't contain \`${L.fullToken}\` and \`${v}\` at the same time`)}else if(A.incompatibleTokens==="*"&&m.length>0)throw new RangeError(`The format string mustn't contain \`${v}\` and any other token at the same time`);m.push({token:C,fullToken:v});const I=A.run(n,v,a.match,d);if(!I)return r();f.push(I.setter),n=I.rest}else{if(C.match(GT))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");if(v==="''"?v="'":C==="'"&&(v=XT(v)),n.indexOf(v)===0)n=n.slice(v.length);else return r()}}if(n.length>0&&jT.test(n))return r();const _=f.map(v=>v.priority).sort((v,C)=>C-v).filter((v,C,A)=>A.indexOf(v)===C).map(v=>f.filter(C=>C.priority===v).sort((C,A)=>A.subPriority-C.subPriority)).map(v=>v[0]);let x=Rt(e,i?.in);if(isNaN(+x))return r();const w={};for(const v of _){if(!v.validate(x,d))return r();const C=v.set(x,w,d);Array.isArray(C)?(x=C[0],Object.assign(w,C[1])):x=C}return x}function XT(n){return n.match(YT)[1].replace(qT,"'")}function ZT(n,t){const e=Rt(n,t?.in);return e.setMinutes(0,0,0),e}function QT(n,t){const e=Rt(n,t?.in);return e.setSeconds(0,0),e}function JT(n,t){const e=Rt(n,t?.in);return e.setMilliseconds(0),e}function _p(n){const t=n/Br;return Math.trunc(t)}function bp(n,t){const e=()=>he(t?.in,NaN),i=t?.additionalDigits??2,r=iM(n);let s;if(r.date){const d=rM(r.date,i);s=sM(d.restDateString,d.year)}if(!s||isNaN(+s))return e();const a=+s;let l=0,u;if(r.time&&(l=oM(r.time),isNaN(l)))return e();if(r.timezone){if(u=aM(r.timezone),isNaN(u))return e()}else{const d=new Date(a+l),f=Rt(0,t?.in);return f.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),f.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),f}return Rt(a+l+u,t?.in)}const ha={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},tM=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,eM=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,nM=/^([+-])(\d{2})(?::?(\d{2}))?$/;function iM(n){const t={},e=n.split(ha.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],ha.timeZoneDelimiter.test(t.date)&&(t.date=n.split(ha.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const r=ha.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function rM(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const r=i[1]?parseInt(i[1]):null,s=i[2]?parseInt(i[2]):null;return{year:s===null?r:s*100,restDateString:n.slice((i[1]||i[2]).length)}}function sM(n,t){if(t===null)return new Date(NaN);const e=n.match(tM);if(!e)return new Date(NaN);const i=!!e[4],r=Bs(e[1]),s=Bs(e[2])-1,a=Bs(e[3]),l=Bs(e[4]),u=Bs(e[5])-1;if(i)return fM(t,l,u)?lM(t,l,u):new Date(NaN);{const d=new Date(0);return!uM(t,s,a)||!dM(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function Bs(n){return n?parseInt(n):1}function oM(n){const t=n.match(eM);if(!t)return NaN;const e=Bc(t[1]),i=Bc(t[2]),r=Bc(t[3]);return hM(e,i,r)?e*Br+i*Es+r*1e3:NaN}function Bc(n){return n&&parseFloat(n.replace(",","."))||0}function aM(n){if(n==="Z")return 0;const t=n.match(nM);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return pM(i,r)?e*(i*Br+r*Es):NaN}function lM(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=(t-1)*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const cM=[31,null,31,30,31,30,31,31,30,31,30,31];function xp(n){return n%400===0||n%4===0&&n%100!==0}function uM(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(cM[t]||(xp(n)?29:28))}function dM(n,t){return t>=1&&t<=(xp(n)?366:365)}function fM(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function hM(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function pM(n,t){return t>=0&&t<=59}const wp={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"},csvExport:{dataError:"Error loading data",noDataRange:"No data in selected range",noDataRetry:"Please adjust the time period and try again",timeRangeSelected:"selected",exportPreview:"Export preview",exportAsCsv:"Export as CSV",exportTimeRange:"Time range",exportDescription:"Exports a CSV of the data represented in the chart.",maximumRecordAmount:"The number of groups is limited to {value}",previewRows:"Previewing {rowsMax} of {rowsTotal} row{plural}",downloadButton:"Export",cancelButton:"Cancel",UtcOffset:"UTC offset",Timestamp:"Timestamp"},query_errors:{forbidden:{message:"Data request forbidden",details:"To access this data, either filter for an entity you have access to or request analytics viewer access from your administrator."},time_range_exceeded:{message:"Time range exceeded",details:"The time range for this report is outside of your organization's data retention period"},timeout:{message:"Data request timed out",details:"We're sorry, the request timed out. Please consider using a shorter time period or try again later."},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_data_plane_node:"AI gateway data plane node",ai_gateway_mcp_server:"AI gateway MCP server",ai_gateway_model:"AI gateway model",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",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:"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)","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)",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)"}},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 gM(){const n=Xf.createI18n("en-us",wp);return{i18n:n,i18nT:Xf.i18nTComponent(n)}}function Fs(n){return n+.5|0}const Ti=(n,t,e)=>Math.max(Math.min(n,e),t);function zs(n){return Ti(Fs(n*2.55),0,255)}function Mi(n){return Ti(Fs(n*255),0,255)}function ei(n){return Ti(Fs(n/2.55)/100,0,1)}function vp(n){return Ti(Fs(n*100),0,100)}const Mn={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},Fc=[..."0123456789ABCDEF"],mM=n=>Fc[n&15],yM=n=>Fc[(n&240)>>4]+Fc[n&15],pa=n=>(n&240)>>4===(n&15),_M=n=>pa(n.r)&&pa(n.g)&&pa(n.b)&&pa(n.a);function bM(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&Mn[n[1]]*17,g:255&Mn[n[2]]*17,b:255&Mn[n[3]]*17,a:t===5?Mn[n[4]]*17:255}:(t===7||t===9)&&(e={r:Mn[n[1]]<<4|Mn[n[2]],g:Mn[n[3]]<<4|Mn[n[4]],b:Mn[n[5]]<<4|Mn[n[6]],a:t===9?Mn[n[7]]<<4|Mn[n[8]]:255})),e}const xM=(n,t)=>n<255?t(n):"";function wM(n){var t=_M(n)?mM:yM;return n?"#"+t(n.r)+t(n.g)+t(n.b)+xM(n.a,t):void 0}const vM=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Sp(n,t,e){const i=t*Math.min(e,1-e),r=(s,a=(s+n/30)%12)=>e-i*Math.max(Math.min(a-3,9-a,1),-1);return[r(0),r(8),r(4)]}function SM(n,t,e){const i=(r,s=(r+n/60)%6)=>e-e*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function TM(n,t,e){const i=Sp(n,1,.5);let r;for(t+e>1&&(r=1/(t+e),t*=r,e*=r),r=0;r<3;r++)i[r]*=1-t-e,i[r]+=t;return i}function MM(n,t,e,i,r){return n===r?(t-e)/i+(t<e?6:0):t===r?(e-n)/i+2:(n-t)/i+4}function zc(n){const e=n.r/255,i=n.g/255,r=n.b/255,s=Math.max(e,i,r),a=Math.min(e,i,r),l=(s+a)/2;let u,d,f;return s!==a&&(f=s-a,d=l>.5?f/(2-s-a):f/(s+a),u=MM(e,i,r,f,s),u=u*60+.5),[u|0,d||0,l]}function Uc(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(Mi)}function Hc(n,t,e){return Uc(Sp,n,t,e)}function kM(n,t,e){return Uc(TM,n,t,e)}function DM(n,t,e){return Uc(SM,n,t,e)}function Tp(n){return(n%360+360)%360}function CM(n){const t=vM.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?zs(+t[5]):Mi(+t[5]));const r=Tp(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=kM(r,s,a):t[1]==="hsv"?i=DM(r,s,a):i=Hc(r,s,a),{r:i[0],g:i[1],b:i[2],a:e}}function OM(n,t){var e=zc(n);e[0]=Tp(e[0]+t),e=Hc(e),n.r=e[0],n.g=e[1],n.b=e[2]}function AM(n){if(!n)return;const t=zc(n),e=t[0],i=vp(t[1]),r=vp(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${r}%, ${ei(n.a)})`:`hsl(${e}, ${i}%, ${r}%)`}const Mp={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"},kp={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 RM(){const n={},t=Object.keys(kp),e=Object.keys(Mp);let i,r,s,a,l;for(i=0;i<t.length;i++){for(a=l=t[i],r=0;r<e.length;r++)s=e[r],l=l.replace(s,Mp[s]);s=parseInt(kp[a],16),n[l]=[s>>16&255,s>>8&255,s&255]}return n}let ga;function EM(n){ga||(ga=RM(),ga.transparent=[0,0,0,0]);const t=ga[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const PM=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function IM(n){const t=PM.exec(n);let e=255,i,r,s;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?zs(a):Ti(a*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?zs(i):Ti(i,0,255)),r=255&(t[4]?zs(r):Ti(r,0,255)),s=255&(t[6]?zs(s):Ti(s,0,255)),{r:i,g:r,b:s,a:e}}}function LM(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ei(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Wc=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Ur=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function NM(n,t,e){const i=Ur(ei(n.r)),r=Ur(ei(n.g)),s=Ur(ei(n.b));return{r:Mi(Wc(i+e*(Ur(ei(t.r))-i))),g:Mi(Wc(r+e*(Ur(ei(t.g))-r))),b:Mi(Wc(s+e*(Ur(ei(t.b))-s))),a:n.a+e*(t.a-n.a)}}function ma(n,t,e){if(n){let i=zc(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Hc(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Dp(n,t){return n&&Object.assign(t||{},n)}function Cp(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=Mi(n[3]))):(t=Dp(n,{r:0,g:0,b:0,a:1}),t.a=Mi(t.a)),t}function BM(n){return n.charAt(0)==="r"?IM(n):CM(n)}class Us{constructor(t){if(t instanceof Us)return t;const e=typeof t;let i;e==="object"?i=Cp(t):e==="string"&&(i=bM(t)||EM(t)||BM(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Dp(this._rgb);return t&&(t.a=ei(t.a)),t}set rgb(t){this._rgb=Cp(t)}rgbString(){return this._valid?LM(this._rgb):void 0}hexString(){return this._valid?wM(this._rgb):void 0}hslString(){return this._valid?AM(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,r=t.rgb;let s;const a=e===s?.5:e,l=2*a-1,u=i.a-r.a,d=((l*u===-1?l:(l+u)/(1+l*u))+1)/2;s=1-d,i.r=255&d*i.r+s*r.r+.5,i.g=255&d*i.g+s*r.g+.5,i.b=255&d*i.b+s*r.b+.5,i.a=a*i.a+(1-a)*r.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=NM(this._rgb,t._rgb,e)),this}clone(){return new Us(this.rgb)}alpha(t){return this._rgb.a=Mi(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Fs(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ma(this._rgb,2,t),this}darken(t){return ma(this._rgb,2,-t),this}saturate(t){return ma(this._rgb,1,t),this}desaturate(t){return ma(this._rgb,1,-t),this}rotate(t){return OM(this._rgb,t),this}}function ni(){}const FM=(()=>{let n=0;return()=>n++})();function vt(n){return n==null}function qt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function It(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function ae(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function pn(n,t){return ae(n)?n:t}function Ct(n,t){return typeof n>"u"?t:n}const zM=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Op=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function Qt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Jt(n,t,e,i){let r,s,a;if(qt(n))for(s=n.length,r=0;r<s;r++)t.call(e,n[r],r);else if(It(n))for(a=Object.keys(n),s=a.length,r=0;r<s;r++)t.call(e,n[a[r]],a[r])}function ya(n,t){let e,i,r,s;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(r=n[e],s=t[e],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function _a(n){if(qt(n))return n.map(_a);if(It(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let r=0;for(;r<i;++r)t[e[r]]=_a(n[e[r]]);return t}return n}function Ap(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function UM(n,t,e,i){if(!Ap(n))return;const r=t[n],s=e[n];It(r)&&It(s)?Hs(r,s,i):t[n]=_a(s)}function Hs(n,t,e){const i=qt(t)?t:[t],r=i.length;if(!It(n))return n;e=e||{};const s=e.merger||UM;let a;for(let l=0;l<r;++l){if(a=i[l],!It(a))continue;const u=Object.keys(a);for(let d=0,f=u.length;d<f;++d)s(u[d],n,a,e)}return n}function Ws(n,t){return Hs(n,t,{merger:HM})}function HM(n,t,e){if(!Ap(n))return;const i=t[n],r=e[n];It(i)&&It(r)?Ws(i,r):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=_a(r))}const Rp={"":n=>n,x:n=>n.x,y:n=>n.y};function WM(n){const t=n.split("."),e=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function $M(n){const t=WM(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function ki(n,t){return(Rp[t]||(Rp[t]=$M(t)))(n)}function $c(n){return n.charAt(0).toUpperCase()+n.slice(1)}const en=n=>typeof n<"u",nn=n=>typeof n=="function",Ep=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function VM(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Et=Math.PI,te=2*Et,YM=te+Et,ba=Number.POSITIVE_INFINITY,Vc=Et/180,re=Et/2,kn=Et/4,xa=Et*2/3,Di=Math.log10,Yn=Math.sign;function $s(n,t,e){return Math.abs(n-t)<e}function Pp(n){const t=Math.round(n);n=$s(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(Di(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function qM(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((r,s)=>r-s).pop(),t}function jM(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function Ci(n){return!jM(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function GM(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Ip(n,t,e){let i,r,s;for(i=0,r=n.length;i<r;i++)s=n[i][e],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function xe(n){return n*(Et/180)}function wa(n){return n*(180/Et)}function Lp(n){if(!ae(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function va(n,t){const e=t.x-n.x,i=t.y-n.y,r=Math.sqrt(e*e+i*i);let s=Math.atan2(i,e);return s<-.5*Et&&(s+=te),{angle:s,distance:r}}function Hr(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function KM(n,t){return(n-t+YM)%te-Et}function Ue(n){return(n%te+te)%te}function Vs(n,t,e,i){const r=Ue(n),s=Ue(t),a=Ue(e),l=Ue(s-r),u=Ue(a-r),d=Ue(r-s),f=Ue(r-a);return r===s||r===a||i&&s===a||l>u&&d<f}function Ce(n,t,e){return Math.max(t,Math.min(e,n))}function XM(n){return Ce(n,-32768,32767)}function ii(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Yc(n,t,e){e=e||(a=>n[a]<t);let i=n.length-1,r=0,s;for(;i-r>1;)s=r+i>>1,e(s)?r=s:i=s;return{lo:r,hi:i}}const ri=(n,t,e,i)=>Yc(n,e,i?r=>{const s=n[r][t];return s<e||s===e&&n[r+1][t]===e}:r=>n[r][t]<e),ZM=(n,t,e)=>Yc(n,e,i=>n[i][t]>=e);function QM(n,t,e){let i=0,r=n.length;for(;i<r&&n[i]<t;)i++;for(;r>i&&n[r-1]>e;)r--;return i>0||r<n.length?n.slice(i,r):n}const Np=["push","pop","shift","splice","unshift"];function JM(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Np.forEach(e=>{const i="_onData"+$c(e),r=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...s){const a=r.apply(this,s);return n._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...s)}),a}})})}function Bp(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(Np.forEach(s=>{delete n[s]}),delete n._chartjs)}function Fp(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const zp=(function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame})();function Up(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,zp.call(window,()=>{i=!1,n.apply(t,e)}))}}function tk(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const qc=n=>n==="start"?"left":n==="end"?"right":"center",He=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,ek=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Hp(n,t,e){const i=t.length;let r=0,s=i;if(n._sorted){const{iScale:a,vScale:l,_parsed:u}=n,d=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,f=a.axis,{min:g,max:m,minDefined:_,maxDefined:x}=a.getUserBounds();if(_){if(r=Math.min(ri(u,f,g).lo,e?i:ri(t,f,a.getPixelForValue(g)).lo),d){const w=u.slice(0,r+1).reverse().findIndex(v=>!vt(v[l.axis]));r-=Math.max(0,w)}r=Ce(r,0,i-1)}if(x){let w=Math.max(ri(u,a.axis,m,!0).hi+1,e?0:ri(t,f,a.getPixelForValue(m),!0).hi+1);if(d){const v=u.slice(w-1).findIndex(C=>!vt(C[l.axis]));w+=Math.max(0,v)}s=Ce(w,r,i)-r}else s=i-r}return{start:r,count:s}}function Wp(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,r={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=r,!0;const s=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,r),s}const Sa=n=>n===0||n===1,$p=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*te/e)),Vp=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*te/e)+1,Ys={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*re)+1,easeOutSine:n=>Math.sin(n*re),easeInOutSine:n=>-.5*(Math.cos(Et*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Sa(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Sa(n)?n:$p(n,.075,.3),easeOutElastic:n=>Sa(n)?n:Vp(n,.075,.3),easeInOutElastic(n){return Sa(n)?n:n<.5?.5*$p(n*2,.1125,.45):.5+.5*Vp(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Ys.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Ys.easeInBounce(n*2)*.5:Ys.easeOutBounce(n*2-1)*.5+.5};function jc(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ta(n){return jc(n)?n:new Us(n)}function Gc(n){return jc(n)?n:new Us(n).saturate(.5).darken(.1).hexString()}const nk=["x","y","borderWidth","radius","tension"],ik=["color","borderColor","backgroundColor"];function rk(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:ik},numbers:{type:"number",properties:nk}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function sk(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Yp=new Map;function ok(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Yp.get(e);return i||(i=new Intl.NumberFormat(n,t),Yp.set(e,i)),i}function qs(n,t,e){return ok(t,e).format(n)}const qp={values(n){return qt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let r,s=n;if(e.length>1){const d=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(d<1e-4||d>1e15)&&(r="scientific"),s=ak(n,e)}const a=Di(Math.abs(s)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),u={notation:r,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(u,this.options.ticks.format),qs(n,i,u)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(Di(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?qp.numeric.call(this,n,t,e):""}};function ak(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var Ma={formatters:qp};function lk(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ma.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const sr=Object.create(null),Kc=Object.create(null);function js(n,t){if(!t)return n;const e=t.split(".");for(let i=0,r=e.length;i<r;++i){const s=e[i];n=n[s]||(n[s]=Object.create(null))}return n}function Xc(n,t,e){return typeof t=="string"?Hs(js(n,t),e):Hs(js(n,""),t)}class ck{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>Gc(r.backgroundColor),this.hoverBorderColor=(i,r)=>Gc(r.borderColor),this.hoverColor=(i,r)=>Gc(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Xc(this,t,e)}get(t){return js(this,t)}describe(t,e){return Xc(Kc,t,e)}override(t,e){return Xc(sr,t,e)}route(t,e,i,r){const s=js(this,t),a=js(this,i),l="_"+e;Object.defineProperties(s,{[l]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const u=this[l],d=a[r];return It(u)?Object.assign({},d,u):Ct(u,d)},set(u){this[l]=u}}})}apply(t){t.forEach(e=>e(this))}}var se=new ck({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[rk,sk,lk]);function uk(n){return!n||vt(n.size)||vt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ka(n,t,e,i,r){let s=t[r];return s||(s=t[r]=n.measureText(r).width,e.push(r)),s>i&&(i=s),i}function dk(n,t,e,i){i=i||{};let r=i.data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},s=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let a=0;const l=e.length;let u,d,f,g,m;for(u=0;u<l;u++)if(g=e[u],g!=null&&!qt(g))a=ka(n,r,s,a,g);else if(qt(g))for(d=0,f=g.length;d<f;d++)m=g[d],m!=null&&!qt(m)&&(a=ka(n,r,s,a,m));n.restore();const _=s.length/2;if(_>e.length){for(u=0;u<_;u++)delete r[s[u]];s.splice(0,_)}return a}function or(n,t,e){const i=n.currentDevicePixelRatio,r=e!==0?Math.max(e/2,.5):0;return Math.round((t-r)*i)/i+r}function jp(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Zc(n,t,e,i){Gp(n,t,e,i,null)}function Gp(n,t,e,i,r){let s,a,l,u,d,f,g,m;const _=t.pointStyle,x=t.rotation,w=t.radius;let v=(x||0)*Vc;if(_&&typeof _=="object"&&(s=_.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(v),n.drawImage(_,-_.width/2,-_.height/2,_.width,_.height),n.restore();return}if(!(isNaN(w)||w<=0)){switch(n.beginPath(),_){default:r?n.ellipse(e,i,r/2,w,0,0,te):n.arc(e,i,w,0,te),n.closePath();break;case"triangle":f=r?r/2:w,n.moveTo(e+Math.sin(v)*f,i-Math.cos(v)*w),v+=xa,n.lineTo(e+Math.sin(v)*f,i-Math.cos(v)*w),v+=xa,n.lineTo(e+Math.sin(v)*f,i-Math.cos(v)*w),n.closePath();break;case"rectRounded":d=w*.516,u=w-d,a=Math.cos(v+kn)*u,g=Math.cos(v+kn)*(r?r/2-d:u),l=Math.sin(v+kn)*u,m=Math.sin(v+kn)*(r?r/2-d:u),n.arc(e-g,i-l,d,v-Et,v-re),n.arc(e+m,i-a,d,v-re,v),n.arc(e+g,i+l,d,v,v+re),n.arc(e-m,i+a,d,v+re,v+Et),n.closePath();break;case"rect":if(!x){u=Math.SQRT1_2*w,f=r?r/2:u,n.rect(e-f,i-u,2*f,2*u);break}v+=kn;case"rectRot":g=Math.cos(v)*(r?r/2:w),a=Math.cos(v)*w,l=Math.sin(v)*w,m=Math.sin(v)*(r?r/2:w),n.moveTo(e-g,i-l),n.lineTo(e+m,i-a),n.lineTo(e+g,i+l),n.lineTo(e-m,i+a),n.closePath();break;case"crossRot":v+=kn;case"cross":g=Math.cos(v)*(r?r/2:w),a=Math.cos(v)*w,l=Math.sin(v)*w,m=Math.sin(v)*(r?r/2:w),n.moveTo(e-g,i-l),n.lineTo(e+g,i+l),n.moveTo(e+m,i-a),n.lineTo(e-m,i+a);break;case"star":g=Math.cos(v)*(r?r/2:w),a=Math.cos(v)*w,l=Math.sin(v)*w,m=Math.sin(v)*(r?r/2:w),n.moveTo(e-g,i-l),n.lineTo(e+g,i+l),n.moveTo(e+m,i-a),n.lineTo(e-m,i+a),v+=kn,g=Math.cos(v)*(r?r/2:w),a=Math.cos(v)*w,l=Math.sin(v)*w,m=Math.sin(v)*(r?r/2:w),n.moveTo(e-g,i-l),n.lineTo(e+g,i+l),n.moveTo(e+m,i-a),n.lineTo(e-m,i+a);break;case"line":a=r?r/2:Math.cos(v)*w,l=Math.sin(v)*w,n.moveTo(e-a,i-l),n.lineTo(e+a,i+l);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(v)*(r?r/2:w),i+Math.sin(v)*w);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function si(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function Gs(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Ks(n){n.restore()}function fk(n,t,e,i,r){if(!t)return n.lineTo(e.x,e.y);if(r==="middle"){const s=(t.x+e.x)/2;n.lineTo(s,t.y),n.lineTo(s,e.y)}else r==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function hk(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function pk(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),vt(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function gk(n,t,e,i,r){if(r.strikethrough||r.underline){const s=n.measureText(i),a=t-s.actualBoundingBoxLeft,l=t+s.actualBoundingBoxRight,u=e-s.actualBoundingBoxAscent,d=e+s.actualBoundingBoxDescent,f=r.strikethrough?(u+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=r.decorationWidth||2,n.moveTo(a,f),n.lineTo(l,f),n.stroke()}}function mk(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function ar(n,t,e,i,r,s={}){const a=qt(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!=="";let u,d;for(n.save(),n.font=r.string,pk(n,s),u=0;u<a.length;++u)d=a[u],s.backdrop&&mk(n,s.backdrop),l&&(s.strokeColor&&(n.strokeStyle=s.strokeColor),vt(s.strokeWidth)||(n.lineWidth=s.strokeWidth),n.strokeText(d,e,i,s.maxWidth)),n.fillText(d,e,i,s.maxWidth),gk(n,e,i,d,s),i+=Number(r.lineHeight);n.restore()}function Wr(n,t){const{x:e,y:i,w:r,h:s,radius:a}=t;n.arc(e+a.topLeft,i+a.topLeft,a.topLeft,1.5*Et,Et,!0),n.lineTo(e,i+s-a.bottomLeft),n.arc(e+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,Et,re,!0),n.lineTo(e+r-a.bottomRight,i+s),n.arc(e+r-a.bottomRight,i+s-a.bottomRight,a.bottomRight,re,0,!0),n.lineTo(e+r,i+a.topRight),n.arc(e+r-a.topRight,i+a.topRight,a.topRight,0,-re,!0),n.lineTo(e+a.topLeft,i)}const yk=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,_k=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function bk(n,t){const e=(""+n).match(yk);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const xk=n=>+n||0;function Qc(n,t){const e={},i=It(t),r=i?Object.keys(t):t,s=It(n)?i?a=>Ct(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of r)e[a]=xk(s(a));return e}function Kp(n){return Qc(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Oi(n){return Qc(n,["topLeft","topRight","bottomLeft","bottomRight"])}function we(n){const t=Kp(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function le(n,t){n=n||{},t=t||se.font;let e=Ct(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=Ct(n.style,t.style);i&&!(""+i).match(_k)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Ct(n.family,t.family),lineHeight:bk(Ct(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:Ct(n.weight,t.weight),string:""};return r.string=uk(r),r}function Xs(n,t,e,i){let r,s,a;for(r=0,s=n.length;r<s;++r)if(a=n[r],a!==void 0&&a!==void 0)return a}function wk(n,t,e){const{min:i,max:r}=n,s=Op(t,(r-i)/2),a=(l,u)=>e&&l===0?0:l+u;return{min:a(i,-Math.abs(s)),max:a(r,s)}}function Ai(n,t){return Object.assign(Object.create(n),t)}function Jc(n,t=[""],e,i,r=()=>n[0]){const s=e||n;typeof i>"u"&&(i=tg("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>Jc([l,...n],t,s,i)};return new Proxy(a,{deleteProperty(l,u){return delete l[u],delete l._keys,delete n[0][u],!0},get(l,u){return Zp(l,u,()=>Ok(u,t,n,l))},getOwnPropertyDescriptor(l,u){return Reflect.getOwnPropertyDescriptor(l._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,u){return eg(l).includes(u)},ownKeys(l){return eg(l)},set(l,u,d){const f=l._storage||(l._storage=r());return l[u]=f[u]=d,delete l._keys,!0}})}function $r(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Xp(n,i),setContext:s=>$r(n,s,e,i),override:s=>$r(n.override(s),t,e,i)};return new Proxy(r,{deleteProperty(s,a){return delete s[a],delete n[a],!0},get(s,a,l){return Zp(s,a,()=>Sk(s,a,l))},getOwnPropertyDescriptor(s,a){return s._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(s,a,l){return n[a]=l,delete s[a],!0}})}function Xp(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=n;return{allKeys:r,scriptable:e,indexable:i,isScriptable:nn(e)?e:()=>e,isIndexable:nn(i)?i:()=>i}}const vk=(n,t)=>n?n+$c(t):t,tu=(n,t)=>It(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Zp(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function Sk(n,t,e){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=n;let l=i[t];return nn(l)&&a.isScriptable(t)&&(l=Tk(t,l,n,e)),qt(l)&&l.length&&(l=Mk(t,l,n,a.isIndexable)),tu(t,l)&&(l=$r(l,r,s&&s[t],a)),l}function Tk(n,t,e,i){const{_proxy:r,_context:s,_subProxy:a,_stack:l}=e;if(l.has(n))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+n);l.add(n);let u=t(s,a||i);return l.delete(n),tu(n,u)&&(u=eu(r._scopes,r,n,u)),u}function Mk(n,t,e,i){const{_proxy:r,_context:s,_subProxy:a,_descriptors:l}=e;if(typeof s.index<"u"&&i(n))return t[s.index%t.length];if(It(t[0])){const u=t,d=r._scopes.filter(f=>f!==u);t=[];for(const f of u){const g=eu(d,r,n,f);t.push($r(g,s,a&&a[n],l))}}return t}function Qp(n,t,e){return nn(n)?n(t,e):n}const kk=(n,t)=>n===!0?t:typeof n=="string"?ki(t,n):void 0;function Dk(n,t,e,i,r){for(const s of t){const a=kk(e,s);if(a){n.add(a);const l=Qp(a._fallback,e,r);if(typeof l<"u"&&l!==e&&l!==i)return l}else if(a===!1&&typeof i<"u"&&e!==i)return null}return!1}function eu(n,t,e,i){const r=t._rootScopes,s=Qp(t._fallback,e,i),a=[...n,...r],l=new Set;l.add(i);let u=Jp(l,a,e,s||e,i);return u===null||typeof s<"u"&&s!==e&&(u=Jp(l,a,s,u,i),u===null)?!1:Jc(Array.from(l),[""],r,s,()=>Ck(t,e,i))}function Jp(n,t,e,i,r){for(;e;)e=Dk(n,t,e,i,r);return e}function Ck(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return qt(r)&&It(e)?e:r||{}}function Ok(n,t,e,i){let r;for(const s of t)if(r=tg(vk(s,n),e),typeof r<"u")return tu(n,r)?eu(e,i,n,r):r}function tg(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function eg(n){let t=n._keys;return t||(t=n._keys=Ak(n._scopes)),t}function Ak(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function ng(n,t,e,i){const{iScale:r}=n,{key:s="r"}=this._parsing,a=new Array(i);let l,u,d,f;for(l=0,u=i;l<u;++l)d=l+e,f=t[d],a[l]={r:r.parse(ki(f,s),d)};return a}const Rk=Number.EPSILON||1e-14,Vr=(n,t)=>t<n.length&&!n[t].skip&&n[t],ig=n=>n==="x"?"y":"x";function Ek(n,t,e,i){const r=n.skip?t:n,s=t,a=e.skip?t:e,l=Hr(s,r),u=Hr(a,s);let d=l/(l+u),f=u/(l+u);d=isNaN(d)?0:d,f=isNaN(f)?0:f;const g=i*d,m=i*f;return{previous:{x:s.x-g*(a.x-r.x),y:s.y-g*(a.y-r.y)},next:{x:s.x+m*(a.x-r.x),y:s.y+m*(a.y-r.y)}}}function Pk(n,t,e){const i=n.length;let r,s,a,l,u,d=Vr(n,0);for(let f=0;f<i-1;++f)if(u=d,d=Vr(n,f+1),!(!u||!d)){if($s(t[f],0,Rk)){e[f]=e[f+1]=0;continue}r=e[f]/t[f],s=e[f+1]/t[f],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(a=3/Math.sqrt(l),e[f]=r*a*t[f],e[f+1]=s*a*t[f])}}function Ik(n,t,e="x"){const i=ig(e),r=n.length;let s,a,l,u=Vr(n,0);for(let d=0;d<r;++d){if(a=l,l=u,u=Vr(n,d+1),!l)continue;const f=l[e],g=l[i];a&&(s=(f-a[e])/3,l[`cp1${e}`]=f-s,l[`cp1${i}`]=g-s*t[d]),u&&(s=(u[e]-f)/3,l[`cp2${e}`]=f+s,l[`cp2${i}`]=g+s*t[d])}}function Lk(n,t="x"){const e=ig(t),i=n.length,r=Array(i).fill(0),s=Array(i);let a,l,u,d=Vr(n,0);for(a=0;a<i;++a)if(l=u,u=d,d=Vr(n,a+1),!!u){if(d){const f=d[t]-u[t];r[a]=f!==0?(d[e]-u[e])/f:0}s[a]=l?d?Yn(r[a-1])!==Yn(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}Pk(n,r,s),Ik(n,s,t)}function Da(n,t,e){return Math.max(Math.min(n,e),t)}function Nk(n,t){let e,i,r,s,a,l=si(n[0],t);for(e=0,i=n.length;e<i;++e)a=s,s=l,l=e<i-1&&si(n[e+1],t),s&&(r=n[e],a&&(r.cp1x=Da(r.cp1x,t.left,t.right),r.cp1y=Da(r.cp1y,t.top,t.bottom)),l&&(r.cp2x=Da(r.cp2x,t.left,t.right),r.cp2y=Da(r.cp2y,t.top,t.bottom)))}function Bk(n,t,e,i,r){let s,a,l,u;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")Lk(n,r);else{let d=i?n[n.length-1]:n[0];for(s=0,a=n.length;s<a;++s)l=n[s],u=Ek(d,l,n[Math.min(s+1,a-(i?0:1))%a],t.tension),l.cp1x=u.previous.x,l.cp1y=u.previous.y,l.cp2x=u.next.x,l.cp2y=u.next.y,d=l}t.capBezierPoints&&Nk(n,e)}function nu(){return typeof window<"u"&&typeof document<"u"}function iu(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ca(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const Oa=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Fk(n,t){return Oa(n).getPropertyValue(t)}const zk=["top","right","bottom","left"];function lr(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const s=zk[r];i[s]=parseFloat(n[t+"-"+s+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Uk=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Hk(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:s}=i;let a=!1,l,u;if(Uk(r,s,n.target))l=r,u=s;else{const d=t.getBoundingClientRect();l=i.clientX-d.left,u=i.clientY-d.top,a=!0}return{x:l,y:u,box:a}}function Ri(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,r=Oa(e),s=r.boxSizing==="border-box",a=lr(r,"padding"),l=lr(r,"border","width"),{x:u,y:d,box:f}=Hk(n,e),g=a.left+(f&&l.left),m=a.top+(f&&l.top);let{width:_,height:x}=t;return s&&(_-=a.width+l.width,x-=a.height+l.height),{x:Math.round((u-g)/_*e.width/i),y:Math.round((d-m)/x*e.height/i)}}function Wk(n,t,e){let i,r;if(t===void 0||e===void 0){const s=n&&iu(n);if(!s)t=n.clientWidth,e=n.clientHeight;else{const a=s.getBoundingClientRect(),l=Oa(s),u=lr(l,"border","width"),d=lr(l,"padding");t=a.width-d.width-u.width,e=a.height-d.height-u.height,i=Ca(l.maxWidth,s,"clientWidth"),r=Ca(l.maxHeight,s,"clientHeight")}}return{width:t,height:e,maxWidth:i||ba,maxHeight:r||ba}}const Ei=n=>Math.round(n*10)/10;function $k(n,t,e,i){const r=Oa(n),s=lr(r,"margin"),a=Ca(r.maxWidth,n,"clientWidth")||ba,l=Ca(r.maxHeight,n,"clientHeight")||ba,u=Wk(n,t,e);let{width:d,height:f}=u;if(r.boxSizing==="content-box"){const m=lr(r,"border","width"),_=lr(r,"padding");d-=_.width+m.width,f-=_.height+m.height}return d=Math.max(0,d-s.width),f=Math.max(0,i?d/i:f-s.height),d=Ei(Math.min(d,a,u.maxWidth)),f=Ei(Math.min(f,l,u.maxHeight)),d&&!f&&(f=Ei(d/2)),(t!==void 0||e!==void 0)&&i&&u.height&&f>u.height&&(f=u.height,d=Ei(Math.floor(f*i))),{width:d,height:f}}function rg(n,t,e){const i=t||1,r=Ei(n.height*i),s=Ei(n.width*i);n.height=Ei(n.height),n.width=Ei(n.width);const a=n.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${n.height}px`,a.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||a.height!==r||a.width!==s?(n.currentDevicePixelRatio=i,a.height=r,a.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Vk=(function(){let n=!1;try{const t={get passive(){return n=!0,!1}};nu()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n})();function sg(n,t){const e=Fk(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function cr(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Yk(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function qk(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},s={x:t.cp1x,y:t.cp1y},a=cr(n,r,e),l=cr(r,s,e),u=cr(s,t,e),d=cr(a,l,e),f=cr(l,u,e);return cr(d,f,e)}const jk=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},Gk=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function Yr(n,t,e){return n?jk(t,e):Gk()}function og(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function ag(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function lg(n){return n==="angle"?{between:Vs,compare:KM,normalize:Ue}:{between:ii,compare:(t,e)=>t-e,normalize:t=>t}}function cg({start:n,end:t,count:e,loop:i,style:r}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:r}}function Kk(n,t,e){const{property:i,start:r,end:s}=e,{between:a,normalize:l}=lg(i),u=t.length;let{start:d,end:f,loop:g}=n,m,_;if(g){for(d+=u,f+=u,m=0,_=u;m<_&&a(l(t[d%u][i]),r,s);++m)d--,f--;d%=u,f%=u}return f<d&&(f+=u),{start:d,end:f,loop:g,style:n.style}}function ug(n,t,e){if(!e)return[n];const{property:i,start:r,end:s}=e,a=t.length,{compare:l,between:u,normalize:d}=lg(i),{start:f,end:g,loop:m,style:_}=Kk(n,t,e),x=[];let w=!1,v=null,C,A,F;const I=()=>u(r,F,C)&&l(r,F)!==0,L=()=>l(s,C)===0||u(s,F,C),N=()=>w||I(),B=()=>!w||L();for(let k=f,T=f;k<=g;++k)A=t[k%a],!A.skip&&(C=d(A[i]),C!==F&&(w=u(C,r,s),v===null&&N()&&(v=l(C,r)===0?k:T),v!==null&&B()&&(x.push(cg({start:v,end:k,loop:m,count:a,style:_})),v=null),T=k,F=C));return v!==null&&x.push(cg({start:v,end:g,loop:m,count:a,style:_})),x}function dg(n,t){const e=[],i=n.segments;for(let r=0;r<i.length;r++){const s=ug(i[r],n.points,t);s.length&&e.push(...s)}return e}function Xk(n,t,e,i){let r=0,s=t-1;if(e&&!i)for(;r<t&&!n[r].skip;)r++;for(;r<t&&n[r].skip;)r++;for(r%=t,e&&(s+=r);s>r&&n[s%t].skip;)s--;return s%=t,{start:r,end:s}}function Zk(n,t,e,i){const r=n.length,s=[];let a=t,l=n[t],u;for(u=t+1;u<=e;++u){const d=n[u%r];d.skip||d.stop?l.skip||(i=!1,s.push({start:t%r,end:(u-1)%r,loop:i}),t=a=d.stop?u:null):(a=u,l.skip&&(t=u)),l=d}return a!==null&&s.push({start:t%r,end:a%r,loop:i}),s}function Qk(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const s=!!n._loop,{start:a,end:l}=Xk(e,r,s,i);if(i===!0)return fg(n,[{start:a,end:l,loop:s}],e,t);const u=l<a?l+r:l,d=!!n._fullLoop&&a===0&&l===r-1;return fg(n,Zk(e,a,u,d),e,t)}function fg(n,t,e,i){return!i||!i.setContext||!e?t:Jk(n,t,e,i)}function Jk(n,t,e,i){const r=n._chart.getContext(),s=hg(n.options),{_datasetIndex:a,options:{spanGaps:l}}=n,u=e.length,d=[];let f=s,g=t[0].start,m=g;function _(x,w,v,C){const A=l?-1:1;if(x!==w){for(x+=u;e[x%u].skip;)x-=A;for(;e[w%u].skip;)w+=A;x%u!==w%u&&(d.push({start:x%u,end:w%u,loop:v,style:C}),f=C,g=w%u)}}for(const x of t){g=l?g:x.start;let w=e[g%u],v;for(m=g+1;m<=x.end;m++){const C=e[m%u];v=hg(i.setContext(Ai(r,{type:"segment",p0:w,p1:C,p0DataIndex:(m-1)%u,p1DataIndex:m%u,datasetIndex:a}))),tD(v,f)&&_(g,m-1,x.loop,f),w=C,f=v}g<m-1&&_(g,m-1,x.loop,f)}return d}function hg(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function tD(n,t){if(!t)return!1;const e=[],i=function(r,s){return jc(s)?(e.includes(s)||e.push(s),e.indexOf(s)):s};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function Aa(n,t,e){return n.options.clip?n[e]:t[e]}function eD(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Aa(e,t,"left"),right:Aa(e,t,"right"),top:Aa(i,t,"top"),bottom:Aa(i,t,"bottom")}:t}function pg(n,t){const e=t._clip;if(e.disabled)return!1;const i=eD(t,n.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?n.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?n.height:i.bottom+(e.bottom===!0?0:e.bottom)}}class nD{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,r){const s=e.listeners[r],a=e.duration;s.forEach(l=>l({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=zp.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const s=i.items;let a=s.length-1,l=!1,u;for(;a>=0;--a)u=s[a],u._active?(u._total>i.duration&&(i.duration=u._total),u.tick(t),l=!0):(s[a]=s[s.length-1],s.pop());l&&(r.draw(),this._notify(r,i,t,"progress")),s.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),e+=s.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var oi=new nD;const gg="transparent",iD={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Ta(n||gg),r=i.valid&&Ta(t||gg);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class rD{constructor(t,e,i,r){const s=e[i];r=Xs([t.to,r,s,t.from]);const a=Xs([t.from,s,r]);this._active=!0,this._fn=t.fn||iD[t.type||typeof a],this._easing=Ys[t.easing]||Ys.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const r=this._target[this._prop],s=i-this._start,a=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=Xs([t.to,e,r,t.from]),this._from=Xs([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,r=this._prop,s=this._from,a=this._loop,l=this._to;let u;if(this._active=s!==l&&(a||e<i),!this._active){this._target[r]=l,this._notify(!0);return}if(e<0){this._target[r]=s;return}u=e/i%2,u=a&&u>1?2-u:u,u=this._easing(Math.min(1,Math.max(0,u))),this._target[r]=this._fn(s,l,u)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][e]()}}class ru{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!It(t))return;const e=Object.keys(se.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!It(s))return;const a={};for(const l of e)a[l]=s[l];(qt(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!i.has(l))&&i.set(l,a)})})}_animateOptions(t,e){const i=e.options,r=oD(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&sD(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,e){const i=this._properties,r=[],s=t.$animations||(t.$animations={}),a=Object.keys(e),l=Date.now();let u;for(u=a.length-1;u>=0;--u){const d=a[u];if(d.charAt(0)==="$")continue;if(d==="options"){r.push(...this._animateOptions(t,e));continue}const f=e[d];let g=s[d];const m=i.get(d);if(g)if(m&&g.active()){g.update(m,f,l);continue}else g.cancel();if(!m||!m.duration){t[d]=f;continue}s[d]=g=new rD(m,t,d,f),r.push(g)}return r}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return oi.add(this._chart,i),!0}}function sD(n,t){const e=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const s=n[i[r]];s&&s.active()&&e.push(s.wait())}return Promise.all(e)}function oD(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function mg(n,t){const e=n&&n.options||{},i=e.reverse,r=e.min===void 0?t:0,s=e.max===void 0?t:0;return{start:i?s:r,end:i?r:s}}function aD(n,t,e){if(e===!1)return!1;const i=mg(n,e),r=mg(t,e);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function lD(n){let t,e,i,r;return It(n)?(t=n.top,e=n.right,i=n.bottom,r=n.left):t=e=i=r=n,{top:t,right:e,bottom:i,left:r,disabled:n===!1}}function yg(n,t){const e=[],i=n._getSortedDatasetMetas(t);let r,s;for(r=0,s=i.length;r<s;++r)e.push(i[r].index);return e}function _g(n,t,e,i={}){const r=n.keys,s=i.mode==="single";let a,l,u,d;if(t===null)return;let f=!1;for(a=0,l=r.length;a<l;++a){if(u=+r[a],u===e){if(f=!0,i.all)continue;break}d=n.values[u],ae(d)&&(s||t===0||Yn(t)===Yn(d))&&(t+=d)}return!f&&!i.all?0:t}function cD(n,t){const{iScale:e,vScale:i}=t,r=e.axis==="x"?"x":"y",s=i.axis==="x"?"x":"y",a=Object.keys(n),l=new Array(a.length);let u,d,f;for(u=0,d=a.length;u<d;++u)f=a[u],l[u]={[r]:f,[s]:n[f]};return l}function su(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function uD(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function dD(n){const{min:t,max:e,minDefined:i,maxDefined:r}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?e:Number.POSITIVE_INFINITY}}function fD(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function bg(n,t,e,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const s=n[r.index];if(e&&s>0||!e&&s<0)return r.index}return null}function xg(n,t){const{chart:e,_cachedMeta:i}=n,r=e._stacks||(e._stacks={}),{iScale:s,vScale:a,index:l}=i,u=s.axis,d=a.axis,f=uD(s,a,i),g=t.length;let m;for(let _=0;_<g;++_){const x=t[_],{[u]:w,[d]:v}=x,C=x._stacks||(x._stacks={});m=C[d]=fD(r,f,w),m[l]=v,m._top=bg(m,a,!0,i.type),m._bottom=bg(m,a,!1,i.type);const A=m._visualValues||(m._visualValues={});A[l]=v}}function ou(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function hD(n,t){return Ai(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function pD(n,t,e){return Ai(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Zs(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const r of t){const s=r._stacks;if(!s||s[i]===void 0||s[i][e]===void 0)return;delete s[i][e],s[i]._visualValues!==void 0&&s[i]._visualValues[e]!==void 0&&delete s[i]._visualValues[e]}}}const au=n=>n==="reset"||n==="none",wg=(n,t)=>t?n:Object.assign({},n),gD=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:yg(e,!0),values:null};class Pi{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=su(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&&Zs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(g,m,_,x)=>g==="x"?m:g==="r"?x:_,s=e.xAxisID=Ct(i.xAxisID,ou(t,"x")),a=e.yAxisID=Ct(i.yAxisID,ou(t,"y")),l=e.rAxisID=Ct(i.rAxisID,ou(t,"r")),u=e.indexAxis,d=e.iAxisID=r(u,s,a,l),f=e.vAxisID=r(u,a,s,l);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(l),e.iScale=this.getScaleForId(d),e.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Bp(this._data,this),t._stacked&&Zs(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(It(e)){const r=this._cachedMeta;this._data=cD(e,r)}else if(i!==e){if(i){Bp(i,this);const r=this._cachedMeta;Zs(r),r._parsed=[]}e&&Object.isExtensible(e)&&JM(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const s=e._stacked;e._stacked=su(e.vScale,e),e.stack!==i.stack&&(r=!0,Zs(e),e.stack=i.stack),this._resyncElements(t),(r||s!==e._stacked)&&(xg(this,e._parsed),e._stacked=su(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:a}=i,l=s.axis;let u=t===0&&e===r.length?!0:i._sorted,d=t>0&&i._parsed[t-1],f,g,m;if(this._parsing===!1)i._parsed=r,i._sorted=!0,m=r;else{qt(r[t])?m=this.parseArrayData(i,r,t,e):It(r[t])?m=this.parseObjectData(i,r,t,e):m=this.parsePrimitiveData(i,r,t,e);const _=()=>g[l]===null||d&&g[l]<d[l];for(f=0;f<e;++f)i._parsed[f+t]=g=m[f],u&&(_()&&(u=!1),d=g);i._sorted=u}a&&xg(this,m)}parsePrimitiveData(t,e,i,r){const{iScale:s,vScale:a}=t,l=s.axis,u=a.axis,d=s.getLabels(),f=s===a,g=new Array(r);let m,_,x;for(m=0,_=r;m<_;++m)x=m+i,g[m]={[l]:f||s.parse(d[x],x),[u]:a.parse(e[x],x)};return g}parseArrayData(t,e,i,r){const{xScale:s,yScale:a}=t,l=new Array(r);let u,d,f,g;for(u=0,d=r;u<d;++u)f=u+i,g=e[f],l[u]={x:s.parse(g[0],f),y:a.parse(g[1],f)};return l}parseObjectData(t,e,i,r){const{xScale:s,yScale:a}=t,{xAxisKey:l="x",yAxisKey:u="y"}=this._parsing,d=new Array(r);let f,g,m,_;for(f=0,g=r;f<g;++f)m=f+i,_=e[m],d[f]={x:s.parse(ki(_,l),m),y:a.parse(ki(_,u),m)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const r=this.chart,s=this._cachedMeta,a=e[t.axis],l={keys:yg(r,!0),values:e._stacks[t.axis]._visualValues};return _g(l,a,s.index,{mode:i})}updateRangeFromParsed(t,e,i,r){const s=i[e.axis];let a=s===null?NaN:s;const l=r&&i._stacks[e.axis];r&&l&&(r.values=l,a=_g(r,s,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,r=i._parsed,s=i._sorted&&t===i.iScale,a=r.length,l=this._getOtherScale(t),u=gD(e,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:g}=dD(l);let m,_;function x(){_=r[m];const w=_[l.axis];return!ae(_[t.axis])||f>w||g<w}for(m=0;m<a&&!(!x()&&(this.updateRangeFromParsed(d,t,_,u),s));++m);if(s){for(m=a-1;m>=0;--m)if(!x()){this.updateRangeFromParsed(d,t,_,u);break}}return d}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let r,s,a;for(r=0,s=e.length;r<s;++r)a=e[r][t.axis],ae(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,r=e.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=lD(Ct(this.options.clip,aD(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,r=i.data||[],s=e.chartArea,a=[],l=this._drawStart||0,u=this._drawCount||r.length-l,d=this.options.drawActiveElementsOnTop;let f;for(i.dataset&&i.dataset.draw(t,s,l,u),f=l;f<l+u;++f){const g=r[f];g.hidden||(g.active&&d?a.push(g):g.draw(t,s))}for(f=0;f<a.length;++f)a[f].draw(t,s)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const r=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];s=a.$context||(a.$context=pD(this.getContext(),t,a)),s.parsed=this.getParsed(t),s.raw=r.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=hD(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!e,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const r=e==="active",s=this._cachedDataOpts,a=t+"-"+e,l=s[a],u=this.enableOptionSharing&&en(i);if(l)return wg(l,u);const d=this.chart.config,f=d.datasetElementScopeKeys(this._type,t),g=r?[`${t}Hover`,"hover",t,""]:[t,""],m=d.getOptionScopes(this.getDataset(),f),_=Object.keys(se.elements[t]),x=()=>this.getContext(i,r,e),w=d.resolveNamedOptions(m,_,x,g);return w.$shared&&(w.$shared=u,s[a]=Object.freeze(wg(w,u))),w}_resolveAnimations(t,e,i){const r=this.chart,s=this._cachedDataOpts,a=`animation-${e}`,l=s[a];if(l)return l;let u;if(r.options.animation!==!1){const f=this.chart.config,g=f.datasetAnimationScopeKeys(this._type,e),m=f.getOptionScopes(this.getDataset(),g);u=f.createResolver(m,this.getContext(t,i,e))}const d=new ru(r,u&&u.animations);return u&&u._cacheable&&(s[a]=Object.freeze(d)),d}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||au(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,s=this.getSharedOptions(i),a=this.includeOptions(e,s)||s!==r;return this.updateSharedOptions(s,e,i),{sharedOptions:s,includeOptions:a}}updateElement(t,e,i,r){au(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!au(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;const s=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[l,u,d]of this._syncList)this[l](u,d);this._syncList=[];const r=i.length,s=e.length,a=Math.min(s,r);a&&this.parse(0,a),s>r?this._insertElements(r,s-r,t):s<r&&this._removeElements(s,r-s)}_insertElements(t,e,i=!0){const r=this._cachedMeta,s=r.data,a=t+e;let l;const u=d=>{for(d.length+=e,l=d.length-1;l>=a;l--)d[l]=d[l-e]};for(u(s),l=t;l<a;++l)s[l]=new this.dataElementType;this._parsing&&u(r._parsed),this.parse(t,e),i&&this.updateElements(s,t,e,"reset")}updateElements(t,e,i,r){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,e);i._stacked&&Zs(i,r)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,r]=t;this[e](i,r)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function mD(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let r=0,s=e.length;r<s;r++)i=i.concat(e[r].controller.getAllParsedValues(n));n._cache.$bar=Fp(i.sort((r,s)=>r-s))}return n._cache.$bar}function yD(n){const t=n.iScale,e=mD(t,n.type);let i=t._length,r,s,a,l;const u=()=>{a===32767||a===-32768||(en(l)&&(i=Math.min(i,Math.abs(a-l)||i)),l=a)};for(r=0,s=e.length;r<s;++r)a=t.getPixelForValue(e[r]),u();for(l=void 0,r=0,s=t.ticks.length;r<s;++r)a=t.getPixelForTick(r),u();return i}function _D(n,t,e,i){const r=e.barThickness;let s,a;return vt(r)?(s=t.min*e.categoryPercentage,a=e.barPercentage):(s=r*i,a=1),{chunk:s/i,ratio:a,start:t.pixels[n]-s/2}}function bD(n,t,e,i){const r=t.pixels,s=r[n];let a=n>0?r[n-1]:null,l=n<r.length-1?r[n+1]:null;const u=e.categoryPercentage;a===null&&(a=s-(l===null?t.end-t.start:l-s)),l===null&&(l=s+s-a);const d=s-(s-Math.min(a,l))/2*u;return{chunk:Math.abs(l-a)/2*u/i,ratio:e.barPercentage,start:d}}function xD(n,t,e,i){const r=e.parse(n[0],i),s=e.parse(n[1],i),a=Math.min(r,s),l=Math.max(r,s);let u=a,d=l;Math.abs(a)>Math.abs(l)&&(u=l,d=a),t[e.axis]=d,t._custom={barStart:u,barEnd:d,start:r,end:s,min:a,max:l}}function vg(n,t,e,i){return qt(n)?xD(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Sg(n,t,e,i){const r=n.iScale,s=n.vScale,a=r.getLabels(),l=r===s,u=[];let d,f,g,m;for(d=e,f=e+i;d<f;++d)m=t[d],g={},g[r.axis]=l||r.parse(a[d],d),u.push(vg(m,g,s,d));return u}function lu(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function wD(n,t,e){return n!==0?Yn(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function vD(n){let t,e,i,r,s;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(r="end",s="start"):(r="start",s="end"),{start:e,end:i,reverse:t,top:r,bottom:s}}function SD(n,t,e,i){let r=t.borderSkipped;const s={};if(!r){n.borderSkipped=s;return}if(r===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:u,top:d,bottom:f}=vD(n);r==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?r=d:(e._bottom||0)===i?r=f:(s[Tg(f,a,l,u)]=!0,r=d)),s[Tg(r,a,l,u)]=!0,n.borderSkipped=s}function Tg(n,t,e,i){return i?(n=TD(n,t,e),n=Mg(n,e,t)):n=Mg(n,t,e),n}function TD(n,t,e){return n===t?e:n===e?t:n}function Mg(n,t,e){return n==="start"?t:n==="end"?e:n}function MD(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class kg extends Pi{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,e,i,r){return Sg(t,e,i,r)}parseArrayData(t,e,i,r){return Sg(t,e,i,r)}parseObjectData(t,e,i,r){const{iScale:s,vScale:a}=t,{xAxisKey:l="x",yAxisKey:u="y"}=this._parsing,d=s.axis==="x"?l:u,f=a.axis==="x"?l:u,g=[];let m,_,x,w;for(m=i,_=i+r;m<_;++m)w=e[m],x={},x[s.axis]=s.parse(ki(w,d),m),g.push(vg(ki(w,f),x,a,m));return g}updateRangeFromParsed(t,e,i,r){super.updateRangeFromParsed(t,e,i,r);const s=i._custom;s&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:r}=e,s=this.getParsed(t),a=s._custom,l=lu(a)?"["+a.start+", "+a.end+"]":""+r.getLabelForValue(s[r.axis]);return{label:""+i.getLabelForValue(s[i.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,r){const s=r==="reset",{index:a,_cachedMeta:{vScale:l}}=this,u=l.getBasePixel(),d=l.isHorizontal(),f=this._getRuler(),{sharedOptions:g,includeOptions:m}=this._getSharedOptions(e,r);for(let _=e;_<e+i;_++){const x=this.getParsed(_),w=s||vt(x[l.axis])?{base:u,head:u}:this._calculateBarValuePixels(_),v=this._calculateBarIndexPixels(_,f),C=(x._stacks||{})[l.axis],A={horizontal:d,base:w.base,enableBorderRadius:!C||lu(x._custom)||a===C._top||a===C._bottom,x:d?w.head:v.center,y:d?v.center:w.head,height:d?v.size:Math.abs(w.size),width:d?Math.abs(w.size):v.size};m&&(A.options=g||this.resolveDataElementOptions(_,t[_].active?"active":r));const F=A.options||t[_].options;SD(A,F,C,a),MD(A,F,f.ratio),this.updateElement(t[_],_,A,r)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(f=>f.controller.options.grouped),s=i.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(e),u=l&&l[i.axis],d=f=>{const g=f._parsed.find(_=>_[i.axis]===u),m=g&&g[f.vScale.axis];if(vt(m)||isNaN(m))return!0};for(const f of r)if(!(e!==void 0&&d(f))&&((s===!1||a.indexOf(f.stack)===-1||s===void 0&&f.stack===void 0)&&a.push(f.stack),f.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Ct(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const r=this._getStacks(t,i),s=e!==void 0?r.indexOf(e):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,r=[];let s,a;for(s=0,a=e.data.length;s<a;++s)r.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const l=t.barThickness;return{min:l||yD(e),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:r},options:{base:s,minBarLength:a}}=this,l=s||0,u=this.getParsed(t),d=u._custom,f=lu(d);let g=u[e.axis],m=0,_=i?this.applyStack(e,u,i):g,x,w;_!==g&&(m=_-g,_=g),f&&(g=d.barStart,_=d.barEnd-d.barStart,g!==0&&Yn(g)!==Yn(d.barEnd)&&(m=0),m+=g);const v=!vt(s)&&!f?s:m;let C=e.getPixelForValue(v);if(this.chart.getDataVisibility(t)?x=e.getPixelForValue(m+_):x=C,w=x-C,Math.abs(w)<a){w=wD(w,e,l)*a,g===l&&(C-=w/2);const A=e.getPixelForDecimal(0),F=e.getPixelForDecimal(1),I=Math.min(A,F),L=Math.max(A,F);C=Math.max(Math.min(C,L),I),x=C+w,i&&!f&&(u._stacks[e.axis]._visualValues[r]=e.getValueForPixel(x)-e.getValueForPixel(C))}if(C===e.getPixelForValue(l)){const A=Yn(w)*e.getLineWidthForValue(l)/2;C+=A,w-=A}return{size:w,base:C,head:x,center:x+w/2}}_calculateBarIndexPixels(t,e){const i=e.scale,r=this.options,s=r.skipNull,a=Ct(r.maxBarThickness,1/0);let l,u;const d=this._getAxisCount();if(e.grouped){const f=s?this._getStackCount(t):e.stackCount,g=r.barThickness==="flex"?bD(t,e,r,f*d):_D(t,e,r,f*d),m=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,_=this._getAxis().indexOf(Ct(m,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+_;l=g.start+g.chunk*x+g.chunk/2,u=Math.min(a,g.chunk*g.ratio)}else l=i.getPixelForValue(this.getParsed(t)[i.axis],t),u=Math.min(a,e.min*e.ratio);return{base:l-u/2,head:l+u/2,center:l,size:u}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,r=i.length;let s=0;for(;s<r;++s)this.getParsed(s)[e.axis]!==null&&!i[s].hidden&&i[s].draw(this._ctx)}}class kD extends Pi{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,e,i,r){const s=super.parsePrimitiveData(t,e,i,r);for(let a=0;a<s.length;a++)s[a]._custom=this.resolveDataElementOptions(a+i).radius;return s}parseArrayData(t,e,i,r){const s=super.parseArrayData(t,e,i,r);for(let a=0;a<s.length;a++){const l=e[i+a];s[a]._custom=Ct(l[2],this.resolveDataElementOptions(a+i).radius)}return s}parseObjectData(t,e,i,r){const s=super.parseObjectData(t,e,i,r);for(let a=0;a<s.length;a++){const l=e[i+a];s[a]._custom=Ct(l&&l.r&&+l.r,this.resolveDataElementOptions(a+i).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=e,a=this.getParsed(t),l=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y),d=a._custom;return{label:i[t]||"",value:"("+l+", "+u+(d?", "+d:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,r),f=a.axis,g=l.axis;for(let m=e;m<e+i;m++){const _=t[m],x=!s&&this.getParsed(m),w={},v=w[f]=s?a.getPixelForDecimal(.5):a.getPixelForValue(x[f]),C=w[g]=s?l.getBasePixel():l.getPixelForValue(x[g]);w.skip=isNaN(v)||isNaN(C),d&&(w.options=u||this.resolveDataElementOptions(m,_.active?"active":r),s&&(w.options.radius=0)),this.updateElement(_,m,w,r)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,e);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const s=r.radius;return e!=="active"&&(r.radius=0),r.radius+=Ct(i&&i._custom,s),r}}function DD(n,t,e){let i=1,r=1,s=0,a=0;if(t<te){const l=n,u=l+t,d=Math.cos(l),f=Math.sin(l),g=Math.cos(u),m=Math.sin(u),_=(F,I,L)=>Vs(F,l,u,!0)?1:Math.max(I,I*e,L,L*e),x=(F,I,L)=>Vs(F,l,u,!0)?-1:Math.min(I,I*e,L,L*e),w=_(0,d,g),v=_(re,f,m),C=x(Et,d,g),A=x(Et+re,f,m);i=(w-C)/2,r=(v-A)/2,s=-(w+C)/2,a=-(v+A)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:a}}class Qs extends Pi{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 e=t.data,{labels:{pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((u,d)=>{const g=t.getDatasetMeta(0).controller.getStyle(d);return{text:u,fillStyle:g.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(d),lineDash:g.borderDash,lineDashOffset:g.borderDashOffset,lineJoin:g.borderJoinStyle,lineWidth:g.borderWidth,strokeStyle:g.borderColor,textAlign:r,pointStyle:i,borderRadius:a&&(l||g.borderRadius),index:d}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let s=u=>+i[u];if(It(i[t])){const{key:u="value"}=this._parsing;s=d=>+ki(i[d],u)}let a,l;for(a=t,l=t+e;a<l;++a)r._parsed[a]=s(a)}}_getRotation(){return xe(this.options.rotation-90)}_getCircumference(){return xe(this.options.circumference)}_getRotationExtents(){let t=te,e=-te;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,s=r._getRotation(),a=r._getCircumference();t=Math.min(t,s),e=Math.max(e,s+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,r=this._cachedMeta,s=r.data,a=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(i.width,i.height)-a)/2,0),u=Math.min(zM(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:f,rotation:g}=this._getRotationExtents(),{ratioX:m,ratioY:_,offsetX:x,offsetY:w}=DD(g,f,u),v=(i.width-a)/m,C=(i.height-a)/_,A=Math.max(Math.min(v,C)/2,0),F=Op(this.options.radius,A),I=Math.max(F*u,0),L=(F-I)/this._getVisibleDatasetWeightTotal();this.offsetX=x*F,this.offsetY=w*F,r.total=this.calculateTotal(),this.outerRadius=F-L*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-L*d,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){const i=this.options,r=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*s/te)}updateElements(t,e,i,r){const s=r==="reset",a=this.chart,l=a.chartArea,d=a.options.animation,f=(l.left+l.right)/2,g=(l.top+l.bottom)/2,m=s&&d.animateScale,_=m?0:this.innerRadius,x=m?0:this.outerRadius,{sharedOptions:w,includeOptions:v}=this._getSharedOptions(e,r);let C=this._getRotation(),A;for(A=0;A<e;++A)C+=this._circumference(A,s);for(A=e;A<e+i;++A){const F=this._circumference(A,s),I=t[A],L={x:f+this.offsetX,y:g+this.offsetY,startAngle:C,endAngle:C+F,circumference:F,outerRadius:x,innerRadius:_};v&&(L.options=w||this.resolveDataElementOptions(A,I.active?"active":r)),C+=F,this.updateElement(I,A,L,r)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,r;for(r=0;r<e.length;r++){const s=t._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!e[r].hidden&&(i+=Math.abs(s))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?te*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=qs(e._parsed[t],i.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let e=0;const i=this.chart;let r,s,a,l,u;if(!t){for(r=0,s=i.data.datasets.length;r<s;++r)if(i.isDatasetVisible(r)){a=i.getDatasetMeta(r),t=a.data,l=a.controller;break}}if(!t)return 0;for(r=0,s=t.length;r<s;++r)u=l.resolveDataElementOptions(r),u.borderAlign!=="inner"&&(e=Math.max(e,u.borderWidth||0,u.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,r=t.length;i<r;++i){const s=this.resolveDataElementOptions(i);e=Math.max(e,s.offset||0,s.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(Ct(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Dg extends Pi{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 e=this._cachedMeta,{dataset:i,data:r=[],_dataset:s}=e,a=this.chart._animationsDisabled;let{start:l,count:u}=Hp(e,r,a);this._drawStart=l,this._drawCount=u,Wp(e)&&(l=0,u=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=r;const d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:d},t),this.updateElements(r,l,u,t)}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:d}=this._cachedMeta,{sharedOptions:f,includeOptions:g}=this._getSharedOptions(e,r),m=a.axis,_=l.axis,{spanGaps:x,segment:w}=this.options,v=Ci(x)?x:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||s||r==="none",A=e+i,F=t.length;let I=e>0&&this.getParsed(e-1);for(let L=0;L<F;++L){const N=t[L],B=C?N:{};if(L<e||L>=A){B.skip=!0;continue}const k=this.getParsed(L),T=vt(k[_]),O=B[m]=a.getPixelForValue(k[m],L),E=B[_]=s||T?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,k,u):k[_],L);B.skip=isNaN(O)||isNaN(E)||T,B.stop=L>0&&Math.abs(k[m]-I[m])>v,w&&(B.parsed=k,B.raw=d.data[L]),g&&(B.options=f||this.resolveDataElementOptions(L,N.active?"active":r)),C||this.updateElement(N,L,B,r),I=k}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const s=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,s,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class Cg extends Pi{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 e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((s,a)=>{const u=t.getDatasetMeta(0).controller.getStyle(a);return{text:s,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=qs(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:s}}parseObjectData(t,e,i,r){return ng.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,r)=>{const s=this.getParsed(r).r;!isNaN(s)&&this.chart.getDataVisibility(r)&&(s<e.min&&(e.min=s),s>e.max&&(e.max=s))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),s=Math.max(r/2,0),a=Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0),l=(s-a)/t.getVisibleDatasetCount();this.outerRadius=s-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,e,i,r){const s=r==="reset",a=this.chart,u=a.options.animation,d=this._cachedMeta.rScale,f=d.xCenter,g=d.yCenter,m=d.getIndexAngle(0)-.5*Et;let _=m,x;const w=360/this.countVisibleElements();for(x=0;x<e;++x)_+=this._computeAngle(x,r,w);for(x=e;x<e+i;x++){const v=t[x];let C=_,A=_+this._computeAngle(x,r,w),F=a.getDataVisibility(x)?d.getDistanceFromCenterForValue(this.getParsed(x).r):0;_=A,s&&(u.animateScale&&(F=0),u.animateRotate&&(C=A=m));const I={x:f,y:g,innerRadius:0,outerRadius:F,startAngle:C,endAngle:A,options:this.resolveDataElementOptions(x,v.active?"active":r)};this.updateElement(v,x,I,r)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?xe(this.resolveDataElementOptions(t,e).angle||i):0}}class CD extends Qs{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class OD extends Pi{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 e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,r){return ng.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta,i=e.dataset,r=e.data||[],s=e.iScale.getLabels();if(i.points=r,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const l={_loop:!0,_fullLoop:s.length===r.length,options:a};this.updateElement(i,void 0,l,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,i,r){const s=this._cachedMeta.rScale,a=r==="reset";for(let l=e;l<e+i;l++){const u=t[l],d=this.resolveDataElementOptions(l,u.active?"active":r),f=s.getPointPositionForValue(l,this.getParsed(l).r),g=a?s.xCenter:f.x,m=a?s.yCenter:f.y,_={x:g,y:m,angle:f.angle,skip:isNaN(g)||isNaN(m),options:d};this.updateElement(u,l,_,r)}}}class Og extends Pi{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 e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=e,a=this.getParsed(t),l=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y);return{label:i[t]||"",value:"("+l+", "+u+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,r=this.chart._animationsDisabled;let{start:s,count:a}=Hp(e,i,r);if(this._drawStart=s,this._drawCount=a,Wp(e)&&(s=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:u}=e;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!u._decimated,l.points=i;const d=this.resolveDatasetElementOptions(t);d.segment=this.options.segment,this.updateElement(l,void 0,{animated:!r,options:d},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,s,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:d}=this._cachedMeta,f=this.resolveDataElementOptions(e,r),g=this.getSharedOptions(f),m=this.includeOptions(r,g),_=a.axis,x=l.axis,{spanGaps:w,segment:v}=this.options,C=Ci(w)?w:Number.POSITIVE_INFINITY,A=this.chart._animationsDisabled||s||r==="none";let F=e>0&&this.getParsed(e-1);for(let I=e;I<e+i;++I){const L=t[I],N=this.getParsed(I),B=A?L:{},k=vt(N[x]),T=B[_]=a.getPixelForValue(N[_],I),O=B[x]=s||k?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,N,u):N[x],I);B.skip=isNaN(T)||isNaN(O)||k,B.stop=I>0&&Math.abs(N[_]-F[_])>C,v&&(B.parsed=N,B.raw=d.data[I]),m&&(B.options=g||this.resolveDataElementOptions(I,L.active?"active":r)),A||this.updateElement(L,I,B,r),F=N}this.updateSharedOptions(g,r,f)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let l=0;for(let u=e.length-1;u>=0;--u)l=Math.max(l,e[u].size(this.resolveDataElementOptions(u))/2);return l>0&&l}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;const s=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,s,a)/2}}var AD=Object.freeze({__proto__:null,BarController:kg,BubbleController:kD,DoughnutController:Qs,LineController:Dg,PieController:CD,PolarAreaController:Cg,RadarController:OD,ScatterController:Og});function ur(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class cu{static override(t){Object.assign(cu.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return ur()}parse(){return ur()}format(){return ur()}add(){return ur()}diff(){return ur()}startOf(){return ur()}endOf(){return ur()}}var Ag={_date:cu};function RD(n,t,e,i){const{controller:r,data:s,_sorted:a}=n,l=r._cachedMeta.iScale,u=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(l&&t===l.axis&&t!=="r"&&a&&s.length){const d=l._reversePixels?ZM:ri;if(i){if(r._sharedOptions){const f=s[0],g=typeof f.getRange=="function"&&f.getRange(t);if(g){const m=d(s,t,e-g),_=d(s,t,e+g);return{lo:m.lo,hi:_.hi}}}}else{const f=d(s,t,e);if(u){const{vScale:g}=r._cachedMeta,{_parsed:m}=n,_=m.slice(0,f.lo+1).reverse().findIndex(w=>!vt(w[g.axis]));f.lo-=Math.max(0,_);const x=m.slice(f.hi).findIndex(w=>!vt(w[g.axis]));f.hi+=Math.max(0,x)}return f}}return{lo:0,hi:s.length-1}}function Js(n,t,e,i,r){const s=n.getSortedVisibleDatasetMetas(),a=e[t];for(let l=0,u=s.length;l<u;++l){const{index:d,data:f}=s[l],{lo:g,hi:m}=RD(s[l],t,a,r);for(let _=g;_<=m;++_){const x=f[_];x.skip||i(x,d,_)}}}function ED(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,r){const s=t?Math.abs(i.x-r.x):0,a=e?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(a,2))}}function uu(n,t,e,i,r){const s=[];return!r&&!n.isPointInArea(t)||Js(n,e,t,function(l,u,d){!r&&!si(l,n.chartArea,0)||l.inRange(t.x,t.y,i)&&s.push({element:l,datasetIndex:u,index:d})},!0),s}function PD(n,t,e,i){let r=[];function s(a,l,u){const{startAngle:d,endAngle:f}=a.getProps(["startAngle","endAngle"],i),{angle:g}=va(a,{x:t.x,y:t.y});Vs(g,d,f)&&r.push({element:a,datasetIndex:l,index:u})}return Js(n,e,t,s),r}function ID(n,t,e,i,r,s){let a=[];const l=ED(e);let u=Number.POSITIVE_INFINITY;function d(f,g,m){const _=f.inRange(t.x,t.y,r);if(i&&!_)return;const x=f.getCenterPoint(r);if(!(!!s||n.isPointInArea(x))&&!_)return;const v=l(t,x);v<u?(a=[{element:f,datasetIndex:g,index:m}],u=v):v===u&&a.push({element:f,datasetIndex:g,index:m})}return Js(n,e,t,d),a}function du(n,t,e,i,r,s){return!s&&!n.isPointInArea(t)?[]:e==="r"&&!i?PD(n,t,e,r):ID(n,t,e,i,r,s)}function Rg(n,t,e,i,r){const s=[],a=e==="x"?"inXRange":"inYRange";let l=!1;return Js(n,e,t,(u,d,f)=>{u[a]&&u[a](t[e],r)&&(s.push({element:u,datasetIndex:d,index:f}),l=l||u.inRange(t.x,t.y,r))}),i&&!l?[]:s}var fu={evaluateInteractionItems:Js,modes:{index(n,t,e,i){const r=Ri(t,n),s=e.axis||"x",a=e.includeInvisible||!1,l=e.intersect?uu(n,r,s,i,a):du(n,r,s,!1,i,a),u=[];return l.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const f=l[0].index,g=d.data[f];g&&!g.skip&&u.push({element:g,datasetIndex:d.index,index:f})}),u):[]},dataset(n,t,e,i){const r=Ri(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;let l=e.intersect?uu(n,r,s,i,a):du(n,r,s,!1,i,a);if(l.length>0){const u=l[0].datasetIndex,d=n.getDatasetMeta(u).data;l=[];for(let f=0;f<d.length;++f)l.push({element:d[f],datasetIndex:u,index:f})}return l},point(n,t,e,i){const r=Ri(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return uu(n,r,s,i,a)},nearest(n,t,e,i){const r=Ri(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return du(n,r,s,e.intersect,i,a)},x(n,t,e,i){const r=Ri(t,n);return Rg(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=Ri(t,n);return Rg(n,r,"y",e.intersect,i)}}};const Eg=["left","top","right","bottom"];function to(n,t){return n.filter(e=>e.pos===t)}function Pg(n,t){return n.filter(e=>Eg.indexOf(e.pos)===-1&&e.box.axis===t)}function eo(n,t){return n.sort((e,i)=>{const r=t?i:e,s=t?e:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function LD(n){const t=[];let e,i,r,s,a,l;for(e=0,i=(n||[]).length;e<i;++e)r=n[e],{position:s,options:{stack:a,stackWeight:l=1}}=r,t.push({index:e,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&s+a,stackWeight:l});return t}function ND(n){const t={};for(const e of n){const{stack:i,pos:r,stackWeight:s}=e;if(!i||!Eg.includes(r))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=s}return t}function BD(n,t){const e=ND(n),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let s,a,l;for(s=0,a=n.length;s<a;++s){l=n[s];const{fullSize:u}=l.box,d=e[l.stack],f=d&&l.stackWeight/d.weight;l.horizontal?(l.width=f?f*i:u&&t.availableWidth,l.height=r):(l.width=i,l.height=f?f*r:u&&t.availableHeight)}return e}function FD(n){const t=LD(n),e=eo(t.filter(d=>d.box.fullSize),!0),i=eo(to(t,"left"),!0),r=eo(to(t,"right")),s=eo(to(t,"top"),!0),a=eo(to(t,"bottom")),l=Pg(t,"x"),u=Pg(t,"y");return{fullSize:e,leftAndTop:i.concat(s),rightAndBottom:r.concat(u).concat(a).concat(l),chartArea:to(t,"chartArea"),vertical:i.concat(r).concat(u),horizontal:s.concat(a).concat(l)}}function Ig(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Lg(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function zD(n,t,e,i){const{pos:r,box:s}=e,a=n.maxPadding;if(!It(r)){e.size&&(n[r]-=e.size);const g=i[e.stack]||{size:0,count:1};g.size=Math.max(g.size,e.horizontal?s.height:s.width),e.size=g.size/g.count,n[r]+=e.size}s.getPadding&&Lg(a,s.getPadding());const l=Math.max(0,t.outerWidth-Ig(a,n,"left","right")),u=Math.max(0,t.outerHeight-Ig(a,n,"top","bottom")),d=l!==n.w,f=u!==n.h;return n.w=l,n.h=u,e.horizontal?{same:d,other:f}:{same:f,other:d}}function UD(n){const t=n.maxPadding;function e(i){const r=Math.max(t[i]-n[i],0);return n[i]+=r,r}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function HD(n,t){const e=t.maxPadding;function i(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(a=>{s[a]=Math.max(t[a],e[a])}),s}return i(n?["left","right"]:["top","bottom"])}function no(n,t,e,i){const r=[];let s,a,l,u,d,f;for(s=0,a=n.length,d=0;s<a;++s){l=n[s],u=l.box,u.update(l.width||t.w,l.height||t.h,HD(l.horizontal,t));const{same:g,other:m}=zD(t,e,l,i);d|=g&&r.length,f=f||m,u.fullSize||r.push(l)}return d&&no(r,t,e,i)||f}function Ra(n,t,e,i,r){n.top=e,n.left=t,n.right=t+i,n.bottom=e+r,n.width=i,n.height=r}function Ng(n,t,e,i){const r=e.padding;let{x:s,y:a}=t;for(const l of n){const u=l.box,d=i[l.stack]||{placed:0,weight:1},f=l.stackWeight/d.weight||1;if(l.horizontal){const g=t.w*f,m=d.size||u.height;en(d.start)&&(a=d.start),u.fullSize?Ra(u,r.left,a,e.outerWidth-r.right-r.left,m):Ra(u,t.left+d.placed,a,g,m),d.start=a,d.placed+=g,a=u.bottom}else{const g=t.h*f,m=d.size||u.width;en(d.start)&&(s=d.start),u.fullSize?Ra(u,s,r.top,m,e.outerHeight-r.bottom-r.top):Ra(u,s,t.top+d.placed,m,g),d.start=s,d.placed+=g,s=u.right}}t.x=s,t.y=a}var We={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const r=we(n.options.layout.padding),s=Math.max(t-r.width,0),a=Math.max(e-r.height,0),l=FD(n.boxes),u=l.vertical,d=l.horizontal;Jt(n.boxes,w=>{typeof w.beforeLayout=="function"&&w.beforeLayout()});const f=u.reduce((w,v)=>v.box.options&&v.box.options.display===!1?w:w+1,0)||1,g=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/f,hBoxMaxHeight:a/2}),m=Object.assign({},r);Lg(m,we(i));const _=Object.assign({maxPadding:m,w:s,h:a,x:r.left,y:r.top},r),x=BD(u.concat(d),g);no(l.fullSize,_,g,x),no(u,_,g,x),no(d,_,g,x)&&no(u,_,g,x),UD(_),Ng(l.leftAndTop,_,g,x),_.x+=_.w,_.y+=_.h,Ng(l.rightAndBottom,_,g,x),n.chartArea={left:_.left,top:_.top,right:_.left+_.w,bottom:_.top+_.h,height:_.h,width:_.w},Jt(l.chartArea,w=>{const v=w.box;Object.assign(v,n.chartArea),v.update(_.w,_.h,{left:0,top:0,right:0,bottom:0})})}};class Bg{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class WD extends Bg{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ea="$chartjs",$D={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Fg=n=>n===null||n==="";function VD(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[Ea]={initial:{height:i,width:r,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Fg(r)){const s=sg(n,"width");s!==void 0&&(n.width=s)}if(Fg(i))if(n.style.height==="")n.height=n.width/(t||2);else{const s=sg(n,"height");s!==void 0&&(n.height=s)}return n}const zg=Vk?{passive:!0}:!1;function YD(n,t,e){n&&n.addEventListener(t,e,zg)}function qD(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,zg)}function jD(n,t){const e=$D[n.type]||n.type,{x:i,y:r}=Ri(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Pa(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function GD(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||Pa(l.addedNodes,i),a=a&&!Pa(l.removedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function KD(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||Pa(l.removedNodes,i),a=a&&!Pa(l.addedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const io=new Map;let Ug=0;function Hg(){const n=window.devicePixelRatio;n!==Ug&&(Ug=n,io.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function XD(n,t){io.size||window.addEventListener("resize",Hg),io.set(n,t)}function ZD(n){io.delete(n),io.size||window.removeEventListener("resize",Hg)}function QD(n,t,e){const i=n.canvas,r=i&&iu(i);if(!r)return;const s=Up((l,u)=>{const d=r.clientWidth;e(l,u),d<r.clientWidth&&e()},window),a=new ResizeObserver(l=>{const u=l[0],d=u.contentRect.width,f=u.contentRect.height;d===0&&f===0||s(d,f)});return a.observe(r),XD(n,s),a}function hu(n,t,e){e&&e.disconnect(),t==="resize"&&ZD(n)}function JD(n,t,e){const i=n.canvas,r=Up(s=>{n.ctx!==null&&e(jD(s,n))},n);return YD(i,t,r),r}class tC extends Bg{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(VD(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ea])return!1;const i=e[Ea].initial;["height","width"].forEach(s=>{const a=i[s];vt(a)?e.removeAttribute(s):e.setAttribute(s,a)});const r=i.style||{};return Object.keys(r).forEach(s=>{e.style[s]=r[s]}),e.width=e.width,delete e[Ea],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),a={attach:GD,detach:KD,resize:QD}[e]||JD;r[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;({attach:hu,detach:hu,resize:hu}[e]||qD)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return $k(t,e,i,r)}isAttached(t){const e=t&&iu(t);return!!(e&&e.isConnected)}}function eC(n){return!nu()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?WD:tC}class $e{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Ci(this.x)&&Ci(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const r={};return t.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}}function nC(n,t){const e=n.options.ticks,i=iC(n),r=Math.min(e.maxTicksLimit||i,i),s=e.major.enabled?sC(t):[],a=s.length,l=s[0],u=s[a-1],d=[];if(a>r)return oC(t,d,s,a/r),d;const f=rC(s,t,r);if(a>0){let g,m;const _=a>1?Math.round((u-l)/(a-1)):null;for(Ia(t,d,f,vt(_)?0:l-_,l),g=0,m=a-1;g<m;g++)Ia(t,d,f,s[g],s[g+1]);return Ia(t,d,f,u,vt(_)?t.length:u+_),d}return Ia(t,d,f),d}function iC(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),r=n._maxLength/e;return Math.floor(Math.min(i,r))}function rC(n,t,e){const i=aC(n),r=t.length/e;if(!i)return Math.max(r,1);const s=qM(i);for(let a=0,l=s.length-1;a<l;a++){const u=s[a];if(u>r)return u}return Math.max(r,1)}function sC(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function oC(n,t,e,i){let r=0,s=e[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===s&&(t.push(n[a]),r++,s=e[r*i])}function Ia(n,t,e,i,r){const s=Ct(i,0),a=Math.min(Ct(r,n.length),n.length);let l=0,u,d,f;for(e=Math.ceil(e),r&&(u=r-i,e=u/Math.floor(u/e)),f=s;f<0;)l++,f=Math.round(s+l*e);for(d=Math.max(s,0);d<a;d++)d===f&&(t.push(n[d]),l++,f=Math.round(s+l*e))}function aC(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const lC=n=>n==="left"?"right":n==="right"?"left":n,Wg=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,$g=(n,t)=>Math.min(t||n,n);function Vg(n,t){const e=[],i=n.length/t,r=n.length;let s=0;for(;s<r;s+=i)e.push(n[Math.floor(s)]);return e}function cC(n,t,e){const i=n.ticks.length,r=Math.min(t,i-1),s=n._startPixel,a=n._endPixel,l=1e-6;let u=n.getPixelForTick(r),d;if(!(e&&(i===1?d=Math.max(u-s,a-u):t===0?d=(n.getPixelForTick(1)-u)/2:d=(u-n.getPixelForTick(r-1))/2,u+=r<t?d:-d,u<s-l||u>a+l)))return u}function uC(n,t){Jt(n,e=>{const i=e.gc,r=i.length/2;let s;if(r>t){for(s=0;s<r;++s)delete e.data[i[s]];i.splice(0,r)}})}function ro(n){return n.drawTicks?n.tickLength:0}function Yg(n,t){if(!n.display)return 0;const e=le(n.font,t),i=we(n.padding);return(qt(n.text)?n.text.length:1)*e.lineHeight+i.height}function dC(n,t){return Ai(n,{scale:t,type:"scale"})}function fC(n,t,e){return Ai(n,{tick:e,index:t,type:"tick"})}function hC(n,t,e){let i=qc(n);return(e&&t!=="right"||!e&&t==="right")&&(i=lC(i)),i}function pC(n,t,e,i){const{top:r,left:s,bottom:a,right:l,chart:u}=n,{chartArea:d,scales:f}=u;let g=0,m,_,x;const w=a-r,v=l-s;if(n.isHorizontal()){if(_=He(i,s,l),It(e)){const C=Object.keys(e)[0],A=e[C];x=f[C].getPixelForValue(A)+w-t}else e==="center"?x=(d.bottom+d.top)/2+w-t:x=Wg(n,e,t);m=l-s}else{if(It(e)){const C=Object.keys(e)[0],A=e[C];_=f[C].getPixelForValue(A)-v+t}else e==="center"?_=(d.left+d.right)/2-v+t:_=Wg(n,e,t);x=He(i,a,r),g=e==="left"?-re:re}return{titleX:_,titleY:x,maxWidth:m,rotation:g}}class dr extends $e{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:r}=this;return t=pn(t,Number.POSITIVE_INFINITY),e=pn(e,Number.NEGATIVE_INFINITY),i=pn(i,Number.POSITIVE_INFINITY),r=pn(r,Number.NEGATIVE_INFINITY),{min:pn(t,i),max:pn(e,r),minDefined:ae(t),maxDefined:ae(e)}}getMinMax(t){let{min:e,max:i,minDefined:r,maxDefined:s}=this.getUserBounds(),a;if(r&&s)return{min:e,max:i};const l=this.getMatchingVisibleMetas();for(let u=0,d=l.length;u<d;++u)a=l[u].controller.getMinMax(this,t),r||(e=Math.min(e,a.min)),s||(i=Math.max(i,a.max));return e=s&&e>i?i:e,i=r&&e>i?e:i,{min:pn(e,pn(i,e)),max:pn(i,pn(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Qt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:r,grace:s,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=wk(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=l<this.ticks.length;this._convertTicksToLabels(u?Vg(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=nC(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),u&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Qt(this.options.afterUpdate,[this])}beforeSetDimensions(){Qt(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(){Qt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Qt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Qt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,r,s;for(i=0,r=t.length;i<r;i++)s=t[i],s.label=Qt(e.callback,[s.value,i,t],this)}afterTickToLabelConversion(){Qt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Qt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=$g(this.ticks.length,t.ticks.maxTicksLimit),r=e.minRotation||0,s=e.maxRotation;let a=r,l,u,d;if(!this._isVisible()||!e.display||r>=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const f=this._getLabelSizes(),g=f.widest.width,m=f.highest.height,_=Ce(this.chart.width-g,0,this.maxWidth);l=t.offset?this.maxWidth/i:_/(i-1),g+6>l&&(l=_/(i-(t.offset?.5:1)),u=this.maxHeight-ro(t.grid)-e.padding-Yg(t.title,this.chart.options.font),d=Math.sqrt(g*g+m*m),a=wa(Math.min(Math.asin(Ce((f.highest.height+6)/l,-1,1)),Math.asin(Ce(u/d,-1,1))-Math.asin(Ce(m/d,-1,1)))),a=Math.max(r,Math.min(s,a))),this.labelRotation=a}afterCalculateLabelRotation(){Qt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Qt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:s}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const u=Yg(r,e.options.font);if(l?(t.width=this.maxWidth,t.height=ro(s)+u):(t.height=this.maxHeight,t.width=ro(s)+u),i.display&&this.ticks.length){const{first:d,last:f,widest:g,highest:m}=this._getLabelSizes(),_=i.padding*2,x=xe(this.labelRotation),w=Math.cos(x),v=Math.sin(x);if(l){const C=i.mirror?0:v*g.width+w*m.height;t.height=Math.min(this.maxHeight,t.height+C+_)}else{const C=i.mirror?0:w*g.width+v*m.height;t.width=Math.min(this.maxWidth,t.width+C+_)}this._calculatePadding(d,f,v,w)}}this._handleMargins(),l?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,r){const{ticks:{align:s,padding:a},position:l}=this.options,u=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,g=this.right-this.getPixelForTick(this.ticks.length-1);let m=0,_=0;u?d?(m=r*t.width,_=i*e.height):(m=i*t.height,_=r*e.width):s==="start"?_=e.width:s==="end"?m=t.width:s!=="inner"&&(m=t.width/2,_=e.width/2),this.paddingLeft=Math.max((m-f+a)*this.width/(this.width-f),0),this.paddingRight=Math.max((_-g+a)*this.width/(this.width-g),0)}else{let f=e.height/2,g=t.height/2;s==="start"?(f=0,g=t.height):s==="end"&&(f=e.height,g=0),this.paddingTop=f+a,this.paddingBottom=g+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(){Qt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)vt(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Vg(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:r,_longestTextCache:s}=this,a=[],l=[],u=Math.floor(e/$g(e,i));let d=0,f=0,g,m,_,x,w,v,C,A,F,I,L;for(g=0;g<e;g+=u){if(x=t[g].label,w=this._resolveTickFontOptions(g),r.font=v=w.string,C=s[v]=s[v]||{data:{},gc:[]},A=w.lineHeight,F=I=0,!vt(x)&&!qt(x))F=ka(r,C.data,C.gc,F,x),I=A;else if(qt(x))for(m=0,_=x.length;m<_;++m)L=x[m],!vt(L)&&!qt(L)&&(F=ka(r,C.data,C.gc,F,L),I+=A);a.push(F),l.push(I),d=Math.max(F,d),f=Math.max(I,f)}uC(s,e);const N=a.indexOf(d),B=l.indexOf(f),k=T=>({width:a[T]||0,height:l[T]||0});return{first:k(0),last:k(e-1),widest:k(N),highest:k(B),widths:a,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return XM(this._alignToPixels?or(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=fC(this.getContext(),t,i))}return this.$context||(this.$context=dC(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=xe(this.labelRotation),i=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),s=this._getLabelSizes(),a=t.autoSkipPadding||0,l=s?s.widest.width+a:0,u=s?s.highest.height+a:0;return this.isHorizontal()?u*i>l*r?l/i:u/r:u*r<l*i?u/i:l/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,r=this.options,{grid:s,position:a,border:l}=r,u=s.offset,d=this.isHorizontal(),g=this.ticks.length+(u?1:0),m=ro(s),_=[],x=l.setContext(this.getContext()),w=x.display?x.width:0,v=w/2,C=function(G){return or(i,G,w)};let A,F,I,L,N,B,k,T,O,E,W,J;if(a==="top")A=C(this.bottom),B=this.bottom-m,T=A-v,E=C(t.top)+v,J=t.bottom;else if(a==="bottom")A=C(this.top),E=t.top,J=C(t.bottom)-v,B=A+v,T=this.top+m;else if(a==="left")A=C(this.right),N=this.right-m,k=A-v,O=C(t.left)+v,W=t.right;else if(a==="right")A=C(this.left),O=t.left,W=C(t.right)-v,N=A+v,k=this.left+m;else if(e==="x"){if(a==="center")A=C((t.top+t.bottom)/2+.5);else if(It(a)){const G=Object.keys(a)[0],rt=a[G];A=C(this.chart.scales[G].getPixelForValue(rt))}E=t.top,J=t.bottom,B=A+v,T=B+m}else if(e==="y"){if(a==="center")A=C((t.left+t.right)/2);else if(It(a)){const G=Object.keys(a)[0],rt=a[G];A=C(this.chart.scales[G].getPixelForValue(rt))}N=A-v,k=N-m,O=t.left,W=t.right}const at=Ct(r.ticks.maxTicksLimit,g),lt=Math.max(1,Math.ceil(g/at));for(F=0;F<g;F+=lt){const G=this.getContext(F),rt=s.setContext(G),st=l.setContext(G),nt=rt.lineWidth,ct=rt.color,H=st.dash||[],q=st.dashOffset,X=rt.tickWidth,_t=rt.tickColor,dt=rt.tickBorderDash||[],tt=rt.tickBorderDashOffset;I=cC(this,F,u),I!==void 0&&(L=or(i,I,nt),d?N=k=O=W=L:B=T=E=J=L,_.push({tx1:N,ty1:B,tx2:k,ty2:T,x1:O,y1:E,x2:W,y2:J,width:nt,color:ct,borderDash:H,borderDashOffset:q,tickWidth:X,tickColor:_t,tickBorderDash:dt,tickBorderDashOffset:tt}))}return this._ticksLength=g,this._borderValue=A,_}_computeLabelItems(t){const e=this.axis,i=this.options,{position:r,ticks:s}=i,a=this.isHorizontal(),l=this.ticks,{align:u,crossAlign:d,padding:f,mirror:g}=s,m=ro(i.grid),_=m+f,x=g?-f:_,w=-xe(this.labelRotation),v=[];let C,A,F,I,L,N,B,k,T,O,E,W,J="middle";if(r==="top")N=this.bottom-x,B=this._getXAxisLabelAlignment();else if(r==="bottom")N=this.top+x,B=this._getXAxisLabelAlignment();else if(r==="left"){const lt=this._getYAxisLabelAlignment(m);B=lt.textAlign,L=lt.x}else if(r==="right"){const lt=this._getYAxisLabelAlignment(m);B=lt.textAlign,L=lt.x}else if(e==="x"){if(r==="center")N=(t.top+t.bottom)/2+_;else if(It(r)){const lt=Object.keys(r)[0],G=r[lt];N=this.chart.scales[lt].getPixelForValue(G)+_}B=this._getXAxisLabelAlignment()}else if(e==="y"){if(r==="center")L=(t.left+t.right)/2-_;else if(It(r)){const lt=Object.keys(r)[0],G=r[lt];L=this.chart.scales[lt].getPixelForValue(G)}B=this._getYAxisLabelAlignment(m).textAlign}e==="y"&&(u==="start"?J="top":u==="end"&&(J="bottom"));const at=this._getLabelSizes();for(C=0,A=l.length;C<A;++C){F=l[C],I=F.label;const lt=s.setContext(this.getContext(C));k=this.getPixelForTick(C)+s.labelOffset,T=this._resolveTickFontOptions(C),O=T.lineHeight,E=qt(I)?I.length:1;const G=E/2,rt=lt.color,st=lt.textStrokeColor,nt=lt.textStrokeWidth;let ct=B;a?(L=k,B==="inner"&&(C===A-1?ct=this.options.reverse?"left":"right":C===0?ct=this.options.reverse?"right":"left":ct="center"),r==="top"?d==="near"||w!==0?W=-E*O+O/2:d==="center"?W=-at.highest.height/2-G*O+O:W=-at.highest.height+O/2:d==="near"||w!==0?W=O/2:d==="center"?W=at.highest.height/2-G*O:W=at.highest.height-E*O,g&&(W*=-1),w!==0&&!lt.showLabelBackdrop&&(L+=O/2*Math.sin(w))):(N=k,W=(1-E)*O/2);let H;if(lt.showLabelBackdrop){const q=we(lt.backdropPadding),X=at.heights[C],_t=at.widths[C];let dt=W-q.top,tt=0-q.left;switch(J){case"middle":dt-=X/2;break;case"bottom":dt-=X;break}switch(B){case"center":tt-=_t/2;break;case"right":tt-=_t;break;case"inner":C===A-1?tt-=_t:C>0&&(tt-=_t/2);break}H={left:tt,top:dt,width:_t+q.width,height:X+q.height,color:lt.backdropColor}}v.push({label:I,font:T,textOffset:W,options:{rotation:w,color:rt,strokeColor:st,strokeWidth:nt,textAlign:ct,textBaseline:J,translation:[L,N],backdrop:H}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-xe(this.labelRotation))return t==="top"?"left":"right";let r="center";return e.align==="start"?r="left":e.align==="end"?r="right":e.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,a=this._getLabelSizes(),l=t+s,u=a.widest.width;let d,f;return e==="left"?r?(f=this.right+s,i==="near"?d="left":i==="center"?(d="center",f+=u/2):(d="right",f+=u)):(f=this.right-l,i==="near"?d="right":i==="center"?(d="center",f-=u/2):(d="left",f=this.left)):e==="right"?r?(f=this.left+s,i==="near"?d="right":i==="center"?(d="center",f-=u/2):(d="left",f-=u)):(f=this.left+l,i==="near"?d="left":i==="center"?(d="center",f+=u/2):(d="right",f=this.right)):d="right",{textAlign:d,x:f}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:r,width:s,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,r,s,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?e.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,a;const l=(u,d,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(u.x,u.y),i.lineTo(d.x,d.y),i.stroke(),i.restore())};if(e.display)for(s=0,a=r.length;s<a;++s){const u=r[s];e.drawOnChartArea&&l({x:u.x1,y:u.y1},{x:u.x2,y:u.y2},u),e.drawTicks&&l({x:u.tx1,y:u.ty1},{x:u.tx2,y:u.ty2},{color:u.tickColor,width:u.tickWidth,borderDash:u.tickBorderDash,borderDashOffset:u.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:r}}=this,s=i.setContext(this.getContext()),a=i.display?s.width:0;if(!a)return;const l=r.setContext(this.getContext(0)).lineWidth,u=this._borderValue;let d,f,g,m;this.isHorizontal()?(d=or(t,this.left,a)-a/2,f=or(t,this.right,l)+l/2,g=m=u):(g=or(t,this.top,a)-a/2,m=or(t,this.bottom,l)+l/2,d=f=u),e.save(),e.lineWidth=s.width,e.strokeStyle=s.color,e.beginPath(),e.moveTo(d,g),e.lineTo(f,m),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&Gs(i,r);const s=this.getLabelItems(t);for(const a of s){const l=a.options,u=a.font,d=a.label,f=a.textOffset;ar(i,d,0,f,u,l)}r&&Ks(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:r}}=this;if(!i.display)return;const s=le(i.font),a=we(i.padding),l=i.align;let u=s.lineHeight/2;e==="bottom"||e==="center"||It(e)?(u+=a.bottom,qt(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;const{titleX:d,titleY:f,maxWidth:g,rotation:m}=pC(this,u,e,l);ar(t,i.text,0,0,s,{color:i.color,maxWidth:g,rotation:m,textAlign:hC(l,e,r),textBaseline:"middle",translation:[d,f]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=Ct(t.grid&&t.grid.z,-1),r=Ct(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==dr.prototype.draw?[{z:e,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,a;for(s=0,a=e.length;s<a;++s){const l=e[s];l[i]===this.id&&(!t||l.type===t)&&r.push(l)}return r}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return le(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class La{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;yC(e)&&(i=this.register(e));const r=this.items,s=t.id,a=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in r||(r[s]=t,gC(t,a,i),this.override&&se.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,r=this.scope;i in e&&delete e[i],r&&i in se[r]&&(delete se[r][i],this.override&&delete sr[i])}}function gC(n,t,e){const i=Hs(Object.create(null),[e?se.get(e):{},se.get(t),n.defaults]);se.set(t,i),n.defaultRoutes&&mC(t,n.defaultRoutes),n.descriptors&&se.describe(t,n.descriptors)}function mC(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),r=i.pop(),s=[n].concat(i).join("."),a=t[e].split("."),l=a.pop(),u=a.join(".");se.route(s,r,u,l)})}function yC(n){return"id"in n&&"defaults"in n}class _C{constructor(){this.controllers=new La(Pi,"datasets",!0),this.elements=new La($e,"elements"),this.plugins=new La(Object,"plugins"),this.scales=new La(dr,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):Jt(r,a=>{const l=i||this._getRegistryForType(a);this._exec(t,l,a)})})}_exec(t,e,i){const r=$c(t);Qt(i["before"+r],[],i),e[t](i),Qt(i["after"+r],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const r=e.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var qn=new _C;class bC{constructor(){this._init=void 0}notify(t,e,i,r){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const s=r?this._descriptors(t).filter(r):this._descriptors(t),a=this._notify(s,t,e,i);return e==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,e,i,r){r=r||{};for(const s of t){const a=s.plugin,l=a[i],u=[e,r,s.options];if(Qt(l,u,a)===!1&&r.cancelable)return!1}return!0}invalidate(){vt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,r=Ct(i.options&&i.options.plugins,{}),s=xC(i);return r===!1&&!e?[]:vC(t,s,r,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,r=(s,a)=>s.filter(l=>!a.some(u=>l.plugin.id===u.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}}function xC(n){const t={},e=[],i=Object.keys(qn.plugins.items);for(let s=0;s<i.length;s++)e.push(qn.getPlugin(i[s]));const r=n.plugins||[];for(let s=0;s<r.length;s++){const a=r[s];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function wC(n,t){return!t&&n===!1?null:n===!0?{}:n}function vC(n,{plugins:t,localIds:e},i,r){const s=[],a=n.getContext();for(const l of t){const u=l.id,d=wC(i[u],r);d!==null&&s.push({plugin:l,options:SC(n.config,{plugin:l,local:e[u]},d,a)})}return s}function SC(n,{plugin:t,local:e},i,r){const s=n.pluginScopeKeys(t),a=n.getOptionScopes(i,s);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function pu(n,t){const e=se.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function TC(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function MC(n,t){return n===t?"_index_":"_value_"}function qg(n){if(n==="x"||n==="y"||n==="r")return n}function kC(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function gu(n,...t){if(qg(n))return n;for(const e of t){const i=e.axis||kC(e.position)||n.length>1&&qg(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function jg(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function DC(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return jg(n,"x",e[0])||jg(n,"y",e[0])}return{}}function CC(n,t){const e=sr[n.type]||{scales:{}},i=t.scales||{},r=pu(n.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!It(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const u=gu(a,l,DC(a,n),se.scales[l.type]),d=MC(u,r),f=e.scales||{};s[a]=Ws(Object.create(null),[{axis:u},l,f[u],f[d]])}),n.data.datasets.forEach(a=>{const l=a.type||n.type,u=a.indexAxis||pu(l,t),f=(sr[l]||{}).scales||{};Object.keys(f).forEach(g=>{const m=TC(g,u),_=a[m+"AxisID"]||m;s[_]=s[_]||Object.create(null),Ws(s[_],[{axis:m},i[_],f[g]])})}),Object.keys(s).forEach(a=>{const l=s[a];Ws(l,[se.scales[l.type],se.scale])}),s}function Gg(n){const t=n.options||(n.options={});t.plugins=Ct(t.plugins,{}),t.scales=CC(n,t)}function Kg(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function OC(n){return n=n||{},n.data=Kg(n.data),Gg(n),n}const Xg=new Map,Zg=new Set;function Na(n,t){let e=Xg.get(n);return e||(e=t(),Xg.set(n,e),Zg.add(e)),e}const so=(n,t,e)=>{const i=ki(t,e);i!==void 0&&n.add(i)};class AC{constructor(t){this._config=OC(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=Kg(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(),Gg(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Na(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Na(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Na(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Na(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){const{options:r,type:s}=this,a=this._cachedScopes(t,i),l=a.get(e);if(l)return l;const u=new Set;e.forEach(f=>{t&&(u.add(t),f.forEach(g=>so(u,t,g))),f.forEach(g=>so(u,r,g)),f.forEach(g=>so(u,sr[s]||{},g)),f.forEach(g=>so(u,se,g)),f.forEach(g=>so(u,Kc,g))});const d=Array.from(u);return d.length===0&&d.push(Object.create(null)),Zg.has(e)&&a.set(e,d),d}chartOptionScopes(){const{options:t,type:e}=this;return[t,sr[e]||{},se.datasets[e]||{},{type:e},se,Kc]}resolveNamedOptions(t,e,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:l}=Qg(this._resolverCache,t,r);let u=a;if(EC(a,e)){s.$shared=!1,i=nn(i)?i():i;const d=this.createResolver(t,i,l);u=$r(a,i,d)}for(const d of e)s[d]=u[d];return s}createResolver(t,e,i=[""],r){const{resolver:s}=Qg(this._resolverCache,t,i);return It(e)?$r(s,e,void 0,r):s}}function Qg(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const r=e.join();let s=i.get(r);return s||(s={resolver:Jc(t,e),subPrefixes:e.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const RC=n=>It(n)&&Object.getOwnPropertyNames(n).some(t=>nn(n[t]));function EC(n,t){const{isScriptable:e,isIndexable:i}=Xp(n);for(const r of t){const s=e(r),a=i(r),l=(a||s)&&n[r];if(s&&(nn(l)||RC(l))||a&&qt(l))return!0}return!1}var PC="4.5.1";const IC=["top","bottom","left","right","chartArea"];function Jg(n,t){return n==="top"||n==="bottom"||IC.indexOf(n)===-1&&t==="x"}function tm(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function em(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Qt(e&&e.onComplete,[n],t)}function LC(n){const t=n.chart,e=t.options.animation;Qt(e&&e.onProgress,[n],t)}function nm(n){return nu()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Ba={},im=n=>{const t=nm(n);return Object.values(Ba).filter(e=>e.canvas===t).pop()};function NC(n,t,e){const i=Object.keys(n);for(const r of i){const s=+r;if(s>=t){const a=n[r];delete n[r],(e>0||s>t)&&(n[s+e]=a)}}}function BC(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let rn=class{static defaults=se;static instances=Ba;static overrides=sr;static registry=qn;static version=PC;static getChart=im;static register(...t){qn.add(...t),rm()}static unregister(...t){qn.remove(...t),rm()}constructor(t,e){const i=this.config=new AC(e),r=nm(t),s=im(r);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||eC(r)),this.platform.updateConfig(i);const l=this.platform.acquireContext(r,a.aspectRatio),u=l&&l.canvas,d=u&&u.height,f=u&&u.width;if(this.id=FM(),this.ctx=l,this.canvas=u,this.width=f,this.height=d,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 bC,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=tk(g=>this.update(g),a.resizeDelay||0),this._dataChanges=[],Ba[this.id]=this,!l||!u){console.error("Failed to create chart: can't acquire context from the given item");return}oi.listen(this,"complete",em),oi.listen(this,"progress",LC),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:s}=this;return vt(t)?e&&s?s:r?i/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return qn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():rg(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return jp(this.canvas,this.ctx),this}stop(){return oi.stop(this),this}resize(t,e){oi.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,t,e,s),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,rg(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),Qt(i.onResize,[this,a],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Jt(e,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((a,l)=>(a[l]=!1,a),{});let s=[];e&&(s=s.concat(Object.keys(e).map(a=>{const l=e[a],u=gu(a,l),d=u==="r",f=u==="x";return{options:l,dposition:d?"chartArea":f?"bottom":"left",dtype:d?"radialLinear":f?"category":"linear"}}))),Jt(s,a=>{const l=a.options,u=l.id,d=gu(u,l),f=Ct(l.type,a.dtype);(l.position===void 0||Jg(l.position,d)!==Jg(a.dposition))&&(l.position=a.dposition),r[u]=!0;let g=null;if(u in i&&i[u].type===f)g=i[u];else{const m=qn.getScale(f);g=new m({id:u,type:f,ctx:this.ctx,chart:this}),i[g.id]=g}g.init(l,t)}),Jt(r,(a,l)=>{a||delete i[l]}),Jt(i,a=>{We.configure(this,a,a.options),We.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((r,s)=>r.index-s.index),i>e){for(let r=e;r<i;++r)this._destroyDatasetMeta(r);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(tm("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,r)=>{e.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=e.length;i<r;i++){const s=e[i];let a=this.getDatasetMeta(i);const l=s.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=l,a.indexAxis=s.indexAxis||pu(l,this.options),a.order=s.order||0,a.index=i,a.label=""+s.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const u=qn.getController(l),{datasetElementType:d,dataElementType:f}=se.datasets[l];Object.assign(u,{dataElementType:qn.getElement(f),datasetElementType:d&&qn.getElement(d)}),a.controller=new u(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Jt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let d=0,f=this.data.datasets.length;d<f;d++){const{controller:g}=this.getDatasetMeta(d),m=!r&&s.indexOf(g)===-1;g.buildOrUpdateElements(m),a=Math.max(+g.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),r||Jt(s,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(tm("z","_idx"));const{_active:l,_lastEvent:u}=this;u?this._eventHandler(u,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Jt(this.scales,t=>{We.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Ep(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of e){const a=i==="_removeElements"?-s:s;NC(t,r,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=s=>new Set(t.filter(a=>a[0]===s).map((a,l)=>l+","+a.splice(1).join(","))),r=i(0);for(let s=1;s<e;s++)if(!Ep(r,i(s)))return;return Array.from(r).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;We.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Jt(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,nn(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(e),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(oi.has(this)?this.attached&&!oi.running(this)&&oi.start(this):(this.draw(),em({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,r)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let r,s;for(r=0,s=e.length;r<s;++r){const a=e[r];(!t||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},r=pg(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(r&&Gs(e,r),t.controller.draw(),r&&Ks(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return si(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const s=fu.modes[e];return typeof s=="function"?s(this,t,i,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let r=i.filter(s=>s&&s._dataset===e).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=Ai(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const r=i?"show":"hide",s=this.getDatasetMeta(t),a=s.controller._resolveAnimations(void 0,r);en(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(s,{visible:i}),this.update(l=>l.datasetIndex===t?r:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),oi.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),jp(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ba[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(s,a)=>{e.addEventListener(this,s,a),t[s]=a},r=(s,a,l)=>{s.offsetX=a,s.offsetY=l,this._eventHandler(s)};Jt(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(u,d)=>{e.addEventListener(this,u,d),t[u]=d},r=(u,d)=>{t[u]&&(e.removeEventListener(this,u,d),delete t[u])},s=(u,d)=>{this.canvas&&this.resize(u,d)};let a;const l=()=>{r("attach",l),this.attached=!0,this.resize(),i("resize",s),i("detach",a)};a=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),i("attach",l)},e.isAttached(this.canvas)?l():a()}unbindEvents(){Jt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Jt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const r=i?"set":"remove";let s,a,l,u;for(e==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),l=0,u=t.length;l<u;++l){a=t[l];const d=a&&this.getDatasetMeta(a.datasetIndex).controller;d&&d[r+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:s,index:a})=>{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[a],index:a}});!ya(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const r=this.options.hover,s=(u,d)=>u.filter(f=>!d.some(g=>f.datasetIndex===g.datasetIndex&&f.index===g.index)),a=s(e,t),l=i?t:s(t,e);a.length&&this.updateHoverStyle(a,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const s=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:r=[],options:s}=this,a=e,l=this._getActiveElements(t,r,i,a),u=VM(t),d=BC(t,this._lastEvent,i,u);i&&(this._lastEvent=null,Qt(s.onHover,[t,l,this],this),u&&Qt(s.onClick,[t,l,this],this));const f=!ya(l,r);return(f||e)&&(this._active=l,this._updateHoverStyles(l,r,e)),this._lastEvent=d,f}_getActiveElements(t,e,i,r){if(t.type==="mouseout")return[];if(!i)return e;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}};function rm(){return Jt(rn.instances,n=>n._plugins.invalidate())}function FC(n,t,e){const{startAngle:i,x:r,y:s,outerRadius:a,innerRadius:l,options:u}=t,{borderWidth:d,borderJoinStyle:f}=u,g=Math.min(d/a,Ue(i-e));if(n.beginPath(),n.arc(r,s,a-d/2,i+g/2,e-g/2),l>0){const m=Math.min(d/l,Ue(i-e));n.arc(r,s,l+d/2,e-m/2,i+m/2,!0)}else{const m=Math.min(d/2,a*Ue(i-e));if(f==="round")n.arc(r,s,m,e-Et/2,i+Et/2,!0);else if(f==="bevel"){const _=2*m*m,x=-_*Math.cos(e+Et/2)+r,w=-_*Math.sin(e+Et/2)+s,v=_*Math.cos(i+Et/2)+r,C=_*Math.sin(i+Et/2)+s;n.lineTo(x,w),n.lineTo(v,C)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function zC(n,t,e){const{startAngle:i,pixelMargin:r,x:s,y:a,outerRadius:l,innerRadius:u}=t;let d=r/l;n.beginPath(),n.arc(s,a,l,i-d,e+d),u>r?(d=r/u,n.arc(s,a,u,e+d,i-d,!0)):n.arc(s,a,r,e+re,i-re),n.closePath(),n.clip()}function UC(n){return Qc(n,["outerStart","outerEnd","innerStart","innerEnd"])}function HC(n,t,e,i){const r=UC(n.options.borderRadius),s=(e-t)/2,a=Math.min(s,i*t/2),l=u=>{const d=(e-Math.min(s,u))*i/2;return Ce(u,0,Math.min(s,d))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:Ce(r.innerStart,0,a),innerEnd:Ce(r.innerEnd,0,a)}}function qr(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Fa(n,t,e,i,r,s){const{x:a,y:l,startAngle:u,pixelMargin:d,innerRadius:f}=t,g=Math.max(t.outerRadius+i+e-d,0),m=f>0?f+i+e+d:0;let _=0;const x=r-u;if(i){const lt=f>0?f-i:0,G=g>0?g-i:0,rt=(lt+G)/2,st=rt!==0?x*rt/(rt+i):x;_=(x-st)/2}const w=Math.max(.001,x*g-e/Et)/g,v=(x-w)/2,C=u+v+_,A=r-v-_,{outerStart:F,outerEnd:I,innerStart:L,innerEnd:N}=HC(t,m,g,A-C),B=g-F,k=g-I,T=C+F/B,O=A-I/k,E=m+L,W=m+N,J=C+L/E,at=A-N/W;if(n.beginPath(),s){const lt=(T+O)/2;if(n.arc(a,l,g,T,lt),n.arc(a,l,g,lt,O),I>0){const nt=qr(k,O,a,l);n.arc(nt.x,nt.y,I,O,A+re)}const G=qr(W,A,a,l);if(n.lineTo(G.x,G.y),N>0){const nt=qr(W,at,a,l);n.arc(nt.x,nt.y,N,A+re,at+Math.PI)}const rt=(A-N/m+(C+L/m))/2;if(n.arc(a,l,m,A-N/m,rt,!0),n.arc(a,l,m,rt,C+L/m,!0),L>0){const nt=qr(E,J,a,l);n.arc(nt.x,nt.y,L,J+Math.PI,C-re)}const st=qr(B,C,a,l);if(n.lineTo(st.x,st.y),F>0){const nt=qr(B,T,a,l);n.arc(nt.x,nt.y,F,C-re,T)}}else{n.moveTo(a,l);const lt=Math.cos(T)*g+a,G=Math.sin(T)*g+l;n.lineTo(lt,G);const rt=Math.cos(O)*g+a,st=Math.sin(O)*g+l;n.lineTo(rt,st)}n.closePath()}function WC(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:l}=t;let u=t.endAngle;if(s){Fa(n,t,e,i,u,r);for(let d=0;d<s;++d)n.fill();isNaN(l)||(u=a+(l%te||te))}return Fa(n,t,e,i,u,r),n.fill(),u}function $C(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:l,options:u}=t,{borderWidth:d,borderJoinStyle:f,borderDash:g,borderDashOffset:m,borderRadius:_}=u,x=u.borderAlign==="inner";if(!d)return;n.setLineDash(g||[]),n.lineDashOffset=m,x?(n.lineWidth=d*2,n.lineJoin=f||"round"):(n.lineWidth=d,n.lineJoin=f||"bevel");let w=t.endAngle;if(s){Fa(n,t,e,i,w,r);for(let v=0;v<s;++v)n.stroke();isNaN(l)||(w=a+(l%te||te))}x&&zC(n,t,w),u.selfJoin&&w-a>=Et&&_===0&&f!=="miter"&&FC(n,t,w),s||(Fa(n,t,e,i,w,r),n.stroke())}class VC extends $e{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,e,i){const r=this.getProps(["x","y"],i),{angle:s,distance:a}=va(r,{x:t,y:e}),{startAngle:l,endAngle:u,innerRadius:d,outerRadius:f,circumference:g}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),m=(this.options.spacing+this.options.borderWidth)/2,_=Ct(g,u-l),x=Vs(s,l,u)&&l!==u,w=_>=te||x,v=ii(a,d+m,f+m);return w&&v}getCenterPoint(t){const{x:e,y:i,startAngle:r,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:u,spacing:d}=this.options,f=(r+s)/2,g=(a+l+d+u)/2;return{x:e+Math.cos(f)*g,y:i+Math.sin(f)*g}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,r=(e.offset||0)/4,s=(e.spacing||0)/2,a=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>te?Math.floor(i/te):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const l=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(l)*r,Math.sin(l)*r);const u=1-Math.sin(Math.min(Et,i||0)),d=r*u;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,WC(t,this,d,s,a),$C(t,this,d,s,a),t.restore()}}function sm(n,t,e=t){n.lineCap=Ct(e.borderCapStyle,t.borderCapStyle),n.setLineDash(Ct(e.borderDash,t.borderDash)),n.lineDashOffset=Ct(e.borderDashOffset,t.borderDashOffset),n.lineJoin=Ct(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=Ct(e.borderWidth,t.borderWidth),n.strokeStyle=Ct(e.borderColor,t.borderColor)}function YC(n,t,e){n.lineTo(e.x,e.y)}function qC(n){return n.stepped?fk:n.tension||n.cubicInterpolationMode==="monotone"?hk:YC}function om(n,t,e={}){const i=n.length,{start:r=0,end:s=i-1}=e,{start:a,end:l}=t,u=Math.max(r,a),d=Math.min(s,l),f=r<a&&s<a||r>l&&s>l;return{count:i,start:u,loop:t.loop,ilen:d<u&&!f?i+d-u:d-u}}function jC(n,t,e,i){const{points:r,options:s}=t,{count:a,start:l,loop:u,ilen:d}=om(r,e,i),f=qC(s);let{move:g=!0,reverse:m}=i||{},_,x,w;for(_=0;_<=d;++_)x=r[(l+(m?d-_:_))%a],!x.skip&&(g?(n.moveTo(x.x,x.y),g=!1):f(n,w,x,m,s.stepped),w=x);return u&&(x=r[(l+(m?d:0))%a],f(n,w,x,m,s.stepped)),!!u}function GC(n,t,e,i){const r=t.points,{count:s,start:a,ilen:l}=om(r,e,i),{move:u=!0,reverse:d}=i||{};let f=0,g=0,m,_,x,w,v,C;const A=I=>(a+(d?l-I:I))%s,F=()=>{w!==v&&(n.lineTo(f,v),n.lineTo(f,w),n.lineTo(f,C))};for(u&&(_=r[A(0)],n.moveTo(_.x,_.y)),m=0;m<=l;++m){if(_=r[A(m)],_.skip)continue;const I=_.x,L=_.y,N=I|0;N===x?(L<w?w=L:L>v&&(v=L),f=(g*f+I)/++g):(F(),n.lineTo(I,L),x=N,g=0,w=v=L),C=L}F()}function mu(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?GC:jC}function KC(n){return n.stepped?Yk:n.tension||n.cubicInterpolationMode==="monotone"?qk:cr}function XC(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),sm(n,t.options),n.stroke(r)}function ZC(n,t,e,i){const{segments:r,options:s}=t,a=mu(t);for(const l of r)sm(n,s,l.style),n.beginPath(),a(n,t,l,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const QC=typeof Path2D=="function";function JC(n,t,e,i){QC&&!t.options.segment?XC(n,t,e,i):ZC(n,t,e,i)}class za extends $e{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,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;Bk(this._points,i,t,r,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Qk(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,r=t[e],s=this.points,a=dg(this,{property:e,start:r,end:r});if(!a.length)return;const l=[],u=KC(i);let d,f;for(d=0,f=a.length;d<f;++d){const{start:g,end:m}=a[d],_=s[g],x=s[m];if(_===x){l.push(_);continue}const w=Math.abs((r-_[e])/(x[e]-_[e])),v=u(_,x,w,i.stepped);v[e]=t[e],l.push(v)}return l.length===1?l[0]:l}pathSegment(t,e,i){return mu(this)(t,this,e,i)}path(t,e,i){const r=this.segments,s=mu(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const l of r)a&=s(t,this,l,{start:e,end:e+i-1});return!!a}draw(t,e,i,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),JC(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function am(n,t,e,i){const r=n.options,{[e]:s}=n.getProps([e],i);return Math.abs(t-s)<r.radius+r.hitRadius}class tO extends $e{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,e,i){const r=this.options,{x:s,y:a}=this.getProps(["x","y"],i);return Math.pow(t-s,2)+Math.pow(e-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(t,e){return am(this,t,"x",e)}inYRange(t,e){return am(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const i=e&&t.borderWidth||0;return(e+i)*2}draw(t,e){const i=this.options;this.skip||i.radius<.1||!si(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Zc(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function lm(n,t){const{x:e,y:i,base:r,width:s,height:a}=n.getProps(["x","y","base","width","height"],t);let l,u,d,f,g;return n.horizontal?(g=a/2,l=Math.min(e,r),u=Math.max(e,r),d=i-g,f=i+g):(g=s/2,l=e-g,u=e+g,d=Math.min(i,r),f=Math.max(i,r)),{left:l,top:d,right:u,bottom:f}}function Ii(n,t,e,i){return n?0:Ce(t,e,i)}function eO(n,t,e){const i=n.options.borderWidth,r=n.borderSkipped,s=Kp(i);return{t:Ii(r.top,s.top,0,e),r:Ii(r.right,s.right,0,t),b:Ii(r.bottom,s.bottom,0,e),l:Ii(r.left,s.left,0,t)}}function nO(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,s=Oi(r),a=Math.min(t,e),l=n.borderSkipped,u=i||It(r);return{topLeft:Ii(!u||l.top||l.left,s.topLeft,0,a),topRight:Ii(!u||l.top||l.right,s.topRight,0,a),bottomLeft:Ii(!u||l.bottom||l.left,s.bottomLeft,0,a),bottomRight:Ii(!u||l.bottom||l.right,s.bottomRight,0,a)}}function iO(n){const t=lm(n),e=t.right-t.left,i=t.bottom-t.top,r=eO(n,e/2,i/2),s=nO(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:e-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function yu(n,t,e,i){const r=t===null,s=e===null,l=n&&!(r&&s)&&lm(n,i);return l&&(r||ii(t,l.left,l.right))&&(s||ii(e,l.top,l.bottom))}function rO(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function sO(n,t){n.rect(t.x,t.y,t.w,t.h)}function _u(n,t,e={}){const i=n.x!==e.x?-t:0,r=n.y!==e.y?-t:0,s=(n.x+n.w!==e.x+e.w?t:0)-i,a=(n.y+n.h!==e.y+e.h?t:0)-r;return{x:n.x+i,y:n.y+r,w:n.w+s,h:n.h+a,radius:n.radius}}class oO extends $e{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:e,options:{borderColor:i,backgroundColor:r}}=this,{inner:s,outer:a}=iO(this),l=rO(a.radius)?Wr:sO;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),l(t,_u(a,e,s)),t.clip(),l(t,_u(s,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),l(t,_u(s,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,i){return yu(this,t,e,i)}inXRange(t,e){return yu(this,t,null,e)}inYRange(t,e){return yu(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(e+r)/2:e,y:s?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var aO=Object.freeze({__proto__:null,ArcElement:VC,BarElement:oO,LineElement:za,PointElement:tO});const bu=["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)"],cm=bu.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function um(n){return bu[n%bu.length]}function dm(n){return cm[n%cm.length]}function lO(n,t){return n.borderColor=um(t),n.backgroundColor=dm(t),++t}function cO(n,t){return n.backgroundColor=n.data.map(()=>um(t++)),t}function uO(n,t){return n.backgroundColor=n.data.map(()=>dm(t++)),t}function dO(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof Qs?t=cO(e,t):r instanceof Cg?t=uO(e,t):r&&(t=lO(e,t))}}function fm(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function fO(n){return n&&(n.borderColor||n.backgroundColor)}function hO(){return se.borderColor!=="rgba(0,0,0,0.1)"||se.backgroundColor!=="rgba(0,0,0,0.1)"}var pO={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:r}=n.config,{elements:s}=r,a=fm(i)||fO(r)||s&&fm(s)||hO();if(!e.forceOverride&&a)return;const l=dO(n);i.forEach(l)}};function gO(n,t,e,i,r){const s=r.samples||i;if(s>=e)return n.slice(t,t+e);const a=[],l=(e-2)/(s-2);let u=0;const d=t+e-1;let f=t,g,m,_,x,w;for(a[u++]=n[f],g=0;g<s-2;g++){let v=0,C=0,A;const F=Math.floor((g+1)*l)+1+t,I=Math.min(Math.floor((g+2)*l)+1,e)+t,L=I-F;for(A=F;A<I;A++)v+=n[A].x,C+=n[A].y;v/=L,C/=L;const N=Math.floor(g*l)+1+t,B=Math.min(Math.floor((g+1)*l)+1,e)+t,{x:k,y:T}=n[f];for(_=x=-1,A=N;A<B;A++)x=.5*Math.abs((k-v)*(n[A].y-T)-(k-n[A].x)*(C-T)),x>_&&(_=x,m=n[A],w=A);a[u++]=m,f=w}return a[u++]=n[d],a}function mO(n,t,e,i){let r=0,s=0,a,l,u,d,f,g,m,_,x,w;const v=[],C=t+e-1,A=n[t].x,I=n[C].x-A;for(a=t;a<t+e;++a){l=n[a],u=(l.x-A)/I*i,d=l.y;const L=u|0;if(L===f)d<x?(x=d,g=a):d>w&&(w=d,m=a),r=(s*r+l.x)/++s;else{const N=a-1;if(!vt(g)&&!vt(m)){const B=Math.min(g,m),k=Math.max(g,m);B!==_&&B!==N&&v.push({...n[B],x:r}),k!==_&&k!==N&&v.push({...n[k],x:r})}a>0&&N!==_&&v.push(n[N]),v.push(l),f=L,s=0,x=w=d,g=m=_=a}}return v}function hm(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function pm(n){n.data.datasets.forEach(t=>{hm(t)})}function yO(n,t){const e=t.length;let i=0,r;const{iScale:s}=n,{min:a,max:l,minDefined:u,maxDefined:d}=s.getUserBounds();return u&&(i=Ce(ri(t,s.axis,a).lo,0,e-1)),d?r=Ce(ri(t,s.axis,l).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var _O={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){pm(n);return}const i=n.width;n.data.datasets.forEach((r,s)=>{const{_data:a,indexAxis:l}=r,u=n.getDatasetMeta(s),d=a||r.data;if(Xs([l,n.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const f=n.scales[u.xAxisID];if(f.type!=="linear"&&f.type!=="time"||n.options.parsing)return;let{start:g,count:m}=yO(u,d);const _=e.threshold||4*i;if(m<=_){hm(r);return}vt(a)&&(r._data=d,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(w){this._data=w}}));let x;switch(e.algorithm){case"lttb":x=gO(d,g,m,i,e);break;case"min-max":x=mO(d,g,m,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=x})},destroy(n){pm(n)}};function bO(n,t,e){const i=n.segments,r=n.points,s=t.points,a=[];for(const l of i){let{start:u,end:d}=l;d=Ua(u,d,r);const f=xu(e,r[u],r[d],l.loop);if(!t.segments){a.push({source:l,target:f,start:r[u],end:r[d]});continue}const g=dg(t,f);for(const m of g){const _=xu(e,s[m.start],s[m.end],m.loop),x=ug(l,r,_);for(const w of x)a.push({source:w,target:m,start:{[e]:gm(f,_,"start",Math.max)},end:{[e]:gm(f,_,"end",Math.min)}})}}return a}function xu(n,t,e,i){if(i)return;let r=t[n],s=e[n];return n==="angle"&&(r=Ue(r),s=Ue(s)),{property:n,start:r,end:s}}function xO(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,s=[];return t.segments.forEach(({start:a,end:l})=>{l=Ua(a,l,r);const u=r[a],d=r[l];i!==null?(s.push({x:u.x,y:i}),s.push({x:d.x,y:i})):e!==null&&(s.push({x:e,y:u.y}),s.push({x:e,y:d.y}))}),s}function Ua(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function gm(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function mm(n,t){let e=[],i=!1;return qt(n)?(i=!0,e=n):e=xO(n,t),e.length?new za({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function ym(n){return n&&n.fill!==!1}function wO(n,t,e){let r=n[t].fill;const s=[t];let a;if(!e)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!ae(r))return r;if(a=n[r],!a)return!1;if(a.visible)return r;s.push(r),r=a.fill}return!1}function vO(n,t,e){const i=kO(n);if(It(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return ae(r)&&Math.floor(r)===r?SO(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function SO(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function TO(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:It(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function MO(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:It(n)?i=n.value:i=t.getBaseValue(),i}function kO(n){const t=n.options,e=t.fill;let i=Ct(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function DO(n){const{scale:t,index:e,line:i}=n,r=[],s=i.segments,a=i.points,l=CO(t,e);l.push(mm({x:null,y:t.bottom},i));for(let u=0;u<s.length;u++){const d=s[u];for(let f=d.start;f<=d.end;f++)OO(r,a[f],l)}return new za({points:r,options:{}})}function CO(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const s=i[r];if(s.index===t)break;s.hidden||e.unshift(s.dataset)}return e}function OO(n,t,e){const i=[];for(let r=0;r<e.length;r++){const s=e[r],{first:a,last:l,point:u}=AO(s,t,"x");if(!(!u||a&&l)){if(a)i.unshift(u);else if(n.push(u),!l)break}}n.push(...i)}function AO(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const r=i[e],s=n.segments,a=n.points;let l=!1,u=!1;for(let d=0;d<s.length;d++){const f=s[d],g=a[f.start][e],m=a[f.end][e];if(ii(r,g,m)){l=r===g,u=r===m;break}}return{first:l,last:u,point:i}}class _m{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:r,y:s,radius:a}=this;return e=e||{start:0,end:te},t.arc(r,s,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:r}=this,s=t.angle;return{x:e+Math.cos(s)*r,y:i+Math.sin(s)*r,angle:s}}}function RO(n){const{chart:t,fill:e,line:i}=n;if(ae(e))return EO(t,e);if(e==="stack")return DO(n);if(e==="shape")return!0;const r=PO(n);return r instanceof _m?r:mm(r,i)}function EO(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function PO(n){return(n.scale||{}).getPointPositionForValue?LO(n):IO(n)}function IO(n){const{scale:t={},fill:e}=n,i=TO(e,t);if(ae(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function LO(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=MO(e,t,s),l=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,s);return new _m({x:u.x,y:u.y,radius:t.getDistanceFromCenterForValue(a)})}for(let u=0;u<r;++u)l.push(t.getPointPositionForValue(u,a));return l}function wu(n,t,e){const i=RO(t),{chart:r,index:s,line:a,scale:l,axis:u}=t,d=a.options,f=d.fill,g=d.backgroundColor,{above:m=g,below:_=g}=f||{},x=r.getDatasetMeta(s),w=pg(r,x);i&&a.points.length&&(Gs(n,e),NO(n,{line:a,target:i,above:m,below:_,area:e,scale:l,axis:u,clip:w}),Ks(n))}function NO(n,t){const{line:e,target:i,above:r,below:s,area:a,scale:l,clip:u}=t,d=e._loop?"angle":t.axis;n.save();let f=s;s!==r&&(d==="x"?(bm(n,i,a.top),vu(n,{line:e,target:i,color:r,scale:l,property:d,clip:u}),n.restore(),n.save(),bm(n,i,a.bottom)):d==="y"&&(xm(n,i,a.left),vu(n,{line:e,target:i,color:s,scale:l,property:d,clip:u}),n.restore(),n.save(),xm(n,i,a.right),f=r)),vu(n,{line:e,target:i,color:f,scale:l,property:d,clip:u}),n.restore()}function bm(n,t,e){const{segments:i,points:r}=t;let s=!0,a=!1;n.beginPath();for(const l of i){const{start:u,end:d}=l,f=r[u],g=r[Ua(u,d,r)];s?(n.moveTo(f.x,f.y),s=!1):(n.lineTo(f.x,e),n.lineTo(f.x,f.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(g.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function xm(n,t,e){const{segments:i,points:r}=t;let s=!0,a=!1;n.beginPath();for(const l of i){const{start:u,end:d}=l,f=r[u],g=r[Ua(u,d,r)];s?(n.moveTo(f.x,f.y),s=!1):(n.lineTo(e,f.y),n.lineTo(f.x,f.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(e,g.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function vu(n,t){const{line:e,target:i,property:r,color:s,scale:a,clip:l}=t,u=bO(e,i,r);for(const{source:d,target:f,start:g,end:m}of u){const{style:{backgroundColor:_=s}={}}=d,x=i!==!0;n.save(),n.fillStyle=_,BO(n,a,l,x&&xu(r,g,m)),n.beginPath();const w=!!e.pathSegment(n,d);let v;if(x){w?n.closePath():wm(n,i,m,r);const C=!!i.pathSegment(n,f,{move:w,reverse:!0});v=w&&C,v||wm(n,i,g,r)}n.closePath(),n.fill(v?"evenodd":"nonzero"),n.restore()}}function BO(n,t,e,i){const r=t.chart.chartArea,{property:s,start:a,end:l}=i||{};if(s==="x"||s==="y"){let u,d,f,g;s==="x"?(u=a,d=r.top,f=l,g=r.bottom):(u=r.left,d=a,f=r.right,g=l),n.beginPath(),e&&(u=Math.max(u,e.left),f=Math.min(f,e.right),d=Math.max(d,e.top),g=Math.min(g,e.bottom)),n.rect(u,d,f-u,g-d),n.clip()}}function wm(n,t,e,i){const r=t.interpolate(e,i);r&&n.lineTo(r.x,r.y)}var FO={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,r=[];let s,a,l,u;for(a=0;a<i;++a)s=n.getDatasetMeta(a),l=s.dataset,u=null,l&&l.options&&l instanceof za&&(u={visible:n.isDatasetVisible(a),index:a,fill:vO(l,a,i),chart:n,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=u,r.push(u);for(a=0;a<i;++a)u=r[a],!(!u||u.fill===!1)&&(u.fill=wO(r,a,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",r=n.getSortedVisibleDatasetMetas(),s=n.chartArea;for(let a=r.length-1;a>=0;--a){const l=r[a].$filler;l&&(l.line.updateControlPoints(s,l.axis),i&&l.fill&&wu(n.ctx,l,s))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const s=i[r].$filler;ym(s)&&wu(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!ym(i)||e.drawTime!=="beforeDatasetDraw"||wu(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const vm=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},zO=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Sm extends $e{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Qt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=le(i.font),s=r.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:u}=vm(i,s);let d,f;e.font=r.string,this.isHorizontal()?(d=this.maxWidth,f=this._fitRows(a,s,l,u)+10):(f=this.maxHeight,d=this._fitCols(a,r,l,u)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(f,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,r){const{ctx:s,maxWidth:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.lineWidths=[0],f=r+l;let g=t;s.textAlign="left",s.textBaseline="middle";let m=-1,_=-f;return this.legendItems.forEach((x,w)=>{const v=i+e/2+s.measureText(x.text).width;(w===0||d[d.length-1]+v+2*l>a)&&(g+=f,d[d.length-(w>0?0:1)]=0,_+=f,m++),u[w]={left:0,top:_,row:m,width:v,height:r},d[d.length-1]+=v+l}),g}_fitCols(t,e,i,r){const{ctx:s,maxHeight:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.columnSizes=[],f=a-t;let g=l,m=0,_=0,x=0,w=0;return this.legendItems.forEach((v,C)=>{const{itemWidth:A,itemHeight:F}=UO(i,e,s,v,r);C>0&&_+F+2*l>f&&(g+=m+l,d.push({width:m,height:_}),x+=m+l,w++,m=_=0),u[C]={left:x,top:_,col:w,width:A,height:F},m=Math.max(m,A),_+=F+l}),g+=m,d.push({width:m,height:_}),g}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:s}}=this,a=Yr(s,this.left,this.width);if(this.isHorizontal()){let l=0,u=He(i,this.left+r,this.right-this.lineWidths[l]);for(const d of e)l!==d.row&&(l=d.row,u=He(i,this.left+r,this.right-this.lineWidths[l])),d.top+=this.top+t+r,d.left=a.leftForLtr(a.x(u),d.width),u+=d.width+r}else{let l=0,u=He(i,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const d of e)d.col!==l&&(l=d.col,u=He(i,this.top+t+r,this.bottom-this.columnSizes[l].height)),d.top=u,d.left+=this.left+r,d.left=a.leftForLtr(a.x(d.left),d.width),u+=d.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Gs(t,this),this._draw(),Ks(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:s,labels:a}=t,l=se.color,u=Yr(t.rtl,this.left,this.width),d=le(a.font),{padding:f}=a,g=d.size,m=g/2;let _;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=d.string;const{boxWidth:x,boxHeight:w,itemHeight:v}=vm(a,g),C=function(N,B,k){if(isNaN(x)||x<=0||isNaN(w)||w<0)return;r.save();const T=Ct(k.lineWidth,1);if(r.fillStyle=Ct(k.fillStyle,l),r.lineCap=Ct(k.lineCap,"butt"),r.lineDashOffset=Ct(k.lineDashOffset,0),r.lineJoin=Ct(k.lineJoin,"miter"),r.lineWidth=T,r.strokeStyle=Ct(k.strokeStyle,l),r.setLineDash(Ct(k.lineDash,[])),a.usePointStyle){const O={radius:w*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:T},E=u.xPlus(N,x/2),W=B+m;Gp(r,O,E,W,a.pointStyleWidth&&x)}else{const O=B+Math.max((g-w)/2,0),E=u.leftForLtr(N,x),W=Oi(k.borderRadius);r.beginPath(),Object.values(W).some(J=>J!==0)?Wr(r,{x:E,y:O,w:x,h:w,radius:W}):r.rect(E,O,x,w),r.fill(),T!==0&&r.stroke()}r.restore()},A=function(N,B,k){ar(r,k.text,N,B+v/2,d,{strikethrough:k.hidden,textAlign:u.textAlign(k.textAlign)})},F=this.isHorizontal(),I=this._computeTitleHeight();F?_={x:He(s,this.left+f,this.right-i[0]),y:this.top+f+I,line:0}:_={x:this.left+f,y:He(s,this.top+I+f,this.bottom-e[0].height),line:0},og(this.ctx,t.textDirection);const L=v+f;this.legendItems.forEach((N,B)=>{r.strokeStyle=N.fontColor,r.fillStyle=N.fontColor;const k=r.measureText(N.text).width,T=u.textAlign(N.textAlign||(N.textAlign=a.textAlign)),O=x+m+k;let E=_.x,W=_.y;u.setWidth(this.width),F?B>0&&E+O+f>this.right&&(W=_.y+=L,_.line++,E=_.x=He(s,this.left+f,this.right-i[_.line])):B>0&&W+L>this.bottom&&(E=_.x=E+e[_.line].width+f,_.line++,W=_.y=He(s,this.top+I+f,this.bottom-e[_.line].height));const J=u.x(E);if(C(J,W,N),E=ek(T,E+x+m,F?E+O:this.right,t.rtl),A(u.x(E),W,N),F)_.x+=O+f;else if(typeof N.text!="string"){const at=d.lineHeight;_.y+=Tm(N,at)+f}else _.y+=L}),ag(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=le(e.font),r=we(e.padding);if(!e.display)return;const s=Yr(t.rtl,this.left,this.width),a=this.ctx,l=e.position,u=i.size/2,d=r.top+u;let f,g=this.left,m=this.width;if(this.isHorizontal())m=Math.max(...this.lineWidths),f=this.top+d,g=He(t.align,g,this.right-m);else{const x=this.columnSizes.reduce((w,v)=>Math.max(w,v.height),0);f=d+He(t.align,this.top,this.bottom-x-t.labels.padding-this._computeTitleHeight())}const _=He(l,g,g+m);a.textAlign=s.textAlign(qc(l)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,ar(a,e.text,_,f,i)}_computeTitleHeight(){const t=this.options.title,e=le(t.font),i=we(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,s;if(ii(t,this.left,this.right)&&ii(e,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(r=s[i],ii(t,r.left,r.left+r.width)&&ii(e,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!$O(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=zO(r,i);r&&!s&&Qt(e.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!s&&Qt(e.onHover,[t,i,this],this)}else i&&Qt(e.onClick,[t,i,this],this)}}function UO(n,t,e,i,r){const s=HO(i,n,t,e),a=WO(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function HO(n,t,e,i){let r=n.text;return r&&typeof r!="string"&&(r=r.reduce((s,a)=>s.length>a.length?s:a)),t+e.size/2+i.measureText(r).width}function WO(n,t,e){let i=n;return typeof t.text!="string"&&(i=Tm(t,e)),i}function Tm(n,t){const e=n.text?n.text.length:0;return t*e}function $O(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var VO={id:"legend",_element:Sm,start(n,t,e){const i=n.legend=new Sm({ctx:n.ctx,options:e,chart:n});We.configure(n,i,e),We.addBox(n,i)},stop(n){We.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;We.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,r=e.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=n.legend.options;return n._getSortedDatasetMetas().map(u=>{const d=u.controller.getStyle(e?0:void 0),f=we(d.borderWidth);return{text:t[u.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!u.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(f.width+f.height)/4,strokeStyle:d.borderColor,pointStyle:i||d.pointStyle,rotation:d.rotation,textAlign:r||d.textAlign,borderRadius:a&&(l||d.borderRadius),datasetIndex:u.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class Su extends $e{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const r=qt(i.text)?i.text.length:1;this._padding=we(i.padding);const s=r*le(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:r,right:s,options:a}=this,l=a.align;let u=0,d,f,g;return this.isHorizontal()?(f=He(l,i,s),g=e+t,d=s-i):(a.position==="left"?(f=i+t,g=He(l,r,e),u=Et*-.5):(f=s-t,g=He(l,e,r),u=Et*.5),d=r-e),{titleX:f,titleY:g,maxWidth:d,rotation:u}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=le(e.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:u,rotation:d}=this._drawArgs(s);ar(t,e.text,0,0,i,{color:e.color,maxWidth:u,rotation:d,textAlign:qc(e.align),textBaseline:"middle",translation:[a,l]})}}function YO(n,t){const e=new Su({ctx:n.ctx,options:t,chart:n});We.configure(n,e,t),We.addBox(n,e),n.titleBlock=e}var qO={id:"title",_element:Su,start(n,t,e){YO(n,e)},stop(n){const t=n.titleBlock;We.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;We.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ha=new WeakMap;var jO={id:"subtitle",start(n,t,e){const i=new Su({ctx:n.ctx,options:e,chart:n});We.configure(n,i,e),We.addBox(n,i),Ha.set(n,i)},stop(n){We.removeBox(n,Ha.get(n)),Ha.delete(n)},beforeUpdate(n,t,e){const i=Ha.get(n);We.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const oo={average(n){if(!n.length)return!1;let t,e,i=new Set,r=0,s=0;for(t=0,e=n.length;t<e;++t){const l=n[t].element;if(l&&l.hasValue()){const u=l.tooltipPosition();i.add(u.x),r+=u.y,++s}}return s===0||i.size===0?!1:{x:[...i].reduce((l,u)=>l+u)/i.size,y:r/s}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,r=Number.POSITIVE_INFINITY,s,a,l;for(s=0,a=n.length;s<a;++s){const u=n[s].element;if(u&&u.hasValue()){const d=u.getCenterPoint(),f=Hr(t,d);f<r&&(r=f,l=u)}}if(l){const u=l.tooltipPosition();e=u.x,i=u.y}return{x:e,y:i}}};function jn(n,t){return t&&(qt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function ai(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
2
2
|
`)>-1?n.split(`
|
|
3
|
-
`):n}function jO(n,t){const{element:e,datasetIndex:i,index:r}=t,s=n.getDatasetMeta(i).controller,{label:a,value:l}=s.getLabelAndValue(r);return{chart:n,label:a,parsed:s.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:e}}function Mm(n,t){const e=n.chart.ctx,{body:i,footer:r,title:s}=n,{boxWidth:a,boxHeight:l}=t,u=le(t.bodyFont),d=le(t.titleFont),f=le(t.footerFont),g=s.length,m=r.length,_=i.length,x=we(t.padding);let S=x.height,T=0,C=i.reduce((P,I)=>P+I.before.length+I.lines.length+I.after.length,0);if(C+=n.beforeBody.length+n.afterBody.length,g&&(S+=g*d.lineHeight+(g-1)*t.titleSpacing+t.titleMarginBottom),C){const P=t.displayColors?Math.max(l,u.lineHeight):u.lineHeight;S+=_*P+(C-_)*u.lineHeight+(C-1)*t.bodySpacing}m&&(S+=t.footerMarginTop+m*f.lineHeight+(m-1)*t.footerSpacing);let A=0;const F=function(P){T=Math.max(T,e.measureText(P).width+A)};return e.save(),e.font=d.string,Jt(n.title,F),e.font=u.string,Jt(n.beforeBody.concat(n.afterBody),F),A=t.displayColors?a+2+t.boxPadding:0,Jt(i,P=>{Jt(P.before,F),Jt(P.lines,F),Jt(P.after,F)}),A=0,e.font=f.string,Jt(n.footer,F),e.restore(),T+=x.width,{width:T,height:S}}function GO(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function KO(n,t,e,i){const{x:r,width:s}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&r+s+a>t.width||n==="right"&&r-s-a<0)return!0}function XO(n,t,e,i){const{x:r,width:s}=e,{width:a,chartArea:{left:l,right:u}}=n;let d="center";return i==="center"?d=r<=(l+u)/2?"left":"right":r<=s/2?d="left":r>=a-s/2&&(d="right"),KO(d,n,t,e)&&(d="center"),d}function km(n,t,e){const i=e.yAlign||t.yAlign||GO(n,e);return{xAlign:e.xAlign||t.xAlign||XO(n,t,e,i),yAlign:i}}function ZO(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function QO(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Dm(n,t,e,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=n,{xAlign:l,yAlign:u}=e,d=r+s,{topLeft:f,topRight:g,bottomLeft:m,bottomRight:_}=Oi(a);let x=ZO(t,l);const S=QO(t,u,d);return u==="center"?l==="left"?x+=d:l==="right"&&(x-=d):l==="left"?x-=Math.max(f,m)+r:l==="right"&&(x+=Math.max(g,_)+r),{x:Ce(x,0,i.width-t.width),y:Ce(S,0,i.height-t.height)}}function Wa(n,t,e){const i=we(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Cm(n){return jn([],ai(n))}function JO(n,t,e){return Ai(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Om(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Am={beforeTitle:ni,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:ni,beforeBody:ni,beforeLabel:ni,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return xt(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:ni,afterBody:ni,beforeFooter:ni,footer:ni,afterFooter:ni};function sn(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?Am[t].call(e,i):r}class Em extends $e{static positioners=so;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&e.options.animation&&i.animations,s=new ou(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=JO(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=sn(i,"beforeTitle",this,t),s=sn(i,"title",this,t),a=sn(i,"afterTitle",this,t);let l=[];return l=jn(l,ai(r)),l=jn(l,ai(s)),l=jn(l,ai(a)),l}getBeforeBody(t,e){return Cm(sn(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return Jt(t,s=>{const a={before:[],lines:[],after:[]},l=Om(i,s);jn(a.before,ai(sn(l,"beforeLabel",this,s))),jn(a.lines,sn(l,"label",this,s)),jn(a.after,ai(sn(l,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,e){return Cm(sn(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=sn(i,"beforeFooter",this,t),s=sn(i,"footer",this,t),a=sn(i,"afterFooter",this,t);let l=[];return l=jn(l,ai(r)),l=jn(l,ai(s)),l=jn(l,ai(a)),l}_createItems(t){const e=this._active,i=this.chart.data,r=[],s=[],a=[];let l=[],u,d;for(u=0,d=e.length;u<d;++u)l.push(jO(this.chart,e[u]));return t.filter&&(l=l.filter((f,g,m)=>t.filter(f,g,m,i))),t.itemSort&&(l=l.sort((f,g)=>t.itemSort(f,g,i))),Jt(l,f=>{const g=Om(t.callbacks,f);r.push(sn(g,"labelColor",this,f)),s.push(sn(g,"labelPointStyle",this,f)),a.push(sn(g,"labelTextColor",this,f))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),r=this._active;let s,a=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const l=so[i.position].call(this,r,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const u=this._size=Mm(this,i),d=Object.assign({},l,u),f=km(this.chart,i,d),g=Dm(i,d,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,s={opacity:1,x:g.x,y:g.y,width:u.width,height:u.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,r){const s=this.getCaretPosition(t,i,r);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:r,yAlign:s}=this,{caretSize:a,cornerRadius:l}=i,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=Oi(l),{x:m,y:_}=t,{width:x,height:S}=e;let T,C,A,F,P,I;return s==="center"?(P=_+S/2,r==="left"?(T=m,C=T-a,F=P+a,I=P-a):(T=m+x,C=T+a,F=P-a,I=P+a),A=T):(r==="left"?C=m+Math.max(u,f)+a:r==="right"?C=m+x-Math.max(d,g)-a:C=this.caretX,s==="top"?(F=_,P=F-a,T=C-a,A=C+a):(F=_+S,P=F+a,T=C+a,A=C-a),I=F),{x1:T,x2:C,x3:A,y1:F,y2:P,y3:I}}drawTitle(t,e,i){const r=this.title,s=r.length;let a,l,u;if(s){const d=Yr(i.rtl,this.x,this.width);for(t.x=Wa(this,i.titleAlign,i),e.textAlign=d.textAlign(i.titleAlign),e.textBaseline="middle",a=le(i.titleFont),l=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,u=0;u<s;++u)e.fillText(r[u],d.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+l,u+1===s&&(t.y+=i.titleMarginBottom-l)}}_drawColorBox(t,e,i,r,s){const a=this.labelColors[i],l=this.labelPointStyles[i],{boxHeight:u,boxWidth:d}=s,f=le(s.bodyFont),g=Wa(this,"left",s),m=r.x(g),_=u<f.lineHeight?(f.lineHeight-u)/2:0,x=e.y+_;if(s.usePointStyle){const S={radius:Math.min(d,u)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},T=r.leftForLtr(m,d)+d/2,C=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Jc(t,S,T,C),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Jc(t,S,T,C)}else{t.lineWidth=Pt(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const S=r.leftForLtr(m,d),T=r.leftForLtr(r.xPlus(m,1),d-2),C=Oi(a.borderRadius);Object.values(C).some(A=>A!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Wr(t,{x:S,y:x,w:d,h:u,radius:C}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Wr(t,{x:T,y:x+1,w:d-2,h:u-2,radius:C}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(S,x,d,u),t.strokeRect(S,x,d,u),t.fillStyle=a.backgroundColor,t.fillRect(T,x+1,d-2,u-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:r}=this,{bodySpacing:s,bodyAlign:a,displayColors:l,boxHeight:u,boxWidth:d,boxPadding:f}=i,g=le(i.bodyFont);let m=g.lineHeight,_=0;const x=Yr(i.rtl,this.x,this.width),S=function(w){e.fillText(w,x.x(t.x+_),t.y+m/2),t.y+=m+s},T=x.textAlign(a);let C,A,F,P,I,L,N;for(e.textAlign=a,e.textBaseline="middle",e.font=g.string,t.x=Wa(this,T,i),e.fillStyle=i.bodyColor,Jt(this.beforeBody,S),_=l&&T!=="right"?a==="center"?d/2+f:d+2+f:0,P=0,L=r.length;P<L;++P){for(C=r[P],A=this.labelTextColors[P],e.fillStyle=A,Jt(C.before,S),F=C.lines,l&&F.length&&(this._drawColorBox(e,t,P,x,i),m=Math.max(g.lineHeight,u)),I=0,N=F.length;I<N;++I)S(F[I]),m=g.lineHeight;Jt(C.after,S)}_=0,m=g.lineHeight,Jt(this.afterBody,S),t.y-=s}drawFooter(t,e,i){const r=this.footer,s=r.length;let a,l;if(s){const u=Yr(i.rtl,this.x,this.width);for(t.x=Wa(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=u.textAlign(i.footerAlign),e.textBaseline="middle",a=le(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,l=0;l<s;++l)e.fillText(r[l],u.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,r){const{xAlign:s,yAlign:a}=this,{x:l,y:u}=t,{width:d,height:f}=i,{topLeft:g,topRight:m,bottomLeft:_,bottomRight:x}=Oi(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(l+g,u),a==="top"&&this.drawCaret(t,e,i,r),e.lineTo(l+d-m,u),e.quadraticCurveTo(l+d,u,l+d,u+m),a==="center"&&s==="right"&&this.drawCaret(t,e,i,r),e.lineTo(l+d,u+f-x),e.quadraticCurveTo(l+d,u+f,l+d-x,u+f),a==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(l+_,u+f),e.quadraticCurveTo(l,u+f,l,u+f-_),a==="center"&&s==="left"&&this.drawCaret(t,e,i,r),e.lineTo(l,u+g),e.quadraticCurveTo(l,u,l+g,u),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const a=so[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=Mm(this,t),u=Object.assign({},a,this._size),d=km(e,t,u),f=Dm(t,u,d,e);(r._to!==f.x||s._to!==f.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=we(e.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&l&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,e),og(t,e.textDirection),s.y+=a.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),ag(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,r=t.map(({datasetIndex:l,index:u})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[u],index:u}}),s=!ya(i,r),a=this._positionChanged(r,e);(s||a)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],a=this._getActiveElements(t,s,e,i),l=this._positionChanged(a,t),u=e||!ya(a,s)||l;return u&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),u}_getActiveElements(t,e,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return e.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:r,options:s}=this,a=so[s.position].call(this,t,e);return a!==!1&&(i!==a.x||r!==a.y)}}var Ve={id:"tooltip",_element:Em,positioners:so,afterInit(n,t,e){e&&(n.tooltip=new Em({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Am},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},tA=Object.freeze({__proto__:null,Colors:hO,Decimation:yO,Filler:BO,Legend:$O,SubTitle:qO,Title:YO,Tooltip:Ve});const eA=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function nA(n,t,e,i){const r=n.indexOf(t);if(r===-1)return eA(n,t,e,i);const s=n.lastIndexOf(t);return r!==s?e:r}const iA=(n,t)=>n===null?null:Ce(Math.round(n),0,t);function Rm(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class rA extends fr{static id="category";static defaults={ticks:{callback:Rm}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:r,label:s}of e)i[r]===s&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(xt(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:nA(i,t,kt(e,t),this._addedLabels),iA(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,r=[];let s=this.getLabels();s=t===0&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)r.push({value:a});return r}getLabelForValue(t){return Rm.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function sA(n,t){const e=[],{bounds:r,step:s,min:a,max:l,precision:u,count:d,maxTicks:f,maxDigits:g,includeBounds:m}=n,_=s||1,x=f-1,{min:S,max:T}=t,C=!xt(a),A=!xt(l),F=!xt(d),P=(T-S)/(g+1);let I=Pp((T-S)/x/_)*_,L,N,w,M;if(I<1e-14&&!C&&!A)return[{value:S},{value:T}];M=Math.ceil(T/I)-Math.floor(S/I),M>x&&(I=Pp(M*I/x/_)*_),xt(u)||(L=Math.pow(10,u),I=Math.ceil(I*L)/L),r==="ticks"?(N=Math.floor(S/I)*I,w=Math.ceil(T/I)*I):(N=S,w=T),C&&A&&s&&jM((l-a)/s,I/1e3)?(M=Math.round(Math.min((l-a)/I,f)),I=(l-a)/M,N=a,w=l):F?(N=C?a:N,w=A?l:w,M=d-1,I=(w-N)/M):(M=(w-N)/I,Ws(M,Math.round(M),I/1e3)?M=Math.round(M):M=Math.ceil(M));const O=Math.max(Lp(I),Lp(N));L=Math.pow(10,xt(u)?O:u),N=Math.round(N*L)/L,w=Math.round(w*L)/L;let B=0;for(C&&(m&&N!==a?(e.push({value:a}),N<a&&B++,Ws(Math.round((N+B*I)*L)/L,a,Pm(a,P,n))&&B++):N<a&&B++);B<M;++B){const W=Math.round((N+B*I)*L)/L;if(A&&W>l)break;e.push({value:W})}return A&&m&&w!==l?e.length&&Ws(e[e.length-1].value,l,Pm(l,P,n))?e[e.length-1].value=l:e.push({value:l}):(!A||w===l)&&e.push({value:w}),e}function Pm(n,t,{horizontal:e,minRotation:i}){const r=xe(i),s=(e?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+n).length;return Math.min(t/s,a)}class $a extends fr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return xt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=u=>r=e?r:u,l=u=>s=i?s:u;if(t){const u=Yn(r),d=Yn(s);u<0&&d<0?l(0):u>0&&d>0&&a(0)}if(r===s){let u=s===0?1:Math.abs(s*.05);l(s+u),t||a(r-u)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),e=e||11),e&&(r=Math.min(e,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},s=this._range||this,a=sA(r,s);return t.bounds==="ticks"&&Ip(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Ys(t,this.chart.options.locale,this.options.ticks.format)}}class oA extends $a{static id="linear";static defaults={ticks:{callback:Ma.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ae(t)?t:0,this.max=ae(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=xe(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const oo=n=>Math.floor(Di(n)),hr=(n,t)=>Math.pow(10,oo(n)+t);function Im(n){return n/Math.pow(10,oo(n))===1}function Lm(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function aA(n,t){const e=t-n;let i=oo(e);for(;Lm(n,t,i)>10;)i++;for(;Lm(n,t,i)<10;)i--;return Math.min(i,oo(n))}function lA(n,{min:t,max:e}){t=pn(n.min,t);const i=[],r=oo(t);let s=aA(t,e),a=s<0?Math.pow(10,Math.abs(s)):1;const l=Math.pow(10,s),u=r>s?Math.pow(10,r):0,d=Math.round((t-u)*a)/a,f=Math.floor((t-u)/l/10)*l*10;let g=Math.floor((d-f)/Math.pow(10,s)),m=pn(n.min,Math.round((u+f+g*Math.pow(10,s))*a)/a);for(;m<e;)i.push({value:m,major:Im(m),significand:g}),g>=10?g=g<15?15:20:g++,g>=20&&(s++,g=2,a=s>=0?1:a),m=Math.round((u+f+g*Math.pow(10,s))*a)/a;const _=pn(n.max,m);return i.push({value:_,major:Im(_),significand:g}),i}class cA extends fr{static id="logarithmic";static defaults={ticks:{callback:Ma.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,e){const i=$a.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return ae(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ae(t)?Math.max(0,t):null,this.max=ae(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ae(this._userMin)&&(this.min=t===hr(this.min,0)?hr(this.min,-1):hr(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,r=this.max;const s=l=>i=t?i:l,a=l=>r=e?r:l;i===r&&(i<=0?(s(1),a(10)):(s(hr(i,-1)),a(hr(r,1)))),i<=0&&s(hr(r,-1)),r<=0&&a(hr(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=lA(e,this);return t.bounds==="ticks"&&Ip(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":Ys(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Di(t),this._valueRange=Di(this.max)-Di(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Di(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function ku(n){const t=n.ticks;if(t.display&&n.display){const e=we(t.backdropPadding);return kt(t.font&&t.font.size,se.font.size)+e.height}return 0}function uA(n,t,e){return e=qt(e)?e:[e],{w:uk(n,t.string,e),h:e.length*t.lineHeight}}function Nm(n,t,e,i,r){return n===i||n===r?{start:t-e/2,end:t+e/2}:n<i||n>r?{start:t-e,end:t}:{start:t,end:t+e}}function dA(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],r=[],s=n._pointLabels.length,a=n.options.pointLabels,l=a.centerPointLabels?Et/s:0;for(let u=0;u<s;u++){const d=a.setContext(n.getPointLabelContext(u));r[u]=d.padding;const f=n.getPointPosition(u,n.drawingArea+r[u],l),g=le(d.font),m=uA(n.ctx,g,n._pointLabels[u]);i[u]=m;const _=Ue(n.getIndexAngle(u)+l),x=Math.round(wa(_)),S=Nm(x,f.x,m.w,0,180),T=Nm(x,f.y,m.h,90,270);fA(e,t,_,S,T)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=gA(n,i,r)}function fA(n,t,e,i,r){const s=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let l=0,u=0;i.start<t.l?(l=(t.l-i.start)/s,n.l=Math.min(n.l,t.l-l)):i.end>t.r&&(l=(i.end-t.r)/s,n.r=Math.max(n.r,t.r+l)),r.start<t.t?(u=(t.t-r.start)/a,n.t=Math.min(n.t,t.t-u)):r.end>t.b&&(u=(r.end-t.b)/a,n.b=Math.max(n.b,t.b+u))}function hA(n,t,e){const i=n.drawingArea,{extra:r,additionalAngle:s,padding:a,size:l}=e,u=n.getPointPosition(t,i+r+a,s),d=Math.round(wa(Ue(u.angle+re))),f=_A(u.y,l.h,d),g=mA(d),m=yA(u.x,l.w,g);return{visible:!0,x:u.x,y:f,textAlign:g,left:m,top:f,right:m+l.w,bottom:f+l.h}}function pA(n,t){if(!t)return!0;const{left:e,top:i,right:r,bottom:s}=n;return!(si({x:e,y:i},t)||si({x:e,y:s},t)||si({x:r,y:i},t)||si({x:r,y:s},t))}function gA(n,t,e){const i=[],r=n._pointLabels.length,s=n.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:ku(s)/2,additionalAngle:a?Et/r:0};let d;for(let f=0;f<r;f++){u.padding=e[f],u.size=t[f];const g=hA(n,f,u);i.push(g),l==="auto"&&(g.visible=pA(g,d),g.visible&&(d=g))}return i}function mA(n){return n===0||n===180?"center":n<180?"left":"right"}function yA(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function _A(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function bA(n,t,e){const{left:i,top:r,right:s,bottom:a}=e,{backdropColor:l}=t;if(!xt(l)){const u=Oi(t.borderRadius),d=we(t.backdropPadding);n.fillStyle=l;const f=i-d.left,g=r-d.top,m=s-i+d.width,_=a-r+d.height;Object.values(u).some(x=>x!==0)?(n.beginPath(),Wr(n,{x:f,y:g,w:m,h:_,radius:u}),n.fill()):n.fillRect(f,g,m,_)}}function xA(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let r=t-1;r>=0;r--){const s=n._pointLabelItems[r];if(!s.visible)continue;const a=i.setContext(n.getPointLabelContext(r));bA(e,a,s);const l=le(a.font),{x:u,y:d,textAlign:f}=s;lr(e,n._pointLabels[r],u,d+l.lineHeight/2,l,{color:a.color,textAlign:f,textBaseline:"middle"})}}function Bm(n,t,e,i){const{ctx:r}=n;if(e)r.arc(n.xCenter,n.yCenter,t,0,te);else{let s=n.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let a=1;a<i;a++)s=n.getPointPosition(a,t),r.lineTo(s.x,s.y)}}function wA(n,t,e,i,r){const s=n.ctx,a=t.circular,{color:l,lineWidth:u}=t;!a&&!i||!l||!u||e<0||(s.save(),s.strokeStyle=l,s.lineWidth=u,s.setLineDash(r.dash||[]),s.lineDashOffset=r.dashOffset,s.beginPath(),Bm(n,e,a,i),s.closePath(),s.stroke(),s.restore())}function vA(n,t,e){return Ai(n,{label:e,index:t,type:"pointLabel"})}class SA extends $a{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:Ma.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=we(ku(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=ae(t)&&!isNaN(t)?t:0,this.max=ae(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ku(this.options))}generateTickLabels(t){$a.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const r=Qt(this.options.pointLabels.callback,[e,i],this);return r||r===0?r:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?dA(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){const e=te/(this._pointLabels.length||1),i=this.options.startAngle||0;return Ue(t*e+xe(i))}getDistanceFromCenterForValue(t){if(xt(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(xt(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return vA(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const r=this.getIndexAngle(t)-re+i;return{x:Math.cos(r)*e+this.xCenter,y:Math.sin(r)*e+this.yCenter,angle:r}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:r,bottom:s}=this._pointLabelItems[t];return{left:e,top:i,right:r,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Bm(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:r,border:s}=e,a=this._pointLabels.length;let l,u,d;if(e.pointLabels.display&&xA(this,a),r.display&&this.ticks.forEach((f,g)=>{if(g!==0||g===0&&this.min<0){u=this.getDistanceFromCenterForValue(f.value);const m=this.getContext(g),_=r.setContext(m),x=s.setContext(m);wA(this,_,u,a,x)}}),i.display){for(t.save(),l=a-1;l>=0;l--){const f=i.setContext(this.getPointLabelContext(l)),{color:g,lineWidth:m}=f;!m||!g||(t.lineWidth=m,t.strokeStyle=g,t.setLineDash(f.borderDash),t.lineDashOffset=f.borderDashOffset,u=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),d=this.getPointPosition(l,u),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(d.x,d.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let s,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,u)=>{if(u===0&&this.min>=0&&!e.reverse)return;const d=i.setContext(this.getContext(u)),f=le(d.font);if(s=this.getDistanceFromCenterForValue(this.ticks[u].value),d.showLabelBackdrop){t.font=f.string,a=t.measureText(l.label).width,t.fillStyle=d.backdropColor;const g=we(d.backdropPadding);t.fillRect(-a/2-g.left,-s-f.size/2-g.top,a+g.width,f.size+g.height)}lr(t,l.label,0,-s,f,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}const Va={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}},on=Object.keys(Va);function Fm(n,t){return n-t}function zm(n,t){if(xt(t))return null;const e=n._adapter,{parser:i,round:r,isoWeekday:s}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),ae(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(r&&(a=r==="week"&&(Ci(s)||s===!0)?e.startOf(a,"isoWeek",s):e.startOf(a,r)),+a)}function Um(n,t,e,i){const r=on.length;for(let s=on.indexOf(n);s<r-1;++s){const a=Va[on[s]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(l*a.size))<=i)return on[s]}return on[r-1]}function TA(n,t,e,i,r){for(let s=on.length-1;s>=on.indexOf(e);s--){const a=on[s];if(Va[a].common&&n._adapter.diff(r,i,a)>=t-1)return a}return on[e?on.indexOf(e):0]}function MA(n){for(let t=on.indexOf(n)+1,e=on.length;t<e;++t)if(Va[on[t]].common)return on[t]}function Hm(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=jc(e,t),s=e[i]>=t?e[i]:e[r];n[s]=!0}}function kA(n,t,e,i){const r=n._adapter,s=+r.startOf(t[0].value,i),a=t[t.length-1].value;let l,u;for(l=s;l<=a;l=+r.add(l,1,i))u=e[l],u>=0&&(t[u].major=!0);return t}function Wm(n,t,e){const i=[],r={},s=t.length;let a,l;for(a=0;a<s;++a)l=t[a],r[l]=a,i.push({value:l,major:!1});return s===0||!e?i:kA(n,i,r,e)}class Du extends fr{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,e={}){const i=t.time||(t.time={}),r=this._adapter=new Ag._date(t.adapters.date);r.init(e),Hs(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:zm(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:r,max:s,minDefined:a,maxDefined:l}=this.getUserBounds();function u(d){!a&&!isNaN(d.min)&&(r=Math.min(r,d.min)),!l&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!a||!l)&&(u(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&u(this.getMinMax(!1))),r=ae(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),s=ae(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const s=this.min,a=this.max,l=ZM(r,s,a);return this._unit=e.unit||(i.autoSkip?Um(e.minUnit,this.min,this.max,this._getLabelCapacity(s)):TA(this,l.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:MA(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),Wm(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?e=1-r:e=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?i=s:i=(s-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=Ce(e,0,a),i=Ce(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,r=this.options,s=r.time,a=s.unit||Um(s.minUnit,e,i,this._getLabelCapacity(e)),l=kt(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,d=Ci(u)||u===!0,f={};let g=e,m,_;if(d&&(g=+t.startOf(g,"isoWeek",u)),g=+t.startOf(g,d?"day":a),t.diff(i,e,a)>1e5*l)throw new Error(e+" and "+i+" are too far apart with stepSize of "+l+" "+a);const x=r.ticks.source==="data"&&this.getDataTimestamps();for(m=g,_=0;m<i;m=+t.add(m,l,a),_++)Hm(f,m,x);return(m===i||r.bounds==="ticks"||_===1)&&Hm(f,m,x),Object.keys(f).sort(Fm).map(S=>+S)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const r=this.options.time.displayFormats,s=this._unit,a=e||r[s];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,r){const s=this.options,a=s.ticks.callback;if(a)return Qt(a,[t,e,i],this);const l=s.time.displayFormats,u=this._unit,d=this._majorUnit,f=u&&l[u],g=d&&l[d],m=i[e],_=d&&g&&m&&m.major;return this._adapter.format(t,r||(_?g:f))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e<i;++e)r=t[e],r.label=this._tickFormatFunction(r.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,r=xe(this.isHorizontal()?e.maxRotation:e.minRotation),s=Math.cos(r),a=Math.sin(r),l=this._resolveTickFontOptions(0).size;return{w:i*s+l*a,h:i*a+l*s}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,r=i[e.unit]||i.millisecond,s=this._tickFormatFunction(t,0,Wm(this,[t],this._majorUnit),r),a=this._getLabelSize(s),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,i=r.length;e<i;++e)t=t.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const r=this.getLabels();for(e=0,i=r.length;e<i;++e)t.push(zm(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Fp(t.sort(Fm))}}function Ya(n,t,e){let i=0,r=n.length-1,s,a,l,u;e?(t>=n[i].pos&&t<=n[r].pos&&({lo:i,hi:r}=ri(n,"pos",t)),{pos:s,time:l}=n[i],{pos:a,time:u}=n[r]):(t>=n[i].time&&t<=n[r].time&&({lo:i,hi:r}=ri(n,"time",t)),{time:s,pos:l}=n[i],{time:a,pos:u}=n[r]);const d=a-s;return d?l+(u-l)*(t-s)/d:l}class DA extends Du{static id="timeseries";static defaults=Du.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ya(e,this.min),this._tableRange=Ya(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],s=[];let a,l,u,d,f;for(a=0,l=t.length;a<l;++a)d=t[a],d>=e&&d<=i&&r.push(d);if(r.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,l=r.length;a<l;++a)f=r[a+1],u=r[a-1],d=r[a],Math.round((f+u)/2)!==d&&s.push({time:d,pos:a/(l-1)});return s}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Ya(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Ya(this._table,i*this._tableRange+this._minPos,!0)}}var CA=Object.freeze({__proto__:null,CategoryScale:rA,LinearScale:oA,LogarithmicScale:cA,RadialLinearScale:SA,TimeScale:Du,TimeSeriesScale:DA});const OA=[OD,oO,tA,CA];function AA(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:u=>({label:u.dataset.label,value:u.label})}};Ve.positioners[e]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const f=this.chart.canvas.getBoundingClientRect(),g=n.tooltipState.width||this.width,m=f.width/2,_=Xa(d,g,m),x=d.y,S=d.x<m?"left":"center";return{x:_-n.tooltipState.offsetX,y:x-n.tooltipState.offsetY,xAlign:S}},pu.modes.customInteractionMode=function(u,d){const f=Ei(d,u),g=[];return pu.evaluateInteractionItems(u,u.options.indexAxis||"x",f,(m,_,x)=>{u.options.indexAxis==="y"&&m.inYRange(f.y,!0)&&u.data.datasets[_].data[x]&&g.push({element:m,datasetIndex:_,index:x}),u.options.indexAxis==="x"&&f.x!==null&&m.inXRange(f.x,!0)&&u.data.datasets[_].data[x]&&g.push({element:m,datasetIndex:_,index:x})}),g};const r=n.numLabels.value>25?iy:ry,s=({chart:u,index:d})=>{const f=u.data;return{size:r,style:f?.isLabelEmpty?.[d]?"italic":"normal"}},a=(u,d,f)=>u.chart.options.indexAxis===u.axis?(d=u.getLabelForValue(f),d&&d.length>Za?d.slice(0,Za)+"...":d):u.getLabelForValue(Number(d)),l=p.computed(()=>({indexAxis:n.indexAxis,skipNull:!0,scales:{x:{stacked:n.stacked.value,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{maxRotation:90,autoSkip:!1,font:s,callback:function(u,d){return a(this,u,d)}},title:{display:n.indexAxis==="y"?!xt(n.metricAxesTitle?.value):!xt(n.dimensionAxesTitle?.value),text:n.indexAxis==="y"?n.metricAxesTitle?.value:n.dimensionAxesTitle?.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:n.stacked.value,beginAtZero:!0,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{padding:0,font:s,callback:function(u,d){return a(this,u,d)}},title:{display:n.indexAxis==="x"?!xt(n.metricAxesTitle?.value):!xt(n.dimensionAxesTitle?.value),text:n.indexAxis==="x"?n.metricAxesTitle?.value:n.dimensionAxesTitle?.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:u=>{ty(n.tooltipState,u)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.getCurrentInstance()&&p.onUnmounted(()=>{Ve.positioners[e]&&delete Ve.positioners[e]}),l}rn.register(...OA);const EA=(n,t)=>{const e=t.datasets.map(r=>r.label),i=n.datasets.map(r=>r.label);return n.datasets.length===t.datasets.length&&e.every((r,s)=>r===i[s])};function RA(n,t,e,i,r){const s=p.shallowRef(null),a=(l,u)=>{if(t.value)return new rn(t.value,{type:n,data:l,plugins:i,options:u})};return p.onMounted(()=>{s.value=a(e.value,r.value)}),p.onBeforeUnmount(()=>{xt(s.value)||s.value.destroy()}),p.watch(e,(l,u)=>{if(EA(u,l)&&!xt(s.value)){for(const[d,f]of l.datasets.entries())Object.assign(s.value.data.datasets[d],f);s.value.data.labels=l.labels,s.value.update()}else xt(s.value)||s.value.destroy(),s.value=a(l,r.value)}),p.watch(t,()=>{xt(s.value)||s.value.destroy(),s.value=a(e.value,r.value)}),p.watch(r,(l,u)=>{(l.indexAxis!==u.indexAxis||JSON.stringify(l.scales.x.title)!==JSON.stringify(u.scales.x.title)||JSON.stringify(l.scales.y.title)!==JSON.stringify(u.scales.y.title))&&(xt(s.value)||s.value.destroy(),s.value=a(e.value,l))}),s}const $m=1e3,PA=1e4,Vm=1e6,Ym=1e9,qm=1e12,ao=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((s,a)=>{a&&a%3===0&&i.push(e),i.push(s)}),i.reverse().join("")},jr=(n,t,e)=>{const i=n/t,r=e.round?"round":"floor";if(e.decimal===!1)return Math[r](i).toString();let s;e.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function lo(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const r=t.min10k?PA:$m;return n<r||t.precision&&t.precision>Math.log10(n)?e=ao(jr(n,1,t),t):n<Vm?e=`${jr(n,$m,t)}k`:n<Ym?e=`${jr(n,Vm,t)}m`:n<qm?e=`${ao(jr(n,Ym,t),t)}b`:e=`${ao(jr(n,qm,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}lo.addCommas=ao;function IA(n,t,e){const{i18n:i}=Tt.useI18n(),{formatBytes:r}=ti({i18n:i}),{translateUnit:s}=Tt.useTranslatedUnits();return{legendValues:p.computed(()=>n.value.datasets.reduce((l,u)=>{const d=u.total?u.total:u.data.reduce((g,m)=>g+(typeof m=="number"?Number(m)||0:Number(m&&m.y)||0),0);let f;if(e.value==="bytes")f=r(d);else{const g=s(e.value,d);f=i&&i.t("legend.datapointValueDisplay",{value:lo(d,{capital:!0}),unit:g})||`${lo(d,{capital:!0})} ${e.value}`}return{...l,[u.label]:{raw:d,formatted:f,isThreshold:u.isThreshold}}},{}))}}function LA(n){return p.computed(()=>{if(!n.value?.meta)return"";const e=n.value.meta.start,i=n.value.meta.end;return e&&i?`${Lh(new Date(e))} - ${Lh(new Date(i),{includeTZ:!0})}`:""})}function NA(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};Ve.positioners[e]=function(s,a){if(!s.length||a.x===null||a.y===null)return!1;const l=this.chart.canvas.getBoundingClientRect(),u=n.tooltipState.width||this.width,d=l.width/2,f=Xa(a,u,d),g=a.y,m=a.x<d?"left":"center";return{x:f-n.tooltipState.offsetX,y:g,xAlign:m}};const r=p.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:s=>{ty(n.tooltipState,s)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return p.onUnmounted(()=>{Ve.positioners[e]&&delete Ve.positioners[e]}),{options:r}}function BA(n){const t=p.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const d=new Date(u);return vy({tickValue:d,granularity:n.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!xt(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value})),e=p.computed(()=>({title:{display:!xt(n.metricAxesTitle?.value),text:n.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value})),r=`lineChartTooltipPosition-${n.tooltipState.chartID}`,s={enabled:!1,position:r};Ve.positioners[r]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const f=this.chart.canvas.getBoundingClientRect(),g=n.tooltipState.width||this.width,m=n.tooltipState.height||this.height,_=f.width/2,x=f.height/2,S=Xa(d,g,_);let T=ey(d,m,x);const C=d.y<x?"top":"bottom",A=d.x<_?"left":"center";return m>f.height&&(T=0),{x:S,y:T,xAlign:A,yAlign:C}};const a=p.computed(()=>{const u=Number(n.timeRangeMs.value),d=new Date,f=new Date(d.getTime()-u);return _p(u)>24||f.getDate()!==d.getDate()}),l=p.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:n.pointsWithoutHover?.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...s,external:u=>{Cu(n.tooltipState,u,n.granularity.value)}},thresholdPlugin:{threshold:n.threshold?.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.onUnmounted(()=>{Ve.positioners[r]&&delete Ve.positioners[r]}),{options:l}}const FA=["usd","bytes"],zA="usd";function UA(n){const{i18n:t}=Tt.useI18n(),{formatUnit:e}=ti({i18n:t}),i=f=>{const g=n.metricUnit?.value;return!g||!FA.includes(g)?f:f===0&&g===zA?t.formatNumber(0,{style:"currency",currency:"USD"}):e(f,g)},r=p.computed(()=>{const f=Number(n.timeRangeMs.value),g=new Date,m=new Date(g.getTime()-f);return _p(f)>24||m.getDate()!==g.getDate()}),s=p.computed(()=>({type:"time",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:f=>vy({tickValue:new Date(f),granularity:n.granularity.value,dayBoundaryCrossed:r.value})},title:{display:!xt(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1}})),a=p.computed(()=>({title:{display:!xt(n.metricAxesTitle?.value),text:n.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5,callback:f=>i(f)},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1}})),u=`scatterChartTooltipPosition-${n.tooltipState.chartID}`;Ve.positioners[u]=function(f,g){if(!f.length||n.tooltipState.interactionMode==="interactive"||g.x===null||g.y===null)return!1;const m=this.chart.canvas.getBoundingClientRect(),_=n.tooltipState.width||this.width,x=n.tooltipState.height||this.height,S=m.width/2,T=m.height/2,C=Xa(g,_,S);let A=ey(g,x,T);const F=g.y<T?"top":"bottom",P=g.x<S?"left":"center";return x>m.height&&(A=0),{x:C,y:A,xAlign:P,yAlign:F}};const d=p.computed(()=>({hover:{mode:"nearest",intersect:!1},interaction:{mode:"nearest",intersect:!1},animation:{duration:250,easing:"linear"},scales:{x:s.value,y:a.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{enabled:!1,position:u,external:f=>{Cu(n.tooltipState,f,n.granularity.value)}},outlierBandPlugin:{value:n.outlierValue?.value,color:n.themeColors.value.outlierBand},referenceLinePlugin:{lines:n.referenceLines?.value}},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.onUnmounted(()=>{Ve.positioners[u]&&delete Ve.positioners[u]}),{options:d}}function HA(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:r,pivotRecords:s,rowLabels:a,colorPalette:l}=n,{i18n:u}=Tt.useI18n();return t?i.map(f=>({label:u&&u.te(`chartLabels.${f}`)&&u.t(`chartLabels.${f}`)||f,backgroundColor:Au(i.indexOf(f),li),data:a.map((g,m)=>e?s[`${g.id},${f}`]||0:s[`${m},${f}`]||null)})):Array.from(r).flatMap((f,g)=>{if(!f)return[];const m=Eu(g,f.name,f.id==="empty",l);return{label:u&&u.te(`chartLabels.${f.name}`)&&u.t(`chartLabels.${f.name}`)||f.name,backgroundColor:m,data:a.map(_=>s[`${_.id},${f.id}`]||null),isSegmentEmpty:f.id==="empty"}})}function WA(n,t){const{i18n:e}=Tt.useI18n();return p.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a}=t.value.meta,l=s&&Object.keys(s),u=a&&a.length>1,d=s&&l&&l.length>0,f=d&&l.length>1;if(!r.length||!a)return{datasets:[],labels:[]};const g=d&&l||a,m=g[0],_=g.length>1?g[1]:g[0],x=Object.fromEntries(u?r.flatMap(M=>a.map((O,B)=>{const W=M.event[m],J=d?`${W},${O}`:`${B},${O}`,ut=M.event[O];return[J,ut]})):r.map(M=>{const O=d?`${M.event[m]},${M.event[_]}`:`${m},${_}`,B=M.event[a[0]];return[O,B]})),S=Object.keys(x).reduce((M,O)=>{const[B]=O.split(","),W=x[O];return M[B]?M[B]+=W:M[B]=W,M},{}),T=Object.entries(S).sort(([,M],[,O])=>Number(O)-Number(M)).map(([M])=>M),C=s[m],A=s[_];let F=d&&C&&Object.entries(C).map(([M,O])=>({id:M,name:O.name}))||a.map(M=>({id:M,name:M})),P=d&&A&&Object.entries(A).map(([M,O])=>({id:M,name:O.name}))||a.map(M=>({id:M,name:M}));if(d&&m==="country_code"&&(F=F.map(M=>({...M,name:kc(M.id)||M.name}))),d&&_==="country_code"&&(P=P.map(M=>({...M,name:kc(M.id)||M.name}))),m!=="status_code"&&m!=="status_code_grouped"&&(F.sort((M,O)=>T.indexOf(M.id)-T.indexOf(O.id)),P.sort((M,O)=>T.indexOf(M.id)-T.indexOf(O.id))),!F||!P)return{labels:[],datasets:[]};const I=HA({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:g,barSegmentLabels:P,pivotRecords:x,rowLabels:F,colorPalette:n.colorPalette||li}),L=d?F.map(M=>e&&e.te(`chartLabels.${M.name}`)&&e.t(`chartLabels.${M.name}`)||M.name):a.map(M=>e&&e.te(`chartLabels.${M}`)&&e.t(`chartLabels.${M}`)||M),N=F.map(M=>M.id==="empty");return{labels:L,datasets:I,isLabelEmpty:N,isMultiDimension:f}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const $A=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),VA=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return bp(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},YA=(n,t,e,i,r)=>{const a=Math.max(t-6e4,Math.max(...(r||[]).map(d=>new Date(d.timestamp).valueOf()))),l=Math.floor((n-i)/e)*e+i,u=Math.floor((a-i)/e)*e+i+e;return $A(l,u,e)};function qA(n,t){const{i18n:e}=Tt.useI18n();return p.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a,start:l,end:u}=t.value.meta,d=new Date(l).getTime(),f=new Date(u).getTime();if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const g=s&&Object.keys(s)||a,m=g&&g[0],_=s?.[m],x=!!_&&a.length>1;let S=s&&_&&Object.keys(_).map(L=>({id:L,name:_[L].name}))||a.map(L=>({id:L,name:L}));m==="country_code"&&(S=S.map(L=>({...L,name:kc(L.id)||L.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(!r.length)return{datasets:[],labels:[]};const C=VA(d),A=YA(d,f,T,C,r),F=r?.length?r.reduce((L,N)=>{const w=new Date(N.timestamp).valueOf(),M=N.event;for(const O of a)w in L||(L[w]={}),O in L[w]||(L[w][O]={});for(const O of a)S.forEach(B=>{(_?M[m]===B.id:O===B.id)?(L[w][O]||(L[w][O]={}),L[w][O][B.id]=Math.round(Number(M[O])*1e3)/1e3):g.length||(L[w][O]||(L[w][O]={}),L[w][O][B.id]=Math.round(Number(M[B.id])*1e3)/1e3)});return L},{}):{},I=[..._||a.length===1?a.flatMap(L=>S.map(N=>[L,N.id,N.name,N.id==="empty"])):S.map(L=>[L.name,L.id,L.name,L.id==="empty"])].map(([L,N,w,M],O)=>{const B=A.map(rt=>rt in F&&L in F[rt]?{x:rt,y:F[rt][L][N]||0}:{x:rt,y:0});let{colorPalette:W,fill:J}=n;xt(W)&&(W=li);const ut=Eu(O,w,M,W),ft=Dy(w)?e.t(`chartLabels.${w}`):w,K=Dy(L)?e.t(`chartLabels.${L}`):L,nt=a.findIndex(rt=>rt===L);return{rawDimension:w,rawMetric:L,label:x?`${ft} — ${K}`:ft,borderColor:ut,backgroundColor:ut,data:B,total:B.reduce((rt,{y:it})=>rt+Number(it),0),...RE,...x?{borderDash:nt===0?[]:[nt*4,2]}:{},fill:J,borderWidth:J?IE:PE,isSegmentEmpty:M}});return m==="status_code"||m==="status_code_grouped"?I.sort((L,N)=>(L.label??"")<(N.label??"")?-1:1):I.sort((L,N)=>Number(L.total)<Number(N.total)?-1:1),{datasets:I}}}catch(r){return console.error(r),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const jA=2,GA=.6,jm=1,KA=2,Gm=50,XA=[6,4],ZA=[2,3],QA=n=>n?Math.random()*n:0;function JA(n,t){const{i18n:e}=Tt.useI18n(),i=(r,s)=>s||(r===Gm?e.t("scatter.median"):e.t("scatter.percentile",{value:r}));return p.computed(()=>{try{const r=t.value;if(!r?.points?.length)return{datasets:[]};const{metric:s,dimension:a,display:l}=r,u=n.scatter||{},d=u.jitterMs??0,f=u.pointRadius??jA,g=u.pointOpacity??GA,m=new Map,_=[];r.points.forEach(w=>{const M=w.group??s,O=m.get(M)||[];O.push({x:w.timestamp+QA(d),y:w.value,...w.extras?.length?{extras:w.extras}:{}}),m.set(M,O),_.push(w.value)});const x=u.percentileLines||[],S=[...x.map(w=>w.percentile),...u.outlierPercentile!==void 0?[u.outlierPercentile]:[]],T=S.length?SR(_,S):new Map,C=u.outlierPercentile!==void 0?T.get(u.outlierPercentile):void 0,A=C!==void 0&&Number.isFinite(C),F=xt(n.colorPalette)?li:n.colorPalette,P=n.themeColors?.value??Ja(),I=[],L=w=>{const M=w?.y;return A&&Number.isFinite(M)&&M>C};Array.from(m.entries()).forEach(([w,M],O)=>{const B=a&&l?.[w]?.name||w,W=w==="empty",J=Eu(O,B,W,F),ut=qu(J,g),ft=e.te(`chartLabels.${B}`)&&e.t(`chartLabels.${B}`)||B;I.push({type:"scatter",rawDimension:B,rawMetric:s,label:ft,borderColor:K=>L(K.raw)?P.outlier:J,backgroundColor:K=>L(K.raw)?P.outlier:ut,pointRadius:K=>L(K.raw)?f+jm:f,pointHoverRadius:K=>(L(K.raw)?f+jm:f)+KA,data:M,pointBorderWidth:0,showLine:!1,isSegmentEmpty:W})});const N=[];return x.forEach(w=>{const M=T.get(w.percentile);if(M===void 0||!Number.isFinite(M))return;const O=w.percentile===Gm;N.push({percentile:w.percentile,label:i(w.percentile,w.label),value:M,color:w.color||(O?P.medianLine:P.outlier),borderDash:w.borderDash||(O?XA:ZA)})}),{datasets:I,...A?{outlier:{value:C,label:e.t("scatter.outlier",{label:i(u.outlierPercentile)}),color:P.outlier}}:{},...N.length?{referenceLines:N}:{}}}catch(r){return console.warn(r),{datasets:[]}}})}const tE=(n,t)=>{p.watch([n,t],(e,i,r)=>{const[s,a]=e;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,s),r(()=>{window._AnalyticsChartDataInternal?.delete(a)}))},{immediate:!0})};function eE(){const{i18n:n}=Tt.useI18n();return{translateUnit:(e,i)=>{const r=i===1,s=`chartUnits.${e}`;return po(e)?"":n.te(s)?n.t(s,{plural:r?"":"s"}):e}}}const nE="analytics-query-provider",Km=2;function iE(){const n=p.inject(nE);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function Xm(n,t){return p.getCurrentScope()?(p.onScopeDispose(n,t),!0):!1}const Zm=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const rE=n=>n!=null,sE=Object.prototype.toString,oE=n=>sE.call(n)==="[object Object]";function qa(n){return Array.isArray(n)?n:[n]}function aE(n){return p.getCurrentInstance()}function lE(n,t={}){if(!p.isRef(n))return p.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=p.customRef(()=>({get(){return n.value[i]},set(r){var s;if(!((s=p.toValue(t.replaceRef))!==null&&s!==void 0)||s)if(Array.isArray(n.value)){const a=[...n.value];a[i]=r,n.value=a}else{const a={...n.value,[i]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=r}}));return e}function cE(n,t=!0,e){aE()?p.onMounted(n,e):t?n():p.nextTick(n)}function uE(n,t,e){return p.watch(n,t,{...e,immediate:!0})}const ja=Zm?window:void 0;function Gr(n){var t;const e=p.toValue(n);return(t=e?.$el)!==null&&t!==void 0?t:e}function co(...n){const t=(i,r,s,a)=>(i.addEventListener(r,s,a),()=>i.removeEventListener(r,s,a)),e=p.computed(()=>{const i=qa(p.toValue(n[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return uE(()=>{var i,r;return[(i=(r=e.value)===null||r===void 0?void 0:r.map(s=>Gr(s)))!==null&&i!==void 0?i:[ja].filter(s=>s!=null),qa(p.toValue(e.value?n[1]:n[0])),qa(p.unref(e.value?n[2]:n[1])),p.toValue(e.value?n[3]:n[2])]},([i,r,s,a],l,u)=>{if(!i?.length||!r?.length||!s?.length)return;const d=oE(a)?{...a}:a,f=i.flatMap(g=>r.flatMap(m=>s.map(_=>t(g,m,_,d))));u(()=>{f.forEach(g=>g())})},{flush:"post"})}function dE(){const n=p.shallowRef(!1),t=p.getCurrentInstance();return t&&p.onMounted(()=>{n.value=!0},t),n}function Qm(n){const t=dE();return p.computed(()=>(t.value,!!n()))}function fE(n,t,e={}){const{window:i=ja,...r}=e;let s;const a=Qm(()=>i&&"MutationObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=p.watch(p.computed(()=>{const g=qa(p.toValue(n)).map(Gr).filter(rE);return new Set(g)}),g=>{l(),a.value&&g.size&&(s=new MutationObserver(t),g.forEach(m=>s.observe(m,r)))},{immediate:!0,flush:"post"}),d=()=>s?.takeRecords(),f=()=>{u(),l()};return Xm(f),{isSupported:a,stop:f,takeRecords:d}}const Ga={speed:2,margin:30,direction:"both"};function hE(n){n.scrollLeft>n.scrollWidth-n.clientWidth&&(n.scrollLeft=Math.max(0,n.scrollWidth-n.clientWidth)),n.scrollTop>n.scrollHeight-n.clientHeight&&(n.scrollTop=Math.max(0,n.scrollHeight-n.clientHeight))}function pE(n,t={}){var e,i,r,s;const{pointerTypes:a,preventDefault:l,stopPropagation:u,exact:d,onMove:f,onEnd:g,onStart:m,initialValue:_,axis:x="both",draggingElement:S=ja,containerElement:T,handle:C=n,buttons:A=[0],restrictInView:F,autoScroll:P=!1}=t,I=p.ref((e=p.toValue(_))!==null&&e!==void 0?e:{x:0,y:0}),L=p.ref(),N=H=>a?a.includes(H.pointerType):!0,w=H=>{p.toValue(l)&&H.preventDefault(),p.toValue(u)&&H.stopPropagation()},M=p.toValue(P),O=typeof M=="object"?{speed:(i=p.toValue(M.speed))!==null&&i!==void 0?i:Ga.speed,margin:(r=p.toValue(M.margin))!==null&&r!==void 0?r:Ga.margin,direction:(s=M.direction)!==null&&s!==void 0?s:Ga.direction}:Ga,B=H=>typeof H=="number"?[H,H]:[H.x,H.y],W=(H,q,X)=>{const{clientWidth:_t,clientHeight:j,scrollLeft:V,scrollTop:st,scrollWidth:ot,scrollHeight:lt}=H,[pt,dt]=B(O.margin),[It,zt]=B(O.speed);let vt=0,Ct=0;(O.direction==="x"||O.direction==="both")&&(X.x<pt&&V>0?vt=-It:X.x+q.width>_t-pt&&V<ot-_t&&(vt=It)),(O.direction==="y"||O.direction==="both")&&(X.y<dt&&st>0?Ct=-zt:X.y+q.height>j-dt&&st<lt-j&&(Ct=zt)),(vt||Ct)&&H.scrollBy({left:vt,top:Ct,behavior:"auto"})};let J=null;const ut=()=>{const H=p.toValue(T);H&&!J&&(J=setInterval(()=>{const q=p.toValue(n).getBoundingClientRect(),{x:X,y:_t}=I.value,j={x:X-H.scrollLeft,y:_t-H.scrollTop};j.x>=0&&j.y>=0&&(W(H,q,j),j.x+=H.scrollLeft,j.y+=H.scrollTop,I.value=j)},1e3/60))},ft=()=>{J&&(clearInterval(J),J=null)},K=(H,q,X,_t)=>{const[j,V]=typeof X=="number"?[X,X]:[X.x,X.y],{clientWidth:st,clientHeight:ot}=q;return H.x<j||H.x+_t.width>st-j||H.y<V||H.y+_t.height>ot-V},nt=()=>{if(p.toValue(t.disabled)||!L.value)return;const H=p.toValue(T);if(!H)return;const q=p.toValue(n).getBoundingClientRect(),{x:X,y:_t}=I.value,j={x:X-H.scrollLeft,y:_t-H.scrollTop};K(j,H,O.margin,q)?ut():ft()};p.toValue(P)&&p.watch(I,nt);const rt=H=>{var q;if(!p.toValue(A).includes(H.button)||p.toValue(t.disabled)||!N(H)||p.toValue(d)&&H.target!==p.toValue(n))return;const X=p.toValue(T),_t=X==null||(q=X.getBoundingClientRect)===null||q===void 0?void 0:q.call(X),j=p.toValue(n).getBoundingClientRect(),V={x:H.clientX-(X?j.left-_t.left+(P?0:X.scrollLeft):j.left),y:H.clientY-(X?j.top-_t.top+(P?0:X.scrollTop):j.top)};m?.(V,H)!==!1&&(L.value=V,w(H))},it=H=>{if(p.toValue(t.disabled)||!N(H)||!L.value)return;const q=p.toValue(T);q instanceof HTMLElement&&hE(q);const X=p.toValue(n).getBoundingClientRect();let{x:_t,y:j}=I.value;if((x==="x"||x==="both")&&(_t=H.clientX-L.value.x,q&&(_t=Math.min(Math.max(0,_t),q.scrollWidth-X.width))),(x==="y"||x==="both")&&(j=H.clientY-L.value.y,q&&(j=Math.min(Math.max(0,j),q.scrollHeight-X.height))),p.toValue(P)&&q&&(J===null&&W(q,X,{x:_t,y:j}),_t+=q.scrollLeft,j+=q.scrollTop),q&&(F||P)){if(x!=="y"){const V=_t-q.scrollLeft;V<0?_t=q.scrollLeft:V>q.clientWidth-X.width&&(_t=q.clientWidth-X.width+q.scrollLeft)}if(x!=="x"){const V=j-q.scrollTop;V<0?j=q.scrollTop:V>q.clientHeight-X.height&&(j=q.clientHeight-X.height+q.scrollTop)}}I.value={x:_t,y:j},f?.(I.value,H),w(H)},at=H=>{p.toValue(t.disabled)||!N(H)||L.value&&(L.value=void 0,P&&ft(),g?.(I.value,H),w(H))};if(Zm){const H=()=>{var q;return{capture:(q=t.capture)!==null&&q!==void 0?q:!0,passive:!p.toValue(l)}};co(C,"pointerdown",rt,H),co(S,"pointermove",it,H),co(S,["pointerup","pointercancel"],at,H)}return{...lE(I),position:I,isDragging:p.computed(()=>!!L.value),style:p.computed(()=>`
|
|
4
|
-
left: ${
|
|
5
|
-
top: ${
|
|
6
|
-
${
|
|
7
|
-
`)}}function gE(n,t,e={}){const{window:i=ja,...r}=e;let s;const a=Qm(()=>i&&"ResizeObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=p.watch(p.computed(()=>{const f=p.toValue(n);return Array.isArray(f)?f.map(g=>Gr(g)):[Gr(f)]}),f=>{if(l(),a.value&&i){s=new ResizeObserver(t);for(const g of f)g&&s.observe(g,r)}},{immediate:!0,flush:"post"}),d=()=>{l(),u()};return Xm(d),{isSupported:a,stop:d}}function mE(n,t={}){const{reset:e=!0,windowResize:i=!0,windowScroll:r=!0,immediate:s=!0,updateTiming:a="sync"}=t,l=p.shallowRef(0),u=p.shallowRef(0),d=p.shallowRef(0),f=p.shallowRef(0),g=p.shallowRef(0),m=p.shallowRef(0),_=p.shallowRef(0),x=p.shallowRef(0);function S(){const C=Gr(n);if(!C){e&&(l.value=0,u.value=0,d.value=0,f.value=0,g.value=0,m.value=0,_.value=0,x.value=0);return}const A=C.getBoundingClientRect();l.value=A.height,u.value=A.bottom,d.value=A.left,f.value=A.right,g.value=A.top,m.value=A.width,_.value=A.x,x.value=A.y}function T(){a==="sync"?S():a==="next-frame"&&requestAnimationFrame(()=>S())}return gE(n,T),p.watch(()=>Gr(n),C=>!C&&T()),fE(n,T,{attributeFilter:["style","class"]}),r&&co("scroll",T,{capture:!0,passive:!0}),i&&co("resize",T,{passive:!0}),cE(()=>{s&&T()}),{height:l,bottom:u,left:d,right:f,top:g,width:m,x:_,y:x,update:T}}function yE(n,t){const{top:e,left:i}=mE(n),r=p.computed(()=>n.value?`${parseFloat(t.left)+i.value}px`:t.left),s=p.computed(()=>n.value?`${parseFloat(t.top)+e.value}px`:t.top);return{tooltipAbsoluteLeft:r,tooltipAbsoluteTop:s}}const _E=({bucketCount:n,minStamp:t,maxStamp:e,timestamps:i})=>{const r=[...i].filter(u=>u>=t&&u<=e).sort((u,d)=>u-d),s=[];if(e-t<n-2)return[];const a=(e-t)/n;let l=0;for(let u=0;u<n;u++){const d=t+u*a,f=t+(u+1)*a;let g=0;for(;l<r.length&&r[l]>=d&&r[l]<=f;)g++,l++;s.push([Math.ceil(d),g])}return s},Jm=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),uo=p.ref({}),bE=n=>(uo.value[n]||(uo.value[n]=Jm()),uo.value[n]),xE=(n,t)=>{const e=uo.value[t];if(!e)return;const i=e.minCounts[n]!==void 0||e.maxCounts[n]!==void 0||e.minStamps[n]!==void 0||e.maxStamps[n]!==void 0||e.renderPoints[n]!==void 0;e&&i&&(delete e.minCounts[n],delete e.maxCounts[n],delete e.minStamps[n],delete e.maxStamps[n],delete e.renderPoints[n],Object.keys(e.minCounts).length||Object.keys(e.maxCounts).length||Object.keys(e.minStamps).length||Object.keys(e.maxStamps).length||Object.keys(e.renderPoints).length||delete uo.value[t])};function wE({chartKey:n,datasets:t,groupKey:e,minStamp:i=void 0,maxStamp:r=void 0,minCount:s=void 0,maxCount:a=void 0,renderPoints:l=void 0,type:u}){const f=e!==void 0&&n!==void 0?bE(e):Jm(),g=n!==void 0?n:"static-chart-key",m=p.computed(()=>t.reduce((O,{timestamps:B})=>[...O,...B],[])),_=p.computed(()=>i||m.value.reduce((O,B)=>O===0?B:Math.min(O,B),0)),x=p.computed(()=>r||m.value.reduce((O,B)=>Math.max(O,B),0));p.watchEffect(()=>{f.minStamps[g]=_.value,f.maxStamps[g]=x.value,l!==void 0&&(f.renderPoints[g]=l)});const S=p.computed(()=>Object.values(f.minStamps).reduce((O,B)=>O===0?B:Math.min(O,B),0)),T=p.computed(()=>Object.values(f.maxStamps).reduce((O,B)=>Math.max(O,B),0)),C=p.computed(()=>{const O=Object.values(f.renderPoints);return O.length===0?24:O.reduce((B,W)=>Math.max(B,W),2)}),A=p.computed(()=>{const O=T.value-S.value;return Math.ceil(O/C.value)}),F=p.computed(()=>t.length>1),P=p.computed(()=>t.map(({timestamps:O,color:B,label:W})=>({data:_E({bucketCount:C.value,minStamp:S.value,maxStamp:T.value,timestamps:O}).map(([ft,K])=>({x:ft,y:K})),label:W,...(u==="sparkline_bar"||F.value)&&B&&{backgroundColor:B},...u!=="sparkline_bar"&&B&&{borderColor:B},...F.value&&u!=="sparkline_bar"&&{fill:!0}}))),I=p.computed(()=>{const O=P.value[0]?.data?.length??0,B=[];for(let W=0;W<O;W++){let J=0;for(let ut=0;ut<P.value.length;ut++)J+=P.value[ut].data[W].y;B.push(J)}return B}),L=p.computed(()=>{const O=I.value.reduce((B,W)=>Math.max(B,W),0);return Math.max(O,a??0)}),N=p.computed(()=>{const O=P.value.reduce((J,{data:ut})=>[...J,...ut.map(({y:ft})=>ft)],[]),B=O.length?O[0]:0,W=O.reduce((J,ut)=>Math.min(J,ut),B);return s===void 0?W:Math.min(W,s)});p.watchEffect(()=>{f.maxCounts[g]=L.value,f.minCounts[g]=N.value});const w=p.computed(()=>{const O=Object.values(f.minCounts),B=O.length?O[0]:0;return O.reduce((W,J)=>Math.min(W,J),B)}),M=p.computed(()=>Object.values(f.maxCounts).reduce((O,B)=>Math.max(O,B),0));return p.onUnmounted(()=>{n!==void 0&&e!==void 0&&xE(n,e)}),{syncedMinStamp:S,syncedMaxStamp:T,syncedRenderPoints:C,syncedChartDatasets:P,syncedGroupSizeMs:A,syncedMinCount:w,syncedMaxCount:M}}const Tt={useBarChartOptions:AA,useChartJSCommon:RA,useChartLegendValues:IA,useChartSelectedRange:LA,useExploreResultToDatasets:WA,useExploreResultToTimeDataset:qA,useScatterDatasets:JA,useDonutChartOptions:NA,useLineChartOptions:BA,useScatterChartOptions:UA,useI18n:pM,useReportChartDataForSynthetics:tE,useTranslatedUnits:eE,useEvaluateFeatureFlag:iE,useTooltipAbsolutePosition:yE,useSparklineSync:wE},Ka=n=>["interactive","zoom-interactive"].includes(n),Cu=(n,t,e,i)=>{const{tooltip:r}=t;if(r.opacity===0&&!Ka(n.interactionMode)){n.showTooltip=!1;return}const{i18n:s}=Tt.useI18n(),{formatUnit:a}=ti({i18n:s}),l=n.chartTooltipSortFn||((u,d)=>d.rawValue-u.rawValue);if(r.body&&!Ka(n.interactionMode)){const u=r.labelColors,d=t.chart.config?.options?.indexAxis==="y"?"x":"y",f=r.dataPoints[0].parsed.x??0;n.tooltipContext=i?.contextFormatter?i.contextFormatter(f,e):ho({tickValue:new Date(f),granularity:e}),n.tooltipSeries=r.dataPoints.map((m,_)=>{const x=m.parsed[d],S=a(x??0,n.units,{translateUnit:n.translateUnit}),T=m.raw?.tooltipLabel||m.dataset.label;return{backgroundColor:u[_].backgroundColor,borderColor:u[_].borderColor,label:T,value:S,rawValue:x,isSegmentEmpty:m.dataset.isSegmentEmpty}}).sort(l);const g=r.dataPoints[0]?.raw?.extras??[];for(const m of g)n.tooltipSeries.push({label:m.label,value:m.unit?a(Number(m.value)||0,m.unit,{translateUnit:n.translateUnit}):String(m.value),rawValue:Number(m.value)||0,isExtra:!0});n.left=`${r.x}px`,n.top=`${r.y}px`,n.showTooltip=!0}},ty=(n,t)=>{const{tooltip:e}=t,{i18n:i}=Tt.useI18n(),{formatUnit:r}=ti({i18n:i});if(e.opacity===0&&!Ka(n.interactionMode)){n.showTooltip=!1;return}const s=n.chartTooltipSortFn||((a,l)=>l.rawValue-a.rawValue);if(e.body&&!Ka(n.interactionMode)){const a=e.labelColors,l=t.chart.config?.options?.indexAxis==="y"?"x":"y",u=["gauge","donut"].includes(n.chartType);u?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((d,f)=>{const g=u?d.parsed:d.parsed[l],m=r(g??0,n.units,{translateUnit:n.translateUnit});let _;return u?_=d.dataset.labels[d.dataIndex]:_=d.dataset.label,{backgroundColor:a[f].backgroundColor,borderColor:a[f].borderColor,label:_,value:m,rawValue:g,isSegmentEmpty:d.dataset.isSegmentEmpty}}).sort(s),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},vE=n=>n&&n.datasets&&n.datasets.length,SE=n=>vE(n)&&n.datasets.some(t=>t.data.length),TE=n=>n.datasets.some(t=>t.data[0]&&Ec(t.data[0].x)),ME=n=>!!SE(n)&&n.datasets.some(t=>t.data.length==1),kE=n=>TE(n)&&n.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),Xa=(n,t,e)=>{const r=Math.min(t/1150,1),s=.15,a=1.15,l=n.x??0;return l<e?l+t*s*(1-r):l-t*a*(1-r)},ey=(n,t,e)=>{const s=n.y??0;return s<e?s+t*.15:s-t*.5};function ny(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Ou=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(r=>!t?.[r.text]?.isThreshold).map(((r,s)=>({...r,value:t&&t[r.text],isSegmentEmpty:i.datasets[s].isSegmentEmpty}))).sort(e)},DE=2,iy=10,ry=12,Za=10,li=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Au=(n,t)=>(t||li)[n%li.length],CE="#6f7787",OE={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"}},AE=n=>{const t=Math.floor(parseInt(n,10)/100)*100;return OE[t]?.background||"#fafafa"},EE=uv,Eu=(n,t,e,i)=>{let r;return e?r=EE:Array.isArray(i)?r=Au(n,i):r=i[t],r||Au(n)},Ru=n=>{switch(n){case"error":return dv;case"warning":return gv;case"neutral":return Vh;default:return Vh}},RE={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},PE=2,IE=0,Pu=new Map,sy=(n,t)=>{const{i18n:e}=Tt.useI18n(),{formatBytes:i}=ti({i18n:e});return t==="bytes"?i(n):t==="count/minute"?n.toFixed(2):la.format(n)},LE=n=>{const e=document.createElement("canvas").getContext("2d"),i=le({});return e.font=i.string,e.measureText(n).width},NE=()=>{const n="label_height";if(!Pu.has(n)){const t=le({});Pu.set(n,t.lineHeight)}return Pu.get(n)},BE=(n,t)=>t.datasets.reduce((e,i,r)=>n.isDatasetVisible(r)?e+i.data.reduce((s,a)=>isNaN(a)?s:s+a,0):e,0),FE=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,zE=cv,UE={100:_v,101:bv,102:xv,103:wv,200:vv,201:Sv,202:Tv,203:Mv,204:kv,205:Dv,206:Cv,207:Ov,208:Av,226:Ev,300:Rv,301:Pv,302:Iv,303:Lv,304:Nv,305:Bv,307:Fv,308:zv,400:Uv,401:Hv,402:Wv,403:$v,404:Vv,405:Yv,406:qv,407:jv,408:Gv,409:Kv,410:Xv,411:Zv,412:Qv,413:Jv,414:t1,415:e1,416:n1,417:i1,418:r1,421:s1,422:o1,423:a1,424:l1,425:c1,426:u1,428:d1,429:f1,431:h1,451:p1,500:g1,501:m1,502:y1,503:_1,504:b1,505:x1,506:w1,507:v1,508:S1,510:T1,511:M1},HE={100:k1,200:D1,300:C1,400:O1,500:A1},WE={"1XX":E1,"2XX":R1,"3XX":P1,"4XX":I1,"5XX":L1},oy=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100;return UE[t]??HE[e]??zE},Iu={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=oy(`${t}`),n),{}),____OTHER____:lv,...WE};function ay(n,t,e){const i=hp(),r=YE(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?$E(r,t):VE(r,t)}function $E(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function VE(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function YE(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function qE(n,t){const e=ZE(t);return"formatToParts"in e?GE(e,n):KE(e,n)}const jE={year:0,month:1,day:2,hour:3,minute:4,second:5};function GE(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=jE[e[r].type];s!==void 0&&(i[s]=parseInt(e[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function KE(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Lu={},ly=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")),XE=ly==="06/25/2014, 00:00:00"||ly==="06/25/2014 00:00:00";function ZE(n){return Lu[n]||(Lu[n]=XE?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Lu[n]}function cy(n,t,e,i,r,s,a){const l=new Date(0);return l.setUTCFullYear(n,t,e),l.setUTCHours(i,r,s,a),l}const uy=36e5,QE=6e4,Nu={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Bu(n,t,e){if(!n)return 0;let i=Nu.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=Nu.timezoneHH.exec(n),i)return r=parseInt(i[1],10),dy(r)?-(r*uy):NaN;if(i=Nu.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return dy(r,a)?(s=Math.abs(r)*uy+a*QE,i[1]==="+"?-s:s):NaN}if(eR(n)){t=new Date(t||Date.now());const a=e?t:JE(t),l=Fu(a,n);return-(e?l:tR(t,l,n))}return NaN}function JE(n){return cy(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Fu(n,t){const e=qE(n,t),i=cy(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let r=n.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function tR(n,t,e){let r=n.getTime()-t;const s=Fu(new Date(r),e);if(t===s)return t;r-=s-t;const a=Fu(new Date(r),e);return s===a?s:Math.max(s,a)}function dy(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const fy={};function eR(n){if(fy[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),fy[n]=!0,!0}catch{return!1}}const nR=60*1e3,iR={X:function(n,t,e){const i=zu(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return hy(i);case"XXXX":case"XX":return Kr(i);default:return Kr(i,":")}},x:function(n,t,e){const i=zu(e.timeZone,n);switch(t){case"x":return hy(i);case"xxxx":case"xx":return Kr(i);default:return Kr(i,":")}},O:function(n,t,e){const i=zu(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+rR(i,":");default:return"GMT"+Kr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return ay("short",n,e);default:return ay("long",n,e)}}};function zu(n,t){const e=n?Bu(n,t,!0)/nR:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Qa(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Kr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Qa(Math.floor(i/60),2),s=Qa(Math.floor(i%60),2);return e+r+t+s}function hy(n,t){return n%60===0?(n>0?"-":"+")+Qa(Math.abs(n)/60,2):Kr(n,t)}function rR(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Qa(s,2)}function py(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const sR=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Uu=36e5,gy=6e4,oR=2,Xe={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:sR};function my(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?oR:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=aR(n),{year:r,restDateString:s}=lR(i.date,e),a=cR(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const l=a.getTime();let u=0,d;if(i.time&&(u=uR(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Bu(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=py(new Date(l+u)),d=py(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function aR(n){const t={};let e=Xe.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Xe.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=Xe.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function lR(n,t){if(n){const e=Xe.YYY[t],i=Xe.YYYYY[t];let r=Xe.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=Xe.YY.exec(n)||e.exec(n),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}}return{year:null}}function cR(n,t){if(t===null)return null;let e,i,r;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let s=Xe.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,by(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=Xe.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return hR(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=Xe.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return by(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=Xe.Www.exec(n),s)return r=parseInt(s[1],10)-1,xy(r)?yy(t,r):new Date(NaN);if(s=Xe.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return xy(r,a)?yy(t,r,a):new Date(NaN)}return null}function uR(n){let t,e,i=Xe.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Hu(t)?t%24*Uu:NaN;if(i=Xe.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Hu(t,e)?t%24*Uu+e*gy:NaN;if(i=Xe.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Hu(t,e,r)?t%24*Uu+e*gy+r*1e3:NaN}return null}function yy(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const dR=[31,28,31,30,31,30,31,31,30,31,30,31],fR=[31,29,31,30,31,30,31,31,30,31,30,31];function _y(n){return n%400===0||n%4===0&&n%100!==0}function by(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=_y(n);if(i&&e>fR[t]||!i&&e>dR[t])return!1}return!0}function hR(n,t){if(t<1)return!1;const e=_y(n);return!(e&&t>366||!e&&t>365)}function xy(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Hu(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const pR=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Wu(n,t,e={}){t=String(t);const i=t.match(pR);if(i){const r=my(e.originalDate||n,e);t=i.reduce(function(s,a){if(a[0]==="'")return s;const l=s.indexOf(a),u=s[l-1]==="'",d=s.replace(a,"'"+iR[a[0]](r,a,e)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return da(n,t,e)}function gR(n,t,e){n=my(n,e);const i=Bu(t,n,!0),r=new Date(n.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function fo(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Wu(gR(n,t,{timeZone:i.timeZone}),e,i)}const mR=(n,t)=>`${fo(n,t,"yyyy")} W${fo(n,t,"II")}`,$u="yyyy-MM-dd h:mm:ss a",Vu="h:mm:ss a",pr="yyyy-MM-dd h:mm a",Xr="h:mm a",yR="yyyy-MM-dd",Yu="MMM dd, yyyy h:mm:ss a",Li="MMM dd, yyyy h:mm a",_R={secondly:n=>n?$u:Vu,tenSecondly:n=>n?$u:Vu,thirtySecondly:n=>n?$u:Vu,minutely:n=>n?pr:Xr,fiveMinutely:n=>n?pr:Xr,tenMinutely:n=>n?pr:Xr,thirtyMinutely:n=>n?pr:Xr,hourly:n=>n?pr:Xr,twoHourly:n=>n?pr:Xr,twelveHourly:()=>pr,daily:()=>yR},bR={secondly:()=>Yu,tenSecondly:()=>Yu,thirtySecondly:()=>Yu,minutely:()=>Li,fiveMinutely:()=>Li,tenMinutely:()=>Li,thirtyMinutely:()=>Li,hourly:()=>Li,twoHourly:()=>Li,twelveHourly:()=>Li,daily:()=>Li};function wy({tickValue:n,granularity:t,timezone:e,dayBoundaryCrossed:i=!1,tickMap:r,tooltipMap:s,defaultFormat:a}){const l=e||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return mR(n,l);if(r&&r[t]){const u=r[t](i);return fo(n,l,u)}if(s&&s[t]){const u=s[t]();return fo(n,l,u)}return fo(n,l,a)}const vy=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>wy({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:_R,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),ho=({tickValue:n,granularity:t,timezone:e})=>wy({tickValue:n,granularity:t,timezone:e,tooltipMap:bR,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),Sy=n=>n?.code==="ERR_CANCELED"||n?.name==="CanceledError"||n?.name==="AbortError",xR=n=>{const{i18n:t}=Tt.useI18n();return Sy(n)?{type:"canceled",message:t.t("query_errors.canceled.message")}:n?.status===403?{status:n.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:n?.status===408||n?.message?.includes("timeout")?{status:n.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:n?.response?.data?.message==="Range not allowed for this tier"?{status:n.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:n.status,type:"other",message:t.t("query_errors.other.message"),details:n.response?.data?.invalid_parameters?.map(e=>e.reason).join(", ")||n?.message}},po=n=>n.toLocaleLowerCase().endsWith("count"),wR=n=>{const t=n.toLocaleLowerCase();return["sum","count","cost","tokens"].some(e=>t.endsWith(e))},vR=(n,t)=>{if(!n.length)return NaN;const i=Math.min(100,Math.max(0,t))/100*(n.length-1),r=Math.floor(i),s=Math.ceil(i);return r===s?n[r]:n[r]+(n[s]-n[r])*(i-r)},SR=(n,t)=>{const e=n.filter(i=>Number.isFinite(i)).sort((i,r)=>i-r);return new Map(t.map(i=>[i,vR(e,i)]))},Ty=.7,qu=(n,t)=>{const e=Ta(n.trim());return e.valid?e.alpha(t).rgbString():n},Ja=n=>{const t=n??(typeof document>"u"?null:document.documentElement);if(typeof window>"u"||!t)return{medianLine:Yh,outlier:Wh,outlierBand:qu($h,Ty)};const e=window.getComputedStyle(t),i=(r,s)=>e.getPropertyValue(r).trim()||s;return{medianLine:i("--kui-color-text",Yh),outlier:i("--kui-color-background-danger",Wh),outlierBand:qu(i("--kui-color-background-danger-weakest",$h),Ty)}},TR="empty",My=n=>{if(!n||!("meta"in n)||!("data"in n))return;const{display:t,metric_names:e,metric_units:i,start:r,end:s,truncated:a,limit:l,datasource:u}=n.meta;if(!e?.length){console.error("Cannot build scatter chart data from this explore result. Missing metric names.");return}const d=e[0],f=t&&Object.keys(t)[0]||void 0,g=n.data??[],m=[];for(const _ of g){const x=ky(_.timestamp,_.event[d],f?_.event[f]:void 0);x&&m.push(x)}return{points:m,metric:d,metricUnit:i?.[d],dimension:f,display:f?t?.[f]:void 0,start:r,end:s,truncated:a,limit:l,datasource:u}},ky=(n,t,e,i)=>{if(t==null||t==="")return;const r=new Date(n).valueOf(),s=Number(t);if(!Number.isFinite(r)||!Number.isFinite(s))return;const a=i?.length?{extras:i}:{};return e===void 0?{timestamp:r,value:s,...a}:{timestamp:r,value:s,group:e!==null&&e!==""?String(e):TR,...a}},MR=(n,t,e)=>{if(!e?.length)return;const i=[];for(const{field:r,label:s,unit:a}of e){const l=Ni(n,r)??Ni(t,r);l==null||l===""||i.push({label:s??r,value:l,...a?{unit:a}:{}})}return i.length?i:void 0},kR=(n,t)=>{if(!n||!("meta"in n))return;const{metric:e,dimension:i,unroll:r,display:s,extraFields:a,metricUnit:l}=t,u=t.timestamp??"request_start";if(!e){console.error("Cannot build scatter chart data from these request records. Missing metric.");return}const d=[];for(const f of n.results??[]){const g=Ni(f,u);for(const m of DR(f,r)){const _=Ni(m,e)??Ni(f,e),x=i?Ni(m,i)??Ni(f,i):void 0,S=ky(g,_,i?x??null:void 0,MR(m,f,a));S&&d.push(S)}}return{points:d,metric:e,metricUnit:l,dimension:i,display:s,start:n.meta?.time_range?.start,end:n.meta?.time_range?.end,truncated:n.truncated,limit:n.limit,datasource:"requests"}},DR=(n,t)=>{if(!t)return[n];const e=Ni(n,t);return Array.isArray(e)?e:[]},Ni=(n,t)=>{let e=n;for(const i of t.split(".")){if(e===null||typeof e!="object")return;e=e[i]}return e},Dy=n=>Object.hasOwn(wp.chartLabels,n),CR=["hidden","single","full"];var gr=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(gr||{});const OR=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar","scatter"],AR=["gauge","top_n","single_value"],tl=n=>n===null||typeof n!="object"||!("points"in n)?!1:Array.isArray(n.points);var Pe=(n=>(n.Hidden="hidden",n.Bottom="bottom",n))(Pe||{});const Cy={modes:{point(n,t){return el(n,t,{intersect:!0})},nearest(n,t,e){return PR(n,t,e)},x(n,t,e){return el(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return el(n,t,{intersect:e.intersect,axis:"y"})}}};function ju(n,t,e){return(Cy.modes[e.mode]||Cy.modes.nearest)(n,t,e)}function ER(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function RR(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function el(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):ER(i,t,e.axis))}function PR(n,t,e){let i=Number.POSITIVE_INFINITY;return el(n,t,e).reduce((r,s)=>{const a=s.getCenterPoint(),l=RR(t,a,e.axis),u=Hr(t,l);return u<i?(r=[s],i=u):u===i&&r.push(s),r},[]).sort((r,s)=>r._index-s._index).slice(0,1)}function mr(n,t,e){const i=Math.cos(e),r=Math.sin(e),s=t.x,a=t.y;return{x:s+i*(n.x-s)-r*(n.y-a),y:a+r*(n.x-s)+i*(n.y-a)}}const IR=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,yr=.001,nl=(n,t,e)=>Math.min(e,Math.max(t,n)),Oy=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function LR(n,t,e){for(const i of Object.keys(n))n[i]=nl(n[i],t,e);return n}function NR(n,t,e,i){return!n||!t||e<=0?!1:Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function Ay(n,{x:t,y:e,x2:i,y2:r},s,{borderWidth:a,hitTolerance:l}){const u=(a+l)/2,d=n.x>=t-u-yr&&n.x<=i+u+yr,f=n.y>=e-u-yr&&n.y<=r+u+yr;return s==="x"?d:(s==="y"||d)&&f}function Ey(n,{rect:t,center:e},i,{rotation:r,borderWidth:s,hitTolerance:a}){const l=mr(n,e,xe(-r));return Ay(l,t,i,{borderWidth:s,hitTolerance:a})}function _r(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function BR(n,t,e,i=!0){const r=e.split(".");let s=0;for(const a of t.split(".")){const l=r[s++];if(parseInt(a,10)<parseInt(l,10))break;if(IR(l,a)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const Ry=n=>typeof n=="string"&&n.endsWith("%"),Py=n=>parseFloat(n)/100,Iy=n=>nl(Py(n),0,1),go=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),FR={box:n=>go(n.centerX,n.centerY),doughnutLabel:n=>go(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>go(n.centerX,n.centerY),line:n=>go(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>go(n.centerX,n.centerY)};function Gu(n,t){return t==="start"?0:t==="end"?n:Ry(t)?Iy(t)*n:n/2}function Bi(n,t,e=!0){return typeof t=="number"?t:Ry(t)?(e?Iy(t):Py(t))*n:n}function zR(n,t){const{x:e,width:i}=n,r=t.textAlign;return r==="center"?e+i/2:r==="end"||r==="right"?e+i:e}function Ly(n,t,{borderWidth:e,position:i,xAdjust:r,yAdjust:s},a){const l=Pt(a),u=t.width+(l?a.width:0)+e,d=t.height+(l?a.height:0)+e,f=Ku(i),g=zy(n.x,u,r,f.x),m=zy(n.y,d,s,f.y);return{x:g,y:m,x2:g+u,y2:m+d,width:u,height:d,centerX:g+u/2,centerY:m+d/2}}function Ku(n,t="center"){return Pt(n)?{x:kt(n.x,t),y:kt(n.y,t)}:(n=kt(n,t),{x:n,y:n})}const Ny=(n,t)=>n&&n.autoFit&&t<1;function By(n,t){const e=n.font,i=qt(e)?e:[e];return Ny(n,t)?i.map(function(r){const s=le(r);return s.size=Math.floor(r.size*t),s.lineHeight=r.lineHeight,le(s)}):i.map(r=>le(r))}function Fy(n){return n&&(en(n.xValue)||en(n.yValue))}function zy(n,t,e=0,i){return n-Gu(t,i)+e}function Zr(n,t,e){const i=e.init;if(i){if(i===!0)return Hy(t,e)}else return;return UR(n,t,e)}function Uy(n,t,e){let i=!1;return t.forEach(r=>{nn(n[r])?(i=!0,e[r]=n[r]):en(e[r])&&delete e[r]}),i}function Hy(n,t){const e=t.type||"line";return FR[e](n)}function UR(n,t,e){const i=Qt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return Hy(t,e);if(Pt(i))return i}const Xu=new Map,HR=n=>isNaN(n)||n<=0,WR=n=>n.reduce(function(t,e){return t+=e.string,t},"");function il(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function rl(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(xe(i)),n.translate(-t,-e))}function ci(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function Qr(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function sl(n,t){const e=t.content;if(il(e))return{width:Bi(e.width,t.width),height:Bi(e.height,t.height)};const i=By(t),r=t.textStrokeWidth,s=qt(e)?e:[e],a=s.join()+WR(i)+r+(n._measureText?"-spriting":"");return Xu.has(a)||Xu.set(a,qR(n,s,i,r)),Xu.get(a)}function Wy(n,t,e){const{x:i,y:r,width:s,height:a}=t;n.save(),Qr(n,e);const l=ci(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),Wr(n,{x:i,y:r,w:s,h:a,radius:LR(Oi(e.borderRadius),0,Math.min(s,a)/2)}),n.closePath(),n.fill(),l&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function $y(n,t,e,i){const r=e.content;if(il(r)){n.save(),n.globalAlpha=KR(e.opacity,r.style.opacity),n.drawImage(r,t.x,t.y,t.width,t.height),n.restore();return}const s=qt(r)?r:[r],a=By(e,i),l=e.color,u=qt(l)?l:[l],d=zR(t,e),f=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,$R(n,e)&&jR(n,{x:d,y:f},s,a),GR(n,{x:d,y:f},s,{fonts:a,colors:u}),n.restore()}function $R(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function VR(n,t,e,i){const{radius:r,options:s}=t,a=s.pointStyle,l=s.rotation;let u=(l||0)*qc;if(il(a)){n.save(),n.translate(e,i),n.rotate(u),n.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),n.restore();return}HR(r)||YR(n,{x:e,y:i,radius:r,rotation:l,style:a,rad:u})}function YR(n,{x:t,y:e,radius:i,rotation:r,style:s,rad:a}){let l,u,d,f;switch(n.beginPath(),s){default:n.arc(t,e,i,0,te),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=xa,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=xa,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),n.closePath();break;case"rectRounded":f=i*.516,d=i-f,l=Math.cos(a+kn)*d,u=Math.sin(a+kn)*d,n.arc(t-l,e-u,f,a-Et,a-re),n.arc(t+u,e-l,f,a-re,a),n.arc(t+l,e+u,f,a,a+re),n.arc(t-u,e+l,f,a+re,a+Et),n.closePath();break;case"rect":if(!r){d=Math.SQRT1_2*i,n.rect(t-d,e-d,2*d,2*d);break}a+=kn;case"rectRot":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+u,e-l),n.lineTo(t+l,e+u),n.lineTo(t-u,e+l),n.closePath();break;case"crossRot":a+=kn;case"cross":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u),n.moveTo(t+u,e-l),n.lineTo(t-u,e+l);break;case"star":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u),n.moveTo(t+u,e-l),n.lineTo(t-u,e+l),a+=kn,l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u),n.moveTo(t+u,e-l),n.lineTo(t-u,e+l);break;case"line":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(a)*i,e+Math.sin(a)*i);break}n.fill()}function qR(n,t,e,i){n.save();const r=t.length;let s=0,a=i;for(let l=0;l<r;l++){const u=e[Math.min(l,e.length-1)];n.font=u.string;const d=t[l];s=Math.max(s,n.measureText(d).width+i),a+=u.lineHeight}return n.restore(),{width:s,height:a}}function jR(n,{x:t,y:e},i,r){n.beginPath();let s=0;i.forEach(function(a,l){const u=r[Math.min(l,r.length-1)],d=u.lineHeight;n.font=u.string,n.strokeText(a,t,e+d/2+s),s+=d}),n.stroke()}function GR(n,{x:t,y:e},i,{fonts:r,colors:s}){let a=0;i.forEach(function(l,u){const d=s[Math.min(u,s.length-1)],f=r[Math.min(u,r.length-1)],g=f.lineHeight;n.beginPath(),n.font=f.string,n.fillStyle=d,n.fillText(l,t,e+g/2+a),a+=g,n.fill()})}function KR(n,t){const e=Ci(n)?n:t;return Ci(e)?nl(e,0,1):1}const Vy=["left","bottom","top","right"];function XR(n,t){const{pointX:e,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&eP(t,s);if(!a||iP(t,s,a))return;if(n.save(),n.beginPath(),!ci(n,s))return n.restore();const{separatorStart:u,separatorEnd:d}=ZR(t,a),{sideStart:f,sideEnd:g}=JR(t,a,u);(s.margin>0||r.borderWidth===0)&&(n.moveTo(u.x,u.y),n.lineTo(d.x,d.y)),n.moveTo(f.x,f.y),n.lineTo(g.x,g.y);const m=mr({x:e,y:i},t.getCenterPoint(),xe(-t.rotation));n.lineTo(m.x,m.y),n.stroke(),n.restore()}function ZR(n,t){const{x:e,y:i,x2:r,y2:s}=n,a=QR(n,t);let l,u;return t==="left"||t==="right"?(l={x:e+a,y:i},u={x:l.x,y:s}):(l={x:e,y:i+a},u={x:r,y:l.y}),{separatorStart:l,separatorEnd:u}}function QR(n,t){const{width:e,height:i,options:r}=n,s=r.callout.margin+r.borderWidth/2;return t==="right"?e+s:t==="bottom"?i+s:-s}function JR(n,t,e){const{y:i,width:r,height:s,options:a}=n,l=a.callout.start,u=tP(t,a.callout);let d,f;return t==="left"||t==="right"?(d={x:e.x,y:i+Bi(s,l)},f={x:d.x+u,y:d.y}):(d={x:e.x+Bi(r,l),y:e.y},f={x:d.x,y:d.y+u}),{sideStart:d,sideEnd:f}}function tP(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function eP(n,t){const e=t.position;return Vy.includes(e)?e:nP(n,t)}function nP(n,t){const{x:e,y:i,x2:r,y2:s,width:a,height:l,pointX:u,pointY:d,centerX:f,centerY:g,rotation:m}=n,_={x:f,y:g},x=t.start,S=Bi(a,x),T=Bi(l,x),C=[e,e+S,e+S,r],A=[i+T,s,i,s],F=[];for(let P=0;P<4;P++){const I=mr({x:C[P],y:A[P]},_,xe(m));F.push({position:Vy[P],distance:Hr(I,{x:u,y:d})})}return F.sort((P,I)=>P.distance-I.distance)[0].position}function iP(n,t,e){const{pointX:i,pointY:r}=n,s=t.margin;let a=i,l=r;return e==="left"?a+=s:e==="right"?a-=s:e==="top"?l+=s:e==="bottom"&&(l-=s),n.inRange(a,l)}const Yy={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 Jr(n,t,e){return t=typeof t=="number"?t:n.parse(t),ae(t)?n.getPixelForValue(t):e}function br(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const r=e.charAt(0),s=Object.values(n).filter(a=>a.axis&&a.axis===r);return s.length?s[0].id:r}function qy(n,t){if(n){const e=n.options.reverse,i=Jr(n,t.min,e?t.end:t.start),r=Jr(n,t.max,e?t.start:t.end);return{start:i,end:r}}}function jy(n,t){const{chartArea:e,scales:i}=n,r=i[br(i,t,"xScaleID")],s=i[br(i,t,"yScaleID")];let a=e.width/2,l=e.height/2;return r&&(a=Jr(r,t.xValue,r.left+r.width/2)),s&&(l=Jr(s,t.yValue,s.top+s.height/2)),{x:a,y:l}}function Zu(n,t){const e=n.scales,i=e[br(e,t,"xScaleID")],r=e[br(e,t,"yScaleID")];if(!i&&!r)return{};let{left:s,right:a}=i||n.chartArea,{top:l,bottom:u}=r||n.chartArea;const d=Xy(i,{min:t.xMin,max:t.xMax,start:s,end:a});s=d.start,a=d.end;const f=Xy(r,{min:t.yMin,max:t.yMax,start:u,end:l});return l=f.start,u=f.end,{x:s,y:l,x2:a,y2:u,width:a-s,height:u-l,centerX:s+(a-s)/2,centerY:l+(u-l)/2}}function Gy(n,t){if(!Fy(t)){const e=Zu(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const r=i*2,s=e.centerX+t.xAdjust,a=e.centerY+t.yAdjust;return{x:s-i,y:a-i,x2:s+i,y2:a+i,centerX:s,centerY:a,width:r,height:r,radius:i}}return sP(n,t)}function rP(n,t){const{scales:e,chartArea:i}=n,r=e[t.scaleID],s={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return r?oP(r,s,t):aP(e,s,t),s}function Ky(n,t){const e=Zu(n,t);return e.initProperties=Zr(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:uP(n,e,t),initProperties:e.initProperties}],e}function sP(n,t){const e=jy(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function Xy(n,t){const e=qy(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function oP(n,t,e){const i=Jr(n,e.value,NaN),r=Jr(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function aP(n,t,e){for(const i of Object.keys(Yy)){const r=n[br(n,e,i)];if(r){const{min:s,max:a,start:l,end:u,startProp:d,endProp:f}=Yy[i],g=qy(r,{min:e[s],max:e[a],start:r[l],end:r[u]});t[d]=g.start,t[f]=g.end}}}function lP({properties:n,options:t},e,i,r){const{x:s,x2:a,width:l}=n;return Zy({start:s,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:r.left,end:r.right},adjust:t.label.xAdjust,size:e.width})}function cP({properties:n,options:t},e,i,r){const{y:s,y2:a,height:l}=n;return Zy({start:s,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:r.top,end:r.bottom},adjust:t.label.yAdjust,size:e.height})}function Zy(n,t){const{start:e,end:i,borderWidth:r}=n,{position:s,padding:{start:a,end:l},adjust:u}=t,d=i-r-e-a-l-t.size;return e+r/2+u+Gu(d,s)}function uP(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const r=Ku(i.position),s=we(i.padding),a=sl(n.ctx,i),l=lP({properties:t,options:e},a,r,s),u=cP({properties:t,options:e},a,r,s),d=a.width+s.width,f=a.height+s.height;return{x:l,y:u,x2:l+d,y2:u+f,width:d,height:f,centerX:l+d/2,centerY:u+f/2,rotation:i.rotation}}const Qu=["enter","leave"],Ju=Qu.concat("click");function dP(n,t,e){t.listened=Uy(e,Ju,t.listeners),t.moveListened=!1,Qu.forEach(i=>{nn(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&nn(i.click)&&(t.listened=!0),t.moveListened||Qu.forEach(r=>{nn(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function fP(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return hP(n,t,e);case"click":return pP(n,t,e)}}function hP(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=ju(n.visibleElements,t,e.interaction):i=[];const r=n.hovered;n.hovered=i;const s={state:n,event:t};let a=Qy(s,"leave",r,i);return Qy(s,"enter",i,r)||a}function Qy({state:n,event:t},e,i,r){let s;for(const a of i)r.indexOf(a)<0&&(s=Jy(a.options[e]||n.listeners[e],a,t)||s);return s}function pP(n,t,e){const i=n.listeners,r=ju(n.visibleElements,t,e.interaction);let s;for(const a of r)s=Jy(a.options.click||i.click,a,t)||s;return s}function Jy(n,t,e){return Qt(n,[t.$context,e])===!0}const ol=["afterDraw","beforeDraw"];function gP(n,t,e){const i=t.visibleElements;t.hooked=Uy(e,ol,t.hooks),t.hooked||i.forEach(r=>{t.hooked||ol.forEach(s=>{nn(r.options[s])&&(t.hooked=!0)})})}function t_(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return Qt(i,[t.$context])}}function mP(n,t,e){const i=wP(n.scales,t,e);let r=e_(t,i,"min","suggestedMin");r=e_(t,i,"max","suggestedMax")||r,r&&nn(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function yP(n,t){for(const e of n)bP(e,t)}function e_(n,t,e,i){if(ae(t[e])&&!_P(n.options,e,i)){const r=n[e]!==t[e];return n[e]=t[e],r}}function _P(n,t,e){return en(n[t])||en(n[e])}function bP(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=br(t,n,e);i&&!t[i]&&xP(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function xP(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(en(n[e+i]))return!0;return!1}function wP(n,t,e){const i=t.axis,r=t.id,s=i+"ScaleID",a={min:kt(t.min,Number.NEGATIVE_INFINITY),max:kt(t.max,Number.POSITIVE_INFINITY)};for(const l of e)l.scaleID===r?n_(l,t,["value","endValue"],a):br(n,l,s)===r&&n_(l,t,[i+"Min",i+"Max",i+"Value"],a);return a}function n_(n,t,e,i){for(const r of e){const s=n[r];if(en(s)){const a=t.parse(s);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class ts extends $e{inRange(t,e,i,r){const{x:s,y:a}=mr({x:t,y:e},this.getCenterPoint(r),xe(-this.options.rotation));return Ay({x:s,y:a},this.getProps(["x","y","x2","y2"],r),i,this.options)}getCenterPoint(t){return _r(this,t)}draw(t){t.save(),rl(t,this.getCenterPoint(),this.options.rotation),Wy(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Ky(t,e)}}ts.id="boxAnnotation",ts.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},ts.defaultRoutes={borderColor:"color",backgroundColor:"color"},ts.descriptors={label:{_fallback:!0}};class al extends $e{inRange(t,e,i,r){return Ey({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return _r(this,t)}draw(t){const e=this.options;!e.display||!e.content||(DP(t,this),t.save(),rl(t,this.getCenterPoint(),this.rotation),$y(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=vP(t,e);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=TP(t,e,i);let l=sl(t.ctx,e);const u=MP(l,a);Ny(e,u)&&(l={width:l.width*u,height:l.height*u});const{position:d,xAdjust:f,yAdjust:g}=e,m=Ly(s,l,{borderWidth:0,position:d,xAdjust:f,yAdjust:g});return{initProperties:Zr(t,m,e),...m,...r,rotation:e.rotation,_fitRatio:u}}}al.id="doughnutLabelAnnotation",al.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},al.defaultRoutes={};function vP(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const r=i.controller;return r instanceof Zs&&SP(n,t,i.data)&&(!e||r.innerRadius<e.controller.innerRadius)&&r.options.circumference>=90?i:e},void 0)}function SP(n,t,e){if(!t.autoHide)return!0;for(let i=0;i<e.length;i++)if(!e[i].hidden&&n.getDataVisibility(i))return!0}function TP({chartArea:n},t,e){const{left:i,top:r,right:s,bottom:a}=n,{innerRadius:l,offsetX:u,offsetY:d}=e.controller,f=(i+s)/2+u,g=(r+a)/2+d,m={left:Math.max(f-l,i),right:Math.min(f+l,s),top:Math.max(g-l,r),bottom:Math.min(g+l,a)},_={x:(m.left+m.right)/2,y:(m.top+m.bottom)/2},x=t.spacing+t.borderWidth/2,S=l-x,T=_.y>g,C=T?r+x:a-x,A=kP(C,f,g,S);return{controllerMeta:{_centerX:f,_centerY:g,_radius:S,_counterclockwise:T,...A},point:_,radius:Math.min(l,Math.min(m.right-m.left,m.bottom-m.top)/2)}}function MP({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function kP(n,t,e,i){const r=Math.pow(e-n,2),s=Math.pow(i,2),a=t*-2,l=Math.pow(t,2)+r-s,u=Math.pow(a,2)-4*l;if(u<=0)return{_startAngle:0,_endAngle:te};const d=(-a-Math.sqrt(u))/2,f=(-a+Math.sqrt(u))/2;return{_startAngle:va({x:t,y:e},{x:d,y:n}).angle,_endAngle:va({x:t,y:e},{x:f,y:n}).angle}}function DP(n,t){const{_centerX:e,_centerY:i,_radius:r,_startAngle:s,_endAngle:a,_counterclockwise:l,options:u}=t;n.save();const d=ci(n,u);n.fillStyle=u.backgroundColor,n.beginPath(),n.arc(e,i,r,s,a,l),n.closePath(),n.fill(),d&&n.stroke(),n.restore()}class mo extends $e{inRange(t,e,i,r){return Ey({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return _r(this,t)}draw(t){const e=this.options,i=!en(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),rl(t,this.getCenterPoint(),this.rotation),XR(t,this),Wy(t,this,e),$y(t,CP(this),e),t.restore())}resolveElementProperties(t,e){let i;if(Fy(e))i=jy(t,e);else{const{centerX:l,centerY:u}=Zu(t,e);i={x:l,y:u}}const r=we(e.padding),s=sl(t.ctx,e),a=Ly(i,s,e,r);return{initProperties:Zr(t,a,e),pointX:i.x,pointY:i.y,...a,rotation:e.rotation}}}mo.id="labelAnnotation",mo.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},mo.defaultRoutes={borderColor:"color"};function CP({x:n,y:t,width:e,height:i,options:r}){const s=r.borderWidth/2,a=we(r.padding);return{x:n+a.left+s,y:t+a.top+s,width:e-a.left-a.right-r.borderWidth,height:i-a.top-a.bottom-r.borderWidth}}const td=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),ed=(n,t,e)=>td(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,i_=(n,t,e)=>td(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,yo=n=>n*n,OP=(n,t,{x:e,y:i,x2:r,y2:s},a)=>a==="y"?{start:Math.min(i,s),end:Math.max(i,s),value:t}:{start:Math.min(e,r),end:Math.max(e,r),value:n},r_=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,nd=(n,t,e,i)=>({x:r_(n.x,t.x,e.x,i),y:r_(n.y,t.y,e.y,i)}),s_=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),o_=(n,t,e,i)=>-Math.atan2(s_(n.x,t.x,e.x,i),s_(n.y,t.y,e.y,i))+.5*Et;class _o extends $e{inRange(t,e,i,r){const s=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:e},{path:l,ctx:u}=this;if(l){ci(u,this.options),u.lineWidth+=this.options.hitTolerance;const{chart:f}=this.$context,g=t*f.currentDevicePixelRatio,m=e*f.currentDevicePixelRatio,_=u.isPointInStroke(l,g,m)||id(this,a,r);return u.restore(),_}const d=yo(s);return PP(this,a,d,r)||id(this,a,r)}return AP(this,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r})}getCenterPoint(t){return _r(this,t)}draw(t){const{x:e,y:i,x2:r,y2:s,cp:a,options:l}=this;if(t.save(),!ci(t,l))return t.restore();Qr(t,l);const u=Math.sqrt(Math.pow(r-e,2)+Math.pow(s-i,2));if(l.curve&&a)return HP(t,this,a,u),t.restore();const{startOpts:d,endOpts:f,startAdjust:g,endAdjust:m}=d_(this),_=Math.atan2(s-i,r-e);t.translate(e,i),t.rotate(_),t.beginPath(),t.moveTo(0+g,0),t.lineTo(u-m,0),t.shadowColor=l.borderShadowColor,t.stroke(),rd(t,0,g,d),rd(t,u,-m,f),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=rP(t,e),{x:r,y:s,x2:a,y2:l}=i,u=EP(i,t.chartArea),d=u?RP({x:r,y:s},{x:a,y:l},t.chartArea):{x:r,y:s,x2:a,y2:l,width:Math.abs(a-r),height:Math.abs(l-s)};if(d.centerX=(a+r)/2,d.centerY=(l+s)/2,d.initProperties=Zr(t,d,e),e.curve){const g={x:d.x,y:d.y},m={x:d.x2,y:d.y2};d.cp=UP(d,e,Hr(g,m))}const f=IP(t,d,e.label);return f._visible=u,d.elements=[{type:"label",optionScope:"label",properties:f,initProperties:d.initProperties}],d}}_o.id="lineAnnotation";const a_={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};_o.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},a_),fill:!1,length:12,start:Object.assign({},a_),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({},mo.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},_o.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},_o.defaultRoutes={borderColor:"color"};function AP(n,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s}){const a=OP(t,e,n.getProps(["x","y","x2","y2"],s),i);return Oy(a,r)||id(n,{mouseX:t,mouseY:e},s,i)}function EP({x:n,y:t,x2:e,y2:i},{top:r,right:s,bottom:a,left:l}){return!(n<l&&e<l||n>s&&e>s||t<r&&i<r||t>a&&i>a)}function l_({x:n,y:t},e,{top:i,right:r,bottom:s,left:a}){return n<a&&(t=i_(a,{x:n,y:t},e),n=a),n>r&&(t=i_(r,{x:n,y:t},e),n=r),t<i&&(n=ed(i,{x:n,y:t},e),t=i),t>s&&(n=ed(s,{x:n,y:t},e),t=s),{x:n,y:t}}function RP(n,t,e){const{x:i,y:r}=l_(n,t,e),{x:s,y:a}=l_(t,n,e);return{x:i,y:r,x2:s,y2:a,width:Math.abs(s-i),height:Math.abs(a-r)}}function PP(n,{mouseX:t,mouseY:e},i=yr,r){const{x:s,y:a,x2:l,y2:u}=n.getProps(["x","y","x2","y2"],r),d=l-s,f=u-a,g=yo(d)+yo(f),m=g===0?-1:((t-s)*d+(e-a)*f)/g;let _,x;return m<0?(_=s,x=a):m>1?(_=l,x=u):(_=s+m*d,x=a+m*f),yo(t-_)+yo(e-x)<=i}function id(n,{mouseX:t,mouseY:e},i,r){const s=n.label;return s.options.display&&s.inRange(t,e,r,i)}function IP(n,t,e){const i=e.borderWidth,r=we(e.padding),s=sl(n.ctx,e),a=s.width+r.width+i,l=s.height+r.height+i;return NP(t,e,{width:a,height:l,padding:r},n.chartArea)}function LP(n){const{x:t,y:e,x2:i,y2:r}=n,s=Math.atan2(r-e,i-t);return s>Et/2?s-Et:s<Et/-2?s+Et:s}function NP(n,t,e,i){const{width:r,height:s,padding:a}=e,{xAdjust:l,yAdjust:u}=t,d={x:n.x,y:n.y},f={x:n.x2,y:n.y2},g=t.rotation==="auto"?LP(n):xe(t.rotation),m=BP(r,s,g),_=FP(n,t,{labelSize:m,padding:a},i),x=n.cp?nd(d,n.cp,f,_):td(d,f,_),S={size:m.w,min:i.left,max:i.right,padding:a.left},T={size:m.h,min:i.top,max:i.bottom,padding:a.top},C=u_(x.x,S)+l,A=u_(x.y,T)+u;return{x:C-r/2,y:A-s/2,x2:C+r/2,y2:A+s/2,centerX:C,centerY:A,pointX:x.x,pointY:x.y,width:r,height:s,rotation:wa(g)}}function BP(n,t,e){const i=Math.cos(e),r=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*r),h:Math.abs(n*r)+Math.abs(t*i)}}function FP(n,t,e,i){let r;const s=zP(n,i);return t.position==="start"?r=c_({w:n.x2-n.x,h:n.y2-n.y},e,t,s):t.position==="end"?r=1-c_({w:n.x-n.x2,h:n.y-n.y2},e,t,s):r=Gu(1,t.position),r}function c_(n,t,e,i){const{labelSize:r,padding:s}=t,a=n.w*i.dx,l=n.h*i.dy,u=a>0&&(r.w/2+s.left-i.x)/a,d=l>0&&(r.h/2+s.top-i.y)/l;return nl(Math.max(u,d),0,.25)}function zP(n,t){const{x:e,x2:i,y:r,y2:s}=n,a=Math.min(r,s)-t.top,l=Math.min(e,i)-t.left,u=t.bottom-Math.max(r,s),d=t.right-Math.max(e,i);return{x:Math.min(l,d),y:Math.min(a,u),dx:l<=d?1:-1,dy:a<=u?1:-1}}function u_(n,t){const{size:e,min:i,max:r,padding:s}=t,a=e/2;return e>r-i?(r+i)/2:(i>=n-s-a&&(n=i+s+a),r<=n+s+a&&(n=r-s-a),n)}function d_(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:f_(n,e),endAdjust:f_(n,i)}}function f_(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,r=n.options.borderWidth/2,s={x:e,y:i+r};return Math.abs(ed(0,s,{x:0,y:r}))}function rd(n,t,e,i){if(!i||!i.display)return;const{length:r,width:s,fill:a,backgroundColor:l,borderColor:u}=i,d=Math.abs(t-r)+e;n.beginPath(),Qr(n,i),ci(n,i),n.moveTo(d,-s),n.lineTo(t+e,0),n.lineTo(d,s),a===!0?(n.fillStyle=l||u,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function UP(n,t,e){const{x:i,y:r,x2:s,y2:a,centerX:l,centerY:u}=n,d=Math.atan2(a-r,s-i),f=Ku(t.controlPoint,0),g={x:l+Bi(e,f.x,!1),y:u+Bi(e,f.y,!1)};return mr(g,{x:l,y:u},d)}function h_(n,{x:t,y:e},{angle:i,adjust:r},s){!s||!s.display||(n.save(),n.translate(t,e),n.rotate(i),rd(n,0,-r,s),n.restore())}function HP(n,t,e,i){const{x:r,y:s,x2:a,y2:l,options:u}=t,{startOpts:d,endOpts:f,startAdjust:g,endAdjust:m}=d_(t),_={x:r,y:s},x={x:a,y:l},S=o_(_,e,x,0),T=o_(_,e,x,1)-Et,C=nd(_,e,x,g/i),A=nd(_,e,x,1-m/i),F=new Path2D;n.beginPath(),F.moveTo(C.x,C.y),F.quadraticCurveTo(e.x,e.y,A.x,A.y),n.shadowColor=u.borderShadowColor,n.stroke(F),t.path=F,t.ctx=n,h_(n,C,{angle:S,adjust:g},d),h_(n,A,{angle:T,adjust:m},f)}class bo extends $e{inRange(t,e,i,r){const s=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return WP({x:t,y:e},this.getProps(["width","height","centerX","centerY"],r),s,a);const{x:l,y:u,x2:d,y2:f}=this.getProps(["x","y","x2","y2"],r),g=i==="y"?{start:u,end:f}:{start:l,end:d},m=mr({x:t,y:e},this.getCenterPoint(r),xe(-s));return m[i]>=g.start-a-yr&&m[i]<=g.end+a+yr}getCenterPoint(t){return _r(this,t)}draw(t){const{width:e,height:i,centerX:r,centerY:s,options:a}=this;t.save(),rl(t,this.getCenterPoint(),a.rotation),Qr(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const l=ci(t,a);t.ellipse(r,s,i/2,e/2,Et/2,0,2*Et),t.fill(),l&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Ky(t,e)}}bo.id="ellipseAnnotation",bo.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},ts.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},bo.defaultRoutes={borderColor:"color",backgroundColor:"color"},bo.descriptors={label:{_fallback:!0}};function WP(n,t,e,i){const{width:r,height:s,centerX:a,centerY:l}=t,u=r/2,d=s/2;if(u<=0||d<=0)return!1;const f=xe(e||0),g=Math.cos(f),m=Math.sin(f),_=Math.pow(g*(n.x-a)+m*(n.y-l),2),x=Math.pow(m*(n.x-a)-g*(n.y-l),2);return _/Math.pow(u+i,2)+x/Math.pow(d+i,2)<=1.0001}class ll extends $e{inRange(t,e,i,r){const{x:s,y:a,x2:l,y2:u,width:d}=this.getProps(["x","y","x2","y2","width"],r),f=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?NR({x:t,y:e},this.getCenterPoint(r),d/2,f):Oy(i==="y"?{start:a,end:u,value:e}:{start:s,end:l,value:t},f)}getCenterPoint(t){return _r(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Qr(t,e);const r=ci(t,e);VR(t,this,this.centerX,this.centerY),r&&!il(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=Gy(t,e);return i.initProperties=Zr(t,i,e),i}}ll.id="pointAnnotation",ll.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},ll.defaultRoutes={borderColor:"color",backgroundColor:"color"};class cl extends $e{inRange(t,e,i,r){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&VP(this.elements,t,e,r);const s=mr({x:t,y:e},this.getCenterPoint(r),xe(-this.options.rotation)),a=this.elements.map(d=>i==="y"?d.bY:d.bX),l=Math.min(...a),u=Math.max(...a);return s[i]>=l&&s[i]<=u}getCenterPoint(t){return _r(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Qr(t,i);const r=ci(t,i);let s=!0;for(const a of e)s?(t.moveTo(a.x,a.y),s=!1):t.lineTo(a.x,a.y);t.closePath(),t.fill(),r&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=Gy(t,e),{sides:r,rotation:s}=e,a=[],l=2*Et/r;let u=s*qc;for(let d=0;d<r;d++,u+=l){const f=$P(i,e,u);f.initProperties=Zr(t,i,e),a.push(f)}return i.elements=a,i}}cl.id="polygonAnnotation",cl.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},cl.defaultRoutes={borderColor:"color",backgroundColor:"color"};function $P({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:r},s){const a=(i+r)/2,l=Math.sin(s),u=Math.cos(s),d={x:n+l*e,y:t-u*e};return{type:"point",optionScope:"point",properties:{x:d.x,y:d.y,centerX:d.x,centerY:d.y,bX:n+l*(e+a),bY:t-u*(e+a)}}}function VP(n,t,e,i){let r=!1,s=n[n.length-1].getProps(["bX","bY"],i);for(const a of n){const l=a.getProps(["bX","bY"],i);l.bY>e!=s.bY>e&&t<(s.bX-l.bX)*(e-l.bY)/(s.bY-l.bY)+l.bX&&(r=!r),s=l}return r}const Fi={box:ts,doughnutLabel:al,ellipse:bo,label:mo,line:_o,point:ll,polygon:cl};Object.keys(Fi).forEach(n=>{se.describe(`elements.${Fi[n].id}`,{_fallback:"plugins.annotation.common"})});const YP={update:Object.assign},qP=Ju.concat(ol),p_=(n,t)=>Pt(t)?ad(n,t):n,sd=n=>n==="color"||n==="font";function od(n="line"){return Fi[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function jP(n,t,e,i){const r=KP(n,e.animations,i),s=t.annotations,a=QP(t.elements,s);for(let l=0;l<s.length;l++){const u=s[l],d=g_(a,l,u.type),f=u.setContext(ZP(n,d,a,u)),g=d.resolveElementProperties(n,f);g.skip=GP(g),"elements"in g&&(XP(d,g.elements,f,r),delete g.elements),en(d.x)||Object.assign(d,g),Object.assign(d,g.initProperties),g.options=m_(f),r.update(d,g)}}function GP(n){return isNaN(n.x)||isNaN(n.y)}function KP(n,t,e){return e==="reset"||e==="none"||e==="resize"?YP:new ou(n,t)}function XP(n,t,e,i){const r=n.elements||(n.elements=[]);r.length=t.length;for(let s=0;s<t.length;s++){const a=t[s],l=a.properties,u=g_(r,s,a.type,a.initProperties),d=e[a.optionScope].override(a);l.options=m_(d),i.update(u,l)}}function g_(n,t,e,i){const r=Fi[od(e)];let s=n[t];return(!s||!(s instanceof r))&&(s=n[t]=new r,Object.assign(s,i)),s}function m_(n){const t=Fi[od(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,ad(n,t.defaults),ad(n,t.defaultRoutes));for(const i of qP)e[i]=n[i];return e}function ad(n,t){const e={};for(const i of Object.keys(t)){const r=t[i],s=n[i];sd(i)&&qt(s)?e[i]=s.map(a=>p_(a,r)):e[i]=p_(s,r)}return e}function ZP(n,t,e,i){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,get elements(){return e.filter(r=>r&&r.options)},id:i.id,type:"annotation"}))}function QP(n,t){const e=t.length,i=n.length;if(i<e){const r=e-i;n.splice(i,0,...new Array(r))}else i>e&&n.splice(e,i-e);return n}var JP="3.1.0";const zi=new Map,y_=n=>n.type!=="doughnutLabel",t2=Ju.concat(ol);var __={id:"annotation",version:JP,beforeRegister(){BR("chart.js","4.0",rn.version)},afterRegister(){rn.register(Fi)},afterUnregister(){rn.unregister(Fi)},beforeInit(n){zi.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=zi.get(n),r=i.annotations=[];let s=e.annotations;Pt(s)?Object.keys(s).forEach(a=>{const l=s[a];Pt(l)&&(l.id=a,r.push(l))}):qt(s)&&r.push(...s),yP(r.filter(y_),n.scales)},afterDataLimits(n,t){const e=zi.get(n);mP(n,t.scale,e.annotations.filter(y_).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=zi.get(n);dP(n,i,e),jP(n,i,e,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),gP(n,i,e)},beforeDatasetsDraw(n,t,e){xo(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){xo(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){xo(n,t.index,e.clip)},beforeDraw(n,t,e){xo(n,"beforeDraw",e.clip)},afterDraw(n,t,e){xo(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=zi.get(n);fP(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){zi.delete(n)},getAnnotations(n){const t=zi.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return ju(n,t,e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!t2.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Fi[od(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:sd,_fallback:!0},_indexable:sd}},additionalOptionScopes:[""]};function xo(n,t,e){const{ctx:i,chartArea:r}=n,s=zi.get(n);e&&js(i,r);const a=e2(s.visibleElements,t).sort((l,u)=>l.element.options.z-u.element.options.z);for(const l of a)n2(i,r,s,l);e&&Gs(i)}function e2(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const r of i.elements)r.options.display&&r.options.drawTime===t&&e.push({element:r});return e}function n2(n,t,e,i){const r=i.element;i.main?(t_(e,r,"beforeDraw"),r.draw(n,t),t_(e,r,"afterDraw")):r.draw(n,t)}const i2={class:"zoom-timerange-container"},r2={class:"zoom-timerange-details"},s2={class:"label","data-testid":"zoom-timerange-from"},o2={class:"label","data-testid":"zoom-timerange-to"},a2=p.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(n){const t=n,{i18n:e}=Tt.useI18n(),i=p.ref(ho({tickValue:t.start,granularity:t.granularity})),r=p.ref(ho({tickValue:t.end,granularity:t.granularity})),s=(a,l)=>{ny(()=>{i.value=ho({tickValue:a,granularity:t.granularity}),r.value=ho({tickValue:l,granularity:t.granularity})},100)()};return p.watch(()=>[t.start,t.end],([a,l])=>{s(a,l)},{immediate:!0}),(a,l)=>(p.openBlock(),p.createElementBlock("div",i2,[p.createElementVNode("div",r2,[p.createElementVNode("div",s2,p.toDisplayString(p.unref(e).t("zoom_time_range.from")),1),p.createElementVNode("div",null,p.toDisplayString(i.value),1),p.createElementVNode("div",o2,p.toDisplayString(p.unref(e).t("zoom_time_range.to")),1),p.createElementVNode("div",null,p.toDisplayString(r.value),1)])]))}}),an=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},b_=an(a2,[["__scopeId","data-v-4fa681cf"]]),l2={class:"zoom-actions-container"},c2={class:"zoom-actions-heading"},u2={class:"zoom-action-select"},d2=["data-testid"],f2=["aria-disabled","href"],h2=["onClick"],p2=an(p.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(n,{emit:t}){const e=n,i=t,r=s=>{s.action&&(s.action(e.newTimeRange),i("onAction"))};return(s,a)=>(p.openBlock(),p.createElementBlock("div",l2,[p.createElementVNode("div",c2,[p.createVNode(b_,{end:n.newTimeRange.end,granularity:n.granularity,start:n.newTimeRange.start},null,8,["end","granularity","start"]),p.createVNode(p.unref(Ts.CloseIcon),{class:"zoom-actions-close-icon",color:`var(--kui-color-text-neutral, ${p.unref(Dc)})`,size:`var(--kui-icon-size-30, ${p.unref(As)})`,onClick:a[0]||(a[0]=l=>s.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=p.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),p.createElementVNode("div",u2,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.zoomActionItems,l=>(p.openBlock(),p.createElementBlock("div",{key:l.key,class:p.normalizeClass(["zoom-action-item",{disabled:l.disabled}]),"data-testid":`zoom-action-item-${l.key}`},[l.href?(p.openBlock(),p.createElementBlock("a",{key:0,"aria-disabled":l.disabled,class:"zoom-action-link",href:l.href,onClick:a[1]||(a[1]=u=>s.$emit("onAction"))},p.toDisplayString(l.label),9,f2)):(p.openBlock(),p.createElementBlock("div",{key:1,onClick:u=>r(l)},p.toDisplayString(l.label),9,h2))],10,d2))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),g2={key:2},m2={class:"tooltip-title"},y2={class:"title"},_2={key:0,class:"subtitle"},b2={class:"context"},x2={class:"metric"},w2={class:"tooltip"},v2={key:0,class:"square-marker marker-placeholder"},S2={class:"display-value"},wo=an(p.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0},granularity:{default:void 0}},emits:["dimensions","onAction"],setup(n,{emit:t}){const e=t,i=n,r=p.ref(null),{x:s,y:a,isDragging:l}=pE(r,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),u=p.computed(()=>`${a.value}px`),d=p.computed(()=>`${s.value}px`),f=p.computed(()=>i.state.tooltipContext),g=p.computed(()=>i.state.metricDisplay),m=p.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return p.watch(()=>[i.absoluteLeft,i.absoluteTop],([_,x])=>{l.value||(s.value=parseFloat(_),a.value=parseFloat(x))}),p.watch(l,_=>{_?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),p.watch(r,_=>{if(_){const{width:x,height:S}=_.getBoundingClientRect();e("dimensions",{width:x,height:S})}}),(_,x)=>n.state.showTooltip?(p.openBlock(),p.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:r,class:p.normalizeClass(["tooltip-container",{locked:n.state.interactionMode==="interactive"}]),style:p.normalizeStyle({transform:m.value?`translate(${d.value}, ${u.value})`:`translate(${n.absoluteLeft}, ${n.absoluteTop})`,left:"0",top:"0",pointerEvents:m.value?"all":"none"})},[n.state.interactionMode==="selecting-chart-area"&&n.granularity&&n.zoomTimeRange&&n.zoomTimeRange.end&&n.zoomTimeRange.start?(p.openBlock(),p.createBlock(b_,{key:0,end:n.zoomTimeRange?.end,granularity:n.granularity,start:n.zoomTimeRange?.start},null,8,["end","granularity","start"])):n.state.interactionMode==="zoom-interactive"&&n.zoomTimeRange&&n.zoomActionItems&&n.granularity?(p.openBlock(),p.createBlock(p2,{key:1,granularity:n.granularity,"new-time-range":n.zoomTimeRange,"zoom-action-items":n.zoomActionItems,onOnAction:x[0]||(x[0]=S=>e("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(p.openBlock(),p.createElementBlock("div",g2,[p.createElementVNode("div",m2,[p.createElementVNode("div",y2,[p.createElementVNode("div",null,p.toDisplayString(n.tooltipTitle),1),m.value?(p.openBlock(),p.createBlock(p.unref(Ts.DragIcon),{key:0,class:"drag-icon",color:`var(--kui-color-text-neutral, ${p.unref(Dc)})`,size:`var(--kui-icon-size-30, ${p.unref(As)})`},null,8,["color","size"])):p.createCommentVNode("",!0)]),f.value||g.value?(p.openBlock(),p.createElementBlock("div",_2,[p.createElementVNode("div",b2,p.toDisplayString(f.value),1),p.createElementVNode("div",x2,p.toDisplayString(g.value),1)])):p.createCommentVNode("",!0)]),p.createElementVNode("ul",w2,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.state.tooltipSeries,({backgroundColor:S,borderColor:T,label:C,value:A,isSegmentEmpty:F,isExtra:P},I)=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:C+I},[n.state.tooltipSeries.length?(p.openBlock(),p.createElementBlock("li",{key:0,class:p.normalizeClass({"extra-row":P})},[P?(p.openBlock(),p.createElementBlock("div",v2)):(p.openBlock(),p.createElementBlock("div",{key:1,class:"square-marker",style:p.normalizeStyle({background:String(S),borderColor:String(T)})},null,4)),p.createElementVNode("span",{class:p.normalizeClass(["display-label",{empty:F}])},p.toDisplayString(C),3),p.createElementVNode("span",S2,p.toDisplayString(A),1)],2)):p.createCommentVNode("",!0)],64))),128))])]))],6)):p.createCommentVNode("",!0)}}),[["__scopeId","data-v-fb2f2a72"]]),T2={key:0,class:"legend-container","data-testid":"legend"},M2=["onClick"],k2={key:0,"aria-hidden":"true",class:"line-marker",height:"2",width:"16"},D2=["stroke","stroke-dasharray"],C2=["title"],O2={class:"label truncate-label"},A2={key:0,class:"sub-label"},E2={key:0},R2={class:"tooltip-content"},ul=an(p.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){const t=n,{i18n:e}=Tt.useI18n(),i=p.inject("showLegendValues",!1),r=p.inject("legendPosition",p.ref(Pe.Bottom)),s=(l=0,u)=>{if(t.chartInstance===null)return;const d=t.chartInstance instanceof rn?t.chartInstance:t.chartInstance.chart,f=a(l,u);!d.getDatasetMeta(l).dataset&&u!==void 0?d.toggleDataVisibility(u):f?d.hide(l,u):d.show(l,u),d.update()},a=(l=0,u)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const d=t.chartInstance instanceof rn?t.chartInstance:t.chartInstance.chart;return d.getDatasetMeta(l).dataset||u===void 0?d.isDatasetVisible(l):d.getDataVisibility(u)};return(l,u)=>{const d=p.resolveComponent("KTooltip");return p.unref(r)!==p.unref(Pe).Hidden?(p.openBlock(),p.createElementBlock("ul",T2,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.items,({fillStyle:f,strokeStyle:g,text:m,datasetIndex:_,index:x,value:S,isSegmentEmpty:T,isKey:C,lineDash:A})=>(p.openBlock(),p.createElementBlock("li",{key:m,class:p.normalizeClass({"legend-key":C}),onClick:F=>C?void 0:s(_,x)},[A?.length?(p.openBlock(),p.createElementBlock("svg",k2,[p.createElementVNode("line",{stroke:g,"stroke-dasharray":A.join(" "),"stroke-width":"2",x1:"0",x2:"16",y1:"1",y2:"1"},null,8,D2)])):(p.openBlock(),p.createElementBlock("div",{key:1,class:"square-marker",style:p.normalizeStyle({background:f,"border-color":g})},null,4)),p.createVNode(d,null,p.createSlots({default:p.withCtx(()=>[p.createElementVNode("div",{class:p.normalizeClass(["label-container",{"strike-through":!C&&!a(_,x),"inline-value":C}]),title:S&&(p.unref(i)||C)?`${m}: ${S.formatted}`:m},[p.createElementVNode("div",O2,p.toDisplayString(m),1),S&&(p.unref(i)||C)?(p.openBlock(),p.createElementBlock("div",A2,[C?(p.openBlock(),p.createElementBlock("span",E2,"-")):p.createCommentVNode("",!0),p.createTextVNode(" "+p.toDisplayString(S.formatted),1)])):p.createCommentVNode("",!0)],10,C2)]),_:2},[T?{name:"content",fn:p.withCtx(()=>[p.createElementVNode("div",R2,p.toDisplayString(p.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],10,M2))),128))])):p.createCommentVNode("",!0)}}}),[["__scopeId","data-v-b5919295"]]),Ie=[];for(let n=0;n<256;++n)Ie.push((n+256).toString(16).slice(1));function P2(n,t=0){return(Ie[n[t+0]]+Ie[n[t+1]]+Ie[n[t+2]]+Ie[n[t+3]]+"-"+Ie[n[t+4]]+Ie[n[t+5]]+"-"+Ie[n[t+6]]+Ie[n[t+7]]+"-"+Ie[n[t+8]]+Ie[n[t+9]]+"-"+Ie[n[t+10]]+Ie[n[t+11]]+Ie[n[t+12]]+Ie[n[t+13]]+Ie[n[t+14]]+Ie[n[t+15]]).toLowerCase()}const I2=new Uint8Array(16);function L2(){return crypto.getRandomValues(I2)}function ld(n,t,e){return crypto.randomUUID?crypto.randomUUID():N2(n)}function N2(n,t,e){n=n||{};const i=n.random??n.rng?.()??L2();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,P2(i)}const x_=(n,t)=>{const e=n.ctx,i=n.scales.y,r=n.scales.x,s=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(s.x-s.width/2,s.y,s.width,i.bottom-s.y):e.strokeRect(r.left,s.y-s.height/2,s.x-r.left,s.height),e.restore()};class w_{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&x_(t,this._clickedElements)}afterEvent(t,{event:e}){if(e.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(e.type!=="click"||!e.native||this._pause)return;this._clicked=!this._clicked;const i=t.options.interaction?.mode||"index",r=t.getElementsAtEventForMode(e.native,i,{intersect:!1},!0);r.length&&this._clicked?(this._clickedElements=r,x_(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 B2=["id"],F2=["id"],z2={class:"axis-tooltip-content"},U2="100%",H2="100%",W2=20,$2=20,v_=6,V2=0,Y2=10,q2=10,j2=1,G2=an(p.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{i18n:e}=Tt.useI18n(),{translateUnit:i}=Tt.useTranslatedUnits(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=new w_,l=p.useTemplateRef("chartContainer"),u=p.useTemplateRef("chartParent"),d=({chart:V},st)=>{const ot=V.data,lt=ot.labels?.indexOf(st);return ot.datasets.reduce((pt,dt,It)=>{if(V.isDatasetVisible(It)){const zt=dt.data[lt];return isNaN(zt)?pt:pt+zt}else return pt},0)},f=(V,st,ot,lt)=>{const pt=lt==="horizontal";st===null&&(st=e.t("entityNoName"));const dt={type:"label",yValue:vt=>pt?st:d(vt,st),xValue:vt=>pt?d(vt,st):st},It={...dt,position:pt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>pt?0:-Math.abs(NE()),content:vt=>sy(d(vt,st),ot)},zt={...dt,content:vt=>FE(d(vt,st),BE(vt.chart,V)),position:pt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:vt=>pt?LE(sy(d(vt,st),ot)):0,color:CE};return{[`${st}-value`]:It,[`${st}-percent`]:zt}},g=p.useTemplateRef("canvas"),m=p.useTemplateRef("axis"),_=ld(),x=ld(),S=p.ref([]),T=p.inject("legendPosition",Pe.Bottom),C=p.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),A=p.toRef(t,"metricUnit"),F=p.computed(()=>t.orientation==="horizontal"),P=p.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:p.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:p.toRef(t,"dimensionAxesTitle"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:F.value?"horizontal_bar":"vertical_bar",chartID:s,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:I,tooltipAbsoluteTop:L}=Tt.useTooltipAbsolutePosition(u,P),N=p.ref(0),w=()=>t.annotations&&t.chartData.labels?.reduce((V,st)=>Object.assign(V,f(t.chartData,st,A.value,t.orientation)),{}),M={id:_,afterUpdate(V){N.value+=1,S.value=Ou(V,t.legendValues,t.chartLegendSortFn)}},O={id:x,afterUpdate(V){V.options.plugins.annotation.annotations=t.annotations?w():{}}},W=[M,{id:"axisHover",afterEvent(V,st){if(C.show=!1,st.event.type==="mousemove"){const ot=st.event,lt=V.options.indexAxis,pt=V.scales,dt=V.scales[lt].getLabelForValue(Number(V.scales[lt].getValueForPixel(ot[lt]))),zt=V.scales[lt].getLabels().indexOf(dt),vt=t.chartData.isLabelEmpty?.[zt];if((Dt=>Dt==="x"?ot.y>pt.x.top:ot.x<pt.y.right)(lt)){P.interactionMode!=="interactive"&&(P.showTooltip=!1);const ve=V.canvas.getContext("2d").measureText(dt).width,bt=Math.abs(Math.round(ot.x-ve*.5)),jt=Math.round(ot.x+ve*.5),Oe=V.canvas.getBoundingClientRect(),Ae=40;C.left=lt==="x"?`${(bt>0?bt:jt)-C.offset+Oe.left}px`:`${ot.x-ve*.5-C.offset+Oe.left}px`,C.top=`${ot.y-Ae+Oe.top}px`,dt.length>Za?(C.show=!0,C.text=dt):vt?(C.text=e.t("emptyEntityInfo"),C.show=!0):C.show=!1}else C.show=!1}}},a,...t.annotations?[O]:[]],J=p.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),ut=p.ref(0),ft=p.ref(0),K=new ResizeObserver(ny(V=>{ut.value=V[0].contentRect.width,ft.value=V[0].contentRect.height},100)),nt=p.computed(()=>{const V=t.chartData?.labels?.length;return g.value&&V&&!F.value?`${Math.max(V*(W2+v_),ut.value)}px`:U2}),rt=p.computed(()=>{const V=t.chartData?.labels?.length;return g.value&&V&&F.value?`${Math.max(V*($2+v_),ft.value)}px`:H2});Tt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey")),p.onMounted(()=>{t.annotations&&rn.register(__),l.value&&(ut.value=l.value.offsetWidth,ft.value=l.value.offsetHeight,K.observe(l.value))}),p.onUnmounted(()=>{l.value&&K.unobserve(l.value)});const it=p.computed(()=>{const V=Tt.useBarChartOptions({tooltipState:P,legendID:_,stacked:p.toRef(t,"stacked"),metricAxesTitle:p.toRef(t,"metricAxesTitle"),dimensionAxesTitle:p.toRef(t,"dimensionAxesTitle"),indexAxis:F.value?"y":"x",numLabels:J});return{...V.value,plugins:{...V.value.plugins,annotation:{annotations:w(),clip:!1}}}}),at=Tt.useChartJSCommon("bar",g,p.toRef(t,"chartData"),W,it);p.onBeforeUnmount(()=>{rn.unregister(__)});const H={[Pe.Bottom]:"column"},q=p.computed(()=>{if(m.value&&at.value){const V=window.devicePixelRatio,st=at.value,ot=st.scales.y.width*V+j2,lt=(st.scales.y.height+st.scales.y.top+st.scales.x.height)*V,pt=m.value.getContext("2d");return pt.scale(V,V),pt.canvas.width=ot,pt.canvas.height=lt,pt.canvas.style.width=`${ot/V}px`,pt.canvas.style.height=`${lt/V}px`,{scale:V,width:ot*V,height:lt*V,targetCtx:pt}}return null}),X=V=>{const st=V.target;if(q.value&&at.value&&!F.value){const ot=q.value.scale,lt=q.value.targetCtx,pt=q.value.width,dt=q.value.height,It=at.value,zt=It.canvas;lt.fillStyle="white",st.scrollLeft>=V2&&st.scrollLeft<=Y2?(lt.globalCompositeOperation="source-over",lt.clearRect(0,0,pt,dt),lt.drawImage(zt,0,0,pt,dt,0,0,pt,dt),lt.globalCompositeOperation="destination-over",lt.fillRect(0,0,pt,dt)):(lt.globalCompositeOperation="source-over",lt.fillRect(0,(It.scales.y.height+It.scales.y.top+q2)*ot,pt,It.scales.x.height*ot))}P.offsetY=st.scrollTop,P.offsetX=st.scrollLeft,C.offset=st.scrollLeft},_t=({width:V,height:st})=>{P.width=V,P.height=st};p.watch(()=>t.orientation,()=>{if(m.value&&q.value){const V=q.value.width,st=q.value.height;(m.value?.getContext("2d")).clearRect(0,0,V,st)}P.showTooltip=!1,P.interactionMode="idle"}),p.watch(()=>t.annotations,V=>{at.value&&(V?at.value.options.plugins.annotation.annotations=w(t.chartData):delete at.value.options.plugins.annotation.annotations)});const j=()=>{P.showTooltip&&(P.interactionMode!=="idle"?P.interactionMode="idle":P.interactionMode="interactive")};return(V,st)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",H[p.unref(T)]])},[p.createElementVNode("canvas",{id:p.unref(r),ref:"axis",class:"axis"},null,8,B2),p.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:st[0]||(st[0]=ot=>j()),onScroll:X},[p.createElementVNode("div",{class:"chart-body",style:p.normalizeStyle({width:nt.value,height:rt.value})},[p.createElementVNode("canvas",{id:p.unref(s),ref:"canvas",class:"chart-canvas"},null,8,F2)],4)],544),(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[C.show?(p.openBlock(),p.createElementBlock("div",{key:0,class:"axis-tooltip",style:p.normalizeStyle({top:C.top,left:C.left}),width:"auto"},[p.createElementVNode("div",z2,p.toDisplayString(C.text),1)],4)):p.createCommentVNode("",!0),p.createVNode(wo,{"absolute-left":p.unref(I),"absolute-top":p.unref(L),"chart-parent-ref":u.value,state:P,"tooltip-title":n.tooltipTitle,onDimensions:_t},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),p.createVNode(ul,{id:p.unref(_),"chart-instance":p.unref(at),items:S.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-60e5a1a7"]]);const K2={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"};Ag._date.override({_id:"date-fns",formats:function(){return K2},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=At(n):e==="string"&&(typeof t=="string"?n=GT(n,t,new Date,this.options):n=bp(n,this.options)),Ec(n)?n.getTime():null},format:function(n,t){return da(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return Oc(n,t);case"second":return $1(n,t);case"minute":return H1(n,t);case"hour":return F1(n,t);case"day":return ca(n,t);case"week":return V1(n,t);case"month":return Cc(n,t);case"quarter":return W1(n,t);case"year":return Y1(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Rc(n,t);case"second":return J1(n,t);case"minute":return X1(n,t);case"hour":return K1(n,t);case"day":return Zh(n,t);case"week":return tS(n,t);case"month":return ep(n,t);case"quarter":return Q1(n,t);case"year":return eS(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return QT(n);case"minute":return ZT(n);case"hour":return XT(n);case"day":return Ac(n);case"week":return Wn(n);case"isoWeek":return Wn(n,{weekStartsOn:+e});case"month":return iS(n);case"quarter":return nS(n);case"year":return np(n);default:return n}},endOf:function(n,t){switch(t){case"second":return cS(n);case"minute":return aS(n);case"hour":return sS(n);case"day":return Jh(n);case"week":return oS(n);case"month":return tp(n);case"quarter":return lS(n);case"year":return rS(n);default:return n}}});const S_={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},X2={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...S_,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},Z2=p.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function es(n){return p.isProxy(n)?p.toRaw(n):n}function Q2(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return p.isProxy(t)?new Proxy(n,{}):n}function J2(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function T_(n,t){n.labels=t}function M_(n,t,e){const i=[];n.datasets=t.map(r=>{const s=n.datasets.find(a=>a[e]===r[e]);return!s||!r.data||i.includes(s)?{...r}:(i.push(s),Object.assign(s,r),s)})}function tI(n,t){const e={labels:[],datasets:[]};return T_(e,n.labels),M_(e,n.datasets,t),e}const eI=p.defineComponent({props:X2,setup(n,t){let{expose:e,slots:i}=t;const r=p.ref(null),s=p.shallowRef(null);e({chart:s});const a=()=>{if(!r.value)return;const{type:d,data:f,options:g,plugins:m,datasetIdKey:_}=n,x=tI(f,_),S=Q2(x,f);s.value=new rn(r.value,{type:d,data:S,options:{...g},plugins:m})},l=()=>{const d=p.toRaw(s.value);d&&(n.destroyDelay>0?setTimeout(()=>{d.destroy(),s.value=null},n.destroyDelay):(d.destroy(),s.value=null))},u=d=>{d.update(n.updateMode)};return p.onMounted(a),p.onUnmounted(l),p.watch([()=>n.options,()=>n.data],(d,f)=>{let[g,m]=d,[_,x]=f;const S=p.toRaw(s.value);if(!S)return;let T=!1;if(g){const C=es(g),A=es(_);C&&C!==A&&(J2(S,C),T=!0)}if(m){const C=es(m.labels),A=es(x.labels),F=es(m.datasets),P=es(x.datasets);C!==A&&(T_(S.config.data,C),T=!0),F&&F!==P&&(M_(S.config.data,F,n.datasetIdKey),T=!0)}T&&p.nextTick(()=>{u(S)})},{deep:!0}),()=>p.h("canvas",{role:"img","aria-label":n.ariaLabel,"aria-describedby":n.ariaDescribedby,ref:r},[p.h("p",{},[i.default?i.default():""])])}});function dl(n,t){return rn.register(t),p.defineComponent({props:S_,setup(e,i){let{expose:r}=i;const s=p.shallowRef(null),a=p.shallowRef(null);p.watch(()=>a.value?.chart??null,u=>{s.value=u},{flush:"sync"}),r({chart:s});const l=u=>{a.value=u};return()=>p.h(eI,Z2({ref:l},{type:n,...e}))}})}const k_=dl("bar",kg),D_=dl("doughnut",Zs),C_=dl("line",Dg),nI=dl("scatter",Og),iI={class:"chart-container"},rI={key:0,class:"chart-center-metric"},sI={class:"chart-center-total"},oI={key:0,class:"chart-center-unit"},aI=p.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},metricName:{default:""},legendPosition:{default:Pe.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>li},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""},showCenterMetric:{type:Boolean,default:!0}},setup(n){const t=n,{translateUnit:e}=Tt.useTranslatedUnits(),{i18n:i}=Tt.useI18n(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=p.ref([]),l=p.useTemplateRef("chartParent"),u=p.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:p.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:p.toRef(t,"tooltipDimensionDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:d,tooltipAbsoluteTop:f}=Tt.useTooltipAbsolutePosition(l,u),g={id:r,afterUpdate(N){a.value=N.options.plugins.legend.labels.generateLabels(N).map(w=>({...w,value:t.legendValues&&t.legendValues[w.text],hidden:!1}))}},m=p.computed(()=>[g]),_=p.computed(()=>[t.chartData.datasets.reduce((w,M)=>(w.labels.push(M.label),w.backgroundColor.push(M.backgroundColor),w.hoverBorderColor.push(Ta(M.backgroundColor).saturate(.5).darken(.15).hexString()),w.data.push(M.data.reduce((O,B)=>O+B,0)),w),{labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:x}=ti({i18n:i}),S=p.computed(()=>wR(t.metricName??"")),T=p.computed(()=>{const N=_.value[0]?.data.reduce((w,M)=>w+M,0)??0;return x(N,t.metricUnit,{approximate:!0,translateUnit:(w,M)=>e(w,M)}).trim()}),C=p.computed(()=>t.tooltipMetricDisplay||""),A=p.computed(()=>({...t.chartData,datasets:_.value}));Tt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey"));const{options:F}=Tt.useDonutChartOptions({tooltipState:u,legendID:r}),P=p.ref(),I=N=>({[Pe.Bottom]:"column",[Pe.Hidden]:"hidden"})[N],L=({width:N,height:w})=>{u.width=N,u.height=w};return(N,w)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",I(n.legendPosition)]),"data-testid":"donut-chart-parent"},[p.createElementVNode("div",iI,[p.createVNode(p.unref(D_),{ref_key:"chartInstance",ref:P,"chart-id":p.unref(s),data:A.value,options:p.unref(F),plugins:m.value},null,8,["chart-id","data","options","plugins"]),n.showCenterMetric&&S.value?(p.openBlock(),p.createElementBlock("div",rI,[p.createElementVNode("span",sI,p.toDisplayString(T.value),1),C.value?(p.openBlock(),p.createElementBlock("span",oI,p.toDisplayString(C.value),1)):p.createCommentVNode("",!0)])):p.createCommentVNode("",!0),(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[p.createVNode(wo,{"absolute-left":p.unref(d),"absolute-top":p.unref(f),state:u,"tooltip-title":n.tooltipTitle,unit:n.metricUnit,onDimensions:L},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),p.createVNode(ul,{id:p.unref(r),"chart-instance":P.value,items:a.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),lI=an(aI,[["__scopeId","data-v-48b16272"]]);class cI{id="outlierBandPlugin";beforeDatasetsDraw(t,e,i){const r=i?.value;if(r===void 0||!Number.isFinite(r)||!i?.color)return;const s=t.scales.y;if(!s||!t.chartArea)return;const{top:a,bottom:l,left:u,right:d}=t.chartArea,f=Math.min(Math.max(s.getPixelForValue(r),a),l);if(f<=a)return;const g=t.ctx;g.save(),g.fillStyle=i.color,g.fillRect(u,a,d-u,f-a),g.restore()}}const uI=1.5;class dI{id="referenceLinePlugin";afterDatasetsDraw(t,e,i){const r=i?.lines;if(!r?.length)return;const s=t.scales.y;if(!s||!t.chartArea)return;const{top:a,bottom:l,left:u,right:d}=t.chartArea,f=t.ctx;f.save(),f.lineWidth=uI;for(const{value:g,color:m,borderDash:_}of r){if(!Number.isFinite(g))continue;const x=s.getPixelForValue(g);x<a||x>l||(f.beginPath(),f.setLineDash(_),f.strokeStyle=m,f.moveTo(u,x),f.lineTo(d,x),f.stroke())}f.restore()}}const fI={class:"chart-container"},hI=an(p.defineComponent({__name:"ScatterChart",props:{chartData:{default:void 0},tooltipTitle:{},metricUnit:{default:""},granularity:{},timeRangeMs:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:()=>0},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""},shadeOutlierRegion:{type:Boolean,default:!1}},setup(n){const t=n,e=p.inject("legendPosition",Pe.Bottom),i=p.inject("app:konnectColorMode",p.computed(()=>"light")),{i18n:r}=Tt.useI18n(),{formatUnit:s}=ti({i18n:r}),{translateUnit:a}=Tt.useTranslatedUnits(),l=p.useTemplateRef("chartParent"),u=new cI,d=new dI,f=crypto.randomUUID(),g=crypto.randomUUID(),m=p.ref(Ja()),_=p.ref(),x=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:p.toRef(t,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:a,offsetX:0,offsetY:0,width:0,height:0,chartType:"scatter",chartID:g,chartTooltipSortFn:t.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:S,tooltipAbsoluteTop:T}=Tt.useTooltipAbsolutePosition(l,x);Tt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey")),p.onMounted(()=>{m.value=Ja(l.value)}),p.watch(i,()=>{m.value=Ja(l.value)});const C=p.computed(()=>t.chartData?.outlier),A=p.computed(()=>t.chartData?.referenceLines??[]),F=p.ref([]),P={id:f,afterUpdate(W){F.value=Ou(W,void 0,t.chartLegendSortFn)}},I=p.computed(()=>{const W=[];C.value&&W.push({text:C.value.label,fillStyle:C.value.color,strokeStyle:C.value.color,isKey:!0});for(const J of A.value)W.push({text:J.label,fillStyle:J.color,strokeStyle:J.color,lineDash:J.borderDash,isKey:!0,value:{raw:J.value,formatted:s(J.value,t.metricUnit,{translateUnit:a})}});return W}),L=p.computed(()=>[...F.value,...I.value]),N=p.computed(()=>t.shadeOutlierRegion?C.value?.value:void 0),w=p.computed(()=>[P,...N.value!==void 0?[u]:[],...A.value.length?[d]:[]]),M=p.computed(()=>`scatter-${w.value.map(W=>W.id).join("-")}`),{options:O}=Tt.useScatterChartOptions({tooltipState:x,legendID:f,granularity:p.toRef(t,"granularity"),timeRangeMs:p.toRef(t,"timeRangeMs"),metricAxesTitle:p.toRef(t,"metricAxesTitle"),dimensionAxesTitle:p.toRef(t,"dimensionAxesTitle"),metricUnit:p.toRef(t,"metricUnit"),outlierValue:N,referenceLines:A,themeColors:m}),B=W=>({[Pe.Bottom]:"column",[Pe.Hidden]:"hidden"})[W];return(W,J)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",B(p.unref(e))]),"data-testid":"scatter-chart-parent"},[p.createElementVNode("div",fI,[(p.openBlock(),p.createBlock(p.unref(nI),{key:M.value,ref_key:"chartInstance",ref:_,"chart-id":p.unref(g),class:"chart-canvas",data:n.chartData,"data-testid":"scatter-chart",options:p.unref(O),plugins:w.value},null,8,["chart-id","data","options","plugins"]))]),p.createVNode(wo,{"absolute-left":p.unref(S),"absolute-top":p.unref(T),"data-testid":"tooltip",granularity:n.granularity,state:x,"tooltip-title":n.tooltipTitle},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title"]),p.createVNode(ul,{id:p.unref(f),"chart-instance":_.value,"data-testid":"legend",items:L.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-7e9803ff"]]),cd=(n,t,e,i,r="#0275d8")=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle=r,n.stroke(),n.restore()},Ze={},pI=()=>{Ze.x=void 0,Ze.chart=void 0,Ze.strategy=void 0,Ze.group=void 0},gI=10;class O_{id="verticalLinePlugin";_clickedSegment;_pause=!1;_useBrushingState=!1;_brushStrategy;_brushGroup;constructor({brushGroup:t=void 0,brushStrategy:e=void 0,enableBrushing:i=!1}={}){let r=!1;e==="group"&&(r=t!==void 0),this._useBrushingState=i&&r,this._brushStrategy=e,this._brushGroup=t}afterEvent(t,e){if(!this._useBrushingState)return;const{event:i}=e;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(r=>this.onMouseBrush(i.type,t,r))}_lastMouseBrushEvent=0;onMouseBrush(t,e,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<gI)return;const r=()=>{Ze.chart=e,Ze.strategy=this._brushStrategy,Ze.group=this._brushGroup;for(const s of Object.values(rn.instances))s!==e&&s.update("none")};t==="mousemove"?e.tooltip&&e.tooltip.getActiveElements()&&e.tooltip.getActiveElements().length&&(Ze.x=e.tooltip.dataPoints[0].element.x,r()):t==="mouseout"&&(Ze.x=void 0,r()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const e=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:r}=this._clickedSegment.element;cd(i,r,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(e){const{x:r}=t.tooltip.dataPoints[0].element;cd(i,r,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(Ze.x===void 0)return;const e=Ze.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&Ze.group===this._brushGroup&&cd(t.ctx,Ze.x,t.scales.y.top,t.scales.y.bottom,e)}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(t){if(this._clickedSegment&&this.destroyClickedSegment(),this._useBrushingState&&Ze.chart===t){const e=Ze.x!==void 0;if(pI(),e)for(const i of Object.values(rn.instances))i!==t&&i.update("none")}}}const mI=(n,t,e)=>{const i=n.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,n.chartArea.top),i.lineTo(t,n.chartArea.bottom),i.moveTo(e,n.chartArea.top),i.lineTo(e,n.chartArea.bottom),i.stroke(),i.restore()},yI=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},A_=(n,t)=>{const e=n.scales.x.getValueForPixel(t.startX),i=n.scales.x.getValueForPixel(t.endX);if(!(e===void 0||i===void 0))return{xStart:Math.min(e,i),xEnd:Math.max(e,i)}},E_=(n,t,e)=>{t.canvas.dispatchEvent(new CustomEvent(n,{detail:e}))};class _I{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 e=t.canvas;let i=!1;const r=l=>{this._dragTimeout=window.setTimeout(()=>{const u=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=l.clientX-u.left,this._endX=this._startX},150)},s=l=>{const u=e.getBoundingClientRect();if(i&&this._isDragging){this._endX=l.clientX-u.left;const d=A_(t,this);d&&E_("dragSelectMove",t,d)}},a=l=>{const u=e.getBoundingClientRect();if(clearTimeout(this._dragTimeout),i&&this._isDragging){this._endX=l.clientX-u.left,i=!1,this._isDragging=!1;const d=A_(t,this);d?E_("dragSelect",t,d):this.clearSelectionArea()}};e.addEventListener("mousedown",r),e.addEventListener("mousemove",s),e.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:r,onMouseMove:s,onMouseUp:a}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:r,onMouseUp:s}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",r),e.removeEventListener("mouseup",s)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(yI(t,this._startX,this._endX),mI(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const bI=20,xI="rgba(255, 171, 171, 0.4)",wI="rgba(255, 196, 0, 0.2)",R_=(n,t,e)=>{const i=t.y-n.y;if(i===0)return t.x;const r=(e-n.y)/i;return n.x+r*(t.x-n.x)},vI=(n,t)=>{const e=[];return n.data.datasets.forEach(i=>{if(!n.getDatasetMeta(n.data.datasets.indexOf(i)).visible)return;const s=i.data;s?.length&&t.filter(a=>a.highlightIntersections).forEach(a=>{const l=s.map(d=>({ts:d.x,aboveThreshold:d.y>=a.value}));let u=l[0].aboveThreshold?s[0].x:void 0;for(let d=1;d<l.length;d++)!l[d-1].aboveThreshold&&l[d].aboveThreshold?u=R_(s[d-1],s[d],a.value):l[d-1].aboveThreshold&&!l[d].aboveThreshold&&u!==void 0&&(e.push({start:u,end:R_(s[d-1],s[d],a.value),type:a.type}),u=void 0);u!==void 0&&e.push({start:u,end:l[l.length-1].ts,type:a.type})})}),e},SI=n=>{if(!n.length)return[];n.sort((e,i)=>e.type.localeCompare(i.type)||e.start-i.start);const t=[];for(const e of n){const i=t.findLast(({type:r})=>r===e.type);i&&e.start<=i.end?i.end=Math.max(i.end,e.end):t.push({...e})}return t};class TI{constructor(t){this.i18n=t}i18n;id="thresholdPlugin";_thresholds;_mouseMoveHandler;_syncThresholds(t){for(const e of Object.keys(t.threshold||{})){const i=t.threshold?.[e];i&&(this._thresholds={...this._thresholds,[e]:i.map(r=>({...r,hovered:!1}))})}if(this._thresholds)for(const e of Object.keys(this._thresholds))t.threshold?.[e]||delete this._thresholds[e]}get thresholds(){return this._thresholds}beforeUpdate(t,e,i){this._syncThresholds(i)}beforeInit(t,e,i){const r=t.canvas;this._syncThresholds(i);const s=a=>{if(t){const l=a.clientY,u=t.scales.y,d=r.getBoundingClientRect(),f=u.getValueForPixel(l-d.top);if(f)for(const g of Object.keys(this._thresholds||{})){const m=this._thresholds?.[g];m&&m.forEach(_=>{_.hovered=Math.abs(_.value-f)<bI})}}};r.addEventListener("mousemove",s),this._mouseMoveHandler=s}afterDatasetsDraw(t,e){const i=t.ctx;for(const r of Object.keys(this._thresholds||{})){const s=this._thresholds?.[r];if(s){s.forEach(u=>{const f=t.scales.y.getPixelForValue(u.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,f),i.lineTo(t.chartArea.right,f),i.lineWidth=1,i.strokeStyle=Ru(u.type),i.setLineDash([5,5]),i.stroke(),i.restore();let g="";u.label?g=`${u.label}: ${u.value}`:u.type==="warning"?g=this.i18n.t("chartLabels.threshold-warning",{value:u.value}):u.type==="error"?g=this.i18n.t("chartLabels.threshold-error",{value:u.value}):g=this.i18n.t("chartLabels.thatreshold-neutral",{value:u.value}),u.hovered&&(i.save(),i.fillStyle=Ru(u.type),i.font=mv,i.fillText(g,t.chartArea.left,f-4),i.restore())});const a=vI(t,s);SI(a).forEach(u=>{const d=t.scales.x.getPixelForValue(u.start),f=t.scales.x.getPixelForValue(u.end);i.save(),i.fillStyle=u.type==="error"?xI:wI,i.fillRect(d,t.chartArea.top,f-d,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(d,t.chartArea.bottom),i.lineTo(f,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=Ru(u.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const MI=an(p.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=n,i=t,{i18n:r}=Tt.useI18n(),s=new O_,a=new w_,l=new _I,u=new TI(r),{translateUnit:d}=Tt.useTranslatedUnits(),f=p.ref(),g=crypto.randomUUID(),m=crypto.randomUUID(),_=p.ref([]),x=p.inject("legendPosition",Pe.Bottom),S=p.useTemplateRef("chartParent"),T=p.ref(void 0),C=p.ref(!1),A=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:p.toRef(e,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(e,"metricUnit"),translateUnit:d,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:m,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:F,tooltipAbsoluteTop:P}=Tt.useTooltipAbsolutePosition(S,A),I={id:g,afterUpdate(H){_.value=Ou(H,e.legendValues,e.chartLegendSortFn)}},L=p.computed(()=>[I,a,...e.brush?[l]:[],...e.type==="timeseries_line"?[s]:[],...e.threshold?[u]:[]]),N=p.computed(()=>`line-${L.value.map(H=>H.id).join("-")}`),w=p.computed(()=>`bar-${L.value.map(H=>H.id).join("-")}`),M=p.computed(()=>e.chartData&&ME(e.chartData)),{options:O}=Tt.useLineChartOptions({tooltipState:A,timeRangeMs:p.toRef(e,"timeRangeMs"),granularity:p.toRef(e,"granularity"),legendID:g,stacked:p.toRef(e,"stacked"),metricAxesTitle:p.toRef(e,"metricAxesTitle"),dimensionAxesTitle:p.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:M,threshold:p.toRef(e,"threshold")});Tt.useReportChartDataForSynthetics(p.toRef(e,"chartData"),p.toRef(e,"syntheticsDataKey"));const B=H=>H?H.end.getTime()>H.start.getTime():!1,W=H=>({[Pe.Bottom]:"column",[Pe.Hidden]:"hidden"})[H],J=({width:H,height:q})=>{A.width=H,A.height=q},ut=(H=!0)=>{A.interactionMode="idle",A.showTooltip=!1,l.clearSelectionArea(),a.isPaused&&a.resume(H),s.isPaused&&s.resume()},ft=()=>{A.interactionMode="interactive"},K=()=>{!f.value||!f.value.chart.tooltip?.dataPoints?.length||(A.interactionMode==="interactive"?s.clickedSegment=f.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},nt=()=>{if(C.value){C.value=!1;return}A.interactionMode!=="idle"?ut():ft(),K()};p.watch(()=>e.type,()=>{A.interactionMode="idle",A.showTooltip=!1,s.destroyClickedSegment()});const rt=H=>{H.preventDefault(),H.stopPropagation();const{xStart:q,xEnd:X}=H.detail,_t={start:new Date(q),end:new Date(X),type:"absolute"};if(!B(_t)){T.value=void 0,ut(!1);return}T.value=_t,A.interactionMode="zoom-interactive",_t&&i("select-chart-range",_t)},it=H=>{A.interactionMode="selecting-chart-area",C.value=!0,s.pause(),a.pause();const{xStart:q,xEnd:X}=H.detail;T.value={start:new Date(q),end:new Date(X),type:"absolute"}},at=H=>{if(!S.value||A.interactionMode==="idle")return;const q=H.target;q&&S.value.contains(q)||C.value||ut(!1)};return p.watch(()=>f.value?.chart,()=>{f.value?.chart&&(f.value.chart.canvas.removeEventListener("dragSelect",rt),f.value.chart.canvas.removeEventListener("dragSelectMove",it),f.value.chart.canvas.addEventListener("dragSelect",rt),f.value.chart.canvas.addEventListener("dragSelectMove",it))}),p.onMounted(()=>{document.addEventListener("click",at,!0)}),p.onUnmounted(()=>{f.value?.chart&&(f.value.chart.canvas.removeEventListener("dragSelect",rt),f.value.chart.canvas.removeEventListener("dragSelectMove",it)),document.removeEventListener("click",at,!0)}),(H,q)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",W(p.unref(x))]),"data-testid":"line-chart-parent"},[p.createElementVNode("div",{class:"chart-container",onClick:q[0]||(q[0]=X=>nt())},[n.type==="timeseries_line"?(p.openBlock(),p.createBlock(p.unref(C_),{key:N.value,ref_key:"chartInstance",ref:f,"chart-id":p.unref(m),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-line-chart",options:p.unref(O),plugins:L.value},null,8,["chart-id","data","options","plugins"])):n.type==="timeseries_bar"?(p.openBlock(),p.createBlock(p.unref(k_),{key:w.value,ref_key:"chartInstance",ref:f,"chart-id":p.unref(m),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-bar-chart",options:p.unref(O),plugins:L.value},null,8,["chart-id","data","options","plugins"])):p.createCommentVNode("",!0)]),p.createVNode(wo,{"absolute-left":p.unref(F),"absolute-top":p.unref(P),"data-testid":"tooltip",granularity:n.granularity,state:A,"tooltip-title":n.tooltipTitle,"zoom-action-items":n.zoomActionItems,"zoom-time-range":T.value,onDimensions:J,onOnAction:q[1]||(q[1]=()=>ut(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),p.createVNode(ul,{id:p.unref(g),"chart-instance":f.value,"data-testid":"legend",items:_.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-399f4923"]]),kI={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},DI={class:"tooltip-content"},CI={key:2,class:"analytics-chart-parent"},OI=7,AI=p.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},activeMetric:{default:void 0},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Pe.Bottom},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!1},showAnnotations:{type:Boolean,default:!0},timeseriesZoom:{type:Boolean,default:!1},requestsLink:{default:void 0},exploreLink:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=t,i=n,{i18n:r}=Tt.useI18n(),s=p.computed(()=>tl(i.chartData)?void 0:i.chartData),a=p.computed(()=>{const j=s.value?.meta,V=j?.metric_names??[];return["timeseries_line","timeseries_bar"].includes(i.chartOptions.type)&&V.length>1&&Object.keys(j?.display??{}).length>0?V:[]}),l=p.computed(()=>a.value.length>1),u=p.computed(()=>i.activeMetric&&a.value.includes(i.activeMetric)?i.activeMetric:a.value[0]),d=p.computed(()=>{const j=s.value;return!j||!l.value||!u.value?j:{...j,meta:{...j.meta,metric_names:[u.value]}}}),f=p.computed(()=>{const j=i.chartOptions.threshold;return!l.value||!j?j:{...j,...Object.fromEntries(Object.keys(j).filter(V=>V!==u.value).map(V=>[V,[]]))}}),g=p.computed(()=>{if(O.value)return tl(i.chartData)?i.chartData:My(i.chartData)}),m=p.computed(()=>{if(tl(i.chartData)){const{start:V,end:st,metric:ot,metricUnit:lt,truncated:pt,limit:dt,datasource:It}=i.chartData;return{start:V,end:st,metricNames:[ot],metricUnits:{[ot]:lt??""},truncated:pt,limit:dt,datasource:It}}const j=d.value?.meta;return{start:j?.start,end:j?.end,metricNames:j?.metric_names,metricUnits:j?.metric_units,truncated:j?.truncated,limit:j?.limit,datasource:j?.datasource}}),_=p.computed(()=>O.value?Tt.useScatterDatasets({colorPalette:i.chartOptions.chartDatasetColors,scatter:i.chartOptions.scatter},g).value:s.value?w.value?Tt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Iu},d).value:Tt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Iu},s).value:{datasets:[]}),x=p.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),S=p.computed(()=>{if(!i.chartData||s.value&&!s.value.meta)return 0;const{start:j,end:V}=m.value;if(j&&V)return new Date(V).getTime()-new Date(j).getTime()}),T=p.computed(()=>m.value.metricUnits?l.value&&u.value?m.value.metricUnits[u.value]??"":Object.values(m.value.metricUnits)[0]??"":""),C=p.computed(()=>m.value.metricUnits?l.value&&u.value?u.value:Object.keys(m.value.metricUnits)[0]??"":""),A=p.computed(()=>i.showLegendValues&&i.legendPosition!==Pe.Hidden),{legendValues:F}=Tt.useChartLegendValues(_,i.chartOptions.type,T),P=p.computed(()=>m.value.limit?.toString()||null),I=p.computed(()=>i.chartOptions.hideTruncationWarning?!1:m.value.truncated||!1),L=p.computed(()=>r.t("limitedResultsShown",{maxReturned:P.value})),N=p.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),w=p.computed(()=>["timeseries_bar","timeseries_line"].some(j=>j===i.chartOptions.type)),M=p.computed(()=>i.chartOptions.type==="donut"),O=p.computed(()=>i.chartOptions.type==="scatter"),B=p.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),W=p.computed(()=>{const{metricNames:j,metricUnits:V}=m.value;if(!j||!V)return;const st=j[0],ot=V[st]||"";if(j.length>1){if(st.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${ot}`,{plural:"s"})});if(st.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${ot}`,{plural:"s"})})}if(st)return po(ot)&&r.te(`metricAxisTitles.${st}`)?r.t(`metricAxisTitles.${st}`)||void 0:r.te(`chartLabels.${st}`)?r.t(`chartLabels.${st}`):st}),J=p.computed(()=>{if(i.chartOptions?.metricAxesTitle)return i.chartOptions?.metricAxesTitle;const{metricNames:j,metricUnits:V}=m.value;if(!j||!V)return;const st=j[0],ot=V[st]||"";if(j.length>1){if(st.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${ot}`,{plural:"s"})});if(st.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${ot}`,{plural:"s"})})}return r.te(`metricAxisTitles.${st}`)&&(po(ot)||r.te(`chartUnits.${ot}`))?po(ot)?r.t(`metricAxisTitles.${st}`)||void 0:r.t(`metricAxisTitles.${st}`,{unit:r.t(`chartUnits.${ot}`,{plural:"s"})})||void 0:st||void 0}),ut=p.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const j=s.value?.meta,V=w.value?"Time":Object.keys(j?.display||j?.metric_names||{})[0];if(V)return r.te(`chartLabels.${V}`)?r.t(`chartLabels.${V}`):V}),ft=p.computed(()=>O.value?H.value:ia(Number(s.value?.meta?.granularity_ms))),K=p.computed(()=>{if(ix(m.value.datasource))return r.t("timestampAxisTitles.platform");const j=ft.value;if(j)return r.te(`granularityAxisTitles.${j}`)?r.t(`granularityAxisTitles.${j}`):j}),nt=p.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),rt=p.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),it=p.computed(()=>O.value?!!g.value?.points.length:w.value?kE(_.value):!!(s.value&&s.value.meta&&s.value.data.length)),at=p.computed(()=>{const j=s.value;return j?j.meta.granularity_ms?ia(j.meta.granularity_ms)||"hourly":ia(new Date(j.data[1].timestamp).getTime()-new Date(j.data[0].timestamp).getTime())||"hourly":"hourly"}),H=p.computed(()=>ia(Math.floor((S.value||0)/OI))||"hourly"),q=p.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(j,V)=>j.text===r.t("chartLabels.____OTHER____")?1:V.text===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(j.text,10))&&!isNaN(parseInt(V.text,10))?j.text<V.text?-1:1:j.value&&V.value?V.value.raw-j.value.raw:0),X=p.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(j,V)=>j.label===r.t("chartLabels.____OTHER____")?1:V.label===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(j.label,10))&&!isNaN(parseInt(V.label,10))?j.label<V.label?-1:1:j.value&&V.value?V.rawValue-j.rawValue:0),_t=p.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:j=>e("zoom-time-range",j)}]:[],...i.exploreLink?[{label:r.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:r.t("zoom_action_items.view_requests"),key:"view-requests",href:i.requestsLink.href}]:[]]);return p.provide("showLegendValues",A),p.provide("legendPosition",p.toRef(i,"legendPosition")),(j,V)=>{const st=p.resolveComponent("KTooltip"),ot=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["analytics-chart-shell",{"show-values":A.value}])},[it.value&&I.value&&P.value?(p.openBlock(),p.createElementBlock("div",kI,[p.createVNode(st,{class:"tooltip","max-width":"500",placement:"right"},{content:p.withCtx(()=>[p.createElementVNode("div",DI,p.toDisplayString(L.value),1)]),default:p.withCtx(()=>[p.createVNode(p.unref(Ts.WarningIcon),{color:`var(--kui-color-text-warning, ${p.unref(pv)})`,size:`var(--kui-icon-size-40, ${p.unref(yv)})`},null,8,["color","size"])]),_:1})])):p.createCommentVNode("",!0),it.value?(p.openBlock(),p.createElementBlock("div",CI,[w.value?(p.openBlock(),p.createBlock(MI,{key:0,brush:x.value,"chart-data":_.value,"chart-legend-sort-fn":q.value,"chart-tooltip-sort-fn":X.value,"dimension-axes-title":K.value,fill:n.chartOptions.stacked,granularity:at.value,"legend-values":p.unref(F),"metric-axes-title":J.value,"metric-unit":T.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,threshold:f.value,"time-range-ms":S.value,"tooltip-metric-display":W.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type,"zoom-action-items":_t.value,onSelectChartRange:V[0]||(V[0]=lt=>e("select-chart-range",lt)),onZoomTimeRange:V[1]||(V[1]=lt=>e("zoom-time-range",lt))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):N.value?(p.openBlock(),p.createBlock(G2,{key:1,annotations:n.showAnnotations,"chart-data":_.value,"chart-legend-sort-fn":q.value,"chart-tooltip-sort-fn":X.value,"data-testid":"bar-chart-container","dimension-axes-title":ut.value,"legend-values":p.unref(F),"metric-axes-title":J.value,"metric-unit":T.value,orientation:B.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-metric-display":W.value,"tooltip-title":n.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):M.value?(p.openBlock(),p.createBlock(lI,{key:2,"chart-data":_.value,"dataset-colors":n.chartOptions.chartDatasetColors||p.unref(Iu),"legend-position":n.legendPosition,"legend-values":p.unref(F),"metric-name":C.value,"metric-unit":T.value,"show-center-metric":n.chartOptions.showCenterMetric,"synthetics-data-key":n.syntheticsDataKey,"tooltip-dimension-display":ut.value,"tooltip-metric-display":W.value,"tooltip-title":n.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"])):O.value?(p.openBlock(),p.createBlock(hI,{key:3,"chart-data":_.value,"chart-legend-sort-fn":n.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":X.value,"data-testid":"scatter-chart-container","dimension-axes-title":K.value,granularity:H.value,"metric-axes-title":J.value,"metric-unit":T.value,"shade-outlier-region":n.chartOptions.scatter?.shadeOutlierRegion,"synthetics-data-key":n.syntheticsDataKey,"time-range-ms":S.value,"tooltip-metric-display":W.value,"tooltip-title":n.tooltipTitle},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","time-range-ms","tooltip-metric-display","tooltip-title"])):p.createCommentVNode("",!0)])):(p.openBlock(),p.createBlock(ot,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(nt.value),1)]),default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(rt.value),1)]),_:1}))],2)}}}),EI=an(AI,[["__scopeId","data-v-604918de"]]),RI={class:"chart-parent","data-testid":"gauge-chart-parent"},PI={class:"chart-totals-flex"},II={key:1,class:"metric-small","data-testid":"gauge-chart-total"},LI=an(p.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:li},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=Tt.useI18n(),i=p.ref(ld()),r=p.computed(()=>[t.chartData.datasets.reduce((_,x)=>(_.labels.push(x.label),_.borderColor.push(x.backgroundColor),_.backgroundColor.push(x.backgroundColor),_.data.push(x.data.reduce((S,T)=>S+T,0)),_),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),s=p.computed(()=>({...t.chartData,datasets:r.value}));Tt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},l=p.computed(()=>lo(r?.value[0]?.data[t.numerator],{capital:!0})),u=p.computed(()=>lo(r?.value[0]?.data[0]+r?.value[0]?.data[1],{capital:!0})),d=p.computed(()=>`color: ${r?.value[0]?.backgroundColor[t.numerator]}`),f=p.computed(()=>["full","single"].includes(t.metricDisplay)),g=p.computed(()=>t.metricDisplay==="full");return(m,_)=>(p.openBlock(),p.createElementBlock("div",RI,[p.createElementVNode("div",PI,[f.value?(p.openBlock(),p.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:p.normalizeStyle(d.value)},p.toDisplayString(l.value),5)):p.createCommentVNode("",!0),g.value?(p.openBlock(),p.createElementBlock("div",II,p.toDisplayString(p.unref(e).t("total"))+": "+p.toDisplayString(u.value),1)):p.createCommentVNode("",!0)]),p.createElementVNode("div",{class:"chart-container",style:p.normalizeStyle({height:n.height,width:n.width})},[p.createVNode(p.unref(D_),{"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),NI={key:1,class:"single-value-wrapper"},BI={class:"single-value-metric"},FI={class:"name-unit-alignment"},zI={class:"single-value","data-testid":"single-value-chart"},UI={key:0,class:"single-value-unit"},HI={class:"single-value-metric-name"},WI={key:0,class:"single-value-trend"},$I={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},ud="t1",dd="t2",VI=an(p.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:Km},leftAlign:{type:Boolean,default:!1},showTrend:{type:Boolean,default:!1},increaseIsBad:{type:Boolean,default:!1},alignX:{type:String,default:"left"}},setup(n){const{i18n:t}=Tt.useI18n(),{formatBytes:e,formatCost:i}=ti({i18n:t}),r=n,s=p.computed(()=>`align-${r.leftAlign?"left":r.alignX}`),a=p.computed(()=>tr.buildDeltaMapping(r.data,r.showTrend,{topLevelKey:ud,secondLevelKey:dd})),l=p.computed(()=>a.value?.previous?.[ud]?.[dd]),u=p.computed(()=>a.value?.current?.[ud]?.[dd]),d=p.computed(()=>r.data.data),f=p.computed(()=>r.data.meta?.metric_names?.[0]),g=p.computed(()=>t.te(`chartLabels.${f.value}`)?t.t(`chartLabels.${f.value}`):""),m=p.computed(()=>{const O=f.value?r.data.meta?.metric_units?.[f.value]:void 0;if(O){const B=`chartUnits.${O}`;return t.te(B)?t.t(B,{plural:""}):""}}),_=p.computed(()=>!!f.value&&(f.value.includes("_per_minute")||f.value.includes("_latency_")||f.value==="error_rate")),x=p.computed(()=>r.showTrend&&l.value!==void 0?l.value:null),S=p.computed(()=>{if(r.showTrend)return u.value??null;if(d.value.length<1||!f.value)return null;const O=d.value[0].event[f.value];return typeof O!="number"||isNaN(O)?null:O}),T=p.computed(()=>r.data?.data?.length===void 0||r.data?.data?.length===0||!r.showTrend&&S.value===null||r.showTrend&&x.value===null&&S.value===null),C=p.computed(()=>{const O=S.value;if(O===null)return"-";const B=f.value?r.data.meta?.metric_units?.[f.value]:void 0;if(B==="usd")return i(O);if(B==="bytes")return e(O);if(O>=1e9){const J=(O/1e9).toFixed(1);return J.endsWith(".0")?`${Math.floor(O/1e9)}B`:`${J}B`}if(O>=1e7){const J=(O/1e6).toFixed(1);return J.endsWith(".0")?`${Math.floor(O/1e6)}M`:`${J}M`}const W=r.decimalPoints&&typeof r.decimalPoints=="number"?r.decimalPoints:Km;return O.toLocaleString("en-US",{maximumFractionDigits:W})}),A=p.computed(()=>r.showTrend&&r.data?.data?.length<2),F=p.computed(()=>tr.calculateChange(S.value??0,x.value??0)||0),P=p.computed(()=>{if(!r.showTrend)return 0;if(r.data?.data?.length<2){if(l.value===void 0)return 0;if(u.value===void 0)return r.increaseIsBad?1:-1}return tr.changePolarity(F.value,!0,r.increaseIsBad)}),I=p.computed(()=>tr.defineIcon(P.value,r.increaseIsBad)),L=p.computed(()=>{if(r.showTrend&&r.data?.data?.length<2){if(l.value===void 0)return t.t("singleValue.trend.not_available");if(u.value===void 0)return tr.metricChange(-1,!0,t.t("singleValue.trend.not_available"))}return tr.metricChange(F.value,r.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),N=tr.useTrendRange(p.computed(()=>r.showTrend),void 0,p.computed(()=>r.data.meta)),w=O=>O>0?"positive":O<0?"negative":"neutral",M=O=>O>0?hv:O<0?fv:qh;return p.onMounted(()=>{!r.showTrend&&r.data?.data?.length>1?console.warn("SingleValue chart should only be used with a single data point. Data length:",r.data.data.length):r.showTrend&&r.data?.data?.length>2&&console.warn("SingleValue with trend expects 2 or fewer data points. Instead got:",r.data.data.length)}),(O,B)=>{const W=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["chart-parent",s.value]),"data-testid":"single-value-parent"},[T.value?(p.openBlock(),p.createBlock(W,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:p.unref(t).t("singleValue.valueError")},null,8,["title"])):(p.openBlock(),p.createElementBlock("div",NI,[p.createElementVNode("div",BI,[p.createElementVNode("div",FI,[p.createElementVNode("span",zI,p.toDisplayString(C.value),1),_.value&&m.value?(p.openBlock(),p.createElementBlock("span",UI," "+p.toDisplayString(m.value),1)):p.createCommentVNode("",!0)]),p.createElementVNode("div",HI,p.toDisplayString(g.value),1)]),n.showTrend?(p.openBlock(),p.createElementBlock("div",WI,[p.createElementVNode("div",{class:p.normalizeClass(["trend-change",w(P.value)]),"data-testid":"single-value-trend"},[A.value||P.value!==0?(p.openBlock(),p.createBlock(p.resolveDynamicComponent(I.value),{key:0,color:M(P.value),size:`var(--kui-icon-size-30, ${p.unref(As)})`},null,8,["color","size"])):(p.openBlock(),p.createBlock(p.unref(Ts.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${p.unref(qh)})`,size:`var(--kui-icon-size-30, ${p.unref(As)})`},null,8,["color","size"])),p.createElementVNode("div",null,p.toDisplayString(L.value),1)],2),p.unref(N)?(p.openBlock(),p.createElementBlock("div",$I,p.toDisplayString(p.unref(N)),1)):p.createCommentVNode("",!0)])):p.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-640d8a8c"]]),YI={class:"simple-chart-shell"},qI={key:1,class:"analytics-chart-parent"},jI=an(p.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=Tt.useI18n(),i=p.computed(()=>{const d=Tt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||li},p.toRef(t,"chartData")).value;return t.chartOptions?.reverseDataset&&d?.datasets.reverse(),d}),r=p.computed(()=>t.chartData.meta?.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""),s=p.computed(()=>t.chartOptions.type==="gauge"),a=p.computed(()=>t.chartOptions.type==="single_value"),l=p.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),u=p.computed(()=>{const d=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(a.value){const f=t.chartData.meta?.metric_names?.[0];return d&&t.chartData.data[0].event[f]!==null}return d});return(d,f)=>{const g=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",YI,[u.value?(p.openBlock(),p.createElementBlock("div",qI,[s.value?(p.openBlock(),p.createBlock(LI,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":r.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):p.createCommentVNode("",!0),a.value?(p.openBlock(),p.createBlock(VI,{key:1,"align-x":n.chartOptions.alignX,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints,"increase-is-bad":n.chartOptions.increaseIsBad,"show-trend":n.chartOptions.showTrend},null,8,["align-x","data","decimal-points","increase-is-bad","show-trend"])):p.createCommentVNode("",!0)])):(p.openBlock(),p.createBlock(g,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(l.value),1)]),_:1}))])}}}),[["__scopeId","data-v-23ca8c84"]]),GI={class:"top-n-card-title","data-testid":"top-n-card-title"},KI={class:"top-n-card-description","data-testid":"top-n-card-description"},XI={key:3,class:"top-n-table","data-testid":"top-n-table"},ZI={"data-testid":"top-n-table-header"},QI={class:"top-n-table-header-row"},JI={class:"table-header-label"},tL=["data-testid"],eL=["data-testid"],nL=["data-testid"],iL=3,rL=an(p.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(n){const t=n,{i18n:e}=Tt.useI18n(),{formatUnit:i}=ti({i18n:e}),r=p.computed(()=>t.data.data),s=p.computed(()=>!!r.value?.length),a=p.computed(()=>t.data.meta?.display?Object.keys(t.data.meta.display).slice(0,iL):[]),l=p.computed(()=>a.value[0]||""),u=p.computed(()=>a.value.length>1),d=p.computed(()=>a.value[a.value.length-1]||""),f=p.computed(()=>l.value?t.data.meta.display[l.value]:{}),g=p.computed(()=>t.data.meta?.metric_names?.length?t.data.meta.metric_names:[]),m=p.computed(()=>g.value[0]),_=p.computed(()=>m.value?ut(m.value):""),x=p.computed(()=>{const K=a.value.map(nt=>({key:nt,label:u.value?ut(nt):e.t("topNTable.nameLabel"),type:"dimension"}));return m.value&&K.push({key:"value",label:_.value,type:"metric"}),g.value.forEach((nt,rt)=>{rt!==0&&K.push({key:nt,label:ut(nt),type:"metric"})}),K}),S=p.computed(()=>x.value.filter(K=>K.type==="metric")),T=p.computed(()=>x.value.filter(K=>K.type==="dimension").slice(1)),C=K=>K.type==="dimension"&&K.key===d.value,A=K=>u.value&&K.type==="dimension"&&!C(K),F=K=>{const nt=K.event;return String(nt[l.value])},P=(K,nt)=>{const rt=String(K.event[nt]),it=t.data.meta?.display?.[nt]?.[rt];return{dimension:nt,id:rt,name:it?.name||"-",deleted:!!it?.deleted}},I=K=>{const nt=F(K),rt=f.value&&f.value[nt];return rt?rt.name:"-"},L=K=>{const nt=F(K),rt=f.value&&f.value[nt];return rt?!!rt.deleted:!1},N=(K,nt)=>{const rt=K.event[nt];if(rt==null)return"–";const it=typeof rt=="number"?rt:Number(rt);if(Number.isNaN(it))return"–";const at=t.data.meta?.metric_units?.[nt]||"count",H=["count","count/minute","token count"].includes(at);return i(it,at,{approximate:H,isBytes1024:!0,translateUnit:q=>ft(q,it)})},w=K=>m.value?N(K,m.value):"–",M=p.computed(()=>r.value?.length?r.value.map(K=>{const nt=a.value.map(H=>P(K,H)),rt=nt[0],it=rt?.id||F(K),at={id:it,rowKey:nt.map(H=>`${H.dimension}:${H.id}`).join("|")||it,name:rt?.name||I(K),deleted:L(K),dimensions:nt,original:K};return m.value&&(at.value=w(K)),g.value.forEach((H,q)=>{q!==0&&(at[H]=N(K,H))}),at}):[]),O=p.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value.some(K=>!Object.keys(t.data.meta.display[K]||{}).length))return e.t("topNTable.errors.display");if(!m.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),B=(K,nt)=>{const rt=K[nt];return typeof rt=="string"?rt:rt==null?"–":String(rt)},W=(K,nt)=>K.dimensions.find(rt=>rt.dimension===nt)?.name||"–",J=(K,nt)=>{const rt=K.dimensions.find(it=>it.dimension===nt);return{id:rt?.id||"",name:rt?.name||"–",deleted:rt?.deleted||!1,dimension:nt,dimensions:K.dimensions,isEmpty:rt?.id==="empty"}},ut=K=>e.te(`chartLabels.${K}`)?e.t(`chartLabels.${K}`):K,ft=(K,nt)=>{if(po(K)||K==="count"||K==="requests")return"";const rt=nt===1?"":"s";return e.te(`chartUnits.${K}`)?e.t(`chartUnits.${K}`,{plural:rt}):K};return(K,nt)=>{const rt=p.resolveComponent("KEmptyState"),it=p.resolveComponent("KSkeleton"),at=p.resolveComponent("KCard");return p.openBlock(),p.createBlock(at,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},p.createSlots({default:p.withCtx(()=>[O.value?(p.openBlock(),p.createBlock(rt,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(O.value),1)]),_:1})):n.isLoading?(p.openBlock(),p.createBlock(it,{key:1,"table-columns":2,type:"table"})):s.value?(p.openBlock(),p.createElementBlock("div",XI,[p.createElementVNode("table",{class:p.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":u.value}])},[p.createElementVNode("thead",ZI,[p.createElementVNode("tr",QI,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(x.value,H=>(p.openBlock(),p.createElementBlock("th",{key:H.key,class:p.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":H.type==="metric","top-n-table-header-cell-dimension-compact":A(H)}]),"data-testid":"top-n-table-header-column"},[p.createElementVNode("span",JI,p.toDisplayString(H.label),1)],2))),128))])]),p.createElementVNode("tbody",null,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(M.value,H=>(p.openBlock(),p.createElementBlock("tr",{key:H.rowKey,class:"top-n-table-row"},[a.value.length?(p.openBlock(),p.createElementBlock("td",{key:0,class:p.normalizeClass(["top-n-table-cell top-n-table-cell--name",{"top-n-table-cell-dimension-compact":u.value}])},[p.createElementVNode("span",{"data-testid":`row-${H.id}`},[p.renderSlot(K.$slots,"name",{record:{id:H.id,name:H.name,deleted:H.deleted,dimension:l.value,dimensions:H.dimensions,isEmpty:H.id==="empty"}},()=>[p.createTextVNode(p.toDisplayString(H.name),1)],!0)],8,tL)],2)):p.createCommentVNode("",!0),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(T.value,q=>(p.openBlock(),p.createElementBlock("td",{key:q.key,class:p.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!C(q)}])},[p.renderSlot(K.$slots,"name",{record:J(H,q.key)},()=>[p.createTextVNode(p.toDisplayString(W(H,q.key)),1)],!0)],2))),128)),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(S.value,q=>(p.openBlock(),p.createElementBlock("td",{key:q.key,class:"top-n-table-cell top-n-table-cell-metric"},[q.key==="value"?(p.openBlock(),p.createElementBlock("span",{key:0,"data-testid":`row-${H.id}`},p.toDisplayString(B(H,q.key)),9,eL)):(p.openBlock(),p.createElementBlock("span",{key:1,"data-testid":`row-${H.id}-${q.key}`},p.toDisplayString(B(H,q.key)),9,nL))]))),128))]))),128))])],2)])):(p.openBlock(),p.createBlock(rt,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(n.emptyStateTitle||p.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:p.withCtx(()=>[p.createElementVNode("span",GI,p.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:p.withCtx(()=>[p.createElementVNode("div",KI,p.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-0dc897d6"]]),sL={class:"container"},oL={key:0,class:"no-data","data-testid":"sparkline-empty"},aL=["title"],lL=an(p.defineComponent({__name:"SparklineChart",props:{chartKey:{default:()=>{}},datasets:{},disableTooltip:{type:Boolean,default:!1},enableBrushing:{type:Boolean,default:!1},groupKey:{default:()=>{}},maxCount:{default:()=>{}},maxStamp:{default:()=>{}},minCount:{default:()=>{}},minStamp:{default:()=>{}},pointRenderCount:{default:24},showLabel:{type:Boolean,default:!1},tooltipTitle:{default:()=>{}},type:{default:"sparkline_bar"}},setup(n){const t=crypto.randomUUID(),{i18n:e}=Tt.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:r,syncedMaxStamp:s,syncedMinCount:a,syncedMaxCount:l,syncedRenderPoints:u,syncedChartDatasets:d}=Tt.useSparklineSync({chartKey:n.chartKey,datasets:n.datasets,groupKey:n.groupKey,minStamp:n.minStamp,maxStamp:n.maxStamp,minCount:n.minCount,maxCount:n.maxCount,renderPoints:n.pointRenderCount,type:n.type}),f=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:n.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),g=({width:N,height:w})=>{f.width=N,f.height=w},m=p.computed(()=>n.disableTooltip?[]:[new O_({enableBrushing:n.groupKey!==void 0&&n.chartKey!==void 0&&n.enableBrushing,brushStrategy:"group",brushGroup:n.groupKey})]),_=p.computed(()=>d.value.reduce((N,{data:w,label:M})=>({...N,[M]:w.reduce((O,{y:B})=>O+B,0)}),{})),x=p.computed(()=>d.value.map(({label:N})=>[_.value[N],`${N}: ${_.value[N]}`]).sort(([N],[w])=>w-N).map(([,N])=>N).join(", ")),S=p.computed(()=>Object.keys(_.value).map(N=>_.value[N]).reduce((N,w)=>N+w,0)),T=p.computed(()=>S.value>0),C=p.computed(()=>({labels:new Array(u.value).fill(""),datasets:d.value})),A=p.computed(()=>n.datasets.length>1),F=`SparklineTooltipPosition-${t}`,P=p.computed(()=>{const N=n.type==="sparkline_bar",w=N?r.value-1:r.value,M=N?s.value:s.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:n.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:N?0:2,right:N?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:F,external:O=>{Cu(f,O,"minutely",{contextFormatter:B=>{const W=B+i.value;let J="";return i.value>1440*60*1e3?J=da(new Date(W),"MMM dd, yyy hh:mm a"):J=da(new Date(W),"hh:mm a"),`${Gw(B)} - ${J}`}})}}},scales:{x:{min:w,max:M,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:A.value},y:{min:Math.max(a.value-1,0),max:l.value,grid:{display:!1},display:!1,stacked:A.value}}}}),I=p.ref("0"),L=p.ref("0");return p.onMounted(()=>{Ve.positioners[F]=function(N,w){if(!N.length||f.interactionMode==="interactive"||w.x===null)return!1;const M=10,O=this.chart.canvas.getBoundingClientRect(),B=f.width||this.width,W=f.height||this.height,J=O.top-W>0,ut=J?O.top-W-M:O.top+O.height+M,ft=O.left>B/2-w.x,K=Math.max(M,window.innerWidth-M-B),nt=Math.min(K,ft?Math.floor(O.left-B/2)+w.x:0+M);return I.value=`${ut}px`,L.value=`${nt}px`,{x:nt,y:ut,xAlign:"center",yAlign:J?"top":"bottom"}}}),p.onUnmounted(()=>{Ve.positioners[F]&&delete Ve.positioners[F]}),(N,w)=>(p.openBlock(),p.createElementBlock("div",sL,[T.value?n.type==="sparkline_bar"?(p.openBlock(),p.createBlock(p.unref(k_),{key:1,"chart-id":p.unref(t),data:C.value,"data-testid":"sparkline-bar",options:P.value,plugins:m.value},null,8,["chart-id","data","options","plugins"])):n.type==="sparkline_line"||n.type==="sparkline_step"?(p.openBlock(),p.createBlock(p.unref(C_),{key:2,"chart-id":p.unref(t),data:C.value,"data-testid":n.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:P.value,plugins:m.value},null,8,["chart-id","data","data-testid","options","plugins"])):p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",oL,[p.renderSlot(N.$slots,"empty",{},()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("sparkline_no_data")),1)],!0)])),n.disableTooltip?p.createCommentVNode("",!0):(p.openBlock(),p.createBlock(wo,{key:3,"absolute-left":L.value,"absolute-top":I.value,class:"tooltip","data-testid":"sparkline-tooltip",state:f,"tooltip-title":n.tooltipTitle,onDimensions:g},null,8,["absolute-left","absolute-top","state","tooltip-title"])),T.value&&n.showLabel?(p.openBlock(),p.createElementBlock("div",{key:4,class:"label",title:N.$slots.label?"":x.value},[p.renderSlot(N.$slots,"label",{total:S.value,totalByDataset:_.value},()=>[p.createTextVNode(p.toDisplayString(x.value),1)],!0)],8,aL)):p.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]);var Ui=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vo={exports:{}};var cL=vo.exports,P_;function uL(){return P_||(P_=1,(function(n,t){(function(){var e,i="4.18.1",r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",l="Invalid `variable` option passed into `_.template`",u="Invalid `imports` option passed into `_.template`",d="__lodash_hash_undefined__",f=500,g="__lodash_placeholder__",m=1,_=2,x=4,S=1,T=2,C=1,A=2,F=4,P=8,I=16,L=32,N=64,w=128,M=256,O=512,B=30,W="...",J=800,ut=16,ft=1,K=2,nt=3,rt=1/0,it=9007199254740991,at=17976931348623157e292,H=NaN,q=4294967295,X=q-1,_t=q>>>1,j=[["ary",w],["bind",C],["bindKey",A],["curry",P],["curryRight",I],["flip",O],["partial",L],["partialRight",N],["rearg",M]],V="[object Arguments]",st="[object Array]",ot="[object AsyncFunction]",lt="[object Boolean]",pt="[object Date]",dt="[object DOMException]",It="[object Error]",zt="[object Function]",vt="[object GeneratorFunction]",Ct="[object Map]",Dt="[object Number]",ve="[object Null]",bt="[object Object]",jt="[object Promise]",Oe="[object Proxy]",Ae="[object RegExp]",oe="[object Set]",ln="[object String]",$t="[object Symbol]",Le="[object Undefined]",ie="[object WeakMap]",Se="[object WeakSet]",Ee="[object ArrayBuffer]",gn="[object DataView]",Hi="[object Float32Array]",Dn="[object Float64Array]",Ye="[object Int8Array]",In="[object Int16Array]",ui="[object Int32Array]",So="[object Uint8Array]",To="[object Uint8ClampedArray]",xr="[object Uint16Array]",di="[object Uint32Array]",Mo=/\b__p \+= '';/g,ko=/\b(__p \+=) '' \+/g,Do=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Wi=/&(?:amp|lt|gt|quot|#39);/g,pl=/[&<>"']/g,fd=RegExp(Wi.source),hd=RegExp(pl.source),pd=/<%-([\s\S]+?)%>/g,gd=/<%([\s\S]+?)%>/g,Co=/<%=([\s\S]+?)%>/g,gl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fi=/^\w*$/,md=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Oo=/[\\^$.*+?()[\]{}|]/g,yd=RegExp(Oo.source),Ao=/^\s+/,_d=/\s/,Ln=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,bd=/\{\n\/\* \[wrapped with (.+)\] \*/,xd=/,? & /,wd=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ml=/[()=,{}\[\]\/\s]/,vd=/\\(\\)?/g,$i=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yl=/\w*$/,Sd=/^[-+]0x[0-9a-f]+$/i,Td=/^0b[01]+$/i,Md=/^\[object .+?Constructor\]$/,kd=/^0o[0-7]+$/i,Vi=/^(?:0|[1-9]\d*)$/,Dd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ns=/($^)/,Cd=/['\n\r\u2028\u2029\\]/g,is="\\ud800-\\udfff",Od="\\u0300-\\u036f",Ad="\\ufe20-\\ufe2f",_l="\\u20d0-\\u20ff",wr=Od+Ad+_l,bl="\\u2700-\\u27bf",rs="a-z\\xdf-\\xf6\\xf8-\\xff",Ed="\\xac\\xb1\\xd7\\xf7",Rd="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Pd="\\u2000-\\u206f",Id=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",xl="A-Z\\xc0-\\xd6\\xd8-\\xde",wl="\\ufe0e\\ufe0f",ss=Ed+Rd+Pd+Id,Eo="['’]",Ld="["+is+"]",vl="["+ss+"]",os="["+wr+"]",Sl="\\d+",Nd="["+bl+"]",Tl="["+rs+"]",Ro="[^"+is+ss+Sl+bl+rs+xl+"]",Po="\\ud83c[\\udffb-\\udfff]",Bd="(?:"+os+"|"+Po+")",vr="[^"+is+"]",Gn="(?:\\ud83c[\\udde6-\\uddff]){2}",as="[\\ud800-\\udbff][\\udc00-\\udfff]",cn="["+xl+"]",Ml="\\u200d",kl="(?:"+Tl+"|"+Ro+")",Fd="(?:"+cn+"|"+Ro+")",Dl="(?:"+Eo+"(?:d|ll|m|re|s|t|ve))?",Cl="(?:"+Eo+"(?:D|LL|M|RE|S|T|VE))?",Ol=Bd+"?",Io="["+wl+"]?",hi="(?:"+Ml+"(?:"+[vr,Gn,as].join("|")+")"+Io+Ol+")*",zd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Al="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",El=Io+Ol+hi,Lo="(?:"+[Nd,Gn,as].join("|")+")"+El,Rl="(?:"+[vr+os+"?",os,Gn,as,Ld].join("|")+")",Ud=RegExp(Eo,"g"),Hd=RegExp(os,"g"),ls=RegExp(Po+"(?="+Po+")|"+Rl+El,"g"),Wd=RegExp([cn+"?"+Tl+"+"+Dl+"(?="+[vl,cn,"$"].join("|")+")",Fd+"+"+Cl+"(?="+[vl,cn+kl,"$"].join("|")+")",cn+"?"+kl+"+"+Dl,cn+"+"+Cl,Al,zd,Sl,Lo].join("|"),"g"),cs=RegExp("["+Ml+is+wr+wl+"]"),$d=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,No=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Vd=-1,ee={};ee[Hi]=ee[Dn]=ee[Ye]=ee[In]=ee[ui]=ee[So]=ee[To]=ee[xr]=ee[di]=!0,ee[V]=ee[st]=ee[Ee]=ee[lt]=ee[gn]=ee[pt]=ee[It]=ee[zt]=ee[Ct]=ee[Dt]=ee[bt]=ee[Ae]=ee[oe]=ee[ln]=ee[ie]=!1;var D={};D[V]=D[st]=D[Ee]=D[gn]=D[lt]=D[pt]=D[Hi]=D[Dn]=D[Ye]=D[In]=D[ui]=D[Ct]=D[Dt]=D[bt]=D[Ae]=D[oe]=D[ln]=D[$t]=D[So]=D[To]=D[xr]=D[di]=!0,D[It]=D[zt]=D[ie]=!1;var $={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},tt={"&":"&","<":"<",">":">",'"':""","'":"'"},mt={"&":"&","<":"<",">":">",""":'"',"'":"'"},Te={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},qe=parseFloat,Nn=parseInt,Ne=typeof Ui=="object"&&Ui&&Ui.Object===Object&&Ui,Pl=typeof self=="object"&&self&&self.Object===Object&&self,ce=Ne||Pl||Function("return this")(),us=t&&!t.nodeType&&t,Kn=us&&!0&&n&&!n.nodeType&&n,Bo=Kn&&Kn.exports===us,Sr=Bo&&Ne.process,Be=(function(){try{var z=Kn&&Kn.require&&Kn.require("util").types;return z||Sr&&Sr.binding&&Sr.binding("util")}catch{}})(),F_=Be&&Be.isArrayBuffer,z_=Be&&Be.isDate,U_=Be&&Be.isMap,H_=Be&&Be.isRegExp,W_=Be&&Be.isSet,$_=Be&&Be.isTypedArray;function mn(z,G,Y){switch(Y.length){case 0:return z.call(G);case 1:return z.call(G,Y[0]);case 2:return z.call(G,Y[0],Y[1]);case 3:return z.call(G,Y[0],Y[1],Y[2])}return z.apply(G,Y)}function TL(z,G,Y,ht){for(var Ot=-1,Vt=z==null?0:z.length;++Ot<Vt;){var Me=z[Ot];G(ht,Me,Y(Me),z)}return ht}function yn(z,G){for(var Y=-1,ht=z==null?0:z.length;++Y<ht&&G(z[Y],Y,z)!==!1;);return z}function ML(z,G){for(var Y=z==null?0:z.length;Y--&&G(z[Y],Y,z)!==!1;);return z}function V_(z,G){for(var Y=-1,ht=z==null?0:z.length;++Y<ht;)if(!G(z[Y],Y,z))return!1;return!0}function Yi(z,G){for(var Y=-1,ht=z==null?0:z.length,Ot=0,Vt=[];++Y<ht;){var Me=z[Y];G(Me,Y,z)&&(Vt[Ot++]=Me)}return Vt}function Il(z,G){var Y=z==null?0:z.length;return!!Y&&ds(z,G,0)>-1}function Yd(z,G,Y){for(var ht=-1,Ot=z==null?0:z.length;++ht<Ot;)if(Y(G,z[ht]))return!0;return!1}function ue(z,G){for(var Y=-1,ht=z==null?0:z.length,Ot=Array(ht);++Y<ht;)Ot[Y]=G(z[Y],Y,z);return Ot}function qi(z,G){for(var Y=-1,ht=G.length,Ot=z.length;++Y<ht;)z[Ot+Y]=G[Y];return z}function qd(z,G,Y,ht){var Ot=-1,Vt=z==null?0:z.length;for(ht&&Vt&&(Y=z[++Ot]);++Ot<Vt;)Y=G(Y,z[Ot],Ot,z);return Y}function kL(z,G,Y,ht){var Ot=z==null?0:z.length;for(ht&&Ot&&(Y=z[--Ot]);Ot--;)Y=G(Y,z[Ot],Ot,z);return Y}function jd(z,G){for(var Y=-1,ht=z==null?0:z.length;++Y<ht;)if(G(z[Y],Y,z))return!0;return!1}var DL=Gd("length");function CL(z){return z.split("")}function OL(z){return z.match(wd)||[]}function Y_(z,G,Y){var ht;return Y(z,function(Ot,Vt,Me){if(G(Ot,Vt,Me))return ht=Vt,!1}),ht}function Ll(z,G,Y,ht){for(var Ot=z.length,Vt=Y+(ht?1:-1);ht?Vt--:++Vt<Ot;)if(G(z[Vt],Vt,z))return Vt;return-1}function ds(z,G,Y){return G===G?HL(z,G,Y):Ll(z,q_,Y)}function AL(z,G,Y,ht){for(var Ot=Y-1,Vt=z.length;++Ot<Vt;)if(ht(z[Ot],G))return Ot;return-1}function q_(z){return z!==z}function j_(z,G){var Y=z==null?0:z.length;return Y?Xd(z,G)/Y:H}function Gd(z){return function(G){return G==null?e:G[z]}}function Kd(z){return function(G){return z==null?e:z[G]}}function G_(z,G,Y,ht,Ot){return Ot(z,function(Vt,Me,ne){Y=ht?(ht=!1,Vt):G(Y,Vt,Me,ne)}),Y}function EL(z,G){var Y=z.length;for(z.sort(G);Y--;)z[Y]=z[Y].value;return z}function Xd(z,G){for(var Y,ht=-1,Ot=z.length;++ht<Ot;){var Vt=G(z[ht]);Vt!==e&&(Y=Y===e?Vt:Y+Vt)}return Y}function Zd(z,G){for(var Y=-1,ht=Array(z);++Y<z;)ht[Y]=G(Y);return ht}function RL(z,G){return ue(G,function(Y){return[Y,z[Y]]})}function K_(z){return z&&z.slice(0,J_(z)+1).replace(Ao,"")}function _n(z){return function(G){return z(G)}}function Qd(z,G){return ue(G,function(Y){return z[Y]})}function Fo(z,G){return z.has(G)}function X_(z,G){for(var Y=-1,ht=z.length;++Y<ht&&ds(G,z[Y],0)>-1;);return Y}function Z_(z,G){for(var Y=z.length;Y--&&ds(G,z[Y],0)>-1;);return Y}function PL(z,G){for(var Y=z.length,ht=0;Y--;)z[Y]===G&&++ht;return ht}var IL=Kd($),LL=Kd(tt);function NL(z){return"\\"+Te[z]}function BL(z,G){return z==null?e:z[G]}function fs(z){return cs.test(z)}function FL(z){return $d.test(z)}function zL(z){for(var G,Y=[];!(G=z.next()).done;)Y.push(G.value);return Y}function Jd(z){var G=-1,Y=Array(z.size);return z.forEach(function(ht,Ot){Y[++G]=[Ot,ht]}),Y}function Q_(z,G){return function(Y){return z(G(Y))}}function ji(z,G){for(var Y=-1,ht=z.length,Ot=0,Vt=[];++Y<ht;){var Me=z[Y];(Me===G||Me===g)&&(z[Y]=g,Vt[Ot++]=Y)}return Vt}function Nl(z){var G=-1,Y=Array(z.size);return z.forEach(function(ht){Y[++G]=ht}),Y}function UL(z){var G=-1,Y=Array(z.size);return z.forEach(function(ht){Y[++G]=[ht,ht]}),Y}function HL(z,G,Y){for(var ht=Y-1,Ot=z.length;++ht<Ot;)if(z[ht]===G)return ht;return-1}function WL(z,G,Y){for(var ht=Y+1;ht--;)if(z[ht]===G)return ht;return ht}function hs(z){return fs(z)?VL(z):DL(z)}function Bn(z){return fs(z)?YL(z):CL(z)}function J_(z){for(var G=z.length;G--&&_d.test(z.charAt(G)););return G}var $L=Kd(mt);function VL(z){for(var G=ls.lastIndex=0;ls.test(z);)++G;return G}function YL(z){return z.match(ls)||[]}function qL(z){return z.match(Wd)||[]}var jL=(function z(G){G=G==null?ce:ps.defaults(ce.Object(),G,ps.pick(ce,No));var Y=G.Array,ht=G.Date,Ot=G.Error,Vt=G.Function,Me=G.Math,ne=G.Object,tf=G.RegExp,GL=G.String,Cn=G.TypeError,Bl=Y.prototype,KL=Vt.prototype,gs=ne.prototype,Fl=G["__core-js_shared__"],zl=KL.toString,Gt=gs.hasOwnProperty,XL=0,t0=(function(){var o=/[^.]+$/.exec(Fl&&Fl.keys&&Fl.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),Ul=gs.toString,ZL=zl.call(ne),QL=ce._,JL=tf("^"+zl.call(Gt).replace(Oo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hl=Bo?G.Buffer:e,Gi=G.Symbol,Wl=G.Uint8Array,e0=Hl?Hl.allocUnsafe:e,$l=Q_(ne.getPrototypeOf,ne),n0=ne.create,i0=gs.propertyIsEnumerable,Vl=Bl.splice,r0=Gi?Gi.isConcatSpreadable:e,zo=Gi?Gi.iterator:e,Tr=Gi?Gi.toStringTag:e,Yl=(function(){try{var o=Or(ne,"defineProperty");return o({},"",{}),o}catch{}})(),tN=G.clearTimeout!==ce.clearTimeout&&G.clearTimeout,eN=ht&&ht.now!==ce.Date.now&&ht.now,nN=G.setTimeout!==ce.setTimeout&&G.setTimeout,ql=Me.ceil,jl=Me.floor,ef=ne.getOwnPropertySymbols,iN=Hl?Hl.isBuffer:e,s0=G.isFinite,rN=Bl.join,sN=Q_(ne.keys,ne),ke=Me.max,je=Me.min,oN=ht.now,aN=G.parseInt,o0=Me.random,lN=Bl.reverse,nf=Or(G,"DataView"),Uo=Or(G,"Map"),rf=Or(G,"Promise"),ms=Or(G,"Set"),Ho=Or(G,"WeakMap"),Wo=Or(ne,"create"),Gl=Ho&&new Ho,ys={},cN=Ar(nf),uN=Ar(Uo),dN=Ar(rf),fN=Ar(ms),hN=Ar(Ho),Kl=Gi?Gi.prototype:e,$o=Kl?Kl.valueOf:e,a0=Kl?Kl.toString:e;function v(o){if(ge(o)&&!Rt(o)&&!(o instanceof Ut)){if(o instanceof On)return o;if(Gt.call(o,"__wrapped__"))return lb(o)}return new On(o)}var _s=(function(){function o(){}return function(c){if(!fe(c))return{};if(n0)return n0(c);o.prototype=c;var h=new o;return o.prototype=e,h}})();function Xl(){}function On(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=e}v.templateSettings={escape:pd,evaluate:gd,interpolate:Co,variable:"",imports:{_:v}},v.prototype=Xl.prototype,v.prototype.constructor=v,On.prototype=_s(Xl.prototype),On.prototype.constructor=On;function Ut(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=q,this.__views__=[]}function pN(){var o=new Ut(this.__wrapped__);return o.__actions__=un(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=un(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=un(this.__views__),o}function gN(){if(this.__filtered__){var o=new Ut(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function mN(){var o=this.__wrapped__.value(),c=this.__dir__,h=Rt(o),y=c<0,b=h?o.length:0,k=CB(0,b,this.__views__),E=k.start,R=k.end,U=R-E,Z=y?R:E-1,Q=this.__iteratees__,et=Q.length,ct=0,yt=je(U,this.__takeCount__);if(!h||!y&&b==U&&yt==U)return E0(o,this.__actions__);var Mt=[];t:for(;U--&&ct<yt;){Z+=c;for(var Nt=-1,wt=o[Z];++Nt<et;){var Ft=Q[Nt],Ht=Ft.iteratee,wn=Ft.type,tn=Ht(wt);if(wn==K)wt=tn;else if(!tn){if(wn==ft)continue t;break t}}Mt[ct++]=wt}return Mt}Ut.prototype=_s(Xl.prototype),Ut.prototype.constructor=Ut;function Mr(o){var c=-1,h=o==null?0:o.length;for(this.clear();++c<h;){var y=o[c];this.set(y[0],y[1])}}function yN(){this.__data__=Wo?Wo(null):{},this.size=0}function _N(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function bN(o){var c=this.__data__;if(Wo){var h=c[o];return h===d?e:h}return Gt.call(c,o)?c[o]:e}function xN(o){var c=this.__data__;return Wo?c[o]!==e:Gt.call(c,o)}function wN(o,c){var h=this.__data__;return this.size+=this.has(o)?0:1,h[o]=Wo&&c===e?d:c,this}Mr.prototype.clear=yN,Mr.prototype.delete=_N,Mr.prototype.get=bN,Mr.prototype.has=xN,Mr.prototype.set=wN;function pi(o){var c=-1,h=o==null?0:o.length;for(this.clear();++c<h;){var y=o[c];this.set(y[0],y[1])}}function vN(){this.__data__=[],this.size=0}function SN(o){var c=this.__data__,h=Zl(c,o);if(h<0)return!1;var y=c.length-1;return h==y?c.pop():Vl.call(c,h,1),--this.size,!0}function TN(o){var c=this.__data__,h=Zl(c,o);return h<0?e:c[h][1]}function MN(o){return Zl(this.__data__,o)>-1}function kN(o,c){var h=this.__data__,y=Zl(h,o);return y<0?(++this.size,h.push([o,c])):h[y][1]=c,this}pi.prototype.clear=vN,pi.prototype.delete=SN,pi.prototype.get=TN,pi.prototype.has=MN,pi.prototype.set=kN;function gi(o){var c=-1,h=o==null?0:o.length;for(this.clear();++c<h;){var y=o[c];this.set(y[0],y[1])}}function DN(){this.size=0,this.__data__={hash:new Mr,map:new(Uo||pi),string:new Mr}}function CN(o){var c=cc(this,o).delete(o);return this.size-=c?1:0,c}function ON(o){return cc(this,o).get(o)}function AN(o){return cc(this,o).has(o)}function EN(o,c){var h=cc(this,o),y=h.size;return h.set(o,c),this.size+=h.size==y?0:1,this}gi.prototype.clear=DN,gi.prototype.delete=CN,gi.prototype.get=ON,gi.prototype.has=AN,gi.prototype.set=EN;function kr(o){var c=-1,h=o==null?0:o.length;for(this.__data__=new gi;++c<h;)this.add(o[c])}function RN(o){return this.__data__.set(o,d),this}function PN(o){return this.__data__.has(o)}kr.prototype.add=kr.prototype.push=RN,kr.prototype.has=PN;function Fn(o){var c=this.__data__=new pi(o);this.size=c.size}function IN(){this.__data__=new pi,this.size=0}function LN(o){var c=this.__data__,h=c.delete(o);return this.size=c.size,h}function NN(o){return this.__data__.get(o)}function BN(o){return this.__data__.has(o)}function FN(o,c){var h=this.__data__;if(h instanceof pi){var y=h.__data__;if(!Uo||y.length<r-1)return y.push([o,c]),this.size=++h.size,this;h=this.__data__=new gi(y)}return h.set(o,c),this.size=h.size,this}Fn.prototype.clear=IN,Fn.prototype.delete=LN,Fn.prototype.get=NN,Fn.prototype.has=BN,Fn.prototype.set=FN;function l0(o,c){var h=Rt(o),y=!h&&Er(o),b=!h&&!y&&Ji(o),k=!h&&!y&&!b&&vs(o),E=h||y||b||k,R=E?Zd(o.length,GL):[],U=R.length;for(var Z in o)(c||Gt.call(o,Z))&&!(E&&(Z=="length"||b&&(Z=="offset"||Z=="parent")||k&&(Z=="buffer"||Z=="byteLength"||Z=="byteOffset")||_i(Z,U)))&&R.push(Z);return R}function c0(o){var c=o.length;return c?o[gf(0,c-1)]:e}function zN(o,c){return uc(un(o),Dr(c,0,o.length))}function UN(o){return uc(un(o))}function sf(o,c,h){(h!==e&&!Un(o[c],h)||h===e&&!(c in o))&&Xn(o,c,h)}function Vo(o,c,h){var y=o[c];(!(Gt.call(o,c)&&Un(y,h))||h===e&&!(c in o))&&Xn(o,c,h)}function Zl(o,c){for(var h=o.length;h--;)if(Un(o[h][0],c))return h;return-1}function HN(o,c,h,y){return Ki(o,function(b,k,E){c(y,b,h(b),E)}),y}function u0(o,c){return o&&Qn(c,Re(c),o)}function WN(o,c){return o&&Qn(c,fn(c),o)}function Xn(o,c,h){c=="__proto__"&&Yl?Yl(o,c,{configurable:!0,enumerable:!0,value:h,writable:!0}):o[c]=h}function of(o,c){for(var h=-1,y=c.length,b=Y(y),k=o==null;++h<y;)b[h]=k?e:Hf(o,c[h]);return b}function Dr(o,c,h){return o===o&&(h!==e&&(o=o<=h?o:h),c!==e&&(o=o>=c?o:c)),o}function An(o,c,h,y,b,k){var E,R=c&m,U=c&_,Z=c&x;if(h&&(E=b?h(o,y,b,k):h(o)),E!==e)return E;if(!fe(o))return o;var Q=Rt(o);if(Q){if(E=AB(o),!R)return un(o,E)}else{var et=Ge(o),ct=et==zt||et==vt;if(Ji(o))return I0(o,R);if(et==bt||et==V||ct&&!b){if(E=U||ct?{}:J0(o),!R)return U?bB(o,WN(E,o)):_B(o,u0(E,o))}else{if(!D[et])return b?o:{};E=EB(o,et,R)}}k||(k=new Fn);var yt=k.get(o);if(yt)return yt;k.set(o,E),Cb(o)?o.forEach(function(wt){E.add(An(wt,c,h,wt,o,k))}):kb(o)&&o.forEach(function(wt,Ft){E.set(Ft,An(wt,c,h,Ft,o,k))});var Mt=Z?U?kf:Mf:U?fn:Re,Nt=Q?e:Mt(o);return yn(Nt||o,function(wt,Ft){Nt&&(Ft=wt,wt=o[Ft]),Vo(E,Ft,An(wt,c,h,Ft,o,k))}),E}function $N(o){var c=Re(o);return function(h){return d0(h,o,c)}}function d0(o,c,h){var y=h.length;if(o==null)return!y;for(o=ne(o);y--;){var b=h[y],k=c[b],E=o[b];if(E===e&&!(b in o)||!k(E))return!1}return!0}function f0(o,c,h){if(typeof o!="function")throw new Cn(a);return Zo(function(){o.apply(e,h)},c)}function Yo(o,c,h,y){var b=-1,k=Il,E=!0,R=o.length,U=[],Z=c.length;if(!R)return U;h&&(c=ue(c,_n(h))),y?(k=Yd,E=!1):c.length>=r&&(k=Fo,E=!1,c=new kr(c));t:for(;++b<R;){var Q=o[b],et=h==null?Q:h(Q);if(Q=y||Q!==0?Q:0,E&&et===et){for(var ct=Z;ct--;)if(c[ct]===et)continue t;U.push(Q)}else k(c,et,y)||U.push(Q)}return U}var Ki=z0(Zn),h0=z0(lf,!0);function VN(o,c){var h=!0;return Ki(o,function(y,b,k){return h=!!c(y,b,k),h}),h}function Ql(o,c,h){for(var y=-1,b=o.length;++y<b;){var k=o[y],E=c(k);if(E!=null&&(R===e?E===E&&!xn(E):h(E,R)))var R=E,U=k}return U}function YN(o,c,h,y){var b=o.length;for(h=Lt(h),h<0&&(h=-h>b?0:b+h),y=y===e||y>b?b:Lt(y),y<0&&(y+=b),y=h>y?0:Ab(y);h<y;)o[h++]=c;return o}function p0(o,c){var h=[];return Ki(o,function(y,b,k){c(y,b,k)&&h.push(y)}),h}function Fe(o,c,h,y,b){var k=-1,E=o.length;for(h||(h=PB),b||(b=[]);++k<E;){var R=o[k];c>0&&h(R)?c>1?Fe(R,c-1,h,y,b):qi(b,R):y||(b[b.length]=R)}return b}var af=U0(),g0=U0(!0);function Zn(o,c){return o&&af(o,c,Re)}function lf(o,c){return o&&g0(o,c,Re)}function Jl(o,c){return Yi(c,function(h){return bi(o[h])})}function Cr(o,c){c=Zi(c,o);for(var h=0,y=c.length;o!=null&&h<y;)o=o[zn(c[h++])];return h&&h==y?o:e}function m0(o,c,h){var y=c(o);return Rt(o)?y:qi(y,h(o))}function Qe(o){return o==null?o===e?Le:ve:Tr&&Tr in ne(o)?DB(o):UB(o)}function cf(o,c){return o>c}function qN(o,c){return o!=null&&Gt.call(o,c)}function jN(o,c){return o!=null&&c in ne(o)}function GN(o,c,h){return o>=je(c,h)&&o<ke(c,h)}function uf(o,c,h){for(var y=h?Yd:Il,b=o[0].length,k=o.length,E=k,R=Y(k),U=1/0,Z=[];E--;){var Q=o[E];E&&c&&(Q=ue(Q,_n(c))),U=je(Q.length,U),R[E]=!h&&(c||b>=120&&Q.length>=120)?new kr(E&&Q):e}Q=o[0];var et=-1,ct=R[0];t:for(;++et<b&&Z.length<U;){var yt=Q[et],Mt=c?c(yt):yt;if(yt=h||yt!==0?yt:0,!(ct?Fo(ct,Mt):y(Z,Mt,h))){for(E=k;--E;){var Nt=R[E];if(!(Nt?Fo(Nt,Mt):y(o[E],Mt,h)))continue t}ct&&ct.push(Mt),Z.push(yt)}}return Z}function KN(o,c,h,y){return Zn(o,function(b,k,E){c(y,h(b),k,E)}),y}function qo(o,c,h){c=Zi(c,o),o=ib(o,c);var y=o==null?o:o[zn(Rn(c))];return y==null?e:mn(y,o,h)}function y0(o){return ge(o)&&Qe(o)==V}function XN(o){return ge(o)&&Qe(o)==Ee}function ZN(o){return ge(o)&&Qe(o)==pt}function jo(o,c,h,y,b){return o===c?!0:o==null||c==null||!ge(o)&&!ge(c)?o!==o&&c!==c:QN(o,c,h,y,jo,b)}function QN(o,c,h,y,b,k){var E=Rt(o),R=Rt(c),U=E?st:Ge(o),Z=R?st:Ge(c);U=U==V?bt:U,Z=Z==V?bt:Z;var Q=U==bt,et=Z==bt,ct=U==Z;if(ct&&Ji(o)){if(!Ji(c))return!1;E=!0,Q=!1}if(ct&&!Q)return k||(k=new Fn),E||vs(o)?X0(o,c,h,y,b,k):MB(o,c,U,h,y,b,k);if(!(h&S)){var yt=Q&&Gt.call(o,"__wrapped__"),Mt=et&&Gt.call(c,"__wrapped__");if(yt||Mt){var Nt=yt?o.value():o,wt=Mt?c.value():c;return k||(k=new Fn),b(Nt,wt,h,y,k)}}return ct?(k||(k=new Fn),kB(o,c,h,y,b,k)):!1}function JN(o){return ge(o)&&Ge(o)==Ct}function df(o,c,h,y){var b=h.length,k=b,E=!y;if(o==null)return!k;for(o=ne(o);b--;){var R=h[b];if(E&&R[2]?R[1]!==o[R[0]]:!(R[0]in o))return!1}for(;++b<k;){R=h[b];var U=R[0],Z=o[U],Q=R[1];if(E&&R[2]){if(Z===e&&!(U in o))return!1}else{var et=new Fn;if(y)var ct=y(Z,Q,U,o,c,et);if(!(ct===e?jo(Q,Z,S|T,y,et):ct))return!1}}return!0}function _0(o){if(!fe(o)||LB(o))return!1;var c=bi(o)?JL:Md;return c.test(Ar(o))}function tB(o){return ge(o)&&Qe(o)==Ae}function eB(o){return ge(o)&&Ge(o)==oe}function nB(o){return ge(o)&&mc(o.length)&&!!ee[Qe(o)]}function b0(o){return typeof o=="function"?o:o==null?hn:typeof o=="object"?Rt(o)?v0(o[0],o[1]):w0(o):Wb(o)}function ff(o){if(!Xo(o))return sN(o);var c=[];for(var h in ne(o))Gt.call(o,h)&&h!="constructor"&&c.push(h);return c}function iB(o){if(!fe(o))return zB(o);var c=Xo(o),h=[];for(var y in o)y=="constructor"&&(c||!Gt.call(o,y))||h.push(y);return h}function hf(o,c){return o<c}function x0(o,c){var h=-1,y=dn(o)?Y(o.length):[];return Ki(o,function(b,k,E){y[++h]=c(b,k,E)}),y}function w0(o){var c=Cf(o);return c.length==1&&c[0][2]?eb(c[0][0],c[0][1]):function(h){return h===o||df(h,o,c)}}function v0(o,c){return Af(o)&&tb(c)?eb(zn(o),c):function(h){var y=Hf(h,o);return y===e&&y===c?Wf(h,o):jo(c,y,S|T)}}function tc(o,c,h,y,b){o!==c&&af(c,function(k,E){if(b||(b=new Fn),fe(k))rB(o,c,E,h,tc,y,b);else{var R=y?y(Rf(o,E),k,E+"",o,c,b):e;R===e&&(R=k),sf(o,E,R)}},fn)}function rB(o,c,h,y,b,k,E){var R=Rf(o,h),U=Rf(c,h),Z=E.get(U);if(Z){sf(o,h,Z);return}var Q=k?k(R,U,h+"",o,c,E):e,et=Q===e;if(et){var ct=Rt(U),yt=!ct&&Ji(U),Mt=!ct&&!yt&&vs(U);Q=U,ct||yt||Mt?Rt(R)?Q=R:_e(R)?Q=un(R):yt?(et=!1,Q=I0(U,!0)):Mt?(et=!1,Q=L0(U,!0)):Q=[]:Qo(U)||Er(U)?(Q=R,Er(R)?Q=Eb(R):(!fe(R)||bi(R))&&(Q=J0(U))):et=!1}et&&(E.set(U,Q),b(Q,U,y,k,E),E.delete(U)),sf(o,h,Q)}function S0(o,c){var h=o.length;if(h)return c+=c<0?h:0,_i(c,h)?o[c]:e}function T0(o,c,h){c.length?c=ue(c,function(k){return Rt(k)?function(E){return Cr(E,k.length===1?k[0]:k)}:k}):c=[hn];var y=-1;c=ue(c,_n(St()));var b=x0(o,function(k,E,R){var U=ue(c,function(Z){return Z(k)});return{criteria:U,index:++y,value:k}});return EL(b,function(k,E){return yB(k,E,h)})}function sB(o,c){return M0(o,c,function(h,y){return Wf(o,y)})}function M0(o,c,h){for(var y=-1,b=c.length,k={};++y<b;){var E=c[y],R=Cr(o,E);h(R,E)&&Go(k,Zi(E,o),R)}return k}function oB(o){return function(c){return Cr(c,o)}}function pf(o,c,h,y){var b=y?AL:ds,k=-1,E=c.length,R=o;for(o===c&&(c=un(c)),h&&(R=ue(o,_n(h)));++k<E;)for(var U=0,Z=c[k],Q=h?h(Z):Z;(U=b(R,Q,U,y))>-1;)R!==o&&Vl.call(R,U,1),Vl.call(o,U,1);return o}function k0(o,c){for(var h=o?c.length:0,y=h-1;h--;){var b=c[h];if(h==y||b!==k){var k=b;_i(b)?Vl.call(o,b,1):_f(o,b)}}return o}function gf(o,c){return o+jl(o0()*(c-o+1))}function aB(o,c,h,y){for(var b=-1,k=ke(ql((c-o)/(h||1)),0),E=Y(k);k--;)E[y?k:++b]=o,o+=h;return E}function mf(o,c){var h="";if(!o||c<1||c>it)return h;do c%2&&(h+=o),c=jl(c/2),c&&(o+=o);while(c);return h}function Bt(o,c){return Pf(nb(o,c,hn),o+"")}function lB(o){return c0(Ss(o))}function cB(o,c){var h=Ss(o);return uc(h,Dr(c,0,h.length))}function Go(o,c,h,y){if(!fe(o))return o;c=Zi(c,o);for(var b=-1,k=c.length,E=k-1,R=o;R!=null&&++b<k;){var U=zn(c[b]),Z=h;if(U==="__proto__"||U==="constructor"||U==="prototype")return o;if(b!=E){var Q=R[U];Z=y?y(Q,U,R):e,Z===e&&(Z=fe(Q)?Q:_i(c[b+1])?[]:{})}Vo(R,U,Z),R=R[U]}return o}var D0=Gl?function(o,c){return Gl.set(o,c),o}:hn,uB=Yl?function(o,c){return Yl(o,"toString",{configurable:!0,enumerable:!1,value:Vf(c),writable:!0})}:hn;function dB(o){return uc(Ss(o))}function En(o,c,h){var y=-1,b=o.length;c<0&&(c=-c>b?0:b+c),h=h>b?b:h,h<0&&(h+=b),b=c>h?0:h-c>>>0,c>>>=0;for(var k=Y(b);++y<b;)k[y]=o[y+c];return k}function fB(o,c){var h;return Ki(o,function(y,b,k){return h=c(y,b,k),!h}),!!h}function ec(o,c,h){var y=0,b=o==null?y:o.length;if(typeof c=="number"&&c===c&&b<=_t){for(;y<b;){var k=y+b>>>1,E=o[k];E!==null&&!xn(E)&&(h?E<=c:E<c)?y=k+1:b=k}return b}return yf(o,c,hn,h)}function yf(o,c,h,y){var b=0,k=o==null?0:o.length;if(k===0)return 0;c=h(c);for(var E=c!==c,R=c===null,U=xn(c),Z=c===e;b<k;){var Q=jl((b+k)/2),et=h(o[Q]),ct=et!==e,yt=et===null,Mt=et===et,Nt=xn(et);if(E)var wt=y||Mt;else Z?wt=Mt&&(y||ct):R?wt=Mt&&ct&&(y||!yt):U?wt=Mt&&ct&&!yt&&(y||!Nt):yt||Nt?wt=!1:wt=y?et<=c:et<c;wt?b=Q+1:k=Q}return je(k,X)}function C0(o,c){for(var h=-1,y=o.length,b=0,k=[];++h<y;){var E=o[h],R=c?c(E):E;if(!h||!Un(R,U)){var U=R;k[b++]=E===0?0:E}}return k}function O0(o){return typeof o=="number"?o:xn(o)?H:+o}function bn(o){if(typeof o=="string")return o;if(Rt(o))return ue(o,bn)+"";if(xn(o))return a0?a0.call(o):"";var c=o+"";return c=="0"&&1/o==-rt?"-0":c}function Xi(o,c,h){var y=-1,b=Il,k=o.length,E=!0,R=[],U=R;if(h)E=!1,b=Yd;else if(k>=r){var Z=c?null:SB(o);if(Z)return Nl(Z);E=!1,b=Fo,U=new kr}else U=c?[]:R;t:for(;++y<k;){var Q=o[y],et=c?c(Q):Q;if(Q=h||Q!==0?Q:0,E&&et===et){for(var ct=U.length;ct--;)if(U[ct]===et)continue t;c&&U.push(et),R.push(Q)}else b(U,et,h)||(U!==R&&U.push(et),R.push(Q))}return R}function _f(o,c){c=Zi(c,o);var h=-1,y=c.length;if(!y)return!0;for(;++h<y;){var b=zn(c[h]);if(b==="__proto__"&&!Gt.call(o,"__proto__")||(b==="constructor"||b==="prototype")&&h<y-1)return!1}var k=ib(o,c);return k==null||delete k[zn(Rn(c))]}function A0(o,c,h,y){return Go(o,c,h(Cr(o,c)),y)}function nc(o,c,h,y){for(var b=o.length,k=y?b:-1;(y?k--:++k<b)&&c(o[k],k,o););return h?En(o,y?0:k,y?k+1:b):En(o,y?k+1:0,y?b:k)}function E0(o,c){var h=o;return h instanceof Ut&&(h=h.value()),qd(c,function(y,b){return b.func.apply(b.thisArg,qi([y],b.args))},h)}function bf(o,c,h){var y=o.length;if(y<2)return y?Xi(o[0]):[];for(var b=-1,k=Y(y);++b<y;)for(var E=o[b],R=-1;++R<y;)R!=b&&(k[b]=Yo(k[b]||E,o[R],c,h));return Xi(Fe(k,1),c,h)}function R0(o,c,h){for(var y=-1,b=o.length,k=c.length,E={};++y<b;){var R=y<k?c[y]:e;h(E,o[y],R)}return E}function xf(o){return _e(o)?o:[]}function wf(o){return typeof o=="function"?o:hn}function Zi(o,c){return Rt(o)?o:Af(o,c)?[o]:ab(Kt(o))}var hB=Bt;function Qi(o,c,h){var y=o.length;return h=h===e?y:h,!c&&h>=y?o:En(o,c,h)}var P0=tN||function(o){return ce.clearTimeout(o)};function I0(o,c){if(c)return o.slice();var h=o.length,y=e0?e0(h):new o.constructor(h);return o.copy(y),y}function vf(o){var c=new o.constructor(o.byteLength);return new Wl(c).set(new Wl(o)),c}function pB(o,c){var h=c?vf(o.buffer):o.buffer;return new o.constructor(h,o.byteOffset,o.byteLength)}function gB(o){var c=new o.constructor(o.source,yl.exec(o));return c.lastIndex=o.lastIndex,c}function mB(o){return $o?ne($o.call(o)):{}}function L0(o,c){var h=c?vf(o.buffer):o.buffer;return new o.constructor(h,o.byteOffset,o.length)}function N0(o,c){if(o!==c){var h=o!==e,y=o===null,b=o===o,k=xn(o),E=c!==e,R=c===null,U=c===c,Z=xn(c);if(!R&&!Z&&!k&&o>c||k&&E&&U&&!R&&!Z||y&&E&&U||!h&&U||!b)return 1;if(!y&&!k&&!Z&&o<c||Z&&h&&b&&!y&&!k||R&&h&&b||!E&&b||!U)return-1}return 0}function yB(o,c,h){for(var y=-1,b=o.criteria,k=c.criteria,E=b.length,R=h.length;++y<E;){var U=N0(b[y],k[y]);if(U){if(y>=R)return U;var Z=h[y];return U*(Z=="desc"?-1:1)}}return o.index-c.index}function B0(o,c,h,y){for(var b=-1,k=o.length,E=h.length,R=-1,U=c.length,Z=ke(k-E,0),Q=Y(U+Z),et=!y;++R<U;)Q[R]=c[R];for(;++b<E;)(et||b<k)&&(Q[h[b]]=o[b]);for(;Z--;)Q[R++]=o[b++];return Q}function F0(o,c,h,y){for(var b=-1,k=o.length,E=-1,R=h.length,U=-1,Z=c.length,Q=ke(k-R,0),et=Y(Q+Z),ct=!y;++b<Q;)et[b]=o[b];for(var yt=b;++U<Z;)et[yt+U]=c[U];for(;++E<R;)(ct||b<k)&&(et[yt+h[E]]=o[b++]);return et}function un(o,c){var h=-1,y=o.length;for(c||(c=Y(y));++h<y;)c[h]=o[h];return c}function Qn(o,c,h,y){var b=!h;h||(h={});for(var k=-1,E=c.length;++k<E;){var R=c[k],U=y?y(h[R],o[R],R,h,o):e;U===e&&(U=o[R]),b?Xn(h,R,U):Vo(h,R,U)}return h}function _B(o,c){return Qn(o,Of(o),c)}function bB(o,c){return Qn(o,Z0(o),c)}function ic(o,c){return function(h,y){var b=Rt(h)?TL:HN,k=c?c():{};return b(h,o,St(y,2),k)}}function bs(o){return Bt(function(c,h){var y=-1,b=h.length,k=b>1?h[b-1]:e,E=b>2?h[2]:e;for(k=o.length>3&&typeof k=="function"?(b--,k):e,E&&Je(h[0],h[1],E)&&(k=b<3?e:k,b=1),c=ne(c);++y<b;){var R=h[y];R&&o(c,R,y,k)}return c})}function z0(o,c){return function(h,y){if(h==null)return h;if(!dn(h))return o(h,y);for(var b=h.length,k=c?b:-1,E=ne(h);(c?k--:++k<b)&&y(E[k],k,E)!==!1;);return h}}function U0(o){return function(c,h,y){for(var b=-1,k=ne(c),E=y(c),R=E.length;R--;){var U=E[o?R:++b];if(h(k[U],U,k)===!1)break}return c}}function xB(o,c,h){var y=c&C,b=Ko(o);function k(){var E=this&&this!==ce&&this instanceof k?b:o;return E.apply(y?h:this,arguments)}return k}function H0(o){return function(c){c=Kt(c);var h=fs(c)?Bn(c):e,y=h?h[0]:c.charAt(0),b=h?Qi(h,1).join(""):c.slice(1);return y[o]()+b}}function xs(o){return function(c){return qd(Ub(zb(c).replace(Ud,"")),o,"")}}function Ko(o){return function(){var c=arguments;switch(c.length){case 0:return new o;case 1:return new o(c[0]);case 2:return new o(c[0],c[1]);case 3:return new o(c[0],c[1],c[2]);case 4:return new o(c[0],c[1],c[2],c[3]);case 5:return new o(c[0],c[1],c[2],c[3],c[4]);case 6:return new o(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new o(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var h=_s(o.prototype),y=o.apply(h,c);return fe(y)?y:h}}function wB(o,c,h){var y=Ko(o);function b(){for(var k=arguments.length,E=Y(k),R=k,U=ws(b);R--;)E[R]=arguments[R];var Z=k<3&&E[0]!==U&&E[k-1]!==U?[]:ji(E,U);if(k-=Z.length,k<h)return q0(o,c,rc,b.placeholder,e,E,Z,e,e,h-k);var Q=this&&this!==ce&&this instanceof b?y:o;return mn(Q,this,E)}return b}function W0(o){return function(c,h,y){var b=ne(c);if(!dn(c)){var k=St(h,3);c=Re(c),h=function(R){return k(b[R],R,b)}}var E=o(c,h,y);return E>-1?b[k?c[E]:E]:e}}function $0(o){return yi(function(c){var h=c.length,y=h,b=On.prototype.thru;for(o&&c.reverse();y--;){var k=c[y];if(typeof k!="function")throw new Cn(a);if(b&&!E&&lc(k)=="wrapper")var E=new On([],!0)}for(y=E?y:h;++y<h;){k=c[y];var R=lc(k),U=R=="wrapper"?Df(k):e;U&&Ef(U[0])&&U[1]==(w|P|L|M)&&!U[4].length&&U[9]==1?E=E[lc(U[0])].apply(E,U[3]):E=k.length==1&&Ef(k)?E[R]():E.thru(k)}return function(){var Z=arguments,Q=Z[0];if(E&&Z.length==1&&Rt(Q))return E.plant(Q).value();for(var et=0,ct=h?c[et].apply(this,Z):Q;++et<h;)ct=c[et].call(this,ct);return ct}})}function rc(o,c,h,y,b,k,E,R,U,Z){var Q=c&w,et=c&C,ct=c&A,yt=c&(P|I),Mt=c&O,Nt=ct?e:Ko(o);function wt(){for(var Ft=arguments.length,Ht=Y(Ft),wn=Ft;wn--;)Ht[wn]=arguments[wn];if(yt)var tn=ws(wt),vn=PL(Ht,tn);if(y&&(Ht=B0(Ht,y,b,yt)),k&&(Ht=F0(Ht,k,E,yt)),Ft-=vn,yt&&Ft<Z){var be=ji(Ht,tn);return q0(o,c,rc,wt.placeholder,h,Ht,be,R,U,Z-Ft)}var Hn=et?h:this,wi=ct?Hn[o]:o;return Ft=Ht.length,R?Ht=HB(Ht,R):Mt&&Ft>1&&Ht.reverse(),Q&&U<Ft&&(Ht.length=U),this&&this!==ce&&this instanceof wt&&(wi=Nt||Ko(wi)),wi.apply(Hn,Ht)}return wt}function V0(o,c){return function(h,y){return KN(h,o,c(y),{})}}function sc(o,c){return function(h,y){var b;if(h===e&&y===e)return c;if(h!==e&&(b=h),y!==e){if(b===e)return y;typeof h=="string"||typeof y=="string"?(h=bn(h),y=bn(y)):(h=O0(h),y=O0(y)),b=o(h,y)}return b}}function Sf(o){return yi(function(c){return c=ue(c,_n(St())),Bt(function(h){var y=this;return o(c,function(b){return mn(b,y,h)})})})}function oc(o,c){c=c===e?" ":bn(c);var h=c.length;if(h<2)return h?mf(c,o):c;var y=mf(c,ql(o/hs(c)));return fs(c)?Qi(Bn(y),0,o).join(""):y.slice(0,o)}function vB(o,c,h,y){var b=c&C,k=Ko(o);function E(){for(var R=-1,U=arguments.length,Z=-1,Q=y.length,et=Y(Q+U),ct=this&&this!==ce&&this instanceof E?k:o;++Z<Q;)et[Z]=y[Z];for(;U--;)et[Z++]=arguments[++R];return mn(ct,b?h:this,et)}return E}function Y0(o){return function(c,h,y){return y&&typeof y!="number"&&Je(c,h,y)&&(h=y=e),c=xi(c),h===e?(h=c,c=0):h=xi(h),y=y===e?c<h?1:-1:xi(y),aB(c,h,y,o)}}function ac(o){return function(c,h){return typeof c=="string"&&typeof h=="string"||(c=Pn(c),h=Pn(h)),o(c,h)}}function q0(o,c,h,y,b,k,E,R,U,Z){var Q=c&P,et=Q?E:e,ct=Q?e:E,yt=Q?k:e,Mt=Q?e:k;c|=Q?L:N,c&=~(Q?N:L),c&F||(c&=-4);var Nt=[o,c,b,yt,et,Mt,ct,R,U,Z],wt=h.apply(e,Nt);return Ef(o)&&rb(wt,Nt),wt.placeholder=y,sb(wt,o,c)}function Tf(o){var c=Me[o];return function(h,y){if(h=Pn(h),y=y==null?0:je(Lt(y),292),y&&s0(h)){var b=(Kt(h)+"e").split("e"),k=c(b[0]+"e"+(+b[1]+y));return b=(Kt(k)+"e").split("e"),+(b[0]+"e"+(+b[1]-y))}return c(h)}}var SB=ms&&1/Nl(new ms([,-0]))[1]==rt?function(o){return new ms(o)}:jf;function j0(o){return function(c){var h=Ge(c);return h==Ct?Jd(c):h==oe?UL(c):RL(c,o(c))}}function mi(o,c,h,y,b,k,E,R){var U=c&A;if(!U&&typeof o!="function")throw new Cn(a);var Z=y?y.length:0;if(Z||(c&=-97,y=b=e),E=E===e?E:ke(Lt(E),0),R=R===e?R:Lt(R),Z-=b?b.length:0,c&N){var Q=y,et=b;y=b=e}var ct=U?e:Df(o),yt=[o,c,h,y,b,Q,et,k,E,R];if(ct&&FB(yt,ct),o=yt[0],c=yt[1],h=yt[2],y=yt[3],b=yt[4],R=yt[9]=yt[9]===e?U?0:o.length:ke(yt[9]-Z,0),!R&&c&(P|I)&&(c&=-25),!c||c==C)var Mt=xB(o,c,h);else c==P||c==I?Mt=wB(o,c,R):(c==L||c==(C|L))&&!b.length?Mt=vB(o,c,h,y):Mt=rc.apply(e,yt);var Nt=ct?D0:rb;return sb(Nt(Mt,yt),o,c)}function G0(o,c,h,y){return o===e||Un(o,gs[h])&&!Gt.call(y,h)?c:o}function K0(o,c,h,y,b,k){return fe(o)&&fe(c)&&(k.set(c,o),tc(o,c,e,K0,k),k.delete(c)),o}function TB(o){return Qo(o)?e:o}function X0(o,c,h,y,b,k){var E=h&S,R=o.length,U=c.length;if(R!=U&&!(E&&U>R))return!1;var Z=k.get(o),Q=k.get(c);if(Z&&Q)return Z==c&&Q==o;var et=-1,ct=!0,yt=h&T?new kr:e;for(k.set(o,c),k.set(c,o);++et<R;){var Mt=o[et],Nt=c[et];if(y)var wt=E?y(Nt,Mt,et,c,o,k):y(Mt,Nt,et,o,c,k);if(wt!==e){if(wt)continue;ct=!1;break}if(yt){if(!jd(c,function(Ft,Ht){if(!Fo(yt,Ht)&&(Mt===Ft||b(Mt,Ft,h,y,k)))return yt.push(Ht)})){ct=!1;break}}else if(!(Mt===Nt||b(Mt,Nt,h,y,k))){ct=!1;break}}return k.delete(o),k.delete(c),ct}function MB(o,c,h,y,b,k,E){switch(h){case gn:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case Ee:return!(o.byteLength!=c.byteLength||!k(new Wl(o),new Wl(c)));case lt:case pt:case Dt:return Un(+o,+c);case It:return o.name==c.name&&o.message==c.message;case Ae:case ln:return o==c+"";case Ct:var R=Jd;case oe:var U=y&S;if(R||(R=Nl),o.size!=c.size&&!U)return!1;var Z=E.get(o);if(Z)return Z==c;y|=T,E.set(o,c);var Q=X0(R(o),R(c),y,b,k,E);return E.delete(o),Q;case $t:if($o)return $o.call(o)==$o.call(c)}return!1}function kB(o,c,h,y,b,k){var E=h&S,R=Mf(o),U=R.length,Z=Mf(c),Q=Z.length;if(U!=Q&&!E)return!1;for(var et=U;et--;){var ct=R[et];if(!(E?ct in c:Gt.call(c,ct)))return!1}var yt=k.get(o),Mt=k.get(c);if(yt&&Mt)return yt==c&&Mt==o;var Nt=!0;k.set(o,c),k.set(c,o);for(var wt=E;++et<U;){ct=R[et];var Ft=o[ct],Ht=c[ct];if(y)var wn=E?y(Ht,Ft,ct,c,o,k):y(Ft,Ht,ct,o,c,k);if(!(wn===e?Ft===Ht||b(Ft,Ht,h,y,k):wn)){Nt=!1;break}wt||(wt=ct=="constructor")}if(Nt&&!wt){var tn=o.constructor,vn=c.constructor;tn!=vn&&"constructor"in o&&"constructor"in c&&!(typeof tn=="function"&&tn instanceof tn&&typeof vn=="function"&&vn instanceof vn)&&(Nt=!1)}return k.delete(o),k.delete(c),Nt}function yi(o){return Pf(nb(o,e,db),o+"")}function Mf(o){return m0(o,Re,Of)}function kf(o){return m0(o,fn,Z0)}var Df=Gl?function(o){return Gl.get(o)}:jf;function lc(o){for(var c=o.name+"",h=ys[c],y=Gt.call(ys,c)?h.length:0;y--;){var b=h[y],k=b.func;if(k==null||k==o)return b.name}return c}function ws(o){var c=Gt.call(v,"placeholder")?v:o;return c.placeholder}function St(){var o=v.iteratee||Yf;return o=o===Yf?b0:o,arguments.length?o(arguments[0],arguments[1]):o}function cc(o,c){var h=o.__data__;return IB(c)?h[typeof c=="string"?"string":"hash"]:h.map}function Cf(o){for(var c=Re(o),h=c.length;h--;){var y=c[h],b=o[y];c[h]=[y,b,tb(b)]}return c}function Or(o,c){var h=BL(o,c);return _0(h)?h:e}function DB(o){var c=Gt.call(o,Tr),h=o[Tr];try{o[Tr]=e;var y=!0}catch{}var b=Ul.call(o);return y&&(c?o[Tr]=h:delete o[Tr]),b}var Of=ef?function(o){return o==null?[]:(o=ne(o),Yi(ef(o),function(c){return i0.call(o,c)}))}:Gf,Z0=ef?function(o){for(var c=[];o;)qi(c,Of(o)),o=$l(o);return c}:Gf,Ge=Qe;(nf&&Ge(new nf(new ArrayBuffer(1)))!=gn||Uo&&Ge(new Uo)!=Ct||rf&&Ge(rf.resolve())!=jt||ms&&Ge(new ms)!=oe||Ho&&Ge(new Ho)!=ie)&&(Ge=function(o){var c=Qe(o),h=c==bt?o.constructor:e,y=h?Ar(h):"";if(y)switch(y){case cN:return gn;case uN:return Ct;case dN:return jt;case fN:return oe;case hN:return ie}return c});function CB(o,c,h){for(var y=-1,b=h.length;++y<b;){var k=h[y],E=k.size;switch(k.type){case"drop":o+=E;break;case"dropRight":c-=E;break;case"take":c=je(c,o+E);break;case"takeRight":o=ke(o,c-E);break}}return{start:o,end:c}}function OB(o){var c=o.match(bd);return c?c[1].split(xd):[]}function Q0(o,c,h){c=Zi(c,o);for(var y=-1,b=c.length,k=!1;++y<b;){var E=zn(c[y]);if(!(k=o!=null&&h(o,E)))break;o=o[E]}return k||++y!=b?k:(b=o==null?0:o.length,!!b&&mc(b)&&_i(E,b)&&(Rt(o)||Er(o)))}function AB(o){var c=o.length,h=new o.constructor(c);return c&&typeof o[0]=="string"&&Gt.call(o,"index")&&(h.index=o.index,h.input=o.input),h}function J0(o){return typeof o.constructor=="function"&&!Xo(o)?_s($l(o)):{}}function EB(o,c,h){var y=o.constructor;switch(c){case Ee:return vf(o);case lt:case pt:return new y(+o);case gn:return pB(o,h);case Hi:case Dn:case Ye:case In:case ui:case So:case To:case xr:case di:return L0(o,h);case Ct:return new y;case Dt:case ln:return new y(o);case Ae:return gB(o);case oe:return new y;case $t:return mB(o)}}function RB(o,c){var h=c.length;if(!h)return o;var y=h-1;return c[y]=(h>1?"& ":"")+c[y],c=c.join(h>2?", ":" "),o.replace(Ln,`{
|
|
3
|
+
`):n}function GO(n,t){const{element:e,datasetIndex:i,index:r}=t,s=n.getDatasetMeta(i).controller,{label:a,value:l}=s.getLabelAndValue(r);return{chart:n,label:a,parsed:s.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:e}}function Mm(n,t){const e=n.chart.ctx,{body:i,footer:r,title:s}=n,{boxWidth:a,boxHeight:l}=t,u=le(t.bodyFont),d=le(t.titleFont),f=le(t.footerFont),g=s.length,m=r.length,_=i.length,x=we(t.padding);let w=x.height,v=0,C=i.reduce((I,L)=>I+L.before.length+L.lines.length+L.after.length,0);if(C+=n.beforeBody.length+n.afterBody.length,g&&(w+=g*d.lineHeight+(g-1)*t.titleSpacing+t.titleMarginBottom),C){const I=t.displayColors?Math.max(l,u.lineHeight):u.lineHeight;w+=_*I+(C-_)*u.lineHeight+(C-1)*t.bodySpacing}m&&(w+=t.footerMarginTop+m*f.lineHeight+(m-1)*t.footerSpacing);let A=0;const F=function(I){v=Math.max(v,e.measureText(I).width+A)};return e.save(),e.font=d.string,Jt(n.title,F),e.font=u.string,Jt(n.beforeBody.concat(n.afterBody),F),A=t.displayColors?a+2+t.boxPadding:0,Jt(i,I=>{Jt(I.before,F),Jt(I.lines,F),Jt(I.after,F)}),A=0,e.font=f.string,Jt(n.footer,F),e.restore(),v+=x.width,{width:v,height:w}}function KO(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function XO(n,t,e,i){const{x:r,width:s}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&r+s+a>t.width||n==="right"&&r-s-a<0)return!0}function ZO(n,t,e,i){const{x:r,width:s}=e,{width:a,chartArea:{left:l,right:u}}=n;let d="center";return i==="center"?d=r<=(l+u)/2?"left":"right":r<=s/2?d="left":r>=a-s/2&&(d="right"),XO(d,n,t,e)&&(d="center"),d}function km(n,t,e){const i=e.yAlign||t.yAlign||KO(n,e);return{xAlign:e.xAlign||t.xAlign||ZO(n,t,e,i),yAlign:i}}function QO(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function JO(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Dm(n,t,e,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=n,{xAlign:l,yAlign:u}=e,d=r+s,{topLeft:f,topRight:g,bottomLeft:m,bottomRight:_}=Oi(a);let x=QO(t,l);const w=JO(t,u,d);return u==="center"?l==="left"?x+=d:l==="right"&&(x-=d):l==="left"?x-=Math.max(f,m)+r:l==="right"&&(x+=Math.max(g,_)+r),{x:Ce(x,0,i.width-t.width),y:Ce(w,0,i.height-t.height)}}function Wa(n,t,e){const i=we(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Cm(n){return jn([],ai(n))}function tA(n,t,e){return Ai(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Om(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Am={beforeTitle:ni,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:ni,beforeBody:ni,beforeLabel:ni,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return vt(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:ni,afterBody:ni,beforeFooter:ni,footer:ni,afterFooter:ni};function sn(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?Am[t].call(e,i):r}class Rm extends $e{static positioners=oo;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&e.options.animation&&i.animations,s=new ru(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=tA(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=sn(i,"beforeTitle",this,t),s=sn(i,"title",this,t),a=sn(i,"afterTitle",this,t);let l=[];return l=jn(l,ai(r)),l=jn(l,ai(s)),l=jn(l,ai(a)),l}getBeforeBody(t,e){return Cm(sn(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return Jt(t,s=>{const a={before:[],lines:[],after:[]},l=Om(i,s);jn(a.before,ai(sn(l,"beforeLabel",this,s))),jn(a.lines,sn(l,"label",this,s)),jn(a.after,ai(sn(l,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,e){return Cm(sn(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=sn(i,"beforeFooter",this,t),s=sn(i,"footer",this,t),a=sn(i,"afterFooter",this,t);let l=[];return l=jn(l,ai(r)),l=jn(l,ai(s)),l=jn(l,ai(a)),l}_createItems(t){const e=this._active,i=this.chart.data,r=[],s=[],a=[];let l=[],u,d;for(u=0,d=e.length;u<d;++u)l.push(GO(this.chart,e[u]));return t.filter&&(l=l.filter((f,g,m)=>t.filter(f,g,m,i))),t.itemSort&&(l=l.sort((f,g)=>t.itemSort(f,g,i))),Jt(l,f=>{const g=Om(t.callbacks,f);r.push(sn(g,"labelColor",this,f)),s.push(sn(g,"labelPointStyle",this,f)),a.push(sn(g,"labelTextColor",this,f))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),r=this._active;let s,a=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const l=oo[i.position].call(this,r,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const u=this._size=Mm(this,i),d=Object.assign({},l,u),f=km(this.chart,i,d),g=Dm(i,d,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,s={opacity:1,x:g.x,y:g.y,width:u.width,height:u.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,r){const s=this.getCaretPosition(t,i,r);e.lineTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.lineTo(s.x3,s.y3)}getCaretPosition(t,e,i){const{xAlign:r,yAlign:s}=this,{caretSize:a,cornerRadius:l}=i,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=Oi(l),{x:m,y:_}=t,{width:x,height:w}=e;let v,C,A,F,I,L;return s==="center"?(I=_+w/2,r==="left"?(v=m,C=v-a,F=I+a,L=I-a):(v=m+x,C=v+a,F=I-a,L=I+a),A=v):(r==="left"?C=m+Math.max(u,f)+a:r==="right"?C=m+x-Math.max(d,g)-a:C=this.caretX,s==="top"?(F=_,I=F-a,v=C-a,A=C+a):(F=_+w,I=F+a,v=C+a,A=C-a),L=F),{x1:v,x2:C,x3:A,y1:F,y2:I,y3:L}}drawTitle(t,e,i){const r=this.title,s=r.length;let a,l,u;if(s){const d=Yr(i.rtl,this.x,this.width);for(t.x=Wa(this,i.titleAlign,i),e.textAlign=d.textAlign(i.titleAlign),e.textBaseline="middle",a=le(i.titleFont),l=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,u=0;u<s;++u)e.fillText(r[u],d.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+l,u+1===s&&(t.y+=i.titleMarginBottom-l)}}_drawColorBox(t,e,i,r,s){const a=this.labelColors[i],l=this.labelPointStyles[i],{boxHeight:u,boxWidth:d}=s,f=le(s.bodyFont),g=Wa(this,"left",s),m=r.x(g),_=u<f.lineHeight?(f.lineHeight-u)/2:0,x=e.y+_;if(s.usePointStyle){const w={radius:Math.min(d,u)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},v=r.leftForLtr(m,d)+d/2,C=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Zc(t,w,v,C),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Zc(t,w,v,C)}else{t.lineWidth=It(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 w=r.leftForLtr(m,d),v=r.leftForLtr(r.xPlus(m,1),d-2),C=Oi(a.borderRadius);Object.values(C).some(A=>A!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Wr(t,{x:w,y:x,w:d,h:u,radius:C}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Wr(t,{x:v,y:x+1,w:d-2,h:u-2,radius:C}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(w,x,d,u),t.strokeRect(w,x,d,u),t.fillStyle=a.backgroundColor,t.fillRect(v,x+1,d-2,u-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:r}=this,{bodySpacing:s,bodyAlign:a,displayColors:l,boxHeight:u,boxWidth:d,boxPadding:f}=i,g=le(i.bodyFont);let m=g.lineHeight,_=0;const x=Yr(i.rtl,this.x,this.width),w=function(k){e.fillText(k,x.x(t.x+_),t.y+m/2),t.y+=m+s},v=x.textAlign(a);let C,A,F,I,L,N,B;for(e.textAlign=a,e.textBaseline="middle",e.font=g.string,t.x=Wa(this,v,i),e.fillStyle=i.bodyColor,Jt(this.beforeBody,w),_=l&&v!=="right"?a==="center"?d/2+f:d+2+f:0,I=0,N=r.length;I<N;++I){for(C=r[I],A=this.labelTextColors[I],e.fillStyle=A,Jt(C.before,w),F=C.lines,l&&F.length&&(this._drawColorBox(e,t,I,x,i),m=Math.max(g.lineHeight,u)),L=0,B=F.length;L<B;++L)w(F[L]),m=g.lineHeight;Jt(C.after,w)}_=0,m=g.lineHeight,Jt(this.afterBody,w),t.y-=s}drawFooter(t,e,i){const r=this.footer,s=r.length;let a,l;if(s){const u=Yr(i.rtl,this.x,this.width);for(t.x=Wa(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=u.textAlign(i.footerAlign),e.textBaseline="middle",a=le(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,l=0;l<s;++l)e.fillText(r[l],u.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,r){const{xAlign:s,yAlign:a}=this,{x:l,y:u}=t,{width:d,height:f}=i,{topLeft:g,topRight:m,bottomLeft:_,bottomRight:x}=Oi(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(l+g,u),a==="top"&&this.drawCaret(t,e,i,r),e.lineTo(l+d-m,u),e.quadraticCurveTo(l+d,u,l+d,u+m),a==="center"&&s==="right"&&this.drawCaret(t,e,i,r),e.lineTo(l+d,u+f-x),e.quadraticCurveTo(l+d,u+f,l+d-x,u+f),a==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(l+_,u+f),e.quadraticCurveTo(l,u+f,l,u+f-_),a==="center"&&s==="left"&&this.drawCaret(t,e,i,r),e.lineTo(l,u+g),e.quadraticCurveTo(l,u,l+g,u),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const a=oo[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=Mm(this,t),u=Object.assign({},a,this._size),d=km(e,t,u),f=Dm(t,u,d,e);(r._to!==f.x||s._to!==f.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=we(e.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&l&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,e),og(t,e.textDirection),s.y+=a.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),ag(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,r=t.map(({datasetIndex:l,index:u})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[u],index:u}}),s=!ya(i,r),a=this._positionChanged(r,e);(s||a)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],a=this._getActiveElements(t,s,e,i),l=this._positionChanged(a,t),u=e||!ya(a,s)||l;return u&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),u}_getActiveElements(t,e,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return e.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:r,options:s}=this,a=oo[s.position].call(this,t,e);return a!==!1&&(i!==a.x||r!==a.y)}}var Ve={id:"tooltip",_element:Rm,positioners:oo,afterInit(n,t,e){e&&(n.tooltip=new Rm({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Am},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},eA=Object.freeze({__proto__:null,Colors:pO,Decimation:_O,Filler:FO,Legend:VO,SubTitle:jO,Title:qO,Tooltip:Ve});const nA=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function iA(n,t,e,i){const r=n.indexOf(t);if(r===-1)return nA(n,t,e,i);const s=n.lastIndexOf(t);return r!==s?e:r}const rA=(n,t)=>n===null?null:Ce(Math.round(n),0,t);function Em(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class sA extends dr{static id="category";static defaults={ticks:{callback:Em}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:r,label:s}of e)i[r]===s&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(vt(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:iA(i,t,Ct(e,t),this._addedLabels),rA(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,r=[];let s=this.getLabels();s=t===0&&e===s.length-1?s:s.slice(t,e+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)r.push({value:a});return r}getLabelForValue(t){return Em.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function oA(n,t){const e=[],{bounds:r,step:s,min:a,max:l,precision:u,count:d,maxTicks:f,maxDigits:g,includeBounds:m}=n,_=s||1,x=f-1,{min:w,max:v}=t,C=!vt(a),A=!vt(l),F=!vt(d),I=(v-w)/(g+1);let L=Pp((v-w)/x/_)*_,N,B,k,T;if(L<1e-14&&!C&&!A)return[{value:w},{value:v}];T=Math.ceil(v/L)-Math.floor(w/L),T>x&&(L=Pp(T*L/x/_)*_),vt(u)||(N=Math.pow(10,u),L=Math.ceil(L*N)/N),r==="ticks"?(B=Math.floor(w/L)*L,k=Math.ceil(v/L)*L):(B=w,k=v),C&&A&&s&&GM((l-a)/s,L/1e3)?(T=Math.round(Math.min((l-a)/L,f)),L=(l-a)/T,B=a,k=l):F?(B=C?a:B,k=A?l:k,T=d-1,L=(k-B)/T):(T=(k-B)/L,$s(T,Math.round(T),L/1e3)?T=Math.round(T):T=Math.ceil(T));const O=Math.max(Lp(L),Lp(B));N=Math.pow(10,vt(u)?O:u),B=Math.round(B*N)/N,k=Math.round(k*N)/N;let E=0;for(C&&(m&&B!==a?(e.push({value:a}),B<a&&E++,$s(Math.round((B+E*L)*N)/N,a,Pm(a,I,n))&&E++):B<a&&E++);E<T;++E){const W=Math.round((B+E*L)*N)/N;if(A&&W>l)break;e.push({value:W})}return A&&m&&k!==l?e.length&&$s(e[e.length-1].value,l,Pm(l,I,n))?e[e.length-1].value=l:e.push({value:l}):(!A||k===l)&&e.push({value:k}),e}function Pm(n,t,{horizontal:e,minRotation:i}){const r=xe(i),s=(e?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+n).length;return Math.min(t/s,a)}class $a extends dr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return vt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=u=>r=e?r:u,l=u=>s=i?s:u;if(t){const u=Yn(r),d=Yn(s);u<0&&d<0?l(0):u>0&&d>0&&a(0)}if(r===s){let u=s===0?1:Math.abs(s*.05);l(s+u),t||a(r-u)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),e=e||11),e&&(r=Math.min(e,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},s=this._range||this,a=oA(r,s);return t.bounds==="ticks"&&Ip(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return qs(t,this.chart.options.locale,this.options.ticks.format)}}class aA extends $a{static id="linear";static defaults={ticks:{callback:Ma.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ae(t)?t:0,this.max=ae(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=xe(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const ao=n=>Math.floor(Di(n)),fr=(n,t)=>Math.pow(10,ao(n)+t);function Im(n){return n/Math.pow(10,ao(n))===1}function Lm(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function lA(n,t){const e=t-n;let i=ao(e);for(;Lm(n,t,i)>10;)i++;for(;Lm(n,t,i)<10;)i--;return Math.min(i,ao(n))}function cA(n,{min:t,max:e}){t=pn(n.min,t);const i=[],r=ao(t);let s=lA(t,e),a=s<0?Math.pow(10,Math.abs(s)):1;const l=Math.pow(10,s),u=r>s?Math.pow(10,r):0,d=Math.round((t-u)*a)/a,f=Math.floor((t-u)/l/10)*l*10;let g=Math.floor((d-f)/Math.pow(10,s)),m=pn(n.min,Math.round((u+f+g*Math.pow(10,s))*a)/a);for(;m<e;)i.push({value:m,major:Im(m),significand:g}),g>=10?g=g<15?15:20:g++,g>=20&&(s++,g=2,a=s>=0?1:a),m=Math.round((u+f+g*Math.pow(10,s))*a)/a;const _=pn(n.max,m);return i.push({value:_,major:Im(_),significand:g}),i}class uA extends dr{static id="logarithmic";static defaults={ticks:{callback:Ma.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,e){const i=$a.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return ae(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ae(t)?Math.max(0,t):null,this.max=ae(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ae(this._userMin)&&(this.min=t===fr(this.min,0)?fr(this.min,-1):fr(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,r=this.max;const s=l=>i=t?i:l,a=l=>r=e?r:l;i===r&&(i<=0?(s(1),a(10)):(s(fr(i,-1)),a(fr(r,1)))),i<=0&&s(fr(r,-1)),r<=0&&a(fr(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=cA(e,this);return t.bounds==="ticks"&&Ip(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":qs(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Di(t),this._valueRange=Di(this.max)-Di(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Di(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Tu(n){const t=n.ticks;if(t.display&&n.display){const e=we(t.backdropPadding);return Ct(t.font&&t.font.size,se.font.size)+e.height}return 0}function dA(n,t,e){return e=qt(e)?e:[e],{w:dk(n,t.string,e),h:e.length*t.lineHeight}}function Nm(n,t,e,i,r){return n===i||n===r?{start:t-e/2,end:t+e/2}:n<i||n>r?{start:t-e,end:t}:{start:t,end:t+e}}function fA(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],r=[],s=n._pointLabels.length,a=n.options.pointLabels,l=a.centerPointLabels?Et/s:0;for(let u=0;u<s;u++){const d=a.setContext(n.getPointLabelContext(u));r[u]=d.padding;const f=n.getPointPosition(u,n.drawingArea+r[u],l),g=le(d.font),m=dA(n.ctx,g,n._pointLabels[u]);i[u]=m;const _=Ue(n.getIndexAngle(u)+l),x=Math.round(wa(_)),w=Nm(x,f.x,m.w,0,180),v=Nm(x,f.y,m.h,90,270);hA(e,t,_,w,v)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=mA(n,i,r)}function hA(n,t,e,i,r){const s=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let l=0,u=0;i.start<t.l?(l=(t.l-i.start)/s,n.l=Math.min(n.l,t.l-l)):i.end>t.r&&(l=(i.end-t.r)/s,n.r=Math.max(n.r,t.r+l)),r.start<t.t?(u=(t.t-r.start)/a,n.t=Math.min(n.t,t.t-u)):r.end>t.b&&(u=(r.end-t.b)/a,n.b=Math.max(n.b,t.b+u))}function pA(n,t,e){const i=n.drawingArea,{extra:r,additionalAngle:s,padding:a,size:l}=e,u=n.getPointPosition(t,i+r+a,s),d=Math.round(wa(Ue(u.angle+re))),f=bA(u.y,l.h,d),g=yA(d),m=_A(u.x,l.w,g);return{visible:!0,x:u.x,y:f,textAlign:g,left:m,top:f,right:m+l.w,bottom:f+l.h}}function gA(n,t){if(!t)return!0;const{left:e,top:i,right:r,bottom:s}=n;return!(si({x:e,y:i},t)||si({x:e,y:s},t)||si({x:r,y:i},t)||si({x:r,y:s},t))}function mA(n,t,e){const i=[],r=n._pointLabels.length,s=n.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:Tu(s)/2,additionalAngle:a?Et/r:0};let d;for(let f=0;f<r;f++){u.padding=e[f],u.size=t[f];const g=pA(n,f,u);i.push(g),l==="auto"&&(g.visible=gA(g,d),g.visible&&(d=g))}return i}function yA(n){return n===0||n===180?"center":n<180?"left":"right"}function _A(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function bA(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function xA(n,t,e){const{left:i,top:r,right:s,bottom:a}=e,{backdropColor:l}=t;if(!vt(l)){const u=Oi(t.borderRadius),d=we(t.backdropPadding);n.fillStyle=l;const f=i-d.left,g=r-d.top,m=s-i+d.width,_=a-r+d.height;Object.values(u).some(x=>x!==0)?(n.beginPath(),Wr(n,{x:f,y:g,w:m,h:_,radius:u}),n.fill()):n.fillRect(f,g,m,_)}}function wA(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let r=t-1;r>=0;r--){const s=n._pointLabelItems[r];if(!s.visible)continue;const a=i.setContext(n.getPointLabelContext(r));xA(e,a,s);const l=le(a.font),{x:u,y:d,textAlign:f}=s;ar(e,n._pointLabels[r],u,d+l.lineHeight/2,l,{color:a.color,textAlign:f,textBaseline:"middle"})}}function Bm(n,t,e,i){const{ctx:r}=n;if(e)r.arc(n.xCenter,n.yCenter,t,0,te);else{let s=n.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let a=1;a<i;a++)s=n.getPointPosition(a,t),r.lineTo(s.x,s.y)}}function vA(n,t,e,i,r){const s=n.ctx,a=t.circular,{color:l,lineWidth:u}=t;!a&&!i||!l||!u||e<0||(s.save(),s.strokeStyle=l,s.lineWidth=u,s.setLineDash(r.dash||[]),s.lineDashOffset=r.dashOffset,s.beginPath(),Bm(n,e,a,i),s.closePath(),s.stroke(),s.restore())}function SA(n,t,e){return Ai(n,{label:e,index:t,type:"pointLabel"})}class TA extends $a{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:Ma.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=we(Tu(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=ae(t)&&!isNaN(t)?t:0,this.max=ae(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Tu(this.options))}generateTickLabels(t){$a.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const r=Qt(this.options.pointLabels.callback,[e,i],this);return r||r===0?r:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?fA(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){const e=te/(this._pointLabels.length||1),i=this.options.startAngle||0;return Ue(t*e+xe(i))}getDistanceFromCenterForValue(t){if(vt(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(vt(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return SA(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const r=this.getIndexAngle(t)-re+i;return{x:Math.cos(r)*e+this.xCenter,y:Math.sin(r)*e+this.yCenter,angle:r}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:r,bottom:s}=this._pointLabelItems[t];return{left:e,top:i,right:r,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Bm(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:r,border:s}=e,a=this._pointLabels.length;let l,u,d;if(e.pointLabels.display&&wA(this,a),r.display&&this.ticks.forEach((f,g)=>{if(g!==0||g===0&&this.min<0){u=this.getDistanceFromCenterForValue(f.value);const m=this.getContext(g),_=r.setContext(m),x=s.setContext(m);vA(this,_,u,a,x)}}),i.display){for(t.save(),l=a-1;l>=0;l--){const f=i.setContext(this.getPointLabelContext(l)),{color:g,lineWidth:m}=f;!m||!g||(t.lineWidth=m,t.strokeStyle=g,t.setLineDash(f.borderDash),t.lineDashOffset=f.borderDashOffset,u=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),d=this.getPointPosition(l,u),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(d.x,d.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let s,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,u)=>{if(u===0&&this.min>=0&&!e.reverse)return;const d=i.setContext(this.getContext(u)),f=le(d.font);if(s=this.getDistanceFromCenterForValue(this.ticks[u].value),d.showLabelBackdrop){t.font=f.string,a=t.measureText(l.label).width,t.fillStyle=d.backdropColor;const g=we(d.backdropPadding);t.fillRect(-a/2-g.left,-s-f.size/2-g.top,a+g.width,f.size+g.height)}ar(t,l.label,0,-s,f,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}const Va={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}},on=Object.keys(Va);function Fm(n,t){return n-t}function zm(n,t){if(vt(t))return null;const e=n._adapter,{parser:i,round:r,isoWeekday:s}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),ae(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(r&&(a=r==="week"&&(Ci(s)||s===!0)?e.startOf(a,"isoWeek",s):e.startOf(a,r)),+a)}function Um(n,t,e,i){const r=on.length;for(let s=on.indexOf(n);s<r-1;++s){const a=Va[on[s]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(l*a.size))<=i)return on[s]}return on[r-1]}function MA(n,t,e,i,r){for(let s=on.length-1;s>=on.indexOf(e);s--){const a=on[s];if(Va[a].common&&n._adapter.diff(r,i,a)>=t-1)return a}return on[e?on.indexOf(e):0]}function kA(n){for(let t=on.indexOf(n)+1,e=on.length;t<e;++t)if(Va[on[t]].common)return on[t]}function Hm(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=Yc(e,t),s=e[i]>=t?e[i]:e[r];n[s]=!0}}function DA(n,t,e,i){const r=n._adapter,s=+r.startOf(t[0].value,i),a=t[t.length-1].value;let l,u;for(l=s;l<=a;l=+r.add(l,1,i))u=e[l],u>=0&&(t[u].major=!0);return t}function Wm(n,t,e){const i=[],r={},s=t.length;let a,l;for(a=0;a<s;++a)l=t[a],r[l]=a,i.push({value:l,major:!1});return s===0||!e?i:DA(n,i,r,e)}class Mu extends dr{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,e={}){const i=t.time||(t.time={}),r=this._adapter=new Ag._date(t.adapters.date);r.init(e),Ws(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:zm(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:r,max:s,minDefined:a,maxDefined:l}=this.getUserBounds();function u(d){!a&&!isNaN(d.min)&&(r=Math.min(r,d.min)),!l&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!a||!l)&&(u(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&u(this.getMinMax(!1))),r=ae(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),s=ae(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const s=this.min,a=this.max,l=QM(r,s,a);return this._unit=e.unit||(i.autoSkip?Um(e.minUnit,this.min,this.max,this._getLabelCapacity(s)):MA(this,l.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:kA(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),Wm(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?e=1-r:e=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?i=s:i=(s-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=Ce(e,0,a),i=Ce(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,r=this.options,s=r.time,a=s.unit||Um(s.minUnit,e,i,this._getLabelCapacity(e)),l=Ct(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,d=Ci(u)||u===!0,f={};let g=e,m,_;if(d&&(g=+t.startOf(g,"isoWeek",u)),g=+t.startOf(g,d?"day":a),t.diff(i,e,a)>1e5*l)throw new Error(e+" and "+i+" are too far apart with stepSize of "+l+" "+a);const x=r.ticks.source==="data"&&this.getDataTimestamps();for(m=g,_=0;m<i;m=+t.add(m,l,a),_++)Hm(f,m,x);return(m===i||r.bounds==="ticks"||_===1)&&Hm(f,m,x),Object.keys(f).sort(Fm).map(w=>+w)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const r=this.options.time.displayFormats,s=this._unit,a=e||r[s];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,r){const s=this.options,a=s.ticks.callback;if(a)return Qt(a,[t,e,i],this);const l=s.time.displayFormats,u=this._unit,d=this._majorUnit,f=u&&l[u],g=d&&l[d],m=i[e],_=d&&g&&m&&m.major;return this._adapter.format(t,r||(_?g:f))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e<i;++e)r=t[e],r.label=this._tickFormatFunction(r.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,r=xe(this.isHorizontal()?e.maxRotation:e.minRotation),s=Math.cos(r),a=Math.sin(r),l=this._resolveTickFontOptions(0).size;return{w:i*s+l*a,h:i*a+l*s}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,r=i[e.unit]||i.millisecond,s=this._tickFormatFunction(t,0,Wm(this,[t],this._majorUnit),r),a=this._getLabelSize(s),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,i=r.length;e<i;++e)t=t.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const r=this.getLabels();for(e=0,i=r.length;e<i;++e)t.push(zm(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Fp(t.sort(Fm))}}function Ya(n,t,e){let i=0,r=n.length-1,s,a,l,u;e?(t>=n[i].pos&&t<=n[r].pos&&({lo:i,hi:r}=ri(n,"pos",t)),{pos:s,time:l}=n[i],{pos:a,time:u}=n[r]):(t>=n[i].time&&t<=n[r].time&&({lo:i,hi:r}=ri(n,"time",t)),{time:s,pos:l}=n[i],{time:a,pos:u}=n[r]);const d=a-s;return d?l+(u-l)*(t-s)/d:l}class CA extends Mu{static id="timeseries";static defaults=Mu.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ya(e,this.min),this._tableRange=Ya(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],s=[];let a,l,u,d,f;for(a=0,l=t.length;a<l;++a)d=t[a],d>=e&&d<=i&&r.push(d);if(r.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,l=r.length;a<l;++a)f=r[a+1],u=r[a-1],d=r[a],Math.round((f+u)/2)!==d&&s.push({time:d,pos:a/(l-1)});return s}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Ya(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Ya(this._table,i*this._tableRange+this._minPos,!0)}}var OA=Object.freeze({__proto__:null,CategoryScale:sA,LinearScale:aA,LogarithmicScale:uA,RadialLinearScale:TA,TimeScale:Mu,TimeSeriesScale:CA});const AA=[AD,aO,eA,OA];function RA(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:u=>({label:u.dataset.label,value:u.label})}};Ve.positioners[e]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const f=this.chart.canvas.getBoundingClientRect(),g=n.tooltipState.width||this.width,m=f.width/2,_=Xa(d,g,m),x=d.y,w=d.x<m?"left":"center";return{x:_-n.tooltipState.offsetX,y:x-n.tooltipState.offsetY,xAlign:w}},fu.modes.customInteractionMode=function(u,d){const f=Ri(d,u),g=[];return fu.evaluateInteractionItems(u,u.options.indexAxis||"x",f,(m,_,x)=>{u.options.indexAxis==="y"&&m.inYRange(f.y,!0)&&u.data.datasets[_].data[x]&&g.push({element:m,datasetIndex:_,index:x}),u.options.indexAxis==="x"&&f.x!==null&&m.inXRange(f.x,!0)&&u.data.datasets[_].data[x]&&g.push({element:m,datasetIndex:_,index:x})}),g};const r=n.numLabels.value>25?iy:ry,s=({chart:u,index:d})=>{const f=u.data;return{size:r,style:f?.isLabelEmpty?.[d]?"italic":"normal"}},a=(u,d,f)=>u.chart.options.indexAxis===u.axis?(d=u.getLabelForValue(f),d&&d.length>Za?d.slice(0,Za)+"...":d):u.getLabelForValue(Number(d)),l=p.computed(()=>({indexAxis:n.indexAxis,skipNull:!0,scales:{x:{stacked:n.stacked.value,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{maxRotation:90,autoSkip:!1,font:s,callback:function(u,d){return a(this,u,d)}},title:{display:n.indexAxis==="y"?!vt(n.metricAxesTitle?.value):!vt(n.dimensionAxesTitle?.value),text:n.indexAxis==="y"?n.metricAxesTitle?.value:n.dimensionAxesTitle?.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:n.stacked.value,beginAtZero:!0,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{padding:0,font:s,callback:function(u,d){return a(this,u,d)}},title:{display:n.indexAxis==="x"?!vt(n.metricAxesTitle?.value):!vt(n.dimensionAxesTitle?.value),text:n.indexAxis==="x"?n.metricAxesTitle?.value:n.dimensionAxesTitle?.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:u=>{ty(n.tooltipState,u)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.getCurrentInstance()&&p.onUnmounted(()=>{Ve.positioners[e]&&delete Ve.positioners[e]}),l}rn.register(...AA);const EA=(n,t)=>{const e=t.datasets.map(r=>r.label),i=n.datasets.map(r=>r.label);return n.datasets.length===t.datasets.length&&e.every((r,s)=>r===i[s])};function PA(n,t,e,i,r){const s=p.shallowRef(null),a=(l,u)=>{if(t.value)return new rn(t.value,{type:n,data:l,plugins:i,options:u})};return p.onMounted(()=>{s.value=a(e.value,r.value)}),p.onBeforeUnmount(()=>{vt(s.value)||s.value.destroy()}),p.watch(e,(l,u)=>{if(EA(u,l)&&!vt(s.value)){for(const[d,f]of l.datasets.entries())Object.assign(s.value.data.datasets[d],f);s.value.data.labels=l.labels,s.value.update()}else vt(s.value)||s.value.destroy(),s.value=a(l,r.value)}),p.watch(t,()=>{vt(s.value)||s.value.destroy(),s.value=a(e.value,r.value)}),p.watch(r,(l,u)=>{(l.indexAxis!==u.indexAxis||JSON.stringify(l.scales.x.title)!==JSON.stringify(u.scales.x.title)||JSON.stringify(l.scales.y.title)!==JSON.stringify(u.scales.y.title))&&(vt(s.value)||s.value.destroy(),s.value=a(e.value,l))}),s}const $m=1e3,IA=1e4,Vm=1e6,Ym=1e9,qm=1e12,lo=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((s,a)=>{a&&a%3===0&&i.push(e),i.push(s)}),i.reverse().join("")},jr=(n,t,e)=>{const i=n/t,r=e.round?"round":"floor";if(e.decimal===!1)return Math[r](i).toString();let s;e.precision?s=i:s=i<10?Math[r](i*10)/10:Math[r](i);let a=s.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function co(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const r=t.min10k?IA:$m;return n<r||t.precision&&t.precision>Math.log10(n)?e=lo(jr(n,1,t),t):n<Vm?e=`${jr(n,$m,t)}k`:n<Ym?e=`${jr(n,Vm,t)}m`:n<qm?e=`${lo(jr(n,Ym,t),t)}b`:e=`${lo(jr(n,qm,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}co.addCommas=lo;function LA(n,t,e){const{i18n:i}=Mt.useI18n(),{formatBytes:r}=ti({i18n:i}),{translateUnit:s}=Mt.useTranslatedUnits();return{legendValues:p.computed(()=>n.value.datasets.reduce((l,u)=>{const d=u.total?u.total:u.data.reduce((g,m)=>g+(typeof m=="number"?Number(m)||0:Number(m&&m.y)||0),0);let f;if(e.value==="bytes")f=r(d);else{const g=s(e.value,d);f=i&&i.t("legend.datapointValueDisplay",{value:co(d,{capital:!0}),unit:g})||`${co(d,{capital:!0})} ${e.value}`}return{...l,[u.label]:{raw:d,formatted:f,isThreshold:u.isThreshold}}},{}))}}function NA(n){return p.computed(()=>{if(!n.value?.meta)return"";const e=n.value.meta.start,i=n.value.meta.end;return e&&i?`${Lh(new Date(e))} - ${Lh(new Date(i),{includeTZ:!0})}`:""})}function BA(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};Ve.positioners[e]=function(s,a){if(!s.length||a.x===null||a.y===null)return!1;const l=this.chart.canvas.getBoundingClientRect(),u=n.tooltipState.width||this.width,d=l.width/2,f=Xa(a,u,d),g=a.y,m=a.x<d?"left":"center";return{x:f-n.tooltipState.offsetX,y:g,xAlign:m}};const r=p.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:s=>{ty(n.tooltipState,s)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return p.onUnmounted(()=>{Ve.positioners[e]&&delete Ve.positioners[e]}),{options:r}}function FA(n){const t=p.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const d=new Date(u);return vy({tickValue:d,granularity:n.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!vt(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value})),e=p.computed(()=>({title:{display:!vt(n.metricAxesTitle?.value),text:n.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value})),r=`lineChartTooltipPosition-${n.tooltipState.chartID}`,s={enabled:!1,position:r};Ve.positioners[r]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const f=this.chart.canvas.getBoundingClientRect(),g=n.tooltipState.width||this.width,m=n.tooltipState.height||this.height,_=f.width/2,x=f.height/2,w=Xa(d,g,_);let v=ey(d,m,x);const C=d.y<x?"top":"bottom",A=d.x<_?"left":"center";return m>f.height&&(v=0),{x:w,y:v,xAlign:A,yAlign:C}};const a=p.computed(()=>{const u=Number(n.timeRangeMs.value),d=new Date,f=new Date(d.getTime()-u);return _p(u)>24||f.getDate()!==d.getDate()}),l=p.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:n.pointsWithoutHover?.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...s,external:u=>{ku(n.tooltipState,u,n.granularity.value)}},thresholdPlugin:{threshold:n.threshold?.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.onUnmounted(()=>{Ve.positioners[r]&&delete Ve.positioners[r]}),{options:l}}const zA=["usd","bytes"],UA="usd";function HA(n){const{i18n:t}=Mt.useI18n(),{formatUnit:e}=ti({i18n:t}),i=(_,x)=>!x||!zA.includes(x)?_:_===0&&x===UA?t.formatNumber(0,{style:"currency",currency:"USD"}):e(_,x),r=p.computed(()=>{const _=Number(n.timeRangeMs.value),x=new Date,w=new Date(x.getTime()-_);return _p(_)>24||w.getDate()!==x.getDate()}),s=p.computed(()=>({display:!vt(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}})),a=p.computed(()=>({type:"linear",display:!0,beginAtZero:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{maxRotation:0,maxTicksLimit:7,callback:_=>i(_,n.xMetricUnit?.value)},title:s.value,border:{display:!1}})),l=p.computed(()=>({type:"time",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:_=>vy({tickValue:new Date(_),granularity:n.granularity.value,dayBoundaryCrossed:r.value})},title:s.value,border:{display:!1}})),u=p.computed(()=>({title:{display:!vt(n.metricAxesTitle?.value),text:n.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5,callback:_=>i(_,n.metricUnit?.value)},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1}})),d=(_,x,w)=>{const v=w?.timestamp;return v===void 0?"":Zr({tickValue:new Date(v),granularity:x})},g=`scatterChartTooltipPosition-${n.tooltipState.chartID}`;Ve.positioners[g]=function(_,x){if(!_.length||n.tooltipState.interactionMode==="interactive"||x.x===null||x.y===null)return!1;const w=this.chart.canvas.getBoundingClientRect(),v=n.tooltipState.width||this.width,C=n.tooltipState.height||this.height,A=w.width/2,F=w.height/2,I=Xa(x,v,A);let L=ey(x,C,F);const N=x.y<F?"top":"bottom",B=x.x<A?"left":"center";return C>w.height&&(L=0),{x:I,y:L,xAlign:B,yAlign:N}};const m=p.computed(()=>({hover:{mode:"nearest",intersect:!1},interaction:{mode:"nearest",intersect:!1},animation:{duration:250,easing:"linear"},scales:{x:n.xMetric?.value?a.value:l.value,y:u.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{enabled:!1,position:g,external:_=>{ku(n.tooltipState,_,n.granularity.value,{...n.xMetric?.value?{contextFormatter:d}:{}})}},outlierBandPlugin:{value:n.outlierValue?.value,color:n.themeColors.value.outlierBand},referenceLinePlugin:{lines:n.referenceLines?.value}},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.onUnmounted(()=>{Ve.positioners[g]&&delete Ve.positioners[g]}),{options:m}}function WA(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:r,pivotRecords:s,rowLabels:a,colorPalette:l}=n,{i18n:u}=Mt.useI18n();return t?i.map(f=>({label:u&&u.te(`chartLabels.${f}`)&&u.t(`chartLabels.${f}`)||f,backgroundColor:Cu(i.indexOf(f),li),data:a.map((g,m)=>e?s[`${g.id},${f}`]||0:s[`${m},${f}`]||null)})):Array.from(r).flatMap((f,g)=>{if(!f)return[];const m=Ou(g,f.name,f.id==="empty",l);return{label:u&&u.te(`chartLabels.${f.name}`)&&u.t(`chartLabels.${f.name}`)||f.name,backgroundColor:m,data:a.map(_=>s[`${_.id},${f.id}`]||null),isSegmentEmpty:f.id==="empty"}})}function $A(n,t){const{i18n:e}=Mt.useI18n();return p.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a}=t.value.meta,l=s&&Object.keys(s),u=a&&a.length>1,d=s&&l&&l.length>0,f=d&&l.length>1;if(!r.length||!a)return{datasets:[],labels:[]};const g=d&&l||a,m=g[0],_=g.length>1?g[1]:g[0],x=Object.fromEntries(u?r.flatMap(T=>a.map((O,E)=>{const W=T.event[m],J=d?`${W},${O}`:`${E},${O}`,at=T.event[O];return[J,at]})):r.map(T=>{const O=d?`${T.event[m]},${T.event[_]}`:`${m},${_}`,E=T.event[a[0]];return[O,E]})),w=Object.keys(x).reduce((T,O)=>{const[E]=O.split(","),W=x[O];return T[E]?T[E]+=W:T[E]=W,T},{}),v=Object.entries(w).sort(([,T],[,O])=>Number(O)-Number(T)).map(([T])=>T),C=s[m],A=s[_];let F=d&&C&&Object.entries(C).map(([T,O])=>({id:T,name:O.name}))||a.map(T=>({id:T,name:T})),I=d&&A&&Object.entries(A).map(([T,O])=>({id:T,name:O.name}))||a.map(T=>({id:T,name:T}));if(d&&m==="country_code"&&(F=F.map(T=>({...T,name:Tc(T.id)||T.name}))),d&&_==="country_code"&&(I=I.map(T=>({...T,name:Tc(T.id)||T.name}))),m!=="status_code"&&m!=="status_code_grouped"&&(F.sort((T,O)=>v.indexOf(T.id)-v.indexOf(O.id)),I.sort((T,O)=>v.indexOf(T.id)-v.indexOf(O.id))),!F||!I)return{labels:[],datasets:[]};const L=WA({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:g,barSegmentLabels:I,pivotRecords:x,rowLabels:F,colorPalette:n.colorPalette||li}),N=d?F.map(T=>e&&e.te(`chartLabels.${T.name}`)&&e.t(`chartLabels.${T.name}`)||T.name):a.map(T=>e&&e.te(`chartLabels.${T}`)&&e.t(`chartLabels.${T}`)||T),B=F.map(T=>T.id==="empty");return{labels:N,datasets:L,isLabelEmpty:B,isMultiDimension:f}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const VA=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),YA=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return bp(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},qA=(n,t,e,i,r)=>{const a=Math.max(t-6e4,Math.max(...(r||[]).map(d=>new Date(d.timestamp).valueOf()))),l=Math.floor((n-i)/e)*e+i,u=Math.floor((a-i)/e)*e+i+e;return VA(l,u,e)};function jA(n,t){const{i18n:e}=Mt.useI18n();return p.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a,start:l,end:u}=t.value.meta,d=new Date(l).getTime(),f=new Date(u).getTime();if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const g=s&&Object.keys(s)||a,m=g&&g[0],_=s?.[m],x=!!_&&a.length>1;let w=s&&_&&Object.keys(_).map(N=>({id:N,name:_[N].name}))||a.map(N=>({id:N,name:N}));m==="country_code"&&(w=w.map(N=>({...N,name:Tc(N.id)||N.name})));const v=t.value.meta.granularity_ms;if(typeof v!="number"||isNaN(v)||!isFinite(v)||v===0)return console.error("Invalid step value:",v),{datasets:[],labels:[]};if(!r.length)return{datasets:[],labels:[]};const C=YA(d),A=qA(d,f,v,C,r),F=r?.length?r.reduce((N,B)=>{const k=new Date(B.timestamp).valueOf(),T=B.event;for(const O of a)k in N||(N[k]={}),O in N[k]||(N[k][O]={});for(const O of a)w.forEach(E=>{(_?T[m]===E.id:O===E.id)?(N[k][O]||(N[k][O]={}),N[k][O][E.id]=Math.round(Number(T[O])*1e3)/1e3):g.length||(N[k][O]||(N[k][O]={}),N[k][O][E.id]=Math.round(Number(T[E.id])*1e3)/1e3)});return N},{}):{},L=[..._||a.length===1?a.flatMap(N=>w.map(B=>[N,B.id,B.name,B.id==="empty"])):w.map(N=>[N.name,N.id,N.name,N.id==="empty"])].map(([N,B,k,T],O)=>{const E=A.map(st=>st in F&&N in F[st]?{x:st,y:F[st][N][B]||0}:{x:st,y:0});let{colorPalette:W,fill:J}=n;vt(W)&&(W=li);const at=Ou(O,k,T,W),lt=Cy(k)?e.t(`chartLabels.${k}`):k,G=Cy(N)?e.t(`chartLabels.${N}`):N,rt=a.findIndex(st=>st===N);return{rawDimension:k,rawMetric:N,label:x?`${lt} — ${G}`:lt,borderColor:at,backgroundColor:at,data:E,total:E.reduce((st,{y:nt})=>st+Number(nt),0),...PR,...x?{borderDash:rt===0?[]:[rt*4,2]}:{},fill:J,borderWidth:J?LR:IR,isSegmentEmpty:T}});return m==="status_code"||m==="status_code_grouped"?L.sort((N,B)=>(N.label??"")<(B.label??"")?-1:1):L.sort((N,B)=>Number(N.total)<Number(B.total)?-1:1),{datasets:L}}}catch(r){return console.error(r),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const GA=2,KA=.6,jm=1,XA=2,Gm=50,ZA=[6,4],QA=[2,3],JA=(n,t)=>{const e=Math.sin(t)*1e4;return(e-Math.floor(e))*n};function tR(n,t){const{i18n:e}=Mt.useI18n(),i=(r,s)=>s||(r===Gm?e.t("scatter.median"):e.t("scatter.percentile",{value:r}));return p.computed(()=>{try{const r=t.value;if(!r?.points?.length)return{datasets:[]};const{metric:s,dimension:a,display:l,xMetric:u,xMetricUnit:d}=r,f=u?e.te(`chartLabels.${u}`)&&e.t(`chartLabels.${u}`)||u:"",g=n.scatter||{},m=g.jitterMs??0,_=g.pointRadius??GA,x=g.pointOpacity??KA,w=new Map,v=[];r.points.forEach(E=>{const W=E.group??s,J=w.get(W)||[];let at,lt;E.x!==void 0?(at={x:E.x,timestamp:E.timestamp},lt=[{label:f,value:E.x,...d?{unit:d}:{}},...E.extras??[]]):(at={x:E.timestamp+JA(m,E.timestamp+E.value)},lt=E.extras??[]),J.push({...at,y:E.value,...lt.length?{extras:lt}:{}}),w.set(W,J),v.push(E.value)});const C=g.percentileLines||[],A=[...C.map(E=>E.percentile),...g.outlierPercentile!==void 0?[g.outlierPercentile]:[]],F=A.length?TE(v,A):new Map,I=g.outlierPercentile!==void 0?F.get(g.outlierPercentile):void 0,L=I!==void 0&&Number.isFinite(I),N=vt(n.colorPalette)?li:n.colorPalette,B=n.themeColors?.value??Yu(),k=[],T=E=>{const W=E?.y;return L&&Number.isFinite(W)&&W>I};Array.from(w.entries()).forEach(([E,W],J)=>{const at=a&&l?.[E]?.name||E,lt=E==="empty",G=Ou(J,at,lt,N),rt=Vu(G,x),st=e.te(`chartLabels.${at}`)&&e.t(`chartLabels.${at}`)||at;k.push({type:"scatter",rawDimension:at,rawMetric:s,label:st,borderColor:nt=>T(nt.raw)?B.outlier:G,backgroundColor:nt=>T(nt.raw)?B.outlier:rt,pointRadius:nt=>T(nt.raw)?_+jm:_,pointHoverRadius:nt=>(T(nt.raw)?_+jm:_)+XA,data:W,pointBorderWidth:0,showLine:!1,isSegmentEmpty:lt})});const O=[];return C.forEach(E=>{const W=F.get(E.percentile);if(W===void 0||!Number.isFinite(W))return;const J=E.percentile===Gm;O.push({percentile:E.percentile,label:i(E.percentile,E.label),value:W,color:E.color||(J?B.medianLine:B.outlier),borderDash:E.borderDash||(J?ZA:QA)})}),{datasets:k,...L?{outlier:{value:I,label:e.t("scatter.outlier",{label:i(g.outlierPercentile)}),color:B.outlier}}:{},...O.length?{referenceLines:O}:{}}}catch(r){return console.warn(r),{datasets:[]}}})}const eR=(n,t)=>{p.watch([n,t],(e,i,r)=>{const[s,a]=e;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,s),r(()=>{window._AnalyticsChartDataInternal?.delete(a)}))},{immediate:!0})};function nR(){const{i18n:n}=Mt.useI18n();return{translateUnit:(e,i)=>{const r=i===1,s=`chartUnits.${e}`;return po(e)?"":n.te(s)?n.t(s,{plural:r?"":"s"}):e}}}const iR="analytics-query-provider",Km=2;function rR(){const n=p.inject(iR);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function Xm(n,t){return p.getCurrentScope()?(p.onScopeDispose(n,t),!0):!1}const Zm=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const sR=n=>n!=null,oR=Object.prototype.toString,aR=n=>oR.call(n)==="[object Object]";function qa(n){return Array.isArray(n)?n:[n]}function lR(n){return p.getCurrentInstance()}function cR(n,t={}){if(!p.isRef(n))return p.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=p.customRef(()=>({get(){return n.value[i]},set(r){var s;if(!((s=p.toValue(t.replaceRef))!==null&&s!==void 0)||s)if(Array.isArray(n.value)){const a=[...n.value];a[i]=r,n.value=a}else{const a={...n.value,[i]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=r}}));return e}function uR(n,t=!0,e){lR()?p.onMounted(n,e):t?n():p.nextTick(n)}function dR(n,t,e){return p.watch(n,t,{...e,immediate:!0})}const ja=Zm?window:void 0;function Gr(n){var t;const e=p.toValue(n);return(t=e?.$el)!==null&&t!==void 0?t:e}function uo(...n){const t=(i,r,s,a)=>(i.addEventListener(r,s,a),()=>i.removeEventListener(r,s,a)),e=p.computed(()=>{const i=qa(p.toValue(n[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return dR(()=>{var i,r;return[(i=(r=e.value)===null||r===void 0?void 0:r.map(s=>Gr(s)))!==null&&i!==void 0?i:[ja].filter(s=>s!=null),qa(p.toValue(e.value?n[1]:n[0])),qa(p.unref(e.value?n[2]:n[1])),p.toValue(e.value?n[3]:n[2])]},([i,r,s,a],l,u)=>{if(!i?.length||!r?.length||!s?.length)return;const d=aR(a)?{...a}:a,f=i.flatMap(g=>r.flatMap(m=>s.map(_=>t(g,m,_,d))));u(()=>{f.forEach(g=>g())})},{flush:"post"})}function fR(){const n=p.shallowRef(!1),t=p.getCurrentInstance();return t&&p.onMounted(()=>{n.value=!0},t),n}function Qm(n){const t=fR();return p.computed(()=>(t.value,!!n()))}function hR(n,t,e={}){const{window:i=ja,...r}=e;let s;const a=Qm(()=>i&&"MutationObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=p.watch(p.computed(()=>{const g=qa(p.toValue(n)).map(Gr).filter(sR);return new Set(g)}),g=>{l(),a.value&&g.size&&(s=new MutationObserver(t),g.forEach(m=>s.observe(m,r)))},{immediate:!0,flush:"post"}),d=()=>s?.takeRecords(),f=()=>{u(),l()};return Xm(f),{isSupported:a,stop:f,takeRecords:d}}const Ga={speed:2,margin:30,direction:"both"};function pR(n){n.scrollLeft>n.scrollWidth-n.clientWidth&&(n.scrollLeft=Math.max(0,n.scrollWidth-n.clientWidth)),n.scrollTop>n.scrollHeight-n.clientHeight&&(n.scrollTop=Math.max(0,n.scrollHeight-n.clientHeight))}function gR(n,t={}){var e,i,r,s;const{pointerTypes:a,preventDefault:l,stopPropagation:u,exact:d,onMove:f,onEnd:g,onStart:m,initialValue:_,axis:x="both",draggingElement:w=ja,containerElement:v,handle:C=n,buttons:A=[0],restrictInView:F,autoScroll:I=!1}=t,L=p.ref((e=p.toValue(_))!==null&&e!==void 0?e:{x:0,y:0}),N=p.ref(),B=H=>a?a.includes(H.pointerType):!0,k=H=>{p.toValue(l)&&H.preventDefault(),p.toValue(u)&&H.stopPropagation()},T=p.toValue(I),O=typeof T=="object"?{speed:(i=p.toValue(T.speed))!==null&&i!==void 0?i:Ga.speed,margin:(r=p.toValue(T.margin))!==null&&r!==void 0?r:Ga.margin,direction:(s=T.direction)!==null&&s!==void 0?s:Ga.direction}:Ga,E=H=>typeof H=="number"?[H,H]:[H.x,H.y],W=(H,q,X)=>{const{clientWidth:_t,clientHeight:dt,scrollLeft:tt,scrollTop:pt,scrollWidth:ft,scrollHeight:Y}=H,[et,ot]=E(O.margin),[xt,Lt]=E(O.speed);let wt=0,Ot=0;(O.direction==="x"||O.direction==="both")&&(X.x<et&&tt>0?wt=-xt:X.x+q.width>_t-et&&tt<ft-_t&&(wt=xt)),(O.direction==="y"||O.direction==="both")&&(X.y<ot&&pt>0?Ot=-Lt:X.y+q.height>dt-ot&&pt<Y-dt&&(Ot=Lt)),(wt||Ot)&&H.scrollBy({left:wt,top:Ot,behavior:"auto"})};let J=null;const at=()=>{const H=p.toValue(v);H&&!J&&(J=setInterval(()=>{const q=p.toValue(n).getBoundingClientRect(),{x:X,y:_t}=L.value,dt={x:X-H.scrollLeft,y:_t-H.scrollTop};dt.x>=0&&dt.y>=0&&(W(H,q,dt),dt.x+=H.scrollLeft,dt.y+=H.scrollTop,L.value=dt)},1e3/60))},lt=()=>{J&&(clearInterval(J),J=null)},G=(H,q,X,_t)=>{const[dt,tt]=typeof X=="number"?[X,X]:[X.x,X.y],{clientWidth:pt,clientHeight:ft}=q;return H.x<dt||H.x+_t.width>pt-dt||H.y<tt||H.y+_t.height>ft-tt},rt=()=>{if(p.toValue(t.disabled)||!N.value)return;const H=p.toValue(v);if(!H)return;const q=p.toValue(n).getBoundingClientRect(),{x:X,y:_t}=L.value,dt={x:X-H.scrollLeft,y:_t-H.scrollTop};G(dt,H,O.margin,q)?at():lt()};p.toValue(I)&&p.watch(L,rt);const st=H=>{var q;if(!p.toValue(A).includes(H.button)||p.toValue(t.disabled)||!B(H)||p.toValue(d)&&H.target!==p.toValue(n))return;const X=p.toValue(v),_t=X==null||(q=X.getBoundingClientRect)===null||q===void 0?void 0:q.call(X),dt=p.toValue(n).getBoundingClientRect(),tt={x:H.clientX-(X?dt.left-_t.left+(I?0:X.scrollLeft):dt.left),y:H.clientY-(X?dt.top-_t.top+(I?0:X.scrollTop):dt.top)};m?.(tt,H)!==!1&&(N.value=tt,k(H))},nt=H=>{if(p.toValue(t.disabled)||!B(H)||!N.value)return;const q=p.toValue(v);q instanceof HTMLElement&&pR(q);const X=p.toValue(n).getBoundingClientRect();let{x:_t,y:dt}=L.value;if((x==="x"||x==="both")&&(_t=H.clientX-N.value.x,q&&(_t=Math.min(Math.max(0,_t),q.scrollWidth-X.width))),(x==="y"||x==="both")&&(dt=H.clientY-N.value.y,q&&(dt=Math.min(Math.max(0,dt),q.scrollHeight-X.height))),p.toValue(I)&&q&&(J===null&&W(q,X,{x:_t,y:dt}),_t+=q.scrollLeft,dt+=q.scrollTop),q&&(F||I)){if(x!=="y"){const tt=_t-q.scrollLeft;tt<0?_t=q.scrollLeft:tt>q.clientWidth-X.width&&(_t=q.clientWidth-X.width+q.scrollLeft)}if(x!=="x"){const tt=dt-q.scrollTop;tt<0?dt=q.scrollTop:tt>q.clientHeight-X.height&&(dt=q.clientHeight-X.height+q.scrollTop)}}L.value={x:_t,y:dt},f?.(L.value,H),k(H)},ct=H=>{p.toValue(t.disabled)||!B(H)||N.value&&(N.value=void 0,I&<(),g?.(L.value,H),k(H))};if(Zm){const H=()=>{var q;return{capture:(q=t.capture)!==null&&q!==void 0?q:!0,passive:!p.toValue(l)}};uo(C,"pointerdown",st,H),uo(w,"pointermove",nt,H),uo(w,["pointerup","pointercancel"],ct,H)}return{...cR(L),position:L,isDragging:p.computed(()=>!!N.value),style:p.computed(()=>`
|
|
4
|
+
left: ${L.value.x}px;
|
|
5
|
+
top: ${L.value.y}px;
|
|
6
|
+
${I?"text-wrap: nowrap;":""}
|
|
7
|
+
`)}}function mR(n,t,e={}){const{window:i=ja,...r}=e;let s;const a=Qm(()=>i&&"ResizeObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=p.watch(p.computed(()=>{const f=p.toValue(n);return Array.isArray(f)?f.map(g=>Gr(g)):[Gr(f)]}),f=>{if(l(),a.value&&i){s=new ResizeObserver(t);for(const g of f)g&&s.observe(g,r)}},{immediate:!0,flush:"post"}),d=()=>{l(),u()};return Xm(d),{isSupported:a,stop:d}}function yR(n,t={}){const{reset:e=!0,windowResize:i=!0,windowScroll:r=!0,immediate:s=!0,updateTiming:a="sync"}=t,l=p.shallowRef(0),u=p.shallowRef(0),d=p.shallowRef(0),f=p.shallowRef(0),g=p.shallowRef(0),m=p.shallowRef(0),_=p.shallowRef(0),x=p.shallowRef(0);function w(){const C=Gr(n);if(!C){e&&(l.value=0,u.value=0,d.value=0,f.value=0,g.value=0,m.value=0,_.value=0,x.value=0);return}const A=C.getBoundingClientRect();l.value=A.height,u.value=A.bottom,d.value=A.left,f.value=A.right,g.value=A.top,m.value=A.width,_.value=A.x,x.value=A.y}function v(){a==="sync"?w():a==="next-frame"&&requestAnimationFrame(()=>w())}return mR(n,v),p.watch(()=>Gr(n),C=>!C&&v()),hR(n,v,{attributeFilter:["style","class"]}),r&&uo("scroll",v,{capture:!0,passive:!0}),i&&uo("resize",v,{passive:!0}),uR(()=>{s&&v()}),{height:l,bottom:u,left:d,right:f,top:g,width:m,x:_,y:x,update:v}}function _R(n,t){const{top:e,left:i}=yR(n),r=p.computed(()=>n.value?`${parseFloat(t.left)+i.value}px`:t.left),s=p.computed(()=>n.value?`${parseFloat(t.top)+e.value}px`:t.top);return{tooltipAbsoluteLeft:r,tooltipAbsoluteTop:s}}const bR=({bucketCount:n,minStamp:t,maxStamp:e,timestamps:i})=>{const r=[...i].filter(u=>u>=t&&u<=e).sort((u,d)=>u-d),s=[];if(e-t<n-2)return[];const a=(e-t)/n;let l=0;for(let u=0;u<n;u++){const d=t+u*a,f=t+(u+1)*a;let g=0;for(;l<r.length&&r[l]>=d&&r[l]<=f;)g++,l++;s.push([Math.ceil(d),g])}return s},Jm=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),fo=p.ref({}),xR=n=>(fo.value[n]||(fo.value[n]=Jm()),fo.value[n]),wR=(n,t)=>{const e=fo.value[t];if(!e)return;const i=e.minCounts[n]!==void 0||e.maxCounts[n]!==void 0||e.minStamps[n]!==void 0||e.maxStamps[n]!==void 0||e.renderPoints[n]!==void 0;e&&i&&(delete e.minCounts[n],delete e.maxCounts[n],delete e.minStamps[n],delete e.maxStamps[n],delete e.renderPoints[n],Object.keys(e.minCounts).length||Object.keys(e.maxCounts).length||Object.keys(e.minStamps).length||Object.keys(e.maxStamps).length||Object.keys(e.renderPoints).length||delete fo.value[t])};function vR({chartKey:n,datasets:t,groupKey:e,minStamp:i=void 0,maxStamp:r=void 0,minCount:s=void 0,maxCount:a=void 0,renderPoints:l=void 0,type:u}){const f=e!==void 0&&n!==void 0?xR(e):Jm(),g=n!==void 0?n:"static-chart-key",m=p.computed(()=>t.reduce((O,{timestamps:E})=>[...O,...E],[])),_=p.computed(()=>i||m.value.reduce((O,E)=>O===0?E:Math.min(O,E),0)),x=p.computed(()=>r||m.value.reduce((O,E)=>Math.max(O,E),0));p.watchEffect(()=>{f.minStamps[g]=_.value,f.maxStamps[g]=x.value,l!==void 0&&(f.renderPoints[g]=l)});const w=p.computed(()=>Object.values(f.minStamps).reduce((O,E)=>O===0?E:Math.min(O,E),0)),v=p.computed(()=>Object.values(f.maxStamps).reduce((O,E)=>Math.max(O,E),0)),C=p.computed(()=>{const O=Object.values(f.renderPoints);return O.length===0?24:O.reduce((E,W)=>Math.max(E,W),2)}),A=p.computed(()=>{const O=v.value-w.value;return Math.ceil(O/C.value)}),F=p.computed(()=>t.length>1),I=p.computed(()=>t.map(({timestamps:O,color:E,label:W})=>({data:bR({bucketCount:C.value,minStamp:w.value,maxStamp:v.value,timestamps:O}).map(([lt,G])=>({x:lt,y:G})),label:W,...(u==="sparkline_bar"||F.value)&&E&&{backgroundColor:E},...u!=="sparkline_bar"&&E&&{borderColor:E},...F.value&&u!=="sparkline_bar"&&{fill:!0}}))),L=p.computed(()=>{const O=I.value[0]?.data?.length??0,E=[];for(let W=0;W<O;W++){let J=0;for(let at=0;at<I.value.length;at++)J+=I.value[at].data[W].y;E.push(J)}return E}),N=p.computed(()=>{const O=L.value.reduce((E,W)=>Math.max(E,W),0);return Math.max(O,a??0)}),B=p.computed(()=>{const O=I.value.reduce((J,{data:at})=>[...J,...at.map(({y:lt})=>lt)],[]),E=O.length?O[0]:0,W=O.reduce((J,at)=>Math.min(J,at),E);return s===void 0?W:Math.min(W,s)});p.watchEffect(()=>{f.maxCounts[g]=N.value,f.minCounts[g]=B.value});const k=p.computed(()=>{const O=Object.values(f.minCounts),E=O.length?O[0]:0;return O.reduce((W,J)=>Math.min(W,J),E)}),T=p.computed(()=>Object.values(f.maxCounts).reduce((O,E)=>Math.max(O,E),0));return p.onUnmounted(()=>{n!==void 0&&e!==void 0&&wR(n,e)}),{syncedMinStamp:w,syncedMaxStamp:v,syncedRenderPoints:C,syncedChartDatasets:I,syncedGroupSizeMs:A,syncedMinCount:k,syncedMaxCount:T}}const Mt={useBarChartOptions:RA,useChartJSCommon:PA,useChartLegendValues:LA,useChartSelectedRange:NA,useExploreResultToDatasets:$A,useExploreResultToTimeDataset:jA,useScatterDatasets:tR,useDonutChartOptions:BA,useLineChartOptions:FA,useScatterChartOptions:HA,useI18n:gM,useReportChartDataForSynthetics:eR,useTranslatedUnits:nR,useEvaluateFeatureFlag:rR,useTooltipAbsolutePosition:_R,useSparklineSync:vR},Ka=n=>["interactive","zoom-interactive"].includes(n),ku=(n,t,e,i)=>{const{tooltip:r}=t;if(r.opacity===0&&!Ka(n.interactionMode)){n.showTooltip=!1;return}const{i18n:s}=Mt.useI18n(),{formatUnit:a}=ti({i18n:s}),l=n.chartTooltipSortFn||((u,d)=>d.rawValue-u.rawValue);if(r.body&&!Ka(n.interactionMode)){const u=r.labelColors,d=t.chart.config?.options?.indexAxis==="y"?"x":"y",f=r.dataPoints[0].parsed.x??0;n.tooltipContext=i?.contextFormatter?i.contextFormatter(f,e,r.dataPoints[0].raw):Zr({tickValue:new Date(f),granularity:e}),n.tooltipSeries=r.dataPoints.map((m,_)=>{const x=m.parsed[d],w=a(x??0,n.units,{translateUnit:n.translateUnit}),v=m.raw?.tooltipLabel||m.dataset.label;return{backgroundColor:u[_].backgroundColor,borderColor:u[_].borderColor,label:v,value:w,rawValue:x,isSegmentEmpty:m.dataset.isSegmentEmpty}}).sort(l);const g=r.dataPoints[0]?.raw?.extras??[];for(const m of g)n.tooltipSeries.push({label:m.label,value:m.unit?a(Number(m.value)||0,m.unit,{translateUnit:n.translateUnit}):String(m.value),rawValue:Number(m.value)||0,isExtra:!0});n.left=`${r.x}px`,n.top=`${r.y}px`,n.showTooltip=!0}},ty=(n,t)=>{const{tooltip:e}=t,{i18n:i}=Mt.useI18n(),{formatUnit:r}=ti({i18n:i});if(e.opacity===0&&!Ka(n.interactionMode)){n.showTooltip=!1;return}const s=n.chartTooltipSortFn||((a,l)=>l.rawValue-a.rawValue);if(e.body&&!Ka(n.interactionMode)){const a=e.labelColors,l=t.chart.config?.options?.indexAxis==="y"?"x":"y",u=["gauge","donut"].includes(n.chartType);u?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((d,f)=>{const g=u?d.parsed:d.parsed[l],m=r(g??0,n.units,{translateUnit:n.translateUnit});let _;return u?_=d.dataset.labels[d.dataIndex]:_=d.dataset.label,{backgroundColor:a[f].backgroundColor,borderColor:a[f].borderColor,label:_,value:m,rawValue:g,isSegmentEmpty:d.dataset.isSegmentEmpty}}).sort(s),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},SR=n=>n&&n.datasets&&n.datasets.length,TR=n=>SR(n)&&n.datasets.some(t=>t.data.length),MR=n=>n.datasets.some(t=>t.data[0]&&Oc(t.data[0].x)),kR=n=>!!TR(n)&&n.datasets.some(t=>t.data.length==1),DR=n=>MR(n)&&n.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),Xa=(n,t,e)=>{const r=Math.min(t/1150,1),s=.15,a=1.15,l=n.x??0;return l<e?l+t*s*(1-r):l-t*a*(1-r)},ey=(n,t,e)=>{const s=n.y??0;return s<e?s+t*.15:s-t*.5};function ny(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Du=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(r=>!t?.[r.text]?.isThreshold).map(((r,s)=>({...r,value:t&&t[r.text],isSegmentEmpty:i.datasets[s].isSegmentEmpty}))).sort(e)},CR=2,iy=10,ry=12,Za=10,li=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Cu=(n,t)=>(t||li)[n%li.length],OR="#6f7787",AR={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"}},RR=n=>{const t=Math.floor(parseInt(n,10)/100)*100;return AR[t]?.background||"#fafafa"},ER=dv,Ou=(n,t,e,i)=>{let r;return e?r=ER:Array.isArray(i)?r=Cu(n,i):r=i[t],r||Cu(n)},Au=n=>{switch(n){case"error":return fv;case"warning":return mv;case"neutral":return Vh;default:return Vh}},PR={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},IR=2,LR=0,Ru=new Map,sy=(n,t)=>{const{i18n:e}=Mt.useI18n(),{formatBytes:i}=ti({i18n:e});return t==="bytes"?i(n):t==="count/minute"?n.toFixed(2):la.format(n)},NR=n=>{const e=document.createElement("canvas").getContext("2d"),i=le({});return e.font=i.string,e.measureText(n).width},BR=()=>{const n="label_height";if(!Ru.has(n)){const t=le({});Ru.set(n,t.lineHeight)}return Ru.get(n)},FR=(n,t)=>t.datasets.reduce((e,i,r)=>n.isDatasetVisible(r)?e+i.data.reduce((s,a)=>isNaN(a)?s:s+a,0):e,0),zR=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,UR=uv,HR={100:bv,101:xv,102:wv,103:vv,200:Sv,201:Tv,202:Mv,203:kv,204:Dv,205:Cv,206:Ov,207:Av,208:Rv,226:Ev,300:Pv,301:Iv,302:Lv,303:Nv,304:Bv,305:Fv,307:zv,308:Uv,400:Hv,401:Wv,402:$v,403:Vv,404:Yv,405:qv,406:jv,407:Gv,408:Kv,409:Xv,410:Zv,411:Qv,412:Jv,413:t1,414:e1,415:n1,416:i1,417:r1,418:s1,421:o1,422:a1,423:l1,424:c1,425:u1,426:d1,428:f1,429:h1,431:p1,451:g1,500:m1,501:y1,502:_1,503:b1,504:x1,505:w1,506:v1,507:S1,508:T1,510:M1,511:k1},WR={100:D1,200:C1,300:O1,400:A1,500:R1},$R={"1XX":E1,"2XX":P1,"3XX":I1,"4XX":L1,"5XX":N1},oy=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100;return HR[t]??WR[e]??UR},Eu={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=oy(`${t}`),n),{}),____OTHER____:cv,...$R};function ay(n,t,e){const i=hp(),r=qR(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?VR(r,t):YR(r,t)}function VR(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function YR(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function qR(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function jR(n,t){const e=QR(t);return"formatToParts"in e?KR(e,n):XR(e,n)}const GR={year:0,month:1,day:2,hour:3,minute:4,second:5};function KR(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=GR[e[r].type];s!==void 0&&(i[s]=parseInt(e[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function XR(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Pu={},ly=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")),ZR=ly==="06/25/2014, 00:00:00"||ly==="06/25/2014 00:00:00";function QR(n){return Pu[n]||(Pu[n]=ZR?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Pu[n]}function cy(n,t,e,i,r,s,a){const l=new Date(0);return l.setUTCFullYear(n,t,e),l.setUTCHours(i,r,s,a),l}const uy=36e5,JR=6e4,Iu={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Lu(n,t,e){if(!n)return 0;let i=Iu.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=Iu.timezoneHH.exec(n),i)return r=parseInt(i[1],10),dy(r)?-(r*uy):NaN;if(i=Iu.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return dy(r,a)?(s=Math.abs(r)*uy+a*JR,i[1]==="+"?-s:s):NaN}if(nE(n)){t=new Date(t||Date.now());const a=e?t:tE(t),l=Nu(a,n);return-(e?l:eE(t,l,n))}return NaN}function tE(n){return cy(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Nu(n,t){const e=jR(n,t),i=cy(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let r=n.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function eE(n,t,e){let r=n.getTime()-t;const s=Nu(new Date(r),e);if(t===s)return t;r-=s-t;const a=Nu(new Date(r),e);return s===a?s:Math.max(s,a)}function dy(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const fy={};function nE(n){if(fy[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),fy[n]=!0,!0}catch{return!1}}const iE=60*1e3,rE={X:function(n,t,e){const i=Bu(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return hy(i);case"XXXX":case"XX":return Kr(i);default:return Kr(i,":")}},x:function(n,t,e){const i=Bu(e.timeZone,n);switch(t){case"x":return hy(i);case"xxxx":case"xx":return Kr(i);default:return Kr(i,":")}},O:function(n,t,e){const i=Bu(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+sE(i,":");default:return"GMT"+Kr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return ay("short",n,e);default:return ay("long",n,e)}}};function Bu(n,t){const e=n?Lu(n,t,!0)/iE:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Qa(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Kr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Qa(Math.floor(i/60),2),s=Qa(Math.floor(i%60),2);return e+r+t+s}function hy(n,t){return n%60===0?(n>0?"-":"+")+Qa(Math.abs(n)/60,2):Kr(n,t)}function sE(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),s=i%60;return s===0?e+String(r):e+String(r)+t+Qa(s,2)}function py(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const oE=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Fu=36e5,gy=6e4,aE=2,Xe={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:oE};function my(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?aE:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=lE(n),{year:r,restDateString:s}=cE(i.date,e),a=uE(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const l=a.getTime();let u=0,d;if(i.time&&(u=dE(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Lu(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=py(new Date(l+u)),d=py(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function lE(n){const t={};let e=Xe.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Xe.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=Xe.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function cE(n,t){if(n){const e=Xe.YYY[t],i=Xe.YYYYY[t];let r=Xe.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=Xe.YY.exec(n)||e.exec(n),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}}return{year:null}}function uE(n,t){if(t===null)return null;let e,i,r;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let s=Xe.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,by(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=Xe.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return pE(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=Xe.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return by(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=Xe.Www.exec(n),s)return r=parseInt(s[1],10)-1,xy(r)?yy(t,r):new Date(NaN);if(s=Xe.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return xy(r,a)?yy(t,r,a):new Date(NaN)}return null}function dE(n){let t,e,i=Xe.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),zu(t)?t%24*Fu:NaN;if(i=Xe.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),zu(t,e)?t%24*Fu+e*gy:NaN;if(i=Xe.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return zu(t,e,r)?t%24*Fu+e*gy+r*1e3:NaN}return null}function yy(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const r=i.getUTCDay()||7,s=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const fE=[31,28,31,30,31,30,31,31,30,31,30,31],hE=[31,29,31,30,31,30,31,31,30,31,30,31];function _y(n){return n%400===0||n%4===0&&n%100!==0}function by(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=_y(n);if(i&&e>hE[t]||!i&&e>fE[t])return!1}return!0}function pE(n,t){if(t<1)return!1;const e=_y(n);return!(e&&t>366||!e&&t>365)}function xy(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function zu(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const gE=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Uu(n,t,e={}){t=String(t);const i=t.match(gE);if(i){const r=my(e.originalDate||n,e);t=i.reduce(function(s,a){if(a[0]==="'")return s;const l=s.indexOf(a),u=s[l-1]==="'",d=s.replace(a,"'"+rE[a[0]](r,a,e)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return da(n,t,e)}function mE(n,t,e){n=my(n,e);const i=Lu(t,n,!0),r=new Date(n.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function ho(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Uu(mE(n,t,{timeZone:i.timeZone}),e,i)}const yE=(n,t)=>`${ho(n,t,"yyyy")} W${ho(n,t,"II")}`,Hu="yyyy-MM-dd h:mm:ss a",Wu="h:mm:ss a",hr="yyyy-MM-dd h:mm a",Xr="h:mm a",_E="yyyy-MM-dd",$u="MMM dd, yyyy h:mm:ss a",Li="MMM dd, yyyy h:mm a",bE={secondly:n=>n?Hu:Wu,tenSecondly:n=>n?Hu:Wu,thirtySecondly:n=>n?Hu:Wu,minutely:n=>n?hr:Xr,fiveMinutely:n=>n?hr:Xr,tenMinutely:n=>n?hr:Xr,thirtyMinutely:n=>n?hr:Xr,hourly:n=>n?hr:Xr,twoHourly:n=>n?hr:Xr,twelveHourly:()=>hr,daily:()=>_E},xE={secondly:()=>$u,tenSecondly:()=>$u,thirtySecondly:()=>$u,minutely:()=>Li,fiveMinutely:()=>Li,tenMinutely:()=>Li,thirtyMinutely:()=>Li,hourly:()=>Li,twoHourly:()=>Li,twelveHourly:()=>Li,daily:()=>Li};function wy({tickValue:n,granularity:t,timezone:e,dayBoundaryCrossed:i=!1,tickMap:r,tooltipMap:s,defaultFormat:a}){const l=e||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return yE(n,l);if(r&&r[t]){const u=r[t](i);return ho(n,l,u)}if(s&&s[t]){const u=s[t]();return ho(n,l,u)}return ho(n,l,a)}const vy=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>wy({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:bE,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),Zr=({tickValue:n,granularity:t,timezone:e})=>wy({tickValue:n,granularity:t,timezone:e,tooltipMap:xE,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),Sy=n=>n?.code==="ERR_CANCELED"||n?.name==="CanceledError"||n?.name==="AbortError",wE=n=>{const{i18n:t}=Mt.useI18n();return Sy(n)?{type:"canceled",message:t.t("query_errors.canceled.message")}:n?.status===403?{status:n.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:n?.status===408||n?.message?.includes("timeout")?{status:n.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:n?.response?.data?.message==="Range not allowed for this tier"?{status:n.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:n.status,type:"other",message:t.t("query_errors.other.message"),details:n.response?.data?.invalid_parameters?.map(e=>e.reason).join(", ")||n?.message}},po=n=>n.toLocaleLowerCase().endsWith("count"),vE=n=>{const t=n.toLocaleLowerCase();return["sum","count","cost","tokens"].some(e=>t.endsWith(e))},SE=(n,t)=>{if(!n.length)return NaN;const i=Math.min(100,Math.max(0,t))/100*(n.length-1),r=Math.floor(i),s=Math.ceil(i);return r===s?n[r]:n[r]+(n[s]-n[r])*(i-r)},TE=(n,t)=>{const e=n.filter(i=>Number.isFinite(i)).sort((i,r)=>i-r);return new Map(t.map(i=>[i,SE(e,i)]))},Ty=.7,Vu=(n,t)=>{const e=Ta(n.trim());return e.valid?e.alpha(t).rgbString():n},Yu=n=>{const t=n??(typeof document>"u"?null:document.documentElement);if(typeof window>"u"||!t)return{medianLine:Yh,outlier:Wh,outlierBand:Vu($h,Ty)};const e=window.getComputedStyle(t),i=(r,s)=>e.getPropertyValue(r).trim()||s;return{medianLine:i("--kui-color-text",Yh),outlier:i("--kui-color-background-danger",Wh),outlierBand:Vu(i("--kui-color-background-danger-weakest",$h),Ty)}},ME="empty",My=n=>{if(!n||!("meta"in n)||!("data"in n))return;const{display:t,metric_names:e,metric_units:i,start:r,end:s,truncated:a,limit:l,datasource:u}=n.meta;if(!e?.length){console.error("Cannot build scatter chart data from this explore result. Missing metric names.");return}const d=e.length>1?e[0]:void 0,f=d?e[1]:e[0],g=t&&Object.keys(t)[0]||void 0,m=n.data??[],_=[];for(const x of m){const w=Dy(x.timestamp,x.event[f],g?x.event[g]:void 0);if(w){if(d){const v=ky(x.event[d]);if(v===void 0)continue;w.x=v}_.push(w)}}return{points:_,metric:f,metricUnit:i?.[f],...d?{xMetric:d,xMetricUnit:i?.[d]}:{},dimension:g,display:g?t?.[g]:void 0,start:r,end:s,truncated:a,limit:l,datasource:u}},ky=n=>{if(n==null||n==="")return;const t=Number(n);return Number.isFinite(t)?t:void 0},Dy=(n,t,e,i)=>{const r=new Date(n).valueOf(),s=ky(t);if(!Number.isFinite(r)||s===void 0)return;const a=i?.length?{extras:i}:{};return e===void 0?{timestamp:r,value:s,...a}:{timestamp:r,value:s,group:e!==null&&e!==""?String(e):ME,...a}},kE=(n,t,e)=>{if(!e?.length)return;const i=[];for(const{field:r,label:s,unit:a}of e){const l=pr(n,r)??pr(t,r);l==null||l===""||i.push({label:s??r,value:l,...a?{unit:a}:{}})}return i.length?i:void 0},DE=(n,t)=>{if(!n||!("meta"in n))return;const{metric:e,dimension:i,unroll:r,display:s,extraFields:a,metricUnit:l}=t,u=t.timestamp??"request_start";if(!e){console.error("Cannot build scatter chart data from these request records. Missing metric.");return}const d=[];for(const f of n.results??[]){const g=pr(f,u);for(const m of CE(f,r)){const _=pr(m,e),x=i?pr(m,i)??pr(f,i):void 0,w=Dy(g,_,i?x??null:void 0,kE(m,f,a));w&&d.push(w)}}return{points:d,metric:e,metricUnit:l,dimension:i,display:s,start:n.meta?.time_range?.start,end:n.meta?.time_range?.end,truncated:n.truncated,limit:n.limit,datasource:"requests"}},CE=(n,t)=>{if(!t)return[n];const e=pr(n,t);return Array.isArray(e)?e:[]},pr=(n,t)=>{let e=n;for(const i of t.split(".")){if(e===null||typeof e!="object")return;e=e[i]}return e},Cy=n=>Object.hasOwn(wp.chartLabels,n),OE=["hidden","single","full"];var gr=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(gr||{});const AE=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar","scatter"],RE=["gauge","top_n","single_value"],qu=n=>n===null||typeof n!="object"||!("points"in n)?!1:Array.isArray(n.points);var Pe=(n=>(n.Hidden="hidden",n.Bottom="bottom",n))(Pe||{});const Oy={modes:{point(n,t){return Ja(n,t,{intersect:!0})},nearest(n,t,e){return IE(n,t,e)},x(n,t,e){return Ja(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return Ja(n,t,{intersect:e.intersect,axis:"y"})}}};function ju(n,t,e){return(Oy.modes[e.mode]||Oy.modes.nearest)(n,t,e)}function EE(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function PE(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function Ja(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):EE(i,t,e.axis))}function IE(n,t,e){let i=Number.POSITIVE_INFINITY;return Ja(n,t,e).reduce((r,s)=>{const a=s.getCenterPoint(),l=PE(t,a,e.axis),u=Hr(t,l);return u<i?(r=[s],i=u):u===i&&r.push(s),r},[]).sort((r,s)=>r._index-s._index).slice(0,1)}function mr(n,t,e){const i=Math.cos(e),r=Math.sin(e),s=t.x,a=t.y;return{x:s+i*(n.x-s)-r*(n.y-a),y:a+r*(n.x-s)+i*(n.y-a)}}const LE=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,yr=.001,tl=(n,t,e)=>Math.min(e,Math.max(t,n)),Ay=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function NE(n,t,e){for(const i of Object.keys(n))n[i]=tl(n[i],t,e);return n}function BE(n,t,e,i){return!n||!t||e<=0?!1:Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function Ry(n,{x:t,y:e,x2:i,y2:r},s,{borderWidth:a,hitTolerance:l}){const u=(a+l)/2,d=n.x>=t-u-yr&&n.x<=i+u+yr,f=n.y>=e-u-yr&&n.y<=r+u+yr;return s==="x"?d:(s==="y"||d)&&f}function Ey(n,{rect:t,center:e},i,{rotation:r,borderWidth:s,hitTolerance:a}){const l=mr(n,e,xe(-r));return Ry(l,t,i,{borderWidth:s,hitTolerance:a})}function _r(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function FE(n,t,e,i=!0){const r=e.split(".");let s=0;for(const a of t.split(".")){const l=r[s++];if(parseInt(a,10)<parseInt(l,10))break;if(LE(l,a)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const Py=n=>typeof n=="string"&&n.endsWith("%"),Iy=n=>parseFloat(n)/100,Ly=n=>tl(Iy(n),0,1),go=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),zE={box:n=>go(n.centerX,n.centerY),doughnutLabel:n=>go(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>go(n.centerX,n.centerY),line:n=>go(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>go(n.centerX,n.centerY)};function Gu(n,t){return t==="start"?0:t==="end"?n:Py(t)?Ly(t)*n:n/2}function Ni(n,t,e=!0){return typeof t=="number"?t:Py(t)?(e?Ly(t):Iy(t))*n:n}function UE(n,t){const{x:e,width:i}=n,r=t.textAlign;return r==="center"?e+i/2:r==="end"||r==="right"?e+i:e}function Ny(n,t,{borderWidth:e,position:i,xAdjust:r,yAdjust:s},a){const l=It(a),u=t.width+(l?a.width:0)+e,d=t.height+(l?a.height:0)+e,f=Ku(i),g=Uy(n.x,u,r,f.x),m=Uy(n.y,d,s,f.y);return{x:g,y:m,x2:g+u,y2:m+d,width:u,height:d,centerX:g+u/2,centerY:m+d/2}}function Ku(n,t="center"){return It(n)?{x:Ct(n.x,t),y:Ct(n.y,t)}:(n=Ct(n,t),{x:n,y:n})}const By=(n,t)=>n&&n.autoFit&&t<1;function Fy(n,t){const e=n.font,i=qt(e)?e:[e];return By(n,t)?i.map(function(r){const s=le(r);return s.size=Math.floor(r.size*t),s.lineHeight=r.lineHeight,le(s)}):i.map(r=>le(r))}function zy(n){return n&&(en(n.xValue)||en(n.yValue))}function Uy(n,t,e=0,i){return n-Gu(t,i)+e}function Qr(n,t,e){const i=e.init;if(i){if(i===!0)return Wy(t,e)}else return;return HE(n,t,e)}function Hy(n,t,e){let i=!1;return t.forEach(r=>{nn(n[r])?(i=!0,e[r]=n[r]):en(e[r])&&delete e[r]}),i}function Wy(n,t){const e=t.type||"line";return zE[e](n)}function HE(n,t,e){const i=Qt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return Wy(t,e);if(It(i))return i}const Xu=new Map,WE=n=>isNaN(n)||n<=0,$E=n=>n.reduce(function(t,e){return t+=e.string,t},"");function el(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function nl(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(xe(i)),n.translate(-t,-e))}function ci(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function Jr(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function il(n,t){const e=t.content;if(el(e))return{width:Ni(e.width,t.width),height:Ni(e.height,t.height)};const i=Fy(t),r=t.textStrokeWidth,s=qt(e)?e:[e],a=s.join()+$E(i)+r+(n._measureText?"-spriting":"");return Xu.has(a)||Xu.set(a,jE(n,s,i,r)),Xu.get(a)}function $y(n,t,e){const{x:i,y:r,width:s,height:a}=t;n.save(),Jr(n,e);const l=ci(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),Wr(n,{x:i,y:r,w:s,h:a,radius:NE(Oi(e.borderRadius),0,Math.min(s,a)/2)}),n.closePath(),n.fill(),l&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function Vy(n,t,e,i){const r=e.content;if(el(r)){n.save(),n.globalAlpha=XE(e.opacity,r.style.opacity),n.drawImage(r,t.x,t.y,t.width,t.height),n.restore();return}const s=qt(r)?r:[r],a=Fy(e,i),l=e.color,u=qt(l)?l:[l],d=UE(t,e),f=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,VE(n,e)&&GE(n,{x:d,y:f},s,a),KE(n,{x:d,y:f},s,{fonts:a,colors:u}),n.restore()}function VE(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function YE(n,t,e,i){const{radius:r,options:s}=t,a=s.pointStyle,l=s.rotation;let u=(l||0)*Vc;if(el(a)){n.save(),n.translate(e,i),n.rotate(u),n.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),n.restore();return}WE(r)||qE(n,{x:e,y:i,radius:r,rotation:l,style:a,rad:u})}function qE(n,{x:t,y:e,radius:i,rotation:r,style:s,rad:a}){let l,u,d,f;switch(n.beginPath(),s){default:n.arc(t,e,i,0,te),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=xa,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=xa,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),n.closePath();break;case"rectRounded":f=i*.516,d=i-f,l=Math.cos(a+kn)*d,u=Math.sin(a+kn)*d,n.arc(t-l,e-u,f,a-Et,a-re),n.arc(t+u,e-l,f,a-re,a),n.arc(t+l,e+u,f,a,a+re),n.arc(t-u,e+l,f,a+re,a+Et),n.closePath();break;case"rect":if(!r){d=Math.SQRT1_2*i,n.rect(t-d,e-d,2*d,2*d);break}a+=kn;case"rectRot":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+u,e-l),n.lineTo(t+l,e+u),n.lineTo(t-u,e+l),n.closePath();break;case"crossRot":a+=kn;case"cross":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u),n.moveTo(t+u,e-l),n.lineTo(t-u,e+l);break;case"star":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u),n.moveTo(t+u,e-l),n.lineTo(t-u,e+l),a+=kn,l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u),n.moveTo(t+u,e-l),n.lineTo(t-u,e+l);break;case"line":l=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-l,e-u),n.lineTo(t+l,e+u);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(a)*i,e+Math.sin(a)*i);break}n.fill()}function jE(n,t,e,i){n.save();const r=t.length;let s=0,a=i;for(let l=0;l<r;l++){const u=e[Math.min(l,e.length-1)];n.font=u.string;const d=t[l];s=Math.max(s,n.measureText(d).width+i),a+=u.lineHeight}return n.restore(),{width:s,height:a}}function GE(n,{x:t,y:e},i,r){n.beginPath();let s=0;i.forEach(function(a,l){const u=r[Math.min(l,r.length-1)],d=u.lineHeight;n.font=u.string,n.strokeText(a,t,e+d/2+s),s+=d}),n.stroke()}function KE(n,{x:t,y:e},i,{fonts:r,colors:s}){let a=0;i.forEach(function(l,u){const d=s[Math.min(u,s.length-1)],f=r[Math.min(u,r.length-1)],g=f.lineHeight;n.beginPath(),n.font=f.string,n.fillStyle=d,n.fillText(l,t,e+g/2+a),a+=g,n.fill()})}function XE(n,t){const e=Ci(n)?n:t;return Ci(e)?tl(e,0,1):1}const Yy=["left","bottom","top","right"];function ZE(n,t){const{pointX:e,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&nP(t,s);if(!a||rP(t,s,a))return;if(n.save(),n.beginPath(),!ci(n,s))return n.restore();const{separatorStart:u,separatorEnd:d}=QE(t,a),{sideStart:f,sideEnd:g}=tP(t,a,u);(s.margin>0||r.borderWidth===0)&&(n.moveTo(u.x,u.y),n.lineTo(d.x,d.y)),n.moveTo(f.x,f.y),n.lineTo(g.x,g.y);const m=mr({x:e,y:i},t.getCenterPoint(),xe(-t.rotation));n.lineTo(m.x,m.y),n.stroke(),n.restore()}function QE(n,t){const{x:e,y:i,x2:r,y2:s}=n,a=JE(n,t);let l,u;return t==="left"||t==="right"?(l={x:e+a,y:i},u={x:l.x,y:s}):(l={x:e,y:i+a},u={x:r,y:l.y}),{separatorStart:l,separatorEnd:u}}function JE(n,t){const{width:e,height:i,options:r}=n,s=r.callout.margin+r.borderWidth/2;return t==="right"?e+s:t==="bottom"?i+s:-s}function tP(n,t,e){const{y:i,width:r,height:s,options:a}=n,l=a.callout.start,u=eP(t,a.callout);let d,f;return t==="left"||t==="right"?(d={x:e.x,y:i+Ni(s,l)},f={x:d.x+u,y:d.y}):(d={x:e.x+Ni(r,l),y:e.y},f={x:d.x,y:d.y+u}),{sideStart:d,sideEnd:f}}function eP(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function nP(n,t){const e=t.position;return Yy.includes(e)?e:iP(n,t)}function iP(n,t){const{x:e,y:i,x2:r,y2:s,width:a,height:l,pointX:u,pointY:d,centerX:f,centerY:g,rotation:m}=n,_={x:f,y:g},x=t.start,w=Ni(a,x),v=Ni(l,x),C=[e,e+w,e+w,r],A=[i+v,s,i,s],F=[];for(let I=0;I<4;I++){const L=mr({x:C[I],y:A[I]},_,xe(m));F.push({position:Yy[I],distance:Hr(L,{x:u,y:d})})}return F.sort((I,L)=>I.distance-L.distance)[0].position}function rP(n,t,e){const{pointX:i,pointY:r}=n,s=t.margin;let a=i,l=r;return e==="left"?a+=s:e==="right"?a-=s:e==="top"?l+=s:e==="bottom"&&(l-=s),n.inRange(a,l)}const qy={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 ts(n,t,e){return t=typeof t=="number"?t:n.parse(t),ae(t)?n.getPixelForValue(t):e}function br(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const r=e.charAt(0),s=Object.values(n).filter(a=>a.axis&&a.axis===r);return s.length?s[0].id:r}function jy(n,t){if(n){const e=n.options.reverse,i=ts(n,t.min,e?t.end:t.start),r=ts(n,t.max,e?t.start:t.end);return{start:i,end:r}}}function Gy(n,t){const{chartArea:e,scales:i}=n,r=i[br(i,t,"xScaleID")],s=i[br(i,t,"yScaleID")];let a=e.width/2,l=e.height/2;return r&&(a=ts(r,t.xValue,r.left+r.width/2)),s&&(l=ts(s,t.yValue,s.top+s.height/2)),{x:a,y:l}}function Zu(n,t){const e=n.scales,i=e[br(e,t,"xScaleID")],r=e[br(e,t,"yScaleID")];if(!i&&!r)return{};let{left:s,right:a}=i||n.chartArea,{top:l,bottom:u}=r||n.chartArea;const d=Zy(i,{min:t.xMin,max:t.xMax,start:s,end:a});s=d.start,a=d.end;const f=Zy(r,{min:t.yMin,max:t.yMax,start:u,end:l});return l=f.start,u=f.end,{x:s,y:l,x2:a,y2:u,width:a-s,height:u-l,centerX:s+(a-s)/2,centerY:l+(u-l)/2}}function Ky(n,t){if(!zy(t)){const e=Zu(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const r=i*2,s=e.centerX+t.xAdjust,a=e.centerY+t.yAdjust;return{x:s-i,y:a-i,x2:s+i,y2:a+i,centerX:s,centerY:a,width:r,height:r,radius:i}}return oP(n,t)}function sP(n,t){const{scales:e,chartArea:i}=n,r=e[t.scaleID],s={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return r?aP(r,s,t):lP(e,s,t),s}function Xy(n,t){const e=Zu(n,t);return e.initProperties=Qr(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:dP(n,e,t),initProperties:e.initProperties}],e}function oP(n,t){const e=Gy(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function Zy(n,t){const e=jy(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function aP(n,t,e){const i=ts(n,e.value,NaN),r=ts(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function lP(n,t,e){for(const i of Object.keys(qy)){const r=n[br(n,e,i)];if(r){const{min:s,max:a,start:l,end:u,startProp:d,endProp:f}=qy[i],g=jy(r,{min:e[s],max:e[a],start:r[l],end:r[u]});t[d]=g.start,t[f]=g.end}}}function cP({properties:n,options:t},e,i,r){const{x:s,x2:a,width:l}=n;return Qy({start:s,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:r.left,end:r.right},adjust:t.label.xAdjust,size:e.width})}function uP({properties:n,options:t},e,i,r){const{y:s,y2:a,height:l}=n;return Qy({start:s,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:r.top,end:r.bottom},adjust:t.label.yAdjust,size:e.height})}function Qy(n,t){const{start:e,end:i,borderWidth:r}=n,{position:s,padding:{start:a,end:l},adjust:u}=t,d=i-r-e-a-l-t.size;return e+r/2+u+Gu(d,s)}function dP(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const r=Ku(i.position),s=we(i.padding),a=il(n.ctx,i),l=cP({properties:t,options:e},a,r,s),u=uP({properties:t,options:e},a,r,s),d=a.width+s.width,f=a.height+s.height;return{x:l,y:u,x2:l+d,y2:u+f,width:d,height:f,centerX:l+d/2,centerY:u+f/2,rotation:i.rotation}}const Qu=["enter","leave"],Ju=Qu.concat("click");function fP(n,t,e){t.listened=Hy(e,Ju,t.listeners),t.moveListened=!1,Qu.forEach(i=>{nn(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&nn(i.click)&&(t.listened=!0),t.moveListened||Qu.forEach(r=>{nn(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function hP(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return pP(n,t,e);case"click":return gP(n,t,e)}}function pP(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=ju(n.visibleElements,t,e.interaction):i=[];const r=n.hovered;n.hovered=i;const s={state:n,event:t};let a=Jy(s,"leave",r,i);return Jy(s,"enter",i,r)||a}function Jy({state:n,event:t},e,i,r){let s;for(const a of i)r.indexOf(a)<0&&(s=t_(a.options[e]||n.listeners[e],a,t)||s);return s}function gP(n,t,e){const i=n.listeners,r=ju(n.visibleElements,t,e.interaction);let s;for(const a of r)s=t_(a.options.click||i.click,a,t)||s;return s}function t_(n,t,e){return Qt(n,[t.$context,e])===!0}const rl=["afterDraw","beforeDraw"];function mP(n,t,e){const i=t.visibleElements;t.hooked=Hy(e,rl,t.hooks),t.hooked||i.forEach(r=>{t.hooked||rl.forEach(s=>{nn(r.options[s])&&(t.hooked=!0)})})}function e_(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return Qt(i,[t.$context])}}function yP(n,t,e){const i=vP(n.scales,t,e);let r=n_(t,i,"min","suggestedMin");r=n_(t,i,"max","suggestedMax")||r,r&&nn(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function _P(n,t){for(const e of n)xP(e,t)}function n_(n,t,e,i){if(ae(t[e])&&!bP(n.options,e,i)){const r=n[e]!==t[e];return n[e]=t[e],r}}function bP(n,t,e){return en(n[t])||en(n[e])}function xP(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=br(t,n,e);i&&!t[i]&&wP(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function wP(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(en(n[e+i]))return!0;return!1}function vP(n,t,e){const i=t.axis,r=t.id,s=i+"ScaleID",a={min:Ct(t.min,Number.NEGATIVE_INFINITY),max:Ct(t.max,Number.POSITIVE_INFINITY)};for(const l of e)l.scaleID===r?i_(l,t,["value","endValue"],a):br(n,l,s)===r&&i_(l,t,[i+"Min",i+"Max",i+"Value"],a);return a}function i_(n,t,e,i){for(const r of e){const s=n[r];if(en(s)){const a=t.parse(s);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class es extends $e{inRange(t,e,i,r){const{x:s,y:a}=mr({x:t,y:e},this.getCenterPoint(r),xe(-this.options.rotation));return Ry({x:s,y:a},this.getProps(["x","y","x2","y2"],r),i,this.options)}getCenterPoint(t){return _r(this,t)}draw(t){t.save(),nl(t,this.getCenterPoint(),this.options.rotation),$y(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Xy(t,e)}}es.id="boxAnnotation",es.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},es.defaultRoutes={borderColor:"color",backgroundColor:"color"},es.descriptors={label:{_fallback:!0}};class sl extends $e{inRange(t,e,i,r){return Ey({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return _r(this,t)}draw(t){const e=this.options;!e.display||!e.content||(CP(t,this),t.save(),nl(t,this.getCenterPoint(),this.rotation),Vy(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=SP(t,e);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=MP(t,e,i);let l=il(t.ctx,e);const u=kP(l,a);By(e,u)&&(l={width:l.width*u,height:l.height*u});const{position:d,xAdjust:f,yAdjust:g}=e,m=Ny(s,l,{borderWidth:0,position:d,xAdjust:f,yAdjust:g});return{initProperties:Qr(t,m,e),...m,...r,rotation:e.rotation,_fitRatio:u}}}sl.id="doughnutLabelAnnotation",sl.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},sl.defaultRoutes={};function SP(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const r=i.controller;return r instanceof Qs&&TP(n,t,i.data)&&(!e||r.innerRadius<e.controller.innerRadius)&&r.options.circumference>=90?i:e},void 0)}function TP(n,t,e){if(!t.autoHide)return!0;for(let i=0;i<e.length;i++)if(!e[i].hidden&&n.getDataVisibility(i))return!0}function MP({chartArea:n},t,e){const{left:i,top:r,right:s,bottom:a}=n,{innerRadius:l,offsetX:u,offsetY:d}=e.controller,f=(i+s)/2+u,g=(r+a)/2+d,m={left:Math.max(f-l,i),right:Math.min(f+l,s),top:Math.max(g-l,r),bottom:Math.min(g+l,a)},_={x:(m.left+m.right)/2,y:(m.top+m.bottom)/2},x=t.spacing+t.borderWidth/2,w=l-x,v=_.y>g,C=v?r+x:a-x,A=DP(C,f,g,w);return{controllerMeta:{_centerX:f,_centerY:g,_radius:w,_counterclockwise:v,...A},point:_,radius:Math.min(l,Math.min(m.right-m.left,m.bottom-m.top)/2)}}function kP({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function DP(n,t,e,i){const r=Math.pow(e-n,2),s=Math.pow(i,2),a=t*-2,l=Math.pow(t,2)+r-s,u=Math.pow(a,2)-4*l;if(u<=0)return{_startAngle:0,_endAngle:te};const d=(-a-Math.sqrt(u))/2,f=(-a+Math.sqrt(u))/2;return{_startAngle:va({x:t,y:e},{x:d,y:n}).angle,_endAngle:va({x:t,y:e},{x:f,y:n}).angle}}function CP(n,t){const{_centerX:e,_centerY:i,_radius:r,_startAngle:s,_endAngle:a,_counterclockwise:l,options:u}=t;n.save();const d=ci(n,u);n.fillStyle=u.backgroundColor,n.beginPath(),n.arc(e,i,r,s,a,l),n.closePath(),n.fill(),d&&n.stroke(),n.restore()}class mo extends $e{inRange(t,e,i,r){return Ey({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return _r(this,t)}draw(t){const e=this.options,i=!en(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),nl(t,this.getCenterPoint(),this.rotation),ZE(t,this),$y(t,this,e),Vy(t,OP(this),e),t.restore())}resolveElementProperties(t,e){let i;if(zy(e))i=Gy(t,e);else{const{centerX:l,centerY:u}=Zu(t,e);i={x:l,y:u}}const r=we(e.padding),s=il(t.ctx,e),a=Ny(i,s,e,r);return{initProperties:Qr(t,a,e),pointX:i.x,pointY:i.y,...a,rotation:e.rotation}}}mo.id="labelAnnotation",mo.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},mo.defaultRoutes={borderColor:"color"};function OP({x:n,y:t,width:e,height:i,options:r}){const s=r.borderWidth/2,a=we(r.padding);return{x:n+a.left+s,y:t+a.top+s,width:e-a.left-a.right-r.borderWidth,height:i-a.top-a.bottom-r.borderWidth}}const td=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),ed=(n,t,e)=>td(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,r_=(n,t,e)=>td(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,yo=n=>n*n,AP=(n,t,{x:e,y:i,x2:r,y2:s},a)=>a==="y"?{start:Math.min(i,s),end:Math.max(i,s),value:t}:{start:Math.min(e,r),end:Math.max(e,r),value:n},s_=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,nd=(n,t,e,i)=>({x:s_(n.x,t.x,e.x,i),y:s_(n.y,t.y,e.y,i)}),o_=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),a_=(n,t,e,i)=>-Math.atan2(o_(n.x,t.x,e.x,i),o_(n.y,t.y,e.y,i))+.5*Et;class _o extends $e{inRange(t,e,i,r){const s=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:e},{path:l,ctx:u}=this;if(l){ci(u,this.options),u.lineWidth+=this.options.hitTolerance;const{chart:f}=this.$context,g=t*f.currentDevicePixelRatio,m=e*f.currentDevicePixelRatio,_=u.isPointInStroke(l,g,m)||id(this,a,r);return u.restore(),_}const d=yo(s);return IP(this,a,d,r)||id(this,a,r)}return RP(this,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r})}getCenterPoint(t){return _r(this,t)}draw(t){const{x:e,y:i,x2:r,y2:s,cp:a,options:l}=this;if(t.save(),!ci(t,l))return t.restore();Jr(t,l);const u=Math.sqrt(Math.pow(r-e,2)+Math.pow(s-i,2));if(l.curve&&a)return WP(t,this,a,u),t.restore();const{startOpts:d,endOpts:f,startAdjust:g,endAdjust:m}=f_(this),_=Math.atan2(s-i,r-e);t.translate(e,i),t.rotate(_),t.beginPath(),t.moveTo(0+g,0),t.lineTo(u-m,0),t.shadowColor=l.borderShadowColor,t.stroke(),rd(t,0,g,d),rd(t,u,-m,f),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=sP(t,e),{x:r,y:s,x2:a,y2:l}=i,u=EP(i,t.chartArea),d=u?PP({x:r,y:s},{x:a,y:l},t.chartArea):{x:r,y:s,x2:a,y2:l,width:Math.abs(a-r),height:Math.abs(l-s)};if(d.centerX=(a+r)/2,d.centerY=(l+s)/2,d.initProperties=Qr(t,d,e),e.curve){const g={x:d.x,y:d.y},m={x:d.x2,y:d.y2};d.cp=HP(d,e,Hr(g,m))}const f=LP(t,d,e.label);return f._visible=u,d.elements=[{type:"label",optionScope:"label",properties:f,initProperties:d.initProperties}],d}}_o.id="lineAnnotation";const l_={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};_o.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},l_),fill:!1,length:12,start:Object.assign({},l_),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({},mo.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},_o.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},_o.defaultRoutes={borderColor:"color"};function RP(n,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s}){const a=AP(t,e,n.getProps(["x","y","x2","y2"],s),i);return Ay(a,r)||id(n,{mouseX:t,mouseY:e},s,i)}function EP({x:n,y:t,x2:e,y2:i},{top:r,right:s,bottom:a,left:l}){return!(n<l&&e<l||n>s&&e>s||t<r&&i<r||t>a&&i>a)}function c_({x:n,y:t},e,{top:i,right:r,bottom:s,left:a}){return n<a&&(t=r_(a,{x:n,y:t},e),n=a),n>r&&(t=r_(r,{x:n,y:t},e),n=r),t<i&&(n=ed(i,{x:n,y:t},e),t=i),t>s&&(n=ed(s,{x:n,y:t},e),t=s),{x:n,y:t}}function PP(n,t,e){const{x:i,y:r}=c_(n,t,e),{x:s,y:a}=c_(t,n,e);return{x:i,y:r,x2:s,y2:a,width:Math.abs(s-i),height:Math.abs(a-r)}}function IP(n,{mouseX:t,mouseY:e},i=yr,r){const{x:s,y:a,x2:l,y2:u}=n.getProps(["x","y","x2","y2"],r),d=l-s,f=u-a,g=yo(d)+yo(f),m=g===0?-1:((t-s)*d+(e-a)*f)/g;let _,x;return m<0?(_=s,x=a):m>1?(_=l,x=u):(_=s+m*d,x=a+m*f),yo(t-_)+yo(e-x)<=i}function id(n,{mouseX:t,mouseY:e},i,r){const s=n.label;return s.options.display&&s.inRange(t,e,r,i)}function LP(n,t,e){const i=e.borderWidth,r=we(e.padding),s=il(n.ctx,e),a=s.width+r.width+i,l=s.height+r.height+i;return BP(t,e,{width:a,height:l,padding:r},n.chartArea)}function NP(n){const{x:t,y:e,x2:i,y2:r}=n,s=Math.atan2(r-e,i-t);return s>Et/2?s-Et:s<Et/-2?s+Et:s}function BP(n,t,e,i){const{width:r,height:s,padding:a}=e,{xAdjust:l,yAdjust:u}=t,d={x:n.x,y:n.y},f={x:n.x2,y:n.y2},g=t.rotation==="auto"?NP(n):xe(t.rotation),m=FP(r,s,g),_=zP(n,t,{labelSize:m,padding:a},i),x=n.cp?nd(d,n.cp,f,_):td(d,f,_),w={size:m.w,min:i.left,max:i.right,padding:a.left},v={size:m.h,min:i.top,max:i.bottom,padding:a.top},C=d_(x.x,w)+l,A=d_(x.y,v)+u;return{x:C-r/2,y:A-s/2,x2:C+r/2,y2:A+s/2,centerX:C,centerY:A,pointX:x.x,pointY:x.y,width:r,height:s,rotation:wa(g)}}function FP(n,t,e){const i=Math.cos(e),r=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*r),h:Math.abs(n*r)+Math.abs(t*i)}}function zP(n,t,e,i){let r;const s=UP(n,i);return t.position==="start"?r=u_({w:n.x2-n.x,h:n.y2-n.y},e,t,s):t.position==="end"?r=1-u_({w:n.x-n.x2,h:n.y-n.y2},e,t,s):r=Gu(1,t.position),r}function u_(n,t,e,i){const{labelSize:r,padding:s}=t,a=n.w*i.dx,l=n.h*i.dy,u=a>0&&(r.w/2+s.left-i.x)/a,d=l>0&&(r.h/2+s.top-i.y)/l;return tl(Math.max(u,d),0,.25)}function UP(n,t){const{x:e,x2:i,y:r,y2:s}=n,a=Math.min(r,s)-t.top,l=Math.min(e,i)-t.left,u=t.bottom-Math.max(r,s),d=t.right-Math.max(e,i);return{x:Math.min(l,d),y:Math.min(a,u),dx:l<=d?1:-1,dy:a<=u?1:-1}}function d_(n,t){const{size:e,min:i,max:r,padding:s}=t,a=e/2;return e>r-i?(r+i)/2:(i>=n-s-a&&(n=i+s+a),r<=n+s+a&&(n=r-s-a),n)}function f_(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:h_(n,e),endAdjust:h_(n,i)}}function h_(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,r=n.options.borderWidth/2,s={x:e,y:i+r};return Math.abs(ed(0,s,{x:0,y:r}))}function rd(n,t,e,i){if(!i||!i.display)return;const{length:r,width:s,fill:a,backgroundColor:l,borderColor:u}=i,d=Math.abs(t-r)+e;n.beginPath(),Jr(n,i),ci(n,i),n.moveTo(d,-s),n.lineTo(t+e,0),n.lineTo(d,s),a===!0?(n.fillStyle=l||u,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function HP(n,t,e){const{x:i,y:r,x2:s,y2:a,centerX:l,centerY:u}=n,d=Math.atan2(a-r,s-i),f=Ku(t.controlPoint,0),g={x:l+Ni(e,f.x,!1),y:u+Ni(e,f.y,!1)};return mr(g,{x:l,y:u},d)}function p_(n,{x:t,y:e},{angle:i,adjust:r},s){!s||!s.display||(n.save(),n.translate(t,e),n.rotate(i),rd(n,0,-r,s),n.restore())}function WP(n,t,e,i){const{x:r,y:s,x2:a,y2:l,options:u}=t,{startOpts:d,endOpts:f,startAdjust:g,endAdjust:m}=f_(t),_={x:r,y:s},x={x:a,y:l},w=a_(_,e,x,0),v=a_(_,e,x,1)-Et,C=nd(_,e,x,g/i),A=nd(_,e,x,1-m/i),F=new Path2D;n.beginPath(),F.moveTo(C.x,C.y),F.quadraticCurveTo(e.x,e.y,A.x,A.y),n.shadowColor=u.borderShadowColor,n.stroke(F),t.path=F,t.ctx=n,p_(n,C,{angle:w,adjust:g},d),p_(n,A,{angle:v,adjust:m},f)}class bo extends $e{inRange(t,e,i,r){const s=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return $P({x:t,y:e},this.getProps(["width","height","centerX","centerY"],r),s,a);const{x:l,y:u,x2:d,y2:f}=this.getProps(["x","y","x2","y2"],r),g=i==="y"?{start:u,end:f}:{start:l,end:d},m=mr({x:t,y:e},this.getCenterPoint(r),xe(-s));return m[i]>=g.start-a-yr&&m[i]<=g.end+a+yr}getCenterPoint(t){return _r(this,t)}draw(t){const{width:e,height:i,centerX:r,centerY:s,options:a}=this;t.save(),nl(t,this.getCenterPoint(),a.rotation),Jr(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const l=ci(t,a);t.ellipse(r,s,i/2,e/2,Et/2,0,2*Et),t.fill(),l&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Xy(t,e)}}bo.id="ellipseAnnotation",bo.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},es.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},bo.defaultRoutes={borderColor:"color",backgroundColor:"color"},bo.descriptors={label:{_fallback:!0}};function $P(n,t,e,i){const{width:r,height:s,centerX:a,centerY:l}=t,u=r/2,d=s/2;if(u<=0||d<=0)return!1;const f=xe(e||0),g=Math.cos(f),m=Math.sin(f),_=Math.pow(g*(n.x-a)+m*(n.y-l),2),x=Math.pow(m*(n.x-a)-g*(n.y-l),2);return _/Math.pow(u+i,2)+x/Math.pow(d+i,2)<=1.0001}class ol extends $e{inRange(t,e,i,r){const{x:s,y:a,x2:l,y2:u,width:d}=this.getProps(["x","y","x2","y2","width"],r),f=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?BE({x:t,y:e},this.getCenterPoint(r),d/2,f):Ay(i==="y"?{start:a,end:u,value:e}:{start:s,end:l,value:t},f)}getCenterPoint(t){return _r(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Jr(t,e);const r=ci(t,e);YE(t,this,this.centerX,this.centerY),r&&!el(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=Ky(t,e);return i.initProperties=Qr(t,i,e),i}}ol.id="pointAnnotation",ol.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},ol.defaultRoutes={borderColor:"color",backgroundColor:"color"};class al extends $e{inRange(t,e,i,r){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&YP(this.elements,t,e,r);const s=mr({x:t,y:e},this.getCenterPoint(r),xe(-this.options.rotation)),a=this.elements.map(d=>i==="y"?d.bY:d.bX),l=Math.min(...a),u=Math.max(...a);return s[i]>=l&&s[i]<=u}getCenterPoint(t){return _r(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Jr(t,i);const r=ci(t,i);let s=!0;for(const a of e)s?(t.moveTo(a.x,a.y),s=!1):t.lineTo(a.x,a.y);t.closePath(),t.fill(),r&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=Ky(t,e),{sides:r,rotation:s}=e,a=[],l=2*Et/r;let u=s*Vc;for(let d=0;d<r;d++,u+=l){const f=VP(i,e,u);f.initProperties=Qr(t,i,e),a.push(f)}return i.elements=a,i}}al.id="polygonAnnotation",al.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},al.defaultRoutes={borderColor:"color",backgroundColor:"color"};function VP({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:r},s){const a=(i+r)/2,l=Math.sin(s),u=Math.cos(s),d={x:n+l*e,y:t-u*e};return{type:"point",optionScope:"point",properties:{x:d.x,y:d.y,centerX:d.x,centerY:d.y,bX:n+l*(e+a),bY:t-u*(e+a)}}}function YP(n,t,e,i){let r=!1,s=n[n.length-1].getProps(["bX","bY"],i);for(const a of n){const l=a.getProps(["bX","bY"],i);l.bY>e!=s.bY>e&&t<(s.bX-l.bX)*(e-l.bY)/(s.bY-l.bY)+l.bX&&(r=!r),s=l}return r}const Bi={box:es,doughnutLabel:sl,ellipse:bo,label:mo,line:_o,point:ol,polygon:al};Object.keys(Bi).forEach(n=>{se.describe(`elements.${Bi[n].id}`,{_fallback:"plugins.annotation.common"})});const qP={update:Object.assign},jP=Ju.concat(rl),g_=(n,t)=>It(t)?ad(n,t):n,sd=n=>n==="color"||n==="font";function od(n="line"){return Bi[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function GP(n,t,e,i){const r=XP(n,e.animations,i),s=t.annotations,a=JP(t.elements,s);for(let l=0;l<s.length;l++){const u=s[l],d=m_(a,l,u.type),f=u.setContext(QP(n,d,a,u)),g=d.resolveElementProperties(n,f);g.skip=KP(g),"elements"in g&&(ZP(d,g.elements,f,r),delete g.elements),en(d.x)||Object.assign(d,g),Object.assign(d,g.initProperties),g.options=y_(f),r.update(d,g)}}function KP(n){return isNaN(n.x)||isNaN(n.y)}function XP(n,t,e){return e==="reset"||e==="none"||e==="resize"?qP:new ru(n,t)}function ZP(n,t,e,i){const r=n.elements||(n.elements=[]);r.length=t.length;for(let s=0;s<t.length;s++){const a=t[s],l=a.properties,u=m_(r,s,a.type,a.initProperties),d=e[a.optionScope].override(a);l.options=y_(d),i.update(u,l)}}function m_(n,t,e,i){const r=Bi[od(e)];let s=n[t];return(!s||!(s instanceof r))&&(s=n[t]=new r,Object.assign(s,i)),s}function y_(n){const t=Bi[od(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,ad(n,t.defaults),ad(n,t.defaultRoutes));for(const i of jP)e[i]=n[i];return e}function ad(n,t){const e={};for(const i of Object.keys(t)){const r=t[i],s=n[i];sd(i)&&qt(s)?e[i]=s.map(a=>g_(a,r)):e[i]=g_(s,r)}return e}function QP(n,t,e,i){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,get elements(){return e.filter(r=>r&&r.options)},id:i.id,type:"annotation"}))}function JP(n,t){const e=t.length,i=n.length;if(i<e){const r=e-i;n.splice(i,0,...new Array(r))}else i>e&&n.splice(e,i-e);return n}var t2="3.1.0";const Fi=new Map,__=n=>n.type!=="doughnutLabel",e2=Ju.concat(rl);var b_={id:"annotation",version:t2,beforeRegister(){FE("chart.js","4.0",rn.version)},afterRegister(){rn.register(Bi)},afterUnregister(){rn.unregister(Bi)},beforeInit(n){Fi.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=Fi.get(n),r=i.annotations=[];let s=e.annotations;It(s)?Object.keys(s).forEach(a=>{const l=s[a];It(l)&&(l.id=a,r.push(l))}):qt(s)&&r.push(...s),_P(r.filter(__),n.scales)},afterDataLimits(n,t){const e=Fi.get(n);yP(n,t.scale,e.annotations.filter(__).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=Fi.get(n);fP(n,i,e),GP(n,i,e,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),mP(n,i,e)},beforeDatasetsDraw(n,t,e){xo(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){xo(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){xo(n,t.index,e.clip)},beforeDraw(n,t,e){xo(n,"beforeDraw",e.clip)},afterDraw(n,t,e){xo(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=Fi.get(n);hP(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){Fi.delete(n)},getAnnotations(n){const t=Fi.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return ju(n,t,e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!e2.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Bi[od(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:sd,_fallback:!0},_indexable:sd}},additionalOptionScopes:[""]};function xo(n,t,e){const{ctx:i,chartArea:r}=n,s=Fi.get(n);e&&Gs(i,r);const a=n2(s.visibleElements,t).sort((l,u)=>l.element.options.z-u.element.options.z);for(const l of a)i2(i,r,s,l);e&&Ks(i)}function n2(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const r of i.elements)r.options.display&&r.options.drawTime===t&&e.push({element:r});return e}function i2(n,t,e,i){const r=i.element;i.main?(e_(e,r,"beforeDraw"),r.draw(n,t),e_(e,r,"afterDraw")):r.draw(n,t)}const r2={class:"zoom-timerange-container"},s2={class:"zoom-timerange-details"},o2={class:"label","data-testid":"zoom-timerange-from"},a2={class:"label","data-testid":"zoom-timerange-to"},l2=p.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(n){const t=n,{i18n:e}=Mt.useI18n(),i=p.ref(Zr({tickValue:t.start,granularity:t.granularity})),r=p.ref(Zr({tickValue:t.end,granularity:t.granularity})),s=(a,l)=>{ny(()=>{i.value=Zr({tickValue:a,granularity:t.granularity}),r.value=Zr({tickValue:l,granularity:t.granularity})},100)()};return p.watch(()=>[t.start,t.end],([a,l])=>{s(a,l)},{immediate:!0}),(a,l)=>(p.openBlock(),p.createElementBlock("div",r2,[p.createElementVNode("div",s2,[p.createElementVNode("div",o2,p.toDisplayString(p.unref(e).t("zoom_time_range.from")),1),p.createElementVNode("div",null,p.toDisplayString(i.value),1),p.createElementVNode("div",a2,p.toDisplayString(p.unref(e).t("zoom_time_range.to")),1),p.createElementVNode("div",null,p.toDisplayString(r.value),1)])]))}}),an=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},x_=an(l2,[["__scopeId","data-v-4fa681cf"]]),c2={class:"zoom-actions-container"},u2={class:"zoom-actions-heading"},d2={class:"zoom-action-select"},f2=["data-testid"],h2=["aria-disabled","href"],p2=["onClick"],g2=an(p.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(n,{emit:t}){const e=n,i=t,r=s=>{s.action&&(s.action(e.newTimeRange),i("onAction"))};return(s,a)=>(p.openBlock(),p.createElementBlock("div",c2,[p.createElementVNode("div",u2,[p.createVNode(x_,{end:n.newTimeRange.end,granularity:n.granularity,start:n.newTimeRange.start},null,8,["end","granularity","start"]),p.createVNode(p.unref(Ms.CloseIcon),{class:"zoom-actions-close-icon",color:`var(--kui-color-text-neutral, ${p.unref(Mc)})`,size:`var(--kui-icon-size-30, ${p.unref(Rs)})`,onClick:a[0]||(a[0]=l=>s.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=p.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),p.createElementVNode("div",d2,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.zoomActionItems,l=>(p.openBlock(),p.createElementBlock("div",{key:l.key,class:p.normalizeClass(["zoom-action-item",{disabled:l.disabled}]),"data-testid":`zoom-action-item-${l.key}`},[l.href?(p.openBlock(),p.createElementBlock("a",{key:0,"aria-disabled":l.disabled,class:"zoom-action-link",href:l.href,onClick:a[1]||(a[1]=u=>s.$emit("onAction"))},p.toDisplayString(l.label),9,h2)):(p.openBlock(),p.createElementBlock("div",{key:1,onClick:u=>r(l)},p.toDisplayString(l.label),9,p2))],10,f2))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),m2={key:2},y2={class:"tooltip-title"},_2={class:"title"},b2={key:0,class:"subtitle"},x2={class:"context"},w2={class:"metric"},v2={class:"tooltip"},S2={key:0,class:"square-marker marker-placeholder"},T2={class:"display-value"},wo=an(p.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0},granularity:{default:void 0}},emits:["dimensions","onAction"],setup(n,{emit:t}){const e=t,i=n,r=p.ref(null),{x:s,y:a,isDragging:l}=gR(r,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),u=p.computed(()=>`${a.value}px`),d=p.computed(()=>`${s.value}px`),f=p.computed(()=>i.state.tooltipContext),g=p.computed(()=>i.state.metricDisplay),m=p.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return p.watch(()=>[i.absoluteLeft,i.absoluteTop],([_,x])=>{l.value||(s.value=parseFloat(_),a.value=parseFloat(x))}),p.watch(l,_=>{_?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),p.watch(r,_=>{if(_){const{width:x,height:w}=_.getBoundingClientRect();e("dimensions",{width:x,height:w})}}),(_,x)=>n.state.showTooltip?(p.openBlock(),p.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:r,class:p.normalizeClass(["tooltip-container",{locked:n.state.interactionMode==="interactive"}]),style:p.normalizeStyle({transform:m.value?`translate(${d.value}, ${u.value})`:`translate(${n.absoluteLeft}, ${n.absoluteTop})`,left:"0",top:"0",pointerEvents:m.value?"all":"none"})},[n.state.interactionMode==="selecting-chart-area"&&n.granularity&&n.zoomTimeRange&&n.zoomTimeRange.end&&n.zoomTimeRange.start?(p.openBlock(),p.createBlock(x_,{key:0,end:n.zoomTimeRange?.end,granularity:n.granularity,start:n.zoomTimeRange?.start},null,8,["end","granularity","start"])):n.state.interactionMode==="zoom-interactive"&&n.zoomTimeRange&&n.zoomActionItems&&n.granularity?(p.openBlock(),p.createBlock(g2,{key:1,granularity:n.granularity,"new-time-range":n.zoomTimeRange,"zoom-action-items":n.zoomActionItems,onOnAction:x[0]||(x[0]=w=>e("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(p.openBlock(),p.createElementBlock("div",m2,[p.createElementVNode("div",y2,[p.createElementVNode("div",_2,[p.createElementVNode("div",null,p.toDisplayString(n.tooltipTitle),1),m.value?(p.openBlock(),p.createBlock(p.unref(Ms.DragIcon),{key:0,class:"drag-icon",color:`var(--kui-color-text-neutral, ${p.unref(Mc)})`,size:`var(--kui-icon-size-30, ${p.unref(Rs)})`},null,8,["color","size"])):p.createCommentVNode("",!0)]),f.value||g.value?(p.openBlock(),p.createElementBlock("div",b2,[p.createElementVNode("div",x2,p.toDisplayString(f.value),1),p.createElementVNode("div",w2,p.toDisplayString(g.value),1)])):p.createCommentVNode("",!0)]),p.createElementVNode("ul",v2,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.state.tooltipSeries,({backgroundColor:w,borderColor:v,label:C,value:A,isSegmentEmpty:F,isExtra:I},L)=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:C+L},[n.state.tooltipSeries.length?(p.openBlock(),p.createElementBlock("li",{key:0,class:p.normalizeClass({"extra-row":I})},[I?(p.openBlock(),p.createElementBlock("div",S2)):(p.openBlock(),p.createElementBlock("div",{key:1,class:"square-marker",style:p.normalizeStyle({background:String(w),borderColor:String(v)})},null,4)),p.createElementVNode("span",{class:p.normalizeClass(["display-label",{empty:F}])},p.toDisplayString(C),3),p.createElementVNode("span",T2,p.toDisplayString(A),1)],2)):p.createCommentVNode("",!0)],64))),128))])]))],6)):p.createCommentVNode("",!0)}}),[["__scopeId","data-v-fb2f2a72"]]),M2={key:0,class:"legend-container","data-testid":"legend"},k2=["onClick"],D2={key:0,"aria-hidden":"true",class:"line-marker",height:"2",width:"16"},C2=["stroke","stroke-dasharray"],O2=["title"],A2={class:"label truncate-label"},R2={key:0,class:"sub-label"},E2={key:0},P2={class:"tooltip-content"},ll=an(p.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){const t=n,{i18n:e}=Mt.useI18n(),i=p.inject("showLegendValues",!1),r=p.inject("legendPosition",p.ref(Pe.Bottom)),s=({datasetIndex:u,index:d,isKey:f},g)=>f?`key-${g}`:`dataset-${u??0}-${d??0}`,a=(u=0,d)=>{if(t.chartInstance===null)return;const f=t.chartInstance instanceof rn?t.chartInstance:t.chartInstance.chart,g=l(u,d);!f.getDatasetMeta(u).dataset&&d!==void 0?f.toggleDataVisibility(d):g?f.hide(u,d):f.show(u,d),f.update()},l=(u=0,d)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const f=t.chartInstance instanceof rn?t.chartInstance:t.chartInstance.chart;return f.getDatasetMeta(u).dataset||d===void 0?f.isDatasetVisible(u):f.getDataVisibility(d)};return(u,d)=>{const f=p.resolveComponent("KTooltip");return p.unref(r)!==p.unref(Pe).Hidden?(p.openBlock(),p.createElementBlock("ul",M2,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.items,({fillStyle:g,strokeStyle:m,text:_,datasetIndex:x,index:w,value:v,isSegmentEmpty:C,isKey:A,lineDash:F},I)=>(p.openBlock(),p.createElementBlock("li",{key:s({datasetIndex:x,index:w,isKey:A},I),class:p.normalizeClass({"legend-key":A}),onClick:L=>A?void 0:a(x,w)},[F?.length?(p.openBlock(),p.createElementBlock("svg",D2,[p.createElementVNode("line",{stroke:m,"stroke-dasharray":F.join(" "),"stroke-width":"2",x1:"0",x2:"16",y1:"1",y2:"1"},null,8,C2)])):(p.openBlock(),p.createElementBlock("div",{key:1,class:"square-marker",style:p.normalizeStyle({background:g,"border-color":m})},null,4)),p.createVNode(f,null,p.createSlots({default:p.withCtx(()=>[p.createElementVNode("div",{class:p.normalizeClass(["label-container",{"strike-through":!A&&!l(x,w),"inline-value":A}]),title:v&&(p.unref(i)||A)?`${_}: ${v.formatted}`:_},[p.createElementVNode("div",A2,p.toDisplayString(_),1),v&&(p.unref(i)||A)?(p.openBlock(),p.createElementBlock("div",R2,[A?(p.openBlock(),p.createElementBlock("span",E2,"-")):p.createCommentVNode("",!0),p.createTextVNode(" "+p.toDisplayString(v.formatted),1)])):p.createCommentVNode("",!0)],10,O2)]),_:2},[C?{name:"content",fn:p.withCtx(()=>[p.createElementVNode("div",P2,p.toDisplayString(p.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],10,k2))),128))])):p.createCommentVNode("",!0)}}}),[["__scopeId","data-v-90ef4d12"]]),Ie=[];for(let n=0;n<256;++n)Ie.push((n+256).toString(16).slice(1));function I2(n,t=0){return(Ie[n[t+0]]+Ie[n[t+1]]+Ie[n[t+2]]+Ie[n[t+3]]+"-"+Ie[n[t+4]]+Ie[n[t+5]]+"-"+Ie[n[t+6]]+Ie[n[t+7]]+"-"+Ie[n[t+8]]+Ie[n[t+9]]+"-"+Ie[n[t+10]]+Ie[n[t+11]]+Ie[n[t+12]]+Ie[n[t+13]]+Ie[n[t+14]]+Ie[n[t+15]]).toLowerCase()}const L2=new Uint8Array(16);function N2(){return crypto.getRandomValues(L2)}function ld(n,t,e){return crypto.randomUUID?crypto.randomUUID():B2(n)}function B2(n,t,e){n=n||{};const i=n.random??n.rng?.()??N2();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,I2(i)}const w_=(n,t)=>{const e=n.ctx,i=n.scales.y,r=n.scales.x,s=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(s.x-s.width/2,s.y,s.width,i.bottom-s.y):e.strokeRect(r.left,s.y-s.height/2,s.x-r.left,s.height),e.restore()};class v_{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&w_(t,this._clickedElements)}afterEvent(t,{event:e}){if(e.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(e.type!=="click"||!e.native||this._pause)return;this._clicked=!this._clicked;const i=t.options.interaction?.mode||"index",r=t.getElementsAtEventForMode(e.native,i,{intersect:!1},!0);r.length&&this._clicked?(this._clickedElements=r,w_(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 F2=["id"],z2=["id"],U2={class:"axis-tooltip-content"},H2="100%",W2="100%",$2=20,V2=20,S_=6,Y2=0,q2=10,j2=10,G2=1,K2=an(p.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{i18n:e}=Mt.useI18n(),{translateUnit:i}=Mt.useTranslatedUnits(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=new v_,l=p.useTemplateRef("chartContainer"),u=p.useTemplateRef("chartParent"),d=({chart:tt},pt)=>{const ft=tt.data,Y=ft.labels?.indexOf(pt);return ft.datasets.reduce((et,ot,xt)=>{if(tt.isDatasetVisible(xt)){const Lt=ot.data[Y];return isNaN(Lt)?et:et+Lt}else return et},0)},f=(tt,pt,ft,Y)=>{const et=Y==="horizontal";pt===null&&(pt=e.t("entityNoName"));const ot={type:"label",yValue:wt=>et?pt:d(wt,pt),xValue:wt=>et?d(wt,pt):pt},xt={...ot,position:et?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>et?0:-Math.abs(BR()),content:wt=>sy(d(wt,pt),ft)},Lt={...ot,content:wt=>zR(d(wt,pt),FR(wt.chart,tt)),position:et?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:wt=>et?NR(sy(d(wt,pt),ft)):0,color:OR};return{[`${pt}-value`]:xt,[`${pt}-percent`]:Lt}},g=p.useTemplateRef("canvas"),m=p.useTemplateRef("axis"),_=ld(),x=ld(),w=p.ref([]),v=p.inject("legendPosition",Pe.Bottom),C=p.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),A=p.toRef(t,"metricUnit"),F=p.computed(()=>t.orientation==="horizontal"),I=p.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:p.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:p.toRef(t,"dimensionAxesTitle"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:F.value?"horizontal_bar":"vertical_bar",chartID:s,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:L,tooltipAbsoluteTop:N}=Mt.useTooltipAbsolutePosition(u,I),B=p.ref(0),k=()=>t.annotations&&t.chartData.labels?.reduce((tt,pt)=>Object.assign(tt,f(t.chartData,pt,A.value,t.orientation)),{}),T={id:_,afterUpdate(tt){B.value+=1,w.value=Du(tt,t.legendValues,t.chartLegendSortFn)}},O={id:x,afterUpdate(tt){tt.options.plugins.annotation.annotations=t.annotations?k():{}}},W=[T,{id:"axisHover",afterEvent(tt,pt){if(C.show=!1,pt.event.type==="mousemove"){const ft=pt.event,Y=tt.options.indexAxis,et=tt.scales,ot=tt.scales[Y].getLabelForValue(Number(tt.scales[Y].getValueForPixel(ft[Y]))),Lt=tt.scales[Y].getLabels().indexOf(ot),wt=t.chartData.isLabelEmpty?.[Lt];if((kt=>kt==="x"?ft.y>et.x.top:ft.x<et.y.right)(Y)){I.interactionMode!=="interactive"&&(I.showTooltip=!1);const ve=tt.canvas.getContext("2d").measureText(ot).width,bt=Math.abs(Math.round(ft.x-ve*.5)),jt=Math.round(ft.x+ve*.5),Oe=tt.canvas.getBoundingClientRect(),Ae=40;C.left=Y==="x"?`${(bt>0?bt:jt)-C.offset+Oe.left}px`:`${ft.x-ve*.5-C.offset+Oe.left}px`,C.top=`${ft.y-Ae+Oe.top}px`,ot.length>Za?(C.show=!0,C.text=ot):wt?(C.text=e.t("emptyEntityInfo"),C.show=!0):C.show=!1}else C.show=!1}}},a,...t.annotations?[O]:[]],J=p.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),at=p.ref(0),lt=p.ref(0),G=new ResizeObserver(ny(tt=>{at.value=tt[0].contentRect.width,lt.value=tt[0].contentRect.height},100)),rt=p.computed(()=>{const tt=t.chartData?.labels?.length;return g.value&&tt&&!F.value?`${Math.max(tt*($2+S_),at.value)}px`:H2}),st=p.computed(()=>{const tt=t.chartData?.labels?.length;return g.value&&tt&&F.value?`${Math.max(tt*(V2+S_),lt.value)}px`:W2});Mt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey")),p.onMounted(()=>{t.annotations&&rn.register(b_),l.value&&(at.value=l.value.offsetWidth,lt.value=l.value.offsetHeight,G.observe(l.value))}),p.onUnmounted(()=>{l.value&&G.unobserve(l.value)});const nt=p.computed(()=>{const tt=Mt.useBarChartOptions({tooltipState:I,legendID:_,stacked:p.toRef(t,"stacked"),metricAxesTitle:p.toRef(t,"metricAxesTitle"),dimensionAxesTitle:p.toRef(t,"dimensionAxesTitle"),indexAxis:F.value?"y":"x",numLabels:J});return{...tt.value,plugins:{...tt.value.plugins,annotation:{annotations:k(),clip:!1}}}}),ct=Mt.useChartJSCommon("bar",g,p.toRef(t,"chartData"),W,nt);p.onBeforeUnmount(()=>{rn.unregister(b_)});const H={[Pe.Bottom]:"column"},q=p.computed(()=>{if(m.value&&ct.value){const tt=window.devicePixelRatio,pt=ct.value,ft=pt.scales.y.width*tt+G2,Y=(pt.scales.y.height+pt.scales.y.top+pt.scales.x.height)*tt,et=m.value.getContext("2d");return et.scale(tt,tt),et.canvas.width=ft,et.canvas.height=Y,et.canvas.style.width=`${ft/tt}px`,et.canvas.style.height=`${Y/tt}px`,{scale:tt,width:ft*tt,height:Y*tt,targetCtx:et}}return null}),X=tt=>{const pt=tt.target;if(q.value&&ct.value&&!F.value){const ft=q.value.scale,Y=q.value.targetCtx,et=q.value.width,ot=q.value.height,xt=ct.value,Lt=xt.canvas;Y.fillStyle="white",pt.scrollLeft>=Y2&&pt.scrollLeft<=q2?(Y.globalCompositeOperation="source-over",Y.clearRect(0,0,et,ot),Y.drawImage(Lt,0,0,et,ot,0,0,et,ot),Y.globalCompositeOperation="destination-over",Y.fillRect(0,0,et,ot)):(Y.globalCompositeOperation="source-over",Y.fillRect(0,(xt.scales.y.height+xt.scales.y.top+j2)*ft,et,xt.scales.x.height*ft))}I.offsetY=pt.scrollTop,I.offsetX=pt.scrollLeft,C.offset=pt.scrollLeft},_t=({width:tt,height:pt})=>{I.width=tt,I.height=pt};p.watch(()=>t.orientation,()=>{if(m.value&&q.value){const tt=q.value.width,pt=q.value.height;(m.value?.getContext("2d")).clearRect(0,0,tt,pt)}I.showTooltip=!1,I.interactionMode="idle"}),p.watch(()=>t.annotations,tt=>{ct.value&&(tt?ct.value.options.plugins.annotation.annotations=k(t.chartData):delete ct.value.options.plugins.annotation.annotations)});const dt=()=>{I.showTooltip&&(I.interactionMode!=="idle"?I.interactionMode="idle":I.interactionMode="interactive")};return(tt,pt)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",H[p.unref(v)]])},[p.createElementVNode("canvas",{id:p.unref(r),ref:"axis",class:"axis"},null,8,F2),p.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:pt[0]||(pt[0]=ft=>dt()),onScroll:X},[p.createElementVNode("div",{class:"chart-body",style:p.normalizeStyle({width:rt.value,height:st.value})},[p.createElementVNode("canvas",{id:p.unref(s),ref:"canvas",class:"chart-canvas"},null,8,z2)],4)],544),(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[C.show?(p.openBlock(),p.createElementBlock("div",{key:0,class:"axis-tooltip",style:p.normalizeStyle({top:C.top,left:C.left}),width:"auto"},[p.createElementVNode("div",U2,p.toDisplayString(C.text),1)],4)):p.createCommentVNode("",!0),p.createVNode(wo,{"absolute-left":p.unref(L),"absolute-top":p.unref(N),"chart-parent-ref":u.value,state:I,"tooltip-title":n.tooltipTitle,onDimensions:_t},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),p.createVNode(ll,{id:p.unref(_),"chart-instance":p.unref(ct),items:w.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-60e5a1a7"]]);const X2={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"};Ag._date.override({_id:"date-fns",formats:function(){return X2},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=Rt(n):e==="string"&&(typeof t=="string"?n=KT(n,t,new Date,this.options):n=bp(n,this.options)),Oc(n)?n.getTime():null},format:function(n,t){return da(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return Dc(n,t);case"second":return V1(n,t);case"minute":return W1(n,t);case"hour":return z1(n,t);case"day":return ca(n,t);case"week":return Y1(n,t);case"month":return kc(n,t);case"quarter":return $1(n,t);case"year":return q1(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Ac(n,t);case"second":return tS(n,t);case"minute":return Z1(n,t);case"hour":return X1(n,t);case"day":return Zh(n,t);case"week":return eS(n,t);case"month":return ep(n,t);case"quarter":return J1(n,t);case"year":return nS(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return JT(n);case"minute":return QT(n);case"hour":return ZT(n);case"day":return Cc(n);case"week":return Wn(n);case"isoWeek":return Wn(n,{weekStartsOn:+e});case"month":return rS(n);case"quarter":return iS(n);case"year":return np(n);default:return n}},endOf:function(n,t){switch(t){case"second":return uS(n);case"minute":return lS(n);case"hour":return oS(n);case"day":return Jh(n);case"week":return aS(n);case"month":return tp(n);case"quarter":return cS(n);case"year":return sS(n);default:return n}}});const T_={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},Z2={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...T_,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},Q2=p.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function ns(n){return p.isProxy(n)?p.toRaw(n):n}function J2(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return p.isProxy(t)?new Proxy(n,{}):n}function tI(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function M_(n,t){n.labels=t}function k_(n,t,e){const i=[];n.datasets=t.map(r=>{const s=n.datasets.find(a=>a[e]===r[e]);return!s||!r.data||i.includes(s)?{...r}:(i.push(s),Object.assign(s,r),s)})}function eI(n,t){const e={labels:[],datasets:[]};return M_(e,n.labels),k_(e,n.datasets,t),e}const nI=p.defineComponent({props:Z2,setup(n,t){let{expose:e,slots:i}=t;const r=p.ref(null),s=p.shallowRef(null);e({chart:s});const a=()=>{if(!r.value)return;const{type:d,data:f,options:g,plugins:m,datasetIdKey:_}=n,x=eI(f,_),w=J2(x,f);s.value=new rn(r.value,{type:d,data:w,options:{...g},plugins:m})},l=()=>{const d=p.toRaw(s.value);d&&(n.destroyDelay>0?setTimeout(()=>{d.destroy(),s.value=null},n.destroyDelay):(d.destroy(),s.value=null))},u=d=>{d.update(n.updateMode)};return p.onMounted(a),p.onUnmounted(l),p.watch([()=>n.options,()=>n.data],(d,f)=>{let[g,m]=d,[_,x]=f;const w=p.toRaw(s.value);if(!w)return;let v=!1;if(g){const C=ns(g),A=ns(_);C&&C!==A&&(tI(w,C),v=!0)}if(m){const C=ns(m.labels),A=ns(x.labels),F=ns(m.datasets),I=ns(x.datasets);C!==A&&(M_(w.config.data,C),v=!0),F&&F!==I&&(k_(w.config.data,F,n.datasetIdKey),v=!0)}v&&p.nextTick(()=>{u(w)})},{deep:!0}),()=>p.h("canvas",{role:"img","aria-label":n.ariaLabel,"aria-describedby":n.ariaDescribedby,ref:r},[p.h("p",{},[i.default?i.default():""])])}});function cl(n,t){return rn.register(t),p.defineComponent({props:T_,setup(e,i){let{expose:r}=i;const s=p.shallowRef(null),a=p.shallowRef(null);p.watch(()=>a.value?.chart??null,u=>{s.value=u},{flush:"sync"}),r({chart:s});const l=u=>{a.value=u};return()=>p.h(nI,Q2({ref:l},{type:n,...e}))}})}const D_=cl("bar",kg),C_=cl("doughnut",Qs),O_=cl("line",Dg),iI=cl("scatter",Og),rI={class:"chart-container"},sI={key:0,class:"chart-center-metric"},oI={class:"chart-center-total"},aI={key:0,class:"chart-center-unit"},lI=p.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},metricName:{default:""},legendPosition:{default:Pe.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>li},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""},showCenterMetric:{type:Boolean,default:!0}},setup(n){const t=n,{translateUnit:e}=Mt.useTranslatedUnits(),{i18n:i}=Mt.useI18n(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=p.ref([]),l=p.useTemplateRef("chartParent"),u=p.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:p.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:p.toRef(t,"tooltipDimensionDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:d,tooltipAbsoluteTop:f}=Mt.useTooltipAbsolutePosition(l,u),g={id:r,afterUpdate(B){a.value=B.options.plugins.legend.labels.generateLabels(B).map(k=>({...k,value:t.legendValues&&t.legendValues[k.text],hidden:!1}))}},m=p.computed(()=>[g]),_=p.computed(()=>[t.chartData.datasets.reduce((k,T)=>(k.labels.push(T.label),k.backgroundColor.push(T.backgroundColor),k.hoverBorderColor.push(Ta(T.backgroundColor).saturate(.5).darken(.15).hexString()),k.data.push(T.data.reduce((O,E)=>O+E,0)),k),{labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:x}=ti({i18n:i}),w=p.computed(()=>vE(t.metricName??"")),v=p.computed(()=>{const B=_.value[0]?.data.reduce((k,T)=>k+T,0)??0;return x(B,t.metricUnit,{approximate:!0,translateUnit:(k,T)=>e(k,T)}).trim()}),C=p.computed(()=>t.tooltipMetricDisplay||""),A=p.computed(()=>({...t.chartData,datasets:_.value}));Mt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey"));const{options:F}=Mt.useDonutChartOptions({tooltipState:u,legendID:r}),I=p.ref(),L=B=>({[Pe.Bottom]:"column",[Pe.Hidden]:"hidden"})[B],N=({width:B,height:k})=>{u.width=B,u.height=k};return(B,k)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",L(n.legendPosition)]),"data-testid":"donut-chart-parent"},[p.createElementVNode("div",rI,[p.createVNode(p.unref(C_),{ref_key:"chartInstance",ref:I,"chart-id":p.unref(s),data:A.value,options:p.unref(F),plugins:m.value},null,8,["chart-id","data","options","plugins"]),n.showCenterMetric&&w.value?(p.openBlock(),p.createElementBlock("div",sI,[p.createElementVNode("span",oI,p.toDisplayString(v.value),1),C.value?(p.openBlock(),p.createElementBlock("span",aI,p.toDisplayString(C.value),1)):p.createCommentVNode("",!0)])):p.createCommentVNode("",!0),(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[p.createVNode(wo,{"absolute-left":p.unref(d),"absolute-top":p.unref(f),state:u,"tooltip-title":n.tooltipTitle,unit:n.metricUnit,onDimensions:N},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),p.createVNode(ll,{id:p.unref(r),"chart-instance":I.value,items:a.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),cI=an(lI,[["__scopeId","data-v-48b16272"]]);class uI{id="outlierBandPlugin";beforeDatasetsDraw(t,e,i){const r=i?.value;if(r===void 0||!Number.isFinite(r)||!i?.color)return;const s=t.scales.y;if(!s||!t.chartArea)return;const{top:a,bottom:l,left:u,right:d}=t.chartArea,f=Math.min(Math.max(s.getPixelForValue(r),a),l);if(f<=a)return;const g=t.ctx;g.save(),g.fillStyle=i.color,g.fillRect(u,a,d-u,f-a),g.restore()}}const dI=1.5;class fI{id="referenceLinePlugin";afterDatasetsDraw(t,e,i){const r=i?.lines;if(!r?.length)return;const s=t.scales.y;if(!s||!t.chartArea)return;const{top:a,bottom:l,left:u,right:d}=t.chartArea,f=t.ctx;f.save(),f.lineWidth=dI;for(const{value:g,color:m,borderDash:_}of r){if(!Number.isFinite(g))continue;const x=s.getPixelForValue(g);x<a||x>l||(f.beginPath(),f.setLineDash(_),f.strokeStyle=m,f.moveTo(u,x),f.lineTo(d,x),f.stroke())}f.restore()}}const hI={class:"chart-container"},pI=an(p.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:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""},shadeOutlierRegion:{type:Boolean,default:!1},themeColors:{default:()=>Yu()}},setup(n){const t=n,e=p.inject("legendPosition",Pe.Bottom),{i18n:i}=Mt.useI18n(),{formatUnit:r}=ti({i18n:i}),{translateUnit:s}=Mt.useTranslatedUnits(),a=p.useTemplateRef("chartParent"),l=new uI,u=new fI,d=crypto.randomUUID(),f=crypto.randomUUID(),g=p.ref(),m=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:p.toRef(t,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:s,offsetX:0,offsetY:0,width:0,height:0,chartType:"scatter",chartID:f,chartTooltipSortFn:t.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:_,tooltipAbsoluteTop:x}=Mt.useTooltipAbsolutePosition(a,m);Mt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey"));const w=p.computed(()=>t.chartData?.outlier),v=p.computed(()=>t.chartData?.referenceLines??[]),C=p.ref([]),A={id:d,afterUpdate(O){C.value=Du(O,void 0,t.chartLegendSortFn)}},F=p.computed(()=>{const O=[];w.value&&O.push({text:w.value.label,fillStyle:w.value.color,strokeStyle:w.value.color,isKey:!0});for(const E of v.value)O.push({text:E.label,fillStyle:E.color,strokeStyle:E.color,lineDash:E.borderDash,isKey:!0,value:{raw:E.value,formatted:r(E.value,t.metricUnit,{translateUnit:s})}});return O}),I=p.computed(()=>[...C.value,...F.value]),L=p.computed(()=>t.shadeOutlierRegion?w.value?.value:void 0),N=p.computed(()=>[A,...L.value!==void 0?[l]:[],...v.value.length?[u]:[]]),B=p.computed(()=>`scatter-${N.value.map(O=>O.id).join("-")}`),{options:k}=Mt.useScatterChartOptions({tooltipState:m,legendID:d,granularity:p.toRef(t,"granularity"),timeRangeMs:p.toRef(t,"timeRangeMs"),metricAxesTitle:p.toRef(t,"metricAxesTitle"),dimensionAxesTitle:p.toRef(t,"dimensionAxesTitle"),metricUnit:p.toRef(t,"metricUnit"),xMetric:p.toRef(t,"xMetric"),xMetricUnit:p.toRef(t,"xMetricUnit"),outlierValue:L,referenceLines:v,themeColors:p.toRef(t,"themeColors")}),T=O=>({[Pe.Bottom]:"column",[Pe.Hidden]:"hidden"})[O];return(O,E)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",T(p.unref(e))]),"data-testid":"scatter-chart-parent"},[p.createElementVNode("div",hI,[(p.openBlock(),p.createBlock(p.unref(iI),{key:B.value,ref_key:"chartInstance",ref:g,"chart-id":p.unref(f),class:"chart-canvas",data:n.chartData,"data-testid":"scatter-chart",options:p.unref(k),plugins:N.value},null,8,["chart-id","data","options","plugins"]))]),p.createVNode(wo,{"absolute-left":p.unref(_),"absolute-top":p.unref(x),"data-testid":"tooltip",granularity:n.granularity,state:m,"tooltip-title":n.tooltipTitle},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title"]),p.createVNode(ll,{id:p.unref(d),"chart-instance":g.value,"data-testid":"legend",items:I.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-3bb682a5"]]),cd=(n,t,e,i,r="#0275d8")=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle=r,n.stroke(),n.restore()},Ze={},gI=()=>{Ze.x=void 0,Ze.chart=void 0,Ze.strategy=void 0,Ze.group=void 0},mI=10;class A_{id="verticalLinePlugin";_clickedSegment;_pause=!1;_useBrushingState=!1;_brushStrategy;_brushGroup;constructor({brushGroup:t=void 0,brushStrategy:e=void 0,enableBrushing:i=!1}={}){let r=!1;e==="group"&&(r=t!==void 0),this._useBrushingState=i&&r,this._brushStrategy=e,this._brushGroup=t}afterEvent(t,e){if(!this._useBrushingState)return;const{event:i}=e;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(r=>this.onMouseBrush(i.type,t,r))}_lastMouseBrushEvent=0;onMouseBrush(t,e,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<mI)return;const r=()=>{Ze.chart=e,Ze.strategy=this._brushStrategy,Ze.group=this._brushGroup;for(const s of Object.values(rn.instances))s!==e&&s.update("none")};t==="mousemove"?e.tooltip&&e.tooltip.getActiveElements()&&e.tooltip.getActiveElements().length&&(Ze.x=e.tooltip.dataPoints[0].element.x,r()):t==="mouseout"&&(Ze.x=void 0,r()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const e=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:r}=this._clickedSegment.element;cd(i,r,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(e){const{x:r}=t.tooltip.dataPoints[0].element;cd(i,r,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(Ze.x===void 0)return;const e=Ze.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&Ze.group===this._brushGroup&&cd(t.ctx,Ze.x,t.scales.y.top,t.scales.y.bottom,e)}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(t){if(this._clickedSegment&&this.destroyClickedSegment(),this._useBrushingState&&Ze.chart===t){const e=Ze.x!==void 0;if(gI(),e)for(const i of Object.values(rn.instances))i!==t&&i.update("none")}}}const yI=(n,t,e)=>{const i=n.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,n.chartArea.top),i.lineTo(t,n.chartArea.bottom),i.moveTo(e,n.chartArea.top),i.lineTo(e,n.chartArea.bottom),i.stroke(),i.restore()},_I=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},R_=(n,t)=>{const e=n.scales.x.getValueForPixel(t.startX),i=n.scales.x.getValueForPixel(t.endX);if(!(e===void 0||i===void 0))return{xStart:Math.min(e,i),xEnd:Math.max(e,i)}},E_=(n,t,e)=>{t.canvas.dispatchEvent(new CustomEvent(n,{detail:e}))};class bI{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 e=t.canvas;let i=!1;const r=l=>{this._dragTimeout=window.setTimeout(()=>{const u=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=l.clientX-u.left,this._endX=this._startX},150)},s=l=>{const u=e.getBoundingClientRect();if(i&&this._isDragging){this._endX=l.clientX-u.left;const d=R_(t,this);d&&E_("dragSelectMove",t,d)}},a=l=>{const u=e.getBoundingClientRect();if(clearTimeout(this._dragTimeout),i&&this._isDragging){this._endX=l.clientX-u.left,i=!1,this._isDragging=!1;const d=R_(t,this);d?E_("dragSelect",t,d):this.clearSelectionArea()}};e.addEventListener("mousedown",r),e.addEventListener("mousemove",s),e.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:r,onMouseMove:s,onMouseUp:a}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:r,onMouseUp:s}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",r),e.removeEventListener("mouseup",s)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(_I(t,this._startX,this._endX),yI(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const xI=20,wI="rgba(255, 171, 171, 0.4)",vI="rgba(255, 196, 0, 0.2)",P_=(n,t,e)=>{const i=t.y-n.y;if(i===0)return t.x;const r=(e-n.y)/i;return n.x+r*(t.x-n.x)},SI=(n,t)=>{const e=[];return n.data.datasets.forEach(i=>{if(!n.getDatasetMeta(n.data.datasets.indexOf(i)).visible)return;const s=i.data;s?.length&&t.filter(a=>a.highlightIntersections).forEach(a=>{const l=s.map(d=>({ts:d.x,aboveThreshold:d.y>=a.value}));let u=l[0].aboveThreshold?s[0].x:void 0;for(let d=1;d<l.length;d++)!l[d-1].aboveThreshold&&l[d].aboveThreshold?u=P_(s[d-1],s[d],a.value):l[d-1].aboveThreshold&&!l[d].aboveThreshold&&u!==void 0&&(e.push({start:u,end:P_(s[d-1],s[d],a.value),type:a.type}),u=void 0);u!==void 0&&e.push({start:u,end:l[l.length-1].ts,type:a.type})})}),e},TI=n=>{if(!n.length)return[];n.sort((e,i)=>e.type.localeCompare(i.type)||e.start-i.start);const t=[];for(const e of n){const i=t.findLast(({type:r})=>r===e.type);i&&e.start<=i.end?i.end=Math.max(i.end,e.end):t.push({...e})}return t};class MI{constructor(t){this.i18n=t}i18n;id="thresholdPlugin";_thresholds;_mouseMoveHandler;_syncThresholds(t){for(const e of Object.keys(t.threshold||{})){const i=t.threshold?.[e];i&&(this._thresholds={...this._thresholds,[e]:i.map(r=>({...r,hovered:!1}))})}if(this._thresholds)for(const e of Object.keys(this._thresholds))t.threshold?.[e]||delete this._thresholds[e]}get thresholds(){return this._thresholds}beforeUpdate(t,e,i){this._syncThresholds(i)}beforeInit(t,e,i){const r=t.canvas;this._syncThresholds(i);const s=a=>{if(t){const l=a.clientY,u=t.scales.y,d=r.getBoundingClientRect(),f=u.getValueForPixel(l-d.top);if(f)for(const g of Object.keys(this._thresholds||{})){const m=this._thresholds?.[g];m&&m.forEach(_=>{_.hovered=Math.abs(_.value-f)<xI})}}};r.addEventListener("mousemove",s),this._mouseMoveHandler=s}afterDatasetsDraw(t,e){const i=t.ctx;for(const r of Object.keys(this._thresholds||{})){const s=this._thresholds?.[r];if(s){s.forEach(u=>{const f=t.scales.y.getPixelForValue(u.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,f),i.lineTo(t.chartArea.right,f),i.lineWidth=1,i.strokeStyle=Au(u.type),i.setLineDash([5,5]),i.stroke(),i.restore();let g="";u.label?g=`${u.label}: ${u.value}`:u.type==="warning"?g=this.i18n.t("chartLabels.threshold-warning",{value:u.value}):u.type==="error"?g=this.i18n.t("chartLabels.threshold-error",{value:u.value}):g=this.i18n.t("chartLabels.thatreshold-neutral",{value:u.value}),u.hovered&&(i.save(),i.fillStyle=Au(u.type),i.font=yv,i.fillText(g,t.chartArea.left,f-4),i.restore())});const a=SI(t,s);TI(a).forEach(u=>{const d=t.scales.x.getPixelForValue(u.start),f=t.scales.x.getPixelForValue(u.end);i.save(),i.fillStyle=u.type==="error"?wI:vI,i.fillRect(d,t.chartArea.top,f-d,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(d,t.chartArea.bottom),i.lineTo(f,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=Au(u.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const kI=an(p.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=n,i=t,{i18n:r}=Mt.useI18n(),s=new A_,a=new v_,l=new bI,u=new MI(r),{translateUnit:d}=Mt.useTranslatedUnits(),f=p.ref(),g=crypto.randomUUID(),m=crypto.randomUUID(),_=p.ref([]),x=p.inject("legendPosition",Pe.Bottom),w=p.useTemplateRef("chartParent"),v=p.ref(void 0),C=p.ref(!1),A=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:p.toRef(e,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(e,"metricUnit"),translateUnit:d,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:m,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:F,tooltipAbsoluteTop:I}=Mt.useTooltipAbsolutePosition(w,A),L={id:g,afterUpdate(H){_.value=Du(H,e.legendValues,e.chartLegendSortFn)}},N=p.computed(()=>[L,a,...e.brush?[l]:[],...e.type==="timeseries_line"?[s]:[],...e.threshold?[u]:[]]),B=p.computed(()=>`line-${N.value.map(H=>H.id).join("-")}`),k=p.computed(()=>`bar-${N.value.map(H=>H.id).join("-")}`),T=p.computed(()=>e.chartData&&kR(e.chartData)),{options:O}=Mt.useLineChartOptions({tooltipState:A,timeRangeMs:p.toRef(e,"timeRangeMs"),granularity:p.toRef(e,"granularity"),legendID:g,stacked:p.toRef(e,"stacked"),metricAxesTitle:p.toRef(e,"metricAxesTitle"),dimensionAxesTitle:p.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:T,threshold:p.toRef(e,"threshold")});Mt.useReportChartDataForSynthetics(p.toRef(e,"chartData"),p.toRef(e,"syntheticsDataKey"));const E=H=>H?H.end.getTime()>H.start.getTime():!1,W=H=>({[Pe.Bottom]:"column",[Pe.Hidden]:"hidden"})[H],J=({width:H,height:q})=>{A.width=H,A.height=q},at=(H=!0)=>{A.interactionMode="idle",A.showTooltip=!1,l.clearSelectionArea(),a.isPaused&&a.resume(H),s.isPaused&&s.resume()},lt=()=>{A.interactionMode="interactive"},G=()=>{!f.value||!f.value.chart.tooltip?.dataPoints?.length||(A.interactionMode==="interactive"?s.clickedSegment=f.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},rt=()=>{if(C.value){C.value=!1;return}A.interactionMode!=="idle"?at():lt(),G()};p.watch(()=>e.type,()=>{A.interactionMode="idle",A.showTooltip=!1,s.destroyClickedSegment()});const st=H=>{H.preventDefault(),H.stopPropagation();const{xStart:q,xEnd:X}=H.detail,_t={start:new Date(q),end:new Date(X),type:"absolute"};if(!E(_t)){v.value=void 0,at(!1);return}v.value=_t,A.interactionMode="zoom-interactive",_t&&i("select-chart-range",_t)},nt=H=>{A.interactionMode="selecting-chart-area",C.value=!0,s.pause(),a.pause();const{xStart:q,xEnd:X}=H.detail;v.value={start:new Date(q),end:new Date(X),type:"absolute"}},ct=H=>{if(!w.value||A.interactionMode==="idle")return;const q=H.target;q&&w.value.contains(q)||C.value||at(!1)};return p.watch(()=>f.value?.chart,()=>{f.value?.chart&&(f.value.chart.canvas.removeEventListener("dragSelect",st),f.value.chart.canvas.removeEventListener("dragSelectMove",nt),f.value.chart.canvas.addEventListener("dragSelect",st),f.value.chart.canvas.addEventListener("dragSelectMove",nt))}),p.onMounted(()=>{document.addEventListener("click",ct,!0)}),p.onUnmounted(()=>{f.value?.chart&&(f.value.chart.canvas.removeEventListener("dragSelect",st),f.value.chart.canvas.removeEventListener("dragSelectMove",nt)),document.removeEventListener("click",ct,!0)}),(H,q)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",W(p.unref(x))]),"data-testid":"line-chart-parent"},[p.createElementVNode("div",{class:"chart-container",onClick:q[0]||(q[0]=X=>rt())},[n.type==="timeseries_line"?(p.openBlock(),p.createBlock(p.unref(O_),{key:B.value,ref_key:"chartInstance",ref:f,"chart-id":p.unref(m),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-line-chart",options:p.unref(O),plugins:N.value},null,8,["chart-id","data","options","plugins"])):n.type==="timeseries_bar"?(p.openBlock(),p.createBlock(p.unref(D_),{key:k.value,ref_key:"chartInstance",ref:f,"chart-id":p.unref(m),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-bar-chart",options:p.unref(O),plugins:N.value},null,8,["chart-id","data","options","plugins"])):p.createCommentVNode("",!0)]),p.createVNode(wo,{"absolute-left":p.unref(F),"absolute-top":p.unref(I),"data-testid":"tooltip",granularity:n.granularity,state:A,"tooltip-title":n.tooltipTitle,"zoom-action-items":n.zoomActionItems,"zoom-time-range":v.value,onDimensions:J,onOnAction:q[1]||(q[1]=()=>at(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),p.createVNode(ll,{id:p.unref(g),"chart-instance":f.value,"data-testid":"legend",items:_.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-399f4923"]]),DI={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},CI={class:"tooltip-content"},OI={key:2,class:"analytics-chart-parent"},AI=p.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},activeMetric:{default:void 0},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Pe.Bottom},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!1},showAnnotations:{type:Boolean,default:!0},timeseriesZoom:{type:Boolean,default:!1},requestsLink:{default:void 0},exploreLink:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=t,i=n,{i18n:r}=Mt.useI18n(),s=p.computed(()=>qu(i.chartData)?void 0:i.chartData),a=p.computed(()=>{const Y=s.value?.meta,et=Y?.metric_names??[];return["timeseries_line","timeseries_bar"].includes(i.chartOptions.type)&&et.length>1&&Object.keys(Y?.display??{}).length>0?et:[]}),l=p.computed(()=>a.value.length>1),u=p.computed(()=>i.activeMetric&&a.value.includes(i.activeMetric)?i.activeMetric:a.value[0]),d=p.computed(()=>{const Y=s.value;return!Y||!l.value||!u.value?Y:{...Y,meta:{...Y.meta,metric_names:[u.value]}}}),f=p.computed(()=>{const Y=i.chartOptions.threshold;return!l.value||!Y?Y:{...Y,...Object.fromEntries(Object.keys(Y).filter(et=>et!==u.value).map(et=>[et,[]]))}}),g=p.computed(()=>{if(J.value)return qu(i.chartData)?i.chartData:My(i.chartData)}),m=p.inject("app:konnectColorMode",p.computed(()=>"light")),_=p.useTemplateRef("chartShell"),x=p.computed(()=>(m.value,Yu(_.value))),w=p.computed(()=>{if(g.value){const{start:et,end:ot,metric:xt,metricUnit:Lt,truncated:wt,limit:Ot,datasource:kt}=g.value;return{start:et,end:ot,metricNames:[xt],metricUnits:{[xt]:Lt??""},truncated:wt,limit:Ot,datasource:kt}}const Y=d.value?.meta;return{start:Y?.start,end:Y?.end,metricNames:Y?.metric_names,metricUnits:Y?.metric_units,truncated:Y?.truncated,limit:Y?.limit,datasource:Y?.datasource}}),v=p.computed(()=>J.value?Mt.useScatterDatasets({colorPalette:i.chartOptions.chartDatasetColors,scatter:i.chartOptions.scatter,themeColors:x},g).value:s.value?E.value?Mt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Eu},d).value:Mt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Eu},s).value:{datasets:[]}),C=p.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),A=p.computed(()=>{if(!i.chartData||s.value&&!s.value.meta)return 0;const{start:Y,end:et}=w.value;if(Y&&et)return new Date(et).getTime()-new Date(Y).getTime()}),F=p.computed(()=>w.value.metricUnits?l.value&&u.value?w.value.metricUnits[u.value]??"":Object.values(w.value.metricUnits)[0]??"":""),I=p.computed(()=>w.value.metricUnits?l.value&&u.value?u.value:Object.keys(w.value.metricUnits)[0]??"":""),L=p.computed(()=>i.showLegendValues&&i.legendPosition!==Pe.Hidden),{legendValues:N}=Mt.useChartLegendValues(v,i.chartOptions.type,F),B=p.computed(()=>w.value.limit?.toString()||null),k=p.computed(()=>i.chartOptions.hideTruncationWarning?!1:w.value.truncated||!1),T=p.computed(()=>r.t("limitedResultsShown",{maxReturned:B.value})),O=p.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),E=p.computed(()=>["timeseries_bar","timeseries_line"].some(Y=>Y===i.chartOptions.type)),W=p.computed(()=>i.chartOptions.type==="donut"),J=p.computed(()=>i.chartOptions.type==="scatter"),at=p.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),lt=p.computed(()=>{const{metricNames:Y,metricUnits:et}=w.value;if(!Y||!et)return;const ot=Y[0],xt=et[ot]||"";if(Y.length>1){if(ot.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${xt}`,{plural:"s"})});if(ot.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${xt}`,{plural:"s"})})}if(ot)return po(xt)&&r.te(`metricAxisTitles.${ot}`)?r.t(`metricAxisTitles.${ot}`)||void 0:r.te(`chartLabels.${ot}`)?r.t(`chartLabels.${ot}`):ot}),G=p.computed(()=>{if(i.chartOptions?.metricAxesTitle)return i.chartOptions?.metricAxesTitle;const{metricNames:Y,metricUnits:et}=w.value;if(!Y||!et)return;const ot=Y[0],xt=et[ot]||"";if(Y.length>1){if(ot.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${xt}`,{plural:"s"})});if(ot.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${xt}`,{plural:"s"})})}return rt(ot,xt)}),rt=(Y,et)=>r.te(`metricAxisTitles.${Y}`)&&(po(et)||r.te(`chartUnits.${et}`))?po(et)?r.t(`metricAxisTitles.${Y}`)||void 0:r.t(`metricAxisTitles.${Y}`,{unit:r.t(`chartUnits.${et}`,{plural:"s"})})||void 0:Y||void 0,st=p.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const Y=s.value?.meta,et=E.value?"Time":Object.keys(Y?.display||Y?.metric_names||{})[0];if(et)return r.te(`chartLabels.${et}`)?r.t(`chartLabels.${et}`):et}),nt=p.computed(()=>{if(rx(w.value.datasource))return r.t("timestampAxisTitles.platform");const Y=ia(s.value?.meta?.granularity_ms);if(Y)return r.te(`granularityAxisTitles.${Y}`)?r.t(`granularityAxisTitles.${Y}`):Y}),ct=p.computed(()=>{const Y=g.value?.xMetric;return Y?rt(Y,g.value?.xMetricUnit??""):nt.value}),H=p.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),q=p.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),X=p.computed(()=>J.value?!!g.value?.points.length:E.value?DR(v.value):!!(s.value&&s.value.meta&&s.value.data.length)),_t=p.computed(()=>{const Y=s.value;return Y?Y.meta.granularity_ms?ia(Y.meta.granularity_ms)||"hourly":ia(new Date(Y.data[1].timestamp).getTime()-new Date(Y.data[0].timestamp).getTime())||"hourly":"hourly"}),dt=p.computed(()=>ia(s.value?.meta?.granularity_ms)||"secondly"),tt=p.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(Y,et)=>Y.text===r.t("chartLabels.____OTHER____")?1:et.text===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(Y.text,10))&&!isNaN(parseInt(et.text,10))?Y.text<et.text?-1:1:Y.value&&et.value?et.value.raw-Y.value.raw:0),pt=p.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(Y,et)=>Y.label===r.t("chartLabels.____OTHER____")?1:et.label===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(Y.label,10))&&!isNaN(parseInt(et.label,10))?Y.label<et.label?-1:1:Y.value&&et.value?et.rawValue-Y.rawValue:0),ft=p.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:Y=>e("zoom-time-range",Y)}]:[],...i.exploreLink?[{label:r.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:r.t("zoom_action_items.view_requests"),key:"view-requests",href:i.requestsLink.href}]:[]]);return p.provide("showLegendValues",L),p.provide("legendPosition",p.toRef(i,"legendPosition")),(Y,et)=>{const ot=p.resolveComponent("KTooltip"),xt=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",{ref:"chartShell",class:p.normalizeClass(["analytics-chart-shell",{"show-values":L.value}])},[X.value&&k.value&&B.value?(p.openBlock(),p.createElementBlock("div",DI,[p.createVNode(ot,{class:"tooltip","max-width":"500",placement:"right"},{content:p.withCtx(()=>[p.createElementVNode("div",CI,p.toDisplayString(T.value),1)]),default:p.withCtx(()=>[p.createVNode(p.unref(Ms.WarningIcon),{color:`var(--kui-color-text-warning, ${p.unref(gv)})`,size:`var(--kui-icon-size-40, ${p.unref(_v)})`},null,8,["color","size"])]),_:1})])):p.createCommentVNode("",!0),X.value?(p.openBlock(),p.createElementBlock("div",OI,[E.value?(p.openBlock(),p.createBlock(kI,{key:0,brush:C.value,"chart-data":v.value,"chart-legend-sort-fn":tt.value,"chart-tooltip-sort-fn":pt.value,"dimension-axes-title":nt.value,fill:n.chartOptions.stacked,granularity:_t.value,"legend-values":p.unref(N),"metric-axes-title":G.value,"metric-unit":F.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,threshold:f.value,"time-range-ms":A.value,"tooltip-metric-display":lt.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type,"zoom-action-items":ft.value,onSelectChartRange:et[0]||(et[0]=Lt=>e("select-chart-range",Lt)),onZoomTimeRange:et[1]||(et[1]=Lt=>e("zoom-time-range",Lt))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):O.value?(p.openBlock(),p.createBlock(K2,{key:1,annotations:n.showAnnotations,"chart-data":v.value,"chart-legend-sort-fn":tt.value,"chart-tooltip-sort-fn":pt.value,"data-testid":"bar-chart-container","dimension-axes-title":st.value,"legend-values":p.unref(N),"metric-axes-title":G.value,"metric-unit":F.value,orientation:at.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-metric-display":lt.value,"tooltip-title":n.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):W.value?(p.openBlock(),p.createBlock(cI,{key:2,"chart-data":v.value,"dataset-colors":n.chartOptions.chartDatasetColors||p.unref(Eu),"legend-position":n.legendPosition,"legend-values":p.unref(N),"metric-name":I.value,"metric-unit":F.value,"show-center-metric":n.chartOptions.showCenterMetric,"synthetics-data-key":n.syntheticsDataKey,"tooltip-dimension-display":st.value,"tooltip-metric-display":lt.value,"tooltip-title":n.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"])):J.value?(p.openBlock(),p.createBlock(pI,{key:3,"chart-data":v.value,"chart-legend-sort-fn":n.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":pt.value,"data-testid":"scatter-chart-container","dimension-axes-title":ct.value,granularity:dt.value,"metric-axes-title":G.value,"metric-unit":F.value,"shade-outlier-region":n.chartOptions.scatter?.shadeOutlierRegion,"synthetics-data-key":n.syntheticsDataKey,"theme-colors":x.value,"time-range-ms":A.value,"tooltip-metric-display":lt.value,"tooltip-title":n.tooltipTitle,"x-metric":g.value?.xMetric,"x-metric-unit":g.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"])):p.createCommentVNode("",!0)])):(p.openBlock(),p.createBlock(xt,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(H.value),1)]),default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(q.value),1)]),_:1}))],2)}}}),RI=an(AI,[["__scopeId","data-v-bbdf6b28"]]),EI={class:"chart-parent","data-testid":"gauge-chart-parent"},PI={class:"chart-totals-flex"},II={key:1,class:"metric-small","data-testid":"gauge-chart-total"},LI=an(p.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:li},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=Mt.useI18n(),i=p.ref(ld()),r=p.computed(()=>[t.chartData.datasets.reduce((_,x)=>(_.labels.push(x.label),_.borderColor.push(x.backgroundColor),_.backgroundColor.push(x.backgroundColor),_.data.push(x.data.reduce((w,v)=>w+v,0)),_),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),s=p.computed(()=>({...t.chartData,datasets:r.value}));Mt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},l=p.computed(()=>co(r?.value[0]?.data[t.numerator],{capital:!0})),u=p.computed(()=>co(r?.value[0]?.data[0]+r?.value[0]?.data[1],{capital:!0})),d=p.computed(()=>`color: ${r?.value[0]?.backgroundColor[t.numerator]}`),f=p.computed(()=>["full","single"].includes(t.metricDisplay)),g=p.computed(()=>t.metricDisplay==="full");return(m,_)=>(p.openBlock(),p.createElementBlock("div",EI,[p.createElementVNode("div",PI,[f.value?(p.openBlock(),p.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:p.normalizeStyle(d.value)},p.toDisplayString(l.value),5)):p.createCommentVNode("",!0),g.value?(p.openBlock(),p.createElementBlock("div",II,p.toDisplayString(p.unref(e).t("total"))+": "+p.toDisplayString(u.value),1)):p.createCommentVNode("",!0)]),p.createElementVNode("div",{class:"chart-container",style:p.normalizeStyle({height:n.height,width:n.width})},[p.createVNode(p.unref(C_),{"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),NI={key:1,class:"single-value-wrapper"},BI={class:"single-value-metric"},FI={class:"name-unit-alignment"},zI={class:"single-value","data-testid":"single-value-chart"},UI={key:0,class:"single-value-unit"},HI={class:"single-value-metric-name"},WI={key:0,class:"single-value-trend"},$I={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},ud="t1",dd="t2",VI=an(p.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:Km},leftAlign:{type:Boolean,default:!1},showTrend:{type:Boolean,default:!1},increaseIsBad:{type:Boolean,default:!1},alignX:{type:String,default:"left"}},setup(n){const{i18n:t}=Mt.useI18n(),{formatBytes:e,formatCost:i}=ti({i18n:t}),r=n,s=p.computed(()=>`align-${r.leftAlign?"left":r.alignX}`),a=p.computed(()=>Ji.buildDeltaMapping(r.data,r.showTrend,{topLevelKey:ud,secondLevelKey:dd})),l=p.computed(()=>a.value?.previous?.[ud]?.[dd]),u=p.computed(()=>a.value?.current?.[ud]?.[dd]),d=p.computed(()=>r.data.data),f=p.computed(()=>r.data.meta?.metric_names?.[0]),g=p.computed(()=>t.te(`chartLabels.${f.value}`)?t.t(`chartLabels.${f.value}`):""),m=p.computed(()=>{const O=f.value?r.data.meta?.metric_units?.[f.value]:void 0;if(O){const E=`chartUnits.${O}`;return t.te(E)?t.t(E,{plural:""}):""}}),_=p.computed(()=>!!f.value&&(f.value.includes("_per_minute")||f.value.includes("_latency_")||f.value==="error_rate")),x=p.computed(()=>r.showTrend&&l.value!==void 0?l.value:null),w=p.computed(()=>{if(r.showTrend)return u.value??null;if(d.value.length<1||!f.value)return null;const O=d.value[0].event[f.value];return typeof O!="number"||isNaN(O)?null:O}),v=p.computed(()=>r.data?.data?.length===void 0||r.data?.data?.length===0||!r.showTrend&&w.value===null||r.showTrend&&x.value===null&&w.value===null),C=p.computed(()=>{const O=w.value;if(O===null)return"-";const E=f.value?r.data.meta?.metric_units?.[f.value]:void 0;if(E==="usd")return i(O);if(E==="bytes")return e(O);if(O>=1e9){const J=(O/1e9).toFixed(1);return J.endsWith(".0")?`${Math.floor(O/1e9)}B`:`${J}B`}if(O>=1e7){const J=(O/1e6).toFixed(1);return J.endsWith(".0")?`${Math.floor(O/1e6)}M`:`${J}M`}const W=r.decimalPoints&&typeof r.decimalPoints=="number"?r.decimalPoints:Km;return O.toLocaleString("en-US",{maximumFractionDigits:W})}),A=p.computed(()=>r.showTrend&&r.data?.data?.length<2),F=p.computed(()=>Ji.calculateChange(w.value??0,x.value??0)||0),I=p.computed(()=>{if(!r.showTrend)return 0;if(r.data?.data?.length<2){if(l.value===void 0)return 0;if(u.value===void 0)return r.increaseIsBad?1:-1}return Ji.changePolarity(F.value,!0,r.increaseIsBad)}),L=p.computed(()=>Ji.defineIcon(I.value,r.increaseIsBad)),N=p.computed(()=>{if(r.showTrend&&r.data?.data?.length<2){if(l.value===void 0)return t.t("singleValue.trend.not_available");if(u.value===void 0)return Ji.metricChange(-1,!0,t.t("singleValue.trend.not_available"))}return Ji.metricChange(F.value,r.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),B=Ji.useTrendRange(p.computed(()=>r.showTrend),void 0,p.computed(()=>r.data.meta)),k=O=>O>0?"positive":O<0?"negative":"neutral",T=O=>O>0?pv:O<0?hv:qh;return p.onMounted(()=>{!r.showTrend&&r.data?.data?.length>1?console.warn("SingleValue chart should only be used with a single data point. Data length:",r.data.data.length):r.showTrend&&r.data?.data?.length>2&&console.warn("SingleValue with trend expects 2 or fewer data points. Instead got:",r.data.data.length)}),(O,E)=>{const W=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["chart-parent",s.value]),"data-testid":"single-value-parent"},[v.value?(p.openBlock(),p.createBlock(W,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:p.unref(t).t("singleValue.valueError")},null,8,["title"])):(p.openBlock(),p.createElementBlock("div",NI,[p.createElementVNode("div",BI,[p.createElementVNode("div",FI,[p.createElementVNode("span",zI,p.toDisplayString(C.value),1),_.value&&m.value?(p.openBlock(),p.createElementBlock("span",UI," "+p.toDisplayString(m.value),1)):p.createCommentVNode("",!0)]),p.createElementVNode("div",HI,p.toDisplayString(g.value),1)]),n.showTrend?(p.openBlock(),p.createElementBlock("div",WI,[p.createElementVNode("div",{class:p.normalizeClass(["trend-change",k(I.value)]),"data-testid":"single-value-trend"},[A.value||I.value!==0?(p.openBlock(),p.createBlock(p.resolveDynamicComponent(L.value),{key:0,color:T(I.value),size:`var(--kui-icon-size-30, ${p.unref(Rs)})`},null,8,["color","size"])):(p.openBlock(),p.createBlock(p.unref(Ms.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${p.unref(qh)})`,size:`var(--kui-icon-size-30, ${p.unref(Rs)})`},null,8,["color","size"])),p.createElementVNode("div",null,p.toDisplayString(N.value),1)],2),p.unref(B)?(p.openBlock(),p.createElementBlock("div",$I,p.toDisplayString(p.unref(B)),1)):p.createCommentVNode("",!0)])):p.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-640d8a8c"]]),YI={class:"simple-chart-shell"},qI={key:1,class:"analytics-chart-parent"},jI=an(p.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=Mt.useI18n(),i=p.computed(()=>{const d=Mt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||li},p.toRef(t,"chartData")).value;return t.chartOptions?.reverseDataset&&d?.datasets.reverse(),d}),r=p.computed(()=>t.chartData.meta?.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""),s=p.computed(()=>t.chartOptions.type==="gauge"),a=p.computed(()=>t.chartOptions.type==="single_value"),l=p.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),u=p.computed(()=>{const d=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(a.value){const f=t.chartData.meta?.metric_names?.[0];return d&&t.chartData.data[0].event[f]!==null}return d});return(d,f)=>{const g=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",YI,[u.value?(p.openBlock(),p.createElementBlock("div",qI,[s.value?(p.openBlock(),p.createBlock(LI,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":r.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):p.createCommentVNode("",!0),a.value?(p.openBlock(),p.createBlock(VI,{key:1,"align-x":n.chartOptions.alignX,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints,"increase-is-bad":n.chartOptions.increaseIsBad,"show-trend":n.chartOptions.showTrend},null,8,["align-x","data","decimal-points","increase-is-bad","show-trend"])):p.createCommentVNode("",!0)])):(p.openBlock(),p.createBlock(g,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(l.value),1)]),_:1}))])}}}),[["__scopeId","data-v-23ca8c84"]]),GI={class:"top-n-card-title","data-testid":"top-n-card-title"},KI={class:"top-n-card-description","data-testid":"top-n-card-description"},XI={key:3,class:"top-n-table","data-testid":"top-n-table"},ZI={"data-testid":"top-n-table-header"},QI={class:"top-n-table-header-row"},JI={class:"table-header-label"},tL=["data-testid"],eL=["data-testid"],nL=["data-testid"],iL=3,rL=an(p.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(n){const t=n,{i18n:e}=Mt.useI18n(),{formatUnit:i}=ti({i18n:e}),r=p.computed(()=>t.data.data),s=p.computed(()=>!!r.value?.length),a=p.computed(()=>t.data.meta?.display?Object.keys(t.data.meta.display).slice(0,iL):[]),l=p.computed(()=>a.value[0]||""),u=p.computed(()=>a.value.length>1),d=p.computed(()=>a.value[a.value.length-1]||""),f=p.computed(()=>l.value?t.data.meta.display[l.value]:{}),g=p.computed(()=>t.data.meta?.metric_names?.length?t.data.meta.metric_names:[]),m=p.computed(()=>g.value[0]),_=p.computed(()=>m.value?at(m.value):""),x=p.computed(()=>{const G=a.value.map(rt=>({key:rt,label:u.value?at(rt):e.t("topNTable.nameLabel"),type:"dimension"}));return m.value&&G.push({key:"value",label:_.value,type:"metric"}),g.value.forEach((rt,st)=>{st!==0&&G.push({key:rt,label:at(rt),type:"metric"})}),G}),w=p.computed(()=>x.value.filter(G=>G.type==="metric")),v=p.computed(()=>x.value.filter(G=>G.type==="dimension").slice(1)),C=G=>G.type==="dimension"&&G.key===d.value,A=G=>u.value&&G.type==="dimension"&&!C(G),F=G=>{const rt=G.event;return String(rt[l.value])},I=(G,rt)=>{const st=String(G.event[rt]),nt=t.data.meta?.display?.[rt]?.[st];return{dimension:rt,id:st,name:nt?.name||"-",deleted:!!nt?.deleted}},L=G=>{const rt=F(G),st=f.value&&f.value[rt];return st?st.name:"-"},N=G=>{const rt=F(G),st=f.value&&f.value[rt];return st?!!st.deleted:!1},B=(G,rt)=>{const st=G.event[rt];if(st==null)return"–";const nt=typeof st=="number"?st:Number(st);if(Number.isNaN(nt))return"–";const ct=t.data.meta?.metric_units?.[rt]||"count",H=["count","count/minute","token count"].includes(ct);return i(nt,ct,{approximate:H,isBytes1024:!0,translateUnit:q=>lt(q,nt)})},k=G=>m.value?B(G,m.value):"–",T=p.computed(()=>r.value?.length?r.value.map(G=>{const rt=a.value.map(H=>I(G,H)),st=rt[0],nt=st?.id||F(G),ct={id:nt,rowKey:rt.map(H=>`${H.dimension}:${H.id}`).join("|")||nt,name:st?.name||L(G),deleted:N(G),dimensions:rt,original:G};return m.value&&(ct.value=k(G)),g.value.forEach((H,q)=>{q!==0&&(ct[H]=B(G,H))}),ct}):[]),O=p.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value.some(G=>!Object.keys(t.data.meta.display[G]||{}).length))return e.t("topNTable.errors.display");if(!m.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),E=(G,rt)=>{const st=G[rt];return typeof st=="string"?st:st==null?"–":String(st)},W=(G,rt)=>G.dimensions.find(st=>st.dimension===rt)?.name||"–",J=(G,rt)=>{const st=G.dimensions.find(nt=>nt.dimension===rt);return{id:st?.id||"",name:st?.name||"–",deleted:st?.deleted||!1,dimension:rt,dimensions:G.dimensions,isEmpty:st?.id==="empty"}},at=G=>e.te(`chartLabels.${G}`)?e.t(`chartLabels.${G}`):G,lt=(G,rt)=>{if(po(G)||G==="count"||G==="requests")return"";const st=rt===1?"":"s";return e.te(`chartUnits.${G}`)?e.t(`chartUnits.${G}`,{plural:st}):G};return(G,rt)=>{const st=p.resolveComponent("KEmptyState"),nt=p.resolveComponent("KSkeleton"),ct=p.resolveComponent("KCard");return p.openBlock(),p.createBlock(ct,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},p.createSlots({default:p.withCtx(()=>[O.value?(p.openBlock(),p.createBlock(st,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(O.value),1)]),_:1})):n.isLoading?(p.openBlock(),p.createBlock(nt,{key:1,"table-columns":2,type:"table"})):s.value?(p.openBlock(),p.createElementBlock("div",XI,[p.createElementVNode("table",{class:p.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":u.value}])},[p.createElementVNode("thead",ZI,[p.createElementVNode("tr",QI,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(x.value,H=>(p.openBlock(),p.createElementBlock("th",{key:H.key,class:p.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":H.type==="metric","top-n-table-header-cell-dimension-compact":A(H)}]),"data-testid":"top-n-table-header-column"},[p.createElementVNode("span",JI,p.toDisplayString(H.label),1)],2))),128))])]),p.createElementVNode("tbody",null,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(T.value,H=>(p.openBlock(),p.createElementBlock("tr",{key:H.rowKey,class:"top-n-table-row"},[a.value.length?(p.openBlock(),p.createElementBlock("td",{key:0,class:p.normalizeClass(["top-n-table-cell top-n-table-cell--name",{"top-n-table-cell-dimension-compact":u.value}])},[p.createElementVNode("span",{"data-testid":`row-${H.id}`},[p.renderSlot(G.$slots,"name",{record:{id:H.id,name:H.name,deleted:H.deleted,dimension:l.value,dimensions:H.dimensions,isEmpty:H.id==="empty"}},()=>[p.createTextVNode(p.toDisplayString(H.name),1)],!0)],8,tL)],2)):p.createCommentVNode("",!0),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(v.value,q=>(p.openBlock(),p.createElementBlock("td",{key:q.key,class:p.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!C(q)}])},[p.renderSlot(G.$slots,"name",{record:J(H,q.key)},()=>[p.createTextVNode(p.toDisplayString(W(H,q.key)),1)],!0)],2))),128)),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(w.value,q=>(p.openBlock(),p.createElementBlock("td",{key:q.key,class:"top-n-table-cell top-n-table-cell-metric"},[q.key==="value"?(p.openBlock(),p.createElementBlock("span",{key:0,"data-testid":`row-${H.id}`},p.toDisplayString(E(H,q.key)),9,eL)):(p.openBlock(),p.createElementBlock("span",{key:1,"data-testid":`row-${H.id}-${q.key}`},p.toDisplayString(E(H,q.key)),9,nL))]))),128))]))),128))])],2)])):(p.openBlock(),p.createBlock(st,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(n.emptyStateTitle||p.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:p.withCtx(()=>[p.createElementVNode("span",GI,p.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:p.withCtx(()=>[p.createElementVNode("div",KI,p.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-0dc897d6"]]),sL={class:"container"},oL={key:0,class:"no-data","data-testid":"sparkline-empty"},aL=["title"],lL=an(p.defineComponent({__name:"SparklineChart",props:{chartKey:{default:()=>{}},datasets:{},disableTooltip:{type:Boolean,default:!1},enableBrushing:{type:Boolean,default:!1},groupKey:{default:()=>{}},maxCount:{default:()=>{}},maxStamp:{default:()=>{}},minCount:{default:()=>{}},minStamp:{default:()=>{}},pointRenderCount:{default:24},showLabel:{type:Boolean,default:!1},tooltipTitle:{default:()=>{}},type:{default:"sparkline_bar"}},setup(n){const t=crypto.randomUUID(),{i18n:e}=Mt.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:r,syncedMaxStamp:s,syncedMinCount:a,syncedMaxCount:l,syncedRenderPoints:u,syncedChartDatasets:d}=Mt.useSparklineSync({chartKey:n.chartKey,datasets:n.datasets,groupKey:n.groupKey,minStamp:n.minStamp,maxStamp:n.maxStamp,minCount:n.minCount,maxCount:n.maxCount,renderPoints:n.pointRenderCount,type:n.type}),f=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:n.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),g=({width:B,height:k})=>{f.width=B,f.height=k},m=p.computed(()=>n.disableTooltip?[]:[new A_({enableBrushing:n.groupKey!==void 0&&n.chartKey!==void 0&&n.enableBrushing,brushStrategy:"group",brushGroup:n.groupKey})]),_=p.computed(()=>d.value.reduce((B,{data:k,label:T})=>({...B,[T]:k.reduce((O,{y:E})=>O+E,0)}),{})),x=p.computed(()=>d.value.map(({label:B})=>[_.value[B],`${B}: ${_.value[B]}`]).sort(([B],[k])=>k-B).map(([,B])=>B).join(", ")),w=p.computed(()=>Object.keys(_.value).map(B=>_.value[B]).reduce((B,k)=>B+k,0)),v=p.computed(()=>w.value>0),C=p.computed(()=>({labels:new Array(u.value).fill(""),datasets:d.value})),A=p.computed(()=>n.datasets.length>1),F=`SparklineTooltipPosition-${t}`,I=p.computed(()=>{const B=n.type==="sparkline_bar",k=B?r.value-1:r.value,T=B?s.value:s.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:n.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:B?0:2,right:B?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:F,external:O=>{ku(f,O,"minutely",{contextFormatter:E=>{const W=E+i.value;let J="";return i.value>1440*60*1e3?J=da(new Date(W),"MMM dd, yyy hh:mm a"):J=da(new Date(W),"hh:mm a"),`${Kw(E)} - ${J}`}})}}},scales:{x:{min:k,max:T,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:A.value},y:{min:Math.max(a.value-1,0),max:l.value,grid:{display:!1},display:!1,stacked:A.value}}}}),L=p.ref("0"),N=p.ref("0");return p.onMounted(()=>{Ve.positioners[F]=function(B,k){if(!B.length||f.interactionMode==="interactive"||k.x===null)return!1;const T=10,O=this.chart.canvas.getBoundingClientRect(),E=f.width||this.width,W=f.height||this.height,J=O.top-W>0,at=J?O.top-W-T:O.top+O.height+T,lt=O.left>E/2-k.x,G=Math.max(T,window.innerWidth-T-E),rt=Math.min(G,lt?Math.floor(O.left-E/2)+k.x:0+T);return L.value=`${at}px`,N.value=`${rt}px`,{x:rt,y:at,xAlign:"center",yAlign:J?"top":"bottom"}}}),p.onUnmounted(()=>{Ve.positioners[F]&&delete Ve.positioners[F]}),(B,k)=>(p.openBlock(),p.createElementBlock("div",sL,[v.value?n.type==="sparkline_bar"?(p.openBlock(),p.createBlock(p.unref(D_),{key:1,"chart-id":p.unref(t),data:C.value,"data-testid":"sparkline-bar",options:I.value,plugins:m.value},null,8,["chart-id","data","options","plugins"])):n.type==="sparkline_line"||n.type==="sparkline_step"?(p.openBlock(),p.createBlock(p.unref(O_),{key:2,"chart-id":p.unref(t),data:C.value,"data-testid":n.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:I.value,plugins:m.value},null,8,["chart-id","data","data-testid","options","plugins"])):p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",oL,[p.renderSlot(B.$slots,"empty",{},()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("sparkline_no_data")),1)],!0)])),n.disableTooltip?p.createCommentVNode("",!0):(p.openBlock(),p.createBlock(wo,{key:3,"absolute-left":N.value,"absolute-top":L.value,class:"tooltip","data-testid":"sparkline-tooltip",state:f,"tooltip-title":n.tooltipTitle,onDimensions:g},null,8,["absolute-left","absolute-top","state","tooltip-title"])),v.value&&n.showLabel?(p.openBlock(),p.createElementBlock("div",{key:4,class:"label",title:B.$slots.label?"":x.value},[p.renderSlot(B.$slots,"label",{total:w.value,totalByDataset:_.value},()=>[p.createTextVNode(p.toDisplayString(x.value),1)],!0)],8,aL)):p.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]);var zi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vo={exports:{}};var cL=vo.exports,I_;function uL(){return I_||(I_=1,(function(n,t){(function(){var e,i="4.18.1",r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",l="Invalid `variable` option passed into `_.template`",u="Invalid `imports` option passed into `_.template`",d="__lodash_hash_undefined__",f=500,g="__lodash_placeholder__",m=1,_=2,x=4,w=1,v=2,C=1,A=2,F=4,I=8,L=16,N=32,B=64,k=128,T=256,O=512,E=30,W="...",J=800,at=16,lt=1,G=2,rt=3,st=1/0,nt=9007199254740991,ct=17976931348623157e292,H=NaN,q=4294967295,X=q-1,_t=q>>>1,dt=[["ary",k],["bind",C],["bindKey",A],["curry",I],["curryRight",L],["flip",O],["partial",N],["partialRight",B],["rearg",T]],tt="[object Arguments]",pt="[object Array]",ft="[object AsyncFunction]",Y="[object Boolean]",et="[object Date]",ot="[object DOMException]",xt="[object Error]",Lt="[object Function]",wt="[object GeneratorFunction]",Ot="[object Map]",kt="[object Number]",ve="[object Null]",bt="[object Object]",jt="[object Promise]",Oe="[object Proxy]",Ae="[object RegExp]",oe="[object Set]",ln="[object String]",$t="[object Symbol]",Le="[object Undefined]",ie="[object WeakMap]",Se="[object WeakSet]",Re="[object ArrayBuffer]",gn="[object DataView]",Ui="[object Float32Array]",Dn="[object Float64Array]",Ye="[object Int8Array]",In="[object Int16Array]",ui="[object Int32Array]",So="[object Uint8Array]",To="[object Uint8ClampedArray]",xr="[object Uint16Array]",di="[object Uint32Array]",Mo=/\b__p \+= '';/g,ko=/\b(__p \+=) '' \+/g,Do=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Hi=/&(?:amp|lt|gt|quot|#39);/g,fl=/[&<>"']/g,fd=RegExp(Hi.source),hd=RegExp(fl.source),pd=/<%-([\s\S]+?)%>/g,gd=/<%([\s\S]+?)%>/g,Co=/<%=([\s\S]+?)%>/g,hl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fi=/^\w*$/,md=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Oo=/[\\^$.*+?()[\]{}|]/g,yd=RegExp(Oo.source),Ao=/^\s+/,_d=/\s/,Ln=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,bd=/\{\n\/\* \[wrapped with (.+)\] \*/,xd=/,? & /,wd=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,pl=/[()=,{}\[\]\/\s]/,vd=/\\(\\)?/g,Wi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,gl=/\w*$/,Sd=/^[-+]0x[0-9a-f]+$/i,Td=/^0b[01]+$/i,Md=/^\[object .+?Constructor\]$/,kd=/^0o[0-7]+$/i,$i=/^(?:0|[1-9]\d*)$/,Dd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,is=/($^)/,Cd=/['\n\r\u2028\u2029\\]/g,rs="\\ud800-\\udfff",Od="\\u0300-\\u036f",Ad="\\ufe20-\\ufe2f",ml="\\u20d0-\\u20ff",wr=Od+Ad+ml,yl="\\u2700-\\u27bf",ss="a-z\\xdf-\\xf6\\xf8-\\xff",Rd="\\xac\\xb1\\xd7\\xf7",Ed="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Pd="\\u2000-\\u206f",Id=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",_l="A-Z\\xc0-\\xd6\\xd8-\\xde",bl="\\ufe0e\\ufe0f",os=Rd+Ed+Pd+Id,Ro="['’]",Ld="["+rs+"]",xl="["+os+"]",as="["+wr+"]",wl="\\d+",Nd="["+yl+"]",vl="["+ss+"]",Eo="[^"+rs+os+wl+yl+ss+_l+"]",Po="\\ud83c[\\udffb-\\udfff]",Bd="(?:"+as+"|"+Po+")",vr="[^"+rs+"]",Gn="(?:\\ud83c[\\udde6-\\uddff]){2}",ls="[\\ud800-\\udbff][\\udc00-\\udfff]",cn="["+_l+"]",Sl="\\u200d",Tl="(?:"+vl+"|"+Eo+")",Fd="(?:"+cn+"|"+Eo+")",Ml="(?:"+Ro+"(?:d|ll|m|re|s|t|ve))?",kl="(?:"+Ro+"(?:D|LL|M|RE|S|T|VE))?",Dl=Bd+"?",Io="["+bl+"]?",hi="(?:"+Sl+"(?:"+[vr,Gn,ls].join("|")+")"+Io+Dl+")*",zd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Cl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ol=Io+Dl+hi,Lo="(?:"+[Nd,Gn,ls].join("|")+")"+Ol,Al="(?:"+[vr+as+"?",as,Gn,ls,Ld].join("|")+")",Ud=RegExp(Ro,"g"),Hd=RegExp(as,"g"),cs=RegExp(Po+"(?="+Po+")|"+Al+Ol,"g"),Wd=RegExp([cn+"?"+vl+"+"+Ml+"(?="+[xl,cn,"$"].join("|")+")",Fd+"+"+kl+"(?="+[xl,cn+Tl,"$"].join("|")+")",cn+"?"+Tl+"+"+Ml,cn+"+"+kl,Cl,zd,wl,Lo].join("|"),"g"),us=RegExp("["+Sl+rs+wr+bl+"]"),$d=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,No=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Vd=-1,ee={};ee[Ui]=ee[Dn]=ee[Ye]=ee[In]=ee[ui]=ee[So]=ee[To]=ee[xr]=ee[di]=!0,ee[tt]=ee[pt]=ee[Re]=ee[Y]=ee[gn]=ee[et]=ee[xt]=ee[Lt]=ee[Ot]=ee[kt]=ee[bt]=ee[Ae]=ee[oe]=ee[ln]=ee[ie]=!1;var D={};D[tt]=D[pt]=D[Re]=D[gn]=D[Y]=D[et]=D[Ui]=D[Dn]=D[Ye]=D[In]=D[ui]=D[Ot]=D[kt]=D[bt]=D[Ae]=D[oe]=D[ln]=D[$t]=D[So]=D[To]=D[xr]=D[di]=!0,D[xt]=D[Lt]=D[ie]=!1;var $={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Q={"&":"&","<":"<",">":">",'"':""","'":"'"},mt={"&":"&","<":"<",">":">",""":'"',"'":"'"},Te={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},qe=parseFloat,Nn=parseInt,Ne=typeof zi=="object"&&zi&&zi.Object===Object&&zi,Rl=typeof self=="object"&&self&&self.Object===Object&&self,ce=Ne||Rl||Function("return this")(),ds=t&&!t.nodeType&&t,Kn=ds&&!0&&n&&!n.nodeType&&n,Bo=Kn&&Kn.exports===ds,Sr=Bo&&Ne.process,Be=(function(){try{var z=Kn&&Kn.require&&Kn.require("util").types;return z||Sr&&Sr.binding&&Sr.binding("util")}catch{}})(),z_=Be&&Be.isArrayBuffer,U_=Be&&Be.isDate,H_=Be&&Be.isMap,W_=Be&&Be.isRegExp,$_=Be&&Be.isSet,V_=Be&&Be.isTypedArray;function mn(z,j,V){switch(V.length){case 0:return z.call(j);case 1:return z.call(j,V[0]);case 2:return z.call(j,V[0],V[1]);case 3:return z.call(j,V[0],V[1],V[2])}return z.apply(j,V)}function TL(z,j,V,ht){for(var At=-1,Vt=z==null?0:z.length;++At<Vt;){var Me=z[At];j(ht,Me,V(Me),z)}return ht}function yn(z,j){for(var V=-1,ht=z==null?0:z.length;++V<ht&&j(z[V],V,z)!==!1;);return z}function ML(z,j){for(var V=z==null?0:z.length;V--&&j(z[V],V,z)!==!1;);return z}function Y_(z,j){for(var V=-1,ht=z==null?0:z.length;++V<ht;)if(!j(z[V],V,z))return!1;return!0}function Vi(z,j){for(var V=-1,ht=z==null?0:z.length,At=0,Vt=[];++V<ht;){var Me=z[V];j(Me,V,z)&&(Vt[At++]=Me)}return Vt}function El(z,j){var V=z==null?0:z.length;return!!V&&fs(z,j,0)>-1}function Yd(z,j,V){for(var ht=-1,At=z==null?0:z.length;++ht<At;)if(V(j,z[ht]))return!0;return!1}function ue(z,j){for(var V=-1,ht=z==null?0:z.length,At=Array(ht);++V<ht;)At[V]=j(z[V],V,z);return At}function Yi(z,j){for(var V=-1,ht=j.length,At=z.length;++V<ht;)z[At+V]=j[V];return z}function qd(z,j,V,ht){var At=-1,Vt=z==null?0:z.length;for(ht&&Vt&&(V=z[++At]);++At<Vt;)V=j(V,z[At],At,z);return V}function kL(z,j,V,ht){var At=z==null?0:z.length;for(ht&&At&&(V=z[--At]);At--;)V=j(V,z[At],At,z);return V}function jd(z,j){for(var V=-1,ht=z==null?0:z.length;++V<ht;)if(j(z[V],V,z))return!0;return!1}var DL=Gd("length");function CL(z){return z.split("")}function OL(z){return z.match(wd)||[]}function q_(z,j,V){var ht;return V(z,function(At,Vt,Me){if(j(At,Vt,Me))return ht=Vt,!1}),ht}function Pl(z,j,V,ht){for(var At=z.length,Vt=V+(ht?1:-1);ht?Vt--:++Vt<At;)if(j(z[Vt],Vt,z))return Vt;return-1}function fs(z,j,V){return j===j?HL(z,j,V):Pl(z,j_,V)}function AL(z,j,V,ht){for(var At=V-1,Vt=z.length;++At<Vt;)if(ht(z[At],j))return At;return-1}function j_(z){return z!==z}function G_(z,j){var V=z==null?0:z.length;return V?Xd(z,j)/V:H}function Gd(z){return function(j){return j==null?e:j[z]}}function Kd(z){return function(j){return z==null?e:z[j]}}function K_(z,j,V,ht,At){return At(z,function(Vt,Me,ne){V=ht?(ht=!1,Vt):j(V,Vt,Me,ne)}),V}function RL(z,j){var V=z.length;for(z.sort(j);V--;)z[V]=z[V].value;return z}function Xd(z,j){for(var V,ht=-1,At=z.length;++ht<At;){var Vt=j(z[ht]);Vt!==e&&(V=V===e?Vt:V+Vt)}return V}function Zd(z,j){for(var V=-1,ht=Array(z);++V<z;)ht[V]=j(V);return ht}function EL(z,j){return ue(j,function(V){return[V,z[V]]})}function X_(z){return z&&z.slice(0,t0(z)+1).replace(Ao,"")}function _n(z){return function(j){return z(j)}}function Qd(z,j){return ue(j,function(V){return z[V]})}function Fo(z,j){return z.has(j)}function Z_(z,j){for(var V=-1,ht=z.length;++V<ht&&fs(j,z[V],0)>-1;);return V}function Q_(z,j){for(var V=z.length;V--&&fs(j,z[V],0)>-1;);return V}function PL(z,j){for(var V=z.length,ht=0;V--;)z[V]===j&&++ht;return ht}var IL=Kd($),LL=Kd(Q);function NL(z){return"\\"+Te[z]}function BL(z,j){return z==null?e:z[j]}function hs(z){return us.test(z)}function FL(z){return $d.test(z)}function zL(z){for(var j,V=[];!(j=z.next()).done;)V.push(j.value);return V}function Jd(z){var j=-1,V=Array(z.size);return z.forEach(function(ht,At){V[++j]=[At,ht]}),V}function J_(z,j){return function(V){return z(j(V))}}function qi(z,j){for(var V=-1,ht=z.length,At=0,Vt=[];++V<ht;){var Me=z[V];(Me===j||Me===g)&&(z[V]=g,Vt[At++]=V)}return Vt}function Il(z){var j=-1,V=Array(z.size);return z.forEach(function(ht){V[++j]=ht}),V}function UL(z){var j=-1,V=Array(z.size);return z.forEach(function(ht){V[++j]=[ht,ht]}),V}function HL(z,j,V){for(var ht=V-1,At=z.length;++ht<At;)if(z[ht]===j)return ht;return-1}function WL(z,j,V){for(var ht=V+1;ht--;)if(z[ht]===j)return ht;return ht}function ps(z){return hs(z)?VL(z):DL(z)}function Bn(z){return hs(z)?YL(z):CL(z)}function t0(z){for(var j=z.length;j--&&_d.test(z.charAt(j)););return j}var $L=Kd(mt);function VL(z){for(var j=cs.lastIndex=0;cs.test(z);)++j;return j}function YL(z){return z.match(cs)||[]}function qL(z){return z.match(Wd)||[]}var jL=(function z(j){j=j==null?ce:gs.defaults(ce.Object(),j,gs.pick(ce,No));var V=j.Array,ht=j.Date,At=j.Error,Vt=j.Function,Me=j.Math,ne=j.Object,tf=j.RegExp,GL=j.String,Cn=j.TypeError,Ll=V.prototype,KL=Vt.prototype,ms=ne.prototype,Nl=j["__core-js_shared__"],Bl=KL.toString,Gt=ms.hasOwnProperty,XL=0,e0=(function(){var o=/[^.]+$/.exec(Nl&&Nl.keys&&Nl.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),Fl=ms.toString,ZL=Bl.call(ne),QL=ce._,JL=tf("^"+Bl.call(Gt).replace(Oo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zl=Bo?j.Buffer:e,ji=j.Symbol,Ul=j.Uint8Array,n0=zl?zl.allocUnsafe:e,Hl=J_(ne.getPrototypeOf,ne),i0=ne.create,r0=ms.propertyIsEnumerable,Wl=Ll.splice,s0=ji?ji.isConcatSpreadable:e,zo=ji?ji.iterator:e,Tr=ji?ji.toStringTag:e,$l=(function(){try{var o=Or(ne,"defineProperty");return o({},"",{}),o}catch{}})(),tN=j.clearTimeout!==ce.clearTimeout&&j.clearTimeout,eN=ht&&ht.now!==ce.Date.now&&ht.now,nN=j.setTimeout!==ce.setTimeout&&j.setTimeout,Vl=Me.ceil,Yl=Me.floor,ef=ne.getOwnPropertySymbols,iN=zl?zl.isBuffer:e,o0=j.isFinite,rN=Ll.join,sN=J_(ne.keys,ne),ke=Me.max,je=Me.min,oN=ht.now,aN=j.parseInt,a0=Me.random,lN=Ll.reverse,nf=Or(j,"DataView"),Uo=Or(j,"Map"),rf=Or(j,"Promise"),ys=Or(j,"Set"),Ho=Or(j,"WeakMap"),Wo=Or(ne,"create"),ql=Ho&&new Ho,_s={},cN=Ar(nf),uN=Ar(Uo),dN=Ar(rf),fN=Ar(ys),hN=Ar(Ho),jl=ji?ji.prototype:e,$o=jl?jl.valueOf:e,l0=jl?jl.toString:e;function S(o){if(ge(o)&&!Pt(o)&&!(o instanceof Ut)){if(o instanceof On)return o;if(Gt.call(o,"__wrapped__"))return cb(o)}return new On(o)}var bs=(function(){function o(){}return function(c){if(!fe(c))return{};if(i0)return i0(c);o.prototype=c;var h=new o;return o.prototype=e,h}})();function Gl(){}function On(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=e}S.templateSettings={escape:pd,evaluate:gd,interpolate:Co,variable:"",imports:{_:S}},S.prototype=Gl.prototype,S.prototype.constructor=S,On.prototype=bs(Gl.prototype),On.prototype.constructor=On;function Ut(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=q,this.__views__=[]}function pN(){var o=new Ut(this.__wrapped__);return o.__actions__=un(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=un(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=un(this.__views__),o}function gN(){if(this.__filtered__){var o=new Ut(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function mN(){var o=this.__wrapped__.value(),c=this.__dir__,h=Pt(o),y=c<0,b=h?o.length:0,M=CB(0,b,this.__views__),R=M.start,P=M.end,U=P-R,K=y?P:R-1,Z=this.__iteratees__,it=Z.length,ut=0,yt=je(U,this.__takeCount__);if(!h||!y&&b==U&&yt==U)return E0(o,this.__actions__);var Dt=[];t:for(;U--&&ut<yt;){K+=c;for(var Bt=-1,St=o[K];++Bt<it;){var zt=Z[Bt],Ht=zt.iteratee,wn=zt.type,tn=Ht(St);if(wn==G)St=tn;else if(!tn){if(wn==lt)continue t;break t}}Dt[ut++]=St}return Dt}Ut.prototype=bs(Gl.prototype),Ut.prototype.constructor=Ut;function Mr(o){var c=-1,h=o==null?0:o.length;for(this.clear();++c<h;){var y=o[c];this.set(y[0],y[1])}}function yN(){this.__data__=Wo?Wo(null):{},this.size=0}function _N(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function bN(o){var c=this.__data__;if(Wo){var h=c[o];return h===d?e:h}return Gt.call(c,o)?c[o]:e}function xN(o){var c=this.__data__;return Wo?c[o]!==e:Gt.call(c,o)}function wN(o,c){var h=this.__data__;return this.size+=this.has(o)?0:1,h[o]=Wo&&c===e?d:c,this}Mr.prototype.clear=yN,Mr.prototype.delete=_N,Mr.prototype.get=bN,Mr.prototype.has=xN,Mr.prototype.set=wN;function pi(o){var c=-1,h=o==null?0:o.length;for(this.clear();++c<h;){var y=o[c];this.set(y[0],y[1])}}function vN(){this.__data__=[],this.size=0}function SN(o){var c=this.__data__,h=Kl(c,o);if(h<0)return!1;var y=c.length-1;return h==y?c.pop():Wl.call(c,h,1),--this.size,!0}function TN(o){var c=this.__data__,h=Kl(c,o);return h<0?e:c[h][1]}function MN(o){return Kl(this.__data__,o)>-1}function kN(o,c){var h=this.__data__,y=Kl(h,o);return y<0?(++this.size,h.push([o,c])):h[y][1]=c,this}pi.prototype.clear=vN,pi.prototype.delete=SN,pi.prototype.get=TN,pi.prototype.has=MN,pi.prototype.set=kN;function gi(o){var c=-1,h=o==null?0:o.length;for(this.clear();++c<h;){var y=o[c];this.set(y[0],y[1])}}function DN(){this.size=0,this.__data__={hash:new Mr,map:new(Uo||pi),string:new Mr}}function CN(o){var c=ac(this,o).delete(o);return this.size-=c?1:0,c}function ON(o){return ac(this,o).get(o)}function AN(o){return ac(this,o).has(o)}function RN(o,c){var h=ac(this,o),y=h.size;return h.set(o,c),this.size+=h.size==y?0:1,this}gi.prototype.clear=DN,gi.prototype.delete=CN,gi.prototype.get=ON,gi.prototype.has=AN,gi.prototype.set=RN;function kr(o){var c=-1,h=o==null?0:o.length;for(this.__data__=new gi;++c<h;)this.add(o[c])}function EN(o){return this.__data__.set(o,d),this}function PN(o){return this.__data__.has(o)}kr.prototype.add=kr.prototype.push=EN,kr.prototype.has=PN;function Fn(o){var c=this.__data__=new pi(o);this.size=c.size}function IN(){this.__data__=new pi,this.size=0}function LN(o){var c=this.__data__,h=c.delete(o);return this.size=c.size,h}function NN(o){return this.__data__.get(o)}function BN(o){return this.__data__.has(o)}function FN(o,c){var h=this.__data__;if(h instanceof pi){var y=h.__data__;if(!Uo||y.length<r-1)return y.push([o,c]),this.size=++h.size,this;h=this.__data__=new gi(y)}return h.set(o,c),this.size=h.size,this}Fn.prototype.clear=IN,Fn.prototype.delete=LN,Fn.prototype.get=NN,Fn.prototype.has=BN,Fn.prototype.set=FN;function c0(o,c){var h=Pt(o),y=!h&&Rr(o),b=!h&&!y&&Qi(o),M=!h&&!y&&!b&&Ss(o),R=h||y||b||M,P=R?Zd(o.length,GL):[],U=P.length;for(var K in o)(c||Gt.call(o,K))&&!(R&&(K=="length"||b&&(K=="offset"||K=="parent")||M&&(K=="buffer"||K=="byteLength"||K=="byteOffset")||_i(K,U)))&&P.push(K);return P}function u0(o){var c=o.length;return c?o[gf(0,c-1)]:e}function zN(o,c){return lc(un(o),Dr(c,0,o.length))}function UN(o){return lc(un(o))}function sf(o,c,h){(h!==e&&!Un(o[c],h)||h===e&&!(c in o))&&Xn(o,c,h)}function Vo(o,c,h){var y=o[c];(!(Gt.call(o,c)&&Un(y,h))||h===e&&!(c in o))&&Xn(o,c,h)}function Kl(o,c){for(var h=o.length;h--;)if(Un(o[h][0],c))return h;return-1}function HN(o,c,h,y){return Gi(o,function(b,M,R){c(y,b,h(b),R)}),y}function d0(o,c){return o&&Qn(c,Ee(c),o)}function WN(o,c){return o&&Qn(c,fn(c),o)}function Xn(o,c,h){c=="__proto__"&&$l?$l(o,c,{configurable:!0,enumerable:!0,value:h,writable:!0}):o[c]=h}function of(o,c){for(var h=-1,y=c.length,b=V(y),M=o==null;++h<y;)b[h]=M?e:Hf(o,c[h]);return b}function Dr(o,c,h){return o===o&&(h!==e&&(o=o<=h?o:h),c!==e&&(o=o>=c?o:c)),o}function An(o,c,h,y,b,M){var R,P=c&m,U=c&_,K=c&x;if(h&&(R=b?h(o,y,b,M):h(o)),R!==e)return R;if(!fe(o))return o;var Z=Pt(o);if(Z){if(R=AB(o),!P)return un(o,R)}else{var it=Ge(o),ut=it==Lt||it==wt;if(Qi(o))return L0(o,P);if(it==bt||it==tt||ut&&!b){if(R=U||ut?{}:tb(o),!P)return U?bB(o,WN(R,o)):_B(o,d0(R,o))}else{if(!D[it])return b?o:{};R=RB(o,it,P)}}M||(M=new Fn);var yt=M.get(o);if(yt)return yt;M.set(o,R),Ob(o)?o.forEach(function(St){R.add(An(St,c,h,St,o,M))}):Db(o)&&o.forEach(function(St,zt){R.set(zt,An(St,c,h,zt,o,M))});var Dt=K?U?kf:Mf:U?fn:Ee,Bt=Z?e:Dt(o);return yn(Bt||o,function(St,zt){Bt&&(zt=St,St=o[zt]),Vo(R,zt,An(St,c,h,zt,o,M))}),R}function $N(o){var c=Ee(o);return function(h){return f0(h,o,c)}}function f0(o,c,h){var y=h.length;if(o==null)return!y;for(o=ne(o);y--;){var b=h[y],M=c[b],R=o[b];if(R===e&&!(b in o)||!M(R))return!1}return!0}function h0(o,c,h){if(typeof o!="function")throw new Cn(a);return Zo(function(){o.apply(e,h)},c)}function Yo(o,c,h,y){var b=-1,M=El,R=!0,P=o.length,U=[],K=c.length;if(!P)return U;h&&(c=ue(c,_n(h))),y?(M=Yd,R=!1):c.length>=r&&(M=Fo,R=!1,c=new kr(c));t:for(;++b<P;){var Z=o[b],it=h==null?Z:h(Z);if(Z=y||Z!==0?Z:0,R&&it===it){for(var ut=K;ut--;)if(c[ut]===it)continue t;U.push(Z)}else M(c,it,y)||U.push(Z)}return U}var Gi=U0(Zn),p0=U0(lf,!0);function VN(o,c){var h=!0;return Gi(o,function(y,b,M){return h=!!c(y,b,M),h}),h}function Xl(o,c,h){for(var y=-1,b=o.length;++y<b;){var M=o[y],R=c(M);if(R!=null&&(P===e?R===R&&!xn(R):h(R,P)))var P=R,U=M}return U}function YN(o,c,h,y){var b=o.length;for(h=Nt(h),h<0&&(h=-h>b?0:b+h),y=y===e||y>b?b:Nt(y),y<0&&(y+=b),y=h>y?0:Rb(y);h<y;)o[h++]=c;return o}function g0(o,c){var h=[];return Gi(o,function(y,b,M){c(y,b,M)&&h.push(y)}),h}function Fe(o,c,h,y,b){var M=-1,R=o.length;for(h||(h=PB),b||(b=[]);++M<R;){var P=o[M];c>0&&h(P)?c>1?Fe(P,c-1,h,y,b):Yi(b,P):y||(b[b.length]=P)}return b}var af=H0(),m0=H0(!0);function Zn(o,c){return o&&af(o,c,Ee)}function lf(o,c){return o&&m0(o,c,Ee)}function Zl(o,c){return Vi(c,function(h){return bi(o[h])})}function Cr(o,c){c=Xi(c,o);for(var h=0,y=c.length;o!=null&&h<y;)o=o[zn(c[h++])];return h&&h==y?o:e}function y0(o,c,h){var y=c(o);return Pt(o)?y:Yi(y,h(o))}function Qe(o){return o==null?o===e?Le:ve:Tr&&Tr in ne(o)?DB(o):UB(o)}function cf(o,c){return o>c}function qN(o,c){return o!=null&&Gt.call(o,c)}function jN(o,c){return o!=null&&c in ne(o)}function GN(o,c,h){return o>=je(c,h)&&o<ke(c,h)}function uf(o,c,h){for(var y=h?Yd:El,b=o[0].length,M=o.length,R=M,P=V(M),U=1/0,K=[];R--;){var Z=o[R];R&&c&&(Z=ue(Z,_n(c))),U=je(Z.length,U),P[R]=!h&&(c||b>=120&&Z.length>=120)?new kr(R&&Z):e}Z=o[0];var it=-1,ut=P[0];t:for(;++it<b&&K.length<U;){var yt=Z[it],Dt=c?c(yt):yt;if(yt=h||yt!==0?yt:0,!(ut?Fo(ut,Dt):y(K,Dt,h))){for(R=M;--R;){var Bt=P[R];if(!(Bt?Fo(Bt,Dt):y(o[R],Dt,h)))continue t}ut&&ut.push(Dt),K.push(yt)}}return K}function KN(o,c,h,y){return Zn(o,function(b,M,R){c(y,h(b),M,R)}),y}function qo(o,c,h){c=Xi(c,o),o=rb(o,c);var y=o==null?o:o[zn(En(c))];return y==null?e:mn(y,o,h)}function _0(o){return ge(o)&&Qe(o)==tt}function XN(o){return ge(o)&&Qe(o)==Re}function ZN(o){return ge(o)&&Qe(o)==et}function jo(o,c,h,y,b){return o===c?!0:o==null||c==null||!ge(o)&&!ge(c)?o!==o&&c!==c:QN(o,c,h,y,jo,b)}function QN(o,c,h,y,b,M){var R=Pt(o),P=Pt(c),U=R?pt:Ge(o),K=P?pt:Ge(c);U=U==tt?bt:U,K=K==tt?bt:K;var Z=U==bt,it=K==bt,ut=U==K;if(ut&&Qi(o)){if(!Qi(c))return!1;R=!0,Z=!1}if(ut&&!Z)return M||(M=new Fn),R||Ss(o)?Z0(o,c,h,y,b,M):MB(o,c,U,h,y,b,M);if(!(h&w)){var yt=Z&&Gt.call(o,"__wrapped__"),Dt=it&&Gt.call(c,"__wrapped__");if(yt||Dt){var Bt=yt?o.value():o,St=Dt?c.value():c;return M||(M=new Fn),b(Bt,St,h,y,M)}}return ut?(M||(M=new Fn),kB(o,c,h,y,b,M)):!1}function JN(o){return ge(o)&&Ge(o)==Ot}function df(o,c,h,y){var b=h.length,M=b,R=!y;if(o==null)return!M;for(o=ne(o);b--;){var P=h[b];if(R&&P[2]?P[1]!==o[P[0]]:!(P[0]in o))return!1}for(;++b<M;){P=h[b];var U=P[0],K=o[U],Z=P[1];if(R&&P[2]){if(K===e&&!(U in o))return!1}else{var it=new Fn;if(y)var ut=y(K,Z,U,o,c,it);if(!(ut===e?jo(Z,K,w|v,y,it):ut))return!1}}return!0}function b0(o){if(!fe(o)||LB(o))return!1;var c=bi(o)?JL:Md;return c.test(Ar(o))}function tB(o){return ge(o)&&Qe(o)==Ae}function eB(o){return ge(o)&&Ge(o)==oe}function nB(o){return ge(o)&&pc(o.length)&&!!ee[Qe(o)]}function x0(o){return typeof o=="function"?o:o==null?hn:typeof o=="object"?Pt(o)?S0(o[0],o[1]):v0(o):$b(o)}function ff(o){if(!Xo(o))return sN(o);var c=[];for(var h in ne(o))Gt.call(o,h)&&h!="constructor"&&c.push(h);return c}function iB(o){if(!fe(o))return zB(o);var c=Xo(o),h=[];for(var y in o)y=="constructor"&&(c||!Gt.call(o,y))||h.push(y);return h}function hf(o,c){return o<c}function w0(o,c){var h=-1,y=dn(o)?V(o.length):[];return Gi(o,function(b,M,R){y[++h]=c(b,M,R)}),y}function v0(o){var c=Cf(o);return c.length==1&&c[0][2]?nb(c[0][0],c[0][1]):function(h){return h===o||df(h,o,c)}}function S0(o,c){return Af(o)&&eb(c)?nb(zn(o),c):function(h){var y=Hf(h,o);return y===e&&y===c?Wf(h,o):jo(c,y,w|v)}}function Ql(o,c,h,y,b){o!==c&&af(c,function(M,R){if(b||(b=new Fn),fe(M))rB(o,c,R,h,Ql,y,b);else{var P=y?y(Ef(o,R),M,R+"",o,c,b):e;P===e&&(P=M),sf(o,R,P)}},fn)}function rB(o,c,h,y,b,M,R){var P=Ef(o,h),U=Ef(c,h),K=R.get(U);if(K){sf(o,h,K);return}var Z=M?M(P,U,h+"",o,c,R):e,it=Z===e;if(it){var ut=Pt(U),yt=!ut&&Qi(U),Dt=!ut&&!yt&&Ss(U);Z=U,ut||yt||Dt?Pt(P)?Z=P:_e(P)?Z=un(P):yt?(it=!1,Z=L0(U,!0)):Dt?(it=!1,Z=N0(U,!0)):Z=[]:Qo(U)||Rr(U)?(Z=P,Rr(P)?Z=Eb(P):(!fe(P)||bi(P))&&(Z=tb(U))):it=!1}it&&(R.set(U,Z),b(Z,U,y,M,R),R.delete(U)),sf(o,h,Z)}function T0(o,c){var h=o.length;if(h)return c+=c<0?h:0,_i(c,h)?o[c]:e}function M0(o,c,h){c.length?c=ue(c,function(M){return Pt(M)?function(R){return Cr(R,M.length===1?M[0]:M)}:M}):c=[hn];var y=-1;c=ue(c,_n(Tt()));var b=w0(o,function(M,R,P){var U=ue(c,function(K){return K(M)});return{criteria:U,index:++y,value:M}});return RL(b,function(M,R){return yB(M,R,h)})}function sB(o,c){return k0(o,c,function(h,y){return Wf(o,y)})}function k0(o,c,h){for(var y=-1,b=c.length,M={};++y<b;){var R=c[y],P=Cr(o,R);h(P,R)&&Go(M,Xi(R,o),P)}return M}function oB(o){return function(c){return Cr(c,o)}}function pf(o,c,h,y){var b=y?AL:fs,M=-1,R=c.length,P=o;for(o===c&&(c=un(c)),h&&(P=ue(o,_n(h)));++M<R;)for(var U=0,K=c[M],Z=h?h(K):K;(U=b(P,Z,U,y))>-1;)P!==o&&Wl.call(P,U,1),Wl.call(o,U,1);return o}function D0(o,c){for(var h=o?c.length:0,y=h-1;h--;){var b=c[h];if(h==y||b!==M){var M=b;_i(b)?Wl.call(o,b,1):_f(o,b)}}return o}function gf(o,c){return o+Yl(a0()*(c-o+1))}function aB(o,c,h,y){for(var b=-1,M=ke(Vl((c-o)/(h||1)),0),R=V(M);M--;)R[y?M:++b]=o,o+=h;return R}function mf(o,c){var h="";if(!o||c<1||c>nt)return h;do c%2&&(h+=o),c=Yl(c/2),c&&(o+=o);while(c);return h}function Ft(o,c){return Pf(ib(o,c,hn),o+"")}function lB(o){return u0(Ts(o))}function cB(o,c){var h=Ts(o);return lc(h,Dr(c,0,h.length))}function Go(o,c,h,y){if(!fe(o))return o;c=Xi(c,o);for(var b=-1,M=c.length,R=M-1,P=o;P!=null&&++b<M;){var U=zn(c[b]),K=h;if(U==="__proto__"||U==="constructor"||U==="prototype")return o;if(b!=R){var Z=P[U];K=y?y(Z,U,P):e,K===e&&(K=fe(Z)?Z:_i(c[b+1])?[]:{})}Vo(P,U,K),P=P[U]}return o}var C0=ql?function(o,c){return ql.set(o,c),o}:hn,uB=$l?function(o,c){return $l(o,"toString",{configurable:!0,enumerable:!1,value:Vf(c),writable:!0})}:hn;function dB(o){return lc(Ts(o))}function Rn(o,c,h){var y=-1,b=o.length;c<0&&(c=-c>b?0:b+c),h=h>b?b:h,h<0&&(h+=b),b=c>h?0:h-c>>>0,c>>>=0;for(var M=V(b);++y<b;)M[y]=o[y+c];return M}function fB(o,c){var h;return Gi(o,function(y,b,M){return h=c(y,b,M),!h}),!!h}function Jl(o,c,h){var y=0,b=o==null?y:o.length;if(typeof c=="number"&&c===c&&b<=_t){for(;y<b;){var M=y+b>>>1,R=o[M];R!==null&&!xn(R)&&(h?R<=c:R<c)?y=M+1:b=M}return b}return yf(o,c,hn,h)}function yf(o,c,h,y){var b=0,M=o==null?0:o.length;if(M===0)return 0;c=h(c);for(var R=c!==c,P=c===null,U=xn(c),K=c===e;b<M;){var Z=Yl((b+M)/2),it=h(o[Z]),ut=it!==e,yt=it===null,Dt=it===it,Bt=xn(it);if(R)var St=y||Dt;else K?St=Dt&&(y||ut):P?St=Dt&&ut&&(y||!yt):U?St=Dt&&ut&&!yt&&(y||!Bt):yt||Bt?St=!1:St=y?it<=c:it<c;St?b=Z+1:M=Z}return je(M,X)}function O0(o,c){for(var h=-1,y=o.length,b=0,M=[];++h<y;){var R=o[h],P=c?c(R):R;if(!h||!Un(P,U)){var U=P;M[b++]=R===0?0:R}}return M}function A0(o){return typeof o=="number"?o:xn(o)?H:+o}function bn(o){if(typeof o=="string")return o;if(Pt(o))return ue(o,bn)+"";if(xn(o))return l0?l0.call(o):"";var c=o+"";return c=="0"&&1/o==-st?"-0":c}function Ki(o,c,h){var y=-1,b=El,M=o.length,R=!0,P=[],U=P;if(h)R=!1,b=Yd;else if(M>=r){var K=c?null:SB(o);if(K)return Il(K);R=!1,b=Fo,U=new kr}else U=c?[]:P;t:for(;++y<M;){var Z=o[y],it=c?c(Z):Z;if(Z=h||Z!==0?Z:0,R&&it===it){for(var ut=U.length;ut--;)if(U[ut]===it)continue t;c&&U.push(it),P.push(Z)}else b(U,it,h)||(U!==P&&U.push(it),P.push(Z))}return P}function _f(o,c){c=Xi(c,o);var h=-1,y=c.length;if(!y)return!0;for(;++h<y;){var b=zn(c[h]);if(b==="__proto__"&&!Gt.call(o,"__proto__")||(b==="constructor"||b==="prototype")&&h<y-1)return!1}var M=rb(o,c);return M==null||delete M[zn(En(c))]}function R0(o,c,h,y){return Go(o,c,h(Cr(o,c)),y)}function tc(o,c,h,y){for(var b=o.length,M=y?b:-1;(y?M--:++M<b)&&c(o[M],M,o););return h?Rn(o,y?0:M,y?M+1:b):Rn(o,y?M+1:0,y?b:M)}function E0(o,c){var h=o;return h instanceof Ut&&(h=h.value()),qd(c,function(y,b){return b.func.apply(b.thisArg,Yi([y],b.args))},h)}function bf(o,c,h){var y=o.length;if(y<2)return y?Ki(o[0]):[];for(var b=-1,M=V(y);++b<y;)for(var R=o[b],P=-1;++P<y;)P!=b&&(M[b]=Yo(M[b]||R,o[P],c,h));return Ki(Fe(M,1),c,h)}function P0(o,c,h){for(var y=-1,b=o.length,M=c.length,R={};++y<b;){var P=y<M?c[y]:e;h(R,o[y],P)}return R}function xf(o){return _e(o)?o:[]}function wf(o){return typeof o=="function"?o:hn}function Xi(o,c){return Pt(o)?o:Af(o,c)?[o]:lb(Kt(o))}var hB=Ft;function Zi(o,c,h){var y=o.length;return h=h===e?y:h,!c&&h>=y?o:Rn(o,c,h)}var I0=tN||function(o){return ce.clearTimeout(o)};function L0(o,c){if(c)return o.slice();var h=o.length,y=n0?n0(h):new o.constructor(h);return o.copy(y),y}function vf(o){var c=new o.constructor(o.byteLength);return new Ul(c).set(new Ul(o)),c}function pB(o,c){var h=c?vf(o.buffer):o.buffer;return new o.constructor(h,o.byteOffset,o.byteLength)}function gB(o){var c=new o.constructor(o.source,gl.exec(o));return c.lastIndex=o.lastIndex,c}function mB(o){return $o?ne($o.call(o)):{}}function N0(o,c){var h=c?vf(o.buffer):o.buffer;return new o.constructor(h,o.byteOffset,o.length)}function B0(o,c){if(o!==c){var h=o!==e,y=o===null,b=o===o,M=xn(o),R=c!==e,P=c===null,U=c===c,K=xn(c);if(!P&&!K&&!M&&o>c||M&&R&&U&&!P&&!K||y&&R&&U||!h&&U||!b)return 1;if(!y&&!M&&!K&&o<c||K&&h&&b&&!y&&!M||P&&h&&b||!R&&b||!U)return-1}return 0}function yB(o,c,h){for(var y=-1,b=o.criteria,M=c.criteria,R=b.length,P=h.length;++y<R;){var U=B0(b[y],M[y]);if(U){if(y>=P)return U;var K=h[y];return U*(K=="desc"?-1:1)}}return o.index-c.index}function F0(o,c,h,y){for(var b=-1,M=o.length,R=h.length,P=-1,U=c.length,K=ke(M-R,0),Z=V(U+K),it=!y;++P<U;)Z[P]=c[P];for(;++b<R;)(it||b<M)&&(Z[h[b]]=o[b]);for(;K--;)Z[P++]=o[b++];return Z}function z0(o,c,h,y){for(var b=-1,M=o.length,R=-1,P=h.length,U=-1,K=c.length,Z=ke(M-P,0),it=V(Z+K),ut=!y;++b<Z;)it[b]=o[b];for(var yt=b;++U<K;)it[yt+U]=c[U];for(;++R<P;)(ut||b<M)&&(it[yt+h[R]]=o[b++]);return it}function un(o,c){var h=-1,y=o.length;for(c||(c=V(y));++h<y;)c[h]=o[h];return c}function Qn(o,c,h,y){var b=!h;h||(h={});for(var M=-1,R=c.length;++M<R;){var P=c[M],U=y?y(h[P],o[P],P,h,o):e;U===e&&(U=o[P]),b?Xn(h,P,U):Vo(h,P,U)}return h}function _B(o,c){return Qn(o,Of(o),c)}function bB(o,c){return Qn(o,Q0(o),c)}function ec(o,c){return function(h,y){var b=Pt(h)?TL:HN,M=c?c():{};return b(h,o,Tt(y,2),M)}}function xs(o){return Ft(function(c,h){var y=-1,b=h.length,M=b>1?h[b-1]:e,R=b>2?h[2]:e;for(M=o.length>3&&typeof M=="function"?(b--,M):e,R&&Je(h[0],h[1],R)&&(M=b<3?e:M,b=1),c=ne(c);++y<b;){var P=h[y];P&&o(c,P,y,M)}return c})}function U0(o,c){return function(h,y){if(h==null)return h;if(!dn(h))return o(h,y);for(var b=h.length,M=c?b:-1,R=ne(h);(c?M--:++M<b)&&y(R[M],M,R)!==!1;);return h}}function H0(o){return function(c,h,y){for(var b=-1,M=ne(c),R=y(c),P=R.length;P--;){var U=R[o?P:++b];if(h(M[U],U,M)===!1)break}return c}}function xB(o,c,h){var y=c&C,b=Ko(o);function M(){var R=this&&this!==ce&&this instanceof M?b:o;return R.apply(y?h:this,arguments)}return M}function W0(o){return function(c){c=Kt(c);var h=hs(c)?Bn(c):e,y=h?h[0]:c.charAt(0),b=h?Zi(h,1).join(""):c.slice(1);return y[o]()+b}}function ws(o){return function(c){return qd(Hb(Ub(c).replace(Ud,"")),o,"")}}function Ko(o){return function(){var c=arguments;switch(c.length){case 0:return new o;case 1:return new o(c[0]);case 2:return new o(c[0],c[1]);case 3:return new o(c[0],c[1],c[2]);case 4:return new o(c[0],c[1],c[2],c[3]);case 5:return new o(c[0],c[1],c[2],c[3],c[4]);case 6:return new o(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new o(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var h=bs(o.prototype),y=o.apply(h,c);return fe(y)?y:h}}function wB(o,c,h){var y=Ko(o);function b(){for(var M=arguments.length,R=V(M),P=M,U=vs(b);P--;)R[P]=arguments[P];var K=M<3&&R[0]!==U&&R[M-1]!==U?[]:qi(R,U);if(M-=K.length,M<h)return j0(o,c,nc,b.placeholder,e,R,K,e,e,h-M);var Z=this&&this!==ce&&this instanceof b?y:o;return mn(Z,this,R)}return b}function $0(o){return function(c,h,y){var b=ne(c);if(!dn(c)){var M=Tt(h,3);c=Ee(c),h=function(P){return M(b[P],P,b)}}var R=o(c,h,y);return R>-1?b[M?c[R]:R]:e}}function V0(o){return yi(function(c){var h=c.length,y=h,b=On.prototype.thru;for(o&&c.reverse();y--;){var M=c[y];if(typeof M!="function")throw new Cn(a);if(b&&!R&&oc(M)=="wrapper")var R=new On([],!0)}for(y=R?y:h;++y<h;){M=c[y];var P=oc(M),U=P=="wrapper"?Df(M):e;U&&Rf(U[0])&&U[1]==(k|I|N|T)&&!U[4].length&&U[9]==1?R=R[oc(U[0])].apply(R,U[3]):R=M.length==1&&Rf(M)?R[P]():R.thru(M)}return function(){var K=arguments,Z=K[0];if(R&&K.length==1&&Pt(Z))return R.plant(Z).value();for(var it=0,ut=h?c[it].apply(this,K):Z;++it<h;)ut=c[it].call(this,ut);return ut}})}function nc(o,c,h,y,b,M,R,P,U,K){var Z=c&k,it=c&C,ut=c&A,yt=c&(I|L),Dt=c&O,Bt=ut?e:Ko(o);function St(){for(var zt=arguments.length,Ht=V(zt),wn=zt;wn--;)Ht[wn]=arguments[wn];if(yt)var tn=vs(St),vn=PL(Ht,tn);if(y&&(Ht=F0(Ht,y,b,yt)),M&&(Ht=z0(Ht,M,R,yt)),zt-=vn,yt&&zt<K){var be=qi(Ht,tn);return j0(o,c,nc,St.placeholder,h,Ht,be,P,U,K-zt)}var Hn=it?h:this,wi=ut?Hn[o]:o;return zt=Ht.length,P?Ht=HB(Ht,P):Dt&&zt>1&&Ht.reverse(),Z&&U<zt&&(Ht.length=U),this&&this!==ce&&this instanceof St&&(wi=Bt||Ko(wi)),wi.apply(Hn,Ht)}return St}function Y0(o,c){return function(h,y){return KN(h,o,c(y),{})}}function ic(o,c){return function(h,y){var b;if(h===e&&y===e)return c;if(h!==e&&(b=h),y!==e){if(b===e)return y;typeof h=="string"||typeof y=="string"?(h=bn(h),y=bn(y)):(h=A0(h),y=A0(y)),b=o(h,y)}return b}}function Sf(o){return yi(function(c){return c=ue(c,_n(Tt())),Ft(function(h){var y=this;return o(c,function(b){return mn(b,y,h)})})})}function rc(o,c){c=c===e?" ":bn(c);var h=c.length;if(h<2)return h?mf(c,o):c;var y=mf(c,Vl(o/ps(c)));return hs(c)?Zi(Bn(y),0,o).join(""):y.slice(0,o)}function vB(o,c,h,y){var b=c&C,M=Ko(o);function R(){for(var P=-1,U=arguments.length,K=-1,Z=y.length,it=V(Z+U),ut=this&&this!==ce&&this instanceof R?M:o;++K<Z;)it[K]=y[K];for(;U--;)it[K++]=arguments[++P];return mn(ut,b?h:this,it)}return R}function q0(o){return function(c,h,y){return y&&typeof y!="number"&&Je(c,h,y)&&(h=y=e),c=xi(c),h===e?(h=c,c=0):h=xi(h),y=y===e?c<h?1:-1:xi(y),aB(c,h,y,o)}}function sc(o){return function(c,h){return typeof c=="string"&&typeof h=="string"||(c=Pn(c),h=Pn(h)),o(c,h)}}function j0(o,c,h,y,b,M,R,P,U,K){var Z=c&I,it=Z?R:e,ut=Z?e:R,yt=Z?M:e,Dt=Z?e:M;c|=Z?N:B,c&=~(Z?B:N),c&F||(c&=-4);var Bt=[o,c,b,yt,it,Dt,ut,P,U,K],St=h.apply(e,Bt);return Rf(o)&&sb(St,Bt),St.placeholder=y,ob(St,o,c)}function Tf(o){var c=Me[o];return function(h,y){if(h=Pn(h),y=y==null?0:je(Nt(y),292),y&&o0(h)){var b=(Kt(h)+"e").split("e"),M=c(b[0]+"e"+(+b[1]+y));return b=(Kt(M)+"e").split("e"),+(b[0]+"e"+(+b[1]-y))}return c(h)}}var SB=ys&&1/Il(new ys([,-0]))[1]==st?function(o){return new ys(o)}:jf;function G0(o){return function(c){var h=Ge(c);return h==Ot?Jd(c):h==oe?UL(c):EL(c,o(c))}}function mi(o,c,h,y,b,M,R,P){var U=c&A;if(!U&&typeof o!="function")throw new Cn(a);var K=y?y.length:0;if(K||(c&=-97,y=b=e),R=R===e?R:ke(Nt(R),0),P=P===e?P:Nt(P),K-=b?b.length:0,c&B){var Z=y,it=b;y=b=e}var ut=U?e:Df(o),yt=[o,c,h,y,b,Z,it,M,R,P];if(ut&&FB(yt,ut),o=yt[0],c=yt[1],h=yt[2],y=yt[3],b=yt[4],P=yt[9]=yt[9]===e?U?0:o.length:ke(yt[9]-K,0),!P&&c&(I|L)&&(c&=-25),!c||c==C)var Dt=xB(o,c,h);else c==I||c==L?Dt=wB(o,c,P):(c==N||c==(C|N))&&!b.length?Dt=vB(o,c,h,y):Dt=nc.apply(e,yt);var Bt=ut?C0:sb;return ob(Bt(Dt,yt),o,c)}function K0(o,c,h,y){return o===e||Un(o,ms[h])&&!Gt.call(y,h)?c:o}function X0(o,c,h,y,b,M){return fe(o)&&fe(c)&&(M.set(c,o),Ql(o,c,e,X0,M),M.delete(c)),o}function TB(o){return Qo(o)?e:o}function Z0(o,c,h,y,b,M){var R=h&w,P=o.length,U=c.length;if(P!=U&&!(R&&U>P))return!1;var K=M.get(o),Z=M.get(c);if(K&&Z)return K==c&&Z==o;var it=-1,ut=!0,yt=h&v?new kr:e;for(M.set(o,c),M.set(c,o);++it<P;){var Dt=o[it],Bt=c[it];if(y)var St=R?y(Bt,Dt,it,c,o,M):y(Dt,Bt,it,o,c,M);if(St!==e){if(St)continue;ut=!1;break}if(yt){if(!jd(c,function(zt,Ht){if(!Fo(yt,Ht)&&(Dt===zt||b(Dt,zt,h,y,M)))return yt.push(Ht)})){ut=!1;break}}else if(!(Dt===Bt||b(Dt,Bt,h,y,M))){ut=!1;break}}return M.delete(o),M.delete(c),ut}function MB(o,c,h,y,b,M,R){switch(h){case gn:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case Re:return!(o.byteLength!=c.byteLength||!M(new Ul(o),new Ul(c)));case Y:case et:case kt:return Un(+o,+c);case xt:return o.name==c.name&&o.message==c.message;case Ae:case ln:return o==c+"";case Ot:var P=Jd;case oe:var U=y&w;if(P||(P=Il),o.size!=c.size&&!U)return!1;var K=R.get(o);if(K)return K==c;y|=v,R.set(o,c);var Z=Z0(P(o),P(c),y,b,M,R);return R.delete(o),Z;case $t:if($o)return $o.call(o)==$o.call(c)}return!1}function kB(o,c,h,y,b,M){var R=h&w,P=Mf(o),U=P.length,K=Mf(c),Z=K.length;if(U!=Z&&!R)return!1;for(var it=U;it--;){var ut=P[it];if(!(R?ut in c:Gt.call(c,ut)))return!1}var yt=M.get(o),Dt=M.get(c);if(yt&&Dt)return yt==c&&Dt==o;var Bt=!0;M.set(o,c),M.set(c,o);for(var St=R;++it<U;){ut=P[it];var zt=o[ut],Ht=c[ut];if(y)var wn=R?y(Ht,zt,ut,c,o,M):y(zt,Ht,ut,o,c,M);if(!(wn===e?zt===Ht||b(zt,Ht,h,y,M):wn)){Bt=!1;break}St||(St=ut=="constructor")}if(Bt&&!St){var tn=o.constructor,vn=c.constructor;tn!=vn&&"constructor"in o&&"constructor"in c&&!(typeof tn=="function"&&tn instanceof tn&&typeof vn=="function"&&vn instanceof vn)&&(Bt=!1)}return M.delete(o),M.delete(c),Bt}function yi(o){return Pf(ib(o,e,fb),o+"")}function Mf(o){return y0(o,Ee,Of)}function kf(o){return y0(o,fn,Q0)}var Df=ql?function(o){return ql.get(o)}:jf;function oc(o){for(var c=o.name+"",h=_s[c],y=Gt.call(_s,c)?h.length:0;y--;){var b=h[y],M=b.func;if(M==null||M==o)return b.name}return c}function vs(o){var c=Gt.call(S,"placeholder")?S:o;return c.placeholder}function Tt(){var o=S.iteratee||Yf;return o=o===Yf?x0:o,arguments.length?o(arguments[0],arguments[1]):o}function ac(o,c){var h=o.__data__;return IB(c)?h[typeof c=="string"?"string":"hash"]:h.map}function Cf(o){for(var c=Ee(o),h=c.length;h--;){var y=c[h],b=o[y];c[h]=[y,b,eb(b)]}return c}function Or(o,c){var h=BL(o,c);return b0(h)?h:e}function DB(o){var c=Gt.call(o,Tr),h=o[Tr];try{o[Tr]=e;var y=!0}catch{}var b=Fl.call(o);return y&&(c?o[Tr]=h:delete o[Tr]),b}var Of=ef?function(o){return o==null?[]:(o=ne(o),Vi(ef(o),function(c){return r0.call(o,c)}))}:Gf,Q0=ef?function(o){for(var c=[];o;)Yi(c,Of(o)),o=Hl(o);return c}:Gf,Ge=Qe;(nf&&Ge(new nf(new ArrayBuffer(1)))!=gn||Uo&&Ge(new Uo)!=Ot||rf&&Ge(rf.resolve())!=jt||ys&&Ge(new ys)!=oe||Ho&&Ge(new Ho)!=ie)&&(Ge=function(o){var c=Qe(o),h=c==bt?o.constructor:e,y=h?Ar(h):"";if(y)switch(y){case cN:return gn;case uN:return Ot;case dN:return jt;case fN:return oe;case hN:return ie}return c});function CB(o,c,h){for(var y=-1,b=h.length;++y<b;){var M=h[y],R=M.size;switch(M.type){case"drop":o+=R;break;case"dropRight":c-=R;break;case"take":c=je(c,o+R);break;case"takeRight":o=ke(o,c-R);break}}return{start:o,end:c}}function OB(o){var c=o.match(bd);return c?c[1].split(xd):[]}function J0(o,c,h){c=Xi(c,o);for(var y=-1,b=c.length,M=!1;++y<b;){var R=zn(c[y]);if(!(M=o!=null&&h(o,R)))break;o=o[R]}return M||++y!=b?M:(b=o==null?0:o.length,!!b&&pc(b)&&_i(R,b)&&(Pt(o)||Rr(o)))}function AB(o){var c=o.length,h=new o.constructor(c);return c&&typeof o[0]=="string"&&Gt.call(o,"index")&&(h.index=o.index,h.input=o.input),h}function tb(o){return typeof o.constructor=="function"&&!Xo(o)?bs(Hl(o)):{}}function RB(o,c,h){var y=o.constructor;switch(c){case Re:return vf(o);case Y:case et:return new y(+o);case gn:return pB(o,h);case Ui:case Dn:case Ye:case In:case ui:case So:case To:case xr:case di:return N0(o,h);case Ot:return new y;case kt:case ln:return new y(o);case Ae:return gB(o);case oe:return new y;case $t:return mB(o)}}function EB(o,c){var h=c.length;if(!h)return o;var y=h-1;return c[y]=(h>1?"& ":"")+c[y],c=c.join(h>2?", ":" "),o.replace(Ln,`{
|
|
8
8
|
/* [wrapped with `+c+`] */
|
|
9
|
-
`)}function PB(o){return Rt(o)||Er(o)||!!(r0&&o&&o[r0])}function _i(o,c){var h=typeof o;return c=c??it,!!c&&(h=="number"||h!="symbol"&&Vi.test(o))&&o>-1&&o%1==0&&o<c}function Je(o,c,h){if(!fe(h))return!1;var y=typeof c;return(y=="number"?dn(h)&&_i(c,h.length):y=="string"&&c in h)?Un(h[c],o):!1}function Af(o,c){if(Rt(o))return!1;var h=typeof o;return h=="number"||h=="symbol"||h=="boolean"||o==null||xn(o)?!0:fi.test(o)||!gl.test(o)||c!=null&&o in ne(c)}function IB(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function Ef(o){var c=lc(o),h=v[c];if(typeof h!="function"||!(c in Ut.prototype))return!1;if(o===h)return!0;var y=Df(h);return!!y&&o===y[0]}function LB(o){return!!t0&&t0 in o}var NB=Fl?bi:Kf;function Xo(o){var c=o&&o.constructor,h=typeof c=="function"&&c.prototype||gs;return o===h}function tb(o){return o===o&&!fe(o)}function eb(o,c){return function(h){return h==null?!1:h[o]===c&&(c!==e||o in ne(h))}}function BB(o){var c=pc(o,function(y){return h.size===f&&h.clear(),y}),h=c.cache;return c}function FB(o,c){var h=o[1],y=c[1],b=h|y,k=b<(C|A|w),E=y==w&&h==P||y==w&&h==M&&o[7].length<=c[8]||y==(w|M)&&c[7].length<=c[8]&&h==P;if(!(k||E))return o;y&C&&(o[2]=c[2],b|=h&C?0:F);var R=c[3];if(R){var U=o[3];o[3]=U?B0(U,R,c[4]):R,o[4]=U?ji(o[3],g):c[4]}return R=c[5],R&&(U=o[5],o[5]=U?F0(U,R,c[6]):R,o[6]=U?ji(o[5],g):c[6]),R=c[7],R&&(o[7]=R),y&w&&(o[8]=o[8]==null?c[8]:je(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=b,o}function zB(o){var c=[];if(o!=null)for(var h in ne(o))c.push(h);return c}function UB(o){return Ul.call(o)}function nb(o,c,h){return c=ke(c===e?o.length-1:c,0),function(){for(var y=arguments,b=-1,k=ke(y.length-c,0),E=Y(k);++b<k;)E[b]=y[c+b];b=-1;for(var R=Y(c+1);++b<c;)R[b]=y[b];return R[c]=h(E),mn(o,this,R)}}function ib(o,c){return c.length<2?o:Cr(o,En(c,0,-1))}function HB(o,c){for(var h=o.length,y=je(c.length,h),b=un(o);y--;){var k=c[y];o[y]=_i(k,h)?b[k]:e}return o}function Rf(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var rb=ob(D0),Zo=nN||function(o,c){return ce.setTimeout(o,c)},Pf=ob(uB);function sb(o,c,h){var y=c+"";return Pf(o,RB(y,WB(OB(y),h)))}function ob(o){var c=0,h=0;return function(){var y=oN(),b=ut-(y-h);if(h=y,b>0){if(++c>=J)return arguments[0]}else c=0;return o.apply(e,arguments)}}function uc(o,c){var h=-1,y=o.length,b=y-1;for(c=c===e?y:c;++h<c;){var k=gf(h,b),E=o[k];o[k]=o[h],o[h]=E}return o.length=c,o}var ab=BB(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(md,function(h,y,b,k){c.push(b?k.replace(vd,"$1"):y||h)}),c});function zn(o){if(typeof o=="string"||xn(o))return o;var c=o+"";return c=="0"&&1/o==-rt?"-0":c}function Ar(o){if(o!=null){try{return zl.call(o)}catch{}try{return o+""}catch{}}return""}function WB(o,c){return yn(j,function(h){var y="_."+h[0];c&h[1]&&!Il(o,y)&&o.push(y)}),o.sort()}function lb(o){if(o instanceof Ut)return o.clone();var c=new On(o.__wrapped__,o.__chain__);return c.__actions__=un(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function $B(o,c,h){(h?Je(o,c,h):c===e)?c=1:c=ke(Lt(c),0);var y=o==null?0:o.length;if(!y||c<1)return[];for(var b=0,k=0,E=Y(ql(y/c));b<y;)E[k++]=En(o,b,b+=c);return E}function VB(o){for(var c=-1,h=o==null?0:o.length,y=0,b=[];++c<h;){var k=o[c];k&&(b[y++]=k)}return b}function YB(){var o=arguments.length;if(!o)return[];for(var c=Y(o-1),h=arguments[0],y=o;y--;)c[y-1]=arguments[y];return qi(Rt(h)?un(h):[h],Fe(c,1))}var qB=Bt(function(o,c){return _e(o)?Yo(o,Fe(c,1,_e,!0)):[]}),jB=Bt(function(o,c){var h=Rn(c);return _e(h)&&(h=e),_e(o)?Yo(o,Fe(c,1,_e,!0),St(h,2)):[]}),GB=Bt(function(o,c){var h=Rn(c);return _e(h)&&(h=e),_e(o)?Yo(o,Fe(c,1,_e,!0),e,h):[]});function KB(o,c,h){var y=o==null?0:o.length;return y?(c=h||c===e?1:Lt(c),En(o,c<0?0:c,y)):[]}function XB(o,c,h){var y=o==null?0:o.length;return y?(c=h||c===e?1:Lt(c),c=y-c,En(o,0,c<0?0:c)):[]}function ZB(o,c){return o&&o.length?nc(o,St(c,3),!0,!0):[]}function QB(o,c){return o&&o.length?nc(o,St(c,3),!0):[]}function JB(o,c,h,y){var b=o==null?0:o.length;return b?(h&&typeof h!="number"&&Je(o,c,h)&&(h=0,y=b),YN(o,c,h,y)):[]}function cb(o,c,h){var y=o==null?0:o.length;if(!y)return-1;var b=h==null?0:Lt(h);return b<0&&(b=ke(y+b,0)),Ll(o,St(c,3),b)}function ub(o,c,h){var y=o==null?0:o.length;if(!y)return-1;var b=y-1;return h!==e&&(b=Lt(h),b=h<0?ke(y+b,0):je(b,y-1)),Ll(o,St(c,3),b,!0)}function db(o){var c=o==null?0:o.length;return c?Fe(o,1):[]}function tF(o){var c=o==null?0:o.length;return c?Fe(o,rt):[]}function eF(o,c){var h=o==null?0:o.length;return h?(c=c===e?1:Lt(c),Fe(o,c)):[]}function nF(o){for(var c=-1,h=o==null?0:o.length,y={};++c<h;){var b=o[c];Xn(y,b[0],b[1])}return y}function fb(o){return o&&o.length?o[0]:e}function iF(o,c,h){var y=o==null?0:o.length;if(!y)return-1;var b=h==null?0:Lt(h);return b<0&&(b=ke(y+b,0)),ds(o,c,b)}function rF(o){var c=o==null?0:o.length;return c?En(o,0,-1):[]}var sF=Bt(function(o){var c=ue(o,xf);return c.length&&c[0]===o[0]?uf(c):[]}),oF=Bt(function(o){var c=Rn(o),h=ue(o,xf);return c===Rn(h)?c=e:h.pop(),h.length&&h[0]===o[0]?uf(h,St(c,2)):[]}),aF=Bt(function(o){var c=Rn(o),h=ue(o,xf);return c=typeof c=="function"?c:e,c&&h.pop(),h.length&&h[0]===o[0]?uf(h,e,c):[]});function lF(o,c){return o==null?"":rN.call(o,c)}function Rn(o){var c=o==null?0:o.length;return c?o[c-1]:e}function cF(o,c,h){var y=o==null?0:o.length;if(!y)return-1;var b=y;return h!==e&&(b=Lt(h),b=b<0?ke(y+b,0):je(b,y-1)),c===c?WL(o,c,b):Ll(o,q_,b,!0)}function uF(o,c){return o&&o.length?S0(o,Lt(c)):e}var dF=Bt(hb);function hb(o,c){return o&&o.length&&c&&c.length?pf(o,c):o}function fF(o,c,h){return o&&o.length&&c&&c.length?pf(o,c,St(h,2)):o}function hF(o,c,h){return o&&o.length&&c&&c.length?pf(o,c,e,h):o}var pF=yi(function(o,c){var h=o==null?0:o.length,y=of(o,c);return k0(o,ue(c,function(b){return _i(b,h)?+b:b}).sort(N0)),y});function gF(o,c){var h=[];if(!(o&&o.length))return h;var y=-1,b=[],k=o.length;for(c=St(c,3);++y<k;){var E=o[y];c(E,y,o)&&(h.push(E),b.push(y))}return k0(o,b),h}function If(o){return o==null?o:lN.call(o)}function mF(o,c,h){var y=o==null?0:o.length;return y?(h&&typeof h!="number"&&Je(o,c,h)?(c=0,h=y):(c=c==null?0:Lt(c),h=h===e?y:Lt(h)),En(o,c,h)):[]}function yF(o,c){return ec(o,c)}function _F(o,c,h){return yf(o,c,St(h,2))}function bF(o,c){var h=o==null?0:o.length;if(h){var y=ec(o,c);if(y<h&&Un(o[y],c))return y}return-1}function xF(o,c){return ec(o,c,!0)}function wF(o,c,h){return yf(o,c,St(h,2),!0)}function vF(o,c){var h=o==null?0:o.length;if(h){var y=ec(o,c,!0)-1;if(Un(o[y],c))return y}return-1}function SF(o){return o&&o.length?C0(o):[]}function TF(o,c){return o&&o.length?C0(o,St(c,2)):[]}function MF(o){var c=o==null?0:o.length;return c?En(o,1,c):[]}function kF(o,c,h){return o&&o.length?(c=h||c===e?1:Lt(c),En(o,0,c<0?0:c)):[]}function DF(o,c,h){var y=o==null?0:o.length;return y?(c=h||c===e?1:Lt(c),c=y-c,En(o,c<0?0:c,y)):[]}function CF(o,c){return o&&o.length?nc(o,St(c,3),!1,!0):[]}function OF(o,c){return o&&o.length?nc(o,St(c,3)):[]}var AF=Bt(function(o){return Xi(Fe(o,1,_e,!0))}),EF=Bt(function(o){var c=Rn(o);return _e(c)&&(c=e),Xi(Fe(o,1,_e,!0),St(c,2))}),RF=Bt(function(o){var c=Rn(o);return c=typeof c=="function"?c:e,Xi(Fe(o,1,_e,!0),e,c)});function PF(o){return o&&o.length?Xi(o):[]}function IF(o,c){return o&&o.length?Xi(o,St(c,2)):[]}function LF(o,c){return c=typeof c=="function"?c:e,o&&o.length?Xi(o,e,c):[]}function Lf(o){if(!(o&&o.length))return[];var c=0;return o=Yi(o,function(h){if(_e(h))return c=ke(h.length,c),!0}),Zd(c,function(h){return ue(o,Gd(h))})}function pb(o,c){if(!(o&&o.length))return[];var h=Lf(o);return c==null?h:ue(h,function(y){return mn(c,e,y)})}var NF=Bt(function(o,c){return _e(o)?Yo(o,c):[]}),BF=Bt(function(o){return bf(Yi(o,_e))}),FF=Bt(function(o){var c=Rn(o);return _e(c)&&(c=e),bf(Yi(o,_e),St(c,2))}),zF=Bt(function(o){var c=Rn(o);return c=typeof c=="function"?c:e,bf(Yi(o,_e),e,c)}),UF=Bt(Lf);function HF(o,c){return R0(o||[],c||[],Vo)}function WF(o,c){return R0(o||[],c||[],Go)}var $F=Bt(function(o){var c=o.length,h=c>1?o[c-1]:e;return h=typeof h=="function"?(o.pop(),h):e,pb(o,h)});function gb(o){var c=v(o);return c.__chain__=!0,c}function VF(o,c){return c(o),o}function dc(o,c){return c(o)}var YF=yi(function(o){var c=o.length,h=c?o[0]:0,y=this.__wrapped__,b=function(k){return of(k,o)};return c>1||this.__actions__.length||!(y instanceof Ut)||!_i(h)?this.thru(b):(y=y.slice(h,+h+(c?1:0)),y.__actions__.push({func:dc,args:[b],thisArg:e}),new On(y,this.__chain__).thru(function(k){return c&&!k.length&&k.push(e),k}))});function qF(){return gb(this)}function jF(){return new On(this.value(),this.__chain__)}function GF(){this.__values__===e&&(this.__values__=Ob(this.value()));var o=this.__index__>=this.__values__.length,c=o?e:this.__values__[this.__index__++];return{done:o,value:c}}function KF(){return this}function XF(o){for(var c,h=this;h instanceof Xl;){var y=lb(h);y.__index__=0,y.__values__=e,c?b.__wrapped__=y:c=y;var b=y;h=h.__wrapped__}return b.__wrapped__=o,c}function ZF(){var o=this.__wrapped__;if(o instanceof Ut){var c=o;return this.__actions__.length&&(c=new Ut(this)),c=c.reverse(),c.__actions__.push({func:dc,args:[If],thisArg:e}),new On(c,this.__chain__)}return this.thru(If)}function QF(){return E0(this.__wrapped__,this.__actions__)}var JF=ic(function(o,c,h){Gt.call(o,h)?++o[h]:Xn(o,h,1)});function tz(o,c,h){var y=Rt(o)?V_:VN;return h&&Je(o,c,h)&&(c=e),y(o,St(c,3))}function ez(o,c){var h=Rt(o)?Yi:p0;return h(o,St(c,3))}var nz=W0(cb),iz=W0(ub);function rz(o,c){return Fe(fc(o,c),1)}function sz(o,c){return Fe(fc(o,c),rt)}function oz(o,c,h){return h=h===e?1:Lt(h),Fe(fc(o,c),h)}function mb(o,c){var h=Rt(o)?yn:Ki;return h(o,St(c,3))}function yb(o,c){var h=Rt(o)?ML:h0;return h(o,St(c,3))}var az=ic(function(o,c,h){Gt.call(o,h)?o[h].push(c):Xn(o,h,[c])});function lz(o,c,h,y){o=dn(o)?o:Ss(o),h=h&&!y?Lt(h):0;var b=o.length;return h<0&&(h=ke(b+h,0)),yc(o)?h<=b&&o.indexOf(c,h)>-1:!!b&&ds(o,c,h)>-1}var cz=Bt(function(o,c,h){var y=-1,b=typeof c=="function",k=dn(o)?Y(o.length):[];return Ki(o,function(E){k[++y]=b?mn(c,E,h):qo(E,c,h)}),k}),uz=ic(function(o,c,h){Xn(o,h,c)});function fc(o,c){var h=Rt(o)?ue:x0;return h(o,St(c,3))}function dz(o,c,h,y){return o==null?[]:(Rt(c)||(c=c==null?[]:[c]),h=y?e:h,Rt(h)||(h=h==null?[]:[h]),T0(o,c,h))}var fz=ic(function(o,c,h){o[h?0:1].push(c)},function(){return[[],[]]});function hz(o,c,h){var y=Rt(o)?qd:G_,b=arguments.length<3;return y(o,St(c,4),h,b,Ki)}function pz(o,c,h){var y=Rt(o)?kL:G_,b=arguments.length<3;return y(o,St(c,4),h,b,h0)}function gz(o,c){var h=Rt(o)?Yi:p0;return h(o,gc(St(c,3)))}function mz(o){var c=Rt(o)?c0:lB;return c(o)}function yz(o,c,h){(h?Je(o,c,h):c===e)?c=1:c=Lt(c);var y=Rt(o)?zN:cB;return y(o,c)}function _z(o){var c=Rt(o)?UN:dB;return c(o)}function bz(o){if(o==null)return 0;if(dn(o))return yc(o)?hs(o):o.length;var c=Ge(o);return c==Ct||c==oe?o.size:ff(o).length}function xz(o,c,h){var y=Rt(o)?jd:fB;return h&&Je(o,c,h)&&(c=e),y(o,St(c,3))}var wz=Bt(function(o,c){if(o==null)return[];var h=c.length;return h>1&&Je(o,c[0],c[1])?c=[]:h>2&&Je(c[0],c[1],c[2])&&(c=[c[0]]),T0(o,Fe(c,1),[])}),hc=eN||function(){return ce.Date.now()};function vz(o,c){if(typeof c!="function")throw new Cn(a);return o=Lt(o),function(){if(--o<1)return c.apply(this,arguments)}}function _b(o,c,h){return c=h?e:c,c=o&&c==null?o.length:c,mi(o,w,e,e,e,e,c)}function bb(o,c){var h;if(typeof c!="function")throw new Cn(a);return o=Lt(o),function(){return--o>0&&(h=c.apply(this,arguments)),o<=1&&(c=e),h}}var Nf=Bt(function(o,c,h){var y=C;if(h.length){var b=ji(h,ws(Nf));y|=L}return mi(o,y,c,h,b)}),xb=Bt(function(o,c,h){var y=C|A;if(h.length){var b=ji(h,ws(xb));y|=L}return mi(c,y,o,h,b)});function wb(o,c,h){c=h?e:c;var y=mi(o,P,e,e,e,e,e,c);return y.placeholder=wb.placeholder,y}function vb(o,c,h){c=h?e:c;var y=mi(o,I,e,e,e,e,e,c);return y.placeholder=vb.placeholder,y}function Sb(o,c,h){var y,b,k,E,R,U,Z=0,Q=!1,et=!1,ct=!0;if(typeof o!="function")throw new Cn(a);c=Pn(c)||0,fe(h)&&(Q=!!h.leading,et="maxWait"in h,k=et?ke(Pn(h.maxWait)||0,c):k,ct="trailing"in h?!!h.trailing:ct);function yt(be){var Hn=y,wi=b;return y=b=e,Z=be,E=o.apply(wi,Hn),E}function Mt(be){return Z=be,R=Zo(Ft,c),Q?yt(be):E}function Nt(be){var Hn=be-U,wi=be-Z,$b=c-Hn;return et?je($b,k-wi):$b}function wt(be){var Hn=be-U,wi=be-Z;return U===e||Hn>=c||Hn<0||et&&wi>=k}function Ft(){var be=hc();if(wt(be))return Ht(be);R=Zo(Ft,Nt(be))}function Ht(be){return R=e,ct&&y?yt(be):(y=b=e,E)}function wn(){R!==e&&P0(R),Z=0,y=U=b=R=e}function tn(){return R===e?E:Ht(hc())}function vn(){var be=hc(),Hn=wt(be);if(y=arguments,b=this,U=be,Hn){if(R===e)return Mt(U);if(et)return P0(R),R=Zo(Ft,c),yt(U)}return R===e&&(R=Zo(Ft,c)),E}return vn.cancel=wn,vn.flush=tn,vn}var Sz=Bt(function(o,c){return f0(o,1,c)}),Tz=Bt(function(o,c,h){return f0(o,Pn(c)||0,h)});function Mz(o){return mi(o,O)}function pc(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new Cn(a);var h=function(){var y=arguments,b=c?c.apply(this,y):y[0],k=h.cache;if(k.has(b))return k.get(b);var E=o.apply(this,y);return h.cache=k.set(b,E)||k,E};return h.cache=new(pc.Cache||gi),h}pc.Cache=gi;function gc(o){if(typeof o!="function")throw new Cn(a);return function(){var c=arguments;switch(c.length){case 0:return!o.call(this);case 1:return!o.call(this,c[0]);case 2:return!o.call(this,c[0],c[1]);case 3:return!o.call(this,c[0],c[1],c[2])}return!o.apply(this,c)}}function kz(o){return bb(2,o)}var Dz=hB(function(o,c){c=c.length==1&&Rt(c[0])?ue(c[0],_n(St())):ue(Fe(c,1),_n(St()));var h=c.length;return Bt(function(y){for(var b=-1,k=je(y.length,h);++b<k;)y[b]=c[b].call(this,y[b]);return mn(o,this,y)})}),Bf=Bt(function(o,c){var h=ji(c,ws(Bf));return mi(o,L,e,c,h)}),Tb=Bt(function(o,c){var h=ji(c,ws(Tb));return mi(o,N,e,c,h)}),Cz=yi(function(o,c){return mi(o,M,e,e,e,c)});function Oz(o,c){if(typeof o!="function")throw new Cn(a);return c=c===e?c:Lt(c),Bt(o,c)}function Az(o,c){if(typeof o!="function")throw new Cn(a);return c=c==null?0:ke(Lt(c),0),Bt(function(h){var y=h[c],b=Qi(h,0,c);return y&&qi(b,y),mn(o,this,b)})}function Ez(o,c,h){var y=!0,b=!0;if(typeof o!="function")throw new Cn(a);return fe(h)&&(y="leading"in h?!!h.leading:y,b="trailing"in h?!!h.trailing:b),Sb(o,c,{leading:y,maxWait:c,trailing:b})}function Rz(o){return _b(o,1)}function Pz(o,c){return Bf(wf(c),o)}function Iz(){if(!arguments.length)return[];var o=arguments[0];return Rt(o)?o:[o]}function Lz(o){return An(o,x)}function Nz(o,c){return c=typeof c=="function"?c:e,An(o,x,c)}function Bz(o){return An(o,m|x)}function Fz(o,c){return c=typeof c=="function"?c:e,An(o,m|x,c)}function zz(o,c){return c==null||d0(o,c,Re(c))}function Un(o,c){return o===c||o!==o&&c!==c}var Uz=ac(cf),Hz=ac(function(o,c){return o>=c}),Er=y0((function(){return arguments})())?y0:function(o){return ge(o)&&Gt.call(o,"callee")&&!i0.call(o,"callee")},Rt=Y.isArray,Wz=F_?_n(F_):XN;function dn(o){return o!=null&&mc(o.length)&&!bi(o)}function _e(o){return ge(o)&&dn(o)}function $z(o){return o===!0||o===!1||ge(o)&&Qe(o)==lt}var Ji=iN||Kf,Vz=z_?_n(z_):ZN;function Yz(o){return ge(o)&&o.nodeType===1&&!Qo(o)}function qz(o){if(o==null)return!0;if(dn(o)&&(Rt(o)||typeof o=="string"||typeof o.splice=="function"||Ji(o)||vs(o)||Er(o)))return!o.length;var c=Ge(o);if(c==Ct||c==oe)return!o.size;if(Xo(o))return!ff(o).length;for(var h in o)if(Gt.call(o,h))return!1;return!0}function jz(o,c){return jo(o,c)}function Gz(o,c,h){h=typeof h=="function"?h:e;var y=h?h(o,c):e;return y===e?jo(o,c,e,h):!!y}function Ff(o){if(!ge(o))return!1;var c=Qe(o);return c==It||c==dt||typeof o.message=="string"&&typeof o.name=="string"&&!Qo(o)}function Kz(o){return typeof o=="number"&&s0(o)}function bi(o){if(!fe(o))return!1;var c=Qe(o);return c==zt||c==vt||c==ot||c==Oe}function Mb(o){return typeof o=="number"&&o==Lt(o)}function mc(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=it}function fe(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function ge(o){return o!=null&&typeof o=="object"}var kb=U_?_n(U_):JN;function Xz(o,c){return o===c||df(o,c,Cf(c))}function Zz(o,c,h){return h=typeof h=="function"?h:e,df(o,c,Cf(c),h)}function Qz(o){return Db(o)&&o!=+o}function Jz(o){if(NB(o))throw new Ot(s);return _0(o)}function tU(o){return o===null}function eU(o){return o==null}function Db(o){return typeof o=="number"||ge(o)&&Qe(o)==Dt}function Qo(o){if(!ge(o)||Qe(o)!=bt)return!1;var c=$l(o);if(c===null)return!0;var h=Gt.call(c,"constructor")&&c.constructor;return typeof h=="function"&&h instanceof h&&zl.call(h)==ZL}var zf=H_?_n(H_):tB;function nU(o){return Mb(o)&&o>=-it&&o<=it}var Cb=W_?_n(W_):eB;function yc(o){return typeof o=="string"||!Rt(o)&&ge(o)&&Qe(o)==ln}function xn(o){return typeof o=="symbol"||ge(o)&&Qe(o)==$t}var vs=$_?_n($_):nB;function iU(o){return o===e}function rU(o){return ge(o)&&Ge(o)==ie}function sU(o){return ge(o)&&Qe(o)==Se}var oU=ac(hf),aU=ac(function(o,c){return o<=c});function Ob(o){if(!o)return[];if(dn(o))return yc(o)?Bn(o):un(o);if(zo&&o[zo])return zL(o[zo]());var c=Ge(o),h=c==Ct?Jd:c==oe?Nl:Ss;return h(o)}function xi(o){if(!o)return o===0?o:0;if(o=Pn(o),o===rt||o===-rt){var c=o<0?-1:1;return c*at}return o===o?o:0}function Lt(o){var c=xi(o),h=c%1;return c===c?h?c-h:c:0}function Ab(o){return o?Dr(Lt(o),0,q):0}function Pn(o){if(typeof o=="number")return o;if(xn(o))return H;if(fe(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=fe(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=K_(o);var h=Td.test(o);return h||kd.test(o)?Nn(o.slice(2),h?2:8):Sd.test(o)?H:+o}function Eb(o){return Qn(o,fn(o))}function lU(o){return o?Dr(Lt(o),-it,it):o===0?o:0}function Kt(o){return o==null?"":bn(o)}var cU=bs(function(o,c){if(Xo(c)||dn(c)){Qn(c,Re(c),o);return}for(var h in c)Gt.call(c,h)&&Vo(o,h,c[h])}),Rb=bs(function(o,c){Qn(c,fn(c),o)}),Pb=bs(function(o,c,h,y){Qn(c,fn(c),o,y)}),Uf=bs(function(o,c,h,y){Qn(c,Re(c),o,y)}),uU=yi(of);function dU(o,c){var h=_s(o);return c==null?h:u0(h,c)}var fU=Bt(function(o,c){o=ne(o);var h=-1,y=c.length,b=y>2?c[2]:e;for(b&&Je(c[0],c[1],b)&&(y=1);++h<y;)for(var k=c[h],E=fn(k),R=-1,U=E.length;++R<U;){var Z=E[R],Q=o[Z];(Q===e||Un(Q,gs[Z])&&!Gt.call(o,Z))&&(o[Z]=k[Z])}return o}),hU=Bt(function(o){return o.push(e,K0),mn(Ib,e,o)});function pU(o,c){return Y_(o,St(c,3),Zn)}function gU(o,c){return Y_(o,St(c,3),lf)}function mU(o,c){return o==null?o:af(o,St(c,3),fn)}function yU(o,c){return o==null?o:g0(o,St(c,3),fn)}function _U(o,c){return o&&Zn(o,St(c,3))}function bU(o,c){return o&&lf(o,St(c,3))}function xU(o){return o==null?[]:Jl(o,Re(o))}function wU(o){return o==null?[]:Jl(o,fn(o))}function Hf(o,c,h){var y=o==null?e:Cr(o,c);return y===e?h:y}function vU(o,c){return o!=null&&Q0(o,c,qN)}function Wf(o,c){return o!=null&&Q0(o,c,jN)}var SU=V0(function(o,c,h){c!=null&&typeof c.toString!="function"&&(c=Ul.call(c)),o[c]=h},Vf(hn)),TU=V0(function(o,c,h){c!=null&&typeof c.toString!="function"&&(c=Ul.call(c)),Gt.call(o,c)?o[c].push(h):o[c]=[h]},St),MU=Bt(qo);function Re(o){return dn(o)?l0(o):ff(o)}function fn(o){return dn(o)?l0(o,!0):iB(o)}function kU(o,c){var h={};return c=St(c,3),Zn(o,function(y,b,k){Xn(h,c(y,b,k),y)}),h}function DU(o,c){var h={};return c=St(c,3),Zn(o,function(y,b,k){Xn(h,b,c(y,b,k))}),h}var CU=bs(function(o,c,h){tc(o,c,h)}),Ib=bs(function(o,c,h,y){tc(o,c,h,y)}),OU=yi(function(o,c){var h={};if(o==null)return h;var y=!1;c=ue(c,function(k){return k=Zi(k,o),y||(y=k.length>1),k}),Qn(o,kf(o),h),y&&(h=An(h,m|_|x,TB));for(var b=c.length;b--;)_f(h,c[b]);return h});function AU(o,c){return Lb(o,gc(St(c)))}var EU=yi(function(o,c){return o==null?{}:sB(o,c)});function Lb(o,c){if(o==null)return{};var h=ue(kf(o),function(y){return[y]});return c=St(c),M0(o,h,function(y,b){return c(y,b[0])})}function RU(o,c,h){c=Zi(c,o);var y=-1,b=c.length;for(b||(b=1,o=e);++y<b;){var k=o==null?e:o[zn(c[y])];k===e&&(y=b,k=h),o=bi(k)?k.call(o):k}return o}function PU(o,c,h){return o==null?o:Go(o,c,h)}function IU(o,c,h,y){return y=typeof y=="function"?y:e,o==null?o:Go(o,c,h,y)}var Nb=j0(Re),Bb=j0(fn);function LU(o,c,h){var y=Rt(o),b=y||Ji(o)||vs(o);if(c=St(c,4),h==null){var k=o&&o.constructor;b?h=y?new k:[]:fe(o)?h=bi(k)?_s($l(o)):{}:h={}}return(b?yn:Zn)(o,function(E,R,U){return c(h,E,R,U)}),h}function NU(o,c){return o==null?!0:_f(o,c)}function BU(o,c,h){return o==null?o:A0(o,c,wf(h))}function FU(o,c,h,y){return y=typeof y=="function"?y:e,o==null?o:A0(o,c,wf(h),y)}function Ss(o){return o==null?[]:Qd(o,Re(o))}function zU(o){return o==null?[]:Qd(o,fn(o))}function UU(o,c,h){return h===e&&(h=c,c=e),h!==e&&(h=Pn(h),h=h===h?h:0),c!==e&&(c=Pn(c),c=c===c?c:0),Dr(Pn(o),c,h)}function HU(o,c,h){return c=xi(c),h===e?(h=c,c=0):h=xi(h),o=Pn(o),GN(o,c,h)}function WU(o,c,h){if(h&&typeof h!="boolean"&&Je(o,c,h)&&(c=h=e),h===e&&(typeof c=="boolean"?(h=c,c=e):typeof o=="boolean"&&(h=o,o=e)),o===e&&c===e?(o=0,c=1):(o=xi(o),c===e?(c=o,o=0):c=xi(c)),o>c){var y=o;o=c,c=y}if(h||o%1||c%1){var b=o0();return je(o+b*(c-o+qe("1e-"+((b+"").length-1))),c)}return gf(o,c)}var $U=xs(function(o,c,h){return c=c.toLowerCase(),o+(h?Fb(c):c)});function Fb(o){return $f(Kt(o).toLowerCase())}function zb(o){return o=Kt(o),o&&o.replace(Dd,IL).replace(Hd,"")}function VU(o,c,h){o=Kt(o),c=bn(c);var y=o.length;h=h===e?y:Dr(Lt(h),0,y);var b=h;return h-=c.length,h>=0&&o.slice(h,b)==c}function YU(o){return o=Kt(o),o&&hd.test(o)?o.replace(pl,LL):o}function qU(o){return o=Kt(o),o&&yd.test(o)?o.replace(Oo,"\\$&"):o}var jU=xs(function(o,c,h){return o+(h?"-":"")+c.toLowerCase()}),GU=xs(function(o,c,h){return o+(h?" ":"")+c.toLowerCase()}),KU=H0("toLowerCase");function XU(o,c,h){o=Kt(o),c=Lt(c);var y=c?hs(o):0;if(!c||y>=c)return o;var b=(c-y)/2;return oc(jl(b),h)+o+oc(ql(b),h)}function ZU(o,c,h){o=Kt(o),c=Lt(c);var y=c?hs(o):0;return c&&y<c?o+oc(c-y,h):o}function QU(o,c,h){o=Kt(o),c=Lt(c);var y=c?hs(o):0;return c&&y<c?oc(c-y,h)+o:o}function JU(o,c,h){return h||c==null?c=0:c&&(c=+c),aN(Kt(o).replace(Ao,""),c||0)}function tH(o,c,h){return(h?Je(o,c,h):c===e)?c=1:c=Lt(c),mf(Kt(o),c)}function eH(){var o=arguments,c=Kt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var nH=xs(function(o,c,h){return o+(h?"_":"")+c.toLowerCase()});function iH(o,c,h){return h&&typeof h!="number"&&Je(o,c,h)&&(c=h=e),h=h===e?q:h>>>0,h?(o=Kt(o),o&&(typeof c=="string"||c!=null&&!zf(c))&&(c=bn(c),!c&&fs(o))?Qi(Bn(o),0,h):o.split(c,h)):[]}var rH=xs(function(o,c,h){return o+(h?" ":"")+$f(c)});function sH(o,c,h){return o=Kt(o),h=h==null?0:Dr(Lt(h),0,o.length),c=bn(c),o.slice(h,h+c.length)==c}function oH(o,c,h){var y=v.templateSettings;h&&Je(o,c,h)&&(c=e),o=Kt(o),c=Uf({},c,y,G0);var b=Uf({},c.imports,y.imports,G0),k=Re(b),E=Qd(b,k);yn(k,function(wt){if(ml.test(wt))throw new Ot(u)});var R,U,Z=0,Q=c.interpolate||ns,et="__p += '",ct=tf((c.escape||ns).source+"|"+Q.source+"|"+(Q===Co?$i:ns).source+"|"+(c.evaluate||ns).source+"|$","g"),yt="//# sourceURL="+(Gt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Vd+"]")+`
|
|
10
|
-
`;o.replace(
|
|
11
|
-
__e(`+
|
|
12
|
-
'`),tn&&(U=!0,
|
|
9
|
+
`)}function PB(o){return Pt(o)||Rr(o)||!!(s0&&o&&o[s0])}function _i(o,c){var h=typeof o;return c=c??nt,!!c&&(h=="number"||h!="symbol"&&$i.test(o))&&o>-1&&o%1==0&&o<c}function Je(o,c,h){if(!fe(h))return!1;var y=typeof c;return(y=="number"?dn(h)&&_i(c,h.length):y=="string"&&c in h)?Un(h[c],o):!1}function Af(o,c){if(Pt(o))return!1;var h=typeof o;return h=="number"||h=="symbol"||h=="boolean"||o==null||xn(o)?!0:fi.test(o)||!hl.test(o)||c!=null&&o in ne(c)}function IB(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function Rf(o){var c=oc(o),h=S[c];if(typeof h!="function"||!(c in Ut.prototype))return!1;if(o===h)return!0;var y=Df(h);return!!y&&o===y[0]}function LB(o){return!!e0&&e0 in o}var NB=Nl?bi:Kf;function Xo(o){var c=o&&o.constructor,h=typeof c=="function"&&c.prototype||ms;return o===h}function eb(o){return o===o&&!fe(o)}function nb(o,c){return function(h){return h==null?!1:h[o]===c&&(c!==e||o in ne(h))}}function BB(o){var c=fc(o,function(y){return h.size===f&&h.clear(),y}),h=c.cache;return c}function FB(o,c){var h=o[1],y=c[1],b=h|y,M=b<(C|A|k),R=y==k&&h==I||y==k&&h==T&&o[7].length<=c[8]||y==(k|T)&&c[7].length<=c[8]&&h==I;if(!(M||R))return o;y&C&&(o[2]=c[2],b|=h&C?0:F);var P=c[3];if(P){var U=o[3];o[3]=U?F0(U,P,c[4]):P,o[4]=U?qi(o[3],g):c[4]}return P=c[5],P&&(U=o[5],o[5]=U?z0(U,P,c[6]):P,o[6]=U?qi(o[5],g):c[6]),P=c[7],P&&(o[7]=P),y&k&&(o[8]=o[8]==null?c[8]:je(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=b,o}function zB(o){var c=[];if(o!=null)for(var h in ne(o))c.push(h);return c}function UB(o){return Fl.call(o)}function ib(o,c,h){return c=ke(c===e?o.length-1:c,0),function(){for(var y=arguments,b=-1,M=ke(y.length-c,0),R=V(M);++b<M;)R[b]=y[c+b];b=-1;for(var P=V(c+1);++b<c;)P[b]=y[b];return P[c]=h(R),mn(o,this,P)}}function rb(o,c){return c.length<2?o:Cr(o,Rn(c,0,-1))}function HB(o,c){for(var h=o.length,y=je(c.length,h),b=un(o);y--;){var M=c[y];o[y]=_i(M,h)?b[M]:e}return o}function Ef(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var sb=ab(C0),Zo=nN||function(o,c){return ce.setTimeout(o,c)},Pf=ab(uB);function ob(o,c,h){var y=c+"";return Pf(o,EB(y,WB(OB(y),h)))}function ab(o){var c=0,h=0;return function(){var y=oN(),b=at-(y-h);if(h=y,b>0){if(++c>=J)return arguments[0]}else c=0;return o.apply(e,arguments)}}function lc(o,c){var h=-1,y=o.length,b=y-1;for(c=c===e?y:c;++h<c;){var M=gf(h,b),R=o[M];o[M]=o[h],o[h]=R}return o.length=c,o}var lb=BB(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(md,function(h,y,b,M){c.push(b?M.replace(vd,"$1"):y||h)}),c});function zn(o){if(typeof o=="string"||xn(o))return o;var c=o+"";return c=="0"&&1/o==-st?"-0":c}function Ar(o){if(o!=null){try{return Bl.call(o)}catch{}try{return o+""}catch{}}return""}function WB(o,c){return yn(dt,function(h){var y="_."+h[0];c&h[1]&&!El(o,y)&&o.push(y)}),o.sort()}function cb(o){if(o instanceof Ut)return o.clone();var c=new On(o.__wrapped__,o.__chain__);return c.__actions__=un(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function $B(o,c,h){(h?Je(o,c,h):c===e)?c=1:c=ke(Nt(c),0);var y=o==null?0:o.length;if(!y||c<1)return[];for(var b=0,M=0,R=V(Vl(y/c));b<y;)R[M++]=Rn(o,b,b+=c);return R}function VB(o){for(var c=-1,h=o==null?0:o.length,y=0,b=[];++c<h;){var M=o[c];M&&(b[y++]=M)}return b}function YB(){var o=arguments.length;if(!o)return[];for(var c=V(o-1),h=arguments[0],y=o;y--;)c[y-1]=arguments[y];return Yi(Pt(h)?un(h):[h],Fe(c,1))}var qB=Ft(function(o,c){return _e(o)?Yo(o,Fe(c,1,_e,!0)):[]}),jB=Ft(function(o,c){var h=En(c);return _e(h)&&(h=e),_e(o)?Yo(o,Fe(c,1,_e,!0),Tt(h,2)):[]}),GB=Ft(function(o,c){var h=En(c);return _e(h)&&(h=e),_e(o)?Yo(o,Fe(c,1,_e,!0),e,h):[]});function KB(o,c,h){var y=o==null?0:o.length;return y?(c=h||c===e?1:Nt(c),Rn(o,c<0?0:c,y)):[]}function XB(o,c,h){var y=o==null?0:o.length;return y?(c=h||c===e?1:Nt(c),c=y-c,Rn(o,0,c<0?0:c)):[]}function ZB(o,c){return o&&o.length?tc(o,Tt(c,3),!0,!0):[]}function QB(o,c){return o&&o.length?tc(o,Tt(c,3),!0):[]}function JB(o,c,h,y){var b=o==null?0:o.length;return b?(h&&typeof h!="number"&&Je(o,c,h)&&(h=0,y=b),YN(o,c,h,y)):[]}function ub(o,c,h){var y=o==null?0:o.length;if(!y)return-1;var b=h==null?0:Nt(h);return b<0&&(b=ke(y+b,0)),Pl(o,Tt(c,3),b)}function db(o,c,h){var y=o==null?0:o.length;if(!y)return-1;var b=y-1;return h!==e&&(b=Nt(h),b=h<0?ke(y+b,0):je(b,y-1)),Pl(o,Tt(c,3),b,!0)}function fb(o){var c=o==null?0:o.length;return c?Fe(o,1):[]}function tF(o){var c=o==null?0:o.length;return c?Fe(o,st):[]}function eF(o,c){var h=o==null?0:o.length;return h?(c=c===e?1:Nt(c),Fe(o,c)):[]}function nF(o){for(var c=-1,h=o==null?0:o.length,y={};++c<h;){var b=o[c];Xn(y,b[0],b[1])}return y}function hb(o){return o&&o.length?o[0]:e}function iF(o,c,h){var y=o==null?0:o.length;if(!y)return-1;var b=h==null?0:Nt(h);return b<0&&(b=ke(y+b,0)),fs(o,c,b)}function rF(o){var c=o==null?0:o.length;return c?Rn(o,0,-1):[]}var sF=Ft(function(o){var c=ue(o,xf);return c.length&&c[0]===o[0]?uf(c):[]}),oF=Ft(function(o){var c=En(o),h=ue(o,xf);return c===En(h)?c=e:h.pop(),h.length&&h[0]===o[0]?uf(h,Tt(c,2)):[]}),aF=Ft(function(o){var c=En(o),h=ue(o,xf);return c=typeof c=="function"?c:e,c&&h.pop(),h.length&&h[0]===o[0]?uf(h,e,c):[]});function lF(o,c){return o==null?"":rN.call(o,c)}function En(o){var c=o==null?0:o.length;return c?o[c-1]:e}function cF(o,c,h){var y=o==null?0:o.length;if(!y)return-1;var b=y;return h!==e&&(b=Nt(h),b=b<0?ke(y+b,0):je(b,y-1)),c===c?WL(o,c,b):Pl(o,j_,b,!0)}function uF(o,c){return o&&o.length?T0(o,Nt(c)):e}var dF=Ft(pb);function pb(o,c){return o&&o.length&&c&&c.length?pf(o,c):o}function fF(o,c,h){return o&&o.length&&c&&c.length?pf(o,c,Tt(h,2)):o}function hF(o,c,h){return o&&o.length&&c&&c.length?pf(o,c,e,h):o}var pF=yi(function(o,c){var h=o==null?0:o.length,y=of(o,c);return D0(o,ue(c,function(b){return _i(b,h)?+b:b}).sort(B0)),y});function gF(o,c){var h=[];if(!(o&&o.length))return h;var y=-1,b=[],M=o.length;for(c=Tt(c,3);++y<M;){var R=o[y];c(R,y,o)&&(h.push(R),b.push(y))}return D0(o,b),h}function If(o){return o==null?o:lN.call(o)}function mF(o,c,h){var y=o==null?0:o.length;return y?(h&&typeof h!="number"&&Je(o,c,h)?(c=0,h=y):(c=c==null?0:Nt(c),h=h===e?y:Nt(h)),Rn(o,c,h)):[]}function yF(o,c){return Jl(o,c)}function _F(o,c,h){return yf(o,c,Tt(h,2))}function bF(o,c){var h=o==null?0:o.length;if(h){var y=Jl(o,c);if(y<h&&Un(o[y],c))return y}return-1}function xF(o,c){return Jl(o,c,!0)}function wF(o,c,h){return yf(o,c,Tt(h,2),!0)}function vF(o,c){var h=o==null?0:o.length;if(h){var y=Jl(o,c,!0)-1;if(Un(o[y],c))return y}return-1}function SF(o){return o&&o.length?O0(o):[]}function TF(o,c){return o&&o.length?O0(o,Tt(c,2)):[]}function MF(o){var c=o==null?0:o.length;return c?Rn(o,1,c):[]}function kF(o,c,h){return o&&o.length?(c=h||c===e?1:Nt(c),Rn(o,0,c<0?0:c)):[]}function DF(o,c,h){var y=o==null?0:o.length;return y?(c=h||c===e?1:Nt(c),c=y-c,Rn(o,c<0?0:c,y)):[]}function CF(o,c){return o&&o.length?tc(o,Tt(c,3),!1,!0):[]}function OF(o,c){return o&&o.length?tc(o,Tt(c,3)):[]}var AF=Ft(function(o){return Ki(Fe(o,1,_e,!0))}),RF=Ft(function(o){var c=En(o);return _e(c)&&(c=e),Ki(Fe(o,1,_e,!0),Tt(c,2))}),EF=Ft(function(o){var c=En(o);return c=typeof c=="function"?c:e,Ki(Fe(o,1,_e,!0),e,c)});function PF(o){return o&&o.length?Ki(o):[]}function IF(o,c){return o&&o.length?Ki(o,Tt(c,2)):[]}function LF(o,c){return c=typeof c=="function"?c:e,o&&o.length?Ki(o,e,c):[]}function Lf(o){if(!(o&&o.length))return[];var c=0;return o=Vi(o,function(h){if(_e(h))return c=ke(h.length,c),!0}),Zd(c,function(h){return ue(o,Gd(h))})}function gb(o,c){if(!(o&&o.length))return[];var h=Lf(o);return c==null?h:ue(h,function(y){return mn(c,e,y)})}var NF=Ft(function(o,c){return _e(o)?Yo(o,c):[]}),BF=Ft(function(o){return bf(Vi(o,_e))}),FF=Ft(function(o){var c=En(o);return _e(c)&&(c=e),bf(Vi(o,_e),Tt(c,2))}),zF=Ft(function(o){var c=En(o);return c=typeof c=="function"?c:e,bf(Vi(o,_e),e,c)}),UF=Ft(Lf);function HF(o,c){return P0(o||[],c||[],Vo)}function WF(o,c){return P0(o||[],c||[],Go)}var $F=Ft(function(o){var c=o.length,h=c>1?o[c-1]:e;return h=typeof h=="function"?(o.pop(),h):e,gb(o,h)});function mb(o){var c=S(o);return c.__chain__=!0,c}function VF(o,c){return c(o),o}function cc(o,c){return c(o)}var YF=yi(function(o){var c=o.length,h=c?o[0]:0,y=this.__wrapped__,b=function(M){return of(M,o)};return c>1||this.__actions__.length||!(y instanceof Ut)||!_i(h)?this.thru(b):(y=y.slice(h,+h+(c?1:0)),y.__actions__.push({func:cc,args:[b],thisArg:e}),new On(y,this.__chain__).thru(function(M){return c&&!M.length&&M.push(e),M}))});function qF(){return mb(this)}function jF(){return new On(this.value(),this.__chain__)}function GF(){this.__values__===e&&(this.__values__=Ab(this.value()));var o=this.__index__>=this.__values__.length,c=o?e:this.__values__[this.__index__++];return{done:o,value:c}}function KF(){return this}function XF(o){for(var c,h=this;h instanceof Gl;){var y=cb(h);y.__index__=0,y.__values__=e,c?b.__wrapped__=y:c=y;var b=y;h=h.__wrapped__}return b.__wrapped__=o,c}function ZF(){var o=this.__wrapped__;if(o instanceof Ut){var c=o;return this.__actions__.length&&(c=new Ut(this)),c=c.reverse(),c.__actions__.push({func:cc,args:[If],thisArg:e}),new On(c,this.__chain__)}return this.thru(If)}function QF(){return E0(this.__wrapped__,this.__actions__)}var JF=ec(function(o,c,h){Gt.call(o,h)?++o[h]:Xn(o,h,1)});function tz(o,c,h){var y=Pt(o)?Y_:VN;return h&&Je(o,c,h)&&(c=e),y(o,Tt(c,3))}function ez(o,c){var h=Pt(o)?Vi:g0;return h(o,Tt(c,3))}var nz=$0(ub),iz=$0(db);function rz(o,c){return Fe(uc(o,c),1)}function sz(o,c){return Fe(uc(o,c),st)}function oz(o,c,h){return h=h===e?1:Nt(h),Fe(uc(o,c),h)}function yb(o,c){var h=Pt(o)?yn:Gi;return h(o,Tt(c,3))}function _b(o,c){var h=Pt(o)?ML:p0;return h(o,Tt(c,3))}var az=ec(function(o,c,h){Gt.call(o,h)?o[h].push(c):Xn(o,h,[c])});function lz(o,c,h,y){o=dn(o)?o:Ts(o),h=h&&!y?Nt(h):0;var b=o.length;return h<0&&(h=ke(b+h,0)),gc(o)?h<=b&&o.indexOf(c,h)>-1:!!b&&fs(o,c,h)>-1}var cz=Ft(function(o,c,h){var y=-1,b=typeof c=="function",M=dn(o)?V(o.length):[];return Gi(o,function(R){M[++y]=b?mn(c,R,h):qo(R,c,h)}),M}),uz=ec(function(o,c,h){Xn(o,h,c)});function uc(o,c){var h=Pt(o)?ue:w0;return h(o,Tt(c,3))}function dz(o,c,h,y){return o==null?[]:(Pt(c)||(c=c==null?[]:[c]),h=y?e:h,Pt(h)||(h=h==null?[]:[h]),M0(o,c,h))}var fz=ec(function(o,c,h){o[h?0:1].push(c)},function(){return[[],[]]});function hz(o,c,h){var y=Pt(o)?qd:K_,b=arguments.length<3;return y(o,Tt(c,4),h,b,Gi)}function pz(o,c,h){var y=Pt(o)?kL:K_,b=arguments.length<3;return y(o,Tt(c,4),h,b,p0)}function gz(o,c){var h=Pt(o)?Vi:g0;return h(o,hc(Tt(c,3)))}function mz(o){var c=Pt(o)?u0:lB;return c(o)}function yz(o,c,h){(h?Je(o,c,h):c===e)?c=1:c=Nt(c);var y=Pt(o)?zN:cB;return y(o,c)}function _z(o){var c=Pt(o)?UN:dB;return c(o)}function bz(o){if(o==null)return 0;if(dn(o))return gc(o)?ps(o):o.length;var c=Ge(o);return c==Ot||c==oe?o.size:ff(o).length}function xz(o,c,h){var y=Pt(o)?jd:fB;return h&&Je(o,c,h)&&(c=e),y(o,Tt(c,3))}var wz=Ft(function(o,c){if(o==null)return[];var h=c.length;return h>1&&Je(o,c[0],c[1])?c=[]:h>2&&Je(c[0],c[1],c[2])&&(c=[c[0]]),M0(o,Fe(c,1),[])}),dc=eN||function(){return ce.Date.now()};function vz(o,c){if(typeof c!="function")throw new Cn(a);return o=Nt(o),function(){if(--o<1)return c.apply(this,arguments)}}function bb(o,c,h){return c=h?e:c,c=o&&c==null?o.length:c,mi(o,k,e,e,e,e,c)}function xb(o,c){var h;if(typeof c!="function")throw new Cn(a);return o=Nt(o),function(){return--o>0&&(h=c.apply(this,arguments)),o<=1&&(c=e),h}}var Nf=Ft(function(o,c,h){var y=C;if(h.length){var b=qi(h,vs(Nf));y|=N}return mi(o,y,c,h,b)}),wb=Ft(function(o,c,h){var y=C|A;if(h.length){var b=qi(h,vs(wb));y|=N}return mi(c,y,o,h,b)});function vb(o,c,h){c=h?e:c;var y=mi(o,I,e,e,e,e,e,c);return y.placeholder=vb.placeholder,y}function Sb(o,c,h){c=h?e:c;var y=mi(o,L,e,e,e,e,e,c);return y.placeholder=Sb.placeholder,y}function Tb(o,c,h){var y,b,M,R,P,U,K=0,Z=!1,it=!1,ut=!0;if(typeof o!="function")throw new Cn(a);c=Pn(c)||0,fe(h)&&(Z=!!h.leading,it="maxWait"in h,M=it?ke(Pn(h.maxWait)||0,c):M,ut="trailing"in h?!!h.trailing:ut);function yt(be){var Hn=y,wi=b;return y=b=e,K=be,R=o.apply(wi,Hn),R}function Dt(be){return K=be,P=Zo(zt,c),Z?yt(be):R}function Bt(be){var Hn=be-U,wi=be-K,Vb=c-Hn;return it?je(Vb,M-wi):Vb}function St(be){var Hn=be-U,wi=be-K;return U===e||Hn>=c||Hn<0||it&&wi>=M}function zt(){var be=dc();if(St(be))return Ht(be);P=Zo(zt,Bt(be))}function Ht(be){return P=e,ut&&y?yt(be):(y=b=e,R)}function wn(){P!==e&&I0(P),K=0,y=U=b=P=e}function tn(){return P===e?R:Ht(dc())}function vn(){var be=dc(),Hn=St(be);if(y=arguments,b=this,U=be,Hn){if(P===e)return Dt(U);if(it)return I0(P),P=Zo(zt,c),yt(U)}return P===e&&(P=Zo(zt,c)),R}return vn.cancel=wn,vn.flush=tn,vn}var Sz=Ft(function(o,c){return h0(o,1,c)}),Tz=Ft(function(o,c,h){return h0(o,Pn(c)||0,h)});function Mz(o){return mi(o,O)}function fc(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new Cn(a);var h=function(){var y=arguments,b=c?c.apply(this,y):y[0],M=h.cache;if(M.has(b))return M.get(b);var R=o.apply(this,y);return h.cache=M.set(b,R)||M,R};return h.cache=new(fc.Cache||gi),h}fc.Cache=gi;function hc(o){if(typeof o!="function")throw new Cn(a);return function(){var c=arguments;switch(c.length){case 0:return!o.call(this);case 1:return!o.call(this,c[0]);case 2:return!o.call(this,c[0],c[1]);case 3:return!o.call(this,c[0],c[1],c[2])}return!o.apply(this,c)}}function kz(o){return xb(2,o)}var Dz=hB(function(o,c){c=c.length==1&&Pt(c[0])?ue(c[0],_n(Tt())):ue(Fe(c,1),_n(Tt()));var h=c.length;return Ft(function(y){for(var b=-1,M=je(y.length,h);++b<M;)y[b]=c[b].call(this,y[b]);return mn(o,this,y)})}),Bf=Ft(function(o,c){var h=qi(c,vs(Bf));return mi(o,N,e,c,h)}),Mb=Ft(function(o,c){var h=qi(c,vs(Mb));return mi(o,B,e,c,h)}),Cz=yi(function(o,c){return mi(o,T,e,e,e,c)});function Oz(o,c){if(typeof o!="function")throw new Cn(a);return c=c===e?c:Nt(c),Ft(o,c)}function Az(o,c){if(typeof o!="function")throw new Cn(a);return c=c==null?0:ke(Nt(c),0),Ft(function(h){var y=h[c],b=Zi(h,0,c);return y&&Yi(b,y),mn(o,this,b)})}function Rz(o,c,h){var y=!0,b=!0;if(typeof o!="function")throw new Cn(a);return fe(h)&&(y="leading"in h?!!h.leading:y,b="trailing"in h?!!h.trailing:b),Tb(o,c,{leading:y,maxWait:c,trailing:b})}function Ez(o){return bb(o,1)}function Pz(o,c){return Bf(wf(c),o)}function Iz(){if(!arguments.length)return[];var o=arguments[0];return Pt(o)?o:[o]}function Lz(o){return An(o,x)}function Nz(o,c){return c=typeof c=="function"?c:e,An(o,x,c)}function Bz(o){return An(o,m|x)}function Fz(o,c){return c=typeof c=="function"?c:e,An(o,m|x,c)}function zz(o,c){return c==null||f0(o,c,Ee(c))}function Un(o,c){return o===c||o!==o&&c!==c}var Uz=sc(cf),Hz=sc(function(o,c){return o>=c}),Rr=_0((function(){return arguments})())?_0:function(o){return ge(o)&&Gt.call(o,"callee")&&!r0.call(o,"callee")},Pt=V.isArray,Wz=z_?_n(z_):XN;function dn(o){return o!=null&&pc(o.length)&&!bi(o)}function _e(o){return ge(o)&&dn(o)}function $z(o){return o===!0||o===!1||ge(o)&&Qe(o)==Y}var Qi=iN||Kf,Vz=U_?_n(U_):ZN;function Yz(o){return ge(o)&&o.nodeType===1&&!Qo(o)}function qz(o){if(o==null)return!0;if(dn(o)&&(Pt(o)||typeof o=="string"||typeof o.splice=="function"||Qi(o)||Ss(o)||Rr(o)))return!o.length;var c=Ge(o);if(c==Ot||c==oe)return!o.size;if(Xo(o))return!ff(o).length;for(var h in o)if(Gt.call(o,h))return!1;return!0}function jz(o,c){return jo(o,c)}function Gz(o,c,h){h=typeof h=="function"?h:e;var y=h?h(o,c):e;return y===e?jo(o,c,e,h):!!y}function Ff(o){if(!ge(o))return!1;var c=Qe(o);return c==xt||c==ot||typeof o.message=="string"&&typeof o.name=="string"&&!Qo(o)}function Kz(o){return typeof o=="number"&&o0(o)}function bi(o){if(!fe(o))return!1;var c=Qe(o);return c==Lt||c==wt||c==ft||c==Oe}function kb(o){return typeof o=="number"&&o==Nt(o)}function pc(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=nt}function fe(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function ge(o){return o!=null&&typeof o=="object"}var Db=H_?_n(H_):JN;function Xz(o,c){return o===c||df(o,c,Cf(c))}function Zz(o,c,h){return h=typeof h=="function"?h:e,df(o,c,Cf(c),h)}function Qz(o){return Cb(o)&&o!=+o}function Jz(o){if(NB(o))throw new At(s);return b0(o)}function tU(o){return o===null}function eU(o){return o==null}function Cb(o){return typeof o=="number"||ge(o)&&Qe(o)==kt}function Qo(o){if(!ge(o)||Qe(o)!=bt)return!1;var c=Hl(o);if(c===null)return!0;var h=Gt.call(c,"constructor")&&c.constructor;return typeof h=="function"&&h instanceof h&&Bl.call(h)==ZL}var zf=W_?_n(W_):tB;function nU(o){return kb(o)&&o>=-nt&&o<=nt}var Ob=$_?_n($_):eB;function gc(o){return typeof o=="string"||!Pt(o)&&ge(o)&&Qe(o)==ln}function xn(o){return typeof o=="symbol"||ge(o)&&Qe(o)==$t}var Ss=V_?_n(V_):nB;function iU(o){return o===e}function rU(o){return ge(o)&&Ge(o)==ie}function sU(o){return ge(o)&&Qe(o)==Se}var oU=sc(hf),aU=sc(function(o,c){return o<=c});function Ab(o){if(!o)return[];if(dn(o))return gc(o)?Bn(o):un(o);if(zo&&o[zo])return zL(o[zo]());var c=Ge(o),h=c==Ot?Jd:c==oe?Il:Ts;return h(o)}function xi(o){if(!o)return o===0?o:0;if(o=Pn(o),o===st||o===-st){var c=o<0?-1:1;return c*ct}return o===o?o:0}function Nt(o){var c=xi(o),h=c%1;return c===c?h?c-h:c:0}function Rb(o){return o?Dr(Nt(o),0,q):0}function Pn(o){if(typeof o=="number")return o;if(xn(o))return H;if(fe(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=fe(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=X_(o);var h=Td.test(o);return h||kd.test(o)?Nn(o.slice(2),h?2:8):Sd.test(o)?H:+o}function Eb(o){return Qn(o,fn(o))}function lU(o){return o?Dr(Nt(o),-nt,nt):o===0?o:0}function Kt(o){return o==null?"":bn(o)}var cU=xs(function(o,c){if(Xo(c)||dn(c)){Qn(c,Ee(c),o);return}for(var h in c)Gt.call(c,h)&&Vo(o,h,c[h])}),Pb=xs(function(o,c){Qn(c,fn(c),o)}),Ib=xs(function(o,c,h,y){Qn(c,fn(c),o,y)}),Uf=xs(function(o,c,h,y){Qn(c,Ee(c),o,y)}),uU=yi(of);function dU(o,c){var h=bs(o);return c==null?h:d0(h,c)}var fU=Ft(function(o,c){o=ne(o);var h=-1,y=c.length,b=y>2?c[2]:e;for(b&&Je(c[0],c[1],b)&&(y=1);++h<y;)for(var M=c[h],R=fn(M),P=-1,U=R.length;++P<U;){var K=R[P],Z=o[K];(Z===e||Un(Z,ms[K])&&!Gt.call(o,K))&&(o[K]=M[K])}return o}),hU=Ft(function(o){return o.push(e,X0),mn(Lb,e,o)});function pU(o,c){return q_(o,Tt(c,3),Zn)}function gU(o,c){return q_(o,Tt(c,3),lf)}function mU(o,c){return o==null?o:af(o,Tt(c,3),fn)}function yU(o,c){return o==null?o:m0(o,Tt(c,3),fn)}function _U(o,c){return o&&Zn(o,Tt(c,3))}function bU(o,c){return o&&lf(o,Tt(c,3))}function xU(o){return o==null?[]:Zl(o,Ee(o))}function wU(o){return o==null?[]:Zl(o,fn(o))}function Hf(o,c,h){var y=o==null?e:Cr(o,c);return y===e?h:y}function vU(o,c){return o!=null&&J0(o,c,qN)}function Wf(o,c){return o!=null&&J0(o,c,jN)}var SU=Y0(function(o,c,h){c!=null&&typeof c.toString!="function"&&(c=Fl.call(c)),o[c]=h},Vf(hn)),TU=Y0(function(o,c,h){c!=null&&typeof c.toString!="function"&&(c=Fl.call(c)),Gt.call(o,c)?o[c].push(h):o[c]=[h]},Tt),MU=Ft(qo);function Ee(o){return dn(o)?c0(o):ff(o)}function fn(o){return dn(o)?c0(o,!0):iB(o)}function kU(o,c){var h={};return c=Tt(c,3),Zn(o,function(y,b,M){Xn(h,c(y,b,M),y)}),h}function DU(o,c){var h={};return c=Tt(c,3),Zn(o,function(y,b,M){Xn(h,b,c(y,b,M))}),h}var CU=xs(function(o,c,h){Ql(o,c,h)}),Lb=xs(function(o,c,h,y){Ql(o,c,h,y)}),OU=yi(function(o,c){var h={};if(o==null)return h;var y=!1;c=ue(c,function(M){return M=Xi(M,o),y||(y=M.length>1),M}),Qn(o,kf(o),h),y&&(h=An(h,m|_|x,TB));for(var b=c.length;b--;)_f(h,c[b]);return h});function AU(o,c){return Nb(o,hc(Tt(c)))}var RU=yi(function(o,c){return o==null?{}:sB(o,c)});function Nb(o,c){if(o==null)return{};var h=ue(kf(o),function(y){return[y]});return c=Tt(c),k0(o,h,function(y,b){return c(y,b[0])})}function EU(o,c,h){c=Xi(c,o);var y=-1,b=c.length;for(b||(b=1,o=e);++y<b;){var M=o==null?e:o[zn(c[y])];M===e&&(y=b,M=h),o=bi(M)?M.call(o):M}return o}function PU(o,c,h){return o==null?o:Go(o,c,h)}function IU(o,c,h,y){return y=typeof y=="function"?y:e,o==null?o:Go(o,c,h,y)}var Bb=G0(Ee),Fb=G0(fn);function LU(o,c,h){var y=Pt(o),b=y||Qi(o)||Ss(o);if(c=Tt(c,4),h==null){var M=o&&o.constructor;b?h=y?new M:[]:fe(o)?h=bi(M)?bs(Hl(o)):{}:h={}}return(b?yn:Zn)(o,function(R,P,U){return c(h,R,P,U)}),h}function NU(o,c){return o==null?!0:_f(o,c)}function BU(o,c,h){return o==null?o:R0(o,c,wf(h))}function FU(o,c,h,y){return y=typeof y=="function"?y:e,o==null?o:R0(o,c,wf(h),y)}function Ts(o){return o==null?[]:Qd(o,Ee(o))}function zU(o){return o==null?[]:Qd(o,fn(o))}function UU(o,c,h){return h===e&&(h=c,c=e),h!==e&&(h=Pn(h),h=h===h?h:0),c!==e&&(c=Pn(c),c=c===c?c:0),Dr(Pn(o),c,h)}function HU(o,c,h){return c=xi(c),h===e?(h=c,c=0):h=xi(h),o=Pn(o),GN(o,c,h)}function WU(o,c,h){if(h&&typeof h!="boolean"&&Je(o,c,h)&&(c=h=e),h===e&&(typeof c=="boolean"?(h=c,c=e):typeof o=="boolean"&&(h=o,o=e)),o===e&&c===e?(o=0,c=1):(o=xi(o),c===e?(c=o,o=0):c=xi(c)),o>c){var y=o;o=c,c=y}if(h||o%1||c%1){var b=a0();return je(o+b*(c-o+qe("1e-"+((b+"").length-1))),c)}return gf(o,c)}var $U=ws(function(o,c,h){return c=c.toLowerCase(),o+(h?zb(c):c)});function zb(o){return $f(Kt(o).toLowerCase())}function Ub(o){return o=Kt(o),o&&o.replace(Dd,IL).replace(Hd,"")}function VU(o,c,h){o=Kt(o),c=bn(c);var y=o.length;h=h===e?y:Dr(Nt(h),0,y);var b=h;return h-=c.length,h>=0&&o.slice(h,b)==c}function YU(o){return o=Kt(o),o&&hd.test(o)?o.replace(fl,LL):o}function qU(o){return o=Kt(o),o&&yd.test(o)?o.replace(Oo,"\\$&"):o}var jU=ws(function(o,c,h){return o+(h?"-":"")+c.toLowerCase()}),GU=ws(function(o,c,h){return o+(h?" ":"")+c.toLowerCase()}),KU=W0("toLowerCase");function XU(o,c,h){o=Kt(o),c=Nt(c);var y=c?ps(o):0;if(!c||y>=c)return o;var b=(c-y)/2;return rc(Yl(b),h)+o+rc(Vl(b),h)}function ZU(o,c,h){o=Kt(o),c=Nt(c);var y=c?ps(o):0;return c&&y<c?o+rc(c-y,h):o}function QU(o,c,h){o=Kt(o),c=Nt(c);var y=c?ps(o):0;return c&&y<c?rc(c-y,h)+o:o}function JU(o,c,h){return h||c==null?c=0:c&&(c=+c),aN(Kt(o).replace(Ao,""),c||0)}function tH(o,c,h){return(h?Je(o,c,h):c===e)?c=1:c=Nt(c),mf(Kt(o),c)}function eH(){var o=arguments,c=Kt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var nH=ws(function(o,c,h){return o+(h?"_":"")+c.toLowerCase()});function iH(o,c,h){return h&&typeof h!="number"&&Je(o,c,h)&&(c=h=e),h=h===e?q:h>>>0,h?(o=Kt(o),o&&(typeof c=="string"||c!=null&&!zf(c))&&(c=bn(c),!c&&hs(o))?Zi(Bn(o),0,h):o.split(c,h)):[]}var rH=ws(function(o,c,h){return o+(h?" ":"")+$f(c)});function sH(o,c,h){return o=Kt(o),h=h==null?0:Dr(Nt(h),0,o.length),c=bn(c),o.slice(h,h+c.length)==c}function oH(o,c,h){var y=S.templateSettings;h&&Je(o,c,h)&&(c=e),o=Kt(o),c=Uf({},c,y,K0);var b=Uf({},c.imports,y.imports,K0),M=Ee(b),R=Qd(b,M);yn(M,function(St){if(pl.test(St))throw new At(u)});var P,U,K=0,Z=c.interpolate||is,it="__p += '",ut=tf((c.escape||is).source+"|"+Z.source+"|"+(Z===Co?Wi:is).source+"|"+(c.evaluate||is).source+"|$","g"),yt="//# sourceURL="+(Gt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Vd+"]")+`
|
|
10
|
+
`;o.replace(ut,function(St,zt,Ht,wn,tn,vn){return Ht||(Ht=wn),it+=o.slice(K,vn).replace(Cd,NL),zt&&(P=!0,it+=`' +
|
|
11
|
+
__e(`+zt+`) +
|
|
12
|
+
'`),tn&&(U=!0,it+=`';
|
|
13
13
|
`+tn+`;
|
|
14
|
-
__p += '`),Ht&&(
|
|
14
|
+
__p += '`),Ht&&(it+=`' +
|
|
15
15
|
((__t = (`+Ht+`)) == null ? '' : __t) +
|
|
16
|
-
'`),
|
|
17
|
-
`;var
|
|
18
|
-
`+
|
|
16
|
+
'`),K=vn+St.length,St}),it+=`';
|
|
17
|
+
`;var Dt=Gt.call(c,"variable")&&c.variable;if(!Dt)it=`with (obj) {
|
|
18
|
+
`+it+`
|
|
19
19
|
}
|
|
20
|
-
`;else if(
|
|
21
|
-
`+(
|
|
22
|
-
`)+"var __t, __p = ''"+(
|
|
20
|
+
`;else if(pl.test(Dt))throw new At(l);it=(U?it.replace(Mo,""):it).replace(ko,"$1").replace(Do,"$1;"),it="function("+(Dt||"obj")+`) {
|
|
21
|
+
`+(Dt?"":`obj || (obj = {});
|
|
22
|
+
`)+"var __t, __p = ''"+(P?", __e = _.escape":"")+(U?`, __j = Array.prototype.join;
|
|
23
23
|
function print() { __p += __j.call(arguments, '') }
|
|
24
24
|
`:`;
|
|
25
|
-
`)+
|
|
26
|
-
}`;var Nt=Hb(function(){return Vt(k,yt+"return "+et).apply(e,E)});if(Nt.source=et,Ff(Nt))throw Nt;return Nt}function aH(o){return Kt(o).toLowerCase()}function lH(o){return Kt(o).toUpperCase()}function cH(o,c,h){if(o=Kt(o),o&&(h||c===e))return K_(o);if(!o||!(c=bn(c)))return o;var y=Bn(o),b=Bn(c),k=X_(y,b),E=Z_(y,b)+1;return Qi(y,k,E).join("")}function uH(o,c,h){if(o=Kt(o),o&&(h||c===e))return o.slice(0,J_(o)+1);if(!o||!(c=bn(c)))return o;var y=Bn(o),b=Z_(y,Bn(c))+1;return Qi(y,0,b).join("")}function dH(o,c,h){if(o=Kt(o),o&&(h||c===e))return o.replace(Ao,"");if(!o||!(c=bn(c)))return o;var y=Bn(o),b=X_(y,Bn(c));return Qi(y,b).join("")}function fH(o,c){var h=B,y=W;if(fe(c)){var b="separator"in c?c.separator:b;h="length"in c?Lt(c.length):h,y="omission"in c?bn(c.omission):y}o=Kt(o);var k=o.length;if(fs(o)){var E=Bn(o);k=E.length}if(h>=k)return o;var R=h-hs(y);if(R<1)return y;var U=E?Qi(E,0,R).join(""):o.slice(0,R);if(b===e)return U+y;if(E&&(R+=U.length-R),zf(b)){if(o.slice(R).search(b)){var Z,Q=U;for(b.global||(b=tf(b.source,Kt(yl.exec(b))+"g")),b.lastIndex=0;Z=b.exec(Q);)var et=Z.index;U=U.slice(0,et===e?R:et)}}else if(o.indexOf(bn(b),R)!=R){var ct=U.lastIndexOf(b);ct>-1&&(U=U.slice(0,ct))}return U+y}function hH(o){return o=Kt(o),o&&fd.test(o)?o.replace(Wi,$L):o}var pH=xs(function(o,c,h){return o+(h?" ":"")+c.toUpperCase()}),$f=H0("toUpperCase");function Ub(o,c,h){return o=Kt(o),c=h?e:c,c===e?FL(o)?qL(o):OL(o):o.match(c)||[]}var Hb=Bt(function(o,c){try{return mn(o,e,c)}catch(h){return Ff(h)?h:new Ot(h)}}),gH=yi(function(o,c){return yn(c,function(h){h=zn(h),Xn(o,h,Nf(o[h],o))}),o});function mH(o){var c=o==null?0:o.length,h=St();return o=c?ue(o,function(y){if(typeof y[1]!="function")throw new Cn(a);return[h(y[0]),y[1]]}):[],Bt(function(y){for(var b=-1;++b<c;){var k=o[b];if(mn(k[0],this,y))return mn(k[1],this,y)}})}function yH(o){return $N(An(o,m))}function Vf(o){return function(){return o}}function _H(o,c){return o==null||o!==o?c:o}var bH=$0(),xH=$0(!0);function hn(o){return o}function Yf(o){return b0(typeof o=="function"?o:An(o,m))}function wH(o){return w0(An(o,m))}function vH(o,c){return v0(o,An(c,m))}var SH=Bt(function(o,c){return function(h){return qo(h,o,c)}}),TH=Bt(function(o,c){return function(h){return qo(o,h,c)}});function qf(o,c,h){var y=Re(c),b=Jl(c,y);h==null&&!(fe(c)&&(b.length||!y.length))&&(h=c,c=o,o=this,b=Jl(c,Re(c)));var k=!(fe(h)&&"chain"in h)||!!h.chain,E=bi(o);return yn(b,function(R){var U=c[R];o[R]=U,E&&(o.prototype[R]=function(){var Z=this.__chain__;if(k||Z){var Q=o(this.__wrapped__),et=Q.__actions__=un(this.__actions__);return et.push({func:U,args:arguments,thisArg:o}),Q.__chain__=Z,Q}return U.apply(o,qi([this.value()],arguments))})}),o}function MH(){return ce._===this&&(ce._=QL),this}function jf(){}function kH(o){return o=Lt(o),Bt(function(c){return S0(c,o)})}var DH=Sf(ue),CH=Sf(V_),OH=Sf(jd);function Wb(o){return Af(o)?Gd(zn(o)):oB(o)}function AH(o){return function(c){return o==null?e:Cr(o,c)}}var EH=Y0(),RH=Y0(!0);function Gf(){return[]}function Kf(){return!1}function PH(){return{}}function IH(){return""}function LH(){return!0}function NH(o,c){if(o=Lt(o),o<1||o>it)return[];var h=q,y=je(o,q);c=St(c),o-=q;for(var b=Zd(y,c);++h<o;)c(h);return b}function BH(o){return Rt(o)?ue(o,zn):xn(o)?[o]:un(ab(Kt(o)))}function FH(o){var c=++XL;return Kt(o)+c}var zH=sc(function(o,c){return o+c},0),UH=Tf("ceil"),HH=sc(function(o,c){return o/c},1),WH=Tf("floor");function $H(o){return o&&o.length?Ql(o,hn,cf):e}function VH(o,c){return o&&o.length?Ql(o,St(c,2),cf):e}function YH(o){return j_(o,hn)}function qH(o,c){return j_(o,St(c,2))}function jH(o){return o&&o.length?Ql(o,hn,hf):e}function GH(o,c){return o&&o.length?Ql(o,St(c,2),hf):e}var KH=sc(function(o,c){return o*c},1),XH=Tf("round"),ZH=sc(function(o,c){return o-c},0);function QH(o){return o&&o.length?Xd(o,hn):0}function JH(o,c){return o&&o.length?Xd(o,St(c,2)):0}return v.after=vz,v.ary=_b,v.assign=cU,v.assignIn=Rb,v.assignInWith=Pb,v.assignWith=Uf,v.at=uU,v.before=bb,v.bind=Nf,v.bindAll=gH,v.bindKey=xb,v.castArray=Iz,v.chain=gb,v.chunk=$B,v.compact=VB,v.concat=YB,v.cond=mH,v.conforms=yH,v.constant=Vf,v.countBy=JF,v.create=dU,v.curry=wb,v.curryRight=vb,v.debounce=Sb,v.defaults=fU,v.defaultsDeep=hU,v.defer=Sz,v.delay=Tz,v.difference=qB,v.differenceBy=jB,v.differenceWith=GB,v.drop=KB,v.dropRight=XB,v.dropRightWhile=ZB,v.dropWhile=QB,v.fill=JB,v.filter=ez,v.flatMap=rz,v.flatMapDeep=sz,v.flatMapDepth=oz,v.flatten=db,v.flattenDeep=tF,v.flattenDepth=eF,v.flip=Mz,v.flow=bH,v.flowRight=xH,v.fromPairs=nF,v.functions=xU,v.functionsIn=wU,v.groupBy=az,v.initial=rF,v.intersection=sF,v.intersectionBy=oF,v.intersectionWith=aF,v.invert=SU,v.invertBy=TU,v.invokeMap=cz,v.iteratee=Yf,v.keyBy=uz,v.keys=Re,v.keysIn=fn,v.map=fc,v.mapKeys=kU,v.mapValues=DU,v.matches=wH,v.matchesProperty=vH,v.memoize=pc,v.merge=CU,v.mergeWith=Ib,v.method=SH,v.methodOf=TH,v.mixin=qf,v.negate=gc,v.nthArg=kH,v.omit=OU,v.omitBy=AU,v.once=kz,v.orderBy=dz,v.over=DH,v.overArgs=Dz,v.overEvery=CH,v.overSome=OH,v.partial=Bf,v.partialRight=Tb,v.partition=fz,v.pick=EU,v.pickBy=Lb,v.property=Wb,v.propertyOf=AH,v.pull=dF,v.pullAll=hb,v.pullAllBy=fF,v.pullAllWith=hF,v.pullAt=pF,v.range=EH,v.rangeRight=RH,v.rearg=Cz,v.reject=gz,v.remove=gF,v.rest=Oz,v.reverse=If,v.sampleSize=yz,v.set=PU,v.setWith=IU,v.shuffle=_z,v.slice=mF,v.sortBy=wz,v.sortedUniq=SF,v.sortedUniqBy=TF,v.split=iH,v.spread=Az,v.tail=MF,v.take=kF,v.takeRight=DF,v.takeRightWhile=CF,v.takeWhile=OF,v.tap=VF,v.throttle=Ez,v.thru=dc,v.toArray=Ob,v.toPairs=Nb,v.toPairsIn=Bb,v.toPath=BH,v.toPlainObject=Eb,v.transform=LU,v.unary=Rz,v.union=AF,v.unionBy=EF,v.unionWith=RF,v.uniq=PF,v.uniqBy=IF,v.uniqWith=LF,v.unset=NU,v.unzip=Lf,v.unzipWith=pb,v.update=BU,v.updateWith=FU,v.values=Ss,v.valuesIn=zU,v.without=NF,v.words=Ub,v.wrap=Pz,v.xor=BF,v.xorBy=FF,v.xorWith=zF,v.zip=UF,v.zipObject=HF,v.zipObjectDeep=WF,v.zipWith=$F,v.entries=Nb,v.entriesIn=Bb,v.extend=Rb,v.extendWith=Pb,qf(v,v),v.add=zH,v.attempt=Hb,v.camelCase=$U,v.capitalize=Fb,v.ceil=UH,v.clamp=UU,v.clone=Lz,v.cloneDeep=Bz,v.cloneDeepWith=Fz,v.cloneWith=Nz,v.conformsTo=zz,v.deburr=zb,v.defaultTo=_H,v.divide=HH,v.endsWith=VU,v.eq=Un,v.escape=YU,v.escapeRegExp=qU,v.every=tz,v.find=nz,v.findIndex=cb,v.findKey=pU,v.findLast=iz,v.findLastIndex=ub,v.findLastKey=gU,v.floor=WH,v.forEach=mb,v.forEachRight=yb,v.forIn=mU,v.forInRight=yU,v.forOwn=_U,v.forOwnRight=bU,v.get=Hf,v.gt=Uz,v.gte=Hz,v.has=vU,v.hasIn=Wf,v.head=fb,v.identity=hn,v.includes=lz,v.indexOf=iF,v.inRange=HU,v.invoke=MU,v.isArguments=Er,v.isArray=Rt,v.isArrayBuffer=Wz,v.isArrayLike=dn,v.isArrayLikeObject=_e,v.isBoolean=$z,v.isBuffer=Ji,v.isDate=Vz,v.isElement=Yz,v.isEmpty=qz,v.isEqual=jz,v.isEqualWith=Gz,v.isError=Ff,v.isFinite=Kz,v.isFunction=bi,v.isInteger=Mb,v.isLength=mc,v.isMap=kb,v.isMatch=Xz,v.isMatchWith=Zz,v.isNaN=Qz,v.isNative=Jz,v.isNil=eU,v.isNull=tU,v.isNumber=Db,v.isObject=fe,v.isObjectLike=ge,v.isPlainObject=Qo,v.isRegExp=zf,v.isSafeInteger=nU,v.isSet=Cb,v.isString=yc,v.isSymbol=xn,v.isTypedArray=vs,v.isUndefined=iU,v.isWeakMap=rU,v.isWeakSet=sU,v.join=lF,v.kebabCase=jU,v.last=Rn,v.lastIndexOf=cF,v.lowerCase=GU,v.lowerFirst=KU,v.lt=oU,v.lte=aU,v.max=$H,v.maxBy=VH,v.mean=YH,v.meanBy=qH,v.min=jH,v.minBy=GH,v.stubArray=Gf,v.stubFalse=Kf,v.stubObject=PH,v.stubString=IH,v.stubTrue=LH,v.multiply=KH,v.nth=uF,v.noConflict=MH,v.noop=jf,v.now=hc,v.pad=XU,v.padEnd=ZU,v.padStart=QU,v.parseInt=JU,v.random=WU,v.reduce=hz,v.reduceRight=pz,v.repeat=tH,v.replace=eH,v.result=RU,v.round=XH,v.runInContext=z,v.sample=mz,v.size=bz,v.snakeCase=nH,v.some=xz,v.sortedIndex=yF,v.sortedIndexBy=_F,v.sortedIndexOf=bF,v.sortedLastIndex=xF,v.sortedLastIndexBy=wF,v.sortedLastIndexOf=vF,v.startCase=rH,v.startsWith=sH,v.subtract=ZH,v.sum=QH,v.sumBy=JH,v.template=oH,v.times=NH,v.toFinite=xi,v.toInteger=Lt,v.toLength=Ab,v.toLower=aH,v.toNumber=Pn,v.toSafeInteger=lU,v.toString=Kt,v.toUpper=lH,v.trim=cH,v.trimEnd=uH,v.trimStart=dH,v.truncate=fH,v.unescape=hH,v.uniqueId=FH,v.upperCase=pH,v.upperFirst=$f,v.each=mb,v.eachRight=yb,v.first=fb,qf(v,(function(){var o={};return Zn(v,function(c,h){Gt.call(v.prototype,h)||(o[h]=c)}),o})(),{chain:!1}),v.VERSION=i,yn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){v[o].placeholder=v}),yn(["drop","take"],function(o,c){Ut.prototype[o]=function(h){h=h===e?1:ke(Lt(h),0);var y=this.__filtered__&&!c?new Ut(this):this.clone();return y.__filtered__?y.__takeCount__=je(h,y.__takeCount__):y.__views__.push({size:je(h,q),type:o+(y.__dir__<0?"Right":"")}),y},Ut.prototype[o+"Right"]=function(h){return this.reverse()[o](h).reverse()}}),yn(["filter","map","takeWhile"],function(o,c){var h=c+1,y=h==ft||h==nt;Ut.prototype[o]=function(b){var k=this.clone();return k.__iteratees__.push({iteratee:St(b,3),type:h}),k.__filtered__=k.__filtered__||y,k}}),yn(["head","last"],function(o,c){var h="take"+(c?"Right":"");Ut.prototype[o]=function(){return this[h](1).value()[0]}}),yn(["initial","tail"],function(o,c){var h="drop"+(c?"":"Right");Ut.prototype[o]=function(){return this.__filtered__?new Ut(this):this[h](1)}}),Ut.prototype.compact=function(){return this.filter(hn)},Ut.prototype.find=function(o){return this.filter(o).head()},Ut.prototype.findLast=function(o){return this.reverse().find(o)},Ut.prototype.invokeMap=Bt(function(o,c){return typeof o=="function"?new Ut(this):this.map(function(h){return qo(h,o,c)})}),Ut.prototype.reject=function(o){return this.filter(gc(St(o)))},Ut.prototype.slice=function(o,c){o=Lt(o);var h=this;return h.__filtered__&&(o>0||c<0)?new Ut(h):(o<0?h=h.takeRight(-o):o&&(h=h.drop(o)),c!==e&&(c=Lt(c),h=c<0?h.dropRight(-c):h.take(c-o)),h)},Ut.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Ut.prototype.toArray=function(){return this.take(q)},Zn(Ut.prototype,function(o,c){var h=/^(?:filter|find|map|reject)|While$/.test(c),y=/^(?:head|last)$/.test(c),b=v[y?"take"+(c=="last"?"Right":""):c],k=y||/^find/.test(c);b&&(v.prototype[c]=function(){var E=this.__wrapped__,R=y?[1]:arguments,U=E instanceof Ut,Z=R[0],Q=U||Rt(E),et=function(Ft){var Ht=b.apply(v,qi([Ft],R));return y&&ct?Ht[0]:Ht};Q&&h&&typeof Z=="function"&&Z.length!=1&&(U=Q=!1);var ct=this.__chain__,yt=!!this.__actions__.length,Mt=k&&!ct,Nt=U&&!yt;if(!k&&Q){E=Nt?E:new Ut(this);var wt=o.apply(E,R);return wt.__actions__.push({func:dc,args:[et],thisArg:e}),new On(wt,ct)}return Mt&&Nt?o.apply(this,R):(wt=this.thru(et),Mt?y?wt.value()[0]:wt.value():wt)})}),yn(["pop","push","shift","sort","splice","unshift"],function(o){var c=Bl[o],h=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",y=/^(?:pop|shift)$/.test(o);v.prototype[o]=function(){var b=arguments;if(y&&!this.__chain__){var k=this.value();return c.apply(Rt(k)?k:[],b)}return this[h](function(E){return c.apply(Rt(E)?E:[],b)})}}),Zn(Ut.prototype,function(o,c){var h=v[c];if(h){var y=h.name+"";Gt.call(ys,y)||(ys[y]=[]),ys[y].push({name:c,func:h})}}),ys[rc(e,A).name]=[{name:"wrapper",func:e}],Ut.prototype.clone=pN,Ut.prototype.reverse=gN,Ut.prototype.value=mN,v.prototype.at=YF,v.prototype.chain=qF,v.prototype.commit=jF,v.prototype.next=GF,v.prototype.plant=XF,v.prototype.reverse=ZF,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=QF,v.prototype.first=v.prototype.head,zo&&(v.prototype[zo]=KF),v}),ps=jL();Kn?((Kn.exports=ps)._=ps,us._=ps):ce._=ps}).call(cL)})(vo,vo.exports)),vo.exports}var I_=uL(),fl={exports:{}},dL=fl.exports,L_;function fL(){return L_||(L_=1,(function(n,t){(function(e,i){i()})(dL,function(){function e(d,f){return typeof f>"u"?f={autoBom:!1}:typeof f!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),f={autoBom:!f}),f.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(d.type)?new Blob(["\uFEFF",d],{type:d.type}):d}function i(d,f,g){var m=new XMLHttpRequest;m.open("GET",d),m.responseType="blob",m.onload=function(){u(m.response,f,g)},m.onerror=function(){console.error("could not download file")},m.send()}function r(d){var f=new XMLHttpRequest;f.open("HEAD",d,!1);try{f.send()}catch{}return 200<=f.status&&299>=f.status}function s(d){try{d.dispatchEvent(new MouseEvent("click"))}catch{var f=document.createEvent("MouseEvents");f.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),d.dispatchEvent(f)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Ui=="object"&&Ui.global===Ui?Ui:void 0,l=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!l?function(d,f,g){var m=a.URL||a.webkitURL,_=document.createElement("a");f=f||d.name||"download",_.download=f,_.rel="noopener",typeof d=="string"?(_.href=d,_.origin===location.origin?s(_):r(_.href)?i(d,f,g):s(_,_.target="_blank")):(_.href=m.createObjectURL(d),setTimeout(function(){m.revokeObjectURL(_.href)},4e4),setTimeout(function(){s(_)},0))}:"msSaveOrOpenBlob"in navigator?function(d,f,g){if(f=f||d.name||"download",typeof d!="string")navigator.msSaveOrOpenBlob(e(d,g),f);else if(r(d))i(d,f,g);else{var m=document.createElement("a");m.href=d,m.target="_blank",setTimeout(function(){s(m)})}}:function(d,f,g,m){if(m=m||open("","_blank"),m&&(m.document.title=m.document.body.innerText="downloading..."),typeof d=="string")return i(d,f,g);var _=d.type==="application/octet-stream",x=/constructor/i.test(a.HTMLElement)||a.safari,S=/CriOS\/[\d]+/.test(navigator.userAgent);if((S||_&&x||l)&&typeof FileReader<"u"){var T=new FileReader;T.onloadend=function(){var F=T.result;F=S?F:F.replace(/^data:[^;]*;/,"data:attachment/file;"),m?m.location.href=F:location=F,m=null},T.readAsDataURL(d)}else{var C=a.URL||a.webkitURL,A=C.createObjectURL(d);m?m.location=A:location.href=A,m=null,setTimeout(function(){C.revokeObjectURL(A)},4e4)}});a.saveAs=u.saveAs=u,n.exports=u})})(fl)),fl.exports}var hL=fL(),hl={exports:{}};var pL=hl.exports,N_;function gL(){return N_||(N_=1,(function(n,t){((e,i)=>{n.exports=i()})(pL,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},r=!i.document&&!!i.postMessage,s=i.IS_PAPA_WORKER||!1,a={},l=0,u={};function d(w){return w.charCodeAt(0)===65279?w.slice(1):w}function f(w){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(M){var O=I(M);O.chunkSize=parseInt(O.chunkSize),M.step||M.chunk||(O.chunkSize=null),this._handle=new S(O),(this._handle.streamer=this)._config=O}).call(this,w),this.parseChunk=function(M,O){var B=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<B){let J=this._config.newline;J||(W=this._config.quoteChar||'"',J=this._handle.guessLineEndings(M,W)),M=[...M.split(J).slice(B)].join(J)}this.isFirstChunk&&N(this._config.beforeFirstChunk)&&(W=this._config.beforeFirstChunk(M))!==void 0&&(M=W),this.isFirstChunk=!1,this._halted=!1;var B=this._partialLine+M,W=(this._partialLine="",this._handle.parse(B,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(M=W.meta.cursor,B=(this._finished||(this._partialLine=B.substring(M-this._baseIndex),this._baseIndex=M),W&&W.data&&(this._rowCount+=W.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),s)i.postMessage({results:W,workerId:u.WORKER_ID,finished:B});else if(N(this._config.chunk)&&!O){if(this._config.chunk(W,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=W=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(W.data),this._completeResults.errors=this._completeResults.errors.concat(W.errors),this._completeResults.meta=W.meta),this._completed||!B||!N(this._config.complete)||W&&W.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),B||W&&W.meta.paused||this._nextChunk(),W}this._halted=!0},this._sendError=function(M){N(this._config.error)?this._config.error(M):s&&this._config.error&&i.postMessage({workerId:u.WORKER_ID,error:M,finished:!1})}}function g(w){var M;(w=w||{}).chunkSize||(w.chunkSize=u.RemoteChunkSize),f.call(this,w),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(O){this._input=O,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(M=new XMLHttpRequest,this._config.withCredentials&&(M.withCredentials=this._config.withCredentials),r||(M.onload=L(this._chunkLoaded,this),M.onerror=L(this._chunkError,this)),M.ontimeout=L(this._chunkTimeout,this),M.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadTimeout&&!r&&(M.timeout=this._config.downloadTimeout),this._config.downloadRequestHeaders){var O,B=this._config.downloadRequestHeaders;for(O in B)M.setRequestHeader(O,B[O])}var W;this._config.chunkSize&&(W=this._start+this._config.chunkSize-1,M.setRequestHeader("Range","bytes="+this._start+"-"+W));try{M.send(this._config.downloadRequestBody)}catch(J){this._chunkError(J.message)}r&&M.status===0&&this._chunkError()}},this._chunkLoaded=function(){M.readyState===4&&(M.status<200||400<=M.status?this._chunkError():(this._start+=this._config.chunkSize||M.responseText.length,this._finished=!this._config.chunkSize||this._start>=(O=>(O=O.getResponseHeader("Content-Range"))!==null?parseInt(O.substring(O.lastIndexOf("/")+1)):-1)(M),this.parseChunk(M.responseText)))},this._chunkError=function(O){O=M.statusText||O,this._sendError(new Error(O))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function m(w){(w=w||{}).chunkSize||(w.chunkSize=u.LocalChunkSize),f.call(this,w);var M,O,B=typeof FileReader<"u";this.stream=function(W){this._input=W,O=W.slice||W.webkitSlice||W.mozSlice,B?((M=new FileReader).onload=L(this._chunkLoaded,this),M.onerror=L(this._chunkError,this)):M=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var W=this._input,J=(this._config.chunkSize&&(J=Math.min(this._start+this._config.chunkSize,this._input.size),W=O.call(W,this._start,J)),M.readAsText(W,this._config.encoding));B||this._chunkLoaded({target:{result:J}})},this._chunkLoaded=function(W){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(W.target.result)},this._chunkError=function(){this._sendError(M.error)}}function _(w){var M;f.call(this,w=w||{}),this.stream=function(O){return M=O,this._nextChunk()},this._nextChunk=function(){var O,B;if(!this._finished)return O=this._config.chunkSize,M=O?(B=M.substring(0,O),M.substring(O)):(B=M,""),this._finished=!M,this.parseChunk(B)}}function x(w){f.call(this,w=w||{});var M=[],O=!0,B=!1;this.pause=function(){f.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){f.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(W){this._input=W,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){B&&M.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),M.length?this.parseChunk(M.shift()):O=!0},this._streamData=L(function(W){try{M.push(typeof W=="string"?W:W.toString(this._config.encoding)),O&&(O=!1,this._checkIsFinished(),this.parseChunk(M.shift()))}catch(J){this._streamError(J)}},this),this._streamError=L(function(W){this._streamCleanUp(),this._sendError(W)},this),this._streamEnd=L(function(){this._streamCleanUp(),B=!0,this._streamData("")},this),this._streamCleanUp=L(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function S(w){var M,O,B,W,J=Math.pow(2,53),ut=-J,ft=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,K=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,nt=this,rt=0,it=0,at=!1,H=!1,q=[],X={data:[],errors:[],meta:{}};function _t(ot){return w.skipEmptyLines==="greedy"?ot.join("").trim()==="":ot.length===1&&ot[0].length===0}function j(){if(X&&B&&(st("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),B=!1),w.skipEmptyLines&&(X.data=X.data.filter(function(dt){return!_t(dt)})),V()){let dt=function(It){q.push(It)};if(X)if(Array.isArray(X.data[0])){for(var ot=0;V()&&ot<X.data.length;ot++)X.data[ot].forEach(dt);X.data.splice(0,1)}else X.data.forEach(dt)}function lt(dt,It){for(var zt=w.header?{}:[],vt=0;vt<dt.length;vt++){var Ct=vt,Dt=dt[vt],Dt=((ve,bt)=>(jt=>(w.dynamicTypingFunction&&w.dynamicTyping[jt]===void 0&&(w.dynamicTyping[jt]=w.dynamicTypingFunction(jt)),(w.dynamicTyping[jt]||w.dynamicTyping)===!0))(ve)?bt==="true"||bt==="TRUE"||bt!=="false"&&bt!=="FALSE"&&((jt=>{if(ft.test(jt)&&(jt=parseFloat(jt),ut<jt&&jt<J))return 1})(bt)?parseFloat(bt):K.test(bt)?new Date(bt):bt===""?null:bt):bt)(Ct=w.header?vt>=q.length?"__parsed_extra":q[vt]:Ct,Dt=w.transform?w.transform(Dt,Ct):Dt);Ct==="__parsed_extra"?(zt[Ct]=zt[Ct]||[],zt[Ct].push(Dt)):zt[Ct]=Dt}return w.header&&(vt>q.length?st("FieldMismatch","TooManyFields","Too many fields: expected "+q.length+" fields but parsed "+vt,it+It):vt<q.length&&st("FieldMismatch","TooFewFields","Too few fields: expected "+q.length+" fields but parsed "+vt,it+It)),zt}var pt;X&&(w.header||w.dynamicTyping||w.transform)&&(pt=1,!X.data.length||Array.isArray(X.data[0])?(X.data=X.data.map(lt),pt=X.data.length):X.data=lt(X.data,0),w.header&&X.meta&&(X.meta.fields=q),it+=pt)}function V(){return w.header&&q.length===0}function st(ot,lt,pt,dt){ot={type:ot,code:lt,message:pt},dt!==void 0&&(ot.row=dt),X.errors.push(ot)}N(w.step)&&(W=w.step,w.step=function(ot){X=ot,V()?j():(j(),X.data.length!==0&&(rt+=ot.data.length,w.preview&&rt>w.preview?O.abort():(X.data=X.data[0],W(X,nt))))}),this.parse=function(ot,lt,pt){var dt=w.quoteChar||'"',dt=(w.newline||(w.newline=this.guessLineEndings(ot,dt)),B=!1,w.delimiter?N(w.delimiter)&&(w.delimiter=w.delimiter(ot),X.meta.delimiter=w.delimiter):((dt=((It,zt,vt,Ct,Dt)=>{var ve,bt,jt,Oe;Dt=Dt||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var Ae=0;Ae<Dt.length;Ae++){for(var oe,ln=Dt[Ae],$t=0,Le=0,ie=0,Se=(jt=void 0,new C({comments:Ct,delimiter:ln,newline:zt,preview:10}).parse(It)),Ee=0;Ee<Se.data.length;Ee++)vt&&_t(Se.data[Ee])?ie++:(oe=Se.data[Ee].length,Le+=oe,jt===void 0?jt=oe:0<oe&&($t+=Math.abs(oe-jt),jt=oe));0<Se.data.length&&(Le/=Se.data.length-ie),1.99<Le&&(bt===void 0||$t<bt||$t===bt&&Oe<Le)&&(bt=$t,ve=ln,Oe=Le)}return{successful:!!(w.delimiter=ve),bestDelimiter:ve}})(ot,w.newline,w.skipEmptyLines,w.comments,w.delimitersToGuess)).successful?w.delimiter=dt.bestDelimiter:(B=!0,w.delimiter=u.DefaultDelimiter),X.meta.delimiter=w.delimiter),I(w));return dt.header=V(),w.preview&&w.header&&dt.preview++,M=ot,O=new C(dt),X=O.parse(M,lt,pt),j(),at?{meta:{paused:!0}}:X||{meta:{paused:!1}}},this.paused=function(){return at},this.pause=function(){at=!0,O.abort(),M=N(w.chunk)?"":M.substring(O.getCharIndex())},this.resume=function(){nt.streamer._halted?(at=!1,nt.streamer.parseChunk(M,!0)):setTimeout(nt.resume,3)},this.aborted=function(){return H},this.abort=function(){H=!0,O.abort(),X.meta.aborted=!0,N(w.complete)&&w.complete(X),M=""},this.guessLineEndings=function(It,dt){It=It.substring(0,1048576);var dt=new RegExp(T(dt)+"([^]*?)"+T(dt),"gm"),pt=(It=It.replace(dt,"")).split("\r"),dt=It.split(`
|
|
27
|
-
`),
|
|
28
|
-
`;for(var
|
|
29
|
-
`&&
|
|
30
|
-
`:"\r"}}function
|
|
25
|
+
`)+it+`return __p
|
|
26
|
+
}`;var Bt=Wb(function(){return Vt(M,yt+"return "+it).apply(e,R)});if(Bt.source=it,Ff(Bt))throw Bt;return Bt}function aH(o){return Kt(o).toLowerCase()}function lH(o){return Kt(o).toUpperCase()}function cH(o,c,h){if(o=Kt(o),o&&(h||c===e))return X_(o);if(!o||!(c=bn(c)))return o;var y=Bn(o),b=Bn(c),M=Z_(y,b),R=Q_(y,b)+1;return Zi(y,M,R).join("")}function uH(o,c,h){if(o=Kt(o),o&&(h||c===e))return o.slice(0,t0(o)+1);if(!o||!(c=bn(c)))return o;var y=Bn(o),b=Q_(y,Bn(c))+1;return Zi(y,0,b).join("")}function dH(o,c,h){if(o=Kt(o),o&&(h||c===e))return o.replace(Ao,"");if(!o||!(c=bn(c)))return o;var y=Bn(o),b=Z_(y,Bn(c));return Zi(y,b).join("")}function fH(o,c){var h=E,y=W;if(fe(c)){var b="separator"in c?c.separator:b;h="length"in c?Nt(c.length):h,y="omission"in c?bn(c.omission):y}o=Kt(o);var M=o.length;if(hs(o)){var R=Bn(o);M=R.length}if(h>=M)return o;var P=h-ps(y);if(P<1)return y;var U=R?Zi(R,0,P).join(""):o.slice(0,P);if(b===e)return U+y;if(R&&(P+=U.length-P),zf(b)){if(o.slice(P).search(b)){var K,Z=U;for(b.global||(b=tf(b.source,Kt(gl.exec(b))+"g")),b.lastIndex=0;K=b.exec(Z);)var it=K.index;U=U.slice(0,it===e?P:it)}}else if(o.indexOf(bn(b),P)!=P){var ut=U.lastIndexOf(b);ut>-1&&(U=U.slice(0,ut))}return U+y}function hH(o){return o=Kt(o),o&&fd.test(o)?o.replace(Hi,$L):o}var pH=ws(function(o,c,h){return o+(h?" ":"")+c.toUpperCase()}),$f=W0("toUpperCase");function Hb(o,c,h){return o=Kt(o),c=h?e:c,c===e?FL(o)?qL(o):OL(o):o.match(c)||[]}var Wb=Ft(function(o,c){try{return mn(o,e,c)}catch(h){return Ff(h)?h:new At(h)}}),gH=yi(function(o,c){return yn(c,function(h){h=zn(h),Xn(o,h,Nf(o[h],o))}),o});function mH(o){var c=o==null?0:o.length,h=Tt();return o=c?ue(o,function(y){if(typeof y[1]!="function")throw new Cn(a);return[h(y[0]),y[1]]}):[],Ft(function(y){for(var b=-1;++b<c;){var M=o[b];if(mn(M[0],this,y))return mn(M[1],this,y)}})}function yH(o){return $N(An(o,m))}function Vf(o){return function(){return o}}function _H(o,c){return o==null||o!==o?c:o}var bH=V0(),xH=V0(!0);function hn(o){return o}function Yf(o){return x0(typeof o=="function"?o:An(o,m))}function wH(o){return v0(An(o,m))}function vH(o,c){return S0(o,An(c,m))}var SH=Ft(function(o,c){return function(h){return qo(h,o,c)}}),TH=Ft(function(o,c){return function(h){return qo(o,h,c)}});function qf(o,c,h){var y=Ee(c),b=Zl(c,y);h==null&&!(fe(c)&&(b.length||!y.length))&&(h=c,c=o,o=this,b=Zl(c,Ee(c)));var M=!(fe(h)&&"chain"in h)||!!h.chain,R=bi(o);return yn(b,function(P){var U=c[P];o[P]=U,R&&(o.prototype[P]=function(){var K=this.__chain__;if(M||K){var Z=o(this.__wrapped__),it=Z.__actions__=un(this.__actions__);return it.push({func:U,args:arguments,thisArg:o}),Z.__chain__=K,Z}return U.apply(o,Yi([this.value()],arguments))})}),o}function MH(){return ce._===this&&(ce._=QL),this}function jf(){}function kH(o){return o=Nt(o),Ft(function(c){return T0(c,o)})}var DH=Sf(ue),CH=Sf(Y_),OH=Sf(jd);function $b(o){return Af(o)?Gd(zn(o)):oB(o)}function AH(o){return function(c){return o==null?e:Cr(o,c)}}var RH=q0(),EH=q0(!0);function Gf(){return[]}function Kf(){return!1}function PH(){return{}}function IH(){return""}function LH(){return!0}function NH(o,c){if(o=Nt(o),o<1||o>nt)return[];var h=q,y=je(o,q);c=Tt(c),o-=q;for(var b=Zd(y,c);++h<o;)c(h);return b}function BH(o){return Pt(o)?ue(o,zn):xn(o)?[o]:un(lb(Kt(o)))}function FH(o){var c=++XL;return Kt(o)+c}var zH=ic(function(o,c){return o+c},0),UH=Tf("ceil"),HH=ic(function(o,c){return o/c},1),WH=Tf("floor");function $H(o){return o&&o.length?Xl(o,hn,cf):e}function VH(o,c){return o&&o.length?Xl(o,Tt(c,2),cf):e}function YH(o){return G_(o,hn)}function qH(o,c){return G_(o,Tt(c,2))}function jH(o){return o&&o.length?Xl(o,hn,hf):e}function GH(o,c){return o&&o.length?Xl(o,Tt(c,2),hf):e}var KH=ic(function(o,c){return o*c},1),XH=Tf("round"),ZH=ic(function(o,c){return o-c},0);function QH(o){return o&&o.length?Xd(o,hn):0}function JH(o,c){return o&&o.length?Xd(o,Tt(c,2)):0}return S.after=vz,S.ary=bb,S.assign=cU,S.assignIn=Pb,S.assignInWith=Ib,S.assignWith=Uf,S.at=uU,S.before=xb,S.bind=Nf,S.bindAll=gH,S.bindKey=wb,S.castArray=Iz,S.chain=mb,S.chunk=$B,S.compact=VB,S.concat=YB,S.cond=mH,S.conforms=yH,S.constant=Vf,S.countBy=JF,S.create=dU,S.curry=vb,S.curryRight=Sb,S.debounce=Tb,S.defaults=fU,S.defaultsDeep=hU,S.defer=Sz,S.delay=Tz,S.difference=qB,S.differenceBy=jB,S.differenceWith=GB,S.drop=KB,S.dropRight=XB,S.dropRightWhile=ZB,S.dropWhile=QB,S.fill=JB,S.filter=ez,S.flatMap=rz,S.flatMapDeep=sz,S.flatMapDepth=oz,S.flatten=fb,S.flattenDeep=tF,S.flattenDepth=eF,S.flip=Mz,S.flow=bH,S.flowRight=xH,S.fromPairs=nF,S.functions=xU,S.functionsIn=wU,S.groupBy=az,S.initial=rF,S.intersection=sF,S.intersectionBy=oF,S.intersectionWith=aF,S.invert=SU,S.invertBy=TU,S.invokeMap=cz,S.iteratee=Yf,S.keyBy=uz,S.keys=Ee,S.keysIn=fn,S.map=uc,S.mapKeys=kU,S.mapValues=DU,S.matches=wH,S.matchesProperty=vH,S.memoize=fc,S.merge=CU,S.mergeWith=Lb,S.method=SH,S.methodOf=TH,S.mixin=qf,S.negate=hc,S.nthArg=kH,S.omit=OU,S.omitBy=AU,S.once=kz,S.orderBy=dz,S.over=DH,S.overArgs=Dz,S.overEvery=CH,S.overSome=OH,S.partial=Bf,S.partialRight=Mb,S.partition=fz,S.pick=RU,S.pickBy=Nb,S.property=$b,S.propertyOf=AH,S.pull=dF,S.pullAll=pb,S.pullAllBy=fF,S.pullAllWith=hF,S.pullAt=pF,S.range=RH,S.rangeRight=EH,S.rearg=Cz,S.reject=gz,S.remove=gF,S.rest=Oz,S.reverse=If,S.sampleSize=yz,S.set=PU,S.setWith=IU,S.shuffle=_z,S.slice=mF,S.sortBy=wz,S.sortedUniq=SF,S.sortedUniqBy=TF,S.split=iH,S.spread=Az,S.tail=MF,S.take=kF,S.takeRight=DF,S.takeRightWhile=CF,S.takeWhile=OF,S.tap=VF,S.throttle=Rz,S.thru=cc,S.toArray=Ab,S.toPairs=Bb,S.toPairsIn=Fb,S.toPath=BH,S.toPlainObject=Eb,S.transform=LU,S.unary=Ez,S.union=AF,S.unionBy=RF,S.unionWith=EF,S.uniq=PF,S.uniqBy=IF,S.uniqWith=LF,S.unset=NU,S.unzip=Lf,S.unzipWith=gb,S.update=BU,S.updateWith=FU,S.values=Ts,S.valuesIn=zU,S.without=NF,S.words=Hb,S.wrap=Pz,S.xor=BF,S.xorBy=FF,S.xorWith=zF,S.zip=UF,S.zipObject=HF,S.zipObjectDeep=WF,S.zipWith=$F,S.entries=Bb,S.entriesIn=Fb,S.extend=Pb,S.extendWith=Ib,qf(S,S),S.add=zH,S.attempt=Wb,S.camelCase=$U,S.capitalize=zb,S.ceil=UH,S.clamp=UU,S.clone=Lz,S.cloneDeep=Bz,S.cloneDeepWith=Fz,S.cloneWith=Nz,S.conformsTo=zz,S.deburr=Ub,S.defaultTo=_H,S.divide=HH,S.endsWith=VU,S.eq=Un,S.escape=YU,S.escapeRegExp=qU,S.every=tz,S.find=nz,S.findIndex=ub,S.findKey=pU,S.findLast=iz,S.findLastIndex=db,S.findLastKey=gU,S.floor=WH,S.forEach=yb,S.forEachRight=_b,S.forIn=mU,S.forInRight=yU,S.forOwn=_U,S.forOwnRight=bU,S.get=Hf,S.gt=Uz,S.gte=Hz,S.has=vU,S.hasIn=Wf,S.head=hb,S.identity=hn,S.includes=lz,S.indexOf=iF,S.inRange=HU,S.invoke=MU,S.isArguments=Rr,S.isArray=Pt,S.isArrayBuffer=Wz,S.isArrayLike=dn,S.isArrayLikeObject=_e,S.isBoolean=$z,S.isBuffer=Qi,S.isDate=Vz,S.isElement=Yz,S.isEmpty=qz,S.isEqual=jz,S.isEqualWith=Gz,S.isError=Ff,S.isFinite=Kz,S.isFunction=bi,S.isInteger=kb,S.isLength=pc,S.isMap=Db,S.isMatch=Xz,S.isMatchWith=Zz,S.isNaN=Qz,S.isNative=Jz,S.isNil=eU,S.isNull=tU,S.isNumber=Cb,S.isObject=fe,S.isObjectLike=ge,S.isPlainObject=Qo,S.isRegExp=zf,S.isSafeInteger=nU,S.isSet=Ob,S.isString=gc,S.isSymbol=xn,S.isTypedArray=Ss,S.isUndefined=iU,S.isWeakMap=rU,S.isWeakSet=sU,S.join=lF,S.kebabCase=jU,S.last=En,S.lastIndexOf=cF,S.lowerCase=GU,S.lowerFirst=KU,S.lt=oU,S.lte=aU,S.max=$H,S.maxBy=VH,S.mean=YH,S.meanBy=qH,S.min=jH,S.minBy=GH,S.stubArray=Gf,S.stubFalse=Kf,S.stubObject=PH,S.stubString=IH,S.stubTrue=LH,S.multiply=KH,S.nth=uF,S.noConflict=MH,S.noop=jf,S.now=dc,S.pad=XU,S.padEnd=ZU,S.padStart=QU,S.parseInt=JU,S.random=WU,S.reduce=hz,S.reduceRight=pz,S.repeat=tH,S.replace=eH,S.result=EU,S.round=XH,S.runInContext=z,S.sample=mz,S.size=bz,S.snakeCase=nH,S.some=xz,S.sortedIndex=yF,S.sortedIndexBy=_F,S.sortedIndexOf=bF,S.sortedLastIndex=xF,S.sortedLastIndexBy=wF,S.sortedLastIndexOf=vF,S.startCase=rH,S.startsWith=sH,S.subtract=ZH,S.sum=QH,S.sumBy=JH,S.template=oH,S.times=NH,S.toFinite=xi,S.toInteger=Nt,S.toLength=Rb,S.toLower=aH,S.toNumber=Pn,S.toSafeInteger=lU,S.toString=Kt,S.toUpper=lH,S.trim=cH,S.trimEnd=uH,S.trimStart=dH,S.truncate=fH,S.unescape=hH,S.uniqueId=FH,S.upperCase=pH,S.upperFirst=$f,S.each=yb,S.eachRight=_b,S.first=hb,qf(S,(function(){var o={};return Zn(S,function(c,h){Gt.call(S.prototype,h)||(o[h]=c)}),o})(),{chain:!1}),S.VERSION=i,yn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){S[o].placeholder=S}),yn(["drop","take"],function(o,c){Ut.prototype[o]=function(h){h=h===e?1:ke(Nt(h),0);var y=this.__filtered__&&!c?new Ut(this):this.clone();return y.__filtered__?y.__takeCount__=je(h,y.__takeCount__):y.__views__.push({size:je(h,q),type:o+(y.__dir__<0?"Right":"")}),y},Ut.prototype[o+"Right"]=function(h){return this.reverse()[o](h).reverse()}}),yn(["filter","map","takeWhile"],function(o,c){var h=c+1,y=h==lt||h==rt;Ut.prototype[o]=function(b){var M=this.clone();return M.__iteratees__.push({iteratee:Tt(b,3),type:h}),M.__filtered__=M.__filtered__||y,M}}),yn(["head","last"],function(o,c){var h="take"+(c?"Right":"");Ut.prototype[o]=function(){return this[h](1).value()[0]}}),yn(["initial","tail"],function(o,c){var h="drop"+(c?"":"Right");Ut.prototype[o]=function(){return this.__filtered__?new Ut(this):this[h](1)}}),Ut.prototype.compact=function(){return this.filter(hn)},Ut.prototype.find=function(o){return this.filter(o).head()},Ut.prototype.findLast=function(o){return this.reverse().find(o)},Ut.prototype.invokeMap=Ft(function(o,c){return typeof o=="function"?new Ut(this):this.map(function(h){return qo(h,o,c)})}),Ut.prototype.reject=function(o){return this.filter(hc(Tt(o)))},Ut.prototype.slice=function(o,c){o=Nt(o);var h=this;return h.__filtered__&&(o>0||c<0)?new Ut(h):(o<0?h=h.takeRight(-o):o&&(h=h.drop(o)),c!==e&&(c=Nt(c),h=c<0?h.dropRight(-c):h.take(c-o)),h)},Ut.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Ut.prototype.toArray=function(){return this.take(q)},Zn(Ut.prototype,function(o,c){var h=/^(?:filter|find|map|reject)|While$/.test(c),y=/^(?:head|last)$/.test(c),b=S[y?"take"+(c=="last"?"Right":""):c],M=y||/^find/.test(c);b&&(S.prototype[c]=function(){var R=this.__wrapped__,P=y?[1]:arguments,U=R instanceof Ut,K=P[0],Z=U||Pt(R),it=function(zt){var Ht=b.apply(S,Yi([zt],P));return y&&ut?Ht[0]:Ht};Z&&h&&typeof K=="function"&&K.length!=1&&(U=Z=!1);var ut=this.__chain__,yt=!!this.__actions__.length,Dt=M&&!ut,Bt=U&&!yt;if(!M&&Z){R=Bt?R:new Ut(this);var St=o.apply(R,P);return St.__actions__.push({func:cc,args:[it],thisArg:e}),new On(St,ut)}return Dt&&Bt?o.apply(this,P):(St=this.thru(it),Dt?y?St.value()[0]:St.value():St)})}),yn(["pop","push","shift","sort","splice","unshift"],function(o){var c=Ll[o],h=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",y=/^(?:pop|shift)$/.test(o);S.prototype[o]=function(){var b=arguments;if(y&&!this.__chain__){var M=this.value();return c.apply(Pt(M)?M:[],b)}return this[h](function(R){return c.apply(Pt(R)?R:[],b)})}}),Zn(Ut.prototype,function(o,c){var h=S[c];if(h){var y=h.name+"";Gt.call(_s,y)||(_s[y]=[]),_s[y].push({name:c,func:h})}}),_s[nc(e,A).name]=[{name:"wrapper",func:e}],Ut.prototype.clone=pN,Ut.prototype.reverse=gN,Ut.prototype.value=mN,S.prototype.at=YF,S.prototype.chain=qF,S.prototype.commit=jF,S.prototype.next=GF,S.prototype.plant=XF,S.prototype.reverse=ZF,S.prototype.toJSON=S.prototype.valueOf=S.prototype.value=QF,S.prototype.first=S.prototype.head,zo&&(S.prototype[zo]=KF),S}),gs=jL();Kn?((Kn.exports=gs)._=gs,ds._=gs):ce._=gs}).call(cL)})(vo,vo.exports)),vo.exports}var L_=uL(),ul={exports:{}},dL=ul.exports,N_;function fL(){return N_||(N_=1,(function(n,t){(function(e,i){i()})(dL,function(){function e(d,f){return typeof f>"u"?f={autoBom:!1}:typeof f!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),f={autoBom:!f}),f.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(d.type)?new Blob(["\uFEFF",d],{type:d.type}):d}function i(d,f,g){var m=new XMLHttpRequest;m.open("GET",d),m.responseType="blob",m.onload=function(){u(m.response,f,g)},m.onerror=function(){console.error("could not download file")},m.send()}function r(d){var f=new XMLHttpRequest;f.open("HEAD",d,!1);try{f.send()}catch{}return 200<=f.status&&299>=f.status}function s(d){try{d.dispatchEvent(new MouseEvent("click"))}catch{var f=document.createEvent("MouseEvents");f.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),d.dispatchEvent(f)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof zi=="object"&&zi.global===zi?zi:void 0,l=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!l?function(d,f,g){var m=a.URL||a.webkitURL,_=document.createElement("a");f=f||d.name||"download",_.download=f,_.rel="noopener",typeof d=="string"?(_.href=d,_.origin===location.origin?s(_):r(_.href)?i(d,f,g):s(_,_.target="_blank")):(_.href=m.createObjectURL(d),setTimeout(function(){m.revokeObjectURL(_.href)},4e4),setTimeout(function(){s(_)},0))}:"msSaveOrOpenBlob"in navigator?function(d,f,g){if(f=f||d.name||"download",typeof d!="string")navigator.msSaveOrOpenBlob(e(d,g),f);else if(r(d))i(d,f,g);else{var m=document.createElement("a");m.href=d,m.target="_blank",setTimeout(function(){s(m)})}}:function(d,f,g,m){if(m=m||open("","_blank"),m&&(m.document.title=m.document.body.innerText="downloading..."),typeof d=="string")return i(d,f,g);var _=d.type==="application/octet-stream",x=/constructor/i.test(a.HTMLElement)||a.safari,w=/CriOS\/[\d]+/.test(navigator.userAgent);if((w||_&&x||l)&&typeof FileReader<"u"){var v=new FileReader;v.onloadend=function(){var F=v.result;F=w?F:F.replace(/^data:[^;]*;/,"data:attachment/file;"),m?m.location.href=F:location=F,m=null},v.readAsDataURL(d)}else{var C=a.URL||a.webkitURL,A=C.createObjectURL(d);m?m.location=A:location.href=A,m=null,setTimeout(function(){C.revokeObjectURL(A)},4e4)}});a.saveAs=u.saveAs=u,n.exports=u})})(ul)),ul.exports}var hL=fL(),dl={exports:{}};var pL=dl.exports,B_;function gL(){return B_||(B_=1,(function(n,t){((e,i)=>{n.exports=i()})(pL,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},r=!i.document&&!!i.postMessage,s=i.IS_PAPA_WORKER||!1,a={},l=0,u={};function d(k){return k.charCodeAt(0)===65279?k.slice(1):k}function f(k){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(T){var O=L(T);O.chunkSize=parseInt(O.chunkSize),T.step||T.chunk||(O.chunkSize=null),this._handle=new w(O),(this._handle.streamer=this)._config=O}).call(this,k),this.parseChunk=function(T,O){var E=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<E){let J=this._config.newline;J||(W=this._config.quoteChar||'"',J=this._handle.guessLineEndings(T,W)),T=[...T.split(J).slice(E)].join(J)}this.isFirstChunk&&B(this._config.beforeFirstChunk)&&(W=this._config.beforeFirstChunk(T))!==void 0&&(T=W),this.isFirstChunk=!1,this._halted=!1;var E=this._partialLine+T,W=(this._partialLine="",this._handle.parse(E,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(T=W.meta.cursor,E=(this._finished||(this._partialLine=E.substring(T-this._baseIndex),this._baseIndex=T),W&&W.data&&(this._rowCount+=W.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),s)i.postMessage({results:W,workerId:u.WORKER_ID,finished:E});else if(B(this._config.chunk)&&!O){if(this._config.chunk(W,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=W=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(W.data),this._completeResults.errors=this._completeResults.errors.concat(W.errors),this._completeResults.meta=W.meta),this._completed||!E||!B(this._config.complete)||W&&W.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),E||W&&W.meta.paused||this._nextChunk(),W}this._halted=!0},this._sendError=function(T){B(this._config.error)?this._config.error(T):s&&this._config.error&&i.postMessage({workerId:u.WORKER_ID,error:T,finished:!1})}}function g(k){var T;(k=k||{}).chunkSize||(k.chunkSize=u.RemoteChunkSize),f.call(this,k),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(O){this._input=O,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(T=new XMLHttpRequest,this._config.withCredentials&&(T.withCredentials=this._config.withCredentials),r||(T.onload=N(this._chunkLoaded,this),T.onerror=N(this._chunkError,this)),T.ontimeout=N(this._chunkTimeout,this),T.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadTimeout&&!r&&(T.timeout=this._config.downloadTimeout),this._config.downloadRequestHeaders){var O,E=this._config.downloadRequestHeaders;for(O in E)T.setRequestHeader(O,E[O])}var W;this._config.chunkSize&&(W=this._start+this._config.chunkSize-1,T.setRequestHeader("Range","bytes="+this._start+"-"+W));try{T.send(this._config.downloadRequestBody)}catch(J){this._chunkError(J.message)}r&&T.status===0&&this._chunkError()}},this._chunkLoaded=function(){T.readyState===4&&(T.status<200||400<=T.status?this._chunkError():(this._start+=this._config.chunkSize||T.responseText.length,this._finished=!this._config.chunkSize||this._start>=(O=>(O=O.getResponseHeader("Content-Range"))!==null?parseInt(O.substring(O.lastIndexOf("/")+1)):-1)(T),this.parseChunk(T.responseText)))},this._chunkError=function(O){O=T.statusText||O,this._sendError(new Error(O))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function m(k){(k=k||{}).chunkSize||(k.chunkSize=u.LocalChunkSize),f.call(this,k);var T,O,E=typeof FileReader<"u";this.stream=function(W){this._input=W,O=W.slice||W.webkitSlice||W.mozSlice,E?((T=new FileReader).onload=N(this._chunkLoaded,this),T.onerror=N(this._chunkError,this)):T=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var W=this._input,J=(this._config.chunkSize&&(J=Math.min(this._start+this._config.chunkSize,this._input.size),W=O.call(W,this._start,J)),T.readAsText(W,this._config.encoding));E||this._chunkLoaded({target:{result:J}})},this._chunkLoaded=function(W){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(W.target.result)},this._chunkError=function(){this._sendError(T.error)}}function _(k){var T;f.call(this,k=k||{}),this.stream=function(O){return T=O,this._nextChunk()},this._nextChunk=function(){var O,E;if(!this._finished)return O=this._config.chunkSize,T=O?(E=T.substring(0,O),T.substring(O)):(E=T,""),this._finished=!T,this.parseChunk(E)}}function x(k){f.call(this,k=k||{});var T=[],O=!0,E=!1;this.pause=function(){f.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){f.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(W){this._input=W,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){E&&T.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),T.length?this.parseChunk(T.shift()):O=!0},this._streamData=N(function(W){try{T.push(typeof W=="string"?W:W.toString(this._config.encoding)),O&&(O=!1,this._checkIsFinished(),this.parseChunk(T.shift()))}catch(J){this._streamError(J)}},this),this._streamError=N(function(W){this._streamCleanUp(),this._sendError(W)},this),this._streamEnd=N(function(){this._streamCleanUp(),E=!0,this._streamData("")},this),this._streamCleanUp=N(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function w(k){var T,O,E,W,J=Math.pow(2,53),at=-J,lt=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,G=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,rt=this,st=0,nt=0,ct=!1,H=!1,q=[],X={data:[],errors:[],meta:{}};function _t(ft){return k.skipEmptyLines==="greedy"?ft.join("").trim()==="":ft.length===1&&ft[0].length===0}function dt(){if(X&&E&&(pt("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),E=!1),k.skipEmptyLines&&(X.data=X.data.filter(function(ot){return!_t(ot)})),tt()){let ot=function(xt){q.push(xt)};if(X)if(Array.isArray(X.data[0])){for(var ft=0;tt()&&ft<X.data.length;ft++)X.data[ft].forEach(ot);X.data.splice(0,1)}else X.data.forEach(ot)}function Y(ot,xt){for(var Lt=k.header?{}:[],wt=0;wt<ot.length;wt++){var Ot=wt,kt=ot[wt],kt=((ve,bt)=>(jt=>(k.dynamicTypingFunction&&k.dynamicTyping[jt]===void 0&&(k.dynamicTyping[jt]=k.dynamicTypingFunction(jt)),(k.dynamicTyping[jt]||k.dynamicTyping)===!0))(ve)?bt==="true"||bt==="TRUE"||bt!=="false"&&bt!=="FALSE"&&((jt=>{if(lt.test(jt)&&(jt=parseFloat(jt),at<jt&&jt<J))return 1})(bt)?parseFloat(bt):G.test(bt)?new Date(bt):bt===""?null:bt):bt)(Ot=k.header?wt>=q.length?"__parsed_extra":q[wt]:Ot,kt=k.transform?k.transform(kt,Ot):kt);Ot==="__parsed_extra"?(Lt[Ot]=Lt[Ot]||[],Lt[Ot].push(kt)):Lt[Ot]=kt}return k.header&&(wt>q.length?pt("FieldMismatch","TooManyFields","Too many fields: expected "+q.length+" fields but parsed "+wt,nt+xt):wt<q.length&&pt("FieldMismatch","TooFewFields","Too few fields: expected "+q.length+" fields but parsed "+wt,nt+xt)),Lt}var et;X&&(k.header||k.dynamicTyping||k.transform)&&(et=1,!X.data.length||Array.isArray(X.data[0])?(X.data=X.data.map(Y),et=X.data.length):X.data=Y(X.data,0),k.header&&X.meta&&(X.meta.fields=q),nt+=et)}function tt(){return k.header&&q.length===0}function pt(ft,Y,et,ot){ft={type:ft,code:Y,message:et},ot!==void 0&&(ft.row=ot),X.errors.push(ft)}B(k.step)&&(W=k.step,k.step=function(ft){X=ft,tt()?dt():(dt(),X.data.length!==0&&(st+=ft.data.length,k.preview&&st>k.preview?O.abort():(X.data=X.data[0],W(X,rt))))}),this.parse=function(ft,Y,et){var ot=k.quoteChar||'"',ot=(k.newline||(k.newline=this.guessLineEndings(ft,ot)),E=!1,k.delimiter?B(k.delimiter)&&(k.delimiter=k.delimiter(ft),X.meta.delimiter=k.delimiter):((ot=((xt,Lt,wt,Ot,kt)=>{var ve,bt,jt,Oe;kt=kt||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var Ae=0;Ae<kt.length;Ae++){for(var oe,ln=kt[Ae],$t=0,Le=0,ie=0,Se=(jt=void 0,new C({comments:Ot,delimiter:ln,newline:Lt,preview:10}).parse(xt)),Re=0;Re<Se.data.length;Re++)wt&&_t(Se.data[Re])?ie++:(oe=Se.data[Re].length,Le+=oe,jt===void 0?jt=oe:0<oe&&($t+=Math.abs(oe-jt),jt=oe));0<Se.data.length&&(Le/=Se.data.length-ie),1.99<Le&&(bt===void 0||$t<bt||$t===bt&&Oe<Le)&&(bt=$t,ve=ln,Oe=Le)}return{successful:!!(k.delimiter=ve),bestDelimiter:ve}})(ft,k.newline,k.skipEmptyLines,k.comments,k.delimitersToGuess)).successful?k.delimiter=ot.bestDelimiter:(E=!0,k.delimiter=u.DefaultDelimiter),X.meta.delimiter=k.delimiter),L(k));return ot.header=tt(),k.preview&&k.header&&ot.preview++,T=ft,O=new C(ot),X=O.parse(T,Y,et),dt(),ct?{meta:{paused:!0}}:X||{meta:{paused:!1}}},this.paused=function(){return ct},this.pause=function(){ct=!0,O.abort(),T=B(k.chunk)?"":T.substring(O.getCharIndex())},this.resume=function(){rt.streamer._halted?(ct=!1,rt.streamer.parseChunk(T,!0)):setTimeout(rt.resume,3)},this.aborted=function(){return H},this.abort=function(){H=!0,O.abort(),X.meta.aborted=!0,B(k.complete)&&k.complete(X),T=""},this.guessLineEndings=function(xt,ot){xt=xt.substring(0,1048576);var ot=new RegExp(v(ot)+"([^]*?)"+v(ot),"gm"),et=(xt=xt.replace(ot,"")).split("\r"),ot=xt.split(`
|
|
27
|
+
`),xt=1<ot.length&&ot[0].length<et[0].length;if(et.length===1||xt)return`
|
|
28
|
+
`;for(var Lt=0,wt=0;wt<et.length;wt++)et[wt][0]===`
|
|
29
|
+
`&&Lt++;return Lt>=et.length/2?`\r
|
|
30
|
+
`:"\r"}}function v(k){return k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function C(k){var T=(k=k||{}).delimiter,O=k.newline,E=k.comments,W=k.step,J=k.preview,at=k.fastMode,lt=null,G=!1,rt=k.quoteChar==null?'"':k.quoteChar,st=rt;if(k.escapeChar!==void 0&&(st=k.escapeChar),(typeof T!="string"||-1<u.BAD_DELIMITERS.indexOf(T))&&(T=","),E===T)throw new Error("Comment character same as delimiter");E===!0?E="#":(typeof E!="string"||-1<u.BAD_DELIMITERS.indexOf(E))&&(E=!1),O!==`
|
|
31
31
|
`&&O!=="\r"&&O!==`\r
|
|
32
32
|
`&&(O=`
|
|
33
|
-
`);var
|
|
34
|
-
`,
|
|
35
|
-
`,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!r&&!!i.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=C,u.ParserHandle=
|
|
36
|
-
`+f),i.encoding==="utf-8"&&(f="\uFEFF"+f),e("export-finished",i.filename),!i.testing){const g=new Blob([f],{type:"text/csv;charset="+i.encoding});hL.saveAs(g,i.filename)}};return(f,g)=>(p.openBlock(),p.createElementBlock("div",{id:r.value,"data-testid":"export-csv",onClick:d},[p.renderSlot(f.$slots,"default",{},()=>[p.createTextVNode("Download "+p.toDisplayString(n.filename),1)])],8,yL))}}),bL=p.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=p.computed(()=>Object.keys(t.headers));return(i,r)=>(p.openBlock(),p.createElementBlock("div",null,[p.createVNode(_L,{data:n.rows,fields:e.value,filename:n.filename,labels:n.headers},{default:p.withCtx(()=>[p.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),xL={class:"kong-ui-public-csv-export-modal"},wL={key:0,class:"selected-range"},vL={key:4,class:"text-muted",tag:"span"},
|
|
33
|
+
`);var nt=0,ct=!1;this.parse=function(H,q,X){if(typeof H!="string")throw new Error("Input must be a string");var _t=H.length,dt=T.length,tt=O.length,pt=E.length,ft=B(W),Y=[],et=[],ot=[],xt=nt=0;if(!H)return $t();if(at||at!==!1&&H.indexOf(rt)===-1){for(var Lt=H.split(O),wt=0;wt<Lt.length;wt++){if(ot=Lt[wt],nt+=ot.length,wt!==Lt.length-1)nt+=O.length;else if(X)return $t();if(!E||ot.substring(0,pt)!==E){if(ft){if(Y=[],Oe(ot.split(T)),Le(),ct)return $t()}else Oe(ot.split(T));if(J&&J<=wt)return Y=Y.slice(0,J),$t(!0)}}return $t()}for(var Ot=H.indexOf(T,nt),kt=H.indexOf(O,nt),ve=new RegExp(v(st)+v(rt),"g"),bt=H.indexOf(rt,nt);;)if(H[nt]===rt)for(bt=nt,nt++;;){if((bt=H.indexOf(rt,bt+1))===-1)return X||et.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:Y.length,index:nt}),oe();if(bt===_t-1)return oe(H.substring(nt,bt).replace(ve,rt));if(rt===st&&H[bt+1]===st)bt++;else if(rt===st||bt===0||H[bt-1]!==st){Ot!==-1&&Ot<bt+1&&(Ot=H.indexOf(T,bt+1));var jt=Ae((kt=kt!==-1&&kt<bt+1?H.indexOf(O,bt+1):kt)===-1?Ot:Math.min(Ot,kt));if(H.substr(bt+1+jt,dt)===T){ot.push(H.substring(nt,bt).replace(ve,rt)),H[nt=bt+1+jt+dt]!==rt&&(bt=H.indexOf(rt,nt)),Ot=H.indexOf(T,nt),kt=H.indexOf(O,nt);break}if(jt=Ae(kt),H.substring(bt+1+jt,bt+1+jt+tt)===O){if(ot.push(H.substring(nt,bt).replace(ve,rt)),ln(bt+1+jt+tt),Ot=H.indexOf(T,nt),bt=H.indexOf(rt,nt),ft&&(Le(),ct))return $t();if(J&&Y.length>=J)return $t(!0);break}et.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:Y.length,index:nt}),bt++}}else if(E&&ot.length===0&&H.substring(nt,nt+pt)===E){if(kt===-1)return $t();nt=kt+tt,kt=H.indexOf(O,nt),Ot=H.indexOf(T,nt)}else if(Ot!==-1&&(Ot<kt||kt===-1))ot.push(H.substring(nt,Ot)),nt=Ot+dt,Ot=H.indexOf(T,nt);else{if(kt===-1)break;if(ot.push(H.substring(nt,kt)),ln(kt+tt),ft&&(Le(),ct))return $t();if(J&&Y.length>=J)return $t(!0)}return oe();function Oe(ie){Y.push(ie),xt=nt}function Ae(ie){var Se=0;return Se=ie!==-1&&(ie=H.substring(bt+1,ie))&&ie.trim()===""?ie.length:Se}function oe(ie){return X||(ie===void 0&&(ie=H.substring(nt)),ot.push(ie),nt=_t,Oe(ot),ft&&Le()),$t()}function ln(ie){nt=ie,Oe(ot),ot=[],kt=H.indexOf(O,nt)}function $t(ie){if(k.header&&!q&&Y.length&&!G){var Se=Y[0],Re=Object.create(null),gn=new Set(Se);let Ui=!1;for(let Dn=0;Dn<Se.length;Dn++){let Ye=d(Se[Dn]);if(Re[Ye=B(k.transformHeader)?k.transformHeader(Ye,Dn):Ye]){let In,ui=Re[Ye];for(;In=Ye+"_"+ui,ui++,gn.has(In););gn.add(In),Se[Dn]=In,Re[Ye]++,Ui=!0,(lt=lt===null?{}:lt)[In]=Ye}else Re[Ye]=1,Se[Dn]=Ye;gn.add(Ye)}Ui&&console.warn("Duplicate headers found and renamed."),G=!0}return{data:Y,errors:et,meta:{delimiter:T,linebreak:O,aborted:ct,truncated:!!ie,cursor:xt+(q||0),renamedHeaders:lt}}}function Le(){W($t()),Y=[],et=[]}},this.abort=function(){ct=!0},this.getCharIndex=function(){return nt}}function A(k){var T=k.data,O=a[T.workerId],E=!1;if(T.error)O.userError(T.error,T.file);else if(T.results&&T.results.data){var W={abort:function(){E=!0,F(T.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:I,resume:I};if(B(O.userStep)){for(var J=0;J<T.results.data.length&&(O.userStep({data:T.results.data[J],errors:T.results.errors,meta:T.results.meta},W),!E);J++);delete T.results}else B(O.userChunk)&&(O.userChunk(T.results,W,T.file),delete T.results)}T.finished&&!E&&F(T.workerId,T.results)}function F(k,T){var O=a[k];B(O.userComplete)&&O.userComplete(T),O.terminate(),delete a[k]}function I(){throw new Error("Not implemented.")}function L(k){if(typeof k!="object"||k===null)return k;var T,O=Array.isArray(k)?[]:{};for(T in k)O[T]=L(k[T]);return O}function N(k,T){return function(){k.apply(T,arguments)}}function B(k){return typeof k=="function"}return u.parse=function(k,T){var O=(T=T||{}).dynamicTyping||!1;if(B(O)&&(T.dynamicTypingFunction=O,O={}),T.dynamicTyping=O,T.transform=!!B(T.transform)&&T.transform,T.downloadTimeout!==void 0){var O=parseInt(T.downloadTimeout);if(isNaN(O))throw new Error("Config downloadTimeout value ("+T.downloadTimeout+") not parsable by parseInt(val).");T.downloadTimeout=O}if(!T.worker||!u.WORKERS_SUPPORTED)return O=null,u.NODE_STREAM_INPUT,typeof k=="string"?(k=d(k),O=new(T.download?g:_)(T)):k.readable===!0&&B(k.read)&&B(k.on)?O=new x(T):(i.File&&k instanceof File||k instanceof Object)&&(O=new m(T)),O.stream(k);(O=(()=>{var E;return!!u.WORKERS_SUPPORTED&&(E=(()=>{var W=i.URL||i.webkitURL||null,J=e.toString();return u.BLOB_URL||(u.BLOB_URL=W.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",J,")();"],{type:"text/javascript"})))})(),(E=new i.Worker(E)).onmessage=A,E.id=l++,a[E.id]=E)})()).userStep=T.step,O.userChunk=T.chunk,O.userComplete=T.complete,O.userError=T.error,T.step=B(T.step),T.chunk=B(T.chunk),T.complete=B(T.complete),T.error=B(T.error),delete T.worker,O.postMessage({input:k,config:T,workerId:O.id})},u.unparse=function(k,T){var O=!1,E=!0,W=",",J=`\r
|
|
34
|
+
`,at='"',lt=at+at,G=!1,rt=null,st=!1,nt=((()=>{if(typeof T=="object"){if(typeof T.delimiter!="string"||u.BAD_DELIMITERS.filter(function(q){return T.delimiter.indexOf(q)!==-1}).length||(W=T.delimiter),typeof T.quotes!="boolean"&&typeof T.quotes!="function"&&!Array.isArray(T.quotes)||(O=T.quotes),typeof T.skipEmptyLines!="boolean"&&typeof T.skipEmptyLines!="string"||(G=T.skipEmptyLines),typeof T.newline=="string"&&(J=T.newline),typeof T.quoteChar=="string"&&(at=T.quoteChar,lt=at+at),typeof T.header=="boolean"&&(E=T.header),Array.isArray(T.columns)){if(T.columns.length===0)throw new Error("Option columns is empty");rt=T.columns}T.escapeChar!==void 0&&(lt=T.escapeChar+at),T.escapeFormulae instanceof RegExp?st=T.escapeFormulae:typeof T.escapeFormulae=="boolean"&&T.escapeFormulae&&(st=/^[=+\-@\t\r].*$/)}})(),new RegExp(v(at),"g"));if(typeof k=="string"&&(k=JSON.parse(k)),Array.isArray(k)){if(!k.length||Array.isArray(k[0]))return ct(null,k,G);if(typeof k[0]=="object")return ct(rt||Object.keys(k[0]),k,G)}else if(typeof k=="object")return typeof k.data=="string"&&(k.data=JSON.parse(k.data)),Array.isArray(k.data)&&(k.fields||(k.fields=k.meta&&k.meta.fields||rt),k.fields||(k.fields=Array.isArray(k.data[0])?k.fields:typeof k.data[0]=="object"?Object.keys(k.data[0]):[]),Array.isArray(k.data[0])||typeof k.data[0]=="object"||(k.data=[k.data])),ct(k.fields||[],k.data||[],G);throw new Error("Unable to serialize unrecognized input");function ct(q,X,_t){var dt="",tt=(typeof q=="string"&&(q=JSON.parse(q)),typeof X=="string"&&(X=JSON.parse(X)),Array.isArray(q)&&0<q.length),pt=!Array.isArray(X[0]);if(tt&&E){for(var ft=0;ft<q.length;ft++)0<ft&&(dt+=W),dt+=H(q[ft],ft);0<X.length&&(dt+=J)}for(var Y=0;Y<X.length;Y++){var et=(tt?q:X[Y]).length,ot=!1,xt=tt?Object.keys(X[Y]).length===0:X[Y].length===0;if(_t&&!tt&&(ot=_t==="greedy"?X[Y].join("").trim()==="":X[Y].length===1&&X[Y][0].length===0),_t==="greedy"&&tt){for(var Lt=[],wt=0;wt<et;wt++){var Ot=pt?q[wt]:wt;Lt.push(X[Y][Ot])}ot=Lt.join("").trim()===""}if(!ot){for(var kt=0;kt<et;kt++){0<kt&&!xt&&(dt+=W);var ve=tt&&pt?q[kt]:kt;dt+=H(X[Y][ve],kt)}Y<X.length-1&&(!_t||0<et&&!xt)&&(dt+=J)}}return dt}function H(q,X){var _t,dt,tt;return q==null?"":q.constructor===Date?isNaN(q.getTime())?"":q.toISOString():(tt=!1,st&&typeof q=="string"&&st.test(q)&&(q="'"+q,tt=!0),dt=(_t=q.toString()).replace(nt,lt),(tt=tt||O===!0||typeof O=="function"&&O(q,X)||Array.isArray(O)&&O[X]||((pt,ft)=>{for(var Y=0;Y<ft.length;Y++)if(-1<pt.indexOf(ft[Y]))return!0;return!1})(dt,u.BAD_DELIMITERS)||-1<dt.indexOf(W)||-1<_t.indexOf(at)||dt.charAt(0)===" "||dt.charAt(dt.length-1)===" ")?at+dt+at:dt)}},u.RECORD_SEP="",u.UNIT_SEP="",u.BYTE_ORDER_MARK="\uFEFF",u.BAD_DELIMITERS=["\r",`
|
|
35
|
+
`,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!r&&!!i.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=C,u.ParserHandle=w,u.NetworkStreamer=g,u.FileStreamer=m,u.StringStreamer=_,u.ReadableStreamStreamer=x,s&&(i.onmessage=function(k){k=k.data,u.WORKER_ID===void 0&&k&&(u.WORKER_ID=k.workerId),typeof k.input=="string"?i.postMessage({workerId:u.WORKER_ID,results:u.parse(k.input,k.config),finished:!0}):(i.File&&k.input instanceof File||k.input instanceof Object)&&(k=u.parse(k.input,k.config))&&i.postMessage({workerId:u.WORKER_ID,results:k,finished:!0})}),(g.prototype=Object.create(f.prototype)).constructor=g,(m.prototype=Object.create(f.prototype)).constructor=m,(_.prototype=Object.create(_.prototype)).constructor=_,(x.prototype=Object.create(f.prototype)).constructor=x,u})})(dl)),dl.exports}var mL=gL();const yL=["id"],_L=p.defineComponent({__name:"VueJsonCsv",props:{data:{type:Array,required:!0},fields:{type:Array,required:!1,default:null},labels:{type:Object,required:!1,default:null},filename:{type:String,default:"report-data.csv"},delimiter:{type:String,default:",",required:!1},separatorExcel:{type:Boolean,default:!1},encoding:{type:String,default:"utf-8"},testing:{type:Boolean,required:!1,default:!1}},emits:["export-started","export-finished"],setup(n,{emit:t}){const e=t,i=n,r=p.computed(()=>`export_${new Date().getTime()}`),s=p.computed(()=>{const f=u();return f.length?f:null}),a=()=>{const f=i.labels;if(typeof i.fields!==gr.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof f===gr.Object?g=>L_.mapKeys(g,(m,_)=>f[_]||_):g=>g},l=()=>{const f=i.fields;if(typeof i.fields!==gr.Object&&!Array.isArray(f))throw new Error("Fields needs to be an array of strings.");return Array.isArray(f)?g=>L_.pick(g,f):g=>g},u=()=>{if(typeof i.fields===gr.Undefined&&typeof i.labels===gr.Undefined)return i.data;const f=a(),g=l();return i.data.map(m=>f(g(m)))},d=()=>{if(!s?.value){console.warn("No data to export");return}e("export-started",s.value);let f=mL.unparse(s.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(f="SEP="+i.delimiter+`\r
|
|
36
|
+
`+f),i.encoding==="utf-8"&&(f="\uFEFF"+f),e("export-finished",i.filename),!i.testing){const g=new Blob([f],{type:"text/csv;charset="+i.encoding});hL.saveAs(g,i.filename)}};return(f,g)=>(p.openBlock(),p.createElementBlock("div",{id:r.value,"data-testid":"export-csv",onClick:d},[p.renderSlot(f.$slots,"default",{},()=>[p.createTextVNode("Download "+p.toDisplayString(n.filename),1)])],8,yL))}}),bL=p.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=p.computed(()=>Object.keys(t.headers));return(i,r)=>(p.openBlock(),p.createElementBlock("div",null,[p.createVNode(_L,{data:n.rows,fields:e.value,filename:n.filename,labels:n.headers},{default:p.withCtx(()=>[p.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),xL={class:"kong-ui-public-csv-export-modal"},wL={key:0,class:"selected-range"},vL={key:4,class:"text-muted",tag:"span"},F_=3,SL=p.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(n,{emit:t}){const{i18n:e}=Mt.useI18n(),i=n,r=t,s=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,a=p.ref(1),l=p.computed(()=>m.value.rows.length),u=p.computed(()=>i.exportState.status==="success"&&!!i.exportState.chartData?.data?.length),d=p.computed(()=>i.exportState.status!=="success"?"":Mt.useChartSelectedRange(p.toRef(i.exportState,"chartData"))),f=p.computed(()=>i.exportState.status!=="success"?"":e.t("csvExport.previewRows",{rowsMax:Math.min(F_,l.value),rowsTotal:l.value,plural:l.value===1?"":"s"})),g=()=>{r("closeModal")},m=p.computed(()=>{if(i.exportState.status!=="success"||!u.value||!i.exportState.chartData?.meta.metric_names)return{headers:[],rows:[],csvHeaders:{}};const x=i.exportState.chartData,w=x.data.some(L=>L.timestamp!==x.data[0].timestamp),v=x.data.map(L=>{const N=new Date(L.timestamp);return{...Object.keys(L.event).reduce((k,T)=>{if(T in x.meta.display){const O=L.event[T],E=x.meta.display[T];k[T]=O&&E&&E[O].name||L.event[T]}else k[T]=L.event[T];return k},{}),...w?{timestamp:Uu(N,"yyyy-MM-dd HH:mm:ss"),tzOffset:Uu(N,"XXX")}:{}}});let C=[];w&&(C=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const A="display"in i.exportState.chartData.meta&&i.exportState.chartData.meta?.display?i.exportState.chartData.meta?.display:{},F=[...C,...Object.keys(A).map(L=>({label:e.t(`chartLabels.${L}`),key:L})),...i.exportState.chartData.meta.metric_names.map(L=>({label:e.t(`chartLabels.${L}`),key:L}))],I=F.reduce((L,N)=>(L[N.key]=N.label,L),{});return{headers:F,csvHeaders:I,rows:v}}),_=async()=>{if(i.exportState.status!=="success")return{total:0,data:[]};const{rows:x}=m.value;return{total:Number(x.length)||0,data:x.slice(0,F_)}};return p.watch(m,()=>{a.value++}),(x,w)=>{const v=p.resolveComponent("KSkeleton"),C=p.resolveComponent("KEmptyState"),A=p.resolveComponent("KTableData"),F=p.resolveComponent("KTooltip"),I=p.resolveComponent("KButton"),L=p.resolveComponent("KModal");return p.openBlock(),p.createElementBlock("div",xL,[p.createVNode(L,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:p.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:g,onKeyup:p.withKeys(g,["esc"])},{default:p.withCtx(()=>[p.createElementVNode("div",null,[n.exportState.status==="success"&&u.value?(p.openBlock(),p.createElementBlock("div",wL,[p.createElementVNode("p",null,p.toDisplayString(n.modalDescription?n.modalDescription:p.unref(e).t("csvExport.exportDescription")),1),p.createElementVNode("p",null,p.toDisplayString(p.unref(e).t("csvExport.exportTimeRange"))+": "+p.toDisplayString(d.value),1)])):p.createCommentVNode("",!0),n.exportState.status==="loading"?(p.openBlock(),p.createBlock(v,{key:1,class:"chart-skeleton",type:"table"})):n.exportState.status==="success"?(p.openBlock(),p.createBlock(A,{key:2,class:"vitals-table",fetcher:_,"fetcher-cache-key":String(a.value),headers:m.value?.headers||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":p.withCtx(()=>[p.createVNode(C,{"action-button-visible":!1},{title:p.withCtx(()=>[p.createElementVNode("h5",null,p.toDisplayString(p.unref(e).t("csvExport.noDataRange")),1)]),default:p.withCtx(()=>[p.createElementVNode("p",null,p.toDisplayString(p.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):n.exportState.status==="error"?(p.openBlock(),p.createBlock(C,{key:3,"action-button-visible":!1},{title:p.withCtx(()=>[p.createElementVNode("h5",null,p.toDisplayString(p.unref(e).t("csvExport.dataError")),1)]),_:1})):p.createCommentVNode("",!0),n.exportState.status==="success"&&u.value?(p.openBlock(),p.createElementBlock("div",vL,[p.createTextVNode(p.toDisplayString(f.value)+" ",1),p.createVNode(F,{class:"preview-tooltip",placement:"right",text:p.unref(e).t("csvExport.maximumRecordAmount",{value:p.unref(1e3)})},{default:p.withCtx(()=>[p.createVNode(p.unref(Ms.InfoIcon),{color:`var(--kui-color-text-neutral, ${p.unref(Mc)})`,size:`var(--kui-icon-size-30, ${p.unref(Rs)})`},null,8,["color","size"])]),_:1},8,["text"])])):p.createCommentVNode("",!0)])]),"footer-actions":p.withCtx(()=>[p.createVNode(I,{appearance:"tertiary",class:"cancel-btn",onClick:g},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("csvExport.cancelButton")),1)]),_:1}),p.createVNode(bL,{class:"vitals-report-export-button",filename:s,headers:m.value.csvHeaders,rows:m.value.rows},{default:p.withCtx(()=>[p.createVNode(I,{appearance:"primary","data-testid":"csv-download-button",disabled:n.exportState.status!=="success"||!u.value},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}});Yt.AnalyticsChart=RI,Yt.ChartLegendPosition=Pe,Yt.CsvExportModal=SL,Yt.DECIMAL_DISPLAY=CR,Yt.FONT_SIZE_REGULAR=ry,Yt.FONT_SIZE_SMALL=iy,Yt.MAX_LABEL_LENGTH=Za,Yt.SimpleChart=jI,Yt.SparklineChart=lL,Yt.TopNTable=rL,Yt.ValidType=gr,Yt.chartTypes=AE,Yt.exploreResultToScatterData=My,Yt.handleQueryError=wE,Yt.isCancellationError=Sy,Yt.isScatterChartData=qu,Yt.lookupStatusCodeColor=oy,Yt.requestsToScatterData=DE,Yt.simpleChartMetricDisplay=OE,Yt.simpleChartTypes=RE,Yt.statusCodeBadgeBackgroundColor=RR,Object.defineProperty(Yt,Symbol.toStringTag,{value:"Module"})}));
|