@kong-ui-public/analytics-chart 10.34.2-pr.3248.33ec9c8e1.0 → 10.34.2
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/types/composables/index.d.ts +1 -1
- package/dist/types/composables/index.d.ts.map +1 -1
- package/dist/types/composables/{useEvauluateFeatureFlag.d.ts → useEvaluateFeatureFlag.d.ts} +1 -1
- package/dist/types/composables/useEvaluateFeatureFlag.d.ts.map +1 -0
- package/dist/vitals-chart.es.js +1 -1
- package/dist/vitals-chart.umd.js +1 -1
- package/package.json +6 -6
- package/dist/types/composables/useEvauluateFeatureFlag.d.ts.map +0 -1
package/dist/vitals-chart.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(Yt,h){typeof exports=="object"&&typeof module<"u"?h(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"],h):(Yt=typeof globalThis<"u"?globalThis:Yt||self,h(Yt["kong-ui-publicvitals-chart"]={},Yt.Vue,Yt.KongIcons,Yt["kong-ui-public-i18n"],Yt["kong-ui-public-analytics-metric-provider"]))})(this,(function(Yt,h,de,Jf,tr){"use strict";var mt=(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))(mt||{});const tx=["in","not_in","selector"],ex=["empty","not_empty"],nx=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],er=n=>n.filter(t=>t!=="time"),th=["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"],eh=er(th),ix=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],nh=[...th,"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"],ih=er(nh),rx=[...ix,"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"],sx=["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"],rh=er(sx),ox=["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"],ax=er(ox),lx=["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"],cx=lx,ux=["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"],dx=er(ux),fx=["platform","platform_usage"],hx=n=>fx.includes(n),px=[...nh.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"],sh=er(px);[...rx];const mx=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],oh=er(mx);new Set(eh),new Set(ih),new Set(rh),new Set(sh),new Set(oh);const ah=[{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"}];ah.map(n=>n.code);const lh=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:tx},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:ex}},required:["field","operator"],additionalProperties:!1}]}}),gx=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];lh(Array.from(new Set([...ax,...cx,...dx]))),lh([...new Set([...ih,...eh,...rh,...sh,...gx,...oh])]);const yx={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"}},_x=(n,t,e)=>{let i;const r=yx[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 bc(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const bx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},wx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},vx={date:bc({formats:bx,defaultWidth:"full"}),time:bc({formats:xx,defaultWidth:"full"}),dateTime:bc({formats:wx,defaultWidth:"full"})},Sx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Tx=(n,t,e,i)=>Sx[n];function Ds(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"]},kx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Dx={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"]},Cx={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"]},Ox={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"}},Ax={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"}},Ex=(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"},Rx={ordinalNumber:Ex,era:Ds({values:Mx,defaultWidth:"wide"}),quarter:Ds({values:kx,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ds({values:Dx,defaultWidth:"wide"}),day:Ds({values:Cx,defaultWidth:"wide"}),dayPeriod:Ds({values:Ox,defaultWidth:"wide",formattingValues:Ax,defaultFormattingWidth:"wide"})};function Cs(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)?Ix(l,m=>m.test(a)):Px(l,m=>m.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const p=t.slice(a.length);return{value:d,rest:p}}}function Px(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Ix(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Lx(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 Nx=/^(\d+)(th|st|nd|rd)?/i,Bx=/\d+/i,Fx={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},zx={any:[/^b/i,/^(a|c)/i]},Ux={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Hx={any:[/1/i,/2/i,/3/i,/4/i]},Wx={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},$x={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]},Vx={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},Yx={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]},qx={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},jx={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}},Gx={ordinalNumber:Lx({matchPattern:Nx,parsePattern:Bx,valueCallback:n=>parseInt(n,10)}),era:Cs({matchPatterns:Fx,defaultMatchWidth:"wide",parsePatterns:zx,defaultParseWidth:"any"}),quarter:Cs({matchPatterns:Ux,defaultMatchWidth:"wide",parsePatterns:Hx,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Cs({matchPatterns:Wx,defaultMatchWidth:"wide",parsePatterns:$x,defaultParseWidth:"any"}),day:Cs({matchPatterns:Vx,defaultMatchWidth:"wide",parsePatterns:Yx,defaultParseWidth:"any"}),dayPeriod:Cs({matchPatterns:qx,defaultMatchWidth:"any",parsePatterns:jx,defaultParseWidth:"any"})},Kx={code:"en-US",formatDistance:_x,formatLong:vx,formatRelative:Tx,localize:Rx,match:Gx,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Xx={};function Os(){return Xx}const ch=6048e5,Zx=864e5,Qx=60,Jx=3600,uh=Symbol.for("constructDateFrom");function Tn(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&uh in n?n[uh](t):n instanceof Date?new n.constructor(t):new Date(t)}function Ue(n,t){return Tn(t||n,n)}function dh(n){const t=Ue(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 tw(n,...t){const e=Tn.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ir(n,t){const e=Ue(n,t?.in);return e.setHours(0,0,0,0),e}function ew(n,t,e){const[i,r]=tw(e?.in,n,t),s=Ir(i),a=Ir(r),l=+s-dh(s),u=+a-dh(a);return Math.round((l-u)/Zx)}function nw(n,t){const e=Ue(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function iw(n,t){const e=Ue(n,t?.in);return ew(e,nw(e))+1}function ei(n,t){const e=Os(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=Ue(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 ta(n,t){return ei(n,{...t,weekStartsOn:1})}function fh(n,t){const e=Ue(n,t?.in),i=e.getFullYear(),r=Tn(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=ta(r),a=Tn(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=ta(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function rw(n,t){const e=fh(n,t),i=Tn(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),ta(i)}function sw(n,t){const e=Ue(n,t?.in),i=+ta(e)-+rw(e);return Math.round(i/ch)+1}function hh(n,t){const e=Ue(n,t?.in),i=e.getFullYear(),r=Os(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=Tn(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=ei(a,t),u=Tn(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=ei(u,t);return+e>=+l?i+1:+e>=+d?i:i-1}function ow(n,t){const e=Os(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=hh(n,t),s=Tn(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),ei(s,t)}function aw(n,t){const e=Ue(n,t?.in),i=+ei(e,t)-+ow(e,t);return Math.round(i/ch)+1}function Xt(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 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)}},Lr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ph={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=hh(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=fh(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 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 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=aw(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Xt(r,t.length)},I:function(n,t,e){const i=sw(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"}):Si.d(n,t)},D:function(n,t,e){const i=iw(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=Lr.noon:i===0?r=Lr.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=Lr.evening:i>=12?r=Lr.afternoon:i>=4?r=Lr.morning:r=Lr.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"}):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"}):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 gh(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 gh(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"+mh(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"+mh(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 mh(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 gh(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 yh=(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"})}},_h=(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"})}},lw=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return yh(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}}",yh(i,t)).replace("{{time}}",_h(r,t))},cw={p:_h,P:lw},uw=/^D+$/,dw=/^Y+$/,fw=["D","DD","YY","YYYY"];function hw(n){return uw.test(n)}function pw(n){return dw.test(n)}function mw(n,t,e){const i=gw(n,t,e);if(console.warn(i),fw.includes(n))throw new RangeError(i)}function gw(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 yw(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function _w(n){return!(!yw(n)&&typeof n!="number"||isNaN(+Ue(n)))}const bw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ww=/^'([^]*?)'?$/,vw=/''/g,Sw=/[a-zA-Z]/;function Tw(n,t,e){const i=Os(),r=e?.locale??i.locale??Kx,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=Ue(n,e?.in);if(!_w(l))throw new RangeError("Invalid time value");let u=t.match(xw).map(p=>{const m=p[0];if(m==="p"||m==="P"){const g=cw[m];return g(p,r.formatLong)}return p}).join("").match(bw).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const m=p[0];if(m==="'")return{isToken:!1,value:Mw(p)};if(ph[m])return{isToken:!0,value:p};if(m.match(Sw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:p}});r.localize.preprocessor&&(u=r.localize.preprocessor(l,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(p=>{if(!p.isToken)return p.value;const m=p.value;(!e?.useAdditionalWeekYearTokens&&pw(m)||!e?.useAdditionalDayOfYearTokens&&hw(m))&&mw(m,t,String(n));const g=ph[m[0]];return g(l,m,r.localize,d)}).join("")}function Mw(n){const t=n.match(ww);return t?t[1].replace(vw,"'"):n}function ea(n,t,e){const i=Ue(n,e?.in);return isNaN(t)?Tn(n,NaN):(i.setDate(i.getDate()+t),i)}function bh(n,t,e){const i=Ue(n,e?.in);if(isNaN(t))return Tn(n,NaN);if(!t)return i;const r=i.getDate(),s=Tn(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 kw(n,t,e){return bh(n,t*3,e)}function Nr(n,t){const e=Ue(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function Br(n,t){const e=Ue(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function Dw(n,t){const e=Ue(n,t?.in),i=e.getFullYear(),r=e.getMonth(),s=Tn(e,0);return s.setFullYear(i,r+1,0),s.setHours(0,0,0,0),s.getDate()}function Cw(){return Object.assign({},Os())}function xh(n){return Math.trunc(n*Jx)}function Ow(n){const t=n/Qx;return Math.trunc(t)}function wh(n,t,e){return bh(n,-1,e)}function vh(n,t,e){return kw(n,-1,e)}function Sh(n,t,e){const i=Cw(),r=Rw(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?Aw(r,t):Ew(r,t)}function Aw(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 Ew(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Rw(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Pw(n,t){const e=Fw(t);return"formatToParts"in e?Lw(e,n):Nw(e,n)}const Iw={year:0,month:1,day:2,hour:3,minute:4,second:5};function Lw(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=Iw[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 Nw(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 xc={},Th=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")),Bw=Th==="06/25/2014, 00:00:00"||Th==="06/25/2014 00:00:00";function Fw(n){return xc[n]||(xc[n]=Bw?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"})),xc[n]}function wc(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 Mh=36e5,zw=6e4,vc={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function As(n,t,e){if(!n)return 0;let i=vc.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=vc.timezoneHH.exec(n),i)return r=parseInt(i[1],10),kh(r)?-(r*Mh):NaN;if(i=vc.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return kh(r,a)?(s=Math.abs(r)*Mh+a*zw,i[1]==="+"?-s:s):NaN}if(Ww(n)){t=new Date(t||Date.now());const a=e?t:Uw(t),l=Sc(a,n);return-(e?l:Hw(t,l,n))}return NaN}function Uw(n){return wc(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Sc(n,t){const e=Pw(n,t),i=wc(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 Hw(n,t,e){let i=n.getTime()-t;const r=Sc(new Date(i),e);if(t===r)return t;i-=r-t;const s=Sc(new Date(i),e);return r===s?r:Math.max(r,s)}function kh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Dh={};function Ww(n){if(Dh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Dh[n]=!0,!0}catch{return!1}}const $w=60*1e3,Vw={X:function(n,t,e){const i=Tc(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Ch(i);case"XXXX":case"XX":return Fr(i);default:return Fr(i,":")}},x:function(n,t,e){const i=Tc(e.timeZone,n);switch(t){case"x":return Ch(i);case"xxxx":case"xx":return Fr(i);default:return Fr(i,":")}},O:function(n,t,e){const i=Tc(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Yw(i,":");default:return"GMT"+Fr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Sh("short",n,e);default:return Sh("long",n,e)}}};function Tc(n,t){const e=n?As(n,t,!0)/$w:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function na(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Fr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=na(Math.floor(i/60),2),s=na(Math.floor(i%60),2);return e+r+t+s}function Ch(n,t){return n%60===0?(n>0?"-":"+")+na(Math.abs(n)/60,2):Fr(n,t)}function Yw(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+na(s,2)}function Oh(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 Ah=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Mc=36e5,Eh=6e4,qw=2,Ze={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:Ah};function ia(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?qw: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=jw(n),{year:r,restDateString:s}=Gw(i.date,e),a=Kw(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=Xw(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=As(i.timeZone||t.timeZone,new Date(l+u)),isNaN(d))return new Date(NaN)}else d=Oh(new Date(l+u)),d=Oh(new Date(l+u+d));return new Date(l+u+d)}else return new Date(NaN)}function jw(n){const t={};let e=Ze.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Ze.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=Ze.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function Gw(n,t){if(n){const e=Ze.YYY[t],i=Ze.YYYYY[t];let r=Ze.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=Ze.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 Kw(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=Ze.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,Ih(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=Ze.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return Jw(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=Ze.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return Ih(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=Ze.Www.exec(n),s)return r=parseInt(s[1],10)-1,Lh(r)?Rh(t,r):new Date(NaN);if(s=Ze.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return Lh(r,a)?Rh(t,r,a):new Date(NaN)}return null}function Xw(n){let t,e,i=Ze.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),kc(t)?t%24*Mc:NaN;if(i=Ze.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),kc(t,e)?t%24*Mc+e*Eh:NaN;if(i=Ze.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return kc(t,e,r)?t%24*Mc+e*Eh+r*1e3:NaN}return null}function Rh(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 Zw=[31,28,31,30,31,30,31,31,30,31,30,31],Qw=[31,29,31,30,31,30,31,31,30,31,30,31];function Ph(n){return n%400===0||n%4===0&&n%100!==0}function Ih(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Ph(n);if(i&&e>Qw[t]||!i&&e>Zw[t])return!1}return!0}function Jw(n,t){if(t<1)return!1;const e=Ph(n);return!(e&&t>366||!e&&t>365)}function Lh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function kc(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const tv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function ev(n,t,e={}){t=String(t);const i=t.match(tv);if(i){const r=ia(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,"'"+Vw[a[0]](r,a,e)+"'");return u?d.substring(0,l-1)+d.substring(l+1):d},t)}return Tw(n,t,e)}function Nh(n,t,e){n=ia(n,e);const i=As(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 Bh(n,t,e,i){return i={...i,timeZone:t,originalDate:n},ev(Nh(n,t,{timeZone:i.timeZone}),e,i)}function nv(n,t,e){if(typeof n=="string"&&!n.match(Ah))return ia(n,{...e,timeZone:t});n=ia(n,e);const i=wc(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),r=As(t,new Date(i));return new Date(i+r)}function iv(n,t){return-As(n,t)}function Fh(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)"),Bh(n,e,i)}function rv(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 Bh(r,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const sv={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 ra(n){return n&&nx.find(t=>n<=sv[t])||null}var sa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},oa={exports:{}};oa.exports;var zh;function ov(){return zh||(zh=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]",p="[object Function]",m="[object GeneratorFunction]",g="[object Map]",_="[object Number]",x="[object Object]",w="[object Promise]",S="[object RegExp]",C="[object Set]",A="[object String]",B="[object Symbol]",P="[object WeakMap]",I="[object ArrayBuffer]",$="[object DataView]",z="[object Float32Array]",v="[object Float64Array]",M="[object Int8Array]",O="[object Int16Array]",N="[object Int32Array]",W="[object Uint8Array]",G="[object Uint8ClampedArray]",lt="[object Uint16Array]",ut="[object Uint32Array]",ht=/[\\^$.*+?()[\]{}|]/g,dt=/\w*$/,bt=/^\[object .+?Constructor\]$/,at=/^(?:0|[1-9]\d*)$/,ct={};ct[s]=ct[a]=ct[I]=ct[$]=ct[l]=ct[u]=ct[z]=ct[v]=ct[M]=ct[O]=ct[N]=ct[g]=ct[_]=ct[x]=ct[S]=ct[C]=ct[A]=ct[B]=ct[W]=ct[G]=ct[lt]=ct[ut]=!0,ct[d]=ct[p]=ct[P]=!1;var V=typeof sa=="object"&&sa&&sa.Object===Object&&sa,L=typeof self=="object"&&self&&self.Object===Object&&self,H=V||L||Function("return this")(),it=t&&!t.nodeType&&t,st=it&&!0&&n&&!n.nodeType&&n,X=st&&st.exports===it;function tt(D,Y){return D.set(Y[0],Y[1]),D}function rt(D,Y){return D.add(Y),D}function j(D,Y){for(var J=-1,gt=D?D.length:0;++J<gt&&Y(D[J],J,D)!==!1;);return D}function et(D,Y){for(var J=-1,gt=Y.length,Me=D.length;++J<gt;)D[Me+J]=Y[J];return D}function ot(D,Y,J,gt){for(var Me=-1,Ge=D?D.length:0;++Me<Ge;)J=Y(J,D[Me],Me,D);return J}function wt(D,Y){for(var J=-1,gt=Array(D);++J<D;)gt[J]=Y(J);return gt}function Lt(D,Y){return D?.[Y]}function vt(D){var Y=!1;if(D!=null&&typeof D.toString!="function")try{Y=!!(D+"")}catch{}return Y}function Ot(D){var Y=-1,J=Array(D.size);return D.forEach(function(gt,Me){J[++Y]=[Me,gt]}),J}function kt(D,Y){return function(J){return D(Y(J))}}function Se(D){var Y=-1,J=Array(D.size);return D.forEach(function(gt){J[++Y]=gt}),J}var _t=Array.prototype,jt=Function.prototype,Ae=Object.prototype,Ee=H["__core-js_shared__"],oe=(function(){var D=/[^.]+$/.exec(Ee&&Ee.keys&&Ee.keys.IE_PROTO||"");return D?"Symbol(src)_1."+D:""})(),cn=jt.toString,$t=Ae.hasOwnProperty,Ne=Ae.toString,ie=RegExp("^"+cn.call($t).replace(ht,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Te=X?H.Buffer:void 0,Re=H.Symbol,gn=H.Uint8Array,Hi=kt(Object.getPrototypeOf,Object),Cn=Object.create,je=Ae.propertyIsEnumerable,Ln=_t.splice,di=Object.getOwnPropertySymbols,To=Te?Te.isBuffer:void 0,Mo=kt(Object.keys,Object),vr=Xn(H,"DataView"),fi=Xn(H,"Map"),ko=Xn(H,"Promise"),Do=Xn(H,"Set"),Co=Xn(H,"WeakMap"),Wi=Xn(Object,"create"),ml=pi(vr),md=pi(fi),gd=pi(ko),yd=pi(Do),_d=pi(Co),Oo=Re?Re.prototype:void 0,gl=Oo?Oo.valueOf:void 0;function hi(D){var Y=-1,J=D?D.length:0;for(this.clear();++Y<J;){var gt=D[Y];this.set(gt[0],gt[1])}}function bd(){this.__data__=Wi?Wi(null):{}}function Ao(D){return this.has(D)&&delete this.__data__[D]}function xd(D){var Y=this.__data__;if(Wi){var J=Y[D];return J===i?void 0:J}return $t.call(Y,D)?Y[D]:void 0}function Eo(D){var Y=this.__data__;return Wi?Y[D]!==void 0:$t.call(Y,D)}function wd(D,Y){var J=this.__data__;return J[D]=Wi&&Y===void 0?i:Y,this}hi.prototype.clear=bd,hi.prototype.delete=Ao,hi.prototype.get=xd,hi.prototype.has=Eo,hi.prototype.set=wd;function Nn(D){var Y=-1,J=D?D.length:0;for(this.clear();++Y<J;){var gt=D[Y];this.set(gt[0],gt[1])}}function vd(){this.__data__=[]}function Sd(D){var Y=this.__data__,J=Sr(Y,D);if(J<0)return!1;var gt=Y.length-1;return J==gt?Y.pop():Ln.call(Y,J,1),!0}function Td(D){var Y=this.__data__,J=Sr(Y,D);return J<0?void 0:Y[J][1]}function yl(D){return Sr(this.__data__,D)>-1}function Md(D,Y){var J=this.__data__,gt=Sr(J,D);return gt<0?J.push([D,Y]):J[gt][1]=Y,this}Nn.prototype.clear=vd,Nn.prototype.delete=Sd,Nn.prototype.get=Td,Nn.prototype.has=yl,Nn.prototype.set=Md;function $i(D){var Y=-1,J=D?D.length:0;for(this.clear();++Y<J;){var gt=D[Y];this.set(gt[0],gt[1])}}function _l(){this.__data__={hash:new hi,map:new(fi||Nn),string:new hi}}function kd(D){return Tr(this,D).delete(D)}function Dd(D){return Tr(this,D).get(D)}function Cd(D){return Tr(this,D).has(D)}function Od(D,Y){return Tr(this,D).set(D,Y),this}$i.prototype.clear=_l,$i.prototype.delete=kd,$i.prototype.get=Dd,$i.prototype.has=Cd,$i.prototype.set=Od;function Vi(D){this.__data__=new Nn(D)}function Ad(){this.__data__=new Nn}function ss(D){return this.__data__.delete(D)}function Ed(D){return this.__data__.get(D)}function os(D){return this.__data__.has(D)}function Rd(D,Y){var J=this.__data__;if(J instanceof Nn){var gt=J.__data__;if(!fi||gt.length<e-1)return gt.push([D,Y]),this;J=this.__data__=new $i(gt)}return J.set(D,Y),this}Vi.prototype.clear=Ad,Vi.prototype.delete=ss,Vi.prototype.get=Ed,Vi.prototype.has=os,Vi.prototype.set=Rd;function Pd(D,Y){var J=No(D)||Rl(D)?wt(D.length,String):[],gt=J.length,Me=!!gt;for(var Ge in D)$t.call(D,Ge)&&!(Me&&(Ge=="length"||Cl(Ge,gt)))&&J.push(Ge);return J}function bl(D,Y,J){var gt=D[Y];(!($t.call(D,Y)&&El(gt,J))||J===void 0&&!(Y in D))&&(D[Y]=J)}function Sr(D,Y){for(var J=D.length;J--;)if(El(D[J][0],Y))return J;return-1}function xl(D,Y){return D&&Po(Y,Bo(Y),D)}function as(D,Y,J,gt,Me,Ge,Bn){var Be;if(gt&&(Be=Ge?gt(D,Me,Ge,Bn):gt(D)),Be!==void 0)return Be;if(!fs(D))return D;var Il=No(D);if(Il){if(Be=kl(D),!Y)return Ml(D,Be)}else{var ce=un(D),hs=ce==p||ce==m;if(Vd(D))return vl(D,Y);if(ce==x||ce==s||hs&&!Ge){if(vt(D))return Ge?D:{};if(Be=Dl(hs?{}:D),!Y)return Io(D,xl(Be,D))}else{if(!ct[ce])return Ge?D:{};Be=Hd(D,ce,as,Y)}}Bn||(Bn=new Vi);var Zn=Bn.get(D);if(Zn)return Zn;if(Bn.set(D,Be),!Il)var Fo=J?Ud(D):Bo(D);return j(Fo||D,function(Mr,Fe){Fo&&(Fe=Mr,Mr=D[Fe]),bl(Be,Fe,as(Mr,Y,J,gt,Fe,D,Bn))}),Be}function Id(D){return fs(D)?Cn(D):{}}function Ld(D,Y,J){var gt=Y(D);return No(D)?gt:et(gt,J(D))}function Nd(D){return Ne.call(D)}function Bd(D){if(!fs(D)||Al(D))return!1;var Y=ds(D)||vt(D)?ie:bt;return Y.test(pi(D))}function wl(D){if(!Lo(D))return Mo(D);var Y=[];for(var J in Object(D))$t.call(D,J)&&J!="constructor"&&Y.push(J);return Y}function vl(D,Y){if(Y)return D.slice();var J=new D.constructor(D.length);return D.copy(J),J}function ls(D){var Y=new D.constructor(D.byteLength);return new gn(Y).set(new gn(D)),Y}function Ro(D,Y){var J=Y?ls(D.buffer):D.buffer;return new D.constructor(J,D.byteOffset,D.byteLength)}function Fd(D,Y,J){var gt=Y?J(Ot(D),!0):Ot(D);return ot(gt,tt,new D.constructor)}function Sl(D){var Y=new D.constructor(D.source,dt.exec(D));return Y.lastIndex=D.lastIndex,Y}function cs(D,Y,J){var gt=Y?J(Se(D),!0):Se(D);return ot(gt,rt,new D.constructor)}function Tl(D){return gl?Object(gl.call(D)):{}}function zd(D,Y){var J=Y?ls(D.buffer):D.buffer;return new D.constructor(J,D.byteOffset,D.length)}function Ml(D,Y){var J=-1,gt=D.length;for(Y||(Y=Array(gt));++J<gt;)Y[J]=D[J];return Y}function Po(D,Y,J,gt){J||(J={});for(var Me=-1,Ge=Y.length;++Me<Ge;){var Bn=Y[Me],Be=void 0;bl(J,Bn,Be===void 0?D[Bn]:Be)}return J}function Io(D,Y){return Po(D,us(D),Y)}function Ud(D){return Ld(D,Bo,us)}function Tr(D,Y){var J=D.__data__;return Ol(Y)?J[typeof Y=="string"?"string":"hash"]:J.map}function Xn(D,Y){var J=Lt(D,Y);return Bd(J)?J:void 0}var us=di?kt(di,Object):jd,un=Nd;(vr&&un(new vr(new ArrayBuffer(1)))!=$||fi&&un(new fi)!=g||ko&&un(ko.resolve())!=w||Do&&un(new Do)!=C||Co&&un(new Co)!=P)&&(un=function(D){var Y=Ne.call(D),J=Y==x?D.constructor:void 0,gt=J?pi(J):void 0;if(gt)switch(gt){case ml:return $;case md:return g;case gd:return w;case yd:return C;case _d:return P}return Y});function kl(D){var Y=D.length,J=D.constructor(Y);return Y&&typeof D[0]=="string"&&$t.call(D,"index")&&(J.index=D.index,J.input=D.input),J}function Dl(D){return typeof D.constructor=="function"&&!Lo(D)?Id(Hi(D)):{}}function Hd(D,Y,J,gt){var Me=D.constructor;switch(Y){case I:return ls(D);case l:case u:return new Me(+D);case $:return Ro(D,gt);case z:case v:case M:case O:case N:case W:case G:case lt:case ut:return zd(D,gt);case g:return Fd(D,gt,J);case _:case A:return new Me(D);case S:return Sl(D);case C:return cs(D,gt,J);case B:return Tl(D)}}function Cl(D,Y){return Y=Y??r,!!Y&&(typeof D=="number"||at.test(D))&&D>-1&&D%1==0&&D<Y}function Ol(D){var Y=typeof D;return Y=="string"||Y=="number"||Y=="symbol"||Y=="boolean"?D!=="__proto__":D===null}function Al(D){return!!oe&&oe in D}function Lo(D){var Y=D&&D.constructor,J=typeof Y=="function"&&Y.prototype||Ae;return D===J}function pi(D){if(D!=null){try{return cn.call(D)}catch{}try{return D+""}catch{}}return""}function Wd(D){return as(D,!0,!0)}function El(D,Y){return D===Y||D!==D&&Y!==Y}function Rl(D){return $d(D)&&$t.call(D,"callee")&&(!je.call(D,"callee")||Ne.call(D)==s)}var No=Array.isArray;function Pl(D){return D!=null&&Yd(D.length)&&!ds(D)}function $d(D){return qd(D)&&Pl(D)}var Vd=To||ee;function ds(D){var Y=fs(D)?Ne.call(D):"";return Y==p||Y==m}function Yd(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=r}function fs(D){var Y=typeof D;return!!D&&(Y=="object"||Y=="function")}function qd(D){return!!D&&typeof D=="object"}function Bo(D){return Pl(D)?Pd(D):wl(D)}function jd(){return[]}function ee(){return!1}n.exports=Wd})(oa,oa.exports)),oa.exports}ov();const Mn=(n,t)=>new Date(n.getTime()-iv(t,n));class Ce{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=nv(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Nh(e,t)}}class av extends Ce{rawStart(t){let e=ei(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Mn(e,t)),e}maximumTimeframeLength(){return 3600*24*7}}class lv extends Ce{rawStart(t){let e=Br(this.tzAdjustedDate(t));return t&&(e=Mn(e,t)),e}maximumTimeframeLength(){return 3600*24*31}}class cv extends Ce{rawStart(t){let e=Nr(this.tzAdjustedDate(t));return t&&(e=Mn(e,t)),e}maximumTimeframeLength(){return 3600*24*92}}class uv extends Ce{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Mn(e,t)),e}maximumTimeframeLength(){return 3600*24*366}}class dv extends Ce{rawEnd(t){let e=ei(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Mn(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=ei(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Mn(i,t)),i}}class fv extends Ce{rawEnd(t){let e=Nr(this.tzAdjustedDate(t));return t&&(e=Mn(e,t)),e}rawStart(t){let e=Nr(vh(this.tzAdjustedDate(t)));return t&&(e=Mn(e,t)),e}}class hv extends Ce{rawEnd(t){let e=Br(this.tzAdjustedDate(t));return t&&(e=Mn(e,t)),e}rawStart(t){let e=Br(wh(this.tzAdjustedDate(t)));return t&&(e=Mn(e,t)),e}}class pv extends Ce{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Mn(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=Mn(e,t)),e}}mt.FIFTEEN_MIN,new Ce({key:mt.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"]}),mt.ONE_HOUR,new Ce({key:mt.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"]}),mt.SIX_HOUR,new Ce({key:mt.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"]}),mt.TWELVE_HOUR,new Ce({key:mt.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"]}),mt.ONE_DAY,new Ce({key:mt.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"]}),mt.SEVEN_DAY,new Ce({key:mt.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"]}),mt.THIRTY_DAY,new Ce({key:mt.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"]}),mt.NINETY_DAY,new Ce({key:mt.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"]}),mt.ONE_HUNDRED_EIGHTY_DAY,new Ce({key:mt.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"]}),mt.ONE_YEAR,new Ce({key:mt.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"]}),mt.CURRENT_WEEK,new av({key:mt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=ei(new Date,{weekStartsOn:1});return(Ir(ea(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),mt.CURRENT_MONTH,new lv({key:mt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Br(new Date);return(Ir(ea(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),mt.CURRENT_QUARTER,new cv({key:mt.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Nr(new Date);return(Ir(ea(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),mt.CURRENT_YEAR,new uv({key:mt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1);return(Ir(ea(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),mt.PREVIOUS_WEEK,new dv({key:mt.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"]}),mt.PREVIOUS_MONTH,new hv({key:mt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Br(new Date),e=Br(wh(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Uh(t,e)),3600*24*Dw(new Date().setMonth(new Date().getMonth()-1))+xh(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),mt.PREVIOUS_QUARTER,new fv({key:mt.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Nr(new Date),t=Nr(vh(new Date));return(n.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),mt.PREVIOUS_YEAR,new pv({key:mt.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=Uh(n,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+xh(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Uh(n,t){return Ow(n.getTimezoneOffset()-t.getTimezoneOffset())}mt.FIFTEEN_MIN,mt.ONE_HOUR,mt.SIX_HOUR,mt.TWELVE_HOUR,mt.ONE_DAY,mt.SEVEN_DAY,mt.FIFTEEN_MIN,mt.ONE_HOUR,mt.SIX_HOUR,mt.TWELVE_HOUR,mt.ONE_DAY,mt.SEVEN_DAY,mt.THIRTY_DAY,mt.NINETY_DAY,mt.ONE_HUNDRED_EIGHTY_DAY,mt.ONE_YEAR,mt.CURRENT_WEEK,mt.CURRENT_MONTH,mt.CURRENT_QUARTER,mt.CURRENT_YEAR,mt.PREVIOUS_WEEK,mt.PREVIOUS_MONTH,mt.PREVIOUS_QUARTER,mt.PREVIOUS_YEAR;const mv=new Map(ah.map(n=>[n.code,{code:n.code,name:n.name}])),Dc=n=>mv.get(n)?.name||n,Hh=1e3,gv=1e4,Wh=1e6,$h=1e9,Vh=1e12,aa=(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("")},Es=(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 la(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?gv:Hh;return n<r||t.precision&&t.precision>Math.log10(n)?e=aa(Es(n,1,t),t):n<Wh?e=`${Es(n,Hh,t)}k`:n<$h?e=`${Es(n,Wh,t)}m`:n<Vh?e=`${aa(Es(n,$h,t),t)}b`:e=`${aa(Es(n,Vh,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}la.addCommas=aa;const yv=typeof document<"u"&&document.documentElement?.lang||"en-US",ca=new Intl.NumberFormat(yv);function ni({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 p;return i>=s?p=n.formatNumber(Number.parseFloat((i/s).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?p=n.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=l?p=n.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=u?p=n.formatNumber(Number.parseFloat((i/u).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=d?p=n.formatNumber(Number.parseFloat((i/d).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):p=n.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),p.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?`${la(i,{capital:!0})} ${d}`:i>=.01?`${ca.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=p=>p}={})=>{const p=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`${la(i,{capital:!0})} - ${la(r,{capital:!0})} ${p}`}const m=i>=.01?`${ca.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,g=r>=.01?`${ca.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`;return`${m} - ${g} ${p}`}}}const _v=n=>{const t=n.length;let e=5381;for(let i=0;i<t;i++)e=e*33^n.charCodeAt(i);return e>>>0},bv="#0044f4",Yh="#6c7489",xv="#afb7c5",wv="#d60027",vv="#ffc400",Sv="#bee2ff",Tv="#8fc1ff",Mv="#5f9aff",kv="#306fff",Dv="#b5ffee",Cv="#00fabe",Ov="#00d6a4",Av="#00a17b",Ev="#007d60",Rv="#005944",Pv="#b5ffee",Iv="#00fabe",Lv="#b5ffee",Nv="#00a17b",Bv="#fff296",Fv="#ffe04b",zv="#ffc400",Uv="#b37600",Hv="#995c00",Wv="#804400",$v="#fff296",Vv="#ffe04b",Yv="#ffc2b3",qv="#ff9877",jv="#ff723c",Gv="#f75008",Kv="#d13500",Xv="#a31f00",Zv="#ffc2b3",Qv="#ff9877",Jv="#ff723c",t1="#f75008",e1="#d13500",n1="#a31f00",i1="#ffc2b3",r1="#ff9877",s1="#ff723c",o1="#f75008",a1="#d13500",l1="#a31f00",c1="#ffc2b3",u1="#ff9877",d1="#ff723c",f1="#f75008",h1="#d13500",p1="#a31f00",m1="#ffc2b3",g1="#ff9877",y1="#ff723c",_1="#f75008",b1="#d13500",x1="#ffabab",w1="#ff7272",v1="#ff3954",S1="#f50045",T1="#d60027",M1="#ad000e",k1="#ffabab",D1="#ff7272",C1="#ff3954",O1="#f50045",A1="#d60027",E1="#eefaff",R1="#ecfffb",P1="#fffce0",I1="#fff1ef",L1="#ffe5e5",N1="#5f9aff",B1="#00d6a4",F1="#ffc400",z1="#ff723c",U1="#ff3954",H1={100:Sv,101:Tv,102:Mv,103:kv,200:Dv,201:Cv,202:Ov,203:Av,204:Ev,205:Rv,206:Pv,207:Iv,208:Lv,226:Nv,300:Bv,301:Fv,302:zv,303:Uv,304:Hv,305:Wv,307:$v,308:Vv,400:Yv,401:qv,402:jv,403:Gv,404:Kv,405:Xv,406:Zv,407:Qv,408:Jv,409:t1,410:e1,411:n1,412:i1,413:r1,414:s1,415:o1,416:a1,417:l1,418:c1,421:u1,422:d1,423:f1,424:h1,425:p1,426:m1,428:g1,429:y1,431:_1,451:b1,500:x1,501:w1,502:v1,503:S1,504:T1,505:M1,506:k1,507:D1,508:C1,510:O1,511:A1},W1={100:E1,200:R1,300:P1,400:I1,500:L1},qh={"1XX":N1,"2XX":B1,"3XX":F1,"4XX":z1,"5XX":U1},$1={error:wv,warning:vv,empty:xv,neutral:Yh,____OTHER____:bv},jh=["#1693AE","#2EA697","#5CB56C","#AD47F1","#7287F1","#4DA8DF","#DA5024","#EC4D87","#D771D5","#6C931E","#AC8E26","#DB8743"],Gh=["#006B74","#187C62","#538732","#7201DE","#1E63D3","#1E83A3","#B2001F","#BA107B","#A739D0","#5E6400","#8B620C","#BB5420"],V1=n=>_v(n),Kh=({discriminator:n,theme:t="light",customPalette:e=void 0})=>{const i=Math.abs(Math.floor(n));return e?e[i%e.length]:t==="dark"?Gh[i%Gh.length]:jh[i%jh.length]},Rs=({state:n})=>$1[n]??Yh,Y1=({statusCode:n})=>{const t=typeof n=="number"?n:Number.parseInt(n,10),e=`${t}`,i=`${Math.floor(t/100)*100}`;return H1[e]??W1[i]??Rs({state:"neutral"})},q1=({group:n})=>qh[n]?qh[n]:Rs({state:"neutral"}),ua=({discriminator:n=void 0,state:t=void 0,dimension:e=void 0,dimensionValue:i=void 0,metric:r=void 0,theme:s="light",customPalette:a=void 0})=>{if(n!==void 0)return Kh({discriminator:n,theme:s,customPalette:a});if(t!==void 0)return Rs({state:t});if(i&&["empty","____OTHER____"].includes(i))return Rs({state:i});if(e!==void 0&&i!==void 0){if(e==="status_code")return Y1({statusCode:i});if(e==="status_code_grouped")return q1({group:i})}return e||i||r?Kh({discriminator:V1(`${e??""}${i??""}${r??""}`),theme:s,customPalette:a}):Rs({state:"neutral"})},Xh="#d60027",Zh="#ffe5e5",j1="#f1f0ff",G1="#e0e4ea",Qh="#6c7489",K1="#afb7c5",Jh="#0d0e14",X1="#d60027",Z1="#ad000e",Cc="#6c7489",tp="#52596e",Q1="#007d60",J1="#995c00",tS="#ffc400",eS="'Inter', Roboto, Helvetica, sans-serif",ir="16px",nS="20px",iS="#bee2ff",rS="#8fc1ff",sS="#5f9aff",oS="#306fff",aS="#b5ffee",lS="#00fabe",cS="#00d6a4",uS="#00a17b",dS="#007d60",fS="#005944",hS="#b5ffee",pS="#00fabe",mS="#b5ffee",gS="#00a17b",yS="#fff296",_S="#ffe04b",bS="#ffc400",xS="#b37600",wS="#995c00",vS="#804400",SS="#fff296",TS="#ffe04b",MS="#ffc2b3",kS="#ff9877",DS="#ff723c",CS="#f75008",OS="#d13500",AS="#a31f00",ES="#ffc2b3",RS="#ff9877",PS="#ff723c",IS="#f75008",LS="#d13500",NS="#a31f00",BS="#ffc2b3",FS="#ff9877",zS="#ff723c",US="#f75008",HS="#d13500",WS="#a31f00",$S="#ffc2b3",VS="#ff9877",YS="#ff723c",qS="#f75008",jS="#d13500",GS="#a31f00",KS="#ffc2b3",XS="#ff9877",ZS="#ff723c",QS="#f75008",JS="#d13500",tT="#ffabab",eT="#ff7272",nT="#ff3954",iT="#f50045",rT="#d60027",sT="#ad000e",oT="#ffabab",aT="#ff7272",lT="#ff3954",cT="#f50045",uT="#d60027",dT="#eefaff",fT="#ecfffb",hT="#fffce0",pT="#fff1ef",mT="#ffe5e5",gT="#5f9aff",yT="#00d6a4",_T="#ffc400",bT="#ff723c",xT="#ff3954",ep=6048e5,wT=864e5,Ps=6e4,zr=36e5,vT=1e3,np=Symbol.for("constructDateFrom");function pe(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&np in n?n[np](t):n instanceof Date?new n.constructor(t):new Date(t)}function Et(n,t){return pe(t||n,n)}function da(n,t,e){const i=Et(n,e?.in);return isNaN(t)?pe(e?.in||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function Oc(n,t,e){const i=Et(n,e?.in);if(isNaN(t))return pe(n,NaN);if(!t)return i;const r=i.getDate(),s=pe(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 Ac(n,t,e){return pe(n,+Et(n)+t)}function ST(n,t,e){return Ac(n,t*zr)}let TT={};function rr(){return TT}function $n(n,t){const e=rr(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=Et(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 Ur(n,t){return $n(n,{...t,weekStartsOn:1})}function ip(n,t){const e=Et(n,t?.in),i=e.getFullYear(),r=pe(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Ur(r),a=pe(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Ur(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function fa(n){const t=Et(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 sr(n,...t){const e=pe.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ec(n,t){const e=Et(n,t?.in);return e.setHours(0,0,0,0),e}function rp(n,t,e){const[i,r]=sr(e?.in,n,t),s=Ec(i),a=Ec(r),l=+s-fa(s),u=+a-fa(a);return Math.round((l-u)/wT)}function MT(n,t){const e=ip(n,t),i=pe(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Ur(i)}function kT(n,t,e){const i=Et(n,e?.in);return i.setTime(i.getTime()+t*Ps),i}function DT(n,t,e){return Oc(n,t*3,e)}function CT(n,t,e){return Ac(n,t*1e3)}function OT(n,t,e){return da(n,t*7,e)}function AT(n,t,e){return Oc(n,t*12,e)}function Is(n,t){const e=+Et(n)-+Et(t);return e<0?-1:e>0?1:e}function ET(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Rc(n){return!(!ET(n)&&typeof n!="number"||isNaN(+Et(n)))}function RT(n,t,e){const[i,r]=sr(e?.in,n,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function PT(n,t,e){const[i,r]=sr(e?.in,n,t);return i.getFullYear()-r.getFullYear()}function sp(n,t,e){const[i,r]=sr(e?.in,n,t),s=op(i,r),a=Math.abs(rp(i,r));i.setDate(i.getDate()-s*a);const l=+(op(i,r)===-s),u=s*(a-l);return u===0?0:u}function op(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 Ls(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function IT(n,t,e){const[i,r]=sr(e?.in,n,t),s=(+i-+r)/zr;return Ls(e?.roundingMethod)(s)}function Pc(n,t){return+Et(n)-+Et(t)}function LT(n,t,e){const i=Pc(n,t)/Ps;return Ls(e?.roundingMethod)(i)}function ap(n,t){const e=Et(n,t?.in);return e.setHours(23,59,59,999),e}function lp(n,t){const e=Et(n,t?.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function NT(n,t){const e=Et(n,t?.in);return+ap(e,t)==+lp(e,t)}function cp(n,t,e){const[i,r,s]=sr(e?.in,n,n,t),a=Is(r,s),l=Math.abs(RT(r,s));if(l<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*l);let u=Is(r,s)===-a;NT(i)&&l===1&&Is(i,s)===1&&(u=!1);const d=a*(l-+u);return d===0?0:d}function BT(n,t,e){const i=cp(n,t,e)/3;return Ls(e?.roundingMethod)(i)}function FT(n,t,e){const i=Pc(n,t)/1e3;return Ls(e?.roundingMethod)(i)}function zT(n,t,e){const i=sp(n,t,e)/7;return Ls(e?.roundingMethod)(i)}function UT(n,t,e){const[i,r]=sr(e?.in,n,t),s=Is(i,r),a=Math.abs(PT(i,r));i.setFullYear(1584),r.setFullYear(1584);const l=Is(i,r)===-s,u=s*(a-+l);return u===0?0:u}function HT(n,t){const e=Et(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function WT(n,t){const e=Et(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function $T(n,t){const e=Et(n,t?.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function up(n,t){const e=Et(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function VT(n,t){const e=Et(n,t?.in);return e.setMinutes(59,59,999),e}function YT(n,t){const e=rr(),i=e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=Et(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 qT(n,t){const e=Et(n,t?.in);return e.setSeconds(59,999),e}function jT(n,t){const e=Et(n,t?.in),i=e.getMonth(),r=i-i%3+3;return e.setMonth(r,0),e.setHours(23,59,59,999),e}function GT(n,t){const e=Et(n,t?.in);return e.setMilliseconds(999),e}const KT={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"}},XT=(n,t,e)=>{let i;const r=KT[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 Ic(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const ZT={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},QT={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},JT={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},tM={date:Ic({formats:ZT,defaultWidth:"full"}),time:Ic({formats:QT,defaultWidth:"full"}),dateTime:Ic({formats:JT,defaultWidth:"full"})},eM={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},nM=(n,t,e,i)=>eM[n];function Ns(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 iM={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},rM={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},sM={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"]},oM={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"]},aM={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"}},lM={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"}},cM={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:Ns({values:iM,defaultWidth:"wide"}),quarter:Ns({values:rM,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ns({values:sM,defaultWidth:"wide"}),day:Ns({values:oM,defaultWidth:"wide"}),dayPeriod:Ns({values:aM,defaultWidth:"wide",formattingValues:lM,defaultFormattingWidth:"wide"})};function Bs(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)?dM(l,m=>m.test(a)):uM(l,m=>m.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const p=t.slice(a.length);return{value:d,rest:p}}}function uM(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function dM(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function fM(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 hM=/^(\d+)(th|st|nd|rd)?/i,pM=/\d+/i,mM={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},gM={any:[/^b/i,/^(a|c)/i]},yM={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},_M={any:[/1/i,/2/i,/3/i,/4/i]},bM={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},xM={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]},wM={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},vM={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]},SM={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},TM={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},MM={ordinalNumber:fM({matchPattern:hM,parsePattern:pM,valueCallback:n=>parseInt(n,10)}),era:Bs({matchPatterns:mM,defaultMatchWidth:"wide",parsePatterns:gM,defaultParseWidth:"any"}),quarter:Bs({matchPatterns:yM,defaultMatchWidth:"wide",parsePatterns:_M,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Bs({matchPatterns:bM,defaultMatchWidth:"wide",parsePatterns:xM,defaultParseWidth:"any"}),day:Bs({matchPatterns:wM,defaultMatchWidth:"wide",parsePatterns:vM,defaultParseWidth:"any"}),dayPeriod:Bs({matchPatterns:SM,defaultMatchWidth:"any",parsePatterns:TM,defaultParseWidth:"any"})},dp={code:"en-US",formatDistance:XT,formatLong:tM,formatRelative:nM,localize:cM,match:MM,options:{weekStartsOn:0,firstWeekContainsDate:1}};function kM(n,t){const e=Et(n,t?.in);return rp(e,up(e))+1}function fp(n,t){const e=Et(n,t?.in),i=+Ur(e)-+MT(e);return Math.round(i/ep)+1}function Lc(n,t){const e=Et(n,t?.in),i=e.getFullYear(),r=rr(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=pe(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const l=$n(a,t),u=pe(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=$n(u,t);return+e>=+l?i+1:+e>=+d?i:i-1}function DM(n,t){const e=rr(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=Lc(n,t),s=pe(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),$n(s,t)}function hp(n,t){const e=Et(n,t?.in),i=+$n(e,t)-+DM(e,t);return Math.round(i/ep)+1}function Zt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Ti={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)}},Hr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},pp={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 Ti.y(n,t)},Y:function(n,t,e,i){const r=Lc(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=ip(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 Ti.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=hp(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Zt(r,t.length)},I:function(n,t,e){const i=fp(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"}):Ti.d(n,t)},D:function(n,t,e){const i=kM(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=Hr.noon:i===0?r=Hr.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=Hr.evening:i>=12?r=Hr.afternoon:i>=4?r=Hr.morning:r=Hr.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 Ti.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Ti.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"}):Ti.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Ti.s(n,t)},S:function(n,t){return Ti.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return gp(i);case"XXXX":case"XX":return or(i);default:return or(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return gp(i);case"xxxx":case"xx":return or(i);default:return or(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+mp(i,":");default:return"GMT"+or(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+mp(i,":");default:return"GMT"+or(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 mp(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 gp(n,t){return n%60===0?(n>0?"-":"+")+Zt(Math.abs(n)/60,2):or(n,t)}function or(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 yp=(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"})}},_p=(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"})}},Nc={p:_p,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return yp(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}}",yp(i,t)).replace("{{time}}",_p(r,t))}},CM=/^D+$/,OM=/^Y+$/,AM=["D","DD","YY","YYYY"];function bp(n){return CM.test(n)}function xp(n){return OM.test(n)}function Bc(n,t,e){const i=EM(n,t,e);if(console.warn(i),AM.includes(n))throw new RangeError(i)}function EM(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 RM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,PM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,IM=/^'([^]*?)'?$/,LM=/''/g,NM=/[a-zA-Z]/;function ha(n,t,e){const i=rr(),r=e?.locale??i.locale??dp,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=Et(n,e?.in);if(!Rc(l))throw new RangeError("Invalid time value");let u=t.match(PM).map(p=>{const m=p[0];if(m==="p"||m==="P"){const g=Nc[m];return g(p,r.formatLong)}return p}).join("").match(RM).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const m=p[0];if(m==="'")return{isToken:!1,value:BM(p)};if(pp[m])return{isToken:!0,value:p};if(m.match(NM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:p}});r.localize.preprocessor&&(u=r.localize.preprocessor(l,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(p=>{if(!p.isToken)return p.value;const m=p.value;(!e?.useAdditionalWeekYearTokens&&xp(m)||!e?.useAdditionalDayOfYearTokens&&bp(m))&&Bc(m,t,String(n));const g=pp[m[0]];return g(l,m,r.localize,d)}).join("")}function BM(n){const t=n.match(IM);return t?t[1].replace(LM,"'"):n}function wp(){return Object.assign({},rr())}function FM(n,t){const e=Et(n,t?.in).getDay();return e===0?7:e}function zM(n,t){const e=UM(t)?new t(0):pe(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function UM(n){return typeof n=="function"&&n.prototype?.constructor===n}const HM=10;class vp{subPriority=0;validate(t,e){return!0}}class WM extends vp{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 $M extends vp{priority=HM;subPriority=-1;constructor(t,e){super(),this.context=t||(i=>pe(e,i))}set(t,e){return e.timestampIsSet?t:pe(t,zM(t,this.context))}}class Wt{run(t,e,i,r){const s=this.parse(t,e,i,r);return s?{setter:new WM(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,e,i){return!0}}class VM 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 ye={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}/},Vn={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 _e(n,t){return n&&{value:t(n.value),rest:n.rest}}function fe(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Yn(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*zr+s*Ps+a*vT),rest:t.slice(e[0].length)}}function Sp(n){return fe(ye.anyDigitsSigned,n)}function me(n,t){switch(n){case 1:return fe(ye.singleDigit,t);case 2:return fe(ye.twoDigits,t);case 3:return fe(ye.threeDigits,t);case 4:return fe(ye.fourDigits,t);default:return fe(new RegExp("^\\d{1,"+n+"}"),t)}}function pa(n,t){switch(n){case 1:return fe(ye.singleDigitSigned,t);case 2:return fe(ye.twoDigitsSigned,t);case 3:return fe(ye.threeDigitsSigned,t);case 4:return fe(ye.fourDigitsSigned,t);default:return fe(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Fc(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Tp(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 Mp(n){return n%400===0||n%4===0&&n%100!==0}class YM 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 _e(me(4,t),r);case"yo":return _e(i.ordinalNumber(t,{unit:"year"}),r);default:return _e(me(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=Tp(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 qM extends Wt{priority=130;parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="YY"});switch(e){case"Y":return _e(me(4,t),r);case"Yo":return _e(i.ordinalNumber(t,{unit:"year"}),r);default:return _e(me(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i,r){const s=Lc(t,r);if(i.isTwoDigitYear){const l=Tp(i.year,s);return t.setFullYear(l,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),$n(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),$n(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class jM extends Wt{priority=130;parse(t,e){return pa(e==="R"?4:e.length,t)}set(t,e,i){const r=pe(t,0);return r.setFullYear(i,0,4),r.setHours(0,0,0,0),Ur(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class GM extends Wt{priority=130;parse(t,e){return pa(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 KM extends Wt{priority=120;parse(t,e,i){switch(e){case"Q":case"QQ":return me(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 XM extends Wt{priority=120;parse(t,e,i){switch(e){case"q":case"qq":return me(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 ZM 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 _e(fe(ye.month,t),r);case"MM":return _e(me(2,t),r);case"Mo":return _e(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 QM extends Wt{priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"L":return _e(fe(ye.month,t),r);case"LL":return _e(me(2,t),r);case"Lo":return _e(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 JM(n,t,e){const i=Et(n,e?.in),r=hp(i,e)-t;return i.setDate(i.getDate()-r*7),Et(i,e?.in)}class tk extends Wt{priority=100;parse(t,e,i){switch(e){case"w":return fe(ye.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return me(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i,r){return $n(JM(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function ek(n,t,e){const i=Et(n,e?.in),r=fp(i,e)-t;return i.setDate(i.getDate()-r*7),i}class nk extends Wt{priority=100;parse(t,e,i){switch(e){case"I":return fe(ye.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return me(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i){return Ur(ek(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const ik=[31,28,31,30,31,30,31,31,30,31,30,31],rk=[31,29,31,30,31,30,31,31,30,31,30,31];class sk extends Wt{priority=90;subPriority=1;parse(t,e,i){switch(e){case"d":return fe(ye.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return me(e.length,t)}}validate(t,e){const i=t.getFullYear(),r=Mp(i),s=t.getMonth();return r?e>=1&&e<=rk[s]:e>=1&&e<=ik[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 ok extends Wt{priority=90;subpriority=1;parse(t,e,i){switch(e){case"D":case"DD":return fe(ye.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return me(e.length,t)}}validate(t,e){const i=t.getFullYear();return Mp(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 zc(n,t,e){const i=rr(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=Et(n,e?.in),a=s.getDay(),u=(t%7+7)%7,d=7-r,p=t<0||t>6?t-(a+d)%7:(u+d)%7-(a+d)%7;return da(s,p,e)}class ak 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=zc(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class lk 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 _e(me(e.length,t),s);case"eo":return _e(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=zc(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 ck 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 _e(me(e.length,t),s);case"co":return _e(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=zc(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 uk(n,t,e){const i=Et(n,e?.in),r=FM(i,e),s=t-r;return da(i,s,e)}class dk extends Wt{priority=90;parse(t,e,i){const r=s=>s===0?7:s;switch(e){case"i":case"ii":return me(e.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return _e(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 _e(i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return _e(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);default:return _e(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=uk(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 fk 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(Fc(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class hk 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(Fc(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class pk 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(Fc(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class mk extends Wt{priority=70;parse(t,e,i){switch(e){case"h":return fe(ye.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return me(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 gk extends Wt{priority=70;parse(t,e,i){switch(e){case"H":return fe(ye.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return me(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 yk extends Wt{priority=70;parse(t,e,i){switch(e){case"K":return fe(ye.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return me(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 _k extends Wt{priority=70;parse(t,e,i){switch(e){case"k":return fe(ye.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return me(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 bk extends Wt{priority=60;parse(t,e,i){switch(e){case"m":return fe(ye.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return me(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 xk extends Wt{priority=50;parse(t,e,i){switch(e){case"s":return fe(ye.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return me(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 wk extends Wt{priority=30;parse(t,e){const i=r=>Math.trunc(r*Math.pow(10,-e.length+3));return _e(me(e.length,t),i)}set(t,e,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class vk extends Wt{priority=10;parse(t,e){switch(e){case"X":return Yn(Vn.basicOptionalMinutes,t);case"XX":return Yn(Vn.basic,t);case"XXXX":return Yn(Vn.basicOptionalSeconds,t);case"XXXXX":return Yn(Vn.extendedOptionalSeconds,t);default:return Yn(Vn.extended,t)}}set(t,e,i){return e.timestampIsSet?t:pe(t,t.getTime()-fa(t)-i)}incompatibleTokens=["t","T","x"]}class Sk extends Wt{priority=10;parse(t,e){switch(e){case"x":return Yn(Vn.basicOptionalMinutes,t);case"xx":return Yn(Vn.basic,t);case"xxxx":return Yn(Vn.basicOptionalSeconds,t);case"xxxxx":return Yn(Vn.extendedOptionalSeconds,t);default:return Yn(Vn.extended,t)}}set(t,e,i){return e.timestampIsSet?t:pe(t,t.getTime()-fa(t)-i)}incompatibleTokens=["t","T","X"]}class Tk extends Wt{priority=40;parse(t){return Sp(t)}set(t,e,i){return[pe(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class Mk extends Wt{priority=20;parse(t){return Sp(t)}set(t,e,i){return[pe(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const kk={G:new VM,y:new YM,Y:new qM,R:new jM,u:new GM,Q:new KM,q:new XM,M:new ZM,L:new QM,w:new tk,I:new nk,d:new sk,D:new ok,E:new ak,e:new lk,c:new ck,i:new dk,a:new fk,b:new hk,B:new pk,h:new mk,H:new gk,K:new yk,k:new _k,m:new bk,s:new xk,S:new wk,X:new vk,x:new Sk,t:new Tk,T:new Mk},Dk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ck=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ok=/^'([^]*?)'?$/,Ak=/''/g,Ek=/\S/,Rk=/[a-zA-Z]/;function Pk(n,t,e,i){const r=()=>pe(i?.in||e,NaN),s=wp(),a=i?.locale??s.locale??dp,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():Et(e,i?.in);const d={firstWeekContainsDate:l,weekStartsOn:u,locale:a},p=[new $M(i?.in,e)],m=t.match(Ck).map(S=>{const C=S[0];if(C in Nc){const A=Nc[C];return A(S,a.formatLong)}return S}).join("").match(Dk),g=[];for(let S of m){!i?.useAdditionalWeekYearTokens&&xp(S)&&Bc(S,t,n),!i?.useAdditionalDayOfYearTokens&&bp(S)&&Bc(S,t,n);const C=S[0],A=kk[C];if(A){const{incompatibleTokens:B}=A;if(Array.isArray(B)){const I=g.find($=>B.includes($.token)||$.token===C);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${S}\` at the same time`)}else if(A.incompatibleTokens==="*"&&g.length>0)throw new RangeError(`The format string mustn't contain \`${S}\` and any other token at the same time`);g.push({token:C,fullToken:S});const P=A.run(n,S,a.match,d);if(!P)return r();p.push(P.setter),n=P.rest}else{if(C.match(Rk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");if(S==="''"?S="'":C==="'"&&(S=Ik(S)),n.indexOf(S)===0)n=n.slice(S.length);else return r()}}if(n.length>0&&Ek.test(n))return r();const _=p.map(S=>S.priority).sort((S,C)=>C-S).filter((S,C,A)=>A.indexOf(S)===C).map(S=>p.filter(C=>C.priority===S).sort((C,A)=>A.subPriority-C.subPriority)).map(S=>S[0]);let x=Et(e,i?.in);if(isNaN(+x))return r();const w={};for(const S of _){if(!S.validate(x,d))return r();const C=S.set(x,w,d);Array.isArray(C)?(x=C[0],Object.assign(w,C[1])):x=C}return x}function Ik(n){return n.match(Ok)[1].replace(Ak,"'")}function Lk(n,t){const e=Et(n,t?.in);return e.setMinutes(0,0,0),e}function Nk(n,t){const e=Et(n,t?.in);return e.setSeconds(0,0),e}function Bk(n,t){const e=Et(n,t?.in);return e.setMilliseconds(0),e}function kp(n){const t=n/zr;return Math.trunc(t)}function Dp(n,t){const e=()=>pe(t?.in,NaN),i=t?.additionalDigits??2,r=Hk(n);let s;if(r.date){const d=Wk(r.date,i);s=$k(d.restDateString,d.year)}if(!s||isNaN(+s))return e();const a=+s;let l=0,u;if(r.time&&(l=Vk(r.time),isNaN(l)))return e();if(r.timezone){if(u=Yk(r.timezone),isNaN(u))return e()}else{const d=new Date(a+l),p=Et(0,t?.in);return p.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),p.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),p}return Et(a+l+u,t?.in)}const ma={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Fk=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,zk=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Uk=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Hk(n){const t={},e=n.split(ma.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],ma.timeZoneDelimiter.test(t.date)&&(t.date=n.split(ma.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const r=ma.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function Wk(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 $k(n,t){if(t===null)return new Date(NaN);const e=n.match(Fk);if(!e)return new Date(NaN);const i=!!e[4],r=Fs(e[1]),s=Fs(e[2])-1,a=Fs(e[3]),l=Fs(e[4]),u=Fs(e[5])-1;if(i)return Xk(t,l,u)?qk(t,l,u):new Date(NaN);{const d=new Date(0);return!Gk(t,s,a)||!Kk(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function Fs(n){return n?parseInt(n):1}function Vk(n){const t=n.match(zk);if(!t)return NaN;const e=Uc(t[1]),i=Uc(t[2]),r=Uc(t[3]);return Zk(e,i,r)?e*zr+i*Ps+r*1e3:NaN}function Uc(n){return n&&parseFloat(n.replace(",","."))||0}function Yk(n){if(n==="Z")return 0;const t=n.match(Uk);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return Qk(i,r)?e*(i*zr+r*Ps):NaN}function qk(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 jk=[31,null,31,30,31,30,31,31,30,31,30,31];function Cp(n){return n%400===0||n%4===0&&n%100!==0}function Gk(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(jk[t]||(Cp(n)?29:28))}function Kk(n,t){return t>=1&&t<=(Cp(n)?366:365)}function Xk(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Zk(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Qk(n,t){return t>=0&&t<=59}const Op={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_consumer_group:"AI gateway consumer group",ai_gateway_data_plane_node:"AI gateway data plane node",ai_gateway_mcp_server:"AI gateway MCP server",ai_gateway_model:"AI gateway model",ai_plugin:"AI plugin",ai_provider:"Provider",ai_request_model:"Request model",ai_response_model:"Response model",error_rate:"Error rate",request_count:"Request count",share_of_requests:"Share of requests",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",response_latency_average:"Response latency (avg)",response_latency_p99:"Response latency (p99)",response_latency_p95:"Response latency (p95)",response_latency_p50:"Response latency (p50)",kong_latency_average:"Kong latency (avg)",kong_latency_p99:"Kong latency (p99)",kong_latency_p95:"Kong latency (p95)",kong_latency_p50:"Kong latency (p50)",kong_internal_latency_average:"Kong internal latency (avg)",kong_internal_latency_p99:"Kong internal latency (p99)",kong_internal_latency_p95:"Kong internal latency (p95)",kong_internal_latency_p50:"Kong internal latency (p50)",llm_cache_status:"Cache status",llm_embeddings_model:"Embeddings model",llm_embeddings_provider:"Embeddings provider",upstream_latency_average:"Upstream latency (avg)",upstream_latency_p99:"Upstream latency (p99)",upstream_latency_p95:"Upstream latency (p95)",upstream_latency_p50:"Upstream latency (p50)",response_size_p99:"Response size (p99)",response_size_p95:"Response size (p95)",response_size_p50:"Response size (p50)",response_size_average:"Response size (avg)",response_size_sum:"Response size (sum)",response_source:"Response source",request_size_p99:"Request size (p99)",request_size_p95:"Request size (p95)",request_size_p50:"Request size (p50)",request_size_average:"Request size (avg)",request_size_sum:"Request size (sum)",control_plane:"Control plane",control_plane_group:"Control plane group",consumer:"Consumer",consumer_group:"Consumer group",oidc_credential:"OIDC credential",country_code:"Country",country:"Country",data_plane_node:"Data plane node",data_plane_node_version:"Data plane node version",api_package:"API package",api_product:"API product",api_product_version:"API product version",portal:"Portal",realm:"Realm",runtime_group:"Runtime group",gateway_service:"Gateway service",route:"Route",application:"Application",status_code:"Status code",status_code_grouped:"Status code (grouped)",total_tokens_per_minute:"Total tokens per minute",upstream_status_code:"Upstream status code",upstream_status_code_grouped:"Upstream status code group",time:"Time",Service:"Service",ServiceVersion:"Service version",Route:"Route",Application:"Application",RuntimeGroup:"Runtime group",GatewayService:"Gateway service",StatusCode:"Status code",CodeClass:"Status code (grouped)",Time:"Time",API_PRODUCT:"Api product",API_PRODUCT_VERSION:"Api product version",RUNTIME_GROUP:"Runtime group",GATEWAY_SERVICE:"Gateway service",ROUTE:"Route",APPLICATION:"Application",STATUS_CODE:"Status code",STATUS_CODE_GROUPED:"Status code (grouped)",TIME:"Time",ORGANIZATION:"Organization",TotalRequests:"Request count",RequestsPerMinute:"Requests per minute",LatencyP99:"Response latency (p99)",LatencyP95:"Response latency (p95)",LatencyP50:"Response latency (p50)",LatencyAverage:"Response latency (avg)",UpstreamLatencyP99:"Upstream latency (p99)",UpstreamLatencyP95:"Upstream latency (p95)",UpstreamLatencyP50:"Upstream latency (p50)",UpstreamLatencyAverage:"Upstream latency (avg)",KongLatencyP99:"Kong latency (p99)",KongLatencyP95:"Kong latency (p95)",KongLatencyP50:"Kong latency (p50)",KongLatencyAverage:"Kong latency (avg)",ResponseSizeP99:"Response size (p99)",ResponseSizeP95:"Response size (p95)",ResponseSizeP50:"Response size (p50)",RequestSizeP99:"Request size (p99)",RequestSizeP95:"Request size (p95)",RequestSizeP50:"Request size (p50)",SuccessfulRequests:"Successful requests",SUCCESS:"Successful requests",FailedRequests:"Failed requests",FAILURE:"Failed requests","5XX":"5xx","4XX":"4xx","3XX":"3xx","2XX":"2xx","1XX":"1xx",REQUEST_COUNT:"Request count",REQUEST_PER_MINUTE:"Requests per minute",RESPONSE_LATENCY_P99:"Response latency",RESPONSE_LATENCY_P95:"Response latency",RESPONSE_LATENCY_P50:"Response latency",RESPONSE_SIZE_P99:"Response size (p99)",RESPONSE_SIZE_P95:"Response size (p95)",RESPONSE_SIZE_P50:"Response size (p50)",REQUEST_SIZE_P99:"Request size (p99)",REQUEST_SIZE_P95:"Request size (p95)",REQUEST_SIZE_P50:"Request size (p50)",CONTROL_PLANE:"Control plane",____OTHER____:"Others",ai_request_count:"Request count",total_tokens:"Total token count",prompt_tokens:"Prompt token count",completion_tokens:"Completion token count",cost:"Costs",cost_per_request_average:"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 Jk(){const n=Jf.createI18n("en-us",Op);return{i18n:n,i18nT:Jf.i18nTComponent(n)}}function zs(n){return n+.5|0}const Mi=(n,t,e)=>Math.max(Math.min(n,e),t);function Us(n){return Mi(zs(n*2.55),0,255)}function ki(n){return Mi(zs(n*255),0,255)}function ii(n){return Mi(zs(n/2.55)/100,0,1)}function Ap(n){return Mi(zs(n*100),0,100)}const kn={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},Hc=[..."0123456789ABCDEF"],tD=n=>Hc[n&15],eD=n=>Hc[(n&240)>>4]+Hc[n&15],ga=n=>(n&240)>>4===(n&15),nD=n=>ga(n.r)&&ga(n.g)&&ga(n.b)&&ga(n.a);function iD(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&kn[n[1]]*17,g:255&kn[n[2]]*17,b:255&kn[n[3]]*17,a:t===5?kn[n[4]]*17:255}:(t===7||t===9)&&(e={r:kn[n[1]]<<4|kn[n[2]],g:kn[n[3]]<<4|kn[n[4]],b:kn[n[5]]<<4|kn[n[6]],a:t===9?kn[n[7]]<<4|kn[n[8]]:255})),e}const rD=(n,t)=>n<255?t(n):"";function sD(n){var t=nD(n)?tD:eD;return n?"#"+t(n.r)+t(n.g)+t(n.b)+rD(n.a,t):void 0}const oD=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ep(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 aD(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 lD(n,t,e){const i=Ep(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 cD(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 Wc(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,p;return s!==a&&(p=s-a,d=l>.5?p/(2-s-a):p/(s+a),u=cD(e,i,r,p,s),u=u*60+.5),[u|0,d||0,l]}function $c(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(ki)}function Vc(n,t,e){return $c(Ep,n,t,e)}function uD(n,t,e){return $c(lD,n,t,e)}function dD(n,t,e){return $c(aD,n,t,e)}function Rp(n){return(n%360+360)%360}function fD(n){const t=oD.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Us(+t[5]):ki(+t[5]));const r=Rp(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=uD(r,s,a):t[1]==="hsv"?i=dD(r,s,a):i=Vc(r,s,a),{r:i[0],g:i[1],b:i[2],a:e}}function hD(n,t){var e=Wc(n);e[0]=Rp(e[0]+t),e=Vc(e),n.r=e[0],n.g=e[1],n.b=e[2]}function pD(n){if(!n)return;const t=Wc(n),e=t[0],i=Ap(t[1]),r=Ap(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${r}%, ${ii(n.a)})`:`hsl(${e}, ${i}%, ${r}%)`}const Pp={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"},Ip={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 mD(){const n={},t=Object.keys(Ip),e=Object.keys(Pp);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,Pp[s]);s=parseInt(Ip[a],16),n[l]=[s>>16&255,s>>8&255,s&255]}return n}let ya;function gD(n){ya||(ya=mD(),ya.transparent=[0,0,0,0]);const t=ya[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const yD=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function _D(n){const t=yD.exec(n);let e=255,i,r,s;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?Us(a):Mi(a*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?Us(i):Mi(i,0,255)),r=255&(t[4]?Us(r):Mi(r,0,255)),s=255&(t[6]?Us(s):Mi(s,0,255)),{r:i,g:r,b:s,a:e}}}function bD(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ii(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Yc=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Wr=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function xD(n,t,e){const i=Wr(ii(n.r)),r=Wr(ii(n.g)),s=Wr(ii(n.b));return{r:ki(Yc(i+e*(Wr(ii(t.r))-i))),g:ki(Yc(r+e*(Wr(ii(t.g))-r))),b:ki(Yc(s+e*(Wr(ii(t.b))-s))),a:n.a+e*(t.a-n.a)}}function _a(n,t,e){if(n){let i=Wc(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Vc(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Lp(n,t){return n&&Object.assign(t||{},n)}function Np(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=ki(n[3]))):(t=Lp(n,{r:0,g:0,b:0,a:1}),t.a=ki(t.a)),t}function wD(n){return n.charAt(0)==="r"?_D(n):fD(n)}class Hs{constructor(t){if(t instanceof Hs)return t;const e=typeof t;let i;e==="object"?i=Np(t):e==="string"&&(i=iD(t)||gD(t)||wD(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Lp(this._rgb);return t&&(t.a=ii(t.a)),t}set rgb(t){this._rgb=Np(t)}rgbString(){return this._valid?bD(this._rgb):void 0}hexString(){return this._valid?sD(this._rgb):void 0}hslString(){return this._valid?pD(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=xD(this._rgb,t._rgb,e)),this}clone(){return new Hs(this.rgb)}alpha(t){return this._rgb.a=ki(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=zs(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 _a(this._rgb,2,t),this}darken(t){return _a(this._rgb,2,-t),this}saturate(t){return _a(this._rgb,1,t),this}desaturate(t){return _a(this._rgb,1,-t),this}rotate(t){return hD(this._rgb,t),this}}function ri(){}const vD=(()=>{let n=0;return()=>n++})();function St(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 mn(n,t){return ae(n)?n:t}function Ct(n,t){return typeof n>"u"?t:n}const SD=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Bp=(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 ba(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 xa(n){if(qt(n))return n.map(xa);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]]=xa(n[e[r]]);return t}return n}function Fp(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function TD(n,t,e,i){if(!Fp(n))return;const r=t[n],s=e[n];It(r)&&It(s)?Ws(r,s,i):t[n]=xa(s)}function Ws(n,t,e){const i=qt(t)?t:[t],r=i.length;if(!It(n))return n;e=e||{};const s=e.merger||TD;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,p=u.length;d<p;++d)s(u[d],n,a,e)}return n}function $s(n,t){return Ws(n,t,{merger:MD})}function MD(n,t,e){if(!Fp(n))return;const i=t[n],r=e[n];It(i)&&It(r)?$s(i,r):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=xa(r))}const zp={"":n=>n,x:n=>n.x,y:n=>n.y};function kD(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 DD(n){const t=kD(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function Di(n,t){return(zp[t]||(zp[t]=DD(t)))(n)}function qc(n){return n.charAt(0).toUpperCase()+n.slice(1)}const rn=n=>typeof n<"u",sn=n=>typeof n=="function",Up=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function CD(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Rt=Math.PI,te=2*Rt,OD=te+Rt,wa=Number.POSITIVE_INFINITY,jc=Rt/180,re=Rt/2,Dn=Rt/4,va=Rt*2/3,Ci=Math.log10,qn=Math.sign;function Vs(n,t,e){return Math.abs(n-t)<e}function Hp(n){const t=Math.round(n);n=Vs(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(Ci(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function AD(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 ED(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function Oi(n){return!ED(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function RD(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Wp(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 we(n){return n*(Rt/180)}function Sa(n){return n*(180/Rt)}function $p(n){if(!ae(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function Ta(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*Rt&&(s+=te),{angle:s,distance:r}}function $r(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function PD(n,t){return(n-t+OD)%te-Rt}function He(n){return(n%te+te)%te}function Ys(n,t,e,i){const r=He(n),s=He(t),a=He(e),l=He(s-r),u=He(a-r),d=He(r-s),p=He(r-a);return r===s||r===a||i&&s===a||l>u&&d<p}function Oe(n,t,e){return Math.max(t,Math.min(e,n))}function ID(n){return Oe(n,-32768,32767)}function si(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Gc(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 oi=(n,t,e,i)=>Gc(n,e,i?r=>{const s=n[r][t];return s<e||s===e&&n[r+1][t]===e}:r=>n[r][t]<e),LD=(n,t,e)=>Gc(n,e,i=>n[i][t]>=e);function ND(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 Vp=["push","pop","shift","splice","unshift"];function BD(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Vp.forEach(e=>{const i="_onData"+qc(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 Yp(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)&&(Vp.forEach(s=>{delete n[s]}),delete n._chartjs)}function qp(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const jp=(function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame})();function Gp(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,jp.call(window,()=>{i=!1,n.apply(t,e)}))}}function FD(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Kc=n=>n==="start"?"left":n==="end"?"right":"center",We=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,zD=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Kp(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,p=a.axis,{min:m,max:g,minDefined:_,maxDefined:x}=a.getUserBounds();if(_){if(r=Math.min(oi(u,p,m).lo,e?i:oi(t,p,a.getPixelForValue(m)).lo),d){const w=u.slice(0,r+1).reverse().findIndex(S=>!St(S[l.axis]));r-=Math.max(0,w)}r=Oe(r,0,i-1)}if(x){let w=Math.max(oi(u,a.axis,g,!0).hi+1,e?0:oi(t,p,a.getPixelForValue(g),!0).hi+1);if(d){const S=u.slice(w-1).findIndex(C=>!St(C[l.axis]));w+=Math.max(0,S)}s=Oe(w,r,i)-r}else s=i-r}return{start:r,count:s}}function Xp(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 Ma=n=>n===0||n===1,Zp=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*te/e)),Qp=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*te/e)+1,qs={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(Rt*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Ma(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=>Ma(n)?n:Zp(n,.075,.3),easeOutElastic:n=>Ma(n)?n:Qp(n,.075,.3),easeInOutElastic(n){return Ma(n)?n:n<.5?.5*Zp(n*2,.1125,.45):.5+.5*Qp(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-qs.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?qs.easeInBounce(n*2)*.5:qs.easeOutBounce(n*2-1)*.5+.5};function Xc(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ka(n){return Xc(n)?n:new Hs(n)}function Zc(n){return Xc(n)?n:new Hs(n).saturate(.5).darken(.1).hexString()}const UD=["x","y","borderWidth","radius","tension"],HD=["color","borderColor","backgroundColor"];function WD(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:HD},numbers:{type:"number",properties:UD}}),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 $D(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Jp=new Map;function VD(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Jp.get(e);return i||(i=new Intl.NumberFormat(n,t),Jp.set(e,i)),i}function js(n,t,e){return VD(t,e).format(n)}const tm={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=YD(n,e)}const a=Ci(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),js(n,i,u)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(Ci(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?tm.numeric.call(this,n,t,e):""}};function YD(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 Da={formatters:tm};function qD(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:Da.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 ar=Object.create(null),Qc=Object.create(null);function Gs(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 Jc(n,t,e){return typeof t=="string"?Ws(Gs(n,t),e):Ws(Gs(n,""),t)}class jD{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)=>Zc(r.backgroundColor),this.hoverBorderColor=(i,r)=>Zc(r.borderColor),this.hoverColor=(i,r)=>Zc(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 Jc(this,t,e)}get(t){return Gs(this,t)}describe(t,e){return Jc(Qc,t,e)}override(t,e){return Jc(ar,t,e)}route(t,e,i,r){const s=Gs(this,t),a=Gs(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 jD({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[WD,$D,qD]);function GD(n){return!n||St(n.size)||St(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Ca(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 KD(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,p,m,g;for(u=0;u<l;u++)if(m=e[u],m!=null&&!qt(m))a=Ca(n,r,s,a,m);else if(qt(m))for(d=0,p=m.length;d<p;d++)g=m[d],g!=null&&!qt(g)&&(a=Ca(n,r,s,a,g));n.restore();const _=s.length/2;if(_>e.length){for(u=0;u<_;u++)delete r[s[u]];s.splice(0,_)}return a}function lr(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 em(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function tu(n,t,e,i){nm(n,t,e,i,null)}function nm(n,t,e,i,r){let s,a,l,u,d,p,m,g;const _=t.pointStyle,x=t.rotation,w=t.radius;let S=(x||0)*jc;if(_&&typeof _=="object"&&(s=_.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(S),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":p=r?r/2:w,n.moveTo(e+Math.sin(S)*p,i-Math.cos(S)*w),S+=va,n.lineTo(e+Math.sin(S)*p,i-Math.cos(S)*w),S+=va,n.lineTo(e+Math.sin(S)*p,i-Math.cos(S)*w),n.closePath();break;case"rectRounded":d=w*.516,u=w-d,a=Math.cos(S+Dn)*u,m=Math.cos(S+Dn)*(r?r/2-d:u),l=Math.sin(S+Dn)*u,g=Math.sin(S+Dn)*(r?r/2-d:u),n.arc(e-m,i-l,d,S-Rt,S-re),n.arc(e+g,i-a,d,S-re,S),n.arc(e+m,i+l,d,S,S+re),n.arc(e-g,i+a,d,S+re,S+Rt),n.closePath();break;case"rect":if(!x){u=Math.SQRT1_2*w,p=r?r/2:u,n.rect(e-p,i-u,2*p,2*u);break}S+=Dn;case"rectRot":m=Math.cos(S)*(r?r/2:w),a=Math.cos(S)*w,l=Math.sin(S)*w,g=Math.sin(S)*(r?r/2:w),n.moveTo(e-m,i-l),n.lineTo(e+g,i-a),n.lineTo(e+m,i+l),n.lineTo(e-g,i+a),n.closePath();break;case"crossRot":S+=Dn;case"cross":m=Math.cos(S)*(r?r/2:w),a=Math.cos(S)*w,l=Math.sin(S)*w,g=Math.sin(S)*(r?r/2:w),n.moveTo(e-m,i-l),n.lineTo(e+m,i+l),n.moveTo(e+g,i-a),n.lineTo(e-g,i+a);break;case"star":m=Math.cos(S)*(r?r/2:w),a=Math.cos(S)*w,l=Math.sin(S)*w,g=Math.sin(S)*(r?r/2:w),n.moveTo(e-m,i-l),n.lineTo(e+m,i+l),n.moveTo(e+g,i-a),n.lineTo(e-g,i+a),S+=Dn,m=Math.cos(S)*(r?r/2:w),a=Math.cos(S)*w,l=Math.sin(S)*w,g=Math.sin(S)*(r?r/2:w),n.moveTo(e-m,i-l),n.lineTo(e+m,i+l),n.moveTo(e+g,i-a),n.lineTo(e-g,i+a);break;case"line":a=r?r/2:Math.cos(S)*w,l=Math.sin(S)*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(S)*(r?r/2:w),i+Math.sin(S)*w);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function ai(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 Ks(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Xs(n){n.restore()}function XD(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 ZD(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 QD(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),St(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function JD(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,p=r.strikethrough?(u+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=r.decorationWidth||2,n.moveTo(a,p),n.lineTo(l,p),n.stroke()}}function tC(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function cr(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,QD(n,s),u=0;u<a.length;++u)d=a[u],s.backdrop&&tC(n,s.backdrop),l&&(s.strokeColor&&(n.strokeStyle=s.strokeColor),St(s.strokeWidth)||(n.lineWidth=s.strokeWidth),n.strokeText(d,e,i,s.maxWidth)),n.fillText(d,e,i,s.maxWidth),JD(n,e,i,d,s),i+=Number(r.lineHeight);n.restore()}function Vr(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*Rt,Rt,!0),n.lineTo(e,i+s-a.bottomLeft),n.arc(e+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,Rt,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 eC=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,nC=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function iC(n,t){const e=(""+n).match(eC);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 rC=n=>+n||0;function eu(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]=rC(s(a));return e}function im(n){return eu(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Ai(n){return eu(n,["topLeft","topRight","bottomLeft","bottomRight"])}function ve(n){const t=im(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(nC)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Ct(n.family,t.family),lineHeight:iC(Ct(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:Ct(n.weight,t.weight),string:""};return r.string=GD(r),r}function Zs(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 sC(n,t,e){const{min:i,max:r}=n,s=Bp(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 Ei(n,t){return Object.assign(Object.create(n),t)}function nu(n,t=[""],e,i,r=()=>n[0]){const s=e||n;typeof i>"u"&&(i=lm("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>nu([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 sm(l,u,()=>hC(u,t,n,l))},getOwnPropertyDescriptor(l,u){return Reflect.getOwnPropertyDescriptor(l._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,u){return cm(l).includes(u)},ownKeys(l){return cm(l)},set(l,u,d){const p=l._storage||(l._storage=r());return l[u]=p[u]=d,delete l._keys,!0}})}function Yr(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:rm(n,i),setContext:s=>Yr(n,s,e,i),override:s=>Yr(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 sm(s,a,()=>aC(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 rm(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:sn(e)?e:()=>e,isIndexable:sn(i)?i:()=>i}}const oC=(n,t)=>n?n+qc(t):t,iu=(n,t)=>It(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function sm(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function aC(n,t,e){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=n;let l=i[t];return sn(l)&&a.isScriptable(t)&&(l=lC(t,l,n,e)),qt(l)&&l.length&&(l=cC(t,l,n,a.isIndexable)),iu(t,l)&&(l=Yr(l,r,s&&s[t],a)),l}function lC(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),iu(n,u)&&(u=ru(r._scopes,r,n,u)),u}function cC(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(p=>p!==u);t=[];for(const p of u){const m=ru(d,r,n,p);t.push(Yr(m,s,a&&a[n],l))}}return t}function om(n,t,e){return sn(n)?n(t,e):n}const uC=(n,t)=>n===!0?t:typeof n=="string"?Di(t,n):void 0;function dC(n,t,e,i,r){for(const s of t){const a=uC(e,s);if(a){n.add(a);const l=om(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 ru(n,t,e,i){const r=t._rootScopes,s=om(t._fallback,e,i),a=[...n,...r],l=new Set;l.add(i);let u=am(l,a,e,s||e,i);return u===null||typeof s<"u"&&s!==e&&(u=am(l,a,s,u,i),u===null)?!1:nu(Array.from(l),[""],r,s,()=>fC(t,e,i))}function am(n,t,e,i,r){for(;e;)e=dC(n,t,e,i,r);return e}function fC(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return qt(r)&&It(e)?e:r||{}}function hC(n,t,e,i){let r;for(const s of t)if(r=lm(oC(s,n),e),typeof r<"u")return iu(n,r)?ru(e,i,n,r):r}function lm(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function cm(n){let t=n._keys;return t||(t=n._keys=pC(n._scopes)),t}function pC(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 um(n,t,e,i){const{iScale:r}=n,{key:s="r"}=this._parsing,a=new Array(i);let l,u,d,p;for(l=0,u=i;l<u;++l)d=l+e,p=t[d],a[l]={r:r.parse(Di(p,s),d)};return a}const mC=Number.EPSILON||1e-14,qr=(n,t)=>t<n.length&&!n[t].skip&&n[t],dm=n=>n==="x"?"y":"x";function gC(n,t,e,i){const r=n.skip?t:n,s=t,a=e.skip?t:e,l=$r(s,r),u=$r(a,s);let d=l/(l+u),p=u/(l+u);d=isNaN(d)?0:d,p=isNaN(p)?0:p;const m=i*d,g=i*p;return{previous:{x:s.x-m*(a.x-r.x),y:s.y-m*(a.y-r.y)},next:{x:s.x+g*(a.x-r.x),y:s.y+g*(a.y-r.y)}}}function yC(n,t,e){const i=n.length;let r,s,a,l,u,d=qr(n,0);for(let p=0;p<i-1;++p)if(u=d,d=qr(n,p+1),!(!u||!d)){if(Vs(t[p],0,mC)){e[p]=e[p+1]=0;continue}r=e[p]/t[p],s=e[p+1]/t[p],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(a=3/Math.sqrt(l),e[p]=r*a*t[p],e[p+1]=s*a*t[p])}}function _C(n,t,e="x"){const i=dm(e),r=n.length;let s,a,l,u=qr(n,0);for(let d=0;d<r;++d){if(a=l,l=u,u=qr(n,d+1),!l)continue;const p=l[e],m=l[i];a&&(s=(p-a[e])/3,l[`cp1${e}`]=p-s,l[`cp1${i}`]=m-s*t[d]),u&&(s=(u[e]-p)/3,l[`cp2${e}`]=p+s,l[`cp2${i}`]=m+s*t[d])}}function bC(n,t="x"){const e=dm(t),i=n.length,r=Array(i).fill(0),s=Array(i);let a,l,u,d=qr(n,0);for(a=0;a<i;++a)if(l=u,u=d,d=qr(n,a+1),!!u){if(d){const p=d[t]-u[t];r[a]=p!==0?(d[e]-u[e])/p:0}s[a]=l?d?qn(r[a-1])!==qn(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}yC(n,r,s),_C(n,s,t)}function Oa(n,t,e){return Math.max(Math.min(n,e),t)}function xC(n,t){let e,i,r,s,a,l=ai(n[0],t);for(e=0,i=n.length;e<i;++e)a=s,s=l,l=e<i-1&&ai(n[e+1],t),s&&(r=n[e],a&&(r.cp1x=Oa(r.cp1x,t.left,t.right),r.cp1y=Oa(r.cp1y,t.top,t.bottom)),l&&(r.cp2x=Oa(r.cp2x,t.left,t.right),r.cp2y=Oa(r.cp2y,t.top,t.bottom)))}function wC(n,t,e,i,r){let s,a,l,u;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")bC(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=gC(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&&xC(n,e)}function su(){return typeof window<"u"&&typeof document<"u"}function ou(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Aa(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 Ea=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function vC(n,t){return Ea(n).getPropertyValue(t)}const SC=["top","right","bottom","left"];function ur(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const s=SC[r];i[s]=parseFloat(n[t+"-"+s+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const TC=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function MC(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:s}=i;let a=!1,l,u;if(TC(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=Ea(e),s=r.boxSizing==="border-box",a=ur(r,"padding"),l=ur(r,"border","width"),{x:u,y:d,box:p}=MC(n,e),m=a.left+(p&&l.left),g=a.top+(p&&l.top);let{width:_,height:x}=t;return s&&(_-=a.width+l.width,x-=a.height+l.height),{x:Math.round((u-m)/_*e.width/i),y:Math.round((d-g)/x*e.height/i)}}function kC(n,t,e){let i,r;if(t===void 0||e===void 0){const s=n&&ou(n);if(!s)t=n.clientWidth,e=n.clientHeight;else{const a=s.getBoundingClientRect(),l=Ea(s),u=ur(l,"border","width"),d=ur(l,"padding");t=a.width-d.width-u.width,e=a.height-d.height-u.height,i=Aa(l.maxWidth,s,"clientWidth"),r=Aa(l.maxHeight,s,"clientHeight")}}return{width:t,height:e,maxWidth:i||wa,maxHeight:r||wa}}const Pi=n=>Math.round(n*10)/10;function DC(n,t,e,i){const r=Ea(n),s=ur(r,"margin"),a=Aa(r.maxWidth,n,"clientWidth")||wa,l=Aa(r.maxHeight,n,"clientHeight")||wa,u=kC(n,t,e);let{width:d,height:p}=u;if(r.boxSizing==="content-box"){const g=ur(r,"border","width"),_=ur(r,"padding");d-=_.width+g.width,p-=_.height+g.height}return d=Math.max(0,d-s.width),p=Math.max(0,i?d/i:p-s.height),d=Pi(Math.min(d,a,u.maxWidth)),p=Pi(Math.min(p,l,u.maxHeight)),d&&!p&&(p=Pi(d/2)),(t!==void 0||e!==void 0)&&i&&u.height&&p>u.height&&(p=u.height,d=Pi(Math.floor(p*i))),{width:d,height:p}}function fm(n,t,e){const i=t||1,r=Pi(n.height*i),s=Pi(n.width*i);n.height=Pi(n.height),n.width=Pi(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 CC=(function(){let n=!1;try{const t={get passive(){return n=!0,!1}};su()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n})();function hm(n,t){const e=vC(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function dr(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function OC(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 AC(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},s={x:t.cp1x,y:t.cp1y},a=dr(n,r,e),l=dr(r,s,e),u=dr(s,t,e),d=dr(a,l,e),p=dr(l,u,e);return dr(d,p,e)}const EC=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}}},RC=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function jr(n,t,e){return n?EC(t,e):RC()}function pm(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 mm(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function gm(n){return n==="angle"?{between:Ys,compare:PD,normalize:He}:{between:si,compare:(t,e)=>t-e,normalize:t=>t}}function ym({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 PC(n,t,e){const{property:i,start:r,end:s}=e,{between:a,normalize:l}=gm(i),u=t.length;let{start:d,end:p,loop:m}=n,g,_;if(m){for(d+=u,p+=u,g=0,_=u;g<_&&a(l(t[d%u][i]),r,s);++g)d--,p--;d%=u,p%=u}return p<d&&(p+=u),{start:d,end:p,loop:m,style:n.style}}function _m(n,t,e){if(!e)return[n];const{property:i,start:r,end:s}=e,a=t.length,{compare:l,between:u,normalize:d}=gm(i),{start:p,end:m,loop:g,style:_}=PC(n,t,e),x=[];let w=!1,S=null,C,A,B;const P=()=>u(r,B,C)&&l(r,B)!==0,I=()=>l(s,C)===0||u(s,B,C),$=()=>w||P(),z=()=>!w||I();for(let v=p,M=p;v<=m;++v)A=t[v%a],!A.skip&&(C=d(A[i]),C!==B&&(w=u(C,r,s),S===null&&$()&&(S=l(C,r)===0?v:M),S!==null&&z()&&(x.push(ym({start:S,end:v,loop:g,count:a,style:_})),S=null),M=v,B=C));return S!==null&&x.push(ym({start:S,end:m,loop:g,count:a,style:_})),x}function bm(n,t){const e=[],i=n.segments;for(let r=0;r<i.length;r++){const s=_m(i[r],n.points,t);s.length&&e.push(...s)}return e}function IC(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 LC(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 NC(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const s=!!n._loop,{start:a,end:l}=IC(e,r,s,i);if(i===!0)return xm(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 xm(n,LC(e,a,u,d),e,t)}function xm(n,t,e,i){return!i||!i.setContext||!e?t:BC(n,t,e,i)}function BC(n,t,e,i){const r=n._chart.getContext(),s=wm(n.options),{_datasetIndex:a,options:{spanGaps:l}}=n,u=e.length,d=[];let p=s,m=t[0].start,g=m;function _(x,w,S,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:S,style:C}),p=C,m=w%u)}}for(const x of t){m=l?m:x.start;let w=e[m%u],S;for(g=m+1;g<=x.end;g++){const C=e[g%u];S=wm(i.setContext(Ei(r,{type:"segment",p0:w,p1:C,p0DataIndex:(g-1)%u,p1DataIndex:g%u,datasetIndex:a}))),FC(S,p)&&_(m,g-1,x.loop,p),w=C,p=S}m<g-1&&_(m,g-1,x.loop,p)}return d}function wm(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function FC(n,t){if(!t)return!1;const e=[],i=function(r,s){return Xc(s)?(e.includes(s)||e.push(s),e.indexOf(s)):s};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function Ra(n,t,e){return n.options.clip?n[e]:t[e]}function zC(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Ra(e,t,"left"),right:Ra(e,t,"right"),top:Ra(i,t,"top"),bottom:Ra(i,t,"bottom")}:t}function vm(n,t){const e=t._clip;if(e.disabled)return!1;const i=zC(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 UC{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=jp.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 li=new UC;const Sm="transparent",HC={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=ka(n||Sm),r=i.valid&&ka(t||Sm);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class WC{constructor(t,e,i,r){const s=e[i];r=Zs([t.to,r,s,t.from]);const a=Zs([t.from,s,r]);this._active=!0,this._fn=t.fn||HC[t.type||typeof a],this._easing=qs[t.easing]||qs.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=Zs([t.to,e,r,t.from]),this._from=Zs([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 au{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=VC(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&$C(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 p=e[d];let m=s[d];const g=i.get(d);if(m)if(g&&m.active()){m.update(g,p,l);continue}else m.cancel();if(!g||!g.duration){t[d]=p;continue}s[d]=m=new WC(g,t,d,p),r.push(m)}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 li.add(this._chart,i),!0}}function $C(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 VC(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 Tm(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 YC(n,t,e){if(e===!1)return!1;const i=Tm(n,e),r=Tm(t,e);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function qC(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 Mm(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 km(n,t,e,i={}){const r=n.keys,s=i.mode==="single";let a,l,u,d;if(t===null)return;let p=!1;for(a=0,l=r.length;a<l;++a){if(u=+r[a],u===e){if(p=!0,i.all)continue;break}d=n.values[u],ae(d)&&(s||t===0||qn(t)===qn(d))&&(t+=d)}return!p&&!i.all?0:t}function jC(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,p;for(u=0,d=a.length;u<d;++u)p=a[u],l[u]={[r]:p,[s]:n[p]};return l}function lu(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function GC(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function KC(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 XC(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function Dm(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 Cm(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,p=GC(s,a,i),m=t.length;let g;for(let _=0;_<m;++_){const x=t[_],{[u]:w,[d]:S}=x,C=x._stacks||(x._stacks={});g=C[d]=XC(r,p,w),g[l]=S,g._top=Dm(g,a,!0,i.type),g._bottom=Dm(g,a,!1,i.type);const A=g._visualValues||(g._visualValues={});A[l]=S}}function cu(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function ZC(n,t){return Ei(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function QC(n,t,e){return Ei(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Qs(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 uu=n=>n==="reset"||n==="none",Om=(n,t)=>t?n:Object.assign({},n),JC=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Mm(e,!0),values:null};class Ii{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=lu(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&&Qs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(m,g,_,x)=>m==="x"?g:m==="r"?x:_,s=e.xAxisID=Ct(i.xAxisID,cu(t,"x")),a=e.yAxisID=Ct(i.yAxisID,cu(t,"y")),l=e.rAxisID=Ct(i.rAxisID,cu(t,"r")),u=e.indexAxis,d=e.iAxisID=r(u,s,a,l),p=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(p)}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&&Yp(this._data,this),t._stacked&&Qs(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(It(e)){const r=this._cachedMeta;this._data=jC(e,r)}else if(i!==e){if(i){Yp(i,this);const r=this._cachedMeta;Qs(r),r._parsed=[]}e&&Object.isExtensible(e)&&BD(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=lu(e.vScale,e),e.stack!==i.stack&&(r=!0,Qs(e),e.stack=i.stack),this._resyncElements(t),(r||s!==e._stacked)&&(Cm(this,e._parsed),e._stacked=lu(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],p,m,g;if(this._parsing===!1)i._parsed=r,i._sorted=!0,g=r;else{qt(r[t])?g=this.parseArrayData(i,r,t,e):It(r[t])?g=this.parseObjectData(i,r,t,e):g=this.parsePrimitiveData(i,r,t,e);const _=()=>m[l]===null||d&&m[l]<d[l];for(p=0;p<e;++p)i._parsed[p+t]=m=g[p],u&&(_()&&(u=!1),d=m);i._sorted=u}a&&Cm(this,g)}parsePrimitiveData(t,e,i,r){const{iScale:s,vScale:a}=t,l=s.axis,u=a.axis,d=s.getLabels(),p=s===a,m=new Array(r);let g,_,x;for(g=0,_=r;g<_;++g)x=g+i,m[g]={[l]:p||s.parse(d[x],x),[u]:a.parse(e[x],x)};return m}parseArrayData(t,e,i,r){const{xScale:s,yScale:a}=t,l=new Array(r);let u,d,p,m;for(u=0,d=r;u<d;++u)p=u+i,m=e[p],l[u]={x:s.parse(m[0],p),y:a.parse(m[1],p)};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 p,m,g,_;for(p=0,m=r;p<m;++p)g=p+i,_=e[g],d[p]={x:s.parse(Di(_,l),g),y:a.parse(Di(_,u),g)};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:Mm(r,!0),values:e._stacks[t.axis]._visualValues};return km(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=km(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=JC(e,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:p,max:m}=KC(l);let g,_;function x(){_=r[g];const w=_[l.axis];return!ae(_[t.axis])||p>w||m<w}for(g=0;g<a&&!(!x()&&(this.updateRangeFromParsed(d,t,_,u),s));++g);if(s){for(g=a-1;g>=0;--g)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=qC(Ct(this.options.clip,YC(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 p;for(i.dataset&&i.dataset.draw(t,s,l,u),p=l;p<l+u;++p){const m=r[p];m.hidden||(m.active&&d?a.push(m):m.draw(t,s))}for(p=0;p<a.length;++p)a[p].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=QC(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=ZC(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&&rn(i);if(l)return Om(l,u);const d=this.chart.config,p=d.datasetElementScopeKeys(this._type,t),m=r?[`${t}Hover`,"hover",t,""]:[t,""],g=d.getOptionScopes(this.getDataset(),p),_=Object.keys(se.elements[t]),x=()=>this.getContext(i,r,e),w=d.resolveNamedOptions(g,_,x,m);return w.$shared&&(w.$shared=u,s[a]=Object.freeze(Om(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 p=this.chart.config,m=p.datasetAnimationScopeKeys(this._type,e),g=p.getOptionScopes(this.getDataset(),m);u=p.createResolver(g,this.getContext(t,i,e))}const d=new au(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||uu(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){uu(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!uu(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&&Qs(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 tO(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=qp(i.sort((r,s)=>r-s))}return n._cache.$bar}function eO(n){const t=n.iScale,e=tO(t,n.type);let i=t._length,r,s,a,l;const u=()=>{a===32767||a===-32768||(rn(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 nO(n,t,e,i){const r=e.barThickness;let s,a;return St(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 iO(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 rO(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 Am(n,t,e,i){return qt(n)?rO(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Em(n,t,e,i){const r=n.iScale,s=n.vScale,a=r.getLabels(),l=r===s,u=[];let d,p,m,g;for(d=e,p=e+i;d<p;++d)g=t[d],m={},m[r.axis]=l||r.parse(a[d],d),u.push(Am(g,m,s,d));return u}function du(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function sO(n,t,e){return n!==0?qn(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function oO(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 aO(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:p}=oO(n);r==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?r=d:(e._bottom||0)===i?r=p:(s[Rm(p,a,l,u)]=!0,r=d)),s[Rm(r,a,l,u)]=!0,n.borderSkipped=s}function Rm(n,t,e,i){return i?(n=lO(n,t,e),n=Pm(n,e,t)):n=Pm(n,t,e),n}function lO(n,t,e){return n===t?e:n===e?t:n}function Pm(n,t,e){return n==="start"?t:n==="end"?e:n}function cO(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Im extends Ii{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 Em(t,e,i,r)}parseArrayData(t,e,i,r){return Em(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,p=a.axis==="x"?l:u,m=[];let g,_,x,w;for(g=i,_=i+r;g<_;++g)w=e[g],x={},x[s.axis]=s.parse(Di(w,d),g),m.push(Am(Di(w,p),x,a,g));return m}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=du(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(),p=this._getRuler(),{sharedOptions:m,includeOptions:g}=this._getSharedOptions(e,r);for(let _=e;_<e+i;_++){const x=this.getParsed(_),w=s||St(x[l.axis])?{base:u,head:u}:this._calculateBarValuePixels(_),S=this._calculateBarIndexPixels(_,p),C=(x._stacks||{})[l.axis],A={horizontal:d,base:w.base,enableBorderRadius:!C||du(x._custom)||a===C._top||a===C._bottom,x:d?w.head:S.center,y:d?S.center:w.head,height:d?S.size:Math.abs(w.size),width:d?Math.abs(w.size):S.size};g&&(A.options=m||this.resolveDataElementOptions(_,t[_].active?"active":r));const B=A.options||t[_].options;aO(A,B,C,a),cO(A,B,p.ratio),this.updateElement(t[_],_,A,r)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(p=>p.controller.options.grouped),s=i.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(e),u=l&&l[i.axis],d=p=>{const m=p._parsed.find(_=>_[i.axis]===u),g=m&&m[p.vScale.axis];if(St(g)||isNaN(g))return!0};for(const p of r)if(!(e!==void 0&&d(p))&&((s===!1||a.indexOf(p.stack)===-1||s===void 0&&p.stack===void 0)&&a.push(p.stack),p.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||eO(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,p=du(d);let m=u[e.axis],g=0,_=i?this.applyStack(e,u,i):m,x,w;_!==m&&(g=_-m,_=m),p&&(m=d.barStart,_=d.barEnd-d.barStart,m!==0&&qn(m)!==qn(d.barEnd)&&(g=0),g+=m);const S=!St(s)&&!p?s:g;let C=e.getPixelForValue(S);if(this.chart.getDataVisibility(t)?x=e.getPixelForValue(g+_):x=C,w=x-C,Math.abs(w)<a){w=sO(w,e,l)*a,m===l&&(C-=w/2);const A=e.getPixelForDecimal(0),B=e.getPixelForDecimal(1),P=Math.min(A,B),I=Math.max(A,B);C=Math.max(Math.min(C,I),P),x=C+w,i&&!p&&(u._stacks[e.axis]._visualValues[r]=e.getValueForPixel(x)-e.getValueForPixel(C))}if(C===e.getPixelForValue(l)){const A=qn(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 p=s?this._getStackCount(t):e.stackCount,m=r.barThickness==="flex"?iO(t,e,r,p*d):nO(t,e,r,p*d),g=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,_=this._getAxis().indexOf(Ct(g,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+_;l=m.start+m.chunk*x+m.chunk/2,u=Math.min(a,m.chunk*m.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 uO extends Ii{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),p=a.axis,m=l.axis;for(let g=e;g<e+i;g++){const _=t[g],x=!s&&this.getParsed(g),w={},S=w[p]=s?a.getPixelForDecimal(.5):a.getPixelForValue(x[p]),C=w[m]=s?l.getBasePixel():l.getPixelForValue(x[m]);w.skip=isNaN(S)||isNaN(C),d&&(w.options=u||this.resolveDataElementOptions(g,_.active?"active":r),s&&(w.options.radius=0)),this.updateElement(_,g,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 dO(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),p=Math.sin(l),m=Math.cos(u),g=Math.sin(u),_=(B,P,I)=>Ys(B,l,u,!0)?1:Math.max(P,P*e,I,I*e),x=(B,P,I)=>Ys(B,l,u,!0)?-1:Math.min(P,P*e,I,I*e),w=_(0,d,m),S=_(re,p,g),C=x(Rt,d,m),A=x(Rt+re,p,g);i=(w-C)/2,r=(S-A)/2,s=-(w+C)/2,a=-(S+A)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:a}}class Js extends Ii{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 m=t.getDatasetMeta(0).controller.getStyle(d);return{text:u,fillStyle:m.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(d),lineDash:m.borderDash,lineDashOffset:m.borderDashOffset,lineJoin:m.borderJoinStyle,lineWidth:m.borderWidth,strokeStyle:m.borderColor,textAlign:r,pointStyle:i,borderRadius:a&&(l||m.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=>+Di(i[d],u)}let a,l;for(a=t,l=t+e;a<l;++a)r._parsed[a]=s(a)}}_getRotation(){return we(this.options.rotation-90)}_getCircumference(){return we(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(SD(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:p,rotation:m}=this._getRotationExtents(),{ratioX:g,ratioY:_,offsetX:x,offsetY:w}=dO(m,p,u),S=(i.width-a)/g,C=(i.height-a)/_,A=Math.max(Math.min(S,C)/2,0),B=Bp(this.options.radius,A),P=Math.max(B*u,0),I=(B-P)/this._getVisibleDatasetWeightTotal();this.offsetX=x*B,this.offsetY=w*B,r.total=this.calculateTotal(),this.outerRadius=B-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,p=(l.left+l.right)/2,m=(l.top+l.bottom)/2,g=s&&d.animateScale,_=g?0:this.innerRadius,x=g?0:this.outerRadius,{sharedOptions:w,includeOptions:S}=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 B=this._circumference(A,s),P=t[A],I={x:p+this.offsetX,y:m+this.offsetY,startAngle:C,endAngle:C+B,circumference:B,outerRadius:x,innerRadius:_};S&&(I.options=w||this.resolveDataElementOptions(A,P.active?"active":r)),C+=B,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=js(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 Lm extends Ii{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}=Kp(e,r,a);this._drawStart=l,this._drawCount=u,Xp(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:p,includeOptions:m}=this._getSharedOptions(e,r),g=a.axis,_=l.axis,{spanGaps:x,segment:w}=this.options,S=Oi(x)?x:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||s||r==="none",A=e+i,B=t.length;let P=e>0&&this.getParsed(e-1);for(let I=0;I<B;++I){const $=t[I],z=C?$:{};if(I<e||I>=A){z.skip=!0;continue}const v=this.getParsed(I),M=St(v[_]),O=z[g]=a.getPixelForValue(v[g],I),N=z[_]=s||M?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,v,u):v[_],I);z.skip=isNaN(O)||isNaN(N)||M,z.stop=I>0&&Math.abs(v[g]-P[g])>S,w&&(z.parsed=v,z.raw=d.data[I]),m&&(z.options=p||this.resolveDataElementOptions(I,$.active?"active":r)),C||this.updateElement($,I,z,r),P=v}}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 Nm extends Ii{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=js(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:s}}parseObjectData(t,e,i,r){return um.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,p=d.xCenter,m=d.yCenter,g=d.getIndexAngle(0)-.5*Rt;let _=g,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 S=t[x];let C=_,A=_+this._computeAngle(x,r,w),B=a.getDataVisibility(x)?d.getDistanceFromCenterForValue(this.getParsed(x).r):0;_=A,s&&(u.animateScale&&(B=0),u.animateRotate&&(C=A=g));const P={x:p,y:m,innerRadius:0,outerRadius:B,startAngle:C,endAngle:A,options:this.resolveDataElementOptions(x,S.active?"active":r)};this.updateElement(S,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)?we(this.resolveDataElementOptions(t,e).angle||i):0}}class fO extends Js{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class hO extends Ii{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 um.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),p=s.getPointPositionForValue(l,this.getParsed(l).r),m=a?s.xCenter:p.x,g=a?s.yCenter:p.y,_={x:m,y:g,angle:p.angle,skip:isNaN(m)||isNaN(g),options:d};this.updateElement(u,l,_,r)}}}class Bm extends Ii{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}=Kp(e,i,r);if(this._drawStart=s,this._drawCount=a,Xp(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,p=this.resolveDataElementOptions(e,r),m=this.getSharedOptions(p),g=this.includeOptions(r,m),_=a.axis,x=l.axis,{spanGaps:w,segment:S}=this.options,C=Oi(w)?w:Number.POSITIVE_INFINITY,A=this.chart._animationsDisabled||s||r==="none";let B=e>0&&this.getParsed(e-1);for(let P=e;P<e+i;++P){const I=t[P],$=this.getParsed(P),z=A?I:{},v=St($[x]),M=z[_]=a.getPixelForValue($[_],P),O=z[x]=s||v?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,$,u):$[x],P);z.skip=isNaN(M)||isNaN(O)||v,z.stop=P>0&&Math.abs($[_]-B[_])>C,S&&(z.parsed=$,z.raw=d.data[P]),g&&(z.options=m||this.resolveDataElementOptions(P,I.active?"active":r)),A||this.updateElement(I,P,z,r),B=$}this.updateSharedOptions(m,r,p)}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 pO=Object.freeze({__proto__:null,BarController:Im,BubbleController:uO,DoughnutController:Js,LineController:Lm,PieController:fO,PolarAreaController:Nm,RadarController:hO,ScatterController:Bm});function fr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class fu{static override(t){Object.assign(fu.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return fr()}parse(){return fr()}format(){return fr()}add(){return fr()}diff(){return fr()}startOf(){return fr()}endOf(){return fr()}}var Fm={_date:fu};function mO(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?LD:oi;if(i){if(r._sharedOptions){const p=s[0],m=typeof p.getRange=="function"&&p.getRange(t);if(m){const g=d(s,t,e-m),_=d(s,t,e+m);return{lo:g.lo,hi:_.hi}}}}else{const p=d(s,t,e);if(u){const{vScale:m}=r._cachedMeta,{_parsed:g}=n,_=g.slice(0,p.lo+1).reverse().findIndex(w=>!St(w[m.axis]));p.lo-=Math.max(0,_);const x=g.slice(p.hi).findIndex(w=>!St(w[m.axis]));p.hi+=Math.max(0,x)}return p}}return{lo:0,hi:s.length-1}}function to(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:p}=s[l],{lo:m,hi:g}=mO(s[l],t,a,r);for(let _=m;_<=g;++_){const x=p[_];x.skip||i(x,d,_)}}}function gO(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 hu(n,t,e,i,r){const s=[];return!r&&!n.isPointInArea(t)||to(n,e,t,function(l,u,d){!r&&!ai(l,n.chartArea,0)||l.inRange(t.x,t.y,i)&&s.push({element:l,datasetIndex:u,index:d})},!0),s}function yO(n,t,e,i){let r=[];function s(a,l,u){const{startAngle:d,endAngle:p}=a.getProps(["startAngle","endAngle"],i),{angle:m}=Ta(a,{x:t.x,y:t.y});Ys(m,d,p)&&r.push({element:a,datasetIndex:l,index:u})}return to(n,e,t,s),r}function _O(n,t,e,i,r,s){let a=[];const l=gO(e);let u=Number.POSITIVE_INFINITY;function d(p,m,g){const _=p.inRange(t.x,t.y,r);if(i&&!_)return;const x=p.getCenterPoint(r);if(!(!!s||n.isPointInArea(x))&&!_)return;const S=l(t,x);S<u?(a=[{element:p,datasetIndex:m,index:g}],u=S):S===u&&a.push({element:p,datasetIndex:m,index:g})}return to(n,e,t,d),a}function pu(n,t,e,i,r,s){return!s&&!n.isPointInArea(t)?[]:e==="r"&&!i?yO(n,t,e,r):_O(n,t,e,i,r,s)}function zm(n,t,e,i,r){const s=[],a=e==="x"?"inXRange":"inYRange";let l=!1;return to(n,e,t,(u,d,p)=>{u[a]&&u[a](t[e],r)&&(s.push({element:u,datasetIndex:d,index:p}),l=l||u.inRange(t.x,t.y,r))}),i&&!l?[]:s}var mu={evaluateInteractionItems:to,modes:{index(n,t,e,i){const r=Ri(t,n),s=e.axis||"x",a=e.includeInvisible||!1,l=e.intersect?hu(n,r,s,i,a):pu(n,r,s,!1,i,a),u=[];return l.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const p=l[0].index,m=d.data[p];m&&!m.skip&&u.push({element:m,datasetIndex:d.index,index:p})}),u):[]},dataset(n,t,e,i){const r=Ri(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;let l=e.intersect?hu(n,r,s,i,a):pu(n,r,s,!1,i,a);if(l.length>0){const u=l[0].datasetIndex,d=n.getDatasetMeta(u).data;l=[];for(let p=0;p<d.length;++p)l.push({element:d[p],datasetIndex:u,index:p})}return l},point(n,t,e,i){const r=Ri(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return hu(n,r,s,i,a)},nearest(n,t,e,i){const r=Ri(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return pu(n,r,s,e.intersect,i,a)},x(n,t,e,i){const r=Ri(t,n);return zm(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=Ri(t,n);return zm(n,r,"y",e.intersect,i)}}};const Um=["left","top","right","bottom"];function eo(n,t){return n.filter(e=>e.pos===t)}function Hm(n,t){return n.filter(e=>Um.indexOf(e.pos)===-1&&e.box.axis===t)}function no(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 bO(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 xO(n){const t={};for(const e of n){const{stack:i,pos:r,stackWeight:s}=e;if(!i||!Um.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 wO(n,t){const e=xO(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],p=d&&l.stackWeight/d.weight;l.horizontal?(l.width=p?p*i:u&&t.availableWidth,l.height=r):(l.width=i,l.height=p?p*r:u&&t.availableHeight)}return e}function vO(n){const t=bO(n),e=no(t.filter(d=>d.box.fullSize),!0),i=no(eo(t,"left"),!0),r=no(eo(t,"right")),s=no(eo(t,"top"),!0),a=no(eo(t,"bottom")),l=Hm(t,"x"),u=Hm(t,"y");return{fullSize:e,leftAndTop:i.concat(s),rightAndBottom:r.concat(u).concat(a).concat(l),chartArea:eo(t,"chartArea"),vertical:i.concat(r).concat(u),horizontal:s.concat(a).concat(l)}}function Wm(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function $m(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 SO(n,t,e,i){const{pos:r,box:s}=e,a=n.maxPadding;if(!It(r)){e.size&&(n[r]-=e.size);const m=i[e.stack]||{size:0,count:1};m.size=Math.max(m.size,e.horizontal?s.height:s.width),e.size=m.size/m.count,n[r]+=e.size}s.getPadding&&$m(a,s.getPadding());const l=Math.max(0,t.outerWidth-Wm(a,n,"left","right")),u=Math.max(0,t.outerHeight-Wm(a,n,"top","bottom")),d=l!==n.w,p=u!==n.h;return n.w=l,n.h=u,e.horizontal?{same:d,other:p}:{same:p,other:d}}function TO(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 MO(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 io(n,t,e,i){const r=[];let s,a,l,u,d,p;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,MO(l.horizontal,t));const{same:m,other:g}=SO(t,e,l,i);d|=m&&r.length,p=p||g,u.fullSize||r.push(l)}return d&&io(r,t,e,i)||p}function Pa(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 Vm(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},p=l.stackWeight/d.weight||1;if(l.horizontal){const m=t.w*p,g=d.size||u.height;rn(d.start)&&(a=d.start),u.fullSize?Pa(u,r.left,a,e.outerWidth-r.right-r.left,g):Pa(u,t.left+d.placed,a,m,g),d.start=a,d.placed+=m,a=u.bottom}else{const m=t.h*p,g=d.size||u.width;rn(d.start)&&(s=d.start),u.fullSize?Pa(u,s,r.top,g,e.outerHeight-r.bottom-r.top):Pa(u,s,t.top+d.placed,g,m),d.start=s,d.placed+=m,s=u.right}}t.x=s,t.y=a}var $e={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=ve(n.options.layout.padding),s=Math.max(t-r.width,0),a=Math.max(e-r.height,0),l=vO(n.boxes),u=l.vertical,d=l.horizontal;Jt(n.boxes,w=>{typeof w.beforeLayout=="function"&&w.beforeLayout()});const p=u.reduce((w,S)=>S.box.options&&S.box.options.display===!1?w:w+1,0)||1,m=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/p,hBoxMaxHeight:a/2}),g=Object.assign({},r);$m(g,ve(i));const _=Object.assign({maxPadding:g,w:s,h:a,x:r.left,y:r.top},r),x=wO(u.concat(d),m);io(l.fullSize,_,m,x),io(u,_,m,x),io(d,_,m,x)&&io(u,_,m,x),TO(_),Vm(l.leftAndTop,_,m,x),_.x+=_.w,_.y+=_.h,Vm(l.rightAndBottom,_,m,x),n.chartArea={left:_.left,top:_.top,right:_.left+_.w,bottom:_.top+_.h,height:_.h,width:_.w},Jt(l.chartArea,w=>{const S=w.box;Object.assign(S,n.chartArea),S.update(_.w,_.h,{left:0,top:0,right:0,bottom:0})})}};class Ym{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 kO extends Ym{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ia="$chartjs",DO={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},qm=n=>n===null||n==="";function CO(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[Ia]={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",qm(r)){const s=hm(n,"width");s!==void 0&&(n.width=s)}if(qm(i))if(n.style.height==="")n.height=n.width/(t||2);else{const s=hm(n,"height");s!==void 0&&(n.height=s)}return n}const jm=CC?{passive:!0}:!1;function OO(n,t,e){n&&n.addEventListener(t,e,jm)}function AO(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,jm)}function EO(n,t){const e=DO[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 La(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function RO(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||La(l.addedNodes,i),a=a&&!La(l.removedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function PO(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||La(l.removedNodes,i),a=a&&!La(l.addedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const ro=new Map;let Gm=0;function Km(){const n=window.devicePixelRatio;n!==Gm&&(Gm=n,ro.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function IO(n,t){ro.size||window.addEventListener("resize",Km),ro.set(n,t)}function LO(n){ro.delete(n),ro.size||window.removeEventListener("resize",Km)}function NO(n,t,e){const i=n.canvas,r=i&&ou(i);if(!r)return;const s=Gp((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,p=u.contentRect.height;d===0&&p===0||s(d,p)});return a.observe(r),IO(n,s),a}function gu(n,t,e){e&&e.disconnect(),t==="resize"&&LO(n)}function BO(n,t,e){const i=n.canvas,r=Gp(s=>{n.ctx!==null&&e(EO(s,n))},n);return OO(i,t,r),r}class FO extends Ym{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(CO(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ia])return!1;const i=e[Ia].initial;["height","width"].forEach(s=>{const a=i[s];St(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[Ia],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),a={attach:RO,detach:PO,resize:NO}[e]||BO;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]||AO)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return DC(t,e,i,r)}isAttached(t){const e=t&&ou(t);return!!(e&&e.isConnected)}}function zO(n){return!su()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?kO:FO}class Ve{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 Oi(this.x)&&Oi(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 UO(n,t){const e=n.options.ticks,i=HO(n),r=Math.min(e.maxTicksLimit||i,i),s=e.major.enabled?$O(t):[],a=s.length,l=s[0],u=s[a-1],d=[];if(a>r)return VO(t,d,s,a/r),d;const p=WO(s,t,r);if(a>0){let m,g;const _=a>1?Math.round((u-l)/(a-1)):null;for(Na(t,d,p,St(_)?0:l-_,l),m=0,g=a-1;m<g;m++)Na(t,d,p,s[m],s[m+1]);return Na(t,d,p,u,St(_)?t.length:u+_),d}return Na(t,d,p),d}function HO(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 WO(n,t,e){const i=YO(n),r=t.length/e;if(!i)return Math.max(r,1);const s=AD(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 $O(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function VO(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 Na(n,t,e,i,r){const s=Ct(i,0),a=Math.min(Ct(r,n.length),n.length);let l=0,u,d,p;for(e=Math.ceil(e),r&&(u=r-i,e=u/Math.floor(u/e)),p=s;p<0;)l++,p=Math.round(s+l*e);for(d=Math.max(s,0);d<a;d++)d===p&&(t.push(n[d]),l++,p=Math.round(s+l*e))}function YO(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 qO=n=>n==="left"?"right":n==="right"?"left":n,Xm=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Zm=(n,t)=>Math.min(t||n,n);function Qm(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 jO(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 GO(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 so(n){return n.drawTicks?n.tickLength:0}function Jm(n,t){if(!n.display)return 0;const e=le(n.font,t),i=ve(n.padding);return(qt(n.text)?n.text.length:1)*e.lineHeight+i.height}function KO(n,t){return Ei(n,{scale:t,type:"scale"})}function XO(n,t,e){return Ei(n,{tick:e,index:t,type:"tick"})}function ZO(n,t,e){let i=Kc(n);return(e&&t!=="right"||!e&&t==="right")&&(i=qO(i)),i}function QO(n,t,e,i){const{top:r,left:s,bottom:a,right:l,chart:u}=n,{chartArea:d,scales:p}=u;let m=0,g,_,x;const w=a-r,S=l-s;if(n.isHorizontal()){if(_=We(i,s,l),It(e)){const C=Object.keys(e)[0],A=e[C];x=p[C].getPixelForValue(A)+w-t}else e==="center"?x=(d.bottom+d.top)/2+w-t:x=Xm(n,e,t);g=l-s}else{if(It(e)){const C=Object.keys(e)[0],A=e[C];_=p[C].getPixelForValue(A)-S+t}else e==="center"?_=(d.left+d.right)/2-S+t:_=Xm(n,e,t);x=We(i,a,r),m=e==="left"?-re:re}return{titleX:_,titleY:x,maxWidth:g,rotation:m}}class hr extends Ve{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=mn(t,Number.POSITIVE_INFINITY),e=mn(e,Number.NEGATIVE_INFINITY),i=mn(i,Number.POSITIVE_INFINITY),r=mn(r,Number.NEGATIVE_INFINITY),{min:mn(t,i),max:mn(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:mn(e,mn(i,e)),max:mn(i,mn(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=sC(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=l<this.ticks.length;this._convertTicksToLabels(u?Qm(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=UO(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=Zm(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 p=this._getLabelSizes(),m=p.widest.width,g=p.highest.height,_=Oe(this.chart.width-m,0,this.maxWidth);l=t.offset?this.maxWidth/i:_/(i-1),m+6>l&&(l=_/(i-(t.offset?.5:1)),u=this.maxHeight-so(t.grid)-e.padding-Jm(t.title,this.chart.options.font),d=Math.sqrt(m*m+g*g),a=Sa(Math.min(Math.asin(Oe((p.highest.height+6)/l,-1,1)),Math.asin(Oe(u/d,-1,1))-Math.asin(Oe(g/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=Jm(r,e.options.font);if(l?(t.width=this.maxWidth,t.height=so(s)+u):(t.height=this.maxHeight,t.width=so(s)+u),i.display&&this.ticks.length){const{first:d,last:p,widest:m,highest:g}=this._getLabelSizes(),_=i.padding*2,x=we(this.labelRotation),w=Math.cos(x),S=Math.sin(x);if(l){const C=i.mirror?0:S*m.width+w*g.height;t.height=Math.min(this.maxHeight,t.height+C+_)}else{const C=i.mirror?0:w*m.width+S*g.height;t.width=Math.min(this.maxWidth,t.width+C+_)}this._calculatePadding(d,p,S,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 p=this.getPixelForTick(0)-this.left,m=this.right-this.getPixelForTick(this.ticks.length-1);let g=0,_=0;u?d?(g=r*t.width,_=i*e.height):(g=i*t.height,_=r*e.width):s==="start"?_=e.width:s==="end"?g=t.width:s!=="inner"&&(g=t.width/2,_=e.width/2),this.paddingLeft=Math.max((g-p+a)*this.width/(this.width-p),0),this.paddingRight=Math.max((_-m+a)*this.width/(this.width-m),0)}else{let p=e.height/2,m=t.height/2;s==="start"?(p=0,m=t.height):s==="end"&&(p=e.height,m=0),this.paddingTop=p+a,this.paddingBottom=m+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++)St(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Qm(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/Zm(e,i));let d=0,p=0,m,g,_,x,w,S,C,A,B,P,I;for(m=0;m<e;m+=u){if(x=t[m].label,w=this._resolveTickFontOptions(m),r.font=S=w.string,C=s[S]=s[S]||{data:{},gc:[]},A=w.lineHeight,B=P=0,!St(x)&&!qt(x))B=Ca(r,C.data,C.gc,B,x),P=A;else if(qt(x))for(g=0,_=x.length;g<_;++g)I=x[g],!St(I)&&!qt(I)&&(B=Ca(r,C.data,C.gc,B,I),P+=A);a.push(B),l.push(P),d=Math.max(B,d),p=Math.max(P,p)}GO(s,e);const $=a.indexOf(d),z=l.indexOf(p),v=M=>({width:a[M]||0,height:l[M]||0});return{first:v(0),last:v(e-1),widest:v($),highest:v(z),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 ID(this._alignToPixels?lr(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=XO(this.getContext(),t,i))}return this.$context||(this.$context=KO(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=we(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(),m=this.ticks.length+(u?1:0),g=so(s),_=[],x=l.setContext(this.getContext()),w=x.display?x.width:0,S=w/2,C=function(ht){return lr(i,ht,w)};let A,B,P,I,$,z,v,M,O,N,W,G;if(a==="top")A=C(this.bottom),z=this.bottom-g,M=A-S,N=C(t.top)+S,G=t.bottom;else if(a==="bottom")A=C(this.top),N=t.top,G=C(t.bottom)-S,z=A+S,M=this.top+g;else if(a==="left")A=C(this.right),$=this.right-g,v=A-S,O=C(t.left)+S,W=t.right;else if(a==="right")A=C(this.left),O=t.left,W=C(t.right)-S,$=A+S,v=this.left+g;else if(e==="x"){if(a==="center")A=C((t.top+t.bottom)/2+.5);else if(It(a)){const ht=Object.keys(a)[0],dt=a[ht];A=C(this.chart.scales[ht].getPixelForValue(dt))}N=t.top,G=t.bottom,z=A+S,M=z+g}else if(e==="y"){if(a==="center")A=C((t.left+t.right)/2);else if(It(a)){const ht=Object.keys(a)[0],dt=a[ht];A=C(this.chart.scales[ht].getPixelForValue(dt))}$=A-S,v=$-g,O=t.left,W=t.right}const lt=Ct(r.ticks.maxTicksLimit,m),ut=Math.max(1,Math.ceil(m/lt));for(B=0;B<m;B+=ut){const ht=this.getContext(B),dt=s.setContext(ht),bt=l.setContext(ht),at=dt.lineWidth,ct=dt.color,V=bt.dash||[],L=bt.dashOffset,H=dt.tickWidth,it=dt.tickColor,st=dt.tickBorderDash||[],X=dt.tickBorderDashOffset;P=jO(this,B,u),P!==void 0&&(I=lr(i,P,at),d?$=v=O=W=I:z=M=N=G=I,_.push({tx1:$,ty1:z,tx2:v,ty2:M,x1:O,y1:N,x2:W,y2:G,width:at,color:ct,borderDash:V,borderDashOffset:L,tickWidth:H,tickColor:it,tickBorderDash:st,tickBorderDashOffset:X}))}return this._ticksLength=m,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:p,mirror:m}=s,g=so(i.grid),_=g+p,x=m?-p:_,w=-we(this.labelRotation),S=[];let C,A,B,P,I,$,z,v,M,O,N,W,G="middle";if(r==="top")$=this.bottom-x,z=this._getXAxisLabelAlignment();else if(r==="bottom")$=this.top+x,z=this._getXAxisLabelAlignment();else if(r==="left"){const ut=this._getYAxisLabelAlignment(g);z=ut.textAlign,I=ut.x}else if(r==="right"){const ut=this._getYAxisLabelAlignment(g);z=ut.textAlign,I=ut.x}else if(e==="x"){if(r==="center")$=(t.top+t.bottom)/2+_;else if(It(r)){const ut=Object.keys(r)[0],ht=r[ut];$=this.chart.scales[ut].getPixelForValue(ht)+_}z=this._getXAxisLabelAlignment()}else if(e==="y"){if(r==="center")I=(t.left+t.right)/2-_;else if(It(r)){const ut=Object.keys(r)[0],ht=r[ut];I=this.chart.scales[ut].getPixelForValue(ht)}z=this._getYAxisLabelAlignment(g).textAlign}e==="y"&&(u==="start"?G="top":u==="end"&&(G="bottom"));const lt=this._getLabelSizes();for(C=0,A=l.length;C<A;++C){B=l[C],P=B.label;const ut=s.setContext(this.getContext(C));v=this.getPixelForTick(C)+s.labelOffset,M=this._resolveTickFontOptions(C),O=M.lineHeight,N=qt(P)?P.length:1;const ht=N/2,dt=ut.color,bt=ut.textStrokeColor,at=ut.textStrokeWidth;let ct=z;a?(I=v,z==="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=-N*O+O/2:d==="center"?W=-lt.highest.height/2-ht*O+O:W=-lt.highest.height+O/2:d==="near"||w!==0?W=O/2:d==="center"?W=lt.highest.height/2-ht*O:W=lt.highest.height-N*O,m&&(W*=-1),w!==0&&!ut.showLabelBackdrop&&(I+=O/2*Math.sin(w))):($=v,W=(1-N)*O/2);let V;if(ut.showLabelBackdrop){const L=ve(ut.backdropPadding),H=lt.heights[C],it=lt.widths[C];let st=W-L.top,X=0-L.left;switch(G){case"middle":st-=H/2;break;case"bottom":st-=H;break}switch(z){case"center":X-=it/2;break;case"right":X-=it;break;case"inner":C===A-1?X-=it:C>0&&(X-=it/2);break}V={left:X,top:st,width:it+L.width,height:H+L.height,color:ut.backdropColor}}S.push({label:P,font:M,textOffset:W,options:{rotation:w,color:dt,strokeColor:bt,strokeWidth:at,textAlign:ct,textBaseline:G,translation:[I,$],backdrop:V}})}return S}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-we(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,p;return e==="left"?r?(p=this.right+s,i==="near"?d="left":i==="center"?(d="center",p+=u/2):(d="right",p+=u)):(p=this.right-l,i==="near"?d="right":i==="center"?(d="center",p-=u/2):(d="left",p=this.left)):e==="right"?r?(p=this.left+s,i==="near"?d="right":i==="center"?(d="center",p-=u/2):(d="left",p-=u)):(p=this.left+l,i==="near"?d="left":i==="center"?(d="center",p+=u/2):(d="right",p=this.right)):d="right",{textAlign:d,x:p}}_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,p)=>{!p.width||!p.color||(i.save(),i.lineWidth=p.width,i.strokeStyle=p.color,i.setLineDash(p.borderDash||[]),i.lineDashOffset=p.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,p,m,g;this.isHorizontal()?(d=lr(t,this.left,a)-a/2,p=lr(t,this.right,l)+l/2,m=g=u):(m=lr(t,this.top,a)-a/2,g=lr(t,this.bottom,l)+l/2,d=p=u),e.save(),e.lineWidth=s.width,e.strokeStyle=s.color,e.beginPath(),e.moveTo(d,m),e.lineTo(p,g),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&Ks(i,r);const s=this.getLabelItems(t);for(const a of s){const l=a.options,u=a.font,d=a.label,p=a.textOffset;cr(i,d,0,p,u,l)}r&&Xs(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:r}}=this;if(!i.display)return;const s=le(i.font),a=ve(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:p,maxWidth:m,rotation:g}=QO(this,u,e,l);cr(t,i.text,0,0,s,{color:i.color,maxWidth:m,rotation:g,textAlign:ZO(l,e,r),textBaseline:"middle",translation:[d,p]})}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!==hr.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 Ba{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;eA(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,JO(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 ar[i])}}function JO(n,t,e){const i=Ws(Object.create(null),[e?se.get(e):{},se.get(t),n.defaults]);se.set(t,i),n.defaultRoutes&&tA(t,n.defaultRoutes),n.descriptors&&se.describe(t,n.descriptors)}function tA(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 eA(n){return"id"in n&&"defaults"in n}class nA{constructor(){this.controllers=new Ba(Ii,"datasets",!0),this.elements=new Ba(Ve,"elements"),this.plugins=new Ba(Object,"plugins"),this.scales=new Ba(hr,"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=qc(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 jn=new nA;class iA{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(){St(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,r=Ct(i.options&&i.options.plugins,{}),s=rA(i);return r===!1&&!e?[]:oA(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 rA(n){const t={},e=[],i=Object.keys(jn.plugins.items);for(let s=0;s<i.length;s++)e.push(jn.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 sA(n,t){return!t&&n===!1?null:n===!0?{}:n}function oA(n,{plugins:t,localIds:e},i,r){const s=[],a=n.getContext();for(const l of t){const u=l.id,d=sA(i[u],r);d!==null&&s.push({plugin:l,options:aA(n.config,{plugin:l,local:e[u]},d,a)})}return s}function aA(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 yu(n,t){const e=se.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function lA(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function cA(n,t){return n===t?"_index_":"_value_"}function tg(n){if(n==="x"||n==="y"||n==="r")return n}function uA(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function _u(n,...t){if(tg(n))return n;for(const e of t){const i=e.axis||uA(e.position)||n.length>1&&tg(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function eg(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function dA(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 eg(n,"x",e[0])||eg(n,"y",e[0])}return{}}function fA(n,t){const e=ar[n.type]||{scales:{}},i=t.scales||{},r=yu(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=_u(a,l,dA(a,n),se.scales[l.type]),d=cA(u,r),p=e.scales||{};s[a]=$s(Object.create(null),[{axis:u},l,p[u],p[d]])}),n.data.datasets.forEach(a=>{const l=a.type||n.type,u=a.indexAxis||yu(l,t),p=(ar[l]||{}).scales||{};Object.keys(p).forEach(m=>{const g=lA(m,u),_=a[g+"AxisID"]||g;s[_]=s[_]||Object.create(null),$s(s[_],[{axis:g},i[_],p[m]])})}),Object.keys(s).forEach(a=>{const l=s[a];$s(l,[se.scales[l.type],se.scale])}),s}function ng(n){const t=n.options||(n.options={});t.plugins=Ct(t.plugins,{}),t.scales=fA(n,t)}function ig(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function hA(n){return n=n||{},n.data=ig(n.data),ng(n),n}const rg=new Map,sg=new Set;function Fa(n,t){let e=rg.get(n);return e||(e=t(),rg.set(n,e),sg.add(e)),e}const oo=(n,t,e)=>{const i=Di(t,e);i!==void 0&&n.add(i)};class pA{constructor(t){this._config=hA(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=ig(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(),ng(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Fa(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Fa(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Fa(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Fa(`${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(p=>{t&&(u.add(t),p.forEach(m=>oo(u,t,m))),p.forEach(m=>oo(u,r,m)),p.forEach(m=>oo(u,ar[s]||{},m)),p.forEach(m=>oo(u,se,m)),p.forEach(m=>oo(u,Qc,m))});const d=Array.from(u);return d.length===0&&d.push(Object.create(null)),sg.has(e)&&a.set(e,d),d}chartOptionScopes(){const{options:t,type:e}=this;return[t,ar[e]||{},se.datasets[e]||{},{type:e},se,Qc]}resolveNamedOptions(t,e,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:l}=og(this._resolverCache,t,r);let u=a;if(gA(a,e)){s.$shared=!1,i=sn(i)?i():i;const d=this.createResolver(t,i,l);u=Yr(a,i,d)}for(const d of e)s[d]=u[d];return s}createResolver(t,e,i=[""],r){const{resolver:s}=og(this._resolverCache,t,i);return It(e)?Yr(s,e,void 0,r):s}}function og(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:nu(t,e),subPrefixes:e.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const mA=n=>It(n)&&Object.getOwnPropertyNames(n).some(t=>sn(n[t]));function gA(n,t){const{isScriptable:e,isIndexable:i}=rm(n);for(const r of t){const s=e(r),a=i(r),l=(a||s)&&n[r];if(s&&(sn(l)||mA(l))||a&&qt(l))return!0}return!1}var yA="4.5.1";const _A=["top","bottom","left","right","chartArea"];function ag(n,t){return n==="top"||n==="bottom"||_A.indexOf(n)===-1&&t==="x"}function lg(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function cg(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Qt(e&&e.onComplete,[n],t)}function bA(n){const t=n.chart,e=t.options.animation;Qt(e&&e.onProgress,[n],t)}function ug(n){return su()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const za={},dg=n=>{const t=ug(n);return Object.values(za).filter(e=>e.canvas===t).pop()};function xA(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 wA(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let on=class{static defaults=se;static instances=za;static overrides=ar;static registry=jn;static version=yA;static getChart=dg;static register(...t){jn.add(...t),fg()}static unregister(...t){jn.remove(...t),fg()}constructor(t,e){const i=this.config=new pA(e),r=ug(t),s=dg(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||zO(r)),this.platform.updateConfig(i);const l=this.platform.acquireContext(r,a.aspectRatio),u=l&&l.canvas,d=u&&u.height,p=u&&u.width;if(this.id=vD(),this.ctx=l,this.canvas=u,this.width=p,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 iA,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=FD(m=>this.update(m),a.resizeDelay||0),this._dataChanges=[],za[this.id]=this,!l||!u){console.error("Failed to create chart: can't acquire context from the given item");return}li.listen(this,"complete",cg),li.listen(this,"progress",bA),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:s}=this;return St(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 jn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():fm(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return em(this.canvas,this.ctx),this}stop(){return li.stop(this),this}resize(t,e){li.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,fm(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=_u(a,l),d=u==="r",p=u==="x";return{options:l,dposition:d?"chartArea":p?"bottom":"left",dtype:d?"radialLinear":p?"category":"linear"}}))),Jt(s,a=>{const l=a.options,u=l.id,d=_u(u,l),p=Ct(l.type,a.dtype);(l.position===void 0||ag(l.position,d)!==ag(a.dposition))&&(l.position=a.dposition),r[u]=!0;let m=null;if(u in i&&i[u].type===p)m=i[u];else{const g=jn.getScale(p);m=new g({id:u,type:p,ctx:this.ctx,chart:this}),i[m.id]=m}m.init(l,t)}),Jt(r,(a,l)=>{a||delete i[l]}),Jt(i,a=>{$e.configure(this,a,a.options),$e.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(lg("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||yu(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=jn.getController(l),{datasetElementType:d,dataElementType:p}=se.datasets[l];Object.assign(u,{dataElementType:jn.getElement(p),datasetElementType:d&&jn.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,p=this.data.datasets.length;d<p;d++){const{controller:m}=this.getDatasetMeta(d),g=!r&&s.indexOf(m)===-1;m.buildOrUpdateElements(g),a=Math.max(+m.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(lg("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=>{$e.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Up(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;xA(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(!Up(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;$e.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,sn(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&&(li.has(this)?this.attached&&!li.running(this)&&li.start(this):(this.draw(),cg({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=vm(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(r&&Ks(e,r),t.controller.draw(),r&&Xs(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return ai(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const s=mu.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=Ei(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);rn(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(),li.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(),em(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete za[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}});!ba(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(p=>!d.some(m=>p.datasetIndex===m.datasetIndex&&p.index===m.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=CD(t),d=wA(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 p=!ba(l,r);return(p||e)&&(this._active=l,this._updateHoverStyles(l,r,e)),this._lastEvent=d,p}_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 fg(){return Jt(on.instances,n=>n._plugins.invalidate())}function vA(n,t,e){const{startAngle:i,x:r,y:s,outerRadius:a,innerRadius:l,options:u}=t,{borderWidth:d,borderJoinStyle:p}=u,m=Math.min(d/a,He(i-e));if(n.beginPath(),n.arc(r,s,a-d/2,i+m/2,e-m/2),l>0){const g=Math.min(d/l,He(i-e));n.arc(r,s,l+d/2,e-g/2,i+g/2,!0)}else{const g=Math.min(d/2,a*He(i-e));if(p==="round")n.arc(r,s,g,e-Rt/2,i+Rt/2,!0);else if(p==="bevel"){const _=2*g*g,x=-_*Math.cos(e+Rt/2)+r,w=-_*Math.sin(e+Rt/2)+s,S=_*Math.cos(i+Rt/2)+r,C=_*Math.sin(i+Rt/2)+s;n.lineTo(x,w),n.lineTo(S,C)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function SA(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 TA(n){return eu(n,["outerStart","outerEnd","innerStart","innerEnd"])}function MA(n,t,e,i){const r=TA(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 Oe(u,0,Math.min(s,d))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:Oe(r.innerStart,0,a),innerEnd:Oe(r.innerEnd,0,a)}}function Gr(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Ua(n,t,e,i,r,s){const{x:a,y:l,startAngle:u,pixelMargin:d,innerRadius:p}=t,m=Math.max(t.outerRadius+i+e-d,0),g=p>0?p+i+e+d:0;let _=0;const x=r-u;if(i){const ut=p>0?p-i:0,ht=m>0?m-i:0,dt=(ut+ht)/2,bt=dt!==0?x*dt/(dt+i):x;_=(x-bt)/2}const w=Math.max(.001,x*m-e/Rt)/m,S=(x-w)/2,C=u+S+_,A=r-S-_,{outerStart:B,outerEnd:P,innerStart:I,innerEnd:$}=MA(t,g,m,A-C),z=m-B,v=m-P,M=C+B/z,O=A-P/v,N=g+I,W=g+$,G=C+I/N,lt=A-$/W;if(n.beginPath(),s){const ut=(M+O)/2;if(n.arc(a,l,m,M,ut),n.arc(a,l,m,ut,O),P>0){const at=Gr(v,O,a,l);n.arc(at.x,at.y,P,O,A+re)}const ht=Gr(W,A,a,l);if(n.lineTo(ht.x,ht.y),$>0){const at=Gr(W,lt,a,l);n.arc(at.x,at.y,$,A+re,lt+Math.PI)}const dt=(A-$/g+(C+I/g))/2;if(n.arc(a,l,g,A-$/g,dt,!0),n.arc(a,l,g,dt,C+I/g,!0),I>0){const at=Gr(N,G,a,l);n.arc(at.x,at.y,I,G+Math.PI,C-re)}const bt=Gr(z,C,a,l);if(n.lineTo(bt.x,bt.y),B>0){const at=Gr(z,M,a,l);n.arc(at.x,at.y,B,C-re,M)}}else{n.moveTo(a,l);const ut=Math.cos(M)*m+a,ht=Math.sin(M)*m+l;n.lineTo(ut,ht);const dt=Math.cos(O)*m+a,bt=Math.sin(O)*m+l;n.lineTo(dt,bt)}n.closePath()}function kA(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:l}=t;let u=t.endAngle;if(s){Ua(n,t,e,i,u,r);for(let d=0;d<s;++d)n.fill();isNaN(l)||(u=a+(l%te||te))}return Ua(n,t,e,i,u,r),n.fill(),u}function DA(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:l,options:u}=t,{borderWidth:d,borderJoinStyle:p,borderDash:m,borderDashOffset:g,borderRadius:_}=u,x=u.borderAlign==="inner";if(!d)return;n.setLineDash(m||[]),n.lineDashOffset=g,x?(n.lineWidth=d*2,n.lineJoin=p||"round"):(n.lineWidth=d,n.lineJoin=p||"bevel");let w=t.endAngle;if(s){Ua(n,t,e,i,w,r);for(let S=0;S<s;++S)n.stroke();isNaN(l)||(w=a+(l%te||te))}x&&SA(n,t,w),u.selfJoin&&w-a>=Rt&&_===0&&p!=="miter"&&vA(n,t,w),s||(Ua(n,t,e,i,w,r),n.stroke())}class CA extends Ve{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}=Ta(r,{x:t,y:e}),{startAngle:l,endAngle:u,innerRadius:d,outerRadius:p,circumference:m}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),g=(this.options.spacing+this.options.borderWidth)/2,_=Ct(m,u-l),x=Ys(s,l,u)&&l!==u,w=_>=te||x,S=si(a,d+g,p+g);return w&&S}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,p=(r+s)/2,m=(a+l+d+u)/2;return{x:e+Math.cos(p)*m,y:i+Math.sin(p)*m}}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(Rt,i||0)),d=r*u;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,kA(t,this,d,s,a),DA(t,this,d,s,a),t.restore()}}function hg(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 OA(n,t,e){n.lineTo(e.x,e.y)}function AA(n){return n.stepped?XD:n.tension||n.cubicInterpolationMode==="monotone"?ZD:OA}function pg(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),p=r<a&&s<a||r>l&&s>l;return{count:i,start:u,loop:t.loop,ilen:d<u&&!p?i+d-u:d-u}}function EA(n,t,e,i){const{points:r,options:s}=t,{count:a,start:l,loop:u,ilen:d}=pg(r,e,i),p=AA(s);let{move:m=!0,reverse:g}=i||{},_,x,w;for(_=0;_<=d;++_)x=r[(l+(g?d-_:_))%a],!x.skip&&(m?(n.moveTo(x.x,x.y),m=!1):p(n,w,x,g,s.stepped),w=x);return u&&(x=r[(l+(g?d:0))%a],p(n,w,x,g,s.stepped)),!!u}function RA(n,t,e,i){const r=t.points,{count:s,start:a,ilen:l}=pg(r,e,i),{move:u=!0,reverse:d}=i||{};let p=0,m=0,g,_,x,w,S,C;const A=P=>(a+(d?l-P:P))%s,B=()=>{w!==S&&(n.lineTo(p,S),n.lineTo(p,w),n.lineTo(p,C))};for(u&&(_=r[A(0)],n.moveTo(_.x,_.y)),g=0;g<=l;++g){if(_=r[A(g)],_.skip)continue;const P=_.x,I=_.y,$=P|0;$===x?(I<w?w=I:I>S&&(S=I),p=(m*p+P)/++m):(B(),n.lineTo(P,I),x=$,m=0,w=S=I),C=I}B()}function bu(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?RA:EA}function PA(n){return n.stepped?OC:n.tension||n.cubicInterpolationMode==="monotone"?AC:dr}function IA(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),hg(n,t.options),n.stroke(r)}function LA(n,t,e,i){const{segments:r,options:s}=t,a=bu(t);for(const l of r)hg(n,s,l.style),n.beginPath(),a(n,t,l,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const NA=typeof Path2D=="function";function BA(n,t,e,i){NA&&!t.options.segment?IA(n,t,e,i):LA(n,t,e,i)}class Ha extends Ve{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;wC(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=NC(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=bm(this,{property:e,start:r,end:r});if(!a.length)return;const l=[],u=PA(i);let d,p;for(d=0,p=a.length;d<p;++d){const{start:m,end:g}=a[d],_=s[m],x=s[g];if(_===x){l.push(_);continue}const w=Math.abs((r-_[e])/(x[e]-_[e])),S=u(_,x,w,i.stepped);S[e]=t[e],l.push(S)}return l.length===1?l[0]:l}pathSegment(t,e,i){return bu(this)(t,this,e,i)}path(t,e,i){const r=this.segments,s=bu(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(),BA(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function mg(n,t,e,i){const r=n.options,{[e]:s}=n.getProps([e],i);return Math.abs(t-s)<r.radius+r.hitRadius}class FA extends Ve{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 mg(this,t,"x",e)}inYRange(t,e){return mg(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||!ai(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,tu(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function gg(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,p,m;return n.horizontal?(m=a/2,l=Math.min(e,r),u=Math.max(e,r),d=i-m,p=i+m):(m=s/2,l=e-m,u=e+m,d=Math.min(i,r),p=Math.max(i,r)),{left:l,top:d,right:u,bottom:p}}function Li(n,t,e,i){return n?0:Oe(t,e,i)}function zA(n,t,e){const i=n.options.borderWidth,r=n.borderSkipped,s=im(i);return{t:Li(r.top,s.top,0,e),r:Li(r.right,s.right,0,t),b:Li(r.bottom,s.bottom,0,e),l:Li(r.left,s.left,0,t)}}function UA(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,s=Ai(r),a=Math.min(t,e),l=n.borderSkipped,u=i||It(r);return{topLeft:Li(!u||l.top||l.left,s.topLeft,0,a),topRight:Li(!u||l.top||l.right,s.topRight,0,a),bottomLeft:Li(!u||l.bottom||l.left,s.bottomLeft,0,a),bottomRight:Li(!u||l.bottom||l.right,s.bottomRight,0,a)}}function HA(n){const t=gg(n),e=t.right-t.left,i=t.bottom-t.top,r=zA(n,e/2,i/2),s=UA(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 xu(n,t,e,i){const r=t===null,s=e===null,l=n&&!(r&&s)&&gg(n,i);return l&&(r||si(t,l.left,l.right))&&(s||si(e,l.top,l.bottom))}function WA(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function $A(n,t){n.rect(t.x,t.y,t.w,t.h)}function wu(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 VA extends Ve{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}=HA(this),l=WA(a.radius)?Vr:$A;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),l(t,wu(a,e,s)),t.clip(),l(t,wu(s,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),l(t,wu(s,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,i){return xu(this,t,e,i)}inXRange(t,e){return xu(this,t,null,e)}inYRange(t,e){return xu(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 YA=Object.freeze({__proto__:null,ArcElement:CA,BarElement:VA,LineElement:Ha,PointElement:FA});const vu=["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)"],yg=vu.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function _g(n){return vu[n%vu.length]}function bg(n){return yg[n%yg.length]}function qA(n,t){return n.borderColor=_g(t),n.backgroundColor=bg(t),++t}function jA(n,t){return n.backgroundColor=n.data.map(()=>_g(t++)),t}function GA(n,t){return n.backgroundColor=n.data.map(()=>bg(t++)),t}function KA(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof Js?t=jA(e,t):r instanceof Nm?t=GA(e,t):r&&(t=qA(e,t))}}function xg(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function XA(n){return n&&(n.borderColor||n.backgroundColor)}function ZA(){return se.borderColor!=="rgba(0,0,0,0.1)"||se.backgroundColor!=="rgba(0,0,0,0.1)"}var QA={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=xg(i)||XA(r)||s&&xg(s)||ZA();if(!e.forceOverride&&a)return;const l=KA(n);i.forEach(l)}};function JA(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 p=t,m,g,_,x,w;for(a[u++]=n[p],m=0;m<s-2;m++){let S=0,C=0,A;const B=Math.floor((m+1)*l)+1+t,P=Math.min(Math.floor((m+2)*l)+1,e)+t,I=P-B;for(A=B;A<P;A++)S+=n[A].x,C+=n[A].y;S/=I,C/=I;const $=Math.floor(m*l)+1+t,z=Math.min(Math.floor((m+1)*l)+1,e)+t,{x:v,y:M}=n[p];for(_=x=-1,A=$;A<z;A++)x=.5*Math.abs((v-S)*(n[A].y-M)-(v-n[A].x)*(C-M)),x>_&&(_=x,g=n[A],w=A);a[u++]=g,p=w}return a[u++]=n[d],a}function tE(n,t,e,i){let r=0,s=0,a,l,u,d,p,m,g,_,x,w;const S=[],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===p)d<x?(x=d,m=a):d>w&&(w=d,g=a),r=(s*r+l.x)/++s;else{const $=a-1;if(!St(m)&&!St(g)){const z=Math.min(m,g),v=Math.max(m,g);z!==_&&z!==$&&S.push({...n[z],x:r}),v!==_&&v!==$&&S.push({...n[v],x:r})}a>0&&$!==_&&S.push(n[$]),S.push(l),p=I,s=0,x=w=d,m=g=_=a}}return S}function wg(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 vg(n){n.data.datasets.forEach(t=>{wg(t)})}function eE(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=Oe(oi(t,s.axis,a).lo,0,e-1)),d?r=Oe(oi(t,s.axis,l).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var nE={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){vg(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(Zs([l,n.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const p=n.scales[u.xAxisID];if(p.type!=="linear"&&p.type!=="time"||n.options.parsing)return;let{start:m,count:g}=eE(u,d);const _=e.threshold||4*i;if(g<=_){wg(r);return}St(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=JA(d,m,g,i,e);break;case"min-max":x=tE(d,m,g,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=x})},destroy(n){vg(n)}};function iE(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=Wa(u,d,r);const p=Su(e,r[u],r[d],l.loop);if(!t.segments){a.push({source:l,target:p,start:r[u],end:r[d]});continue}const m=bm(t,p);for(const g of m){const _=Su(e,s[g.start],s[g.end],g.loop),x=_m(l,r,_);for(const w of x)a.push({source:w,target:g,start:{[e]:Sg(p,_,"start",Math.max)},end:{[e]:Sg(p,_,"end",Math.min)}})}}return a}function Su(n,t,e,i){if(i)return;let r=t[n],s=e[n];return n==="angle"&&(r=He(r),s=He(s)),{property:n,start:r,end:s}}function rE(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,s=[];return t.segments.forEach(({start:a,end:l})=>{l=Wa(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 Wa(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Sg(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Tg(n,t){let e=[],i=!1;return qt(n)?(i=!0,e=n):e=rE(n,t),e.length?new Ha({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Mg(n){return n&&n.fill!==!1}function sE(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 oE(n,t,e){const i=uE(n);if(It(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return ae(r)&&Math.floor(r)===r?aE(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function aE(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function lE(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 cE(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 uE(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 dE(n){const{scale:t,index:e,line:i}=n,r=[],s=i.segments,a=i.points,l=fE(t,e);l.push(Tg({x:null,y:t.bottom},i));for(let u=0;u<s.length;u++){const d=s[u];for(let p=d.start;p<=d.end;p++)hE(r,a[p],l)}return new Ha({points:r,options:{}})}function fE(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 hE(n,t,e){const i=[];for(let r=0;r<e.length;r++){const s=e[r],{first:a,last:l,point:u}=pE(s,t,"x");if(!(!u||a&&l)){if(a)i.unshift(u);else if(n.push(u),!l)break}}n.push(...i)}function pE(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 p=s[d],m=a[p.start][e],g=a[p.end][e];if(si(r,m,g)){l=r===m,u=r===g;break}}return{first:l,last:u,point:i}}class kg{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 mE(n){const{chart:t,fill:e,line:i}=n;if(ae(e))return gE(t,e);if(e==="stack")return dE(n);if(e==="shape")return!0;const r=yE(n);return r instanceof kg?r:Tg(r,i)}function gE(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function yE(n){return(n.scale||{}).getPointPositionForValue?bE(n):_E(n)}function _E(n){const{scale:t={},fill:e}=n,i=lE(e,t);if(ae(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function bE(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=cE(e,t,s),l=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,s);return new kg({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 Tu(n,t,e){const i=mE(t),{chart:r,index:s,line:a,scale:l,axis:u}=t,d=a.options,p=d.fill,m=d.backgroundColor,{above:g=m,below:_=m}=p||{},x=r.getDatasetMeta(s),w=vm(r,x);i&&a.points.length&&(Ks(n,e),xE(n,{line:a,target:i,above:g,below:_,area:e,scale:l,axis:u,clip:w}),Xs(n))}function xE(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 p=s;s!==r&&(d==="x"?(Dg(n,i,a.top),Mu(n,{line:e,target:i,color:r,scale:l,property:d,clip:u}),n.restore(),n.save(),Dg(n,i,a.bottom)):d==="y"&&(Cg(n,i,a.left),Mu(n,{line:e,target:i,color:s,scale:l,property:d,clip:u}),n.restore(),n.save(),Cg(n,i,a.right),p=r)),Mu(n,{line:e,target:i,color:p,scale:l,property:d,clip:u}),n.restore()}function Dg(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,p=r[u],m=r[Wa(u,d,r)];s?(n.moveTo(p.x,p.y),s=!1):(n.lineTo(p.x,e),n.lineTo(p.x,p.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(m.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Cg(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,p=r[u],m=r[Wa(u,d,r)];s?(n.moveTo(p.x,p.y),s=!1):(n.lineTo(e,p.y),n.lineTo(p.x,p.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(e,m.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function Mu(n,t){const{line:e,target:i,property:r,color:s,scale:a,clip:l}=t,u=iE(e,i,r);for(const{source:d,target:p,start:m,end:g}of u){const{style:{backgroundColor:_=s}={}}=d,x=i!==!0;n.save(),n.fillStyle=_,wE(n,a,l,x&&Su(r,m,g)),n.beginPath();const w=!!e.pathSegment(n,d);let S;if(x){w?n.closePath():Og(n,i,g,r);const C=!!i.pathSegment(n,p,{move:w,reverse:!0});S=w&&C,S||Og(n,i,m,r)}n.closePath(),n.fill(S?"evenodd":"nonzero"),n.restore()}}function wE(n,t,e,i){const r=t.chart.chartArea,{property:s,start:a,end:l}=i||{};if(s==="x"||s==="y"){let u,d,p,m;s==="x"?(u=a,d=r.top,p=l,m=r.bottom):(u=r.left,d=a,p=r.right,m=l),n.beginPath(),e&&(u=Math.max(u,e.left),p=Math.min(p,e.right),d=Math.max(d,e.top),m=Math.min(m,e.bottom)),n.rect(u,d,p-u,m-d),n.clip()}}function Og(n,t,e,i){const r=t.interpolate(e,i);r&&n.lineTo(r.x,r.y)}var vE={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 Ha&&(u={visible:n.isDatasetVisible(a),index:a,fill:oE(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=sE(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&&Tu(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;Mg(s)&&Tu(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Mg(i)||e.drawTime!=="beforeDatasetDraw"||Tu(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ag=(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)}},SE=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Eg extends Ve{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}=Ag(i,s);let d,p;e.font=r.string,this.isHorizontal()?(d=this.maxWidth,p=this._fitRows(a,s,l,u)+10):(p=this.maxHeight,d=this._fitCols(a,r,l,u)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(p,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],p=r+l;let m=t;s.textAlign="left",s.textBaseline="middle";let g=-1,_=-p;return this.legendItems.forEach((x,w)=>{const S=i+e/2+s.measureText(x.text).width;(w===0||d[d.length-1]+S+2*l>a)&&(m+=p,d[d.length-(w>0?0:1)]=0,_+=p,g++),u[w]={left:0,top:_,row:g,width:S,height:r},d[d.length-1]+=S+l}),m}_fitCols(t,e,i,r){const{ctx:s,maxHeight:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],d=this.columnSizes=[],p=a-t;let m=l,g=0,_=0,x=0,w=0;return this.legendItems.forEach((S,C)=>{const{itemWidth:A,itemHeight:B}=TE(i,e,s,S,r);C>0&&_+B+2*l>p&&(m+=g+l,d.push({width:g,height:_}),x+=g+l,w++,g=_=0),u[C]={left:x,top:_,col:w,width:A,height:B},g=Math.max(g,A),_+=B+l}),m+=g,d.push({width:g,height:_}),m}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:s}}=this,a=jr(s,this.left,this.width);if(this.isHorizontal()){let l=0,u=We(i,this.left+r,this.right-this.lineWidths[l]);for(const d of e)l!==d.row&&(l=d.row,u=We(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=We(i,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const d of e)d.col!==l&&(l=d.col,u=We(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;Ks(t,this),this._draw(),Xs(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:s,labels:a}=t,l=se.color,u=jr(t.rtl,this.left,this.width),d=le(a.font),{padding:p}=a,m=d.size,g=m/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:S}=Ag(a,m),C=function($,z,v){if(isNaN(x)||x<=0||isNaN(w)||w<0)return;r.save();const M=Ct(v.lineWidth,1);if(r.fillStyle=Ct(v.fillStyle,l),r.lineCap=Ct(v.lineCap,"butt"),r.lineDashOffset=Ct(v.lineDashOffset,0),r.lineJoin=Ct(v.lineJoin,"miter"),r.lineWidth=M,r.strokeStyle=Ct(v.strokeStyle,l),r.setLineDash(Ct(v.lineDash,[])),a.usePointStyle){const O={radius:w*Math.SQRT2/2,pointStyle:v.pointStyle,rotation:v.rotation,borderWidth:M},N=u.xPlus($,x/2),W=z+g;nm(r,O,N,W,a.pointStyleWidth&&x)}else{const O=z+Math.max((m-w)/2,0),N=u.leftForLtr($,x),W=Ai(v.borderRadius);r.beginPath(),Object.values(W).some(G=>G!==0)?Vr(r,{x:N,y:O,w:x,h:w,radius:W}):r.rect(N,O,x,w),r.fill(),M!==0&&r.stroke()}r.restore()},A=function($,z,v){cr(r,v.text,$,z+S/2,d,{strikethrough:v.hidden,textAlign:u.textAlign(v.textAlign)})},B=this.isHorizontal(),P=this._computeTitleHeight();B?_={x:We(s,this.left+p,this.right-i[0]),y:this.top+p+P,line:0}:_={x:this.left+p,y:We(s,this.top+P+p,this.bottom-e[0].height),line:0},pm(this.ctx,t.textDirection);const I=S+p;this.legendItems.forEach(($,z)=>{r.strokeStyle=$.fontColor,r.fillStyle=$.fontColor;const v=r.measureText($.text).width,M=u.textAlign($.textAlign||($.textAlign=a.textAlign)),O=x+g+v;let N=_.x,W=_.y;u.setWidth(this.width),B?z>0&&N+O+p>this.right&&(W=_.y+=I,_.line++,N=_.x=We(s,this.left+p,this.right-i[_.line])):z>0&&W+I>this.bottom&&(N=_.x=N+e[_.line].width+p,_.line++,W=_.y=We(s,this.top+P+p,this.bottom-e[_.line].height));const G=u.x(N);if(C(G,W,$),N=zD(M,N+x+g,B?N+O:this.right,t.rtl),A(u.x(N),W,$),B)_.x+=O+p;else if(typeof $.text!="string"){const lt=d.lineHeight;_.y+=Rg($,lt)+p}else _.y+=I}),mm(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=le(e.font),r=ve(e.padding);if(!e.display)return;const s=jr(t.rtl,this.left,this.width),a=this.ctx,l=e.position,u=i.size/2,d=r.top+u;let p,m=this.left,g=this.width;if(this.isHorizontal())g=Math.max(...this.lineWidths),p=this.top+d,m=We(t.align,m,this.right-g);else{const x=this.columnSizes.reduce((w,S)=>Math.max(w,S.height),0);p=d+We(t.align,this.top,this.bottom-x-t.labels.padding-this._computeTitleHeight())}const _=We(l,m,m+g);a.textAlign=s.textAlign(Kc(l)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,cr(a,e.text,_,p,i)}_computeTitleHeight(){const t=this.options.title,e=le(t.font),i=ve(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,s;if(si(t,this.left,this.right)&&si(e,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(r=s[i],si(t,r.left,r.left+r.width)&&si(e,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!DE(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=SE(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 TE(n,t,e,i,r){const s=ME(i,n,t,e),a=kE(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function ME(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 kE(n,t,e){let i=n;return typeof t.text!="string"&&(i=Rg(t,e)),i}function Rg(n,t){const e=n.text?n.text.length:0;return t*e}function DE(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var CE={id:"legend",_element:Eg,start(n,t,e){const i=n.legend=new Eg({ctx:n.ctx,options:e,chart:n});$e.configure(n,i,e),$e.addBox(n,i)},stop(n){$e.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;$e.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),p=ve(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:(p.width+p.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 ku extends Ve{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=ve(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,p,m;return this.isHorizontal()?(p=We(l,i,s),m=e+t,d=s-i):(a.position==="left"?(p=i+t,m=We(l,r,e),u=Rt*-.5):(p=s-t,m=We(l,e,r),u=Rt*.5),d=r-e),{titleX:p,titleY:m,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);cr(t,e.text,0,0,i,{color:e.color,maxWidth:u,rotation:d,textAlign:Kc(e.align),textBaseline:"middle",translation:[a,l]})}}function OE(n,t){const e=new ku({ctx:n.ctx,options:t,chart:n});$e.configure(n,e,t),$e.addBox(n,e),n.titleBlock=e}var AE={id:"title",_element:ku,start(n,t,e){OE(n,e)},stop(n){const t=n.titleBlock;$e.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;$e.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 $a=new WeakMap;var EE={id:"subtitle",start(n,t,e){const i=new ku({ctx:n.ctx,options:e,chart:n});$e.configure(n,i,e),$e.addBox(n,i),$a.set(n,i)},stop(n){$e.removeBox(n,$a.get(n)),$a.delete(n)},beforeUpdate(n,t,e){const i=$a.get(n);$e.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 ao={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(),p=$r(t,d);p<r&&(r=p,l=u)}}if(l){const u=l.tooltipPosition();e=u.x,i=u.y}return{x:e,y:i}}};function Gn(n,t){return t&&(qt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function ci(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
2
2
|
`)>-1?n.split(`
|
|
3
|
-
`):n}function RE(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 Pg(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),p=le(t.footerFont),m=s.length,g=r.length,_=i.length,x=ve(t.padding);let w=x.height,S=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,m&&(w+=m*d.lineHeight+(m-1)*t.titleSpacing+t.titleMarginBottom),C){const P=t.displayColors?Math.max(l,u.lineHeight):u.lineHeight;w+=_*P+(C-_)*u.lineHeight+(C-1)*t.bodySpacing}g&&(w+=t.footerMarginTop+g*p.lineHeight+(g-1)*t.footerSpacing);let A=0;const B=function(P){S=Math.max(S,e.measureText(P).width+A)};return e.save(),e.font=d.string,Jt(n.title,B),e.font=u.string,Jt(n.beforeBody.concat(n.afterBody),B),A=t.displayColors?a+2+t.boxPadding:0,Jt(i,P=>{Jt(P.before,B),Jt(P.lines,B),Jt(P.after,B)}),A=0,e.font=p.string,Jt(n.footer,B),e.restore(),S+=x.width,{width:S,height:w}}function PE(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function IE(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 LE(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"),IE(d,n,t,e)&&(d="center"),d}function Ig(n,t,e){const i=e.yAlign||t.yAlign||PE(n,e);return{xAlign:e.xAlign||t.xAlign||LE(n,t,e,i),yAlign:i}}function NE(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function BE(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Lg(n,t,e,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=n,{xAlign:l,yAlign:u}=e,d=r+s,{topLeft:p,topRight:m,bottomLeft:g,bottomRight:_}=Ai(a);let x=NE(t,l);const w=BE(t,u,d);return u==="center"?l==="left"?x+=d:l==="right"&&(x-=d):l==="left"?x-=Math.max(p,g)+r:l==="right"&&(x+=Math.max(m,_)+r),{x:Oe(x,0,i.width-t.width),y:Oe(w,0,i.height-t.height)}}function Va(n,t,e){const i=ve(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Ng(n){return Gn([],ci(n))}function FE(n,t,e){return Ei(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Bg(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Fg={beforeTitle:ri,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:ri,beforeBody:ri,beforeLabel:ri,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return St(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:ri,afterBody:ri,beforeFooter:ri,footer:ri,afterFooter:ri};function an(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?Fg[t].call(e,i):r}class zg extends Ve{static positioners=ao;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 au(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=FE(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=an(i,"beforeTitle",this,t),s=an(i,"title",this,t),a=an(i,"afterTitle",this,t);let l=[];return l=Gn(l,ci(r)),l=Gn(l,ci(s)),l=Gn(l,ci(a)),l}getBeforeBody(t,e){return Ng(an(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return Jt(t,s=>{const a={before:[],lines:[],after:[]},l=Bg(i,s);Gn(a.before,ci(an(l,"beforeLabel",this,s))),Gn(a.lines,an(l,"label",this,s)),Gn(a.after,ci(an(l,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,e){return Ng(an(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=an(i,"beforeFooter",this,t),s=an(i,"footer",this,t),a=an(i,"afterFooter",this,t);let l=[];return l=Gn(l,ci(r)),l=Gn(l,ci(s)),l=Gn(l,ci(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(RE(this.chart,e[u]));return t.filter&&(l=l.filter((p,m,g)=>t.filter(p,m,g,i))),t.itemSort&&(l=l.sort((p,m)=>t.itemSort(p,m,i))),Jt(l,p=>{const m=Bg(t.callbacks,p);r.push(an(m,"labelColor",this,p)),s.push(an(m,"labelPointStyle",this,p)),a.push(an(m,"labelTextColor",this,p))}),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=ao[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=Pg(this,i),d=Object.assign({},l,u),p=Ig(this.chart,i,d),m=Lg(i,d,p,this.chart);this.xAlign=p.xAlign,this.yAlign=p.yAlign,s={opacity:1,x:m.x,y:m.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:p,bottomRight:m}=Ai(l),{x:g,y:_}=t,{width:x,height:w}=e;let S,C,A,B,P,I;return s==="center"?(P=_+w/2,r==="left"?(S=g,C=S-a,B=P+a,I=P-a):(S=g+x,C=S+a,B=P-a,I=P+a),A=S):(r==="left"?C=g+Math.max(u,p)+a:r==="right"?C=g+x-Math.max(d,m)-a:C=this.caretX,s==="top"?(B=_,P=B-a,S=C-a,A=C+a):(B=_+w,P=B+a,S=C+a,A=C-a),I=B),{x1:S,x2:C,x3:A,y1:B,y2:P,y3:I}}drawTitle(t,e,i){const r=this.title,s=r.length;let a,l,u;if(s){const d=jr(i.rtl,this.x,this.width);for(t.x=Va(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,p=le(s.bodyFont),m=Va(this,"left",s),g=r.x(m),_=u<p.lineHeight?(p.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},S=r.leftForLtr(g,d)+d/2,C=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,tu(t,w,S,C),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,tu(t,w,S,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(g,d),S=r.leftForLtr(r.xPlus(g,1),d-2),C=Ai(a.borderRadius);Object.values(C).some(A=>A!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Vr(t,{x:w,y:x,w:d,h:u,radius:C}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Vr(t,{x:S,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(S,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:p}=i,m=le(i.bodyFont);let g=m.lineHeight,_=0;const x=jr(i.rtl,this.x,this.width),w=function(v){e.fillText(v,x.x(t.x+_),t.y+g/2),t.y+=g+s},S=x.textAlign(a);let C,A,B,P,I,$,z;for(e.textAlign=a,e.textBaseline="middle",e.font=m.string,t.x=Va(this,S,i),e.fillStyle=i.bodyColor,Jt(this.beforeBody,w),_=l&&S!=="right"?a==="center"?d/2+p:d+2+p:0,P=0,$=r.length;P<$;++P){for(C=r[P],A=this.labelTextColors[P],e.fillStyle=A,Jt(C.before,w),B=C.lines,l&&B.length&&(this._drawColorBox(e,t,P,x,i),g=Math.max(m.lineHeight,u)),I=0,z=B.length;I<z;++I)w(B[I]),g=m.lineHeight;Jt(C.after,w)}_=0,g=m.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=jr(i.rtl,this.x,this.width);for(t.x=Va(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:p}=i,{topLeft:m,topRight:g,bottomLeft:_,bottomRight:x}=Ai(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(l+m,u),a==="top"&&this.drawCaret(t,e,i,r),e.lineTo(l+d-g,u),e.quadraticCurveTo(l+d,u,l+d,u+g),a==="center"&&s==="right"&&this.drawCaret(t,e,i,r),e.lineTo(l+d,u+p-x),e.quadraticCurveTo(l+d,u+p,l+d-x,u+p),a==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(l+_,u+p),e.quadraticCurveTo(l,u+p,l,u+p-_),a==="center"&&s==="left"&&this.drawCaret(t,e,i,r),e.lineTo(l,u+m),e.quadraticCurveTo(l,u,l+m,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=ao[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=Pg(this,t),u=Object.assign({},a,this._size),d=Ig(e,t,u),p=Lg(t,u,d,e);(r._to!==p.x||s._to!==p.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,p))}}_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=ve(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),pm(t,e.textDirection),s.y+=a.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),mm(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=!ba(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||!ba(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=ao[s.position].call(this,t,e);return a!==!1&&(i!==a.x||r!==a.y)}}var Ye={id:"tooltip",_element:zg,positioners:ao,afterInit(n,t,e){e&&(n.tooltip=new zg({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:Fg},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"]},zE=Object.freeze({__proto__:null,Colors:QA,Decimation:nE,Filler:vE,Legend:CE,SubTitle:EE,Title:AE,Tooltip:Ye});const UE=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function HE(n,t,e,i){const r=n.indexOf(t);if(r===-1)return UE(n,t,e,i);const s=n.lastIndexOf(t);return r!==s?e:r}const WE=(n,t)=>n===null?null:Oe(Math.round(n),0,t);function Ug(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class $E extends hr{static id="category";static defaults={ticks:{callback:Ug}};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(St(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:HE(i,t,Ct(e,t),this._addedLabels),WE(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 Ug.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 VE(n,t){const e=[],{bounds:r,step:s,min:a,max:l,precision:u,count:d,maxTicks:p,maxDigits:m,includeBounds:g}=n,_=s||1,x=p-1,{min:w,max:S}=t,C=!St(a),A=!St(l),B=!St(d),P=(S-w)/(m+1);let I=Hp((S-w)/x/_)*_,$,z,v,M;if(I<1e-14&&!C&&!A)return[{value:w},{value:S}];M=Math.ceil(S/I)-Math.floor(w/I),M>x&&(I=Hp(M*I/x/_)*_),St(u)||($=Math.pow(10,u),I=Math.ceil(I*$)/$),r==="ticks"?(z=Math.floor(w/I)*I,v=Math.ceil(S/I)*I):(z=w,v=S),C&&A&&s&&RD((l-a)/s,I/1e3)?(M=Math.round(Math.min((l-a)/I,p)),I=(l-a)/M,z=a,v=l):B?(z=C?a:z,v=A?l:v,M=d-1,I=(v-z)/M):(M=(v-z)/I,Vs(M,Math.round(M),I/1e3)?M=Math.round(M):M=Math.ceil(M));const O=Math.max($p(I),$p(z));$=Math.pow(10,St(u)?O:u),z=Math.round(z*$)/$,v=Math.round(v*$)/$;let N=0;for(C&&(g&&z!==a?(e.push({value:a}),z<a&&N++,Vs(Math.round((z+N*I)*$)/$,a,Hg(a,P,n))&&N++):z<a&&N++);N<M;++N){const W=Math.round((z+N*I)*$)/$;if(A&&W>l)break;e.push({value:W})}return A&&g&&v!==l?e.length&&Vs(e[e.length-1].value,l,Hg(l,P,n))?e[e.length-1].value=l:e.push({value:l}):(!A||v===l)&&e.push({value:v}),e}function Hg(n,t,{horizontal:e,minRotation:i}){const r=we(i),s=(e?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+n).length;return Math.min(t/s,a)}class Ya extends hr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return St(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=u=>r=e?r:u,l=u=>s=i?s:u;if(t){const u=qn(r),d=qn(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=VE(r,s);return t.bounds==="ticks"&&Wp(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 js(t,this.chart.options.locale,this.options.ticks.format)}}class YE extends Ya{static id="linear";static defaults={ticks:{callback:Da.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=we(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 lo=n=>Math.floor(Ci(n)),pr=(n,t)=>Math.pow(10,lo(n)+t);function Wg(n){return n/Math.pow(10,lo(n))===1}function $g(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function qE(n,t){const e=t-n;let i=lo(e);for(;$g(n,t,i)>10;)i++;for(;$g(n,t,i)<10;)i--;return Math.min(i,lo(n))}function jE(n,{min:t,max:e}){t=mn(n.min,t);const i=[],r=lo(t);let s=qE(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,p=Math.floor((t-u)/l/10)*l*10;let m=Math.floor((d-p)/Math.pow(10,s)),g=mn(n.min,Math.round((u+p+m*Math.pow(10,s))*a)/a);for(;g<e;)i.push({value:g,major:Wg(g),significand:m}),m>=10?m=m<15?15:20:m++,m>=20&&(s++,m=2,a=s>=0?1:a),g=Math.round((u+p+m*Math.pow(10,s))*a)/a;const _=mn(n.max,g);return i.push({value:_,major:Wg(_),significand:m}),i}class GE extends hr{static id="logarithmic";static defaults={ticks:{callback:Da.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=Ya.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===pr(this.min,0)?pr(this.min,-1):pr(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(pr(i,-1)),a(pr(r,1)))),i<=0&&s(pr(r,-1)),r<=0&&a(pr(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=jE(e,this);return t.bounds==="ticks"&&Wp(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":js(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ci(t),this._valueRange=Ci(this.max)-Ci(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ci(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Du(n){const t=n.ticks;if(t.display&&n.display){const e=ve(t.backdropPadding);return Ct(t.font&&t.font.size,se.font.size)+e.height}return 0}function KE(n,t,e){return e=qt(e)?e:[e],{w:KD(n,t.string,e),h:e.length*t.lineHeight}}function Vg(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 XE(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?Rt/s:0;for(let u=0;u<s;u++){const d=a.setContext(n.getPointLabelContext(u));r[u]=d.padding;const p=n.getPointPosition(u,n.drawingArea+r[u],l),m=le(d.font),g=KE(n.ctx,m,n._pointLabels[u]);i[u]=g;const _=He(n.getIndexAngle(u)+l),x=Math.round(Sa(_)),w=Vg(x,p.x,g.w,0,180),S=Vg(x,p.y,g.h,90,270);ZE(e,t,_,w,S)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=tR(n,i,r)}function ZE(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 QE(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(Sa(He(u.angle+re))),p=iR(u.y,l.h,d),m=eR(d),g=nR(u.x,l.w,m);return{visible:!0,x:u.x,y:p,textAlign:m,left:g,top:p,right:g+l.w,bottom:p+l.h}}function JE(n,t){if(!t)return!0;const{left:e,top:i,right:r,bottom:s}=n;return!(ai({x:e,y:i},t)||ai({x:e,y:s},t)||ai({x:r,y:i},t)||ai({x:r,y:s},t))}function tR(n,t,e){const i=[],r=n._pointLabels.length,s=n.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:Du(s)/2,additionalAngle:a?Rt/r:0};let d;for(let p=0;p<r;p++){u.padding=e[p],u.size=t[p];const m=QE(n,p,u);i.push(m),l==="auto"&&(m.visible=JE(m,d),m.visible&&(d=m))}return i}function eR(n){return n===0||n===180?"center":n<180?"left":"right"}function nR(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function iR(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function rR(n,t,e){const{left:i,top:r,right:s,bottom:a}=e,{backdropColor:l}=t;if(!St(l)){const u=Ai(t.borderRadius),d=ve(t.backdropPadding);n.fillStyle=l;const p=i-d.left,m=r-d.top,g=s-i+d.width,_=a-r+d.height;Object.values(u).some(x=>x!==0)?(n.beginPath(),Vr(n,{x:p,y:m,w:g,h:_,radius:u}),n.fill()):n.fillRect(p,m,g,_)}}function sR(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));rR(e,a,s);const l=le(a.font),{x:u,y:d,textAlign:p}=s;cr(e,n._pointLabels[r],u,d+l.lineHeight/2,l,{color:a.color,textAlign:p,textBaseline:"middle"})}}function Yg(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 oR(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(),Yg(n,e,a,i),s.closePath(),s.stroke(),s.restore())}function aR(n,t,e){return Ei(n,{label:e,index:t,type:"pointLabel"})}class lR extends Ya{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:Da.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=ve(Du(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/Du(this.options))}generateTickLabels(t){Ya.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?XE(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 He(t*e+we(i))}getDistanceFromCenterForValue(t){if(St(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(St(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return aR(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(),Yg(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&&sR(this,a),r.display&&this.ticks.forEach((p,m)=>{if(m!==0||m===0&&this.min<0){u=this.getDistanceFromCenterForValue(p.value);const g=this.getContext(m),_=r.setContext(g),x=s.setContext(g);oR(this,_,u,a,x)}}),i.display){for(t.save(),l=a-1;l>=0;l--){const p=i.setContext(this.getPointLabelContext(l)),{color:m,lineWidth:g}=p;!g||!m||(t.lineWidth=g,t.strokeStyle=m,t.setLineDash(p.borderDash),t.lineDashOffset=p.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)),p=le(d.font);if(s=this.getDistanceFromCenterForValue(this.ticks[u].value),d.showLabelBackdrop){t.font=p.string,a=t.measureText(l.label).width,t.fillStyle=d.backdropColor;const m=ve(d.backdropPadding);t.fillRect(-a/2-m.left,-s-p.size/2-m.top,a+m.width,p.size+m.height)}cr(t,l.label,0,-s,p,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}const qa={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}},ln=Object.keys(qa);function qg(n,t){return n-t}function jg(n,t){if(St(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"&&(Oi(s)||s===!0)?e.startOf(a,"isoWeek",s):e.startOf(a,r)),+a)}function Gg(n,t,e,i){const r=ln.length;for(let s=ln.indexOf(n);s<r-1;++s){const a=qa[ln[s]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(l*a.size))<=i)return ln[s]}return ln[r-1]}function cR(n,t,e,i,r){for(let s=ln.length-1;s>=ln.indexOf(e);s--){const a=ln[s];if(qa[a].common&&n._adapter.diff(r,i,a)>=t-1)return a}return ln[e?ln.indexOf(e):0]}function uR(n){for(let t=ln.indexOf(n)+1,e=ln.length;t<e;++t)if(qa[ln[t]].common)return ln[t]}function Kg(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=Gc(e,t),s=e[i]>=t?e[i]:e[r];n[s]=!0}}function dR(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 Xg(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:dR(n,i,r,e)}class Cu extends hr{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 Fm._date(t.adapters.date);r.init(e),$s(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:jg(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=ND(r,s,a);return this._unit=e.unit||(i.autoSkip?Gg(e.minUnit,this.min,this.max,this._getLabelCapacity(s)):cR(this,l.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:uR(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),Xg(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=Oe(e,0,a),i=Oe(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||Gg(s.minUnit,e,i,this._getLabelCapacity(e)),l=Ct(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,d=Oi(u)||u===!0,p={};let m=e,g,_;if(d&&(m=+t.startOf(m,"isoWeek",u)),m=+t.startOf(m,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(g=m,_=0;g<i;g=+t.add(g,l,a),_++)Kg(p,g,x);return(g===i||r.bounds==="ticks"||_===1)&&Kg(p,g,x),Object.keys(p).sort(qg).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,p=u&&l[u],m=d&&l[d],g=i[e],_=d&&m&&g&&g.major;return this._adapter.format(t,r||(_?m:p))}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=we(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,Xg(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(jg(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return qp(t.sort(qg))}}function ja(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}=oi(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}=oi(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 fR extends Cu{static id="timeseries";static defaults=Cu.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=ja(e,this.min),this._tableRange=ja(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],s=[];let a,l,u,d,p;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)p=r[a+1],u=r[a-1],d=r[a],Math.round((p+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(ja(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return ja(this._table,i*this._tableRange+this._minPos,!0)}}var hR=Object.freeze({__proto__:null,CategoryScale:$E,LinearScale:YE,LogarithmicScale:GE,RadialLinearScale:lR,TimeScale:Cu,TimeSeriesScale:fR});const pR=[pO,YA,zE,hR];function mR(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:u=>({label:u.dataset.label,value:u.label})}};Ye.positioners[e]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const p=this.chart.canvas.getBoundingClientRect(),m=n.tooltipState.width||this.width,g=p.width/2,_=Qa(d,m,g),x=d.y,w=d.x<g?"left":"center";return{x:_-n.tooltipState.offsetX,y:x-n.tooltipState.offsetY,xAlign:w}},mu.modes.customInteractionMode=function(u,d){const p=Ri(d,u),m=[];return mu.evaluateInteractionItems(u,u.options.indexAxis||"x",p,(g,_,x)=>{u.options.indexAxis==="y"&&g.inYRange(p.y,!0)&&u.data.datasets[_].data[x]&&m.push({element:g,datasetIndex:_,index:x}),u.options.indexAxis==="x"&&p.x!==null&&g.inXRange(p.x,!0)&&u.data.datasets[_].data[x]&&m.push({element:g,datasetIndex:_,index:x})}),m};const r=n.numLabels.value>25?d0:f0,s=({chart:u,index:d})=>{const p=u.data;return{size:r,style:p?.isLabelEmpty?.[d]?"italic":"normal"}},a=(u,d,p)=>u.chart.options.indexAxis===u.axis?(d=u.getLabelForValue(p),d&&d.length>Ja?d.slice(0,Ja)+"...":d):u.getLabelForValue(Number(d)),l=h.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"?!St(n.metricAxesTitle?.value):!St(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"?!St(n.metricAxesTitle?.value):!St(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=>{l0(n.tooltipState,u)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return h.getCurrentInstance()&&h.onUnmounted(()=>{Ye.positioners[e]&&delete Ye.positioners[e]}),l}on.register(...pR);const gR=(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 yR(n,t,e,i,r){const s=h.shallowRef(null),a=(l,u)=>{if(t.value)return new on(t.value,{type:n,data:l,plugins:i,options:u})};return h.onMounted(()=>{s.value=a(e.value,r.value)}),h.onBeforeUnmount(()=>{St(s.value)||s.value.destroy()}),h.watch(e,(l,u)=>{if(gR(u,l)&&!St(s.value)){for(const[d,p]of l.datasets.entries())Object.assign(s.value.data.datasets[d],p);s.value.data.labels=l.labels,s.value.update()}else St(s.value)||s.value.destroy(),s.value=a(l,r.value)}),h.watch(t,()=>{St(s.value)||s.value.destroy(),s.value=a(e.value,r.value)}),h.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))&&(St(s.value)||s.value.destroy(),s.value=a(e.value,l))}),s}const Zg=1e3,_R=1e4,Qg=1e6,Jg=1e9,t0=1e12,co=(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("")},Kr=(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 uo(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?_R:Zg;return n<r||t.precision&&t.precision>Math.log10(n)?e=co(Kr(n,1,t),t):n<Qg?e=`${Kr(n,Zg,t)}k`:n<Jg?e=`${Kr(n,Qg,t)}m`:n<t0?e=`${co(Kr(n,Jg,t),t)}b`:e=`${co(Kr(n,t0,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}uo.addCommas=co;function bR(n,t,e){const{i18n:i}=xt.useI18n(),{formatBytes:r}=ni({i18n:i}),{translateUnit:s}=xt.useTranslatedUnits();return{legendValues:h.computed(()=>n.value.datasets.reduce((l,u)=>{const d=u.total?u.total:u.data.reduce((m,g)=>m+(typeof g=="number"?Number(g)||0:Number(g&&g.y)||0),0);let p;if(e.value==="bytes")p=r(d);else{const m=s(e.value,d);p=i&&i.t("legend.datapointValueDisplay",{value:uo(d,{capital:!0}),unit:m})||`${uo(d,{capital:!0})} ${e.value}`}return{...l,[u.label]:{raw:d,formatted:p,isThreshold:u.isThreshold}}},{}))}}function xR(n){return h.computed(()=>{if(!n.value?.meta)return"";const e=n.value.meta.start,i=n.value.meta.end;return e&&i?`${Fh(new Date(e))} - ${Fh(new Date(i),{includeTZ:!0})}`:""})}function wR(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};Ye.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,p=Qa(a,u,d),m=a.y,g=a.x<d?"left":"center";return{x:p-n.tooltipState.offsetX,y:m,xAlign:g}};const r=h.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:s=>{l0(n.tooltipState,s)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return h.onUnmounted(()=>{Ye.positioners[e]&&delete Ye.positioners[e]}),{options:r}}function vR(n){const t=h.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 A0({tickValue:d,granularity:n.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!St(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value})),e=h.computed(()=>({title:{display:!St(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};Ye.positioners[r]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const p=this.chart.canvas.getBoundingClientRect(),m=n.tooltipState.width||this.width,g=n.tooltipState.height||this.height,_=p.width/2,x=p.height/2,w=Qa(d,m,_);let S=c0(d,g,x);const C=d.y<x?"top":"bottom",A=d.x<_?"left":"center";return g>p.height&&(S=0),{x:w,y:S,xAlign:A,yAlign:C}};const a=h.computed(()=>{const u=Number(n.timeRangeMs.value),d=new Date,p=new Date(d.getTime()-u);return kp(u)>24||p.getDate()!==d.getDate()}),l=h.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=>{Ou(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 h.onUnmounted(()=>{Ye.positioners[r]&&delete Ye.positioners[r]}),{options:l}}const SR=["usd","bytes"],TR="usd";function MR(n){const{i18n:t}=xt.useI18n(),{formatUnit:e}=ni({i18n:t}),i=(_,x)=>!x||!SR.includes(x)?_:_===0&&x===TR?t.formatNumber(0,{style:"currency",currency:"USD"}):e(_,x),r=h.computed(()=>{const _=Number(n.timeRangeMs.value),x=new Date,w=new Date(x.getTime()-_);return kp(_)>24||w.getDate()!==x.getDate()}),s=h.computed(()=>({display:!St(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}})),a=h.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=h.computed(()=>({type:"time",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:_=>A0({tickValue:new Date(_),granularity:n.granularity.value,dayBoundaryCrossed:r.value})},title:s.value,border:{display:!1}})),u=h.computed(()=>({title:{display:!St(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 S=w?.timestamp;return S===void 0?"":Jr({tickValue:new Date(S),granularity:x})},m=`scatterChartTooltipPosition-${n.tooltipState.chartID}`;Ye.positioners[m]=function(_,x){if(!_.length||n.tooltipState.interactionMode==="interactive"||x.x===null||x.y===null)return!1;const w=this.chart.canvas.getBoundingClientRect(),S=n.tooltipState.width||this.width,C=n.tooltipState.height||this.height,A=w.width/2,B=w.height/2,P=Qa(x,S,A);let I=c0(x,C,B);const $=x.y<B?"top":"bottom",z=x.x<A?"left":"center";return C>w.height&&(I=0),{x:P,y:I,xAlign:z,yAlign:$}};const g=h.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:m,external:_=>{Ou(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 h.onUnmounted(()=>{Ye.positioners[m]&&delete Ye.positioners[m]}),{options:g}}function kR(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:r,pivotRecords:s,rowLabels:a,colorPalette:l,seriesDimension:u}=n,{i18n:d}=xt.useI18n(),{evaluateFeatureFlag:p}=xt.useEvaluateFeatureFlag(),m=p("analytics-color-updates",!1);return t?i.map(g=>({label:d&&d.te(`chartLabels.${g}`)&&d.t(`chartLabels.${g}`)||g,backgroundColor:m?ua({metric:g}):Eu(i.indexOf(g),Kn),data:a.map((_,x)=>e?s[`${_.id},${g}`]||0:s[`${x},${g}`]||null)})):Array.from(r).flatMap((g,_)=>g?{label:d&&d.te(`chartLabels.${g.name}`)&&d.t(`chartLabels.${g.name}`)||g.name,backgroundColor:m?ua({dimension:u,dimensionValue:g.id}):Ru(_,g.name,g.id==="empty",l??Kn),data:a.map(x=>s[`${x.id},${g.id}`]||null),isSegmentEmpty:g.id==="empty"}:[])}function DR(n,t){const{i18n:e}=xt.useI18n();return h.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,p=d&&l.length>1;if(!r.length||!a)return{datasets:[],labels:[]};const m=d&&l||a,g=m[0],_=m.length>1?m[1]:m[0],x=Object.fromEntries(u?r.flatMap(M=>a.map((O,N)=>{const W=M.event[g],G=d?`${W},${O}`:`${N},${O}`,lt=M.event[O];return[G,lt]})):r.map(M=>{const O=d?`${M.event[g]},${M.event[_]}`:`${g},${_}`,N=M.event[a[0]];return[O,N]})),w=Object.keys(x).reduce((M,O)=>{const[N]=O.split(","),W=x[O];return M[N]?M[N]+=W:M[N]=W,M},{}),S=Object.entries(w).sort(([,M],[,O])=>Number(O)-Number(M)).map(([M])=>M),C=s[g],A=s[_];let B=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&&g==="country_code"&&(B=B.map(M=>({...M,name:Dc(M.id)||M.name}))),d&&_==="country_code"&&(P=P.map(M=>({...M,name:Dc(M.id)||M.name}))),g!=="status_code"&&g!=="status_code_grouped"&&(B.sort((M,O)=>S.indexOf(M.id)-S.indexOf(O.id)),P.sort((M,O)=>S.indexOf(M.id)-S.indexOf(O.id))),!B||!P)return{labels:[],datasets:[]};const I=kR({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:m,barSegmentLabels:P,pivotRecords:x,rowLabels:B,seriesDimension:_,colorPalette:n.colorPalette||Kn}),$=d?B.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),z=B.map(M=>M.id==="empty");return{labels:$,datasets:I,isLabelEmpty:z,isMultiDimension:p}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const CR=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),OR=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return Dp(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},AR=(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 CR(l,u,e)};function ER(n,t){const{i18n:e}=xt.useI18n(),{evaluateFeatureFlag:i}=xt.useEvaluateFeatureFlag(),r=i("analytics-color-updates",!1);return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const a=t.value.data,{display:l,metric_names:u,start:d,end:p}=t.value.meta,m=new Date(d).getTime(),g=new Date(p).getTime();if(!u)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const _=l&&Object.keys(l)||u,x=_&&_[0],w=l?.[x],S=!!w&&u.length>1;let C=l&&w&&Object.keys(w).map(v=>({id:v,name:w[v].name}))||u.map(v=>({id:v,name:v}));x==="country_code"&&(C=C.map(v=>({...v,name:Dc(v.id)||v.name})));const A=t.value.meta.granularity_ms;if(typeof A!="number"||isNaN(A)||!isFinite(A)||A===0)return console.error("Invalid step value:",A),{datasets:[],labels:[]};if(!a.length)return{datasets:[],labels:[]};const B=OR(m),P=AR(m,g,A,B,a),I=a?.length?a.reduce((v,M)=>{const O=new Date(M.timestamp).valueOf(),N=M.event;for(const W of u)O in v||(v[O]={}),W in v[O]||(v[O][W]={});for(const W of u)C.forEach(G=>{(w?N[x]===G.id:W===G.id)?(v[O][W]||(v[O][W]={}),v[O][W][G.id]=Math.round(Number(N[W])*1e3)/1e3):_.length||(v[O][W]||(v[O][W]={}),v[O][W][G.id]=Math.round(Number(N[G.id])*1e3)/1e3)});return v},{}):{},z=[...w||u.length===1?u.flatMap(v=>C.map(M=>[v,M.id,M.name,M.id==="empty"])):C.map(v=>[v.name,v.id,v.name,v.id==="empty"])].map(([v,M,O,N],W)=>{const G=P.map(ct=>ct in I&&v in I[ct]?{x:ct,y:I[ct][v][M]||0}:{x:ct,y:0});let{colorPalette:lt,fill:ut}=n;St(lt)&&(lt=Kn);const ht=r?ua({dimension:x,dimensionValue:M}):Ru(W,O,N,lt),dt=N0(O)?e.t(`chartLabels.${O}`):O,bt=N0(v)?e.t(`chartLabels.${v}`):v,at=u.findIndex(ct=>ct===v);return{rawDimension:O,rawMetric:v,label:S?`${dt} — ${bt}`:dt,borderColor:ht,backgroundColor:ht,data:G,total:G.reduce((ct,{y:V})=>ct+Number(V),0),...yP,...S?{borderDash:at===0?[]:[at*4,2]}:{},fill:ut,borderWidth:ut?bP:_P,isSegmentEmpty:N}});return x==="status_code"||x==="status_code_grouped"?z.sort((v,M)=>(v.label??"")<(M.label??"")?-1:1):z.sort((v,M)=>Number(v.total)<Number(M.total)?-1:1),{datasets:z}}}catch(a){return console.error(a),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const RR=2,PR=.6,e0=1,IR=2,n0=50,LR=[6,4],NR=[2,3],BR=(n,t)=>{const e=Math.sin(t)*1e4;return(e-Math.floor(e))*n};function FR(n,t){const{i18n:e}=xt.useI18n(),{evaluateFeatureFlag:i}=xt.useEvaluateFeatureFlag(),r=i("analytics-color-updates",!1),s=(a,l)=>l||(a===n0?e.t("scatter.median"):e.t("scatter.percentile",{value:a}));return h.computed(()=>{try{const a=t.value;if(!a?.points?.length)return{datasets:[]};const{metric:l,dimension:u,display:d,xMetric:p,xMetricUnit:m}=a,g=p?e.te(`chartLabels.${p}`)&&e.t(`chartLabels.${p}`)||p:"",_=n.scatter||{},x=_.jitterMs??0,w=_.pointRadius??RR,S=_.pointOpacity??PR,C=new Map,A=[];a.points.forEach(G=>{const lt=G.group??l,ut=C.get(lt)||[];let ht,dt;G.x!==void 0?(ht={x:G.x,timestamp:G.timestamp},dt=[{label:g,value:G.x,...m?{unit:m}:{}},...G.extras??[]]):(ht={x:G.timestamp+BR(x,G.timestamp+G.value)},dt=G.extras??[]),ut.push({...ht,y:G.value,...dt.length?{extras:dt}:{}}),C.set(lt,ut),A.push(G.value)});const B=_.percentileLines||[],P=[...B.map(G=>G.percentile),..._.outlierPercentile!==void 0?[_.outlierPercentile]:[]],I=P.length?l2(A,P):new Map,$=_.outlierPercentile!==void 0?I.get(_.outlierPercentile):void 0,z=$!==void 0&&Number.isFinite($),v=St(n.colorPalette)?Kn:n.colorPalette,M=n.themeColors?.value??Gu(),O=[],N=G=>{const lt=G?.y;return z&&Number.isFinite(lt)&<>$};Array.from(C.entries()).forEach(([G,lt],ut)=>{const ht=u&&d?.[G]?.name||G,dt=G==="empty",bt=r?ua({dimension:u,dimensionValue:G}):Ru(ut,ht,dt,v),at=ju(bt,S),ct=e.te(`chartLabels.${ht}`)&&e.t(`chartLabels.${ht}`)||ht;O.push({type:"scatter",rawDimension:ht,rawMetric:l,label:ct,borderColor:V=>N(V.raw)?M.outlier:bt,backgroundColor:V=>N(V.raw)?M.outlier:at,pointRadius:V=>N(V.raw)?w+e0:w,pointHoverRadius:V=>(N(V.raw)?w+e0:w)+IR,data:lt,pointBorderWidth:0,showLine:!1,isSegmentEmpty:dt})});const W=[];return B.forEach(G=>{const lt=I.get(G.percentile);if(lt===void 0||!Number.isFinite(lt))return;const ut=G.percentile===n0;W.push({percentile:G.percentile,label:s(G.percentile,G.label),value:lt,color:G.color||(ut?M.medianLine:M.outlier),borderDash:G.borderDash||(ut?LR:NR)})}),{datasets:O,...z?{outlier:{value:$,label:e.t("scatter.outlier",{label:s(_.outlierPercentile)}),color:M.outlier}}:{},...W.length?{referenceLines:W}:{}}}catch(a){return console.warn(a),{datasets:[]}}})}const zR=(n,t)=>{h.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 UR(){const{i18n:n}=xt.useI18n();return{translateUnit:(e,i)=>{const r=i===1,s=`chartUnits.${e}`;return mo(e)?"":n.te(s)?n.t(s,{plural:r?"":"s"}):e}}}const HR="analytics-query-provider",i0=2;function WR(){const n=h.inject(HR);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function r0(n,t){return h.getCurrentScope()?(h.onScopeDispose(n,t),!0):!1}const s0=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const $R=n=>n!=null,VR=Object.prototype.toString,YR=n=>VR.call(n)==="[object Object]";function Ga(n){return Array.isArray(n)?n:[n]}function qR(n){return h.getCurrentInstance()}function jR(n,t={}){if(!h.isRef(n))return h.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=h.customRef(()=>({get(){return n.value[i]},set(r){var s;if(!((s=h.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 GR(n,t=!0,e){qR()?h.onMounted(n,e):t?n():h.nextTick(n)}function KR(n,t,e){return h.watch(n,t,{...e,immediate:!0})}const Ka=s0?window:void 0;function Xr(n){var t;const e=h.toValue(n);return(t=e?.$el)!==null&&t!==void 0?t:e}function fo(...n){const t=(i,r,s,a)=>(i.addEventListener(r,s,a),()=>i.removeEventListener(r,s,a)),e=h.computed(()=>{const i=Ga(h.toValue(n[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return KR(()=>{var i,r;return[(i=(r=e.value)===null||r===void 0?void 0:r.map(s=>Xr(s)))!==null&&i!==void 0?i:[Ka].filter(s=>s!=null),Ga(h.toValue(e.value?n[1]:n[0])),Ga(h.unref(e.value?n[2]:n[1])),h.toValue(e.value?n[3]:n[2])]},([i,r,s,a],l,u)=>{if(!i?.length||!r?.length||!s?.length)return;const d=YR(a)?{...a}:a,p=i.flatMap(m=>r.flatMap(g=>s.map(_=>t(m,g,_,d))));u(()=>{p.forEach(m=>m())})},{flush:"post"})}function XR(){const n=h.shallowRef(!1),t=h.getCurrentInstance();return t&&h.onMounted(()=>{n.value=!0},t),n}function o0(n){const t=XR();return h.computed(()=>(t.value,!!n()))}function ZR(n,t,e={}){const{window:i=Ka,...r}=e;let s;const a=o0(()=>i&&"MutationObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=h.watch(h.computed(()=>{const m=Ga(h.toValue(n)).map(Xr).filter($R);return new Set(m)}),m=>{l(),a.value&&m.size&&(s=new MutationObserver(t),m.forEach(g=>s.observe(g,r)))},{immediate:!0,flush:"post"}),d=()=>s?.takeRecords(),p=()=>{u(),l()};return r0(p),{isSupported:a,stop:p,takeRecords:d}}const Xa={speed:2,margin:30,direction:"both"};function QR(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 JR(n,t={}){var e,i,r,s;const{pointerTypes:a,preventDefault:l,stopPropagation:u,exact:d,onMove:p,onEnd:m,onStart:g,initialValue:_,axis:x="both",draggingElement:w=Ka,containerElement:S,handle:C=n,buttons:A=[0],restrictInView:B,autoScroll:P=!1}=t,I=h.ref((e=h.toValue(_))!==null&&e!==void 0?e:{x:0,y:0}),$=h.ref(),z=V=>a?a.includes(V.pointerType):!0,v=V=>{h.toValue(l)&&V.preventDefault(),h.toValue(u)&&V.stopPropagation()},M=h.toValue(P),O=typeof M=="object"?{speed:(i=h.toValue(M.speed))!==null&&i!==void 0?i:Xa.speed,margin:(r=h.toValue(M.margin))!==null&&r!==void 0?r:Xa.margin,direction:(s=M.direction)!==null&&s!==void 0?s:Xa.direction}:Xa,N=V=>typeof V=="number"?[V,V]:[V.x,V.y],W=(V,L,H)=>{const{clientWidth:it,clientHeight:st,scrollLeft:X,scrollTop:tt,scrollWidth:rt,scrollHeight:j}=V,[et,ot]=N(O.margin),[wt,Lt]=N(O.speed);let vt=0,Ot=0;(O.direction==="x"||O.direction==="both")&&(H.x<et&&X>0?vt=-wt:H.x+L.width>it-et&&X<rt-it&&(vt=wt)),(O.direction==="y"||O.direction==="both")&&(H.y<ot&&tt>0?Ot=-Lt:H.y+L.height>st-ot&&tt<j-st&&(Ot=Lt)),(vt||Ot)&&V.scrollBy({left:vt,top:Ot,behavior:"auto"})};let G=null;const lt=()=>{const V=h.toValue(S);V&&!G&&(G=setInterval(()=>{const L=h.toValue(n).getBoundingClientRect(),{x:H,y:it}=I.value,st={x:H-V.scrollLeft,y:it-V.scrollTop};st.x>=0&&st.y>=0&&(W(V,L,st),st.x+=V.scrollLeft,st.y+=V.scrollTop,I.value=st)},1e3/60))},ut=()=>{G&&(clearInterval(G),G=null)},ht=(V,L,H,it)=>{const[st,X]=typeof H=="number"?[H,H]:[H.x,H.y],{clientWidth:tt,clientHeight:rt}=L;return V.x<st||V.x+it.width>tt-st||V.y<X||V.y+it.height>rt-X},dt=()=>{if(h.toValue(t.disabled)||!$.value)return;const V=h.toValue(S);if(!V)return;const L=h.toValue(n).getBoundingClientRect(),{x:H,y:it}=I.value,st={x:H-V.scrollLeft,y:it-V.scrollTop};ht(st,V,O.margin,L)?lt():ut()};h.toValue(P)&&h.watch(I,dt);const bt=V=>{var L;if(!h.toValue(A).includes(V.button)||h.toValue(t.disabled)||!z(V)||h.toValue(d)&&V.target!==h.toValue(n))return;const H=h.toValue(S),it=H==null||(L=H.getBoundingClientRect)===null||L===void 0?void 0:L.call(H),st=h.toValue(n).getBoundingClientRect(),X={x:V.clientX-(H?st.left-it.left+(P?0:H.scrollLeft):st.left),y:V.clientY-(H?st.top-it.top+(P?0:H.scrollTop):st.top)};g?.(X,V)!==!1&&($.value=X,v(V))},at=V=>{if(h.toValue(t.disabled)||!z(V)||!$.value)return;const L=h.toValue(S);L instanceof HTMLElement&&QR(L);const H=h.toValue(n).getBoundingClientRect();let{x:it,y:st}=I.value;if((x==="x"||x==="both")&&(it=V.clientX-$.value.x,L&&(it=Math.min(Math.max(0,it),L.scrollWidth-H.width))),(x==="y"||x==="both")&&(st=V.clientY-$.value.y,L&&(st=Math.min(Math.max(0,st),L.scrollHeight-H.height))),h.toValue(P)&&L&&(G===null&&W(L,H,{x:it,y:st}),it+=L.scrollLeft,st+=L.scrollTop),L&&(B||P)){if(x!=="y"){const X=it-L.scrollLeft;X<0?it=L.scrollLeft:X>L.clientWidth-H.width&&(it=L.clientWidth-H.width+L.scrollLeft)}if(x!=="x"){const X=st-L.scrollTop;X<0?st=L.scrollTop:X>L.clientHeight-H.height&&(st=L.clientHeight-H.height+L.scrollTop)}}I.value={x:it,y:st},p?.(I.value,V),v(V)},ct=V=>{h.toValue(t.disabled)||!z(V)||$.value&&($.value=void 0,P&&ut(),m?.(I.value,V),v(V))};if(s0){const V=()=>{var L;return{capture:(L=t.capture)!==null&&L!==void 0?L:!0,passive:!h.toValue(l)}};fo(C,"pointerdown",bt,V),fo(w,"pointermove",at,V),fo(w,["pointerup","pointercancel"],ct,V)}return{...jR(I),position:I,isDragging:h.computed(()=>!!$.value),style:h.computed(()=>`
|
|
3
|
+
`):n}function RE(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 Pg(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),p=le(t.footerFont),m=s.length,g=r.length,_=i.length,x=ve(t.padding);let w=x.height,S=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,m&&(w+=m*d.lineHeight+(m-1)*t.titleSpacing+t.titleMarginBottom),C){const P=t.displayColors?Math.max(l,u.lineHeight):u.lineHeight;w+=_*P+(C-_)*u.lineHeight+(C-1)*t.bodySpacing}g&&(w+=t.footerMarginTop+g*p.lineHeight+(g-1)*t.footerSpacing);let A=0;const B=function(P){S=Math.max(S,e.measureText(P).width+A)};return e.save(),e.font=d.string,Jt(n.title,B),e.font=u.string,Jt(n.beforeBody.concat(n.afterBody),B),A=t.displayColors?a+2+t.boxPadding:0,Jt(i,P=>{Jt(P.before,B),Jt(P.lines,B),Jt(P.after,B)}),A=0,e.font=p.string,Jt(n.footer,B),e.restore(),S+=x.width,{width:S,height:w}}function PE(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function IE(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 LE(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"),IE(d,n,t,e)&&(d="center"),d}function Ig(n,t,e){const i=e.yAlign||t.yAlign||PE(n,e);return{xAlign:e.xAlign||t.xAlign||LE(n,t,e,i),yAlign:i}}function NE(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function BE(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Lg(n,t,e,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=n,{xAlign:l,yAlign:u}=e,d=r+s,{topLeft:p,topRight:m,bottomLeft:g,bottomRight:_}=Ai(a);let x=NE(t,l);const w=BE(t,u,d);return u==="center"?l==="left"?x+=d:l==="right"&&(x-=d):l==="left"?x-=Math.max(p,g)+r:l==="right"&&(x+=Math.max(m,_)+r),{x:Oe(x,0,i.width-t.width),y:Oe(w,0,i.height-t.height)}}function Va(n,t,e){const i=ve(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Ng(n){return Gn([],ci(n))}function FE(n,t,e){return Ei(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Bg(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Fg={beforeTitle:ri,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:ri,beforeBody:ri,beforeLabel:ri,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return St(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:ri,afterBody:ri,beforeFooter:ri,footer:ri,afterFooter:ri};function an(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?Fg[t].call(e,i):r}class zg extends Ve{static positioners=ao;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 au(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=FE(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=an(i,"beforeTitle",this,t),s=an(i,"title",this,t),a=an(i,"afterTitle",this,t);let l=[];return l=Gn(l,ci(r)),l=Gn(l,ci(s)),l=Gn(l,ci(a)),l}getBeforeBody(t,e){return Ng(an(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return Jt(t,s=>{const a={before:[],lines:[],after:[]},l=Bg(i,s);Gn(a.before,ci(an(l,"beforeLabel",this,s))),Gn(a.lines,an(l,"label",this,s)),Gn(a.after,ci(an(l,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,e){return Ng(an(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=an(i,"beforeFooter",this,t),s=an(i,"footer",this,t),a=an(i,"afterFooter",this,t);let l=[];return l=Gn(l,ci(r)),l=Gn(l,ci(s)),l=Gn(l,ci(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(RE(this.chart,e[u]));return t.filter&&(l=l.filter((p,m,g)=>t.filter(p,m,g,i))),t.itemSort&&(l=l.sort((p,m)=>t.itemSort(p,m,i))),Jt(l,p=>{const m=Bg(t.callbacks,p);r.push(an(m,"labelColor",this,p)),s.push(an(m,"labelPointStyle",this,p)),a.push(an(m,"labelTextColor",this,p))}),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=ao[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=Pg(this,i),d=Object.assign({},l,u),p=Ig(this.chart,i,d),m=Lg(i,d,p,this.chart);this.xAlign=p.xAlign,this.yAlign=p.yAlign,s={opacity:1,x:m.x,y:m.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:p,bottomRight:m}=Ai(l),{x:g,y:_}=t,{width:x,height:w}=e;let S,C,A,B,P,I;return s==="center"?(P=_+w/2,r==="left"?(S=g,C=S-a,B=P+a,I=P-a):(S=g+x,C=S+a,B=P-a,I=P+a),A=S):(r==="left"?C=g+Math.max(u,p)+a:r==="right"?C=g+x-Math.max(d,m)-a:C=this.caretX,s==="top"?(B=_,P=B-a,S=C-a,A=C+a):(B=_+w,P=B+a,S=C+a,A=C-a),I=B),{x1:S,x2:C,x3:A,y1:B,y2:P,y3:I}}drawTitle(t,e,i){const r=this.title,s=r.length;let a,l,u;if(s){const d=jr(i.rtl,this.x,this.width);for(t.x=Va(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,p=le(s.bodyFont),m=Va(this,"left",s),g=r.x(m),_=u<p.lineHeight?(p.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},S=r.leftForLtr(g,d)+d/2,C=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,tu(t,w,S,C),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,tu(t,w,S,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(g,d),S=r.leftForLtr(r.xPlus(g,1),d-2),C=Ai(a.borderRadius);Object.values(C).some(A=>A!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Vr(t,{x:w,y:x,w:d,h:u,radius:C}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Vr(t,{x:S,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(S,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:p}=i,m=le(i.bodyFont);let g=m.lineHeight,_=0;const x=jr(i.rtl,this.x,this.width),w=function(v){e.fillText(v,x.x(t.x+_),t.y+g/2),t.y+=g+s},S=x.textAlign(a);let C,A,B,P,I,$,z;for(e.textAlign=a,e.textBaseline="middle",e.font=m.string,t.x=Va(this,S,i),e.fillStyle=i.bodyColor,Jt(this.beforeBody,w),_=l&&S!=="right"?a==="center"?d/2+p:d+2+p:0,P=0,$=r.length;P<$;++P){for(C=r[P],A=this.labelTextColors[P],e.fillStyle=A,Jt(C.before,w),B=C.lines,l&&B.length&&(this._drawColorBox(e,t,P,x,i),g=Math.max(m.lineHeight,u)),I=0,z=B.length;I<z;++I)w(B[I]),g=m.lineHeight;Jt(C.after,w)}_=0,g=m.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=jr(i.rtl,this.x,this.width);for(t.x=Va(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:p}=i,{topLeft:m,topRight:g,bottomLeft:_,bottomRight:x}=Ai(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(l+m,u),a==="top"&&this.drawCaret(t,e,i,r),e.lineTo(l+d-g,u),e.quadraticCurveTo(l+d,u,l+d,u+g),a==="center"&&s==="right"&&this.drawCaret(t,e,i,r),e.lineTo(l+d,u+p-x),e.quadraticCurveTo(l+d,u+p,l+d-x,u+p),a==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(l+_,u+p),e.quadraticCurveTo(l,u+p,l,u+p-_),a==="center"&&s==="left"&&this.drawCaret(t,e,i,r),e.lineTo(l,u+m),e.quadraticCurveTo(l,u,l+m,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=ao[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=Pg(this,t),u=Object.assign({},a,this._size),d=Ig(e,t,u),p=Lg(t,u,d,e);(r._to!==p.x||s._to!==p.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,p))}}_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=ve(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),pm(t,e.textDirection),s.y+=a.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),mm(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=!ba(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||!ba(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=ao[s.position].call(this,t,e);return a!==!1&&(i!==a.x||r!==a.y)}}var Ye={id:"tooltip",_element:zg,positioners:ao,afterInit(n,t,e){e&&(n.tooltip=new zg({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:Fg},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"]},zE=Object.freeze({__proto__:null,Colors:QA,Decimation:nE,Filler:vE,Legend:CE,SubTitle:EE,Title:AE,Tooltip:Ye});const UE=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function HE(n,t,e,i){const r=n.indexOf(t);if(r===-1)return UE(n,t,e,i);const s=n.lastIndexOf(t);return r!==s?e:r}const WE=(n,t)=>n===null?null:Oe(Math.round(n),0,t);function Ug(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class $E extends hr{static id="category";static defaults={ticks:{callback:Ug}};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(St(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:HE(i,t,Ct(e,t),this._addedLabels),WE(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 Ug.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 VE(n,t){const e=[],{bounds:r,step:s,min:a,max:l,precision:u,count:d,maxTicks:p,maxDigits:m,includeBounds:g}=n,_=s||1,x=p-1,{min:w,max:S}=t,C=!St(a),A=!St(l),B=!St(d),P=(S-w)/(m+1);let I=Hp((S-w)/x/_)*_,$,z,v,M;if(I<1e-14&&!C&&!A)return[{value:w},{value:S}];M=Math.ceil(S/I)-Math.floor(w/I),M>x&&(I=Hp(M*I/x/_)*_),St(u)||($=Math.pow(10,u),I=Math.ceil(I*$)/$),r==="ticks"?(z=Math.floor(w/I)*I,v=Math.ceil(S/I)*I):(z=w,v=S),C&&A&&s&&RD((l-a)/s,I/1e3)?(M=Math.round(Math.min((l-a)/I,p)),I=(l-a)/M,z=a,v=l):B?(z=C?a:z,v=A?l:v,M=d-1,I=(v-z)/M):(M=(v-z)/I,Vs(M,Math.round(M),I/1e3)?M=Math.round(M):M=Math.ceil(M));const O=Math.max($p(I),$p(z));$=Math.pow(10,St(u)?O:u),z=Math.round(z*$)/$,v=Math.round(v*$)/$;let N=0;for(C&&(g&&z!==a?(e.push({value:a}),z<a&&N++,Vs(Math.round((z+N*I)*$)/$,a,Hg(a,P,n))&&N++):z<a&&N++);N<M;++N){const W=Math.round((z+N*I)*$)/$;if(A&&W>l)break;e.push({value:W})}return A&&g&&v!==l?e.length&&Vs(e[e.length-1].value,l,Hg(l,P,n))?e[e.length-1].value=l:e.push({value:l}):(!A||v===l)&&e.push({value:v}),e}function Hg(n,t,{horizontal:e,minRotation:i}){const r=we(i),s=(e?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+n).length;return Math.min(t/s,a)}class Ya extends hr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return St(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=u=>r=e?r:u,l=u=>s=i?s:u;if(t){const u=qn(r),d=qn(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=VE(r,s);return t.bounds==="ticks"&&Wp(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 js(t,this.chart.options.locale,this.options.ticks.format)}}class YE extends Ya{static id="linear";static defaults={ticks:{callback:Da.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=we(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 lo=n=>Math.floor(Ci(n)),pr=(n,t)=>Math.pow(10,lo(n)+t);function Wg(n){return n/Math.pow(10,lo(n))===1}function $g(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function qE(n,t){const e=t-n;let i=lo(e);for(;$g(n,t,i)>10;)i++;for(;$g(n,t,i)<10;)i--;return Math.min(i,lo(n))}function jE(n,{min:t,max:e}){t=mn(n.min,t);const i=[],r=lo(t);let s=qE(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,p=Math.floor((t-u)/l/10)*l*10;let m=Math.floor((d-p)/Math.pow(10,s)),g=mn(n.min,Math.round((u+p+m*Math.pow(10,s))*a)/a);for(;g<e;)i.push({value:g,major:Wg(g),significand:m}),m>=10?m=m<15?15:20:m++,m>=20&&(s++,m=2,a=s>=0?1:a),g=Math.round((u+p+m*Math.pow(10,s))*a)/a;const _=mn(n.max,g);return i.push({value:_,major:Wg(_),significand:m}),i}class GE extends hr{static id="logarithmic";static defaults={ticks:{callback:Da.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=Ya.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===pr(this.min,0)?pr(this.min,-1):pr(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(pr(i,-1)),a(pr(r,1)))),i<=0&&s(pr(r,-1)),r<=0&&a(pr(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=jE(e,this);return t.bounds==="ticks"&&Wp(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":js(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ci(t),this._valueRange=Ci(this.max)-Ci(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ci(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Du(n){const t=n.ticks;if(t.display&&n.display){const e=ve(t.backdropPadding);return Ct(t.font&&t.font.size,se.font.size)+e.height}return 0}function KE(n,t,e){return e=qt(e)?e:[e],{w:KD(n,t.string,e),h:e.length*t.lineHeight}}function Vg(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 XE(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?Rt/s:0;for(let u=0;u<s;u++){const d=a.setContext(n.getPointLabelContext(u));r[u]=d.padding;const p=n.getPointPosition(u,n.drawingArea+r[u],l),m=le(d.font),g=KE(n.ctx,m,n._pointLabels[u]);i[u]=g;const _=He(n.getIndexAngle(u)+l),x=Math.round(Sa(_)),w=Vg(x,p.x,g.w,0,180),S=Vg(x,p.y,g.h,90,270);ZE(e,t,_,w,S)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=tR(n,i,r)}function ZE(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 QE(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(Sa(He(u.angle+re))),p=iR(u.y,l.h,d),m=eR(d),g=nR(u.x,l.w,m);return{visible:!0,x:u.x,y:p,textAlign:m,left:g,top:p,right:g+l.w,bottom:p+l.h}}function JE(n,t){if(!t)return!0;const{left:e,top:i,right:r,bottom:s}=n;return!(ai({x:e,y:i},t)||ai({x:e,y:s},t)||ai({x:r,y:i},t)||ai({x:r,y:s},t))}function tR(n,t,e){const i=[],r=n._pointLabels.length,s=n.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:Du(s)/2,additionalAngle:a?Rt/r:0};let d;for(let p=0;p<r;p++){u.padding=e[p],u.size=t[p];const m=QE(n,p,u);i.push(m),l==="auto"&&(m.visible=JE(m,d),m.visible&&(d=m))}return i}function eR(n){return n===0||n===180?"center":n<180?"left":"right"}function nR(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function iR(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function rR(n,t,e){const{left:i,top:r,right:s,bottom:a}=e,{backdropColor:l}=t;if(!St(l)){const u=Ai(t.borderRadius),d=ve(t.backdropPadding);n.fillStyle=l;const p=i-d.left,m=r-d.top,g=s-i+d.width,_=a-r+d.height;Object.values(u).some(x=>x!==0)?(n.beginPath(),Vr(n,{x:p,y:m,w:g,h:_,radius:u}),n.fill()):n.fillRect(p,m,g,_)}}function sR(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));rR(e,a,s);const l=le(a.font),{x:u,y:d,textAlign:p}=s;cr(e,n._pointLabels[r],u,d+l.lineHeight/2,l,{color:a.color,textAlign:p,textBaseline:"middle"})}}function Yg(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 oR(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(),Yg(n,e,a,i),s.closePath(),s.stroke(),s.restore())}function aR(n,t,e){return Ei(n,{label:e,index:t,type:"pointLabel"})}class lR extends Ya{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:Da.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=ve(Du(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/Du(this.options))}generateTickLabels(t){Ya.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?XE(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 He(t*e+we(i))}getDistanceFromCenterForValue(t){if(St(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(St(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return aR(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(),Yg(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&&sR(this,a),r.display&&this.ticks.forEach((p,m)=>{if(m!==0||m===0&&this.min<0){u=this.getDistanceFromCenterForValue(p.value);const g=this.getContext(m),_=r.setContext(g),x=s.setContext(g);oR(this,_,u,a,x)}}),i.display){for(t.save(),l=a-1;l>=0;l--){const p=i.setContext(this.getPointLabelContext(l)),{color:m,lineWidth:g}=p;!g||!m||(t.lineWidth=g,t.strokeStyle=m,t.setLineDash(p.borderDash),t.lineDashOffset=p.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)),p=le(d.font);if(s=this.getDistanceFromCenterForValue(this.ticks[u].value),d.showLabelBackdrop){t.font=p.string,a=t.measureText(l.label).width,t.fillStyle=d.backdropColor;const m=ve(d.backdropPadding);t.fillRect(-a/2-m.left,-s-p.size/2-m.top,a+m.width,p.size+m.height)}cr(t,l.label,0,-s,p,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}const qa={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}},ln=Object.keys(qa);function qg(n,t){return n-t}function jg(n,t){if(St(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"&&(Oi(s)||s===!0)?e.startOf(a,"isoWeek",s):e.startOf(a,r)),+a)}function Gg(n,t,e,i){const r=ln.length;for(let s=ln.indexOf(n);s<r-1;++s){const a=qa[ln[s]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(l*a.size))<=i)return ln[s]}return ln[r-1]}function cR(n,t,e,i,r){for(let s=ln.length-1;s>=ln.indexOf(e);s--){const a=ln[s];if(qa[a].common&&n._adapter.diff(r,i,a)>=t-1)return a}return ln[e?ln.indexOf(e):0]}function uR(n){for(let t=ln.indexOf(n)+1,e=ln.length;t<e;++t)if(qa[ln[t]].common)return ln[t]}function Kg(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=Gc(e,t),s=e[i]>=t?e[i]:e[r];n[s]=!0}}function dR(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 Xg(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:dR(n,i,r,e)}class Cu extends hr{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 Fm._date(t.adapters.date);r.init(e),$s(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:jg(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=ND(r,s,a);return this._unit=e.unit||(i.autoSkip?Gg(e.minUnit,this.min,this.max,this._getLabelCapacity(s)):cR(this,l.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:uR(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),Xg(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=Oe(e,0,a),i=Oe(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||Gg(s.minUnit,e,i,this._getLabelCapacity(e)),l=Ct(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,d=Oi(u)||u===!0,p={};let m=e,g,_;if(d&&(m=+t.startOf(m,"isoWeek",u)),m=+t.startOf(m,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(g=m,_=0;g<i;g=+t.add(g,l,a),_++)Kg(p,g,x);return(g===i||r.bounds==="ticks"||_===1)&&Kg(p,g,x),Object.keys(p).sort(qg).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,p=u&&l[u],m=d&&l[d],g=i[e],_=d&&m&&g&&g.major;return this._adapter.format(t,r||(_?m:p))}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=we(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,Xg(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(jg(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return qp(t.sort(qg))}}function ja(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}=oi(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}=oi(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 fR extends Cu{static id="timeseries";static defaults=Cu.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=ja(e,this.min),this._tableRange=ja(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],s=[];let a,l,u,d,p;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)p=r[a+1],u=r[a-1],d=r[a],Math.round((p+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(ja(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return ja(this._table,i*this._tableRange+this._minPos,!0)}}var hR=Object.freeze({__proto__:null,CategoryScale:$E,LinearScale:YE,LogarithmicScale:GE,RadialLinearScale:lR,TimeScale:Cu,TimeSeriesScale:fR});const pR=[pO,YA,zE,hR];function mR(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:u=>({label:u.dataset.label,value:u.label})}};Ye.positioners[e]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const p=this.chart.canvas.getBoundingClientRect(),m=n.tooltipState.width||this.width,g=p.width/2,_=Qa(d,m,g),x=d.y,w=d.x<g?"left":"center";return{x:_-n.tooltipState.offsetX,y:x-n.tooltipState.offsetY,xAlign:w}},mu.modes.customInteractionMode=function(u,d){const p=Ri(d,u),m=[];return mu.evaluateInteractionItems(u,u.options.indexAxis||"x",p,(g,_,x)=>{u.options.indexAxis==="y"&&g.inYRange(p.y,!0)&&u.data.datasets[_].data[x]&&m.push({element:g,datasetIndex:_,index:x}),u.options.indexAxis==="x"&&p.x!==null&&g.inXRange(p.x,!0)&&u.data.datasets[_].data[x]&&m.push({element:g,datasetIndex:_,index:x})}),m};const r=n.numLabels.value>25?d0:f0,s=({chart:u,index:d})=>{const p=u.data;return{size:r,style:p?.isLabelEmpty?.[d]?"italic":"normal"}},a=(u,d,p)=>u.chart.options.indexAxis===u.axis?(d=u.getLabelForValue(p),d&&d.length>Ja?d.slice(0,Ja)+"...":d):u.getLabelForValue(Number(d)),l=h.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"?!St(n.metricAxesTitle?.value):!St(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"?!St(n.metricAxesTitle?.value):!St(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=>{l0(n.tooltipState,u)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return h.getCurrentInstance()&&h.onUnmounted(()=>{Ye.positioners[e]&&delete Ye.positioners[e]}),l}on.register(...pR);const gR=(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 yR(n,t,e,i,r){const s=h.shallowRef(null),a=(l,u)=>{if(t.value)return new on(t.value,{type:n,data:l,plugins:i,options:u})};return h.onMounted(()=>{s.value=a(e.value,r.value)}),h.onBeforeUnmount(()=>{St(s.value)||s.value.destroy()}),h.watch(e,(l,u)=>{if(gR(u,l)&&!St(s.value)){for(const[d,p]of l.datasets.entries())Object.assign(s.value.data.datasets[d],p);s.value.data.labels=l.labels,s.value.update()}else St(s.value)||s.value.destroy(),s.value=a(l,r.value)}),h.watch(t,()=>{St(s.value)||s.value.destroy(),s.value=a(e.value,r.value)}),h.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))&&(St(s.value)||s.value.destroy(),s.value=a(e.value,l))}),s}const Zg=1e3,_R=1e4,Qg=1e6,Jg=1e9,t0=1e12,co=(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("")},Kr=(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 uo(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?_R:Zg;return n<r||t.precision&&t.precision>Math.log10(n)?e=co(Kr(n,1,t),t):n<Qg?e=`${Kr(n,Zg,t)}k`:n<Jg?e=`${Kr(n,Qg,t)}m`:n<t0?e=`${co(Kr(n,Jg,t),t)}b`:e=`${co(Kr(n,t0,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}uo.addCommas=co;function bR(n,t,e){const{i18n:i}=xt.useI18n(),{formatBytes:r}=ni({i18n:i}),{translateUnit:s}=xt.useTranslatedUnits();return{legendValues:h.computed(()=>n.value.datasets.reduce((l,u)=>{const d=u.total?u.total:u.data.reduce((m,g)=>m+(typeof g=="number"?Number(g)||0:Number(g&&g.y)||0),0);let p;if(e.value==="bytes")p=r(d);else{const m=s(e.value,d);p=i&&i.t("legend.datapointValueDisplay",{value:uo(d,{capital:!0}),unit:m})||`${uo(d,{capital:!0})} ${e.value}`}return{...l,[u.label]:{raw:d,formatted:p,isThreshold:u.isThreshold}}},{}))}}function xR(n){return h.computed(()=>{if(!n.value?.meta)return"";const e=n.value.meta.start,i=n.value.meta.end;return e&&i?`${Fh(new Date(e))} - ${Fh(new Date(i),{includeTZ:!0})}`:""})}function wR(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};Ye.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,p=Qa(a,u,d),m=a.y,g=a.x<d?"left":"center";return{x:p-n.tooltipState.offsetX,y:m,xAlign:g}};const r=h.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:s=>{l0(n.tooltipState,s)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return h.onUnmounted(()=>{Ye.positioners[e]&&delete Ye.positioners[e]}),{options:r}}function vR(n){const t=h.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 A0({tickValue:d,granularity:n.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!St(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value})),e=h.computed(()=>({title:{display:!St(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};Ye.positioners[r]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const p=this.chart.canvas.getBoundingClientRect(),m=n.tooltipState.width||this.width,g=n.tooltipState.height||this.height,_=p.width/2,x=p.height/2,w=Qa(d,m,_);let S=c0(d,g,x);const C=d.y<x?"top":"bottom",A=d.x<_?"left":"center";return g>p.height&&(S=0),{x:w,y:S,xAlign:A,yAlign:C}};const a=h.computed(()=>{const u=Number(n.timeRangeMs.value),d=new Date,p=new Date(d.getTime()-u);return kp(u)>24||p.getDate()!==d.getDate()}),l=h.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=>{Ou(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 h.onUnmounted(()=>{Ye.positioners[r]&&delete Ye.positioners[r]}),{options:l}}const SR=["usd","bytes"],TR="usd";function MR(n){const{i18n:t}=xt.useI18n(),{formatUnit:e}=ni({i18n:t}),i=(_,x)=>!x||!SR.includes(x)?_:_===0&&x===TR?t.formatNumber(0,{style:"currency",currency:"USD"}):e(_,x),r=h.computed(()=>{const _=Number(n.timeRangeMs.value),x=new Date,w=new Date(x.getTime()-_);return kp(_)>24||w.getDate()!==x.getDate()}),s=h.computed(()=>({display:!St(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}})),a=h.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=h.computed(()=>({type:"time",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:_=>A0({tickValue:new Date(_),granularity:n.granularity.value,dayBoundaryCrossed:r.value})},title:s.value,border:{display:!1}})),u=h.computed(()=>({title:{display:!St(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 S=w?.timestamp;return S===void 0?"":Jr({tickValue:new Date(S),granularity:x})},m=`scatterChartTooltipPosition-${n.tooltipState.chartID}`;Ye.positioners[m]=function(_,x){if(!_.length||n.tooltipState.interactionMode==="interactive"||x.x===null||x.y===null)return!1;const w=this.chart.canvas.getBoundingClientRect(),S=n.tooltipState.width||this.width,C=n.tooltipState.height||this.height,A=w.width/2,B=w.height/2,P=Qa(x,S,A);let I=c0(x,C,B);const $=x.y<B?"top":"bottom",z=x.x<A?"left":"center";return C>w.height&&(I=0),{x:P,y:I,xAlign:z,yAlign:$}};const g=h.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:m,external:_=>{Ou(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 h.onUnmounted(()=>{Ye.positioners[m]&&delete Ye.positioners[m]}),{options:g}}function kR(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:r,pivotRecords:s,rowLabels:a,colorPalette:l,seriesDimension:u}=n,{i18n:d}=xt.useI18n(),{evaluateFeatureFlag:p}=xt.useEvaluateFeatureFlag(),m=p("analytics-color-updates",!1);return t?i.map(g=>({label:d&&d.te(`chartLabels.${g}`)&&d.t(`chartLabels.${g}`)||g,backgroundColor:m?ua({metric:g}):Eu(i.indexOf(g),Kn),data:a.map((_,x)=>e?s[`${_.id},${g}`]||0:s[`${x},${g}`]||null)})):Array.from(r).flatMap((g,_)=>g?{label:d&&d.te(`chartLabels.${g.name}`)&&d.t(`chartLabels.${g.name}`)||g.name,backgroundColor:m?ua({dimension:u,dimensionValue:g.id}):Ru(_,g.name,g.id==="empty",l??Kn),data:a.map(x=>s[`${x.id},${g.id}`]||null),isSegmentEmpty:g.id==="empty"}:[])}function DR(n,t){const{i18n:e}=xt.useI18n();return h.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,p=d&&l.length>1;if(!r.length||!a)return{datasets:[],labels:[]};const m=d&&l||a,g=m[0],_=m.length>1?m[1]:m[0],x=Object.fromEntries(u?r.flatMap(M=>a.map((O,N)=>{const W=M.event[g],G=d?`${W},${O}`:`${N},${O}`,lt=M.event[O];return[G,lt]})):r.map(M=>{const O=d?`${M.event[g]},${M.event[_]}`:`${g},${_}`,N=M.event[a[0]];return[O,N]})),w=Object.keys(x).reduce((M,O)=>{const[N]=O.split(","),W=x[O];return M[N]?M[N]+=W:M[N]=W,M},{}),S=Object.entries(w).sort(([,M],[,O])=>Number(O)-Number(M)).map(([M])=>M),C=s[g],A=s[_];let B=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&&g==="country_code"&&(B=B.map(M=>({...M,name:Dc(M.id)||M.name}))),d&&_==="country_code"&&(P=P.map(M=>({...M,name:Dc(M.id)||M.name}))),g!=="status_code"&&g!=="status_code_grouped"&&(B.sort((M,O)=>S.indexOf(M.id)-S.indexOf(O.id)),P.sort((M,O)=>S.indexOf(M.id)-S.indexOf(O.id))),!B||!P)return{labels:[],datasets:[]};const I=kR({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:m,barSegmentLabels:P,pivotRecords:x,rowLabels:B,seriesDimension:_,colorPalette:n.colorPalette||Kn}),$=d?B.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),z=B.map(M=>M.id==="empty");return{labels:$,datasets:I,isLabelEmpty:z,isMultiDimension:p}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const CR=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),OR=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return Dp(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},AR=(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 CR(l,u,e)};function ER(n,t){const{i18n:e}=xt.useI18n(),{evaluateFeatureFlag:i}=xt.useEvaluateFeatureFlag(),r=i("analytics-color-updates",!1);return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const a=t.value.data,{display:l,metric_names:u,start:d,end:p}=t.value.meta,m=new Date(d).getTime(),g=new Date(p).getTime();if(!u)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const _=l&&Object.keys(l)||u,x=_&&_[0],w=l?.[x],S=!!w&&u.length>1;let C=l&&w&&Object.keys(w).map(v=>({id:v,name:w[v].name}))||u.map(v=>({id:v,name:v}));x==="country_code"&&(C=C.map(v=>({...v,name:Dc(v.id)||v.name})));const A=t.value.meta.granularity_ms;if(typeof A!="number"||isNaN(A)||!isFinite(A)||A===0)return console.error("Invalid step value:",A),{datasets:[],labels:[]};if(!a.length)return{datasets:[],labels:[]};const B=OR(m),P=AR(m,g,A,B,a),I=a?.length?a.reduce((v,M)=>{const O=new Date(M.timestamp).valueOf(),N=M.event;for(const W of u)O in v||(v[O]={}),W in v[O]||(v[O][W]={});for(const W of u)C.forEach(G=>{(w?N[x]===G.id:W===G.id)?(v[O][W]||(v[O][W]={}),v[O][W][G.id]=Math.round(Number(N[W])*1e3)/1e3):_.length||(v[O][W]||(v[O][W]={}),v[O][W][G.id]=Math.round(Number(N[G.id])*1e3)/1e3)});return v},{}):{},z=[...w||u.length===1?u.flatMap(v=>C.map(M=>[v,M.id,M.name,M.id==="empty"])):C.map(v=>[v.name,v.id,v.name,v.id==="empty"])].map(([v,M,O,N],W)=>{const G=P.map(ct=>ct in I&&v in I[ct]?{x:ct,y:I[ct][v][M]||0}:{x:ct,y:0});let{colorPalette:lt,fill:ut}=n;St(lt)&&(lt=Kn);const ht=r?ua({dimension:x,dimensionValue:M}):Ru(W,O,N,lt),dt=N0(O)?e.t(`chartLabels.${O}`):O,bt=N0(v)?e.t(`chartLabels.${v}`):v,at=u.findIndex(ct=>ct===v);return{rawDimension:O,rawMetric:v,label:S?`${dt} — ${bt}`:dt,borderColor:ht,backgroundColor:ht,data:G,total:G.reduce((ct,{y:V})=>ct+Number(V),0),...yP,...S?{borderDash:at===0?[]:[at*4,2]}:{},fill:ut,borderWidth:ut?bP:_P,isSegmentEmpty:N}});return x==="status_code"||x==="status_code_grouped"?z.sort((v,M)=>(v.label??"")<(M.label??"")?-1:1):z.sort((v,M)=>Number(v.total)<Number(M.total)?-1:1),{datasets:z}}}catch(a){return console.error(a),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const RR=2,PR=.6,e0=1,IR=2,n0=50,LR=[6,4],NR=[2,3],BR=(n,t)=>{const e=Math.sin(t)*1e4;return(e-Math.floor(e))*n};function FR(n,t){const{i18n:e}=xt.useI18n(),{evaluateFeatureFlag:i}=xt.useEvaluateFeatureFlag(),r=i("analytics-color-updates",!1),s=(a,l)=>l||(a===n0?e.t("scatter.median"):e.t("scatter.percentile",{value:a}));return h.computed(()=>{try{const a=t.value;if(!a?.points?.length)return{datasets:[]};const{metric:l,dimension:u,display:d,xMetric:p,xMetricUnit:m}=a,g=p?e.te(`chartLabels.${p}`)&&e.t(`chartLabels.${p}`)||p:"",_=n.scatter||{},x=_.jitterMs??0,w=_.pointRadius??RR,S=_.pointOpacity??PR,C=new Map,A=[];a.points.forEach(G=>{const lt=G.group??l,ut=C.get(lt)||[];let ht,dt;G.x!==void 0?(ht={x:G.x,timestamp:G.timestamp},dt=[{label:g,value:G.x,...m?{unit:m}:{}},...G.extras??[]]):(ht={x:G.timestamp+BR(x,G.timestamp+G.value)},dt=G.extras??[]),ut.push({...ht,y:G.value,...dt.length?{extras:dt}:{}}),C.set(lt,ut),A.push(G.value)});const B=_.percentileLines||[],P=[...B.map(G=>G.percentile),..._.outlierPercentile!==void 0?[_.outlierPercentile]:[]],I=P.length?l2(A,P):new Map,$=_.outlierPercentile!==void 0?I.get(_.outlierPercentile):void 0,z=$!==void 0&&Number.isFinite($),v=St(n.colorPalette)?Kn:n.colorPalette,M=n.themeColors?.value??Gu(),O=[],N=G=>{const lt=G?.y;return z&&Number.isFinite(lt)&<>$};Array.from(C.entries()).forEach(([G,lt],ut)=>{const ht=u&&d?.[G]?.name||G,dt=G==="empty",bt=r?ua({dimension:u,dimensionValue:G}):Ru(ut,ht,dt,v),at=ju(bt,S),ct=e.te(`chartLabels.${ht}`)&&e.t(`chartLabels.${ht}`)||ht;O.push({type:"scatter",rawDimension:ht,rawMetric:l,label:ct,borderColor:V=>N(V.raw)?M.outlier:bt,backgroundColor:V=>N(V.raw)?M.outlier:at,pointRadius:V=>N(V.raw)?w+e0:w,pointHoverRadius:V=>(N(V.raw)?w+e0:w)+IR,data:lt,pointBorderWidth:0,showLine:!1,isSegmentEmpty:dt})});const W=[];return B.forEach(G=>{const lt=I.get(G.percentile);if(lt===void 0||!Number.isFinite(lt))return;const ut=G.percentile===n0;W.push({percentile:G.percentile,label:s(G.percentile,G.label),value:lt,color:G.color||(ut?M.medianLine:M.outlier),borderDash:G.borderDash||(ut?LR:NR)})}),{datasets:O,...z?{outlier:{value:$,label:e.t("scatter.outlier",{label:s(_.outlierPercentile)}),color:M.outlier}}:{},...W.length?{referenceLines:W}:{}}}catch(a){return console.warn(a),{datasets:[]}}})}const zR=(n,t)=>{h.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 UR(){const{i18n:n}=xt.useI18n();return{translateUnit:(e,i)=>{const r=i===1,s=`chartUnits.${e}`;return mo(e)?"":n.te(s)?n.t(s,{plural:r?"":"s"}):e}}}const HR="analytics-query-provider",i0=2;function WR(){const n=h.inject(HR);return{evaluateFeatureFlag:(e,i)=>typeof n?.evaluateFeatureFlagFn!="function"?i:n.evaluateFeatureFlagFn(e,i)}}function r0(n,t){return h.getCurrentScope()?(h.onScopeDispose(n,t),!0):!1}const s0=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const $R=n=>n!=null,VR=Object.prototype.toString,YR=n=>VR.call(n)==="[object Object]";function Ga(n){return Array.isArray(n)?n:[n]}function qR(n){return h.getCurrentInstance()}function jR(n,t={}){if(!h.isRef(n))return h.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=h.customRef(()=>({get(){return n.value[i]},set(r){var s;if(!((s=h.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 GR(n,t=!0,e){qR()?h.onMounted(n,e):t?n():h.nextTick(n)}function KR(n,t,e){return h.watch(n,t,{...e,immediate:!0})}const Ka=s0?window:void 0;function Xr(n){var t;const e=h.toValue(n);return(t=e?.$el)!==null&&t!==void 0?t:e}function fo(...n){const t=(i,r,s,a)=>(i.addEventListener(r,s,a),()=>i.removeEventListener(r,s,a)),e=h.computed(()=>{const i=Ga(h.toValue(n[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return KR(()=>{var i,r;return[(i=(r=e.value)===null||r===void 0?void 0:r.map(s=>Xr(s)))!==null&&i!==void 0?i:[Ka].filter(s=>s!=null),Ga(h.toValue(e.value?n[1]:n[0])),Ga(h.unref(e.value?n[2]:n[1])),h.toValue(e.value?n[3]:n[2])]},([i,r,s,a],l,u)=>{if(!i?.length||!r?.length||!s?.length)return;const d=YR(a)?{...a}:a,p=i.flatMap(m=>r.flatMap(g=>s.map(_=>t(m,g,_,d))));u(()=>{p.forEach(m=>m())})},{flush:"post"})}function XR(){const n=h.shallowRef(!1),t=h.getCurrentInstance();return t&&h.onMounted(()=>{n.value=!0},t),n}function o0(n){const t=XR();return h.computed(()=>(t.value,!!n()))}function ZR(n,t,e={}){const{window:i=Ka,...r}=e;let s;const a=o0(()=>i&&"MutationObserver"in i),l=()=>{s&&(s.disconnect(),s=void 0)},u=h.watch(h.computed(()=>{const m=Ga(h.toValue(n)).map(Xr).filter($R);return new Set(m)}),m=>{l(),a.value&&m.size&&(s=new MutationObserver(t),m.forEach(g=>s.observe(g,r)))},{immediate:!0,flush:"post"}),d=()=>s?.takeRecords(),p=()=>{u(),l()};return r0(p),{isSupported:a,stop:p,takeRecords:d}}const Xa={speed:2,margin:30,direction:"both"};function QR(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 JR(n,t={}){var e,i,r,s;const{pointerTypes:a,preventDefault:l,stopPropagation:u,exact:d,onMove:p,onEnd:m,onStart:g,initialValue:_,axis:x="both",draggingElement:w=Ka,containerElement:S,handle:C=n,buttons:A=[0],restrictInView:B,autoScroll:P=!1}=t,I=h.ref((e=h.toValue(_))!==null&&e!==void 0?e:{x:0,y:0}),$=h.ref(),z=V=>a?a.includes(V.pointerType):!0,v=V=>{h.toValue(l)&&V.preventDefault(),h.toValue(u)&&V.stopPropagation()},M=h.toValue(P),O=typeof M=="object"?{speed:(i=h.toValue(M.speed))!==null&&i!==void 0?i:Xa.speed,margin:(r=h.toValue(M.margin))!==null&&r!==void 0?r:Xa.margin,direction:(s=M.direction)!==null&&s!==void 0?s:Xa.direction}:Xa,N=V=>typeof V=="number"?[V,V]:[V.x,V.y],W=(V,L,H)=>{const{clientWidth:it,clientHeight:st,scrollLeft:X,scrollTop:tt,scrollWidth:rt,scrollHeight:j}=V,[et,ot]=N(O.margin),[wt,Lt]=N(O.speed);let vt=0,Ot=0;(O.direction==="x"||O.direction==="both")&&(H.x<et&&X>0?vt=-wt:H.x+L.width>it-et&&X<rt-it&&(vt=wt)),(O.direction==="y"||O.direction==="both")&&(H.y<ot&&tt>0?Ot=-Lt:H.y+L.height>st-ot&&tt<j-st&&(Ot=Lt)),(vt||Ot)&&V.scrollBy({left:vt,top:Ot,behavior:"auto"})};let G=null;const lt=()=>{const V=h.toValue(S);V&&!G&&(G=setInterval(()=>{const L=h.toValue(n).getBoundingClientRect(),{x:H,y:it}=I.value,st={x:H-V.scrollLeft,y:it-V.scrollTop};st.x>=0&&st.y>=0&&(W(V,L,st),st.x+=V.scrollLeft,st.y+=V.scrollTop,I.value=st)},1e3/60))},ut=()=>{G&&(clearInterval(G),G=null)},ht=(V,L,H,it)=>{const[st,X]=typeof H=="number"?[H,H]:[H.x,H.y],{clientWidth:tt,clientHeight:rt}=L;return V.x<st||V.x+it.width>tt-st||V.y<X||V.y+it.height>rt-X},dt=()=>{if(h.toValue(t.disabled)||!$.value)return;const V=h.toValue(S);if(!V)return;const L=h.toValue(n).getBoundingClientRect(),{x:H,y:it}=I.value,st={x:H-V.scrollLeft,y:it-V.scrollTop};ht(st,V,O.margin,L)?lt():ut()};h.toValue(P)&&h.watch(I,dt);const bt=V=>{var L;if(!h.toValue(A).includes(V.button)||h.toValue(t.disabled)||!z(V)||h.toValue(d)&&V.target!==h.toValue(n))return;const H=h.toValue(S),it=H==null||(L=H.getBoundingClientRect)===null||L===void 0?void 0:L.call(H),st=h.toValue(n).getBoundingClientRect(),X={x:V.clientX-(H?st.left-it.left+(P?0:H.scrollLeft):st.left),y:V.clientY-(H?st.top-it.top+(P?0:H.scrollTop):st.top)};g?.(X,V)!==!1&&($.value=X,v(V))},at=V=>{if(h.toValue(t.disabled)||!z(V)||!$.value)return;const L=h.toValue(S);L instanceof HTMLElement&&QR(L);const H=h.toValue(n).getBoundingClientRect();let{x:it,y:st}=I.value;if((x==="x"||x==="both")&&(it=V.clientX-$.value.x,L&&(it=Math.min(Math.max(0,it),L.scrollWidth-H.width))),(x==="y"||x==="both")&&(st=V.clientY-$.value.y,L&&(st=Math.min(Math.max(0,st),L.scrollHeight-H.height))),h.toValue(P)&&L&&(G===null&&W(L,H,{x:it,y:st}),it+=L.scrollLeft,st+=L.scrollTop),L&&(B||P)){if(x!=="y"){const X=it-L.scrollLeft;X<0?it=L.scrollLeft:X>L.clientWidth-H.width&&(it=L.clientWidth-H.width+L.scrollLeft)}if(x!=="x"){const X=st-L.scrollTop;X<0?st=L.scrollTop:X>L.clientHeight-H.height&&(st=L.clientHeight-H.height+L.scrollTop)}}I.value={x:it,y:st},p?.(I.value,V),v(V)},ct=V=>{h.toValue(t.disabled)||!z(V)||$.value&&($.value=void 0,P&&ut(),m?.(I.value,V),v(V))};if(s0){const V=()=>{var L;return{capture:(L=t.capture)!==null&&L!==void 0?L:!0,passive:!h.toValue(l)}};fo(C,"pointerdown",bt,V),fo(w,"pointermove",at,V),fo(w,["pointerup","pointercancel"],ct,V)}return{...jR(I),position:I,isDragging:h.computed(()=>!!$.value),style:h.computed(()=>`
|
|
4
4
|
left: ${I.value.x}px;
|
|
5
5
|
top: ${I.value.y}px;
|
|
6
6
|
${P?"text-wrap: nowrap;":""}
|