@kong-ui-public/analytics-chart 10.23.6 → 10.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,36 @@
1
- (function(kt,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons"),require("@kong-ui-public/analytics-metric-provider")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons","@kong-ui-public/analytics-metric-provider"],d):(kt=typeof globalThis<"u"?globalThis:kt||self,d(kt["kong-ui-publicvitals-chart"]={},kt.Vue,kt["kong-ui-public-i18n"],kt.KongIcons,kt["kong-ui-public-analytics-metric-provider"]))})(this,(function(kt,d,ic,Wi,Ln){"use strict";const Lm={noDataAvailableTitle:"No data in the current time frame",noDataAvailableDescription:"Once there is traffic, it will display here",limitedResultsShown:"Grouped value limit exceeded, showing the top {maxReturned}",entityNoName:"no-name",debug:"debug",total:"Total",jumpToExplore:"Open in explorer",more_actions:"More actions",emptyEntityInfo:"Requests that do not have a value for the selected group",chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{plural}","%":"%","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",ai_plugin:"AI plugin",ai_provider:"Provider",ai_request_model:"Request model",ai_response_model:"Response model",error_rate:"Error rate",request_count:"Request count",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",response_latency_average:"Response latency (avg)",response_latency_p99:"Response latency (p99)",response_latency_p95:"Response latency (p95)",response_latency_p50:"Response latency (p50)",kong_latency_average:"Kong latency (avg)",kong_latency_p99:"Kong latency (p99)",kong_latency_p95:"Kong latency (p95)",kong_latency_p50:"Kong latency (p50)",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",country_code:"Country",country:"Country",data_plane_node:"Data plane node",data_plane_node_version:"Data plane node version",api_package:"API package",api_product:"API product",api_product_version:"API product version",portal:"Portal",realm:"Realm",runtime_group:"Runtime group",gateway_service:"Gateway service",route:"Route",application:"Application",status_code:"Status code",status_code_grouped:"Status code (grouped)",upstream_status_code:"Upstream status code",upstream_status_code_grouped:"Upstream status code group",time:"Time",Service:"Service",ServiceVersion:"Service version",Route:"Route",Application:"Application",RuntimeGroup:"Runtime group",GatewayService:"Gateway service",StatusCode:"Status code",CodeClass:"Status code (grouped)",Time:"Time",API_PRODUCT:"Api product",API_PRODUCT_VERSION:"Api product version",RUNTIME_GROUP:"Runtime group",GATEWAY_SERVICE:"Gateway service",ROUTE:"Route",APPLICATION:"Application",STATUS_CODE:"Status code",STATUS_CODE_GROUPED:"Status code (grouped)",TIME:"Time",ORGANIZATION:"Organization",TotalRequests:"Request count",RequestsPerMinute:"Requests per minute",LatencyP99:"Response latency (p99)",LatencyP95:"Response latency (p95)",LatencyP50:"Response latency (p50)",LatencyAverage:"Response latency (avg)",UpstreamLatencyP99:"Upstream latency (p99)",UpstreamLatencyP95:"Upstream latency (p95)",UpstreamLatencyP50:"Upstream latency (p50)",UpstreamLatencyAverage:"Upstream latency (avg)",KongLatencyP99:"Kong latency (p99)",KongLatencyP95:"Kong latency (p95)",KongLatencyP50:"Kong latency (p50)",KongLatencyAverage:"Kong latency (avg)",ResponseSizeP99:"Response size (p99)",ResponseSizeP95:"Response size (p95)",ResponseSizeP50:"Response size (p50)",RequestSizeP99:"Request size (p99)",RequestSizeP95:"Request size (p95)",RequestSizeP50:"Request size (p50)",SuccessfulRequests:"Successful requests",SUCCESS:"Successful requests",FailedRequests:"Failed requests",FAILURE:"Failed requests","5XX":"5xx","4XX":"4xx","3XX":"3xx","2XX":"2xx","1XX":"1xx",REQUEST_COUNT:"Request count",REQUEST_PER_MINUTE:"Requests per minute",RESPONSE_LATENCY_P99:"Response latency",RESPONSE_LATENCY_P95:"Response latency",RESPONSE_LATENCY_P50:"Response latency",RESPONSE_SIZE_P99:"Response size (p99)",RESPONSE_SIZE_P95:"Response size (p95)",RESPONSE_SIZE_P50:"Response size (p50)",REQUEST_SIZE_P99:"Request size (p99)",REQUEST_SIZE_P95:"Request size (p95)",REQUEST_SIZE_P50:"Request size (p50)",CONTROL_PLANE:"Control plane",____OTHER____:"Others",ai_request_count:"Request count",total_tokens:"Total token count",prompt_tokens:"Prompt token count",completion_tokens:"Completion token count",cost:"Costs",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"Llm latency (avg)","threshold-warning":"Warning threshold: {value}","threshold-error":"Error threshold: {value}","thatreshold-neutral":"Alert threshold: {value}",api:"API",vulnerability_count:"Vulnerability count",a2a_latency_average:"A2A latency (avg)",a2a_response_size_sum:"A2A response size (sum)",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",mcp_error:"MCP error",mcp_method:"MCP method",mcp_response_size_sum:"MCP response size (sum)",mcp_session_id:"MCP session ID",mcp_tool_name:"MCP tool name",mcp_response_body_size_sum:"MCP response size (sum)",control_plane_count:"Control plane count",service_count:"Gateway service count","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",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"},metricAxisTitles:{error_rate:"Error rate in {unit}",request_count:"Request count",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",latency_in:"Latency in {unit}",size_in:"Size in {unit}",response_latency_average:"Response latency (avg) in {unit}",response_latency_p99:"Response latency (p99) in {unit}",response_latency_p95:"Response latency (p95) in {unit}",response_latency_p50:"Response latency (p50) in {unit}",upstream_latency_p99:"Upstream latency (p99) in {unit}",upstream_latency_p95:"Upstream latency (p95) in {unit}",upstream_latency_p50:"Upstream latency (p50) in {unit}",kong_latency_p99:"Kong latency (p99) in {unit}",kong_latency_p95:"Kong latency (p95) in {unit}",kong_latency_p50:"Kong latency (p50) in {unit}",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",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"Llm latency (avg)",api:"API",a2a_latency_average:"A2A latency (avg) in {unit}",a2a_response_size_sum:"A2A response size (sum) in {unit}",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",mcp_response_size_sum:"MCP response size (sum) in {unit}",mcp_response_body_size_sum:"MCP response body size (sum) in {unit}",control_plane_count:"Control plane count",service_count:"Gateway service count",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count",cache_eviction_rate:"Cache eviction rate in {unit}",cache_expiration_rate:"Cache expiration rate in {unit}",cache_items_average:"Cache items (avg) in {unit}",cache_memory_utilization_max:"Cache memory utilization (max) in {unit}"},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 Nm(){const e=ic.createI18n("en-us",Lm);return{i18n:e,i18nT:ic.i18nTComponent(e)}}function $i(e){return e+.5|0}const hn=(e,t,n)=>Math.max(Math.min(e,n),t);function Yi(e){return hn($i(e*2.55),0,255)}function fn(e){return hn($i(e*255),0,255)}function Ge(e){return hn($i(e/2.55)/100,0,1)}function sc(e){return hn($i(e*100),0,100)}const De={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},Tr=[..."0123456789ABCDEF"],Fm=e=>Tr[e&15],Bm=e=>Tr[(e&240)>>4]+Tr[e&15],Zs=e=>(e&240)>>4===(e&15),zm=e=>Zs(e.r)&&Zs(e.g)&&Zs(e.b)&&Zs(e.a);function Um(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&De[e[1]]*17,g:255&De[e[2]]*17,b:255&De[e[3]]*17,a:t===5?De[e[4]]*17:255}:(t===7||t===9)&&(n={r:De[e[1]]<<4|De[e[2]],g:De[e[3]]<<4|De[e[4]],b:De[e[5]]<<4|De[e[6]],a:t===9?De[e[7]]<<4|De[e[8]]:255})),n}const Hm=(e,t)=>e<255?t(e):"";function Vm(e){var t=zm(e)?Fm:Bm;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Hm(e.a,t):void 0}const Wm=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function oc(e,t,n){const i=t*Math.min(n,1-n),s=(o,r=(o+e/30)%12)=>n-i*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function $m(e,t,n){const i=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function Ym(e,t,n){const i=oc(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function jm(e,t,n,i,s){return e===s?(t-n)/i+(t<n?6:0):t===s?(n-e)/i+2:(e-t)/i+4}function Mr(e){const n=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(n,i,s),r=Math.min(n,i,s),a=(o+r)/2;let l,c,u;return o!==r&&(u=o-r,c=a>.5?u/(2-o-r):u/(o+r),l=jm(n,i,s,u,o),l=l*60+.5),[l|0,c||0,a]}function kr(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(fn)}function Dr(e,t,n){return kr(oc,e,t,n)}function qm(e,t,n){return kr(Ym,e,t,n)}function Gm(e,t,n){return kr($m,e,t,n)}function rc(e){return(e%360+360)%360}function Km(e){const t=Wm.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Yi(+t[5]):fn(+t[5]));const s=rc(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=qm(s,o,r):t[1]==="hsv"?i=Gm(s,o,r):i=Dr(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}function Xm(e,t){var n=Mr(e);n[0]=rc(n[0]+t),n=Dr(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Zm(e){if(!e)return;const t=Mr(e),n=t[0],i=sc(t[1]),s=sc(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${Ge(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const ac={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"},lc={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 Qm(){const e={},t=Object.keys(lc),n=Object.keys(ac);let i,s,o,r,a;for(i=0;i<t.length;i++){for(r=a=t[i],s=0;s<n.length;s++)o=n[s],a=a.replace(o,ac[o]);o=parseInt(lc[r],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let Qs;function Jm(e){Qs||(Qs=Qm(),Qs.transparent=[0,0,0,0]);const t=Qs[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const tp=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ep(e){const t=tp.exec(e);let n=255,i,s,o;if(t){if(t[7]!==i){const r=+t[7];n=t[8]?Yi(r):hn(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?Yi(i):hn(i,0,255)),s=255&(t[4]?Yi(s):hn(s,0,255)),o=255&(t[6]?Yi(o):hn(o,0,255)),{r:i,g:s,b:o,a:n}}}function np(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ge(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Cr=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,ui=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function ip(e,t,n){const i=ui(Ge(e.r)),s=ui(Ge(e.g)),o=ui(Ge(e.b));return{r:fn(Cr(i+n*(ui(Ge(t.r))-i))),g:fn(Cr(s+n*(ui(Ge(t.g))-s))),b:fn(Cr(o+n*(ui(Ge(t.b))-o))),a:e.a+n*(t.a-e.a)}}function Js(e,t,n){if(e){let i=Mr(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=Dr(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function cc(e,t){return e&&Object.assign(t||{},e)}function uc(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=fn(e[3]))):(t=cc(e,{r:0,g:0,b:0,a:1}),t.a=fn(t.a)),t}function sp(e){return e.charAt(0)==="r"?ep(e):Km(e)}class ji{constructor(t){if(t instanceof ji)return t;const n=typeof t;let i;n==="object"?i=uc(t):n==="string"&&(i=Um(t)||Jm(t)||sp(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=cc(this._rgb);return t&&(t.a=Ge(t.a)),t}set rgb(t){this._rgb=uc(t)}rgbString(){return this._valid?np(this._rgb):void 0}hexString(){return this._valid?Vm(this._rgb):void 0}hslString(){return this._valid?Zm(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,s=t.rgb;let o;const r=n===o?.5:n,a=2*r-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,i.r=255&c*i.r+o*s.r+.5,i.g=255&c*i.g+o*s.g+.5,i.b=255&c*i.b+o*s.b+.5,i.a=r*i.a+(1-r)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=ip(this._rgb,t._rgb,n)),this}clone(){return new ji(this.rgb)}alpha(t){return this._rgb.a=fn(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=$i(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Js(this._rgb,2,t),this}darken(t){return Js(this._rgb,2,-t),this}saturate(t){return Js(this._rgb,1,t),this}desaturate(t){return Js(this._rgb,1,-t),this}rotate(t){return Xm(this._rgb,t),this}}function Ke(){}const op=(()=>{let e=0;return()=>e++})();function rt(e){return e==null}function xt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function ft(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function At(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Te(e,t){return At(e)?e:t}function at(e,t){return typeof e>"u"?t:e}const rp=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,dc=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function wt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function St(e,t,n,i){let s,o,r;if(xt(e))for(o=e.length,s=0;s<o;s++)t.call(n,e[s],s);else if(ft(e))for(r=Object.keys(e),o=r.length,s=0;s<o;s++)t.call(n,e[r[s]],r[s])}function to(e,t){let n,i,s,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(s=e[n],o=t[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function eo(e){if(xt(e))return e.map(eo);if(ft(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let s=0;for(;s<i;++s)t[n[s]]=eo(e[n[s]]);return t}return e}function hc(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function ap(e,t,n,i){if(!hc(e))return;const s=t[e],o=n[e];ft(s)&&ft(o)?qi(s,o,i):t[e]=eo(o)}function qi(e,t,n){const i=xt(t)?t:[t],s=i.length;if(!ft(e))return e;n=n||{};const o=n.merger||ap;let r;for(let a=0;a<s;++a){if(r=i[a],!ft(r))continue;const l=Object.keys(r);for(let c=0,u=l.length;c<u;++c)o(l[c],e,r,n)}return e}function Gi(e,t){return qi(e,t,{merger:lp})}function lp(e,t,n){if(!hc(e))return;const i=t[e],s=n[e];ft(i)&&ft(s)?Gi(i,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=eo(s))}const fc={"":e=>e,x:e=>e.x,y:e=>e.y};function cp(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function up(e){const t=cp(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function mn(e,t){return(fc[t]||(fc[t]=up(t)))(e)}function Or(e){return e.charAt(0).toUpperCase()+e.slice(1)}const fe=e=>typeof e<"u",me=e=>typeof e=="function",mc=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function dp(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const dt=Math.PI,Dt=2*dt,hp=Dt+dt,no=Number.POSITIVE_INFINITY,Er=dt/180,Ot=dt/2,Ce=dt/4,io=dt*2/3,pn=Math.log10,ze=Math.sign;function Ki(e,t,n){return Math.abs(e-t)<n}function pc(e){const t=Math.round(e);e=Ki(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(pn(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function fp(e){const t=[],n=Math.sqrt(e);let i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));return n===(n|0)&&t.push(n),t.sort((s,o)=>s-o).pop(),t}function mp(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function gn(e){return!mp(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function pp(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function gc(e,t,n){let i,s,o;for(i=0,s=e.length;i<s;i++)o=e[i][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Vt(e){return e*(dt/180)}function so(e){return e*(180/dt)}function yc(e){if(!At(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function oo(e,t){const n=t.x-e.x,i=t.y-e.y,s=Math.sqrt(n*n+i*i);let o=Math.atan2(i,n);return o<-.5*dt&&(o+=Dt),{angle:o,distance:s}}function di(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function gp(e,t){return(e-t+hp)%Dt-dt}function ne(e){return(e%Dt+Dt)%Dt}function Xi(e,t,n,i){const s=ne(e),o=ne(t),r=ne(n),a=ne(o-s),l=ne(r-s),c=ne(s-o),u=ne(s-r);return s===o||s===r||i&&o===r||a>l&&c<u}function Kt(e,t,n){return Math.max(t,Math.min(n,e))}function yp(e){return Kt(e,-32768,32767)}function Xe(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function Ar(e,t,n){n=n||(r=>e[r]<t);let i=e.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,n(o)?s=o:i=o;return{lo:s,hi:i}}const Ze=(e,t,n,i)=>Ar(e,n,i?s=>{const o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),bp=(e,t,n)=>Ar(e,n,i=>e[i][t]>=n);function _p(e,t,n){let i=0,s=e.length;for(;i<s&&e[i]<t;)i++;for(;s>i&&e[s-1]>n;)s--;return i>0||s<e.length?e.slice(i,s):e}const bc=["push","pop","shift","splice","unshift"];function xp(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),bc.forEach(n=>{const i="_onData"+Or(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function _c(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(bc.forEach(o=>{delete e[o]}),delete e._chartjs)}function xc(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const wc=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function Sc(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,wc.call(window,()=>{i=!1,e.apply(t,n)}))}}function wp(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const Pr=e=>e==="start"?"left":e==="end"?"right":"center",ie=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,Sp=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function vc(e,t,n){const i=t.length;let s=0,o=i;if(e._sorted){const{iScale:r,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=r.axis,{min:h,max:f,minDefined:m,maxDefined:p}=r.getUserBounds();if(m){if(s=Math.min(Ze(l,u,h).lo,n?i:Ze(t,u,r.getPixelForValue(h)).lo),c){const y=l.slice(0,s+1).reverse().findIndex(b=>!rt(b[a.axis]));s-=Math.max(0,y)}s=Kt(s,0,i-1)}if(p){let y=Math.max(Ze(l,r.axis,f,!0).hi+1,n?0:Ze(t,u,r.getPixelForValue(f),!0).hi+1);if(c){const b=l.slice(y-1).findIndex(S=>!rt(S[a.axis]));y+=Math.max(0,b)}o=Kt(y,s,i)-s}else o=i-s}return{start:s,count:o}}function Tc(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),o}const ro=e=>e===0||e===1,Mc=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Dt/n)),kc=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Dt/n)+1,Zi={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Ot)+1,easeOutSine:e=>Math.sin(e*Ot),easeInOutSine:e=>-.5*(Math.cos(dt*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>ro(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>ro(e)?e:Mc(e,.075,.3),easeOutElastic:e=>ro(e)?e:kc(e,.075,.3),easeInOutElastic(e){return ro(e)?e:e<.5?.5*Mc(e*2,.1125,.45):.5+.5*kc(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Zi.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Zi.easeInBounce(e*2)*.5:Zi.easeOutBounce(e*2-1)*.5+.5};function Rr(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ir(e){return Rr(e)?e:new ji(e)}function Lr(e){return Rr(e)?e:new ji(e).saturate(.5).darken(.1).hexString()}const vp=["x","y","borderWidth","radius","tension"],Tp=["color","borderColor","backgroundColor"];function Mp(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:Tp},numbers:{type:"number",properties:vp}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function kp(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Dc=new Map;function Dp(e,t){t=t||{};const n=e+JSON.stringify(t);let i=Dc.get(n);return i||(i=new Intl.NumberFormat(e,t),Dc.set(n,i)),i}function Qi(e,t,n){return Dp(t,n).format(e)}const Cc={values(e){return xt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Cp(e,n)}const r=pn(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Qi(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(pn(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?Cc.numeric.call(this,e,t,n):""}};function Cp(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var ao={formatters:Cc};function Op(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ao.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Nn=Object.create(null),Nr=Object.create(null);function Ji(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;i<s;++i){const o=n[i];e=e[o]||(e[o]=Object.create(null))}return e}function Fr(e,t,n){return typeof t=="string"?qi(Ji(e,t),n):qi(Ji(e,""),t)}class Ep{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>Lr(s.backgroundColor),this.hoverBorderColor=(i,s)=>Lr(s.borderColor),this.hoverColor=(i,s)=>Lr(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Fr(this,t,n)}get(t){return Ji(this,t)}describe(t,n){return Fr(Nr,t,n)}override(t,n){return Fr(Nn,t,n)}route(t,n,i,s){const o=Ji(this,t),r=Ji(this,i),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=r[s];return ft(l)?Object.assign({},c,l):at(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var Et=new Ep({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Mp,kp,Op]);function Ap(e){return!e||rt(e.size)||rt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function lo(e,t,n,i,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,n.push(s)),o>i&&(i=o),i}function Pp(e,t,n,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},o=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let r=0;const a=n.length;let l,c,u,h,f;for(l=0;l<a;l++)if(h=n[l],h!=null&&!xt(h))r=lo(e,s,o,r,h);else if(xt(h))for(c=0,u=h.length;c<u;c++)f=h[c],f!=null&&!xt(f)&&(r=lo(e,s,o,r,f));e.restore();const m=o.length/2;if(m>n.length){for(l=0;l<m;l++)delete s[o[l]];o.splice(0,m)}return r}function Fn(e,t,n){const i=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*i)/i+s}function Oc(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Br(e,t,n,i){Ec(e,t,n,i,null)}function Ec(e,t,n,i,s){let o,r,a,l,c,u,h,f;const m=t.pointStyle,p=t.rotation,y=t.radius;let b=(p||0)*Er;if(m&&typeof m=="object"&&(o=m.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(b),e.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),e.restore();return}if(!(isNaN(y)||y<=0)){switch(e.beginPath(),m){default:s?e.ellipse(n,i,s/2,y,0,0,Dt):e.arc(n,i,y,0,Dt),e.closePath();break;case"triangle":u=s?s/2:y,e.moveTo(n+Math.sin(b)*u,i-Math.cos(b)*y),b+=io,e.lineTo(n+Math.sin(b)*u,i-Math.cos(b)*y),b+=io,e.lineTo(n+Math.sin(b)*u,i-Math.cos(b)*y),e.closePath();break;case"rectRounded":c=y*.516,l=y-c,r=Math.cos(b+Ce)*l,h=Math.cos(b+Ce)*(s?s/2-c:l),a=Math.sin(b+Ce)*l,f=Math.sin(b+Ce)*(s?s/2-c:l),e.arc(n-h,i-a,c,b-dt,b-Ot),e.arc(n+f,i-r,c,b-Ot,b),e.arc(n+h,i+a,c,b,b+Ot),e.arc(n-f,i+r,c,b+Ot,b+dt),e.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*y,u=s?s/2:l,e.rect(n-u,i-l,2*u,2*l);break}b+=Ce;case"rectRot":h=Math.cos(b)*(s?s/2:y),r=Math.cos(b)*y,a=Math.sin(b)*y,f=Math.sin(b)*(s?s/2:y),e.moveTo(n-h,i-a),e.lineTo(n+f,i-r),e.lineTo(n+h,i+a),e.lineTo(n-f,i+r),e.closePath();break;case"crossRot":b+=Ce;case"cross":h=Math.cos(b)*(s?s/2:y),r=Math.cos(b)*y,a=Math.sin(b)*y,f=Math.sin(b)*(s?s/2:y),e.moveTo(n-h,i-a),e.lineTo(n+h,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r);break;case"star":h=Math.cos(b)*(s?s/2:y),r=Math.cos(b)*y,a=Math.sin(b)*y,f=Math.sin(b)*(s?s/2:y),e.moveTo(n-h,i-a),e.lineTo(n+h,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r),b+=Ce,h=Math.cos(b)*(s?s/2:y),r=Math.cos(b)*y,a=Math.sin(b)*y,f=Math.sin(b)*(s?s/2:y),e.moveTo(n-h,i-a),e.lineTo(n+h,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r);break;case"line":r=s?s/2:Math.cos(b)*y,a=Math.sin(b)*y,e.moveTo(n-r,i-a),e.lineTo(n+r,i+a);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(b)*(s?s/2:y),i+Math.sin(b)*y);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Qe(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function ts(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function es(e){e.restore()}function Rp(e,t,n,i,s){if(!t)return e.lineTo(n.x,n.y);if(s==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else s==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function Ip(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function Lp(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),rt(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Np(e,t,n,i,s){if(s.strikethrough||s.underline){const o=e.measureText(i),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(r,u),e.lineTo(a,u),e.stroke()}}function Fp(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Bn(e,t,n,i,s,o={}){const r=xt(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,Lp(e,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&Fp(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),rt(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,i,o.maxWidth)),e.fillText(c,n,i,o.maxWidth),Np(e,n,i,c,o),i+=Number(s.lineHeight);e.restore()}function hi(e,t){const{x:n,y:i,w:s,h:o,radius:r}=t;e.arc(n+r.topLeft,i+r.topLeft,r.topLeft,1.5*dt,dt,!0),e.lineTo(n,i+o-r.bottomLeft),e.arc(n+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,dt,Ot,!0),e.lineTo(n+s-r.bottomRight,i+o),e.arc(n+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,Ot,0,!0),e.lineTo(n+s,i+r.topRight),e.arc(n+s-r.topRight,i+r.topRight,r.topRight,0,-Ot,!0),e.lineTo(n+r.topLeft,i)}const Bp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,zp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Up(e,t){const n=(""+e).match(Bp);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const Hp=e=>+e||0;function zr(e,t){const n={},i=ft(t),s=i?Object.keys(t):t,o=ft(e)?i?r=>at(e[r],e[t[r]]):r=>e[r]:()=>e;for(const r of s)n[r]=Hp(o(r));return n}function Ac(e){return zr(e,{top:"y",right:"x",bottom:"y",left:"x"})}function yn(e){return zr(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Wt(e){const t=Ac(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Pt(e,t){e=e||{},t=t||Et.font;let n=at(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=at(e.style,t.style);i&&!(""+i).match(zp)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:at(e.family,t.family),lineHeight:Up(at(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:at(e.weight,t.weight),string:""};return s.string=Ap(s),s}function ns(e,t,n,i){let s,o,r;for(s=0,o=e.length;s<o;++s)if(r=e[s],r!==void 0&&r!==void 0)return r}function Vp(e,t,n){const{min:i,max:s}=e,o=dc(t,(s-i)/2),r=(a,l)=>n&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function bn(e,t){return Object.assign(Object.create(e),t)}function Ur(e,t=[""],n,i,s=()=>e[0]){const o=n||e;typeof i>"u"&&(i=Nc("_fallback",e));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>Ur([a,...e],t,o,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return Rc(a,l,()=>Xp(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return Fc(a).includes(l)},ownKeys(a){return Fc(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function fi(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Pc(e,i),setContext:o=>fi(e,o,n,i),override:o=>fi(e.override(o),t,n,i)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete e[r],!0},get(o,r,a){return Rc(o,r,()=>$p(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(e,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,r)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,r){return Reflect.has(e,r)},ownKeys(){return Reflect.ownKeys(e)},set(o,r,a){return e[r]=a,delete o[r],!0}})}function Pc(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:me(n)?n:()=>n,isIndexable:me(i)?i:()=>i}}const Wp=(e,t)=>e?e+Or(t):t,Hr=(e,t)=>ft(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Rc(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function $p(e,t,n){const{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=e;let a=i[t];return me(a)&&r.isScriptable(t)&&(a=Yp(t,a,e,n)),xt(a)&&a.length&&(a=jp(t,a,e,r.isIndexable)),Hr(t,a)&&(a=fi(a,s,o&&o[t],r)),a}function Yp(e,t,n,i){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,r||i);return a.delete(e),Hr(e,l)&&(l=Vr(s._scopes,s,e,l)),l}function jp(e,t,n,i){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=n;if(typeof o.index<"u"&&i(e))return t[o.index%t.length];if(ft(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const h=Vr(c,s,e,u);t.push(fi(h,o,r&&r[e],a))}}return t}function Ic(e,t,n){return me(e)?e(t,n):e}const qp=(e,t)=>e===!0?t:typeof e=="string"?mn(t,e):void 0;function Gp(e,t,n,i,s){for(const o of t){const r=qp(n,o);if(r){e.add(r);const a=Ic(r._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==i)return a}else if(r===!1&&typeof i<"u"&&n!==i)return null}return!1}function Vr(e,t,n,i){const s=t._rootScopes,o=Ic(t._fallback,n,i),r=[...e,...s],a=new Set;a.add(i);let l=Lc(a,r,n,o||n,i);return l===null||typeof o<"u"&&o!==n&&(l=Lc(a,r,o,l,i),l===null)?!1:Ur(Array.from(a),[""],s,o,()=>Kp(t,n,i))}function Lc(e,t,n,i,s){for(;n;)n=Gp(e,t,n,i,s);return n}function Kp(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return xt(s)&&ft(n)?n:s||{}}function Xp(e,t,n,i){let s;for(const o of t)if(s=Nc(Wp(o,e),n),typeof s<"u")return Hr(e,s)?Vr(n,i,e,s):s}function Nc(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function Fc(e){let t=e._keys;return t||(t=e._keys=Zp(e._scopes)),t}function Zp(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function Bc(e,t,n,i){const{iScale:s}=e,{key:o="r"}=this._parsing,r=new Array(i);let a,l,c,u;for(a=0,l=i;a<l;++a)c=a+n,u=t[c],r[a]={r:s.parse(mn(u,o),c)};return r}const Qp=Number.EPSILON||1e-14,mi=(e,t)=>t<e.length&&!e[t].skip&&e[t],zc=e=>e==="x"?"y":"x";function Jp(e,t,n,i){const s=e.skip?t:e,o=t,r=n.skip?t:n,a=di(o,s),l=di(r,o);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const h=i*c,f=i*u;return{previous:{x:o.x-h*(r.x-s.x),y:o.y-h*(r.y-s.y)},next:{x:o.x+f*(r.x-s.x),y:o.y+f*(r.y-s.y)}}}function tg(e,t,n){const i=e.length;let s,o,r,a,l,c=mi(e,0);for(let u=0;u<i-1;++u)if(l=c,c=mi(e,u+1),!(!l||!c)){if(Ki(t[u],0,Qp)){n[u]=n[u+1]=0;continue}s=n[u]/t[u],o=n[u+1]/t[u],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),n[u]=s*r*t[u],n[u+1]=o*r*t[u])}}function eg(e,t,n="x"){const i=zc(n),s=e.length;let o,r,a,l=mi(e,0);for(let c=0;c<s;++c){if(r=a,a=l,l=mi(e,c+1),!a)continue;const u=a[n],h=a[i];r&&(o=(u-r[n])/3,a[`cp1${n}`]=u-o,a[`cp1${i}`]=h-o*t[c]),l&&(o=(l[n]-u)/3,a[`cp2${n}`]=u+o,a[`cp2${i}`]=h+o*t[c])}}function ng(e,t="x"){const n=zc(t),i=e.length,s=Array(i).fill(0),o=Array(i);let r,a,l,c=mi(e,0);for(r=0;r<i;++r)if(a=l,l=c,c=mi(e,r+1),!!l){if(c){const u=c[t]-l[t];s[r]=u!==0?(c[n]-l[n])/u:0}o[r]=a?c?ze(s[r-1])!==ze(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}tg(e,s,o),eg(e,o,t)}function co(e,t,n){return Math.max(Math.min(e,n),t)}function ig(e,t){let n,i,s,o,r,a=Qe(e[0],t);for(n=0,i=e.length;n<i;++n)r=o,o=a,a=n<i-1&&Qe(e[n+1],t),o&&(s=e[n],r&&(s.cp1x=co(s.cp1x,t.left,t.right),s.cp1y=co(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=co(s.cp2x,t.left,t.right),s.cp2y=co(s.cp2y,t.top,t.bottom)))}function sg(e,t,n,i,s){let o,r,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")ng(e,s);else{let c=i?e[e.length-1]:e[0];for(o=0,r=e.length;o<r;++o)a=e[o],l=Jp(c,a,e[Math.min(o+1,r-(i?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&ig(e,n)}function Wr(){return typeof window<"u"&&typeof document<"u"}function $r(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function uo(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}const ho=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function og(e,t){return ho(e).getPropertyValue(t)}const rg=["top","right","bottom","left"];function zn(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=rg[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const ag=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function lg(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i;let r=!1,a,l;if(ag(s,o,e.target))a=s,l=o;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function _n(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=ho(n),o=s.boxSizing==="border-box",r=zn(s,"padding"),a=zn(s,"border","width"),{x:l,y:c,box:u}=lg(e,n),h=r.left+(u&&a.left),f=r.top+(u&&a.top);let{width:m,height:p}=t;return o&&(m-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-h)/m*n.width/i),y:Math.round((c-f)/p*n.height/i)}}function cg(e,t,n){let i,s;if(t===void 0||n===void 0){const o=e&&$r(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const r=o.getBoundingClientRect(),a=ho(o),l=zn(a,"border","width"),c=zn(a,"padding");t=r.width-c.width-l.width,n=r.height-c.height-l.height,i=uo(a.maxWidth,o,"clientWidth"),s=uo(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||no,maxHeight:s||no}}const xn=e=>Math.round(e*10)/10;function ug(e,t,n,i){const s=ho(e),o=zn(s,"margin"),r=uo(s.maxWidth,e,"clientWidth")||no,a=uo(s.maxHeight,e,"clientHeight")||no,l=cg(e,t,n);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const f=zn(s,"border","width"),m=zn(s,"padding");c-=m.width+f.width,u-=m.height+f.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?c/i:u-o.height),c=xn(Math.min(c,r,l.maxWidth)),u=xn(Math.min(u,a,l.maxHeight)),c&&!u&&(u=xn(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=xn(Math.floor(u*i))),{width:c,height:u}}function Uc(e,t,n){const i=t||1,s=xn(e.height*i),o=xn(e.width*i);e.height=xn(e.height),e.width=xn(e.width);const r=e.canvas;return r.style&&(n||!r.style.height&&!r.style.width)&&(r.style.height=`${e.height}px`,r.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||r.height!==s||r.width!==o?(e.currentDevicePixelRatio=i,r.height=s,r.width=o,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const dg=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Wr()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function Hc(e,t){const n=og(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Un(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function hg(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function fg(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=Un(e,s,n),a=Un(s,o,n),l=Un(o,t,n),c=Un(r,a,n),u=Un(a,l,n);return Un(c,u,n)}const mg=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},pg=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function pi(e,t,n){return e?mg(t,n):pg()}function Vc(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function Wc(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function $c(e){return e==="angle"?{between:Xi,compare:gp,normalize:ne}:{between:Xe,compare:(t,n)=>t-n,normalize:t=>t}}function Yc({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function gg(e,t,n){const{property:i,start:s,end:o}=n,{between:r,normalize:a}=$c(i),l=t.length;let{start:c,end:u,loop:h}=e,f,m;if(h){for(c+=l,u+=l,f=0,m=l;f<m&&r(a(t[c%l][i]),s,o);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:h,style:e.style}}function jc(e,t,n){if(!n)return[e];const{property:i,start:s,end:o}=n,r=t.length,{compare:a,between:l,normalize:c}=$c(i),{start:u,end:h,loop:f,style:m}=gg(e,t,n),p=[];let y=!1,b=null,S,M,E;const D=()=>l(s,E,S)&&a(s,E)!==0,C=()=>a(o,S)===0||l(o,E,S),A=()=>y||D(),O=()=>!y||C();for(let x=u,_=u;x<=h;++x)M=t[x%r],!M.skip&&(S=c(M[i]),S!==E&&(y=l(S,s,o),b===null&&A()&&(b=a(S,s)===0?x:_),b!==null&&O()&&(p.push(Yc({start:b,end:x,loop:f,count:r,style:m})),b=null),_=x,E=S));return b!==null&&p.push(Yc({start:b,end:h,loop:f,count:r,style:m})),p}function qc(e,t){const n=[],i=e.segments;for(let s=0;s<i.length;s++){const o=jc(i[s],e.points,t);o.length&&n.push(...o)}return n}function yg(e,t,n,i){let s=0,o=t-1;if(n&&!i)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,n&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function bg(e,t,n,i){const s=e.length,o=[];let r=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%s];c.skip||c.stop?a.skip||(i=!1,o.push({start:t%s,end:(l-1)%s,loop:i}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%s,end:r%s,loop:i}),o}function _g(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const o=!!e._loop,{start:r,end:a}=yg(n,s,o,i);if(i===!0)return Gc(e,[{start:r,end:a,loop:o}],n,t);const l=a<r?a+s:a,c=!!e._fullLoop&&r===0&&a===s-1;return Gc(e,bg(n,r,l,c),n,t)}function Gc(e,t,n,i){return!i||!i.setContext||!n?t:xg(e,t,n,i)}function xg(e,t,n,i){const s=e._chart.getContext(),o=Kc(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=n.length,c=[];let u=o,h=t[0].start,f=h;function m(p,y,b,S){const M=a?-1:1;if(p!==y){for(p+=l;n[p%l].skip;)p-=M;for(;n[y%l].skip;)y+=M;p%l!==y%l&&(c.push({start:p%l,end:y%l,loop:b,style:S}),u=S,h=y%l)}}for(const p of t){h=a?h:p.start;let y=n[h%l],b;for(f=h+1;f<=p.end;f++){const S=n[f%l];b=Kc(i.setContext(bn(s,{type:"segment",p0:y,p1:S,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:r}))),wg(b,u)&&m(h,f-1,p.loop,u),y=S,u=b}h<f-1&&m(h,f-1,p.loop,u)}return c}function Kc(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function wg(e,t){if(!t)return!1;const n=[],i=function(s,o){return Rr(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function fo(e,t,n){return e.options.clip?e[n]:t[n]}function Sg(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:fo(n,t,"left"),right:fo(n,t,"right"),top:fo(i,t,"top"),bottom:fo(i,t,"bottom")}:t}function Xc(e,t){const n=t._clip;if(n.disabled)return!1;const i=Sg(t,e.chartArea);return{left:n.left===!1?0:i.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:i.right+(n.right===!0?0:n.right),top:n.top===!1?0:i.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:i.bottom+(n.bottom===!0?0:n.bottom)}}class vg{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){const o=n.listeners[s],r=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:r,currentStep:Math.min(i-n.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=wc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Je=new vg;const Zc="transparent",Tg={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=Ir(e||Zc),s=i.valid&&Ir(t||Zc);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Mg{constructor(t,n,i,s){const o=n[i];s=ns([t.to,s,o,t.from]);const r=ns([t.from,o,s]);this._active=!0,this._fn=t.fn||Tg[t.type||typeof r],this._easing=Zi[t.easing]||Zi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ns([t.to,n,s,t.from]),this._from=ns([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||n<i),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=o;return}l=n/i%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][n]()}}class Yr{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!ft(t))return;const n=Object.keys(Et.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!ft(o))return;const r={};for(const a of n)r[a]=o[a];(xt(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,n){const i=n.options,s=Dg(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&kg(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,n){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(n),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const u=n[c];let h=o[c];const f=i.get(c);if(h)if(f&&h.active()){h.update(f,u,a);continue}else h.cancel();if(!f||!f.duration){t[c]=u;continue}o[c]=h=new Mg(f,t,c,u),s.push(h)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Je.add(this._chart,i),!0}}function kg(e,t){const n=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const o=e[i[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function Dg(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Qc(e,t){const n=e&&e.options||{},i=n.reverse,s=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function Cg(e,t,n){if(n===!1)return!1;const i=Qc(e,n),s=Qc(t,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Og(e){let t,n,i,s;return ft(e)?(t=e.top,n=e.right,i=e.bottom,s=e.left):t=n=i=s=e,{top:t,right:n,bottom:i,left:s,disabled:e===!1}}function Jc(e,t){const n=[],i=e._getSortedDatasetMetas(t);let s,o;for(s=0,o=i.length;s<o;++s)n.push(i[s].index);return n}function tu(e,t,n,i={}){const s=e.keys,o=i.mode==="single";let r,a,l,c;if(t===null)return;let u=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===n){if(u=!0,i.all)continue;break}c=e.values[l],At(c)&&(o||t===0||ze(t)===ze(c))&&(t+=c)}return!u&&!i.all?0:t}function Eg(e,t){const{iScale:n,vScale:i}=t,s=n.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",r=Object.keys(e),a=new Array(r.length);let l,c,u;for(l=0,c=r.length;l<c;++l)u=r[l],a[l]={[s]:u,[o]:e[u]};return a}function jr(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Ag(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Pg(e){const{min:t,max:n,minDefined:i,maxDefined:s}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function Rg(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function eu(e,t,n,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const o=e[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function nu(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,u=Ag(o,r,i),h=t.length;let f;for(let m=0;m<h;++m){const p=t[m],{[l]:y,[c]:b}=p,S=p._stacks||(p._stacks={});f=S[c]=Rg(s,u,y),f[a]=b,f._top=eu(f,r,!0,i.type),f._bottom=eu(f,r,!1,i.type);const M=f._visualValues||(f._visualValues={});M[a]=b}}function qr(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function Ig(e,t){return bn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Lg(e,t,n){return bn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function is(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const o=s._stacks;if(!o||o[i]===void 0||o[i][n]===void 0)return;delete o[i][n],o[i]._visualValues!==void 0&&o[i]._visualValues[n]!==void 0&&delete o[i]._visualValues[n]}}}const Gr=e=>e==="reset"||e==="none",iu=(e,t)=>t?e:Object.assign({},e),Ng=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Jc(n,!0),values:null};class wn{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=jr(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&&is(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(h,f,m,p)=>h==="x"?f:h==="r"?p:m,o=n.xAxisID=at(i.xAxisID,qr(t,"x")),r=n.yAxisID=at(i.yAxisID,qr(t,"y")),a=n.rAxisID=at(i.rAxisID,qr(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,o,r,a),u=n.vAxisID=s(l,r,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(r),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_c(this._data,this),t._stacked&&is(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(ft(n)){const s=this._cachedMeta;this._data=Eg(n,s)}else if(i!==n){if(i){_c(i,this);const s=this._cachedMeta;is(s),s._parsed=[]}n&&Object.isExtensible(n)&&xp(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=jr(n.vScale,n),n.stack!==i.stack&&(s=!0,is(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&(nu(this,n._parsed),n._stacked=jr(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,h,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{xt(s[t])?f=this.parseArrayData(i,s,t,n):ft(s[t])?f=this.parseObjectData(i,s,t,n):f=this.parsePrimitiveData(i,s,t,n);const m=()=>h[a]===null||c&&h[a]<c[a];for(u=0;u<n;++u)i._parsed[u+t]=h=f[u],l&&(m()&&(l=!1),c=h);i._sorted=l}r&&nu(this,f)}parsePrimitiveData(t,n,i,s){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),u=o===r,h=new Array(s);let f,m,p;for(f=0,m=s;f<m;++f)p=f+i,h[f]={[a]:u||o.parse(c[p],p),[l]:r.parse(n[p],p)};return h}parseArrayData(t,n,i,s){const{xScale:o,yScale:r}=t,a=new Array(s);let l,c,u,h;for(l=0,c=s;l<c;++l)u=l+i,h=n[u],a[l]={x:o.parse(h[0],u),y:r.parse(h[1],u)};return a}parseObjectData(t,n,i,s){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,h,f,m;for(u=0,h=s;u<h;++u)f=u+i,m=n[f],c[u]={x:o.parse(mn(m,a),f),y:r.parse(mn(m,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){const s=this.chart,o=this._cachedMeta,r=n[t.axis],a={keys:Jc(s,!0),values:n._stacks[t.axis]._visualValues};return tu(a,r,o.index,{mode:i})}updateRangeFromParsed(t,n,i,s){const o=i[n.axis];let r=o===null?NaN:o;const a=s&&i._stacks[n.axis];s&&a&&(s.values=a,r=tu(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,n){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,a=this._getOtherScale(t),l=Ng(n,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=Pg(a);let f,m;function p(){m=s[f];const y=m[a.axis];return!At(m[t.axis])||u>y||h<y}for(f=0;f<r&&!(!p()&&(this.updateRangeFromParsed(c,t,m,l),o));++f);if(o){for(f=r-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,m,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,o,r;for(s=0,o=n.length;s<o;++s)r=n[s][t.axis],At(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,i=n.iScale,s=n.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=Og(at(this.options.clip,Cg(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,i=this._cachedMeta,s=i.data||[],o=n.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,o,a,l),u=a;u<a+l;++u){const h=s[u];h.hidden||(h.active&&c?r.push(h):h.draw(t,o))}for(u=0;u<r.length;++u)r[u].draw(t,o)}getStyle(t,n){const i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,i){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=Lg(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Ig(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",i){const s=n==="active",o=this._cachedDataOpts,r=t+"-"+n,a=o[r],l=this.enableOptionSharing&&fe(i);if(a)return iu(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),h=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),m=Object.keys(Et.elements[t]),p=()=>this.getContext(i,s,n),y=c.resolveNamedOptions(f,m,p,h);return y.$shared&&(y.$shared=l,o[r]=Object.freeze(iu(y,l))),y}_resolveAnimations(t,n,i){const s=this.chart,o=this._cachedDataOpts,r=`animation-${n}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),h);l=u.createResolver(f,this.getContext(t,i,n))}const c=new Yr(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Gr(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,i),{sharedOptions:o,includeOptions:r}}updateElement(t,n,i,s){Gr(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!Gr(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,o=n.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,n,i=!0){const s=this._cachedMeta,o=s.data,r=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=r;a--)c[a]=c[a-n]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,n),i&&this.updateElements(o,t,n,"reset")}updateElements(t,n,i,s){}_removeElements(t,n){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,n);i._stacked&&is(i,s)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,i,s]=t;this[n](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Fg(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let i=[];for(let s=0,o=n.length;s<o;s++)i=i.concat(n[s].controller.getAllParsedValues(e));e._cache.$bar=xc(i.sort((s,o)=>s-o))}return e._cache.$bar}function Bg(e){const t=e.iScale,n=Fg(t,e.type);let i=t._length,s,o,r,a;const l=()=>{r===32767||r===-32768||(fe(a)&&(i=Math.min(i,Math.abs(r-a)||i)),a=r)};for(s=0,o=n.length;s<o;++s)r=t.getPixelForValue(n[s]),l();for(a=void 0,s=0,o=t.ticks.length;s<o;++s)r=t.getPixelForTick(s),l();return i}function zg(e,t,n,i){const s=n.barThickness;let o,r;return rt(s)?(o=t.min*n.categoryPercentage,r=n.barPercentage):(o=s*i,r=1),{chunk:o/i,ratio:r,start:t.pixels[e]-o/2}}function Ug(e,t,n,i){const s=t.pixels,o=s[e];let r=e>0?s[e-1]:null,a=e<s.length-1?s[e+1]:null;const l=n.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);const c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/i,ratio:n.barPercentage,start:c}}function Hg(e,t,n,i){const s=n.parse(e[0],i),o=n.parse(e[1],i),r=Math.min(s,o),a=Math.max(s,o);let l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}function su(e,t,n,i){return xt(e)?Hg(e,t,n,i):t[n.axis]=n.parse(e,i),t}function ou(e,t,n,i){const s=e.iScale,o=e.vScale,r=s.getLabels(),a=s===o,l=[];let c,u,h,f;for(c=n,u=n+i;c<u;++c)f=t[c],h={},h[s.axis]=a||s.parse(r[c],c),l.push(su(f,h,o,c));return l}function Kr(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Vg(e,t,n){return e!==0?ze(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function Wg(e){let t,n,i,s,o;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.base<e.y,n="bottom",i="top"),t?(s="end",o="start"):(s="start",o="end"),{start:n,end:i,reverse:t,top:s,bottom:o}}function $g(e,t,n,i){let s=t.borderSkipped;const o={};if(!s){e.borderSkipped=o;return}if(s===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:l,top:c,bottom:u}=Wg(e);s==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?s=c:(n._bottom||0)===i?s=u:(o[ru(u,r,a,l)]=!0,s=c)),o[ru(s,r,a,l)]=!0,e.borderSkipped=o}function ru(e,t,n,i){return i?(e=Yg(e,t,n),e=au(e,n,t)):e=au(e,t,n),e}function Yg(e,t,n){return e===t?n:e===n?t:e}function au(e,t,n){return e==="start"?t:e==="end"?n:e}function jg(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class lu extends wn{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,n,i,s){return ou(t,n,i,s)}parseArrayData(t,n,i,s){return ou(t,n,i,s)}parseObjectData(t,n,i,s){const{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,u=r.axis==="x"?a:l,h=[];let f,m,p,y;for(f=i,m=i+s;f<m;++f)y=n[f],p={},p[o.axis]=o.parse(mn(y,c),f),h.push(su(mn(y,u),p,r,f));return h}updateRangeFromParsed(t,n,i,s){super.updateRangeFromParsed(t,n,i,s);const o=i._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:i,vScale:s}=n,o=this.getParsed(t),r=o._custom,a=Kr(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,i,s){const o=s==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(n,s);for(let m=n;m<n+i;m++){const p=this.getParsed(m),y=o||rt(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(m),b=this._calculateBarIndexPixels(m,u),S=(p._stacks||{})[a.axis],M={horizontal:c,base:y.base,enableBorderRadius:!S||Kr(p._custom)||r===S._top||r===S._bottom,x:c?y.head:b.center,y:c?b.center:y.head,height:c?b.size:Math.abs(y.size),width:c?Math.abs(y.size):b.size};f&&(M.options=h||this.resolveDataElementOptions(m,t[m].active?"active":s));const E=M.options||t[m].options;$g(M,E,S,r),jg(M,E,u.ratio),this.updateElement(t[m],m,M,s)}}_getStacks(t,n){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=i.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[i.axis],c=u=>{const h=u._parsed.find(m=>m[i.axis]===l),f=h&&h[u.vScale.axis];if(rt(f)||isNaN(f))return!0};for(const u of s)if(!(n!==void 0&&c(u))&&((o===!1||r.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&r.push(u.stack),u.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[at(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,i){const s=this._getStacks(t,i),o=n!==void 0?s.indexOf(n):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,s=[];let o,r;for(o=0,r=n.data.length;o<r;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const a=t.barThickness;return{min:a||Bg(n),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:i,index:s},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),c=l._custom,u=Kr(c);let h=l[n.axis],f=0,m=i?this.applyStack(n,l,i):h,p,y;m!==h&&(f=m-h,m=h),u&&(h=c.barStart,m=c.barEnd-c.barStart,h!==0&&ze(h)!==ze(c.barEnd)&&(f=0),f+=h);const b=!rt(o)&&!u?o:f;let S=n.getPixelForValue(b);if(this.chart.getDataVisibility(t)?p=n.getPixelForValue(f+m):p=S,y=p-S,Math.abs(y)<r){y=Vg(y,n,a)*r,h===a&&(S-=y/2);const M=n.getPixelForDecimal(0),E=n.getPixelForDecimal(1),D=Math.min(M,E),C=Math.max(M,E);S=Math.max(Math.min(S,C),D),p=S+y,i&&!u&&(l._stacks[n.axis]._visualValues[s]=n.getValueForPixel(p)-n.getValueForPixel(S))}if(S===n.getPixelForValue(a)){const M=ze(y)*n.getLineWidthForValue(a)/2;S+=M,y-=M}return{size:y,base:S,head:p,center:p+y/2}}_calculateBarIndexPixels(t,n){const i=n.scale,s=this.options,o=s.skipNull,r=at(s.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(n.grouped){const u=o?this._getStackCount(t):n.stackCount,h=s.barThickness==="flex"?Ug(t,n,s,u*c):zg(t,n,s,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(at(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+m;a=h.start+h.chunk*p+h.chunk/2,l=Math.min(r,h.chunk*h.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(r,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,i=t.data,s=i.length;let o=0;for(;o<s;++o)this.getParsed(o)[n.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}class qg extends wn{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,i,s){const o=super.parsePrimitiveData(t,n,i,s);for(let r=0;r<o.length;r++)o[r]._custom=this.resolveDataElementOptions(r+i).radius;return o}parseArrayData(t,n,i,s){const o=super.parseArrayData(t,n,i,s);for(let r=0;r<o.length;r++){const a=n[i+r];o[r]._custom=at(a[2],this.resolveDataElementOptions(r+i).radius)}return o}parseObjectData(t,n,i,s){const o=super.parseObjectData(t,n,i,s);for(let r=0;r<o.length;r++){const a=n[i+r];o[r]._custom=at(a&&a.r&&+a.r,this.resolveDataElementOptions(r+i).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let i=t.length-1;i>=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=n,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y),c=r._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,s){const o=s==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),u=r.axis,h=a.axis;for(let f=n;f<n+i;f++){const m=t[f],p=!o&&this.getParsed(f),y={},b=y[u]=o?r.getPixelForDecimal(.5):r.getPixelForValue(p[u]),S=y[h]=o?a.getBasePixel():a.getPixelForValue(p[h]);y.skip=isNaN(b)||isNaN(S),c&&(y.options=l||this.resolveDataElementOptions(f,m.active?"active":s),o&&(y.options.radius=0)),this.updateElement(m,f,y,s)}}resolveDataElementOptions(t,n){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,n);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return n!=="active"&&(s.radius=0),s.radius+=at(i&&i._custom,o),s}}function Gg(e,t,n){let i=1,s=1,o=0,r=0;if(t<Dt){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),h=Math.cos(l),f=Math.sin(l),m=(E,D,C)=>Xi(E,a,l,!0)?1:Math.max(D,D*n,C,C*n),p=(E,D,C)=>Xi(E,a,l,!0)?-1:Math.min(D,D*n,C,C*n),y=m(0,c,h),b=m(Ot,u,f),S=p(dt,c,h),M=p(dt+Ot,u,f);i=(y-S)/2,s=(b-M)/2,o=-(y+S)/2,r=-(b+M)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:r}}class ss extends wn{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:i,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((l,c)=>{const h=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:h.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:h.borderWidth,strokeStyle:h.borderColor,textAlign:s,pointStyle:i,borderRadius:r&&(a||h.borderRadius),index:c}}):[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}};constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=l=>+i[l];if(ft(i[t])){const{key:l="value"}=this._parsing;o=c=>+mn(i[c],l)}let r,a;for(r=t,a=t+n;r<a;++r)s._parsed[r]=o(r)}}_getRotation(){return Vt(this.options.rotation-90)}_getCircumference(){return Vt(this.options.circumference)}_getRotationExtents(){let t=Dt,n=-Dt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,o=s._getRotation(),r=s._getCircumference();t=Math.min(t,o),n=Math.max(n,o+r)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:i}=n,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-r)/2,0),l=Math.min(rp(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:p,offsetY:y}=Gg(h,u,l),b=(i.width-r)/f,S=(i.height-r)/m,M=Math.max(Math.min(b,S)/2,0),E=dc(this.options.radius,M),D=Math.max(E*l,0),C=(E-D)/this._getVisibleDatasetWeightTotal();this.offsetX=p*E,this.offsetY=y*E,s.total=this.calculateTotal(),this.outerRadius=E-C*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-C*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/Dt)}updateElements(t,n,i,s){const o=s==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,u=(a.left+a.right)/2,h=(a.top+a.bottom)/2,f=o&&c.animateScale,m=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:y,includeOptions:b}=this._getSharedOptions(n,s);let S=this._getRotation(),M;for(M=0;M<n;++M)S+=this._circumference(M,o);for(M=n;M<n+i;++M){const E=this._circumference(M,o),D=t[M],C={x:u+this.offsetX,y:h+this.offsetY,startAngle:S,endAngle:S+E,circumference:E,outerRadius:p,innerRadius:m};b&&(C.options=y||this.resolveDataElementOptions(M,D.active?"active":s)),S+=E,this.updateElement(D,M,C,s)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let i=0,s;for(s=0;s<n.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Dt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Qi(n._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,o,r,a,l;if(!t){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){r=i.getDatasetMeta(s),t=r.data,a=r.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let i=0,s=t.length;i<s;++i){const o=this.resolveDataElementOptions(i);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(t){return Math.max(at(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class cu extends wn{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=n,r=this.chart._animationsDisabled;let{start:a,count:l}=vc(n,s,r);this._drawStart=a,this._drawCount=l,Tc(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(n,s),f=r.axis,m=a.axis,{spanGaps:p,segment:y}=this.options,b=gn(p)?p:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||o||s==="none",M=n+i,E=t.length;let D=n>0&&this.getParsed(n-1);for(let C=0;C<E;++C){const A=t[C],O=S?A:{};if(C<n||C>=M){O.skip=!0;continue}const x=this.getParsed(C),_=rt(x[m]),v=O[f]=r.getPixelForValue(x[f],C),k=O[m]=o||_?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,x,l):x[m],C);O.skip=isNaN(v)||isNaN(k)||_,O.stop=C>0&&Math.abs(x[f]-D[f])>b,y&&(O.parsed=x,O.raw=c.data[C]),h&&(O.options=u||this.resolveDataElementOptions(C,A.active?"active":s)),S||this.updateElement(A,C,O,s),D=x}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class uu extends wn{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Qi(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,n,i,s){return Bc.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(s/2,0),r=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,i,s){const o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,h=c.yCenter,f=c.getIndexAngle(0)-.5*dt;let m=f,p;const y=360/this.countVisibleElements();for(p=0;p<n;++p)m+=this._computeAngle(p,s,y);for(p=n;p<n+i;p++){const b=t[p];let S=m,M=m+this._computeAngle(p,s,y),E=r.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=M,o&&(l.animateScale&&(E=0),l.animateRotate&&(S=M=f));const D={x:u,y:h,innerRadius:0,outerRadius:E,startAngle:S,endAngle:M,options:this.resolveDataElementOptions(p,b.active?"active":s)};this.updateElement(b,p,D,s)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?Vt(this.resolveDataElementOptions(t,n).angle||i):0}}class Kg extends ss{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class Xg extends wn{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,s){return Bc.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta,i=n.dataset,s=n.data||[],o=n.iScale.getLabels();if(i.points=s,t!=="resize"){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===s.length,options:r};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,i,s){const o=this._cachedMeta.rScale,r=s==="reset";for(let a=n;a<n+i;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),u=o.getPointPositionForValue(a,this.getParsed(a).r),h=r?o.xCenter:u.x,f=r?o.yCenter:u.y,m={x:h,y:f,angle:u.angle,skip:isNaN(h)||isNaN(f),options:c};this.updateElement(l,a,m,s)}}}class Zg extends wn{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=n,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y);return{label:i[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:i=[]}=n,s=this.chart._animationsDisabled;let{start:o,count:r}=vc(n,i,s);if(this._drawStart=o,this._drawCount=r,Tc(n)&&(o=0,r=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(i,o,r,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,i,s){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,s),h=this.getSharedOptions(u),f=this.includeOptions(s,h),m=r.axis,p=a.axis,{spanGaps:y,segment:b}=this.options,S=gn(y)?y:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||o||s==="none";let E=n>0&&this.getParsed(n-1);for(let D=n;D<n+i;++D){const C=t[D],A=this.getParsed(D),O=M?C:{},x=rt(A[p]),_=O[m]=r.getPixelForValue(A[m],D),v=O[p]=o||x?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,A,l):A[p],D);O.skip=isNaN(_)||isNaN(v)||x,O.stop=D>0&&Math.abs(A[m]-E[m])>S,b&&(O.parsed=A,O.raw=c.data[D]),f&&(O.options=h||this.resolveDataElementOptions(D,C.active?"active":s)),M||this.updateElement(C,D,O,s),E=A}this.updateSharedOptions(h,s,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,r)/2}}var Qg=Object.freeze({__proto__:null,BarController:lu,BubbleController:qg,DoughnutController:ss,LineController:cu,PieController:Kg,PolarAreaController:uu,RadarController:Xg,ScatterController:Zg});function Hn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Xr{static override(t){Object.assign(Xr.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Hn()}parse(){return Hn()}format(){return Hn()}add(){return Hn()}diff(){return Hn()}startOf(){return Hn()}endOf(){return Hn()}}var du={_date:Xr};function Jg(e,t,n,i){const{controller:s,data:o,_sorted:r}=e,a=s._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?bp:Ze;if(i){if(s._sharedOptions){const u=o[0],h=typeof u.getRange=="function"&&u.getRange(t);if(h){const f=c(o,t,n-h),m=c(o,t,n+h);return{lo:f.lo,hi:m.hi}}}}else{const u=c(o,t,n);if(l){const{vScale:h}=s._cachedMeta,{_parsed:f}=e,m=f.slice(0,u.lo+1).reverse().findIndex(y=>!rt(y[h.axis]));u.lo-=Math.max(0,m);const p=f.slice(u.hi).findIndex(y=>!rt(y[h.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:o.length-1}}function os(e,t,n,i,s){const o=e.getSortedVisibleDatasetMetas(),r=n[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:u}=o[a],{lo:h,hi:f}=Jg(o[a],t,r,s);for(let m=h;m<=f;++m){const p=u[m];p.skip||i(p,c,m)}}}function ty(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,s){const o=t?Math.abs(i.x-s.x):0,r=n?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Zr(e,t,n,i,s){const o=[];return!s&&!e.isPointInArea(t)||os(e,n,t,function(a,l,c){!s&&!Qe(a,e.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function ey(e,t,n,i){let s=[];function o(r,a,l){const{startAngle:c,endAngle:u}=r.getProps(["startAngle","endAngle"],i),{angle:h}=oo(r,{x:t.x,y:t.y});Xi(h,c,u)&&s.push({element:r,datasetIndex:a,index:l})}return os(e,n,t,o),s}function ny(e,t,n,i,s,o){let r=[];const a=ty(n);let l=Number.POSITIVE_INFINITY;function c(u,h,f){const m=u.inRange(t.x,t.y,s);if(i&&!m)return;const p=u.getCenterPoint(s);if(!(!!o||e.isPointInArea(p))&&!m)return;const b=a(t,p);b<l?(r=[{element:u,datasetIndex:h,index:f}],l=b):b===l&&r.push({element:u,datasetIndex:h,index:f})}return os(e,n,t,c),r}function Qr(e,t,n,i,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!i?ey(e,t,n,s):ny(e,t,n,i,s,o)}function hu(e,t,n,i,s){const o=[],r=n==="x"?"inXRange":"inYRange";let a=!1;return os(e,n,t,(l,c,u)=>{l[r]&&l[r](t[n],s)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:o}var Jr={evaluateInteractionItems:os,modes:{index(e,t,n,i){const s=_n(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?Zr(e,s,o,i,r):Qr(e,s,o,!1,i,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,h=c.data[u];h&&!h.skip&&l.push({element:h,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){const s=_n(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;let a=n.intersect?Zr(e,s,o,i,r):Qr(e,s,o,!1,i,r);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,i){const s=_n(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return Zr(e,s,o,i,r)},nearest(e,t,n,i){const s=_n(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return Qr(e,s,o,n.intersect,i,r)},x(e,t,n,i){const s=_n(t,e);return hu(e,s,"x",n.intersect,i)},y(e,t,n,i){const s=_n(t,e);return hu(e,s,"y",n.intersect,i)}}};const fu=["left","top","right","bottom"];function rs(e,t){return e.filter(n=>n.pos===t)}function mu(e,t){return e.filter(n=>fu.indexOf(n.pos)===-1&&n.box.axis===t)}function as(e,t){return e.sort((n,i)=>{const s=t?i:n,o=t?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function iy(e){const t=[];let n,i,s,o,r,a;for(n=0,i=(e||[]).length;n<i;++n)s=e[n],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function sy(e){const t={};for(const n of e){const{stack:i,pos:s,stackWeight:o}=n;if(!i||!fu.includes(s))continue;const r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function oy(e,t){const n=sy(e),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let o,r,a;for(o=0,r=e.length;o<r;++o){a=e[o];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return n}function ry(e){const t=iy(e),n=as(t.filter(c=>c.box.fullSize),!0),i=as(rs(t,"left"),!0),s=as(rs(t,"right")),o=as(rs(t,"top"),!0),r=as(rs(t,"bottom")),a=mu(t,"x"),l=mu(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:rs(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function pu(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function gu(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function ay(e,t,n,i){const{pos:s,box:o}=n,r=e.maxPadding;if(!ft(s)){n.size&&(e[s]-=n.size);const h=i[n.stack]||{size:0,count:1};h.size=Math.max(h.size,n.horizontal?o.height:o.width),n.size=h.size/h.count,e[s]+=n.size}o.getPadding&&gu(r,o.getPadding());const a=Math.max(0,t.outerWidth-pu(r,e,"left","right")),l=Math.max(0,t.outerHeight-pu(r,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function ly(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function cy(e,t){const n=t.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],n[r])}),o}return i(e?["left","right"]:["top","bottom"])}function ls(e,t,n,i){const s=[];let o,r,a,l,c,u;for(o=0,r=e.length,c=0;o<r;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,cy(a.horizontal,t));const{same:h,other:f}=ay(t,n,a,i);c|=h&&s.length,u=u||f,l.fullSize||s.push(a)}return c&&ls(s,t,n,i)||u}function mo(e,t,n,i,s){e.top=n,e.left=t,e.right=t+i,e.bottom=n+s,e.width=i,e.height=s}function yu(e,t,n,i){const s=n.padding;let{x:o,y:r}=t;for(const a of e){const l=a.box,c=i[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const h=t.w*u,f=c.size||l.height;fe(c.start)&&(r=c.start),l.fullSize?mo(l,s.left,r,n.outerWidth-s.right-s.left,f):mo(l,t.left+c.placed,r,h,f),c.start=r,c.placed+=h,r=l.bottom}else{const h=t.h*u,f=c.size||l.width;fe(c.start)&&(o=c.start),l.fullSize?mo(l,o,s.top,f,n.outerHeight-s.bottom-s.top):mo(l,o,t.top+c.placed,f,h),c.start=o,c.placed+=h,o=l.right}}t.x=o,t.y=r}var se={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;const s=Wt(e.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(n-s.height,0),a=ry(e.boxes),l=a.vertical,c=a.horizontal;St(e.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,b)=>b.box.options&&b.box.options.display===!1?y:y+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/u,hBoxMaxHeight:r/2}),f=Object.assign({},s);gu(f,Wt(i));const m=Object.assign({maxPadding:f,w:o,h:r,x:s.left,y:s.top},s),p=oy(l.concat(c),h);ls(a.fullSize,m,h,p),ls(l,m,h,p),ls(c,m,h,p)&&ls(l,m,h,p),ly(m),yu(a.leftAndTop,m,h,p),m.x+=m.w,m.y+=m.h,yu(a.rightAndBottom,m,h,p),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},St(a.chartArea,y=>{const b=y.box;Object.assign(b,e.chartArea),b.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class bu{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}}class uy extends bu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const po="$chartjs",dy={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},_u=e=>e===null||e==="";function hy(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[po]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",_u(s)){const o=Hc(e,"width");o!==void 0&&(e.width=o)}if(_u(i))if(e.style.height==="")e.height=e.width/(t||2);else{const o=Hc(e,"height");o!==void 0&&(e.height=o)}return e}const xu=dg?{passive:!0}:!1;function fy(e,t,n){e&&e.addEventListener(t,n,xu)}function my(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,xu)}function py(e,t){const n=dy[e.type]||e.type,{x:i,y:s}=_n(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function go(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function gy(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||go(a.addedNodes,i),r=r&&!go(a.removedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function yy(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||go(a.removedNodes,i),r=r&&!go(a.addedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const cs=new Map;let wu=0;function Su(){const e=window.devicePixelRatio;e!==wu&&(wu=e,cs.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function by(e,t){cs.size||window.addEventListener("resize",Su),cs.set(e,t)}function _y(e){cs.delete(e),cs.size||window.removeEventListener("resize",Su)}function xy(e,t,n){const i=e.canvas,s=i&&$r(i);if(!s)return;const o=Sc((a,l)=>{const c=s.clientWidth;n(a,l),c<s.clientWidth&&n()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return r.observe(s),by(e,o),r}function ta(e,t,n){n&&n.disconnect(),t==="resize"&&_y(e)}function wy(e,t,n){const i=e.canvas,s=Sc(o=>{e.ctx!==null&&n(py(o,e))},e);return fy(i,t,s),s}class Sy extends bu{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(hy(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[po])return!1;const i=n[po].initial;["height","width"].forEach(o=>{const r=i[o];rt(r)?n.removeAttribute(o):n.setAttribute(o,r)});const s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[po],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),r={attach:gy,detach:yy,resize:xy}[n]||wy;s[n]=r(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:ta,detach:ta,resize:ta}[n]||my)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return ug(t,n,i,s)}isAttached(t){const n=t&&$r(t);return!!(n&&n.isConnected)}}function vy(e){return!Wr()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?uy:Sy}class oe{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return gn(this.x)&&gn(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}}function Ty(e,t){const n=e.options.ticks,i=My(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?Dy(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return Cy(t,c,o,r/s),c;const u=ky(o,t,s);if(r>0){let h,f;const m=r>1?Math.round((l-a)/(r-1)):null;for(yo(t,c,u,rt(m)?0:a-m,a),h=0,f=r-1;h<f;h++)yo(t,c,u,o[h],o[h+1]);return yo(t,c,u,l,rt(m)?t.length:l+m),c}return yo(t,c,u),c}function My(e){const t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(i,s))}function ky(e,t,n){const i=Oy(e),s=t.length/n;if(!i)return Math.max(s,1);const o=fp(i);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>s)return l}return Math.max(s,1)}function Dy(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function Cy(e,t,n,i){let s=0,o=n[0],r;for(i=Math.ceil(i),r=0;r<e.length;r++)r===o&&(t.push(e[r]),s++,o=n[s*i])}function yo(e,t,n,i,s){const o=at(i,0),r=Math.min(at(s,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),s&&(l=s-i,n=l/Math.floor(l/n)),u=o;u<0;)a++,u=Math.round(o+a*n);for(c=Math.max(o,0);c<r;c++)c===u&&(t.push(e[c]),a++,u=Math.round(o+a*n))}function Oy(e){const t=e.length;let n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}const Ey=e=>e==="left"?"right":e==="right"?"left":e,vu=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Tu=(e,t)=>Math.min(t||e,e);function Mu(e,t){const n=[],i=e.length/t,s=e.length;let o=0;for(;o<s;o+=i)n.push(e[Math.floor(o)]);return n}function Ay(e,t,n){const i=e.ticks.length,s=Math.min(t,i-1),o=e._startPixel,r=e._endPixel,a=1e-6;let l=e.getPixelForTick(s),c;if(!(n&&(i===1?c=Math.max(l-o,r-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function Py(e,t){St(e,n=>{const i=n.gc,s=i.length/2;let o;if(s>t){for(o=0;o<s;++o)delete n.data[i[o]];i.splice(0,s)}})}function us(e){return e.drawTicks?e.tickLength:0}function ku(e,t){if(!e.display)return 0;const n=Pt(e.font,t),i=Wt(e.padding);return(xt(e.text)?e.text.length:1)*n.lineHeight+i.height}function Ry(e,t){return bn(e,{scale:t,type:"scale"})}function Iy(e,t,n){return bn(e,{tick:n,index:t,type:"tick"})}function Ly(e,t,n){let i=Pr(e);return(n&&t!=="right"||!n&&t==="right")&&(i=Ey(i)),i}function Ny(e,t,n,i){const{top:s,left:o,bottom:r,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let h=0,f,m,p;const y=r-s,b=a-o;if(e.isHorizontal()){if(m=ie(i,o,a),ft(n)){const S=Object.keys(n)[0],M=n[S];p=u[S].getPixelForValue(M)+y-t}else n==="center"?p=(c.bottom+c.top)/2+y-t:p=vu(e,n,t);f=a-o}else{if(ft(n)){const S=Object.keys(n)[0],M=n[S];m=u[S].getPixelForValue(M)-b+t}else n==="center"?m=(c.left+c.right)/2-b+t:m=vu(e,n,t);p=ie(i,r,s),h=n==="left"?-Ot:Ot}return{titleX:m,titleY:p,maxWidth:f,rotation:h}}class Vn extends oe{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:i,_suggestedMax:s}=this;return t=Te(t,Number.POSITIVE_INFINITY),n=Te(n,Number.NEGATIVE_INFINITY),i=Te(i,Number.POSITIVE_INFINITY),s=Te(s,Number.NEGATIVE_INFINITY),{min:Te(t,i),max:Te(n,s),minDefined:At(t),maxDefined:At(n)}}getMinMax(t){let{min:n,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:n,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(n=Math.min(n,r.min)),o||(i=Math.max(i,r.max));return n=o&&n>i?i:n,i=s&&n>i?n:i,{min:Te(n,Te(i,n)),max:Te(i,Te(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){wt(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Vp(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Mu(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Ty(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,t=!t),this._startPixel=n,this._endPixel=i,this._reversePixels=t,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){wt(this.options.afterUpdate,[this])}beforeSetDimensions(){wt(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(){wt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),wt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){wt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=wt(n.callback,[o.value,i,t],this)}afterTickToLabelConversion(){wt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){wt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,i=Tu(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let r=s,a,l,c;if(!this._isVisible()||!n.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),h=u.widest.width,f=u.highest.height,m=Kt(this.chart.width-h,0,this.maxWidth);a=t.offset?this.maxWidth/i:m/(i-1),h+6>a&&(a=m/(i-(t.offset?.5:1)),l=this.maxHeight-us(t.grid)-n.padding-ku(t.title,this.chart.options.font),c=Math.sqrt(h*h+f*f),r=so(Math.min(Math.asin(Kt((u.highest.height+6)/a,-1,1)),Math.asin(Kt(l/c,-1,1))-Math.asin(Kt(f/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){wt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){wt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=ku(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=us(o)+l):(t.height=this.maxHeight,t.width=us(o)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:h,highest:f}=this._getLabelSizes(),m=i.padding*2,p=Vt(this.labelRotation),y=Math.cos(p),b=Math.sin(p);if(a){const S=i.mirror?0:b*h.width+y*f.height;t.height=Math.min(this.maxHeight,t.height+S+m)}else{const S=i.mirror?0:y*h.width+b*f.height;t.width=Math.min(this.maxWidth,t.width+S+m)}this._calculatePadding(c,u,b,y)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,m=0;l?c?(f=s*t.width,m=i*n.height):(f=i*t.height,m=s*n.width):o==="start"?m=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,m=n.width/2),this.paddingLeft=Math.max((f-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-h+r)*this.width/(this.width-h),0)}else{let u=n.height/2,h=t.height/2;o==="start"?(u=0,h=t.height):o==="end"&&(u=n.height,h=0),this.paddingTop=u+r,this.paddingBottom=h+r}}_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(){wt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n<i;n++)rt(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=Mu(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){const{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(n/Tu(n,i));let c=0,u=0,h,f,m,p,y,b,S,M,E,D,C;for(h=0;h<n;h+=l){if(p=t[h].label,y=this._resolveTickFontOptions(h),s.font=b=y.string,S=o[b]=o[b]||{data:{},gc:[]},M=y.lineHeight,E=D=0,!rt(p)&&!xt(p))E=lo(s,S.data,S.gc,E,p),D=M;else if(xt(p))for(f=0,m=p.length;f<m;++f)C=p[f],!rt(C)&&!xt(C)&&(E=lo(s,S.data,S.gc,E,C),D+=M);r.push(E),a.push(D),c=Math.max(E,c),u=Math.max(D,u)}Py(o,n);const A=r.indexOf(c),O=a.indexOf(u),x=_=>({width:r[_]||0,height:a[_]||0});return{first:x(0),last:x(n-1),widest:x(A),highest:x(O),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return yp(this._alignToPixels?Fn(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const i=n[t];return i.$context||(i.$context=Iy(this.getContext(),t,i))}return this.$context||(this.$context=Ry(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Vt(this.labelRotation),i=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),f=us(o),m=[],p=a.setContext(this.getContext()),y=p.display?p.width:0,b=y/2,S=function(H){return Fn(i,H,y)};let M,E,D,C,A,O,x,_,v,k,I,Y;if(r==="top")M=S(this.bottom),O=this.bottom-f,_=M-b,k=S(t.top)+b,Y=t.bottom;else if(r==="bottom")M=S(this.top),k=t.top,Y=S(t.bottom)-b,O=M+b,_=this.top+f;else if(r==="left")M=S(this.right),A=this.right-f,x=M-b,v=S(t.left)+b,I=t.right;else if(r==="right")M=S(this.left),v=t.left,I=S(t.right)-b,A=M+b,x=this.left+f;else if(n==="x"){if(r==="center")M=S((t.top+t.bottom)/2+.5);else if(ft(r)){const H=Object.keys(r)[0],$=r[H];M=S(this.chart.scales[H].getPixelForValue($))}k=t.top,Y=t.bottom,O=M+b,_=O+f}else if(n==="y"){if(r==="center")M=S((t.left+t.right)/2);else if(ft(r)){const H=Object.keys(r)[0],$=r[H];M=S(this.chart.scales[H].getPixelForValue($))}A=M-b,x=A-f,v=t.left,I=t.right}const U=at(s.ticks.maxTicksLimit,h),j=Math.max(1,Math.ceil(h/U));for(E=0;E<h;E+=j){const H=this.getContext(E),$=o.setContext(H),R=a.setContext(H),B=$.lineWidth,z=$.color,P=R.dash||[],N=R.dashOffset,V=$.tickWidth,Q=$.tickColor,X=$.tickBorderDash||[],q=$.tickBorderDashOffset;D=Ay(this,E,l),D!==void 0&&(C=Fn(i,D,B),c?A=x=v=I=C:O=_=k=Y=C,m.push({tx1:A,ty1:O,tx2:x,ty2:_,x1:v,y1:k,x2:I,y2:Y,width:B,color:z,borderDash:P,borderDashOffset:N,tickWidth:V,tickColor:Q,tickBorderDash:X,tickBorderDashOffset:q}))}return this._ticksLength=h,this._borderValue=M,m}_computeLabelItems(t){const n=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:h}=o,f=us(i.grid),m=f+u,p=h?-u:m,y=-Vt(this.labelRotation),b=[];let S,M,E,D,C,A,O,x,_,v,k,I,Y="middle";if(s==="top")A=this.bottom-p,O=this._getXAxisLabelAlignment();else if(s==="bottom")A=this.top+p,O=this._getXAxisLabelAlignment();else if(s==="left"){const j=this._getYAxisLabelAlignment(f);O=j.textAlign,C=j.x}else if(s==="right"){const j=this._getYAxisLabelAlignment(f);O=j.textAlign,C=j.x}else if(n==="x"){if(s==="center")A=(t.top+t.bottom)/2+m;else if(ft(s)){const j=Object.keys(s)[0],H=s[j];A=this.chart.scales[j].getPixelForValue(H)+m}O=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")C=(t.left+t.right)/2-m;else if(ft(s)){const j=Object.keys(s)[0],H=s[j];C=this.chart.scales[j].getPixelForValue(H)}O=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?Y="top":l==="end"&&(Y="bottom"));const U=this._getLabelSizes();for(S=0,M=a.length;S<M;++S){E=a[S],D=E.label;const j=o.setContext(this.getContext(S));x=this.getPixelForTick(S)+o.labelOffset,_=this._resolveTickFontOptions(S),v=_.lineHeight,k=xt(D)?D.length:1;const H=k/2,$=j.color,R=j.textStrokeColor,B=j.textStrokeWidth;let z=O;r?(C=x,O==="inner"&&(S===M-1?z=this.options.reverse?"left":"right":S===0?z=this.options.reverse?"right":"left":z="center"),s==="top"?c==="near"||y!==0?I=-k*v+v/2:c==="center"?I=-U.highest.height/2-H*v+v:I=-U.highest.height+v/2:c==="near"||y!==0?I=v/2:c==="center"?I=U.highest.height/2-H*v:I=U.highest.height-k*v,h&&(I*=-1),y!==0&&!j.showLabelBackdrop&&(C+=v/2*Math.sin(y))):(A=x,I=(1-k)*v/2);let P;if(j.showLabelBackdrop){const N=Wt(j.backdropPadding),V=U.heights[S],Q=U.widths[S];let X=I-N.top,q=0-N.left;switch(Y){case"middle":X-=V/2;break;case"bottom":X-=V;break}switch(O){case"center":q-=Q/2;break;case"right":q-=Q;break;case"inner":S===M-1?q-=Q:S>0&&(q-=Q/2);break}P={left:q,top:X,width:Q+N.width,height:V+N.height,color:j.backdropColor}}b.push({label:D,font:_,textOffset:I,options:{rotation:y,color:$,strokeColor:R,strokeWidth:B,textAlign:z,textBaseline:Y,translation:[C,A],backdrop:P}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Vt(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,u;return n==="left"?s?(u=this.right+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:i,top:s,width:o,height:r}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,o,r),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(o=0,r=s.length;o<r;++o){const l=s[o];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,h,f;this.isHorizontal()?(c=Fn(t,this.left,r)-r/2,u=Fn(t,this.right,a)+a/2,h=f=l):(h=Fn(t,this.top,r)-r/2,f=Fn(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,h),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&ts(i,s);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,u=r.textOffset;Bn(i,c,0,u,l,a)}s&&es(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;const o=Pt(i.font),r=Wt(i.padding),a=i.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||ft(n)?(l+=r.bottom,xt(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;const{titleX:c,titleY:u,maxWidth:h,rotation:f}=Ny(this,l,n,a);Bn(t,i.text,0,0,o,{color:i.color,maxWidth:h,rotation:f,textAlign:Ly(a,n,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,i=at(t.grid&&t.grid.z,-1),s=at(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Vn.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,r;for(o=0,r=n.length;o<r;++o){const a=n[o];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return Pt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class bo{constructor(t,n,i){this.type=t,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let i;zy(n)&&(i=this.register(n));const s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,Fy(t,r,i),this.override&&Et.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const n=this.items,i=t.id,s=this.scope;i in n&&delete n[i],s&&i in Et[s]&&(delete Et[s][i],this.override&&delete Nn[i])}}function Fy(e,t,n){const i=qi(Object.create(null),[n?Et.get(n):{},Et.get(t),e.defaults]);Et.set(t,i),e.defaultRoutes&&By(t,e.defaultRoutes),e.descriptors&&Et.describe(t,e.descriptors)}function By(e,t){Object.keys(t).forEach(n=>{const i=n.split("."),s=i.pop(),o=[e].concat(i).join("."),r=t[n].split("."),a=r.pop(),l=r.join(".");Et.route(o,s,l,a)})}function zy(e){return"id"in e&&"defaults"in e}class Uy{constructor(){this.controllers=new bo(wn,"datasets",!0),this.elements=new bo(oe,"elements"),this.plugins=new bo(Object,"plugins"),this.scales=new bo(Vn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,i){[...n].forEach(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):St(s,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,n,i){const s=Or(t);wt(i["before"+s],[],i),n[t](i),wt(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){const s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Ue=new Uy;class Hy{constructor(){this._init=void 0}notify(t,n,i,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,n,i);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,n,i,s){s=s||{};for(const o of t){const r=o.plugin,a=r[i],l=[n,s,o.options];if(wt(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){rt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const i=t&&t.config,s=at(i.options&&i.options.plugins,{}),o=Vy(i);return s===!1&&!n?[]:$y(t,o,s,n)}_notifyStateChanges(t){const n=this._oldCache||[],i=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}}function Vy(e){const t={},n=[],i=Object.keys(Ue.plugins.items);for(let o=0;o<i.length;o++)n.push(Ue.getPlugin(i[o]));const s=e.plugins||[];for(let o=0;o<s.length;o++){const r=s[o];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function Wy(e,t){return!t&&e===!1?null:e===!0?{}:e}function $y(e,{plugins:t,localIds:n},i,s){const o=[],r=e.getContext();for(const a of t){const l=a.id,c=Wy(i[l],s);c!==null&&o.push({plugin:a,options:Yy(e.config,{plugin:a,local:n[l]},c,r)})}return o}function Yy(e,{plugin:t,local:n},i,s){const o=e.pluginScopeKeys(t),r=e.getOptionScopes(i,o);return n&&t.defaults&&r.push(t.defaults),e.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ea(e,t){const n=Et.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function jy(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function qy(e,t){return e===t?"_index_":"_value_"}function Du(e){if(e==="x"||e==="y"||e==="r")return e}function Gy(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function na(e,...t){if(Du(e))return e;for(const n of t){const i=n.axis||Gy(n.position)||e.length>1&&Du(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Cu(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Ky(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return Cu(e,"x",n[0])||Cu(e,"y",n[0])}return{}}function Xy(e,t){const n=Nn[e.type]||{scales:{}},i=t.scales||{},s=ea(e.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!ft(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=na(r,a,Ky(r,e),Et.scales[a.type]),c=qy(l,s),u=n.scales||{};o[r]=Gi(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(r=>{const a=r.type||e.type,l=r.indexAxis||ea(a,t),u=(Nn[a]||{}).scales||{};Object.keys(u).forEach(h=>{const f=jy(h,l),m=r[f+"AxisID"]||f;o[m]=o[m]||Object.create(null),Gi(o[m],[{axis:f},i[m],u[h]])})}),Object.keys(o).forEach(r=>{const a=o[r];Gi(a,[Et.scales[a.type],Et.scale])}),o}function Ou(e){const t=e.options||(e.options={});t.plugins=at(t.plugins,{}),t.scales=Xy(e,t)}function Eu(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Zy(e){return e=e||{},e.data=Eu(e.data),Ou(e),e}const Au=new Map,Pu=new Set;function _o(e,t){let n=Au.get(e);return n||(n=t(),Au.set(e,n),Pu.add(n)),n}const ds=(e,t,n)=>{const i=mn(t,n);i!==void 0&&e.add(i)};class Qy{constructor(t){this._config=Zy(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=Eu(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(),Ou(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return _o(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return _o(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return _o(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return _o(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(h=>ds(l,t,h))),u.forEach(h=>ds(l,s,h)),u.forEach(h=>ds(l,Nn[o]||{},h)),u.forEach(h=>ds(l,Et,h)),u.forEach(h=>ds(l,Nr,h))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Pu.has(n)&&r.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Nn[n]||{},Et.datasets[n]||{},{type:n},Et,Nr]}resolveNamedOptions(t,n,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Ru(this._resolverCache,t,s);let l=r;if(tb(r,n)){o.$shared=!1,i=me(i)?i():i;const c=this.createResolver(t,i,a);l=fi(r,i,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,i=[""],s){const{resolver:o}=Ru(this._resolverCache,t,i);return ft(n)?fi(o,n,void 0,s):o}}function Ru(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let o=i.get(s);return o||(o={resolver:Ur(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}const Jy=e=>ft(e)&&Object.getOwnPropertyNames(e).some(t=>me(e[t]));function tb(e,t){const{isScriptable:n,isIndexable:i}=Pc(e);for(const s of t){const o=n(s),r=i(s),a=(r||o)&&e[s];if(o&&(me(a)||Jy(a))||r&&xt(a))return!0}return!1}var eb="4.5.1";const nb=["top","bottom","left","right","chartArea"];function Iu(e,t){return e==="top"||e==="bottom"||nb.indexOf(e)===-1&&t==="x"}function Lu(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function Nu(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),wt(n&&n.onComplete,[e],t)}function ib(e){const t=e.chart,n=t.options.animation;wt(n&&n.onProgress,[e],t)}function Fu(e){return Wr()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const xo={},Bu=e=>{const t=Fu(e);return Object.values(xo).filter(n=>n.canvas===t).pop()};function sb(e,t,n){const i=Object.keys(e);for(const s of i){const o=+s;if(o>=t){const r=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=r)}}}function ob(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}let pe=class{static defaults=Et;static instances=xo;static overrides=Nn;static registry=Ue;static version=eb;static getChart=Bu;static register(...t){Ue.add(...t),zu()}static unregister(...t){Ue.remove(...t),zu()}constructor(t,n){const i=this.config=new Qy(n),s=Fu(t),o=Bu(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||vy(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=op(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=r,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 Hy,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=wp(h=>this.update(h),r.resizeDelay||0),this._dataChanges=[],xo[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Je.listen(this,"complete",Nu),Je.listen(this,"progress",ib),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return rt(t)?n&&o?o:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ue}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Uc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Oc(this.canvas,this.ctx),this}stop(){return Je.stop(this),this}resize(t,n){Je.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,n,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Uc(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),wt(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};St(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];n&&(o=o.concat(Object.keys(n).map(r=>{const a=n[r],l=na(r,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),St(o,r=>{const a=r.options,l=a.id,c=na(l,a),u=at(a.type,r.dtype);(a.position===void 0||Iu(a.position,c)!==Iu(r.dposition))&&(a.position=r.dposition),s[l]=!0;let h=null;if(l in i&&i[l].type===u)h=i[l];else{const f=Ue.getScale(u);h=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(a,t)}),St(s,(r,a)=>{r||delete i[a]}),St(i,r=>{se.configure(this,r,r.options),se.addBox(this,r)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>n){for(let s=n;s<i;++s)this._destroyDatasetMeta(s);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(Lu("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i<s;i++){const o=n[i];let r=this.getDatasetMeta(i);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=a,r.indexAxis=o.indexAxis||ea(a,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const l=Ue.getController(a),{datasetElementType:c,dataElementType:u}=Et.datasets[a];Object.assign(l,{dataElementType:Ue.getElement(u),datasetElementType:c&&Ue.getElement(c)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){St(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:h}=this.getDatasetMeta(c),f=!s&&o.indexOf(h)===-1;h.buildOrUpdateElements(f),r=Math.max(+h.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||St(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Lu("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){St(this.scales,t=>{se.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!mc(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of n){const r=i==="_removeElements"?-o:o;sb(t,s,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=i(0);for(let o=1;o<n;o++)if(!mc(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;se.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],St(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,me(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Je.has(this)?this.attached&&!Je.running(this)&&Je.start(this):(this.draw(),Nu({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,i=[];let s,o;for(s=0,o=n.length;s<o;++s){const r=n[s];(!t||r.visible)&&i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=Xc(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&ts(n,s),t.controller.draw(),s&&es(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Qe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const o=Jr.modes[n];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=bn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);fe(n)?(o.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Je.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Oc(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete xo[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,i=(o,r)=>{n.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};St(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():r()}unbindEvents(){St(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},St(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let o,r,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!to(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const s=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),r=o(n,t),a=i?t:o(t,n);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const o=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:o}=this,r=n,a=this._getActiveElements(t,s,i,r),l=dp(t),c=ob(t,this._lastEvent,i,l);i&&(this._lastEvent=null,wt(o.onHover,[t,a,this],this),l&&wt(o.onClick,[t,a,this],this));const u=!to(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};function zu(){return St(pe.instances,e=>e._plugins.invalidate())}function rb(e,t,n){const{startAngle:i,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,h=Math.min(c/r,ne(i-n));if(e.beginPath(),e.arc(s,o,r-c/2,i+h/2,n-h/2),a>0){const f=Math.min(c/a,ne(i-n));e.arc(s,o,a+c/2,n-f/2,i+f/2,!0)}else{const f=Math.min(c/2,r*ne(i-n));if(u==="round")e.arc(s,o,f,n-dt/2,i+dt/2,!0);else if(u==="bevel"){const m=2*f*f,p=-m*Math.cos(n+dt/2)+s,y=-m*Math.sin(n+dt/2)+o,b=m*Math.cos(i+dt/2)+s,S=m*Math.sin(i+dt/2)+o;e.lineTo(p,y),e.lineTo(b,S)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function ab(e,t,n){const{startAngle:i,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(o,r,a,i-c,n+c),l>s?(c=s/l,e.arc(o,r,l,n+c,i-c,!0)):e.arc(o,r,s,n+Ot,i-Ot),e.closePath(),e.clip()}function lb(e){return zr(e,["outerStart","outerEnd","innerStart","innerEnd"])}function cb(e,t,n,i){const s=lb(e.options.borderRadius),o=(n-t)/2,r=Math.min(o,i*t/2),a=l=>{const c=(n-Math.min(o,l))*i/2;return Kt(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Kt(s.innerStart,0,r),innerEnd:Kt(s.innerEnd,0,r)}}function gi(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function wo(e,t,n,i,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,h=Math.max(t.outerRadius+i+n-c,0),f=u>0?u+i+n+c:0;let m=0;const p=s-l;if(i){const j=u>0?u-i:0,H=h>0?h-i:0,$=(j+H)/2,R=$!==0?p*$/($+i):p;m=(p-R)/2}const y=Math.max(.001,p*h-n/dt)/h,b=(p-y)/2,S=l+b+m,M=s-b-m,{outerStart:E,outerEnd:D,innerStart:C,innerEnd:A}=cb(t,f,h,M-S),O=h-E,x=h-D,_=S+E/O,v=M-D/x,k=f+C,I=f+A,Y=S+C/k,U=M-A/I;if(e.beginPath(),o){const j=(_+v)/2;if(e.arc(r,a,h,_,j),e.arc(r,a,h,j,v),D>0){const B=gi(x,v,r,a);e.arc(B.x,B.y,D,v,M+Ot)}const H=gi(I,M,r,a);if(e.lineTo(H.x,H.y),A>0){const B=gi(I,U,r,a);e.arc(B.x,B.y,A,M+Ot,U+Math.PI)}const $=(M-A/f+(S+C/f))/2;if(e.arc(r,a,f,M-A/f,$,!0),e.arc(r,a,f,$,S+C/f,!0),C>0){const B=gi(k,Y,r,a);e.arc(B.x,B.y,C,Y+Math.PI,S-Ot)}const R=gi(O,S,r,a);if(e.lineTo(R.x,R.y),E>0){const B=gi(O,_,r,a);e.arc(B.x,B.y,E,S-Ot,_)}}else{e.moveTo(r,a);const j=Math.cos(_)*h+r,H=Math.sin(_)*h+a;e.lineTo(j,H);const $=Math.cos(v)*h+r,R=Math.sin(v)*h+a;e.lineTo($,R)}e.closePath()}function ub(e,t,n,i,s){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){wo(e,t,n,i,l,s);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=r+(a%Dt||Dt))}return wo(e,t,n,i,l,s),e.fill(),l}function db(e,t,n,i,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:h,borderDashOffset:f,borderRadius:m}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(h||[]),e.lineDashOffset=f,p?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let y=t.endAngle;if(o){wo(e,t,n,i,y,s);for(let b=0;b<o;++b)e.stroke();isNaN(a)||(y=r+(a%Dt||Dt))}p&&ab(e,t,y),l.selfJoin&&y-r>=dt&&m===0&&u!=="miter"&&rb(e,t,y),o||(wo(e,t,n,i,y,s),e.stroke())}class hb extends oe{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,n,i){const s=this.getProps(["x","y"],i),{angle:o,distance:r}=oo(s,{x:t,y:n}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:u,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),f=(this.options.spacing+this.options.borderWidth)/2,m=at(h,l-a),p=Xi(o,a,l)&&a!==l,y=m>=Dt||p,b=Xe(r,c+f,u+f);return y&&b}getCenterPoint(t){const{x:n,y:i,startAngle:s,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,u=(s+o)/2,h=(r+a+c+l)/2;return{x:n+Math.cos(u)*h,y:i+Math.sin(u)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:i}=this,s=(n.offset||0)/4,o=(n.spacing||0)/2,r=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>Dt?Math.floor(i/Dt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*s,Math.sin(a)*s);const l=1-Math.sin(Math.min(dt,i||0)),c=s*l;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,ub(t,this,c,o,r),db(t,this,c,o,r),t.restore()}}function Uu(e,t,n=t){e.lineCap=at(n.borderCapStyle,t.borderCapStyle),e.setLineDash(at(n.borderDash,t.borderDash)),e.lineDashOffset=at(n.borderDashOffset,t.borderDashOffset),e.lineJoin=at(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=at(n.borderWidth,t.borderWidth),e.strokeStyle=at(n.borderColor,t.borderColor)}function fb(e,t,n){e.lineTo(n.x,n.y)}function mb(e){return e.stepped?Rp:e.tension||e.cubicInterpolationMode==="monotone"?Ip:fb}function Hu(e,t,n={}){const i=e.length,{start:s=0,end:o=i-1}=n,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),u=s<r&&o<r||s>a&&o>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function pb(e,t,n,i){const{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=Hu(s,n,i),u=mb(o);let{move:h=!0,reverse:f}=i||{},m,p,y;for(m=0;m<=c;++m)p=s[(a+(f?c-m:m))%r],!p.skip&&(h?(e.moveTo(p.x,p.y),h=!1):u(e,y,p,f,o.stepped),y=p);return l&&(p=s[(a+(f?c:0))%r],u(e,y,p,f,o.stepped)),!!l}function gb(e,t,n,i){const s=t.points,{count:o,start:r,ilen:a}=Hu(s,n,i),{move:l=!0,reverse:c}=i||{};let u=0,h=0,f,m,p,y,b,S;const M=D=>(r+(c?a-D:D))%o,E=()=>{y!==b&&(e.lineTo(u,b),e.lineTo(u,y),e.lineTo(u,S))};for(l&&(m=s[M(0)],e.moveTo(m.x,m.y)),f=0;f<=a;++f){if(m=s[M(f)],m.skip)continue;const D=m.x,C=m.y,A=D|0;A===p?(C<y?y=C:C>b&&(b=C),u=(h*u+D)/++h):(E(),e.lineTo(D,C),p=A,h=0,y=b=C),S=C}E()}function ia(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?gb:pb}function yb(e){return e.stepped?hg:e.tension||e.cubicInterpolationMode==="monotone"?fg:Un}function bb(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),Uu(e,t.options),e.stroke(s)}function _b(e,t,n,i){const{segments:s,options:o}=t,r=ia(t);for(const a of s)Uu(e,o,a.style),e.beginPath(),r(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const xb=typeof Path2D=="function";function wb(e,t,n,i){xb&&!t.options.segment?bb(e,t,n,i):_b(e,t,n,i)}class So extends oe{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;sg(this._points,i,t,s,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_g(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,s=t[n],o=this.points,r=qc(this,{property:n,start:s,end:s});if(!r.length)return;const a=[],l=yb(i);let c,u;for(c=0,u=r.length;c<u;++c){const{start:h,end:f}=r[c],m=o[h],p=o[f];if(m===p){a.push(m);continue}const y=Math.abs((s-m[n])/(p[n]-m[n])),b=l(m,p,y,i.stepped);b[n]=t[n],a.push(b)}return a.length===1?a[0]:a}pathSegment(t,n,i){return ia(this)(t,this,n,i)}path(t,n,i){const s=this.segments,o=ia(this);let r=this._loop;n=n||0,i=i||this.points.length-n;for(const a of s)r&=o(t,this,a,{start:n,end:n+i-1});return!!r}draw(t,n,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),wb(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Vu(e,t,n,i){const s=e.options,{[n]:o}=e.getProps([n],i);return Math.abs(t-o)<s.radius+s.hitRadius}class Sb extends oe{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,i){const s=this.options,{x:o,y:r}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(n-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,n){return Vu(this,t,"x",n)}inYRange(t,n){return Vu(this,t,"y",n)}getCenterPoint(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const i=n&&t.borderWidth||0;return(n+i)*2}draw(t,n){const i=this.options;this.skip||i.radius<.1||!Qe(this,n,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Br(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Wu(e,t){const{x:n,y:i,base:s,width:o,height:r}=e.getProps(["x","y","base","width","height"],t);let a,l,c,u,h;return e.horizontal?(h=r/2,a=Math.min(n,s),l=Math.max(n,s),c=i-h,u=i+h):(h=o/2,a=n-h,l=n+h,c=Math.min(i,s),u=Math.max(i,s)),{left:a,top:c,right:l,bottom:u}}function Sn(e,t,n,i){return e?0:Kt(t,n,i)}function vb(e,t,n){const i=e.options.borderWidth,s=e.borderSkipped,o=Ac(i);return{t:Sn(s.top,o.top,0,n),r:Sn(s.right,o.right,0,t),b:Sn(s.bottom,o.bottom,0,n),l:Sn(s.left,o.left,0,t)}}function Tb(e,t,n){const{enableBorderRadius:i}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,o=yn(s),r=Math.min(t,n),a=e.borderSkipped,l=i||ft(s);return{topLeft:Sn(!l||a.top||a.left,o.topLeft,0,r),topRight:Sn(!l||a.top||a.right,o.topRight,0,r),bottomLeft:Sn(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:Sn(!l||a.bottom||a.right,o.bottomRight,0,r)}}function Mb(e){const t=Wu(e),n=t.right-t.left,i=t.bottom-t.top,s=vb(e,n/2,i/2),o=Tb(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:n-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function sa(e,t,n,i){const s=t===null,o=n===null,a=e&&!(s&&o)&&Wu(e,i);return a&&(s||Xe(t,a.left,a.right))&&(o||Xe(n,a.top,a.bottom))}function kb(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function Db(e,t){e.rect(t.x,t.y,t.w,t.h)}function oa(e,t,n={}){const i=e.x!==n.x?-t:0,s=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-i,r=(e.y+e.h!==n.y+n.h?t:0)-s;return{x:e.x+i,y:e.y+s,w:e.w+o,h:e.h+r,radius:e.radius}}class Cb extends oe{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:i,backgroundColor:s}}=this,{inner:o,outer:r}=Mb(this),a=kb(r.radius)?hi:Db;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,oa(r,n,o)),t.clip(),a(t,oa(o,-n,r)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,oa(o,n)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,n,i){return sa(this,t,n,i)}inXRange(t,n){return sa(this,t,null,n)}inYRange(t,n){return sa(this,null,t,n)}getCenterPoint(t){const{x:n,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+s)/2:n,y:o?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var Ob=Object.freeze({__proto__:null,ArcElement:hb,BarElement:Cb,LineElement:So,PointElement:Sb});const ra=["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)"],$u=ra.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Yu(e){return ra[e%ra.length]}function ju(e){return $u[e%$u.length]}function Eb(e,t){return e.borderColor=Yu(t),e.backgroundColor=ju(t),++t}function Ab(e,t){return e.backgroundColor=e.data.map(()=>Yu(t++)),t}function Pb(e,t){return e.backgroundColor=e.data.map(()=>ju(t++)),t}function Rb(e){let t=0;return(n,i)=>{const s=e.getDatasetMeta(i).controller;s instanceof ss?t=Ab(n,t):s instanceof uu?t=Pb(n,t):s&&(t=Eb(n,t))}}function qu(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function Ib(e){return e&&(e.borderColor||e.backgroundColor)}function Lb(){return Et.borderColor!=="rgba(0,0,0,0.1)"||Et.backgroundColor!=="rgba(0,0,0,0.1)"}var Nb={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=e.config,{elements:o}=s,r=qu(i)||Ib(s)||o&&qu(o)||Lb();if(!n.forceOverride&&r)return;const a=Rb(e);i.forEach(a)}};function Fb(e,t,n,i,s){const o=s.samples||i;if(o>=n)return e.slice(t,t+n);const r=[],a=(n-2)/(o-2);let l=0;const c=t+n-1;let u=t,h,f,m,p,y;for(r[l++]=e[u],h=0;h<o-2;h++){let b=0,S=0,M;const E=Math.floor((h+1)*a)+1+t,D=Math.min(Math.floor((h+2)*a)+1,n)+t,C=D-E;for(M=E;M<D;M++)b+=e[M].x,S+=e[M].y;b/=C,S/=C;const A=Math.floor(h*a)+1+t,O=Math.min(Math.floor((h+1)*a)+1,n)+t,{x,y:_}=e[u];for(m=p=-1,M=A;M<O;M++)p=.5*Math.abs((x-b)*(e[M].y-_)-(x-e[M].x)*(S-_)),p>m&&(m=p,f=e[M],y=M);r[l++]=f,u=y}return r[l++]=e[c],r}function Bb(e,t,n,i){let s=0,o=0,r,a,l,c,u,h,f,m,p,y;const b=[],S=t+n-1,M=e[t].x,D=e[S].x-M;for(r=t;r<t+n;++r){a=e[r],l=(a.x-M)/D*i,c=a.y;const C=l|0;if(C===u)c<p?(p=c,h=r):c>y&&(y=c,f=r),s=(o*s+a.x)/++o;else{const A=r-1;if(!rt(h)&&!rt(f)){const O=Math.min(h,f),x=Math.max(h,f);O!==m&&O!==A&&b.push({...e[O],x:s}),x!==m&&x!==A&&b.push({...e[x],x:s})}r>0&&A!==m&&b.push(e[A]),b.push(a),u=C,o=0,p=y=c,h=f=m=r}}return b}function Gu(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Ku(e){e.data.datasets.forEach(t=>{Gu(t)})}function zb(e,t){const n=t.length;let i=0,s;const{iScale:o}=e,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(i=Kt(Ze(t,o.axis,r).lo,0,n-1)),c?s=Kt(Ze(t,o.axis,a).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var Ub={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Ku(e);return}const i=e.width;e.data.datasets.forEach((s,o)=>{const{_data:r,indexAxis:a}=s,l=e.getDatasetMeta(o),c=r||s.data;if(ns([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:h,count:f}=zb(l,c);const m=n.threshold||4*i;if(f<=m){Gu(s);return}rt(r)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let p;switch(n.algorithm){case"lttb":p=Fb(c,h,f,i,n);break;case"min-max":p=Bb(c,h,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){Ku(e)}};function Hb(e,t,n){const i=e.segments,s=e.points,o=t.points,r=[];for(const a of i){let{start:l,end:c}=a;c=vo(l,c,s);const u=aa(n,s[l],s[c],a.loop);if(!t.segments){r.push({source:a,target:u,start:s[l],end:s[c]});continue}const h=qc(t,u);for(const f of h){const m=aa(n,o[f.start],o[f.end],f.loop),p=jc(a,s,m);for(const y of p)r.push({source:y,target:f,start:{[n]:Xu(u,m,"start",Math.max)},end:{[n]:Xu(u,m,"end",Math.min)}})}}return r}function aa(e,t,n,i){if(i)return;let s=t[e],o=n[e];return e==="angle"&&(s=ne(s),o=ne(o)),{property:e,start:s,end:o}}function Vb(e,t){const{x:n=null,y:i=null}=e||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=vo(r,a,s);const l=s[r],c=s[a];i!==null?(o.push({x:l.x,y:i}),o.push({x:c.x,y:i})):n!==null&&(o.push({x:n,y:l.y}),o.push({x:n,y:c.y}))}),o}function vo(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Xu(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function Zu(e,t){let n=[],i=!1;return xt(e)?(i=!0,n=e):n=Vb(e,t),n.length?new So({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Qu(e){return e&&e.fill!==!1}function Wb(e,t,n){let s=e[t].fill;const o=[t];let r;if(!n)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!At(s))return s;if(r=e[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function $b(e,t,n){const i=Gb(e);if(ft(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return At(s)&&Math.floor(s)===s?Yb(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Yb(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function jb(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:ft(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function qb(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:ft(e)?i=e.value:i=t.getBaseValue(),i}function Gb(e){const t=e.options,n=t.fill;let i=at(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Kb(e){const{scale:t,index:n,line:i}=e,s=[],o=i.segments,r=i.points,a=Xb(t,n);a.push(Zu({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){const c=o[l];for(let u=c.start;u<=c.end;u++)Zb(s,r[u],a)}return new So({points:s,options:{}})}function Xb(e,t){const n=[],i=e.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const o=i[s];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function Zb(e,t,n){const i=[];for(let s=0;s<n.length;s++){const o=n[s],{first:r,last:a,point:l}=Qb(o,t,"x");if(!(!l||r&&a)){if(r)i.unshift(l);else if(e.push(l),!a)break}}e.push(...i)}function Qb(e,t,n){const i=e.interpolate(t,n);if(!i)return{};const s=i[n],o=e.segments,r=e.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const u=o[c],h=r[u.start][n],f=r[u.end][n];if(Xe(s,h,f)){a=s===h,l=s===f;break}}return{first:a,last:l,point:i}}class Ju{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,i){const{x:s,y:o,radius:r}=this;return n=n||{start:0,end:Dt},t.arc(s,o,r,n.end,n.start,!0),!i.bounds}interpolate(t){const{x:n,y:i,radius:s}=this,o=t.angle;return{x:n+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}}function Jb(e){const{chart:t,fill:n,line:i}=e;if(At(n))return t0(t,n);if(n==="stack")return Kb(e);if(n==="shape")return!0;const s=e0(e);return s instanceof Ju?s:Zu(s,i)}function t0(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function e0(e){return(e.scale||{}).getPointPositionForValue?i0(e):n0(e)}function n0(e){const{scale:t={},fill:n}=e,i=jb(n,t);if(At(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function i0(e){const{scale:t,fill:n}=e,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,r=qb(n,t,o),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,o);return new Ju({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,r));return a}function la(e,t,n){const i=Jb(t),{chart:s,index:o,line:r,scale:a,axis:l}=t,c=r.options,u=c.fill,h=c.backgroundColor,{above:f=h,below:m=h}=u||{},p=s.getDatasetMeta(o),y=Xc(s,p);i&&r.points.length&&(ts(e,n),s0(e,{line:r,target:i,above:f,below:m,area:n,scale:a,axis:l,clip:y}),es(e))}function s0(e,t){const{line:n,target:i,above:s,below:o,area:r,scale:a,clip:l}=t,c=n._loop?"angle":t.axis;e.save();let u=o;o!==s&&(c==="x"?(td(e,i,r.top),ca(e,{line:n,target:i,color:s,scale:a,property:c,clip:l}),e.restore(),e.save(),td(e,i,r.bottom)):c==="y"&&(ed(e,i,r.left),ca(e,{line:n,target:i,color:o,scale:a,property:c,clip:l}),e.restore(),e.save(),ed(e,i,r.right),u=s)),ca(e,{line:n,target:i,color:u,scale:a,property:c,clip:l}),e.restore()}function td(e,t,n){const{segments:i,points:s}=t;let o=!0,r=!1;e.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],h=s[vo(l,c,s)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),r=!!t.pathSegment(e,a,{move:r}),r?e.closePath():e.lineTo(h.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function ed(e,t,n){const{segments:i,points:s}=t;let o=!0,r=!1;e.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],h=s[vo(l,c,s)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(n,u.y),e.lineTo(u.x,u.y)),r=!!t.pathSegment(e,a,{move:r}),r?e.closePath():e.lineTo(n,h.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function ca(e,t){const{line:n,target:i,property:s,color:o,scale:r,clip:a}=t,l=Hb(n,i,s);for(const{source:c,target:u,start:h,end:f}of l){const{style:{backgroundColor:m=o}={}}=c,p=i!==!0;e.save(),e.fillStyle=m,o0(e,r,a,p&&aa(s,h,f)),e.beginPath();const y=!!n.pathSegment(e,c);let b;if(p){y?e.closePath():nd(e,i,f,s);const S=!!i.pathSegment(e,u,{move:y,reverse:!0});b=y&&S,b||nd(e,i,h,s)}e.closePath(),e.fill(b?"evenodd":"nonzero"),e.restore()}}function o0(e,t,n,i){const s=t.chart.chartArea,{property:o,start:r,end:a}=i||{};if(o==="x"||o==="y"){let l,c,u,h;o==="x"?(l=r,c=s.top,u=a,h=s.bottom):(l=s.left,c=r,u=s.right,h=a),e.beginPath(),n&&(l=Math.max(l,n.left),u=Math.min(u,n.right),c=Math.max(c,n.top),h=Math.min(h,n.bottom)),e.rect(l,c,u-l,h-c),e.clip()}}function nd(e,t,n,i){const s=t.interpolate(n,i);s&&e.lineTo(s.x,s.y)}var r0={id:"filler",afterDatasetsUpdate(e,t,n){const i=(e.data.datasets||[]).length,s=[];let o,r,a,l;for(r=0;r<i;++r)o=e.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof So&&(l={visible:e.isDatasetVisible(r),index:r,fill:$b(a,r,i),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,s.push(l);for(r=0;r<i;++r)l=s[r],!(!l||l.fill===!1)&&(l.fill=Wb(s,r,n.propagate))},beforeDraw(e,t,n){const i=n.drawTime==="beforeDraw",s=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let r=s.length-1;r>=0;--r){const a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),i&&a.fill&&la(e.ctx,a,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;Qu(o)&&la(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Qu(i)||n.drawTime!=="beforeDatasetDraw"||la(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const id=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},a0=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class sd extends oe{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=wt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=Pt(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=id(i,o);let c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(r,o,a,l)+10):(u=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let h=t;o.textAlign="left",o.textBaseline="middle";let f=-1,m=-u;return this.legendItems.forEach((p,y)=>{const b=i+n/2+o.measureText(p.text).width;(y===0||c[c.length-1]+b+2*a>r)&&(h+=u,c[c.length-(y>0?0:1)]=0,m+=u,f++),l[y]={left:0,top:m,row:f,width:b,height:s},c[c.length-1]+=b+a}),h}_fitCols(t,n,i,s){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=r-t;let h=a,f=0,m=0,p=0,y=0;return this.legendItems.forEach((b,S)=>{const{itemWidth:M,itemHeight:E}=l0(i,n,o,b,s);S>0&&m+E+2*a>u&&(h+=f+a,c.push({width:f,height:m}),p+=f+a,y++,f=m=0),l[S]={left:p,top:m,col:y,width:M,height:E},f=Math.max(f,M),m+=E+a}),h+=f,c.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,r=pi(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=ie(i,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=ie(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=ie(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=ie(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;ts(t,this),this._draw(),es(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=Et.color,l=pi(t.rtl,this.left,this.width),c=Pt(r.font),{padding:u}=r,h=c.size,f=h/2;let m;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:y,itemHeight:b}=id(r,h),S=function(A,O,x){if(isNaN(p)||p<=0||isNaN(y)||y<0)return;s.save();const _=at(x.lineWidth,1);if(s.fillStyle=at(x.fillStyle,a),s.lineCap=at(x.lineCap,"butt"),s.lineDashOffset=at(x.lineDashOffset,0),s.lineJoin=at(x.lineJoin,"miter"),s.lineWidth=_,s.strokeStyle=at(x.strokeStyle,a),s.setLineDash(at(x.lineDash,[])),r.usePointStyle){const v={radius:y*Math.SQRT2/2,pointStyle:x.pointStyle,rotation:x.rotation,borderWidth:_},k=l.xPlus(A,p/2),I=O+f;Ec(s,v,k,I,r.pointStyleWidth&&p)}else{const v=O+Math.max((h-y)/2,0),k=l.leftForLtr(A,p),I=yn(x.borderRadius);s.beginPath(),Object.values(I).some(Y=>Y!==0)?hi(s,{x:k,y:v,w:p,h:y,radius:I}):s.rect(k,v,p,y),s.fill(),_!==0&&s.stroke()}s.restore()},M=function(A,O,x){Bn(s,x.text,A,O+b/2,c,{strikethrough:x.hidden,textAlign:l.textAlign(x.textAlign)})},E=this.isHorizontal(),D=this._computeTitleHeight();E?m={x:ie(o,this.left+u,this.right-i[0]),y:this.top+u+D,line:0}:m={x:this.left+u,y:ie(o,this.top+D+u,this.bottom-n[0].height),line:0},Vc(this.ctx,t.textDirection);const C=b+u;this.legendItems.forEach((A,O)=>{s.strokeStyle=A.fontColor,s.fillStyle=A.fontColor;const x=s.measureText(A.text).width,_=l.textAlign(A.textAlign||(A.textAlign=r.textAlign)),v=p+f+x;let k=m.x,I=m.y;l.setWidth(this.width),E?O>0&&k+v+u>this.right&&(I=m.y+=C,m.line++,k=m.x=ie(o,this.left+u,this.right-i[m.line])):O>0&&I+C>this.bottom&&(k=m.x=k+n[m.line].width+u,m.line++,I=m.y=ie(o,this.top+D+u,this.bottom-n[m.line].height));const Y=l.x(k);if(S(Y,I,A),k=Sp(_,k+p+f,E?k+v:this.right,t.rtl),M(l.x(k),I,A),E)m.x+=v+u;else if(typeof A.text!="string"){const U=c.lineHeight;m.y+=od(A,U)+u}else m.y+=C}),Wc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=Pt(n.font),s=Wt(n.padding);if(!n.display)return;const o=pi(t.rtl,this.left,this.width),r=this.ctx,a=n.position,l=i.size/2,c=s.top+l;let u,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,h=ie(t.align,h,this.right-f);else{const p=this.columnSizes.reduce((y,b)=>Math.max(y,b.height),0);u=c+ie(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const m=ie(a,h,h+f);r.textAlign=o.textAlign(Pr(a)),r.textBaseline="middle",r.strokeStyle=n.color,r.fillStyle=n.color,r.font=i.string,Bn(r,n.text,m,u,i)}_computeTitleHeight(){const t=this.options.title,n=Pt(t.font),i=Wt(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,o;if(Xe(t,this.left,this.right)&&Xe(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],Xe(t,s.left,s.left+s.width)&&Xe(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!d0(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=a0(s,i);s&&!o&&wt(n.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&wt(n.onHover,[t,i,this],this)}else i&&wt(n.onClick,[t,i,this],this)}}function l0(e,t,n,i,s){const o=c0(i,e,t,n),r=u0(s,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function c0(e,t,n,i){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+n.size/2+i.measureText(s).width}function u0(e,t,n){let i=e;return typeof t.text!="string"&&(i=od(t,n)),i}function od(e,t){const n=e.text?e.text.length:0;return t*n}function d0(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var h0={id:"legend",_element:sd,start(e,t,n){const i=e.legend=new sd({ctx:e.ctx,options:n,chart:e});se.configure(e,i,n),se.addBox(e,i)},stop(e){se.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;se.configure(e,i,n),i.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const i=t.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Wt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class ua extends oe{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=xt(i.text)?i.text.length:1;this._padding=Wt(i.padding);const o=s*Pt(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:o,options:r}=this,a=r.align;let l=0,c,u,h;return this.isHorizontal()?(u=ie(a,i,o),h=n+t,c=o-i):(r.position==="left"?(u=i+t,h=ie(a,s,n),l=dt*-.5):(u=o-t,h=ie(a,n,s),l=dt*.5),c=s-n),{titleX:u,titleY:h,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=Pt(n.font),o=i.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Bn(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:Pr(n.align),textBaseline:"middle",translation:[r,a]})}}function f0(e,t){const n=new ua({ctx:e.ctx,options:t,chart:e});se.configure(e,n,t),se.addBox(e,n),e.titleBlock=n}var m0={id:"title",_element:ua,start(e,t,n){f0(e,n)},stop(e){const t=e.titleBlock;se.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;se.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const To=new WeakMap;var p0={id:"subtitle",start(e,t,n){const i=new ua({ctx:e.ctx,options:n,chart:e});se.configure(e,i,n),se.addBox(e,i),To.set(e,i)},stop(e){se.removeBox(e,To.get(e)),To.delete(e)},beforeUpdate(e,t,n){const i=To.get(e);se.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const hs={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,o=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),s+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=e.length;o<r;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=di(t,c);u<s&&(s=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,i=l.y}return{x:n,y:i}}};function He(e,t){return t&&(xt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function tn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
2
- `)>-1?e.split(`
3
- `):e}function g0(e,t){const{element:n,datasetIndex:i,index:s}=t,o=e.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:e,label:r,parsed:o.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function rd(e,t){const n=e.chart.ctx,{body:i,footer:s,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=Pt(t.bodyFont),c=Pt(t.titleFont),u=Pt(t.footerFont),h=o.length,f=s.length,m=i.length,p=Wt(t.padding);let y=p.height,b=0,S=i.reduce((D,C)=>D+C.before.length+C.lines.length+C.after.length,0);if(S+=e.beforeBody.length+e.afterBody.length,h&&(y+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),S){const D=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=m*D+(S-m)*l.lineHeight+(S-1)*t.bodySpacing}f&&(y+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let M=0;const E=function(D){b=Math.max(b,n.measureText(D).width+M)};return n.save(),n.font=c.string,St(e.title,E),n.font=l.string,St(e.beforeBody.concat(e.afterBody),E),M=t.displayColors?r+2+t.boxPadding:0,St(i,D=>{St(D.before,E),St(D.lines,E),St(D.after,E)}),M=0,n.font=u.string,St(e.footer,E),n.restore(),b+=p.width,{width:b,height:y}}function y0(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function b0(e,t,n,i){const{x:s,width:o}=i,r=n.caretSize+n.caretPadding;if(e==="left"&&s+o+r>t.width||e==="right"&&s-o-r<0)return!0}function _0(e,t,n,i){const{x:s,width:o}=n,{width:r,chartArea:{left:a,right:l}}=e;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),b0(c,e,t,n)&&(c="center"),c}function ad(e,t,n){const i=n.yAlign||t.yAlign||y0(e,n);return{xAlign:n.xAlign||t.xAlign||_0(e,t,n,i),yAlign:i}}function x0(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function w0(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function ld(e,t,n,i){const{caretSize:s,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=yn(r);let p=x0(t,a);const y=w0(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,f)+s:a==="right"&&(p+=Math.max(h,m)+s),{x:Kt(p,0,i.width-t.width),y:Kt(y,0,i.height-t.height)}}function Mo(e,t,n){const i=Wt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function cd(e){return He([],tn(e))}function S0(e,t,n){return bn(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function ud(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const dd={beforeTitle:Ke,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return n[t.dataIndex]}return""},afterTitle:Ke,beforeBody:Ke,beforeLabel:Ke,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return rt(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Ke,afterBody:Ke,beforeFooter:Ke,footer:Ke,afterFooter:Ke};function ge(e,t,n,i){const s=e[t].call(n,i);return typeof s>"u"?dd[t].call(n,i):s}class hd extends oe{static positioners=hs;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,o=new Yr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=S0(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=ge(i,"beforeTitle",this,t),o=ge(i,"title",this,t),r=ge(i,"afterTitle",this,t);let a=[];return a=He(a,tn(s)),a=He(a,tn(o)),a=He(a,tn(r)),a}getBeforeBody(t,n){return cd(ge(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return St(t,o=>{const r={before:[],lines:[],after:[]},a=ud(i,o);He(r.before,tn(ge(a,"beforeLabel",this,o))),He(r.lines,ge(a,"label",this,o)),He(r.after,tn(ge(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,n){return cd(ge(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=ge(i,"beforeFooter",this,t),o=ge(i,"footer",this,t),r=ge(i,"afterFooter",this,t);let a=[];return a=He(a,tn(s)),a=He(a,tn(o)),a=He(a,tn(r)),a}_createItems(t){const n=this._active,i=this.chart.data,s=[],o=[],r=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(g0(this.chart,n[l]));return t.filter&&(a=a.filter((u,h,f)=>t.filter(u,h,f,i))),t.itemSort&&(a=a.sort((u,h)=>t.itemSort(u,h,i))),St(a,u=>{const h=ud(t.callbacks,u);s.push(ge(h,"labelColor",this,u)),o.push(ge(h,"labelPointStyle",this,u)),r.push(ge(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=hs[i.position].call(this,s,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const l=this._size=rd(this,i),c=Object.assign({},a,l),u=ad(this.chart,i,c),h=ld(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const o=this.getCaretPosition(t,i,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:h}=yn(a),{x:f,y:m}=t,{width:p,height:y}=n;let b,S,M,E,D,C;return o==="center"?(D=m+y/2,s==="left"?(b=f,S=b-r,E=D+r,C=D-r):(b=f+p,S=b+r,E=D-r,C=D+r),M=b):(s==="left"?S=f+Math.max(l,u)+r:s==="right"?S=f+p-Math.max(c,h)-r:S=this.caretX,o==="top"?(E=m,D=E-r,b=S-r,M=S+r):(E=m+y,D=E+r,b=S+r,M=S-r),C=E),{x1:b,x2:S,x3:M,y1:E,y2:D,y3:C}}drawTitle(t,n,i){const s=this.title,o=s.length;let r,a,l;if(o){const c=pi(i.rtl,this.x,this.width);for(t.x=Mo(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",r=Pt(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=r.string,l=0;l<o;++l)n.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,n,i,s,o){const r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,u=Pt(o.bodyFont),h=Mo(this,"left",o),f=s.x(h),m=l<u.lineHeight?(u.lineHeight-l)/2:0,p=n.y+m;if(o.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=s.leftForLtr(f,c)+c/2,S=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Br(t,y,b,S),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Br(t,y,b,S)}else{t.lineWidth=ft(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const y=s.leftForLtr(f,c),b=s.leftForLtr(s.xPlus(f,1),c-2),S=yn(r.borderRadius);Object.values(S).some(M=>M!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,hi(t,{x:y,y:p,w:c,h:l,radius:S}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),hi(t,{x:b,y:p+1,w:c-2,h:l-2,radius:S}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(y,p,c,l),t.strokeRect(y,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(b,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,h=Pt(i.bodyFont);let f=h.lineHeight,m=0;const p=pi(i.rtl,this.x,this.width),y=function(x){n.fillText(x,p.x(t.x+m),t.y+f/2),t.y+=f+o},b=p.textAlign(r);let S,M,E,D,C,A,O;for(n.textAlign=r,n.textBaseline="middle",n.font=h.string,t.x=Mo(this,b,i),n.fillStyle=i.bodyColor,St(this.beforeBody,y),m=a&&b!=="right"?r==="center"?c/2+u:c+2+u:0,D=0,A=s.length;D<A;++D){for(S=s[D],M=this.labelTextColors[D],n.fillStyle=M,St(S.before,y),E=S.lines,a&&E.length&&(this._drawColorBox(n,t,D,p,i),f=Math.max(h.lineHeight,l)),C=0,O=E.length;C<O;++C)y(E[C]),f=h.lineHeight;St(S.after,y)}m=0,f=h.lineHeight,St(this.afterBody,y),t.y-=o}drawFooter(t,n,i){const s=this.footer,o=s.length;let r,a;if(o){const l=pi(i.rtl,this.x,this.width);for(t.x=Mo(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=l.textAlign(i.footerAlign),n.textBaseline="middle",r=Pt(i.footerFont),n.fillStyle=i.footerColor,n.font=r.string,a=0;a<o;++a)n.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,n,i,s){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:p}=yn(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+h,l),r==="top"&&this.drawCaret(t,n,i,s),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),r==="center"&&o==="right"&&this.drawCaret(t,n,i,s),n.lineTo(a+c,l+u-p),n.quadraticCurveTo(a+c,l+u,a+c-p,l+u),r==="bottom"&&this.drawCaret(t,n,i,s),n.lineTo(a+m,l+u),n.quadraticCurveTo(a,l+u,a,l+u-m),r==="center"&&o==="left"&&this.drawCaret(t,n,i,s),n.lineTo(a,l+h),n.quadraticCurveTo(a,l,a+h,l),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const r=hs[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=rd(this,t),l=Object.assign({},r,this._size),c=ad(n,t,l),u=ld(t,l,c,n);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=Wt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,n),Vc(t,n.textDirection),o.y+=r.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),Wc(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!to(i,s),r=this._positionChanged(s,n);(o||r)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,n,i),a=this._positionChanged(r,t),l=n||!to(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,n){const{caretX:i,caretY:s,options:o}=this,r=hs[o.position].call(this,t,n);return r!==!1&&(i!==r.x||s!==r.y)}}var Me={id:"tooltip",_element:hd,positioners:hs,afterInit(e,t,n){n&&(e.tooltip=new hd({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:dd},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},v0=Object.freeze({__proto__:null,Colors:Nb,Decimation:Ub,Filler:r0,Legend:h0,SubTitle:p0,Title:m0,Tooltip:Me});const T0=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function M0(e,t,n,i){const s=e.indexOf(t);if(s===-1)return T0(e,t,n,i);const o=e.lastIndexOf(t);return s!==o?n:s}const k0=(e,t)=>e===null?null:Kt(Math.round(e),0,t);function fd(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class D0 extends Vn{static id="category";static defaults={ticks:{callback:fd}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:s,label:o}of n)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(rt(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:M0(i,t,at(n,t),this._addedLabels),k0(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,n=this.max,i=this.options.offset,s=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=n;r++)s.push({value:r});return s}getLabelForValue(t){return fd.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function C0(e,t){const n=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:u,maxDigits:h,includeBounds:f}=e,m=o||1,p=u-1,{min:y,max:b}=t,S=!rt(r),M=!rt(a),E=!rt(c),D=(b-y)/(h+1);let C=pc((b-y)/p/m)*m,A,O,x,_;if(C<1e-14&&!S&&!M)return[{value:y},{value:b}];_=Math.ceil(b/C)-Math.floor(y/C),_>p&&(C=pc(_*C/p/m)*m),rt(l)||(A=Math.pow(10,l),C=Math.ceil(C*A)/A),s==="ticks"?(O=Math.floor(y/C)*C,x=Math.ceil(b/C)*C):(O=y,x=b),S&&M&&o&&pp((a-r)/o,C/1e3)?(_=Math.round(Math.min((a-r)/C,u)),C=(a-r)/_,O=r,x=a):E?(O=S?r:O,x=M?a:x,_=c-1,C=(x-O)/_):(_=(x-O)/C,Ki(_,Math.round(_),C/1e3)?_=Math.round(_):_=Math.ceil(_));const v=Math.max(yc(C),yc(O));A=Math.pow(10,rt(l)?v:l),O=Math.round(O*A)/A,x=Math.round(x*A)/A;let k=0;for(S&&(f&&O!==r?(n.push({value:r}),O<r&&k++,Ki(Math.round((O+k*C)*A)/A,r,md(r,D,e))&&k++):O<r&&k++);k<_;++k){const I=Math.round((O+k*C)*A)/A;if(M&&I>a)break;n.push({value:I})}return M&&f&&x!==a?n.length&&Ki(n[n.length-1].value,a,md(a,D,e))?n[n.length-1].value=a:n.push({value:a}):(!M||x===a)&&n.push({value:x}),n}function md(e,t,{horizontal:n,minRotation:i}){const s=Vt(i),o=(n?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}class ko extends Vn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return rt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const r=l=>s=n?s:l,a=l=>o=i?o:l;if(t){const l=ze(s),c=ze(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,r=C0(s,o);return t.bounds==="ticks"&&gc(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return Qi(t,this.chart.options.locale,this.options.ticks.format)}}class O0 extends ko{static id="linear";static defaults={ticks:{callback:ao.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=At(t)?t:0,this.max=At(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Vt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const fs=e=>Math.floor(pn(e)),Wn=(e,t)=>Math.pow(10,fs(e)+t);function pd(e){return e/Math.pow(10,fs(e))===1}function gd(e,t,n){const i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function E0(e,t){const n=t-e;let i=fs(n);for(;gd(e,t,i)>10;)i++;for(;gd(e,t,i)<10;)i--;return Math.min(i,fs(e))}function A0(e,{min:t,max:n}){t=Te(e.min,t);const i=[],s=fs(t);let o=E0(t,n),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,u=Math.floor((t-l)/a/10)*a*10;let h=Math.floor((c-u)/Math.pow(10,o)),f=Te(e.min,Math.round((l+u+h*Math.pow(10,o))*r)/r);for(;f<n;)i.push({value:f,major:pd(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,r=o>=0?1:r),f=Math.round((l+u+h*Math.pow(10,o))*r)/r;const m=Te(e.max,f);return i.push({value:m,major:pd(m),significand:h}),i}class P0 extends Vn{static id="logarithmic";static defaults={ticks:{callback:ao.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=ko.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return At(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=At(t)?Math.max(0,t):null,this.max=At(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!At(this._userMin)&&(this.min=t===Wn(this.min,0)?Wn(this.min,-1):Wn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const o=a=>i=t?i:a,r=a=>s=n?s:a;i===s&&(i<=0?(o(1),r(10)):(o(Wn(i,-1)),r(Wn(s,1)))),i<=0&&o(Wn(s,-1)),s<=0&&r(Wn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=A0(n,this);return t.bounds==="ticks"&&gc(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":Qi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=pn(t),this._valueRange=pn(this.max)-pn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(pn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}function da(e){const t=e.ticks;if(t.display&&e.display){const n=Wt(t.backdropPadding);return at(t.font&&t.font.size,Et.font.size)+n.height}return 0}function R0(e,t,n){return n=xt(n)?n:[n],{w:Pp(e,t.string,n),h:n.length*t.lineHeight}}function yd(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:e<i||e>s?{start:t-n,end:t}:{start:t,end:t+n}}function I0(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],s=[],o=e._pointLabels.length,r=e.options.pointLabels,a=r.centerPointLabels?dt/o:0;for(let l=0;l<o;l++){const c=r.setContext(e.getPointLabelContext(l));s[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+s[l],a),h=Pt(c.font),f=R0(e.ctx,h,e._pointLabels[l]);i[l]=f;const m=ne(e.getIndexAngle(l)+a),p=Math.round(so(m)),y=yd(p,u.x,f.w,0,180),b=yd(p,u.y,f.h,90,270);L0(n,t,m,y,b)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=B0(e,i,s)}function L0(e,t,n,i,s){const o=Math.abs(Math.sin(n)),r=Math.abs(Math.cos(n));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/o,e.l=Math.min(e.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,e.t=Math.min(e.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,e.b=Math.max(e.b,t.b+l))}function N0(e,t,n){const i=e.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=n,l=e.getPointPosition(t,i+s+r,o),c=Math.round(so(ne(l.angle+Ot))),u=H0(l.y,a.h,c),h=z0(c),f=U0(l.x,a.w,h);return{visible:!0,x:l.x,y:u,textAlign:h,left:f,top:u,right:f+a.w,bottom:u+a.h}}function F0(e,t){if(!t)return!0;const{left:n,top:i,right:s,bottom:o}=e;return!(Qe({x:n,y:i},t)||Qe({x:n,y:o},t)||Qe({x:s,y:i},t)||Qe({x:s,y:o},t))}function B0(e,t,n){const i=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:da(o)/2,additionalAngle:r?dt/s:0};let c;for(let u=0;u<s;u++){l.padding=n[u],l.size=t[u];const h=N0(e,u,l);i.push(h),a==="auto"&&(h.visible=F0(h,c),h.visible&&(c=h))}return i}function z0(e){return e===0||e===180?"center":e<180?"left":"right"}function U0(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function H0(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function V0(e,t,n){const{left:i,top:s,right:o,bottom:r}=n,{backdropColor:a}=t;if(!rt(a)){const l=yn(t.borderRadius),c=Wt(t.backdropPadding);e.fillStyle=a;const u=i-c.left,h=s-c.top,f=o-i+c.width,m=r-s+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),hi(e,{x:u,y:h,w:f,h:m,radius:l}),e.fill()):e.fillRect(u,h,f,m)}}function W0(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const o=e._pointLabelItems[s];if(!o.visible)continue;const r=i.setContext(e.getPointLabelContext(s));V0(n,r,o);const a=Pt(r.font),{x:l,y:c,textAlign:u}=o;Bn(n,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:u,textBaseline:"middle"})}}function bd(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Dt);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<i;r++)o=e.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function $0(e,t,n,i,s){const o=e.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!i||!a||!l||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),bd(e,n,r,i),o.closePath(),o.stroke(),o.restore())}function Y0(e,t,n){return bn(e,{label:n,index:t,type:"pointLabel"})}class j0 extends ko{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:ao.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=Wt(da(this.options)/2),n=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=At(t)&&!isNaN(t)?t:0,this.max=At(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/da(this.options))}generateTickLabels(t){ko.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{const s=wt(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?I0(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=Dt/(this._pointLabels.length||1),i=this.options.startAngle||0;return ne(t*n+Vt(i))}getDistanceFromCenterForValue(t){if(rt(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(rt(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const i=n[t];return Y0(this.getContext(),t,i)}}getPointPosition(t,n,i=0){const s=this.getIndexAngle(t)-Ot+i;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:i,right:s,bottom:o}=this._pointLabelItems[t];return{left:n,top:i,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),bd(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:i,grid:s,border:o}=n,r=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&W0(this,r),s.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(h),m=s.setContext(f),p=o.setContext(f);$0(this,m,l,r,p)}}),i.display){for(t.save(),a=r-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:h,lineWidth:f}=u;!f||!h||(t.lineWidth=f,t.strokeStyle=h,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=Pt(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const h=Wt(c.backdropPadding);t.fillRect(-r/2-h.left,-o-u.size/2-h.top,r+h.width,u.size+h.height)}Bn(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}const Do={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}},ye=Object.keys(Do);function _d(e,t){return e-t}function xd(e,t){if(rt(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:o}=e._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),At(r)||(r=typeof i=="string"?n.parse(r,i):n.parse(r)),r===null?null:(s&&(r=s==="week"&&(gn(o)||o===!0)?n.startOf(r,"isoWeek",o):n.startOf(r,s)),+r)}function wd(e,t,n,i){const s=ye.length;for(let o=ye.indexOf(e);o<s-1;++o){const r=Do[ye[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((n-t)/(a*r.size))<=i)return ye[o]}return ye[s-1]}function q0(e,t,n,i,s){for(let o=ye.length-1;o>=ye.indexOf(n);o--){const r=ye[o];if(Do[r].common&&e._adapter.diff(s,i,r)>=t-1)return r}return ye[n?ye.indexOf(n):0]}function G0(e){for(let t=ye.indexOf(e)+1,n=ye.length;t<n;++t)if(Do[ye[t]].common)return ye[t]}function Sd(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:s}=Ar(n,t),o=n[i]>=t?n[i]:n[s];e[o]=!0}}function K0(e,t,n,i){const s=e._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function vd(e,t,n){const i=[],s={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,i.push({value:a,major:!1});return o===0||!n?i:K0(e,i,s,n)}class ha extends Vn{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const i=t.time||(t.time={}),s=this._adapter=new du._date(t.adapters.date);s.init(n),Gi(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:xd(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,i=t.time.unit||"day";let{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=At(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=At(o)&&!isNaN(o)?o:+n.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){const t=this.options,n=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,r=this.max,a=_p(s,o,r);return this._unit=n.unit||(i.autoSkip?wd(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):q0(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:G0(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),vd(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;n=Kt(n,0,r),i=Kt(i,0,r),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||wd(o.minUnit,n,i,this._getLabelCapacity(n)),a=at(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=gn(l)||l===!0,u={};let h=n,f,m;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":r),t.diff(i,n,r)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+r);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<i;f=+t.add(f,a,r),m++)Sd(u,f,p);return(f===i||s.bounds==="ticks"||m===1)&&Sd(u,f,p),Object.keys(u).sort(_d).map(y=>+y)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,o=this._unit,r=n||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,n,i,s){const o=this.options,r=o.ticks.callback;if(r)return wt(r,[t,n,i],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],h=c&&a[c],f=i[n],m=c&&h&&f&&f.major;return this._adapter.format(t,s||(m?h:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n<i;++n)s=t[n],s.label=this._tickFormatFunction(s.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,i=this.ctx.measureText(t).width,s=Vt(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){const n=this.options.time,i=n.displayFormats,s=i[n.unit]||i.millisecond,o=this._tickFormatFunction(t,0,vd(this,[t],this._majorUnit),s),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n<i;++n)t=t.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,i;if(t.length)return t;const s=this.getLabels();for(n=0,i=s.length;n<i;++n)t.push(xd(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return xc(t.sort(_d))}}function Co(e,t,n){let i=0,s=e.length-1,o,r,a,l;n?(t>=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=Ze(e,"pos",t)),{pos:o,time:a}=e[i],{pos:r,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=Ze(e,"time",t)),{time:o,pos:a}=e[i],{time:r,pos:l}=e[s]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class X0 extends ha{static id="timeseries";static defaults=ha.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Co(n,this.min),this._tableRange=Co(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],o=[];let r,a,l,c,u;for(r=0,a=t.length;r<a;++r)c=t[r],c>=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(r=0,a=s.length;r<a;++r)u=s[r+1],l=s[r-1],c=s[r],Math.round((u+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){const t=this.min,n=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Co(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return Co(this._table,i*this._tableRange+this._minPos,!0)}}var Z0=Object.freeze({__proto__:null,CategoryScale:D0,LinearScale:O0,LogarithmicScale:P0,RadialLinearScale:j0,TimeScale:ha,TimeSeriesScale:X0});const Q0=[Qg,Ob,v0,Z0],Td=6048e5,J0=864e5,ms=6e4,yi=36e5,t_=1e3,Md=Symbol.for("constructDateFrom");function It(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Md in e?e[Md](t):e instanceof Date?new e.constructor(t):new Date(t)}function ut(e,t){return It(t||e,e)}function Oo(e,t,n){const i=ut(e,n?.in);return isNaN(t)?It(n?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function fa(e,t,n){const i=ut(e,n?.in);if(isNaN(t))return It(e,NaN);if(!t)return i;const s=i.getDate(),o=It(e,i.getTime());o.setMonth(i.getMonth()+t+1,0);const r=o.getDate();return s>=r?o:(i.setFullYear(o.getFullYear(),o.getMonth(),s),i)}function ma(e,t,n){return It(e,+ut(e)+t)}function e_(e,t,n){return ma(e,t*yi)}let n_={};function $n(){return n_}function Ve(e,t){const n=$n(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=ut(e,t?.in),o=s.getDay(),r=(o<i?7:0)+o-i;return s.setDate(s.getDate()-r),s.setHours(0,0,0,0),s}function bi(e,t){return Ve(e,{...t,weekStartsOn:1})}function kd(e,t){const n=ut(e,t?.in),i=n.getFullYear(),s=It(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=bi(s),r=It(n,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const a=bi(r);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function Eo(e){const t=ut(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Yn(e,...t){const n=It.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function pa(e,t){const n=ut(e,t?.in);return n.setHours(0,0,0,0),n}function Dd(e,t,n){const[i,s]=Yn(n?.in,e,t),o=pa(i),r=pa(s),a=+o-Eo(o),l=+r-Eo(r);return Math.round((a-l)/J0)}function i_(e,t){const n=kd(e,t),i=It(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),bi(i)}function s_(e,t,n){const i=ut(e,n?.in);return i.setTime(i.getTime()+t*ms),i}function o_(e,t,n){return fa(e,t*3,n)}function r_(e,t,n){return ma(e,t*1e3)}function a_(e,t,n){return Oo(e,t*7,n)}function l_(e,t,n){return fa(e,t*12,n)}function ps(e,t){const n=+ut(e)-+ut(t);return n<0?-1:n>0?1:n}function c_(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ga(e){return!(!c_(e)&&typeof e!="number"||isNaN(+ut(e)))}function u_(e,t,n){const[i,s]=Yn(n?.in,e,t),o=i.getFullYear()-s.getFullYear(),r=i.getMonth()-s.getMonth();return o*12+r}function d_(e,t,n){const[i,s]=Yn(n?.in,e,t);return i.getFullYear()-s.getFullYear()}function Cd(e,t,n){const[i,s]=Yn(n?.in,e,t),o=Od(i,s),r=Math.abs(Dd(i,s));i.setDate(i.getDate()-o*r);const a=+(Od(i,s)===-o),l=o*(r-a);return l===0?0:l}function Od(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function gs(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return i===0?0:i}}function h_(e,t,n){const[i,s]=Yn(n?.in,e,t),o=(+i-+s)/yi;return gs(n?.roundingMethod)(o)}function ya(e,t){return+ut(e)-+ut(t)}function f_(e,t,n){const i=ya(e,t)/ms;return gs(n?.roundingMethod)(i)}function Ed(e,t){const n=ut(e,t?.in);return n.setHours(23,59,59,999),n}function Ad(e,t){const n=ut(e,t?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function m_(e,t){const n=ut(e,t?.in);return+Ed(n,t)==+Ad(n,t)}function Pd(e,t,n){const[i,s,o]=Yn(n?.in,e,e,t),r=ps(s,o),a=Math.abs(u_(s,o));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-r*a);let l=ps(s,o)===-r;m_(i)&&a===1&&ps(i,o)===1&&(l=!1);const c=r*(a-+l);return c===0?0:c}function p_(e,t,n){const i=Pd(e,t,n)/3;return gs(n?.roundingMethod)(i)}function g_(e,t,n){const i=ya(e,t)/1e3;return gs(n?.roundingMethod)(i)}function y_(e,t,n){const i=Cd(e,t,n)/7;return gs(n?.roundingMethod)(i)}function b_(e,t,n){const[i,s]=Yn(n?.in,e,t),o=ps(i,s),r=Math.abs(d_(i,s));i.setFullYear(1584),s.setFullYear(1584);const a=ps(i,s)===-o,l=o*(r-+a);return l===0?0:l}function __(e,t){const n=ut(e,t?.in),i=n.getMonth(),s=i-i%3;return n.setMonth(s,1),n.setHours(0,0,0,0),n}function x_(e,t){const n=ut(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function w_(e,t){const n=ut(e,t?.in),i=n.getFullYear();return n.setFullYear(i+1,0,0),n.setHours(23,59,59,999),n}function Rd(e,t){const n=ut(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function S_(e,t){const n=ut(e,t?.in);return n.setMinutes(59,59,999),n}function v_(e,t){const n=$n(),i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=ut(e,t?.in),o=s.getDay(),r=(o<i?-7:0)+6-(o-i);return s.setDate(s.getDate()+r),s.setHours(23,59,59,999),s}function T_(e,t){const n=ut(e,t?.in);return n.setSeconds(59,999),n}function M_(e,t){const n=ut(e,t?.in),i=n.getMonth(),s=i-i%3+3;return n.setMonth(s,0),n.setHours(23,59,59,999),n}function k_(e,t){const n=ut(e,t?.in);return n.setMilliseconds(999),n}const D_={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"}},C_=(e,t,n)=>{let i;const s=D_[e];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function ba(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const O_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},E_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},A_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},P_={date:ba({formats:O_,defaultWidth:"full"}),time:ba({formats:E_,defaultWidth:"full"}),dateTime:ba({formats:A_,defaultWidth:"full"})},R_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},I_=(e,t,n,i)=>R_[e];function ys(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let s;if(i==="formatting"&&e.formattingValues){const r=e.defaultFormattingWidth||e.defaultWidth,a=n?.width?String(n.width):r;s=e.formattingValues[a]||e.formattingValues[r]}else{const r=e.defaultWidth,a=n?.width?String(n.width):e.defaultWidth;s=e.values[a]||e.values[r]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const L_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},N_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},F_={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"]},B_={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"]},z_={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"}},U_={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"}},H_={ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:ys({values:L_,defaultWidth:"wide"}),quarter:ys({values:N_,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ys({values:F_,defaultWidth:"wide"}),day:ys({values:B_,defaultWidth:"wide"}),dayPeriod:ys({values:z_,defaultWidth:"wide",formattingValues:U_,defaultFormattingWidth:"wide"})};function bs(e){return(t,n={})=>{const i=n.width,s=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const r=o[0],a=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?W_(a,h=>h.test(r)):V_(a,h=>h.test(r));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(r.length);return{value:c,rest:u}}}function V_(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function W_(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function $_(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const s=i[0],o=t.match(e.parsePattern);if(!o)return null;let r=e.valueCallback?e.valueCallback(o[0]):o[0];r=n.valueCallback?n.valueCallback(r):r;const a=t.slice(s.length);return{value:r,rest:a}}}const Y_=/^(\d+)(th|st|nd|rd)?/i,j_=/\d+/i,q_={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},G_={any:[/^b/i,/^(a|c)/i]},K_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},X_={any:[/1/i,/2/i,/3/i,/4/i]},Z_={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},Q_={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]},J_={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},tx={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]},ex={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},nx={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ix={ordinalNumber:$_({matchPattern:Y_,parsePattern:j_,valueCallback:e=>parseInt(e,10)}),era:bs({matchPatterns:q_,defaultMatchWidth:"wide",parsePatterns:G_,defaultParseWidth:"any"}),quarter:bs({matchPatterns:K_,defaultMatchWidth:"wide",parsePatterns:X_,defaultParseWidth:"any",valueCallback:e=>e+1}),month:bs({matchPatterns:Z_,defaultMatchWidth:"wide",parsePatterns:Q_,defaultParseWidth:"any"}),day:bs({matchPatterns:J_,defaultMatchWidth:"wide",parsePatterns:tx,defaultParseWidth:"any"}),dayPeriod:bs({matchPatterns:ex,defaultMatchWidth:"any",parsePatterns:nx,defaultParseWidth:"any"})},Id={code:"en-US",formatDistance:C_,formatLong:P_,formatRelative:I_,localize:H_,match:ix,options:{weekStartsOn:0,firstWeekContainsDate:1}};function sx(e,t){const n=ut(e,t?.in);return Dd(n,Rd(n))+1}function Ld(e,t){const n=ut(e,t?.in),i=+bi(n)-+i_(n);return Math.round(i/Td)+1}function _a(e,t){const n=ut(e,t?.in),i=n.getFullYear(),s=$n(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,r=It(t?.in||e,0);r.setFullYear(i+1,0,o),r.setHours(0,0,0,0);const a=Ve(r,t),l=It(t?.in||e,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const c=Ve(l,t);return+n>=+a?i+1:+n>=+c?i:i-1}function ox(e,t){const n=$n(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=_a(e,t),o=It(t?.in||e,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),Ve(o,t)}function Nd(e,t){const n=ut(e,t?.in),i=+Ve(n,t)-+ox(n,t);return Math.round(i/Td)+1}function vt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const vn={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return vt(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):vt(n+1,2)},d(e,t){return vt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return vt(e.getHours()%12||12,t.length)},H(e,t){return vt(e.getHours(),t.length)},m(e,t){return vt(e.getMinutes(),t.length)},s(e,t){return vt(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return vt(s,t.length)}},_i={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Fd={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return vn.y(e,t)},Y:function(e,t,n,i){const s=_a(e,i),o=s>0?s:1-s;if(t==="YY"){const r=o%100;return vt(r,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):vt(o,t.length)},R:function(e,t){const n=kd(e);return vt(n,t.length)},u:function(e,t){const n=e.getFullYear();return vt(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return vt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return vt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return vn.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return vt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const s=Nd(e,i);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):vt(s,t.length)},I:function(e,t,n){const i=Ld(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):vt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):vn.d(e,t)},D:function(e,t,n){const i=sx(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):vt(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return vt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return vt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return vt(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let s;switch(i===12?s=_i.noon:i===0?s=_i.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let s;switch(i>=17?s=_i.evening:i>=12?s=_i.afternoon:i>=4?s=_i.morning:s=_i.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return vn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):vn.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):vt(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):vt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):vn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):vn.s(e,t)},S:function(e,t){return vn.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return zd(i);case"XXXX":case"XX":return jn(i);default:return jn(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return zd(i);case"xxxx":case"xx":return jn(i);default:return jn(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Bd(i,":");default:return"GMT"+jn(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Bd(i,":");default:return"GMT"+jn(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return vt(i,t.length)},T:function(e,t,n){return vt(+e,t.length)}};function Bd(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.trunc(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+vt(o,2)}function zd(e,t){return e%60===0?(e>0?"-":"+")+vt(Math.abs(e)/60,2):jn(e,t)}function jn(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=vt(Math.trunc(i/60),2),o=vt(i%60,2);return n+s+t+o}const Ud=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Hd=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},xa={p:Hd,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return Ud(e,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Ud(i,t)).replace("{{time}}",Hd(s,t))}},rx=/^D+$/,ax=/^Y+$/,lx=["D","DD","YY","YYYY"];function Vd(e){return rx.test(e)}function Wd(e){return ax.test(e)}function wa(e,t,n){const i=cx(e,t,n);if(console.warn(i),lx.includes(e))throw new RangeError(i)}function cx(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ux=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,hx=/^'([^]*?)'?$/,fx=/''/g,mx=/[a-zA-Z]/;function Ao(e,t,n){const i=$n(),s=n?.locale??i.locale??Id,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=ut(e,n?.in);if(!ga(a))throw new RangeError("Invalid time value");let l=t.match(dx).map(u=>{const h=u[0];if(h==="p"||h==="P"){const f=xa[h];return f(u,s.formatLong)}return u}).join("").match(ux).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const h=u[0];if(h==="'")return{isToken:!1,value:px(u)};if(Fd[h])return{isToken:!0,value:u};if(h.match(mx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:u}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:r,locale:s};return l.map(u=>{if(!u.isToken)return u.value;const h=u.value;(!n?.useAdditionalWeekYearTokens&&Wd(h)||!n?.useAdditionalDayOfYearTokens&&Vd(h))&&wa(h,t,String(e));const f=Fd[h[0]];return f(a,h,s.localize,c)}).join("")}function px(e){const t=e.match(hx);return t?t[1].replace(fx,"'"):e}function $d(){return Object.assign({},$n())}function gx(e,t){const n=ut(e,t?.in).getDay();return n===0?7:n}function yx(e,t){const n=bx(t)?new t(0):It(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function bx(e){return typeof e=="function"&&e.prototype?.constructor===e}const _x=10;class Yd{subPriority=0;validate(t,n){return!0}}class xx extends Yd{constructor(t,n,i,s,o){super(),this.value=t,this.validateValue=n,this.setValue=i,this.priority=s,o&&(this.subPriority=o)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,i){return this.setValue(t,n,this.value,i)}}class wx extends Yd{priority=_x;subPriority=-1;constructor(t,n){super(),this.context=t||(i=>It(n,i))}set(t,n){return n.timestampIsSet?t:It(t,yx(t,this.context))}}class _t{run(t,n,i,s){const o=this.parse(t,n,i,s);return o?{setter:new xx(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,n,i){return!0}}class Sx extends _t{priority=140;parse(t,n,i){switch(n){case"G":case"GG":case"GGG":return i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"});case"GGGGG":return i.era(t,{width:"narrow"});default:return i.era(t,{width:"wide"})||i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"})}}set(t,n,i){return n.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const zt={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}/},We={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 Ut(e,t){return e&&{value:t(e.value),rest:e.rest}}function Rt(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function $e(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const i=n[1]==="+"?1:-1,s=n[2]?parseInt(n[2],10):0,o=n[3]?parseInt(n[3],10):0,r=n[5]?parseInt(n[5],10):0;return{value:i*(s*yi+o*ms+r*t_),rest:t.slice(n[0].length)}}function jd(e){return Rt(zt.anyDigitsSigned,e)}function Lt(e,t){switch(e){case 1:return Rt(zt.singleDigit,t);case 2:return Rt(zt.twoDigits,t);case 3:return Rt(zt.threeDigits,t);case 4:return Rt(zt.fourDigits,t);default:return Rt(new RegExp("^\\d{1,"+e+"}"),t)}}function Po(e,t){switch(e){case 1:return Rt(zt.singleDigitSigned,t);case 2:return Rt(zt.twoDigitsSigned,t);case 3:return Rt(zt.threeDigitsSigned,t);case 4:return Rt(zt.fourDigitsSigned,t);default:return Rt(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Sa(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function qd(e,t){const n=t>0,i=n?t:1-t;let s;if(i<=50)s=e||100;else{const o=i+50,r=Math.trunc(o/100)*100,a=e>=o%100;s=e+r-(a?100:0)}return n?s:1-s}function Gd(e){return e%400===0||e%4===0&&e%100!==0}class vx extends _t{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,n,i){const s=o=>({year:o,isTwoDigitYear:n==="yy"});switch(n){case"y":return Ut(Lt(4,t),s);case"yo":return Ut(i.ordinalNumber(t,{unit:"year"}),s);default:return Ut(Lt(n.length,t),s)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,i){const s=t.getFullYear();if(i.isTwoDigitYear){const r=qd(i.year,s);return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}const o=!("era"in n)||n.era===1?i.year:1-i.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}}class Tx extends _t{priority=130;parse(t,n,i){const s=o=>({year:o,isTwoDigitYear:n==="YY"});switch(n){case"Y":return Ut(Lt(4,t),s);case"Yo":return Ut(i.ordinalNumber(t,{unit:"year"}),s);default:return Ut(Lt(n.length,t),s)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,i,s){const o=_a(t,s);if(i.isTwoDigitYear){const a=qd(i.year,o);return t.setFullYear(a,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),Ve(t,s)}const r=!("era"in n)||n.era===1?i.year:1-i.year;return t.setFullYear(r,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),Ve(t,s)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class Mx extends _t{priority=130;parse(t,n){return Po(n==="R"?4:n.length,t)}set(t,n,i){const s=It(t,0);return s.setFullYear(i,0,4),s.setHours(0,0,0,0),bi(s)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class kx extends _t{priority=130;parse(t,n){return Po(n==="u"?4:n.length,t)}set(t,n,i){return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class Dx extends _t{priority=120;parse(t,n,i){switch(n){case"Q":case"QQ":return Lt(n.length,t);case"Qo":return i.ordinalNumber(t,{unit:"quarter"});case"QQQ":return i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(t,{width:"narrow",context:"formatting"});default:return i.quarter(t,{width:"wide",context:"formatting"})||i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class Cx extends _t{priority=120;parse(t,n,i){switch(n){case"q":case"qq":return Lt(n.length,t);case"qo":return i.ordinalNumber(t,{unit:"quarter"});case"qqq":return i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(t,{width:"narrow",context:"standalone"});default:return i.quarter(t,{width:"wide",context:"standalone"})||i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class Ox extends _t{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,n,i){const s=o=>o-1;switch(n){case"M":return Ut(Rt(zt.month,t),s);case"MM":return Ut(Lt(2,t),s);case"Mo":return Ut(i.ordinalNumber(t,{unit:"month"}),s);case"MMM":return i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(t,{width:"narrow",context:"formatting"});default:return i.month(t,{width:"wide",context:"formatting"})||i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}}class Ex extends _t{priority=110;parse(t,n,i){const s=o=>o-1;switch(n){case"L":return Ut(Rt(zt.month,t),s);case"LL":return Ut(Lt(2,t),s);case"Lo":return Ut(i.ordinalNumber(t,{unit:"month"}),s);case"LLL":return i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(t,{width:"narrow",context:"standalone"});default:return i.month(t,{width:"wide",context:"standalone"})||i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function Ax(e,t,n){const i=ut(e,n?.in),s=Nd(i,n)-t;return i.setDate(i.getDate()-s*7),ut(i,n?.in)}class Px extends _t{priority=100;parse(t,n,i){switch(n){case"w":return Rt(zt.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return Lt(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,i,s){return Ve(Ax(t,i,s),s)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function Rx(e,t,n){const i=ut(e,n?.in),s=Ld(i,n)-t;return i.setDate(i.getDate()-s*7),i}class Ix extends _t{priority=100;parse(t,n,i){switch(n){case"I":return Rt(zt.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return Lt(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,i){return bi(Rx(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const Lx=[31,28,31,30,31,30,31,31,30,31,30,31],Nx=[31,29,31,30,31,30,31,31,30,31,30,31];class Fx extends _t{priority=90;subPriority=1;parse(t,n,i){switch(n){case"d":return Rt(zt.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return Lt(n.length,t)}}validate(t,n){const i=t.getFullYear(),s=Gd(i),o=t.getMonth();return s?n>=1&&n<=Nx[o]:n>=1&&n<=Lx[o]}set(t,n,i){return t.setDate(i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class Bx extends _t{priority=90;subpriority=1;parse(t,n,i){switch(n){case"D":case"DD":return Rt(zt.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return Lt(n.length,t)}}validate(t,n){const i=t.getFullYear();return Gd(i)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,i){return t.setMonth(0,i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function va(e,t,n){const i=$n(),s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,o=ut(e,n?.in),r=o.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(r+c)%7:(l+c)%7-(r+c)%7;return Oo(o,u,n)}class zx extends _t{priority=90;parse(t,n,i){switch(n){case"E":case"EE":case"EEE":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,s){return t=va(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class Ux extends _t{priority=90;parse(t,n,i,s){const o=r=>{const a=Math.floor((r-1)/7)*7;return(r+s.weekStartsOn+6)%7+a};switch(n){case"e":case"ee":return Ut(Lt(n.length,t),o);case"eo":return Ut(i.ordinalNumber(t,{unit:"day"}),o);case"eee":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeeee":return i.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,s){return t=va(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class Hx extends _t{priority=90;parse(t,n,i,s){const o=r=>{const a=Math.floor((r-1)/7)*7;return(r+s.weekStartsOn+6)%7+a};switch(n){case"c":case"cc":return Ut(Lt(n.length,t),o);case"co":return Ut(i.ordinalNumber(t,{unit:"day"}),o);case"ccc":return i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"ccccc":return i.day(t,{width:"narrow",context:"standalone"});case"cccccc":return i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});default:return i.day(t,{width:"wide",context:"standalone"})||i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,s){return t=va(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function Vx(e,t,n){const i=ut(e,n?.in),s=gx(i,n),o=t-s;return Oo(i,o,n)}class Wx extends _t{priority=90;parse(t,n,i){const s=o=>o===0?7:o;switch(n){case"i":case"ii":return Lt(n.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return Ut(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s);case"iiiii":return Ut(i.day(t,{width:"narrow",context:"formatting"}),s);case"iiiiii":return Ut(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s);default:return Ut(i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s)}}validate(t,n){return n>=1&&n<=7}set(t,n,i){return t=Vx(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 $x extends _t{priority=80;parse(t,n,i){switch(n){case"a":case"aa":case"aaa":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(Sa(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class Yx extends _t{priority=80;parse(t,n,i){switch(n){case"b":case"bb":case"bbb":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(Sa(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class jx extends _t{priority=80;parse(t,n,i){switch(n){case"B":case"BB":case"BBB":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(Sa(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class qx extends _t{priority=70;parse(t,n,i){switch(n){case"h":return Rt(zt.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return Lt(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,i){const s=t.getHours()>=12;return s&&i<12?t.setHours(i+12,0,0,0):!s&&i===12?t.setHours(0,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class Gx extends _t{priority=70;parse(t,n,i){switch(n){case"H":return Rt(zt.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return Lt(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class Kx extends _t{priority=70;parse(t,n,i){switch(n){case"K":return Rt(zt.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return Lt(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.getHours()>=12&&i<12?t.setHours(i+12,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class Xx extends _t{priority=70;parse(t,n,i){switch(n){case"k":return Rt(zt.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return Lt(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,i){const s=i<=24?i%24:i;return t.setHours(s,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class Zx extends _t{priority=60;parse(t,n,i){switch(n){case"m":return Rt(zt.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return Lt(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]}class Qx extends _t{priority=50;parse(t,n,i){switch(n){case"s":return Rt(zt.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return Lt(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]}class Jx extends _t{priority=30;parse(t,n){const i=s=>Math.trunc(s*Math.pow(10,-n.length+3));return Ut(Lt(n.length,t),i)}set(t,n,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class tw extends _t{priority=10;parse(t,n){switch(n){case"X":return $e(We.basicOptionalMinutes,t);case"XX":return $e(We.basic,t);case"XXXX":return $e(We.basicOptionalSeconds,t);case"XXXXX":return $e(We.extendedOptionalSeconds,t);default:return $e(We.extended,t)}}set(t,n,i){return n.timestampIsSet?t:It(t,t.getTime()-Eo(t)-i)}incompatibleTokens=["t","T","x"]}class ew extends _t{priority=10;parse(t,n){switch(n){case"x":return $e(We.basicOptionalMinutes,t);case"xx":return $e(We.basic,t);case"xxxx":return $e(We.basicOptionalSeconds,t);case"xxxxx":return $e(We.extendedOptionalSeconds,t);default:return $e(We.extended,t)}}set(t,n,i){return n.timestampIsSet?t:It(t,t.getTime()-Eo(t)-i)}incompatibleTokens=["t","T","X"]}class nw extends _t{priority=40;parse(t){return jd(t)}set(t,n,i){return[It(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class iw extends _t{priority=20;parse(t){return jd(t)}set(t,n,i){return[It(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const sw={G:new Sx,y:new vx,Y:new Tx,R:new Mx,u:new kx,Q:new Dx,q:new Cx,M:new Ox,L:new Ex,w:new Px,I:new Ix,d:new Fx,D:new Bx,E:new zx,e:new Ux,c:new Hx,i:new Wx,a:new $x,b:new Yx,B:new jx,h:new qx,H:new Gx,K:new Kx,k:new Xx,m:new Zx,s:new Qx,S:new Jx,X:new tw,x:new ew,t:new nw,T:new iw},ow=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,aw=/^'([^]*?)'?$/,lw=/''/g,cw=/\S/,uw=/[a-zA-Z]/;function dw(e,t,n,i){const s=()=>It(i?.in||n,NaN),o=$d(),r=i?.locale??o.locale??Id,a=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,l=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(!t)return e?s():ut(n,i?.in);const c={firstWeekContainsDate:a,weekStartsOn:l,locale:r},u=[new wx(i?.in,n)],h=t.match(rw).map(b=>{const S=b[0];if(S in xa){const M=xa[S];return M(b,r.formatLong)}return b}).join("").match(ow),f=[];for(let b of h){!i?.useAdditionalWeekYearTokens&&Wd(b)&&wa(b,t,e),!i?.useAdditionalDayOfYearTokens&&Vd(b)&&wa(b,t,e);const S=b[0],M=sw[S];if(M){const{incompatibleTokens:E}=M;if(Array.isArray(E)){const C=f.find(A=>E.includes(A.token)||A.token===S);if(C)throw new RangeError(`The format string mustn't contain \`${C.fullToken}\` and \`${b}\` at the same time`)}else if(M.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${b}\` and any other token at the same time`);f.push({token:S,fullToken:b});const D=M.run(e,b,r.match,c);if(!D)return s();u.push(D.setter),e=D.rest}else{if(S.match(uw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");if(b==="''"?b="'":S==="'"&&(b=hw(b)),e.indexOf(b)===0)e=e.slice(b.length);else return s()}}if(e.length>0&&cw.test(e))return s();const m=u.map(b=>b.priority).sort((b,S)=>S-b).filter((b,S,M)=>M.indexOf(b)===S).map(b=>u.filter(S=>S.priority===b).sort((S,M)=>M.subPriority-S.subPriority)).map(b=>b[0]);let p=ut(n,i?.in);if(isNaN(+p))return s();const y={};for(const b of m){if(!b.validate(p,c))return s();const S=b.set(p,y,c);Array.isArray(S)?(p=S[0],Object.assign(y,S[1])):p=S}return p}function hw(e){return e.match(aw)[1].replace(lw,"'")}function fw(e,t){const n=ut(e,t?.in);return n.setMinutes(0,0,0),n}function mw(e,t){const n=ut(e,t?.in);return n.setSeconds(0,0),n}function pw(e,t){const n=ut(e,t?.in);return n.setMilliseconds(0),n}function gw(e){const t=e/yi;return Math.trunc(t)}function Kd(e,t){const n=()=>It(t?.in,NaN),i=t?.additionalDigits??2,s=xw(e);let o;if(s.date){const c=ww(s.date,i);o=Sw(c.restDateString,c.year)}if(!o||isNaN(+o))return n();const r=+o;let a=0,l;if(s.time&&(a=vw(s.time),isNaN(a)))return n();if(s.timezone){if(l=Tw(s.timezone),isNaN(l))return n()}else{const c=new Date(r+a),u=ut(0,t?.in);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return ut(r+a+l,t?.in)}const Ro={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},yw=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,bw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,_w=/^([+-])(\d{2})(?::?(\d{2}))?$/;function xw(e){const t={},n=e.split(Ro.dateTimeDelimiter);let i;if(n.length>2)return t;if(/:/.test(n[0])?i=n[0]:(t.date=n[0],i=n[1],Ro.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Ro.timeZoneDelimiter)[0],i=e.substr(t.date.length,e.length))),i){const s=Ro.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function ww(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:o===null?s:o*100,restDateString:e.slice((i[1]||i[2]).length)}}function Sw(e,t){if(t===null)return new Date(NaN);const n=e.match(yw);if(!n)return new Date(NaN);const i=!!n[4],s=_s(n[1]),o=_s(n[2])-1,r=_s(n[3]),a=_s(n[4]),l=_s(n[5])-1;if(i)return Ow(t,a,l)?Mw(t,a,l):new Date(NaN);{const c=new Date(0);return!Dw(t,o,r)||!Cw(t,s)?new Date(NaN):(c.setUTCFullYear(t,o,Math.max(s,r)),c)}}function _s(e){return e?parseInt(e):1}function vw(e){const t=e.match(bw);if(!t)return NaN;const n=Ta(t[1]),i=Ta(t[2]),s=Ta(t[3]);return Ew(n,i,s)?n*yi+i*ms+s*1e3:NaN}function Ta(e){return e&&parseFloat(e.replace(",","."))||0}function Tw(e){if(e==="Z")return 0;const t=e.match(_w);if(!t)return 0;const n=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Aw(i,s)?n*(i*yi+s*ms):NaN}function Mw(e,t,n){const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,o=(t-1)*7+n+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const kw=[31,null,31,30,31,30,31,31,30,31,30,31];function Xd(e){return e%400===0||e%4===0&&e%100!==0}function Dw(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(kw[t]||(Xd(e)?29:28))}function Cw(e,t){return t>=1&&t<=(Xd(e)?366:365)}function Ow(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function Ew(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function Aw(e,t){return t>=0&&t<=59}const Pw=1e3;var et=(e=>(e.FIFTEEN_MIN="15m",e.ONE_HOUR="1h",e.SIX_HOUR="6h",e.TWELVE_HOUR="12h",e.ONE_DAY="24h",e.SEVEN_DAY="7d",e.THIRTY_DAY="30d",e.NINETY_DAY="90d",e.ONE_HUNDRED_EIGHTY_DAY="180d",e.ONE_YEAR="365d",e.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.CURRENT_YEAR="current_year",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e.PREVIOUS_YEAR="previous_year",e))(et||{});const Rw=["in","not_in","selector"],Iw=["empty","not_empty"],Lw=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],qn=e=>e.filter(t=>t!=="time"),Zd=["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"],Qd=qn(Zd),Nw=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],Jd=[...Zd,"application","bot_info_action","bot_info_detection_reason","bot_info_ban_type","cache_status","consumer","consumer_group","country_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm","portal_api","principal"],th=qn(Jd),Fw=[...Nw,"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"],Bw=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin","principal"],eh=qn(Bw);qn(["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","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","mcp_error","mcp_method","mcp_session_id","mcp_tool_name","portal","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"]),qn(["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"]);const zw=["platform","platform_usage"],Uw=e=>zw.includes(e),Hw=[...Jd,"a2a_context_id","a2a_error","a2a_method","a2a_task_id","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],nh=qn(Hw);[...Fw];const Vw=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","region","time"],ih=qn(Vw);new Set(Qd),new Set(th),new Set(eh),new Set(nh),new Set(ih);const sh=[{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"}];sh.map(e=>e.code);const Ww=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:Rw},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:Iw}},required:["field","operator"],additionalProperties:!1}]}}),$w=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];Ww([...new Set([...th,...Qd,...eh,...nh,...$w,...ih])]);const Yw={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},jw=(e,t,n)=>{let i;const s=Yw[e];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Ma(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const qw={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Gw={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Kw={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Xw={date:Ma({formats:qw,defaultWidth:"full"}),time:Ma({formats:Gw,defaultWidth:"full"}),dateTime:Ma({formats:Kw,defaultWidth:"full"})},Zw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Qw=(e,t,n,i)=>Zw[e];function xs(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let s;if(i==="formatting"&&e.formattingValues){const r=e.defaultFormattingWidth||e.defaultWidth,a=n?.width?String(n.width):r;s=e.formattingValues[a]||e.formattingValues[r]}else{const r=e.defaultWidth,a=n?.width?String(n.width):e.defaultWidth;s=e.values[a]||e.values[r]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const Jw={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},tS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},eS={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"]},nS={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"]},iS={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},sS={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},oS=(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},rS={ordinalNumber:oS,era:xs({values:Jw,defaultWidth:"wide"}),quarter:xs({values:tS,defaultWidth:"wide",argumentCallback:e=>e-1}),month:xs({values:eS,defaultWidth:"wide"}),day:xs({values:nS,defaultWidth:"wide"}),dayPeriod:xs({values:iS,defaultWidth:"wide",formattingValues:sS,defaultFormattingWidth:"wide"})};function ws(e){return(t,n={})=>{const i=n.width,s=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const r=o[0],a=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?lS(a,h=>h.test(r)):aS(a,h=>h.test(r));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(r.length);return{value:c,rest:u}}}function aS(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function lS(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function cS(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const s=i[0],o=t.match(e.parsePattern);if(!o)return null;let r=e.valueCallback?e.valueCallback(o[0]):o[0];r=n.valueCallback?n.valueCallback(r):r;const a=t.slice(s.length);return{value:r,rest:a}}}const uS=/^(\d+)(th|st|nd|rd)?/i,dS=/\d+/i,hS={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},fS={any:[/^b/i,/^(a|c)/i]},mS={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},pS={any:[/1/i,/2/i,/3/i,/4/i]},gS={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},yS={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},bS={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},_S={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]},xS={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},wS={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}},SS={ordinalNumber:cS({matchPattern:uS,parsePattern:dS,valueCallback:e=>parseInt(e,10)}),era:ws({matchPatterns:hS,defaultMatchWidth:"wide",parsePatterns:fS,defaultParseWidth:"any"}),quarter:ws({matchPatterns:mS,defaultMatchWidth:"wide",parsePatterns:pS,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ws({matchPatterns:gS,defaultMatchWidth:"wide",parsePatterns:yS,defaultParseWidth:"any"}),day:ws({matchPatterns:bS,defaultMatchWidth:"wide",parsePatterns:_S,defaultParseWidth:"any"}),dayPeriod:ws({matchPatterns:xS,defaultMatchWidth:"any",parsePatterns:wS,defaultParseWidth:"any"})},vS={code:"en-US",formatDistance:jw,formatLong:Xw,formatRelative:Qw,localize:rS,match:SS,options:{weekStartsOn:0,firstWeekContainsDate:1}};let TS={};function Ss(){return TS}const oh=6048e5,MS=864e5,kS=60,DS=3600,rh=Symbol.for("constructDateFrom");function Oe(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&rh in e?e[rh](t):e instanceof Date?new e.constructor(t):new Date(t)}function re(e,t){return Oe(t||e,e)}function ah(e){const t=re(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function CS(e,...t){const n=Oe.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function xi(e,t){const n=re(e,t?.in);return n.setHours(0,0,0,0),n}function OS(e,t,n){const[i,s]=CS(n?.in,e,t),o=xi(i),r=xi(s),a=+o-ah(o),l=+r-ah(r);return Math.round((a-l)/MS)}function ES(e,t){const n=re(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function AS(e,t){const n=re(e,t?.in);return OS(n,ES(n))+1}function en(e,t){const n=Ss(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=re(e,t?.in),o=s.getDay(),r=(o<i?7:0)+o-i;return s.setDate(s.getDate()-r),s.setHours(0,0,0,0),s}function Io(e,t){return en(e,{...t,weekStartsOn:1})}function lh(e,t){const n=re(e,t?.in),i=n.getFullYear(),s=Oe(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=Io(s),r=Oe(n,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const a=Io(r);return n.getTime()>=o.getTime()?i+1:n.getTime()>=a.getTime()?i:i-1}function PS(e,t){const n=lh(e,t),i=Oe(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Io(i)}function RS(e,t){const n=re(e,t?.in),i=+Io(n)-+PS(n);return Math.round(i/oh)+1}function ch(e,t){const n=re(e,t?.in),i=n.getFullYear(),s=Ss(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,r=Oe(t?.in||e,0);r.setFullYear(i+1,0,o),r.setHours(0,0,0,0);const a=en(r,t),l=Oe(t?.in||e,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const c=en(l,t);return+n>=+a?i+1:+n>=+c?i:i-1}function IS(e,t){const n=Ss(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=ch(e,t),o=Oe(t?.in||e,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),en(o,t)}function LS(e,t){const n=re(e,t?.in),i=+en(n,t)-+IS(n,t);return Math.round(i/oh)+1}function Tt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const Tn={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return Tt(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Tt(n+1,2)},d(e,t){return Tt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Tt(e.getHours()%12||12,t.length)},H(e,t){return Tt(e.getHours(),t.length)},m(e,t){return Tt(e.getMinutes(),t.length)},s(e,t){return Tt(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return Tt(s,t.length)}},wi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},uh={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return Tn.y(e,t)},Y:function(e,t,n,i){const s=ch(e,i),o=s>0?s:1-s;if(t==="YY"){const r=o%100;return Tt(r,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Tt(o,t.length)},R:function(e,t){const n=lh(e);return Tt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Tt(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Tt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Tt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return Tn.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return Tt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const s=LS(e,i);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):Tt(s,t.length)},I:function(e,t,n){const i=RS(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):Tt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Tn.d(e,t)},D:function(e,t,n){const i=AS(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):Tt(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Tt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Tt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Tt(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let s;switch(i===12?s=wi.noon:i===0?s=wi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let s;switch(i>=17?s=wi.evening:i>=12?s=wi.afternoon:i>=4?s=wi.morning:s=wi.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Tn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Tn.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Tn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Tn.s(e,t)},S:function(e,t){return Tn.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return hh(i);case"XXXX":case"XX":return Gn(i);default:return Gn(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return hh(i);case"xxxx":case"xx":return Gn(i);default:return Gn(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+dh(i,":");default:return"GMT"+Gn(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+dh(i,":");default:return"GMT"+Gn(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return Tt(i,t.length)},T:function(e,t,n){return Tt(+e,t.length)}};function dh(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.trunc(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+Tt(o,2)}function hh(e,t){return e%60===0?(e>0?"-":"+")+Tt(Math.abs(e)/60,2):Gn(e,t)}function Gn(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Tt(Math.trunc(i/60),2),o=Tt(i%60,2);return n+s+t+o}const fh=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},mh=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},NS=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return fh(e,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",fh(i,t)).replace("{{time}}",mh(s,t))},FS={p:mh,P:NS},BS=/^D+$/,zS=/^Y+$/,US=["D","DD","YY","YYYY"];function HS(e){return BS.test(e)}function VS(e){return zS.test(e)}function WS(e,t,n){const i=$S(e,t,n);if(console.warn(i),US.includes(e))throw new RangeError(i)}function $S(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function YS(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function jS(e){return!(!YS(e)&&typeof e!="number"||isNaN(+re(e)))}const qS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,GS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,KS=/^'([^]*?)'?$/,XS=/''/g,ZS=/[a-zA-Z]/;function QS(e,t,n){const i=Ss(),s=n?.locale??i.locale??vS,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=re(e,n?.in);if(!jS(a))throw new RangeError("Invalid time value");let l=t.match(GS).map(u=>{const h=u[0];if(h==="p"||h==="P"){const f=FS[h];return f(u,s.formatLong)}return u}).join("").match(qS).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const h=u[0];if(h==="'")return{isToken:!1,value:JS(u)};if(uh[h])return{isToken:!0,value:u};if(h.match(ZS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:u}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:r,locale:s};return l.map(u=>{if(!u.isToken)return u.value;const h=u.value;(!n?.useAdditionalWeekYearTokens&&VS(h)||!n?.useAdditionalDayOfYearTokens&&HS(h))&&WS(h,t,String(e));const f=uh[h[0]];return f(a,h,s.localize,c)}).join("")}function JS(e){const t=e.match(KS);return t?t[1].replace(XS,"'"):e}function Lo(e,t,n){const i=re(e,n?.in);return isNaN(t)?Oe(e,NaN):(i.setDate(i.getDate()+t),i)}function ph(e,t,n){const i=re(e,n?.in);if(isNaN(t))return Oe(e,NaN);if(!t)return i;const s=i.getDate(),o=Oe(e,i.getTime());o.setMonth(i.getMonth()+t+1,0);const r=o.getDate();return s>=r?o:(i.setFullYear(o.getFullYear(),o.getMonth(),s),i)}function tv(e,t,n){return ph(e,t*3,n)}function Si(e,t){const n=re(e,t?.in),i=n.getMonth(),s=i-i%3;return n.setMonth(s,1),n.setHours(0,0,0,0),n}function vi(e,t){const n=re(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function ev(e,t){const n=re(e,t?.in),i=n.getFullYear(),s=n.getMonth(),o=Oe(n,0);return o.setFullYear(i,s+1,0),o.setHours(0,0,0,0),o.getDate()}function nv(){return Object.assign({},Ss())}function gh(e){return Math.trunc(e*DS)}function iv(e){const t=e/kS;return Math.trunc(t)}function yh(e,t,n){return ph(e,-1,n)}function bh(e,t,n){return tv(e,-1,n)}function _h(e,t,n){const i=nv(),s=rv(e,n.timeZone,n.locale??i.locale);return"formatToParts"in s?sv(s,t):ov(s,t)}function sv(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function ov(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function rv(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function av(e,t){const n=hv(t);return"formatToParts"in n?cv(n,e):uv(n,e)}const lv={year:0,month:1,day:2,hour:3,minute:4,second:5};function cv(e,t){try{const n=e.formatToParts(t),i=[];for(let s=0;s<n.length;s++){const o=lv[n[s].type];o!==void 0&&(i[o]=parseInt(n[s].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function uv(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const ka={},xh=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),dv=xh==="06/25/2014, 00:00:00"||xh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function hv(e){return ka[e]||(ka[e]=dv?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),ka[e]}function Da(e,t,n,i,s,o,r){const a=new Date(0);return a.setUTCFullYear(e,t,n),a.setUTCHours(i,s,o,r),a}const wh=36e5,fv=6e4,Ca={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function vs(e,t,n){if(!e)return 0;let i=Ca.timezoneZ.exec(e);if(i)return 0;let s,o;if(i=Ca.timezoneHH.exec(e),i)return s=parseInt(i[1],10),Sh(s)?-(s*wh):NaN;if(i=Ca.timezoneHHMM.exec(e),i){s=parseInt(i[2],10);const r=parseInt(i[3],10);return Sh(s,r)?(o=Math.abs(s)*wh+r*fv,i[1]==="+"?-o:o):NaN}if(gv(e)){t=new Date(t||Date.now());const r=n?t:mv(t),a=Oa(r,e);return-(n?a:pv(t,a,e))}return NaN}function mv(e){return Da(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Oa(e,t){const n=av(e,t),i=Da(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let s=e.getTime();const o=s%1e3;return s-=o>=0?o:1e3+o,i-s}function pv(e,t,n){let i=e.getTime()-t;const s=Oa(new Date(i),n);if(t===s)return t;i-=s-t;const o=Oa(new Date(i),n);return s===o?s:Math.max(s,o)}function Sh(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const vh={};function gv(e){if(vh[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),vh[e]=!0,!0}catch{return!1}}const yv=60*1e3,bv={X:function(e,t,n){const i=Ea(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return Th(i);case"XXXX":case"XX":return Ti(i);default:return Ti(i,":")}},x:function(e,t,n){const i=Ea(n.timeZone,e);switch(t){case"x":return Th(i);case"xxxx":case"xx":return Ti(i);default:return Ti(i,":")}},O:function(e,t,n){const i=Ea(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+_v(i,":");default:return"GMT"+Ti(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return _h("short",e,n);default:return _h("long",e,n)}}};function Ea(e,t){const n=e?vs(e,t,!0)/yv:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function No(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function Ti(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=No(Math.floor(i/60),2),o=No(Math.floor(i%60),2);return n+s+t+o}function Th(e,t){return e%60===0?(e>0?"-":"+")+No(Math.abs(e)/60,2):Ti(e,t)}function _v(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.floor(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+No(o,2)}function Mh(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const kh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Aa=36e5,Dh=6e4,xv=2,ce={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:kh};function Fo(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?xv:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=wv(e),{year:s,restDateString:o}=Sv(i.date,n),r=vv(o,s);if(r===null||isNaN(r.getTime()))return new Date(NaN);if(r){const a=r.getTime();let l=0,c;if(i.time&&(l=Tv(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=vs(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=Mh(new Date(a+l)),c=Mh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function wv(e){const t={};let n=ce.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=ce.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const s=ce.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Sv(e,t){if(e){const n=ce.YYY[t],i=ce.YYYYY[t];let s=ce.YYYY.exec(e)||i.exec(e);if(s){const o=s[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(s=ce.YY.exec(e)||n.exec(e),s){const o=s[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function vv(e,t){if(t===null)return null;let n,i,s;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let o=ce.MM.exec(e);if(o)return n=new Date(0),i=parseInt(o[1],10)-1,Eh(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(o=ce.DDD.exec(e),o){n=new Date(0);const r=parseInt(o[1],10);return Dv(t,r)?(n.setUTCFullYear(t,0,r),n):new Date(NaN)}if(o=ce.MMDD.exec(e),o){n=new Date(0),i=parseInt(o[1],10)-1;const r=parseInt(o[2],10);return Eh(t,i,r)?(n.setUTCFullYear(t,i,r),n):new Date(NaN)}if(o=ce.Www.exec(e),o)return s=parseInt(o[1],10)-1,Ah(s)?Ch(t,s):new Date(NaN);if(o=ce.WwwD.exec(e),o){s=parseInt(o[1],10)-1;const r=parseInt(o[2],10)-1;return Ah(s,r)?Ch(t,s,r):new Date(NaN)}return null}function Tv(e){let t,n,i=ce.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),Pa(t)?t%24*Aa:NaN;if(i=ce.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),Pa(t,n)?t%24*Aa+n*Dh:NaN;if(i=ce.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Pa(t,n,s)?t%24*Aa+n*Dh+s*1e3:NaN}return null}function Ch(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,o=t*7+n+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const Mv=[31,28,31,30,31,30,31,31,30,31,30,31],kv=[31,29,31,30,31,30,31,31,30,31,30,31];function Oh(e){return e%400===0||e%4===0&&e%100!==0}function Eh(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=Oh(e);if(i&&n>kv[t]||!i&&n>Mv[t])return!1}return!0}function Dv(e,t){if(t<1)return!1;const n=Oh(e);return!(n&&t>366||!n&&t>365)}function Ah(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Pa(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const Cv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Ov(e,t,n={}){t=String(t);const i=t.match(Cv);if(i){const s=Fo(n.originalDate||e,n);t=i.reduce(function(o,r){if(r[0]==="'")return o;const a=o.indexOf(r),l=o[a-1]==="'",c=o.replace(r,"'"+bv[r[0]](s,r,n)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return QS(e,t,n)}function Ph(e,t,n){e=Fo(e,n);const i=vs(t,e,!0),s=new Date(e.getTime()-i),o=new Date(0);return o.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),o.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),o}function Rh(e,t,n,i){return i={...i,timeZone:t,originalDate:e},Ov(Ph(e,t,{timeZone:i.timeZone}),n,i)}function Ev(e,t,n){if(typeof e=="string"&&!e.match(kh))return Fo(e,{...n,timeZone:t});e=Fo(e,n);const i=Da(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),s=vs(t,new Date(i));return new Date(i+s)}function Av(e,t){return-vs(e,t)}function Ih(e,t={}){const n=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)"),Rh(e,n,i)}function Pv(e,t={}){if(!e)return e;const n=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const s=new Date(e);return Rh(s,n,i)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}const Rv={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(e){return e&&Lw.find(t=>e<=Rv[t])||null}var Bo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},zo={exports:{}};zo.exports;var Lh;function Iv(){return Lh||(Lh=1,(function(e,t){var n=200,i="__lodash_hash_undefined__",s=9007199254740991,o="[object Arguments]",r="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",h="[object GeneratorFunction]",f="[object Map]",m="[object Number]",p="[object Object]",y="[object Promise]",b="[object RegExp]",S="[object Set]",M="[object String]",E="[object Symbol]",D="[object WeakMap]",C="[object ArrayBuffer]",A="[object DataView]",O="[object Float32Array]",x="[object Float64Array]",_="[object Int8Array]",v="[object Int16Array]",k="[object Int32Array]",I="[object Uint8Array]",Y="[object Uint8ClampedArray]",U="[object Uint16Array]",j="[object Uint32Array]",H=/[\\^$.*+?()[\]{}|]/g,$=/\w*$/,R=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,z={};z[o]=z[r]=z[C]=z[A]=z[a]=z[l]=z[O]=z[x]=z[_]=z[v]=z[k]=z[f]=z[m]=z[p]=z[b]=z[S]=z[M]=z[E]=z[I]=z[Y]=z[U]=z[j]=!0,z[c]=z[u]=z[D]=!1;var P=typeof Bo=="object"&&Bo&&Bo.Object===Object&&Bo,N=typeof self=="object"&&self&&self.Object===Object&&self,V=P||N||Function("return this")(),Q=t&&!t.nodeType&&t,X=Q&&!0&&e&&!e.nodeType&&e,q=X&&X.exports===Q;function G(w,L){return w.set(L[0],L[1]),w}function J(w,L){return w.add(L),w}function nt(w,L){for(var W=-1,it=w?w.length:0;++W<it&&L(w[W],W,w)!==!1;);return w}function tt(w,L){for(var W=-1,it=L.length,Ht=w.length;++W<it;)w[Ht+W]=L[W];return w}function Z(w,L,W,it){for(var Ht=-1,qt=w?w.length:0;++Ht<qt;)W=L(W,w[Ht],Ht,w);return W}function pt(w,L){for(var W=-1,it=Array(w);++W<w;)it[W]=L(W);return it}function bt(w,L){return w?.[L]}function ot(w){var L=!1;if(w!=null&&typeof w.toString!="function")try{L=!!(w+"")}catch{}return L}function gt(w){var L=-1,W=Array(w.size);return w.forEach(function(it,Ht){W[++L]=[Ht,it]}),W}function ct(w,L){return function(W){return w(L(W))}}function $t(w){var L=-1,W=Array(w.size);return w.forEach(function(it){W[++L]=it}),W}var lt=Array.prototype,Mt=Function.prototype,Yt=Object.prototype,_e=V["__core-js_shared__"],Jt=(function(){var w=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""})(),Ye=Mt.toString,Ct=Yt.hasOwnProperty,te=Yt.toString,Nt=RegExp("^"+Ye.call(Ct).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jt=q?V.Buffer:void 0,ee=V.Symbol,je=V.Uint8Array,ni=ct(Object.getPrototypeOf,Object),Le=Object.create,Ft=Yt.propertyIsEnumerable,xe=lt.splice,ii=Object.getOwnPropertySymbols,ar=jt?jt.isBuffer:void 0,lr=ct(Object.keys,Object),Us=Pn(V,"DataView"),si=Pn(V,"Map"),Hs=Pn(V,"Promise"),oi=Pn(V,"Set"),sn=Pn(V,"WeakMap"),on=Pn(Object,"create"),Vs=ae(Us),Ws=ae(si),ri=ae(Hs),xl=ae(oi),wl=ae(sn),cr=ee?ee.prototype:void 0,ur=cr?cr.valueOf:void 0;function rn(w){var L=-1,W=w?w.length:0;for(this.clear();++L<W;){var it=w[L];this.set(it[0],it[1])}}function Ii(){this.__data__=on?on(null):{}}function $s(w){return this.has(w)&&delete this.__data__[w]}function dr(w){var L=this.__data__;if(on){var W=L[w];return W===i?void 0:W}return Ct.call(L,w)?L[w]:void 0}function an(w){var L=this.__data__;return on?L[w]!==void 0:Ct.call(L,w)}function Sl(w,L){var W=this.__data__;return W[w]=on&&L===void 0?i:L,this}rn.prototype.clear=Ii,rn.prototype.delete=$s,rn.prototype.get=dr,rn.prototype.has=an,rn.prototype.set=Sl;function Ne(w){var L=-1,W=w?w.length:0;for(this.clear();++L<W;){var it=w[L];this.set(it[0],it[1])}}function vl(){this.__data__=[]}function Tl(w){var L=this.__data__,W=Ni(L,w);if(W<0)return!1;var it=L.length-1;return W==it?L.pop():xe.call(L,W,1),!0}function Ml(w){var L=this.__data__,W=Ni(L,w);return W<0?void 0:L[W][1]}function Fe(w){return Ni(this.__data__,w)>-1}function kl(w,L){var W=this.__data__,it=Ni(W,w);return it<0?W.push([w,L]):W[it][1]=L,this}Ne.prototype.clear=vl,Ne.prototype.delete=Tl,Ne.prototype.get=Ml,Ne.prototype.has=Fe,Ne.prototype.set=kl;function En(w){var L=-1,W=w?w.length:0;for(this.clear();++L<W;){var it=w[L];this.set(it[0],it[1])}}function Dl(){this.__data__={hash:new rn,map:new(si||Ne),string:new rn}}function Cl(w){return zi(this,w).delete(w)}function Ol(w){return zi(this,w).get(w)}function Be(w){return zi(this,w).has(w)}function El(w,L){return zi(this,w).set(w,L),this}En.prototype.clear=Dl,En.prototype.delete=Cl,En.prototype.get=Ol,En.prototype.has=Be,En.prototype.set=El;function An(w){this.__data__=new Ne(w)}function Al(){this.__data__=new Ne}function Pl(w){return this.__data__.delete(w)}function Rl(w){return this.__data__.get(w)}function Li(w){return this.__data__.has(w)}function Il(w,L){var W=this.__data__;if(W instanceof Ne){var it=W.__data__;if(!si||it.length<n-1)return it.push([w,L]),this;W=this.__data__=new En(it)}return W.set(w,L),this}An.prototype.clear=Al,An.prototype.delete=Pl,An.prototype.get=Rl,An.prototype.has=Li,An.prototype.set=Il;function Ll(w,L){var W=Gs(w)||Hi(w)?pt(w.length,String):[],it=W.length,Ht=!!it;for(var qt in w)Ct.call(w,qt)&&!(Ht&&(qt=="length"||Ql(qt,it)))&&W.push(qt);return W}function Pe(w,L,W){var it=w[L];(!(Ct.call(w,L)&&qs(it,W))||W===void 0&&!(L in w))&&(w[L]=W)}function Ni(w,L){for(var W=w.length;W--;)if(qs(w[W][0],L))return W;return-1}function Nl(w,L){return w&&hr(L,ai(L),w)}function Ys(w,L,W,it,Ht,qt,we){var Zt;if(it&&(Zt=qt?it(w,Ht,qt,we):it(w)),Zt!==void 0)return Zt;if(!cn(w))return w;var _r=Gs(w);if(_r){if(Zt=Xl(w),!L)return ql(w,Zt)}else{var Rn=qe(w),xr=Rn==u||Rn==h;if(gr(w))return Hl(w,L);if(Rn==p||Rn==o||xr&&!qt){if(ot(w))return qt?w:{};if(Zt=mr(xr?{}:w),!L)return Gl(w,Nl(Zt,w))}else{if(!z[Rn])return qt?w:{};Zt=Zl(w,Rn,Ys,L)}}we||(we=new An);var wr=we.get(w);if(wr)return wr;if(we.set(w,Zt),!_r)var li=W?Kl(w):ai(w);return nt(li||w,function(Xs,Vi){li&&(Vi=Xs,Xs=w[Vi]),Pe(Zt,Vi,Ys(Xs,L,W,it,Vi,w,we))}),Zt}function Fl(w){return cn(w)?Le(w):{}}function Bl(w,L,W){var it=L(w);return Gs(w)?it:tt(it,W(w))}function zl(w){return te.call(w)}function Fi(w){if(!cn(w)||Jl(w))return!1;var L=Ks(w)||ot(w)?Nt:R;return L.test(ae(w))}function Ul(w){if(!ln(w))return lr(w);var L=[];for(var W in Object(w))Ct.call(w,W)&&W!="constructor"&&L.push(W);return L}function Hl(w,L){if(L)return w.slice();var W=new w.constructor(w.length);return w.copy(W),W}function Bi(w){var L=new w.constructor(w.byteLength);return new je(L).set(new je(w)),L}function Vl(w,L){var W=L?Bi(w.buffer):w.buffer;return new w.constructor(W,w.byteOffset,w.byteLength)}function Wl(w,L,W){var it=L?W(gt(w),!0):gt(w);return Z(it,G,new w.constructor)}function js(w){var L=new w.constructor(w.source,$.exec(w));return L.lastIndex=w.lastIndex,L}function $l(w,L,W){var it=L?W($t(w),!0):$t(w);return Z(it,J,new w.constructor)}function Yl(w){return ur?Object(ur.call(w)):{}}function jl(w,L){var W=L?Bi(w.buffer):w.buffer;return new w.constructor(W,w.byteOffset,w.length)}function ql(w,L){var W=-1,it=w.length;for(L||(L=Array(it));++W<it;)L[W]=w[W];return L}function hr(w,L,W,it){W||(W={});for(var Ht=-1,qt=L.length;++Ht<qt;){var we=L[Ht],Zt=void 0;Pe(W,we,Zt===void 0?w[we]:Zt)}return W}function Gl(w,L){return hr(w,fr(w),L)}function Kl(w){return Bl(w,ai,fr)}function zi(w,L){var W=w.__data__;return Ui(L)?W[typeof L=="string"?"string":"hash"]:W.map}function Pn(w,L){var W=bt(w,L);return Fi(W)?W:void 0}var fr=ii?ct(ii,Object):yr,qe=zl;(Us&&qe(new Us(new ArrayBuffer(1)))!=A||si&&qe(new si)!=f||Hs&&qe(Hs.resolve())!=y||oi&&qe(new oi)!=S||sn&&qe(new sn)!=D)&&(qe=function(w){var L=te.call(w),W=L==p?w.constructor:void 0,it=W?ae(W):void 0;if(it)switch(it){case Vs:return A;case Ws:return f;case ri:return y;case xl:return S;case wl:return D}return L});function Xl(w){var L=w.length,W=w.constructor(L);return L&&typeof w[0]=="string"&&Ct.call(w,"index")&&(W.index=w.index,W.input=w.input),W}function mr(w){return typeof w.constructor=="function"&&!ln(w)?Fl(ni(w)):{}}function Zl(w,L,W,it){var Ht=w.constructor;switch(L){case C:return Bi(w);case a:case l:return new Ht(+w);case A:return Vl(w,it);case O:case x:case _:case v:case k:case I:case Y:case U:case j:return jl(w,it);case f:return Wl(w,it,W);case m:case M:return new Ht(w);case b:return js(w);case S:return $l(w,it,W);case E:return Yl(w)}}function Ql(w,L){return L=L??s,!!L&&(typeof w=="number"||B.test(w))&&w>-1&&w%1==0&&w<L}function Ui(w){var L=typeof w;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?w!=="__proto__":w===null}function Jl(w){return!!Jt&&Jt in w}function ln(w){var L=w&&w.constructor,W=typeof L=="function"&&L.prototype||Yt;return w===W}function ae(w){if(w!=null){try{return Ye.call(w)}catch{}try{return w+""}catch{}}return""}function tc(w){return Ys(w,!0,!0)}function qs(w,L){return w===L||w!==w&&L!==L}function Hi(w){return ec(w)&&Ct.call(w,"callee")&&(!Ft.call(w,"callee")||te.call(w)==o)}var Gs=Array.isArray;function pr(w){return w!=null&&nc(w.length)&&!Ks(w)}function ec(w){return un(w)&&pr(w)}var gr=ar||br;function Ks(w){var L=cn(w)?te.call(w):"";return L==u||L==h}function nc(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=s}function cn(w){var L=typeof w;return!!w&&(L=="object"||L=="function")}function un(w){return!!w&&typeof w=="object"}function ai(w){return pr(w)?Ll(w):Ul(w)}function yr(){return[]}function br(){return!1}e.exports=tc})(zo,zo.exports)),zo.exports}Iv();const Ee=(e,t)=>new Date(e.getTime()-Av(t,e));class Xt{timeframeText;key;display;timeframeLength;allowedTiers;defaultResponseGranularity;dataGranularity;isRelative;fineGrainedDefaultGranularity;_startCustom;_endCustom;_allowedGranularitiesOverride;constructor(t){this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const n=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&n.add("minutely"),i>=2&&i<=168&&n.add("hourly"),i>=48&&n.add("daily"),i>=672&&n.add("weekly"),n}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const n=Ev(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Ph(n,t)}}class Lv extends Xt{rawStart(t){let n=en(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=Ee(n,t)),n}maximumTimeframeLength(){return 3600*24*7}}class Nv extends Xt{rawStart(t){let n=vi(this.tzAdjustedDate(t));return t&&(n=Ee(n,t)),n}maximumTimeframeLength(){return 3600*24*31}}class Fv extends Xt{rawStart(t){let n=Si(this.tzAdjustedDate(t));return t&&(n=Ee(n,t)),n}maximumTimeframeLength(){return 3600*24*92}}class Bv extends Xt{rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=Ee(n,t)),n}maximumTimeframeLength(){return 3600*24*366}}class zv extends Xt{rawEnd(t){let n=en(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=Ee(n,t)),n}rawStart(t){const n=this.tzAdjustedDate(t);let i=en(n.setDate(n.getDate()-7),{weekStartsOn:1});return t&&(i=Ee(i,t)),i}}class Uv extends Xt{rawEnd(t){let n=Si(this.tzAdjustedDate(t));return t&&(n=Ee(n,t)),n}rawStart(t){let n=Si(bh(this.tzAdjustedDate(t)));return t&&(n=Ee(n,t)),n}}class Hv extends Xt{rawEnd(t){let n=vi(this.tzAdjustedDate(t));return t&&(n=Ee(n,t)),n}rawStart(t){let n=vi(yh(this.tzAdjustedDate(t)));return t&&(n=Ee(n,t)),n}}class Vv extends Xt{rawEnd(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=Ee(n,t)),n}rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(n=Ee(n,t)),n}}et.FIFTEEN_MIN,new Xt({key:et.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"]}),et.ONE_HOUR,new Xt({key:et.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"]}),et.SIX_HOUR,new Xt({key:et.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"]}),et.TWELVE_HOUR,new Xt({key:et.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"]}),et.ONE_DAY,new Xt({key:et.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"]}),et.SEVEN_DAY,new Xt({key:et.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"]}),et.THIRTY_DAY,new Xt({key:et.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"]}),et.NINETY_DAY,new Xt({key:et.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"]}),et.ONE_HUNDRED_EIGHTY_DAY,new Xt({key:et.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"]}),et.ONE_YEAR,new Xt({key:et.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"]}),et.CURRENT_WEEK,new Lv({key:et.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=en(new Date,{weekStartsOn:1});return(xi(Lo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),et.CURRENT_MONTH,new Nv({key:et.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=vi(new Date);return(xi(Lo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),et.CURRENT_QUARTER,new Fv({key:et.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=Si(new Date);return(xi(Lo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),et.CURRENT_YEAR,new Bv({key:et.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1);return(xi(Lo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),et.PREVIOUS_WEEK,new zv({key:et.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"]}),et.PREVIOUS_MONTH,new Hv({key:et.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=vi(new Date),n=vi(yh(new Date));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=Nh(t,n)),3600*24*ev(new Date().setMonth(new Date().getMonth()-1))+gh(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),et.PREVIOUS_QUARTER,new Uv({key:et.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=Si(new Date),t=Si(bh(new Date));return(e.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),et.PREVIOUS_YEAR,new Vv({key:et.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let n=0;return e.getTimezoneOffset()!==t.getTimezoneOffset()&&(n=Nh(e,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+gh(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Nh(e,t){return iv(e.getTimezoneOffset()-t.getTimezoneOffset())}et.FIFTEEN_MIN,et.ONE_HOUR,et.SIX_HOUR,et.TWELVE_HOUR,et.ONE_DAY,et.SEVEN_DAY,et.FIFTEEN_MIN,et.ONE_HOUR,et.SIX_HOUR,et.TWELVE_HOUR,et.ONE_DAY,et.SEVEN_DAY,et.THIRTY_DAY,et.NINETY_DAY,et.ONE_HUNDRED_EIGHTY_DAY,et.ONE_YEAR,et.CURRENT_WEEK,et.CURRENT_MONTH,et.CURRENT_QUARTER,et.CURRENT_YEAR,et.PREVIOUS_WEEK,et.PREVIOUS_MONTH,et.PREVIOUS_QUARTER,et.PREVIOUS_YEAR;const Wv=new Map(sh.map(e=>[e.code,{code:e.code,name:e.name}])),Ia=e=>Wv.get(e)?.name||e,Fh=1e3,$v=1e4,Bh=1e6,zh=1e9,Uh=1e12,Uo=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(e).toString().split("").reverse().forEach((s,o)=>{o&&o%3===0&&i.push(n),i.push(s)}),i.reverse().join("")},Ts=(e,t,n)=>{const i=e/t,s=n.round?"round":"floor";if(n.decimal===!1)return Math[s](i).toString();let o;n.precision?o=i:o=i<10?Math[s](i*10)/10:Math[s](i);let r=o.toString();return typeof n.decimal=="string"&&(r=r.replace(".",n.decimal)),r};function Ho(e,t={}){let n;const i=e<0;i&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const s=t.min10k?$v:Fh;return e<s||t.precision&&t.precision>Math.log10(e)?n=Uo(Ts(e,1,t),t):e<Bh?n=`${Ts(e,Fh,t)}k`:e<zh?n=`${Ts(e,Bh,t)}m`:e<Uh?n=`${Uo(Ts(e,zh,t),t)}b`:n=`${Uo(Ts(e,Uh,t),t)}t`,i&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}Ho.addCommas=Uo;const Yv=typeof document<"u"&&document.documentElement?.lang||"en-US",Vo=new Intl.NumberFormat(Yv);function Kn({i18n:e}){const t=(i,s)=>{if(isNaN(i))return"0 B";const o=s?Math.pow(2,50):1e15,r=s?Math.pow(2,40):1e12,a=s?Math.pow(2,30):1e9,l=s?Math.pow(2,20):1e6,c=s?Math.pow(2,10):1e3;let u;return i>=o?u=e.formatNumber(Number.parseFloat((i/o).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=r?u=e.formatNumber(Number.parseFloat((i/r).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=a?u=e.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=l?u=e.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=c?u=e.formatNumber(Number.parseFloat((i/c).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):u=e.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),u.replace(/([a-zA-Z]*)$/," $1")},n=(i,s="USD")=>isNaN(i)?s==="USD"?"$0.00":`${i}`:i>=.01||s!=="USD"?e.formatNumber(i,{style:"currency",currency:s}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,s,{isBytes1024:o=!1,currency:r="USD",approximate:a=!1,translateUnit:l=c=>c}={})=>{const c=l(s,i);switch(s){case"bytes":return t(i,o);case"usd":return n(i,r);default:return isNaN(i)?`${i}`:a?`${Ho(i,{capital:!0})} ${c}`:i>=.01?`${Vo.format(Number.parseFloat(i.toFixed(2)))} ${c}`:`${Number.parseFloat(i.toPrecision(4))} ${c}`}},formatBytes:t,formatCost:n,formatRange:(i,s,o,{isBytes1024:r=!1,currency:a="USD",approximate:l=!1,translateUnit:c=u=>u}={})=>{const u=c(o,s);switch(o){case"bytes":return`${t(i,r)} - ${t(s,r)}`;case"usd":return`${n(i,a)} - ${n(s,a)}`;default:if(isNaN(i)||isNaN(s))return`${i} - ${s}`;if(l)return`${Ho(i,{capital:!0})} - ${Ho(s,{capital:!0})} ${u}`}const h=i>=.01?`${Vo.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,f=s>=.01?`${Vo.format(Number.parseFloat(s.toFixed(2)))}`:`${Number.parseFloat(s.toPrecision(4))}`;return`${h} - ${f} ${u}`}}}const Wo=e=>["interactive","zoom-interactive"].includes(e),Hh=(e,t,n,i)=>{const{tooltip:s}=t;if(s.opacity===0&&!Wo(e.interactionMode)){e.showTooltip=!1;return}const{i18n:o}=mt.useI18n(),{formatUnit:r}=Kn({i18n:o}),a=e.chartTooltipSortFn||((l,c)=>c.rawValue-l.rawValue);if(s.body&&!Wo(e.interactionMode)){const l=s.labelColors,c=t.chart.config?.options?.indexAxis==="y"?"x":"y",u=s.dataPoints[0].parsed.x??0;e.tooltipContext=i?.contextFormatter?i.contextFormatter(u,n):Ds({tickValue:new Date(u),granularity:n}),e.tooltipSeries=s.dataPoints.map((h,f)=>{const m=h.parsed[c],p=r(m??0,e.units,{translateUnit:e.translateUnit}),y=h.dataset.label;return{backgroundColor:l[f].backgroundColor,borderColor:l[f].borderColor,label:y,value:p,rawValue:m,isSegmentEmpty:h.dataset.isSegmentEmpty}}).sort(a),e.left=`${s.x}px`,e.top=`${s.y}px`,e.showTooltip=!0}},Vh=(e,t)=>{const{tooltip:n}=t,{i18n:i}=mt.useI18n(),{formatUnit:s}=Kn({i18n:i});if(n.opacity===0&&!Wo(e.interactionMode)){e.showTooltip=!1;return}const o=e.chartTooltipSortFn||((r,a)=>a.rawValue-r.rawValue);if(n.body&&!Wo(e.interactionMode)){const r=n.labelColors,a=t.chart.config?.options?.indexAxis==="y"?"x":"y",l=["gauge","donut"].includes(e.chartType);l?e.tooltipContext=e.dimensionDisplay||n.dataPoints[0].label:n.chart.data.isMultiDimension?e.tooltipContext=n.dataPoints[0].label:e.tooltipContext=e.dimensionDisplay||"",e.tooltipSeries=n.dataPoints.map((c,u)=>{const h=l?c.parsed:c.parsed[a],f=s(h??0,e.units,{translateUnit:e.translateUnit});let m;return l?m=c.dataset.labels[c.dataIndex]:m=c.dataset.label,{backgroundColor:r[u].backgroundColor,borderColor:r[u].borderColor,label:m,value:f,rawValue:h,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(o),e.left=`${n.x}px`,e.top=`${n.y}px`,e.showTooltip=!0}},jv=e=>e&&e.datasets&&e.datasets.length,qv=e=>jv(e)&&e.datasets.some(t=>t.data.length),Gv=e=>e.datasets.some(t=>t.data[0]&&ga(t.data[0].x)),Kv=e=>!!qv(e)&&e.datasets.some(t=>t.data.length==1),Xv=e=>Gv(e)&&e.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),La=(e,t,n)=>{const s=Math.min(t/1150,1),o=.15,r=1.15,a=e.x??0;return a<n?a+t*o*(1-s):a-t*r*(1-s)},Zv=(e,t,n)=>{const o=e.y??0;return o<n?o+t*.15:o-t*.5};function Wh(e,t){let n;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>{e(...i)},t)}}const $h=(e,t,n)=>{const i=e.data;return e.options.plugins.legend.labels.generateLabels(e).filter(s=>!t?.[s.text]?.isThreshold).map(((s,o)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[o].isSegmentEmpty}))).sort(n)},Qv=2,Yh=10,jh=12,$o=10,Jv="#f1f0ff",tT="#e0e4ea",qh="#6c7489",eT="#afb7c5",nT="#d60027",iT="#ad000e",Na="#6c7489",Gh="#52596e",sT="#007d60",oT="#995c00",rT="#ffc400",aT="'Inter', Roboto, Helvetica, sans-serif",Ms="16px",lT="20px",cT="#bee2ff",uT="#8fc1ff",dT="#5f9aff",hT="#306fff",fT="#b5ffee",mT="#00fabe",pT="#00d6a4",gT="#00a17b",yT="#007d60",bT="#005944",_T="#b5ffee",xT="#00fabe",wT="#b5ffee",ST="#00a17b",vT="#fff296",TT="#ffe04b",MT="#ffc400",kT="#b37600",DT="#995c00",CT="#804400",OT="#fff296",ET="#ffe04b",AT="#ffc2b3",PT="#ff9877",RT="#ff723c",IT="#f75008",LT="#d13500",NT="#a31f00",FT="#ffc2b3",BT="#ff9877",zT="#ff723c",UT="#f75008",HT="#d13500",VT="#a31f00",WT="#ffc2b3",$T="#ff9877",YT="#ff723c",jT="#f75008",qT="#d13500",GT="#a31f00",KT="#ffc2b3",XT="#ff9877",ZT="#ff723c",QT="#f75008",JT="#d13500",t1="#a31f00",e1="#ffc2b3",n1="#ff9877",i1="#ff723c",s1="#f75008",o1="#d13500",r1="#ffabab",a1="#ff7272",l1="#ff3954",c1="#f50045",u1="#d60027",d1="#ad000e",h1="#ffabab",f1="#ff7272",m1="#ff3954",p1="#f50045",g1="#d60027",y1="#eefaff",b1="#ecfffb",_1="#fffce0",x1="#fff1ef",w1="#ffe5e5",S1="#5f9aff",v1="#00d6a4",T1="#ffc400",M1="#ff723c",k1="#ff3954",Mn=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Fa=(e,t)=>(t||Mn)[e%Mn.length],D1="#6f7787",C1={100:{background:"#f0f5fd",text:"#10599e"},200:{background:"#e5f7f4",text:"#1b6955"},300:{background:"#fff1d5",text:"#a06027"},400:{background:"#fee3b6",text:"#944d19"},500:{background:"#fedada",text:"#852021"}},O1=e=>{const t=Math.floor(parseInt(e,10)/100)*100;return C1[t]?.background||"#fafafa"},E1=eT,Kh=(e,t,n,i)=>{let s;return n?s=E1:Array.isArray(i)?s=Fa(e,i):s=i[t],s||Fa(e)},Ba=e=>{switch(e){case"error":return nT;case"warning":return rT;case"neutral":return qh;default:return qh}},A1={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},P1=2,R1=0,za=new Map,Xh=(e,t)=>{const{i18n:n}=mt.useI18n(),{formatBytes:i}=Kn({i18n:n});return t==="bytes"?i(e):t==="count/minute"?e.toFixed(2):Vo.format(e)},I1=e=>{const n=document.createElement("canvas").getContext("2d"),i=Pt({});return n.font=i.string,n.measureText(e).width},L1=()=>{const e="label_height";if(!za.has(e)){const t=Pt({});za.set(e,t.lineHeight)}return za.get(e)},N1=(e,t)=>t.datasets.reduce((n,i,s)=>e.isDatasetVisible(s)?n+i.data.reduce((o,r)=>isNaN(r)?o:o+r,0):n,0),F1=(e,t)=>t===0?" (0.0%)":` (${(e/t*100).toFixed(1)}%)`,B1=tT,z1={100:cT,101:uT,102:dT,103:hT,200:fT,201:mT,202:pT,203:gT,204:yT,205:bT,206:_T,207:xT,208:wT,226:ST,300:vT,301:TT,302:MT,303:kT,304:DT,305:CT,307:OT,308:ET,400:AT,401:PT,402:RT,403:IT,404:LT,405:NT,406:FT,407:BT,408:zT,409:UT,410:HT,411:VT,412:WT,413:$T,414:YT,415:jT,416:qT,417:GT,418:KT,421:XT,422:ZT,423:QT,424:JT,425:t1,426:e1,428:n1,429:i1,431:s1,451:o1,500:r1,501:a1,502:l1,503:c1,504:u1,505:d1,506:h1,507:f1,508:m1,510:p1,511:g1},U1={100:y1,200:b1,300:_1,400:x1,500:w1},H1={"1XX":S1,"2XX":v1,"3XX":T1,"4XX":M1,"5XX":k1},Zh=e=>{const t=parseInt(e,10),n=Math.floor(t/100)*100;return z1[t]??U1[n]??B1},Ua={...Array.from({length:500},(e,t)=>100+t).reduce((e,t)=>(e[`${t}`]=Zh(`${t}`),e),{}),____OTHER____:Jv,...H1};function Qh(e,t,n){const i=$d(),s=$1(e,n.timeZone,n.locale??i.locale);return"formatToParts"in s?V1(s,t):W1(s,t)}function V1(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function W1(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function $1(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function Y1(e,t){const n=X1(t);return"formatToParts"in n?q1(n,e):G1(n,e)}const j1={year:0,month:1,day:2,hour:3,minute:4,second:5};function q1(e,t){try{const n=e.formatToParts(t),i=[];for(let s=0;s<n.length;s++){const o=j1[n[s].type];o!==void 0&&(i[o]=parseInt(n[s].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function G1(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Ha={},Jh=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")),K1=Jh==="06/25/2014, 00:00:00"||Jh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function X1(e){return Ha[e]||(Ha[e]=K1?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Ha[e]}function tf(e,t,n,i,s,o,r){const a=new Date(0);return a.setUTCFullYear(e,t,n),a.setUTCHours(i,s,o,r),a}const ef=36e5,Z1=6e4,Va={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Wa(e,t,n){if(!e)return 0;let i=Va.timezoneZ.exec(e);if(i)return 0;let s,o;if(i=Va.timezoneHH.exec(e),i)return s=parseInt(i[1],10),nf(s)?-(s*ef):NaN;if(i=Va.timezoneHHMM.exec(e),i){s=parseInt(i[2],10);const r=parseInt(i[3],10);return nf(s,r)?(o=Math.abs(s)*ef+r*Z1,i[1]==="+"?-o:o):NaN}if(tM(e)){t=new Date(t||Date.now());const r=n?t:Q1(t),a=$a(r,e);return-(n?a:J1(t,a,e))}return NaN}function Q1(e){return tf(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function $a(e,t){const n=Y1(e,t),i=tf(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let s=e.getTime();const o=s%1e3;return s-=o>=0?o:1e3+o,i-s}function J1(e,t,n){let s=e.getTime()-t;const o=$a(new Date(s),n);if(t===o)return t;s-=o-t;const r=$a(new Date(s),n);return o===r?o:Math.max(o,r)}function nf(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const sf={};function tM(e){if(sf[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),sf[e]=!0,!0}catch{return!1}}const eM=60*1e3,nM={X:function(e,t,n){const i=Ya(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return of(i);case"XXXX":case"XX":return Mi(i);default:return Mi(i,":")}},x:function(e,t,n){const i=Ya(n.timeZone,e);switch(t){case"x":return of(i);case"xxxx":case"xx":return Mi(i);default:return Mi(i,":")}},O:function(e,t,n){const i=Ya(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+iM(i,":");default:return"GMT"+Mi(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Qh("short",e,n);default:return Qh("long",e,n)}}};function Ya(e,t){const n=e?Wa(e,t,!0)/eM:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Yo(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function Mi(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Yo(Math.floor(i/60),2),o=Yo(Math.floor(i%60),2);return n+s+t+o}function of(e,t){return e%60===0?(e>0?"-":"+")+Yo(Math.abs(e)/60,2):Mi(e,t)}function iM(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.floor(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+Yo(o,2)}function rf(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const sM=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,ja=36e5,af=6e4,oM=2,ue={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:sM};function lf(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?oM:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=rM(e),{year:s,restDateString:o}=aM(i.date,n),r=lM(o,s);if(r===null||isNaN(r.getTime()))return new Date(NaN);if(r){const a=r.getTime();let l=0,c;if(i.time&&(l=cM(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Wa(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=rf(new Date(a+l)),c=rf(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function rM(e){const t={};let n=ue.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=ue.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const s=ue.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function aM(e,t){if(e){const n=ue.YYY[t],i=ue.YYYYY[t];let s=ue.YYYY.exec(e)||i.exec(e);if(s){const o=s[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(s=ue.YY.exec(e)||n.exec(e),s){const o=s[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function lM(e,t){if(t===null)return null;let n,i,s;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let o=ue.MM.exec(e);if(o)return n=new Date(0),i=parseInt(o[1],10)-1,df(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(o=ue.DDD.exec(e),o){n=new Date(0);const r=parseInt(o[1],10);return hM(t,r)?(n.setUTCFullYear(t,0,r),n):new Date(NaN)}if(o=ue.MMDD.exec(e),o){n=new Date(0),i=parseInt(o[1],10)-1;const r=parseInt(o[2],10);return df(t,i,r)?(n.setUTCFullYear(t,i,r),n):new Date(NaN)}if(o=ue.Www.exec(e),o)return s=parseInt(o[1],10)-1,hf(s)?cf(t,s):new Date(NaN);if(o=ue.WwwD.exec(e),o){s=parseInt(o[1],10)-1;const r=parseInt(o[2],10)-1;return hf(s,r)?cf(t,s,r):new Date(NaN)}return null}function cM(e){let t,n,i=ue.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),qa(t)?t%24*ja:NaN;if(i=ue.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),qa(t,n)?t%24*ja+n*af:NaN;if(i=ue.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return qa(t,n,s)?t%24*ja+n*af+s*1e3:NaN}return null}function cf(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,o=t*7+n+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const uM=[31,28,31,30,31,30,31,31,30,31,30,31],dM=[31,29,31,30,31,30,31,31,30,31,30,31];function uf(e){return e%400===0||e%4===0&&e%100!==0}function df(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=uf(e);if(i&&n>dM[t]||!i&&n>uM[t])return!1}return!0}function hM(e,t){if(t<1)return!1;const n=uf(e);return!(n&&t>366||!n&&t>365)}function hf(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function qa(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const fM=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Ga(e,t,n={}){t=String(t);const i=t.match(fM);if(i){const s=lf(n.originalDate||e,n);t=i.reduce(function(o,r){if(r[0]==="'")return o;const a=o.indexOf(r),l=o[a-1]==="'",c=o.replace(r,"'"+nM[r[0]](s,r,n)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return Ao(e,t,n)}function mM(e,t,n){e=lf(e,n);const i=Wa(t,e,!0),s=new Date(e.getTime()-i),o=new Date(0);return o.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),o.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),o}function ks(e,t,n,i){return i={...i,timeZone:t,originalDate:e},Ga(mM(e,t,{timeZone:i.timeZone}),n,i)}const pM=(e,t)=>`${ks(e,t,"yyyy")} W${ks(e,t,"II")}`,Ka="yyyy-MM-dd h:mm:ss a",Xa="h:mm:ss a",Xn="yyyy-MM-dd h:mm a",ki="h:mm a",gM="yyyy-MM-dd",Za="MMM dd, yyyy h:mm:ss a",kn="MMM dd, yyyy h:mm a",yM={secondly:e=>e?Ka:Xa,tenSecondly:e=>e?Ka:Xa,thirtySecondly:e=>e?Ka:Xa,minutely:e=>e?Xn:ki,fiveMinutely:e=>e?Xn:ki,tenMinutely:e=>e?Xn:ki,thirtyMinutely:e=>e?Xn:ki,hourly:e=>e?Xn:ki,twoHourly:e=>e?Xn:ki,twelveHourly:()=>Xn,daily:()=>gM},bM={secondly:()=>Za,tenSecondly:()=>Za,thirtySecondly:()=>Za,minutely:()=>kn,fiveMinutely:()=>kn,tenMinutely:()=>kn,thirtyMinutely:()=>kn,hourly:()=>kn,twoHourly:()=>kn,twelveHourly:()=>kn,daily:()=>kn};function ff({tickValue:e,granularity:t,timezone:n,dayBoundaryCrossed:i=!1,tickMap:s,tooltipMap:o,defaultFormat:r}){const a=n||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return pM(e,a);if(s&&s[t]){const l=s[t](i);return ks(e,a,l)}if(o&&o[t]){const l=o[t]();return ks(e,a,l)}return ks(e,a,r)}const _M=({tickValue:e,granularity:t,dayBoundaryCrossed:n,timezone:i})=>ff({tickValue:e,granularity:t,timezone:i,dayBoundaryCrossed:n,tickMap:yM,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),Ds=({tickValue:e,granularity:t,timezone:n})=>ff({tickValue:e,granularity:t,timezone:n,tooltipMap:bM,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),mf=e=>e?.code==="ERR_CANCELED"||e?.name==="CanceledError"||e?.name==="AbortError",xM=e=>{const{i18n:t}=mt.useI18n();return mf(e)?{type:"canceled",message:t.t("query_errors.canceled.message")}:e?.status===403?{status:e.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:e?.status===408||e?.message?.includes("timeout")?{status:e.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:e?.response?.data?.message==="Range not allowed for this tier"?{status:e.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:e.status,type:"other",message:t.t("query_errors.other.message"),details:e.response?.data?.invalid_parameters?.map(n=>n.reason).join(", ")||e?.message}},Cs=e=>e.toLocaleLowerCase().endsWith("count"),wM=e=>{const t=e.toLocaleLowerCase();return["sum","count","cost","tokens"].some(n=>t.endsWith(n))};function SM(e){const n=`barChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};Me.positioners[n]=function(l,c){if(!l.length||e.tooltipState.interactionMode==="interactive"||c.x===null||c.y===null)return!1;const u=this.chart.canvas.getBoundingClientRect(),h=e.tooltipState.width||this.width,f=u.width/2,m=La(c,h,f),p=c.y,y=c.x<f?"left":"center";return{x:m-e.tooltipState.offsetX,y:p-e.tooltipState.offsetY,xAlign:y}},Jr.modes.customInteractionMode=function(l,c){const u=_n(c,l),h=[];return Jr.evaluateInteractionItems(l,l.options.indexAxis||"x",u,(f,m,p)=>{l.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&l.data.datasets[m].data[p]&&h.push({element:f,datasetIndex:m,index:p}),l.options.indexAxis==="x"&&u.x!==null&&f.inXRange(u.x,!0)&&l.data.datasets[m].data[p]&&h.push({element:f,datasetIndex:m,index:p})}),h};const s=e.numLabels.value>25?Yh:jh,o=({chart:l,index:c})=>{const u=l.data;return{size:s,style:u?.isLabelEmpty?.[c]?"italic":"normal"}},r=(l,c,u)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(u),c&&c.length>$o?c.slice(0,$o)+"...":c):l.getLabelForValue(Number(c)),a=d.computed(()=>({indexAxis:e.indexAxis,skipNull:!0,scales:{x:{stacked:e.stacked.value,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{maxRotation:90,autoSkip:!1,font:o,callback:function(l,c){return r(this,l,c)}},title:{display:e.indexAxis==="y"?!rt(e.metricAxesTitle?.value):!rt(e.dimensionAxesTitle?.value),text:e.indexAxis==="y"?e.metricAxesTitle?.value:e.dimensionAxesTitle?.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:e.stacked.value,beginAtZero:!0,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{padding:0,font:o,callback:function(l,c){return r(this,l,c)}},title:{display:e.indexAxis==="x"?!rt(e.metricAxesTitle?.value):!rt(e.dimensionAxesTitle?.value),text:e.indexAxis==="x"?e.metricAxesTitle?.value:e.dimensionAxesTitle?.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:l=>{Vh(e.tooltipState,l)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return d.getCurrentInstance()&&d.onUnmounted(()=>{Me.positioners[n]&&delete Me.positioners[n]}),a}pe.register(...Q0);const vM=(e,t)=>{const n=t.datasets.map(s=>s.label),i=e.datasets.map(s=>s.label);return e.datasets.length===t.datasets.length&&n.every((s,o)=>s===i[o])};function TM(e,t,n,i,s){const o=d.shallowRef(null),r=(a,l)=>{if(t.value)return new pe(t.value,{type:e,data:a,plugins:i,options:l})};return d.onMounted(()=>{o.value=r(n.value,s.value)}),d.onBeforeUnmount(()=>{rt(o.value)||o.value.destroy()}),d.watch(n,(a,l)=>{if(vM(l,a)&&!rt(o.value)){for(const[c,u]of a.datasets.entries())Object.assign(o.value.data.datasets[c],u);o.value.data.labels=a.labels,o.value.update()}else rt(o.value)||o.value.destroy(),o.value=r(a,s.value)}),d.watch(t,()=>{rt(o.value)||o.value.destroy(),o.value=r(n.value,s.value)}),d.watch(s,(a,l)=>{(a.indexAxis!==l.indexAxis||JSON.stringify(a.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(a.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(rt(o.value)||o.value.destroy(),o.value=r(n.value,a))}),o}const pf=1e3,MM=1e4,gf=1e6,yf=1e9,bf=1e12,Os=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(e).toString().split("").reverse().forEach((o,r)=>{r&&r%3===0&&i.push(n),i.push(o)}),i.reverse().join("")},Di=(e,t,n)=>{const i=e/t,s=n.round?"round":"floor";if(n.decimal===!1)return Math[s](i).toString();let o;n.precision?o=i:o=i<10?Math[s](i*10)/10:Math[s](i);let r=o.toString();return typeof n.decimal=="string"&&(r=r.replace(".",n.decimal)),r};function Es(e,t={}){let n;const i=e<0;i&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const s=t.min10k?MM:pf;return e<s||t.precision&&t.precision>Math.log10(e)?n=Os(Di(e,1,t),t):e<gf?n=`${Di(e,pf,t)}k`:e<yf?n=`${Di(e,gf,t)}m`:e<bf?n=`${Os(Di(e,yf,t),t)}b`:n=`${Os(Di(e,bf,t),t)}t`,i&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}Es.addCommas=Os;function kM(e,t,n){const{i18n:i}=mt.useI18n(),{formatBytes:s}=Kn({i18n:i}),{translateUnit:o}=mt.useTranslatedUnits();return{legendValues:d.computed(()=>e.value.datasets.reduce((a,l)=>{const c=l.total?l.total:l.data.reduce((h,f)=>h+(typeof f=="number"?Number(f)||0:Number(f&&f.y)||0),0);let u;if(n.value==="bytes")u=s(c);else{const h=o(n.value,c);u=i&&i.t("legend.datapointValueDisplay",{value:Es(c,{capital:!0}),unit:h})||`${Es(c,{capital:!0})} ${n.value}`}return{...a,[l.label]:{raw:c,formatted:u,isThreshold:l.isThreshold}}},{}))}}function DM(e){return d.computed(()=>{if(!e.value?.meta)return"";const n=e.value.meta.start,i=e.value.meta.end;return n&&i?`${Ih(new Date(n))} - ${Ih(new Date(i),{includeTZ:!0})}`:""})}function CM(e){const n=`donutChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:o=>({label:o.dataset.label,value:o.label})}};Me.positioners[n]=function(o,r){if(!o.length||r.x===null||r.y===null)return!1;const a=this.chart.canvas.getBoundingClientRect(),l=e.tooltipState.width||this.width,c=a.width/2,u=La(r,l,c),h=r.y,f=r.x<c?"left":"center";return{x:u-e.tooltipState.offsetX,y:h,xAlign:f}};const s=d.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:o=>{Vh(e.tooltipState,o)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return d.onUnmounted(()=>{Me.positioners[n]&&delete Me.positioners[n]}),{options:s}}function OM(e){const t=d.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:l=>{const c=new Date(l);return _M({tickValue:c,granularity:e.granularity.value,dayBoundaryCrossed:r.value})}},title:{display:!rt(e.dimensionAxesTitle?.value),text:e.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:e.stacked.value})),n=d.computed(()=>({title:{display:!rt(e.metricAxesTitle?.value),text:e.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:e.stacked.value})),s=`lineChartTooltipPosition-${e.tooltipState.chartID}`,o={enabled:!1,position:s};Me.positioners[s]=function(l,c){if(!l.length||e.tooltipState.interactionMode==="interactive"||c.x===null||c.y===null)return!1;const u=this.chart.canvas.getBoundingClientRect(),h=e.tooltipState.width||this.width,f=e.tooltipState.height||this.height,m=u.width/2,p=u.height/2,y=La(c,h,m);let b=Zv(c,f,p);const S=c.y<p?"top":"bottom",M=c.x<m?"left":"center";return f>u.height&&(b=0),{x:y,y:b,xAlign:M,yAlign:S}};const r=d.computed(()=>{const l=Number(e.timeRangeMs.value),c=new Date,u=new Date(c.getTime()-l);return gw(l)>24||u.getDate()!==c.getDate()}),a=d.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:e.pointsWithoutHover?.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:n.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{...o,external:l=>{Hh(e.tooltipState,l,e.granularity.value)}},thresholdPlugin:{threshold:e.threshold?.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return d.onUnmounted(()=>{Me.positioners[s]&&delete Me.positioners[s]}),{options:a}}function EM(e){const{isMultiMetric:t,hasDimensions:n,metricNames:i,barSegmentLabels:s,pivotRecords:o,rowLabels:r,colorPalette:a}=e,{i18n:l}=mt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Fa(i.indexOf(u),Mn),data:r.map((h,f)=>n?o[`${h.id},${u}`]||0:o[`${f},${u}`]||null)})):Array.from(s).flatMap((u,h)=>{if(!u)return[];const f=Kh(h,u.name,u.id==="empty",a);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:f,data:r.map(m=>o[`${m.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function AM(e,t){const{i18n:n}=mt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:o,metric_names:r}=t.value.meta,a=o&&Object.keys(o),l=r&&r.length>1,c=o&&a&&a.length>0,u=c&&a.length>1;if(!s.length||!r)return{datasets:[],labels:[]};const h=c&&a||r,f=h[0],m=h.length>1?h[1]:h[0],p=Object.fromEntries(l?s.flatMap(_=>r.map((v,k)=>{const I=_.event[f],Y=c?`${I},${v}`:`${k},${v}`,U=_.event[v];return[Y,U]})):s.map(_=>{const v=c?`${_.event[f]},${_.event[m]}`:`${f},${m}`,k=_.event[r[0]];return[v,k]})),y=Object.keys(p).reduce((_,v)=>{const[k]=v.split(","),I=p[v];return _[k]?_[k]+=I:_[k]=I,_},{}),b=Object.entries(y).sort(([,_],[,v])=>Number(v)-Number(_)).map(([_])=>_),S=o[f],M=o[m];let E=c&&S&&Object.entries(S).map(([_,v])=>({id:_,name:v.name}))||r.map(_=>({id:_,name:_})),D=c&&M&&Object.entries(M).map(([_,v])=>({id:_,name:v.name}))||r.map(_=>({id:_,name:_}));if(c&&f==="country_code"&&(E=E.map(_=>({..._,name:Ia(_.id)||_.name}))),c&&m==="country_code"&&(D=D.map(_=>({..._,name:Ia(_.id)||_.name}))),f!=="status_code"&&f!=="status_code_grouped"&&(E.sort((_,v)=>b.indexOf(_.id)-b.indexOf(v.id)),D.sort((_,v)=>b.indexOf(_.id)-b.indexOf(v.id))),!E||!D)return{labels:[],datasets:[]};const C=EM({isMultiMetric:l,hasDimensions:c,metricNames:r,dimensionFieldNames:h,barSegmentLabels:D,pivotRecords:p,rowLabels:E,colorPalette:e.colorPalette||Mn}),A=c?E.map(_=>n&&n.te(`chartLabels.${_.name}`)&&n.t(`chartLabels.${_.name}`)||_.name):r.map(_=>n&&n.te(`chartLabels.${_}`)&&n.t(`chartLabels.${_}`)||_),O=E.map(_=>_.id==="empty");return{labels:A,datasets:C,isLabelEmpty:O,isMultiDimension:u}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const PM=(e,t,n=1)=>Array(Math.ceil((t-e)/n)).fill(e).map((i,s)=>i+s*n),RM=e=>{if(typeof e=="string"){const t=+e;if(t)return t;try{return Kd(e).getTime()}catch(n){if(n instanceof RangeError)return 0;throw n}}return e},IM=(e,t,n,i,s)=>{const r=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),a=Math.floor((e-i)/n)*n+i,l=Math.floor((r-i)/n)*n+i+n;return PM(a,l,n)};function LM(e,t){const{i18n:n}=mt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:o,metric_names:r,start:a,end:l}=t.value.meta,c=new Date(a).getTime(),u=new Date(l).getTime();if(!r)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const h=o&&Object.keys(o)||r,f=h&&h[0],m=o[f];let p=o&&m&&Object.keys(m).map(A=>({id:A,name:m[A].name}))||r.map(A=>({id:A,name:A}));f==="country_code"&&(p=p.map(A=>({...A,name:Ia(A.id)||A.name})));const y=t.value.meta.granularity_ms;if(typeof y!="number"||isNaN(y)||!isFinite(y)||y===0)return console.error("Invalid step value:",y),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const b=RM(c),S=IM(c,u,y,b,s),M=new Set,E=s?.length?s.reduce((A,O)=>{const x=new Date(O.timestamp).valueOf(),_=O.event;for(const v of r)M.add(v),x in A||(A[x]={}),v in A[x]||(A[x][v]={});for(const v of r)p.forEach(k=>{_[f]===k.id||v===k.id?(A[x][v]||(A[x][v]={}),A[x][v][k.id]=Math.round(Number(_[v])*1e3)/1e3):h.length||(A[x][v]||(A[x][v]={}),A[x][v][k.id]=Math.round(Number(_[k.id])*1e3)/1e3)});return A},{}):{},C=[...r.length===1?r.flatMap(A=>p.map(O=>[A,O.id,O.name,O.id==="empty"])):p.map(A=>[A.name,A.id,A.name,A.id==="empty"])].map(([A,O,x,_],v)=>{const k=S.map(j=>j in E&&A in E[j]?{x:j,y:E[j][A][O]||0}:{x:j,y:0});let{colorPalette:I,fill:Y}=e;rt(I)&&(I=Mn);const U=Kh(v,x,_,I);return{rawDimension:x,rawMetric:A,label:n&&n.te(`chartLabels.${x}`)&&n.t(`chartLabels.${x}`)||x,borderColor:U,backgroundColor:U,data:k,total:k.reduce((j,{y:H})=>j+Number(H),0),...A1,fill:Y,borderWidth:Y?R1:P1,isSegmentEmpty:_}});return f==="status_code"||f==="status_code_grouped"?C.sort((A,O)=>(A.label??"")<(O.label??"")?-1:1):C.sort((A,O)=>Number(A.total)<Number(O.total)?-1:1),{datasets:C}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const NM=(e,t)=>{d.watch([e,t],(n,i,s)=>{const[o,r]=n;!r||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(r,o),s(()=>{window._AnalyticsChartDataInternal?.delete(r)}))},{immediate:!0})};function FM(){const{i18n:e}=mt.useI18n();return{translateUnit:(n,i)=>{const s=i===1,o=`chartUnits.${n}`;return Cs(n)?"":e.te(o)?e.t(o,{plural:s?"":"s"}):n}}}const BM="analytics-query-provider",_f=2;function zM(){const e=d.inject(BM);return{evaluateFeatureFlag:(n,i)=>e?e.evaluateFeatureFlagFn(n,i):i}}function xf(e,t){return d.getCurrentScope()?(d.onScopeDispose(e,t),!0):!1}const wf=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const UM=e=>e!=null,HM=Object.prototype.toString,VM=e=>HM.call(e)==="[object Object]";function jo(e){return Array.isArray(e)?e:[e]}function WM(e){return d.getCurrentInstance()}function $M(e,t={}){if(!d.isRef(e))return d.toRefs(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const i in e.value)n[i]=d.customRef(()=>({get(){return e.value[i]},set(s){var o;if(!((o=d.toValue(t.replaceRef))!==null&&o!==void 0)||o)if(Array.isArray(e.value)){const r=[...e.value];r[i]=s,e.value=r}else{const r={...e.value,[i]:s};Object.setPrototypeOf(r,Object.getPrototypeOf(e.value)),e.value=r}else e.value[i]=s}}));return n}function YM(e,t=!0,n){WM()?d.onMounted(e,n):t?e():d.nextTick(e)}function jM(e,t,n){return d.watch(e,t,{...n,immediate:!0})}const qo=wf?window:void 0;function Ci(e){var t;const n=d.toValue(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function As(...e){const t=(i,s,o,r)=>(i.addEventListener(s,o,r),()=>i.removeEventListener(s,o,r)),n=d.computed(()=>{const i=jo(d.toValue(e[0])).filter(s=>s!=null);return i.every(s=>typeof s!="string")?i:void 0});return jM(()=>{var i,s;return[(i=(s=n.value)===null||s===void 0?void 0:s.map(o=>Ci(o)))!==null&&i!==void 0?i:[qo].filter(o=>o!=null),jo(d.toValue(n.value?e[1]:e[0])),jo(d.unref(n.value?e[2]:e[1])),d.toValue(n.value?e[3]:e[2])]},([i,s,o,r],a,l)=>{if(!i?.length||!s?.length||!o?.length)return;const c=VM(r)?{...r}:r,u=i.flatMap(h=>s.flatMap(f=>o.map(m=>t(h,f,m,c))));l(()=>{u.forEach(h=>h())})},{flush:"post"})}function qM(){const e=d.shallowRef(!1),t=d.getCurrentInstance();return t&&d.onMounted(()=>{e.value=!0},t),e}function Sf(e){const t=qM();return d.computed(()=>(t.value,!!e()))}function GM(e,t,n={}){const{window:i=qo,...s}=n;let o;const r=Sf(()=>i&&"MutationObserver"in i),a=()=>{o&&(o.disconnect(),o=void 0)},l=d.watch(d.computed(()=>{const h=jo(d.toValue(e)).map(Ci).filter(UM);return new Set(h)}),h=>{a(),r.value&&h.size&&(o=new MutationObserver(t),h.forEach(f=>o.observe(f,s)))},{immediate:!0,flush:"post"}),c=()=>o?.takeRecords(),u=()=>{l(),a()};return xf(u),{isSupported:r,stop:u,takeRecords:c}}const Go={speed:2,margin:30,direction:"both"};function KM(e){e.scrollLeft>e.scrollWidth-e.clientWidth&&(e.scrollLeft=Math.max(0,e.scrollWidth-e.clientWidth)),e.scrollTop>e.scrollHeight-e.clientHeight&&(e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight))}function XM(e,t={}){var n,i,s,o;const{pointerTypes:r,preventDefault:a,stopPropagation:l,exact:c,onMove:u,onEnd:h,onStart:f,initialValue:m,axis:p="both",draggingElement:y=qo,containerElement:b,handle:S=e,buttons:M=[0],restrictInView:E,autoScroll:D=!1}=t,C=d.ref((n=d.toValue(m))!==null&&n!==void 0?n:{x:0,y:0}),A=d.ref(),O=P=>r?r.includes(P.pointerType):!0,x=P=>{d.toValue(a)&&P.preventDefault(),d.toValue(l)&&P.stopPropagation()},_=d.toValue(D),v=typeof _=="object"?{speed:(i=d.toValue(_.speed))!==null&&i!==void 0?i:Go.speed,margin:(s=d.toValue(_.margin))!==null&&s!==void 0?s:Go.margin,direction:(o=_.direction)!==null&&o!==void 0?o:Go.direction}:Go,k=P=>typeof P=="number"?[P,P]:[P.x,P.y],I=(P,N,V)=>{const{clientWidth:Q,clientHeight:X,scrollLeft:q,scrollTop:G,scrollWidth:J,scrollHeight:nt}=P,[tt,Z]=k(v.margin),[pt,bt]=k(v.speed);let ot=0,gt=0;(v.direction==="x"||v.direction==="both")&&(V.x<tt&&q>0?ot=-pt:V.x+N.width>Q-tt&&q<J-Q&&(ot=pt)),(v.direction==="y"||v.direction==="both")&&(V.y<Z&&G>0?gt=-bt:V.y+N.height>X-Z&&G<nt-X&&(gt=bt)),(ot||gt)&&P.scrollBy({left:ot,top:gt,behavior:"auto"})};let Y=null;const U=()=>{const P=d.toValue(b);P&&!Y&&(Y=setInterval(()=>{const N=d.toValue(e).getBoundingClientRect(),{x:V,y:Q}=C.value,X={x:V-P.scrollLeft,y:Q-P.scrollTop};X.x>=0&&X.y>=0&&(I(P,N,X),X.x+=P.scrollLeft,X.y+=P.scrollTop,C.value=X)},1e3/60))},j=()=>{Y&&(clearInterval(Y),Y=null)},H=(P,N,V,Q)=>{const[X,q]=typeof V=="number"?[V,V]:[V.x,V.y],{clientWidth:G,clientHeight:J}=N;return P.x<X||P.x+Q.width>G-X||P.y<q||P.y+Q.height>J-q},$=()=>{if(d.toValue(t.disabled)||!A.value)return;const P=d.toValue(b);if(!P)return;const N=d.toValue(e).getBoundingClientRect(),{x:V,y:Q}=C.value;H({x:V-P.scrollLeft,y:Q-P.scrollTop},P,v.margin,N)?U():j()};d.toValue(D)&&d.watch(C,$);const R=P=>{var N;if(!d.toValue(M).includes(P.button)||d.toValue(t.disabled)||!O(P)||d.toValue(c)&&P.target!==d.toValue(e))return;const V=d.toValue(b),Q=V==null||(N=V.getBoundingClientRect)===null||N===void 0?void 0:N.call(V),X=d.toValue(e).getBoundingClientRect(),q={x:P.clientX-(V?X.left-Q.left+(D?0:V.scrollLeft):X.left),y:P.clientY-(V?X.top-Q.top+(D?0:V.scrollTop):X.top)};f?.(q,P)!==!1&&(A.value=q,x(P))},B=P=>{if(d.toValue(t.disabled)||!O(P)||!A.value)return;const N=d.toValue(b);N instanceof HTMLElement&&KM(N);const V=d.toValue(e).getBoundingClientRect();let{x:Q,y:X}=C.value;if((p==="x"||p==="both")&&(Q=P.clientX-A.value.x,N&&(Q=Math.min(Math.max(0,Q),N.scrollWidth-V.width))),(p==="y"||p==="both")&&(X=P.clientY-A.value.y,N&&(X=Math.min(Math.max(0,X),N.scrollHeight-V.height))),d.toValue(D)&&N&&(Y===null&&I(N,V,{x:Q,y:X}),Q+=N.scrollLeft,X+=N.scrollTop),N&&(E||D)){if(p!=="y"){const q=Q-N.scrollLeft;q<0?Q=N.scrollLeft:q>N.clientWidth-V.width&&(Q=N.clientWidth-V.width+N.scrollLeft)}if(p!=="x"){const q=X-N.scrollTop;q<0?X=N.scrollTop:q>N.clientHeight-V.height&&(X=N.clientHeight-V.height+N.scrollTop)}}C.value={x:Q,y:X},u?.(C.value,P),x(P)},z=P=>{d.toValue(t.disabled)||!O(P)||A.value&&(A.value=void 0,D&&j(),h?.(C.value,P),x(P))};if(wf){const P=()=>{var N;return{capture:(N=t.capture)!==null&&N!==void 0?N:!0,passive:!d.toValue(a)}};As(S,"pointerdown",R,P),As(y,"pointermove",B,P),As(y,"pointerup",z,P)}return{...$M(C),position:C,isDragging:d.computed(()=>!!A.value),style:d.computed(()=>`
4
- left: ${C.value.x}px;
5
- top: ${C.value.y}px;
6
- ${D?"text-wrap: nowrap;":""}
7
- `)}}function ZM(e,t,n={}){const{window:i=qo,...s}=n;let o;const r=Sf(()=>i&&"ResizeObserver"in i),a=()=>{o&&(o.disconnect(),o=void 0)},l=d.watch(d.computed(()=>{const u=d.toValue(e);return Array.isArray(u)?u.map(h=>Ci(h)):[Ci(u)]}),u=>{if(a(),r.value&&i){o=new ResizeObserver(t);for(const h of u)h&&o.observe(h,s)}},{immediate:!0,flush:"post"}),c=()=>{a(),l()};return xf(c),{isSupported:r,stop:c}}function QM(e,t={}){const{reset:n=!0,windowResize:i=!0,windowScroll:s=!0,immediate:o=!0,updateTiming:r="sync"}=t,a=d.shallowRef(0),l=d.shallowRef(0),c=d.shallowRef(0),u=d.shallowRef(0),h=d.shallowRef(0),f=d.shallowRef(0),m=d.shallowRef(0),p=d.shallowRef(0);function y(){const S=Ci(e);if(!S){n&&(a.value=0,l.value=0,c.value=0,u.value=0,h.value=0,f.value=0,m.value=0,p.value=0);return}const M=S.getBoundingClientRect();a.value=M.height,l.value=M.bottom,c.value=M.left,u.value=M.right,h.value=M.top,f.value=M.width,m.value=M.x,p.value=M.y}function b(){r==="sync"?y():r==="next-frame"&&requestAnimationFrame(()=>y())}return ZM(e,b),d.watch(()=>Ci(e),S=>!S&&b()),GM(e,b,{attributeFilter:["style","class"]}),s&&As("scroll",b,{capture:!0,passive:!0}),i&&As("resize",b,{passive:!0}),YM(()=>{o&&b()}),{height:a,bottom:l,left:c,right:u,top:h,width:f,x:m,y:p,update:b}}function JM(e,t){const{top:n,left:i}=QM(e),s=d.computed(()=>e.value?`${parseFloat(t.left)+i.value}px`:t.left),o=d.computed(()=>e.value?`${parseFloat(t.top)+n.value}px`:t.top);return{tooltipAbsoluteLeft:s,tooltipAbsoluteTop:o}}const tk=({bucketCount:e,minStamp:t,maxStamp:n,timestamps:i})=>{const s=[...i].filter(l=>l>=t&&l<=n).sort((l,c)=>l-c),o=[];if(n-t<e-2)return[];const r=(n-t)/e;let a=0;for(let l=0;l<e;l++){const c=t+l*r,u=t+(l+1)*r;let h=0;for(;a<s.length&&s[a]>=c&&s[a]<=u;)h++,a++;o.push([Math.ceil(c),h])}return o},vf=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),Ps=d.ref({}),ek=e=>(Ps.value[e]||(Ps.value[e]=vf()),Ps.value[e]),nk=(e,t)=>{const n=Ps.value[t];if(!n)return;const i=n.minCounts[e]!==void 0||n.maxCounts[e]!==void 0||n.minStamps[e]!==void 0||n.maxStamps[e]!==void 0||n.renderPoints[e]!==void 0;n&&i&&(delete n.minCounts[e],delete n.maxCounts[e],delete n.minStamps[e],delete n.maxStamps[e],delete n.renderPoints[e],Object.keys(n.minCounts).length||Object.keys(n.maxCounts).length||Object.keys(n.minStamps).length||Object.keys(n.maxStamps).length||Object.keys(n.renderPoints).length||delete Ps.value[t])};function ik({chartKey:e,datasets:t,groupKey:n,minStamp:i=void 0,maxStamp:s=void 0,minCount:o=void 0,maxCount:r=void 0,renderPoints:a=void 0,type:l}){const u=n!==void 0&&e!==void 0?ek(n):vf(),h=e!==void 0?e:"static-chart-key",f=d.computed(()=>t.reduce((v,{timestamps:k})=>[...v,...k],[])),m=d.computed(()=>i||f.value.reduce((v,k)=>v===0?k:Math.min(v,k),0)),p=d.computed(()=>s||f.value.reduce((v,k)=>Math.max(v,k),0));d.watchEffect(()=>{u.minStamps[h]=m.value,u.maxStamps[h]=p.value,a!==void 0&&(u.renderPoints[h]=a)});const y=d.computed(()=>Object.values(u.minStamps).reduce((v,k)=>v===0?k:Math.min(v,k),0)),b=d.computed(()=>Object.values(u.maxStamps).reduce((v,k)=>Math.max(v,k),0)),S=d.computed(()=>{const v=Object.values(u.renderPoints);return v.length===0?24:v.reduce((k,I)=>Math.max(k,I),2)}),M=d.computed(()=>{const v=b.value-y.value;return Math.ceil(v/S.value)}),E=d.computed(()=>t.length>1),D=d.computed(()=>t.map(({timestamps:v,color:k,label:I})=>({data:tk({bucketCount:S.value,minStamp:y.value,maxStamp:b.value,timestamps:v}).map(([j,H])=>({x:j,y:H})),label:I,...(l==="sparkline_bar"||E.value)&&k&&{backgroundColor:k},...l!=="sparkline_bar"&&k&&{borderColor:k},...E.value&&l!=="sparkline_bar"&&{fill:!0}}))),C=d.computed(()=>{const v=D.value[0]?.data?.length??0,k=[];for(let I=0;I<v;I++){let Y=0;for(let U=0;U<D.value.length;U++)Y+=D.value[U].data[I].y;k.push(Y)}return k}),A=d.computed(()=>{const v=C.value.reduce((k,I)=>Math.max(k,I),0);return Math.max(v,r??0)}),O=d.computed(()=>{const v=D.value.reduce((Y,{data:U})=>[...Y,...U.map(({y:j})=>j)],[]),k=v.length?v[0]:0,I=v.reduce((Y,U)=>Math.min(Y,U),k);return o===void 0?I:Math.min(I,o)});d.watchEffect(()=>{u.maxCounts[h]=A.value,u.minCounts[h]=O.value});const x=d.computed(()=>{const v=Object.values(u.minCounts),k=v.length?v[0]:0;return v.reduce((I,Y)=>Math.min(I,Y),k)}),_=d.computed(()=>Object.values(u.maxCounts).reduce((v,k)=>Math.max(v,k),0));return d.onUnmounted(()=>{e!==void 0&&n!==void 0&&nk(e,n)}),{syncedMinStamp:y,syncedMaxStamp:b,syncedRenderPoints:S,syncedChartDatasets:D,syncedGroupSizeMs:M,syncedMinCount:x,syncedMaxCount:_}}const mt={useBarChartOptions:SM,useChartJSCommon:TM,useChartLegendValues:kM,useChartSelectedRange:DM,useExploreResultToDatasets:AM,useExploreResultToTimeDataset:LM,useDonutChartOptions:CM,useLineChartOptions:OM,useI18n:Nm,useReportChartDataForSynthetics:NM,useTranslatedUnits:FM,useEvaluateFeatureFlag:zM,useTooltipAbsolutePosition:JM,useSparklineSync:ik};var be=(e=>(e.Hidden="hidden",e.Bottom="bottom",e))(be||{});const Tf={modes:{point(e,t){return Ko(e,t,{intersect:!0})},nearest(e,t,n){return rk(e,t,n)},x(e,t,n){return Ko(e,t,{intersect:n.intersect,axis:"x"})},y(e,t,n){return Ko(e,t,{intersect:n.intersect,axis:"y"})}}};function Qa(e,t,n){return(Tf.modes[n.mode]||Tf.modes.nearest)(e,t,n)}function sk(e,t,n){return n!=="x"&&n!=="y"?e.inRange(t.x,t.y,"x",!0)||e.inRange(t.x,t.y,"y",!0):e.inRange(t.x,t.y,n,!0)}function ok(e,t,n){return n==="x"?{x:e.x,y:t.y}:n==="y"?{x:t.x,y:e.y}:t}function Ko(e,t,n){return e.filter(i=>n.intersect?i.inRange(t.x,t.y):sk(i,t,n.axis))}function rk(e,t,n){let i=Number.POSITIVE_INFINITY;return Ko(e,t,n).reduce((s,o)=>{const r=o.getCenterPoint(),a=ok(t,r,n.axis),l=di(t,a);return l<i?(s=[o],i=l):l===i&&s.push(o),s},[]).sort((s,o)=>s._index-o._index).slice(0,1)}function Zn(e,t,n){const i=Math.cos(n),s=Math.sin(n),o=t.x,r=t.y;return{x:o+i*(e.x-o)-s*(e.y-r),y:r+s*(e.x-o)+i*(e.y-r)}}const ak=(e,t)=>t>e||e.length>t.length&&e.slice(0,t.length)===t,Qn=.001,Xo=(e,t,n)=>Math.min(n,Math.max(t,e)),Mf=(e,t)=>e.value>=e.start-t&&e.value<=e.end+t;function lk(e,t,n){for(const i of Object.keys(e))e[i]=Xo(e[i],t,n);return e}function ck(e,t,n,i){return!e||!t||n<=0?!1:Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<=Math.pow(n+i,2)}function kf(e,{x:t,y:n,x2:i,y2:s},o,{borderWidth:r,hitTolerance:a}){const l=(r+a)/2,c=e.x>=t-l-Qn&&e.x<=i+l+Qn,u=e.y>=n-l-Qn&&e.y<=s+l+Qn;return o==="x"?c:(o==="y"||c)&&u}function Df(e,{rect:t,center:n},i,{rotation:s,borderWidth:o,hitTolerance:r}){const a=Zn(e,n,Vt(-s));return kf(a,t,i,{borderWidth:o,hitTolerance:r})}function Jn(e,t){const{centerX:n,centerY:i}=e.getProps(["centerX","centerY"],t);return{x:n,y:i}}function uk(e,t,n,i=!0){const s=n.split(".");let o=0;for(const r of t.split(".")){const a=s[o++];if(parseInt(r,10)<parseInt(a,10))break;if(ak(a,r)){if(i)throw new Error(`${e} v${n} is not supported. v${t} or newer is required.`);return!1}}return!0}const Cf=e=>typeof e=="string"&&e.endsWith("%"),Of=e=>parseFloat(e)/100,Ef=e=>Xo(Of(e),0,1),Rs=(e,t)=>({x:e,y:t,x2:e,y2:t,width:0,height:0}),dk={box:e=>Rs(e.centerX,e.centerY),doughnutLabel:e=>Rs(e.centerX,e.centerY),ellipse:e=>({centerX:e.centerX,centerY:e.centerX,radius:0,width:0,height:0}),label:e=>Rs(e.centerX,e.centerY),line:e=>Rs(e.x,e.y),point:e=>({centerX:e.centerX,centerY:e.centerY,radius:0,width:0,height:0}),polygon:e=>Rs(e.centerX,e.centerY)};function Ja(e,t){return t==="start"?0:t==="end"?e:Cf(t)?Ef(t)*e:e/2}function Dn(e,t,n=!0){return typeof t=="number"?t:Cf(t)?(n?Ef(t):Of(t))*e:e}function hk(e,t){const{x:n,width:i}=e,s=t.textAlign;return s==="center"?n+i/2:s==="end"||s==="right"?n+i:n}function Af(e,t,{borderWidth:n,position:i,xAdjust:s,yAdjust:o},r){const a=ft(r),l=t.width+(a?r.width:0)+n,c=t.height+(a?r.height:0)+n,u=tl(i),h=Lf(e.x,l,s,u.x),f=Lf(e.y,c,o,u.y);return{x:h,y:f,x2:h+l,y2:f+c,width:l,height:c,centerX:h+l/2,centerY:f+c/2}}function tl(e,t="center"){return ft(e)?{x:at(e.x,t),y:at(e.y,t)}:(e=at(e,t),{x:e,y:e})}const Pf=(e,t)=>e&&e.autoFit&&t<1;function Rf(e,t){const n=e.font,i=xt(n)?n:[n];return Pf(e,t)?i.map(function(s){const o=Pt(s);return o.size=Math.floor(s.size*t),o.lineHeight=s.lineHeight,Pt(o)}):i.map(s=>Pt(s))}function If(e){return e&&(fe(e.xValue)||fe(e.yValue))}function Lf(e,t,n=0,i){return e-Ja(t,i)+n}function Oi(e,t,n){const i=n.init;if(i){if(i===!0)return Ff(t,n)}else return;return fk(e,t,n)}function Nf(e,t,n){let i=!1;return t.forEach(s=>{me(e[s])?(i=!0,n[s]=e[s]):fe(n[s])&&delete n[s]}),i}function Ff(e,t){const n=t.type||"line";return dk[n](e)}function fk(e,t,n){const i=wt(n.init,[{chart:e,properties:t,options:n}]);if(i===!0)return Ff(t,n);if(ft(i))return i}const el=new Map,mk=e=>isNaN(e)||e<=0,pk=e=>e.reduce(function(t,n){return t+=n.string,t},"");function Zo(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Qo(e,{x:t,y:n},i){i&&(e.translate(t,n),e.rotate(Vt(i)),e.translate(-t,-n))}function nn(e,t){if(t&&t.borderWidth)return e.lineCap=t.borderCapStyle||"butt",e.setLineDash(t.borderDash),e.lineDashOffset=t.borderDashOffset,e.lineJoin=t.borderJoinStyle||"miter",e.lineWidth=t.borderWidth,e.strokeStyle=t.borderColor,!0}function Ei(e,t){e.shadowColor=t.backgroundShadowColor,e.shadowBlur=t.shadowBlur,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY}function Jo(e,t){const n=t.content;if(Zo(n))return{width:Dn(n.width,t.width),height:Dn(n.height,t.height)};const i=Rf(t),s=t.textStrokeWidth,o=xt(n)?n:[n],r=o.join()+pk(i)+s+(e._measureText?"-spriting":"");return el.has(r)||el.set(r,_k(e,o,i,s)),el.get(r)}function Bf(e,t,n){const{x:i,y:s,width:o,height:r}=t;e.save(),Ei(e,n);const a=nn(e,n);e.fillStyle=n.backgroundColor,e.beginPath(),hi(e,{x:i,y:s,w:o,h:r,radius:lk(yn(n.borderRadius),0,Math.min(o,r)/2)}),e.closePath(),e.fill(),a&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore()}function zf(e,t,n,i){const s=n.content;if(Zo(s)){e.save(),e.globalAlpha=Sk(n.opacity,s.style.opacity),e.drawImage(s,t.x,t.y,t.width,t.height),e.restore();return}const o=xt(s)?s:[s],r=Rf(n,i),a=n.color,l=xt(a)?a:[a],c=hk(t,n),u=t.y+n.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=n.textAlign,gk(e,n)&&xk(e,{x:c,y:u},o,r),wk(e,{x:c,y:u},o,{fonts:r,colors:l}),e.restore()}function gk(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,!0}function yk(e,t,n,i){const{radius:s,options:o}=t,r=o.pointStyle,a=o.rotation;let l=(a||0)*Er;if(Zo(r)){e.save(),e.translate(n,i),e.rotate(l),e.drawImage(r,-r.width/2,-r.height/2,r.width,r.height),e.restore();return}mk(s)||bk(e,{x:n,y:i,radius:s,rotation:a,style:r,rad:l})}function bk(e,{x:t,y:n,radius:i,rotation:s,style:o,rad:r}){let a,l,c,u;switch(e.beginPath(),o){default:e.arc(t,n,i,0,Dt),e.closePath();break;case"triangle":e.moveTo(t+Math.sin(r)*i,n-Math.cos(r)*i),r+=io,e.lineTo(t+Math.sin(r)*i,n-Math.cos(r)*i),r+=io,e.lineTo(t+Math.sin(r)*i,n-Math.cos(r)*i),e.closePath();break;case"rectRounded":u=i*.516,c=i-u,a=Math.cos(r+Ce)*c,l=Math.sin(r+Ce)*c,e.arc(t-a,n-l,u,r-dt,r-Ot),e.arc(t+l,n-a,u,r-Ot,r),e.arc(t+a,n+l,u,r,r+Ot),e.arc(t-l,n+a,u,r+Ot,r+dt),e.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,e.rect(t-c,n-c,2*c,2*c);break}r+=Ce;case"rectRot":a=Math.cos(r)*i,l=Math.sin(r)*i,e.moveTo(t-a,n-l),e.lineTo(t+l,n-a),e.lineTo(t+a,n+l),e.lineTo(t-l,n+a),e.closePath();break;case"crossRot":r+=Ce;case"cross":a=Math.cos(r)*i,l=Math.sin(r)*i,e.moveTo(t-a,n-l),e.lineTo(t+a,n+l),e.moveTo(t+l,n-a),e.lineTo(t-l,n+a);break;case"star":a=Math.cos(r)*i,l=Math.sin(r)*i,e.moveTo(t-a,n-l),e.lineTo(t+a,n+l),e.moveTo(t+l,n-a),e.lineTo(t-l,n+a),r+=Ce,a=Math.cos(r)*i,l=Math.sin(r)*i,e.moveTo(t-a,n-l),e.lineTo(t+a,n+l),e.moveTo(t+l,n-a),e.lineTo(t-l,n+a);break;case"line":a=Math.cos(r)*i,l=Math.sin(r)*i,e.moveTo(t-a,n-l),e.lineTo(t+a,n+l);break;case"dash":e.moveTo(t,n),e.lineTo(t+Math.cos(r)*i,n+Math.sin(r)*i);break}e.fill()}function _k(e,t,n,i){e.save();const s=t.length;let o=0,r=i;for(let a=0;a<s;a++){const l=n[Math.min(a,n.length-1)];e.font=l.string;const c=t[a];o=Math.max(o,e.measureText(c).width+i),r+=l.lineHeight}return e.restore(),{width:o,height:r}}function xk(e,{x:t,y:n},i,s){e.beginPath();let o=0;i.forEach(function(r,a){const l=s[Math.min(a,s.length-1)],c=l.lineHeight;e.font=l.string,e.strokeText(r,t,n+c/2+o),o+=c}),e.stroke()}function wk(e,{x:t,y:n},i,{fonts:s,colors:o}){let r=0;i.forEach(function(a,l){const c=o[Math.min(l,o.length-1)],u=s[Math.min(l,s.length-1)],h=u.lineHeight;e.beginPath(),e.font=u.string,e.fillStyle=c,e.fillText(a,t,n+h/2+r),r+=h,e.fill()})}function Sk(e,t){const n=gn(e)?e:t;return gn(n)?Xo(n,0,1):1}const Uf=["left","bottom","top","right"];function vk(e,t){const{pointX:n,pointY:i,options:s}=t,o=s.callout,r=o&&o.display&&Ck(t,o);if(!r||Ek(t,o,r))return;if(e.save(),e.beginPath(),!nn(e,o))return e.restore();const{separatorStart:l,separatorEnd:c}=Tk(t,r),{sideStart:u,sideEnd:h}=kk(t,r,l);(o.margin>0||s.borderWidth===0)&&(e.moveTo(l.x,l.y),e.lineTo(c.x,c.y)),e.moveTo(u.x,u.y),e.lineTo(h.x,h.y);const f=Zn({x:n,y:i},t.getCenterPoint(),Vt(-t.rotation));e.lineTo(f.x,f.y),e.stroke(),e.restore()}function Tk(e,t){const{x:n,y:i,x2:s,y2:o}=e,r=Mk(e,t);let a,l;return t==="left"||t==="right"?(a={x:n+r,y:i},l={x:a.x,y:o}):(a={x:n,y:i+r},l={x:s,y:a.y}),{separatorStart:a,separatorEnd:l}}function Mk(e,t){const{width:n,height:i,options:s}=e,o=s.callout.margin+s.borderWidth/2;return t==="right"?n+o:t==="bottom"?i+o:-o}function kk(e,t,n){const{y:i,width:s,height:o,options:r}=e,a=r.callout.start,l=Dk(t,r.callout);let c,u;return t==="left"||t==="right"?(c={x:n.x,y:i+Dn(o,a)},u={x:c.x+l,y:c.y}):(c={x:n.x+Dn(s,a),y:n.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function Dk(e,t){const n=t.side;return e==="left"||e==="top"?-n:n}function Ck(e,t){const n=t.position;return Uf.includes(n)?n:Ok(e,t)}function Ok(e,t){const{x:n,y:i,x2:s,y2:o,width:r,height:a,pointX:l,pointY:c,centerX:u,centerY:h,rotation:f}=e,m={x:u,y:h},p=t.start,y=Dn(r,p),b=Dn(a,p),S=[n,n+y,n+y,s],M=[i+b,o,i,o],E=[];for(let D=0;D<4;D++){const C=Zn({x:S[D],y:M[D]},m,Vt(f));E.push({position:Uf[D],distance:di(C,{x:l,y:c})})}return E.sort((D,C)=>D.distance-C.distance)[0].position}function Ek(e,t,n){const{pointX:i,pointY:s}=e,o=t.margin;let r=i,a=s;return n==="left"?r+=o:n==="right"?r-=o:n==="top"?a+=o:n==="bottom"&&(a-=o),e.inRange(r,a)}const Hf={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function Ai(e,t,n){return t=typeof t=="number"?t:e.parse(t),At(t)?e.getPixelForValue(t):n}function ti(e,t,n){const i=t[n];if(i||n==="scaleID")return i;const s=n.charAt(0),o=Object.values(e).filter(r=>r.axis&&r.axis===s);return o.length?o[0].id:s}function Vf(e,t){if(e){const n=e.options.reverse,i=Ai(e,t.min,n?t.end:t.start),s=Ai(e,t.max,n?t.start:t.end);return{start:i,end:s}}}function Wf(e,t){const{chartArea:n,scales:i}=e,s=i[ti(i,t,"xScaleID")],o=i[ti(i,t,"yScaleID")];let r=n.width/2,a=n.height/2;return s&&(r=Ai(s,t.xValue,s.left+s.width/2)),o&&(a=Ai(o,t.yValue,o.top+o.height/2)),{x:r,y:a}}function nl(e,t){const n=e.scales,i=n[ti(n,t,"xScaleID")],s=n[ti(n,t,"yScaleID")];if(!i&&!s)return{};let{left:o,right:r}=i||e.chartArea,{top:a,bottom:l}=s||e.chartArea;const c=jf(i,{min:t.xMin,max:t.xMax,start:o,end:r});o=c.start,r=c.end;const u=jf(s,{min:t.yMin,max:t.yMax,start:l,end:a});return a=u.start,l=u.end,{x:o,y:a,x2:r,y2:l,width:r-o,height:l-a,centerX:o+(r-o)/2,centerY:a+(l-a)/2}}function $f(e,t){if(!If(t)){const n=nl(e,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(n.width,n.height)/2,t.radius=i);const s=i*2,o=n.centerX+t.xAdjust,r=n.centerY+t.yAdjust;return{x:o-i,y:r-i,x2:o+i,y2:r+i,centerX:o,centerY:r,width:s,height:s,radius:i}}return Pk(e,t)}function Ak(e,t){const{scales:n,chartArea:i}=e,s=n[t.scaleID],o={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?Rk(s,o,t):Ik(n,o,t),o}function Yf(e,t){const n=nl(e,t);return n.initProperties=Oi(e,n,t),n.elements=[{type:"label",optionScope:"label",properties:Fk(e,n,t),initProperties:n.initProperties}],n}function Pk(e,t){const n=Wf(e,t),i=t.radius*2;return{x:n.x-t.radius+t.xAdjust,y:n.y-t.radius+t.yAdjust,x2:n.x+t.radius+t.xAdjust,y2:n.y+t.radius+t.yAdjust,centerX:n.x+t.xAdjust,centerY:n.y+t.yAdjust,radius:t.radius,width:i,height:i}}function jf(e,t){const n=Vf(e,t)||t;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function Rk(e,t,n){const i=Ai(e,n.value,NaN),s=Ai(e,n.endValue,i);e.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function Ik(e,t,n){for(const i of Object.keys(Hf)){const s=e[ti(e,n,i)];if(s){const{min:o,max:r,start:a,end:l,startProp:c,endProp:u}=Hf[i],h=Vf(s,{min:n[o],max:n[r],start:s[a],end:s[l]});t[c]=h.start,t[u]=h.end}}}function Lk({properties:e,options:t},n,i,s){const{x:o,x2:r,width:a}=e;return qf({start:o,end:r,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:n.width})}function Nk({properties:e,options:t},n,i,s){const{y:o,y2:r,height:a}=e;return qf({start:o,end:r,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:n.height})}function qf(e,t){const{start:n,end:i,borderWidth:s}=e,{position:o,padding:{start:r,end:a},adjust:l}=t,c=i-s-n-r-a-t.size;return n+s/2+l+Ja(c,o)}function Fk(e,t,n){const i=n.label;i.backgroundColor="transparent",i.callout.display=!1;const s=tl(i.position),o=Wt(i.padding),r=Jo(e.ctx,i),a=Lk({properties:t,options:n},r,s,o),l=Nk({properties:t,options:n},r,s,o),c=r.width+o.width,u=r.height+o.height;return{x:a,y:l,x2:a+c,y2:l+u,width:c,height:u,centerX:a+c/2,centerY:l+u/2,rotation:i.rotation}}const il=["enter","leave"],sl=il.concat("click");function Bk(e,t,n){t.listened=Nf(n,sl,t.listeners),t.moveListened=!1,il.forEach(i=>{me(n[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&me(i.click)&&(t.listened=!0),t.moveListened||il.forEach(s=>{me(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function zk(e,t,n){if(e.listened)switch(t.type){case"mousemove":case"mouseout":return Uk(e,t,n);case"click":return Hk(e,t,n)}}function Uk(e,t,n){if(!e.moveListened)return;let i;t.type==="mousemove"?i=Qa(e.visibleElements,t,n.interaction):i=[];const s=e.hovered;e.hovered=i;const o={state:e,event:t};let r=Gf(o,"leave",s,i);return Gf(o,"enter",i,s)||r}function Gf({state:e,event:t},n,i,s){let o;for(const r of i)s.indexOf(r)<0&&(o=Kf(r.options[n]||e.listeners[n],r,t)||o);return o}function Hk(e,t,n){const i=e.listeners,s=Qa(e.visibleElements,t,n.interaction);let o;for(const r of s)o=Kf(r.options.click||i.click,r,t)||o;return o}function Kf(e,t,n){return wt(e,[t.$context,n])===!0}const tr=["afterDraw","beforeDraw"];function Vk(e,t,n){const i=t.visibleElements;t.hooked=Nf(n,tr,t.hooks),t.hooked||i.forEach(s=>{t.hooked||tr.forEach(o=>{me(s.options[o])&&(t.hooked=!0)})})}function Xf(e,t,n){if(e.hooked){const i=t.options[n]||e.hooks[n];return wt(i,[t.$context])}}function Wk(e,t,n){const i=Gk(e.scales,t,n);let s=Zf(t,i,"min","suggestedMin");s=Zf(t,i,"max","suggestedMax")||s,s&&me(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function $k(e,t){for(const n of e)jk(n,t)}function Zf(e,t,n,i){if(At(t[n])&&!Yk(e.options,n,i)){const s=e[n]!==t[n];return e[n]=t[n],s}}function Yk(e,t,n){return fe(e[t])||fe(e[n])}function jk(e,t){for(const n of["scaleID","xScaleID","yScaleID"]){const i=ti(t,e,n);i&&!t[i]&&qk(e,n)&&console.warn(`No scale found with id '${i}' for annotation '${e.id}'`)}}function qk(e,t){if(t==="scaleID")return!0;const n=t.charAt(0);for(const i of["Min","Max","Value"])if(fe(e[n+i]))return!0;return!1}function Gk(e,t,n){const i=t.axis,s=t.id,o=i+"ScaleID",r={min:at(t.min,Number.NEGATIVE_INFINITY),max:at(t.max,Number.POSITIVE_INFINITY)};for(const a of n)a.scaleID===s?Qf(a,t,["value","endValue"],r):ti(e,a,o)===s&&Qf(a,t,[i+"Min",i+"Max",i+"Value"],r);return r}function Qf(e,t,n,i){for(const s of n){const o=e[s];if(fe(o)){const r=t.parse(o);i.min=Math.min(i.min,r),i.max=Math.max(i.max,r)}}}class Pi extends oe{inRange(t,n,i,s){const{x:o,y:r}=Zn({x:t,y:n},this.getCenterPoint(s),Vt(-this.options.rotation));return kf({x:o,y:r},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return Jn(this,t)}draw(t){t.save(),Qo(t,this.getCenterPoint(),this.options.rotation),Bf(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return Yf(t,n)}}Pi.id="boxAnnotation",Pi.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,hitTolerance:0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Pi.defaultRoutes={borderColor:"color",backgroundColor:"color"},Pi.descriptors={label:{_fallback:!0}};class er extends oe{inRange(t,n,i,s){return Df({x:t,y:n},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return Jn(this,t)}draw(t){const n=this.options;!n.display||!n.content||(tD(t,this),t.save(),Qo(t,this.getCenterPoint(),this.rotation),zf(t,this,n,this._fitRatio),t.restore())}resolveElementProperties(t,n){const i=Kk(t,n);if(!i)return{};const{controllerMeta:s,point:o,radius:r}=Zk(t,n,i);let a=Jo(t.ctx,n);const l=Qk(a,r);Pf(n,l)&&(a={width:a.width*l,height:a.height*l});const{position:c,xAdjust:u,yAdjust:h}=n,f=Af(o,a,{borderWidth:0,position:c,xAdjust:u,yAdjust:h});return{initProperties:Oi(t,f,n),...f,...s,rotation:n.rotation,_fitRatio:l}}}er.id="doughnutLabelAnnotation",er.defaults={autoFit:!0,autoHide:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderColor:"transparent",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:0,color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,spacing:1,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0},er.defaultRoutes={};function Kk(e,t){return e.getSortedVisibleDatasetMetas().reduce(function(n,i){const s=i.controller;return s instanceof ss&&Xk(e,t,i.data)&&(!n||s.innerRadius<n.controller.innerRadius)&&s.options.circumference>=90?i:n},void 0)}function Xk(e,t,n){if(!t.autoHide)return!0;for(let i=0;i<n.length;i++)if(!n[i].hidden&&e.getDataVisibility(i))return!0}function Zk({chartArea:e},t,n){const{left:i,top:s,right:o,bottom:r}=e,{innerRadius:a,offsetX:l,offsetY:c}=n.controller,u=(i+o)/2+l,h=(s+r)/2+c,f={left:Math.max(u-a,i),right:Math.min(u+a,o),top:Math.max(h-a,s),bottom:Math.min(h+a,r)},m={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},p=t.spacing+t.borderWidth/2,y=a-p,b=m.y>h,S=b?s+p:r-p,M=Jk(S,u,h,y);return{controllerMeta:{_centerX:u,_centerY:h,_radius:y,_counterclockwise:b,...M},point:m,radius:Math.min(a,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function Qk({width:e,height:t},n){const i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2));return n*2/i}function Jk(e,t,n,i){const s=Math.pow(n-e,2),o=Math.pow(i,2),r=t*-2,a=Math.pow(t,2)+s-o,l=Math.pow(r,2)-4*a;if(l<=0)return{_startAngle:0,_endAngle:Dt};const c=(-r-Math.sqrt(l))/2,u=(-r+Math.sqrt(l))/2;return{_startAngle:oo({x:t,y:n},{x:c,y:e}).angle,_endAngle:oo({x:t,y:n},{x:u,y:e}).angle}}function tD(e,t){const{_centerX:n,_centerY:i,_radius:s,_startAngle:o,_endAngle:r,_counterclockwise:a,options:l}=t;e.save();const c=nn(e,l);e.fillStyle=l.backgroundColor,e.beginPath(),e.arc(n,i,s,o,r,a),e.closePath(),e.fill(),c&&e.stroke(),e.restore()}class Is extends oe{inRange(t,n,i,s){return Df({x:t,y:n},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return Jn(this,t)}draw(t){const n=this.options,i=!fe(this._visible)||this._visible;!n.display||!n.content||!i||(t.save(),Qo(t,this.getCenterPoint(),this.rotation),vk(t,this),Bf(t,this,n),zf(t,eD(this),n),t.restore())}resolveElementProperties(t,n){let i;if(If(n))i=Wf(t,n);else{const{centerX:a,centerY:l}=nl(t,n);i={x:a,y:l}}const s=Wt(n.padding),o=Jo(t.ctx,n),r=Af(i,o,n,s);return{initProperties:Oi(t,r,n),pointX:i.x,pointY:i.y,...r,rotation:n.rotation}}}Is.id="labelAnnotation",Is.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},Is.defaultRoutes={borderColor:"color"};function eD({x:e,y:t,width:n,height:i,options:s}){const o=s.borderWidth/2,r=Wt(s.padding);return{x:e+r.left+o,y:t+r.top+o,width:n-r.left-r.right-s.borderWidth,height:i-r.top-r.bottom-s.borderWidth}}const ol=(e,t,n)=>({x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}),rl=(e,t,n)=>ol(t,n,Math.abs((e-t.y)/(n.y-t.y))).x,Jf=(e,t,n)=>ol(t,n,Math.abs((e-t.x)/(n.x-t.x))).y,Ls=e=>e*e,nD=(e,t,{x:n,y:i,x2:s,y2:o},r)=>r==="y"?{start:Math.min(i,o),end:Math.max(i,o),value:t}:{start:Math.min(n,s),end:Math.max(n,s),value:e},tm=(e,t,n,i)=>(1-i)*(1-i)*e+2*(1-i)*i*t+i*i*n,al=(e,t,n,i)=>({x:tm(e.x,t.x,n.x,i),y:tm(e.y,t.y,n.y,i)}),em=(e,t,n,i)=>2*(1-i)*(t-e)+2*i*(n-t),nm=(e,t,n,i)=>-Math.atan2(em(e.x,t.x,n.x,i),em(e.y,t.y,n.y,i))+.5*dt;class Ns extends oe{inRange(t,n,i,s){const o=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const r={mouseX:t,mouseY:n},{path:a,ctx:l}=this;if(a){nn(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,h=t*u.currentDevicePixelRatio,f=n*u.currentDevicePixelRatio,m=l.isPointInStroke(a,h,f)||ll(this,r,s);return l.restore(),m}const c=Ls(o);return rD(this,r,c,s)||ll(this,r,s)}return iD(this,{mouseX:t,mouseY:n},i,{hitSize:o,useFinalPosition:s})}getCenterPoint(t){return Jn(this,t)}draw(t){const{x:n,y:i,x2:s,y2:o,cp:r,options:a}=this;if(t.save(),!nn(t,a))return t.restore();Ei(t,a);const l=Math.sqrt(Math.pow(s-n,2)+Math.pow(o-i,2));if(a.curve&&r)return mD(t,this,r,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=am(this),m=Math.atan2(o-i,s-n);t.translate(n,i),t.rotate(m),t.beginPath(),t.moveTo(0+h,0),t.lineTo(l-f,0),t.shadowColor=a.borderShadowColor,t.stroke(),cl(t,0,h,c),cl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){const i=Ak(t,n),{x:s,y:o,x2:r,y2:a}=i,l=sD(i,t.chartArea),c=l?oD({x:s,y:o},{x:r,y:a},t.chartArea):{x:s,y:o,x2:r,y2:a,width:Math.abs(r-s),height:Math.abs(a-o)};if(c.centerX=(r+s)/2,c.centerY=(a+o)/2,c.initProperties=Oi(t,c,n),n.curve){const h={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=fD(c,n,di(h,f))}const u=aD(t,c,n.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}Ns.id="lineAnnotation";const im={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};Ns.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},im),fill:!1,length:12,start:Object.assign({},im),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance:0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},Is.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Ns.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Ns.defaultRoutes={borderColor:"color"};function iD(e,{mouseX:t,mouseY:n},i,{hitSize:s,useFinalPosition:o}){const r=nD(t,n,e.getProps(["x","y","x2","y2"],o),i);return Mf(r,s)||ll(e,{mouseX:t,mouseY:n},o,i)}function sD({x:e,y:t,x2:n,y2:i},{top:s,right:o,bottom:r,left:a}){return!(e<a&&n<a||e>o&&n>o||t<s&&i<s||t>r&&i>r)}function sm({x:e,y:t},n,{top:i,right:s,bottom:o,left:r}){return e<r&&(t=Jf(r,{x:e,y:t},n),e=r),e>s&&(t=Jf(s,{x:e,y:t},n),e=s),t<i&&(e=rl(i,{x:e,y:t},n),t=i),t>o&&(e=rl(o,{x:e,y:t},n),t=o),{x:e,y:t}}function oD(e,t,n){const{x:i,y:s}=sm(e,t,n),{x:o,y:r}=sm(t,e,n);return{x:i,y:s,x2:o,y2:r,width:Math.abs(o-i),height:Math.abs(r-s)}}function rD(e,{mouseX:t,mouseY:n},i=Qn,s){const{x:o,y:r,x2:a,y2:l}=e.getProps(["x","y","x2","y2"],s),c=a-o,u=l-r,h=Ls(c)+Ls(u),f=h===0?-1:((t-o)*c+(n-r)*u)/h;let m,p;return f<0?(m=o,p=r):f>1?(m=a,p=l):(m=o+f*c,p=r+f*u),Ls(t-m)+Ls(n-p)<=i}function ll(e,{mouseX:t,mouseY:n},i,s){const o=e.label;return o.options.display&&o.inRange(t,n,s,i)}function aD(e,t,n){const i=n.borderWidth,s=Wt(n.padding),o=Jo(e.ctx,n),r=o.width+s.width+i,a=o.height+s.height+i;return cD(t,n,{width:r,height:a,padding:s},e.chartArea)}function lD(e){const{x:t,y:n,x2:i,y2:s}=e,o=Math.atan2(s-n,i-t);return o>dt/2?o-dt:o<dt/-2?o+dt:o}function cD(e,t,n,i){const{width:s,height:o,padding:r}=n,{xAdjust:a,yAdjust:l}=t,c={x:e.x,y:e.y},u={x:e.x2,y:e.y2},h=t.rotation==="auto"?lD(e):Vt(t.rotation),f=uD(s,o,h),m=dD(e,t,{labelSize:f,padding:r},i),p=e.cp?al(c,e.cp,u,m):ol(c,u,m),y={size:f.w,min:i.left,max:i.right,padding:r.left},b={size:f.h,min:i.top,max:i.bottom,padding:r.top},S=rm(p.x,y)+a,M=rm(p.y,b)+l;return{x:S-s/2,y:M-o/2,x2:S+s/2,y2:M+o/2,centerX:S,centerY:M,pointX:p.x,pointY:p.y,width:s,height:o,rotation:so(h)}}function uD(e,t,n){const i=Math.cos(n),s=Math.sin(n);return{w:Math.abs(e*i)+Math.abs(t*s),h:Math.abs(e*s)+Math.abs(t*i)}}function dD(e,t,n,i){let s;const o=hD(e,i);return t.position==="start"?s=om({w:e.x2-e.x,h:e.y2-e.y},n,t,o):t.position==="end"?s=1-om({w:e.x-e.x2,h:e.y-e.y2},n,t,o):s=Ja(1,t.position),s}function om(e,t,n,i){const{labelSize:s,padding:o}=t,r=e.w*i.dx,a=e.h*i.dy,l=r>0&&(s.w/2+o.left-i.x)/r,c=a>0&&(s.h/2+o.top-i.y)/a;return Xo(Math.max(l,c),0,.25)}function hD(e,t){const{x:n,x2:i,y:s,y2:o}=e,r=Math.min(s,o)-t.top,a=Math.min(n,i)-t.left,l=t.bottom-Math.max(s,o),c=t.right-Math.max(n,i);return{x:Math.min(a,c),y:Math.min(r,l),dx:a<=c?1:-1,dy:r<=l?1:-1}}function rm(e,t){const{size:n,min:i,max:s,padding:o}=t,r=n/2;return n>s-i?(s+i)/2:(i>=e-o-r&&(e=i+o+r),s<=e+o+r&&(e=s-o-r),e)}function am(e){const t=e.options,n=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:n,endOpts:i,startAdjust:lm(e,n),endAdjust:lm(e,i)}}function lm(e,t){if(!t||!t.display)return 0;const{length:n,width:i}=t,s=e.options.borderWidth/2,o={x:n,y:i+s};return Math.abs(rl(0,o,{x:0,y:s}))}function cl(e,t,n,i){if(!i||!i.display)return;const{length:s,width:o,fill:r,backgroundColor:a,borderColor:l}=i,c=Math.abs(t-s)+n;e.beginPath(),Ei(e,i),nn(e,i),e.moveTo(c,-o),e.lineTo(t+n,0),e.lineTo(c,o),r===!0?(e.fillStyle=a||l,e.closePath(),e.fill(),e.shadowColor="transparent"):e.shadowColor=i.borderShadowColor,e.stroke()}function fD(e,t,n){const{x:i,y:s,x2:o,y2:r,centerX:a,centerY:l}=e,c=Math.atan2(r-s,o-i),u=tl(t.controlPoint,0),h={x:a+Dn(n,u.x,!1),y:l+Dn(n,u.y,!1)};return Zn(h,{x:a,y:l},c)}function cm(e,{x:t,y:n},{angle:i,adjust:s},o){!o||!o.display||(e.save(),e.translate(t,n),e.rotate(i),cl(e,0,-s,o),e.restore())}function mD(e,t,n,i){const{x:s,y:o,x2:r,y2:a,options:l}=t,{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=am(t),m={x:s,y:o},p={x:r,y:a},y=nm(m,n,p,0),b=nm(m,n,p,1)-dt,S=al(m,n,p,h/i),M=al(m,n,p,1-f/i),E=new Path2D;e.beginPath(),E.moveTo(S.x,S.y),E.quadraticCurveTo(n.x,n.y,M.x,M.y),e.shadowColor=l.borderShadowColor,e.stroke(E),t.path=E,t.ctx=e,cm(e,S,{angle:y,adjust:h},c),cm(e,M,{angle:b,adjust:f},u)}class Fs extends oe{inRange(t,n,i,s){const o=this.options.rotation,r=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return pD({x:t,y:n},this.getProps(["width","height","centerX","centerY"],s),o,r);const{x:a,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],s),h=i==="y"?{start:l,end:u}:{start:a,end:c},f=Zn({x:t,y:n},this.getCenterPoint(s),Vt(-o));return f[i]>=h.start-r-Qn&&f[i]<=h.end+r+Qn}getCenterPoint(t){return Jn(this,t)}draw(t){const{width:n,height:i,centerX:s,centerY:o,options:r}=this;t.save(),Qo(t,this.getCenterPoint(),r.rotation),Ei(t,this.options),t.beginPath(),t.fillStyle=r.backgroundColor;const a=nn(t,r);t.ellipse(s,o,i/2,n/2,dt/2,0,2*dt),t.fill(),a&&(t.shadowColor=r.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return Yf(t,n)}}Fs.id="ellipseAnnotation",Fs.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Pi.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Fs.defaultRoutes={borderColor:"color",backgroundColor:"color"},Fs.descriptors={label:{_fallback:!0}};function pD(e,t,n,i){const{width:s,height:o,centerX:r,centerY:a}=t,l=s/2,c=o/2;if(l<=0||c<=0)return!1;const u=Vt(n||0),h=Math.cos(u),f=Math.sin(u),m=Math.pow(h*(e.x-r)+f*(e.y-a),2),p=Math.pow(f*(e.x-r)-h*(e.y-a),2);return m/Math.pow(l+i,2)+p/Math.pow(c+i,2)<=1.0001}class nr extends oe{inRange(t,n,i,s){const{x:o,y:r,x2:a,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),u=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?ck({x:t,y:n},this.getCenterPoint(s),c/2,u):Mf(i==="y"?{start:r,end:l,value:n}:{start:o,end:a,value:t},u)}getCenterPoint(t){return Jn(this,t)}draw(t){const n=this.options,i=n.borderWidth;if(n.radius<.1)return;t.save(),t.fillStyle=n.backgroundColor,Ei(t,n);const s=nn(t,n);yk(t,this,this.centerX,this.centerY),s&&!Zo(n.pointStyle)&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore(),n.borderWidth=i}resolveElementProperties(t,n){const i=$f(t,n);return i.initProperties=Oi(t,i,n),i}}nr.id="pointAnnotation",nr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},nr.defaultRoutes={borderColor:"color",backgroundColor:"color"};class ir extends oe{inRange(t,n,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&yD(this.elements,t,n,s);const o=Zn({x:t,y:n},this.getCenterPoint(s),Vt(-this.options.rotation)),r=this.elements.map(c=>i==="y"?c.bY:c.bX),a=Math.min(...r),l=Math.max(...r);return o[i]>=a&&o[i]<=l}getCenterPoint(t){return Jn(this,t)}draw(t){const{elements:n,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Ei(t,i);const s=nn(t,i);let o=!0;for(const r of n)o?(t.moveTo(r.x,r.y),o=!1):t.lineTo(r.x,r.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,n){const i=$f(t,n),{sides:s,rotation:o}=n,r=[],a=2*dt/s;let l=o*Er;for(let c=0;c<s;c++,l+=a){const u=gD(i,n,l);u.initProperties=Oi(t,i,n),r.push(u)}return i.elements=r,i}}ir.id="polygonAnnotation",ir.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},ir.defaultRoutes={borderColor:"color",backgroundColor:"color"};function gD({centerX:e,centerY:t},{radius:n,borderWidth:i,hitTolerance:s},o){const r=(i+s)/2,a=Math.sin(o),l=Math.cos(o),c={x:e+a*n,y:t-l*n};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:e+a*(n+r),bY:t-l*(n+r)}}}function yD(e,t,n,i){let s=!1,o=e[e.length-1].getProps(["bX","bY"],i);for(const r of e){const a=r.getProps(["bX","bY"],i);a.bY>n!=o.bY>n&&t<(o.bX-a.bX)*(n-a.bY)/(o.bY-a.bY)+a.bX&&(s=!s),o=a}return s}const Cn={box:Pi,doughnutLabel:er,ellipse:Fs,label:Is,line:Ns,point:nr,polygon:ir};Object.keys(Cn).forEach(e=>{Et.describe(`elements.${Cn[e].id}`,{_fallback:"plugins.annotation.common"})});const bD={update:Object.assign},_D=sl.concat(tr),um=(e,t)=>ft(t)?hl(e,t):e,ul=e=>e==="color"||e==="font";function dl(e="line"){return Cn[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function xD(e,t,n,i){const s=SD(e,n.animations,i),o=t.annotations,r=MD(t.elements,o);for(let a=0;a<o.length;a++){const l=o[a],c=dm(r,a,l.type),u=l.setContext(TD(e,c,r,l)),h=c.resolveElementProperties(e,u);h.skip=wD(h),"elements"in h&&(vD(c,h.elements,u,s),delete h.elements),fe(c.x)||Object.assign(c,h),Object.assign(c,h.initProperties),h.options=hm(u),s.update(c,h)}}function wD(e){return isNaN(e.x)||isNaN(e.y)}function SD(e,t,n){return n==="reset"||n==="none"||n==="resize"?bD:new Yr(e,t)}function vD(e,t,n,i){const s=e.elements||(e.elements=[]);s.length=t.length;for(let o=0;o<t.length;o++){const r=t[o],a=r.properties,l=dm(s,o,r.type,r.initProperties),c=n[r.optionScope].override(r);a.options=hm(c),i.update(l,a)}}function dm(e,t,n,i){const s=Cn[dl(n)];let o=e[t];return(!o||!(o instanceof s))&&(o=e[t]=new s,Object.assign(o,i)),o}function hm(e){const t=Cn[dl(e.type)],n={};n.id=e.id,n.type=e.type,n.drawTime=e.drawTime,Object.assign(n,hl(e,t.defaults),hl(e,t.defaultRoutes));for(const i of _D)n[i]=e[i];return n}function hl(e,t){const n={};for(const i of Object.keys(t)){const s=t[i],o=e[i];ul(i)&&xt(o)?n[i]=o.map(r=>um(r,s)):n[i]=um(o,s)}return n}function TD(e,t,n,i){return t.$context||(t.$context=Object.assign(Object.create(e.getContext()),{element:t,get elements(){return n.filter(s=>s&&s.options)},id:i.id,type:"annotation"}))}function MD(e,t){const n=t.length,i=e.length;if(i<n){const s=n-i;e.splice(i,0,...new Array(s))}else i>n&&e.splice(n,i-n);return e}var kD="3.1.0";const On=new Map,fm=e=>e.type!=="doughnutLabel",DD=sl.concat(tr);var mm={id:"annotation",version:kD,beforeRegister(){uk("chart.js","4.0",pe.version)},afterRegister(){pe.register(Cn)},afterUnregister(){pe.unregister(Cn)},beforeInit(e){On.set(e,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(e,t,n){const i=On.get(e),s=i.annotations=[];let o=n.annotations;ft(o)?Object.keys(o).forEach(r=>{const a=o[r];ft(a)&&(a.id=r,s.push(a))}):xt(o)&&s.push(...o),$k(s.filter(fm),e.scales)},afterDataLimits(e,t){const n=On.get(e);Wk(e,t.scale,n.annotations.filter(fm).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(e,t,n){const i=On.get(e);Bk(e,i,n),xD(e,i,n,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),Vk(e,i,n)},beforeDatasetsDraw(e,t,n){Bs(e,"beforeDatasetsDraw",n.clip)},afterDatasetsDraw(e,t,n){Bs(e,"afterDatasetsDraw",n.clip)},beforeDatasetDraw(e,t,n){Bs(e,t.index,n.clip)},beforeDraw(e,t,n){Bs(e,"beforeDraw",n.clip)},afterDraw(e,t,n){Bs(e,"afterDraw",n.clip)},beforeEvent(e,t,n){const i=On.get(e);zk(i,t.event,n)&&(t.changed=!0)},afterDestroy(e){On.delete(e)},getAnnotations(e){const t=On.get(e);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(e,t,n){return Qa(e,t,n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:e=>!DD.includes(e)&&e!=="init",annotations:{_allKeys:!1,_fallback:(e,t)=>`elements.${Cn[dl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:ul,_fallback:!0},_indexable:ul}},additionalOptionScopes:[""]};function Bs(e,t,n){const{ctx:i,chartArea:s}=e,o=On.get(e);n&&ts(i,s);const r=CD(o.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of r)OD(i,s,o,a);n&&es(i)}function CD(e,t){const n=[];for(const i of e)if(i.options.drawTime===t&&n.push({element:i,main:!0}),i.elements&&i.elements.length)for(const s of i.elements)s.options.display&&s.options.drawTime===t&&n.push({element:s});return n}function OD(e,t,n,i){const s=i.element;i.main?(Xf(n,s,"beforeDraw"),s.draw(e,t),Xf(n,s,"afterDraw")):s.draw(e,t)}const ED={class:"zoom-timerange-container"},AD={class:"zoom-timerange-details"},PD={class:"label","data-testid":"zoom-timerange-from"},RD={class:"label","data-testid":"zoom-timerange-to"},ID=d.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(e){const t=e,{i18n:n}=mt.useI18n(),i=d.ref(Ds({tickValue:t.start,granularity:t.granularity})),s=d.ref(Ds({tickValue:t.end,granularity:t.granularity})),o=(r,a)=>{Wh(()=>{i.value=Ds({tickValue:r,granularity:t.granularity}),s.value=Ds({tickValue:a,granularity:t.granularity})},100)()};return d.watch(()=>[t.start,t.end],([r,a])=>{o(r,a)},{immediate:!0}),(r,a)=>(d.openBlock(),d.createElementBlock("div",ED,[d.createElementVNode("div",AD,[d.createElementVNode("div",PD,d.toDisplayString(d.unref(n).t("zoom_time_range.from")),1),d.createElementVNode("div",null,d.toDisplayString(i.value),1),d.createElementVNode("div",RD,d.toDisplayString(d.unref(n).t("zoom_time_range.to")),1),d.createElementVNode("div",null,d.toDisplayString(s.value),1)])]))}}),ke=(e,t)=>{const n=e.__vccOpts||e;for(const[i,s]of t)n[i]=s;return n},pm=ke(ID,[["__scopeId","data-v-4fa681cf"]]),LD={class:"zoom-actions-container"},ND={class:"zoom-actions-heading"},FD={class:"zoom-action-select"},BD=["data-testid"],zD=["aria-disabled","href"],UD=["onClick"],HD=ke(d.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(e,{emit:t}){const n=e,i=t,s=o=>{o.action&&(o.action(n.newTimeRange),i("onAction"))};return(o,r)=>(d.openBlock(),d.createElementBlock("div",LD,[d.createElementVNode("div",ND,[d.createVNode(pm,{end:e.newTimeRange.end,granularity:e.granularity,start:e.newTimeRange.start},null,8,["end","granularity","start"]),d.createVNode(d.unref(Wi.CloseIcon),{class:"zoom-actions-close-icon",color:`var(--kui-color-text-neutral, ${d.unref(Na)})`,size:`var(--kui-icon-size-30, ${d.unref(Ms)})`,onClick:r[0]||(r[0]=a=>o.$emit("onAction"))},null,8,["color","size"])]),r[2]||(r[2]=d.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),d.createElementVNode("div",FD,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.zoomActionItems,a=>(d.openBlock(),d.createElementBlock("div",{key:a.key,class:d.normalizeClass(["zoom-action-item",{disabled:a.disabled}]),"data-testid":`zoom-action-item-${a.key}`},[a.href?(d.openBlock(),d.createElementBlock("a",{key:0,"aria-disabled":a.disabled,class:"zoom-action-link",href:a.href,onClick:r[1]||(r[1]=l=>o.$emit("onAction"))},d.toDisplayString(a.label),9,zD)):(d.openBlock(),d.createElementBlock("div",{key:1,onClick:l=>s(a)},d.toDisplayString(a.label),9,UD))],10,BD))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),VD={key:2},WD={class:"tooltip-title"},$D={class:"title"},YD={key:0,class:"subtitle"},jD={class:"context"},qD={class:"metric"},GD={class:"tooltip"},KD={key:0},XD={class:"display-value"},sr=ke(d.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0},granularity:{default:void 0}},emits:["dimensions","onAction"],setup(e,{emit:t}){const n=t,i=e,s=d.ref(null),{x:o,y:r,isDragging:a}=XM(s,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),l=d.computed(()=>`${r.value}px`),c=d.computed(()=>`${o.value}px`),u=d.computed(()=>i.state.tooltipContext),h=d.computed(()=>i.state.metricDisplay),f=d.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return d.watch(()=>[i.absoluteLeft,i.absoluteTop],([m,p])=>{a.value||(o.value=parseFloat(m),r.value=parseFloat(p))}),d.watch(a,m=>{m?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),d.watch(s,m=>{if(m){const{width:p,height:y}=m.getBoundingClientRect();n("dimensions",{width:p,height:y})}}),(m,p)=>e.state.showTooltip?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:d.normalizeClass(["tooltip-container",{locked:e.state.interactionMode==="interactive"}]),style:d.normalizeStyle({transform:f.value?`translate(${c.value}, ${l.value})`:`translate(${e.absoluteLeft}, ${e.absoluteTop})`,left:"0",top:"0",pointerEvents:f.value?"all":"none"})},[e.state.interactionMode==="selecting-chart-area"&&e.granularity&&e.zoomTimeRange&&e.zoomTimeRange.end&&e.zoomTimeRange.start?(d.openBlock(),d.createBlock(pm,{key:0,end:e.zoomTimeRange?.end,granularity:e.granularity,start:e.zoomTimeRange?.start},null,8,["end","granularity","start"])):e.state.interactionMode==="zoom-interactive"&&e.zoomTimeRange&&e.zoomActionItems&&e.granularity?(d.openBlock(),d.createBlock(HD,{key:1,granularity:e.granularity,"new-time-range":e.zoomTimeRange,"zoom-action-items":e.zoomActionItems,onOnAction:p[0]||(p[0]=y=>n("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(d.openBlock(),d.createElementBlock("div",VD,[d.createElementVNode("div",WD,[d.createElementVNode("div",$D,[d.createElementVNode("div",null,d.toDisplayString(e.tooltipTitle),1),f.value?(d.openBlock(),d.createBlock(d.unref(Wi.DragIcon),{key:0,class:"drag-icon",color:`var(--kui-color-text-neutral, ${d.unref(Na)})`,size:`var(--kui-icon-size-30, ${d.unref(Ms)})`},null,8,["color","size"])):d.createCommentVNode("",!0)]),u.value||h.value?(d.openBlock(),d.createElementBlock("div",YD,[d.createElementVNode("div",jD,d.toDisplayString(u.value),1),d.createElementVNode("div",qD,d.toDisplayString(h.value),1)])):d.createCommentVNode("",!0)]),d.createElementVNode("ul",GD,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.state.tooltipSeries,({backgroundColor:y,borderColor:b,label:S,value:M,isSegmentEmpty:E},D)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:S+D},[e.state.tooltipSeries.length?(d.openBlock(),d.createElementBlock("li",KD,[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:String(y),borderColor:String(b)})},null,4),d.createElementVNode("span",{class:d.normalizeClass(["display-label",{empty:E}])},d.toDisplayString(S),3),d.createElementVNode("span",XD,d.toDisplayString(M),1)])):d.createCommentVNode("",!0)],64))),128))])]))],6)):d.createCommentVNode("",!0)}}),[["__scopeId","data-v-34c60646"]]),ZD={key:0,class:"legend-container","data-testid":"legend"},QD=["onClick"],JD=["title"],tC={class:"label truncate-label"},eC={key:0,class:"sub-label"},nC={class:"tooltip-content"},fl=ke(d.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(e){const t=e,{i18n:n}=mt.useI18n(),i=d.inject("showLegendValues",!1),s=d.inject("legendPosition",d.ref(be.Bottom)),o=(a=0,l)=>{if(t.chartInstance===null)return;const c=t.chartInstance instanceof pe?t.chartInstance:t.chartInstance.chart;r(a,l)?c.hide(a,l):c.show(a,l),c.update()},r=(a=0,l)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const c=t.chartInstance instanceof pe?t.chartInstance:t.chartInstance.chart;return c.getDatasetMeta(a).dataset||l===void 0?c.isDatasetVisible(a):c.getDataVisibility(l)};return(a,l)=>{const c=d.resolveComponent("KTooltip");return d.unref(s)!==d.unref(be).Hidden?(d.openBlock(),d.createElementBlock("ul",ZD,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.items,({fillStyle:u,strokeStyle:h,text:f,datasetIndex:m,index:p,value:y,isSegmentEmpty:b})=>(d.openBlock(),d.createElementBlock("li",{key:f,onClick:S=>o(m,p)},[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:u,"border-color":h})},null,4),d.createVNode(c,null,d.createSlots({default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["label-container",{"strike-through":!r(m,p)}]),title:y&&d.unref(i)?`${f}: ${y.formatted}`:f},[d.createElementVNode("div",tC,d.toDisplayString(f),1),y&&d.unref(i)?(d.openBlock(),d.createElementBlock("div",eC,d.toDisplayString(y.formatted),1)):d.createCommentVNode("",!0)],10,JD)]),_:2},[b?{name:"content",fn:d.withCtx(()=>[d.createElementVNode("div",nC,d.toDisplayString(d.unref(n).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,QD))),128))])):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-e6664c85"]]),Qt=[];for(let e=0;e<256;++e)Qt.push((e+256).toString(16).slice(1));function iC(e,t=0){return(Qt[e[t+0]]+Qt[e[t+1]]+Qt[e[t+2]]+Qt[e[t+3]]+"-"+Qt[e[t+4]]+Qt[e[t+5]]+"-"+Qt[e[t+6]]+Qt[e[t+7]]+"-"+Qt[e[t+8]]+Qt[e[t+9]]+"-"+Qt[e[t+10]]+Qt[e[t+11]]+Qt[e[t+12]]+Qt[e[t+13]]+Qt[e[t+14]]+Qt[e[t+15]]).toLowerCase()}const sC=new Uint8Array(16);function oC(){return crypto.getRandomValues(sC)}function ml(e,t,n){return crypto.randomUUID?crypto.randomUUID():rC(e)}function rC(e,t,n){e=e||{};const i=e.random??e.rng?.()??oC();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,iC(i)}const gm=(e,t)=>{const n=e.ctx,i=e.scales.y,s=e.scales.x,o=t[t.length-1].element;n.save(),n.strokeStyle="rgba(100, 100, 100, 1)",n.lineWidth=3,e.options.indexAxis==="x"?n.strokeRect(o.x-o.width/2,o.y,o.width,i.bottom-o.y):n.strokeRect(s.left,o.y-o.height/2,o.x-s.left,o.height),n.restore()};class ym{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&gm(t,this._clickedElements)}afterEvent(t,{event:n}){if(n.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(n.type!=="click"||!n.native||this._pause)return;this._clicked=!this._clicked;const i=t.options.interaction?.mode||"index",s=t.getElementsAtEventForMode(n.native,i,{intersect:!1},!0);s.length&&this._clicked?(this._clickedElements=s,gm(t,this._clickedElements),this._previousHoverOption=t.options.hover,t.options.hover={mode:null}):(delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1)}beforeDestroy(t){delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1}pause(){this._pause=!0}get isPaused(){return this._pause}resume(t=!1){this._pause=!1,t&&(this._suppressNextClick=!0)}}const aC=["id"],lC=["id"],cC={class:"axis-tooltip-content"},uC="100%",dC="100%",hC=20,fC=20,bm=6,mC=0,pC=10,gC=10,yC=1,bC=ke(d.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},tooltipMetricDisplay:{default:""}},setup(e){const t=e,{i18n:n}=mt.useI18n(),{translateUnit:i}=mt.useTranslatedUnits(),s=crypto.randomUUID(),o=crypto.randomUUID(),r=new ym,a=d.useTemplateRef("chartContainer"),l=d.useTemplateRef("chartParent"),c=({chart:q},G)=>{const J=q.data,nt=J.labels?.indexOf(G);return J.datasets.reduce((tt,Z,pt)=>{if(q.isDatasetVisible(pt)){const bt=Z.data[nt];return isNaN(bt)?tt:tt+bt}else return tt},0)},u=(q,G,J,nt)=>{const tt=nt==="horizontal";G===null&&(G=n.t("entityNoName"));const Z={type:"label",yValue:ot=>tt?G:c(ot,G),xValue:ot=>tt?c(ot,G):G},pt={...Z,position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>tt?0:-Math.abs(L1()),content:ot=>Xh(c(ot,G),J)},bt={...Z,content:ot=>F1(c(ot,G),N1(ot.chart,q)),position:tt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:ot=>tt?I1(Xh(c(ot,G),J)):0,color:D1};return{[`${G}-value`]:pt,[`${G}-percent`]:bt}},h=d.useTemplateRef("canvas"),f=d.useTemplateRef("axis"),m=ml(),p=ml(),y=d.ref([]),b=d.inject("legendPosition",be.Bottom),S=d.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),M=d.toRef(t,"metricUnit"),E=d.computed(()=>t.orientation==="horizontal"),D=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:d.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:d.toRef(t,"dimensionAxesTitle"),tooltipSeries:[],left:"",top:"",units:d.toRef(t,"metricUnit"),translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:E.value?"horizontal_bar":"vertical_bar",chartID:o,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:C,tooltipAbsoluteTop:A}=mt.useTooltipAbsolutePosition(l,D),O=d.ref(0),x=()=>t.annotations&&t.chartData.labels?.reduce((q,G)=>Object.assign(q,u(t.chartData,G,M.value,t.orientation)),{}),_={id:m,afterUpdate(q){O.value+=1,y.value=$h(q,t.legendValues,t.chartLegendSortFn)}},v={id:p,afterUpdate(q){q.options.plugins.annotation.annotations=t.annotations?x():{}}},I=[_,{id:"axisHover",afterEvent(q,G){if(S.show=!1,G.event.type==="mousemove"){const J=G.event,nt=q.options.indexAxis,tt=q.scales,Z=q.scales[nt].getLabelForValue(Number(q.scales[nt].getValueForPixel(J[nt]))),bt=q.scales[nt].getLabels().indexOf(Z),ot=t.chartData.isLabelEmpty?.[bt];if((ct=>ct==="x"?J.y>tt.x.top:J.x<tt.y.right)(nt)){D.interactionMode!=="interactive"&&(D.showTooltip=!1);const $t=q.canvas.getContext("2d").measureText(Z).width,lt=Math.abs(Math.round(J.x-$t*.5)),Mt=Math.round(J.x+$t*.5),Yt=q.canvas.getBoundingClientRect(),_e=40;S.left=nt==="x"?`${(lt>0?lt:Mt)-S.offset+Yt.left}px`:`${J.x-$t*.5-S.offset+Yt.left}px`,S.top=`${J.y-_e+Yt.top}px`,Z.length>$o?(S.show=!0,S.text=Z):ot?(S.text=n.t("emptyEntityInfo"),S.show=!0):S.show=!1}else S.show=!1}}},r,...t.annotations?[v]:[]],Y=d.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),U=d.ref(0),j=d.ref(0),H=new ResizeObserver(Wh(q=>{U.value=q[0].contentRect.width,j.value=q[0].contentRect.height},100)),$=d.computed(()=>{const q=t.chartData?.labels?.length;return h.value&&q&&!E.value?`${Math.max(q*(hC+bm),U.value)}px`:uC}),R=d.computed(()=>{const q=t.chartData?.labels?.length;return h.value&&q&&E.value?`${Math.max(q*(fC+bm),j.value)}px`:dC});mt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey")),d.onMounted(()=>{t.annotations&&pe.register(mm),a.value&&(U.value=a.value.offsetWidth,j.value=a.value.offsetHeight,H.observe(a.value))}),d.onUnmounted(()=>{a.value&&H.unobserve(a.value)});const B=d.computed(()=>{const q=mt.useBarChartOptions({tooltipState:D,legendID:m,stacked:d.toRef(t,"stacked"),metricAxesTitle:d.toRef(t,"metricAxesTitle"),dimensionAxesTitle:d.toRef(t,"dimensionAxesTitle"),indexAxis:E.value?"y":"x",numLabels:Y});return{...q.value,plugins:{...q.value.plugins,annotation:{annotations:x(),clip:!1}}}}),z=mt.useChartJSCommon("bar",h,d.toRef(t,"chartData"),I,B);d.onBeforeUnmount(()=>{pe.unregister(mm)});const P={[be.Bottom]:"column"},N=d.computed(()=>{if(f.value&&z.value){const q=window.devicePixelRatio,G=z.value,J=G.scales.y.width*q+yC,nt=(G.scales.y.height+G.scales.y.top+G.scales.x.height)*q,tt=f.value.getContext("2d");return tt.scale(q,q),tt.canvas.width=J,tt.canvas.height=nt,tt.canvas.style.width=`${J/q}px`,tt.canvas.style.height=`${nt/q}px`,{scale:q,width:J*q,height:nt*q,targetCtx:tt}}return null}),V=q=>{const G=q.target;if(N.value&&z.value&&!E.value){const J=N.value.scale,nt=N.value.targetCtx,tt=N.value.width,Z=N.value.height,pt=z.value,bt=pt.canvas;nt.fillStyle="white",G.scrollLeft>=mC&&G.scrollLeft<=pC?(nt.globalCompositeOperation="source-over",nt.clearRect(0,0,tt,Z),nt.drawImage(bt,0,0,tt,Z,0,0,tt,Z),nt.globalCompositeOperation="destination-over",nt.fillRect(0,0,tt,Z)):(nt.globalCompositeOperation="source-over",nt.fillRect(0,(pt.scales.y.height+pt.scales.y.top+gC)*J,tt,pt.scales.x.height*J))}D.offsetY=G.scrollTop,D.offsetX=G.scrollLeft,S.offset=G.scrollLeft},Q=({width:q,height:G})=>{D.width=q,D.height=G};d.watch(()=>t.orientation,()=>{if(f.value&&N.value){const q=N.value.width,G=N.value.height;(f.value?.getContext("2d")).clearRect(0,0,q,G)}D.showTooltip=!1,D.interactionMode="idle"}),d.watch(()=>t.annotations,q=>{z.value&&(q?z.value.options.plugins.annotation.annotations=x(t.chartData):delete z.value.options.plugins.annotation.annotations)});const X=()=>{D.showTooltip&&(D.interactionMode!=="idle"?D.interactionMode="idle":D.interactionMode="interactive")};return(q,G)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",P[d.unref(b)]])},[d.createElementVNode("canvas",{id:d.unref(s),ref:"axis",class:"axis"},null,8,aC),d.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:G[0]||(G[0]=J=>X()),onScroll:V},[d.createElementVNode("div",{class:"chart-body",style:d.normalizeStyle({width:$.value,height:R.value})},[d.createElementVNode("canvas",{id:d.unref(o),ref:"canvas",class:"chart-canvas"},null,8,lC)],4)],544),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[S.show?(d.openBlock(),d.createElementBlock("div",{key:0,class:"axis-tooltip",style:d.normalizeStyle({top:S.top,left:S.left}),width:"auto"},[d.createElementVNode("div",cC,d.toDisplayString(S.text),1)],4)):d.createCommentVNode("",!0),d.createVNode(sr,{"absolute-left":d.unref(C),"absolute-top":d.unref(A),"chart-parent-ref":l.value,state:D,"tooltip-title":e.tooltipTitle,onDimensions:Q},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),d.createVNode(fl,{id:d.unref(m),"chart-instance":d.unref(z),items:y.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-60e5a1a7"]]);const _C={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};du._date.override({_id:"date-fns",formats:function(){return _C},parse:function(e,t){if(e===null||typeof e>"u")return null;const n=typeof e;return n==="number"||e instanceof Date?e=ut(e):n==="string"&&(typeof t=="string"?e=dw(e,t,new Date,this.options):e=Kd(e,this.options)),ga(e)?e.getTime():null},format:function(e,t){return Ao(e,t,this.options)},add:function(e,t,n){switch(n){case"millisecond":return ma(e,t);case"second":return r_(e,t);case"minute":return s_(e,t);case"hour":return e_(e,t);case"day":return Oo(e,t);case"week":return a_(e,t);case"month":return fa(e,t);case"quarter":return o_(e,t);case"year":return l_(e,t);default:return e}},diff:function(e,t,n){switch(n){case"millisecond":return ya(e,t);case"second":return g_(e,t);case"minute":return f_(e,t);case"hour":return h_(e,t);case"day":return Cd(e,t);case"week":return y_(e,t);case"month":return Pd(e,t);case"quarter":return p_(e,t);case"year":return b_(e,t);default:return 0}},startOf:function(e,t,n){switch(t){case"second":return pw(e);case"minute":return mw(e);case"hour":return fw(e);case"day":return pa(e);case"week":return Ve(e);case"isoWeek":return Ve(e,{weekStartsOn:+n});case"month":return x_(e);case"quarter":return __(e);case"year":return Rd(e);default:return e}},endOf:function(e,t){switch(t){case"second":return k_(e);case"minute":return T_(e);case"hour":return S_(e);case"day":return Ed(e);case"week":return v_(e);case"month":return Ad(e);case"quarter":return M_(e);case"year":return w_(e);default:return e}}});const _m={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},xC={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},..._m,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},wC=d.version[0]==="2"?(e,t)=>Object.assign(e,{attrs:t}):(e,t)=>Object.assign(e,t);function Ri(e){return d.isProxy(e)?d.toRaw(e):e}function SC(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return d.isProxy(t)?new Proxy(e,{}):e}function vC(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function xm(e,t){e.labels=t}function wm(e,t,n){const i=[];e.datasets=t.map(s=>{const o=e.datasets.find(r=>r[n]===s[n]);return!o||!s.data||i.includes(o)?{...s}:(i.push(o),Object.assign(o,s),o)})}function TC(e,t){const n={labels:[],datasets:[]};return xm(n,e.labels),wm(n,e.datasets,t),n}const MC=d.defineComponent({props:xC,setup(e,t){let{expose:n,slots:i}=t;const s=d.ref(null),o=d.shallowRef(null);n({chart:o});const r=()=>{if(!s.value)return;const{type:c,data:u,options:h,plugins:f,datasetIdKey:m}=e,p=TC(u,m),y=SC(p,u);o.value=new pe(s.value,{type:c,data:y,options:{...h},plugins:f})},a=()=>{const c=d.toRaw(o.value);c&&(e.destroyDelay>0?setTimeout(()=>{c.destroy(),o.value=null},e.destroyDelay):(c.destroy(),o.value=null))},l=c=>{c.update(e.updateMode)};return d.onMounted(r),d.onUnmounted(a),d.watch([()=>e.options,()=>e.data],(c,u)=>{let[h,f]=c,[m,p]=u;const y=d.toRaw(o.value);if(!y)return;let b=!1;if(h){const S=Ri(h),M=Ri(m);S&&S!==M&&(vC(y,S),b=!0)}if(f){const S=Ri(f.labels),M=Ri(p.labels),E=Ri(f.datasets),D=Ri(p.datasets);S!==M&&(xm(y.config.data,S),b=!0),E&&E!==D&&(wm(y.config.data,E,e.datasetIdKey),b=!0)}b&&d.nextTick(()=>{l(y)})},{deep:!0}),()=>d.h("canvas",{role:"img","aria-label":e.ariaLabel,"aria-describedby":e.ariaDescribedby,ref:s},[d.h("p",{},[i.default?i.default():""])])}});function pl(e,t){return pe.register(t),d.defineComponent({props:_m,setup(n,i){let{expose:s}=i;const o=d.shallowRef(null),r=a=>{o.value=a?.chart};return s({chart:o}),()=>d.h(MC,wC({ref:r},{type:e,...n}))}})}const Sm=pl("bar",lu),vm=pl("doughnut",ss),Tm=pl("line",cu),kC={class:"chart-container"},DC={key:0,class:"chart-center-metric"},CC={class:"chart-center-total"},OC={key:0,class:"chart-center-unit"},EC=d.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},metricName:{default:""},legendPosition:{default:be.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>Mn},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""},showCenterMetric:{type:Boolean,default:!0}},setup(e){const t=e,{translateUnit:n}=mt.useTranslatedUnits(),{i18n:i}=mt.useI18n(),s=crypto.randomUUID(),o=crypto.randomUUID(),r=d.ref([]),a=d.useTemplateRef("chartParent"),l=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:d.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:d.toRef(t,"tooltipDimensionDisplay"),tooltipSeries:[],left:"",top:"",units:d.toRef(t,"metricUnit"),translateUnit:n,offsetX:0,offsetY:0,width:0,height:0,chartID:o,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:c,tooltipAbsoluteTop:u}=mt.useTooltipAbsolutePosition(a,l),h={id:s,afterUpdate(O){r.value=O.options.plugins.legend.labels.generateLabels(O).map(x=>({...x,value:t.legendValues&&t.legendValues[x.text],hidden:!1}))}},f=d.computed(()=>[h]),m=d.computed(()=>[t.chartData.datasets.reduce((x,_)=>(x.labels.push(_.label),x.backgroundColor.push(_.backgroundColor),x.hoverBorderColor.push(Ir(_.backgroundColor).saturate(.5).darken(.15).hexString()),x.data.push(_.data.reduce((v,k)=>v+k,0)),x),{labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:p}=Kn({i18n:i}),y=d.computed(()=>wM(t.metricName??"")),b=d.computed(()=>{const O=m.value[0]?.data.reduce((x,_)=>x+_,0)??0;return p(O,t.metricUnit,{approximate:!0,translateUnit:(x,_)=>n(x,_)}).trim()}),S=d.computed(()=>t.tooltipMetricDisplay||""),M=d.computed(()=>({...t.chartData,datasets:m.value}));mt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const{options:E}=mt.useDonutChartOptions({tooltipState:l,legendID:s}),D=d.ref(),C=O=>({[be.Bottom]:"column",[be.Hidden]:"hidden"})[O],A=({width:O,height:x})=>{l.width=O,l.height=x};return(O,x)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",C(e.legendPosition)]),"data-testid":"donut-chart-parent"},[d.createElementVNode("div",kC,[d.createVNode(d.unref(vm),{ref_key:"chartInstance",ref:D,"chart-id":d.unref(o),data:M.value,options:d.unref(E),plugins:f.value},null,8,["chart-id","data","options","plugins"]),e.showCenterMetric&&y.value?(d.openBlock(),d.createElementBlock("div",DC,[d.createElementVNode("span",CC,d.toDisplayString(b.value),1),S.value?(d.openBlock(),d.createElementBlock("span",OC,d.toDisplayString(S.value),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createVNode(sr,{"absolute-left":d.unref(c),"absolute-top":d.unref(u),state:l,"tooltip-title":e.tooltipTitle,unit:e.metricUnit,onDimensions:A},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),d.createVNode(fl,{id:d.unref(s),"chart-instance":D.value,items:r.value,position:e.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),AC=ke(EC,[["__scopeId","data-v-48b16272"]]),gl=(e,t,n,i,s="#0275d8")=>{e.save(),e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=1,e.strokeStyle=s,e.stroke(),e.restore()},de={},PC=()=>{de.x=void 0,de.chart=void 0,de.strategy=void 0,de.group=void 0},RC=10;class Mm{id="verticalLinePlugin";_clickedSegment;_pause=!1;_useBrushingState=!1;_brushStrategy;_brushGroup;constructor({brushGroup:t=void 0,brushStrategy:n=void 0,enableBrushing:i=!1}={}){let s=!1;n==="group"&&(s=t!==void 0),this._useBrushingState=i&&s,this._brushStrategy=n,this._brushGroup=t}afterEvent(t,n){if(!this._useBrushingState)return;const{event:i}=n;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(s=>this.onMouseBrush(i.type,t,s))}_lastMouseBrushEvent=0;onMouseBrush(t,n,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<RC)return;const s=()=>{de.chart=n,de.strategy=this._brushStrategy,de.group=this._brushGroup;for(const o of Object.values(pe.instances))o!==n&&o.update("none")};t==="mousemove"?n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&(de.x=n.tooltip.dataPoints[0].element.x,s()):t==="mouseout"&&(de.x=void 0,s()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const n=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:s}=this._clickedSegment.element;gl(i,s,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(n){const{x:s}=t.tooltip.dataPoints[0].element;gl(i,s,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(de.x===void 0)return;const n=de.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&de.group===this._brushGroup&&gl(t.ctx,de.x,t.scales.y.top,t.scales.y.bottom,n)}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(t){if(this._clickedSegment&&this.destroyClickedSegment(),this._useBrushingState&&de.chart===t){const n=de.x!==void 0;if(PC(),n)for(const i of Object.values(pe.instances))i!==t&&i.update("none")}}}const IC=(e,t,n)=>{const i=e.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,e.chartArea.top),i.lineTo(t,e.chartArea.bottom),i.moveTo(n,e.chartArea.top),i.lineTo(n,e.chartArea.bottom),i.stroke(),i.restore()},LC=(e,t,n)=>{const i=e.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,e.chartArea.top,n-t,e.chartArea.bottom-e.chartArea.top),i.restore()},km=(e,t,n)=>{const i=t.scales.x.getValueForPixel(n.startX),s=t.scales.x.getValueForPixel(n.endX);i&&s&&t.canvas.dispatchEvent(new CustomEvent(e,{detail:{xStart:Math.min(i,s),xEnd:Math.max(i,s)}}))};class NC{id="dragSelectPlugin";_isDragging=!1;_startX=0;_endX=0;_dragTimeout;_clearSelectionArea=!0;_chart=null;_dragSelectHandlers;get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const n=t.canvas;let i=!1;const s=a=>{this._dragTimeout=window.setTimeout(()=>{const l=n.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=a.clientX-l.left},150)},o=a=>{const l=n.getBoundingClientRect();i&&this._isDragging&&(this._endX=a.clientX-l.left,km("dragSelectMove",t,this))},r=a=>{const l=n.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=a.clientX-l.left,km("dragSelect",t,this),i=!1,this._isDragging=!1)};n.addEventListener("mousedown",s),n.addEventListener("mousemove",o),n.addEventListener("mouseup",r),this._dragSelectHandlers={onMouseDown:s,onMouseMove:o,onMouseUp:r}}beforeDestroy(t){const n=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:s,onMouseUp:o}=this._dragSelectHandlers;n.removeEventListener("mousedown",i),n.removeEventListener("mousemove",s),n.removeEventListener("mouseup",o)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(LC(t,this._startX,this._endX),IC(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const FC=["hidden","single","full"];var ei=(e=>(e.String="string",e.Number="number",e.Boolean="boolean",e.Object="object",e.Undefined="undefined",e))(ei||{});const BC=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],zC=["gauge","top_n","single_value"],UC=20,HC="rgba(255, 171, 171, 0.4)",VC="rgba(255, 196, 0, 0.2)",Dm=(e,t,n)=>{const i=t.y-e.y;if(i===0)return t.x;const s=(n-e.y)/i;return e.x+s*(t.x-e.x)},WC=(e,t)=>{const n=[];return e.data.datasets.forEach(i=>{if(!e.getDatasetMeta(e.data.datasets.indexOf(i)).visible)return;const o=i.data;o?.length&&t.filter(r=>r.highlightIntersections).forEach(r=>{const a=o.map(c=>({ts:c.x,aboveThreshold:c.y>=r.value}));let l=a[0].aboveThreshold?o[0].x:void 0;for(let c=1;c<a.length;c++)!a[c-1].aboveThreshold&&a[c].aboveThreshold?l=Dm(o[c-1],o[c],r.value):a[c-1].aboveThreshold&&!a[c].aboveThreshold&&l!==void 0&&(n.push({start:l,end:Dm(o[c-1],o[c],r.value),type:r.type}),l=void 0);l!==void 0&&n.push({start:l,end:a[a.length-1].ts,type:r.type})})}),n},$C=e=>{if(!e.length)return[];e.sort((n,i)=>n.type.localeCompare(i.type)||n.start-i.start);const t=[];for(const n of e){const i=t.findLast(({type:s})=>s===n.type);i&&n.start<=i.end?i.end=Math.max(i.end,n.end):t.push({...n})}return t};class YC{constructor(t){this.i18n=t}i18n;id="thresholdPlugin";_thresholds;_mouseMoveHandler;_syncThresholds(t){for(const n of Object.keys(t.threshold||{})){const i=t.threshold?.[n];i&&(this._thresholds={...this._thresholds,[n]:i.map(s=>({...s,hovered:!1}))})}if(this._thresholds)for(const n of Object.keys(this._thresholds))t.threshold?.[n]||delete this._thresholds[n]}get thresholds(){return this._thresholds}beforeUpdate(t,n,i){this._syncThresholds(i)}beforeInit(t,n,i){const s=t.canvas;this._syncThresholds(i);const o=r=>{if(t){const a=r.clientY,l=t.scales.y,c=s.getBoundingClientRect(),u=l.getValueForPixel(a-c.top);if(u)for(const h of Object.keys(this._thresholds||{})){const f=this._thresholds?.[h];f&&f.forEach(m=>{m.hovered=Math.abs(m.value-u)<UC})}}};s.addEventListener("mousemove",o),this._mouseMoveHandler=o}afterDatasetsDraw(t,n){const i=t.ctx;for(const s of Object.keys(this._thresholds||{})){const o=this._thresholds?.[s];if(o){o.forEach(l=>{const u=t.scales.y.getPixelForValue(l.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,u),i.lineTo(t.chartArea.right,u),i.lineWidth=1,i.strokeStyle=Ba(l.type),i.setLineDash([5,5]),i.stroke(),i.restore();let h="";l.label?h=`${l.label}: ${l.value}`:l.type==="warning"?h=this.i18n.t("chartLabels.threshold-warning",{value:l.value}):l.type==="error"?h=this.i18n.t("chartLabels.threshold-error",{value:l.value}):h=this.i18n.t("chartLabels.thatreshold-neutral",{value:l.value}),l.hovered&&(i.save(),i.fillStyle=Ba(l.type),i.font=aT,i.fillText(h,t.chartArea.left,u-4),i.restore())});const r=WC(t,o);$C(r).forEach(l=>{const c=t.scales.x.getPixelForValue(l.start),u=t.scales.x.getPixelForValue(l.end);i.save(),i.fillStyle=l.type==="error"?HC:VC,i.fillRect(c,t.chartArea.top,u-c,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(c,t.chartArea.bottom),i.lineTo(u,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=Ba(l.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const jC=ke(d.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(e,{emit:t}){const n=e,i=t,{i18n:s}=mt.useI18n(),o=new Mm,r=new ym,a=new NC,l=new YC(s),{translateUnit:c}=mt.useTranslatedUnits(),u=d.ref(),h=crypto.randomUUID(),f=crypto.randomUUID(),m=d.ref([]),p=d.inject("legendPosition",be.Bottom),y=d.useTemplateRef("chartParent"),b=d.ref(void 0),S=d.ref(!1),M=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:d.toRef(n,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:d.toRef(n,"metricUnit"),translateUnit:c,offsetX:0,offsetY:0,width:0,height:0,chartType:n.type,chartID:f,chartTooltipSortFn:n.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:E,tooltipAbsoluteTop:D}=mt.useTooltipAbsolutePosition(y,M),C={id:h,afterUpdate(z){m.value=$h(z,n.legendValues,n.chartLegendSortFn)}},A=d.computed(()=>[C,r,...n.brush?[a]:[],...n.type==="timeseries_line"?[o]:[],...n.threshold?[l]:[]]),O=d.computed(()=>`line-${A.value.map(z=>z.id).join("-")}`),x=d.computed(()=>`bar-${A.value.map(z=>z.id).join("-")}`),_=d.computed(()=>n.chartData&&Kv(n.chartData)),{options:v}=mt.useLineChartOptions({tooltipState:M,timeRangeMs:d.toRef(n,"timeRangeMs"),granularity:d.toRef(n,"granularity"),legendID:h,stacked:d.toRef(n,"stacked"),metricAxesTitle:d.toRef(n,"metricAxesTitle"),dimensionAxesTitle:d.toRef(n,"dimensionAxesTitle"),pointsWithoutHover:_,threshold:d.toRef(n,"threshold")});mt.useReportChartDataForSynthetics(d.toRef(n,"chartData"),d.toRef(n,"syntheticsDataKey"));const k=z=>({[be.Bottom]:"column",[be.Hidden]:"hidden"})[z],I=({width:z,height:P})=>{M.width=z,M.height=P},Y=(z=!0)=>{M.interactionMode="idle",M.showTooltip=!1,a.clearSelectionArea(),r.isPaused&&r.resume(z),o.isPaused&&o.resume()},U=()=>{M.interactionMode="interactive"},j=()=>{!u.value||!u.value.chart.tooltip?.dataPoints?.length||(M.interactionMode==="interactive"?o.clickedSegment=u.value.chart.tooltip.dataPoints[0]:o.destroyClickedSegment())},H=()=>{if(S.value){S.value=!1;return}M.interactionMode!=="idle"?Y():U(),j()};d.watch(()=>n.type,()=>{M.interactionMode="idle",M.showTooltip=!1,o.destroyClickedSegment()});const $=z=>{z.preventDefault(),z.stopPropagation();const{xStart:P,xEnd:N}=z.detail;P&&N&&(b.value={start:new Date(P),end:new Date(N),type:"absolute"},M.interactionMode="zoom-interactive",i("select-chart-range",b.value))},R=z=>{M.interactionMode="selecting-chart-area",S.value=!0,o.pause(),r.pause();const{xStart:P,xEnd:N}=z.detail;P&&N&&(b.value={start:new Date(P),end:new Date(N),type:"absolute"})},B=z=>{if(!y.value||M.interactionMode==="idle")return;const P=z.target;P&&y.value.contains(P)||S.value||Y(!1)};return d.watch(()=>u.value?.chart,()=>{u.value?.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",$),u.value.chart.canvas.removeEventListener("dragSelectMove",R),u.value.chart.canvas.addEventListener("dragSelect",$),u.value.chart.canvas.addEventListener("dragSelectMove",R))}),d.onMounted(()=>{document.addEventListener("click",B,!0)}),d.onUnmounted(()=>{u.value?.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",$),u.value.chart.canvas.removeEventListener("dragSelectMove",R)),document.removeEventListener("click",B,!0)}),(z,P)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",k(d.unref(p))]),"data-testid":"line-chart-parent"},[d.createElementVNode("div",{class:"chart-container",onClick:P[0]||(P[0]=N=>H())},[e.type==="timeseries_line"?(d.openBlock(),d.createBlock(d.unref(Tm),{key:O.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-line-chart",options:d.unref(v),plugins:A.value},null,8,["chart-id","data","options","plugins"])):e.type==="timeseries_bar"?(d.openBlock(),d.createBlock(d.unref(Sm),{key:x.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-bar-chart",options:d.unref(v),plugins:A.value},null,8,["chart-id","data","options","plugins"])):d.createCommentVNode("",!0)]),d.createVNode(sr,{"absolute-left":d.unref(E),"absolute-top":d.unref(D),"data-testid":"tooltip",granularity:e.granularity,state:M,"tooltip-title":e.tooltipTitle,"zoom-action-items":e.zoomActionItems,"zoom-time-range":b.value,onDimensions:I,onOnAction:P[1]||(P[1]=()=>Y(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),d.createVNode(fl,{id:d.unref(h),"chart-instance":u.value,"data-testid":"legend",items:m.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-ac6e8bbc"]]),qC={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},GC={class:"tooltip-content"},KC={key:2,class:"analytics-chart-parent"},XC=d.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:be.Bottom},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!1},showAnnotations:{type:Boolean,default:!0},timeseriesZoom:{type:Boolean,default:!1},requestsLink:{default:void 0},exploreLink:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(e,{emit:t}){const n=t,i=e,{i18n:s}=mt.useI18n(),o=d.computed(()=>b.value?mt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Ua},d.toRef(i,"chartData")).value:mt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Ua},d.toRef(i,"chartData")).value),r=d.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),a=d.computed(()=>{if(!i.chartData?.meta)return 0;if(i.chartData.meta.start&&i.chartData.meta.end){const U=new Date(i.chartData.meta.start).getTime();return new Date(i.chartData.meta.end).getTime()-U}}),l=d.computed(()=>i.chartData.meta?.metric_units?Object.values(i.chartData.meta.metric_units)[0]:""),c=d.computed(()=>i.chartData.meta?.metric_units?Object.keys(i.chartData.meta.metric_units)[0]??"":""),u=d.computed(()=>i.showLegendValues&&i.legendPosition!==be.Hidden),{legendValues:h}=mt.useChartLegendValues(o,i.chartOptions.type,l),f=d.computed(()=>i.chartData?.meta?.limit?.toString()||null),m=d.computed(()=>i.chartOptions.hideTruncationWarning?!1:i.chartData?.meta?.truncated||!1),p=d.computed(()=>s.t("limitedResultsShown",{maxReturned:f.value})),y=d.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),b=d.computed(()=>["timeseries_bar","timeseries_line"].some(U=>U===i.chartOptions.type)),S=d.computed(()=>i.chartOptions.type==="donut"),M=d.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),E=d.computed(()=>{if(!i.chartData?.meta.metric_names||!i.chartData?.meta.metric_units)return;const U=i.chartData.meta.metric_names[0],j=i.chartData.meta.metric_units[U]||"";if(i.chartData.meta.metric_names.length>1){if(U.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${j}`,{plural:"s"})});if(U.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${j}`,{plural:"s"})})}if(U)return Cs(j)&&s.te(`metricAxisTitles.${U}`)?s.t(`metricAxisTitles.${U}`)||void 0:s.te(`chartLabels.${U}`)?s.t(`chartLabels.${U}`):U}),D=d.computed(()=>{if(i.chartOptions?.metricAxesTitle)return i.chartOptions?.metricAxesTitle;if(!i.chartData?.meta.metric_names||!i.chartData?.meta.metric_units)return;const U=i.chartData.meta.metric_names[0],j=i.chartData.meta.metric_units[U]||"";if(i.chartData.meta.metric_names.length>1){if(U.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${j}`,{plural:"s"})});if(U.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${j}`,{plural:"s"})})}return s.te(`metricAxisTitles.${U}`)&&(Cs(j)||s.te(`chartUnits.${j}`))?Cs(j)?s.t(`metricAxisTitles.${U}`)||void 0:s.t(`metricAxisTitles.${U}`,{unit:s.t(`chartUnits.${j}`,{plural:"s"})})||void 0:U||void 0}),C=d.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const U=b.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];if(U)return s.te(`chartLabels.${U}`)?s.t(`chartLabels.${U}`):U}),A=d.computed(()=>{if(Uw(i.chartData.meta.datasource))return s.t("timestampAxisTitles.platform");const U=Ra(Number(i.chartData.meta.granularity_ms));if(U)return s.te(`granularityAxisTitles.${U}`)?s.t(`granularityAxisTitles.${U}`):U}),O=d.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),x=d.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),_=d.computed(()=>b.value?Xv(o.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),v=d.computed(()=>i.chartData.meta.granularity_ms?Ra(i.chartData.meta.granularity_ms)||"hourly":Ra(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),k=d.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(U,j)=>U.text===s.t("chartLabels.____OTHER____")?1:j.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(U.text,10))&&!isNaN(parseInt(j.text,10))?U.text<j.text?-1:1:U.value&&j.value?j.value.raw-U.value.raw:0),I=d.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(U,j)=>U.label===s.t("chartLabels.____OTHER____")?1:j.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(U.label,10))&&!isNaN(parseInt(j.label,10))?U.label<j.label?-1:1:U.value&&j.value?j.rawValue-U.rawValue:0),Y=d.computed(()=>[...i.timeseriesZoom?[{label:s.t("zoom_action_items.zoom"),key:"zoom-in",action:U=>n("zoom-time-range",U)}]:[],...i.exploreLink?[{label:s.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:s.t("zoom_action_items.view_requests"),key:"view-requests",href:i.requestsLink.href}]:[]]);return d.provide("showLegendValues",u),d.provide("legendPosition",d.toRef(i,"legendPosition")),(U,j)=>{const H=d.resolveComponent("KTooltip"),$=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["analytics-chart-shell",{"show-values":u.value}])},[_.value&&m.value&&f.value?(d.openBlock(),d.createElementBlock("div",qC,[d.createVNode(H,{class:"tooltip","max-width":"500",placement:"right"},{content:d.withCtx(()=>[d.createElementVNode("div",GC,d.toDisplayString(p.value),1)]),default:d.withCtx(()=>[d.createVNode(d.unref(Wi.WarningIcon),{color:`var(--kui-color-text-warning, ${d.unref(oT)})`,size:`var(--kui-icon-size-40, ${d.unref(lT)})`},null,8,["color","size"])]),_:1})])):d.createCommentVNode("",!0),_.value?(d.openBlock(),d.createElementBlock("div",KC,[b.value?(d.openBlock(),d.createBlock(jC,{key:0,brush:r.value,"chart-data":o.value,"chart-legend-sort-fn":k.value,"chart-tooltip-sort-fn":I.value,"dimension-axes-title":A.value,fill:e.chartOptions.stacked,granularity:v.value,"legend-values":d.unref(h),"metric-axes-title":D.value,"metric-unit":l.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,threshold:e.chartOptions.threshold,"time-range-ms":a.value,"tooltip-metric-display":E.value,"tooltip-title":e.tooltipTitle,type:e.chartOptions.type,"zoom-action-items":Y.value,onSelectChartRange:j[0]||(j[0]=R=>n("select-chart-range",R)),onZoomTimeRange:j[1]||(j[1]=R=>n("zoom-time-range",R))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):y.value?(d.openBlock(),d.createBlock(bC,{key:1,annotations:e.showAnnotations,"chart-data":o.value,"chart-legend-sort-fn":k.value,"chart-tooltip-sort-fn":I.value,"data-testid":"bar-chart-container","dimension-axes-title":C.value,"legend-values":d.unref(h),"metric-axes-title":D.value,"metric-unit":l.value,orientation:M.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,"tooltip-metric-display":E.value,"tooltip-title":e.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):S.value?(d.openBlock(),d.createBlock(AC,{key:2,"chart-data":o.value,"dataset-colors":e.chartOptions.chartDatasetColors||d.unref(Ua),"legend-position":e.legendPosition,"legend-values":d.unref(h),"metric-name":c.value,"metric-unit":l.value,"show-center-metric":e.chartOptions.showCenterMetric,"synthetics-data-key":e.syntheticsDataKey,"tooltip-dimension-display":C.value,"tooltip-metric-display":E.value,"tooltip-title":e.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-name","metric-unit","show-center-metric","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock($,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(O.value),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(x.value),1)]),_:1}))],2)}}}),ZC=ke(XC,[["__scopeId","data-v-346b2111"]]),QC={class:"chart-parent","data-testid":"gauge-chart-parent"},JC={class:"chart-totals-flex"},tO={key:1,class:"metric-small","data-testid":"gauge-chart-total"},eO=ke(d.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Mn},height:{type:String,required:!1,default:"400px",validator:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=mt.useI18n(),i=d.ref(ml()),s=d.computed(()=>[t.chartData.datasets.reduce((m,p)=>(m.labels.push(p.label),m.borderColor.push(p.backgroundColor),m.backgroundColor.push(p.backgroundColor),m.data.push(p.data.reduce((y,b)=>y+b,0)),m),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),o=d.computed(()=>({...t.chartData,datasets:s.value}));mt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const r={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},a=d.computed(()=>Es(s?.value[0]?.data[t.numerator],{capital:!0})),l=d.computed(()=>Es(s?.value[0]?.data[0]+s?.value[0]?.data[1],{capital:!0})),c=d.computed(()=>`color: ${s?.value[0]?.backgroundColor[t.numerator]}`),u=d.computed(()=>["full","single"].includes(t.metricDisplay)),h=d.computed(()=>t.metricDisplay==="full");return(f,m)=>(d.openBlock(),d.createElementBlock("div",QC,[d.createElementVNode("div",JC,[u.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:d.normalizeStyle(c.value)},d.toDisplayString(a.value),5)):d.createCommentVNode("",!0),h.value?(d.openBlock(),d.createElementBlock("div",tO,d.toDisplayString(d.unref(n).t("total"))+": "+d.toDisplayString(l.value),1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",{class:"chart-container",style:d.normalizeStyle({height:e.height,width:e.width})},[d.createVNode(d.unref(vm),{"chart-id":i.value,data:o.value,options:r},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),nO={key:1,class:"single-value-wrapper"},iO={class:"single-value-metric"},sO={class:"name-unit-alignment"},oO={class:"single-value","data-testid":"single-value-chart"},rO={key:0,class:"single-value-unit"},aO={class:"single-value-metric-name"},lO={key:0,class:"single-value-trend"},cO={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},yl="t1",bl="t2",uO=ke(d.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:_f},leftAlign:{type:Boolean,default:!1},showTrend:{type:Boolean,default:!1},increaseIsBad:{type:Boolean,default:!1},alignX:{type:String,default:"space-evenly"}},setup(e){const{i18n:t}=mt.useI18n(),{formatBytes:n,formatCost:i}=Kn({i18n:t}),s=e,o=d.computed(()=>`align-${s.leftAlign?"left":s.alignX}`),r=d.computed(()=>Ln.buildDeltaMapping(s.data,s.showTrend,{topLevelKey:yl,secondLevelKey:bl})),a=d.computed(()=>r.value?.previous?.[yl]?.[bl]),l=d.computed(()=>r.value?.current?.[yl]?.[bl]),c=d.computed(()=>s.data.data),u=d.computed(()=>s.data.meta?.metric_names?.[0]),h=d.computed(()=>t.te(`chartLabels.${u.value}`)?t.t(`chartLabels.${u.value}`):""),f=d.computed(()=>{const v=u.value?s.data.meta?.metric_units?.[u.value]:void 0;if(v){const k=`chartUnits.${v}`;return t.te(k)?t.t(k,{plural:""}):""}}),m=d.computed(()=>u.value==="request_per_minute"||!!u.value?.includes("_latency_")||u.value==="error_rate"),p=d.computed(()=>s.showTrend&&a.value!==void 0?a.value:null),y=d.computed(()=>{if(s.showTrend)return l.value??null;if(c.value.length<1||!u.value)return null;const v=c.value[0].event[u.value];return typeof v!="number"||isNaN(v)?null:v}),b=d.computed(()=>s.data?.data?.length===void 0||s.data?.data?.length===0||!s.showTrend&&y.value===null||s.showTrend&&p.value===null&&y.value===null),S=d.computed(()=>{const v=y.value;if(v===null)return"-";const k=u.value?s.data.meta?.metric_units?.[u.value]:void 0;if(k==="usd")return i(v);if(k==="bytes")return n(v);if(v>=1e9){const Y=(v/1e9).toFixed(1);return Y.endsWith(".0")?`${Math.floor(v/1e9)}B`:`${Y}B`}if(v>=1e7){const Y=(v/1e6).toFixed(1);return Y.endsWith(".0")?`${Math.floor(v/1e6)}M`:`${Y}M`}const I=s.decimalPoints&&typeof s.decimalPoints=="number"?s.decimalPoints:_f;return v.toLocaleString("en-US",{maximumFractionDigits:I})}),M=d.computed(()=>s.showTrend&&s.data?.data?.length<2),E=d.computed(()=>Ln.calculateChange(y.value??0,p.value??0)||0),D=d.computed(()=>{if(!s.showTrend)return 0;if(s.data?.data?.length<2){if(a.value===void 0)return 0;if(l.value===void 0)return s.increaseIsBad?1:-1}return Ln.changePolarity(E.value,!0,s.increaseIsBad)}),C=d.computed(()=>Ln.defineIcon(D.value,s.increaseIsBad)),A=d.computed(()=>{if(s.showTrend&&s.data?.data?.length<2){if(a.value===void 0)return t.t("singleValue.trend.not_available");if(l.value===void 0)return Ln.metricChange(-1,!0,t.t("singleValue.trend.not_available"))}return Ln.metricChange(E.value,s.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),O=Ln.useTrendRange(d.computed(()=>s.showTrend),void 0,d.computed(()=>s.data.meta)),x=v=>v>0?"positive":v<0?"negative":"neutral",_=v=>v>0?sT:v<0?iT:Gh;return d.onMounted(()=>{!s.showTrend&&s.data?.data?.length>1?console.warn("SingleValue chart should only be used with a single data point. Data length:",s.data.data.length):s.showTrend&&s.data?.data?.length>2&&console.warn("SingleValue with trend expects 2 or fewer data points. Instead got:",s.data.data.length)}),(v,k)=>{const I=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["chart-parent",o.value]),"data-testid":"single-value-parent"},[b.value?(d.openBlock(),d.createBlock(I,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:d.unref(t).t("singleValue.valueError")},null,8,["title"])):(d.openBlock(),d.createElementBlock("div",nO,[d.createElementVNode("div",iO,[d.createElementVNode("div",sO,[d.createElementVNode("span",oO,d.toDisplayString(S.value),1),m.value&&f.value?(d.openBlock(),d.createElementBlock("span",rO,"  "+d.toDisplayString(f.value),1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",aO,d.toDisplayString(h.value),1)]),e.showTrend?(d.openBlock(),d.createElementBlock("div",lO,[d.createElementVNode("div",{class:d.normalizeClass(["trend-change",x(D.value)]),"data-testid":"single-value-trend"},[M.value||D.value!==0?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(C.value),{key:0,color:_(D.value),size:`var(--kui-icon-size-30, ${d.unref(Ms)})`},null,8,["color","size"])):(d.openBlock(),d.createBlock(d.unref(Wi.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${d.unref(Gh)})`,size:`var(--kui-icon-size-30, ${d.unref(Ms)})`},null,8,["color","size"])),d.createElementVNode("div",null,d.toDisplayString(A.value),1)],2),d.unref(O)?(d.openBlock(),d.createElementBlock("div",cO,d.toDisplayString(d.unref(O)),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-0203459f"]]),dO={class:"simple-chart-shell"},hO={key:1,class:"analytics-chart-parent"},fO=ke(d.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=mt.useI18n(),i=d.computed(()=>{const c=mt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||Mn},d.toRef(t,"chartData")).value;return t.chartOptions?.reverseDataset&&c?.datasets.reverse(),c}),s=d.computed(()=>t.chartData.meta?.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""),o=d.computed(()=>t.chartOptions.type==="gauge"),r=d.computed(()=>t.chartOptions.type==="single_value"),a=d.computed(()=>t.emptyStateTitle||n.t("noDataAvailableTitle")),l=d.computed(()=>{const c=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(r.value){const u=t.chartData.meta?.metric_names?.[0];return c&&t.chartData.data[0].event[u]!==null}return c});return(c,u)=>{const h=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",dO,[l.value?(d.openBlock(),d.createElementBlock("div",hO,[o.value?(d.openBlock(),d.createBlock(eO,{key:0,"chart-data":i.value,"dataset-colors":e.chartOptions.chartDatasetColors,"is-simple":"","metric-display":e.chartOptions.metricDisplay,"metric-unit":s.value,numerator:e.chartOptions.numerator,"synthetics-data-key":e.syntheticsDataKey,width:e.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):d.createCommentVNode("",!0),r.value?(d.openBlock(),d.createBlock(uO,{key:1,"align-x":e.chartOptions.alignX,data:e.chartData,"decimal-points":e.chartOptions.decimalPoints,"increase-is-bad":e.chartOptions.increaseIsBad,"show-trend":e.chartOptions.showTrend},null,8,["align-x","data","decimal-points","increase-is-bad","show-trend"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock(h,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(a.value),1)]),_:1}))])}}}),[["__scopeId","data-v-23ca8c84"]]),mO={class:"top-n-card-title","data-testid":"top-n-card-title"},pO={class:"top-n-card-description","data-testid":"top-n-card-description"},gO={key:3,class:"top-n-table","data-testid":"top-n-table"},yO={"data-testid":"top-n-table-header"},bO={class:"top-n-table-header-row"},_O={class:"table-header-label"},xO=["data-testid"],wO=["data-testid"],SO=["data-testid"],vO=3,TO=ke(d.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(e){const t=e,{i18n:n}=mt.useI18n(),{formatUnit:i}=Kn({i18n:n}),s=d.computed(()=>t.data.data),o=d.computed(()=>!!s.value?.length),r=d.computed(()=>t.data.meta?.display?Object.keys(t.data.meta.display).slice(0,vO):[]),a=d.computed(()=>r.value[0]||""),l=d.computed(()=>r.value.length>1),c=d.computed(()=>r.value[r.value.length-1]||""),u=d.computed(()=>a.value?t.data.meta.display[a.value]:{}),h=d.computed(()=>t.data.meta?.metric_names?.length?t.data.meta.metric_names:[]),f=d.computed(()=>h.value[0]),m=d.computed(()=>f.value?U(f.value):""),p=d.computed(()=>{const H=r.value.map($=>({key:$,label:l.value?U($):n.t("topNTable.nameLabel"),type:"dimension"}));return f.value&&H.push({key:"value",label:m.value,type:"metric"}),h.value.forEach(($,R)=>{R!==0&&H.push({key:$,label:U($),type:"metric"})}),H}),y=d.computed(()=>p.value.filter(H=>H.type==="metric")),b=d.computed(()=>p.value.filter(H=>H.type==="dimension").slice(1)),S=H=>H.type==="dimension"&&H.key===c.value,M=H=>l.value&&H.type==="dimension"&&!S(H),E=H=>{const $=H.event;return String($[a.value])},D=(H,$)=>{const R=String(H.event[$]),B=t.data.meta?.display?.[$]?.[R];return{dimension:$,id:R,name:B?.name||"-",deleted:!!B?.deleted}},C=H=>{const $=E(H),R=u.value&&u.value[$];return R?R.name:"-"},A=H=>{const $=E(H),R=u.value&&u.value[$];return R?!!R.deleted:!1},O=(H,$)=>{const R=H.event[$];if(R==null)return"–";const B=typeof R=="number"?R:Number(R);if(Number.isNaN(B))return"–";const z=t.data.meta?.metric_units?.[$]||"count",P=["count","count/minute","token count"].includes(z);return i(B,z,{approximate:P,isBytes1024:!0,translateUnit:N=>j(N,B)})},x=H=>f.value?O(H,f.value):"–",_=d.computed(()=>s.value?.length?s.value.map(H=>{const $=r.value.map(P=>D(H,P)),R=$[0],B=R?.id||E(H),z={id:B,rowKey:$.map(P=>`${P.dimension}:${P.id}`).join("|")||B,name:R?.name||C(H),deleted:A(H),dimensions:$,original:H};return f.value&&(z.value=x(H)),h.value.forEach((P,N)=>{N!==0&&(z[P]=O(H,P))}),z}):[]),v=d.computed(()=>{if(!o.value)return"";if(t.data.meta){if(r.value.some(H=>!Object.keys(t.data.meta.display[H]||{}).length))return n.t("topNTable.errors.display");if(!f.value)return n.t("topNTable.errors.metricNames")}else return n.t("topNTable.errors.meta");return""}),k=(H,$)=>{const R=H[$];return typeof R=="string"?R:R==null?"–":String(R)},I=(H,$)=>H.dimensions.find(R=>R.dimension===$)?.name||"–",Y=(H,$)=>{const R=H.dimensions.find(B=>B.dimension===$);return{id:R?.id||"",name:R?.name||"–",deleted:R?.deleted||!1,dimension:$,dimensions:H.dimensions,isEmpty:R?.id==="empty"}},U=H=>n.te(`chartLabels.${H}`)?n.t(`chartLabels.${H}`):H,j=(H,$)=>{if(Cs(H)||H==="count"||H==="requests")return"";const R=$===1?"":"s";return n.te(`chartUnits.${H}`)?n.t(`chartUnits.${H}`,{plural:R}):H};return(H,$)=>{const R=d.resolveComponent("KEmptyState"),B=d.resolveComponent("KSkeleton"),z=d.resolveComponent("KCard");return d.openBlock(),d.createBlock(z,{class:"kong-ui-public-top-n-table","title-tag":e.titleTag},d.createSlots({default:d.withCtx(()=>[v.value?(d.openBlock(),d.createBlock(R,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("topNTable.defaultErrorStateTitle")),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(v.value),1)]),_:1})):e.isLoading?(d.openBlock(),d.createBlock(B,{key:1,"table-columns":2,type:"table"})):o.value?(d.openBlock(),d.createElementBlock("div",gO,[d.createElementVNode("table",{class:d.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":l.value}])},[d.createElementVNode("thead",yO,[d.createElementVNode("tr",bO,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(p.value,P=>(d.openBlock(),d.createElementBlock("th",{key:P.key,class:d.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":P.type==="metric","top-n-table-header-cell-dimension-compact":M(P)}]),"data-testid":"top-n-table-header-column"},[d.createElementVNode("span",_O,d.toDisplayString(P.label),1)],2))),128))])]),d.createElementVNode("tbody",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(_.value,P=>(d.openBlock(),d.createElementBlock("tr",{key:P.rowKey,class:"top-n-table-row"},[d.createElementVNode("td",{class:d.normalizeClass(["top-n-table-cell top-n-table-cell--name",{"top-n-table-cell-dimension-compact":l.value}])},[d.createElementVNode("span",{"data-testid":`row-${P.id}`},[d.renderSlot(H.$slots,"name",{record:{id:P.id,name:P.name,deleted:P.deleted,dimension:a.value,dimensions:P.dimensions,isEmpty:P.id==="empty"}},()=>[d.createTextVNode(d.toDisplayString(P.name),1)],!0)],8,xO)],2),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(b.value,N=>(d.openBlock(),d.createElementBlock("td",{key:N.key,class:d.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!S(N)}])},[d.renderSlot(H.$slots,"name",{record:Y(P,N.key)},()=>[d.createTextVNode(d.toDisplayString(I(P,N.key)),1)],!0)],2))),128)),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(y.value,N=>(d.openBlock(),d.createElementBlock("td",{key:N.key,class:"top-n-table-cell top-n-table-cell-metric"},[N.key==="value"?(d.openBlock(),d.createElementBlock("span",{key:0,"data-testid":`row-${P.id}`},d.toDisplayString(k(P,N.key)),9,wO)):(d.openBlock(),d.createElementBlock("span",{key:1,"data-testid":`row-${P.id}-${N.key}`},d.toDisplayString(k(P,N.key)),9,SO))]))),128))]))),128))])],2)])):(d.openBlock(),d.createBlock(R,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(e.emptyStateTitle||d.unref(n).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[e.title?{name:"title",fn:d.withCtx(()=>[d.createElementVNode("span",mO,d.toDisplayString(e.title),1)]),key:"0"}:void 0,e.description?{name:"actions",fn:d.withCtx(()=>[d.createElementVNode("div",pO,d.toDisplayString(e.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-bd2cedcf"]]),MO={class:"container"},kO={key:0,class:"no-data","data-testid":"sparkline-empty"},DO=["title"],CO=ke(d.defineComponent({__name:"SparklineChart",props:{chartKey:{default:()=>{}},datasets:{},disableTooltip:{type:Boolean,default:!1},enableBrushing:{type:Boolean,default:!1},groupKey:{default:()=>{}},maxCount:{default:()=>{}},maxStamp:{default:()=>{}},minCount:{default:()=>{}},minStamp:{default:()=>{}},pointRenderCount:{default:24},showLabel:{type:Boolean,default:!1},tooltipTitle:{default:()=>{}},type:{default:"sparkline_bar"}},setup(e){const t=crypto.randomUUID(),{i18n:n}=mt.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:s,syncedMaxStamp:o,syncedMinCount:r,syncedMaxCount:a,syncedRenderPoints:l,syncedChartDatasets:c}=mt.useSparklineSync({chartKey:e.chartKey,datasets:e.datasets,groupKey:e.groupKey,minStamp:e.minStamp,maxStamp:e.maxStamp,minCount:e.minCount,maxCount:e.maxCount,renderPoints:e.pointRenderCount,type:e.type}),u=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:e.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),h=({width:O,height:x})=>{u.width=O,u.height=x},f=d.computed(()=>e.disableTooltip?[]:[new Mm({enableBrushing:e.groupKey!==void 0&&e.chartKey!==void 0&&e.enableBrushing,brushStrategy:"group",brushGroup:e.groupKey})]),m=d.computed(()=>c.value.reduce((O,{data:x,label:_})=>({...O,[_]:x.reduce((v,{y:k})=>v+k,0)}),{})),p=d.computed(()=>c.value.map(({label:O})=>[m.value[O],`${O}: ${m.value[O]}`]).sort(([O],[x])=>x-O).map(([,O])=>O).join(", ")),y=d.computed(()=>Object.keys(m.value).map(O=>m.value[O]).reduce((O,x)=>O+x,0)),b=d.computed(()=>y.value>0),S=d.computed(()=>({labels:new Array(l.value).fill(""),datasets:c.value})),M=d.computed(()=>e.datasets.length>1),E=`SparklineTooltipPosition-${t}`,D=d.computed(()=>{const O=e.type==="sparkline_bar",x=O?s.value-1:s.value,_=O?o.value:o.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:e.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:O?0:2,right:O?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:E,external:v=>{Hh(u,v,"minutely",{contextFormatter:k=>{const I=k+i.value;let Y="";return i.value>1440*60*1e3?Y=Ao(new Date(I),"MMM dd, yyy hh:mm a"):Y=Ao(new Date(I),"hh:mm a"),`${Pv(k)} - ${Y}`}})}}},scales:{x:{min:x,max:_,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:M.value},y:{min:Math.max(r.value-1,0),max:a.value,grid:{display:!1},display:!1,stacked:M.value}}}}),C=d.ref("0"),A=d.ref("0");return d.onMounted(()=>{Me.positioners[E]=function(O,x){if(!O.length||u.interactionMode==="interactive"||x.x===null)return!1;const _=10,v=this.chart.canvas.getBoundingClientRect(),k=u.width||this.width,I=u.height||this.height,Y=v.top-I>0,U=Y?v.top-I-_:v.top+v.height+_,j=v.left>k/2-x.x,H=Math.max(_,window.innerWidth-_-k),$=Math.min(H,j?Math.floor(v.left-k/2)+x.x:0+_);return C.value=`${U}px`,A.value=`${$}px`,{x:$,y:U,xAlign:"center",yAlign:Y?"top":"bottom"}}}),d.onUnmounted(()=>{Me.positioners[E]&&delete Me.positioners[E]}),(O,x)=>(d.openBlock(),d.createElementBlock("div",MO,[b.value?e.type==="sparkline_bar"?(d.openBlock(),d.createBlock(d.unref(Sm),{key:1,"chart-id":d.unref(t),data:S.value,"data-testid":"sparkline-bar",options:D.value,plugins:f.value},null,8,["chart-id","data","options","plugins"])):e.type==="sparkline_line"||e.type==="sparkline_step"?(d.openBlock(),d.createBlock(d.unref(Tm),{key:2,"chart-id":d.unref(t),data:S.value,"data-testid":e.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:D.value,plugins:f.value},null,8,["chart-id","data","data-testid","options","plugins"])):d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",kO,[d.renderSlot(O.$slots,"empty",{},()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("sparkline_no_data")),1)],!0)])),e.disableTooltip?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(sr,{key:3,"absolute-left":A.value,"absolute-top":C.value,class:"tooltip","data-testid":"sparkline-tooltip",state:u,"tooltip-title":e.tooltipTitle,onDimensions:h},null,8,["absolute-left","absolute-top","state","tooltip-title"])),b.value&&e.showLabel?(d.openBlock(),d.createElementBlock("div",{key:4,class:"label",title:O.$slots.label?"":p.value},[d.renderSlot(O.$slots,"label",{total:y.value,totalByDataset:m.value},()=>[d.createTextVNode(d.toDisplayString(p.value),1)],!0)],8,DO)):d.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]);var Ae=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zs={exports:{}};zs.exports;var Om;function OO(){return Om||(Om=1,(function(e,t){var n=200,i="Expected a function",s="__lodash_hash_undefined__",o=1,r=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object Boolean]",h="[object Date]",f="[object Error]",m="[object Function]",p="[object GeneratorFunction]",y="[object Map]",b="[object Number]",S="[object Object]",M="[object Promise]",E="[object RegExp]",D="[object Set]",C="[object String]",A="[object Symbol]",O="[object WeakMap]",x="[object ArrayBuffer]",_="[object DataView]",v="[object Float32Array]",k="[object Float64Array]",I="[object Int8Array]",Y="[object Int16Array]",U="[object Int32Array]",j="[object Uint8Array]",H="[object Uint8ClampedArray]",$="[object Uint16Array]",R="[object Uint32Array]",B=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,z=/^\w*$/,P=/^\./,N=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,Q=/\\(\\)?/g,X=/^\[object .+?Constructor\]$/,q=/^(?:0|[1-9]\d*)$/,G={};G[v]=G[k]=G[I]=G[Y]=G[U]=G[j]=G[H]=G[$]=G[R]=!0,G[l]=G[c]=G[x]=G[u]=G[_]=G[h]=G[f]=G[m]=G[y]=G[b]=G[S]=G[E]=G[D]=G[C]=G[O]=!1;var J=typeof Ae=="object"&&Ae&&Ae.Object===Object&&Ae,nt=typeof self=="object"&&self&&self.Object===Object&&self,tt=J||nt||Function("return this")(),Z=t&&!t.nodeType&&t,pt=Z&&!0&&e&&!e.nodeType&&e,bt=pt&&pt.exports===Z,ot=bt&&J.process,gt=(function(){try{return ot&&ot.binding("util")}catch{}})(),ct=gt&&gt.isTypedArray;function $t(g,T){for(var F=-1,K=g?g.length:0;++F<K;)if(T(g[F],F,g))return!0;return!1}function lt(g){return function(T){return T?.[g]}}function Mt(g,T){for(var F=-1,K=Array(g);++F<g;)K[F]=T(F);return K}function Yt(g){return function(T){return g(T)}}function _e(g,T){return g?.[T]}function Jt(g){var T=!1;if(g!=null&&typeof g.toString!="function")try{T=!!(g+"")}catch{}return T}function Ye(g){var T=-1,F=Array(g.size);return g.forEach(function(K,ht){F[++T]=[ht,K]}),F}function Ct(g,T){return function(F){return g(T(F))}}function te(g){var T=-1,F=Array(g.size);return g.forEach(function(K){F[++T]=K}),F}var Nt=Array.prototype,jt=Function.prototype,ee=Object.prototype,je=tt["__core-js_shared__"],ni=(function(){var g=/[^.]+$/.exec(je&&je.keys&&je.keys.IE_PROTO||"");return g?"Symbol(src)_1."+g:""})(),Le=jt.toString,Ft=ee.hasOwnProperty,xe=ee.toString,ii=RegExp("^"+Le.call(Ft).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ar=tt.Symbol,lr=tt.Uint8Array,Us=ee.propertyIsEnumerable,si=Nt.splice,Hs=Ct(Object.keys,Object),oi=ln(tt,"DataView"),sn=ln(tt,"Map"),on=ln(tt,"Promise"),Vs=ln(tt,"Set"),Ws=ln(tt,"WeakMap"),ri=ln(Object,"create"),xl=un(oi),wl=un(sn),cr=un(on),ur=un(Vs),rn=un(Ws),Ii=ar?ar.prototype:void 0,$s=Ii?Ii.valueOf:void 0,dr=Ii?Ii.toString:void 0;function an(g){var T=-1,F=g?g.length:0;for(this.clear();++T<F;){var K=g[T];this.set(K[0],K[1])}}function Sl(){this.__data__=ri?ri(null):{}}function Ne(g){return this.has(g)&&delete this.__data__[g]}function vl(g){var T=this.__data__;if(ri){var F=T[g];return F===s?void 0:F}return Ft.call(T,g)?T[g]:void 0}function Tl(g){var T=this.__data__;return ri?T[g]!==void 0:Ft.call(T,g)}function Ml(g,T){var F=this.__data__;return F[g]=ri&&T===void 0?s:T,this}an.prototype.clear=Sl,an.prototype.delete=Ne,an.prototype.get=vl,an.prototype.has=Tl,an.prototype.set=Ml;function Fe(g){var T=-1,F=g?g.length:0;for(this.clear();++T<F;){var K=g[T];this.set(K[0],K[1])}}function kl(){this.__data__=[]}function En(g){var T=this.__data__,F=Fi(T,g);if(F<0)return!1;var K=T.length-1;return F==K?T.pop():si.call(T,F,1),!0}function Dl(g){var T=this.__data__,F=Fi(T,g);return F<0?void 0:T[F][1]}function Cl(g){return Fi(this.__data__,g)>-1}function Ol(g,T){var F=this.__data__,K=Fi(F,g);return K<0?F.push([g,T]):F[K][1]=T,this}Fe.prototype.clear=kl,Fe.prototype.delete=En,Fe.prototype.get=Dl,Fe.prototype.has=Cl,Fe.prototype.set=Ol;function Be(g){var T=-1,F=g?g.length:0;for(this.clear();++T<F;){var K=g[T];this.set(K[0],K[1])}}function El(){this.__data__={hash:new an,map:new(sn||Fe),string:new an}}function An(g){return Ui(this,g).delete(g)}function Al(g){return Ui(this,g).get(g)}function Pl(g){return Ui(this,g).has(g)}function Rl(g,T){return Ui(this,g).set(g,T),this}Be.prototype.clear=El,Be.prototype.delete=An,Be.prototype.get=Al,Be.prototype.has=Pl,Be.prototype.set=Rl;function Li(g){var T=-1,F=g?g.length:0;for(this.__data__=new Be;++T<F;)this.add(g[T])}function Il(g){return this.__data__.set(g,s),this}function Ll(g){return this.__data__.has(g)}Li.prototype.add=Li.prototype.push=Il,Li.prototype.has=Ll;function Pe(g){this.__data__=new Fe(g)}function Ni(){this.__data__=new Fe}function Nl(g){return this.__data__.delete(g)}function Ys(g){return this.__data__.get(g)}function Fl(g){return this.__data__.has(g)}function Bl(g,T){var F=this.__data__;if(F instanceof Fe){var K=F.__data__;if(!sn||K.length<n-1)return K.push([g,T]),this;F=this.__data__=new Be(K)}return F.set(g,T),this}Pe.prototype.clear=Ni,Pe.prototype.delete=Nl,Pe.prototype.get=Ys,Pe.prototype.has=Fl,Pe.prototype.set=Bl;function zl(g,T){var F=w(g)||br(g)?Mt(g.length,String):[],K=F.length,ht=!!K;for(var st in g)Ft.call(g,st)&&!(ht&&(st=="length"||qs(st,K)))&&F.push(st);return F}function Fi(g,T){for(var F=g.length;F--;)if(yr(g[F][0],T))return F;return-1}var Ul=Xl();function Hl(g,T){return g&&Ul(g,T,li)}function Bi(g,T){T=Hi(T,g)?[T]:qe(T);for(var F=0,K=T.length;g!=null&&F<K;)g=g[cn(T[F++])];return F&&F==K?g:void 0}function Vl(g){return xe.call(g)}function Wl(g,T){return g!=null&&T in Object(g)}function js(g,T,F,K,ht){return g===T?!0:g==null||T==null||!qt(g)&&!we(T)?g!==g&&T!==T:$l(g,T,js,F,K,ht)}function $l(g,T,F,K,ht,st){var yt=w(g),Gt=w(T),Bt=c,le=c;yt||(Bt=ae(g),Bt=Bt==l?S:Bt),Gt||(le=ae(T),le=le==l?S:le);var Se=Bt==S&&!Jt(g),ve=le==S&&!Jt(T),he=Bt==le;if(he&&!Se)return st||(st=new Pe),yt||_r(g)?mr(g,T,F,K,ht,st):Zl(g,T,Bt,F,K,ht,st);if(!(ht&r)){var Re=Se&&Ft.call(g,"__wrapped__"),Ie=ve&&Ft.call(T,"__wrapped__");if(Re||Ie){var In=Re?g.value():g,dn=Ie?T.value():T;return st||(st=new Pe),F(In,dn,K,ht,st)}}return he?(st||(st=new Pe),Ql(g,T,F,K,ht,st)):!1}function Yl(g,T,F,K){var ht=F.length,st=ht;if(g==null)return!st;for(g=Object(g);ht--;){var yt=F[ht];if(yt[2]?yt[1]!==g[yt[0]]:!(yt[0]in g))return!1}for(;++ht<st;){yt=F[ht];var Gt=yt[0],Bt=g[Gt],le=yt[1];if(yt[2]){if(Bt===void 0&&!(Gt in g))return!1}else{var Se=new Pe,ve;if(!(ve===void 0?js(le,Bt,K,o|r,Se):ve))return!1}}return!0}function jl(g){if(!qt(g)||pr(g))return!1;var T=it(g)||Jt(g)?ii:X;return T.test(un(g))}function ql(g){return we(g)&&Ht(g.length)&&!!G[xe.call(g)]}function hr(g){return typeof g=="function"?g:g==null?Vi:typeof g=="object"?w(g)?zi(g[0],g[1]):Kl(g):GO(g)}function Gl(g){if(!ec(g))return Hs(g);var T=[];for(var F in Object(g))Ft.call(g,F)&&F!="constructor"&&T.push(F);return T}function Kl(g){var T=Jl(g);return T.length==1&&T[0][2]?Ks(T[0][0],T[0][1]):function(F){return F===g||Yl(F,g,T)}}function zi(g,T){return Hi(g)&&gr(T)?Ks(cn(g),T):function(F){var K=xr(F,g);return K===void 0&&K===T?wr(F,g):js(T,K,void 0,o|r)}}function Pn(g){return function(T){return Bi(T,g)}}function fr(g){if(typeof g=="string")return g;if(Zt(g))return dr?dr.call(g):"";var T=g+"";return T=="0"&&1/g==-1/0?"-0":T}function qe(g){return w(g)?g:nc(g)}function Xl(g){return function(T,F,K){for(var ht=-1,st=Object(T),yt=K(T),Gt=yt.length;Gt--;){var Bt=yt[++ht];if(F(st[Bt],Bt,st)===!1)break}return T}}function mr(g,T,F,K,ht,st){var yt=ht&r,Gt=g.length,Bt=T.length;if(Gt!=Bt&&!(yt&&Bt>Gt))return!1;var le=st.get(g);if(le&&st.get(T))return le==T;var Se=-1,ve=!0,he=ht&o?new Li:void 0;for(st.set(g,T),st.set(T,g);++Se<Gt;){var Re=g[Se],Ie=T[Se];if(K)var In=yt?K(Ie,Re,Se,T,g,st):K(Re,Ie,Se,g,T,st);if(In!==void 0){if(In)continue;ve=!1;break}if(he){if(!$t(T,function(dn,ci){if(!he.has(ci)&&(Re===dn||F(Re,dn,K,ht,st)))return he.add(ci)})){ve=!1;break}}else if(!(Re===Ie||F(Re,Ie,K,ht,st))){ve=!1;break}}return st.delete(g),st.delete(T),ve}function Zl(g,T,F,K,ht,st,yt){switch(F){case _:if(g.byteLength!=T.byteLength||g.byteOffset!=T.byteOffset)return!1;g=g.buffer,T=T.buffer;case x:return!(g.byteLength!=T.byteLength||!K(new lr(g),new lr(T)));case u:case h:case b:return yr(+g,+T);case f:return g.name==T.name&&g.message==T.message;case E:case C:return g==T+"";case y:var Gt=Ye;case D:var Bt=st&r;if(Gt||(Gt=te),g.size!=T.size&&!Bt)return!1;var le=yt.get(g);if(le)return le==T;st|=o,yt.set(g,T);var Se=mr(Gt(g),Gt(T),K,ht,st,yt);return yt.delete(g),Se;case A:if($s)return $s.call(g)==$s.call(T)}return!1}function Ql(g,T,F,K,ht,st){var yt=ht&r,Gt=li(g),Bt=Gt.length,le=li(T),Se=le.length;if(Bt!=Se&&!yt)return!1;for(var ve=Bt;ve--;){var he=Gt[ve];if(!(yt?he in T:Ft.call(T,he)))return!1}var Re=st.get(g);if(Re&&st.get(T))return Re==T;var Ie=!0;st.set(g,T),st.set(T,g);for(var In=yt;++ve<Bt;){he=Gt[ve];var dn=g[he],ci=T[he];if(K)var Im=yt?K(ci,dn,he,T,g,st):K(dn,ci,he,g,T,st);if(!(Im===void 0?dn===ci||F(dn,ci,K,ht,st):Im)){Ie=!1;break}In||(In=he=="constructor")}if(Ie&&!In){var Sr=g.constructor,vr=T.constructor;Sr!=vr&&"constructor"in g&&"constructor"in T&&!(typeof Sr=="function"&&Sr instanceof Sr&&typeof vr=="function"&&vr instanceof vr)&&(Ie=!1)}return st.delete(g),st.delete(T),Ie}function Ui(g,T){var F=g.__data__;return Gs(T)?F[typeof T=="string"?"string":"hash"]:F.map}function Jl(g){for(var T=li(g),F=T.length;F--;){var K=T[F],ht=g[K];T[F]=[K,ht,gr(ht)]}return T}function ln(g,T){var F=_e(g,T);return jl(F)?F:void 0}var ae=Vl;(oi&&ae(new oi(new ArrayBuffer(1)))!=_||sn&&ae(new sn)!=y||on&&ae(on.resolve())!=M||Vs&&ae(new Vs)!=D||Ws&&ae(new Ws)!=O)&&(ae=function(g){var T=xe.call(g),F=T==S?g.constructor:void 0,K=F?un(F):void 0;if(K)switch(K){case xl:return _;case wl:return y;case cr:return M;case ur:return D;case rn:return O}return T});function tc(g,T,F){T=Hi(T,g)?[T]:qe(T);for(var K,ht=-1,yt=T.length;++ht<yt;){var st=cn(T[ht]);if(!(K=g!=null&&F(g,st)))break;g=g[st]}if(K)return K;var yt=g?g.length:0;return!!yt&&Ht(yt)&&qs(st,yt)&&(w(g)||br(g))}function qs(g,T){return T=T??a,!!T&&(typeof g=="number"||q.test(g))&&g>-1&&g%1==0&&g<T}function Hi(g,T){if(w(g))return!1;var F=typeof g;return F=="number"||F=="symbol"||F=="boolean"||g==null||Zt(g)?!0:z.test(g)||!B.test(g)||T!=null&&g in Object(T)}function Gs(g){var T=typeof g;return T=="string"||T=="number"||T=="symbol"||T=="boolean"?g!=="__proto__":g===null}function pr(g){return!!ni&&ni in g}function ec(g){var T=g&&g.constructor,F=typeof T=="function"&&T.prototype||ee;return g===F}function gr(g){return g===g&&!qt(g)}function Ks(g,T){return function(F){return F==null?!1:F[g]===T&&(T!==void 0||g in Object(F))}}var nc=ai(function(g){g=Rn(g);var T=[];return P.test(g)&&T.push(""),g.replace(N,function(F,K,ht,st){T.push(ht?st.replace(Q,"$1"):K||F)}),T});function cn(g){if(typeof g=="string"||Zt(g))return g;var T=g+"";return T=="0"&&1/g==-1/0?"-0":T}function un(g){if(g!=null){try{return Le.call(g)}catch{}try{return g+""}catch{}}return""}function ai(g,T){if(typeof g!="function"||T&&typeof T!="function")throw new TypeError(i);var F=function(){var K=arguments,ht=T?T.apply(this,K):K[0],st=F.cache;if(st.has(ht))return st.get(ht);var yt=g.apply(this,K);return F.cache=st.set(ht,yt),yt};return F.cache=new(ai.Cache||Be),F}ai.Cache=Be;function yr(g,T){return g===T||g!==g&&T!==T}function br(g){return W(g)&&Ft.call(g,"callee")&&(!Us.call(g,"callee")||xe.call(g)==l)}var w=Array.isArray;function L(g){return g!=null&&Ht(g.length)&&!it(g)}function W(g){return we(g)&&L(g)}function it(g){var T=qt(g)?xe.call(g):"";return T==m||T==p}function Ht(g){return typeof g=="number"&&g>-1&&g%1==0&&g<=a}function qt(g){var T=typeof g;return!!g&&(T=="object"||T=="function")}function we(g){return!!g&&typeof g=="object"}function Zt(g){return typeof g=="symbol"||we(g)&&xe.call(g)==A}var _r=ct?Yt(ct):ql;function Rn(g){return g==null?"":fr(g)}function xr(g,T,F){var K=g==null?void 0:Bi(g,T);return K===void 0?F:K}function wr(g,T){return g!=null&&tc(g,T,Wl)}function li(g){return L(g)?zl(g):Gl(g)}function Xs(g,T){var F={};return T=hr(T),Hl(g,function(K,ht,st){F[T(K,ht,st)]=K}),F}function Vi(g){return g}function GO(g){return Hi(g)?lt(cn(g)):Pn(g)}e.exports=Xs})(zs,zs.exports)),zs.exports}var EO=OO();const AO=Cm(EO);var _l,Em;function PO(){if(Em)return _l;Em=1;var e=9007199254740991,t="[object Arguments]",n="[object Function]",i="[object GeneratorFunction]",s="[object Symbol]",o=typeof Ae=="object"&&Ae&&Ae.Object===Object&&Ae,r=typeof self=="object"&&self&&self.Object===Object&&self,a=o||r||Function("return this")();function l(R,B,z){switch(z.length){case 0:return R.call(B);case 1:return R.call(B,z[0]);case 2:return R.call(B,z[0],z[1]);case 3:return R.call(B,z[0],z[1],z[2])}return R.apply(B,z)}function c(R,B){for(var z=-1,P=R?R.length:0,N=Array(P);++z<P;)N[z]=B(R[z],z,R);return N}function u(R,B){for(var z=-1,P=B.length,N=R.length;++z<P;)R[N+z]=B[z];return R}var h=Object.prototype,f=h.hasOwnProperty,m=h.toString,p=a.Symbol,y=h.propertyIsEnumerable,b=p?p.isConcatSpreadable:void 0,S=Math.max;function M(R,B,z,P,N){var V=-1,Q=R.length;for(z||(z=A),N||(N=[]);++V<Q;){var X=R[V];z(X)?u(N,X):N[N.length]=X}return N}function E(R,B){return R=Object(R),D(R,B,function(z,P){return P in R})}function D(R,B,z){for(var P=-1,N=B.length,V={};++P<N;){var Q=B[P],X=R[Q];z(X,Q)&&(V[Q]=X)}return V}function C(R,B){return B=S(B===void 0?R.length-1:B,0),function(){for(var z=arguments,P=-1,N=S(z.length-B,0),V=Array(N);++P<N;)V[P]=z[B+P];P=-1;for(var Q=Array(B+1);++P<B;)Q[P]=z[P];return Q[B]=V,l(R,this,Q)}}function A(R){return _(R)||x(R)||!!(b&&R&&R[b])}function O(R){if(typeof R=="string"||H(R))return R;var B=R+"";return B=="0"&&1/R==-1/0?"-0":B}function x(R){return k(R)&&f.call(R,"callee")&&(!y.call(R,"callee")||m.call(R)==t)}var _=Array.isArray;function v(R){return R!=null&&Y(R.length)&&!I(R)}function k(R){return j(R)&&v(R)}function I(R){var B=U(R)?m.call(R):"";return B==n||B==i}function Y(R){return typeof R=="number"&&R>-1&&R%1==0&&R<=e}function U(R){var B=typeof R;return!!R&&(B=="object"||B=="function")}function j(R){return!!R&&typeof R=="object"}function H(R){return typeof R=="symbol"||j(R)&&m.call(R)==s}var $=C(function(R,B){return R==null?{}:E(R,c(M(B),O))});return _l=$,_l}var RO=PO();const IO=Cm(RO);var or={exports:{}},LO=or.exports,Am;function NO(){return Am||(Am=1,(function(e,t){(function(n,i){i()})(LO,function(){function n(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,u,h){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,h)},f.onerror=function(){console.error("could not download file")},f.send()}function s(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function o(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var r=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Ae=="object"&&Ae.global===Ae?Ae:void 0,a=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=r.saveAs||(typeof window!="object"||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,u,h){var f=r.URL||r.webkitURL,m=document.createElement("a");u=u||c.name||"download",m.download=u,m.rel="noopener",typeof c=="string"?(m.href=c,m.origin===location.origin?o(m):s(m.href)?i(c,u,h):o(m,m.target="_blank")):(m.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(m.href)},4e4),setTimeout(function(){o(m)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,h){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(n(c,h),u);else if(s(c))i(c,u,h);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){o(f)})}}:function(c,u,h,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,h);var m=c.type==="application/octet-stream",p=/constructor/i.test(r.HTMLElement)||r.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||m&&p||a)&&typeof FileReader<"u"){var b=new FileReader;b.onloadend=function(){var E=b.result;E=y?E:E.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=E:location=E,f=null},b.readAsDataURL(c)}else{var S=r.URL||r.webkitURL,M=S.createObjectURL(c);f?f.location=M:location.href=M,f=null,setTimeout(function(){S.revokeObjectURL(M)},4e4)}});r.saveAs=l.saveAs=l,e.exports=l})})(or)),or.exports}var FO=NO(),rr={exports:{}};var BO=rr.exports,Pm;function zO(){return Pm||(Pm=1,(function(e,t){((n,i)=>{e.exports=i()})(BO,function n(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},s,o=!i.document&&!!i.postMessage,r=i.IS_PAPA_WORKER||!1,a={},l=0,c={};function u(x){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(_){var v=C(_);v.chunkSize=parseInt(v.chunkSize),_.step||_.chunk||(v.chunkSize=null),this._handle=new y(v),(this._handle.streamer=this)._config=v}).call(this,x),this.parseChunk=function(_,v){var k=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<k){let Y=this._config.newline;Y||(I=this._config.quoteChar||'"',Y=this._handle.guessLineEndings(_,I)),_=[..._.split(Y).slice(k)].join(Y)}this.isFirstChunk&&O(this._config.beforeFirstChunk)&&(I=this._config.beforeFirstChunk(_))!==void 0&&(_=I),this.isFirstChunk=!1,this._halted=!1;var k=this._partialLine+_,I=(this._partialLine="",this._handle.parse(k,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(_=I.meta.cursor,k=(this._finished||(this._partialLine=k.substring(_-this._baseIndex),this._baseIndex=_),I&&I.data&&(this._rowCount+=I.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),r)i.postMessage({results:I,workerId:c.WORKER_ID,finished:k});else if(O(this._config.chunk)&&!v){if(this._config.chunk(I,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=I=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(I.data),this._completeResults.errors=this._completeResults.errors.concat(I.errors),this._completeResults.meta=I.meta),this._completed||!k||!O(this._config.complete)||I&&I.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),k||I&&I.meta.paused||this._nextChunk(),I}this._halted=!0},this._sendError=function(_){O(this._config.error)?this._config.error(_):r&&this._config.error&&i.postMessage({workerId:c.WORKER_ID,error:_,finished:!1})}}function h(x){var _;(x=x||{}).chunkSize||(x.chunkSize=c.RemoteChunkSize),u.call(this,x),this._nextChunk=o?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(v){this._input=v,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(_=new XMLHttpRequest,this._config.withCredentials&&(_.withCredentials=this._config.withCredentials),o||(_.onload=A(this._chunkLoaded,this),_.onerror=A(this._chunkError,this)),_.open(this._config.downloadRequestBody?"POST":"GET",this._input,!o),this._config.downloadRequestHeaders){var v,k=this._config.downloadRequestHeaders;for(v in k)_.setRequestHeader(v,k[v])}var I;this._config.chunkSize&&(I=this._start+this._config.chunkSize-1,_.setRequestHeader("Range","bytes="+this._start+"-"+I));try{_.send(this._config.downloadRequestBody)}catch(Y){this._chunkError(Y.message)}o&&_.status===0&&this._chunkError()}},this._chunkLoaded=function(){_.readyState===4&&(_.status<200||400<=_.status?this._chunkError():(this._start+=this._config.chunkSize||_.responseText.length,this._finished=!this._config.chunkSize||this._start>=(v=>(v=v.getResponseHeader("Content-Range"))!==null?parseInt(v.substring(v.lastIndexOf("/")+1)):-1)(_),this.parseChunk(_.responseText)))},this._chunkError=function(v){v=_.statusText||v,this._sendError(new Error(v))}}function f(x){(x=x||{}).chunkSize||(x.chunkSize=c.LocalChunkSize),u.call(this,x);var _,v,k=typeof FileReader<"u";this.stream=function(I){this._input=I,v=I.slice||I.webkitSlice||I.mozSlice,k?((_=new FileReader).onload=A(this._chunkLoaded,this),_.onerror=A(this._chunkError,this)):_=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var I=this._input,Y=(this._config.chunkSize&&(Y=Math.min(this._start+this._config.chunkSize,this._input.size),I=v.call(I,this._start,Y)),_.readAsText(I,this._config.encoding));k||this._chunkLoaded({target:{result:Y}})},this._chunkLoaded=function(I){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(I.target.result)},this._chunkError=function(){this._sendError(_.error)}}function m(x){var _;u.call(this,x=x||{}),this.stream=function(v){return _=v,this._nextChunk()},this._nextChunk=function(){var v,k;if(!this._finished)return v=this._config.chunkSize,_=v?(k=_.substring(0,v),_.substring(v)):(k=_,""),this._finished=!_,this.parseChunk(k)}}function p(x){u.call(this,x=x||{});var _=[],v=!0,k=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(I){this._input=I,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){k&&_.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),_.length?this.parseChunk(_.shift()):v=!0},this._streamData=A(function(I){try{_.push(typeof I=="string"?I:I.toString(this._config.encoding)),v&&(v=!1,this._checkIsFinished(),this.parseChunk(_.shift()))}catch(Y){this._streamError(Y)}},this),this._streamError=A(function(I){this._streamCleanUp(),this._sendError(I)},this),this._streamEnd=A(function(){this._streamCleanUp(),k=!0,this._streamData("")},this),this._streamCleanUp=A(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function y(x){var _,v,k,I,Y=Math.pow(2,53),U=-Y,j=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,H=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,$=this,R=0,B=0,z=!1,P=!1,N=[],V={data:[],errors:[],meta:{}};function Q(J){return x.skipEmptyLines==="greedy"?J.join("").trim()==="":J.length===1&&J[0].length===0}function X(){if(V&&k&&(G("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+c.DefaultDelimiter+"'"),k=!1),x.skipEmptyLines&&(V.data=V.data.filter(function(Z){return!Q(Z)})),q()){let Z=function(pt,bt){O(x.transformHeader)&&(pt=x.transformHeader(pt,bt)),N.push(pt)};if(V)if(Array.isArray(V.data[0])){for(var J=0;q()&&J<V.data.length;J++)V.data[J].forEach(Z);V.data.splice(0,1)}else V.data.forEach(Z)}function nt(Z,pt){for(var bt=x.header?{}:[],ot=0;ot<Z.length;ot++){var gt=ot,ct=Z[ot],ct=(($t,lt)=>(Mt=>(x.dynamicTypingFunction&&x.dynamicTyping[Mt]===void 0&&(x.dynamicTyping[Mt]=x.dynamicTypingFunction(Mt)),(x.dynamicTyping[Mt]||x.dynamicTyping)===!0))($t)?lt==="true"||lt==="TRUE"||lt!=="false"&&lt!=="FALSE"&&((Mt=>{if(j.test(Mt)&&(Mt=parseFloat(Mt),U<Mt&&Mt<Y))return 1})(lt)?parseFloat(lt):H.test(lt)?new Date(lt):lt===""?null:lt):lt)(gt=x.header?ot>=N.length?"__parsed_extra":N[ot]:gt,ct=x.transform?x.transform(ct,gt):ct);gt==="__parsed_extra"?(bt[gt]=bt[gt]||[],bt[gt].push(ct)):bt[gt]=ct}return x.header&&(ot>N.length?G("FieldMismatch","TooManyFields","Too many fields: expected "+N.length+" fields but parsed "+ot,B+pt):ot<N.length&&G("FieldMismatch","TooFewFields","Too few fields: expected "+N.length+" fields but parsed "+ot,B+pt)),bt}var tt;V&&(x.header||x.dynamicTyping||x.transform)&&(tt=1,!V.data.length||Array.isArray(V.data[0])?(V.data=V.data.map(nt),tt=V.data.length):V.data=nt(V.data,0),x.header&&V.meta&&(V.meta.fields=N),B+=tt)}function q(){return x.header&&N.length===0}function G(J,nt,tt,Z){J={type:J,code:nt,message:tt},Z!==void 0&&(J.row=Z),V.errors.push(J)}O(x.step)&&(I=x.step,x.step=function(J){V=J,q()?X():(X(),V.data.length!==0&&(R+=J.data.length,x.preview&&R>x.preview?v.abort():(V.data=V.data[0],I(V,$))))}),this.parse=function(J,nt,tt){var Z=x.quoteChar||'"',Z=(x.newline||(x.newline=this.guessLineEndings(J,Z)),k=!1,x.delimiter?O(x.delimiter)&&(x.delimiter=x.delimiter(J),V.meta.delimiter=x.delimiter):((Z=((pt,bt,ot,gt,ct)=>{var $t,lt,Mt,Yt;ct=ct||[","," ","|",";",c.RECORD_SEP,c.UNIT_SEP];for(var _e=0;_e<ct.length;_e++){for(var Jt,Ye=ct[_e],Ct=0,te=0,Nt=0,jt=(Mt=void 0,new S({comments:gt,delimiter:Ye,newline:bt,preview:10}).parse(pt)),ee=0;ee<jt.data.length;ee++)ot&&Q(jt.data[ee])?Nt++:(Jt=jt.data[ee].length,te+=Jt,Mt===void 0?Mt=Jt:0<Jt&&(Ct+=Math.abs(Jt-Mt),Mt=Jt));0<jt.data.length&&(te/=jt.data.length-Nt),(lt===void 0||Ct<=lt)&&(Yt===void 0||Yt<te)&&1.99<te&&(lt=Ct,$t=Ye,Yt=te)}return{successful:!!(x.delimiter=$t),bestDelimiter:$t}})(J,x.newline,x.skipEmptyLines,x.comments,x.delimitersToGuess)).successful?x.delimiter=Z.bestDelimiter:(k=!0,x.delimiter=c.DefaultDelimiter),V.meta.delimiter=x.delimiter),C(x));return x.preview&&x.header&&Z.preview++,_=J,v=new S(Z),V=v.parse(_,nt,tt),X(),z?{meta:{paused:!0}}:V||{meta:{paused:!1}}},this.paused=function(){return z},this.pause=function(){z=!0,v.abort(),_=O(x.chunk)?"":_.substring(v.getCharIndex())},this.resume=function(){$.streamer._halted?(z=!1,$.streamer.parseChunk(_,!0)):setTimeout($.resume,3)},this.aborted=function(){return P},this.abort=function(){P=!0,v.abort(),V.meta.aborted=!0,O(x.complete)&&x.complete(V),_=""},this.guessLineEndings=function(pt,Z){pt=pt.substring(0,1048576);var Z=new RegExp(b(Z)+"([^]*?)"+b(Z),"gm"),tt=(pt=pt.replace(Z,"")).split("\r"),Z=pt.split(`
8
- `),pt=1<Z.length&&Z[0].length<tt[0].length;if(tt.length===1||pt)return`
9
- `;for(var bt=0,ot=0;ot<tt.length;ot++)tt[ot][0]===`
10
- `&&bt++;return bt>=tt.length/2?`\r
11
- `:"\r"}}function b(x){return x.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function S(x){var _=(x=x||{}).delimiter,v=x.newline,k=x.comments,I=x.step,Y=x.preview,U=x.fastMode,j=null,H=!1,$=x.quoteChar==null?'"':x.quoteChar,R=$;if(x.escapeChar!==void 0&&(R=x.escapeChar),(typeof _!="string"||-1<c.BAD_DELIMITERS.indexOf(_))&&(_=","),k===_)throw new Error("Comment character same as delimiter");k===!0?k="#":(typeof k!="string"||-1<c.BAD_DELIMITERS.indexOf(k))&&(k=!1),v!==`
12
- `&&v!=="\r"&&v!==`\r
13
- `&&(v=`
14
- `);var B=0,z=!1;this.parse=function(P,N,V){if(typeof P!="string")throw new Error("Input must be a string");var Q=P.length,X=_.length,q=v.length,G=k.length,J=O(I),nt=[],tt=[],Z=[],pt=B=0;if(!P)return Ct();if(U||U!==!1&&P.indexOf($)===-1){for(var bt=P.split(v),ot=0;ot<bt.length;ot++){if(Z=bt[ot],B+=Z.length,ot!==bt.length-1)B+=v.length;else if(V)return Ct();if(!k||Z.substring(0,G)!==k){if(J){if(nt=[],Yt(Z.split(_)),te(),z)return Ct()}else Yt(Z.split(_));if(Y&&Y<=ot)return nt=nt.slice(0,Y),Ct(!0)}}return Ct()}for(var gt=P.indexOf(_,B),ct=P.indexOf(v,B),$t=new RegExp(b(R)+b($),"g"),lt=P.indexOf($,B);;)if(P[B]===$)for(lt=B,B++;;){if((lt=P.indexOf($,lt+1))===-1)return V||tt.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:nt.length,index:B}),Jt();if(lt===Q-1)return Jt(P.substring(B,lt).replace($t,$));if($===R&&P[lt+1]===R)lt++;else if($===R||lt===0||P[lt-1]!==R){gt!==-1&&gt<lt+1&&(gt=P.indexOf(_,lt+1));var Mt=_e((ct=ct!==-1&&ct<lt+1?P.indexOf(v,lt+1):ct)===-1?gt:Math.min(gt,ct));if(P.substr(lt+1+Mt,X)===_){Z.push(P.substring(B,lt).replace($t,$)),P[B=lt+1+Mt+X]!==$&&(lt=P.indexOf($,B)),gt=P.indexOf(_,B),ct=P.indexOf(v,B);break}if(Mt=_e(ct),P.substring(lt+1+Mt,lt+1+Mt+q)===v){if(Z.push(P.substring(B,lt).replace($t,$)),Ye(lt+1+Mt+q),gt=P.indexOf(_,B),lt=P.indexOf($,B),J&&(te(),z))return Ct();if(Y&&nt.length>=Y)return Ct(!0);break}tt.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:nt.length,index:B}),lt++}}else if(k&&Z.length===0&&P.substring(B,B+G)===k){if(ct===-1)return Ct();B=ct+q,ct=P.indexOf(v,B),gt=P.indexOf(_,B)}else if(gt!==-1&&(gt<ct||ct===-1))Z.push(P.substring(B,gt)),B=gt+X,gt=P.indexOf(_,B);else{if(ct===-1)break;if(Z.push(P.substring(B,ct)),Ye(ct+q),J&&(te(),z))return Ct();if(Y&&nt.length>=Y)return Ct(!0)}return Jt();function Yt(Nt){nt.push(Nt),pt=B}function _e(Nt){var jt=0;return jt=Nt!==-1&&(Nt=P.substring(lt+1,Nt))&&Nt.trim()===""?Nt.length:jt}function Jt(Nt){return V||(Nt===void 0&&(Nt=P.substring(B)),Z.push(Nt),B=Q,Yt(Z),J&&te()),Ct()}function Ye(Nt){B=Nt,Yt(Z),Z=[],ct=P.indexOf(v,B)}function Ct(Nt){if(x.header&&!N&&nt.length&&!H){var jt=nt[0],ee=Object.create(null),je=new Set(jt);let ni=!1;for(let Le=0;Le<jt.length;Le++){let Ft=jt[Le];if(ee[Ft=O(x.transformHeader)?x.transformHeader(Ft,Le):Ft]){let xe,ii=ee[Ft];for(;xe=Ft+"_"+ii,ii++,je.has(xe););je.add(xe),jt[Le]=xe,ee[Ft]++,ni=!0,(j=j===null?{}:j)[xe]=Ft}else ee[Ft]=1,jt[Le]=Ft;je.add(Ft)}ni&&console.warn("Duplicate headers found and renamed."),H=!0}return{data:nt,errors:tt,meta:{delimiter:_,linebreak:v,aborted:z,truncated:!!Nt,cursor:pt+(N||0),renamedHeaders:j}}}function te(){I(Ct()),nt=[],tt=[]}},this.abort=function(){z=!0},this.getCharIndex=function(){return B}}function M(x){var _=x.data,v=a[_.workerId],k=!1;if(_.error)v.userError(_.error,_.file);else if(_.results&&_.results.data){var I={abort:function(){k=!0,E(_.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:D,resume:D};if(O(v.userStep)){for(var Y=0;Y<_.results.data.length&&(v.userStep({data:_.results.data[Y],errors:_.results.errors,meta:_.results.meta},I),!k);Y++);delete _.results}else O(v.userChunk)&&(v.userChunk(_.results,I,_.file),delete _.results)}_.finished&&!k&&E(_.workerId,_.results)}function E(x,_){var v=a[x];O(v.userComplete)&&v.userComplete(_),v.terminate(),delete a[x]}function D(){throw new Error("Not implemented.")}function C(x){if(typeof x!="object"||x===null)return x;var _,v=Array.isArray(x)?[]:{};for(_ in x)v[_]=C(x[_]);return v}function A(x,_){return function(){x.apply(_,arguments)}}function O(x){return typeof x=="function"}return c.parse=function(x,_){var v=(_=_||{}).dynamicTyping||!1;if(O(v)&&(_.dynamicTypingFunction=v,v={}),_.dynamicTyping=v,_.transform=!!O(_.transform)&&_.transform,!_.worker||!c.WORKERS_SUPPORTED)return v=null,c.NODE_STREAM_INPUT,typeof x=="string"?(x=(k=>k.charCodeAt(0)!==65279?k:k.slice(1))(x),v=new(_.download?h:m)(_)):x.readable===!0&&O(x.read)&&O(x.on)?v=new p(_):(i.File&&x instanceof File||x instanceof Object)&&(v=new f(_)),v.stream(x);(v=(()=>{var k;return!!c.WORKERS_SUPPORTED&&(k=(()=>{var I=i.URL||i.webkitURL||null,Y=n.toString();return c.BLOB_URL||(c.BLOB_URL=I.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",Y,")();"],{type:"text/javascript"})))})(),(k=new i.Worker(k)).onmessage=M,k.id=l++,a[k.id]=k)})()).userStep=_.step,v.userChunk=_.chunk,v.userComplete=_.complete,v.userError=_.error,_.step=O(_.step),_.chunk=O(_.chunk),_.complete=O(_.complete),_.error=O(_.error),delete _.worker,v.postMessage({input:x,config:_,workerId:v.id})},c.unparse=function(x,_){var v=!1,k=!0,I=",",Y=`\r
15
- `,U='"',j=U+U,H=!1,$=null,R=!1,B=((()=>{if(typeof _=="object"){if(typeof _.delimiter!="string"||c.BAD_DELIMITERS.filter(function(N){return _.delimiter.indexOf(N)!==-1}).length||(I=_.delimiter),typeof _.quotes!="boolean"&&typeof _.quotes!="function"&&!Array.isArray(_.quotes)||(v=_.quotes),typeof _.skipEmptyLines!="boolean"&&typeof _.skipEmptyLines!="string"||(H=_.skipEmptyLines),typeof _.newline=="string"&&(Y=_.newline),typeof _.quoteChar=="string"&&(U=_.quoteChar),typeof _.header=="boolean"&&(k=_.header),Array.isArray(_.columns)){if(_.columns.length===0)throw new Error("Option columns is empty");$=_.columns}_.escapeChar!==void 0&&(j=_.escapeChar+U),_.escapeFormulae instanceof RegExp?R=_.escapeFormulae:typeof _.escapeFormulae=="boolean"&&_.escapeFormulae&&(R=/^[=+\-@\t\r].*$/)}})(),new RegExp(b(U),"g"));if(typeof x=="string"&&(x=JSON.parse(x)),Array.isArray(x)){if(!x.length||Array.isArray(x[0]))return z(null,x,H);if(typeof x[0]=="object")return z($||Object.keys(x[0]),x,H)}else if(typeof x=="object")return typeof x.data=="string"&&(x.data=JSON.parse(x.data)),Array.isArray(x.data)&&(x.fields||(x.fields=x.meta&&x.meta.fields||$),x.fields||(x.fields=Array.isArray(x.data[0])?x.fields:typeof x.data[0]=="object"?Object.keys(x.data[0]):[]),Array.isArray(x.data[0])||typeof x.data[0]=="object"||(x.data=[x.data])),z(x.fields||[],x.data||[],H);throw new Error("Unable to serialize unrecognized input");function z(N,V,Q){var X="",q=(typeof N=="string"&&(N=JSON.parse(N)),typeof V=="string"&&(V=JSON.parse(V)),Array.isArray(N)&&0<N.length),G=!Array.isArray(V[0]);if(q&&k){for(var J=0;J<N.length;J++)0<J&&(X+=I),X+=P(N[J],J);0<V.length&&(X+=Y)}for(var nt=0;nt<V.length;nt++){var tt=(q?N:V[nt]).length,Z=!1,pt=q?Object.keys(V[nt]).length===0:V[nt].length===0;if(Q&&!q&&(Z=Q==="greedy"?V[nt].join("").trim()==="":V[nt].length===1&&V[nt][0].length===0),Q==="greedy"&&q){for(var bt=[],ot=0;ot<tt;ot++){var gt=G?N[ot]:ot;bt.push(V[nt][gt])}Z=bt.join("").trim()===""}if(!Z){for(var ct=0;ct<tt;ct++){0<ct&&!pt&&(X+=I);var $t=q&&G?N[ct]:ct;X+=P(V[nt][$t],ct)}nt<V.length-1&&(!Q||0<tt&&!pt)&&(X+=Y)}}return X}function P(N,V){var Q,X;return N==null?"":N.constructor===Date?JSON.stringify(N).slice(1,25):(X=!1,R&&typeof N=="string"&&R.test(N)&&(N="'"+N,X=!0),Q=N.toString().replace(B,j),(X=X||v===!0||typeof v=="function"&&v(N,V)||Array.isArray(v)&&v[V]||((q,G)=>{for(var J=0;J<G.length;J++)if(-1<q.indexOf(G[J]))return!0;return!1})(Q,c.BAD_DELIMITERS)||-1<Q.indexOf(I)||Q.charAt(0)===" "||Q.charAt(Q.length-1)===" ")?U+Q+U:Q)}},c.RECORD_SEP="",c.UNIT_SEP="",c.BYTE_ORDER_MARK="\uFEFF",c.BAD_DELIMITERS=["\r",`
16
- `,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!o&&!!i.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=S,c.ParserHandle=y,c.NetworkStreamer=h,c.FileStreamer=f,c.StringStreamer=m,c.ReadableStreamStreamer=p,i.jQuery&&((s=i.jQuery).fn.parse=function(x){var _=x.config||{},v=[];return this.each(function(Y){if(!(s(this).prop("tagName").toUpperCase()==="INPUT"&&s(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var U=0;U<this.files.length;U++)v.push({file:this.files[U],inputElem:this,instanceConfig:s.extend({},_)})}),k(),this;function k(){if(v.length===0)O(x.complete)&&x.complete();else{var Y,U,j,H,$=v[0];if(O(x.before)){var R=x.before($.file,$.inputElem);if(typeof R=="object"){if(R.action==="abort")return Y="AbortError",U=$.file,j=$.inputElem,H=R.reason,void(O(x.error)&&x.error({name:Y},U,j,H));if(R.action==="skip")return void I();typeof R.config=="object"&&($.instanceConfig=s.extend($.instanceConfig,R.config))}else if(R==="skip")return void I()}var B=$.instanceConfig.complete;$.instanceConfig.complete=function(z){O(B)&&B(z,$.file,$.inputElem),I()},c.parse($.file,$.instanceConfig)}}function I(){v.splice(0,1),k()}}),r&&(i.onmessage=function(x){x=x.data,c.WORKER_ID===void 0&&x&&(c.WORKER_ID=x.workerId),typeof x.input=="string"?i.postMessage({workerId:c.WORKER_ID,results:c.parse(x.input,x.config),finished:!0}):(i.File&&x.input instanceof File||x.input instanceof Object)&&(x=c.parse(x.input,x.config))&&i.postMessage({workerId:c.WORKER_ID,results:x,finished:!0})}),(h.prototype=Object.create(u.prototype)).constructor=h,(f.prototype=Object.create(u.prototype)).constructor=f,(m.prototype=Object.create(m.prototype)).constructor=m,(p.prototype=Object.create(u.prototype)).constructor=p,c})})(rr)),rr.exports}var UO=zO();const HO=["id"],VO=d.defineComponent({__name:"VueJsonCsv",props:{data:{type:Array,required:!0},fields:{type:Array,required:!1,default:null},labels:{type:Object,required:!1,default:null},filename:{type:String,default:"report-data.csv"},delimiter:{type:String,default:",",required:!1},separatorExcel:{type:Boolean,default:!1},encoding:{type:String,default:"utf-8"},testing:{type:Boolean,required:!1,default:!1}},emits:["export-started","export-finished"],setup(e,{emit:t}){const n=t,i=e,s=d.computed(()=>`export_${new Date().getTime()}`),o=d.computed(()=>{const u=l();return u.length?u:null}),r=()=>{const u=i.labels;if(typeof i.fields!==ei.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===ei.Object?h=>AO(h,(f,m)=>u[m]||m):h=>h},a=()=>{const u=i.fields;if(typeof i.fields!==ei.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?h=>IO(h,u):h=>h},l=()=>{if(typeof i.fields===ei.Undefined&&typeof i.labels===ei.Undefined)return i.data;const u=r(),h=a();return i.data.map(f=>u(h(f)))},c=()=>{if(!o?.value){console.warn("No data to export");return}n("export-started",o.value);let u=UO.unparse(o.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(u="SEP="+i.delimiter+`\r
17
- `+u),i.encoding==="utf-8"&&(u="\uFEFF"+u),n("export-finished",i.filename),!i.testing){const h=new Blob([u],{type:"text/csv;charset="+i.encoding});FO.saveAs(h,i.filename)}};return(u,h)=>(d.openBlock(),d.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[d.renderSlot(u.$slots,"default",{},()=>[d.createTextVNode("Download "+d.toDisplayString(e.filename),1)])],8,HO))}}),WO=d.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(e){const t=e,n=d.computed(()=>Object.keys(t.headers));return(i,s)=>(d.openBlock(),d.createElementBlock("div",null,[d.createVNode(VO,{data:e.rows,fields:n.value,filename:e.filename,labels:e.headers},{default:d.withCtx(()=>[d.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),$O={class:"kong-ui-public-csv-export-modal"},YO={key:0,class:"selected-range"},jO={key:4,class:"text-muted",tag:"span"},Rm=3,qO=d.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(e,{emit:t}){const{i18n:n}=mt.useI18n(),i=e,s=t,o=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,r=d.ref(1),a=d.computed(()=>f.value.rows.length),l=d.computed(()=>i.exportState.status==="success"&&!!i.exportState.chartData?.data?.length),c=d.computed(()=>i.exportState.status!=="success"?"":mt.useChartSelectedRange(d.toRef(i.exportState,"chartData"))),u=d.computed(()=>i.exportState.status!=="success"?"":n.t("csvExport.previewRows",{rowsMax:Math.min(Rm,a.value),rowsTotal:a.value,plural:a.value===1?"":"s"})),h=()=>{s("closeModal")},f=d.computed(()=>{if(i.exportState.status!=="success"||!l.value||!i.exportState.chartData?.meta.metric_names)return{headers:[],rows:[],csvHeaders:{}};const p=i.exportState.chartData,y=p.data.some(C=>C.timestamp!==p.data[0].timestamp),b=p.data.map(C=>{const A=new Date(C.timestamp);return{...Object.keys(C.event).reduce((x,_)=>{if(_ in p.meta.display){const v=C.event[_],k=p.meta.display[_];x[_]=v&&k&&k[v].name||C.event[_]}else x[_]=C.event[_];return x},{}),...y?{timestamp:Ga(A,"yyyy-MM-dd HH:mm:ss"),tzOffset:Ga(A,"XXX")}:{}}});let S=[];y&&(S=[{label:n.t("csvExport.Timestamp"),key:"timestamp"},{label:n.t("csvExport.UtcOffset"),key:"tzOffset"}]);const M="display"in i.exportState.chartData.meta&&i.exportState.chartData.meta?.display?i.exportState.chartData.meta?.display:{},E=[...S,...Object.keys(M).map(C=>({label:n.t(`chartLabels.${C}`),key:C})),...i.exportState.chartData.meta.metric_names.map(C=>({label:n.t(`chartLabels.${C}`),key:C}))],D=E.reduce((C,A)=>(C[A.key]=A.label,C),{});return{headers:E,csvHeaders:D,rows:b}}),m=async()=>{if(i.exportState.status!=="success")return{total:0,data:[]};const{rows:p}=f.value;return{total:Number(p.length)||0,data:p.slice(0,Rm)}};return d.watch(f,()=>{r.value++}),(p,y)=>{const b=d.resolveComponent("KSkeleton"),S=d.resolveComponent("KEmptyState"),M=d.resolveComponent("KTableData"),E=d.resolveComponent("KTooltip"),D=d.resolveComponent("KButton"),C=d.resolveComponent("KModal");return d.openBlock(),d.createElementBlock("div",$O,[d.createVNode(C,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:d.unref(n).t("csvExport.exportPreview"),visible:"",onCancel:h,onKeyup:d.withKeys(h,["esc"])},{default:d.withCtx(()=>[d.createElementVNode("div",null,[e.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",YO,[d.createElementVNode("p",null,d.toDisplayString(e.modalDescription?e.modalDescription:d.unref(n).t("csvExport.exportDescription")),1),d.createElementVNode("p",null,d.toDisplayString(d.unref(n).t("csvExport.exportTimeRange"))+": "+d.toDisplayString(c.value),1)])):d.createCommentVNode("",!0),e.exportState.status==="loading"?(d.openBlock(),d.createBlock(b,{key:1,class:"chart-skeleton",type:"table"})):e.exportState.status==="success"?(d.openBlock(),d.createBlock(M,{key:2,class:"vitals-table",fetcher:m,"fetcher-cache-key":String(r.value),headers:f.value?.headers||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":d.withCtx(()=>[d.createVNode(S,{"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(n).t("csvExport.noDataRange")),1)]),default:d.withCtx(()=>[d.createElementVNode("p",null,d.toDisplayString(d.unref(n).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):e.exportState.status==="error"?(d.openBlock(),d.createBlock(S,{key:3,"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(n).t("csvExport.dataError")),1)]),_:1})):d.createCommentVNode("",!0),e.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",jO,[d.createTextVNode(d.toDisplayString(u.value)+" ",1),d.createVNode(E,{class:"preview-tooltip",placement:"right",text:d.unref(n).t("csvExport.maximumRecordAmount",{value:d.unref(Pw)})},{default:d.withCtx(()=>[d.createVNode(d.unref(Wi.InfoIcon),{color:`var(--kui-color-text-neutral, ${d.unref(Na)})`,size:`var(--kui-icon-size-30, ${d.unref(Ms)})`},null,8,["color","size"])]),_:1},8,["text"])])):d.createCommentVNode("",!0)])]),"footer-actions":d.withCtx(()=>[d.createVNode(D,{appearance:"tertiary",class:"cancel-btn",onClick:h},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("csvExport.cancelButton")),1)]),_:1}),d.createVNode(WO,{class:"vitals-report-export-button",filename:o,headers:f.value.csvHeaders,rows:f.value.rows},{default:d.withCtx(()=>[d.createVNode(D,{appearance:"primary","data-testid":"csv-download-button",disabled:e.exportState.status!=="success"||!l.value},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}});kt.AnalyticsChart=ZC,kt.ChartLegendPosition=be,kt.CsvExportModal=qO,kt.DECIMAL_DISPLAY=Qv,kt.FONT_SIZE_REGULAR=jh,kt.FONT_SIZE_SMALL=Yh,kt.MAX_LABEL_LENGTH=$o,kt.SimpleChart=fO,kt.SparklineChart=CO,kt.TopNTable=TO,kt.ValidType=ei,kt.chartTypes=BC,kt.handleQueryError=xM,kt.isCancellationError=mf,kt.lookupStatusCodeColor=Zh,kt.simpleChartMetricDisplay=FC,kt.simpleChartTypes=zC,kt.statusCodeBadgeBackgroundColor=O1,Object.defineProperty(kt,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(Jt,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons"),require("@kong-ui-public/analytics-metric-provider")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons","@kong-ui-public/analytics-metric-provider"],p):(Jt=typeof globalThis<"u"?globalThis:Jt||self,p(Jt["kong-ui-publicvitals-chart"]={},Jt.Vue,Jt["kong-ui-public-i18n"],Jt.KongIcons,Jt["kong-ui-public-analytics-metric-provider"]))})(this,(function(Jt,p,$f,Ss,Qi){"use strict";const Tb={noDataAvailableTitle:"No data in the current time frame",noDataAvailableDescription:"Once there is traffic, it will display here",limitedResultsShown:"Grouped value limit exceeded, showing the top {maxReturned}",entityNoName:"no-name",debug:"debug",total:"Total",jumpToExplore:"Open in explorer",more_actions:"More actions",emptyEntityInfo:"Requests that do not have a value for the selected group",chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{plural}","%":"%","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",ai_plugin:"AI plugin",ai_provider:"Provider",ai_request_model:"Request model",ai_response_model:"Response model",error_rate:"Error rate",request_count:"Request count",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",response_latency_average:"Response latency (avg)",response_latency_p99:"Response latency (p99)",response_latency_p95:"Response latency (p95)",response_latency_p50:"Response latency (p50)",kong_latency_average:"Kong latency (avg)",kong_latency_p99:"Kong latency (p99)",kong_latency_p95:"Kong latency (p95)",kong_latency_p50:"Kong latency (p50)",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",country_code:"Country",country:"Country",data_plane_node:"Data plane node",data_plane_node_version:"Data plane node version",api_package:"API package",api_product:"API product",api_product_version:"API product version",portal:"Portal",realm:"Realm",runtime_group:"Runtime group",gateway_service:"Gateway service",route:"Route",application:"Application",status_code:"Status code",status_code_grouped:"Status code (grouped)",upstream_status_code:"Upstream status code",upstream_status_code_grouped:"Upstream status code group",time:"Time",Service:"Service",ServiceVersion:"Service version",Route:"Route",Application:"Application",RuntimeGroup:"Runtime group",GatewayService:"Gateway service",StatusCode:"Status code",CodeClass:"Status code (grouped)",Time:"Time",API_PRODUCT:"Api product",API_PRODUCT_VERSION:"Api product version",RUNTIME_GROUP:"Runtime group",GATEWAY_SERVICE:"Gateway service",ROUTE:"Route",APPLICATION:"Application",STATUS_CODE:"Status code",STATUS_CODE_GROUPED:"Status code (grouped)",TIME:"Time",ORGANIZATION:"Organization",TotalRequests:"Request count",RequestsPerMinute:"Requests per minute",LatencyP99:"Response latency (p99)",LatencyP95:"Response latency (p95)",LatencyP50:"Response latency (p50)",LatencyAverage:"Response latency (avg)",UpstreamLatencyP99:"Upstream latency (p99)",UpstreamLatencyP95:"Upstream latency (p95)",UpstreamLatencyP50:"Upstream latency (p50)",UpstreamLatencyAverage:"Upstream latency (avg)",KongLatencyP99:"Kong latency (p99)",KongLatencyP95:"Kong latency (p95)",KongLatencyP50:"Kong latency (p50)",KongLatencyAverage:"Kong latency (avg)",ResponseSizeP99:"Response size (p99)",ResponseSizeP95:"Response size (p95)",ResponseSizeP50:"Response size (p50)",RequestSizeP99:"Request size (p99)",RequestSizeP95:"Request size (p95)",RequestSizeP50:"Request size (p50)",SuccessfulRequests:"Successful requests",SUCCESS:"Successful requests",FailedRequests:"Failed requests",FAILURE:"Failed requests","5XX":"5xx","4XX":"4xx","3XX":"3xx","2XX":"2xx","1XX":"1xx",REQUEST_COUNT:"Request count",REQUEST_PER_MINUTE:"Requests per minute",RESPONSE_LATENCY_P99:"Response latency",RESPONSE_LATENCY_P95:"Response latency",RESPONSE_LATENCY_P50:"Response latency",RESPONSE_SIZE_P99:"Response size (p99)",RESPONSE_SIZE_P95:"Response size (p95)",RESPONSE_SIZE_P50:"Response size (p50)",REQUEST_SIZE_P99:"Request size (p99)",REQUEST_SIZE_P95:"Request size (p95)",REQUEST_SIZE_P50:"Request size (p50)",CONTROL_PLANE:"Control plane",____OTHER____:"Others",ai_request_count:"Request count",total_tokens:"Total token count",prompt_tokens:"Prompt token count",completion_tokens:"Completion token count",cost:"Costs",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"Llm latency (avg)","threshold-warning":"Warning threshold: {value}","threshold-error":"Error threshold: {value}","thatreshold-neutral":"Alert threshold: {value}",api:"API",vulnerability_count:"Vulnerability count",a2a_latency_average:"A2A latency (avg)",a2a_response_size_sum:"A2A response size (sum)",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",mcp_error:"MCP error",mcp_method:"MCP method",mcp_response_size_sum:"MCP response size (sum)",mcp_session_id:"MCP session ID",mcp_tool_name:"MCP tool name",mcp_response_body_size_sum:"MCP response size (sum)",control_plane_count:"Control plane count",service_count:"Gateway service count","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",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"},metricAxisTitles:{cache_hit_rate:"Cache hit rate {unit}",error_rate:"Error rate in {unit}",request_count:"Request count",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",latency_in:"Latency in {unit}",size_in:"Size in {unit}",response_latency_average:"Response latency (avg) in {unit}",response_latency_p99:"Response latency (p99) in {unit}",response_latency_p95:"Response latency (p95) in {unit}",response_latency_p50:"Response latency (p50) in {unit}",upstream_latency_p99:"Upstream latency (p99) in {unit}",upstream_latency_p95:"Upstream latency (p95) in {unit}",upstream_latency_p50:"Upstream latency (p50) in {unit}",kong_latency_p99:"Kong latency (p99) in {unit}",kong_latency_p95:"Kong latency (p95) in {unit}",kong_latency_p50:"Kong latency (p50) in {unit}",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",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"Llm latency (avg)",api:"API",a2a_latency_average:"A2A latency (avg) in {unit}",a2a_response_size_sum:"A2A response size (sum) in {unit}",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",mcp_response_size_sum:"MCP response size (sum) in {unit}",mcp_response_body_size_sum:"MCP response body size (sum) in {unit}",control_plane_count:"Control plane count",service_count:"Gateway service count",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count",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}"},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 Mb(){const n=$f.createI18n("en-us",Tb);return{i18n:n,i18nT:$f.i18nTComponent(n)}}function Ts(n){return n+.5|0}const xi=(n,t,e)=>Math.max(Math.min(n,e),t);function Ms(n){return xi(Ts(n*2.55),0,255)}function wi(n){return xi(Ts(n*255),0,255)}function Jn(n){return xi(Ts(n/2.55)/100,0,1)}function Yf(n){return xi(Ts(n*100),0,100)}const Sn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},uc=[..."0123456789ABCDEF"],Db=n=>uc[n&15],kb=n=>uc[(n&240)>>4]+uc[n&15],Zo=n=>(n&240)>>4===(n&15),Cb=n=>Zo(n.r)&&Zo(n.g)&&Zo(n.b)&&Zo(n.a);function Ob(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&Sn[n[1]]*17,g:255&Sn[n[2]]*17,b:255&Sn[n[3]]*17,a:t===5?Sn[n[4]]*17:255}:(t===7||t===9)&&(e={r:Sn[n[1]]<<4|Sn[n[2]],g:Sn[n[3]]<<4|Sn[n[4]],b:Sn[n[5]]<<4|Sn[n[6]],a:t===9?Sn[n[7]]<<4|Sn[n[8]]:255})),e}const Ab=(n,t)=>n<255?t(n):"";function Eb(n){var t=Cb(n)?Db:kb;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Ab(n.a,t):void 0}const Rb=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Vf(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 Pb(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 Ib(n,t,e){const i=Vf(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 Lb(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 dc(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),c=(s+a)/2;let u,d,h;return s!==a&&(h=s-a,d=c>.5?h/(2-s-a):h/(s+a),u=Lb(e,i,r,h,s),u=u*60+.5),[u|0,d||0,c]}function fc(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(wi)}function hc(n,t,e){return fc(Vf,n,t,e)}function Nb(n,t,e){return fc(Ib,n,t,e)}function Fb(n,t,e){return fc(Pb,n,t,e)}function qf(n){return(n%360+360)%360}function Bb(n){const t=Rb.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Ms(+t[5]):wi(+t[5]));const r=qf(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=Nb(r,s,a):t[1]==="hsv"?i=Fb(r,s,a):i=hc(r,s,a),{r:i[0],g:i[1],b:i[2],a:e}}function zb(n,t){var e=dc(n);e[0]=qf(e[0]+t),e=hc(e),n.r=e[0],n.g=e[1],n.b=e[2]}function Ub(n){if(!n)return;const t=dc(n),e=t[0],i=Yf(t[1]),r=Yf(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${r}%, ${Jn(n.a)})`:`hsl(${e}, ${i}%, ${r}%)`}const jf={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"},Gf={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 Hb(){const n={},t=Object.keys(Gf),e=Object.keys(jf);let i,r,s,a,c;for(i=0;i<t.length;i++){for(a=c=t[i],r=0;r<e.length;r++)s=e[r],c=c.replace(s,jf[s]);s=parseInt(Gf[a],16),n[c]=[s>>16&255,s>>8&255,s&255]}return n}let Qo;function Wb(n){Qo||(Qo=Hb(),Qo.transparent=[0,0,0,0]);const t=Qo[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const $b=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Yb(n){const t=$b.exec(n);let e=255,i,r,s;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?Ms(a):xi(a*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?Ms(i):xi(i,0,255)),r=255&(t[4]?Ms(r):xi(r,0,255)),s=255&(t[6]?Ms(s):xi(s,0,255)),{r:i,g:r,b:s,a:e}}}function Vb(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Jn(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const pc=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Er=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function qb(n,t,e){const i=Er(Jn(n.r)),r=Er(Jn(n.g)),s=Er(Jn(n.b));return{r:wi(pc(i+e*(Er(Jn(t.r))-i))),g:wi(pc(r+e*(Er(Jn(t.g))-r))),b:wi(pc(s+e*(Er(Jn(t.b))-s))),a:n.a+e*(t.a-n.a)}}function Jo(n,t,e){if(n){let i=dc(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=hc(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Kf(n,t){return n&&Object.assign(t||{},n)}function Xf(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=wi(n[3]))):(t=Kf(n,{r:0,g:0,b:0,a:1}),t.a=wi(t.a)),t}function jb(n){return n.charAt(0)==="r"?Yb(n):Bb(n)}class Ds{constructor(t){if(t instanceof Ds)return t;const e=typeof t;let i;e==="object"?i=Xf(t):e==="string"&&(i=Ob(t)||Wb(t)||jb(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Kf(this._rgb);return t&&(t.a=Jn(t.a)),t}set rgb(t){this._rgb=Xf(t)}rgbString(){return this._valid?Vb(this._rgb):void 0}hexString(){return this._valid?Eb(this._rgb):void 0}hslString(){return this._valid?Ub(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,r=t.rgb;let s;const a=e===s?.5:e,c=2*a-1,u=i.a-r.a,d=((c*u===-1?c:(c+u)/(1+c*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=qb(this._rgb,t._rgb,e)),this}clone(){return new Ds(this.rgb)}alpha(t){return this._rgb.a=wi(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Ts(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 Jo(this._rgb,2,t),this}darken(t){return Jo(this._rgb,2,-t),this}saturate(t){return Jo(this._rgb,1,t),this}desaturate(t){return Jo(this._rgb,1,-t),this}rotate(t){return zb(this._rgb,t),this}}function ti(){}const Gb=(()=>{let n=0;return()=>n++})();function Tt(n){return n==null}function Yt(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 Rt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function ae(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function fn(n,t){return ae(n)?n:t}function Mt(n,t){return typeof n>"u"?t:n}const Kb=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Zf=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function Kt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Xt(n,t,e,i){let r,s,a;if(Yt(n))for(s=n.length,r=0;r<s;r++)t.call(e,n[r],r);else if(Rt(n))for(a=Object.keys(n),s=a.length,r=0;r<s;r++)t.call(e,n[a[r]],a[r])}function ta(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 ea(n){if(Yt(n))return n.map(ea);if(Rt(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let r=0;for(;r<i;++r)t[e[r]]=ea(n[e[r]]);return t}return n}function Qf(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Xb(n,t,e,i){if(!Qf(n))return;const r=t[n],s=e[n];Rt(r)&&Rt(s)?ks(r,s,i):t[n]=ea(s)}function ks(n,t,e){const i=Yt(t)?t:[t],r=i.length;if(!Rt(n))return n;e=e||{};const s=e.merger||Xb;let a;for(let c=0;c<r;++c){if(a=i[c],!Rt(a))continue;const u=Object.keys(a);for(let d=0,h=u.length;d<h;++d)s(u[d],n,a,e)}return n}function Cs(n,t){return ks(n,t,{merger:Zb})}function Zb(n,t,e){if(!Qf(n))return;const i=t[n],r=e[n];Rt(i)&&Rt(r)?Cs(i,r):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=ea(r))}const Jf={"":n=>n,x:n=>n.x,y:n=>n.y};function Qb(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 Jb(n){const t=Qb(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function vi(n,t){return(Jf[t]||(Jf[t]=Jb(t)))(n)}function gc(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Je=n=>typeof n<"u",tn=n=>typeof n=="function",th=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function tx(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const At=Math.PI,te=2*At,ex=te+At,na=Number.POSITIVE_INFINITY,mc=At/180,re=At/2,Tn=At/4,ia=At*2/3,Si=Math.log10,Wn=Math.sign;function Os(n,t,e){return Math.abs(n-t)<e}function eh(n){const t=Math.round(n);n=Os(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(Si(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function nx(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 ix(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function Ti(n){return!ix(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function rx(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function nh(n,t,e){let i,r,s;for(i=0,r=n.length;i<r;i++)s=n[i][e],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function xe(n){return n*(At/180)}function ra(n){return n*(180/At)}function ih(n){if(!ae(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function sa(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*At&&(s+=te),{angle:s,distance:r}}function Rr(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function sx(n,t){return(n-t+ex)%te-At}function Be(n){return(n%te+te)%te}function As(n,t,e,i){const r=Be(n),s=Be(t),a=Be(e),c=Be(s-r),u=Be(a-r),d=Be(r-s),h=Be(r-a);return r===s||r===a||i&&s===a||c>u&&d<h}function Ce(n,t,e){return Math.max(t,Math.min(e,n))}function ox(n){return Ce(n,-32768,32767)}function ei(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function yc(n,t,e){e=e||(a=>n[a]<t);let i=n.length-1,r=0,s;for(;i-r>1;)s=r+i>>1,e(s)?r=s:i=s;return{lo:r,hi:i}}const ni=(n,t,e,i)=>yc(n,e,i?r=>{const s=n[r][t];return s<e||s===e&&n[r+1][t]===e}:r=>n[r][t]<e),ax=(n,t,e)=>yc(n,e,i=>n[i][t]>=e);function lx(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 rh=["push","pop","shift","splice","unshift"];function cx(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),rh.forEach(e=>{const i="_onData"+gc(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(c=>{typeof c[i]=="function"&&c[i](...s)}),a}})})}function sh(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)&&(rh.forEach(s=>{delete n[s]}),delete n._chartjs)}function oh(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const ah=(function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame})();function lh(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,ah.call(window,()=>{i=!1,n.apply(t,e)}))}}function ux(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const _c=n=>n==="start"?"left":n==="end"?"right":"center",ze=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,dx=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function ch(n,t,e){const i=t.length;let r=0,s=i;if(n._sorted){const{iScale:a,vScale:c,_parsed:u}=n,d=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,h=a.axis,{min:g,max:y,minDefined:_,maxDefined:x}=a.getUserBounds();if(_){if(r=Math.min(ni(u,h,g).lo,e?i:ni(t,h,a.getPixelForValue(g)).lo),d){const v=u.slice(0,r+1).reverse().findIndex(S=>!Tt(S[c.axis]));r-=Math.max(0,v)}r=Ce(r,0,i-1)}if(x){let v=Math.max(ni(u,a.axis,y,!0).hi+1,e?0:ni(t,h,a.getPixelForValue(y),!0).hi+1);if(d){const S=u.slice(v-1).findIndex(C=>!Tt(C[c.axis]));v+=Math.max(0,S)}s=Ce(v,r,i)-r}else s=i-r}return{start:r,count:s}}function uh(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 oa=n=>n===0||n===1,dh=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*te/e)),fh=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*te/e)+1,Es={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(At*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=>oa(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=>oa(n)?n:dh(n,.075,.3),easeOutElastic:n=>oa(n)?n:fh(n,.075,.3),easeInOutElastic(n){return oa(n)?n:n<.5?.5*dh(n*2,.1125,.45):.5+.5*fh(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-Es.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?Es.easeInBounce(n*2)*.5:Es.easeOutBounce(n*2-1)*.5+.5};function bc(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function xc(n){return bc(n)?n:new Ds(n)}function wc(n){return bc(n)?n:new Ds(n).saturate(.5).darken(.1).hexString()}const fx=["x","y","borderWidth","radius","tension"],hx=["color","borderColor","backgroundColor"];function px(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:hx},numbers:{type:"number",properties:fx}}),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 gx(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const hh=new Map;function mx(n,t){t=t||{};const e=n+JSON.stringify(t);let i=hh.get(e);return i||(i=new Intl.NumberFormat(n,t),hh.set(e,i)),i}function Rs(n,t,e){return mx(t,e).format(n)}const ph={values(n){return Yt(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=yx(n,e)}const a=Si(Math.abs(s)),c=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),u={notation:r,minimumFractionDigits:c,maximumFractionDigits:c};return Object.assign(u,this.options.ticks.format),Rs(n,i,u)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(Si(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?ph.numeric.call(this,n,t,e):""}};function yx(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 aa={formatters:ph};function _x(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:aa.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 Ji=Object.create(null),vc=Object.create(null);function Ps(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 Sc(n,t,e){return typeof t=="string"?ks(Ps(n,t),e):ks(Ps(n,""),t)}class bx{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)=>wc(r.backgroundColor),this.hoverBorderColor=(i,r)=>wc(r.borderColor),this.hoverColor=(i,r)=>wc(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 Sc(this,t,e)}get(t){return Ps(this,t)}describe(t,e){return Sc(vc,t,e)}override(t,e){return Sc(Ji,t,e)}route(t,e,i,r){const s=Ps(this,t),a=Ps(this,i),c="_"+e;Object.defineProperties(s,{[c]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){const u=this[c],d=a[r];return Rt(u)?Object.assign({},d,u):Mt(u,d)},set(u){this[c]=u}}})}apply(t){t.forEach(e=>e(this))}}var se=new bx({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[px,gx,_x]);function xx(n){return!n||Tt(n.size)||Tt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function la(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 wx(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 c=e.length;let u,d,h,g,y;for(u=0;u<c;u++)if(g=e[u],g!=null&&!Yt(g))a=la(n,r,s,a,g);else if(Yt(g))for(d=0,h=g.length;d<h;d++)y=g[d],y!=null&&!Yt(y)&&(a=la(n,r,s,a,y));n.restore();const _=s.length/2;if(_>e.length){for(u=0;u<_;u++)delete r[s[u]];s.splice(0,_)}return a}function tr(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 gh(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Tc(n,t,e,i){mh(n,t,e,i,null)}function mh(n,t,e,i,r){let s,a,c,u,d,h,g,y;const _=t.pointStyle,x=t.rotation,v=t.radius;let S=(x||0)*mc;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(v)||v<=0)){switch(n.beginPath(),_){default:r?n.ellipse(e,i,r/2,v,0,0,te):n.arc(e,i,v,0,te),n.closePath();break;case"triangle":h=r?r/2:v,n.moveTo(e+Math.sin(S)*h,i-Math.cos(S)*v),S+=ia,n.lineTo(e+Math.sin(S)*h,i-Math.cos(S)*v),S+=ia,n.lineTo(e+Math.sin(S)*h,i-Math.cos(S)*v),n.closePath();break;case"rectRounded":d=v*.516,u=v-d,a=Math.cos(S+Tn)*u,g=Math.cos(S+Tn)*(r?r/2-d:u),c=Math.sin(S+Tn)*u,y=Math.sin(S+Tn)*(r?r/2-d:u),n.arc(e-g,i-c,d,S-At,S-re),n.arc(e+y,i-a,d,S-re,S),n.arc(e+g,i+c,d,S,S+re),n.arc(e-y,i+a,d,S+re,S+At),n.closePath();break;case"rect":if(!x){u=Math.SQRT1_2*v,h=r?r/2:u,n.rect(e-h,i-u,2*h,2*u);break}S+=Tn;case"rectRot":g=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,c=Math.sin(S)*v,y=Math.sin(S)*(r?r/2:v),n.moveTo(e-g,i-c),n.lineTo(e+y,i-a),n.lineTo(e+g,i+c),n.lineTo(e-y,i+a),n.closePath();break;case"crossRot":S+=Tn;case"cross":g=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,c=Math.sin(S)*v,y=Math.sin(S)*(r?r/2:v),n.moveTo(e-g,i-c),n.lineTo(e+g,i+c),n.moveTo(e+y,i-a),n.lineTo(e-y,i+a);break;case"star":g=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,c=Math.sin(S)*v,y=Math.sin(S)*(r?r/2:v),n.moveTo(e-g,i-c),n.lineTo(e+g,i+c),n.moveTo(e+y,i-a),n.lineTo(e-y,i+a),S+=Tn,g=Math.cos(S)*(r?r/2:v),a=Math.cos(S)*v,c=Math.sin(S)*v,y=Math.sin(S)*(r?r/2:v),n.moveTo(e-g,i-c),n.lineTo(e+g,i+c),n.moveTo(e+y,i-a),n.lineTo(e-y,i+a);break;case"line":a=r?r/2:Math.cos(S)*v,c=Math.sin(S)*v,n.moveTo(e-a,i-c),n.lineTo(e+a,i+c);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(S)*(r?r/2:v),i+Math.sin(S)*v);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function ii(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 Is(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Ls(n){n.restore()}function vx(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 Sx(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 Tx(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),Tt(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 Mx(n,t,e,i,r){if(r.strikethrough||r.underline){const s=n.measureText(i),a=t-s.actualBoundingBoxLeft,c=t+s.actualBoundingBoxRight,u=e-s.actualBoundingBoxAscent,d=e+s.actualBoundingBoxDescent,h=r.strikethrough?(u+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=r.decorationWidth||2,n.moveTo(a,h),n.lineTo(c,h),n.stroke()}}function Dx(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function er(n,t,e,i,r,s={}){const a=Yt(t)?t:[t],c=s.strokeWidth>0&&s.strokeColor!=="";let u,d;for(n.save(),n.font=r.string,Tx(n,s),u=0;u<a.length;++u)d=a[u],s.backdrop&&Dx(n,s.backdrop),c&&(s.strokeColor&&(n.strokeStyle=s.strokeColor),Tt(s.strokeWidth)||(n.lineWidth=s.strokeWidth),n.strokeText(d,e,i,s.maxWidth)),n.fillText(d,e,i,s.maxWidth),Mx(n,e,i,d,s),i+=Number(r.lineHeight);n.restore()}function Pr(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*At,At,!0),n.lineTo(e,i+s-a.bottomLeft),n.arc(e+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,At,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 kx=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Cx=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Ox(n,t){const e=(""+n).match(kx);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 Ax=n=>+n||0;function Mc(n,t){const e={},i=Rt(t),r=i?Object.keys(t):t,s=Rt(n)?i?a=>Mt(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of r)e[a]=Ax(s(a));return e}function yh(n){return Mc(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Mi(n){return Mc(n,["topLeft","topRight","bottomLeft","bottomRight"])}function we(n){const t=yh(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=Mt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=Mt(n.style,t.style);i&&!(""+i).match(Cx)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Mt(n.family,t.family),lineHeight:Ox(Mt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:Mt(n.weight,t.weight),string:""};return r.string=xx(r),r}function Ns(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 Ex(n,t,e){const{min:i,max:r}=n,s=Zf(t,(r-i)/2),a=(c,u)=>e&&c===0?0:c+u;return{min:a(i,-Math.abs(s)),max:a(r,s)}}function Di(n,t){return Object.assign(Object.create(n),t)}function Dc(n,t=[""],e,i,r=()=>n[0]){const s=e||n;typeof i>"u"&&(i=vh("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:r,override:c=>Dc([c,...n],t,s,i)};return new Proxy(a,{deleteProperty(c,u){return delete c[u],delete c._keys,delete n[0][u],!0},get(c,u){return bh(c,u,()=>zx(u,t,n,c))},getOwnPropertyDescriptor(c,u){return Reflect.getOwnPropertyDescriptor(c._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(c,u){return Sh(c).includes(u)},ownKeys(c){return Sh(c)},set(c,u,d){const h=c._storage||(c._storage=r());return c[u]=h[u]=d,delete c._keys,!0}})}function Ir(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:_h(n,i),setContext:s=>Ir(n,s,e,i),override:s=>Ir(n.override(s),t,e,i)};return new Proxy(r,{deleteProperty(s,a){return delete s[a],delete n[a],!0},get(s,a,c){return bh(s,a,()=>Px(s,a,c))},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,c){return n[a]=c,delete s[a],!0}})}function _h(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:tn(e)?e:()=>e,isIndexable:tn(i)?i:()=>i}}const Rx=(n,t)=>n?n+gc(t):t,kc=(n,t)=>Rt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function bh(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function Px(n,t,e){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=n;let c=i[t];return tn(c)&&a.isScriptable(t)&&(c=Ix(t,c,n,e)),Yt(c)&&c.length&&(c=Lx(t,c,n,a.isIndexable)),kc(t,c)&&(c=Ir(c,r,s&&s[t],a)),c}function Ix(n,t,e,i){const{_proxy:r,_context:s,_subProxy:a,_stack:c}=e;if(c.has(n))throw new Error("Recursion detected: "+Array.from(c).join("->")+"->"+n);c.add(n);let u=t(s,a||i);return c.delete(n),kc(n,u)&&(u=Cc(r._scopes,r,n,u)),u}function Lx(n,t,e,i){const{_proxy:r,_context:s,_subProxy:a,_descriptors:c}=e;if(typeof s.index<"u"&&i(n))return t[s.index%t.length];if(Rt(t[0])){const u=t,d=r._scopes.filter(h=>h!==u);t=[];for(const h of u){const g=Cc(d,r,n,h);t.push(Ir(g,s,a&&a[n],c))}}return t}function xh(n,t,e){return tn(n)?n(t,e):n}const Nx=(n,t)=>n===!0?t:typeof n=="string"?vi(t,n):void 0;function Fx(n,t,e,i,r){for(const s of t){const a=Nx(e,s);if(a){n.add(a);const c=xh(a._fallback,e,r);if(typeof c<"u"&&c!==e&&c!==i)return c}else if(a===!1&&typeof i<"u"&&e!==i)return null}return!1}function Cc(n,t,e,i){const r=t._rootScopes,s=xh(t._fallback,e,i),a=[...n,...r],c=new Set;c.add(i);let u=wh(c,a,e,s||e,i);return u===null||typeof s<"u"&&s!==e&&(u=wh(c,a,s,u,i),u===null)?!1:Dc(Array.from(c),[""],r,s,()=>Bx(t,e,i))}function wh(n,t,e,i,r){for(;e;)e=Fx(n,t,e,i,r);return e}function Bx(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return Yt(r)&&Rt(e)?e:r||{}}function zx(n,t,e,i){let r;for(const s of t)if(r=vh(Rx(s,n),e),typeof r<"u")return kc(n,r)?Cc(e,i,n,r):r}function vh(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Sh(n){let t=n._keys;return t||(t=n._keys=Ux(n._scopes)),t}function Ux(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 Th(n,t,e,i){const{iScale:r}=n,{key:s="r"}=this._parsing,a=new Array(i);let c,u,d,h;for(c=0,u=i;c<u;++c)d=c+e,h=t[d],a[c]={r:r.parse(vi(h,s),d)};return a}const Hx=Number.EPSILON||1e-14,Lr=(n,t)=>t<n.length&&!n[t].skip&&n[t],Mh=n=>n==="x"?"y":"x";function Wx(n,t,e,i){const r=n.skip?t:n,s=t,a=e.skip?t:e,c=Rr(s,r),u=Rr(a,s);let d=c/(c+u),h=u/(c+u);d=isNaN(d)?0:d,h=isNaN(h)?0:h;const g=i*d,y=i*h;return{previous:{x:s.x-g*(a.x-r.x),y:s.y-g*(a.y-r.y)},next:{x:s.x+y*(a.x-r.x),y:s.y+y*(a.y-r.y)}}}function $x(n,t,e){const i=n.length;let r,s,a,c,u,d=Lr(n,0);for(let h=0;h<i-1;++h)if(u=d,d=Lr(n,h+1),!(!u||!d)){if(Os(t[h],0,Hx)){e[h]=e[h+1]=0;continue}r=e[h]/t[h],s=e[h+1]/t[h],c=Math.pow(r,2)+Math.pow(s,2),!(c<=9)&&(a=3/Math.sqrt(c),e[h]=r*a*t[h],e[h+1]=s*a*t[h])}}function Yx(n,t,e="x"){const i=Mh(e),r=n.length;let s,a,c,u=Lr(n,0);for(let d=0;d<r;++d){if(a=c,c=u,u=Lr(n,d+1),!c)continue;const h=c[e],g=c[i];a&&(s=(h-a[e])/3,c[`cp1${e}`]=h-s,c[`cp1${i}`]=g-s*t[d]),u&&(s=(u[e]-h)/3,c[`cp2${e}`]=h+s,c[`cp2${i}`]=g+s*t[d])}}function Vx(n,t="x"){const e=Mh(t),i=n.length,r=Array(i).fill(0),s=Array(i);let a,c,u,d=Lr(n,0);for(a=0;a<i;++a)if(c=u,u=d,d=Lr(n,a+1),!!u){if(d){const h=d[t]-u[t];r[a]=h!==0?(d[e]-u[e])/h:0}s[a]=c?d?Wn(r[a-1])!==Wn(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}$x(n,r,s),Yx(n,s,t)}function ca(n,t,e){return Math.max(Math.min(n,e),t)}function qx(n,t){let e,i,r,s,a,c=ii(n[0],t);for(e=0,i=n.length;e<i;++e)a=s,s=c,c=e<i-1&&ii(n[e+1],t),s&&(r=n[e],a&&(r.cp1x=ca(r.cp1x,t.left,t.right),r.cp1y=ca(r.cp1y,t.top,t.bottom)),c&&(r.cp2x=ca(r.cp2x,t.left,t.right),r.cp2y=ca(r.cp2y,t.top,t.bottom)))}function jx(n,t,e,i,r){let s,a,c,u;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")Vx(n,r);else{let d=i?n[n.length-1]:n[0];for(s=0,a=n.length;s<a;++s)c=n[s],u=Wx(d,c,n[Math.min(s+1,a-(i?0:1))%a],t.tension),c.cp1x=u.previous.x,c.cp1y=u.previous.y,c.cp2x=u.next.x,c.cp2y=u.next.y,d=c}t.capBezierPoints&&qx(n,e)}function Oc(){return typeof window<"u"&&typeof document<"u"}function Ac(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ua(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 da=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Gx(n,t){return da(n).getPropertyValue(t)}const Kx=["top","right","bottom","left"];function nr(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const s=Kx[r];i[s]=parseFloat(n[t+"-"+s+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Xx=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Zx(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:s}=i;let a=!1,c,u;if(Xx(r,s,n.target))c=r,u=s;else{const d=t.getBoundingClientRect();c=i.clientX-d.left,u=i.clientY-d.top,a=!0}return{x:c,y:u,box:a}}function ki(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,r=da(e),s=r.boxSizing==="border-box",a=nr(r,"padding"),c=nr(r,"border","width"),{x:u,y:d,box:h}=Zx(n,e),g=a.left+(h&&c.left),y=a.top+(h&&c.top);let{width:_,height:x}=t;return s&&(_-=a.width+c.width,x-=a.height+c.height),{x:Math.round((u-g)/_*e.width/i),y:Math.round((d-y)/x*e.height/i)}}function Qx(n,t,e){let i,r;if(t===void 0||e===void 0){const s=n&&Ac(n);if(!s)t=n.clientWidth,e=n.clientHeight;else{const a=s.getBoundingClientRect(),c=da(s),u=nr(c,"border","width"),d=nr(c,"padding");t=a.width-d.width-u.width,e=a.height-d.height-u.height,i=ua(c.maxWidth,s,"clientWidth"),r=ua(c.maxHeight,s,"clientHeight")}}return{width:t,height:e,maxWidth:i||na,maxHeight:r||na}}const Ci=n=>Math.round(n*10)/10;function Jx(n,t,e,i){const r=da(n),s=nr(r,"margin"),a=ua(r.maxWidth,n,"clientWidth")||na,c=ua(r.maxHeight,n,"clientHeight")||na,u=Qx(n,t,e);let{width:d,height:h}=u;if(r.boxSizing==="content-box"){const y=nr(r,"border","width"),_=nr(r,"padding");d-=_.width+y.width,h-=_.height+y.height}return d=Math.max(0,d-s.width),h=Math.max(0,i?d/i:h-s.height),d=Ci(Math.min(d,a,u.maxWidth)),h=Ci(Math.min(h,c,u.maxHeight)),d&&!h&&(h=Ci(d/2)),(t!==void 0||e!==void 0)&&i&&u.height&&h>u.height&&(h=u.height,d=Ci(Math.floor(h*i))),{width:d,height:h}}function Dh(n,t,e){const i=t||1,r=Ci(n.height*i),s=Ci(n.width*i);n.height=Ci(n.height),n.width=Ci(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 tw=(function(){let n=!1;try{const t={get passive(){return n=!0,!1}};Oc()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n})();function kh(n,t){const e=Gx(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function ir(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function ew(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 nw(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},s={x:t.cp1x,y:t.cp1y},a=ir(n,r,e),c=ir(r,s,e),u=ir(s,t,e),d=ir(a,c,e),h=ir(c,u,e);return ir(d,h,e)}const iw=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}}},rw=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function Nr(n,t,e){return n?iw(t,e):rw()}function Ch(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 Oh(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function Ah(n){return n==="angle"?{between:As,compare:sx,normalize:Be}:{between:ei,compare:(t,e)=>t-e,normalize:t=>t}}function Eh({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 sw(n,t,e){const{property:i,start:r,end:s}=e,{between:a,normalize:c}=Ah(i),u=t.length;let{start:d,end:h,loop:g}=n,y,_;if(g){for(d+=u,h+=u,y=0,_=u;y<_&&a(c(t[d%u][i]),r,s);++y)d--,h--;d%=u,h%=u}return h<d&&(h+=u),{start:d,end:h,loop:g,style:n.style}}function Rh(n,t,e){if(!e)return[n];const{property:i,start:r,end:s}=e,a=t.length,{compare:c,between:u,normalize:d}=Ah(i),{start:h,end:g,loop:y,style:_}=sw(n,t,e),x=[];let v=!1,S=null,C,E,U;const P=()=>u(r,U,C)&&c(r,U)!==0,I=()=>c(s,C)===0||u(s,U,C),B=()=>v||P(),N=()=>!v||I();for(let T=h,D=h;T<=g;++T)E=t[T%a],!E.skip&&(C=d(E[i]),C!==U&&(v=u(C,r,s),S===null&&B()&&(S=c(C,r)===0?T:D),S!==null&&N()&&(x.push(Eh({start:S,end:T,loop:y,count:a,style:_})),S=null),D=T,U=C));return S!==null&&x.push(Eh({start:S,end:g,loop:y,count:a,style:_})),x}function Ph(n,t){const e=[],i=n.segments;for(let r=0;r<i.length;r++){const s=Rh(i[r],n.points,t);s.length&&e.push(...s)}return e}function ow(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 aw(n,t,e,i){const r=n.length,s=[];let a=t,c=n[t],u;for(u=t+1;u<=e;++u){const d=n[u%r];d.skip||d.stop?c.skip||(i=!1,s.push({start:t%r,end:(u-1)%r,loop:i}),t=a=d.stop?u:null):(a=u,c.skip&&(t=u)),c=d}return a!==null&&s.push({start:t%r,end:a%r,loop:i}),s}function lw(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const s=!!n._loop,{start:a,end:c}=ow(e,r,s,i);if(i===!0)return Ih(n,[{start:a,end:c,loop:s}],e,t);const u=c<a?c+r:c,d=!!n._fullLoop&&a===0&&c===r-1;return Ih(n,aw(e,a,u,d),e,t)}function Ih(n,t,e,i){return!i||!i.setContext||!e?t:cw(n,t,e,i)}function cw(n,t,e,i){const r=n._chart.getContext(),s=Lh(n.options),{_datasetIndex:a,options:{spanGaps:c}}=n,u=e.length,d=[];let h=s,g=t[0].start,y=g;function _(x,v,S,C){const E=c?-1:1;if(x!==v){for(x+=u;e[x%u].skip;)x-=E;for(;e[v%u].skip;)v+=E;x%u!==v%u&&(d.push({start:x%u,end:v%u,loop:S,style:C}),h=C,g=v%u)}}for(const x of t){g=c?g:x.start;let v=e[g%u],S;for(y=g+1;y<=x.end;y++){const C=e[y%u];S=Lh(i.setContext(Di(r,{type:"segment",p0:v,p1:C,p0DataIndex:(y-1)%u,p1DataIndex:y%u,datasetIndex:a}))),uw(S,h)&&_(g,y-1,x.loop,h),v=C,h=S}g<y-1&&_(g,y-1,x.loop,h)}return d}function Lh(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function uw(n,t){if(!t)return!1;const e=[],i=function(r,s){return bc(s)?(e.includes(s)||e.push(s),e.indexOf(s)):s};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function fa(n,t,e){return n.options.clip?n[e]:t[e]}function dw(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:fa(e,t,"left"),right:fa(e,t,"right"),top:fa(i,t,"top"),bottom:fa(i,t,"bottom")}:t}function Nh(n,t){const e=t._clip;if(e.disabled)return!1;const i=dw(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 fw{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(c=>c({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=ah.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,c=!1,u;for(;a>=0;--a)u=s[a],u._active?(u._total>i.duration&&(i.duration=u._total),u.tick(t),c=!0):(s[a]=s[s.length-1],s.pop());c&&(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 ri=new fw;const Fh="transparent",hw={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=xc(n||Fh),r=i.valid&&xc(t||Fh);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class pw{constructor(t,e,i,r){const s=e[i];r=Ns([t.to,r,s,t.from]);const a=Ns([t.from,s,r]);this._active=!0,this._fn=t.fn||hw[t.type||typeof a],this._easing=Es[t.easing]||Es.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=Ns([t.to,e,r,t.from]),this._from=Ns([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,c=this._to;let u;if(this._active=s!==c&&(a||e<i),!this._active){this._target[r]=c,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,c,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 Ec{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!Rt(t))return;const e=Object.keys(se.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!Rt(s))return;const a={};for(const c of e)a[c]=s[c];(Yt(s.properties)&&s.properties||[r]).forEach(c=>{(c===r||!i.has(c))&&i.set(c,a)})})}_animateOptions(t,e){const i=e.options,r=mw(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&gw(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),c=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 h=e[d];let g=s[d];const y=i.get(d);if(g)if(y&&g.active()){g.update(y,h,c);continue}else g.cancel();if(!y||!y.duration){t[d]=h;continue}s[d]=g=new pw(y,t,d,h),r.push(g)}return r}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return ri.add(this._chart,i),!0}}function gw(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 mw(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 Bh(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 yw(n,t,e){if(e===!1)return!1;const i=Bh(n,e),r=Bh(t,e);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function _w(n){let t,e,i,r;return Rt(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 zh(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 Uh(n,t,e,i={}){const r=n.keys,s=i.mode==="single";let a,c,u,d;if(t===null)return;let h=!1;for(a=0,c=r.length;a<c;++a){if(u=+r[a],u===e){if(h=!0,i.all)continue;break}d=n.values[u],ae(d)&&(s||t===0||Wn(t)===Wn(d))&&(t+=d)}return!h&&!i.all?0:t}function bw(n,t){const{iScale:e,vScale:i}=t,r=e.axis==="x"?"x":"y",s=i.axis==="x"?"x":"y",a=Object.keys(n),c=new Array(a.length);let u,d,h;for(u=0,d=a.length;u<d;++u)h=a[u],c[u]={[r]:h,[s]:n[h]};return c}function Rc(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function xw(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function ww(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 vw(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function Hh(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 Wh(n,t){const{chart:e,_cachedMeta:i}=n,r=e._stacks||(e._stacks={}),{iScale:s,vScale:a,index:c}=i,u=s.axis,d=a.axis,h=xw(s,a,i),g=t.length;let y;for(let _=0;_<g;++_){const x=t[_],{[u]:v,[d]:S}=x,C=x._stacks||(x._stacks={});y=C[d]=vw(r,h,v),y[c]=S,y._top=Hh(y,a,!0,i.type),y._bottom=Hh(y,a,!1,i.type);const E=y._visualValues||(y._visualValues={});E[c]=S}}function Pc(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Sw(n,t){return Di(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Tw(n,t,e){return Di(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Fs(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 Ic=n=>n==="reset"||n==="none",$h=(n,t)=>t?n:Object.assign({},n),Mw=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:zh(e,!0),values:null};class Oi{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=Rc(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&&Fs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(g,y,_,x)=>g==="x"?y:g==="r"?x:_,s=e.xAxisID=Mt(i.xAxisID,Pc(t,"x")),a=e.yAxisID=Mt(i.yAxisID,Pc(t,"y")),c=e.rAxisID=Mt(i.rAxisID,Pc(t,"r")),u=e.indexAxis,d=e.iAxisID=r(u,s,a,c),h=e.vAxisID=r(u,a,s,c);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(c),e.iScale=this.getScaleForId(d),e.vScale=this.getScaleForId(h)}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&&sh(this._data,this),t._stacked&&Fs(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(Rt(e)){const r=this._cachedMeta;this._data=bw(e,r)}else if(i!==e){if(i){sh(i,this);const r=this._cachedMeta;Fs(r),r._parsed=[]}e&&Object.isExtensible(e)&&cx(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=Rc(e.vScale,e),e.stack!==i.stack&&(r=!0,Fs(e),e.stack=i.stack),this._resyncElements(t),(r||s!==e._stacked)&&(Wh(this,e._parsed),e._stacked=Rc(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,c=s.axis;let u=t===0&&e===r.length?!0:i._sorted,d=t>0&&i._parsed[t-1],h,g,y;if(this._parsing===!1)i._parsed=r,i._sorted=!0,y=r;else{Yt(r[t])?y=this.parseArrayData(i,r,t,e):Rt(r[t])?y=this.parseObjectData(i,r,t,e):y=this.parsePrimitiveData(i,r,t,e);const _=()=>g[c]===null||d&&g[c]<d[c];for(h=0;h<e;++h)i._parsed[h+t]=g=y[h],u&&(_()&&(u=!1),d=g);i._sorted=u}a&&Wh(this,y)}parsePrimitiveData(t,e,i,r){const{iScale:s,vScale:a}=t,c=s.axis,u=a.axis,d=s.getLabels(),h=s===a,g=new Array(r);let y,_,x;for(y=0,_=r;y<_;++y)x=y+i,g[y]={[c]:h||s.parse(d[x],x),[u]:a.parse(e[x],x)};return g}parseArrayData(t,e,i,r){const{xScale:s,yScale:a}=t,c=new Array(r);let u,d,h,g;for(u=0,d=r;u<d;++u)h=u+i,g=e[h],c[u]={x:s.parse(g[0],h),y:a.parse(g[1],h)};return c}parseObjectData(t,e,i,r){const{xScale:s,yScale:a}=t,{xAxisKey:c="x",yAxisKey:u="y"}=this._parsing,d=new Array(r);let h,g,y,_;for(h=0,g=r;h<g;++h)y=h+i,_=e[y],d[h]={x:s.parse(vi(_,c),y),y:a.parse(vi(_,u),y)};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],c={keys:zh(r,!0),values:e._stacks[t.axis]._visualValues};return Uh(c,a,s.index,{mode:i})}updateRangeFromParsed(t,e,i,r){const s=i[e.axis];let a=s===null?NaN:s;const c=r&&i._stacks[e.axis];r&&c&&(r.values=c,a=Uh(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,c=this._getOtherScale(t),u=Mw(e,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:g}=ww(c);let y,_;function x(){_=r[y];const v=_[c.axis];return!ae(_[t.axis])||h>v||g<v}for(y=0;y<a&&!(!x()&&(this.updateRangeFromParsed(d,t,_,u),s));++y);if(s){for(y=a-1;y>=0;--y)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=_w(Mt(this.options.clip,yw(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=[],c=this._drawStart||0,u=this._drawCount||r.length-c,d=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,s,c,u),h=c;h<c+u;++h){const g=r[h];g.hidden||(g.active&&d?a.push(g):g.draw(t,s))}for(h=0;h<a.length;++h)a[h].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=Tw(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=Sw(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,c=s[a],u=this.enableOptionSharing&&Je(i);if(c)return $h(c,u);const d=this.chart.config,h=d.datasetElementScopeKeys(this._type,t),g=r?[`${t}Hover`,"hover",t,""]:[t,""],y=d.getOptionScopes(this.getDataset(),h),_=Object.keys(se.elements[t]),x=()=>this.getContext(i,r,e),v=d.resolveNamedOptions(y,_,x,g);return v.$shared&&(v.$shared=u,s[a]=Object.freeze($h(v,u))),v}_resolveAnimations(t,e,i){const r=this.chart,s=this._cachedDataOpts,a=`animation-${e}`,c=s[a];if(c)return c;let u;if(r.options.animation!==!1){const h=this.chart.config,g=h.datasetAnimationScopeKeys(this._type,e),y=h.getOptionScopes(this.getDataset(),g);u=h.createResolver(y,this.getContext(t,i,e))}const d=new Ec(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||Ic(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){Ic(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!Ic(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[c,u,d]of this._syncList)this[c](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 c;const u=d=>{for(d.length+=e,c=d.length-1;c>=a;c--)d[c]=d[c-e]};for(u(s),c=t;c<a;++c)s[c]=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&&Fs(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 Dw(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=oh(i.sort((r,s)=>r-s))}return n._cache.$bar}function kw(n){const t=n.iScale,e=Dw(t,n.type);let i=t._length,r,s,a,c;const u=()=>{a===32767||a===-32768||(Je(c)&&(i=Math.min(i,Math.abs(a-c)||i)),c=a)};for(r=0,s=e.length;r<s;++r)a=t.getPixelForValue(e[r]),u();for(c=void 0,r=0,s=t.ticks.length;r<s;++r)a=t.getPixelForTick(r),u();return i}function Cw(n,t,e,i){const r=e.barThickness;let s,a;return Tt(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 Ow(n,t,e,i){const r=t.pixels,s=r[n];let a=n>0?r[n-1]:null,c=n<r.length-1?r[n+1]:null;const u=e.categoryPercentage;a===null&&(a=s-(c===null?t.end-t.start:c-s)),c===null&&(c=s+s-a);const d=s-(s-Math.min(a,c))/2*u;return{chunk:Math.abs(c-a)/2*u/i,ratio:e.barPercentage,start:d}}function Aw(n,t,e,i){const r=e.parse(n[0],i),s=e.parse(n[1],i),a=Math.min(r,s),c=Math.max(r,s);let u=a,d=c;Math.abs(a)>Math.abs(c)&&(u=c,d=a),t[e.axis]=d,t._custom={barStart:u,barEnd:d,start:r,end:s,min:a,max:c}}function Yh(n,t,e,i){return Yt(n)?Aw(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Vh(n,t,e,i){const r=n.iScale,s=n.vScale,a=r.getLabels(),c=r===s,u=[];let d,h,g,y;for(d=e,h=e+i;d<h;++d)y=t[d],g={},g[r.axis]=c||r.parse(a[d],d),u.push(Yh(y,g,s,d));return u}function Lc(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Ew(n,t,e){return n!==0?Wn(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Rw(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 Pw(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:c,reverse:u,top:d,bottom:h}=Rw(n);r==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?r=d:(e._bottom||0)===i?r=h:(s[qh(h,a,c,u)]=!0,r=d)),s[qh(r,a,c,u)]=!0,n.borderSkipped=s}function qh(n,t,e,i){return i?(n=Iw(n,t,e),n=jh(n,e,t)):n=jh(n,t,e),n}function Iw(n,t,e){return n===t?e:n===e?t:n}function jh(n,t,e){return n==="start"?t:n==="end"?e:n}function Lw(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Gh extends Oi{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 Vh(t,e,i,r)}parseArrayData(t,e,i,r){return Vh(t,e,i,r)}parseObjectData(t,e,i,r){const{iScale:s,vScale:a}=t,{xAxisKey:c="x",yAxisKey:u="y"}=this._parsing,d=s.axis==="x"?c:u,h=a.axis==="x"?c:u,g=[];let y,_,x,v;for(y=i,_=i+r;y<_;++y)v=e[y],x={},x[s.axis]=s.parse(vi(v,d),y),g.push(Yh(vi(v,h),x,a,y));return g}updateRangeFromParsed(t,e,i,r){super.updateRangeFromParsed(t,e,i,r);const s=i._custom;s&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:r}=e,s=this.getParsed(t),a=s._custom,c=Lc(a)?"["+a.start+", "+a.end+"]":""+r.getLabelForValue(s[r.axis]);return{label:""+i.getLabelForValue(s[i.axis]),value:c}}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:c}}=this,u=c.getBasePixel(),d=c.isHorizontal(),h=this._getRuler(),{sharedOptions:g,includeOptions:y}=this._getSharedOptions(e,r);for(let _=e;_<e+i;_++){const x=this.getParsed(_),v=s||Tt(x[c.axis])?{base:u,head:u}:this._calculateBarValuePixels(_),S=this._calculateBarIndexPixels(_,h),C=(x._stacks||{})[c.axis],E={horizontal:d,base:v.base,enableBorderRadius:!C||Lc(x._custom)||a===C._top||a===C._bottom,x:d?v.head:S.center,y:d?S.center:v.head,height:d?S.size:Math.abs(v.size),width:d?Math.abs(v.size):S.size};y&&(E.options=g||this.resolveDataElementOptions(_,t[_].active?"active":r));const U=E.options||t[_].options;Pw(E,U,C,a),Lw(E,U,h.ratio),this.updateElement(t[_],_,E,r)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),s=i.options.stacked,a=[],c=this._cachedMeta.controller.getParsed(e),u=c&&c[i.axis],d=h=>{const g=h._parsed.find(_=>_[i.axis]===u),y=g&&g[h.vScale.axis];if(Tt(y)||isNaN(y))return!0};for(const h of r)if(!(e!==void 0&&d(h))&&((s===!1||a.indexOf(h.stack)===-1||s===void 0&&h.stack===void 0)&&a.push(h.stack),h.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[Mt(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 c=t.barThickness;return{min:c||kw(e),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:c?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:r},options:{base:s,minBarLength:a}}=this,c=s||0,u=this.getParsed(t),d=u._custom,h=Lc(d);let g=u[e.axis],y=0,_=i?this.applyStack(e,u,i):g,x,v;_!==g&&(y=_-g,_=g),h&&(g=d.barStart,_=d.barEnd-d.barStart,g!==0&&Wn(g)!==Wn(d.barEnd)&&(y=0),y+=g);const S=!Tt(s)&&!h?s:y;let C=e.getPixelForValue(S);if(this.chart.getDataVisibility(t)?x=e.getPixelForValue(y+_):x=C,v=x-C,Math.abs(v)<a){v=Ew(v,e,c)*a,g===c&&(C-=v/2);const E=e.getPixelForDecimal(0),U=e.getPixelForDecimal(1),P=Math.min(E,U),I=Math.max(E,U);C=Math.max(Math.min(C,I),P),x=C+v,i&&!h&&(u._stacks[e.axis]._visualValues[r]=e.getValueForPixel(x)-e.getValueForPixel(C))}if(C===e.getPixelForValue(c)){const E=Wn(v)*e.getLineWidthForValue(c)/2;C+=E,v-=E}return{size:v,base:C,head:x,center:x+v/2}}_calculateBarIndexPixels(t,e){const i=e.scale,r=this.options,s=r.skipNull,a=Mt(r.maxBarThickness,1/0);let c,u;const d=this._getAxisCount();if(e.grouped){const h=s?this._getStackCount(t):e.stackCount,g=r.barThickness==="flex"?Ow(t,e,r,h*d):Cw(t,e,r,h*d),y=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,_=this._getAxis().indexOf(Mt(y,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+_;c=g.start+g.chunk*x+g.chunk/2,u=Math.min(a,g.chunk*g.ratio)}else c=i.getPixelForValue(this.getParsed(t)[i.axis],t),u=Math.min(a,e.min*e.ratio);return{base:c-u/2,head:c+u/2,center:c,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 Nw extends Oi{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 c=e[i+a];s[a]._custom=Mt(c[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 c=e[i+a];s[a]._custom=Mt(c&&c.r&&+c.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),c=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y),d=a._custom;return{label:i[t]||"",value:"("+c+", "+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:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,r),h=a.axis,g=c.axis;for(let y=e;y<e+i;y++){const _=t[y],x=!s&&this.getParsed(y),v={},S=v[h]=s?a.getPixelForDecimal(.5):a.getPixelForValue(x[h]),C=v[g]=s?c.getBasePixel():c.getPixelForValue(x[g]);v.skip=isNaN(S)||isNaN(C),d&&(v.options=u||this.resolveDataElementOptions(y,_.active?"active":r),s&&(v.options.radius=0)),this.updateElement(_,y,v,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+=Mt(i&&i._custom,s),r}}function Fw(n,t,e){let i=1,r=1,s=0,a=0;if(t<te){const c=n,u=c+t,d=Math.cos(c),h=Math.sin(c),g=Math.cos(u),y=Math.sin(u),_=(U,P,I)=>As(U,c,u,!0)?1:Math.max(P,P*e,I,I*e),x=(U,P,I)=>As(U,c,u,!0)?-1:Math.min(P,P*e,I,I*e),v=_(0,d,g),S=_(re,h,y),C=x(At,d,g),E=x(At+re,h,y);i=(v-C)/2,r=(S-E)/2,s=-(v+C)/2,a=-(S+E)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:a}}class Bs extends Oi{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:c}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((u,d)=>{const g=t.getDatasetMeta(0).controller.getStyle(d);return{text:u,fillStyle:g.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(d),lineDash:g.borderDash,lineDashOffset:g.borderDashOffset,lineJoin:g.borderJoinStyle,lineWidth:g.borderWidth,strokeStyle:g.borderColor,textAlign:r,pointStyle:i,borderRadius:a&&(c||g.borderRadius),index:d}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let s=u=>+i[u];if(Rt(i[t])){const{key:u="value"}=this._parsing;s=d=>+vi(i[d],u)}let a,c;for(a=t,c=t+e;a<c;++a)r._parsed[a]=s(a)}}_getRotation(){return xe(this.options.rotation-90)}_getCircumference(){return xe(this.options.circumference)}_getRotationExtents(){let t=te,e=-te;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,s=r._getRotation(),a=r._getCircumference();t=Math.min(t,s),e=Math.max(e,s+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,r=this._cachedMeta,s=r.data,a=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,c=Math.max((Math.min(i.width,i.height)-a)/2,0),u=Math.min(Kb(this.options.cutout,c),1),d=this._getRingWeight(this.index),{circumference:h,rotation:g}=this._getRotationExtents(),{ratioX:y,ratioY:_,offsetX:x,offsetY:v}=Fw(g,h,u),S=(i.width-a)/y,C=(i.height-a)/_,E=Math.max(Math.min(S,C)/2,0),U=Zf(this.options.radius,E),P=Math.max(U*u,0),I=(U-P)/this._getVisibleDatasetWeightTotal();this.offsetX=x*U,this.offsetY=v*U,r.total=this.calculateTotal(),this.outerRadius=U-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,c=a.chartArea,d=a.options.animation,h=(c.left+c.right)/2,g=(c.top+c.bottom)/2,y=s&&d.animateScale,_=y?0:this.innerRadius,x=y?0:this.outerRadius,{sharedOptions:v,includeOptions:S}=this._getSharedOptions(e,r);let C=this._getRotation(),E;for(E=0;E<e;++E)C+=this._circumference(E,s);for(E=e;E<e+i;++E){const U=this._circumference(E,s),P=t[E],I={x:h+this.offsetX,y:g+this.offsetY,startAngle:C,endAngle:C+U,circumference:U,outerRadius:x,innerRadius:_};S&&(I.options=v||this.resolveDataElementOptions(E,P.active?"active":r)),C+=U,this.updateElement(P,E,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=Rs(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,c,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,c=a.controller;break}}if(!t)return 0;for(r=0,s=t.length;r<s;++r)u=c.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(Mt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Kh extends Oi{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:c,count:u}=ch(e,r,a);this._drawStart=c,this._drawCount=u,uh(e)&&(c=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,c,u,t)}updateElements(t,e,i,r){const s=r==="reset",{iScale:a,vScale:c,_stacked:u,_dataset:d}=this._cachedMeta,{sharedOptions:h,includeOptions:g}=this._getSharedOptions(e,r),y=a.axis,_=c.axis,{spanGaps:x,segment:v}=this.options,S=Ti(x)?x:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||s||r==="none",E=e+i,U=t.length;let P=e>0&&this.getParsed(e-1);for(let I=0;I<U;++I){const B=t[I],N=C?B:{};if(I<e||I>=E){N.skip=!0;continue}const T=this.getParsed(I),D=Tt(T[_]),O=N[y]=a.getPixelForValue(T[y],I),L=N[_]=s||D?c.getBasePixel():c.getPixelForValue(u?this.applyStack(c,T,u):T[_],I);N.skip=isNaN(O)||isNaN(L)||D,N.stop=I>0&&Math.abs(T[y]-P[y])>S,v&&(N.parsed=T,N.raw=d.data[I]),g&&(N.options=h||this.resolveDataElementOptions(I,B.active?"active":r)),C||this.updateElement(B,I,N,r),P=T}}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 Xh extends Oi{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=Rs(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:s}}parseObjectData(t,e,i,r){return Th.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),c=(s-a)/t.getVisibleDatasetCount();this.outerRadius=s-c*this.index,this.innerRadius=this.outerRadius-c}updateElements(t,e,i,r){const s=r==="reset",a=this.chart,u=a.options.animation,d=this._cachedMeta.rScale,h=d.xCenter,g=d.yCenter,y=d.getIndexAngle(0)-.5*At;let _=y,x;const v=360/this.countVisibleElements();for(x=0;x<e;++x)_+=this._computeAngle(x,r,v);for(x=e;x<e+i;x++){const S=t[x];let C=_,E=_+this._computeAngle(x,r,v),U=a.getDataVisibility(x)?d.getDistanceFromCenterForValue(this.getParsed(x).r):0;_=E,s&&(u.animateScale&&(U=0),u.animateRotate&&(C=E=y));const P={x:h,y:g,innerRadius:0,outerRadius:U,startAngle:C,endAngle:E,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)?xe(this.resolveDataElementOptions(t,e).angle||i):0}}class Bw extends Bs{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class zw extends Oi{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 Th.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 c={_loop:!0,_fullLoop:s.length===r.length,options:a};this.updateElement(i,void 0,c,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,i,r){const s=this._cachedMeta.rScale,a=r==="reset";for(let c=e;c<e+i;c++){const u=t[c],d=this.resolveDataElementOptions(c,u.active?"active":r),h=s.getPointPositionForValue(c,this.getParsed(c).r),g=a?s.xCenter:h.x,y=a?s.yCenter:h.y,_={x:g,y,angle:h.angle,skip:isNaN(g)||isNaN(y),options:d};this.updateElement(u,c,_,r)}}}class Uw extends Oi{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),c=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y);return{label:i[t]||"",value:"("+c+", "+u+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,r=this.chart._animationsDisabled;let{start:s,count:a}=ch(e,i,r);if(this._drawStart=s,this._drawCount=a,uh(e)&&(s=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:c,_dataset:u}=e;c._chart=this.chart,c._datasetIndex=this.index,c._decimated=!!u._decimated,c.points=i;const d=this.resolveDatasetElementOptions(t);d.segment=this.options.segment,this.updateElement(c,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:c,_stacked:u,_dataset:d}=this._cachedMeta,h=this.resolveDataElementOptions(e,r),g=this.getSharedOptions(h),y=this.includeOptions(r,g),_=a.axis,x=c.axis,{spanGaps:v,segment:S}=this.options,C=Ti(v)?v:Number.POSITIVE_INFINITY,E=this.chart._animationsDisabled||s||r==="none";let U=e>0&&this.getParsed(e-1);for(let P=e;P<e+i;++P){const I=t[P],B=this.getParsed(P),N=E?I:{},T=Tt(B[x]),D=N[_]=a.getPixelForValue(B[_],P),O=N[x]=s||T?c.getBasePixel():c.getPixelForValue(u?this.applyStack(c,B,u):B[x],P);N.skip=isNaN(D)||isNaN(O)||T,N.stop=P>0&&Math.abs(B[_]-U[_])>C,S&&(N.parsed=B,N.raw=d.data[P]),y&&(N.options=g||this.resolveDataElementOptions(P,I.active?"active":r)),E||this.updateElement(I,P,N,r),U=B}this.updateSharedOptions(g,r,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let c=0;for(let u=e.length-1;u>=0;--u)c=Math.max(c,e[u].size(this.resolveDataElementOptions(u))/2);return c>0&&c}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 Hw=Object.freeze({__proto__:null,BarController:Gh,BubbleController:Nw,DoughnutController:Bs,LineController:Kh,PieController:Bw,PolarAreaController:Xh,RadarController:zw,ScatterController:Uw});function rr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Nc{static override(t){Object.assign(Nc.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return rr()}parse(){return rr()}format(){return rr()}add(){return rr()}diff(){return rr()}startOf(){return rr()}endOf(){return rr()}}var Zh={_date:Nc};function Ww(n,t,e,i){const{controller:r,data:s,_sorted:a}=n,c=r._cachedMeta.iScale,u=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(c&&t===c.axis&&t!=="r"&&a&&s.length){const d=c._reversePixels?ax:ni;if(i){if(r._sharedOptions){const h=s[0],g=typeof h.getRange=="function"&&h.getRange(t);if(g){const y=d(s,t,e-g),_=d(s,t,e+g);return{lo:y.lo,hi:_.hi}}}}else{const h=d(s,t,e);if(u){const{vScale:g}=r._cachedMeta,{_parsed:y}=n,_=y.slice(0,h.lo+1).reverse().findIndex(v=>!Tt(v[g.axis]));h.lo-=Math.max(0,_);const x=y.slice(h.hi).findIndex(v=>!Tt(v[g.axis]));h.hi+=Math.max(0,x)}return h}}return{lo:0,hi:s.length-1}}function zs(n,t,e,i,r){const s=n.getSortedVisibleDatasetMetas(),a=e[t];for(let c=0,u=s.length;c<u;++c){const{index:d,data:h}=s[c],{lo:g,hi:y}=Ww(s[c],t,a,r);for(let _=g;_<=y;++_){const x=h[_];x.skip||i(x,d,_)}}}function $w(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 Fc(n,t,e,i,r){const s=[];return!r&&!n.isPointInArea(t)||zs(n,e,t,function(c,u,d){!r&&!ii(c,n.chartArea,0)||c.inRange(t.x,t.y,i)&&s.push({element:c,datasetIndex:u,index:d})},!0),s}function Yw(n,t,e,i){let r=[];function s(a,c,u){const{startAngle:d,endAngle:h}=a.getProps(["startAngle","endAngle"],i),{angle:g}=sa(a,{x:t.x,y:t.y});As(g,d,h)&&r.push({element:a,datasetIndex:c,index:u})}return zs(n,e,t,s),r}function Vw(n,t,e,i,r,s){let a=[];const c=$w(e);let u=Number.POSITIVE_INFINITY;function d(h,g,y){const _=h.inRange(t.x,t.y,r);if(i&&!_)return;const x=h.getCenterPoint(r);if(!(!!s||n.isPointInArea(x))&&!_)return;const S=c(t,x);S<u?(a=[{element:h,datasetIndex:g,index:y}],u=S):S===u&&a.push({element:h,datasetIndex:g,index:y})}return zs(n,e,t,d),a}function Bc(n,t,e,i,r,s){return!s&&!n.isPointInArea(t)?[]:e==="r"&&!i?Yw(n,t,e,r):Vw(n,t,e,i,r,s)}function Qh(n,t,e,i,r){const s=[],a=e==="x"?"inXRange":"inYRange";let c=!1;return zs(n,e,t,(u,d,h)=>{u[a]&&u[a](t[e],r)&&(s.push({element:u,datasetIndex:d,index:h}),c=c||u.inRange(t.x,t.y,r))}),i&&!c?[]:s}var zc={evaluateInteractionItems:zs,modes:{index(n,t,e,i){const r=ki(t,n),s=e.axis||"x",a=e.includeInvisible||!1,c=e.intersect?Fc(n,r,s,i,a):Bc(n,r,s,!1,i,a),u=[];return c.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const h=c[0].index,g=d.data[h];g&&!g.skip&&u.push({element:g,datasetIndex:d.index,index:h})}),u):[]},dataset(n,t,e,i){const r=ki(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;let c=e.intersect?Fc(n,r,s,i,a):Bc(n,r,s,!1,i,a);if(c.length>0){const u=c[0].datasetIndex,d=n.getDatasetMeta(u).data;c=[];for(let h=0;h<d.length;++h)c.push({element:d[h],datasetIndex:u,index:h})}return c},point(n,t,e,i){const r=ki(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return Fc(n,r,s,i,a)},nearest(n,t,e,i){const r=ki(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return Bc(n,r,s,e.intersect,i,a)},x(n,t,e,i){const r=ki(t,n);return Qh(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=ki(t,n);return Qh(n,r,"y",e.intersect,i)}}};const Jh=["left","top","right","bottom"];function Us(n,t){return n.filter(e=>e.pos===t)}function tp(n,t){return n.filter(e=>Jh.indexOf(e.pos)===-1&&e.box.axis===t)}function Hs(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 qw(n){const t=[];let e,i,r,s,a,c;for(e=0,i=(n||[]).length;e<i;++e)r=n[e],{position:s,options:{stack:a,stackWeight:c=1}}=r,t.push({index:e,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&s+a,stackWeight:c});return t}function jw(n){const t={};for(const e of n){const{stack:i,pos:r,stackWeight:s}=e;if(!i||!Jh.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 Gw(n,t){const e=jw(n),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let s,a,c;for(s=0,a=n.length;s<a;++s){c=n[s];const{fullSize:u}=c.box,d=e[c.stack],h=d&&c.stackWeight/d.weight;c.horizontal?(c.width=h?h*i:u&&t.availableWidth,c.height=r):(c.width=i,c.height=h?h*r:u&&t.availableHeight)}return e}function Kw(n){const t=qw(n),e=Hs(t.filter(d=>d.box.fullSize),!0),i=Hs(Us(t,"left"),!0),r=Hs(Us(t,"right")),s=Hs(Us(t,"top"),!0),a=Hs(Us(t,"bottom")),c=tp(t,"x"),u=tp(t,"y");return{fullSize:e,leftAndTop:i.concat(s),rightAndBottom:r.concat(u).concat(a).concat(c),chartArea:Us(t,"chartArea"),vertical:i.concat(r).concat(u),horizontal:s.concat(a).concat(c)}}function ep(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function np(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 Xw(n,t,e,i){const{pos:r,box:s}=e,a=n.maxPadding;if(!Rt(r)){e.size&&(n[r]-=e.size);const g=i[e.stack]||{size:0,count:1};g.size=Math.max(g.size,e.horizontal?s.height:s.width),e.size=g.size/g.count,n[r]+=e.size}s.getPadding&&np(a,s.getPadding());const c=Math.max(0,t.outerWidth-ep(a,n,"left","right")),u=Math.max(0,t.outerHeight-ep(a,n,"top","bottom")),d=c!==n.w,h=u!==n.h;return n.w=c,n.h=u,e.horizontal?{same:d,other:h}:{same:h,other:d}}function Zw(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 Qw(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 Ws(n,t,e,i){const r=[];let s,a,c,u,d,h;for(s=0,a=n.length,d=0;s<a;++s){c=n[s],u=c.box,u.update(c.width||t.w,c.height||t.h,Qw(c.horizontal,t));const{same:g,other:y}=Xw(t,e,c,i);d|=g&&r.length,h=h||y,u.fullSize||r.push(c)}return d&&Ws(r,t,e,i)||h}function ha(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 ip(n,t,e,i){const r=e.padding;let{x:s,y:a}=t;for(const c of n){const u=c.box,d=i[c.stack]||{placed:0,weight:1},h=c.stackWeight/d.weight||1;if(c.horizontal){const g=t.w*h,y=d.size||u.height;Je(d.start)&&(a=d.start),u.fullSize?ha(u,r.left,a,e.outerWidth-r.right-r.left,y):ha(u,t.left+d.placed,a,g,y),d.start=a,d.placed+=g,a=u.bottom}else{const g=t.h*h,y=d.size||u.width;Je(d.start)&&(s=d.start),u.fullSize?ha(u,s,r.top,y,e.outerHeight-r.bottom-r.top):ha(u,s,t.top+d.placed,y,g),d.start=s,d.placed+=g,s=u.right}}t.x=s,t.y=a}var Ue={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const r=we(n.options.layout.padding),s=Math.max(t-r.width,0),a=Math.max(e-r.height,0),c=Kw(n.boxes),u=c.vertical,d=c.horizontal;Xt(n.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const h=u.reduce((v,S)=>S.box.options&&S.box.options.display===!1?v:v+1,0)||1,g=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/h,hBoxMaxHeight:a/2}),y=Object.assign({},r);np(y,we(i));const _=Object.assign({maxPadding:y,w:s,h:a,x:r.left,y:r.top},r),x=Gw(u.concat(d),g);Ws(c.fullSize,_,g,x),Ws(u,_,g,x),Ws(d,_,g,x)&&Ws(u,_,g,x),Zw(_),ip(c.leftAndTop,_,g,x),_.x+=_.w,_.y+=_.h,ip(c.rightAndBottom,_,g,x),n.chartArea={left:_.left,top:_.top,right:_.left+_.w,bottom:_.top+_.h,height:_.h,width:_.w},Xt(c.chartArea,v=>{const S=v.box;Object.assign(S,n.chartArea),S.update(_.w,_.h,{left:0,top:0,right:0,bottom:0})})}};class rp{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 Jw extends rp{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const pa="$chartjs",tv={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},sp=n=>n===null||n==="";function ev(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[pa]={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",sp(r)){const s=kh(n,"width");s!==void 0&&(n.width=s)}if(sp(i))if(n.style.height==="")n.height=n.width/(t||2);else{const s=kh(n,"height");s!==void 0&&(n.height=s)}return n}const op=tw?{passive:!0}:!1;function nv(n,t,e){n&&n.addEventListener(t,e,op)}function iv(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,op)}function rv(n,t){const e=tv[n.type]||n.type,{x:i,y:r}=ki(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function ga(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function sv(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const c of s)a=a||ga(c.addedNodes,i),a=a&&!ga(c.removedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function ov(n,t,e){const i=n.canvas,r=new MutationObserver(s=>{let a=!1;for(const c of s)a=a||ga(c.removedNodes,i),a=a&&!ga(c.addedNodes,i);a&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const $s=new Map;let ap=0;function lp(){const n=window.devicePixelRatio;n!==ap&&(ap=n,$s.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function av(n,t){$s.size||window.addEventListener("resize",lp),$s.set(n,t)}function lv(n){$s.delete(n),$s.size||window.removeEventListener("resize",lp)}function cv(n,t,e){const i=n.canvas,r=i&&Ac(i);if(!r)return;const s=lh((c,u)=>{const d=r.clientWidth;e(c,u),d<r.clientWidth&&e()},window),a=new ResizeObserver(c=>{const u=c[0],d=u.contentRect.width,h=u.contentRect.height;d===0&&h===0||s(d,h)});return a.observe(r),av(n,s),a}function Uc(n,t,e){e&&e.disconnect(),t==="resize"&&lv(n)}function uv(n,t,e){const i=n.canvas,r=lh(s=>{n.ctx!==null&&e(rv(s,n))},n);return nv(i,t,r),r}class dv extends rp{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(ev(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[pa])return!1;const i=e[pa].initial;["height","width"].forEach(s=>{const a=i[s];Tt(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[pa],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),a={attach:sv,detach:ov,resize:cv}[e]||uv;r[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;({attach:Uc,detach:Uc,resize:Uc}[e]||iv)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return Jx(t,e,i,r)}isAttached(t){const e=t&&Ac(t);return!!(e&&e.isConnected)}}function fv(n){return!Oc()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Jw:dv}class He{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 Ti(this.x)&&Ti(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 hv(n,t){const e=n.options.ticks,i=pv(n),r=Math.min(e.maxTicksLimit||i,i),s=e.major.enabled?mv(t):[],a=s.length,c=s[0],u=s[a-1],d=[];if(a>r)return yv(t,d,s,a/r),d;const h=gv(s,t,r);if(a>0){let g,y;const _=a>1?Math.round((u-c)/(a-1)):null;for(ma(t,d,h,Tt(_)?0:c-_,c),g=0,y=a-1;g<y;g++)ma(t,d,h,s[g],s[g+1]);return ma(t,d,h,u,Tt(_)?t.length:u+_),d}return ma(t,d,h),d}function pv(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 gv(n,t,e){const i=_v(n),r=t.length/e;if(!i)return Math.max(r,1);const s=nx(i);for(let a=0,c=s.length-1;a<c;a++){const u=s[a];if(u>r)return u}return Math.max(r,1)}function mv(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function yv(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 ma(n,t,e,i,r){const s=Mt(i,0),a=Math.min(Mt(r,n.length),n.length);let c=0,u,d,h;for(e=Math.ceil(e),r&&(u=r-i,e=u/Math.floor(u/e)),h=s;h<0;)c++,h=Math.round(s+c*e);for(d=Math.max(s,0);d<a;d++)d===h&&(t.push(n[d]),c++,h=Math.round(s+c*e))}function _v(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 bv=n=>n==="left"?"right":n==="right"?"left":n,cp=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,up=(n,t)=>Math.min(t||n,n);function dp(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 xv(n,t,e){const i=n.ticks.length,r=Math.min(t,i-1),s=n._startPixel,a=n._endPixel,c=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-c||u>a+c)))return u}function wv(n,t){Xt(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 Ys(n){return n.drawTicks?n.tickLength:0}function fp(n,t){if(!n.display)return 0;const e=le(n.font,t),i=we(n.padding);return(Yt(n.text)?n.text.length:1)*e.lineHeight+i.height}function vv(n,t){return Di(n,{scale:t,type:"scale"})}function Sv(n,t,e){return Di(n,{tick:e,index:t,type:"tick"})}function Tv(n,t,e){let i=_c(n);return(e&&t!=="right"||!e&&t==="right")&&(i=bv(i)),i}function Mv(n,t,e,i){const{top:r,left:s,bottom:a,right:c,chart:u}=n,{chartArea:d,scales:h}=u;let g=0,y,_,x;const v=a-r,S=c-s;if(n.isHorizontal()){if(_=ze(i,s,c),Rt(e)){const C=Object.keys(e)[0],E=e[C];x=h[C].getPixelForValue(E)+v-t}else e==="center"?x=(d.bottom+d.top)/2+v-t:x=cp(n,e,t);y=c-s}else{if(Rt(e)){const C=Object.keys(e)[0],E=e[C];_=h[C].getPixelForValue(E)-S+t}else e==="center"?_=(d.left+d.right)/2-S+t:_=cp(n,e,t);x=ze(i,a,r),g=e==="left"?-re:re}return{titleX:_,titleY:x,maxWidth:y,rotation:g}}class sr extends He{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=fn(t,Number.POSITIVE_INFINITY),e=fn(e,Number.NEGATIVE_INFINITY),i=fn(i,Number.POSITIVE_INFINITY),r=fn(r,Number.NEGATIVE_INFINITY),{min:fn(t,i),max:fn(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 c=this.getMatchingVisibleMetas();for(let u=0,d=c.length;u<d;++u)a=c[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:fn(e,fn(i,e)),max:fn(i,fn(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(){Kt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:r,grace:s,ticks:a}=this.options,c=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=Ex(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=c<this.ticks.length;this._convertTicksToLabels(u?dp(this.ticks,c):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=hv(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(){Kt(this.options.afterUpdate,[this])}beforeSetDimensions(){Kt(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(){Kt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Kt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Kt(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=Kt(e.callback,[s.value,i,t],this)}afterTickToLabelConversion(){Kt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Kt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=up(this.ticks.length,t.ticks.maxTicksLimit),r=e.minRotation||0,s=e.maxRotation;let a=r,c,u,d;if(!this._isVisible()||!e.display||r>=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const h=this._getLabelSizes(),g=h.widest.width,y=h.highest.height,_=Ce(this.chart.width-g,0,this.maxWidth);c=t.offset?this.maxWidth/i:_/(i-1),g+6>c&&(c=_/(i-(t.offset?.5:1)),u=this.maxHeight-Ys(t.grid)-e.padding-fp(t.title,this.chart.options.font),d=Math.sqrt(g*g+y*y),a=ra(Math.min(Math.asin(Ce((h.highest.height+6)/c,-1,1)),Math.asin(Ce(u/d,-1,1))-Math.asin(Ce(y/d,-1,1)))),a=Math.max(r,Math.min(s,a))),this.labelRotation=a}afterCalculateLabelRotation(){Kt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Kt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:s}}=this,a=this._isVisible(),c=this.isHorizontal();if(a){const u=fp(r,e.options.font);if(c?(t.width=this.maxWidth,t.height=Ys(s)+u):(t.height=this.maxHeight,t.width=Ys(s)+u),i.display&&this.ticks.length){const{first:d,last:h,widest:g,highest:y}=this._getLabelSizes(),_=i.padding*2,x=xe(this.labelRotation),v=Math.cos(x),S=Math.sin(x);if(c){const C=i.mirror?0:S*g.width+v*y.height;t.height=Math.min(this.maxHeight,t.height+C+_)}else{const C=i.mirror?0:v*g.width+S*y.height;t.width=Math.min(this.maxWidth,t.width+C+_)}this._calculatePadding(d,h,S,v)}}this._handleMargins(),c?(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:c}=this.options,u=this.labelRotation!==0,d=c!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,g=this.right-this.getPixelForTick(this.ticks.length-1);let y=0,_=0;u?d?(y=r*t.width,_=i*e.height):(y=i*t.height,_=r*e.width):s==="start"?_=e.width:s==="end"?y=t.width:s!=="inner"&&(y=t.width/2,_=e.width/2),this.paddingLeft=Math.max((y-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((_-g+a)*this.width/(this.width-g),0)}else{let h=e.height/2,g=t.height/2;s==="start"?(h=0,g=t.height):s==="end"&&(h=e.height,g=0),this.paddingTop=h+a,this.paddingBottom=g+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Kt(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++)Tt(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=dp(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=[],c=[],u=Math.floor(e/up(e,i));let d=0,h=0,g,y,_,x,v,S,C,E,U,P,I;for(g=0;g<e;g+=u){if(x=t[g].label,v=this._resolveTickFontOptions(g),r.font=S=v.string,C=s[S]=s[S]||{data:{},gc:[]},E=v.lineHeight,U=P=0,!Tt(x)&&!Yt(x))U=la(r,C.data,C.gc,U,x),P=E;else if(Yt(x))for(y=0,_=x.length;y<_;++y)I=x[y],!Tt(I)&&!Yt(I)&&(U=la(r,C.data,C.gc,U,I),P+=E);a.push(U),c.push(P),d=Math.max(U,d),h=Math.max(P,h)}wv(s,e);const B=a.indexOf(d),N=c.indexOf(h),T=D=>({width:a[D]||0,height:c[D]||0});return{first:T(0),last:T(e-1),widest:T(B),highest:T(N),widths:a,heights:c}}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 ox(this._alignToPixels?tr(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=Sv(this.getContext(),t,i))}return this.$context||(this.$context=vv(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=xe(this.labelRotation),i=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),s=this._getLabelSizes(),a=t.autoSkipPadding||0,c=s?s.widest.width+a:0,u=s?s.highest.height+a:0;return this.isHorizontal()?u*i>c*r?c/i:u/r:u*r<c*i?u/i:c/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:c}=r,u=s.offset,d=this.isHorizontal(),g=this.ticks.length+(u?1:0),y=Ys(s),_=[],x=c.setContext(this.getContext()),v=x.display?x.width:0,S=v/2,C=function(X){return tr(i,X,v)};let E,U,P,I,B,N,T,D,O,L,W,tt;if(a==="top")E=C(this.bottom),N=this.bottom-y,D=E-S,L=C(t.top)+S,tt=t.bottom;else if(a==="bottom")E=C(this.top),L=t.top,tt=C(t.bottom)-S,N=E+S,D=this.top+y;else if(a==="left")E=C(this.right),B=this.right-y,T=E-S,O=C(t.left)+S,W=t.right;else if(a==="right")E=C(this.left),O=t.left,W=C(t.right)-S,B=E+S,T=this.left+y;else if(e==="x"){if(a==="center")E=C((t.top+t.bottom)/2+.5);else if(Rt(a)){const X=Object.keys(a)[0],Q=a[X];E=C(this.chart.scales[X].getPixelForValue(Q))}L=t.top,tt=t.bottom,N=E+S,D=N+y}else if(e==="y"){if(a==="center")E=C((t.left+t.right)/2);else if(Rt(a)){const X=Object.keys(a)[0],Q=a[X];E=C(this.chart.scales[X].getPixelForValue(Q))}B=E-S,T=B-y,O=t.left,W=t.right}const G=Mt(r.ticks.maxTicksLimit,g),nt=Math.max(1,Math.ceil(g/G));for(U=0;U<g;U+=nt){const X=this.getContext(U),Q=s.setContext(X),rt=c.setContext(X),st=Q.lineWidth,ot=Q.color,H=rt.dash||[],V=rt.dashOffset,J=Q.tickWidth,_t=Q.tickColor,pt=Q.tickBorderDash||[],it=Q.tickBorderDashOffset;P=xv(this,U,u),P!==void 0&&(I=tr(i,P,st),d?B=T=O=W=I:N=D=L=tt=I,_.push({tx1:B,ty1:N,tx2:T,ty2:D,x1:O,y1:L,x2:W,y2:tt,width:st,color:ot,borderDash:H,borderDashOffset:V,tickWidth:J,tickColor:_t,tickBorderDash:pt,tickBorderDashOffset:it}))}return this._ticksLength=g,this._borderValue=E,_}_computeLabelItems(t){const e=this.axis,i=this.options,{position:r,ticks:s}=i,a=this.isHorizontal(),c=this.ticks,{align:u,crossAlign:d,padding:h,mirror:g}=s,y=Ys(i.grid),_=y+h,x=g?-h:_,v=-xe(this.labelRotation),S=[];let C,E,U,P,I,B,N,T,D,O,L,W,tt="middle";if(r==="top")B=this.bottom-x,N=this._getXAxisLabelAlignment();else if(r==="bottom")B=this.top+x,N=this._getXAxisLabelAlignment();else if(r==="left"){const nt=this._getYAxisLabelAlignment(y);N=nt.textAlign,I=nt.x}else if(r==="right"){const nt=this._getYAxisLabelAlignment(y);N=nt.textAlign,I=nt.x}else if(e==="x"){if(r==="center")B=(t.top+t.bottom)/2+_;else if(Rt(r)){const nt=Object.keys(r)[0],X=r[nt];B=this.chart.scales[nt].getPixelForValue(X)+_}N=this._getXAxisLabelAlignment()}else if(e==="y"){if(r==="center")I=(t.left+t.right)/2-_;else if(Rt(r)){const nt=Object.keys(r)[0],X=r[nt];I=this.chart.scales[nt].getPixelForValue(X)}N=this._getYAxisLabelAlignment(y).textAlign}e==="y"&&(u==="start"?tt="top":u==="end"&&(tt="bottom"));const G=this._getLabelSizes();for(C=0,E=c.length;C<E;++C){U=c[C],P=U.label;const nt=s.setContext(this.getContext(C));T=this.getPixelForTick(C)+s.labelOffset,D=this._resolveTickFontOptions(C),O=D.lineHeight,L=Yt(P)?P.length:1;const X=L/2,Q=nt.color,rt=nt.textStrokeColor,st=nt.textStrokeWidth;let ot=N;a?(I=T,N==="inner"&&(C===E-1?ot=this.options.reverse?"left":"right":C===0?ot=this.options.reverse?"right":"left":ot="center"),r==="top"?d==="near"||v!==0?W=-L*O+O/2:d==="center"?W=-G.highest.height/2-X*O+O:W=-G.highest.height+O/2:d==="near"||v!==0?W=O/2:d==="center"?W=G.highest.height/2-X*O:W=G.highest.height-L*O,g&&(W*=-1),v!==0&&!nt.showLabelBackdrop&&(I+=O/2*Math.sin(v))):(B=T,W=(1-L)*O/2);let H;if(nt.showLabelBackdrop){const V=we(nt.backdropPadding),J=G.heights[C],_t=G.widths[C];let pt=W-V.top,it=0-V.left;switch(tt){case"middle":pt-=J/2;break;case"bottom":pt-=J;break}switch(N){case"center":it-=_t/2;break;case"right":it-=_t;break;case"inner":C===E-1?it-=_t:C>0&&(it-=_t/2);break}H={left:it,top:pt,width:_t+V.width,height:J+V.height,color:nt.backdropColor}}S.push({label:P,font:D,textOffset:W,options:{rotation:v,color:Q,strokeColor:rt,strokeWidth:st,textAlign:ot,textBaseline:tt,translation:[I,B],backdrop:H}})}return S}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-xe(this.labelRotation))return t==="top"?"left":"right";let r="center";return e.align==="start"?r="left":e.align==="end"?r="right":e.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,a=this._getLabelSizes(),c=t+s,u=a.widest.width;let d,h;return e==="left"?r?(h=this.right+s,i==="near"?d="left":i==="center"?(d="center",h+=u/2):(d="right",h+=u)):(h=this.right-c,i==="near"?d="right":i==="center"?(d="center",h-=u/2):(d="left",h=this.left)):e==="right"?r?(h=this.left+s,i==="near"?d="right":i==="center"?(d="center",h-=u/2):(d="left",h-=u)):(h=this.left+c,i==="near"?d="left":i==="center"?(d="center",h+=u/2):(d="right",h=this.right)):d="right",{textAlign:d,x:h}}_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 c=(u,d,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.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&&c({x:u.x1,y:u.y1},{x:u.x2,y:u.y2},u),e.drawTicks&&c({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 c=r.setContext(this.getContext(0)).lineWidth,u=this._borderValue;let d,h,g,y;this.isHorizontal()?(d=tr(t,this.left,a)-a/2,h=tr(t,this.right,c)+c/2,g=y=u):(g=tr(t,this.top,a)-a/2,y=tr(t,this.bottom,c)+c/2,d=h=u),e.save(),e.lineWidth=s.width,e.strokeStyle=s.color,e.beginPath(),e.moveTo(d,g),e.lineTo(h,y),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&Is(i,r);const s=this.getLabelItems(t);for(const a of s){const c=a.options,u=a.font,d=a.label,h=a.textOffset;er(i,d,0,h,u,c)}r&&Ls(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:r}}=this;if(!i.display)return;const s=le(i.font),a=we(i.padding),c=i.align;let u=s.lineHeight/2;e==="bottom"||e==="center"||Rt(e)?(u+=a.bottom,Yt(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;const{titleX:d,titleY:h,maxWidth:g,rotation:y}=Mv(this,u,e,c);er(t,i.text,0,0,s,{color:i.color,maxWidth:g,rotation:y,textAlign:Tv(c,e,r),textBaseline:"middle",translation:[d,h]})}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=Mt(t.grid&&t.grid.z,-1),r=Mt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==sr.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 c=e[s];c[i]===this.id&&(!t||c.type===t)&&r.push(c)}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 ya{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;Cv(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,Dv(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 Ji[i])}}function Dv(n,t,e){const i=ks(Object.create(null),[e?se.get(e):{},se.get(t),n.defaults]);se.set(t,i),n.defaultRoutes&&kv(t,n.defaultRoutes),n.descriptors&&se.describe(t,n.descriptors)}function kv(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),r=i.pop(),s=[n].concat(i).join("."),a=t[e].split("."),c=a.pop(),u=a.join(".");se.route(s,r,u,c)})}function Cv(n){return"id"in n&&"defaults"in n}class Ov{constructor(){this.controllers=new ya(Oi,"datasets",!0),this.elements=new ya(He,"elements"),this.plugins=new ya(Object,"plugins"),this.scales=new ya(sr,"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):Xt(r,a=>{const c=i||this._getRegistryForType(a);this._exec(t,c,a)})})}_exec(t,e,i){const r=gc(t);Kt(i["before"+r],[],i),e[t](i),Kt(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 $n=new Ov;class Av{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,c=a[i],u=[e,r,s.options];if(Kt(c,u,a)===!1&&r.cancelable)return!1}return!0}invalidate(){Tt(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=Mt(i.options&&i.options.plugins,{}),s=Ev(i);return r===!1&&!e?[]:Pv(t,s,r,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,r=(s,a)=>s.filter(c=>!a.some(u=>c.plugin.id===u.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}}function Ev(n){const t={},e=[],i=Object.keys($n.plugins.items);for(let s=0;s<i.length;s++)e.push($n.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 Rv(n,t){return!t&&n===!1?null:n===!0?{}:n}function Pv(n,{plugins:t,localIds:e},i,r){const s=[],a=n.getContext();for(const c of t){const u=c.id,d=Rv(i[u],r);d!==null&&s.push({plugin:c,options:Iv(n.config,{plugin:c,local:e[u]},d,a)})}return s}function Iv(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 Hc(n,t){const e=se.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Lv(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Nv(n,t){return n===t?"_index_":"_value_"}function hp(n){if(n==="x"||n==="y"||n==="r")return n}function Fv(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Wc(n,...t){if(hp(n))return n;for(const e of t){const i=e.axis||Fv(e.position)||n.length>1&&hp(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function pp(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Bv(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 pp(n,"x",e[0])||pp(n,"y",e[0])}return{}}function zv(n,t){const e=Ji[n.type]||{scales:{}},i=t.scales||{},r=Hc(n.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const c=i[a];if(!Rt(c))return console.error(`Invalid scale configuration for scale: ${a}`);if(c._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const u=Wc(a,c,Bv(a,n),se.scales[c.type]),d=Nv(u,r),h=e.scales||{};s[a]=Cs(Object.create(null),[{axis:u},c,h[u],h[d]])}),n.data.datasets.forEach(a=>{const c=a.type||n.type,u=a.indexAxis||Hc(c,t),h=(Ji[c]||{}).scales||{};Object.keys(h).forEach(g=>{const y=Lv(g,u),_=a[y+"AxisID"]||y;s[_]=s[_]||Object.create(null),Cs(s[_],[{axis:y},i[_],h[g]])})}),Object.keys(s).forEach(a=>{const c=s[a];Cs(c,[se.scales[c.type],se.scale])}),s}function gp(n){const t=n.options||(n.options={});t.plugins=Mt(t.plugins,{}),t.scales=zv(n,t)}function mp(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Uv(n){return n=n||{},n.data=mp(n.data),gp(n),n}const yp=new Map,_p=new Set;function _a(n,t){let e=yp.get(n);return e||(e=t(),yp.set(n,e),_p.add(e)),e}const Vs=(n,t,e)=>{const i=vi(t,e);i!==void 0&&n.add(i)};class Hv{constructor(t){this._config=Uv(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=mp(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(),gp(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return _a(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return _a(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return _a(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return _a(`${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),c=a.get(e);if(c)return c;const u=new Set;e.forEach(h=>{t&&(u.add(t),h.forEach(g=>Vs(u,t,g))),h.forEach(g=>Vs(u,r,g)),h.forEach(g=>Vs(u,Ji[s]||{},g)),h.forEach(g=>Vs(u,se,g)),h.forEach(g=>Vs(u,vc,g))});const d=Array.from(u);return d.length===0&&d.push(Object.create(null)),_p.has(e)&&a.set(e,d),d}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ji[e]||{},se.datasets[e]||{},{type:e},se,vc]}resolveNamedOptions(t,e,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:c}=bp(this._resolverCache,t,r);let u=a;if($v(a,e)){s.$shared=!1,i=tn(i)?i():i;const d=this.createResolver(t,i,c);u=Ir(a,i,d)}for(const d of e)s[d]=u[d];return s}createResolver(t,e,i=[""],r){const{resolver:s}=bp(this._resolverCache,t,i);return Rt(e)?Ir(s,e,void 0,r):s}}function bp(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:Dc(t,e),subPrefixes:e.filter(c=>!c.toLowerCase().includes("hover"))},i.set(r,s)),s}const Wv=n=>Rt(n)&&Object.getOwnPropertyNames(n).some(t=>tn(n[t]));function $v(n,t){const{isScriptable:e,isIndexable:i}=_h(n);for(const r of t){const s=e(r),a=i(r),c=(a||s)&&n[r];if(s&&(tn(c)||Wv(c))||a&&Yt(c))return!0}return!1}var Yv="4.5.1";const Vv=["top","bottom","left","right","chartArea"];function xp(n,t){return n==="top"||n==="bottom"||Vv.indexOf(n)===-1&&t==="x"}function wp(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function vp(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Kt(e&&e.onComplete,[n],t)}function qv(n){const t=n.chart,e=t.options.animation;Kt(e&&e.onProgress,[n],t)}function Sp(n){return Oc()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const ba={},Tp=n=>{const t=Sp(n);return Object.values(ba).filter(e=>e.canvas===t).pop()};function jv(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 Gv(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let en=class{static defaults=se;static instances=ba;static overrides=Ji;static registry=$n;static version=Yv;static getChart=Tp;static register(...t){$n.add(...t),Mp()}static unregister(...t){$n.remove(...t),Mp()}constructor(t,e){const i=this.config=new Hv(e),r=Sp(t),s=Tp(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||fv(r)),this.platform.updateConfig(i);const c=this.platform.acquireContext(r,a.aspectRatio),u=c&&c.canvas,d=u&&u.height,h=u&&u.width;if(this.id=Gb(),this.ctx=c,this.canvas=u,this.width=h,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 Av,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ux(g=>this.update(g),a.resizeDelay||0),this._dataChanges=[],ba[this.id]=this,!c||!u){console.error("Failed to create chart: can't acquire context from the given item");return}ri.listen(this,"complete",vp),ri.listen(this,"progress",qv),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:s}=this;return Tt(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 $n}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Dh(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return gh(this.canvas,this.ctx),this}stop(){return ri.stop(this),this}resize(t,e){ri.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),c=i.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Dh(this,c,!0)&&(this.notifyPlugins("resize",{size:a}),Kt(i.onResize,[this,a],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Xt(e,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((a,c)=>(a[c]=!1,a),{});let s=[];e&&(s=s.concat(Object.keys(e).map(a=>{const c=e[a],u=Wc(a,c),d=u==="r",h=u==="x";return{options:c,dposition:d?"chartArea":h?"bottom":"left",dtype:d?"radialLinear":h?"category":"linear"}}))),Xt(s,a=>{const c=a.options,u=c.id,d=Wc(u,c),h=Mt(c.type,a.dtype);(c.position===void 0||xp(c.position,d)!==xp(a.dposition))&&(c.position=a.dposition),r[u]=!0;let g=null;if(u in i&&i[u].type===h)g=i[u];else{const y=$n.getScale(h);g=new y({id:u,type:h,ctx:this.ctx,chart:this}),i[g.id]=g}g.init(c,t)}),Xt(r,(a,c)=>{a||delete i[c]}),Xt(i,a=>{Ue.configure(this,a,a.options),Ue.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(wp("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 c=s.type||this.config.type;if(a.type&&a.type!==c&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=c,a.indexAxis=s.indexAxis||Hc(c,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=$n.getController(c),{datasetElementType:d,dataElementType:h}=se.datasets[c];Object.assign(u,{dataElementType:$n.getElement(h),datasetElementType:d&&$n.getElement(d)}),a.controller=new u(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Xt(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,h=this.data.datasets.length;d<h;d++){const{controller:g}=this.getDatasetMeta(d),y=!r&&s.indexOf(g)===-1;g.buildOrUpdateElements(y),a=Math.max(+g.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),r||Xt(s,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(wp("z","_idx"));const{_active:c,_lastEvent:u}=this;u?this._eventHandler(u,!0):c.length&&this._updateHoverStyles(c,c,!0),this.render()}_updateScales(){Xt(this.scales,t=>{Ue.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!th(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;jv(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,c)=>c+","+a.splice(1).join(","))),r=i(0);for(let s=1;s<e;s++)if(!th(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;Ue.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Xt(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,tn(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&&(ri.has(this)?this.attached&&!ri.running(this)&&ri.start(this):(this.draw(),vp({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=Nh(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(r&&Is(e,r),t.controller.draw(),r&&Ls(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return ii(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const s=zc.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=Di(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);Je(e)?(s.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(s,{visible:i}),this.update(c=>c.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(),ri.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(),gh(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete ba[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(s,a)=>{e.addEventListener(this,s,a),t[s]=a},r=(s,a,c)=>{s.offsetX=a,s.offsetY=c,this._eventHandler(s)};Xt(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 c=()=>{r("attach",c),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",c)},e.isAttached(this.canvas)?c():a()}unbindEvents(){Xt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Xt(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,c,u;for(e==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),c=0,u=t.length;c<u;++c){a=t[c];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 c=this.getDatasetMeta(s);if(!c)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:c.data[a],index:a}});!ta(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(h=>!d.some(g=>h.datasetIndex===g.datasetIndex&&h.index===g.index)),a=s(e,t),c=i?t:s(t,e);a.length&&this.updateHoverStyle(a,r.mode,!1),c.length&&r.mode&&this.updateHoverStyle(c,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,c=this._getActiveElements(t,r,i,a),u=tx(t),d=Gv(t,this._lastEvent,i,u);i&&(this._lastEvent=null,Kt(s.onHover,[t,c,this],this),u&&Kt(s.onClick,[t,c,this],this));const h=!ta(c,r);return(h||e)&&(this._active=c,this._updateHoverStyles(c,r,e)),this._lastEvent=d,h}_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 Mp(){return Xt(en.instances,n=>n._plugins.invalidate())}function Kv(n,t,e){const{startAngle:i,x:r,y:s,outerRadius:a,innerRadius:c,options:u}=t,{borderWidth:d,borderJoinStyle:h}=u,g=Math.min(d/a,Be(i-e));if(n.beginPath(),n.arc(r,s,a-d/2,i+g/2,e-g/2),c>0){const y=Math.min(d/c,Be(i-e));n.arc(r,s,c+d/2,e-y/2,i+y/2,!0)}else{const y=Math.min(d/2,a*Be(i-e));if(h==="round")n.arc(r,s,y,e-At/2,i+At/2,!0);else if(h==="bevel"){const _=2*y*y,x=-_*Math.cos(e+At/2)+r,v=-_*Math.sin(e+At/2)+s,S=_*Math.cos(i+At/2)+r,C=_*Math.sin(i+At/2)+s;n.lineTo(x,v),n.lineTo(S,C)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function Xv(n,t,e){const{startAngle:i,pixelMargin:r,x:s,y:a,outerRadius:c,innerRadius:u}=t;let d=r/c;n.beginPath(),n.arc(s,a,c,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 Zv(n){return Mc(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Qv(n,t,e,i){const r=Zv(n.options.borderRadius),s=(e-t)/2,a=Math.min(s,i*t/2),c=u=>{const d=(e-Math.min(s,u))*i/2;return Ce(u,0,Math.min(s,d))};return{outerStart:c(r.outerStart),outerEnd:c(r.outerEnd),innerStart:Ce(r.innerStart,0,a),innerEnd:Ce(r.innerEnd,0,a)}}function Fr(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function xa(n,t,e,i,r,s){const{x:a,y:c,startAngle:u,pixelMargin:d,innerRadius:h}=t,g=Math.max(t.outerRadius+i+e-d,0),y=h>0?h+i+e+d:0;let _=0;const x=r-u;if(i){const nt=h>0?h-i:0,X=g>0?g-i:0,Q=(nt+X)/2,rt=Q!==0?x*Q/(Q+i):x;_=(x-rt)/2}const v=Math.max(.001,x*g-e/At)/g,S=(x-v)/2,C=u+S+_,E=r-S-_,{outerStart:U,outerEnd:P,innerStart:I,innerEnd:B}=Qv(t,y,g,E-C),N=g-U,T=g-P,D=C+U/N,O=E-P/T,L=y+I,W=y+B,tt=C+I/L,G=E-B/W;if(n.beginPath(),s){const nt=(D+O)/2;if(n.arc(a,c,g,D,nt),n.arc(a,c,g,nt,O),P>0){const st=Fr(T,O,a,c);n.arc(st.x,st.y,P,O,E+re)}const X=Fr(W,E,a,c);if(n.lineTo(X.x,X.y),B>0){const st=Fr(W,G,a,c);n.arc(st.x,st.y,B,E+re,G+Math.PI)}const Q=(E-B/y+(C+I/y))/2;if(n.arc(a,c,y,E-B/y,Q,!0),n.arc(a,c,y,Q,C+I/y,!0),I>0){const st=Fr(L,tt,a,c);n.arc(st.x,st.y,I,tt+Math.PI,C-re)}const rt=Fr(N,C,a,c);if(n.lineTo(rt.x,rt.y),U>0){const st=Fr(N,D,a,c);n.arc(st.x,st.y,U,C-re,D)}}else{n.moveTo(a,c);const nt=Math.cos(D)*g+a,X=Math.sin(D)*g+c;n.lineTo(nt,X);const Q=Math.cos(O)*g+a,rt=Math.sin(O)*g+c;n.lineTo(Q,rt)}n.closePath()}function Jv(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:c}=t;let u=t.endAngle;if(s){xa(n,t,e,i,u,r);for(let d=0;d<s;++d)n.fill();isNaN(c)||(u=a+(c%te||te))}return xa(n,t,e,i,u,r),n.fill(),u}function t1(n,t,e,i,r){const{fullCircles:s,startAngle:a,circumference:c,options:u}=t,{borderWidth:d,borderJoinStyle:h,borderDash:g,borderDashOffset:y,borderRadius:_}=u,x=u.borderAlign==="inner";if(!d)return;n.setLineDash(g||[]),n.lineDashOffset=y,x?(n.lineWidth=d*2,n.lineJoin=h||"round"):(n.lineWidth=d,n.lineJoin=h||"bevel");let v=t.endAngle;if(s){xa(n,t,e,i,v,r);for(let S=0;S<s;++S)n.stroke();isNaN(c)||(v=a+(c%te||te))}x&&Xv(n,t,v),u.selfJoin&&v-a>=At&&_===0&&h!=="miter"&&Kv(n,t,v),s||(xa(n,t,e,i,v,r),n.stroke())}class e1 extends He{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}=sa(r,{x:t,y:e}),{startAngle:c,endAngle:u,innerRadius:d,outerRadius:h,circumference:g}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),y=(this.options.spacing+this.options.borderWidth)/2,_=Mt(g,u-c),x=As(s,c,u)&&c!==u,v=_>=te||x,S=ei(a,d+y,h+y);return v&&S}getCenterPoint(t){const{x:e,y:i,startAngle:r,endAngle:s,innerRadius:a,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:u,spacing:d}=this.options,h=(r+s)/2,g=(a+c+d+u)/2;return{x:e+Math.cos(h)*g,y:i+Math.sin(h)*g}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,r=(e.offset||0)/4,s=(e.spacing||0)/2,a=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>te?Math.floor(i/te):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*r,Math.sin(c)*r);const u=1-Math.sin(Math.min(At,i||0)),d=r*u;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,Jv(t,this,d,s,a),t1(t,this,d,s,a),t.restore()}}function Dp(n,t,e=t){n.lineCap=Mt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(Mt(e.borderDash,t.borderDash)),n.lineDashOffset=Mt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=Mt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=Mt(e.borderWidth,t.borderWidth),n.strokeStyle=Mt(e.borderColor,t.borderColor)}function n1(n,t,e){n.lineTo(e.x,e.y)}function i1(n){return n.stepped?vx:n.tension||n.cubicInterpolationMode==="monotone"?Sx:n1}function kp(n,t,e={}){const i=n.length,{start:r=0,end:s=i-1}=e,{start:a,end:c}=t,u=Math.max(r,a),d=Math.min(s,c),h=r<a&&s<a||r>c&&s>c;return{count:i,start:u,loop:t.loop,ilen:d<u&&!h?i+d-u:d-u}}function r1(n,t,e,i){const{points:r,options:s}=t,{count:a,start:c,loop:u,ilen:d}=kp(r,e,i),h=i1(s);let{move:g=!0,reverse:y}=i||{},_,x,v;for(_=0;_<=d;++_)x=r[(c+(y?d-_:_))%a],!x.skip&&(g?(n.moveTo(x.x,x.y),g=!1):h(n,v,x,y,s.stepped),v=x);return u&&(x=r[(c+(y?d:0))%a],h(n,v,x,y,s.stepped)),!!u}function s1(n,t,e,i){const r=t.points,{count:s,start:a,ilen:c}=kp(r,e,i),{move:u=!0,reverse:d}=i||{};let h=0,g=0,y,_,x,v,S,C;const E=P=>(a+(d?c-P:P))%s,U=()=>{v!==S&&(n.lineTo(h,S),n.lineTo(h,v),n.lineTo(h,C))};for(u&&(_=r[E(0)],n.moveTo(_.x,_.y)),y=0;y<=c;++y){if(_=r[E(y)],_.skip)continue;const P=_.x,I=_.y,B=P|0;B===x?(I<v?v=I:I>S&&(S=I),h=(g*h+P)/++g):(U(),n.lineTo(P,I),x=B,g=0,v=S=I),C=I}U()}function $c(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?s1:r1}function o1(n){return n.stepped?ew:n.tension||n.cubicInterpolationMode==="monotone"?nw:ir}function a1(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),Dp(n,t.options),n.stroke(r)}function l1(n,t,e,i){const{segments:r,options:s}=t,a=$c(t);for(const c of r)Dp(n,s,c.style),n.beginPath(),a(n,t,c,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const c1=typeof Path2D=="function";function u1(n,t,e,i){c1&&!t.options.segment?a1(n,t,e,i):l1(n,t,e,i)}class wa extends He{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;jx(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=lw(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=Ph(this,{property:e,start:r,end:r});if(!a.length)return;const c=[],u=o1(i);let d,h;for(d=0,h=a.length;d<h;++d){const{start:g,end:y}=a[d],_=s[g],x=s[y];if(_===x){c.push(_);continue}const v=Math.abs((r-_[e])/(x[e]-_[e])),S=u(_,x,v,i.stepped);S[e]=t[e],c.push(S)}return c.length===1?c[0]:c}pathSegment(t,e,i){return $c(this)(t,this,e,i)}path(t,e,i){const r=this.segments,s=$c(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const c of r)a&=s(t,this,c,{start:e,end:e+i-1});return!!a}draw(t,e,i,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),u1(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Cp(n,t,e,i){const r=n.options,{[e]:s}=n.getProps([e],i);return Math.abs(t-s)<r.radius+r.hitRadius}class d1 extends He{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 Cp(this,t,"x",e)}inYRange(t,e){return Cp(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||!ii(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Tc(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Op(n,t){const{x:e,y:i,base:r,width:s,height:a}=n.getProps(["x","y","base","width","height"],t);let c,u,d,h,g;return n.horizontal?(g=a/2,c=Math.min(e,r),u=Math.max(e,r),d=i-g,h=i+g):(g=s/2,c=e-g,u=e+g,d=Math.min(i,r),h=Math.max(i,r)),{left:c,top:d,right:u,bottom:h}}function Ai(n,t,e,i){return n?0:Ce(t,e,i)}function f1(n,t,e){const i=n.options.borderWidth,r=n.borderSkipped,s=yh(i);return{t:Ai(r.top,s.top,0,e),r:Ai(r.right,s.right,0,t),b:Ai(r.bottom,s.bottom,0,e),l:Ai(r.left,s.left,0,t)}}function h1(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,s=Mi(r),a=Math.min(t,e),c=n.borderSkipped,u=i||Rt(r);return{topLeft:Ai(!u||c.top||c.left,s.topLeft,0,a),topRight:Ai(!u||c.top||c.right,s.topRight,0,a),bottomLeft:Ai(!u||c.bottom||c.left,s.bottomLeft,0,a),bottomRight:Ai(!u||c.bottom||c.right,s.bottomRight,0,a)}}function p1(n){const t=Op(n),e=t.right-t.left,i=t.bottom-t.top,r=f1(n,e/2,i/2),s=h1(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 Yc(n,t,e,i){const r=t===null,s=e===null,c=n&&!(r&&s)&&Op(n,i);return c&&(r||ei(t,c.left,c.right))&&(s||ei(e,c.top,c.bottom))}function g1(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function m1(n,t){n.rect(t.x,t.y,t.w,t.h)}function Vc(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 y1 extends He{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}=p1(this),c=g1(a.radius)?Pr:m1;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),c(t,Vc(a,e,s)),t.clip(),c(t,Vc(s,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),c(t,Vc(s,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,i){return Yc(this,t,e,i)}inXRange(t,e){return Yc(this,t,null,e)}inYRange(t,e){return Yc(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 _1=Object.freeze({__proto__:null,ArcElement:e1,BarElement:y1,LineElement:wa,PointElement:d1});const qc=["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)"],Ap=qc.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ep(n){return qc[n%qc.length]}function Rp(n){return Ap[n%Ap.length]}function b1(n,t){return n.borderColor=Ep(t),n.backgroundColor=Rp(t),++t}function x1(n,t){return n.backgroundColor=n.data.map(()=>Ep(t++)),t}function w1(n,t){return n.backgroundColor=n.data.map(()=>Rp(t++)),t}function v1(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof Bs?t=x1(e,t):r instanceof Xh?t=w1(e,t):r&&(t=b1(e,t))}}function Pp(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function S1(n){return n&&(n.borderColor||n.backgroundColor)}function T1(){return se.borderColor!=="rgba(0,0,0,0.1)"||se.backgroundColor!=="rgba(0,0,0,0.1)"}var M1={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=Pp(i)||S1(r)||s&&Pp(s)||T1();if(!e.forceOverride&&a)return;const c=v1(n);i.forEach(c)}};function D1(n,t,e,i,r){const s=r.samples||i;if(s>=e)return n.slice(t,t+e);const a=[],c=(e-2)/(s-2);let u=0;const d=t+e-1;let h=t,g,y,_,x,v;for(a[u++]=n[h],g=0;g<s-2;g++){let S=0,C=0,E;const U=Math.floor((g+1)*c)+1+t,P=Math.min(Math.floor((g+2)*c)+1,e)+t,I=P-U;for(E=U;E<P;E++)S+=n[E].x,C+=n[E].y;S/=I,C/=I;const B=Math.floor(g*c)+1+t,N=Math.min(Math.floor((g+1)*c)+1,e)+t,{x:T,y:D}=n[h];for(_=x=-1,E=B;E<N;E++)x=.5*Math.abs((T-S)*(n[E].y-D)-(T-n[E].x)*(C-D)),x>_&&(_=x,y=n[E],v=E);a[u++]=y,h=v}return a[u++]=n[d],a}function k1(n,t,e,i){let r=0,s=0,a,c,u,d,h,g,y,_,x,v;const S=[],C=t+e-1,E=n[t].x,P=n[C].x-E;for(a=t;a<t+e;++a){c=n[a],u=(c.x-E)/P*i,d=c.y;const I=u|0;if(I===h)d<x?(x=d,g=a):d>v&&(v=d,y=a),r=(s*r+c.x)/++s;else{const B=a-1;if(!Tt(g)&&!Tt(y)){const N=Math.min(g,y),T=Math.max(g,y);N!==_&&N!==B&&S.push({...n[N],x:r}),T!==_&&T!==B&&S.push({...n[T],x:r})}a>0&&B!==_&&S.push(n[B]),S.push(c),h=I,s=0,x=v=d,g=y=_=a}}return S}function Ip(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 Lp(n){n.data.datasets.forEach(t=>{Ip(t)})}function C1(n,t){const e=t.length;let i=0,r;const{iScale:s}=n,{min:a,max:c,minDefined:u,maxDefined:d}=s.getUserBounds();return u&&(i=Ce(ni(t,s.axis,a).lo,0,e-1)),d?r=Ce(ni(t,s.axis,c).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var O1={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Lp(n);return}const i=n.width;n.data.datasets.forEach((r,s)=>{const{_data:a,indexAxis:c}=r,u=n.getDatasetMeta(s),d=a||r.data;if(Ns([c,n.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const h=n.scales[u.xAxisID];if(h.type!=="linear"&&h.type!=="time"||n.options.parsing)return;let{start:g,count:y}=C1(u,d);const _=e.threshold||4*i;if(y<=_){Ip(r);return}Tt(a)&&(r._data=d,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(v){this._data=v}}));let x;switch(e.algorithm){case"lttb":x=D1(d,g,y,i,e);break;case"min-max":x=k1(d,g,y,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=x})},destroy(n){Lp(n)}};function A1(n,t,e){const i=n.segments,r=n.points,s=t.points,a=[];for(const c of i){let{start:u,end:d}=c;d=va(u,d,r);const h=jc(e,r[u],r[d],c.loop);if(!t.segments){a.push({source:c,target:h,start:r[u],end:r[d]});continue}const g=Ph(t,h);for(const y of g){const _=jc(e,s[y.start],s[y.end],y.loop),x=Rh(c,r,_);for(const v of x)a.push({source:v,target:y,start:{[e]:Np(h,_,"start",Math.max)},end:{[e]:Np(h,_,"end",Math.min)}})}}return a}function jc(n,t,e,i){if(i)return;let r=t[n],s=e[n];return n==="angle"&&(r=Be(r),s=Be(s)),{property:n,start:r,end:s}}function E1(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,s=[];return t.segments.forEach(({start:a,end:c})=>{c=va(a,c,r);const u=r[a],d=r[c];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 va(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Np(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Fp(n,t){let e=[],i=!1;return Yt(n)?(i=!0,e=n):e=E1(n,t),e.length?new wa({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Bp(n){return n&&n.fill!==!1}function R1(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 P1(n,t,e){const i=F1(n);if(Rt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return ae(r)&&Math.floor(r)===r?I1(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function I1(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function L1(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:Rt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function N1(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:Rt(n)?i=n.value:i=t.getBaseValue(),i}function F1(n){const t=n.options,e=t.fill;let i=Mt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function B1(n){const{scale:t,index:e,line:i}=n,r=[],s=i.segments,a=i.points,c=z1(t,e);c.push(Fp({x:null,y:t.bottom},i));for(let u=0;u<s.length;u++){const d=s[u];for(let h=d.start;h<=d.end;h++)U1(r,a[h],c)}return new wa({points:r,options:{}})}function z1(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 U1(n,t,e){const i=[];for(let r=0;r<e.length;r++){const s=e[r],{first:a,last:c,point:u}=H1(s,t,"x");if(!(!u||a&&c)){if(a)i.unshift(u);else if(n.push(u),!c)break}}n.push(...i)}function H1(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const r=i[e],s=n.segments,a=n.points;let c=!1,u=!1;for(let d=0;d<s.length;d++){const h=s[d],g=a[h.start][e],y=a[h.end][e];if(ei(r,g,y)){c=r===g,u=r===y;break}}return{first:c,last:u,point:i}}class zp{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 W1(n){const{chart:t,fill:e,line:i}=n;if(ae(e))return $1(t,e);if(e==="stack")return B1(n);if(e==="shape")return!0;const r=Y1(n);return r instanceof zp?r:Fp(r,i)}function $1(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Y1(n){return(n.scale||{}).getPointPositionForValue?q1(n):V1(n)}function V1(n){const{scale:t={},fill:e}=n,i=L1(e,t);if(ae(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function q1(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=N1(e,t,s),c=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,s);return new zp({x:u.x,y:u.y,radius:t.getDistanceFromCenterForValue(a)})}for(let u=0;u<r;++u)c.push(t.getPointPositionForValue(u,a));return c}function Gc(n,t,e){const i=W1(t),{chart:r,index:s,line:a,scale:c,axis:u}=t,d=a.options,h=d.fill,g=d.backgroundColor,{above:y=g,below:_=g}=h||{},x=r.getDatasetMeta(s),v=Nh(r,x);i&&a.points.length&&(Is(n,e),j1(n,{line:a,target:i,above:y,below:_,area:e,scale:c,axis:u,clip:v}),Ls(n))}function j1(n,t){const{line:e,target:i,above:r,below:s,area:a,scale:c,clip:u}=t,d=e._loop?"angle":t.axis;n.save();let h=s;s!==r&&(d==="x"?(Up(n,i,a.top),Kc(n,{line:e,target:i,color:r,scale:c,property:d,clip:u}),n.restore(),n.save(),Up(n,i,a.bottom)):d==="y"&&(Hp(n,i,a.left),Kc(n,{line:e,target:i,color:s,scale:c,property:d,clip:u}),n.restore(),n.save(),Hp(n,i,a.right),h=r)),Kc(n,{line:e,target:i,color:h,scale:c,property:d,clip:u}),n.restore()}function Up(n,t,e){const{segments:i,points:r}=t;let s=!0,a=!1;n.beginPath();for(const c of i){const{start:u,end:d}=c,h=r[u],g=r[va(u,d,r)];s?(n.moveTo(h.x,h.y),s=!1):(n.lineTo(h.x,e),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,c,{move:a}),a?n.closePath():n.lineTo(g.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Hp(n,t,e){const{segments:i,points:r}=t;let s=!0,a=!1;n.beginPath();for(const c of i){const{start:u,end:d}=c,h=r[u],g=r[va(u,d,r)];s?(n.moveTo(h.x,h.y),s=!1):(n.lineTo(e,h.y),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,c,{move:a}),a?n.closePath():n.lineTo(e,g.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function Kc(n,t){const{line:e,target:i,property:r,color:s,scale:a,clip:c}=t,u=A1(e,i,r);for(const{source:d,target:h,start:g,end:y}of u){const{style:{backgroundColor:_=s}={}}=d,x=i!==!0;n.save(),n.fillStyle=_,G1(n,a,c,x&&jc(r,g,y)),n.beginPath();const v=!!e.pathSegment(n,d);let S;if(x){v?n.closePath():Wp(n,i,y,r);const C=!!i.pathSegment(n,h,{move:v,reverse:!0});S=v&&C,S||Wp(n,i,g,r)}n.closePath(),n.fill(S?"evenodd":"nonzero"),n.restore()}}function G1(n,t,e,i){const r=t.chart.chartArea,{property:s,start:a,end:c}=i||{};if(s==="x"||s==="y"){let u,d,h,g;s==="x"?(u=a,d=r.top,h=c,g=r.bottom):(u=r.left,d=a,h=r.right,g=c),n.beginPath(),e&&(u=Math.max(u,e.left),h=Math.min(h,e.right),d=Math.max(d,e.top),g=Math.min(g,e.bottom)),n.rect(u,d,h-u,g-d),n.clip()}}function Wp(n,t,e,i){const r=t.interpolate(e,i);r&&n.lineTo(r.x,r.y)}var K1={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,r=[];let s,a,c,u;for(a=0;a<i;++a)s=n.getDatasetMeta(a),c=s.dataset,u=null,c&&c.options&&c instanceof wa&&(u={visible:n.isDatasetVisible(a),index:a,fill:P1(c,a,i),chart:n,axis:s.controller.options.indexAxis,scale:s.vScale,line:c}),s.$filler=u,r.push(u);for(a=0;a<i;++a)u=r[a],!(!u||u.fill===!1)&&(u.fill=R1(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 c=r[a].$filler;c&&(c.line.updateControlPoints(s,c.axis),i&&c.fill&&Gc(n.ctx,c,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;Bp(s)&&Gc(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Bp(i)||e.drawTime!=="beforeDatasetDraw"||Gc(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const $p=(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)}},X1=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Yp extends He{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=Kt(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:c,itemHeight:u}=$p(i,s);let d,h;e.font=r.string,this.isHorizontal()?(d=this.maxWidth,h=this._fitRows(a,s,c,u)+10):(h=this.maxHeight,d=this._fitCols(a,r,c,u)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,r){const{ctx:s,maxWidth:a,options:{labels:{padding:c}}}=this,u=this.legendHitBoxes=[],d=this.lineWidths=[0],h=r+c;let g=t;s.textAlign="left",s.textBaseline="middle";let y=-1,_=-h;return this.legendItems.forEach((x,v)=>{const S=i+e/2+s.measureText(x.text).width;(v===0||d[d.length-1]+S+2*c>a)&&(g+=h,d[d.length-(v>0?0:1)]=0,_+=h,y++),u[v]={left:0,top:_,row:y,width:S,height:r},d[d.length-1]+=S+c}),g}_fitCols(t,e,i,r){const{ctx:s,maxHeight:a,options:{labels:{padding:c}}}=this,u=this.legendHitBoxes=[],d=this.columnSizes=[],h=a-t;let g=c,y=0,_=0,x=0,v=0;return this.legendItems.forEach((S,C)=>{const{itemWidth:E,itemHeight:U}=Z1(i,e,s,S,r);C>0&&_+U+2*c>h&&(g+=y+c,d.push({width:y,height:_}),x+=y+c,v++,y=_=0),u[C]={left:x,top:_,col:v,width:E,height:U},y=Math.max(y,E),_+=U+c}),g+=y,d.push({width:y,height:_}),g}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:s}}=this,a=Nr(s,this.left,this.width);if(this.isHorizontal()){let c=0,u=ze(i,this.left+r,this.right-this.lineWidths[c]);for(const d of e)c!==d.row&&(c=d.row,u=ze(i,this.left+r,this.right-this.lineWidths[c])),d.top+=this.top+t+r,d.left=a.leftForLtr(a.x(u),d.width),u+=d.width+r}else{let c=0,u=ze(i,this.top+t+r,this.bottom-this.columnSizes[c].height);for(const d of e)d.col!==c&&(c=d.col,u=ze(i,this.top+t+r,this.bottom-this.columnSizes[c].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;Is(t,this),this._draw(),Ls(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:s,labels:a}=t,c=se.color,u=Nr(t.rtl,this.left,this.width),d=le(a.font),{padding:h}=a,g=d.size,y=g/2;let _;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=d.string;const{boxWidth:x,boxHeight:v,itemHeight:S}=$p(a,g),C=function(B,N,T){if(isNaN(x)||x<=0||isNaN(v)||v<0)return;r.save();const D=Mt(T.lineWidth,1);if(r.fillStyle=Mt(T.fillStyle,c),r.lineCap=Mt(T.lineCap,"butt"),r.lineDashOffset=Mt(T.lineDashOffset,0),r.lineJoin=Mt(T.lineJoin,"miter"),r.lineWidth=D,r.strokeStyle=Mt(T.strokeStyle,c),r.setLineDash(Mt(T.lineDash,[])),a.usePointStyle){const O={radius:v*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:D},L=u.xPlus(B,x/2),W=N+y;mh(r,O,L,W,a.pointStyleWidth&&x)}else{const O=N+Math.max((g-v)/2,0),L=u.leftForLtr(B,x),W=Mi(T.borderRadius);r.beginPath(),Object.values(W).some(tt=>tt!==0)?Pr(r,{x:L,y:O,w:x,h:v,radius:W}):r.rect(L,O,x,v),r.fill(),D!==0&&r.stroke()}r.restore()},E=function(B,N,T){er(r,T.text,B,N+S/2,d,{strikethrough:T.hidden,textAlign:u.textAlign(T.textAlign)})},U=this.isHorizontal(),P=this._computeTitleHeight();U?_={x:ze(s,this.left+h,this.right-i[0]),y:this.top+h+P,line:0}:_={x:this.left+h,y:ze(s,this.top+P+h,this.bottom-e[0].height),line:0},Ch(this.ctx,t.textDirection);const I=S+h;this.legendItems.forEach((B,N)=>{r.strokeStyle=B.fontColor,r.fillStyle=B.fontColor;const T=r.measureText(B.text).width,D=u.textAlign(B.textAlign||(B.textAlign=a.textAlign)),O=x+y+T;let L=_.x,W=_.y;u.setWidth(this.width),U?N>0&&L+O+h>this.right&&(W=_.y+=I,_.line++,L=_.x=ze(s,this.left+h,this.right-i[_.line])):N>0&&W+I>this.bottom&&(L=_.x=L+e[_.line].width+h,_.line++,W=_.y=ze(s,this.top+P+h,this.bottom-e[_.line].height));const tt=u.x(L);if(C(tt,W,B),L=dx(D,L+x+y,U?L+O:this.right,t.rtl),E(u.x(L),W,B),U)_.x+=O+h;else if(typeof B.text!="string"){const G=d.lineHeight;_.y+=Vp(B,G)+h}else _.y+=I}),Oh(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=le(e.font),r=we(e.padding);if(!e.display)return;const s=Nr(t.rtl,this.left,this.width),a=this.ctx,c=e.position,u=i.size/2,d=r.top+u;let h,g=this.left,y=this.width;if(this.isHorizontal())y=Math.max(...this.lineWidths),h=this.top+d,g=ze(t.align,g,this.right-y);else{const x=this.columnSizes.reduce((v,S)=>Math.max(v,S.height),0);h=d+ze(t.align,this.top,this.bottom-x-t.labels.padding-this._computeTitleHeight())}const _=ze(c,g,g+y);a.textAlign=s.textAlign(_c(c)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,er(a,e.text,_,h,i)}_computeTitleHeight(){const t=this.options.title,e=le(t.font),i=we(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,s;if(ei(t,this.left,this.right)&&ei(e,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(r=s[i],ei(t,r.left,r.left+r.width)&&ei(e,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!tS(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=X1(r,i);r&&!s&&Kt(e.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!s&&Kt(e.onHover,[t,i,this],this)}else i&&Kt(e.onClick,[t,i,this],this)}}function Z1(n,t,e,i,r){const s=Q1(i,n,t,e),a=J1(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function Q1(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 J1(n,t,e){let i=n;return typeof t.text!="string"&&(i=Vp(t,e)),i}function Vp(n,t){const e=n.text?n.text.length:0;return t*e}function tS(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var eS={id:"legend",_element:Yp,start(n,t,e){const i=n.legend=new Yp({ctx:n.ctx,options:e,chart:n});Ue.configure(n,i,e),Ue.addBox(n,i)},stop(n){Ue.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;Ue.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:c}}=n.legend.options;return n._getSortedDatasetMetas().map(u=>{const d=u.controller.getStyle(e?0:void 0),h=we(d.borderWidth);return{text:t[u.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!u.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:d.borderColor,pointStyle:i||d.pointStyle,rotation:d.rotation,textAlign:r||d.textAlign,borderRadius:a&&(c||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 Xc extends He{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=Yt(i.text)?i.text.length:1;this._padding=we(i.padding);const s=r*le(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:r,right:s,options:a}=this,c=a.align;let u=0,d,h,g;return this.isHorizontal()?(h=ze(c,i,s),g=e+t,d=s-i):(a.position==="left"?(h=i+t,g=ze(c,r,e),u=At*-.5):(h=s-t,g=ze(c,e,r),u=At*.5),d=r-e),{titleX:h,titleY:g,maxWidth:d,rotation:u}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=le(e.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:c,maxWidth:u,rotation:d}=this._drawArgs(s);er(t,e.text,0,0,i,{color:e.color,maxWidth:u,rotation:d,textAlign:_c(e.align),textBaseline:"middle",translation:[a,c]})}}function nS(n,t){const e=new Xc({ctx:n.ctx,options:t,chart:n});Ue.configure(n,e,t),Ue.addBox(n,e),n.titleBlock=e}var iS={id:"title",_element:Xc,start(n,t,e){nS(n,e)},stop(n){const t=n.titleBlock;Ue.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;Ue.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 Sa=new WeakMap;var rS={id:"subtitle",start(n,t,e){const i=new Xc({ctx:n.ctx,options:e,chart:n});Ue.configure(n,i,e),Ue.addBox(n,i),Sa.set(n,i)},stop(n){Ue.removeBox(n,Sa.get(n)),Sa.delete(n)},beforeUpdate(n,t,e){const i=Sa.get(n);Ue.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 qs={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 c=n[t].element;if(c&&c.hasValue()){const u=c.tooltipPosition();i.add(u.x),r+=u.y,++s}}return s===0||i.size===0?!1:{x:[...i].reduce((c,u)=>c+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,c;for(s=0,a=n.length;s<a;++s){const u=n[s].element;if(u&&u.hasValue()){const d=u.getCenterPoint(),h=Rr(t,d);h<r&&(r=h,c=u)}}if(c){const u=c.tooltipPosition();e=u.x,i=u.y}return{x:e,y:i}}};function Yn(n,t){return t&&(Yt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function si(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
2
+ `)>-1?n.split(`
3
+ `):n}function sS(n,t){const{element:e,datasetIndex:i,index:r}=t,s=n.getDatasetMeta(i).controller,{label:a,value:c}=s.getLabelAndValue(r);return{chart:n,label:a,parsed:s.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:c,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:e}}function qp(n,t){const e=n.chart.ctx,{body:i,footer:r,title:s}=n,{boxWidth:a,boxHeight:c}=t,u=le(t.bodyFont),d=le(t.titleFont),h=le(t.footerFont),g=s.length,y=r.length,_=i.length,x=we(t.padding);let v=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,g&&(v+=g*d.lineHeight+(g-1)*t.titleSpacing+t.titleMarginBottom),C){const P=t.displayColors?Math.max(c,u.lineHeight):u.lineHeight;v+=_*P+(C-_)*u.lineHeight+(C-1)*t.bodySpacing}y&&(v+=t.footerMarginTop+y*h.lineHeight+(y-1)*t.footerSpacing);let E=0;const U=function(P){S=Math.max(S,e.measureText(P).width+E)};return e.save(),e.font=d.string,Xt(n.title,U),e.font=u.string,Xt(n.beforeBody.concat(n.afterBody),U),E=t.displayColors?a+2+t.boxPadding:0,Xt(i,P=>{Xt(P.before,U),Xt(P.lines,U),Xt(P.after,U)}),E=0,e.font=h.string,Xt(n.footer,U),e.restore(),S+=x.width,{width:S,height:v}}function oS(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function aS(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 lS(n,t,e,i){const{x:r,width:s}=e,{width:a,chartArea:{left:c,right:u}}=n;let d="center";return i==="center"?d=r<=(c+u)/2?"left":"right":r<=s/2?d="left":r>=a-s/2&&(d="right"),aS(d,n,t,e)&&(d="center"),d}function jp(n,t,e){const i=e.yAlign||t.yAlign||oS(n,e);return{xAlign:e.xAlign||t.xAlign||lS(n,t,e,i),yAlign:i}}function cS(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function uS(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Gp(n,t,e,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=n,{xAlign:c,yAlign:u}=e,d=r+s,{topLeft:h,topRight:g,bottomLeft:y,bottomRight:_}=Mi(a);let x=cS(t,c);const v=uS(t,u,d);return u==="center"?c==="left"?x+=d:c==="right"&&(x-=d):c==="left"?x-=Math.max(h,y)+r:c==="right"&&(x+=Math.max(g,_)+r),{x:Ce(x,0,i.width-t.width),y:Ce(v,0,i.height-t.height)}}function Ta(n,t,e){const i=we(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Kp(n){return Yn([],si(n))}function dS(n,t,e){return Di(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Xp(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Zp={beforeTitle:ti,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:ti,beforeBody:ti,beforeLabel:ti,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 Tt(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:ti,afterBody:ti,beforeFooter:ti,footer:ti,afterFooter:ti};function nn(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?Zp[t].call(e,i):r}class Qp extends He{static positioners=qs;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 Ec(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=dS(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=nn(i,"beforeTitle",this,t),s=nn(i,"title",this,t),a=nn(i,"afterTitle",this,t);let c=[];return c=Yn(c,si(r)),c=Yn(c,si(s)),c=Yn(c,si(a)),c}getBeforeBody(t,e){return Kp(nn(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return Xt(t,s=>{const a={before:[],lines:[],after:[]},c=Xp(i,s);Yn(a.before,si(nn(c,"beforeLabel",this,s))),Yn(a.lines,nn(c,"label",this,s)),Yn(a.after,si(nn(c,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,e){return Kp(nn(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=nn(i,"beforeFooter",this,t),s=nn(i,"footer",this,t),a=nn(i,"afterFooter",this,t);let c=[];return c=Yn(c,si(r)),c=Yn(c,si(s)),c=Yn(c,si(a)),c}_createItems(t){const e=this._active,i=this.chart.data,r=[],s=[],a=[];let c=[],u,d;for(u=0,d=e.length;u<d;++u)c.push(sS(this.chart,e[u]));return t.filter&&(c=c.filter((h,g,y)=>t.filter(h,g,y,i))),t.itemSort&&(c=c.sort((h,g)=>t.itemSort(h,g,i))),Xt(c,h=>{const g=Xp(t.callbacks,h);r.push(nn(g,"labelColor",this,h)),s.push(nn(g,"labelPointStyle",this,h)),a.push(nn(g,"labelTextColor",this,h))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=c,c}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 c=qs[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=qp(this,i),d=Object.assign({},c,u),h=jp(this.chart,i,d),g=Gp(i,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,s={opacity:1,x:g.x,y:g.y,width:u.width,height:u.height,caretX:c.x,caretY:c.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:c}=i,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:g}=Mi(c),{x:y,y:_}=t,{width:x,height:v}=e;let S,C,E,U,P,I;return s==="center"?(P=_+v/2,r==="left"?(S=y,C=S-a,U=P+a,I=P-a):(S=y+x,C=S+a,U=P-a,I=P+a),E=S):(r==="left"?C=y+Math.max(u,h)+a:r==="right"?C=y+x-Math.max(d,g)-a:C=this.caretX,s==="top"?(U=_,P=U-a,S=C-a,E=C+a):(U=_+v,P=U+a,S=C+a,E=C-a),I=U),{x1:S,x2:C,x3:E,y1:U,y2:P,y3:I}}drawTitle(t,e,i){const r=this.title,s=r.length;let a,c,u;if(s){const d=Nr(i.rtl,this.x,this.width);for(t.x=Ta(this,i.titleAlign,i),e.textAlign=d.textAlign(i.titleAlign),e.textBaseline="middle",a=le(i.titleFont),c=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+c,u+1===s&&(t.y+=i.titleMarginBottom-c)}}_drawColorBox(t,e,i,r,s){const a=this.labelColors[i],c=this.labelPointStyles[i],{boxHeight:u,boxWidth:d}=s,h=le(s.bodyFont),g=Ta(this,"left",s),y=r.x(g),_=u<h.lineHeight?(h.lineHeight-u)/2:0,x=e.y+_;if(s.usePointStyle){const v={radius:Math.min(d,u)/2,pointStyle:c.pointStyle,rotation:c.rotation,borderWidth:1},S=r.leftForLtr(y,d)+d/2,C=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Tc(t,v,S,C),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Tc(t,v,S,C)}else{t.lineWidth=Rt(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 v=r.leftForLtr(y,d),S=r.leftForLtr(r.xPlus(y,1),d-2),C=Mi(a.borderRadius);Object.values(C).some(E=>E!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Pr(t,{x:v,y:x,w:d,h:u,radius:C}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Pr(t,{x:S,y:x+1,w:d-2,h:u-2,radius:C}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(v,x,d,u),t.strokeRect(v,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:c,boxHeight:u,boxWidth:d,boxPadding:h}=i,g=le(i.bodyFont);let y=g.lineHeight,_=0;const x=Nr(i.rtl,this.x,this.width),v=function(T){e.fillText(T,x.x(t.x+_),t.y+y/2),t.y+=y+s},S=x.textAlign(a);let C,E,U,P,I,B,N;for(e.textAlign=a,e.textBaseline="middle",e.font=g.string,t.x=Ta(this,S,i),e.fillStyle=i.bodyColor,Xt(this.beforeBody,v),_=c&&S!=="right"?a==="center"?d/2+h:d+2+h:0,P=0,B=r.length;P<B;++P){for(C=r[P],E=this.labelTextColors[P],e.fillStyle=E,Xt(C.before,v),U=C.lines,c&&U.length&&(this._drawColorBox(e,t,P,x,i),y=Math.max(g.lineHeight,u)),I=0,N=U.length;I<N;++I)v(U[I]),y=g.lineHeight;Xt(C.after,v)}_=0,y=g.lineHeight,Xt(this.afterBody,v),t.y-=s}drawFooter(t,e,i){const r=this.footer,s=r.length;let a,c;if(s){const u=Nr(i.rtl,this.x,this.width);for(t.x=Ta(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,c=0;c<s;++c)e.fillText(r[c],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:c,y:u}=t,{width:d,height:h}=i,{topLeft:g,topRight:y,bottomLeft:_,bottomRight:x}=Mi(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(c+g,u),a==="top"&&this.drawCaret(t,e,i,r),e.lineTo(c+d-y,u),e.quadraticCurveTo(c+d,u,c+d,u+y),a==="center"&&s==="right"&&this.drawCaret(t,e,i,r),e.lineTo(c+d,u+h-x),e.quadraticCurveTo(c+d,u+h,c+d-x,u+h),a==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(c+_,u+h),e.quadraticCurveTo(c,u+h,c,u+h-_),a==="center"&&s==="left"&&this.drawCaret(t,e,i,r),e.lineTo(c,u+g),e.quadraticCurveTo(c,u,c+g,u),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const a=qs[t.position].call(this,this._active,this._eventPosition);if(!a)return;const c=this._size=qp(this,t),u=Object.assign({},a,this._size),d=jp(e,t,u),h=Gp(t,u,d,e);(r._to!==h.x||s._to!==h.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=c.width,this.height=c.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=we(e.padding),c=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&c&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,e),Ch(t,e.textDirection),s.y+=a.top,this.drawTitle(s,t,e),this.drawBody(s,t,e),this.drawFooter(s,t,e),Oh(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,r=t.map(({datasetIndex:c,index:u})=>{const d=this.chart.getDatasetMeta(c);if(!d)throw new Error("Cannot find a dataset at index "+c);return{datasetIndex:c,element:d.data[u],index:u}}),s=!ta(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),c=this._positionChanged(a,t),u=e||!ta(a,s)||c;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(c=>this.chart.data.datasets[c.datasetIndex]&&this.chart.getDatasetMeta(c.datasetIndex).controller.getParsed(c.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=qs[s.position].call(this,t,e);return a!==!1&&(i!==a.x||r!==a.y)}}var hn={id:"tooltip",_element:Qp,positioners:qs,afterInit(n,t,e){e&&(n.tooltip=new Qp({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:Zp},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"]},fS=Object.freeze({__proto__:null,Colors:M1,Decimation:O1,Filler:K1,Legend:eS,SubTitle:rS,Title:iS,Tooltip:hn});const hS=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function pS(n,t,e,i){const r=n.indexOf(t);if(r===-1)return hS(n,t,e,i);const s=n.lastIndexOf(t);return r!==s?e:r}const gS=(n,t)=>n===null?null:Ce(Math.round(n),0,t);function Jp(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class mS extends sr{static id="category";static defaults={ticks:{callback:Jp}};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(Tt(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:pS(i,t,Mt(e,t),this._addedLabels),gS(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 Jp.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 yS(n,t){const e=[],{bounds:r,step:s,min:a,max:c,precision:u,count:d,maxTicks:h,maxDigits:g,includeBounds:y}=n,_=s||1,x=h-1,{min:v,max:S}=t,C=!Tt(a),E=!Tt(c),U=!Tt(d),P=(S-v)/(g+1);let I=eh((S-v)/x/_)*_,B,N,T,D;if(I<1e-14&&!C&&!E)return[{value:v},{value:S}];D=Math.ceil(S/I)-Math.floor(v/I),D>x&&(I=eh(D*I/x/_)*_),Tt(u)||(B=Math.pow(10,u),I=Math.ceil(I*B)/B),r==="ticks"?(N=Math.floor(v/I)*I,T=Math.ceil(S/I)*I):(N=v,T=S),C&&E&&s&&rx((c-a)/s,I/1e3)?(D=Math.round(Math.min((c-a)/I,h)),I=(c-a)/D,N=a,T=c):U?(N=C?a:N,T=E?c:T,D=d-1,I=(T-N)/D):(D=(T-N)/I,Os(D,Math.round(D),I/1e3)?D=Math.round(D):D=Math.ceil(D));const O=Math.max(ih(I),ih(N));B=Math.pow(10,Tt(u)?O:u),N=Math.round(N*B)/B,T=Math.round(T*B)/B;let L=0;for(C&&(y&&N!==a?(e.push({value:a}),N<a&&L++,Os(Math.round((N+L*I)*B)/B,a,tg(a,P,n))&&L++):N<a&&L++);L<D;++L){const W=Math.round((N+L*I)*B)/B;if(E&&W>c)break;e.push({value:W})}return E&&y&&T!==c?e.length&&Os(e[e.length-1].value,c,tg(c,P,n))?e[e.length-1].value=c:e.push({value:c}):(!E||T===c)&&e.push({value:T}),e}function tg(n,t,{horizontal:e,minRotation:i}){const r=xe(i),s=(e?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+n).length;return Math.min(t/s,a)}class Ma extends sr{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 Tt(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,c=u=>s=i?s:u;if(t){const u=Wn(r),d=Wn(s);u<0&&d<0?c(0):u>0&&d>0&&a(0)}if(r===s){let u=s===0?1:Math.abs(s*.05);c(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=yS(r,s);return t.bounds==="ticks"&&nh(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 Rs(t,this.chart.options.locale,this.options.ticks.format)}}class _S extends Ma{static id="linear";static defaults={ticks:{callback:aa.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ae(t)?t:0,this.max=ae(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=xe(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const js=n=>Math.floor(Si(n)),or=(n,t)=>Math.pow(10,js(n)+t);function eg(n){return n/Math.pow(10,js(n))===1}function ng(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function bS(n,t){const e=t-n;let i=js(e);for(;ng(n,t,i)>10;)i++;for(;ng(n,t,i)<10;)i--;return Math.min(i,js(n))}function xS(n,{min:t,max:e}){t=fn(n.min,t);const i=[],r=js(t);let s=bS(t,e),a=s<0?Math.pow(10,Math.abs(s)):1;const c=Math.pow(10,s),u=r>s?Math.pow(10,r):0,d=Math.round((t-u)*a)/a,h=Math.floor((t-u)/c/10)*c*10;let g=Math.floor((d-h)/Math.pow(10,s)),y=fn(n.min,Math.round((u+h+g*Math.pow(10,s))*a)/a);for(;y<e;)i.push({value:y,major:eg(y),significand:g}),g>=10?g=g<15?15:20:g++,g>=20&&(s++,g=2,a=s>=0?1:a),y=Math.round((u+h+g*Math.pow(10,s))*a)/a;const _=fn(n.max,y);return i.push({value:_,major:eg(_),significand:g}),i}class wS extends sr{static id="logarithmic";static defaults={ticks:{callback:aa.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=Ma.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===or(this.min,0)?or(this.min,-1):or(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,r=this.max;const s=c=>i=t?i:c,a=c=>r=e?r:c;i===r&&(i<=0?(s(1),a(10)):(s(or(i,-1)),a(or(r,1)))),i<=0&&s(or(r,-1)),r<=0&&a(or(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=xS(e,this);return t.bounds==="ticks"&&nh(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":Rs(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Si(t),this._valueRange=Si(this.max)-Si(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Si(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Zc(n){const t=n.ticks;if(t.display&&n.display){const e=we(t.backdropPadding);return Mt(t.font&&t.font.size,se.font.size)+e.height}return 0}function vS(n,t,e){return e=Yt(e)?e:[e],{w:wx(n,t.string,e),h:e.length*t.lineHeight}}function ig(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 SS(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,c=a.centerPointLabels?At/s:0;for(let u=0;u<s;u++){const d=a.setContext(n.getPointLabelContext(u));r[u]=d.padding;const h=n.getPointPosition(u,n.drawingArea+r[u],c),g=le(d.font),y=vS(n.ctx,g,n._pointLabels[u]);i[u]=y;const _=Be(n.getIndexAngle(u)+c),x=Math.round(ra(_)),v=ig(x,h.x,y.w,0,180),S=ig(x,h.y,y.h,90,270);TS(e,t,_,v,S)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=kS(n,i,r)}function TS(n,t,e,i,r){const s=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let c=0,u=0;i.start<t.l?(c=(t.l-i.start)/s,n.l=Math.min(n.l,t.l-c)):i.end>t.r&&(c=(i.end-t.r)/s,n.r=Math.max(n.r,t.r+c)),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 MS(n,t,e){const i=n.drawingArea,{extra:r,additionalAngle:s,padding:a,size:c}=e,u=n.getPointPosition(t,i+r+a,s),d=Math.round(ra(Be(u.angle+re))),h=AS(u.y,c.h,d),g=CS(d),y=OS(u.x,c.w,g);return{visible:!0,x:u.x,y:h,textAlign:g,left:y,top:h,right:y+c.w,bottom:h+c.h}}function DS(n,t){if(!t)return!0;const{left:e,top:i,right:r,bottom:s}=n;return!(ii({x:e,y:i},t)||ii({x:e,y:s},t)||ii({x:r,y:i},t)||ii({x:r,y:s},t))}function kS(n,t,e){const i=[],r=n._pointLabels.length,s=n.options,{centerPointLabels:a,display:c}=s.pointLabels,u={extra:Zc(s)/2,additionalAngle:a?At/r:0};let d;for(let h=0;h<r;h++){u.padding=e[h],u.size=t[h];const g=MS(n,h,u);i.push(g),c==="auto"&&(g.visible=DS(g,d),g.visible&&(d=g))}return i}function CS(n){return n===0||n===180?"center":n<180?"left":"right"}function OS(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function AS(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function ES(n,t,e){const{left:i,top:r,right:s,bottom:a}=e,{backdropColor:c}=t;if(!Tt(c)){const u=Mi(t.borderRadius),d=we(t.backdropPadding);n.fillStyle=c;const h=i-d.left,g=r-d.top,y=s-i+d.width,_=a-r+d.height;Object.values(u).some(x=>x!==0)?(n.beginPath(),Pr(n,{x:h,y:g,w:y,h:_,radius:u}),n.fill()):n.fillRect(h,g,y,_)}}function RS(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));ES(e,a,s);const c=le(a.font),{x:u,y:d,textAlign:h}=s;er(e,n._pointLabels[r],u,d+c.lineHeight/2,c,{color:a.color,textAlign:h,textBaseline:"middle"})}}function rg(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 PS(n,t,e,i,r){const s=n.ctx,a=t.circular,{color:c,lineWidth:u}=t;!a&&!i||!c||!u||e<0||(s.save(),s.strokeStyle=c,s.lineWidth=u,s.setLineDash(r.dash||[]),s.lineDashOffset=r.dashOffset,s.beginPath(),rg(n,e,a,i),s.closePath(),s.stroke(),s.restore())}function IS(n,t,e){return Di(n,{label:e,index:t,type:"pointLabel"})}class LS extends Ma{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:aa.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=we(Zc(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/Zc(this.options))}generateTickLabels(t){Ma.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const r=Kt(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?SS(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 Be(t*e+xe(i))}getDistanceFromCenterForValue(t){if(Tt(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(Tt(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 IS(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(),rg(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 c,u,d;if(e.pointLabels.display&&RS(this,a),r.display&&this.ticks.forEach((h,g)=>{if(g!==0||g===0&&this.min<0){u=this.getDistanceFromCenterForValue(h.value);const y=this.getContext(g),_=r.setContext(y),x=s.setContext(y);PS(this,_,u,a,x)}}),i.display){for(t.save(),c=a-1;c>=0;c--){const h=i.setContext(this.getPointLabelContext(c)),{color:g,lineWidth:y}=h;!y||!g||(t.lineWidth=y,t.strokeStyle=g,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,u=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),d=this.getPointPosition(c,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((c,u)=>{if(u===0&&this.min>=0&&!e.reverse)return;const d=i.setContext(this.getContext(u)),h=le(d.font);if(s=this.getDistanceFromCenterForValue(this.ticks[u].value),d.showLabelBackdrop){t.font=h.string,a=t.measureText(c.label).width,t.fillStyle=d.backdropColor;const g=we(d.backdropPadding);t.fillRect(-a/2-g.left,-s-h.size/2-g.top,a+g.width,h.size+g.height)}er(t,c.label,0,-s,h,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}const Da={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}},rn=Object.keys(Da);function sg(n,t){return n-t}function og(n,t){if(Tt(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"&&(Ti(s)||s===!0)?e.startOf(a,"isoWeek",s):e.startOf(a,r)),+a)}function ag(n,t,e,i){const r=rn.length;for(let s=rn.indexOf(n);s<r-1;++s){const a=Da[rn[s]],c=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(c*a.size))<=i)return rn[s]}return rn[r-1]}function NS(n,t,e,i,r){for(let s=rn.length-1;s>=rn.indexOf(e);s--){const a=rn[s];if(Da[a].common&&n._adapter.diff(r,i,a)>=t-1)return a}return rn[e?rn.indexOf(e):0]}function FS(n){for(let t=rn.indexOf(n)+1,e=rn.length;t<e;++t)if(Da[rn[t]].common)return rn[t]}function lg(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=yc(e,t),s=e[i]>=t?e[i]:e[r];n[s]=!0}}function BS(n,t,e,i){const r=n._adapter,s=+r.startOf(t[0].value,i),a=t[t.length-1].value;let c,u;for(c=s;c<=a;c=+r.add(c,1,i))u=e[c],u>=0&&(t[u].major=!0);return t}function cg(n,t,e){const i=[],r={},s=t.length;let a,c;for(a=0;a<s;++a)c=t[a],r[c]=a,i.push({value:c,major:!1});return s===0||!e?i:BS(n,i,r,e)}class Qc extends sr{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 Zh._date(t.adapters.date);r.init(e),Cs(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:og(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:c}=this.getUserBounds();function u(d){!a&&!isNaN(d.min)&&(r=Math.min(r,d.min)),!c&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!a||!c)&&(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,c=lx(r,s,a);return this._unit=e.unit||(i.autoSkip?ag(e.minUnit,this.min,this.max,this._getLabelCapacity(s)):NS(this,c.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:FS(this._unit),this.initOffsets(r),t.reverse&&c.reverse(),cg(this,c,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?e=1-r:e=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?i=s:i=(s-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=Ce(e,0,a),i=Ce(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,r=this.options,s=r.time,a=s.unit||ag(s.minUnit,e,i,this._getLabelCapacity(e)),c=Mt(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,d=Ti(u)||u===!0,h={};let g=e,y,_;if(d&&(g=+t.startOf(g,"isoWeek",u)),g=+t.startOf(g,d?"day":a),t.diff(i,e,a)>1e5*c)throw new Error(e+" and "+i+" are too far apart with stepSize of "+c+" "+a);const x=r.ticks.source==="data"&&this.getDataTimestamps();for(y=g,_=0;y<i;y=+t.add(y,c,a),_++)lg(h,y,x);return(y===i||r.bounds==="ticks"||_===1)&&lg(h,y,x),Object.keys(h).sort(sg).map(v=>+v)}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 Kt(a,[t,e,i],this);const c=s.time.displayFormats,u=this._unit,d=this._majorUnit,h=u&&c[u],g=d&&c[d],y=i[e],_=d&&g&&y&&y.major;return this._adapter.format(t,r||(_?g:h))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e<i;++e)r=t[e],r.label=this._tickFormatFunction(r.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,r=xe(this.isHorizontal()?e.maxRotation:e.minRotation),s=Math.cos(r),a=Math.sin(r),c=this._resolveTickFontOptions(0).size;return{w:i*s+c*a,h:i*a+c*s}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,r=i[e.unit]||i.millisecond,s=this._tickFormatFunction(t,0,cg(this,[t],this._majorUnit),r),a=this._getLabelSize(s),c=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return c>0?c: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(og(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return oh(t.sort(sg))}}function ka(n,t,e){let i=0,r=n.length-1,s,a,c,u;e?(t>=n[i].pos&&t<=n[r].pos&&({lo:i,hi:r}=ni(n,"pos",t)),{pos:s,time:c}=n[i],{pos:a,time:u}=n[r]):(t>=n[i].time&&t<=n[r].time&&({lo:i,hi:r}=ni(n,"time",t)),{time:s,pos:c}=n[i],{time:a,pos:u}=n[r]);const d=a-s;return d?c+(u-c)*(t-s)/d:c}class zS extends Qc{static id="timeseries";static defaults=Qc.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=ka(e,this.min),this._tableRange=ka(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],s=[];let a,c,u,d,h;for(a=0,c=t.length;a<c;++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,c=r.length;a<c;++a)h=r[a+1],u=r[a-1],d=r[a],Math.round((h+u)/2)!==d&&s.push({time:d,pos:a/(c-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(ka(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return ka(this._table,i*this._tableRange+this._minPos,!0)}}var US=Object.freeze({__proto__:null,CategoryScale:mS,LinearScale:_S,LogarithmicScale:wS,RadialLinearScale:LS,TimeScale:Qc,TimeSeriesScale:zS});const HS=[Hw,_1,fS,US],ug=6048e5,WS=864e5,Gs=6e4,Br=36e5,$S=1e3,dg=Symbol.for("constructDateFrom");function he(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&dg in n?n[dg](t):n instanceof Date?new n.constructor(t):new Date(t)}function Ot(n,t){return he(t||n,n)}function Ca(n,t,e){const i=Ot(n,e?.in);return isNaN(t)?he(e?.in||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function Jc(n,t,e){const i=Ot(n,e?.in);if(isNaN(t))return he(n,NaN);if(!t)return i;const r=i.getDate(),s=he(n,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function tu(n,t,e){return he(n,+Ot(n)+t)}function YS(n,t,e){return tu(n,t*Br)}let VS={};function ar(){return VS}function Vn(n,t){const e=ar(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=Ot(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 zr(n,t){return Vn(n,{...t,weekStartsOn:1})}function fg(n,t){const e=Ot(n,t?.in),i=e.getFullYear(),r=he(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=zr(r),a=he(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const c=zr(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=c.getTime()?i:i-1}function Oa(n){const t=Ot(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 lr(n,...t){const e=he.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function eu(n,t){const e=Ot(n,t?.in);return e.setHours(0,0,0,0),e}function hg(n,t,e){const[i,r]=lr(e?.in,n,t),s=eu(i),a=eu(r),c=+s-Oa(s),u=+a-Oa(a);return Math.round((c-u)/WS)}function qS(n,t){const e=fg(n,t),i=he(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),zr(i)}function jS(n,t,e){const i=Ot(n,e?.in);return i.setTime(i.getTime()+t*Gs),i}function GS(n,t,e){return Jc(n,t*3,e)}function KS(n,t,e){return tu(n,t*1e3)}function XS(n,t,e){return Ca(n,t*7,e)}function ZS(n,t,e){return Jc(n,t*12,e)}function Ks(n,t){const e=+Ot(n)-+Ot(t);return e<0?-1:e>0?1:e}function QS(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function nu(n){return!(!QS(n)&&typeof n!="number"||isNaN(+Ot(n)))}function JS(n,t,e){const[i,r]=lr(e?.in,n,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function tT(n,t,e){const[i,r]=lr(e?.in,n,t);return i.getFullYear()-r.getFullYear()}function pg(n,t,e){const[i,r]=lr(e?.in,n,t),s=gg(i,r),a=Math.abs(hg(i,r));i.setDate(i.getDate()-s*a);const c=+(gg(i,r)===-s),u=s*(a-c);return u===0?0:u}function gg(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 Xs(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function eT(n,t,e){const[i,r]=lr(e?.in,n,t),s=(+i-+r)/Br;return Xs(e?.roundingMethod)(s)}function iu(n,t){return+Ot(n)-+Ot(t)}function nT(n,t,e){const i=iu(n,t)/Gs;return Xs(e?.roundingMethod)(i)}function mg(n,t){const e=Ot(n,t?.in);return e.setHours(23,59,59,999),e}function yg(n,t){const e=Ot(n,t?.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function iT(n,t){const e=Ot(n,t?.in);return+mg(e,t)==+yg(e,t)}function _g(n,t,e){const[i,r,s]=lr(e?.in,n,n,t),a=Ks(r,s),c=Math.abs(JS(r,s));if(c<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*c);let u=Ks(r,s)===-a;iT(i)&&c===1&&Ks(i,s)===1&&(u=!1);const d=a*(c-+u);return d===0?0:d}function rT(n,t,e){const i=_g(n,t,e)/3;return Xs(e?.roundingMethod)(i)}function sT(n,t,e){const i=iu(n,t)/1e3;return Xs(e?.roundingMethod)(i)}function oT(n,t,e){const i=pg(n,t,e)/7;return Xs(e?.roundingMethod)(i)}function aT(n,t,e){const[i,r]=lr(e?.in,n,t),s=Ks(i,r),a=Math.abs(tT(i,r));i.setFullYear(1584),r.setFullYear(1584);const c=Ks(i,r)===-s,u=s*(a-+c);return u===0?0:u}function lT(n,t){const e=Ot(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function cT(n,t){const e=Ot(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function uT(n,t){const e=Ot(n,t?.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function bg(n,t){const e=Ot(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function dT(n,t){const e=Ot(n,t?.in);return e.setMinutes(59,59,999),e}function fT(n,t){const e=ar(),i=e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=Ot(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 hT(n,t){const e=Ot(n,t?.in);return e.setSeconds(59,999),e}function pT(n,t){const e=Ot(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=Ot(n,t?.in);return e.setMilliseconds(999),e}const mT={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"}},yT=(n,t,e)=>{let i;const r=mT[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 ru(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const _T={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},bT={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},xT={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},wT={date:ru({formats:_T,defaultWidth:"full"}),time:ru({formats:bT,defaultWidth:"full"}),dateTime:ru({formats:xT,defaultWidth:"full"})},vT={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ST=(n,t,e,i)=>vT[n];function Zs(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,c=e?.width?String(e.width):a;r=n.formattingValues[c]||n.formattingValues[a]}else{const a=n.defaultWidth,c=e?.width?String(e.width):n.defaultWidth;r=n.values[c]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(t):t;return r[s]}}const TT={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},MT={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},DT={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"]},kT={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"]},CT={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"}},OT={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"}},AT={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:Zs({values:TT,defaultWidth:"wide"}),quarter:Zs({values:MT,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Zs({values:DT,defaultWidth:"wide"}),day:Zs({values:kT,defaultWidth:"wide"}),dayPeriod:Zs({values:CT,defaultWidth:"wide",formattingValues:OT,defaultFormattingWidth:"wide"})};function Qs(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],c=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(c)?RT(c,g=>g.test(a)):ET(c,g=>g.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function ET(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function RT(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function PT(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 c=t.slice(r.length);return{value:a,rest:c}}}const IT=/^(\d+)(th|st|nd|rd)?/i,LT=/\d+/i,NT={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},FT={any:[/^b/i,/^(a|c)/i]},BT={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zT={any:[/1/i,/2/i,/3/i,/4/i]},UT={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},HT={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]},WT={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},$T={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]},YT={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},VT={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}},qT={ordinalNumber:PT({matchPattern:IT,parsePattern:LT,valueCallback:n=>parseInt(n,10)}),era:Qs({matchPatterns:NT,defaultMatchWidth:"wide",parsePatterns:FT,defaultParseWidth:"any"}),quarter:Qs({matchPatterns:BT,defaultMatchWidth:"wide",parsePatterns:zT,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Qs({matchPatterns:UT,defaultMatchWidth:"wide",parsePatterns:HT,defaultParseWidth:"any"}),day:Qs({matchPatterns:WT,defaultMatchWidth:"wide",parsePatterns:$T,defaultParseWidth:"any"}),dayPeriod:Qs({matchPatterns:YT,defaultMatchWidth:"any",parsePatterns:VT,defaultParseWidth:"any"})},xg={code:"en-US",formatDistance:yT,formatLong:wT,formatRelative:ST,localize:AT,match:qT,options:{weekStartsOn:0,firstWeekContainsDate:1}};function jT(n,t){const e=Ot(n,t?.in);return hg(e,bg(e))+1}function wg(n,t){const e=Ot(n,t?.in),i=+zr(e)-+qS(e);return Math.round(i/ug)+1}function su(n,t){const e=Ot(n,t?.in),i=e.getFullYear(),r=ar(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=he(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const c=Vn(a,t),u=he(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=Vn(u,t);return+e>=+c?i+1:+e>=+d?i:i-1}function GT(n,t){const e=ar(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=su(n,t),s=he(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Vn(s,t)}function vg(n,t){const e=Ot(n,t?.in),i=+Vn(e,t)-+GT(e,t);return Math.round(i/ug)+1}function Zt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Ei={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)}},Ur={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Sg={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 Ei.y(n,t)},Y:function(n,t,e,i){const r=su(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=fg(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 Ei.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=vg(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Zt(r,t.length)},I:function(n,t,e){const i=wg(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"}):Ei.d(n,t)},D:function(n,t,e){const i=jT(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=Ur.noon:i===0?r=Ur.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=Ur.evening:i>=12?r=Ur.afternoon:i>=4?r=Ur.morning:r=Ur.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 Ei.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Ei.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"}):Ei.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Ei.s(n,t)},S:function(n,t){return Ei.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Mg(i);case"XXXX":case"XX":return cr(i);default:return cr(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Mg(i);case"xxxx":case"xx":return cr(i);default:return cr(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Tg(i,":");default:return"GMT"+cr(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Tg(i,":");default:return"GMT"+cr(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 Tg(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 Mg(n,t){return n%60===0?(n>0?"-":"+")+Zt(Math.abs(n)/60,2):cr(n,t)}function cr(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 Dg=(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"})}},kg=(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"})}},ou={p:kg,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return Dg(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}}",Dg(i,t)).replace("{{time}}",kg(r,t))}},KT=/^D+$/,XT=/^Y+$/,ZT=["D","DD","YY","YYYY"];function Cg(n){return KT.test(n)}function Og(n){return XT.test(n)}function au(n,t,e){const i=QT(n,t,e);if(console.warn(i),ZT.includes(n))throw new RangeError(i)}function QT(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 JT=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,tM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,eM=/^'([^]*?)'?$/,nM=/''/g,iM=/[a-zA-Z]/;function Aa(n,t,e){const i=ar(),r=e?.locale??i.locale??xg,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,c=Ot(n,e?.in);if(!nu(c))throw new RangeError("Invalid time value");let u=t.match(tM).map(h=>{const g=h[0];if(g==="p"||g==="P"){const y=ou[g];return y(h,r.formatLong)}return h}).join("").match(JT).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:rM(h)};if(Sg[g])return{isToken:!0,value:h};if(g.match(iM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:h}});r.localize.preprocessor&&(u=r.localize.preprocessor(c,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(h=>{if(!h.isToken)return h.value;const g=h.value;(!e?.useAdditionalWeekYearTokens&&Og(g)||!e?.useAdditionalDayOfYearTokens&&Cg(g))&&au(g,t,String(n));const y=Sg[g[0]];return y(c,g,r.localize,d)}).join("")}function rM(n){const t=n.match(eM);return t?t[1].replace(nM,"'"):n}function Ag(){return Object.assign({},ar())}function sM(n,t){const e=Ot(n,t?.in).getDay();return e===0?7:e}function oM(n,t){const e=aM(t)?new t(0):he(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function aM(n){return typeof n=="function"&&n.prototype?.constructor===n}const lM=10;class Eg{subPriority=0;validate(t,e){return!0}}class cM extends Eg{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 uM extends Eg{priority=lM;subPriority=-1;constructor(t,e){super(),this.context=t||(i=>he(e,i))}set(t,e){return e.timestampIsSet?t:he(t,oM(t,this.context))}}class Wt{run(t,e,i,r){const s=this.parse(t,e,i,r);return s?{setter:new cM(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,e,i){return!0}}class dM extends Wt{priority=140;parse(t,e,i){switch(e){case"G":case"GG":case"GGG":return i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"});case"GGGGG":return i.era(t,{width:"narrow"});default:return i.era(t,{width:"wide"})||i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"})}}set(t,e,i){return e.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const me={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},qn={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function ye(n,t){return n&&{value:t(n.value),rest:n.rest}}function de(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function jn(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,r=e[2]?parseInt(e[2],10):0,s=e[3]?parseInt(e[3],10):0,a=e[5]?parseInt(e[5],10):0;return{value:i*(r*Br+s*Gs+a*$S),rest:t.slice(e[0].length)}}function Rg(n){return de(me.anyDigitsSigned,n)}function pe(n,t){switch(n){case 1:return de(me.singleDigit,t);case 2:return de(me.twoDigits,t);case 3:return de(me.threeDigits,t);case 4:return de(me.fourDigits,t);default:return de(new RegExp("^\\d{1,"+n+"}"),t)}}function Ea(n,t){switch(n){case 1:return de(me.singleDigitSigned,t);case 2:return de(me.twoDigitsSigned,t);case 3:return de(me.threeDigitsSigned,t);case 4:return de(me.fourDigitsSigned,t);default:return de(new RegExp("^-?\\d{1,"+n+"}"),t)}}function lu(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Pg(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,c=n>=s%100;r=n+a-(c?100:0)}return e?r:1-r}function Ig(n){return n%400===0||n%4===0&&n%100!==0}class fM extends Wt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="yy"});switch(e){case"y":return ye(pe(4,t),r);case"yo":return ye(i.ordinalNumber(t,{unit:"year"}),r);default:return ye(pe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i){const r=t.getFullYear();if(i.isTwoDigitYear){const a=Pg(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 hM extends Wt{priority=130;parse(t,e,i){const r=s=>({year:s,isTwoDigitYear:e==="YY"});switch(e){case"Y":return ye(pe(4,t),r);case"Yo":return ye(i.ordinalNumber(t,{unit:"year"}),r);default:return ye(pe(e.length,t),r)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i,r){const s=su(t,r);if(i.isTwoDigitYear){const c=Pg(i.year,s);return t.setFullYear(c,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),Vn(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),Vn(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class pM extends Wt{priority=130;parse(t,e){return Ea(e==="R"?4:e.length,t)}set(t,e,i){const r=he(t,0);return r.setFullYear(i,0,4),r.setHours(0,0,0,0),zr(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 Ea(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 mM extends Wt{priority=120;parse(t,e,i){switch(e){case"Q":case"QQ":return pe(e.length,t);case"Qo":return i.ordinalNumber(t,{unit:"quarter"});case"QQQ":return i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(t,{width:"narrow",context:"formatting"});default:return i.quarter(t,{width:"wide",context:"formatting"})||i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class yM extends Wt{priority=120;parse(t,e,i){switch(e){case"q":case"qq":return pe(e.length,t);case"qo":return i.ordinalNumber(t,{unit:"quarter"});case"qqq":return i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(t,{width:"narrow",context:"standalone"});default:return i.quarter(t,{width:"wide",context:"standalone"})||i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class _M extends Wt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"M":return ye(de(me.month,t),r);case"MM":return ye(pe(2,t),r);case"Mo":return ye(i.ordinalNumber(t,{unit:"month"}),r);case"MMM":return i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(t,{width:"narrow",context:"formatting"});default:return i.month(t,{width:"wide",context:"formatting"})||i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}}class bM extends Wt{priority=110;parse(t,e,i){const r=s=>s-1;switch(e){case"L":return ye(de(me.month,t),r);case"LL":return ye(pe(2,t),r);case"Lo":return ye(i.ordinalNumber(t,{unit:"month"}),r);case"LLL":return i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(t,{width:"narrow",context:"standalone"});default:return i.month(t,{width:"wide",context:"standalone"})||i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function xM(n,t,e){const i=Ot(n,e?.in),r=vg(i,e)-t;return i.setDate(i.getDate()-r*7),Ot(i,e?.in)}class wM extends Wt{priority=100;parse(t,e,i){switch(e){case"w":return de(me.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i,r){return Vn(xM(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function vM(n,t,e){const i=Ot(n,e?.in),r=wg(i,e)-t;return i.setDate(i.getDate()-r*7),i}class SM extends Wt{priority=100;parse(t,e,i){switch(e){case"I":return de(me.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i){return zr(vM(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const TM=[31,28,31,30,31,30,31,31,30,31,30,31],MM=[31,29,31,30,31,30,31,31,30,31,30,31];class DM extends Wt{priority=90;subPriority=1;parse(t,e,i){switch(e){case"d":return de(me.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const i=t.getFullYear(),r=Ig(i),s=t.getMonth();return r?e>=1&&e<=MM[s]:e>=1&&e<=TM[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 kM extends Wt{priority=90;subpriority=1;parse(t,e,i){switch(e){case"D":case"DD":return de(me.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return pe(e.length,t)}}validate(t,e){const i=t.getFullYear();return Ig(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 cu(n,t,e){const i=ar(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=Ot(n,e?.in),a=s.getDay(),u=(t%7+7)%7,d=7-r,h=t<0||t>6?t-(a+d)%7:(u+d)%7-(a+d)%7;return Ca(s,h,e)}class CM 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=cu(t,i,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class OM extends Wt{priority=90;parse(t,e,i,r){const s=a=>{const c=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+c};switch(e){case"e":case"ee":return ye(pe(e.length,t),s);case"eo":return ye(i.ordinalNumber(t,{unit:"day"}),s);case"eee":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeeee":return i.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,r){return t=cu(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 AM extends Wt{priority=90;parse(t,e,i,r){const s=a=>{const c=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+c};switch(e){case"c":case"cc":return ye(pe(e.length,t),s);case"co":return ye(i.ordinalNumber(t,{unit:"day"}),s);case"ccc":return i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"ccccc":return i.day(t,{width:"narrow",context:"standalone"});case"cccccc":return i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});default:return i.day(t,{width:"wide",context:"standalone"})||i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,r){return t=cu(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 EM(n,t,e){const i=Ot(n,e?.in),r=sM(i,e),s=t-r;return Ca(i,s,e)}class RM extends Wt{priority=90;parse(t,e,i){const r=s=>s===0?7:s;switch(e){case"i":case"ii":return pe(e.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return ye(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return ye(i.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return ye(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r);default:return ye(i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),r)}}validate(t,e){return e>=1&&e<=7}set(t,e,i){return t=EM(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 PM 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(lu(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class IM 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(lu(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class LM 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(lu(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class NM extends Wt{priority=70;parse(t,e,i){switch(e){case"h":return de(me.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,i){const r=t.getHours()>=12;return r&&i<12?t.setHours(i+12,0,0,0):!r&&i===12?t.setHours(0,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class FM extends Wt{priority=70;parse(t,e,i){switch(e){case"H":return de(me.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class BM extends Wt{priority=70;parse(t,e,i){switch(e){case"K":return de(me.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.getHours()>=12&&i<12?t.setHours(i+12,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class zM extends Wt{priority=70;parse(t,e,i){switch(e){case"k":return de(me.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return pe(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,i){const r=i<=24?i%24:i;return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class UM extends Wt{priority=60;parse(t,e,i){switch(e){case"m":return de(me.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]}class HM extends Wt{priority=50;parse(t,e,i){switch(e){case"s":return de(me.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return pe(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]}class WM extends Wt{priority=30;parse(t,e){const i=r=>Math.trunc(r*Math.pow(10,-e.length+3));return ye(pe(e.length,t),i)}set(t,e,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class $M extends Wt{priority=10;parse(t,e){switch(e){case"X":return jn(qn.basicOptionalMinutes,t);case"XX":return jn(qn.basic,t);case"XXXX":return jn(qn.basicOptionalSeconds,t);case"XXXXX":return jn(qn.extendedOptionalSeconds,t);default:return jn(qn.extended,t)}}set(t,e,i){return e.timestampIsSet?t:he(t,t.getTime()-Oa(t)-i)}incompatibleTokens=["t","T","x"]}class YM extends Wt{priority=10;parse(t,e){switch(e){case"x":return jn(qn.basicOptionalMinutes,t);case"xx":return jn(qn.basic,t);case"xxxx":return jn(qn.basicOptionalSeconds,t);case"xxxxx":return jn(qn.extendedOptionalSeconds,t);default:return jn(qn.extended,t)}}set(t,e,i){return e.timestampIsSet?t:he(t,t.getTime()-Oa(t)-i)}incompatibleTokens=["t","T","X"]}class VM extends Wt{priority=40;parse(t){return Rg(t)}set(t,e,i){return[he(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class qM extends Wt{priority=20;parse(t){return Rg(t)}set(t,e,i){return[he(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const jM={G:new dM,y:new fM,Y:new hM,R:new pM,u:new gM,Q:new mM,q:new yM,M:new _M,L:new bM,w:new wM,I:new SM,d:new DM,D:new kM,E:new CM,e:new OM,c:new AM,i:new RM,a:new PM,b:new IM,B:new LM,h:new NM,H:new FM,K:new BM,k:new zM,m:new UM,s:new HM,S:new WM,X:new $M,x:new YM,t:new VM,T:new qM},GM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,KM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,XM=/^'([^]*?)'?$/,ZM=/''/g,QM=/\S/,JM=/[a-zA-Z]/;function tD(n,t,e,i){const r=()=>he(i?.in||e,NaN),s=Ag(),a=i?.locale??s.locale??xg,c=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():Ot(e,i?.in);const d={firstWeekContainsDate:c,weekStartsOn:u,locale:a},h=[new uM(i?.in,e)],g=t.match(KM).map(S=>{const C=S[0];if(C in ou){const E=ou[C];return E(S,a.formatLong)}return S}).join("").match(GM),y=[];for(let S of g){!i?.useAdditionalWeekYearTokens&&Og(S)&&au(S,t,n),!i?.useAdditionalDayOfYearTokens&&Cg(S)&&au(S,t,n);const C=S[0],E=jM[C];if(E){const{incompatibleTokens:U}=E;if(Array.isArray(U)){const I=y.find(B=>U.includes(B.token)||B.token===C);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${S}\` at the same time`)}else if(E.incompatibleTokens==="*"&&y.length>0)throw new RangeError(`The format string mustn't contain \`${S}\` and any other token at the same time`);y.push({token:C,fullToken:S});const P=E.run(n,S,a.match,d);if(!P)return r();h.push(P.setter),n=P.rest}else{if(C.match(JM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");if(S==="''"?S="'":C==="'"&&(S=eD(S)),n.indexOf(S)===0)n=n.slice(S.length);else return r()}}if(n.length>0&&QM.test(n))return r();const _=h.map(S=>S.priority).sort((S,C)=>C-S).filter((S,C,E)=>E.indexOf(S)===C).map(S=>h.filter(C=>C.priority===S).sort((C,E)=>E.subPriority-C.subPriority)).map(S=>S[0]);let x=Ot(e,i?.in);if(isNaN(+x))return r();const v={};for(const S of _){if(!S.validate(x,d))return r();const C=S.set(x,v,d);Array.isArray(C)?(x=C[0],Object.assign(v,C[1])):x=C}return x}function eD(n){return n.match(XM)[1].replace(ZM,"'")}function nD(n,t){const e=Ot(n,t?.in);return e.setMinutes(0,0,0),e}function iD(n,t){const e=Ot(n,t?.in);return e.setSeconds(0,0),e}function rD(n,t){const e=Ot(n,t?.in);return e.setMilliseconds(0),e}function sD(n){const t=n/Br;return Math.trunc(t)}function Lg(n,t){const e=()=>he(t?.in,NaN),i=t?.additionalDigits??2,r=cD(n);let s;if(r.date){const d=uD(r.date,i);s=dD(d.restDateString,d.year)}if(!s||isNaN(+s))return e();const a=+s;let c=0,u;if(r.time&&(c=fD(r.time),isNaN(c)))return e();if(r.timezone){if(u=hD(r.timezone),isNaN(u))return e()}else{const d=new Date(a+c),h=Ot(0,t?.in);return h.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),h.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),h}return Ot(a+c+u,t?.in)}const Ra={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},oD=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,aD=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,lD=/^([+-])(\d{2})(?::?(\d{2}))?$/;function cD(n){const t={},e=n.split(Ra.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Ra.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Ra.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const r=Ra.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function uD(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 dD(n,t){if(t===null)return new Date(NaN);const e=n.match(oD);if(!e)return new Date(NaN);const i=!!e[4],r=Js(e[1]),s=Js(e[2])-1,a=Js(e[3]),c=Js(e[4]),u=Js(e[5])-1;if(i)return _D(t,c,u)?pD(t,c,u):new Date(NaN);{const d=new Date(0);return!mD(t,s,a)||!yD(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function Js(n){return n?parseInt(n):1}function fD(n){const t=n.match(aD);if(!t)return NaN;const e=uu(t[1]),i=uu(t[2]),r=uu(t[3]);return bD(e,i,r)?e*Br+i*Gs+r*1e3:NaN}function uu(n){return n&&parseFloat(n.replace(",","."))||0}function hD(n){if(n==="Z")return 0;const t=n.match(lD);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return xD(i,r)?e*(i*Br+r*Gs):NaN}function pD(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 gD=[31,null,31,30,31,30,31,31,30,31,30,31];function Ng(n){return n%400===0||n%4===0&&n%100!==0}function mD(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(gD[t]||(Ng(n)?29:28))}function yD(n,t){return t>=1&&t<=(Ng(n)?366:365)}function _D(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function bD(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function xD(n,t){return t>=0&&t<=59}const wD=1e3;var ht=(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))(ht||{});const vD=["in","not_in","selector"],SD=["empty","not_empty"],TD=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],ur=n=>n.filter(t=>t!=="time"),Fg=["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"],Bg=ur(Fg),MD=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],zg=[...Fg,"application","bot_info_action","bot_info_detection_reason","bot_info_ban_type","cache_status","consumer","consumer_group","country_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm","portal_api","principal"],Ug=ur(zg),DD=[...MD,"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"],kD=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin","principal"],Hg=ur(kD);ur(["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","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","mcp_error","mcp_method","mcp_session_id","mcp_tool_name","portal","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"]),ur(["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"]);const CD=["platform","platform_usage"],OD=n=>CD.includes(n),AD=[...zg,"a2a_context_id","a2a_error","a2a_method","a2a_task_id","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],Wg=ur(AD);[...DD];const ED=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","region","time"],$g=ur(ED);new Set(Bg),new Set(Ug),new Set(Hg),new Set(Wg),new Set($g);const Yg=[{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"}];Yg.map(n=>n.code);const RD=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:vD},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:SD}},required:["field","operator"],additionalProperties:!1}]}}),PD=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];RD([...new Set([...Ug,...Bg,...Hg,...Wg,...PD,...$g])]);const ID={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"}},LD=(n,t,e)=>{let i;const r=ID[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 du(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const ND={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},FD={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},BD={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},zD={date:du({formats:ND,defaultWidth:"full"}),time:du({formats:FD,defaultWidth:"full"}),dateTime:du({formats:BD,defaultWidth:"full"})},UD={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},HD=(n,t,e,i)=>UD[n];function to(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,c=e?.width?String(e.width):a;r=n.formattingValues[c]||n.formattingValues[a]}else{const a=n.defaultWidth,c=e?.width?String(e.width):n.defaultWidth;r=n.values[c]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(t):t;return r[s]}}const WD={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},$D={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},YD={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"]},VD={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"]},qD={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"}},jD={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"}},GD=(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"},KD={ordinalNumber:GD,era:to({values:WD,defaultWidth:"wide"}),quarter:to({values:$D,defaultWidth:"wide",argumentCallback:n=>n-1}),month:to({values:YD,defaultWidth:"wide"}),day:to({values:VD,defaultWidth:"wide"}),dayPeriod:to({values:qD,defaultWidth:"wide",formattingValues:jD,defaultFormattingWidth:"wide"})};function eo(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],c=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],u=Array.isArray(c)?ZD(c,g=>g.test(a)):XD(c,g=>g.test(a));let d;d=n.valueCallback?n.valueCallback(u):u,d=e.valueCallback?e.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function XD(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function ZD(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function QD(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 c=t.slice(r.length);return{value:a,rest:c}}}const JD=/^(\d+)(th|st|nd|rd)?/i,tk=/\d+/i,ek={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},nk={any:[/^b/i,/^(a|c)/i]},ik={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},rk={any:[/1/i,/2/i,/3/i,/4/i]},sk={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},ok={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]},ak={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},lk={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]},ck={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},uk={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}},dk={ordinalNumber:QD({matchPattern:JD,parsePattern:tk,valueCallback:n=>parseInt(n,10)}),era:eo({matchPatterns:ek,defaultMatchWidth:"wide",parsePatterns:nk,defaultParseWidth:"any"}),quarter:eo({matchPatterns:ik,defaultMatchWidth:"wide",parsePatterns:rk,defaultParseWidth:"any",valueCallback:n=>n+1}),month:eo({matchPatterns:sk,defaultMatchWidth:"wide",parsePatterns:ok,defaultParseWidth:"any"}),day:eo({matchPatterns:ak,defaultMatchWidth:"wide",parsePatterns:lk,defaultParseWidth:"any"}),dayPeriod:eo({matchPatterns:ck,defaultMatchWidth:"any",parsePatterns:uk,defaultParseWidth:"any"})},fk={code:"en-US",formatDistance:LD,formatLong:zD,formatRelative:HD,localize:KD,match:dk,options:{weekStartsOn:0,firstWeekContainsDate:1}};let hk={};function no(){return hk}const Vg=6048e5,pk=864e5,gk=60,mk=3600,qg=Symbol.for("constructDateFrom");function Mn(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&qg in n?n[qg](t):n instanceof Date?new n.constructor(t):new Date(t)}function We(n,t){return Mn(t||n,n)}function jg(n){const t=We(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 yk(n,...t){const e=Mn.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Hr(n,t){const e=We(n,t?.in);return e.setHours(0,0,0,0),e}function _k(n,t,e){const[i,r]=yk(e?.in,n,t),s=Hr(i),a=Hr(r),c=+s-jg(s),u=+a-jg(a);return Math.round((c-u)/pk)}function bk(n,t){const e=We(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function xk(n,t){const e=We(n,t?.in);return _k(e,bk(e))+1}function oi(n,t){const e=no(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,r=We(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 Pa(n,t){return oi(n,{...t,weekStartsOn:1})}function Gg(n,t){const e=We(n,t?.in),i=e.getFullYear(),r=Mn(e,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Pa(r),a=Mn(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const c=Pa(a);return e.getTime()>=s.getTime()?i+1:e.getTime()>=c.getTime()?i:i-1}function wk(n,t){const e=Gg(n,t),i=Mn(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Pa(i)}function vk(n,t){const e=We(n,t?.in),i=+Pa(e)-+wk(e);return Math.round(i/Vg)+1}function Kg(n,t){const e=We(n,t?.in),i=e.getFullYear(),r=no(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=Mn(t?.in||n,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const c=oi(a,t),u=Mn(t?.in||n,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const d=oi(u,t);return+e>=+c?i+1:+e>=+d?i:i-1}function Sk(n,t){const e=no(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,r=Kg(n,t),s=Mn(t?.in||n,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),oi(s,t)}function Tk(n,t){const e=We(n,t?.in),i=+oi(e,t)-+Sk(e,t);return Math.round(i/Vg)+1}function Qt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Ri={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Qt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Qt(e+1,2)},d(n,t){return Qt(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 Qt(n.getHours()%12||12,t.length)},H(n,t){return Qt(n.getHours(),t.length)},m(n,t){return Qt(n.getMinutes(),t.length)},s(n,t){return Qt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),r=Math.trunc(i*Math.pow(10,e-3));return Qt(r,t.length)}},Wr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Xg={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 Ri.y(n,t)},Y:function(n,t,e,i){const r=Kg(n,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Qt(a,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):Qt(s,t.length)},R:function(n,t){const e=Gg(n);return Qt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Qt(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 Qt(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 Qt(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 Ri.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 Qt(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=Tk(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Qt(r,t.length)},I:function(n,t,e){const i=vk(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Qt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Ri.d(n,t)},D:function(n,t,e){const i=xk(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Qt(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 Qt(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 Qt(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 Qt(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=Wr.noon:i===0?r=Wr.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=Wr.evening:i>=12?r=Wr.afternoon:i>=4?r=Wr.morning:r=Wr.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 Ri.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Ri.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Qt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Qt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Ri.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Ri.s(n,t)},S:function(n,t){return Ri.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Qg(i);case"XXXX":case"XX":return dr(i);default:return dr(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Qg(i);case"xxxx":case"xx":return dr(i);default:return dr(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Zg(i,":");default:return"GMT"+dr(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Zg(i,":");default:return"GMT"+dr(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Qt(i,t.length)},T:function(n,t,e){return Qt(+n,t.length)}};function Zg(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+Qt(s,2)}function Qg(n,t){return n%60===0?(n>0?"-":"+")+Qt(Math.abs(n)/60,2):dr(n,t)}function dr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Qt(Math.trunc(i/60),2),s=Qt(i%60,2);return e+r+t+s}const Jg=(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"})}},tm=(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"})}},Mk=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return Jg(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}}",Jg(i,t)).replace("{{time}}",tm(r,t))},Dk={p:tm,P:Mk},kk=/^D+$/,Ck=/^Y+$/,Ok=["D","DD","YY","YYYY"];function Ak(n){return kk.test(n)}function Ek(n){return Ck.test(n)}function Rk(n,t,e){const i=Pk(n,t,e);if(console.warn(i),Ok.includes(n))throw new RangeError(i)}function Pk(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 Ik(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Lk(n){return!(!Ik(n)&&typeof n!="number"||isNaN(+We(n)))}const Nk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Fk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Bk=/^'([^]*?)'?$/,zk=/''/g,Uk=/[a-zA-Z]/;function Hk(n,t,e){const i=no(),r=e?.locale??i.locale??fk,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,c=We(n,e?.in);if(!Lk(c))throw new RangeError("Invalid time value");let u=t.match(Fk).map(h=>{const g=h[0];if(g==="p"||g==="P"){const y=Dk[g];return y(h,r.formatLong)}return h}).join("").match(Nk).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:Wk(h)};if(Xg[g])return{isToken:!0,value:h};if(g.match(Uk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:h}});r.localize.preprocessor&&(u=r.localize.preprocessor(c,u));const d={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return u.map(h=>{if(!h.isToken)return h.value;const g=h.value;(!e?.useAdditionalWeekYearTokens&&Ek(g)||!e?.useAdditionalDayOfYearTokens&&Ak(g))&&Rk(g,t,String(n));const y=Xg[g[0]];return y(c,g,r.localize,d)}).join("")}function Wk(n){const t=n.match(Bk);return t?t[1].replace(zk,"'"):n}function Ia(n,t,e){const i=We(n,e?.in);return isNaN(t)?Mn(n,NaN):(i.setDate(i.getDate()+t),i)}function em(n,t,e){const i=We(n,e?.in);if(isNaN(t))return Mn(n,NaN);if(!t)return i;const r=i.getDate(),s=Mn(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 $k(n,t,e){return em(n,t*3,e)}function $r(n,t){const e=We(n,t?.in),i=e.getMonth(),r=i-i%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function Yr(n,t){const e=We(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function Yk(n,t){const e=We(n,t?.in),i=e.getFullYear(),r=e.getMonth(),s=Mn(e,0);return s.setFullYear(i,r+1,0),s.setHours(0,0,0,0),s.getDate()}function Vk(){return Object.assign({},no())}function nm(n){return Math.trunc(n*mk)}function qk(n){const t=n/gk;return Math.trunc(t)}function im(n,t,e){return em(n,-1,e)}function rm(n,t,e){return $k(n,-1,e)}function sm(n,t,e){const i=Vk(),r=Kk(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?jk(r,t):Gk(r,t)}function jk(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 Gk(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Kk(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Xk(n,t){const e=eC(t);return"formatToParts"in e?Qk(e,n):Jk(e,n)}const Zk={year:0,month:1,day:2,hour:3,minute:4,second:5};function Qk(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=Zk[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 Jk(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 fu={},om=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")),tC=om==="06/25/2014, 00:00:00"||om==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function eC(n){return fu[n]||(fu[n]=tC?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"})),fu[n]}function hu(n,t,e,i,r,s,a){const c=new Date(0);return c.setUTCFullYear(n,t,e),c.setUTCHours(i,r,s,a),c}const am=36e5,nC=6e4,pu={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function io(n,t,e){if(!n)return 0;let i=pu.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=pu.timezoneHH.exec(n),i)return r=parseInt(i[1],10),lm(r)?-(r*am):NaN;if(i=pu.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return lm(r,a)?(s=Math.abs(r)*am+a*nC,i[1]==="+"?-s:s):NaN}if(sC(n)){t=new Date(t||Date.now());const a=e?t:iC(t),c=gu(a,n);return-(e?c:rC(t,c,n))}return NaN}function iC(n){return hu(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function gu(n,t){const e=Xk(n,t),i=hu(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 rC(n,t,e){let i=n.getTime()-t;const r=gu(new Date(i),e);if(t===r)return t;i-=r-t;const s=gu(new Date(i),e);return r===s?r:Math.max(r,s)}function lm(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const cm={};function sC(n){if(cm[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),cm[n]=!0,!0}catch{return!1}}const oC=60*1e3,aC={X:function(n,t,e){const i=mu(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return um(i);case"XXXX":case"XX":return Vr(i);default:return Vr(i,":")}},x:function(n,t,e){const i=mu(e.timeZone,n);switch(t){case"x":return um(i);case"xxxx":case"xx":return Vr(i);default:return Vr(i,":")}},O:function(n,t,e){const i=mu(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+lC(i,":");default:return"GMT"+Vr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return sm("short",n,e);default:return sm("long",n,e)}}};function mu(n,t){const e=n?io(n,t,!0)/oC:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function La(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Vr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=La(Math.floor(i/60),2),s=La(Math.floor(i%60),2);return e+r+t+s}function um(n,t){return n%60===0?(n>0?"-":"+")+La(Math.abs(n)/60,2):Vr(n,t)}function lC(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+La(s,2)}function dm(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 fm=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,yu=36e5,hm=6e4,cC=2,je={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:fm};function Na(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?cC: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=uC(n),{year:r,restDateString:s}=dC(i.date,e),a=fC(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const c=a.getTime();let u=0,d;if(i.time&&(u=hC(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=io(i.timeZone||t.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=dm(new Date(c+u)),d=dm(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function uC(n){const t={};let e=je.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=je.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=je.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function dC(n,t){if(n){const e=je.YYY[t],i=je.YYYYY[t];let r=je.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=je.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 fC(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=je.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,mm(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=je.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return mC(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=je.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return mm(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=je.Www.exec(n),s)return r=parseInt(s[1],10)-1,ym(r)?pm(t,r):new Date(NaN);if(s=je.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return ym(r,a)?pm(t,r,a):new Date(NaN)}return null}function hC(n){let t,e,i=je.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),_u(t)?t%24*yu:NaN;if(i=je.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),_u(t,e)?t%24*yu+e*hm:NaN;if(i=je.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return _u(t,e,r)?t%24*yu+e*hm+r*1e3:NaN}return null}function pm(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 pC=[31,28,31,30,31,30,31,31,30,31,30,31],gC=[31,29,31,30,31,30,31,31,30,31,30,31];function gm(n){return n%400===0||n%4===0&&n%100!==0}function mm(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=gm(n);if(i&&e>gC[t]||!i&&e>pC[t])return!1}return!0}function mC(n,t){if(t<1)return!1;const e=gm(n);return!(e&&t>366||!e&&t>365)}function ym(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function _u(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const yC=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function _C(n,t,e={}){t=String(t);const i=t.match(yC);if(i){const r=Na(e.originalDate||n,e);t=i.reduce(function(s,a){if(a[0]==="'")return s;const c=s.indexOf(a),u=s[c-1]==="'",d=s.replace(a,"'"+aC[a[0]](r,a,e)+"'");return u?d.substring(0,c-1)+d.substring(c+1):d},t)}return Hk(n,t,e)}function _m(n,t,e){n=Na(n,e);const i=io(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 bm(n,t,e,i){return i={...i,timeZone:t,originalDate:n},_C(_m(n,t,{timeZone:i.timeZone}),e,i)}function bC(n,t,e){if(typeof n=="string"&&!n.match(fm))return Na(n,{...e,timeZone:t});n=Na(n,e);const i=hu(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),r=io(t,new Date(i));return new Date(i+r)}function xC(n,t){return-io(n,t)}function xm(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)"),bm(n,e,i)}function wC(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 bm(r,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const vC={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 bu(n){return n&&TD.find(t=>n<=vC[t])||null}var Fa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ba={exports:{}};Ba.exports;var wm;function SC(){return wm||(wm=1,(function(n,t){var e=200,i="__lodash_hash_undefined__",r=9007199254740991,s="[object Arguments]",a="[object Array]",c="[object Boolean]",u="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",y="[object Map]",_="[object Number]",x="[object Object]",v="[object Promise]",S="[object RegExp]",C="[object Set]",E="[object String]",U="[object Symbol]",P="[object WeakMap]",I="[object ArrayBuffer]",B="[object DataView]",N="[object Float32Array]",T="[object Float64Array]",D="[object Int8Array]",O="[object Int16Array]",L="[object Int32Array]",W="[object Uint8Array]",tt="[object Uint8ClampedArray]",G="[object Uint16Array]",nt="[object Uint32Array]",X=/[\\^$.*+?()[\]{}|]/g,Q=/\w*$/,rt=/^\[object .+?Constructor\]$/,st=/^(?:0|[1-9]\d*)$/,ot={};ot[s]=ot[a]=ot[I]=ot[B]=ot[c]=ot[u]=ot[N]=ot[T]=ot[D]=ot[O]=ot[L]=ot[y]=ot[_]=ot[x]=ot[S]=ot[C]=ot[E]=ot[U]=ot[W]=ot[tt]=ot[G]=ot[nt]=!0,ot[d]=ot[h]=ot[P]=!1;var H=typeof Fa=="object"&&Fa&&Fa.Object===Object&&Fa,V=typeof self=="object"&&self&&self.Object===Object&&self,J=H||V||Function("return this")(),_t=t&&!t.nodeType&&t,pt=_t&&!0&&n&&!n.nodeType&&n,it=pt&&pt.exports===_t;function ft(k,$){return k.set($[0],$[1]),k}function ut(k,$){return k.add($),k}function dt(k,$){for(var Z=-1,mt=k?k.length:0;++Z<mt&&$(k[Z],Z,k)!==!1;);return k}function gt(k,$){for(var Z=-1,mt=$.length,Me=k.length;++Z<mt;)k[Me+Z]=$[Z];return k}function lt(k,$,Z,mt){for(var Me=-1,Ye=k?k.length:0;++Me<Ye;)Z=$(Z,k[Me],Me,k);return Z}function It(k,$){for(var Z=-1,mt=Array(k);++Z<k;)mt[Z]=$(Z);return mt}function Bt(k,$){return k?.[$]}function wt(k){var $=!1;if(k!=null&&typeof k.toString!="function")try{$=!!(k+"")}catch{}return $}function kt(k){var $=-1,Z=Array(k.size);return k.forEach(function(mt,Me){Z[++$]=[Me,mt]}),Z}function Dt(k,$){return function(Z){return k($(Z))}}function ve(k){var $=-1,Z=Array(k.size);return k.forEach(function(mt){Z[++$]=mt}),Z}var bt=Array.prototype,Vt=Function.prototype,Se=Object.prototype,Ae=J["__core-js_shared__"],oe=(function(){var k=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||"");return k?"Symbol(src)_1."+k:""})(),on=Vt.toString,qt=Se.hasOwnProperty,Ie=Se.toString,ie=RegExp("^"+on.call(qt).replace(X,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Te=it?J.Buffer:void 0,Ee=J.Symbol,gn=J.Uint8Array,zi=Dt(Object.getPrototypeOf,Object),kn=Object.create,$e=Se.propertyIsEnumerable,In=bt.splice,li=Object.getOwnPropertySymbols,wo=Te?Te.isBuffer:void 0,vo=Dt(Object.keys,Object),br=Gn(J,"DataView"),ci=Gn(J,"Map"),So=Gn(J,"Promise"),To=Gn(J,"Set"),Mo=Gn(J,"WeakMap"),Ui=Gn(Object,"create"),ol=di(br),sd=di(ci),od=di(So),ad=di(To),ld=di(Mo),Do=Ee?Ee.prototype:void 0,al=Do?Do.valueOf:void 0;function ui(k){var $=-1,Z=k?k.length:0;for(this.clear();++$<Z;){var mt=k[$];this.set(mt[0],mt[1])}}function cd(){this.__data__=Ui?Ui(null):{}}function ko(k){return this.has(k)&&delete this.__data__[k]}function ud(k){var $=this.__data__;if(Ui){var Z=$[k];return Z===i?void 0:Z}return qt.call($,k)?$[k]:void 0}function Co(k){var $=this.__data__;return Ui?$[k]!==void 0:qt.call($,k)}function dd(k,$){var Z=this.__data__;return Z[k]=Ui&&$===void 0?i:$,this}ui.prototype.clear=cd,ui.prototype.delete=ko,ui.prototype.get=ud,ui.prototype.has=Co,ui.prototype.set=dd;function Ln(k){var $=-1,Z=k?k.length:0;for(this.clear();++$<Z;){var mt=k[$];this.set(mt[0],mt[1])}}function fd(){this.__data__=[]}function hd(k){var $=this.__data__,Z=xr($,k);if(Z<0)return!1;var mt=$.length-1;return Z==mt?$.pop():In.call($,Z,1),!0}function pd(k){var $=this.__data__,Z=xr($,k);return Z<0?void 0:$[Z][1]}function ll(k){return xr(this.__data__,k)>-1}function gd(k,$){var Z=this.__data__,mt=xr(Z,k);return mt<0?Z.push([k,$]):Z[mt][1]=$,this}Ln.prototype.clear=fd,Ln.prototype.delete=hd,Ln.prototype.get=pd,Ln.prototype.has=ll,Ln.prototype.set=gd;function Hi(k){var $=-1,Z=k?k.length:0;for(this.clear();++$<Z;){var mt=k[$];this.set(mt[0],mt[1])}}function cl(){this.__data__={hash:new ui,map:new(ci||Ln),string:new ui}}function md(k){return wr(this,k).delete(k)}function yd(k){return wr(this,k).get(k)}function _d(k){return wr(this,k).has(k)}function bd(k,$){return wr(this,k).set(k,$),this}Hi.prototype.clear=cl,Hi.prototype.delete=md,Hi.prototype.get=yd,Hi.prototype.has=_d,Hi.prototype.set=bd;function Wi(k){this.__data__=new Ln(k)}function xd(){this.__data__=new Ln}function es(k){return this.__data__.delete(k)}function wd(k){return this.__data__.get(k)}function ns(k){return this.__data__.has(k)}function vd(k,$){var Z=this.__data__;if(Z instanceof Ln){var mt=Z.__data__;if(!ci||mt.length<e-1)return mt.push([k,$]),this;Z=this.__data__=new Hi(mt)}return Z.set(k,$),this}Wi.prototype.clear=xd,Wi.prototype.delete=es,Wi.prototype.get=wd,Wi.prototype.has=ns,Wi.prototype.set=vd;function Sd(k,$){var Z=Po(k)||Sl(k)?It(k.length,String):[],mt=Z.length,Me=!!mt;for(var Ye in k)qt.call(k,Ye)&&!(Me&&(Ye=="length"||bl(Ye,mt)))&&Z.push(Ye);return Z}function ul(k,$,Z){var mt=k[$];(!(qt.call(k,$)&&vl(mt,Z))||Z===void 0&&!($ in k))&&(k[$]=Z)}function xr(k,$){for(var Z=k.length;Z--;)if(vl(k[Z][0],$))return Z;return-1}function dl(k,$){return k&&Ao($,Io($),k)}function is(k,$,Z,mt,Me,Ye,Nn){var Le;if(mt&&(Le=Ye?mt(k,Me,Ye,Nn):mt(k)),Le!==void 0)return Le;if(!ls(k))return k;var Ml=Po(k);if(Ml){if(Le=yl(k),!$)return ml(k,Le)}else{var ce=an(k),cs=ce==h||ce==g;if(Id(k))return hl(k,$);if(ce==x||ce==s||cs&&!Ye){if(wt(k))return Ye?k:{};if(Le=_l(cs?{}:k),!$)return Eo(k,dl(Le,k))}else{if(!ot[ce])return Ye?k:{};Le=Ed(k,ce,is,$)}}Nn||(Nn=new Wi);var Kn=Nn.get(k);if(Kn)return Kn;if(Nn.set(k,Le),!Ml)var Lo=Z?Ad(k):Io(k);return dt(Lo||k,function(vr,Ne){Lo&&(Ne=vr,vr=k[Ne]),ul(Le,Ne,is(vr,$,Z,mt,Ne,k,Nn))}),Le}function Td(k){return ls(k)?kn(k):{}}function Md(k,$,Z){var mt=$(k);return Po(k)?mt:gt(mt,Z(k))}function Dd(k){return Ie.call(k)}function kd(k){if(!ls(k)||wl(k))return!1;var $=as(k)||wt(k)?ie:rt;return $.test(di(k))}function fl(k){if(!Ro(k))return vo(k);var $=[];for(var Z in Object(k))qt.call(k,Z)&&Z!="constructor"&&$.push(Z);return $}function hl(k,$){if($)return k.slice();var Z=new k.constructor(k.length);return k.copy(Z),Z}function rs(k){var $=new k.constructor(k.byteLength);return new gn($).set(new gn(k)),$}function Oo(k,$){var Z=$?rs(k.buffer):k.buffer;return new k.constructor(Z,k.byteOffset,k.byteLength)}function Cd(k,$,Z){var mt=$?Z(kt(k),!0):kt(k);return lt(mt,ft,new k.constructor)}function pl(k){var $=new k.constructor(k.source,Q.exec(k));return $.lastIndex=k.lastIndex,$}function ss(k,$,Z){var mt=$?Z(ve(k),!0):ve(k);return lt(mt,ut,new k.constructor)}function gl(k){return al?Object(al.call(k)):{}}function Od(k,$){var Z=$?rs(k.buffer):k.buffer;return new k.constructor(Z,k.byteOffset,k.length)}function ml(k,$){var Z=-1,mt=k.length;for($||($=Array(mt));++Z<mt;)$[Z]=k[Z];return $}function Ao(k,$,Z,mt){Z||(Z={});for(var Me=-1,Ye=$.length;++Me<Ye;){var Nn=$[Me],Le=void 0;ul(Z,Nn,Le===void 0?k[Nn]:Le)}return Z}function Eo(k,$){return Ao(k,os(k),$)}function Ad(k){return Md(k,Io,os)}function wr(k,$){var Z=k.__data__;return xl($)?Z[typeof $=="string"?"string":"hash"]:Z.map}function Gn(k,$){var Z=Bt(k,$);return kd(Z)?Z:void 0}var os=li?Dt(li,Object):Fd,an=Dd;(br&&an(new br(new ArrayBuffer(1)))!=B||ci&&an(new ci)!=y||So&&an(So.resolve())!=v||To&&an(new To)!=C||Mo&&an(new Mo)!=P)&&(an=function(k){var $=Ie.call(k),Z=$==x?k.constructor:void 0,mt=Z?di(Z):void 0;if(mt)switch(mt){case ol:return B;case sd:return y;case od:return v;case ad:return C;case ld:return P}return $});function yl(k){var $=k.length,Z=k.constructor($);return $&&typeof k[0]=="string"&&qt.call(k,"index")&&(Z.index=k.index,Z.input=k.input),Z}function _l(k){return typeof k.constructor=="function"&&!Ro(k)?Td(zi(k)):{}}function Ed(k,$,Z,mt){var Me=k.constructor;switch($){case I:return rs(k);case c:case u:return new Me(+k);case B:return Oo(k,mt);case N:case T:case D:case O:case L:case W:case tt:case G:case nt:return Od(k,mt);case y:return Cd(k,mt,Z);case _:case E:return new Me(k);case S:return pl(k);case C:return ss(k,mt,Z);case U:return gl(k)}}function bl(k,$){return $=$??r,!!$&&(typeof k=="number"||st.test(k))&&k>-1&&k%1==0&&k<$}function xl(k){var $=typeof k;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?k!=="__proto__":k===null}function wl(k){return!!oe&&oe in k}function Ro(k){var $=k&&k.constructor,Z=typeof $=="function"&&$.prototype||Se;return k===Z}function di(k){if(k!=null){try{return on.call(k)}catch{}try{return k+""}catch{}}return""}function Rd(k){return is(k,!0,!0)}function vl(k,$){return k===$||k!==k&&$!==$}function Sl(k){return Pd(k)&&qt.call(k,"callee")&&(!$e.call(k,"callee")||Ie.call(k)==s)}var Po=Array.isArray;function Tl(k){return k!=null&&Ld(k.length)&&!as(k)}function Pd(k){return Nd(k)&&Tl(k)}var Id=wo||ee;function as(k){var $=ls(k)?Ie.call(k):"";return $==h||$==g}function Ld(k){return typeof k=="number"&&k>-1&&k%1==0&&k<=r}function ls(k){var $=typeof k;return!!k&&($=="object"||$=="function")}function Nd(k){return!!k&&typeof k=="object"}function Io(k){return Tl(k)?Sd(k):fl(k)}function Fd(){return[]}function ee(){return!1}n.exports=Rd})(Ba,Ba.exports)),Ba.exports}SC();const Dn=(n,t)=>new Date(n.getTime()-xC(t,n));class Oe{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=bC(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return _m(e,t)}}class TC extends Oe{rawStart(t){let e=oi(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Dn(e,t)),e}maximumTimeframeLength(){return 3600*24*7}}class MC extends Oe{rawStart(t){let e=Yr(this.tzAdjustedDate(t));return t&&(e=Dn(e,t)),e}maximumTimeframeLength(){return 3600*24*31}}class DC extends Oe{rawStart(t){let e=$r(this.tzAdjustedDate(t));return t&&(e=Dn(e,t)),e}maximumTimeframeLength(){return 3600*24*92}}class kC extends Oe{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Dn(e,t)),e}maximumTimeframeLength(){return 3600*24*366}}class CC extends Oe{rawEnd(t){let e=oi(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Dn(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=oi(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Dn(i,t)),i}}class OC extends Oe{rawEnd(t){let e=$r(this.tzAdjustedDate(t));return t&&(e=Dn(e,t)),e}rawStart(t){let e=$r(rm(this.tzAdjustedDate(t)));return t&&(e=Dn(e,t)),e}}class AC extends Oe{rawEnd(t){let e=Yr(this.tzAdjustedDate(t));return t&&(e=Dn(e,t)),e}rawStart(t){let e=Yr(im(this.tzAdjustedDate(t)));return t&&(e=Dn(e,t)),e}}class EC extends Oe{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Dn(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=Dn(e,t)),e}}ht.FIFTEEN_MIN,new Oe({key:ht.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"]}),ht.ONE_HOUR,new Oe({key:ht.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"]}),ht.SIX_HOUR,new Oe({key:ht.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"]}),ht.TWELVE_HOUR,new Oe({key:ht.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"]}),ht.ONE_DAY,new Oe({key:ht.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"]}),ht.SEVEN_DAY,new Oe({key:ht.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"]}),ht.THIRTY_DAY,new Oe({key:ht.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"]}),ht.NINETY_DAY,new Oe({key:ht.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"]}),ht.ONE_HUNDRED_EIGHTY_DAY,new Oe({key:ht.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"]}),ht.ONE_YEAR,new Oe({key:ht.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"]}),ht.CURRENT_WEEK,new TC({key:ht.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=oi(new Date,{weekStartsOn:1});return(Hr(Ia(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),ht.CURRENT_MONTH,new MC({key:ht.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Yr(new Date);return(Hr(Ia(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ht.CURRENT_QUARTER,new DC({key:ht.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=$r(new Date);return(Hr(Ia(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ht.CURRENT_YEAR,new kC({key:ht.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1);return(Hr(Ia(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ht.PREVIOUS_WEEK,new CC({key:ht.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"]}),ht.PREVIOUS_MONTH,new AC({key:ht.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Yr(new Date),e=Yr(im(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=vm(t,e)),3600*24*Yk(new Date().setMonth(new Date().getMonth()-1))+nm(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ht.PREVIOUS_QUARTER,new OC({key:ht.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=$r(new Date),t=$r(rm(new Date));return(n.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ht.PREVIOUS_YEAR,new EC({key:ht.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=vm(n,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+nm(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function vm(n,t){return qk(n.getTimezoneOffset()-t.getTimezoneOffset())}ht.FIFTEEN_MIN,ht.ONE_HOUR,ht.SIX_HOUR,ht.TWELVE_HOUR,ht.ONE_DAY,ht.SEVEN_DAY,ht.FIFTEEN_MIN,ht.ONE_HOUR,ht.SIX_HOUR,ht.TWELVE_HOUR,ht.ONE_DAY,ht.SEVEN_DAY,ht.THIRTY_DAY,ht.NINETY_DAY,ht.ONE_HUNDRED_EIGHTY_DAY,ht.ONE_YEAR,ht.CURRENT_WEEK,ht.CURRENT_MONTH,ht.CURRENT_QUARTER,ht.CURRENT_YEAR,ht.PREVIOUS_WEEK,ht.PREVIOUS_MONTH,ht.PREVIOUS_QUARTER,ht.PREVIOUS_YEAR;const RC=new Map(Yg.map(n=>[n.code,{code:n.code,name:n.name}])),xu=n=>RC.get(n)?.name||n,Sm=1e3,PC=1e4,Tm=1e6,Mm=1e9,Dm=1e12,za=(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("")},ro=(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 Ua(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?PC:Sm;return n<r||t.precision&&t.precision>Math.log10(n)?e=za(ro(n,1,t),t):n<Tm?e=`${ro(n,Sm,t)}k`:n<Mm?e=`${ro(n,Tm,t)}m`:n<Dm?e=`${za(ro(n,Mm,t),t)}b`:e=`${za(ro(n,Dm,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}Ua.addCommas=za;const IC=typeof document<"u"&&document.documentElement?.lang||"en-US",Ha=new Intl.NumberFormat(IC);function fr({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,c=r?Math.pow(2,30):1e9,u=r?Math.pow(2,20):1e6,d=r?Math.pow(2,10):1e3;let h;return i>=s?h=n.formatNumber(Number.parseFloat((i/s).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?h=n.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=c?h=n.formatNumber(Number.parseFloat((i/c).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=u?h=n.formatNumber(Number.parseFloat((i/u).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=d?h=n.formatNumber(Number.parseFloat((i/d).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):h=n.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),h.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:c=!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}`:c?`${Ua(i,{capital:!0})} ${d}`:i>=.01?`${Ha.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:c="USD",approximate:u=!1,translateUnit:d=h=>h}={})=>{const h=d(s,r);switch(s){case"bytes":return`${t(i,a)} - ${t(r,a)}`;case"usd":return`${e(i,c)} - ${e(r,c)}`;default:if(isNaN(i)||isNaN(r))return`${i} - ${r}`;if(u)return`${Ua(i,{capital:!0})} - ${Ua(r,{capital:!0})} ${h}`}const g=i>=.01?`${Ha.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,y=r>=.01?`${Ha.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`;return`${g} - ${y} ${h}`}}}const Wa=n=>["interactive","zoom-interactive"].includes(n),km=(n,t,e,i)=>{const{tooltip:r}=t;if(r.opacity===0&&!Wa(n.interactionMode)){n.showTooltip=!1;return}const{i18n:s}=Pt.useI18n(),{formatUnit:a}=fr({i18n:s}),c=n.chartTooltipSortFn||((u,d)=>d.rawValue-u.rawValue);if(r.body&&!Wa(n.interactionMode)){const u=r.labelColors,d=t.chart.config?.options?.indexAxis==="y"?"x":"y",h=r.dataPoints[0].parsed.x??0;n.tooltipContext=i?.contextFormatter?i.contextFormatter(h,e):ao({tickValue:new Date(h),granularity:e}),n.tooltipSeries=r.dataPoints.map((g,y)=>{const _=g.parsed[d],x=a(_??0,n.units,{translateUnit:n.translateUnit}),v=g.dataset.label;return{backgroundColor:u[y].backgroundColor,borderColor:u[y].borderColor,label:v,value:x,rawValue:_,isSegmentEmpty:g.dataset.isSegmentEmpty}}).sort(c),n.left=`${r.x}px`,n.top=`${r.y}px`,n.showTooltip=!0}},Cm=(n,t)=>{const{tooltip:e}=t,{i18n:i}=Pt.useI18n(),{formatUnit:r}=fr({i18n:i});if(e.opacity===0&&!Wa(n.interactionMode)){n.showTooltip=!1;return}const s=n.chartTooltipSortFn||((a,c)=>c.rawValue-a.rawValue);if(e.body&&!Wa(n.interactionMode)){const a=e.labelColors,c=t.chart.config?.options?.indexAxis==="y"?"x":"y",u=["gauge","donut"].includes(n.chartType);u?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((d,h)=>{const g=u?d.parsed:d.parsed[c],y=r(g??0,n.units,{translateUnit:n.translateUnit});let _;return u?_=d.dataset.labels[d.dataIndex]:_=d.dataset.label,{backgroundColor:a[h].backgroundColor,borderColor:a[h].borderColor,label:_,value:y,rawValue:g,isSegmentEmpty:d.dataset.isSegmentEmpty}}).sort(s),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},LC=n=>n&&n.datasets&&n.datasets.length,NC=n=>LC(n)&&n.datasets.some(t=>t.data.length),FC=n=>n.datasets.some(t=>t.data[0]&&nu(t.data[0].x)),BC=n=>!!NC(n)&&n.datasets.some(t=>t.data.length==1),zC=n=>FC(n)&&n.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),wu=(n,t,e)=>{const r=Math.min(t/1150,1),s=.15,a=1.15,c=n.x??0;return c<e?c+t*s*(1-r):c-t*a*(1-r)},UC=(n,t,e)=>{const s=n.y??0;return s<e?s+t*.15:s-t*.5};function Om(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Am=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(r=>!t?.[r.text]?.isThreshold).map(((r,s)=>({...r,value:t&&t[r.text],isSegmentEmpty:i.datasets[s].isSegmentEmpty}))).sort(e)},HC=2,Em=10,Rm=12,$a=10,WC="#f1f0ff",$C="#e0e4ea",Pm="#6c7489",YC="#afb7c5",VC="#d60027",qC="#ad000e",vu="#6c7489",Im="#52596e",jC="#007d60",GC="#995c00",KC="#ffc400",XC="'Inter', Roboto, Helvetica, sans-serif",so="16px",ZC="20px",QC="#bee2ff",JC="#8fc1ff",tO="#5f9aff",eO="#306fff",nO="#b5ffee",iO="#00fabe",rO="#00d6a4",sO="#00a17b",oO="#007d60",aO="#005944",lO="#b5ffee",cO="#00fabe",uO="#b5ffee",dO="#00a17b",fO="#fff296",hO="#ffe04b",pO="#ffc400",gO="#b37600",mO="#995c00",yO="#804400",_O="#fff296",bO="#ffe04b",xO="#ffc2b3",wO="#ff9877",vO="#ff723c",SO="#f75008",TO="#d13500",MO="#a31f00",DO="#ffc2b3",kO="#ff9877",CO="#ff723c",OO="#f75008",AO="#d13500",EO="#a31f00",RO="#ffc2b3",PO="#ff9877",IO="#ff723c",LO="#f75008",NO="#d13500",FO="#a31f00",BO="#ffc2b3",zO="#ff9877",UO="#ff723c",HO="#f75008",WO="#d13500",$O="#a31f00",YO="#ffc2b3",VO="#ff9877",qO="#ff723c",jO="#f75008",GO="#d13500",KO="#ffabab",XO="#ff7272",ZO="#ff3954",QO="#f50045",JO="#d60027",tA="#ad000e",eA="#ffabab",nA="#ff7272",iA="#ff3954",rA="#f50045",sA="#d60027",oA="#eefaff",aA="#ecfffb",lA="#fffce0",cA="#fff1ef",uA="#ffe5e5",dA="#5f9aff",fA="#00d6a4",hA="#ffc400",pA="#ff723c",gA="#ff3954",Pi=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Su=(n,t)=>(t||Pi)[n%Pi.length],mA="#6f7787",yA={100:{background:"#f0f5fd",text:"#10599e"},200:{background:"#e5f7f4",text:"#1b6955"},300:{background:"#fff1d5",text:"#a06027"},400:{background:"#fee3b6",text:"#944d19"},500:{background:"#fedada",text:"#852021"}},_A=n=>{const t=Math.floor(parseInt(n,10)/100)*100;return yA[t]?.background||"#fafafa"},bA=YC,Lm=(n,t,e,i)=>{let r;return e?r=bA:Array.isArray(i)?r=Su(n,i):r=i[t],r||Su(n)},Tu=n=>{switch(n){case"error":return VC;case"warning":return KC;case"neutral":return Pm;default:return Pm}},xA={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},wA=2,vA=0,Mu=new Map,Nm=(n,t)=>{const{i18n:e}=Pt.useI18n(),{formatBytes:i}=fr({i18n:e});return t==="bytes"?i(n):t==="count/minute"?n.toFixed(2):Ha.format(n)},SA=n=>{const e=document.createElement("canvas").getContext("2d"),i=le({});return e.font=i.string,e.measureText(n).width},TA=()=>{const n="label_height";if(!Mu.has(n)){const t=le({});Mu.set(n,t.lineHeight)}return Mu.get(n)},MA=(n,t)=>t.datasets.reduce((e,i,r)=>n.isDatasetVisible(r)?e+i.data.reduce((s,a)=>isNaN(a)?s:s+a,0):e,0),DA=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,kA=$C,CA={100:QC,101:JC,102:tO,103:eO,200:nO,201:iO,202:rO,203:sO,204:oO,205:aO,206:lO,207:cO,208:uO,226:dO,300:fO,301:hO,302:pO,303:gO,304:mO,305:yO,307:_O,308:bO,400:xO,401:wO,402:vO,403:SO,404:TO,405:MO,406:DO,407:kO,408:CO,409:OO,410:AO,411:EO,412:RO,413:PO,414:IO,415:LO,416:NO,417:FO,418:BO,421:zO,422:UO,423:HO,424:WO,425:$O,426:YO,428:VO,429:qO,431:jO,451:GO,500:KO,501:XO,502:ZO,503:QO,504:JO,505:tA,506:eA,507:nA,508:iA,510:rA,511:sA},OA={100:oA,200:aA,300:lA,400:cA,500:uA},AA={"1XX":dA,"2XX":fA,"3XX":hA,"4XX":pA,"5XX":gA},Fm=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100;return CA[t]??OA[e]??kA},Du={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Fm(`${t}`),n),{}),____OTHER____:WC,...AA};function Bm(n,t,e){const i=Ag(),r=PA(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?EA(r,t):RA(r,t)}function EA(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 RA(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function PA(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function IA(n,t){const e=zA(t);return"formatToParts"in e?NA(e,n):FA(e,n)}const LA={year:0,month:1,day:2,hour:3,minute:4,second:5};function NA(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=LA[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 FA(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 ku={},zm=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")),BA=zm==="06/25/2014, 00:00:00"||zm==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function zA(n){return ku[n]||(ku[n]=BA?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"})),ku[n]}function Um(n,t,e,i,r,s,a){const c=new Date(0);return c.setUTCFullYear(n,t,e),c.setUTCHours(i,r,s,a),c}const Hm=36e5,UA=6e4,Cu={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ou(n,t,e){if(!n)return 0;let i=Cu.timezoneZ.exec(n);if(i)return 0;let r,s;if(i=Cu.timezoneHH.exec(n),i)return r=parseInt(i[1],10),Wm(r)?-(r*Hm):NaN;if(i=Cu.timezoneHHMM.exec(n),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Wm(r,a)?(s=Math.abs(r)*Hm+a*UA,i[1]==="+"?-s:s):NaN}if($A(n)){t=new Date(t||Date.now());const a=e?t:HA(t),c=Au(a,n);return-(e?c:WA(t,c,n))}return NaN}function HA(n){return Um(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Au(n,t){const e=IA(n,t),i=Um(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 WA(n,t,e){let r=n.getTime()-t;const s=Au(new Date(r),e);if(t===s)return t;r-=s-t;const a=Au(new Date(r),e);return s===a?s:Math.max(s,a)}function Wm(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const $m={};function $A(n){if($m[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),$m[n]=!0,!0}catch{return!1}}const YA=60*1e3,VA={X:function(n,t,e){const i=Eu(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Ym(i);case"XXXX":case"XX":return qr(i);default:return qr(i,":")}},x:function(n,t,e){const i=Eu(e.timeZone,n);switch(t){case"x":return Ym(i);case"xxxx":case"xx":return qr(i);default:return qr(i,":")}},O:function(n,t,e){const i=Eu(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+qA(i,":");default:return"GMT"+qr(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Bm("short",n,e);default:return Bm("long",n,e)}}};function Eu(n,t){const e=n?Ou(n,t,!0)/YA:t?.getTimezoneOffset()??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Ya(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function qr(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),r=Ya(Math.floor(i/60),2),s=Ya(Math.floor(i%60),2);return e+r+t+s}function Ym(n,t){return n%60===0?(n>0?"-":"+")+Ya(Math.abs(n)/60,2):qr(n,t)}function qA(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+Ya(s,2)}function Vm(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 jA=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ru=36e5,qm=6e4,GA=2,Ge={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:jA};function jm(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?GA: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=KA(n),{year:r,restDateString:s}=XA(i.date,e),a=ZA(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const c=a.getTime();let u=0,d;if(i.time&&(u=QA(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(d=Ou(i.timeZone||t.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=Vm(new Date(c+u)),d=Vm(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function KA(n){const t={};let e=Ge.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Ge.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const r=Ge.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function XA(n,t){if(n){const e=Ge.YYY[t],i=Ge.YYYYY[t];let r=Ge.YYYY.exec(n)||i.exec(n);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:n.slice(s.length)}}if(r=Ge.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 ZA(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=Ge.MM.exec(n);if(s)return e=new Date(0),i=parseInt(s[1],10)-1,Xm(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(s=Ge.DDD.exec(n),s){e=new Date(0);const a=parseInt(s[1],10);return eE(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(s=Ge.MMDD.exec(n),s){e=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return Xm(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(s=Ge.Www.exec(n),s)return r=parseInt(s[1],10)-1,Zm(r)?Gm(t,r):new Date(NaN);if(s=Ge.WwwD.exec(n),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return Zm(r,a)?Gm(t,r,a):new Date(NaN)}return null}function QA(n){let t,e,i=Ge.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Pu(t)?t%24*Ru:NaN;if(i=Ge.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Pu(t,e)?t%24*Ru+e*qm:NaN;if(i=Ge.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return Pu(t,e,r)?t%24*Ru+e*qm+r*1e3:NaN}return null}function Gm(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 JA=[31,28,31,30,31,30,31,31,30,31,30,31],tE=[31,29,31,30,31,30,31,31,30,31,30,31];function Km(n){return n%400===0||n%4===0&&n%100!==0}function Xm(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Km(n);if(i&&e>tE[t]||!i&&e>JA[t])return!1}return!0}function eE(n,t){if(t<1)return!1;const e=Km(n);return!(e&&t>366||!e&&t>365)}function Zm(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Pu(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const nE=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Iu(n,t,e={}){t=String(t);const i=t.match(nE);if(i){const r=jm(e.originalDate||n,e);t=i.reduce(function(s,a){if(a[0]==="'")return s;const c=s.indexOf(a),u=s[c-1]==="'",d=s.replace(a,"'"+VA[a[0]](r,a,e)+"'");return u?d.substring(0,c-1)+d.substring(c+1):d},t)}return Aa(n,t,e)}function iE(n,t,e){n=jm(n,e);const i=Ou(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 oo(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Iu(iE(n,t,{timeZone:i.timeZone}),e,i)}const rE=(n,t)=>`${oo(n,t,"yyyy")} W${oo(n,t,"II")}`,Lu="yyyy-MM-dd h:mm:ss a",Nu="h:mm:ss a",hr="yyyy-MM-dd h:mm a",jr="h:mm a",sE="yyyy-MM-dd",Fu="MMM dd, yyyy h:mm:ss a",Ii="MMM dd, yyyy h:mm a",oE={secondly:n=>n?Lu:Nu,tenSecondly:n=>n?Lu:Nu,thirtySecondly:n=>n?Lu:Nu,minutely:n=>n?hr:jr,fiveMinutely:n=>n?hr:jr,tenMinutely:n=>n?hr:jr,thirtyMinutely:n=>n?hr:jr,hourly:n=>n?hr:jr,twoHourly:n=>n?hr:jr,twelveHourly:()=>hr,daily:()=>sE},aE={secondly:()=>Fu,tenSecondly:()=>Fu,thirtySecondly:()=>Fu,minutely:()=>Ii,fiveMinutely:()=>Ii,tenMinutely:()=>Ii,thirtyMinutely:()=>Ii,hourly:()=>Ii,twoHourly:()=>Ii,twelveHourly:()=>Ii,daily:()=>Ii};function Qm({tickValue:n,granularity:t,timezone:e,dayBoundaryCrossed:i=!1,tickMap:r,tooltipMap:s,defaultFormat:a}){const c=e||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return rE(n,c);if(r&&r[t]){const u=r[t](i);return oo(n,c,u)}if(s&&s[t]){const u=s[t]();return oo(n,c,u)}return oo(n,c,a)}const lE=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>Qm({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:oE,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),ao=({tickValue:n,granularity:t,timezone:e})=>Qm({tickValue:n,granularity:t,timezone:e,tooltipMap:aE,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),Jm=n=>n?.code==="ERR_CANCELED"||n?.name==="CanceledError"||n?.name==="AbortError",cE=n=>{const{i18n:t}=Pt.useI18n();return Jm(n)?{type:"canceled",message:t.t("query_errors.canceled.message")}:n?.status===403?{status:n.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:n?.status===408||n?.message?.includes("timeout")?{status:n.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:n?.response?.data?.message==="Range not allowed for this tier"?{status:n.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:n.status,type:"other",message:t.t("query_errors.other.message"),details:n.response?.data?.invalid_parameters?.map(e=>e.reason).join(", ")||n?.message}},lo=n=>n.toLocaleLowerCase().endsWith("count"),uE=n=>{const t=n.toLocaleLowerCase();return["sum","count","cost","tokens"].some(e=>t.endsWith(e))};function dE(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:u=>({label:u.dataset.label,value:u.label})}};hn.positioners[e]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const h=this.chart.canvas.getBoundingClientRect(),g=n.tooltipState.width||this.width,y=h.width/2,_=wu(d,g,y),x=d.y,v=d.x<y?"left":"center";return{x:_-n.tooltipState.offsetX,y:x-n.tooltipState.offsetY,xAlign:v}},zc.modes.customInteractionMode=function(u,d){const h=ki(d,u),g=[];return zc.evaluateInteractionItems(u,u.options.indexAxis||"x",h,(y,_,x)=>{u.options.indexAxis==="y"&&y.inYRange(h.y,!0)&&u.data.datasets[_].data[x]&&g.push({element:y,datasetIndex:_,index:x}),u.options.indexAxis==="x"&&h.x!==null&&y.inXRange(h.x,!0)&&u.data.datasets[_].data[x]&&g.push({element:y,datasetIndex:_,index:x})}),g};const r=n.numLabels.value>25?Em:Rm,s=({chart:u,index:d})=>{const h=u.data;return{size:r,style:h?.isLabelEmpty?.[d]?"italic":"normal"}},a=(u,d,h)=>u.chart.options.indexAxis===u.axis?(d=u.getLabelForValue(h),d&&d.length>$a?d.slice(0,$a)+"...":d):u.getLabelForValue(Number(d)),c=p.computed(()=>({indexAxis:n.indexAxis,skipNull:!0,scales:{x:{stacked:n.stacked.value,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{maxRotation:90,autoSkip:!1,font:s,callback:function(u,d){return a(this,u,d)}},title:{display:n.indexAxis==="y"?!Tt(n.metricAxesTitle?.value):!Tt(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"?!Tt(n.metricAxesTitle?.value):!Tt(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=>{Cm(n.tooltipState,u)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.getCurrentInstance()&&p.onUnmounted(()=>{hn.positioners[e]&&delete hn.positioners[e]}),c}en.register(...HS);const fE=(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 hE(n,t,e,i,r){const s=p.shallowRef(null),a=(c,u)=>{if(t.value)return new en(t.value,{type:n,data:c,plugins:i,options:u})};return p.onMounted(()=>{s.value=a(e.value,r.value)}),p.onBeforeUnmount(()=>{Tt(s.value)||s.value.destroy()}),p.watch(e,(c,u)=>{if(fE(u,c)&&!Tt(s.value)){for(const[d,h]of c.datasets.entries())Object.assign(s.value.data.datasets[d],h);s.value.data.labels=c.labels,s.value.update()}else Tt(s.value)||s.value.destroy(),s.value=a(c,r.value)}),p.watch(t,()=>{Tt(s.value)||s.value.destroy(),s.value=a(e.value,r.value)}),p.watch(r,(c,u)=>{(c.indexAxis!==u.indexAxis||JSON.stringify(c.scales.x.title)!==JSON.stringify(u.scales.x.title)||JSON.stringify(c.scales.y.title)!==JSON.stringify(u.scales.y.title))&&(Tt(s.value)||s.value.destroy(),s.value=a(e.value,c))}),s}const ty=1e3,pE=1e4,ey=1e6,ny=1e9,iy=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("")},Gr=(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?pE:ty;return n<r||t.precision&&t.precision>Math.log10(n)?e=co(Gr(n,1,t),t):n<ey?e=`${Gr(n,ty,t)}k`:n<ny?e=`${Gr(n,ey,t)}m`:n<iy?e=`${co(Gr(n,ny,t),t)}b`:e=`${co(Gr(n,iy,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 gE(n,t,e){const{i18n:i}=Pt.useI18n(),{formatBytes:r}=fr({i18n:i}),{translateUnit:s}=Pt.useTranslatedUnits();return{legendValues:p.computed(()=>n.value.datasets.reduce((c,u)=>{const d=u.total?u.total:u.data.reduce((g,y)=>g+(typeof y=="number"?Number(y)||0:Number(y&&y.y)||0),0);let h;if(e.value==="bytes")h=r(d);else{const g=s(e.value,d);h=i&&i.t("legend.datapointValueDisplay",{value:uo(d,{capital:!0}),unit:g})||`${uo(d,{capital:!0})} ${e.value}`}return{...c,[u.label]:{raw:d,formatted:h,isThreshold:u.isThreshold}}},{}))}}function mE(n){return p.computed(()=>{if(!n.value?.meta)return"";const e=n.value.meta.start,i=n.value.meta.end;return e&&i?`${xm(new Date(e))} - ${xm(new Date(i),{includeTZ:!0})}`:""})}function yE(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};hn.positioners[e]=function(s,a){if(!s.length||a.x===null||a.y===null)return!1;const c=this.chart.canvas.getBoundingClientRect(),u=n.tooltipState.width||this.width,d=c.width/2,h=wu(a,u,d),g=a.y,y=a.x<d?"left":"center";return{x:h-n.tooltipState.offsetX,y:g,xAlign:y}};const r=p.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:s=>{Cm(n.tooltipState,s)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return p.onUnmounted(()=>{hn.positioners[e]&&delete hn.positioners[e]}),{options:r}}function _E(n){const t=p.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const d=new Date(u);return lE({tickValue:d,granularity:n.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!Tt(n.dimensionAxesTitle?.value),text:n.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value})),e=p.computed(()=>({title:{display:!Tt(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};hn.positioners[r]=function(u,d){if(!u.length||n.tooltipState.interactionMode==="interactive"||d.x===null||d.y===null)return!1;const h=this.chart.canvas.getBoundingClientRect(),g=n.tooltipState.width||this.width,y=n.tooltipState.height||this.height,_=h.width/2,x=h.height/2,v=wu(d,g,_);let S=UC(d,y,x);const C=d.y<x?"top":"bottom",E=d.x<_?"left":"center";return y>h.height&&(S=0),{x:v,y:S,xAlign:E,yAlign:C}};const a=p.computed(()=>{const u=Number(n.timeRangeMs.value),d=new Date,h=new Date(d.getTime()-u);return sD(u)>24||h.getDate()!==d.getDate()}),c=p.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:n.pointsWithoutHover?.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...s,external:u=>{km(n.tooltipState,u,n.granularity.value)}},thresholdPlugin:{threshold:n.threshold?.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return p.onUnmounted(()=>{hn.positioners[r]&&delete hn.positioners[r]}),{options:c}}function bE(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:r,pivotRecords:s,rowLabels:a,colorPalette:c}=n,{i18n:u}=Pt.useI18n();return t?i.map(h=>({label:u&&u.te(`chartLabels.${h}`)&&u.t(`chartLabels.${h}`)||h,backgroundColor:Su(i.indexOf(h),Pi),data:a.map((g,y)=>e?s[`${g.id},${h}`]||0:s[`${y},${h}`]||null)})):Array.from(r).flatMap((h,g)=>{if(!h)return[];const y=Lm(g,h.name,h.id==="empty",c);return{label:u&&u.te(`chartLabels.${h.name}`)&&u.t(`chartLabels.${h.name}`)||h.name,backgroundColor:y,data:a.map(_=>s[`${_.id},${h.id}`]||null),isSegmentEmpty:h.id==="empty"}})}function xE(n,t){const{i18n:e}=Pt.useI18n();return p.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a}=t.value.meta,c=s&&Object.keys(s),u=a&&a.length>1,d=s&&c&&c.length>0,h=d&&c.length>1;if(!r.length||!a)return{datasets:[],labels:[]};const g=d&&c||a,y=g[0],_=g.length>1?g[1]:g[0],x=Object.fromEntries(u?r.flatMap(D=>a.map((O,L)=>{const W=D.event[y],tt=d?`${W},${O}`:`${L},${O}`,G=D.event[O];return[tt,G]})):r.map(D=>{const O=d?`${D.event[y]},${D.event[_]}`:`${y},${_}`,L=D.event[a[0]];return[O,L]})),v=Object.keys(x).reduce((D,O)=>{const[L]=O.split(","),W=x[O];return D[L]?D[L]+=W:D[L]=W,D},{}),S=Object.entries(v).sort(([,D],[,O])=>Number(O)-Number(D)).map(([D])=>D),C=s[y],E=s[_];let U=d&&C&&Object.entries(C).map(([D,O])=>({id:D,name:O.name}))||a.map(D=>({id:D,name:D})),P=d&&E&&Object.entries(E).map(([D,O])=>({id:D,name:O.name}))||a.map(D=>({id:D,name:D}));if(d&&y==="country_code"&&(U=U.map(D=>({...D,name:xu(D.id)||D.name}))),d&&_==="country_code"&&(P=P.map(D=>({...D,name:xu(D.id)||D.name}))),y!=="status_code"&&y!=="status_code_grouped"&&(U.sort((D,O)=>S.indexOf(D.id)-S.indexOf(O.id)),P.sort((D,O)=>S.indexOf(D.id)-S.indexOf(O.id))),!U||!P)return{labels:[],datasets:[]};const I=bE({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:g,barSegmentLabels:P,pivotRecords:x,rowLabels:U,colorPalette:n.colorPalette||Pi}),B=d?U.map(D=>e&&e.te(`chartLabels.${D.name}`)&&e.t(`chartLabels.${D.name}`)||D.name):a.map(D=>e&&e.te(`chartLabels.${D}`)&&e.t(`chartLabels.${D}`)||D),N=U.map(D=>D.id==="empty");return{labels:B,datasets:I,isLabelEmpty:N,isMultiDimension:h}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const wE=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),vE=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return Lg(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},SE=(n,t,e,i,r)=>{const a=Math.max(t-6e4,Math.max(...(r||[]).map(d=>new Date(d.timestamp).valueOf()))),c=Math.floor((n-i)/e)*e+i,u=Math.floor((a-i)/e)*e+i+e;return wE(c,u,e)};function TE(n,t){const{i18n:e}=Pt.useI18n();return p.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a,start:c,end:u}=t.value.meta,d=new Date(c).getTime(),h=new Date(u).getTime();if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const g=s&&Object.keys(s)||a,y=g&&g[0],_=s[y];let x=s&&_&&Object.keys(_).map(B=>({id:B,name:_[B].name}))||a.map(B=>({id:B,name:B}));y==="country_code"&&(x=x.map(B=>({...B,name:xu(B.id)||B.name})));const v=t.value.meta.granularity_ms;if(typeof v!="number"||isNaN(v)||!isFinite(v)||v===0)return console.error("Invalid step value:",v),{datasets:[],labels:[]};if(!r.length)return{datasets:[],labels:[]};const S=vE(d),C=SE(d,h,v,S,r),E=new Set,U=r?.length?r.reduce((B,N)=>{const T=new Date(N.timestamp).valueOf(),D=N.event;for(const O of a)E.add(O),T in B||(B[T]={}),O in B[T]||(B[T][O]={});for(const O of a)x.forEach(L=>{D[y]===L.id||O===L.id?(B[T][O]||(B[T][O]={}),B[T][O][L.id]=Math.round(Number(D[O])*1e3)/1e3):g.length||(B[T][O]||(B[T][O]={}),B[T][O][L.id]=Math.round(Number(D[L.id])*1e3)/1e3)});return B},{}):{},I=[...a.length===1?a.flatMap(B=>x.map(N=>[B,N.id,N.name,N.id==="empty"])):x.map(B=>[B.name,B.id,B.name,B.id==="empty"])].map(([B,N,T,D],O)=>{const L=C.map(nt=>nt in U&&B in U[nt]?{x:nt,y:U[nt][B][N]||0}:{x:nt,y:0});let{colorPalette:W,fill:tt}=n;Tt(W)&&(W=Pi);const G=Lm(O,T,D,W);return{rawDimension:T,rawMetric:B,label:e&&e.te(`chartLabels.${T}`)&&e.t(`chartLabels.${T}`)||T,borderColor:G,backgroundColor:G,data:L,total:L.reduce((nt,{y:X})=>nt+Number(X),0),...xA,fill:tt,borderWidth:tt?vA:wA,isSegmentEmpty:D}});return y==="status_code"||y==="status_code_grouped"?I.sort((B,N)=>(B.label??"")<(N.label??"")?-1:1):I.sort((B,N)=>Number(B.total)<Number(N.total)?-1:1),{datasets:I}}}catch(r){return console.error(r),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const ME=(n,t)=>{p.watch([n,t],(e,i,r)=>{const[s,a]=e;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,s),r(()=>{window._AnalyticsChartDataInternal?.delete(a)}))},{immediate:!0})};function DE(){const{i18n:n}=Pt.useI18n();return{translateUnit:(e,i)=>{const r=i===1,s=`chartUnits.${e}`;return lo(e)?"":n.te(s)?n.t(s,{plural:r?"":"s"}):e}}}const kE="analytics-query-provider",ry=2;function CE(){const n=p.inject(kE);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function sy(n,t){return p.getCurrentScope()?(p.onScopeDispose(n,t),!0):!1}const oy=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const OE=n=>n!=null,AE=Object.prototype.toString,EE=n=>AE.call(n)==="[object Object]";function Va(n){return Array.isArray(n)?n:[n]}function RE(n){return p.getCurrentInstance()}function PE(n,t={}){if(!p.isRef(n))return p.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=p.customRef(()=>({get(){return n.value[i]},set(r){var s;if(!((s=p.toValue(t.replaceRef))!==null&&s!==void 0)||s)if(Array.isArray(n.value)){const a=[...n.value];a[i]=r,n.value=a}else{const a={...n.value,[i]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=r}}));return e}function IE(n,t=!0,e){RE()?p.onMounted(n,e):t?n():p.nextTick(n)}function LE(n,t,e){return p.watch(n,t,{...e,immediate:!0})}const qa=oy?window:void 0;function Kr(n){var t;const e=p.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=p.computed(()=>{const i=Va(p.toValue(n[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return LE(()=>{var i,r;return[(i=(r=e.value)===null||r===void 0?void 0:r.map(s=>Kr(s)))!==null&&i!==void 0?i:[qa].filter(s=>s!=null),Va(p.toValue(e.value?n[1]:n[0])),Va(p.unref(e.value?n[2]:n[1])),p.toValue(e.value?n[3]:n[2])]},([i,r,s,a],c,u)=>{if(!i?.length||!r?.length||!s?.length)return;const d=EE(a)?{...a}:a,h=i.flatMap(g=>r.flatMap(y=>s.map(_=>t(g,y,_,d))));u(()=>{h.forEach(g=>g())})},{flush:"post"})}function NE(){const n=p.shallowRef(!1),t=p.getCurrentInstance();return t&&p.onMounted(()=>{n.value=!0},t),n}function ay(n){const t=NE();return p.computed(()=>(t.value,!!n()))}function FE(n,t,e={}){const{window:i=qa,...r}=e;let s;const a=ay(()=>i&&"MutationObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=p.watch(p.computed(()=>{const g=Va(p.toValue(n)).map(Kr).filter(OE);return new Set(g)}),g=>{c(),a.value&&g.size&&(s=new MutationObserver(t),g.forEach(y=>s.observe(y,r)))},{immediate:!0,flush:"post"}),d=()=>s?.takeRecords(),h=()=>{u(),c()};return sy(h),{isSupported:a,stop:h,takeRecords:d}}const ja={speed:2,margin:30,direction:"both"};function BE(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 zE(n,t={}){var e,i,r,s;const{pointerTypes:a,preventDefault:c,stopPropagation:u,exact:d,onMove:h,onEnd:g,onStart:y,initialValue:_,axis:x="both",draggingElement:v=qa,containerElement:S,handle:C=n,buttons:E=[0],restrictInView:U,autoScroll:P=!1}=t,I=p.ref((e=p.toValue(_))!==null&&e!==void 0?e:{x:0,y:0}),B=p.ref(),N=H=>a?a.includes(H.pointerType):!0,T=H=>{p.toValue(c)&&H.preventDefault(),p.toValue(u)&&H.stopPropagation()},D=p.toValue(P),O=typeof D=="object"?{speed:(i=p.toValue(D.speed))!==null&&i!==void 0?i:ja.speed,margin:(r=p.toValue(D.margin))!==null&&r!==void 0?r:ja.margin,direction:(s=D.direction)!==null&&s!==void 0?s:ja.direction}:ja,L=H=>typeof H=="number"?[H,H]:[H.x,H.y],W=(H,V,J)=>{const{clientWidth:_t,clientHeight:pt,scrollLeft:it,scrollTop:ft,scrollWidth:ut,scrollHeight:dt}=H,[gt,lt]=L(O.margin),[It,Bt]=L(O.speed);let wt=0,kt=0;(O.direction==="x"||O.direction==="both")&&(J.x<gt&&it>0?wt=-It:J.x+V.width>_t-gt&&it<ut-_t&&(wt=It)),(O.direction==="y"||O.direction==="both")&&(J.y<lt&&ft>0?kt=-Bt:J.y+V.height>pt-lt&&ft<dt-pt&&(kt=Bt)),(wt||kt)&&H.scrollBy({left:wt,top:kt,behavior:"auto"})};let tt=null;const G=()=>{const H=p.toValue(S);H&&!tt&&(tt=setInterval(()=>{const V=p.toValue(n).getBoundingClientRect(),{x:J,y:_t}=I.value,pt={x:J-H.scrollLeft,y:_t-H.scrollTop};pt.x>=0&&pt.y>=0&&(W(H,V,pt),pt.x+=H.scrollLeft,pt.y+=H.scrollTop,I.value=pt)},1e3/60))},nt=()=>{tt&&(clearInterval(tt),tt=null)},X=(H,V,J,_t)=>{const[pt,it]=typeof J=="number"?[J,J]:[J.x,J.y],{clientWidth:ft,clientHeight:ut}=V;return H.x<pt||H.x+_t.width>ft-pt||H.y<it||H.y+_t.height>ut-it},Q=()=>{if(p.toValue(t.disabled)||!B.value)return;const H=p.toValue(S);if(!H)return;const V=p.toValue(n).getBoundingClientRect(),{x:J,y:_t}=I.value;X({x:J-H.scrollLeft,y:_t-H.scrollTop},H,O.margin,V)?G():nt()};p.toValue(P)&&p.watch(I,Q);const rt=H=>{var V;if(!p.toValue(E).includes(H.button)||p.toValue(t.disabled)||!N(H)||p.toValue(d)&&H.target!==p.toValue(n))return;const J=p.toValue(S),_t=J==null||(V=J.getBoundingClientRect)===null||V===void 0?void 0:V.call(J),pt=p.toValue(n).getBoundingClientRect(),it={x:H.clientX-(J?pt.left-_t.left+(P?0:J.scrollLeft):pt.left),y:H.clientY-(J?pt.top-_t.top+(P?0:J.scrollTop):pt.top)};y?.(it,H)!==!1&&(B.value=it,T(H))},st=H=>{if(p.toValue(t.disabled)||!N(H)||!B.value)return;const V=p.toValue(S);V instanceof HTMLElement&&BE(V);const J=p.toValue(n).getBoundingClientRect();let{x:_t,y:pt}=I.value;if((x==="x"||x==="both")&&(_t=H.clientX-B.value.x,V&&(_t=Math.min(Math.max(0,_t),V.scrollWidth-J.width))),(x==="y"||x==="both")&&(pt=H.clientY-B.value.y,V&&(pt=Math.min(Math.max(0,pt),V.scrollHeight-J.height))),p.toValue(P)&&V&&(tt===null&&W(V,J,{x:_t,y:pt}),_t+=V.scrollLeft,pt+=V.scrollTop),V&&(U||P)){if(x!=="y"){const it=_t-V.scrollLeft;it<0?_t=V.scrollLeft:it>V.clientWidth-J.width&&(_t=V.clientWidth-J.width+V.scrollLeft)}if(x!=="x"){const it=pt-V.scrollTop;it<0?pt=V.scrollTop:it>V.clientHeight-J.height&&(pt=V.clientHeight-J.height+V.scrollTop)}}I.value={x:_t,y:pt},h?.(I.value,H),T(H)},ot=H=>{p.toValue(t.disabled)||!N(H)||B.value&&(B.value=void 0,P&&nt(),g?.(I.value,H),T(H))};if(oy){const H=()=>{var V;return{capture:(V=t.capture)!==null&&V!==void 0?V:!0,passive:!p.toValue(c)}};fo(C,"pointerdown",rt,H),fo(v,"pointermove",st,H),fo(v,"pointerup",ot,H)}return{...PE(I),position:I,isDragging:p.computed(()=>!!B.value),style:p.computed(()=>`
4
+ left: ${I.value.x}px;
5
+ top: ${I.value.y}px;
6
+ ${P?"text-wrap: nowrap;":""}
7
+ `)}}function UE(n,t,e={}){const{window:i=qa,...r}=e;let s;const a=ay(()=>i&&"ResizeObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=p.watch(p.computed(()=>{const h=p.toValue(n);return Array.isArray(h)?h.map(g=>Kr(g)):[Kr(h)]}),h=>{if(c(),a.value&&i){s=new ResizeObserver(t);for(const g of h)g&&s.observe(g,r)}},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return sy(d),{isSupported:a,stop:d}}function HE(n,t={}){const{reset:e=!0,windowResize:i=!0,windowScroll:r=!0,immediate:s=!0,updateTiming:a="sync"}=t,c=p.shallowRef(0),u=p.shallowRef(0),d=p.shallowRef(0),h=p.shallowRef(0),g=p.shallowRef(0),y=p.shallowRef(0),_=p.shallowRef(0),x=p.shallowRef(0);function v(){const C=Kr(n);if(!C){e&&(c.value=0,u.value=0,d.value=0,h.value=0,g.value=0,y.value=0,_.value=0,x.value=0);return}const E=C.getBoundingClientRect();c.value=E.height,u.value=E.bottom,d.value=E.left,h.value=E.right,g.value=E.top,y.value=E.width,_.value=E.x,x.value=E.y}function S(){a==="sync"?v():a==="next-frame"&&requestAnimationFrame(()=>v())}return UE(n,S),p.watch(()=>Kr(n),C=>!C&&S()),FE(n,S,{attributeFilter:["style","class"]}),r&&fo("scroll",S,{capture:!0,passive:!0}),i&&fo("resize",S,{passive:!0}),IE(()=>{s&&S()}),{height:c,bottom:u,left:d,right:h,top:g,width:y,x:_,y:x,update:S}}function WE(n,t){const{top:e,left:i}=HE(n),r=p.computed(()=>n.value?`${parseFloat(t.left)+i.value}px`:t.left),s=p.computed(()=>n.value?`${parseFloat(t.top)+e.value}px`:t.top);return{tooltipAbsoluteLeft:r,tooltipAbsoluteTop:s}}const $E=({bucketCount:n,minStamp:t,maxStamp:e,timestamps:i})=>{const r=[...i].filter(u=>u>=t&&u<=e).sort((u,d)=>u-d),s=[];if(e-t<n-2)return[];const a=(e-t)/n;let c=0;for(let u=0;u<n;u++){const d=t+u*a,h=t+(u+1)*a;let g=0;for(;c<r.length&&r[c]>=d&&r[c]<=h;)g++,c++;s.push([Math.ceil(d),g])}return s},ly=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),ho=p.ref({}),YE=n=>(ho.value[n]||(ho.value[n]=ly()),ho.value[n]),VE=(n,t)=>{const e=ho.value[t];if(!e)return;const i=e.minCounts[n]!==void 0||e.maxCounts[n]!==void 0||e.minStamps[n]!==void 0||e.maxStamps[n]!==void 0||e.renderPoints[n]!==void 0;e&&i&&(delete e.minCounts[n],delete e.maxCounts[n],delete e.minStamps[n],delete e.maxStamps[n],delete e.renderPoints[n],Object.keys(e.minCounts).length||Object.keys(e.maxCounts).length||Object.keys(e.minStamps).length||Object.keys(e.maxStamps).length||Object.keys(e.renderPoints).length||delete ho.value[t])};function qE({chartKey:n,datasets:t,groupKey:e,minStamp:i=void 0,maxStamp:r=void 0,minCount:s=void 0,maxCount:a=void 0,renderPoints:c=void 0,type:u}){const h=e!==void 0&&n!==void 0?YE(e):ly(),g=n!==void 0?n:"static-chart-key",y=p.computed(()=>t.reduce((O,{timestamps:L})=>[...O,...L],[])),_=p.computed(()=>i||y.value.reduce((O,L)=>O===0?L:Math.min(O,L),0)),x=p.computed(()=>r||y.value.reduce((O,L)=>Math.max(O,L),0));p.watchEffect(()=>{h.minStamps[g]=_.value,h.maxStamps[g]=x.value,c!==void 0&&(h.renderPoints[g]=c)});const v=p.computed(()=>Object.values(h.minStamps).reduce((O,L)=>O===0?L:Math.min(O,L),0)),S=p.computed(()=>Object.values(h.maxStamps).reduce((O,L)=>Math.max(O,L),0)),C=p.computed(()=>{const O=Object.values(h.renderPoints);return O.length===0?24:O.reduce((L,W)=>Math.max(L,W),2)}),E=p.computed(()=>{const O=S.value-v.value;return Math.ceil(O/C.value)}),U=p.computed(()=>t.length>1),P=p.computed(()=>t.map(({timestamps:O,color:L,label:W})=>({data:$E({bucketCount:C.value,minStamp:v.value,maxStamp:S.value,timestamps:O}).map(([nt,X])=>({x:nt,y:X})),label:W,...(u==="sparkline_bar"||U.value)&&L&&{backgroundColor:L},...u!=="sparkline_bar"&&L&&{borderColor:L},...U.value&&u!=="sparkline_bar"&&{fill:!0}}))),I=p.computed(()=>{const O=P.value[0]?.data?.length??0,L=[];for(let W=0;W<O;W++){let tt=0;for(let G=0;G<P.value.length;G++)tt+=P.value[G].data[W].y;L.push(tt)}return L}),B=p.computed(()=>{const O=I.value.reduce((L,W)=>Math.max(L,W),0);return Math.max(O,a??0)}),N=p.computed(()=>{const O=P.value.reduce((tt,{data:G})=>[...tt,...G.map(({y:nt})=>nt)],[]),L=O.length?O[0]:0,W=O.reduce((tt,G)=>Math.min(tt,G),L);return s===void 0?W:Math.min(W,s)});p.watchEffect(()=>{h.maxCounts[g]=B.value,h.minCounts[g]=N.value});const T=p.computed(()=>{const O=Object.values(h.minCounts),L=O.length?O[0]:0;return O.reduce((W,tt)=>Math.min(W,tt),L)}),D=p.computed(()=>Object.values(h.maxCounts).reduce((O,L)=>Math.max(O,L),0));return p.onUnmounted(()=>{n!==void 0&&e!==void 0&&VE(n,e)}),{syncedMinStamp:v,syncedMaxStamp:S,syncedRenderPoints:C,syncedChartDatasets:P,syncedGroupSizeMs:E,syncedMinCount:T,syncedMaxCount:D}}const Pt={useBarChartOptions:dE,useChartJSCommon:hE,useChartLegendValues:gE,useChartSelectedRange:mE,useExploreResultToDatasets:xE,useExploreResultToTimeDataset:TE,useDonutChartOptions:yE,useLineChartOptions:_E,useI18n:Mb,useReportChartDataForSynthetics:ME,useTranslatedUnits:DE,useEvaluateFeatureFlag:CE,useTooltipAbsolutePosition:WE,useSparklineSync:qE};var sn=(n=>(n.Hidden="hidden",n.Bottom="bottom",n))(sn||{});const cy={modes:{point(n,t){return Ga(n,t,{intersect:!0})},nearest(n,t,e){return KE(n,t,e)},x(n,t,e){return Ga(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return Ga(n,t,{intersect:e.intersect,axis:"y"})}}};function Bu(n,t,e){return(cy.modes[e.mode]||cy.modes.nearest)(n,t,e)}function jE(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function GE(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function Ga(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):jE(i,t,e.axis))}function KE(n,t,e){let i=Number.POSITIVE_INFINITY;return Ga(n,t,e).reduce((r,s)=>{const a=s.getCenterPoint(),c=GE(t,a,e.axis),u=Rr(t,c);return u<i?(r=[s],i=u):u===i&&r.push(s),r},[]).sort((r,s)=>r._index-s._index).slice(0,1)}function pr(n,t,e){const i=Math.cos(e),r=Math.sin(e),s=t.x,a=t.y;return{x:s+i*(n.x-s)-r*(n.y-a),y:a+r*(n.x-s)+i*(n.y-a)}}const XE=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,gr=.001,Ka=(n,t,e)=>Math.min(e,Math.max(t,n)),uy=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function ZE(n,t,e){for(const i of Object.keys(n))n[i]=Ka(n[i],t,e);return n}function QE(n,t,e,i){return!n||!t||e<=0?!1:Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function dy(n,{x:t,y:e,x2:i,y2:r},s,{borderWidth:a,hitTolerance:c}){const u=(a+c)/2,d=n.x>=t-u-gr&&n.x<=i+u+gr,h=n.y>=e-u-gr&&n.y<=r+u+gr;return s==="x"?d:(s==="y"||d)&&h}function fy(n,{rect:t,center:e},i,{rotation:r,borderWidth:s,hitTolerance:a}){const c=pr(n,e,xe(-r));return dy(c,t,i,{borderWidth:s,hitTolerance:a})}function mr(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function JE(n,t,e,i=!0){const r=e.split(".");let s=0;for(const a of t.split(".")){const c=r[s++];if(parseInt(a,10)<parseInt(c,10))break;if(XE(c,a)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const hy=n=>typeof n=="string"&&n.endsWith("%"),py=n=>parseFloat(n)/100,gy=n=>Ka(py(n),0,1),po=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),tR={box:n=>po(n.centerX,n.centerY),doughnutLabel:n=>po(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>po(n.centerX,n.centerY),line:n=>po(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>po(n.centerX,n.centerY)};function zu(n,t){return t==="start"?0:t==="end"?n:hy(t)?gy(t)*n:n/2}function Li(n,t,e=!0){return typeof t=="number"?t:hy(t)?(e?gy(t):py(t))*n:n}function eR(n,t){const{x:e,width:i}=n,r=t.textAlign;return r==="center"?e+i/2:r==="end"||r==="right"?e+i:e}function my(n,t,{borderWidth:e,position:i,xAdjust:r,yAdjust:s},a){const c=Rt(a),u=t.width+(c?a.width:0)+e,d=t.height+(c?a.height:0)+e,h=Uu(i),g=xy(n.x,u,r,h.x),y=xy(n.y,d,s,h.y);return{x:g,y,x2:g+u,y2:y+d,width:u,height:d,centerX:g+u/2,centerY:y+d/2}}function Uu(n,t="center"){return Rt(n)?{x:Mt(n.x,t),y:Mt(n.y,t)}:(n=Mt(n,t),{x:n,y:n})}const yy=(n,t)=>n&&n.autoFit&&t<1;function _y(n,t){const e=n.font,i=Yt(e)?e:[e];return yy(n,t)?i.map(function(r){const s=le(r);return s.size=Math.floor(r.size*t),s.lineHeight=r.lineHeight,le(s)}):i.map(r=>le(r))}function by(n){return n&&(Je(n.xValue)||Je(n.yValue))}function xy(n,t,e=0,i){return n-zu(t,i)+e}function Xr(n,t,e){const i=e.init;if(i){if(i===!0)return vy(t,e)}else return;return nR(n,t,e)}function wy(n,t,e){let i=!1;return t.forEach(r=>{tn(n[r])?(i=!0,e[r]=n[r]):Je(e[r])&&delete e[r]}),i}function vy(n,t){const e=t.type||"line";return tR[e](n)}function nR(n,t,e){const i=Kt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return vy(t,e);if(Rt(i))return i}const Hu=new Map,iR=n=>isNaN(n)||n<=0,rR=n=>n.reduce(function(t,e){return t+=e.string,t},"");function Xa(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Za(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(xe(i)),n.translate(-t,-e))}function ai(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function Zr(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function Qa(n,t){const e=t.content;if(Xa(e))return{width:Li(e.width,t.width),height:Li(e.height,t.height)};const i=_y(t),r=t.textStrokeWidth,s=Yt(e)?e:[e],a=s.join()+rR(i)+r+(n._measureText?"-spriting":"");return Hu.has(a)||Hu.set(a,lR(n,s,i,r)),Hu.get(a)}function Sy(n,t,e){const{x:i,y:r,width:s,height:a}=t;n.save(),Zr(n,e);const c=ai(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),Pr(n,{x:i,y:r,w:s,h:a,radius:ZE(Mi(e.borderRadius),0,Math.min(s,a)/2)}),n.closePath(),n.fill(),c&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function Ty(n,t,e,i){const r=e.content;if(Xa(r)){n.save(),n.globalAlpha=dR(e.opacity,r.style.opacity),n.drawImage(r,t.x,t.y,t.width,t.height),n.restore();return}const s=Yt(r)?r:[r],a=_y(e,i),c=e.color,u=Yt(c)?c:[c],d=eR(t,e),h=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,sR(n,e)&&cR(n,{x:d,y:h},s,a),uR(n,{x:d,y:h},s,{fonts:a,colors:u}),n.restore()}function sR(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function oR(n,t,e,i){const{radius:r,options:s}=t,a=s.pointStyle,c=s.rotation;let u=(c||0)*mc;if(Xa(a)){n.save(),n.translate(e,i),n.rotate(u),n.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),n.restore();return}iR(r)||aR(n,{x:e,y:i,radius:r,rotation:c,style:a,rad:u})}function aR(n,{x:t,y:e,radius:i,rotation:r,style:s,rad:a}){let c,u,d,h;switch(n.beginPath(),s){default:n.arc(t,e,i,0,te),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=ia,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=ia,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),n.closePath();break;case"rectRounded":h=i*.516,d=i-h,c=Math.cos(a+Tn)*d,u=Math.sin(a+Tn)*d,n.arc(t-c,e-u,h,a-At,a-re),n.arc(t+u,e-c,h,a-re,a),n.arc(t+c,e+u,h,a,a+re),n.arc(t-u,e+c,h,a+re,a+At),n.closePath();break;case"rect":if(!r){d=Math.SQRT1_2*i,n.rect(t-d,e-d,2*d,2*d);break}a+=Tn;case"rectRot":c=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-c,e-u),n.lineTo(t+u,e-c),n.lineTo(t+c,e+u),n.lineTo(t-u,e+c),n.closePath();break;case"crossRot":a+=Tn;case"cross":c=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-c,e-u),n.lineTo(t+c,e+u),n.moveTo(t+u,e-c),n.lineTo(t-u,e+c);break;case"star":c=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-c,e-u),n.lineTo(t+c,e+u),n.moveTo(t+u,e-c),n.lineTo(t-u,e+c),a+=Tn,c=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-c,e-u),n.lineTo(t+c,e+u),n.moveTo(t+u,e-c),n.lineTo(t-u,e+c);break;case"line":c=Math.cos(a)*i,u=Math.sin(a)*i,n.moveTo(t-c,e-u),n.lineTo(t+c,e+u);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(a)*i,e+Math.sin(a)*i);break}n.fill()}function lR(n,t,e,i){n.save();const r=t.length;let s=0,a=i;for(let c=0;c<r;c++){const u=e[Math.min(c,e.length-1)];n.font=u.string;const d=t[c];s=Math.max(s,n.measureText(d).width+i),a+=u.lineHeight}return n.restore(),{width:s,height:a}}function cR(n,{x:t,y:e},i,r){n.beginPath();let s=0;i.forEach(function(a,c){const u=r[Math.min(c,r.length-1)],d=u.lineHeight;n.font=u.string,n.strokeText(a,t,e+d/2+s),s+=d}),n.stroke()}function uR(n,{x:t,y:e},i,{fonts:r,colors:s}){let a=0;i.forEach(function(c,u){const d=s[Math.min(u,s.length-1)],h=r[Math.min(u,r.length-1)],g=h.lineHeight;n.beginPath(),n.font=h.string,n.fillStyle=d,n.fillText(c,t,e+g/2+a),a+=g,n.fill()})}function dR(n,t){const e=Ti(n)?n:t;return Ti(e)?Ka(e,0,1):1}const My=["left","bottom","top","right"];function fR(n,t){const{pointX:e,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&yR(t,s);if(!a||bR(t,s,a))return;if(n.save(),n.beginPath(),!ai(n,s))return n.restore();const{separatorStart:u,separatorEnd:d}=hR(t,a),{sideStart:h,sideEnd:g}=gR(t,a,u);(s.margin>0||r.borderWidth===0)&&(n.moveTo(u.x,u.y),n.lineTo(d.x,d.y)),n.moveTo(h.x,h.y),n.lineTo(g.x,g.y);const y=pr({x:e,y:i},t.getCenterPoint(),xe(-t.rotation));n.lineTo(y.x,y.y),n.stroke(),n.restore()}function hR(n,t){const{x:e,y:i,x2:r,y2:s}=n,a=pR(n,t);let c,u;return t==="left"||t==="right"?(c={x:e+a,y:i},u={x:c.x,y:s}):(c={x:e,y:i+a},u={x:r,y:c.y}),{separatorStart:c,separatorEnd:u}}function pR(n,t){const{width:e,height:i,options:r}=n,s=r.callout.margin+r.borderWidth/2;return t==="right"?e+s:t==="bottom"?i+s:-s}function gR(n,t,e){const{y:i,width:r,height:s,options:a}=n,c=a.callout.start,u=mR(t,a.callout);let d,h;return t==="left"||t==="right"?(d={x:e.x,y:i+Li(s,c)},h={x:d.x+u,y:d.y}):(d={x:e.x+Li(r,c),y:e.y},h={x:d.x,y:d.y+u}),{sideStart:d,sideEnd:h}}function mR(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function yR(n,t){const e=t.position;return My.includes(e)?e:_R(n,t)}function _R(n,t){const{x:e,y:i,x2:r,y2:s,width:a,height:c,pointX:u,pointY:d,centerX:h,centerY:g,rotation:y}=n,_={x:h,y:g},x=t.start,v=Li(a,x),S=Li(c,x),C=[e,e+v,e+v,r],E=[i+S,s,i,s],U=[];for(let P=0;P<4;P++){const I=pr({x:C[P],y:E[P]},_,xe(y));U.push({position:My[P],distance:Rr(I,{x:u,y:d})})}return U.sort((P,I)=>P.distance-I.distance)[0].position}function bR(n,t,e){const{pointX:i,pointY:r}=n,s=t.margin;let a=i,c=r;return e==="left"?a+=s:e==="right"?a-=s:e==="top"?c+=s:e==="bottom"&&(c-=s),n.inRange(a,c)}const Dy={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function Qr(n,t,e){return t=typeof t=="number"?t:n.parse(t),ae(t)?n.getPixelForValue(t):e}function yr(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const r=e.charAt(0),s=Object.values(n).filter(a=>a.axis&&a.axis===r);return s.length?s[0].id:r}function ky(n,t){if(n){const e=n.options.reverse,i=Qr(n,t.min,e?t.end:t.start),r=Qr(n,t.max,e?t.start:t.end);return{start:i,end:r}}}function Cy(n,t){const{chartArea:e,scales:i}=n,r=i[yr(i,t,"xScaleID")],s=i[yr(i,t,"yScaleID")];let a=e.width/2,c=e.height/2;return r&&(a=Qr(r,t.xValue,r.left+r.width/2)),s&&(c=Qr(s,t.yValue,s.top+s.height/2)),{x:a,y:c}}function Wu(n,t){const e=n.scales,i=e[yr(e,t,"xScaleID")],r=e[yr(e,t,"yScaleID")];if(!i&&!r)return{};let{left:s,right:a}=i||n.chartArea,{top:c,bottom:u}=r||n.chartArea;const d=Ey(i,{min:t.xMin,max:t.xMax,start:s,end:a});s=d.start,a=d.end;const h=Ey(r,{min:t.yMin,max:t.yMax,start:u,end:c});return c=h.start,u=h.end,{x:s,y:c,x2:a,y2:u,width:a-s,height:u-c,centerX:s+(a-s)/2,centerY:c+(u-c)/2}}function Oy(n,t){if(!by(t)){const e=Wu(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const r=i*2,s=e.centerX+t.xAdjust,a=e.centerY+t.yAdjust;return{x:s-i,y:a-i,x2:s+i,y2:a+i,centerX:s,centerY:a,width:r,height:r,radius:i}}return wR(n,t)}function xR(n,t){const{scales:e,chartArea:i}=n,r=e[t.scaleID],s={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return r?vR(r,s,t):SR(e,s,t),s}function Ay(n,t){const e=Wu(n,t);return e.initProperties=Xr(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:DR(n,e,t),initProperties:e.initProperties}],e}function wR(n,t){const e=Cy(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function Ey(n,t){const e=ky(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function vR(n,t,e){const i=Qr(n,e.value,NaN),r=Qr(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function SR(n,t,e){for(const i of Object.keys(Dy)){const r=n[yr(n,e,i)];if(r){const{min:s,max:a,start:c,end:u,startProp:d,endProp:h}=Dy[i],g=ky(r,{min:e[s],max:e[a],start:r[c],end:r[u]});t[d]=g.start,t[h]=g.end}}}function TR({properties:n,options:t},e,i,r){const{x:s,x2:a,width:c}=n;return Ry({start:s,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:r.left,end:r.right},adjust:t.label.xAdjust,size:e.width})}function MR({properties:n,options:t},e,i,r){const{y:s,y2:a,height:c}=n;return Ry({start:s,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:r.top,end:r.bottom},adjust:t.label.yAdjust,size:e.height})}function Ry(n,t){const{start:e,end:i,borderWidth:r}=n,{position:s,padding:{start:a,end:c},adjust:u}=t,d=i-r-e-a-c-t.size;return e+r/2+u+zu(d,s)}function DR(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const r=Uu(i.position),s=we(i.padding),a=Qa(n.ctx,i),c=TR({properties:t,options:e},a,r,s),u=MR({properties:t,options:e},a,r,s),d=a.width+s.width,h=a.height+s.height;return{x:c,y:u,x2:c+d,y2:u+h,width:d,height:h,centerX:c+d/2,centerY:u+h/2,rotation:i.rotation}}const $u=["enter","leave"],Yu=$u.concat("click");function kR(n,t,e){t.listened=wy(e,Yu,t.listeners),t.moveListened=!1,$u.forEach(i=>{tn(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&tn(i.click)&&(t.listened=!0),t.moveListened||$u.forEach(r=>{tn(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function CR(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return OR(n,t,e);case"click":return AR(n,t,e)}}function OR(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=Bu(n.visibleElements,t,e.interaction):i=[];const r=n.hovered;n.hovered=i;const s={state:n,event:t};let a=Py(s,"leave",r,i);return Py(s,"enter",i,r)||a}function Py({state:n,event:t},e,i,r){let s;for(const a of i)r.indexOf(a)<0&&(s=Iy(a.options[e]||n.listeners[e],a,t)||s);return s}function AR(n,t,e){const i=n.listeners,r=Bu(n.visibleElements,t,e.interaction);let s;for(const a of r)s=Iy(a.options.click||i.click,a,t)||s;return s}function Iy(n,t,e){return Kt(n,[t.$context,e])===!0}const Ja=["afterDraw","beforeDraw"];function ER(n,t,e){const i=t.visibleElements;t.hooked=wy(e,Ja,t.hooks),t.hooked||i.forEach(r=>{t.hooked||Ja.forEach(s=>{tn(r.options[s])&&(t.hooked=!0)})})}function Ly(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return Kt(i,[t.$context])}}function RR(n,t,e){const i=FR(n.scales,t,e);let r=Ny(t,i,"min","suggestedMin");r=Ny(t,i,"max","suggestedMax")||r,r&&tn(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function PR(n,t){for(const e of n)LR(e,t)}function Ny(n,t,e,i){if(ae(t[e])&&!IR(n.options,e,i)){const r=n[e]!==t[e];return n[e]=t[e],r}}function IR(n,t,e){return Je(n[t])||Je(n[e])}function LR(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=yr(t,n,e);i&&!t[i]&&NR(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function NR(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(Je(n[e+i]))return!0;return!1}function FR(n,t,e){const i=t.axis,r=t.id,s=i+"ScaleID",a={min:Mt(t.min,Number.NEGATIVE_INFINITY),max:Mt(t.max,Number.POSITIVE_INFINITY)};for(const c of e)c.scaleID===r?Fy(c,t,["value","endValue"],a):yr(n,c,s)===r&&Fy(c,t,[i+"Min",i+"Max",i+"Value"],a);return a}function Fy(n,t,e,i){for(const r of e){const s=n[r];if(Je(s)){const a=t.parse(s);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class Jr extends He{inRange(t,e,i,r){const{x:s,y:a}=pr({x:t,y:e},this.getCenterPoint(r),xe(-this.options.rotation));return dy({x:s,y:a},this.getProps(["x","y","x2","y2"],r),i,this.options)}getCenterPoint(t){return mr(this,t)}draw(t){t.save(),Za(t,this.getCenterPoint(),this.options.rotation),Sy(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Ay(t,e)}}Jr.id="boxAnnotation",Jr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,hitTolerance:0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Jr.defaultRoutes={borderColor:"color",backgroundColor:"color"},Jr.descriptors={label:{_fallback:!0}};class tl extends He{inRange(t,e,i,r){return fy({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return mr(this,t)}draw(t){const e=this.options;!e.display||!e.content||($R(t,this),t.save(),Za(t,this.getCenterPoint(),this.rotation),Ty(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=BR(t,e);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=UR(t,e,i);let c=Qa(t.ctx,e);const u=HR(c,a);yy(e,u)&&(c={width:c.width*u,height:c.height*u});const{position:d,xAdjust:h,yAdjust:g}=e,y=my(s,c,{borderWidth:0,position:d,xAdjust:h,yAdjust:g});return{initProperties:Xr(t,y,e),...y,...r,rotation:e.rotation,_fitRatio:u}}}tl.id="doughnutLabelAnnotation",tl.defaults={autoFit:!0,autoHide:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderColor:"transparent",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:0,color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,spacing:1,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0},tl.defaultRoutes={};function BR(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const r=i.controller;return r instanceof Bs&&zR(n,t,i.data)&&(!e||r.innerRadius<e.controller.innerRadius)&&r.options.circumference>=90?i:e},void 0)}function zR(n,t,e){if(!t.autoHide)return!0;for(let i=0;i<e.length;i++)if(!e[i].hidden&&n.getDataVisibility(i))return!0}function UR({chartArea:n},t,e){const{left:i,top:r,right:s,bottom:a}=n,{innerRadius:c,offsetX:u,offsetY:d}=e.controller,h=(i+s)/2+u,g=(r+a)/2+d,y={left:Math.max(h-c,i),right:Math.min(h+c,s),top:Math.max(g-c,r),bottom:Math.min(g+c,a)},_={x:(y.left+y.right)/2,y:(y.top+y.bottom)/2},x=t.spacing+t.borderWidth/2,v=c-x,S=_.y>g,C=S?r+x:a-x,E=WR(C,h,g,v);return{controllerMeta:{_centerX:h,_centerY:g,_radius:v,_counterclockwise:S,...E},point:_,radius:Math.min(c,Math.min(y.right-y.left,y.bottom-y.top)/2)}}function HR({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function WR(n,t,e,i){const r=Math.pow(e-n,2),s=Math.pow(i,2),a=t*-2,c=Math.pow(t,2)+r-s,u=Math.pow(a,2)-4*c;if(u<=0)return{_startAngle:0,_endAngle:te};const d=(-a-Math.sqrt(u))/2,h=(-a+Math.sqrt(u))/2;return{_startAngle:sa({x:t,y:e},{x:d,y:n}).angle,_endAngle:sa({x:t,y:e},{x:h,y:n}).angle}}function $R(n,t){const{_centerX:e,_centerY:i,_radius:r,_startAngle:s,_endAngle:a,_counterclockwise:c,options:u}=t;n.save();const d=ai(n,u);n.fillStyle=u.backgroundColor,n.beginPath(),n.arc(e,i,r,s,a,c),n.closePath(),n.fill(),d&&n.stroke(),n.restore()}class go extends He{inRange(t,e,i,r){return fy({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return mr(this,t)}draw(t){const e=this.options,i=!Je(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),Za(t,this.getCenterPoint(),this.rotation),fR(t,this),Sy(t,this,e),Ty(t,YR(this),e),t.restore())}resolveElementProperties(t,e){let i;if(by(e))i=Cy(t,e);else{const{centerX:c,centerY:u}=Wu(t,e);i={x:c,y:u}}const r=we(e.padding),s=Qa(t.ctx,e),a=my(i,s,e,r);return{initProperties:Xr(t,a,e),pointX:i.x,pointY:i.y,...a,rotation:e.rotation}}}go.id="labelAnnotation",go.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},go.defaultRoutes={borderColor:"color"};function YR({x:n,y:t,width:e,height:i,options:r}){const s=r.borderWidth/2,a=we(r.padding);return{x:n+a.left+s,y:t+a.top+s,width:e-a.left-a.right-r.borderWidth,height:i-a.top-a.bottom-r.borderWidth}}const Vu=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),qu=(n,t,e)=>Vu(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,By=(n,t,e)=>Vu(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,mo=n=>n*n,VR=(n,t,{x:e,y:i,x2:r,y2:s},a)=>a==="y"?{start:Math.min(i,s),end:Math.max(i,s),value:t}:{start:Math.min(e,r),end:Math.max(e,r),value:n},zy=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,ju=(n,t,e,i)=>({x:zy(n.x,t.x,e.x,i),y:zy(n.y,t.y,e.y,i)}),Uy=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),Hy=(n,t,e,i)=>-Math.atan2(Uy(n.x,t.x,e.x,i),Uy(n.y,t.y,e.y,i))+.5*At;class yo extends He{inRange(t,e,i,r){const s=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:e},{path:c,ctx:u}=this;if(c){ai(u,this.options),u.lineWidth+=this.options.hitTolerance;const{chart:h}=this.$context,g=t*h.currentDevicePixelRatio,y=e*h.currentDevicePixelRatio,_=u.isPointInStroke(c,g,y)||Gu(this,a,r);return u.restore(),_}const d=mo(s);return KR(this,a,d,r)||Gu(this,a,r)}return qR(this,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r})}getCenterPoint(t){return mr(this,t)}draw(t){const{x:e,y:i,x2:r,y2:s,cp:a,options:c}=this;if(t.save(),!ai(t,c))return t.restore();Zr(t,c);const u=Math.sqrt(Math.pow(r-e,2)+Math.pow(s-i,2));if(c.curve&&a)return iP(t,this,a,u),t.restore();const{startOpts:d,endOpts:h,startAdjust:g,endAdjust:y}=qy(this),_=Math.atan2(s-i,r-e);t.translate(e,i),t.rotate(_),t.beginPath(),t.moveTo(0+g,0),t.lineTo(u-y,0),t.shadowColor=c.borderShadowColor,t.stroke(),Ku(t,0,g,d),Ku(t,u,-y,h),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=xR(t,e),{x:r,y:s,x2:a,y2:c}=i,u=jR(i,t.chartArea),d=u?GR({x:r,y:s},{x:a,y:c},t.chartArea):{x:r,y:s,x2:a,y2:c,width:Math.abs(a-r),height:Math.abs(c-s)};if(d.centerX=(a+r)/2,d.centerY=(c+s)/2,d.initProperties=Xr(t,d,e),e.curve){const g={x:d.x,y:d.y},y={x:d.x2,y:d.y2};d.cp=nP(d,e,Rr(g,y))}const h=XR(t,d,e.label);return h._visible=u,d.elements=[{type:"label",optionScope:"label",properties:h,initProperties:d.initProperties}],d}}yo.id="lineAnnotation";const Wy={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};yo.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Wy),fill:!1,length:12,start:Object.assign({},Wy),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance:0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},go.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},yo.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},yo.defaultRoutes={borderColor:"color"};function qR(n,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s}){const a=VR(t,e,n.getProps(["x","y","x2","y2"],s),i);return uy(a,r)||Gu(n,{mouseX:t,mouseY:e},s,i)}function jR({x:n,y:t,x2:e,y2:i},{top:r,right:s,bottom:a,left:c}){return!(n<c&&e<c||n>s&&e>s||t<r&&i<r||t>a&&i>a)}function $y({x:n,y:t},e,{top:i,right:r,bottom:s,left:a}){return n<a&&(t=By(a,{x:n,y:t},e),n=a),n>r&&(t=By(r,{x:n,y:t},e),n=r),t<i&&(n=qu(i,{x:n,y:t},e),t=i),t>s&&(n=qu(s,{x:n,y:t},e),t=s),{x:n,y:t}}function GR(n,t,e){const{x:i,y:r}=$y(n,t,e),{x:s,y:a}=$y(t,n,e);return{x:i,y:r,x2:s,y2:a,width:Math.abs(s-i),height:Math.abs(a-r)}}function KR(n,{mouseX:t,mouseY:e},i=gr,r){const{x:s,y:a,x2:c,y2:u}=n.getProps(["x","y","x2","y2"],r),d=c-s,h=u-a,g=mo(d)+mo(h),y=g===0?-1:((t-s)*d+(e-a)*h)/g;let _,x;return y<0?(_=s,x=a):y>1?(_=c,x=u):(_=s+y*d,x=a+y*h),mo(t-_)+mo(e-x)<=i}function Gu(n,{mouseX:t,mouseY:e},i,r){const s=n.label;return s.options.display&&s.inRange(t,e,r,i)}function XR(n,t,e){const i=e.borderWidth,r=we(e.padding),s=Qa(n.ctx,e),a=s.width+r.width+i,c=s.height+r.height+i;return QR(t,e,{width:a,height:c,padding:r},n.chartArea)}function ZR(n){const{x:t,y:e,x2:i,y2:r}=n,s=Math.atan2(r-e,i-t);return s>At/2?s-At:s<At/-2?s+At:s}function QR(n,t,e,i){const{width:r,height:s,padding:a}=e,{xAdjust:c,yAdjust:u}=t,d={x:n.x,y:n.y},h={x:n.x2,y:n.y2},g=t.rotation==="auto"?ZR(n):xe(t.rotation),y=JR(r,s,g),_=tP(n,t,{labelSize:y,padding:a},i),x=n.cp?ju(d,n.cp,h,_):Vu(d,h,_),v={size:y.w,min:i.left,max:i.right,padding:a.left},S={size:y.h,min:i.top,max:i.bottom,padding:a.top},C=Vy(x.x,v)+c,E=Vy(x.y,S)+u;return{x:C-r/2,y:E-s/2,x2:C+r/2,y2:E+s/2,centerX:C,centerY:E,pointX:x.x,pointY:x.y,width:r,height:s,rotation:ra(g)}}function JR(n,t,e){const i=Math.cos(e),r=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*r),h:Math.abs(n*r)+Math.abs(t*i)}}function tP(n,t,e,i){let r;const s=eP(n,i);return t.position==="start"?r=Yy({w:n.x2-n.x,h:n.y2-n.y},e,t,s):t.position==="end"?r=1-Yy({w:n.x-n.x2,h:n.y-n.y2},e,t,s):r=zu(1,t.position),r}function Yy(n,t,e,i){const{labelSize:r,padding:s}=t,a=n.w*i.dx,c=n.h*i.dy,u=a>0&&(r.w/2+s.left-i.x)/a,d=c>0&&(r.h/2+s.top-i.y)/c;return Ka(Math.max(u,d),0,.25)}function eP(n,t){const{x:e,x2:i,y:r,y2:s}=n,a=Math.min(r,s)-t.top,c=Math.min(e,i)-t.left,u=t.bottom-Math.max(r,s),d=t.right-Math.max(e,i);return{x:Math.min(c,d),y:Math.min(a,u),dx:c<=d?1:-1,dy:a<=u?1:-1}}function Vy(n,t){const{size:e,min:i,max:r,padding:s}=t,a=e/2;return e>r-i?(r+i)/2:(i>=n-s-a&&(n=i+s+a),r<=n+s+a&&(n=r-s-a),n)}function qy(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:jy(n,e),endAdjust:jy(n,i)}}function jy(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,r=n.options.borderWidth/2,s={x:e,y:i+r};return Math.abs(qu(0,s,{x:0,y:r}))}function Ku(n,t,e,i){if(!i||!i.display)return;const{length:r,width:s,fill:a,backgroundColor:c,borderColor:u}=i,d=Math.abs(t-r)+e;n.beginPath(),Zr(n,i),ai(n,i),n.moveTo(d,-s),n.lineTo(t+e,0),n.lineTo(d,s),a===!0?(n.fillStyle=c||u,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function nP(n,t,e){const{x:i,y:r,x2:s,y2:a,centerX:c,centerY:u}=n,d=Math.atan2(a-r,s-i),h=Uu(t.controlPoint,0),g={x:c+Li(e,h.x,!1),y:u+Li(e,h.y,!1)};return pr(g,{x:c,y:u},d)}function Gy(n,{x:t,y:e},{angle:i,adjust:r},s){!s||!s.display||(n.save(),n.translate(t,e),n.rotate(i),Ku(n,0,-r,s),n.restore())}function iP(n,t,e,i){const{x:r,y:s,x2:a,y2:c,options:u}=t,{startOpts:d,endOpts:h,startAdjust:g,endAdjust:y}=qy(t),_={x:r,y:s},x={x:a,y:c},v=Hy(_,e,x,0),S=Hy(_,e,x,1)-At,C=ju(_,e,x,g/i),E=ju(_,e,x,1-y/i),U=new Path2D;n.beginPath(),U.moveTo(C.x,C.y),U.quadraticCurveTo(e.x,e.y,E.x,E.y),n.shadowColor=u.borderShadowColor,n.stroke(U),t.path=U,t.ctx=n,Gy(n,C,{angle:v,adjust:g},d),Gy(n,E,{angle:S,adjust:y},h)}class _o extends He{inRange(t,e,i,r){const s=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return rP({x:t,y:e},this.getProps(["width","height","centerX","centerY"],r),s,a);const{x:c,y:u,x2:d,y2:h}=this.getProps(["x","y","x2","y2"],r),g=i==="y"?{start:u,end:h}:{start:c,end:d},y=pr({x:t,y:e},this.getCenterPoint(r),xe(-s));return y[i]>=g.start-a-gr&&y[i]<=g.end+a+gr}getCenterPoint(t){return mr(this,t)}draw(t){const{width:e,height:i,centerX:r,centerY:s,options:a}=this;t.save(),Za(t,this.getCenterPoint(),a.rotation),Zr(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const c=ai(t,a);t.ellipse(r,s,i/2,e/2,At/2,0,2*At),t.fill(),c&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Ay(t,e)}}_o.id="ellipseAnnotation",_o.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Jr.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},_o.defaultRoutes={borderColor:"color",backgroundColor:"color"},_o.descriptors={label:{_fallback:!0}};function rP(n,t,e,i){const{width:r,height:s,centerX:a,centerY:c}=t,u=r/2,d=s/2;if(u<=0||d<=0)return!1;const h=xe(e||0),g=Math.cos(h),y=Math.sin(h),_=Math.pow(g*(n.x-a)+y*(n.y-c),2),x=Math.pow(y*(n.x-a)-g*(n.y-c),2);return _/Math.pow(u+i,2)+x/Math.pow(d+i,2)<=1.0001}class el extends He{inRange(t,e,i,r){const{x:s,y:a,x2:c,y2:u,width:d}=this.getProps(["x","y","x2","y2","width"],r),h=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?QE({x:t,y:e},this.getCenterPoint(r),d/2,h):uy(i==="y"?{start:a,end:u,value:e}:{start:s,end:c,value:t},h)}getCenterPoint(t){return mr(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Zr(t,e);const r=ai(t,e);oR(t,this,this.centerX,this.centerY),r&&!Xa(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=Oy(t,e);return i.initProperties=Xr(t,i,e),i}}el.id="pointAnnotation",el.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},el.defaultRoutes={borderColor:"color",backgroundColor:"color"};class nl extends He{inRange(t,e,i,r){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&oP(this.elements,t,e,r);const s=pr({x:t,y:e},this.getCenterPoint(r),xe(-this.options.rotation)),a=this.elements.map(d=>i==="y"?d.bY:d.bX),c=Math.min(...a),u=Math.max(...a);return s[i]>=c&&s[i]<=u}getCenterPoint(t){return mr(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Zr(t,i);const r=ai(t,i);let s=!0;for(const a of e)s?(t.moveTo(a.x,a.y),s=!1):t.lineTo(a.x,a.y);t.closePath(),t.fill(),r&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=Oy(t,e),{sides:r,rotation:s}=e,a=[],c=2*At/r;let u=s*mc;for(let d=0;d<r;d++,u+=c){const h=sP(i,e,u);h.initProperties=Xr(t,i,e),a.push(h)}return i.elements=a,i}}nl.id="polygonAnnotation",nl.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},nl.defaultRoutes={borderColor:"color",backgroundColor:"color"};function sP({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:r},s){const a=(i+r)/2,c=Math.sin(s),u=Math.cos(s),d={x:n+c*e,y:t-u*e};return{type:"point",optionScope:"point",properties:{x:d.x,y:d.y,centerX:d.x,centerY:d.y,bX:n+c*(e+a),bY:t-u*(e+a)}}}function oP(n,t,e,i){let r=!1,s=n[n.length-1].getProps(["bX","bY"],i);for(const a of n){const c=a.getProps(["bX","bY"],i);c.bY>e!=s.bY>e&&t<(s.bX-c.bX)*(e-c.bY)/(s.bY-c.bY)+c.bX&&(r=!r),s=c}return r}const Ni={box:Jr,doughnutLabel:tl,ellipse:_o,label:go,line:yo,point:el,polygon:nl};Object.keys(Ni).forEach(n=>{se.describe(`elements.${Ni[n].id}`,{_fallback:"plugins.annotation.common"})});const aP={update:Object.assign},lP=Yu.concat(Ja),Ky=(n,t)=>Rt(t)?Qu(n,t):n,Xu=n=>n==="color"||n==="font";function Zu(n="line"){return Ni[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function cP(n,t,e,i){const r=dP(n,e.animations,i),s=t.annotations,a=pP(t.elements,s);for(let c=0;c<s.length;c++){const u=s[c],d=Xy(a,c,u.type),h=u.setContext(hP(n,d,a,u)),g=d.resolveElementProperties(n,h);g.skip=uP(g),"elements"in g&&(fP(d,g.elements,h,r),delete g.elements),Je(d.x)||Object.assign(d,g),Object.assign(d,g.initProperties),g.options=Zy(h),r.update(d,g)}}function uP(n){return isNaN(n.x)||isNaN(n.y)}function dP(n,t,e){return e==="reset"||e==="none"||e==="resize"?aP:new Ec(n,t)}function fP(n,t,e,i){const r=n.elements||(n.elements=[]);r.length=t.length;for(let s=0;s<t.length;s++){const a=t[s],c=a.properties,u=Xy(r,s,a.type,a.initProperties),d=e[a.optionScope].override(a);c.options=Zy(d),i.update(u,c)}}function Xy(n,t,e,i){const r=Ni[Zu(e)];let s=n[t];return(!s||!(s instanceof r))&&(s=n[t]=new r,Object.assign(s,i)),s}function Zy(n){const t=Ni[Zu(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,Qu(n,t.defaults),Qu(n,t.defaultRoutes));for(const i of lP)e[i]=n[i];return e}function Qu(n,t){const e={};for(const i of Object.keys(t)){const r=t[i],s=n[i];Xu(i)&&Yt(s)?e[i]=s.map(a=>Ky(a,r)):e[i]=Ky(s,r)}return e}function hP(n,t,e,i){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,get elements(){return e.filter(r=>r&&r.options)},id:i.id,type:"annotation"}))}function pP(n,t){const e=t.length,i=n.length;if(i<e){const r=e-i;n.splice(i,0,...new Array(r))}else i>e&&n.splice(e,i-e);return n}var gP="3.1.0";const Fi=new Map,Qy=n=>n.type!=="doughnutLabel",mP=Yu.concat(Ja);var Jy={id:"annotation",version:gP,beforeRegister(){JE("chart.js","4.0",en.version)},afterRegister(){en.register(Ni)},afterUnregister(){en.unregister(Ni)},beforeInit(n){Fi.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=Fi.get(n),r=i.annotations=[];let s=e.annotations;Rt(s)?Object.keys(s).forEach(a=>{const c=s[a];Rt(c)&&(c.id=a,r.push(c))}):Yt(s)&&r.push(...s),PR(r.filter(Qy),n.scales)},afterDataLimits(n,t){const e=Fi.get(n);RR(n,t.scale,e.annotations.filter(Qy).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=Fi.get(n);kR(n,i,e),cP(n,i,e,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),ER(n,i,e)},beforeDatasetsDraw(n,t,e){bo(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){bo(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){bo(n,t.index,e.clip)},beforeDraw(n,t,e){bo(n,"beforeDraw",e.clip)},afterDraw(n,t,e){bo(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=Fi.get(n);CR(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){Fi.delete(n)},getAnnotations(n){const t=Fi.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return Bu(n,t,e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!mP.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Ni[Zu(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:Xu,_fallback:!0},_indexable:Xu}},additionalOptionScopes:[""]};function bo(n,t,e){const{ctx:i,chartArea:r}=n,s=Fi.get(n);e&&Is(i,r);const a=yP(s.visibleElements,t).sort((c,u)=>c.element.options.z-u.element.options.z);for(const c of a)_P(i,r,s,c);e&&Ls(i)}function yP(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const r of i.elements)r.options.display&&r.options.drawTime===t&&e.push({element:r});return e}function _P(n,t,e,i){const r=i.element;i.main?(Ly(e,r,"beforeDraw"),r.draw(n,t),Ly(e,r,"afterDraw")):r.draw(n,t)}const bP={class:"zoom-timerange-container"},xP={class:"zoom-timerange-details"},wP={class:"label","data-testid":"zoom-timerange-from"},vP={class:"label","data-testid":"zoom-timerange-to"},SP=p.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(n){const t=n,{i18n:e}=Pt.useI18n(),i=p.ref(ao({tickValue:t.start,granularity:t.granularity})),r=p.ref(ao({tickValue:t.end,granularity:t.granularity})),s=(a,c)=>{Om(()=>{i.value=ao({tickValue:a,granularity:t.granularity}),r.value=ao({tickValue:c,granularity:t.granularity})},100)()};return p.watch(()=>[t.start,t.end],([a,c])=>{s(a,c)},{immediate:!0}),(a,c)=>(p.openBlock(),p.createElementBlock("div",bP,[p.createElementVNode("div",xP,[p.createElementVNode("div",wP,p.toDisplayString(p.unref(e).t("zoom_time_range.from")),1),p.createElementVNode("div",null,p.toDisplayString(i.value),1),p.createElementVNode("div",vP,p.toDisplayString(p.unref(e).t("zoom_time_range.to")),1),p.createElementVNode("div",null,p.toDisplayString(r.value),1)])]))}}),pn=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},t0=pn(SP,[["__scopeId","data-v-4fa681cf"]]),TP={class:"zoom-actions-container"},MP={class:"zoom-actions-heading"},DP={class:"zoom-action-select"},kP=["data-testid"],CP=["aria-disabled","href"],OP=["onClick"],AP=pn(p.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(n,{emit:t}){const e=n,i=t,r=s=>{s.action&&(s.action(e.newTimeRange),i("onAction"))};return(s,a)=>(p.openBlock(),p.createElementBlock("div",TP,[p.createElementVNode("div",MP,[p.createVNode(t0,{end:n.newTimeRange.end,granularity:n.granularity,start:n.newTimeRange.start},null,8,["end","granularity","start"]),p.createVNode(p.unref(Ss.CloseIcon),{class:"zoom-actions-close-icon",color:`var(--kui-color-text-neutral, ${p.unref(vu)})`,size:`var(--kui-icon-size-30, ${p.unref(so)})`,onClick:a[0]||(a[0]=c=>s.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=p.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),p.createElementVNode("div",DP,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.zoomActionItems,c=>(p.openBlock(),p.createElementBlock("div",{key:c.key,class:p.normalizeClass(["zoom-action-item",{disabled:c.disabled}]),"data-testid":`zoom-action-item-${c.key}`},[c.href?(p.openBlock(),p.createElementBlock("a",{key:0,"aria-disabled":c.disabled,class:"zoom-action-link",href:c.href,onClick:a[1]||(a[1]=u=>s.$emit("onAction"))},p.toDisplayString(c.label),9,CP)):(p.openBlock(),p.createElementBlock("div",{key:1,onClick:u=>r(c)},p.toDisplayString(c.label),9,OP))],10,kP))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),EP={key:2},RP={class:"tooltip-title"},PP={class:"title"},IP={key:0,class:"subtitle"},LP={class:"context"},NP={class:"metric"},FP={class:"tooltip"},BP={key:0},zP={class:"display-value"},il=pn(p.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0},granularity:{default:void 0}},emits:["dimensions","onAction"],setup(n,{emit:t}){const e=t,i=n,r=p.ref(null),{x:s,y:a,isDragging:c}=zE(r,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),u=p.computed(()=>`${a.value}px`),d=p.computed(()=>`${s.value}px`),h=p.computed(()=>i.state.tooltipContext),g=p.computed(()=>i.state.metricDisplay),y=p.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return p.watch(()=>[i.absoluteLeft,i.absoluteTop],([_,x])=>{c.value||(s.value=parseFloat(_),a.value=parseFloat(x))}),p.watch(c,_=>{_?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),p.watch(r,_=>{if(_){const{width:x,height:v}=_.getBoundingClientRect();e("dimensions",{width:x,height:v})}}),(_,x)=>n.state.showTooltip?(p.openBlock(),p.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:r,class:p.normalizeClass(["tooltip-container",{locked:n.state.interactionMode==="interactive"}]),style:p.normalizeStyle({transform:y.value?`translate(${d.value}, ${u.value})`:`translate(${n.absoluteLeft}, ${n.absoluteTop})`,left:"0",top:"0",pointerEvents:y.value?"all":"none"})},[n.state.interactionMode==="selecting-chart-area"&&n.granularity&&n.zoomTimeRange&&n.zoomTimeRange.end&&n.zoomTimeRange.start?(p.openBlock(),p.createBlock(t0,{key:0,end:n.zoomTimeRange?.end,granularity:n.granularity,start:n.zoomTimeRange?.start},null,8,["end","granularity","start"])):n.state.interactionMode==="zoom-interactive"&&n.zoomTimeRange&&n.zoomActionItems&&n.granularity?(p.openBlock(),p.createBlock(AP,{key:1,granularity:n.granularity,"new-time-range":n.zoomTimeRange,"zoom-action-items":n.zoomActionItems,onOnAction:x[0]||(x[0]=v=>e("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(p.openBlock(),p.createElementBlock("div",EP,[p.createElementVNode("div",RP,[p.createElementVNode("div",PP,[p.createElementVNode("div",null,p.toDisplayString(n.tooltipTitle),1),y.value?(p.openBlock(),p.createBlock(p.unref(Ss.DragIcon),{key:0,class:"drag-icon",color:`var(--kui-color-text-neutral, ${p.unref(vu)})`,size:`var(--kui-icon-size-30, ${p.unref(so)})`},null,8,["color","size"])):p.createCommentVNode("",!0)]),h.value||g.value?(p.openBlock(),p.createElementBlock("div",IP,[p.createElementVNode("div",LP,p.toDisplayString(h.value),1),p.createElementVNode("div",NP,p.toDisplayString(g.value),1)])):p.createCommentVNode("",!0)]),p.createElementVNode("ul",FP,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.state.tooltipSeries,({backgroundColor:v,borderColor:S,label:C,value:E,isSegmentEmpty:U},P)=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:C+P},[n.state.tooltipSeries.length?(p.openBlock(),p.createElementBlock("li",BP,[p.createElementVNode("div",{class:"square-marker",style:p.normalizeStyle({background:String(v),borderColor:String(S)})},null,4),p.createElementVNode("span",{class:p.normalizeClass(["display-label",{empty:U}])},p.toDisplayString(C),3),p.createElementVNode("span",zP,p.toDisplayString(E),1)])):p.createCommentVNode("",!0)],64))),128))])]))],6)):p.createCommentVNode("",!0)}}),[["__scopeId","data-v-34c60646"]]),UP={key:0,class:"legend-container","data-testid":"legend"},HP=["onClick"],WP=["title"],$P={class:"label truncate-label"},YP={key:0,class:"sub-label"},VP={class:"tooltip-content"},Ju=pn(p.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){const t=n,{i18n:e}=Pt.useI18n(),i=p.inject("showLegendValues",!1),r=p.inject("legendPosition",p.ref(sn.Bottom)),s=(c=0,u)=>{if(t.chartInstance===null)return;const d=t.chartInstance instanceof en?t.chartInstance:t.chartInstance.chart;a(c,u)?d.hide(c,u):d.show(c,u),d.update()},a=(c=0,u)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const d=t.chartInstance instanceof en?t.chartInstance:t.chartInstance.chart;return d.getDatasetMeta(c).dataset||u===void 0?d.isDatasetVisible(c):d.getDataVisibility(u)};return(c,u)=>{const d=p.resolveComponent("KTooltip");return p.unref(r)!==p.unref(sn).Hidden?(p.openBlock(),p.createElementBlock("ul",UP,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.items,({fillStyle:h,strokeStyle:g,text:y,datasetIndex:_,index:x,value:v,isSegmentEmpty:S})=>(p.openBlock(),p.createElementBlock("li",{key:y,onClick:C=>s(_,x)},[p.createElementVNode("div",{class:"square-marker",style:p.normalizeStyle({background:h,"border-color":g})},null,4),p.createVNode(d,null,p.createSlots({default:p.withCtx(()=>[p.createElementVNode("div",{class:p.normalizeClass(["label-container",{"strike-through":!a(_,x)}]),title:v&&p.unref(i)?`${y}: ${v.formatted}`:y},[p.createElementVNode("div",$P,p.toDisplayString(y),1),v&&p.unref(i)?(p.openBlock(),p.createElementBlock("div",YP,p.toDisplayString(v.formatted),1)):p.createCommentVNode("",!0)],10,WP)]),_:2},[S?{name:"content",fn:p.withCtx(()=>[p.createElementVNode("div",VP,p.toDisplayString(p.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,HP))),128))])):p.createCommentVNode("",!0)}}}),[["__scopeId","data-v-e6664c85"]]),Pe=[];for(let n=0;n<256;++n)Pe.push((n+256).toString(16).slice(1));function qP(n,t=0){return(Pe[n[t+0]]+Pe[n[t+1]]+Pe[n[t+2]]+Pe[n[t+3]]+"-"+Pe[n[t+4]]+Pe[n[t+5]]+"-"+Pe[n[t+6]]+Pe[n[t+7]]+"-"+Pe[n[t+8]]+Pe[n[t+9]]+"-"+Pe[n[t+10]]+Pe[n[t+11]]+Pe[n[t+12]]+Pe[n[t+13]]+Pe[n[t+14]]+Pe[n[t+15]]).toLowerCase()}const jP=new Uint8Array(16);function GP(){return crypto.getRandomValues(jP)}function td(n,t,e){return crypto.randomUUID?crypto.randomUUID():KP(n)}function KP(n,t,e){n=n||{};const i=n.random??n.rng?.()??GP();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,qP(i)}const e0=(n,t)=>{const e=n.ctx,i=n.scales.y,r=n.scales.x,s=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(s.x-s.width/2,s.y,s.width,i.bottom-s.y):e.strokeRect(r.left,s.y-s.height/2,s.x-r.left,s.height),e.restore()};class n0{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&e0(t,this._clickedElements)}afterEvent(t,{event:e}){if(e.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(e.type!=="click"||!e.native||this._pause)return;this._clicked=!this._clicked;const i=t.options.interaction?.mode||"index",r=t.getElementsAtEventForMode(e.native,i,{intersect:!1},!0);r.length&&this._clicked?(this._clickedElements=r,e0(t,this._clickedElements),this._previousHoverOption=t.options.hover,t.options.hover={mode:null}):(delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1)}beforeDestroy(t){delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1}pause(){this._pause=!0}get isPaused(){return this._pause}resume(t=!1){this._pause=!1,t&&(this._suppressNextClick=!0)}}const XP=["id"],ZP=["id"],QP={class:"axis-tooltip-content"},JP="100%",t2="100%",e2=20,n2=20,i0=6,i2=0,r2=10,s2=10,o2=1,a2=pn(p.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{i18n:e}=Pt.useI18n(),{translateUnit:i}=Pt.useTranslatedUnits(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=new n0,c=p.useTemplateRef("chartContainer"),u=p.useTemplateRef("chartParent"),d=({chart:it},ft)=>{const ut=it.data,dt=ut.labels?.indexOf(ft);return ut.datasets.reduce((gt,lt,It)=>{if(it.isDatasetVisible(It)){const Bt=lt.data[dt];return isNaN(Bt)?gt:gt+Bt}else return gt},0)},h=(it,ft,ut,dt)=>{const gt=dt==="horizontal";ft===null&&(ft=e.t("entityNoName"));const lt={type:"label",yValue:wt=>gt?ft:d(wt,ft),xValue:wt=>gt?d(wt,ft):ft},It={...lt,position:gt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>gt?0:-Math.abs(TA()),content:wt=>Nm(d(wt,ft),ut)},Bt={...lt,content:wt=>DA(d(wt,ft),MA(wt.chart,it)),position:gt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:wt=>gt?SA(Nm(d(wt,ft),ut)):0,color:mA};return{[`${ft}-value`]:It,[`${ft}-percent`]:Bt}},g=p.useTemplateRef("canvas"),y=p.useTemplateRef("axis"),_=td(),x=td(),v=p.ref([]),S=p.inject("legendPosition",sn.Bottom),C=p.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),E=p.toRef(t,"metricUnit"),U=p.computed(()=>t.orientation==="horizontal"),P=p.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:p.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:p.toRef(t,"dimensionAxesTitle"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:U.value?"horizontal_bar":"vertical_bar",chartID:s,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:I,tooltipAbsoluteTop:B}=Pt.useTooltipAbsolutePosition(u,P),N=p.ref(0),T=()=>t.annotations&&t.chartData.labels?.reduce((it,ft)=>Object.assign(it,h(t.chartData,ft,E.value,t.orientation)),{}),D={id:_,afterUpdate(it){N.value+=1,v.value=Am(it,t.legendValues,t.chartLegendSortFn)}},O={id:x,afterUpdate(it){it.options.plugins.annotation.annotations=t.annotations?T():{}}},W=[D,{id:"axisHover",afterEvent(it,ft){if(C.show=!1,ft.event.type==="mousemove"){const ut=ft.event,dt=it.options.indexAxis,gt=it.scales,lt=it.scales[dt].getLabelForValue(Number(it.scales[dt].getValueForPixel(ut[dt]))),Bt=it.scales[dt].getLabels().indexOf(lt),wt=t.chartData.isLabelEmpty?.[Bt];if((Dt=>Dt==="x"?ut.y>gt.x.top:ut.x<gt.y.right)(dt)){P.interactionMode!=="interactive"&&(P.showTooltip=!1);const ve=it.canvas.getContext("2d").measureText(lt).width,bt=Math.abs(Math.round(ut.x-ve*.5)),Vt=Math.round(ut.x+ve*.5),Se=it.canvas.getBoundingClientRect(),Ae=40;C.left=dt==="x"?`${(bt>0?bt:Vt)-C.offset+Se.left}px`:`${ut.x-ve*.5-C.offset+Se.left}px`,C.top=`${ut.y-Ae+Se.top}px`,lt.length>$a?(C.show=!0,C.text=lt):wt?(C.text=e.t("emptyEntityInfo"),C.show=!0):C.show=!1}else C.show=!1}}},a,...t.annotations?[O]:[]],tt=p.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),G=p.ref(0),nt=p.ref(0),X=new ResizeObserver(Om(it=>{G.value=it[0].contentRect.width,nt.value=it[0].contentRect.height},100)),Q=p.computed(()=>{const it=t.chartData?.labels?.length;return g.value&&it&&!U.value?`${Math.max(it*(e2+i0),G.value)}px`:JP}),rt=p.computed(()=>{const it=t.chartData?.labels?.length;return g.value&&it&&U.value?`${Math.max(it*(n2+i0),nt.value)}px`:t2});Pt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey")),p.onMounted(()=>{t.annotations&&en.register(Jy),c.value&&(G.value=c.value.offsetWidth,nt.value=c.value.offsetHeight,X.observe(c.value))}),p.onUnmounted(()=>{c.value&&X.unobserve(c.value)});const st=p.computed(()=>{const it=Pt.useBarChartOptions({tooltipState:P,legendID:_,stacked:p.toRef(t,"stacked"),metricAxesTitle:p.toRef(t,"metricAxesTitle"),dimensionAxesTitle:p.toRef(t,"dimensionAxesTitle"),indexAxis:U.value?"y":"x",numLabels:tt});return{...it.value,plugins:{...it.value.plugins,annotation:{annotations:T(),clip:!1}}}}),ot=Pt.useChartJSCommon("bar",g,p.toRef(t,"chartData"),W,st);p.onBeforeUnmount(()=>{en.unregister(Jy)});const H={[sn.Bottom]:"column"},V=p.computed(()=>{if(y.value&&ot.value){const it=window.devicePixelRatio,ft=ot.value,ut=ft.scales.y.width*it+o2,dt=(ft.scales.y.height+ft.scales.y.top+ft.scales.x.height)*it,gt=y.value.getContext("2d");return gt.scale(it,it),gt.canvas.width=ut,gt.canvas.height=dt,gt.canvas.style.width=`${ut/it}px`,gt.canvas.style.height=`${dt/it}px`,{scale:it,width:ut*it,height:dt*it,targetCtx:gt}}return null}),J=it=>{const ft=it.target;if(V.value&&ot.value&&!U.value){const ut=V.value.scale,dt=V.value.targetCtx,gt=V.value.width,lt=V.value.height,It=ot.value,Bt=It.canvas;dt.fillStyle="white",ft.scrollLeft>=i2&&ft.scrollLeft<=r2?(dt.globalCompositeOperation="source-over",dt.clearRect(0,0,gt,lt),dt.drawImage(Bt,0,0,gt,lt,0,0,gt,lt),dt.globalCompositeOperation="destination-over",dt.fillRect(0,0,gt,lt)):(dt.globalCompositeOperation="source-over",dt.fillRect(0,(It.scales.y.height+It.scales.y.top+s2)*ut,gt,It.scales.x.height*ut))}P.offsetY=ft.scrollTop,P.offsetX=ft.scrollLeft,C.offset=ft.scrollLeft},_t=({width:it,height:ft})=>{P.width=it,P.height=ft};p.watch(()=>t.orientation,()=>{if(y.value&&V.value){const it=V.value.width,ft=V.value.height;(y.value?.getContext("2d")).clearRect(0,0,it,ft)}P.showTooltip=!1,P.interactionMode="idle"}),p.watch(()=>t.annotations,it=>{ot.value&&(it?ot.value.options.plugins.annotation.annotations=T(t.chartData):delete ot.value.options.plugins.annotation.annotations)});const pt=()=>{P.showTooltip&&(P.interactionMode!=="idle"?P.interactionMode="idle":P.interactionMode="interactive")};return(it,ft)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",H[p.unref(S)]])},[p.createElementVNode("canvas",{id:p.unref(r),ref:"axis",class:"axis"},null,8,XP),p.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:ft[0]||(ft[0]=ut=>pt()),onScroll:J},[p.createElementVNode("div",{class:"chart-body",style:p.normalizeStyle({width:Q.value,height:rt.value})},[p.createElementVNode("canvas",{id:p.unref(s),ref:"canvas",class:"chart-canvas"},null,8,ZP)],4)],544),(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[C.show?(p.openBlock(),p.createElementBlock("div",{key:0,class:"axis-tooltip",style:p.normalizeStyle({top:C.top,left:C.left}),width:"auto"},[p.createElementVNode("div",QP,p.toDisplayString(C.text),1)],4)):p.createCommentVNode("",!0),p.createVNode(il,{"absolute-left":p.unref(I),"absolute-top":p.unref(B),"chart-parent-ref":u.value,state:P,"tooltip-title":n.tooltipTitle,onDimensions:_t},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),p.createVNode(Ju,{id:p.unref(_),"chart-instance":p.unref(ot),items:v.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-60e5a1a7"]]);const l2={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};Zh._date.override({_id:"date-fns",formats:function(){return l2},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=Ot(n):e==="string"&&(typeof t=="string"?n=tD(n,t,new Date,this.options):n=Lg(n,this.options)),nu(n)?n.getTime():null},format:function(n,t){return Aa(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return tu(n,t);case"second":return KS(n,t);case"minute":return jS(n,t);case"hour":return YS(n,t);case"day":return Ca(n,t);case"week":return XS(n,t);case"month":return Jc(n,t);case"quarter":return GS(n,t);case"year":return ZS(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return iu(n,t);case"second":return sT(n,t);case"minute":return nT(n,t);case"hour":return eT(n,t);case"day":return pg(n,t);case"week":return oT(n,t);case"month":return _g(n,t);case"quarter":return rT(n,t);case"year":return aT(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return rD(n);case"minute":return iD(n);case"hour":return nD(n);case"day":return eu(n);case"week":return Vn(n);case"isoWeek":return Vn(n,{weekStartsOn:+e});case"month":return cT(n);case"quarter":return lT(n);case"year":return bg(n);default:return n}},endOf:function(n,t){switch(t){case"second":return gT(n);case"minute":return hT(n);case"hour":return dT(n);case"day":return mg(n);case"week":return fT(n);case"month":return yg(n);case"quarter":return pT(n);case"year":return uT(n);default:return n}}});const r0={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},c2={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...r0,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},u2=p.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function ts(n){return p.isProxy(n)?p.toRaw(n):n}function d2(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return p.isProxy(t)?new Proxy(n,{}):n}function f2(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function s0(n,t){n.labels=t}function o0(n,t,e){const i=[];n.datasets=t.map(r=>{const s=n.datasets.find(a=>a[e]===r[e]);return!s||!r.data||i.includes(s)?{...r}:(i.push(s),Object.assign(s,r),s)})}function h2(n,t){const e={labels:[],datasets:[]};return s0(e,n.labels),o0(e,n.datasets,t),e}const p2=p.defineComponent({props:c2,setup(n,t){let{expose:e,slots:i}=t;const r=p.ref(null),s=p.shallowRef(null);e({chart:s});const a=()=>{if(!r.value)return;const{type:d,data:h,options:g,plugins:y,datasetIdKey:_}=n,x=h2(h,_),v=d2(x,h);s.value=new en(r.value,{type:d,data:v,options:{...g},plugins:y})},c=()=>{const d=p.toRaw(s.value);d&&(n.destroyDelay>0?setTimeout(()=>{d.destroy(),s.value=null},n.destroyDelay):(d.destroy(),s.value=null))},u=d=>{d.update(n.updateMode)};return p.onMounted(a),p.onUnmounted(c),p.watch([()=>n.options,()=>n.data],(d,h)=>{let[g,y]=d,[_,x]=h;const v=p.toRaw(s.value);if(!v)return;let S=!1;if(g){const C=ts(g),E=ts(_);C&&C!==E&&(f2(v,C),S=!0)}if(y){const C=ts(y.labels),E=ts(x.labels),U=ts(y.datasets),P=ts(x.datasets);C!==E&&(s0(v.config.data,C),S=!0),U&&U!==P&&(o0(v.config.data,U,n.datasetIdKey),S=!0)}S&&p.nextTick(()=>{u(v)})},{deep:!0}),()=>p.h("canvas",{role:"img","aria-label":n.ariaLabel,"aria-describedby":n.ariaDescribedby,ref:r},[p.h("p",{},[i.default?i.default():""])])}});function ed(n,t){return en.register(t),p.defineComponent({props:r0,setup(e,i){let{expose:r}=i;const s=p.shallowRef(null),a=c=>{s.value=c?.chart};return r({chart:s}),()=>p.h(p2,u2({ref:a},{type:n,...e}))}})}const a0=ed("bar",Gh),l0=ed("doughnut",Bs),c0=ed("line",Kh),g2={class:"chart-container"},m2={key:0,class:"chart-center-metric"},y2={class:"chart-center-total"},_2={key:0,class:"chart-center-unit"},b2=p.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},metricName:{default:""},legendPosition:{default:sn.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>Pi},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""},showCenterMetric:{type:Boolean,default:!0}},setup(n){const t=n,{translateUnit:e}=Pt.useTranslatedUnits(),{i18n:i}=Pt.useI18n(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=p.ref([]),c=p.useTemplateRef("chartParent"),u=p.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:p.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:p.toRef(t,"tooltipDimensionDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:d,tooltipAbsoluteTop:h}=Pt.useTooltipAbsolutePosition(c,u),g={id:r,afterUpdate(N){a.value=N.options.plugins.legend.labels.generateLabels(N).map(T=>({...T,value:t.legendValues&&t.legendValues[T.text],hidden:!1}))}},y=p.computed(()=>[g]),_=p.computed(()=>[t.chartData.datasets.reduce((T,D)=>(T.labels.push(D.label),T.backgroundColor.push(D.backgroundColor),T.hoverBorderColor.push(xc(D.backgroundColor).saturate(.5).darken(.15).hexString()),T.data.push(D.data.reduce((O,L)=>O+L,0)),T),{labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:x}=fr({i18n:i}),v=p.computed(()=>uE(t.metricName??"")),S=p.computed(()=>{const N=_.value[0]?.data.reduce((T,D)=>T+D,0)??0;return x(N,t.metricUnit,{approximate:!0,translateUnit:(T,D)=>e(T,D)}).trim()}),C=p.computed(()=>t.tooltipMetricDisplay||""),E=p.computed(()=>({...t.chartData,datasets:_.value}));Pt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey"));const{options:U}=Pt.useDonutChartOptions({tooltipState:u,legendID:r}),P=p.ref(),I=N=>({[sn.Bottom]:"column",[sn.Hidden]:"hidden"})[N],B=({width:N,height:T})=>{u.width=N,u.height=T};return(N,T)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",I(n.legendPosition)]),"data-testid":"donut-chart-parent"},[p.createElementVNode("div",g2,[p.createVNode(p.unref(l0),{ref_key:"chartInstance",ref:P,"chart-id":p.unref(s),data:E.value,options:p.unref(U),plugins:y.value},null,8,["chart-id","data","options","plugins"]),n.showCenterMetric&&v.value?(p.openBlock(),p.createElementBlock("div",m2,[p.createElementVNode("span",y2,p.toDisplayString(S.value),1),C.value?(p.openBlock(),p.createElementBlock("span",_2,p.toDisplayString(C.value),1)):p.createCommentVNode("",!0)])):p.createCommentVNode("",!0),(p.openBlock(),p.createBlock(p.Teleport,{to:"body"},[p.createVNode(il,{"absolute-left":p.unref(d),"absolute-top":p.unref(h),state:u,"tooltip-title":n.tooltipTitle,unit:n.metricUnit,onDimensions:B},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),p.createVNode(Ju,{id:p.unref(r),"chart-instance":P.value,items:a.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),x2=pn(b2,[["__scopeId","data-v-48b16272"]]),nd=(n,t,e,i,r="#0275d8")=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle=r,n.stroke(),n.restore()},Ke={},w2=()=>{Ke.x=void 0,Ke.chart=void 0,Ke.strategy=void 0,Ke.group=void 0},v2=10;class u0{id="verticalLinePlugin";_clickedSegment;_pause=!1;_useBrushingState=!1;_brushStrategy;_brushGroup;constructor({brushGroup:t=void 0,brushStrategy:e=void 0,enableBrushing:i=!1}={}){let r=!1;e==="group"&&(r=t!==void 0),this._useBrushingState=i&&r,this._brushStrategy=e,this._brushGroup=t}afterEvent(t,e){if(!this._useBrushingState)return;const{event:i}=e;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(r=>this.onMouseBrush(i.type,t,r))}_lastMouseBrushEvent=0;onMouseBrush(t,e,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<v2)return;const r=()=>{Ke.chart=e,Ke.strategy=this._brushStrategy,Ke.group=this._brushGroup;for(const s of Object.values(en.instances))s!==e&&s.update("none")};t==="mousemove"?e.tooltip&&e.tooltip.getActiveElements()&&e.tooltip.getActiveElements().length&&(Ke.x=e.tooltip.dataPoints[0].element.x,r()):t==="mouseout"&&(Ke.x=void 0,r()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const e=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:r}=this._clickedSegment.element;nd(i,r,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(e){const{x:r}=t.tooltip.dataPoints[0].element;nd(i,r,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(Ke.x===void 0)return;const e=Ke.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&Ke.group===this._brushGroup&&nd(t.ctx,Ke.x,t.scales.y.top,t.scales.y.bottom,e)}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(t){if(this._clickedSegment&&this.destroyClickedSegment(),this._useBrushingState&&Ke.chart===t){const e=Ke.x!==void 0;if(w2(),e)for(const i of Object.values(en.instances))i!==t&&i.update("none")}}}const S2=(n,t,e)=>{const i=n.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,n.chartArea.top),i.lineTo(t,n.chartArea.bottom),i.moveTo(e,n.chartArea.top),i.lineTo(e,n.chartArea.bottom),i.stroke(),i.restore()},T2=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},d0=(n,t,e)=>{const i=t.scales.x.getValueForPixel(e.startX),r=t.scales.x.getValueForPixel(e.endX);i&&r&&t.canvas.dispatchEvent(new CustomEvent(n,{detail:{xStart:Math.min(i,r),xEnd:Math.max(i,r)}}))};class M2{id="dragSelectPlugin";_isDragging=!1;_startX=0;_endX=0;_dragTimeout;_clearSelectionArea=!0;_chart=null;_dragSelectHandlers;get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const e=t.canvas;let i=!1;const r=c=>{this._dragTimeout=window.setTimeout(()=>{const u=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=c.clientX-u.left},150)},s=c=>{const u=e.getBoundingClientRect();i&&this._isDragging&&(this._endX=c.clientX-u.left,d0("dragSelectMove",t,this))},a=c=>{const u=e.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=c.clientX-u.left,d0("dragSelect",t,this),i=!1,this._isDragging=!1)};e.addEventListener("mousedown",r),e.addEventListener("mousemove",s),e.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:r,onMouseMove:s,onMouseUp:a}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:r,onMouseUp:s}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",r),e.removeEventListener("mouseup",s)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(T2(t,this._startX,this._endX),S2(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const D2=["hidden","single","full"];var _r=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(_r||{});const k2=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],C2=["gauge","top_n","single_value"],O2=20,A2="rgba(255, 171, 171, 0.4)",E2="rgba(255, 196, 0, 0.2)",f0=(n,t,e)=>{const i=t.y-n.y;if(i===0)return t.x;const r=(e-n.y)/i;return n.x+r*(t.x-n.x)},R2=(n,t)=>{const e=[];return n.data.datasets.forEach(i=>{if(!n.getDatasetMeta(n.data.datasets.indexOf(i)).visible)return;const s=i.data;s?.length&&t.filter(a=>a.highlightIntersections).forEach(a=>{const c=s.map(d=>({ts:d.x,aboveThreshold:d.y>=a.value}));let u=c[0].aboveThreshold?s[0].x:void 0;for(let d=1;d<c.length;d++)!c[d-1].aboveThreshold&&c[d].aboveThreshold?u=f0(s[d-1],s[d],a.value):c[d-1].aboveThreshold&&!c[d].aboveThreshold&&u!==void 0&&(e.push({start:u,end:f0(s[d-1],s[d],a.value),type:a.type}),u=void 0);u!==void 0&&e.push({start:u,end:c[c.length-1].ts,type:a.type})})}),e},P2=n=>{if(!n.length)return[];n.sort((e,i)=>e.type.localeCompare(i.type)||e.start-i.start);const t=[];for(const e of n){const i=t.findLast(({type:r})=>r===e.type);i&&e.start<=i.end?i.end=Math.max(i.end,e.end):t.push({...e})}return t};class I2{constructor(t){this.i18n=t}i18n;id="thresholdPlugin";_thresholds;_mouseMoveHandler;_syncThresholds(t){for(const e of Object.keys(t.threshold||{})){const i=t.threshold?.[e];i&&(this._thresholds={...this._thresholds,[e]:i.map(r=>({...r,hovered:!1}))})}if(this._thresholds)for(const e of Object.keys(this._thresholds))t.threshold?.[e]||delete this._thresholds[e]}get thresholds(){return this._thresholds}beforeUpdate(t,e,i){this._syncThresholds(i)}beforeInit(t,e,i){const r=t.canvas;this._syncThresholds(i);const s=a=>{if(t){const c=a.clientY,u=t.scales.y,d=r.getBoundingClientRect(),h=u.getValueForPixel(c-d.top);if(h)for(const g of Object.keys(this._thresholds||{})){const y=this._thresholds?.[g];y&&y.forEach(_=>{_.hovered=Math.abs(_.value-h)<O2})}}};r.addEventListener("mousemove",s),this._mouseMoveHandler=s}afterDatasetsDraw(t,e){const i=t.ctx;for(const r of Object.keys(this._thresholds||{})){const s=this._thresholds?.[r];if(s){s.forEach(u=>{const h=t.scales.y.getPixelForValue(u.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,h),i.lineTo(t.chartArea.right,h),i.lineWidth=1,i.strokeStyle=Tu(u.type),i.setLineDash([5,5]),i.stroke(),i.restore();let g="";u.label?g=`${u.label}: ${u.value}`:u.type==="warning"?g=this.i18n.t("chartLabels.threshold-warning",{value:u.value}):u.type==="error"?g=this.i18n.t("chartLabels.threshold-error",{value:u.value}):g=this.i18n.t("chartLabels.thatreshold-neutral",{value:u.value}),u.hovered&&(i.save(),i.fillStyle=Tu(u.type),i.font=XC,i.fillText(g,t.chartArea.left,h-4),i.restore())});const a=R2(t,s);P2(a).forEach(u=>{const d=t.scales.x.getPixelForValue(u.start),h=t.scales.x.getPixelForValue(u.end);i.save(),i.fillStyle=u.type==="error"?A2:E2,i.fillRect(d,t.chartArea.top,h-d,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(d,t.chartArea.bottom),i.lineTo(h,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=Tu(u.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const L2=pn(p.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=n,i=t,{i18n:r}=Pt.useI18n(),s=new u0,a=new n0,c=new M2,u=new I2(r),{translateUnit:d}=Pt.useTranslatedUnits(),h=p.ref(),g=crypto.randomUUID(),y=crypto.randomUUID(),_=p.ref([]),x=p.inject("legendPosition",sn.Bottom),v=p.useTemplateRef("chartParent"),S=p.ref(void 0),C=p.ref(!1),E=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:p.toRef(e,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:p.toRef(e,"metricUnit"),translateUnit:d,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:y,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:U,tooltipAbsoluteTop:P}=Pt.useTooltipAbsolutePosition(v,E),I={id:g,afterUpdate(ot){_.value=Am(ot,e.legendValues,e.chartLegendSortFn)}},B=p.computed(()=>[I,a,...e.brush?[c]:[],...e.type==="timeseries_line"?[s]:[],...e.threshold?[u]:[]]),N=p.computed(()=>`line-${B.value.map(ot=>ot.id).join("-")}`),T=p.computed(()=>`bar-${B.value.map(ot=>ot.id).join("-")}`),D=p.computed(()=>e.chartData&&BC(e.chartData)),{options:O}=Pt.useLineChartOptions({tooltipState:E,timeRangeMs:p.toRef(e,"timeRangeMs"),granularity:p.toRef(e,"granularity"),legendID:g,stacked:p.toRef(e,"stacked"),metricAxesTitle:p.toRef(e,"metricAxesTitle"),dimensionAxesTitle:p.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:D,threshold:p.toRef(e,"threshold")});Pt.useReportChartDataForSynthetics(p.toRef(e,"chartData"),p.toRef(e,"syntheticsDataKey"));const L=ot=>({[sn.Bottom]:"column",[sn.Hidden]:"hidden"})[ot],W=({width:ot,height:H})=>{E.width=ot,E.height=H},tt=(ot=!0)=>{E.interactionMode="idle",E.showTooltip=!1,c.clearSelectionArea(),a.isPaused&&a.resume(ot),s.isPaused&&s.resume()},G=()=>{E.interactionMode="interactive"},nt=()=>{!h.value||!h.value.chart.tooltip?.dataPoints?.length||(E.interactionMode==="interactive"?s.clickedSegment=h.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},X=()=>{if(C.value){C.value=!1;return}E.interactionMode!=="idle"?tt():G(),nt()};p.watch(()=>e.type,()=>{E.interactionMode="idle",E.showTooltip=!1,s.destroyClickedSegment()});const Q=ot=>{ot.preventDefault(),ot.stopPropagation();const{xStart:H,xEnd:V}=ot.detail;H&&V&&(S.value={start:new Date(H),end:new Date(V),type:"absolute"},E.interactionMode="zoom-interactive",i("select-chart-range",S.value))},rt=ot=>{E.interactionMode="selecting-chart-area",C.value=!0,s.pause(),a.pause();const{xStart:H,xEnd:V}=ot.detail;H&&V&&(S.value={start:new Date(H),end:new Date(V),type:"absolute"})},st=ot=>{if(!v.value||E.interactionMode==="idle")return;const H=ot.target;H&&v.value.contains(H)||C.value||tt(!1)};return p.watch(()=>h.value?.chart,()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",Q),h.value.chart.canvas.removeEventListener("dragSelectMove",rt),h.value.chart.canvas.addEventListener("dragSelect",Q),h.value.chart.canvas.addEventListener("dragSelectMove",rt))}),p.onMounted(()=>{document.addEventListener("click",st,!0)}),p.onUnmounted(()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",Q),h.value.chart.canvas.removeEventListener("dragSelectMove",rt)),document.removeEventListener("click",st,!0)}),(ot,H)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",L(p.unref(x))]),"data-testid":"line-chart-parent"},[p.createElementVNode("div",{class:"chart-container",onClick:H[0]||(H[0]=V=>X())},[n.type==="timeseries_line"?(p.openBlock(),p.createBlock(p.unref(c0),{key:N.value,ref_key:"chartInstance",ref:h,"chart-id":p.unref(y),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-line-chart",options:p.unref(O),plugins:B.value},null,8,["chart-id","data","options","plugins"])):n.type==="timeseries_bar"?(p.openBlock(),p.createBlock(p.unref(a0),{key:T.value,ref_key:"chartInstance",ref:h,"chart-id":p.unref(y),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-bar-chart",options:p.unref(O),plugins:B.value},null,8,["chart-id","data","options","plugins"])):p.createCommentVNode("",!0)]),p.createVNode(il,{"absolute-left":p.unref(U),"absolute-top":p.unref(P),"data-testid":"tooltip",granularity:n.granularity,state:E,"tooltip-title":n.tooltipTitle,"zoom-action-items":n.zoomActionItems,"zoom-time-range":S.value,onDimensions:W,onOnAction:H[1]||(H[1]=()=>tt(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),p.createVNode(Ju,{id:p.unref(g),"chart-instance":h.value,"data-testid":"legend",items:_.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-ac6e8bbc"]]),N2={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},F2={class:"tooltip-content"},B2={key:2,class:"analytics-chart-parent"},z2=p.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:sn.Bottom},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!1},showAnnotations:{type:Boolean,default:!0},timeseriesZoom:{type:Boolean,default:!1},requestsLink:{default:void 0},exploreLink:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=t,i=n,{i18n:r}=Pt.useI18n(),s=p.computed(()=>S.value?Pt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Du},p.toRef(i,"chartData")).value:Pt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Du},p.toRef(i,"chartData")).value),a=p.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),c=p.computed(()=>{if(!i.chartData?.meta)return 0;if(i.chartData.meta.start&&i.chartData.meta.end){const G=new Date(i.chartData.meta.start).getTime();return new Date(i.chartData.meta.end).getTime()-G}}),u=p.computed(()=>i.chartData.meta?.metric_units?Object.values(i.chartData.meta.metric_units)[0]:""),d=p.computed(()=>i.chartData.meta?.metric_units?Object.keys(i.chartData.meta.metric_units)[0]??"":""),h=p.computed(()=>i.showLegendValues&&i.legendPosition!==sn.Hidden),{legendValues:g}=Pt.useChartLegendValues(s,i.chartOptions.type,u),y=p.computed(()=>i.chartData?.meta?.limit?.toString()||null),_=p.computed(()=>i.chartOptions.hideTruncationWarning?!1:i.chartData?.meta?.truncated||!1),x=p.computed(()=>r.t("limitedResultsShown",{maxReturned:y.value})),v=p.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),S=p.computed(()=>["timeseries_bar","timeseries_line"].some(G=>G===i.chartOptions.type)),C=p.computed(()=>i.chartOptions.type==="donut"),E=p.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),U=p.computed(()=>{if(!i.chartData?.meta.metric_names||!i.chartData?.meta.metric_units)return;const G=i.chartData.meta.metric_names[0],nt=i.chartData.meta.metric_units[G]||"";if(i.chartData.meta.metric_names.length>1){if(G.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${nt}`,{plural:"s"})});if(G.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${nt}`,{plural:"s"})})}if(G)return lo(nt)&&r.te(`metricAxisTitles.${G}`)?r.t(`metricAxisTitles.${G}`)||void 0:r.te(`chartLabels.${G}`)?r.t(`chartLabels.${G}`):G}),P=p.computed(()=>{if(i.chartOptions?.metricAxesTitle)return i.chartOptions?.metricAxesTitle;if(!i.chartData?.meta.metric_names||!i.chartData?.meta.metric_units)return;const G=i.chartData.meta.metric_names[0],nt=i.chartData.meta.metric_units[G]||"";if(i.chartData.meta.metric_names.length>1){if(G.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${nt}`,{plural:"s"})});if(G.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${nt}`,{plural:"s"})})}return r.te(`metricAxisTitles.${G}`)&&(lo(nt)||r.te(`chartUnits.${nt}`))?lo(nt)?r.t(`metricAxisTitles.${G}`)||void 0:r.t(`metricAxisTitles.${G}`,{unit:r.t(`chartUnits.${nt}`,{plural:"s"})})||void 0:G||void 0}),I=p.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const G=S.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];if(G)return r.te(`chartLabels.${G}`)?r.t(`chartLabels.${G}`):G}),B=p.computed(()=>{if(OD(i.chartData.meta.datasource))return r.t("timestampAxisTitles.platform");const G=bu(Number(i.chartData.meta.granularity_ms));if(G)return r.te(`granularityAxisTitles.${G}`)?r.t(`granularityAxisTitles.${G}`):G}),N=p.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),T=p.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),D=p.computed(()=>S.value?zC(s.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),O=p.computed(()=>i.chartData.meta.granularity_ms?bu(i.chartData.meta.granularity_ms)||"hourly":bu(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),L=p.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(G,nt)=>G.text===r.t("chartLabels.____OTHER____")?1:nt.text===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(G.text,10))&&!isNaN(parseInt(nt.text,10))?G.text<nt.text?-1:1:G.value&&nt.value?nt.value.raw-G.value.raw:0),W=p.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(G,nt)=>G.label===r.t("chartLabels.____OTHER____")?1:nt.label===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(G.label,10))&&!isNaN(parseInt(nt.label,10))?G.label<nt.label?-1:1:G.value&&nt.value?nt.rawValue-G.rawValue:0),tt=p.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:G=>e("zoom-time-range",G)}]:[],...i.exploreLink?[{label:r.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:r.t("zoom_action_items.view_requests"),key:"view-requests",href:i.requestsLink.href}]:[]]);return p.provide("showLegendValues",h),p.provide("legendPosition",p.toRef(i,"legendPosition")),(G,nt)=>{const X=p.resolveComponent("KTooltip"),Q=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["analytics-chart-shell",{"show-values":h.value}])},[D.value&&_.value&&y.value?(p.openBlock(),p.createElementBlock("div",N2,[p.createVNode(X,{class:"tooltip","max-width":"500",placement:"right"},{content:p.withCtx(()=>[p.createElementVNode("div",F2,p.toDisplayString(x.value),1)]),default:p.withCtx(()=>[p.createVNode(p.unref(Ss.WarningIcon),{color:`var(--kui-color-text-warning, ${p.unref(GC)})`,size:`var(--kui-icon-size-40, ${p.unref(ZC)})`},null,8,["color","size"])]),_:1})])):p.createCommentVNode("",!0),D.value?(p.openBlock(),p.createElementBlock("div",B2,[S.value?(p.openBlock(),p.createBlock(L2,{key:0,brush:a.value,"chart-data":s.value,"chart-legend-sort-fn":L.value,"chart-tooltip-sort-fn":W.value,"dimension-axes-title":B.value,fill:n.chartOptions.stacked,granularity:O.value,"legend-values":p.unref(g),"metric-axes-title":P.value,"metric-unit":u.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,threshold:n.chartOptions.threshold,"time-range-ms":c.value,"tooltip-metric-display":U.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type,"zoom-action-items":tt.value,onSelectChartRange:nt[0]||(nt[0]=rt=>e("select-chart-range",rt)),onZoomTimeRange:nt[1]||(nt[1]=rt=>e("zoom-time-range",rt))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):v.value?(p.openBlock(),p.createBlock(a2,{key:1,annotations:n.showAnnotations,"chart-data":s.value,"chart-legend-sort-fn":L.value,"chart-tooltip-sort-fn":W.value,"data-testid":"bar-chart-container","dimension-axes-title":I.value,"legend-values":p.unref(g),"metric-axes-title":P.value,"metric-unit":u.value,orientation:E.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-metric-display":U.value,"tooltip-title":n.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):C.value?(p.openBlock(),p.createBlock(x2,{key:2,"chart-data":s.value,"dataset-colors":n.chartOptions.chartDatasetColors||p.unref(Du),"legend-position":n.legendPosition,"legend-values":p.unref(g),"metric-name":d.value,"metric-unit":u.value,"show-center-metric":n.chartOptions.showCenterMetric,"synthetics-data-key":n.syntheticsDataKey,"tooltip-dimension-display":I.value,"tooltip-metric-display":U.value,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-name","metric-unit","show-center-metric","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):p.createCommentVNode("",!0)])):(p.openBlock(),p.createBlock(Q,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(N.value),1)]),default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(T.value),1)]),_:1}))],2)}}}),U2=pn(z2,[["__scopeId","data-v-346b2111"]]),H2={class:"chart-parent","data-testid":"gauge-chart-parent"},W2={class:"chart-totals-flex"},$2={key:1,class:"metric-small","data-testid":"gauge-chart-total"},Y2=pn(p.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Pi},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=Pt.useI18n(),i=p.ref(td()),r=p.computed(()=>[t.chartData.datasets.reduce((_,x)=>(_.labels.push(x.label),_.borderColor.push(x.backgroundColor),_.backgroundColor.push(x.backgroundColor),_.data.push(x.data.reduce((v,S)=>v+S,0)),_),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),s=p.computed(()=>({...t.chartData,datasets:r.value}));Pt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},c=p.computed(()=>uo(r?.value[0]?.data[t.numerator],{capital:!0})),u=p.computed(()=>uo(r?.value[0]?.data[0]+r?.value[0]?.data[1],{capital:!0})),d=p.computed(()=>`color: ${r?.value[0]?.backgroundColor[t.numerator]}`),h=p.computed(()=>["full","single"].includes(t.metricDisplay)),g=p.computed(()=>t.metricDisplay==="full");return(y,_)=>(p.openBlock(),p.createElementBlock("div",H2,[p.createElementVNode("div",W2,[h.value?(p.openBlock(),p.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:p.normalizeStyle(d.value)},p.toDisplayString(c.value),5)):p.createCommentVNode("",!0),g.value?(p.openBlock(),p.createElementBlock("div",$2,p.toDisplayString(p.unref(e).t("total"))+": "+p.toDisplayString(u.value),1)):p.createCommentVNode("",!0)]),p.createElementVNode("div",{class:"chart-container",style:p.normalizeStyle({height:n.height,width:n.width})},[p.createVNode(p.unref(l0),{"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),V2={key:1,class:"single-value-wrapper"},q2={class:"single-value-metric"},j2={class:"name-unit-alignment"},G2={class:"single-value","data-testid":"single-value-chart"},K2={key:0,class:"single-value-unit"},X2={class:"single-value-metric-name"},Z2={key:0,class:"single-value-trend"},Q2={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},id="t1",rd="t2",J2=pn(p.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:ry},leftAlign:{type:Boolean,default:!1},showTrend:{type:Boolean,default:!1},increaseIsBad:{type:Boolean,default:!1},alignX:{type:String,default:"space-evenly"}},setup(n){const{i18n:t}=Pt.useI18n(),{formatBytes:e,formatCost:i}=fr({i18n:t}),r=n,s=p.computed(()=>`align-${r.leftAlign?"left":r.alignX}`),a=p.computed(()=>Qi.buildDeltaMapping(r.data,r.showTrend,{topLevelKey:id,secondLevelKey:rd})),c=p.computed(()=>a.value?.previous?.[id]?.[rd]),u=p.computed(()=>a.value?.current?.[id]?.[rd]),d=p.computed(()=>r.data.data),h=p.computed(()=>r.data.meta?.metric_names?.[0]),g=p.computed(()=>t.te(`chartLabels.${h.value}`)?t.t(`chartLabels.${h.value}`):""),y=p.computed(()=>{const O=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(O){const L=`chartUnits.${O}`;return t.te(L)?t.t(L,{plural:""}):""}}),_=p.computed(()=>h.value==="request_per_minute"||!!h.value?.includes("_latency_")||h.value==="error_rate"),x=p.computed(()=>r.showTrend&&c.value!==void 0?c.value:null),v=p.computed(()=>{if(r.showTrend)return u.value??null;if(d.value.length<1||!h.value)return null;const O=d.value[0].event[h.value];return typeof O!="number"||isNaN(O)?null:O}),S=p.computed(()=>r.data?.data?.length===void 0||r.data?.data?.length===0||!r.showTrend&&v.value===null||r.showTrend&&x.value===null&&v.value===null),C=p.computed(()=>{const O=v.value;if(O===null)return"-";const L=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(L==="usd")return i(O);if(L==="bytes")return e(O);if(O>=1e9){const tt=(O/1e9).toFixed(1);return tt.endsWith(".0")?`${Math.floor(O/1e9)}B`:`${tt}B`}if(O>=1e7){const tt=(O/1e6).toFixed(1);return tt.endsWith(".0")?`${Math.floor(O/1e6)}M`:`${tt}M`}const W=r.decimalPoints&&typeof r.decimalPoints=="number"?r.decimalPoints:ry;return O.toLocaleString("en-US",{maximumFractionDigits:W})}),E=p.computed(()=>r.showTrend&&r.data?.data?.length<2),U=p.computed(()=>Qi.calculateChange(v.value??0,x.value??0)||0),P=p.computed(()=>{if(!r.showTrend)return 0;if(r.data?.data?.length<2){if(c.value===void 0)return 0;if(u.value===void 0)return r.increaseIsBad?1:-1}return Qi.changePolarity(U.value,!0,r.increaseIsBad)}),I=p.computed(()=>Qi.defineIcon(P.value,r.increaseIsBad)),B=p.computed(()=>{if(r.showTrend&&r.data?.data?.length<2){if(c.value===void 0)return t.t("singleValue.trend.not_available");if(u.value===void 0)return Qi.metricChange(-1,!0,t.t("singleValue.trend.not_available"))}return Qi.metricChange(U.value,r.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),N=Qi.useTrendRange(p.computed(()=>r.showTrend),void 0,p.computed(()=>r.data.meta)),T=O=>O>0?"positive":O<0?"negative":"neutral",D=O=>O>0?jC:O<0?qC:Im;return p.onMounted(()=>{!r.showTrend&&r.data?.data?.length>1?console.warn("SingleValue chart should only be used with a single data point. Data length:",r.data.data.length):r.showTrend&&r.data?.data?.length>2&&console.warn("SingleValue with trend expects 2 or fewer data points. Instead got:",r.data.data.length)}),(O,L)=>{const W=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["chart-parent",s.value]),"data-testid":"single-value-parent"},[S.value?(p.openBlock(),p.createBlock(W,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:p.unref(t).t("singleValue.valueError")},null,8,["title"])):(p.openBlock(),p.createElementBlock("div",V2,[p.createElementVNode("div",q2,[p.createElementVNode("div",j2,[p.createElementVNode("span",G2,p.toDisplayString(C.value),1),_.value&&y.value?(p.openBlock(),p.createElementBlock("span",K2,"  "+p.toDisplayString(y.value),1)):p.createCommentVNode("",!0)]),p.createElementVNode("div",X2,p.toDisplayString(g.value),1)]),n.showTrend?(p.openBlock(),p.createElementBlock("div",Z2,[p.createElementVNode("div",{class:p.normalizeClass(["trend-change",T(P.value)]),"data-testid":"single-value-trend"},[E.value||P.value!==0?(p.openBlock(),p.createBlock(p.resolveDynamicComponent(I.value),{key:0,color:D(P.value),size:`var(--kui-icon-size-30, ${p.unref(so)})`},null,8,["color","size"])):(p.openBlock(),p.createBlock(p.unref(Ss.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${p.unref(Im)})`,size:`var(--kui-icon-size-30, ${p.unref(so)})`},null,8,["color","size"])),p.createElementVNode("div",null,p.toDisplayString(B.value),1)],2),p.unref(N)?(p.openBlock(),p.createElementBlock("div",Q2,p.toDisplayString(p.unref(N)),1)):p.createCommentVNode("",!0)])):p.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-0203459f"]]),tI={class:"simple-chart-shell"},eI={key:1,class:"analytics-chart-parent"},nI=pn(p.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=Pt.useI18n(),i=p.computed(()=>{const d=Pt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||Pi},p.toRef(t,"chartData")).value;return t.chartOptions?.reverseDataset&&d?.datasets.reverse(),d}),r=p.computed(()=>t.chartData.meta?.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""),s=p.computed(()=>t.chartOptions.type==="gauge"),a=p.computed(()=>t.chartOptions.type==="single_value"),c=p.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),u=p.computed(()=>{const d=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(a.value){const h=t.chartData.meta?.metric_names?.[0];return d&&t.chartData.data[0].event[h]!==null}return d});return(d,h)=>{const g=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",tI,[u.value?(p.openBlock(),p.createElementBlock("div",eI,[s.value?(p.openBlock(),p.createBlock(Y2,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":r.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):p.createCommentVNode("",!0),a.value?(p.openBlock(),p.createBlock(J2,{key:1,"align-x":n.chartOptions.alignX,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints,"increase-is-bad":n.chartOptions.increaseIsBad,"show-trend":n.chartOptions.showTrend},null,8,["align-x","data","decimal-points","increase-is-bad","show-trend"])):p.createCommentVNode("",!0)])):(p.openBlock(),p.createBlock(g,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(c.value),1)]),_:1}))])}}}),[["__scopeId","data-v-23ca8c84"]]),iI={class:"top-n-card-title","data-testid":"top-n-card-title"},rI={class:"top-n-card-description","data-testid":"top-n-card-description"},sI={key:3,class:"top-n-table","data-testid":"top-n-table"},oI={"data-testid":"top-n-table-header"},aI={class:"top-n-table-header-row"},lI={class:"table-header-label"},cI=["data-testid"],uI=["data-testid"],dI=["data-testid"],fI=3,hI=pn(p.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(n){const t=n,{i18n:e}=Pt.useI18n(),{formatUnit:i}=fr({i18n:e}),r=p.computed(()=>t.data.data),s=p.computed(()=>!!r.value?.length),a=p.computed(()=>t.data.meta?.display?Object.keys(t.data.meta.display).slice(0,fI):[]),c=p.computed(()=>a.value[0]||""),u=p.computed(()=>a.value.length>1),d=p.computed(()=>a.value[a.value.length-1]||""),h=p.computed(()=>c.value?t.data.meta.display[c.value]:{}),g=p.computed(()=>t.data.meta?.metric_names?.length?t.data.meta.metric_names:[]),y=p.computed(()=>g.value[0]),_=p.computed(()=>y.value?G(y.value):""),x=p.computed(()=>{const X=a.value.map(Q=>({key:Q,label:u.value?G(Q):e.t("topNTable.nameLabel"),type:"dimension"}));return y.value&&X.push({key:"value",label:_.value,type:"metric"}),g.value.forEach((Q,rt)=>{rt!==0&&X.push({key:Q,label:G(Q),type:"metric"})}),X}),v=p.computed(()=>x.value.filter(X=>X.type==="metric")),S=p.computed(()=>x.value.filter(X=>X.type==="dimension").slice(1)),C=X=>X.type==="dimension"&&X.key===d.value,E=X=>u.value&&X.type==="dimension"&&!C(X),U=X=>{const Q=X.event;return String(Q[c.value])},P=(X,Q)=>{const rt=String(X.event[Q]),st=t.data.meta?.display?.[Q]?.[rt];return{dimension:Q,id:rt,name:st?.name||"-",deleted:!!st?.deleted}},I=X=>{const Q=U(X),rt=h.value&&h.value[Q];return rt?rt.name:"-"},B=X=>{const Q=U(X),rt=h.value&&h.value[Q];return rt?!!rt.deleted:!1},N=(X,Q)=>{const rt=X.event[Q];if(rt==null)return"–";const st=typeof rt=="number"?rt:Number(rt);if(Number.isNaN(st))return"–";const ot=t.data.meta?.metric_units?.[Q]||"count",H=["count","count/minute","token count"].includes(ot);return i(st,ot,{approximate:H,isBytes1024:!0,translateUnit:V=>nt(V,st)})},T=X=>y.value?N(X,y.value):"–",D=p.computed(()=>r.value?.length?r.value.map(X=>{const Q=a.value.map(H=>P(X,H)),rt=Q[0],st=rt?.id||U(X),ot={id:st,rowKey:Q.map(H=>`${H.dimension}:${H.id}`).join("|")||st,name:rt?.name||I(X),deleted:B(X),dimensions:Q,original:X};return y.value&&(ot.value=T(X)),g.value.forEach((H,V)=>{V!==0&&(ot[H]=N(X,H))}),ot}):[]),O=p.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value.some(X=>!Object.keys(t.data.meta.display[X]||{}).length))return e.t("topNTable.errors.display");if(!y.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),L=(X,Q)=>{const rt=X[Q];return typeof rt=="string"?rt:rt==null?"–":String(rt)},W=(X,Q)=>X.dimensions.find(rt=>rt.dimension===Q)?.name||"–",tt=(X,Q)=>{const rt=X.dimensions.find(st=>st.dimension===Q);return{id:rt?.id||"",name:rt?.name||"–",deleted:rt?.deleted||!1,dimension:Q,dimensions:X.dimensions,isEmpty:rt?.id==="empty"}},G=X=>e.te(`chartLabels.${X}`)?e.t(`chartLabels.${X}`):X,nt=(X,Q)=>{if(lo(X)||X==="count"||X==="requests")return"";const rt=Q===1?"":"s";return e.te(`chartUnits.${X}`)?e.t(`chartUnits.${X}`,{plural:rt}):X};return(X,Q)=>{const rt=p.resolveComponent("KEmptyState"),st=p.resolveComponent("KSkeleton"),ot=p.resolveComponent("KCard");return p.openBlock(),p.createBlock(ot,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},p.createSlots({default:p.withCtx(()=>[O.value?(p.openBlock(),p.createBlock(rt,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(O.value),1)]),_:1})):n.isLoading?(p.openBlock(),p.createBlock(st,{key:1,"table-columns":2,type:"table"})):s.value?(p.openBlock(),p.createElementBlock("div",sI,[p.createElementVNode("table",{class:p.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":u.value}])},[p.createElementVNode("thead",oI,[p.createElementVNode("tr",aI,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(x.value,H=>(p.openBlock(),p.createElementBlock("th",{key:H.key,class:p.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":H.type==="metric","top-n-table-header-cell-dimension-compact":E(H)}]),"data-testid":"top-n-table-header-column"},[p.createElementVNode("span",lI,p.toDisplayString(H.label),1)],2))),128))])]),p.createElementVNode("tbody",null,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(D.value,H=>(p.openBlock(),p.createElementBlock("tr",{key:H.rowKey,class:"top-n-table-row"},[p.createElementVNode("td",{class:p.normalizeClass(["top-n-table-cell top-n-table-cell--name",{"top-n-table-cell-dimension-compact":u.value}])},[p.createElementVNode("span",{"data-testid":`row-${H.id}`},[p.renderSlot(X.$slots,"name",{record:{id:H.id,name:H.name,deleted:H.deleted,dimension:c.value,dimensions:H.dimensions,isEmpty:H.id==="empty"}},()=>[p.createTextVNode(p.toDisplayString(H.name),1)],!0)],8,cI)],2),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(S.value,V=>(p.openBlock(),p.createElementBlock("td",{key:V.key,class:p.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!C(V)}])},[p.renderSlot(X.$slots,"name",{record:tt(H,V.key)},()=>[p.createTextVNode(p.toDisplayString(W(H,V.key)),1)],!0)],2))),128)),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(v.value,V=>(p.openBlock(),p.createElementBlock("td",{key:V.key,class:"top-n-table-cell top-n-table-cell-metric"},[V.key==="value"?(p.openBlock(),p.createElementBlock("span",{key:0,"data-testid":`row-${H.id}`},p.toDisplayString(L(H,V.key)),9,uI)):(p.openBlock(),p.createElementBlock("span",{key:1,"data-testid":`row-${H.id}-${V.key}`},p.toDisplayString(L(H,V.key)),9,dI))]))),128))]))),128))])],2)])):(p.openBlock(),p.createBlock(rt,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(n.emptyStateTitle||p.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:p.withCtx(()=>[p.createElementVNode("span",iI,p.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:p.withCtx(()=>[p.createElementVNode("div",rI,p.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-bd2cedcf"]]),pI={class:"container"},gI={key:0,class:"no-data","data-testid":"sparkline-empty"},mI=["title"],yI=pn(p.defineComponent({__name:"SparklineChart",props:{chartKey:{default:()=>{}},datasets:{},disableTooltip:{type:Boolean,default:!1},enableBrushing:{type:Boolean,default:!1},groupKey:{default:()=>{}},maxCount:{default:()=>{}},maxStamp:{default:()=>{}},minCount:{default:()=>{}},minStamp:{default:()=>{}},pointRenderCount:{default:24},showLabel:{type:Boolean,default:!1},tooltipTitle:{default:()=>{}},type:{default:"sparkline_bar"}},setup(n){const t=crypto.randomUUID(),{i18n:e}=Pt.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:r,syncedMaxStamp:s,syncedMinCount:a,syncedMaxCount:c,syncedRenderPoints:u,syncedChartDatasets:d}=Pt.useSparklineSync({chartKey:n.chartKey,datasets:n.datasets,groupKey:n.groupKey,minStamp:n.minStamp,maxStamp:n.maxStamp,minCount:n.minCount,maxCount:n.maxCount,renderPoints:n.pointRenderCount,type:n.type}),h=p.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:n.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),g=({width:N,height:T})=>{h.width=N,h.height=T},y=p.computed(()=>n.disableTooltip?[]:[new u0({enableBrushing:n.groupKey!==void 0&&n.chartKey!==void 0&&n.enableBrushing,brushStrategy:"group",brushGroup:n.groupKey})]),_=p.computed(()=>d.value.reduce((N,{data:T,label:D})=>({...N,[D]:T.reduce((O,{y:L})=>O+L,0)}),{})),x=p.computed(()=>d.value.map(({label:N})=>[_.value[N],`${N}: ${_.value[N]}`]).sort(([N],[T])=>T-N).map(([,N])=>N).join(", ")),v=p.computed(()=>Object.keys(_.value).map(N=>_.value[N]).reduce((N,T)=>N+T,0)),S=p.computed(()=>v.value>0),C=p.computed(()=>({labels:new Array(u.value).fill(""),datasets:d.value})),E=p.computed(()=>n.datasets.length>1),U=`SparklineTooltipPosition-${t}`,P=p.computed(()=>{const N=n.type==="sparkline_bar",T=N?r.value-1:r.value,D=N?s.value:s.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:n.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:N?0:2,right:N?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:U,external:O=>{km(h,O,"minutely",{contextFormatter:L=>{const W=L+i.value;let tt="";return i.value>1440*60*1e3?tt=Aa(new Date(W),"MMM dd, yyy hh:mm a"):tt=Aa(new Date(W),"hh:mm a"),`${wC(L)} - ${tt}`}})}}},scales:{x:{min:T,max:D,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:E.value},y:{min:Math.max(a.value-1,0),max:c.value,grid:{display:!1},display:!1,stacked:E.value}}}}),I=p.ref("0"),B=p.ref("0");return p.onMounted(()=>{hn.positioners[U]=function(N,T){if(!N.length||h.interactionMode==="interactive"||T.x===null)return!1;const D=10,O=this.chart.canvas.getBoundingClientRect(),L=h.width||this.width,W=h.height||this.height,tt=O.top-W>0,G=tt?O.top-W-D:O.top+O.height+D,nt=O.left>L/2-T.x,X=Math.max(D,window.innerWidth-D-L),Q=Math.min(X,nt?Math.floor(O.left-L/2)+T.x:0+D);return I.value=`${G}px`,B.value=`${Q}px`,{x:Q,y:G,xAlign:"center",yAlign:tt?"top":"bottom"}}}),p.onUnmounted(()=>{hn.positioners[U]&&delete hn.positioners[U]}),(N,T)=>(p.openBlock(),p.createElementBlock("div",pI,[S.value?n.type==="sparkline_bar"?(p.openBlock(),p.createBlock(p.unref(a0),{key:1,"chart-id":p.unref(t),data:C.value,"data-testid":"sparkline-bar",options:P.value,plugins:y.value},null,8,["chart-id","data","options","plugins"])):n.type==="sparkline_line"||n.type==="sparkline_step"?(p.openBlock(),p.createBlock(p.unref(c0),{key:2,"chart-id":p.unref(t),data:C.value,"data-testid":n.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:P.value,plugins:y.value},null,8,["chart-id","data","data-testid","options","plugins"])):p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",gI,[p.renderSlot(N.$slots,"empty",{},()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("sparkline_no_data")),1)],!0)])),n.disableTooltip?p.createCommentVNode("",!0):(p.openBlock(),p.createBlock(il,{key:3,"absolute-left":B.value,"absolute-top":I.value,class:"tooltip","data-testid":"sparkline-tooltip",state:h,"tooltip-title":n.tooltipTitle,onDimensions:g},null,8,["absolute-left","absolute-top","state","tooltip-title"])),S.value&&n.showLabel?(p.openBlock(),p.createElementBlock("div",{key:4,class:"label",title:N.$slots.label?"":x.value},[p.renderSlot(N.$slots,"label",{total:v.value,totalByDataset:_.value},()=>[p.createTextVNode(p.toDisplayString(x.value),1)],!0)],8,mI)):p.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]);var Bi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},xo={exports:{}};var _I=xo.exports,h0;function bI(){return h0||(h0=1,(function(n,t){(function(){var e,i="4.18.1",r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",c="Invalid `variable` option passed into `_.template`",u="Invalid `imports` option passed into `_.template`",d="__lodash_hash_undefined__",h=500,g="__lodash_placeholder__",y=1,_=2,x=4,v=1,S=2,C=1,E=2,U=4,P=8,I=16,B=32,N=64,T=128,D=256,O=512,L=30,W="...",tt=800,G=16,nt=1,X=2,Q=3,rt=1/0,st=9007199254740991,ot=17976931348623157e292,H=NaN,V=4294967295,J=V-1,_t=V>>>1,pt=[["ary",T],["bind",C],["bindKey",E],["curry",P],["curryRight",I],["flip",O],["partial",B],["partialRight",N],["rearg",D]],it="[object Arguments]",ft="[object Array]",ut="[object AsyncFunction]",dt="[object Boolean]",gt="[object Date]",lt="[object DOMException]",It="[object Error]",Bt="[object Function]",wt="[object GeneratorFunction]",kt="[object Map]",Dt="[object Number]",ve="[object Null]",bt="[object Object]",Vt="[object Promise]",Se="[object Proxy]",Ae="[object RegExp]",oe="[object Set]",on="[object String]",qt="[object Symbol]",Ie="[object Undefined]",ie="[object WeakMap]",Te="[object WeakSet]",Ee="[object ArrayBuffer]",gn="[object DataView]",zi="[object Float32Array]",kn="[object Float64Array]",$e="[object Int8Array]",In="[object Int16Array]",li="[object Int32Array]",wo="[object Uint8Array]",vo="[object Uint8ClampedArray]",br="[object Uint16Array]",ci="[object Uint32Array]",So=/\b__p \+= '';/g,To=/\b(__p \+=) '' \+/g,Mo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ui=/&(?:amp|lt|gt|quot|#39);/g,ol=/[&<>"']/g,sd=RegExp(Ui.source),od=RegExp(ol.source),ad=/<%-([\s\S]+?)%>/g,ld=/<%([\s\S]+?)%>/g,Do=/<%=([\s\S]+?)%>/g,al=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ui=/^\w*$/,cd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ko=/[\\^$.*+?()[\]{}|]/g,ud=RegExp(ko.source),Co=/^\s+/,dd=/\s/,Ln=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,fd=/\{\n\/\* \[wrapped with (.+)\] \*/,hd=/,? & /,pd=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ll=/[()=,{}\[\]\/\s]/,gd=/\\(\\)?/g,Hi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,cl=/\w*$/,md=/^[-+]0x[0-9a-f]+$/i,yd=/^0b[01]+$/i,_d=/^\[object .+?Constructor\]$/,bd=/^0o[0-7]+$/i,Wi=/^(?:0|[1-9]\d*)$/,xd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,es=/($^)/,wd=/['\n\r\u2028\u2029\\]/g,ns="\\ud800-\\udfff",vd="\\u0300-\\u036f",Sd="\\ufe20-\\ufe2f",ul="\\u20d0-\\u20ff",xr=vd+Sd+ul,dl="\\u2700-\\u27bf",is="a-z\\xdf-\\xf6\\xf8-\\xff",Td="\\xac\\xb1\\xd7\\xf7",Md="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Dd="\\u2000-\\u206f",kd=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",fl="A-Z\\xc0-\\xd6\\xd8-\\xde",hl="\\ufe0e\\ufe0f",rs=Td+Md+Dd+kd,Oo="['’]",Cd="["+ns+"]",pl="["+rs+"]",ss="["+xr+"]",gl="\\d+",Od="["+dl+"]",ml="["+is+"]",Ao="[^"+ns+rs+gl+dl+is+fl+"]",Eo="\\ud83c[\\udffb-\\udfff]",Ad="(?:"+ss+"|"+Eo+")",wr="[^"+ns+"]",Gn="(?:\\ud83c[\\udde6-\\uddff]){2}",os="[\\ud800-\\udbff][\\udc00-\\udfff]",an="["+fl+"]",yl="\\u200d",_l="(?:"+ml+"|"+Ao+")",Ed="(?:"+an+"|"+Ao+")",bl="(?:"+Oo+"(?:d|ll|m|re|s|t|ve))?",xl="(?:"+Oo+"(?:D|LL|M|RE|S|T|VE))?",wl=Ad+"?",Ro="["+hl+"]?",di="(?:"+yl+"(?:"+[wr,Gn,os].join("|")+")"+Ro+wl+")*",Rd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Sl=Ro+wl+di,Po="(?:"+[Od,Gn,os].join("|")+")"+Sl,Tl="(?:"+[wr+ss+"?",ss,Gn,os,Cd].join("|")+")",Pd=RegExp(Oo,"g"),Id=RegExp(ss,"g"),as=RegExp(Eo+"(?="+Eo+")|"+Tl+Sl,"g"),Ld=RegExp([an+"?"+ml+"+"+bl+"(?="+[pl,an,"$"].join("|")+")",Ed+"+"+xl+"(?="+[pl,an+_l,"$"].join("|")+")",an+"?"+_l+"+"+bl,an+"+"+xl,vl,Rd,gl,Po].join("|"),"g"),ls=RegExp("["+yl+ns+xr+hl+"]"),Nd=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Io=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Fd=-1,ee={};ee[zi]=ee[kn]=ee[$e]=ee[In]=ee[li]=ee[wo]=ee[vo]=ee[br]=ee[ci]=!0,ee[it]=ee[ft]=ee[Ee]=ee[dt]=ee[gn]=ee[gt]=ee[It]=ee[Bt]=ee[kt]=ee[Dt]=ee[bt]=ee[Ae]=ee[oe]=ee[on]=ee[ie]=!1;var k={};k[it]=k[ft]=k[Ee]=k[gn]=k[dt]=k[gt]=k[zi]=k[kn]=k[$e]=k[In]=k[li]=k[kt]=k[Dt]=k[bt]=k[Ae]=k[oe]=k[on]=k[qt]=k[wo]=k[vo]=k[br]=k[ci]=!0,k[It]=k[Bt]=k[ie]=!1;var $={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Z={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},mt={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Me={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ye=parseFloat,Nn=parseInt,Le=typeof Bi=="object"&&Bi&&Bi.Object===Object&&Bi,Ml=typeof self=="object"&&self&&self.Object===Object&&self,ce=Le||Ml||Function("return this")(),cs=t&&!t.nodeType&&t,Kn=cs&&!0&&n&&!n.nodeType&&n,Lo=Kn&&Kn.exports===cs,vr=Lo&&Le.process,Ne=(function(){try{var F=Kn&&Kn.require&&Kn.require("util").types;return F||vr&&vr.binding&&vr.binding("util")}catch{}})(),_0=Ne&&Ne.isArrayBuffer,b0=Ne&&Ne.isDate,x0=Ne&&Ne.isMap,w0=Ne&&Ne.isRegExp,v0=Ne&&Ne.isSet,S0=Ne&&Ne.isTypedArray;function mn(F,q,Y){switch(Y.length){case 0:return F.call(q);case 1:return F.call(q,Y[0]);case 2:return F.call(q,Y[0],Y[1]);case 3:return F.call(q,Y[0],Y[1],Y[2])}return F.apply(q,Y)}function PI(F,q,Y,ct){for(var Ct=-1,$t=F==null?0:F.length;++Ct<$t;){var De=F[Ct];q(ct,De,Y(De),F)}return ct}function yn(F,q){for(var Y=-1,ct=F==null?0:F.length;++Y<ct&&q(F[Y],Y,F)!==!1;);return F}function II(F,q){for(var Y=F==null?0:F.length;Y--&&q(F[Y],Y,F)!==!1;);return F}function T0(F,q){for(var Y=-1,ct=F==null?0:F.length;++Y<ct;)if(!q(F[Y],Y,F))return!1;return!0}function $i(F,q){for(var Y=-1,ct=F==null?0:F.length,Ct=0,$t=[];++Y<ct;){var De=F[Y];q(De,Y,F)&&($t[Ct++]=De)}return $t}function Dl(F,q){var Y=F==null?0:F.length;return!!Y&&us(F,q,0)>-1}function Bd(F,q,Y){for(var ct=-1,Ct=F==null?0:F.length;++ct<Ct;)if(Y(q,F[ct]))return!0;return!1}function ue(F,q){for(var Y=-1,ct=F==null?0:F.length,Ct=Array(ct);++Y<ct;)Ct[Y]=q(F[Y],Y,F);return Ct}function Yi(F,q){for(var Y=-1,ct=q.length,Ct=F.length;++Y<ct;)F[Ct+Y]=q[Y];return F}function zd(F,q,Y,ct){var Ct=-1,$t=F==null?0:F.length;for(ct&&$t&&(Y=F[++Ct]);++Ct<$t;)Y=q(Y,F[Ct],Ct,F);return Y}function LI(F,q,Y,ct){var Ct=F==null?0:F.length;for(ct&&Ct&&(Y=F[--Ct]);Ct--;)Y=q(Y,F[Ct],Ct,F);return Y}function Ud(F,q){for(var Y=-1,ct=F==null?0:F.length;++Y<ct;)if(q(F[Y],Y,F))return!0;return!1}var NI=Hd("length");function FI(F){return F.split("")}function BI(F){return F.match(pd)||[]}function M0(F,q,Y){var ct;return Y(F,function(Ct,$t,De){if(q(Ct,$t,De))return ct=$t,!1}),ct}function kl(F,q,Y,ct){for(var Ct=F.length,$t=Y+(ct?1:-1);ct?$t--:++$t<Ct;)if(q(F[$t],$t,F))return $t;return-1}function us(F,q,Y){return q===q?XI(F,q,Y):kl(F,D0,Y)}function zI(F,q,Y,ct){for(var Ct=Y-1,$t=F.length;++Ct<$t;)if(ct(F[Ct],q))return Ct;return-1}function D0(F){return F!==F}function k0(F,q){var Y=F==null?0:F.length;return Y?$d(F,q)/Y:H}function Hd(F){return function(q){return q==null?e:q[F]}}function Wd(F){return function(q){return F==null?e:F[q]}}function C0(F,q,Y,ct,Ct){return Ct(F,function($t,De,ne){Y=ct?(ct=!1,$t):q(Y,$t,De,ne)}),Y}function UI(F,q){var Y=F.length;for(F.sort(q);Y--;)F[Y]=F[Y].value;return F}function $d(F,q){for(var Y,ct=-1,Ct=F.length;++ct<Ct;){var $t=q(F[ct]);$t!==e&&(Y=Y===e?$t:Y+$t)}return Y}function Yd(F,q){for(var Y=-1,ct=Array(F);++Y<F;)ct[Y]=q(Y);return ct}function HI(F,q){return ue(q,function(Y){return[Y,F[Y]]})}function O0(F){return F&&F.slice(0,P0(F)+1).replace(Co,"")}function _n(F){return function(q){return F(q)}}function Vd(F,q){return ue(q,function(Y){return F[Y]})}function No(F,q){return F.has(q)}function A0(F,q){for(var Y=-1,ct=F.length;++Y<ct&&us(q,F[Y],0)>-1;);return Y}function E0(F,q){for(var Y=F.length;Y--&&us(q,F[Y],0)>-1;);return Y}function WI(F,q){for(var Y=F.length,ct=0;Y--;)F[Y]===q&&++ct;return ct}var $I=Wd($),YI=Wd(Z);function VI(F){return"\\"+Me[F]}function qI(F,q){return F==null?e:F[q]}function ds(F){return ls.test(F)}function jI(F){return Nd.test(F)}function GI(F){for(var q,Y=[];!(q=F.next()).done;)Y.push(q.value);return Y}function qd(F){var q=-1,Y=Array(F.size);return F.forEach(function(ct,Ct){Y[++q]=[Ct,ct]}),Y}function R0(F,q){return function(Y){return F(q(Y))}}function Vi(F,q){for(var Y=-1,ct=F.length,Ct=0,$t=[];++Y<ct;){var De=F[Y];(De===q||De===g)&&(F[Y]=g,$t[Ct++]=Y)}return $t}function Cl(F){var q=-1,Y=Array(F.size);return F.forEach(function(ct){Y[++q]=ct}),Y}function KI(F){var q=-1,Y=Array(F.size);return F.forEach(function(ct){Y[++q]=[ct,ct]}),Y}function XI(F,q,Y){for(var ct=Y-1,Ct=F.length;++ct<Ct;)if(F[ct]===q)return ct;return-1}function ZI(F,q,Y){for(var ct=Y+1;ct--;)if(F[ct]===q)return ct;return ct}function fs(F){return ds(F)?JI(F):NI(F)}function Fn(F){return ds(F)?tL(F):FI(F)}function P0(F){for(var q=F.length;q--&&dd.test(F.charAt(q)););return q}var QI=Wd(mt);function JI(F){for(var q=as.lastIndex=0;as.test(F);)++q;return q}function tL(F){return F.match(as)||[]}function eL(F){return F.match(Ld)||[]}var nL=(function F(q){q=q==null?ce:hs.defaults(ce.Object(),q,hs.pick(ce,Io));var Y=q.Array,ct=q.Date,Ct=q.Error,$t=q.Function,De=q.Math,ne=q.Object,jd=q.RegExp,iL=q.String,Cn=q.TypeError,Ol=Y.prototype,rL=$t.prototype,ps=ne.prototype,Al=q["__core-js_shared__"],El=rL.toString,jt=ps.hasOwnProperty,sL=0,I0=(function(){var o=/[^.]+$/.exec(Al&&Al.keys&&Al.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),Rl=ps.toString,oL=El.call(ne),aL=ce._,lL=jd("^"+El.call(jt).replace(ko,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pl=Lo?q.Buffer:e,qi=q.Symbol,Il=q.Uint8Array,L0=Pl?Pl.allocUnsafe:e,Ll=R0(ne.getPrototypeOf,ne),N0=ne.create,F0=ps.propertyIsEnumerable,Nl=Ol.splice,B0=qi?qi.isConcatSpreadable:e,Fo=qi?qi.iterator:e,Sr=qi?qi.toStringTag:e,Fl=(function(){try{var o=Cr(ne,"defineProperty");return o({},"",{}),o}catch{}})(),cL=q.clearTimeout!==ce.clearTimeout&&q.clearTimeout,uL=ct&&ct.now!==ce.Date.now&&ct.now,dL=q.setTimeout!==ce.setTimeout&&q.setTimeout,Bl=De.ceil,zl=De.floor,Gd=ne.getOwnPropertySymbols,fL=Pl?Pl.isBuffer:e,z0=q.isFinite,hL=Ol.join,pL=R0(ne.keys,ne),ke=De.max,Ve=De.min,gL=ct.now,mL=q.parseInt,U0=De.random,yL=Ol.reverse,Kd=Cr(q,"DataView"),Bo=Cr(q,"Map"),Xd=Cr(q,"Promise"),gs=Cr(q,"Set"),zo=Cr(q,"WeakMap"),Uo=Cr(ne,"create"),Ul=zo&&new zo,ms={},_L=Or(Kd),bL=Or(Bo),xL=Or(Xd),wL=Or(gs),vL=Or(zo),Hl=qi?qi.prototype:e,Ho=Hl?Hl.valueOf:e,H0=Hl?Hl.toString:e;function w(o){if(ge(o)&&!Et(o)&&!(o instanceof Ut)){if(o instanceof On)return o;if(jt.call(o,"__wrapped__"))return W_(o)}return new On(o)}var ys=(function(){function o(){}return function(l){if(!fe(l))return{};if(N0)return N0(l);o.prototype=l;var f=new o;return o.prototype=e,f}})();function Wl(){}function On(o,l){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=e}w.templateSettings={escape:ad,evaluate:ld,interpolate:Do,variable:"",imports:{_:w}},w.prototype=Wl.prototype,w.prototype.constructor=w,On.prototype=ys(Wl.prototype),On.prototype.constructor=On;function Ut(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=V,this.__views__=[]}function SL(){var o=new Ut(this.__wrapped__);return o.__actions__=ln(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=ln(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=ln(this.__views__),o}function TL(){if(this.__filtered__){var o=new Ut(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function ML(){var o=this.__wrapped__.value(),l=this.__dir__,f=Et(o),m=l<0,b=f?o.length:0,M=FN(0,b,this.__views__),A=M.start,R=M.end,z=R-A,j=m?R:A-1,K=this.__iteratees__,et=K.length,at=0,yt=Ve(z,this.__takeCount__);if(!f||!m&&b==z&&yt==z)return d_(o,this.__actions__);var St=[];t:for(;z--&&at<yt;){j+=l;for(var Nt=-1,xt=o[j];++Nt<et;){var zt=K[Nt],Ht=zt.iteratee,wn=zt.type,Qe=Ht(xt);if(wn==X)xt=Qe;else if(!Qe){if(wn==nt)continue t;break t}}St[at++]=xt}return St}Ut.prototype=ys(Wl.prototype),Ut.prototype.constructor=Ut;function Tr(o){var l=-1,f=o==null?0:o.length;for(this.clear();++l<f;){var m=o[l];this.set(m[0],m[1])}}function DL(){this.__data__=Uo?Uo(null):{},this.size=0}function kL(o){var l=this.has(o)&&delete this.__data__[o];return this.size-=l?1:0,l}function CL(o){var l=this.__data__;if(Uo){var f=l[o];return f===d?e:f}return jt.call(l,o)?l[o]:e}function OL(o){var l=this.__data__;return Uo?l[o]!==e:jt.call(l,o)}function AL(o,l){var f=this.__data__;return this.size+=this.has(o)?0:1,f[o]=Uo&&l===e?d:l,this}Tr.prototype.clear=DL,Tr.prototype.delete=kL,Tr.prototype.get=CL,Tr.prototype.has=OL,Tr.prototype.set=AL;function fi(o){var l=-1,f=o==null?0:o.length;for(this.clear();++l<f;){var m=o[l];this.set(m[0],m[1])}}function EL(){this.__data__=[],this.size=0}function RL(o){var l=this.__data__,f=$l(l,o);if(f<0)return!1;var m=l.length-1;return f==m?l.pop():Nl.call(l,f,1),--this.size,!0}function PL(o){var l=this.__data__,f=$l(l,o);return f<0?e:l[f][1]}function IL(o){return $l(this.__data__,o)>-1}function LL(o,l){var f=this.__data__,m=$l(f,o);return m<0?(++this.size,f.push([o,l])):f[m][1]=l,this}fi.prototype.clear=EL,fi.prototype.delete=RL,fi.prototype.get=PL,fi.prototype.has=IL,fi.prototype.set=LL;function hi(o){var l=-1,f=o==null?0:o.length;for(this.clear();++l<f;){var m=o[l];this.set(m[0],m[1])}}function NL(){this.size=0,this.__data__={hash:new Tr,map:new(Bo||fi),string:new Tr}}function FL(o){var l=ec(this,o).delete(o);return this.size-=l?1:0,l}function BL(o){return ec(this,o).get(o)}function zL(o){return ec(this,o).has(o)}function UL(o,l){var f=ec(this,o),m=f.size;return f.set(o,l),this.size+=f.size==m?0:1,this}hi.prototype.clear=NL,hi.prototype.delete=FL,hi.prototype.get=BL,hi.prototype.has=zL,hi.prototype.set=UL;function Mr(o){var l=-1,f=o==null?0:o.length;for(this.__data__=new hi;++l<f;)this.add(o[l])}function HL(o){return this.__data__.set(o,d),this}function WL(o){return this.__data__.has(o)}Mr.prototype.add=Mr.prototype.push=HL,Mr.prototype.has=WL;function Bn(o){var l=this.__data__=new fi(o);this.size=l.size}function $L(){this.__data__=new fi,this.size=0}function YL(o){var l=this.__data__,f=l.delete(o);return this.size=l.size,f}function VL(o){return this.__data__.get(o)}function qL(o){return this.__data__.has(o)}function jL(o,l){var f=this.__data__;if(f instanceof fi){var m=f.__data__;if(!Bo||m.length<r-1)return m.push([o,l]),this.size=++f.size,this;f=this.__data__=new hi(m)}return f.set(o,l),this.size=f.size,this}Bn.prototype.clear=$L,Bn.prototype.delete=YL,Bn.prototype.get=VL,Bn.prototype.has=qL,Bn.prototype.set=jL;function W0(o,l){var f=Et(o),m=!f&&Ar(o),b=!f&&!m&&Zi(o),M=!f&&!m&&!b&&ws(o),A=f||m||b||M,R=A?Yd(o.length,iL):[],z=R.length;for(var j in o)(l||jt.call(o,j))&&!(A&&(j=="length"||b&&(j=="offset"||j=="parent")||M&&(j=="buffer"||j=="byteLength"||j=="byteOffset")||mi(j,z)))&&R.push(j);return R}function $0(o){var l=o.length;return l?o[lf(0,l-1)]:e}function GL(o,l){return nc(ln(o),Dr(l,0,o.length))}function KL(o){return nc(ln(o))}function Zd(o,l,f){(f!==e&&!Un(o[l],f)||f===e&&!(l in o))&&Xn(o,l,f)}function Wo(o,l,f){var m=o[l];(!(jt.call(o,l)&&Un(m,f))||f===e&&!(l in o))&&Xn(o,l,f)}function $l(o,l){for(var f=o.length;f--;)if(Un(o[f][0],l))return f;return-1}function XL(o,l,f,m){return ji(o,function(b,M,A){l(m,b,f(b),A)}),m}function Y0(o,l){return o&&Qn(l,Re(l),o)}function ZL(o,l){return o&&Qn(l,un(l),o)}function Xn(o,l,f){l=="__proto__"&&Fl?Fl(o,l,{configurable:!0,enumerable:!0,value:f,writable:!0}):o[l]=f}function Qd(o,l){for(var f=-1,m=l.length,b=Y(m),M=o==null;++f<m;)b[f]=M?e:If(o,l[f]);return b}function Dr(o,l,f){return o===o&&(f!==e&&(o=o<=f?o:f),l!==e&&(o=o>=l?o:l)),o}function An(o,l,f,m,b,M){var A,R=l&y,z=l&_,j=l&x;if(f&&(A=b?f(o,m,b,M):f(o)),A!==e)return A;if(!fe(o))return o;var K=Et(o);if(K){if(A=zN(o),!R)return ln(o,A)}else{var et=qe(o),at=et==Bt||et==wt;if(Zi(o))return p_(o,R);if(et==bt||et==it||at&&!b){if(A=z||at?{}:P_(o),!R)return z?CN(o,ZL(A,o)):kN(o,Y0(A,o))}else{if(!k[et])return b?o:{};A=UN(o,et,R)}}M||(M=new Bn);var yt=M.get(o);if(yt)return yt;M.set(o,A),lb(o)?o.forEach(function(xt){A.add(An(xt,l,f,xt,o,M))}):ob(o)&&o.forEach(function(xt,zt){A.set(zt,An(xt,l,f,zt,o,M))});var St=j?z?bf:_f:z?un:Re,Nt=K?e:St(o);return yn(Nt||o,function(xt,zt){Nt&&(zt=xt,xt=o[zt]),Wo(A,zt,An(xt,l,f,zt,o,M))}),A}function QL(o){var l=Re(o);return function(f){return V0(f,o,l)}}function V0(o,l,f){var m=f.length;if(o==null)return!m;for(o=ne(o);m--;){var b=f[m],M=l[b],A=o[b];if(A===e&&!(b in o)||!M(A))return!1}return!0}function q0(o,l,f){if(typeof o!="function")throw new Cn(a);return Ko(function(){o.apply(e,f)},l)}function $o(o,l,f,m){var b=-1,M=Dl,A=!0,R=o.length,z=[],j=l.length;if(!R)return z;f&&(l=ue(l,_n(f))),m?(M=Bd,A=!1):l.length>=r&&(M=No,A=!1,l=new Mr(l));t:for(;++b<R;){var K=o[b],et=f==null?K:f(K);if(K=m||K!==0?K:0,A&&et===et){for(var at=j;at--;)if(l[at]===et)continue t;z.push(K)}else M(l,et,m)||z.push(K)}return z}var ji=b_(Zn),j0=b_(tf,!0);function JL(o,l){var f=!0;return ji(o,function(m,b,M){return f=!!l(m,b,M),f}),f}function Yl(o,l,f){for(var m=-1,b=o.length;++m<b;){var M=o[m],A=l(M);if(A!=null&&(R===e?A===A&&!xn(A):f(A,R)))var R=A,z=M}return z}function tN(o,l,f,m){var b=o.length;for(f=Lt(f),f<0&&(f=-f>b?0:b+f),m=m===e||m>b?b:Lt(m),m<0&&(m+=b),m=f>m?0:ub(m);f<m;)o[f++]=l;return o}function G0(o,l){var f=[];return ji(o,function(m,b,M){l(m,b,M)&&f.push(m)}),f}function Fe(o,l,f,m,b){var M=-1,A=o.length;for(f||(f=WN),b||(b=[]);++M<A;){var R=o[M];l>0&&f(R)?l>1?Fe(R,l-1,f,m,b):Yi(b,R):m||(b[b.length]=R)}return b}var Jd=x_(),K0=x_(!0);function Zn(o,l){return o&&Jd(o,l,Re)}function tf(o,l){return o&&K0(o,l,Re)}function Vl(o,l){return $i(l,function(f){return yi(o[f])})}function kr(o,l){l=Ki(l,o);for(var f=0,m=l.length;o!=null&&f<m;)o=o[zn(l[f++])];return f&&f==m?o:e}function X0(o,l,f){var m=l(o);return Et(o)?m:Yi(m,f(o))}function Xe(o){return o==null?o===e?Ie:ve:Sr&&Sr in ne(o)?NN(o):KN(o)}function ef(o,l){return o>l}function eN(o,l){return o!=null&&jt.call(o,l)}function nN(o,l){return o!=null&&l in ne(o)}function iN(o,l,f){return o>=Ve(l,f)&&o<ke(l,f)}function nf(o,l,f){for(var m=f?Bd:Dl,b=o[0].length,M=o.length,A=M,R=Y(M),z=1/0,j=[];A--;){var K=o[A];A&&l&&(K=ue(K,_n(l))),z=Ve(K.length,z),R[A]=!f&&(l||b>=120&&K.length>=120)?new Mr(A&&K):e}K=o[0];var et=-1,at=R[0];t:for(;++et<b&&j.length<z;){var yt=K[et],St=l?l(yt):yt;if(yt=f||yt!==0?yt:0,!(at?No(at,St):m(j,St,f))){for(A=M;--A;){var Nt=R[A];if(!(Nt?No(Nt,St):m(o[A],St,f)))continue t}at&&at.push(St),j.push(yt)}}return j}function rN(o,l,f,m){return Zn(o,function(b,M,A){l(m,f(b),M,A)}),m}function Yo(o,l,f){l=Ki(l,o),o=F_(o,l);var m=o==null?o:o[zn(Rn(l))];return m==null?e:mn(m,o,f)}function Z0(o){return ge(o)&&Xe(o)==it}function sN(o){return ge(o)&&Xe(o)==Ee}function oN(o){return ge(o)&&Xe(o)==gt}function Vo(o,l,f,m,b){return o===l?!0:o==null||l==null||!ge(o)&&!ge(l)?o!==o&&l!==l:aN(o,l,f,m,Vo,b)}function aN(o,l,f,m,b,M){var A=Et(o),R=Et(l),z=A?ft:qe(o),j=R?ft:qe(l);z=z==it?bt:z,j=j==it?bt:j;var K=z==bt,et=j==bt,at=z==j;if(at&&Zi(o)){if(!Zi(l))return!1;A=!0,K=!1}if(at&&!K)return M||(M=new Bn),A||ws(o)?A_(o,l,f,m,b,M):IN(o,l,z,f,m,b,M);if(!(f&v)){var yt=K&&jt.call(o,"__wrapped__"),St=et&&jt.call(l,"__wrapped__");if(yt||St){var Nt=yt?o.value():o,xt=St?l.value():l;return M||(M=new Bn),b(Nt,xt,f,m,M)}}return at?(M||(M=new Bn),LN(o,l,f,m,b,M)):!1}function lN(o){return ge(o)&&qe(o)==kt}function rf(o,l,f,m){var b=f.length,M=b,A=!m;if(o==null)return!M;for(o=ne(o);b--;){var R=f[b];if(A&&R[2]?R[1]!==o[R[0]]:!(R[0]in o))return!1}for(;++b<M;){R=f[b];var z=R[0],j=o[z],K=R[1];if(A&&R[2]){if(j===e&&!(z in o))return!1}else{var et=new Bn;if(m)var at=m(j,K,z,o,l,et);if(!(at===e?Vo(K,j,v|S,m,et):at))return!1}}return!0}function Q0(o){if(!fe(o)||YN(o))return!1;var l=yi(o)?lL:_d;return l.test(Or(o))}function cN(o){return ge(o)&&Xe(o)==Ae}function uN(o){return ge(o)&&qe(o)==oe}function dN(o){return ge(o)&&lc(o.length)&&!!ee[Xe(o)]}function J0(o){return typeof o=="function"?o:o==null?dn:typeof o=="object"?Et(o)?n_(o[0],o[1]):e_(o):vb(o)}function sf(o){if(!Go(o))return pL(o);var l=[];for(var f in ne(o))jt.call(o,f)&&f!="constructor"&&l.push(f);return l}function fN(o){if(!fe(o))return GN(o);var l=Go(o),f=[];for(var m in o)m=="constructor"&&(l||!jt.call(o,m))||f.push(m);return f}function of(o,l){return o<l}function t_(o,l){var f=-1,m=cn(o)?Y(o.length):[];return ji(o,function(b,M,A){m[++f]=l(b,M,A)}),m}function e_(o){var l=wf(o);return l.length==1&&l[0][2]?L_(l[0][0],l[0][1]):function(f){return f===o||rf(f,o,l)}}function n_(o,l){return Sf(o)&&I_(l)?L_(zn(o),l):function(f){var m=If(f,o);return m===e&&m===l?Lf(f,o):Vo(l,m,v|S)}}function ql(o,l,f,m,b){o!==l&&Jd(l,function(M,A){if(b||(b=new Bn),fe(M))hN(o,l,A,f,ql,m,b);else{var R=m?m(Mf(o,A),M,A+"",o,l,b):e;R===e&&(R=M),Zd(o,A,R)}},un)}function hN(o,l,f,m,b,M,A){var R=Mf(o,f),z=Mf(l,f),j=A.get(z);if(j){Zd(o,f,j);return}var K=M?M(R,z,f+"",o,l,A):e,et=K===e;if(et){var at=Et(z),yt=!at&&Zi(z),St=!at&&!yt&&ws(z);K=z,at||yt||St?Et(R)?K=R:_e(R)?K=ln(R):yt?(et=!1,K=p_(z,!0)):St?(et=!1,K=g_(z,!0)):K=[]:Xo(z)||Ar(z)?(K=R,Ar(R)?K=db(R):(!fe(R)||yi(R))&&(K=P_(z))):et=!1}et&&(A.set(z,K),b(K,z,m,M,A),A.delete(z)),Zd(o,f,K)}function i_(o,l){var f=o.length;if(f)return l+=l<0?f:0,mi(l,f)?o[l]:e}function r_(o,l,f){l.length?l=ue(l,function(M){return Et(M)?function(A){return kr(A,M.length===1?M[0]:M)}:M}):l=[dn];var m=-1;l=ue(l,_n(vt()));var b=t_(o,function(M,A,R){var z=ue(l,function(j){return j(M)});return{criteria:z,index:++m,value:M}});return UI(b,function(M,A){return DN(M,A,f)})}function pN(o,l){return s_(o,l,function(f,m){return Lf(o,m)})}function s_(o,l,f){for(var m=-1,b=l.length,M={};++m<b;){var A=l[m],R=kr(o,A);f(R,A)&&qo(M,Ki(A,o),R)}return M}function gN(o){return function(l){return kr(l,o)}}function af(o,l,f,m){var b=m?zI:us,M=-1,A=l.length,R=o;for(o===l&&(l=ln(l)),f&&(R=ue(o,_n(f)));++M<A;)for(var z=0,j=l[M],K=f?f(j):j;(z=b(R,K,z,m))>-1;)R!==o&&Nl.call(R,z,1),Nl.call(o,z,1);return o}function o_(o,l){for(var f=o?l.length:0,m=f-1;f--;){var b=l[f];if(f==m||b!==M){var M=b;mi(b)?Nl.call(o,b,1):df(o,b)}}return o}function lf(o,l){return o+zl(U0()*(l-o+1))}function mN(o,l,f,m){for(var b=-1,M=ke(Bl((l-o)/(f||1)),0),A=Y(M);M--;)A[m?M:++b]=o,o+=f;return A}function cf(o,l){var f="";if(!o||l<1||l>st)return f;do l%2&&(f+=o),l=zl(l/2),l&&(o+=o);while(l);return f}function Ft(o,l){return Df(N_(o,l,dn),o+"")}function yN(o){return $0(vs(o))}function _N(o,l){var f=vs(o);return nc(f,Dr(l,0,f.length))}function qo(o,l,f,m){if(!fe(o))return o;l=Ki(l,o);for(var b=-1,M=l.length,A=M-1,R=o;R!=null&&++b<M;){var z=zn(l[b]),j=f;if(z==="__proto__"||z==="constructor"||z==="prototype")return o;if(b!=A){var K=R[z];j=m?m(K,z,R):e,j===e&&(j=fe(K)?K:mi(l[b+1])?[]:{})}Wo(R,z,j),R=R[z]}return o}var a_=Ul?function(o,l){return Ul.set(o,l),o}:dn,bN=Fl?function(o,l){return Fl(o,"toString",{configurable:!0,enumerable:!1,value:Ff(l),writable:!0})}:dn;function xN(o){return nc(vs(o))}function En(o,l,f){var m=-1,b=o.length;l<0&&(l=-l>b?0:b+l),f=f>b?b:f,f<0&&(f+=b),b=l>f?0:f-l>>>0,l>>>=0;for(var M=Y(b);++m<b;)M[m]=o[m+l];return M}function wN(o,l){var f;return ji(o,function(m,b,M){return f=l(m,b,M),!f}),!!f}function jl(o,l,f){var m=0,b=o==null?m:o.length;if(typeof l=="number"&&l===l&&b<=_t){for(;m<b;){var M=m+b>>>1,A=o[M];A!==null&&!xn(A)&&(f?A<=l:A<l)?m=M+1:b=M}return b}return uf(o,l,dn,f)}function uf(o,l,f,m){var b=0,M=o==null?0:o.length;if(M===0)return 0;l=f(l);for(var A=l!==l,R=l===null,z=xn(l),j=l===e;b<M;){var K=zl((b+M)/2),et=f(o[K]),at=et!==e,yt=et===null,St=et===et,Nt=xn(et);if(A)var xt=m||St;else j?xt=St&&(m||at):R?xt=St&&at&&(m||!yt):z?xt=St&&at&&!yt&&(m||!Nt):yt||Nt?xt=!1:xt=m?et<=l:et<l;xt?b=K+1:M=K}return Ve(M,J)}function l_(o,l){for(var f=-1,m=o.length,b=0,M=[];++f<m;){var A=o[f],R=l?l(A):A;if(!f||!Un(R,z)){var z=R;M[b++]=A===0?0:A}}return M}function c_(o){return typeof o=="number"?o:xn(o)?H:+o}function bn(o){if(typeof o=="string")return o;if(Et(o))return ue(o,bn)+"";if(xn(o))return H0?H0.call(o):"";var l=o+"";return l=="0"&&1/o==-rt?"-0":l}function Gi(o,l,f){var m=-1,b=Dl,M=o.length,A=!0,R=[],z=R;if(f)A=!1,b=Bd;else if(M>=r){var j=l?null:RN(o);if(j)return Cl(j);A=!1,b=No,z=new Mr}else z=l?[]:R;t:for(;++m<M;){var K=o[m],et=l?l(K):K;if(K=f||K!==0?K:0,A&&et===et){for(var at=z.length;at--;)if(z[at]===et)continue t;l&&z.push(et),R.push(K)}else b(z,et,f)||(z!==R&&z.push(et),R.push(K))}return R}function df(o,l){l=Ki(l,o);var f=-1,m=l.length;if(!m)return!0;for(;++f<m;){var b=zn(l[f]);if(b==="__proto__"&&!jt.call(o,"__proto__")||(b==="constructor"||b==="prototype")&&f<m-1)return!1}var M=F_(o,l);return M==null||delete M[zn(Rn(l))]}function u_(o,l,f,m){return qo(o,l,f(kr(o,l)),m)}function Gl(o,l,f,m){for(var b=o.length,M=m?b:-1;(m?M--:++M<b)&&l(o[M],M,o););return f?En(o,m?0:M,m?M+1:b):En(o,m?M+1:0,m?b:M)}function d_(o,l){var f=o;return f instanceof Ut&&(f=f.value()),zd(l,function(m,b){return b.func.apply(b.thisArg,Yi([m],b.args))},f)}function ff(o,l,f){var m=o.length;if(m<2)return m?Gi(o[0]):[];for(var b=-1,M=Y(m);++b<m;)for(var A=o[b],R=-1;++R<m;)R!=b&&(M[b]=$o(M[b]||A,o[R],l,f));return Gi(Fe(M,1),l,f)}function f_(o,l,f){for(var m=-1,b=o.length,M=l.length,A={};++m<b;){var R=m<M?l[m]:e;f(A,o[m],R)}return A}function hf(o){return _e(o)?o:[]}function pf(o){return typeof o=="function"?o:dn}function Ki(o,l){return Et(o)?o:Sf(o,l)?[o]:H_(Gt(o))}var vN=Ft;function Xi(o,l,f){var m=o.length;return f=f===e?m:f,!l&&f>=m?o:En(o,l,f)}var h_=cL||function(o){return ce.clearTimeout(o)};function p_(o,l){if(l)return o.slice();var f=o.length,m=L0?L0(f):new o.constructor(f);return o.copy(m),m}function gf(o){var l=new o.constructor(o.byteLength);return new Il(l).set(new Il(o)),l}function SN(o,l){var f=l?gf(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.byteLength)}function TN(o){var l=new o.constructor(o.source,cl.exec(o));return l.lastIndex=o.lastIndex,l}function MN(o){return Ho?ne(Ho.call(o)):{}}function g_(o,l){var f=l?gf(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.length)}function m_(o,l){if(o!==l){var f=o!==e,m=o===null,b=o===o,M=xn(o),A=l!==e,R=l===null,z=l===l,j=xn(l);if(!R&&!j&&!M&&o>l||M&&A&&z&&!R&&!j||m&&A&&z||!f&&z||!b)return 1;if(!m&&!M&&!j&&o<l||j&&f&&b&&!m&&!M||R&&f&&b||!A&&b||!z)return-1}return 0}function DN(o,l,f){for(var m=-1,b=o.criteria,M=l.criteria,A=b.length,R=f.length;++m<A;){var z=m_(b[m],M[m]);if(z){if(m>=R)return z;var j=f[m];return z*(j=="desc"?-1:1)}}return o.index-l.index}function y_(o,l,f,m){for(var b=-1,M=o.length,A=f.length,R=-1,z=l.length,j=ke(M-A,0),K=Y(z+j),et=!m;++R<z;)K[R]=l[R];for(;++b<A;)(et||b<M)&&(K[f[b]]=o[b]);for(;j--;)K[R++]=o[b++];return K}function __(o,l,f,m){for(var b=-1,M=o.length,A=-1,R=f.length,z=-1,j=l.length,K=ke(M-R,0),et=Y(K+j),at=!m;++b<K;)et[b]=o[b];for(var yt=b;++z<j;)et[yt+z]=l[z];for(;++A<R;)(at||b<M)&&(et[yt+f[A]]=o[b++]);return et}function ln(o,l){var f=-1,m=o.length;for(l||(l=Y(m));++f<m;)l[f]=o[f];return l}function Qn(o,l,f,m){var b=!f;f||(f={});for(var M=-1,A=l.length;++M<A;){var R=l[M],z=m?m(f[R],o[R],R,f,o):e;z===e&&(z=o[R]),b?Xn(f,R,z):Wo(f,R,z)}return f}function kN(o,l){return Qn(o,vf(o),l)}function CN(o,l){return Qn(o,E_(o),l)}function Kl(o,l){return function(f,m){var b=Et(f)?PI:XL,M=l?l():{};return b(f,o,vt(m,2),M)}}function _s(o){return Ft(function(l,f){var m=-1,b=f.length,M=b>1?f[b-1]:e,A=b>2?f[2]:e;for(M=o.length>3&&typeof M=="function"?(b--,M):e,A&&Ze(f[0],f[1],A)&&(M=b<3?e:M,b=1),l=ne(l);++m<b;){var R=f[m];R&&o(l,R,m,M)}return l})}function b_(o,l){return function(f,m){if(f==null)return f;if(!cn(f))return o(f,m);for(var b=f.length,M=l?b:-1,A=ne(f);(l?M--:++M<b)&&m(A[M],M,A)!==!1;);return f}}function x_(o){return function(l,f,m){for(var b=-1,M=ne(l),A=m(l),R=A.length;R--;){var z=A[o?R:++b];if(f(M[z],z,M)===!1)break}return l}}function ON(o,l,f){var m=l&C,b=jo(o);function M(){var A=this&&this!==ce&&this instanceof M?b:o;return A.apply(m?f:this,arguments)}return M}function w_(o){return function(l){l=Gt(l);var f=ds(l)?Fn(l):e,m=f?f[0]:l.charAt(0),b=f?Xi(f,1).join(""):l.slice(1);return m[o]()+b}}function bs(o){return function(l){return zd(xb(bb(l).replace(Pd,"")),o,"")}}function jo(o){return function(){var l=arguments;switch(l.length){case 0:return new o;case 1:return new o(l[0]);case 2:return new o(l[0],l[1]);case 3:return new o(l[0],l[1],l[2]);case 4:return new o(l[0],l[1],l[2],l[3]);case 5:return new o(l[0],l[1],l[2],l[3],l[4]);case 6:return new o(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new o(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var f=ys(o.prototype),m=o.apply(f,l);return fe(m)?m:f}}function AN(o,l,f){var m=jo(o);function b(){for(var M=arguments.length,A=Y(M),R=M,z=xs(b);R--;)A[R]=arguments[R];var j=M<3&&A[0]!==z&&A[M-1]!==z?[]:Vi(A,z);if(M-=j.length,M<f)return D_(o,l,Xl,b.placeholder,e,A,j,e,e,f-M);var K=this&&this!==ce&&this instanceof b?m:o;return mn(K,this,A)}return b}function v_(o){return function(l,f,m){var b=ne(l);if(!cn(l)){var M=vt(f,3);l=Re(l),f=function(R){return M(b[R],R,b)}}var A=o(l,f,m);return A>-1?b[M?l[A]:A]:e}}function S_(o){return gi(function(l){var f=l.length,m=f,b=On.prototype.thru;for(o&&l.reverse();m--;){var M=l[m];if(typeof M!="function")throw new Cn(a);if(b&&!A&&tc(M)=="wrapper")var A=new On([],!0)}for(m=A?m:f;++m<f;){M=l[m];var R=tc(M),z=R=="wrapper"?xf(M):e;z&&Tf(z[0])&&z[1]==(T|P|B|D)&&!z[4].length&&z[9]==1?A=A[tc(z[0])].apply(A,z[3]):A=M.length==1&&Tf(M)?A[R]():A.thru(M)}return function(){var j=arguments,K=j[0];if(A&&j.length==1&&Et(K))return A.plant(K).value();for(var et=0,at=f?l[et].apply(this,j):K;++et<f;)at=l[et].call(this,at);return at}})}function Xl(o,l,f,m,b,M,A,R,z,j){var K=l&T,et=l&C,at=l&E,yt=l&(P|I),St=l&O,Nt=at?e:jo(o);function xt(){for(var zt=arguments.length,Ht=Y(zt),wn=zt;wn--;)Ht[wn]=arguments[wn];if(yt)var Qe=xs(xt),vn=WI(Ht,Qe);if(m&&(Ht=y_(Ht,m,b,yt)),M&&(Ht=__(Ht,M,A,yt)),zt-=vn,yt&&zt<j){var be=Vi(Ht,Qe);return D_(o,l,Xl,xt.placeholder,f,Ht,be,R,z,j-zt)}var Hn=et?f:this,bi=at?Hn[o]:o;return zt=Ht.length,R?Ht=XN(Ht,R):St&&zt>1&&Ht.reverse(),K&&z<zt&&(Ht.length=z),this&&this!==ce&&this instanceof xt&&(bi=Nt||jo(bi)),bi.apply(Hn,Ht)}return xt}function T_(o,l){return function(f,m){return rN(f,o,l(m),{})}}function Zl(o,l){return function(f,m){var b;if(f===e&&m===e)return l;if(f!==e&&(b=f),m!==e){if(b===e)return m;typeof f=="string"||typeof m=="string"?(f=bn(f),m=bn(m)):(f=c_(f),m=c_(m)),b=o(f,m)}return b}}function mf(o){return gi(function(l){return l=ue(l,_n(vt())),Ft(function(f){var m=this;return o(l,function(b){return mn(b,m,f)})})})}function Ql(o,l){l=l===e?" ":bn(l);var f=l.length;if(f<2)return f?cf(l,o):l;var m=cf(l,Bl(o/fs(l)));return ds(l)?Xi(Fn(m),0,o).join(""):m.slice(0,o)}function EN(o,l,f,m){var b=l&C,M=jo(o);function A(){for(var R=-1,z=arguments.length,j=-1,K=m.length,et=Y(K+z),at=this&&this!==ce&&this instanceof A?M:o;++j<K;)et[j]=m[j];for(;z--;)et[j++]=arguments[++R];return mn(at,b?f:this,et)}return A}function M_(o){return function(l,f,m){return m&&typeof m!="number"&&Ze(l,f,m)&&(f=m=e),l=_i(l),f===e?(f=l,l=0):f=_i(f),m=m===e?l<f?1:-1:_i(m),mN(l,f,m,o)}}function Jl(o){return function(l,f){return typeof l=="string"&&typeof f=="string"||(l=Pn(l),f=Pn(f)),o(l,f)}}function D_(o,l,f,m,b,M,A,R,z,j){var K=l&P,et=K?A:e,at=K?e:A,yt=K?M:e,St=K?e:M;l|=K?B:N,l&=~(K?N:B),l&U||(l&=-4);var Nt=[o,l,b,yt,et,St,at,R,z,j],xt=f.apply(e,Nt);return Tf(o)&&B_(xt,Nt),xt.placeholder=m,z_(xt,o,l)}function yf(o){var l=De[o];return function(f,m){if(f=Pn(f),m=m==null?0:Ve(Lt(m),292),m&&z0(f)){var b=(Gt(f)+"e").split("e"),M=l(b[0]+"e"+(+b[1]+m));return b=(Gt(M)+"e").split("e"),+(b[0]+"e"+(+b[1]-m))}return l(f)}}var RN=gs&&1/Cl(new gs([,-0]))[1]==rt?function(o){return new gs(o)}:Uf;function k_(o){return function(l){var f=qe(l);return f==kt?qd(l):f==oe?KI(l):HI(l,o(l))}}function pi(o,l,f,m,b,M,A,R){var z=l&E;if(!z&&typeof o!="function")throw new Cn(a);var j=m?m.length:0;if(j||(l&=-97,m=b=e),A=A===e?A:ke(Lt(A),0),R=R===e?R:Lt(R),j-=b?b.length:0,l&N){var K=m,et=b;m=b=e}var at=z?e:xf(o),yt=[o,l,f,m,b,K,et,M,A,R];if(at&&jN(yt,at),o=yt[0],l=yt[1],f=yt[2],m=yt[3],b=yt[4],R=yt[9]=yt[9]===e?z?0:o.length:ke(yt[9]-j,0),!R&&l&(P|I)&&(l&=-25),!l||l==C)var St=ON(o,l,f);else l==P||l==I?St=AN(o,l,R):(l==B||l==(C|B))&&!b.length?St=EN(o,l,f,m):St=Xl.apply(e,yt);var Nt=at?a_:B_;return z_(Nt(St,yt),o,l)}function C_(o,l,f,m){return o===e||Un(o,ps[f])&&!jt.call(m,f)?l:o}function O_(o,l,f,m,b,M){return fe(o)&&fe(l)&&(M.set(l,o),ql(o,l,e,O_,M),M.delete(l)),o}function PN(o){return Xo(o)?e:o}function A_(o,l,f,m,b,M){var A=f&v,R=o.length,z=l.length;if(R!=z&&!(A&&z>R))return!1;var j=M.get(o),K=M.get(l);if(j&&K)return j==l&&K==o;var et=-1,at=!0,yt=f&S?new Mr:e;for(M.set(o,l),M.set(l,o);++et<R;){var St=o[et],Nt=l[et];if(m)var xt=A?m(Nt,St,et,l,o,M):m(St,Nt,et,o,l,M);if(xt!==e){if(xt)continue;at=!1;break}if(yt){if(!Ud(l,function(zt,Ht){if(!No(yt,Ht)&&(St===zt||b(St,zt,f,m,M)))return yt.push(Ht)})){at=!1;break}}else if(!(St===Nt||b(St,Nt,f,m,M))){at=!1;break}}return M.delete(o),M.delete(l),at}function IN(o,l,f,m,b,M,A){switch(f){case gn:if(o.byteLength!=l.byteLength||o.byteOffset!=l.byteOffset)return!1;o=o.buffer,l=l.buffer;case Ee:return!(o.byteLength!=l.byteLength||!M(new Il(o),new Il(l)));case dt:case gt:case Dt:return Un(+o,+l);case It:return o.name==l.name&&o.message==l.message;case Ae:case on:return o==l+"";case kt:var R=qd;case oe:var z=m&v;if(R||(R=Cl),o.size!=l.size&&!z)return!1;var j=A.get(o);if(j)return j==l;m|=S,A.set(o,l);var K=A_(R(o),R(l),m,b,M,A);return A.delete(o),K;case qt:if(Ho)return Ho.call(o)==Ho.call(l)}return!1}function LN(o,l,f,m,b,M){var A=f&v,R=_f(o),z=R.length,j=_f(l),K=j.length;if(z!=K&&!A)return!1;for(var et=z;et--;){var at=R[et];if(!(A?at in l:jt.call(l,at)))return!1}var yt=M.get(o),St=M.get(l);if(yt&&St)return yt==l&&St==o;var Nt=!0;M.set(o,l),M.set(l,o);for(var xt=A;++et<z;){at=R[et];var zt=o[at],Ht=l[at];if(m)var wn=A?m(Ht,zt,at,l,o,M):m(zt,Ht,at,o,l,M);if(!(wn===e?zt===Ht||b(zt,Ht,f,m,M):wn)){Nt=!1;break}xt||(xt=at=="constructor")}if(Nt&&!xt){var Qe=o.constructor,vn=l.constructor;Qe!=vn&&"constructor"in o&&"constructor"in l&&!(typeof Qe=="function"&&Qe instanceof Qe&&typeof vn=="function"&&vn instanceof vn)&&(Nt=!1)}return M.delete(o),M.delete(l),Nt}function gi(o){return Df(N_(o,e,V_),o+"")}function _f(o){return X0(o,Re,vf)}function bf(o){return X0(o,un,E_)}var xf=Ul?function(o){return Ul.get(o)}:Uf;function tc(o){for(var l=o.name+"",f=ms[l],m=jt.call(ms,l)?f.length:0;m--;){var b=f[m],M=b.func;if(M==null||M==o)return b.name}return l}function xs(o){var l=jt.call(w,"placeholder")?w:o;return l.placeholder}function vt(){var o=w.iteratee||Bf;return o=o===Bf?J0:o,arguments.length?o(arguments[0],arguments[1]):o}function ec(o,l){var f=o.__data__;return $N(l)?f[typeof l=="string"?"string":"hash"]:f.map}function wf(o){for(var l=Re(o),f=l.length;f--;){var m=l[f],b=o[m];l[f]=[m,b,I_(b)]}return l}function Cr(o,l){var f=qI(o,l);return Q0(f)?f:e}function NN(o){var l=jt.call(o,Sr),f=o[Sr];try{o[Sr]=e;var m=!0}catch{}var b=Rl.call(o);return m&&(l?o[Sr]=f:delete o[Sr]),b}var vf=Gd?function(o){return o==null?[]:(o=ne(o),$i(Gd(o),function(l){return F0.call(o,l)}))}:Hf,E_=Gd?function(o){for(var l=[];o;)Yi(l,vf(o)),o=Ll(o);return l}:Hf,qe=Xe;(Kd&&qe(new Kd(new ArrayBuffer(1)))!=gn||Bo&&qe(new Bo)!=kt||Xd&&qe(Xd.resolve())!=Vt||gs&&qe(new gs)!=oe||zo&&qe(new zo)!=ie)&&(qe=function(o){var l=Xe(o),f=l==bt?o.constructor:e,m=f?Or(f):"";if(m)switch(m){case _L:return gn;case bL:return kt;case xL:return Vt;case wL:return oe;case vL:return ie}return l});function FN(o,l,f){for(var m=-1,b=f.length;++m<b;){var M=f[m],A=M.size;switch(M.type){case"drop":o+=A;break;case"dropRight":l-=A;break;case"take":l=Ve(l,o+A);break;case"takeRight":o=ke(o,l-A);break}}return{start:o,end:l}}function BN(o){var l=o.match(fd);return l?l[1].split(hd):[]}function R_(o,l,f){l=Ki(l,o);for(var m=-1,b=l.length,M=!1;++m<b;){var A=zn(l[m]);if(!(M=o!=null&&f(o,A)))break;o=o[A]}return M||++m!=b?M:(b=o==null?0:o.length,!!b&&lc(b)&&mi(A,b)&&(Et(o)||Ar(o)))}function zN(o){var l=o.length,f=new o.constructor(l);return l&&typeof o[0]=="string"&&jt.call(o,"index")&&(f.index=o.index,f.input=o.input),f}function P_(o){return typeof o.constructor=="function"&&!Go(o)?ys(Ll(o)):{}}function UN(o,l,f){var m=o.constructor;switch(l){case Ee:return gf(o);case dt:case gt:return new m(+o);case gn:return SN(o,f);case zi:case kn:case $e:case In:case li:case wo:case vo:case br:case ci:return g_(o,f);case kt:return new m;case Dt:case on:return new m(o);case Ae:return TN(o);case oe:return new m;case qt:return MN(o)}}function HN(o,l){var f=l.length;if(!f)return o;var m=f-1;return l[m]=(f>1?"& ":"")+l[m],l=l.join(f>2?", ":" "),o.replace(Ln,`{
8
+ /* [wrapped with `+l+`] */
9
+ `)}function WN(o){return Et(o)||Ar(o)||!!(B0&&o&&o[B0])}function mi(o,l){var f=typeof o;return l=l??st,!!l&&(f=="number"||f!="symbol"&&Wi.test(o))&&o>-1&&o%1==0&&o<l}function Ze(o,l,f){if(!fe(f))return!1;var m=typeof l;return(m=="number"?cn(f)&&mi(l,f.length):m=="string"&&l in f)?Un(f[l],o):!1}function Sf(o,l){if(Et(o))return!1;var f=typeof o;return f=="number"||f=="symbol"||f=="boolean"||o==null||xn(o)?!0:ui.test(o)||!al.test(o)||l!=null&&o in ne(l)}function $N(o){var l=typeof o;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?o!=="__proto__":o===null}function Tf(o){var l=tc(o),f=w[l];if(typeof f!="function"||!(l in Ut.prototype))return!1;if(o===f)return!0;var m=xf(f);return!!m&&o===m[0]}function YN(o){return!!I0&&I0 in o}var VN=Al?yi:Wf;function Go(o){var l=o&&o.constructor,f=typeof l=="function"&&l.prototype||ps;return o===f}function I_(o){return o===o&&!fe(o)}function L_(o,l){return function(f){return f==null?!1:f[o]===l&&(l!==e||o in ne(f))}}function qN(o){var l=oc(o,function(m){return f.size===h&&f.clear(),m}),f=l.cache;return l}function jN(o,l){var f=o[1],m=l[1],b=f|m,M=b<(C|E|T),A=m==T&&f==P||m==T&&f==D&&o[7].length<=l[8]||m==(T|D)&&l[7].length<=l[8]&&f==P;if(!(M||A))return o;m&C&&(o[2]=l[2],b|=f&C?0:U);var R=l[3];if(R){var z=o[3];o[3]=z?y_(z,R,l[4]):R,o[4]=z?Vi(o[3],g):l[4]}return R=l[5],R&&(z=o[5],o[5]=z?__(z,R,l[6]):R,o[6]=z?Vi(o[5],g):l[6]),R=l[7],R&&(o[7]=R),m&T&&(o[8]=o[8]==null?l[8]:Ve(o[8],l[8])),o[9]==null&&(o[9]=l[9]),o[0]=l[0],o[1]=b,o}function GN(o){var l=[];if(o!=null)for(var f in ne(o))l.push(f);return l}function KN(o){return Rl.call(o)}function N_(o,l,f){return l=ke(l===e?o.length-1:l,0),function(){for(var m=arguments,b=-1,M=ke(m.length-l,0),A=Y(M);++b<M;)A[b]=m[l+b];b=-1;for(var R=Y(l+1);++b<l;)R[b]=m[b];return R[l]=f(A),mn(o,this,R)}}function F_(o,l){return l.length<2?o:kr(o,En(l,0,-1))}function XN(o,l){for(var f=o.length,m=Ve(l.length,f),b=ln(o);m--;){var M=l[m];o[m]=mi(M,f)?b[M]:e}return o}function Mf(o,l){if(!(l==="constructor"&&typeof o[l]=="function")&&l!="__proto__")return o[l]}var B_=U_(a_),Ko=dL||function(o,l){return ce.setTimeout(o,l)},Df=U_(bN);function z_(o,l,f){var m=l+"";return Df(o,HN(m,ZN(BN(m),f)))}function U_(o){var l=0,f=0;return function(){var m=gL(),b=G-(m-f);if(f=m,b>0){if(++l>=tt)return arguments[0]}else l=0;return o.apply(e,arguments)}}function nc(o,l){var f=-1,m=o.length,b=m-1;for(l=l===e?m:l;++f<l;){var M=lf(f,b),A=o[M];o[M]=o[f],o[f]=A}return o.length=l,o}var H_=qN(function(o){var l=[];return o.charCodeAt(0)===46&&l.push(""),o.replace(cd,function(f,m,b,M){l.push(b?M.replace(gd,"$1"):m||f)}),l});function zn(o){if(typeof o=="string"||xn(o))return o;var l=o+"";return l=="0"&&1/o==-rt?"-0":l}function Or(o){if(o!=null){try{return El.call(o)}catch{}try{return o+""}catch{}}return""}function ZN(o,l){return yn(pt,function(f){var m="_."+f[0];l&f[1]&&!Dl(o,m)&&o.push(m)}),o.sort()}function W_(o){if(o instanceof Ut)return o.clone();var l=new On(o.__wrapped__,o.__chain__);return l.__actions__=ln(o.__actions__),l.__index__=o.__index__,l.__values__=o.__values__,l}function QN(o,l,f){(f?Ze(o,l,f):l===e)?l=1:l=ke(Lt(l),0);var m=o==null?0:o.length;if(!m||l<1)return[];for(var b=0,M=0,A=Y(Bl(m/l));b<m;)A[M++]=En(o,b,b+=l);return A}function JN(o){for(var l=-1,f=o==null?0:o.length,m=0,b=[];++l<f;){var M=o[l];M&&(b[m++]=M)}return b}function tF(){var o=arguments.length;if(!o)return[];for(var l=Y(o-1),f=arguments[0],m=o;m--;)l[m-1]=arguments[m];return Yi(Et(f)?ln(f):[f],Fe(l,1))}var eF=Ft(function(o,l){return _e(o)?$o(o,Fe(l,1,_e,!0)):[]}),nF=Ft(function(o,l){var f=Rn(l);return _e(f)&&(f=e),_e(o)?$o(o,Fe(l,1,_e,!0),vt(f,2)):[]}),iF=Ft(function(o,l){var f=Rn(l);return _e(f)&&(f=e),_e(o)?$o(o,Fe(l,1,_e,!0),e,f):[]});function rF(o,l,f){var m=o==null?0:o.length;return m?(l=f||l===e?1:Lt(l),En(o,l<0?0:l,m)):[]}function sF(o,l,f){var m=o==null?0:o.length;return m?(l=f||l===e?1:Lt(l),l=m-l,En(o,0,l<0?0:l)):[]}function oF(o,l){return o&&o.length?Gl(o,vt(l,3),!0,!0):[]}function aF(o,l){return o&&o.length?Gl(o,vt(l,3),!0):[]}function lF(o,l,f,m){var b=o==null?0:o.length;return b?(f&&typeof f!="number"&&Ze(o,l,f)&&(f=0,m=b),tN(o,l,f,m)):[]}function $_(o,l,f){var m=o==null?0:o.length;if(!m)return-1;var b=f==null?0:Lt(f);return b<0&&(b=ke(m+b,0)),kl(o,vt(l,3),b)}function Y_(o,l,f){var m=o==null?0:o.length;if(!m)return-1;var b=m-1;return f!==e&&(b=Lt(f),b=f<0?ke(m+b,0):Ve(b,m-1)),kl(o,vt(l,3),b,!0)}function V_(o){var l=o==null?0:o.length;return l?Fe(o,1):[]}function cF(o){var l=o==null?0:o.length;return l?Fe(o,rt):[]}function uF(o,l){var f=o==null?0:o.length;return f?(l=l===e?1:Lt(l),Fe(o,l)):[]}function dF(o){for(var l=-1,f=o==null?0:o.length,m={};++l<f;){var b=o[l];Xn(m,b[0],b[1])}return m}function q_(o){return o&&o.length?o[0]:e}function fF(o,l,f){var m=o==null?0:o.length;if(!m)return-1;var b=f==null?0:Lt(f);return b<0&&(b=ke(m+b,0)),us(o,l,b)}function hF(o){var l=o==null?0:o.length;return l?En(o,0,-1):[]}var pF=Ft(function(o){var l=ue(o,hf);return l.length&&l[0]===o[0]?nf(l):[]}),gF=Ft(function(o){var l=Rn(o),f=ue(o,hf);return l===Rn(f)?l=e:f.pop(),f.length&&f[0]===o[0]?nf(f,vt(l,2)):[]}),mF=Ft(function(o){var l=Rn(o),f=ue(o,hf);return l=typeof l=="function"?l:e,l&&f.pop(),f.length&&f[0]===o[0]?nf(f,e,l):[]});function yF(o,l){return o==null?"":hL.call(o,l)}function Rn(o){var l=o==null?0:o.length;return l?o[l-1]:e}function _F(o,l,f){var m=o==null?0:o.length;if(!m)return-1;var b=m;return f!==e&&(b=Lt(f),b=b<0?ke(m+b,0):Ve(b,m-1)),l===l?ZI(o,l,b):kl(o,D0,b,!0)}function bF(o,l){return o&&o.length?i_(o,Lt(l)):e}var xF=Ft(j_);function j_(o,l){return o&&o.length&&l&&l.length?af(o,l):o}function wF(o,l,f){return o&&o.length&&l&&l.length?af(o,l,vt(f,2)):o}function vF(o,l,f){return o&&o.length&&l&&l.length?af(o,l,e,f):o}var SF=gi(function(o,l){var f=o==null?0:o.length,m=Qd(o,l);return o_(o,ue(l,function(b){return mi(b,f)?+b:b}).sort(m_)),m});function TF(o,l){var f=[];if(!(o&&o.length))return f;var m=-1,b=[],M=o.length;for(l=vt(l,3);++m<M;){var A=o[m];l(A,m,o)&&(f.push(A),b.push(m))}return o_(o,b),f}function kf(o){return o==null?o:yL.call(o)}function MF(o,l,f){var m=o==null?0:o.length;return m?(f&&typeof f!="number"&&Ze(o,l,f)?(l=0,f=m):(l=l==null?0:Lt(l),f=f===e?m:Lt(f)),En(o,l,f)):[]}function DF(o,l){return jl(o,l)}function kF(o,l,f){return uf(o,l,vt(f,2))}function CF(o,l){var f=o==null?0:o.length;if(f){var m=jl(o,l);if(m<f&&Un(o[m],l))return m}return-1}function OF(o,l){return jl(o,l,!0)}function AF(o,l,f){return uf(o,l,vt(f,2),!0)}function EF(o,l){var f=o==null?0:o.length;if(f){var m=jl(o,l,!0)-1;if(Un(o[m],l))return m}return-1}function RF(o){return o&&o.length?l_(o):[]}function PF(o,l){return o&&o.length?l_(o,vt(l,2)):[]}function IF(o){var l=o==null?0:o.length;return l?En(o,1,l):[]}function LF(o,l,f){return o&&o.length?(l=f||l===e?1:Lt(l),En(o,0,l<0?0:l)):[]}function NF(o,l,f){var m=o==null?0:o.length;return m?(l=f||l===e?1:Lt(l),l=m-l,En(o,l<0?0:l,m)):[]}function FF(o,l){return o&&o.length?Gl(o,vt(l,3),!1,!0):[]}function BF(o,l){return o&&o.length?Gl(o,vt(l,3)):[]}var zF=Ft(function(o){return Gi(Fe(o,1,_e,!0))}),UF=Ft(function(o){var l=Rn(o);return _e(l)&&(l=e),Gi(Fe(o,1,_e,!0),vt(l,2))}),HF=Ft(function(o){var l=Rn(o);return l=typeof l=="function"?l:e,Gi(Fe(o,1,_e,!0),e,l)});function WF(o){return o&&o.length?Gi(o):[]}function $F(o,l){return o&&o.length?Gi(o,vt(l,2)):[]}function YF(o,l){return l=typeof l=="function"?l:e,o&&o.length?Gi(o,e,l):[]}function Cf(o){if(!(o&&o.length))return[];var l=0;return o=$i(o,function(f){if(_e(f))return l=ke(f.length,l),!0}),Yd(l,function(f){return ue(o,Hd(f))})}function G_(o,l){if(!(o&&o.length))return[];var f=Cf(o);return l==null?f:ue(f,function(m){return mn(l,e,m)})}var VF=Ft(function(o,l){return _e(o)?$o(o,l):[]}),qF=Ft(function(o){return ff($i(o,_e))}),jF=Ft(function(o){var l=Rn(o);return _e(l)&&(l=e),ff($i(o,_e),vt(l,2))}),GF=Ft(function(o){var l=Rn(o);return l=typeof l=="function"?l:e,ff($i(o,_e),e,l)}),KF=Ft(Cf);function XF(o,l){return f_(o||[],l||[],Wo)}function ZF(o,l){return f_(o||[],l||[],qo)}var QF=Ft(function(o){var l=o.length,f=l>1?o[l-1]:e;return f=typeof f=="function"?(o.pop(),f):e,G_(o,f)});function K_(o){var l=w(o);return l.__chain__=!0,l}function JF(o,l){return l(o),o}function ic(o,l){return l(o)}var tB=gi(function(o){var l=o.length,f=l?o[0]:0,m=this.__wrapped__,b=function(M){return Qd(M,o)};return l>1||this.__actions__.length||!(m instanceof Ut)||!mi(f)?this.thru(b):(m=m.slice(f,+f+(l?1:0)),m.__actions__.push({func:ic,args:[b],thisArg:e}),new On(m,this.__chain__).thru(function(M){return l&&!M.length&&M.push(e),M}))});function eB(){return K_(this)}function nB(){return new On(this.value(),this.__chain__)}function iB(){this.__values__===e&&(this.__values__=cb(this.value()));var o=this.__index__>=this.__values__.length,l=o?e:this.__values__[this.__index__++];return{done:o,value:l}}function rB(){return this}function sB(o){for(var l,f=this;f instanceof Wl;){var m=W_(f);m.__index__=0,m.__values__=e,l?b.__wrapped__=m:l=m;var b=m;f=f.__wrapped__}return b.__wrapped__=o,l}function oB(){var o=this.__wrapped__;if(o instanceof Ut){var l=o;return this.__actions__.length&&(l=new Ut(this)),l=l.reverse(),l.__actions__.push({func:ic,args:[kf],thisArg:e}),new On(l,this.__chain__)}return this.thru(kf)}function aB(){return d_(this.__wrapped__,this.__actions__)}var lB=Kl(function(o,l,f){jt.call(o,f)?++o[f]:Xn(o,f,1)});function cB(o,l,f){var m=Et(o)?T0:JL;return f&&Ze(o,l,f)&&(l=e),m(o,vt(l,3))}function uB(o,l){var f=Et(o)?$i:G0;return f(o,vt(l,3))}var dB=v_($_),fB=v_(Y_);function hB(o,l){return Fe(rc(o,l),1)}function pB(o,l){return Fe(rc(o,l),rt)}function gB(o,l,f){return f=f===e?1:Lt(f),Fe(rc(o,l),f)}function X_(o,l){var f=Et(o)?yn:ji;return f(o,vt(l,3))}function Z_(o,l){var f=Et(o)?II:j0;return f(o,vt(l,3))}var mB=Kl(function(o,l,f){jt.call(o,f)?o[f].push(l):Xn(o,f,[l])});function yB(o,l,f,m){o=cn(o)?o:vs(o),f=f&&!m?Lt(f):0;var b=o.length;return f<0&&(f=ke(b+f,0)),cc(o)?f<=b&&o.indexOf(l,f)>-1:!!b&&us(o,l,f)>-1}var _B=Ft(function(o,l,f){var m=-1,b=typeof l=="function",M=cn(o)?Y(o.length):[];return ji(o,function(A){M[++m]=b?mn(l,A,f):Yo(A,l,f)}),M}),bB=Kl(function(o,l,f){Xn(o,f,l)});function rc(o,l){var f=Et(o)?ue:t_;return f(o,vt(l,3))}function xB(o,l,f,m){return o==null?[]:(Et(l)||(l=l==null?[]:[l]),f=m?e:f,Et(f)||(f=f==null?[]:[f]),r_(o,l,f))}var wB=Kl(function(o,l,f){o[f?0:1].push(l)},function(){return[[],[]]});function vB(o,l,f){var m=Et(o)?zd:C0,b=arguments.length<3;return m(o,vt(l,4),f,b,ji)}function SB(o,l,f){var m=Et(o)?LI:C0,b=arguments.length<3;return m(o,vt(l,4),f,b,j0)}function TB(o,l){var f=Et(o)?$i:G0;return f(o,ac(vt(l,3)))}function MB(o){var l=Et(o)?$0:yN;return l(o)}function DB(o,l,f){(f?Ze(o,l,f):l===e)?l=1:l=Lt(l);var m=Et(o)?GL:_N;return m(o,l)}function kB(o){var l=Et(o)?KL:xN;return l(o)}function CB(o){if(o==null)return 0;if(cn(o))return cc(o)?fs(o):o.length;var l=qe(o);return l==kt||l==oe?o.size:sf(o).length}function OB(o,l,f){var m=Et(o)?Ud:wN;return f&&Ze(o,l,f)&&(l=e),m(o,vt(l,3))}var AB=Ft(function(o,l){if(o==null)return[];var f=l.length;return f>1&&Ze(o,l[0],l[1])?l=[]:f>2&&Ze(l[0],l[1],l[2])&&(l=[l[0]]),r_(o,Fe(l,1),[])}),sc=uL||function(){return ce.Date.now()};function EB(o,l){if(typeof l!="function")throw new Cn(a);return o=Lt(o),function(){if(--o<1)return l.apply(this,arguments)}}function Q_(o,l,f){return l=f?e:l,l=o&&l==null?o.length:l,pi(o,T,e,e,e,e,l)}function J_(o,l){var f;if(typeof l!="function")throw new Cn(a);return o=Lt(o),function(){return--o>0&&(f=l.apply(this,arguments)),o<=1&&(l=e),f}}var Of=Ft(function(o,l,f){var m=C;if(f.length){var b=Vi(f,xs(Of));m|=B}return pi(o,m,l,f,b)}),tb=Ft(function(o,l,f){var m=C|E;if(f.length){var b=Vi(f,xs(tb));m|=B}return pi(l,m,o,f,b)});function eb(o,l,f){l=f?e:l;var m=pi(o,P,e,e,e,e,e,l);return m.placeholder=eb.placeholder,m}function nb(o,l,f){l=f?e:l;var m=pi(o,I,e,e,e,e,e,l);return m.placeholder=nb.placeholder,m}function ib(o,l,f){var m,b,M,A,R,z,j=0,K=!1,et=!1,at=!0;if(typeof o!="function")throw new Cn(a);l=Pn(l)||0,fe(f)&&(K=!!f.leading,et="maxWait"in f,M=et?ke(Pn(f.maxWait)||0,l):M,at="trailing"in f?!!f.trailing:at);function yt(be){var Hn=m,bi=b;return m=b=e,j=be,A=o.apply(bi,Hn),A}function St(be){return j=be,R=Ko(zt,l),K?yt(be):A}function Nt(be){var Hn=be-z,bi=be-j,Sb=l-Hn;return et?Ve(Sb,M-bi):Sb}function xt(be){var Hn=be-z,bi=be-j;return z===e||Hn>=l||Hn<0||et&&bi>=M}function zt(){var be=sc();if(xt(be))return Ht(be);R=Ko(zt,Nt(be))}function Ht(be){return R=e,at&&m?yt(be):(m=b=e,A)}function wn(){R!==e&&h_(R),j=0,m=z=b=R=e}function Qe(){return R===e?A:Ht(sc())}function vn(){var be=sc(),Hn=xt(be);if(m=arguments,b=this,z=be,Hn){if(R===e)return St(z);if(et)return h_(R),R=Ko(zt,l),yt(z)}return R===e&&(R=Ko(zt,l)),A}return vn.cancel=wn,vn.flush=Qe,vn}var RB=Ft(function(o,l){return q0(o,1,l)}),PB=Ft(function(o,l,f){return q0(o,Pn(l)||0,f)});function IB(o){return pi(o,O)}function oc(o,l){if(typeof o!="function"||l!=null&&typeof l!="function")throw new Cn(a);var f=function(){var m=arguments,b=l?l.apply(this,m):m[0],M=f.cache;if(M.has(b))return M.get(b);var A=o.apply(this,m);return f.cache=M.set(b,A)||M,A};return f.cache=new(oc.Cache||hi),f}oc.Cache=hi;function ac(o){if(typeof o!="function")throw new Cn(a);return function(){var l=arguments;switch(l.length){case 0:return!o.call(this);case 1:return!o.call(this,l[0]);case 2:return!o.call(this,l[0],l[1]);case 3:return!o.call(this,l[0],l[1],l[2])}return!o.apply(this,l)}}function LB(o){return J_(2,o)}var NB=vN(function(o,l){l=l.length==1&&Et(l[0])?ue(l[0],_n(vt())):ue(Fe(l,1),_n(vt()));var f=l.length;return Ft(function(m){for(var b=-1,M=Ve(m.length,f);++b<M;)m[b]=l[b].call(this,m[b]);return mn(o,this,m)})}),Af=Ft(function(o,l){var f=Vi(l,xs(Af));return pi(o,B,e,l,f)}),rb=Ft(function(o,l){var f=Vi(l,xs(rb));return pi(o,N,e,l,f)}),FB=gi(function(o,l){return pi(o,D,e,e,e,l)});function BB(o,l){if(typeof o!="function")throw new Cn(a);return l=l===e?l:Lt(l),Ft(o,l)}function zB(o,l){if(typeof o!="function")throw new Cn(a);return l=l==null?0:ke(Lt(l),0),Ft(function(f){var m=f[l],b=Xi(f,0,l);return m&&Yi(b,m),mn(o,this,b)})}function UB(o,l,f){var m=!0,b=!0;if(typeof o!="function")throw new Cn(a);return fe(f)&&(m="leading"in f?!!f.leading:m,b="trailing"in f?!!f.trailing:b),ib(o,l,{leading:m,maxWait:l,trailing:b})}function HB(o){return Q_(o,1)}function WB(o,l){return Af(pf(l),o)}function $B(){if(!arguments.length)return[];var o=arguments[0];return Et(o)?o:[o]}function YB(o){return An(o,x)}function VB(o,l){return l=typeof l=="function"?l:e,An(o,x,l)}function qB(o){return An(o,y|x)}function jB(o,l){return l=typeof l=="function"?l:e,An(o,y|x,l)}function GB(o,l){return l==null||V0(o,l,Re(l))}function Un(o,l){return o===l||o!==o&&l!==l}var KB=Jl(ef),XB=Jl(function(o,l){return o>=l}),Ar=Z0((function(){return arguments})())?Z0:function(o){return ge(o)&&jt.call(o,"callee")&&!F0.call(o,"callee")},Et=Y.isArray,ZB=_0?_n(_0):sN;function cn(o){return o!=null&&lc(o.length)&&!yi(o)}function _e(o){return ge(o)&&cn(o)}function QB(o){return o===!0||o===!1||ge(o)&&Xe(o)==dt}var Zi=fL||Wf,JB=b0?_n(b0):oN;function tz(o){return ge(o)&&o.nodeType===1&&!Xo(o)}function ez(o){if(o==null)return!0;if(cn(o)&&(Et(o)||typeof o=="string"||typeof o.splice=="function"||Zi(o)||ws(o)||Ar(o)))return!o.length;var l=qe(o);if(l==kt||l==oe)return!o.size;if(Go(o))return!sf(o).length;for(var f in o)if(jt.call(o,f))return!1;return!0}function nz(o,l){return Vo(o,l)}function iz(o,l,f){f=typeof f=="function"?f:e;var m=f?f(o,l):e;return m===e?Vo(o,l,e,f):!!m}function Ef(o){if(!ge(o))return!1;var l=Xe(o);return l==It||l==lt||typeof o.message=="string"&&typeof o.name=="string"&&!Xo(o)}function rz(o){return typeof o=="number"&&z0(o)}function yi(o){if(!fe(o))return!1;var l=Xe(o);return l==Bt||l==wt||l==ut||l==Se}function sb(o){return typeof o=="number"&&o==Lt(o)}function lc(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=st}function fe(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function ge(o){return o!=null&&typeof o=="object"}var ob=x0?_n(x0):lN;function sz(o,l){return o===l||rf(o,l,wf(l))}function oz(o,l,f){return f=typeof f=="function"?f:e,rf(o,l,wf(l),f)}function az(o){return ab(o)&&o!=+o}function lz(o){if(VN(o))throw new Ct(s);return Q0(o)}function cz(o){return o===null}function uz(o){return o==null}function ab(o){return typeof o=="number"||ge(o)&&Xe(o)==Dt}function Xo(o){if(!ge(o)||Xe(o)!=bt)return!1;var l=Ll(o);if(l===null)return!0;var f=jt.call(l,"constructor")&&l.constructor;return typeof f=="function"&&f instanceof f&&El.call(f)==oL}var Rf=w0?_n(w0):cN;function dz(o){return sb(o)&&o>=-st&&o<=st}var lb=v0?_n(v0):uN;function cc(o){return typeof o=="string"||!Et(o)&&ge(o)&&Xe(o)==on}function xn(o){return typeof o=="symbol"||ge(o)&&Xe(o)==qt}var ws=S0?_n(S0):dN;function fz(o){return o===e}function hz(o){return ge(o)&&qe(o)==ie}function pz(o){return ge(o)&&Xe(o)==Te}var gz=Jl(of),mz=Jl(function(o,l){return o<=l});function cb(o){if(!o)return[];if(cn(o))return cc(o)?Fn(o):ln(o);if(Fo&&o[Fo])return GI(o[Fo]());var l=qe(o),f=l==kt?qd:l==oe?Cl:vs;return f(o)}function _i(o){if(!o)return o===0?o:0;if(o=Pn(o),o===rt||o===-rt){var l=o<0?-1:1;return l*ot}return o===o?o:0}function Lt(o){var l=_i(o),f=l%1;return l===l?f?l-f:l:0}function ub(o){return o?Dr(Lt(o),0,V):0}function Pn(o){if(typeof o=="number")return o;if(xn(o))return H;if(fe(o)){var l=typeof o.valueOf=="function"?o.valueOf():o;o=fe(l)?l+"":l}if(typeof o!="string")return o===0?o:+o;o=O0(o);var f=yd.test(o);return f||bd.test(o)?Nn(o.slice(2),f?2:8):md.test(o)?H:+o}function db(o){return Qn(o,un(o))}function yz(o){return o?Dr(Lt(o),-st,st):o===0?o:0}function Gt(o){return o==null?"":bn(o)}var _z=_s(function(o,l){if(Go(l)||cn(l)){Qn(l,Re(l),o);return}for(var f in l)jt.call(l,f)&&Wo(o,f,l[f])}),fb=_s(function(o,l){Qn(l,un(l),o)}),hb=_s(function(o,l,f,m){Qn(l,un(l),o,m)}),Pf=_s(function(o,l,f,m){Qn(l,Re(l),o,m)}),bz=gi(Qd);function xz(o,l){var f=ys(o);return l==null?f:Y0(f,l)}var wz=Ft(function(o,l){o=ne(o);var f=-1,m=l.length,b=m>2?l[2]:e;for(b&&Ze(l[0],l[1],b)&&(m=1);++f<m;)for(var M=l[f],A=un(M),R=-1,z=A.length;++R<z;){var j=A[R],K=o[j];(K===e||Un(K,ps[j])&&!jt.call(o,j))&&(o[j]=M[j])}return o}),vz=Ft(function(o){return o.push(e,O_),mn(pb,e,o)});function Sz(o,l){return M0(o,vt(l,3),Zn)}function Tz(o,l){return M0(o,vt(l,3),tf)}function Mz(o,l){return o==null?o:Jd(o,vt(l,3),un)}function Dz(o,l){return o==null?o:K0(o,vt(l,3),un)}function kz(o,l){return o&&Zn(o,vt(l,3))}function Cz(o,l){return o&&tf(o,vt(l,3))}function Oz(o){return o==null?[]:Vl(o,Re(o))}function Az(o){return o==null?[]:Vl(o,un(o))}function If(o,l,f){var m=o==null?e:kr(o,l);return m===e?f:m}function Ez(o,l){return o!=null&&R_(o,l,eN)}function Lf(o,l){return o!=null&&R_(o,l,nN)}var Rz=T_(function(o,l,f){l!=null&&typeof l.toString!="function"&&(l=Rl.call(l)),o[l]=f},Ff(dn)),Pz=T_(function(o,l,f){l!=null&&typeof l.toString!="function"&&(l=Rl.call(l)),jt.call(o,l)?o[l].push(f):o[l]=[f]},vt),Iz=Ft(Yo);function Re(o){return cn(o)?W0(o):sf(o)}function un(o){return cn(o)?W0(o,!0):fN(o)}function Lz(o,l){var f={};return l=vt(l,3),Zn(o,function(m,b,M){Xn(f,l(m,b,M),m)}),f}function Nz(o,l){var f={};return l=vt(l,3),Zn(o,function(m,b,M){Xn(f,b,l(m,b,M))}),f}var Fz=_s(function(o,l,f){ql(o,l,f)}),pb=_s(function(o,l,f,m){ql(o,l,f,m)}),Bz=gi(function(o,l){var f={};if(o==null)return f;var m=!1;l=ue(l,function(M){return M=Ki(M,o),m||(m=M.length>1),M}),Qn(o,bf(o),f),m&&(f=An(f,y|_|x,PN));for(var b=l.length;b--;)df(f,l[b]);return f});function zz(o,l){return gb(o,ac(vt(l)))}var Uz=gi(function(o,l){return o==null?{}:pN(o,l)});function gb(o,l){if(o==null)return{};var f=ue(bf(o),function(m){return[m]});return l=vt(l),s_(o,f,function(m,b){return l(m,b[0])})}function Hz(o,l,f){l=Ki(l,o);var m=-1,b=l.length;for(b||(b=1,o=e);++m<b;){var M=o==null?e:o[zn(l[m])];M===e&&(m=b,M=f),o=yi(M)?M.call(o):M}return o}function Wz(o,l,f){return o==null?o:qo(o,l,f)}function $z(o,l,f,m){return m=typeof m=="function"?m:e,o==null?o:qo(o,l,f,m)}var mb=k_(Re),yb=k_(un);function Yz(o,l,f){var m=Et(o),b=m||Zi(o)||ws(o);if(l=vt(l,4),f==null){var M=o&&o.constructor;b?f=m?new M:[]:fe(o)?f=yi(M)?ys(Ll(o)):{}:f={}}return(b?yn:Zn)(o,function(A,R,z){return l(f,A,R,z)}),f}function Vz(o,l){return o==null?!0:df(o,l)}function qz(o,l,f){return o==null?o:u_(o,l,pf(f))}function jz(o,l,f,m){return m=typeof m=="function"?m:e,o==null?o:u_(o,l,pf(f),m)}function vs(o){return o==null?[]:Vd(o,Re(o))}function Gz(o){return o==null?[]:Vd(o,un(o))}function Kz(o,l,f){return f===e&&(f=l,l=e),f!==e&&(f=Pn(f),f=f===f?f:0),l!==e&&(l=Pn(l),l=l===l?l:0),Dr(Pn(o),l,f)}function Xz(o,l,f){return l=_i(l),f===e?(f=l,l=0):f=_i(f),o=Pn(o),iN(o,l,f)}function Zz(o,l,f){if(f&&typeof f!="boolean"&&Ze(o,l,f)&&(l=f=e),f===e&&(typeof l=="boolean"?(f=l,l=e):typeof o=="boolean"&&(f=o,o=e)),o===e&&l===e?(o=0,l=1):(o=_i(o),l===e?(l=o,o=0):l=_i(l)),o>l){var m=o;o=l,l=m}if(f||o%1||l%1){var b=U0();return Ve(o+b*(l-o+Ye("1e-"+((b+"").length-1))),l)}return lf(o,l)}var Qz=bs(function(o,l,f){return l=l.toLowerCase(),o+(f?_b(l):l)});function _b(o){return Nf(Gt(o).toLowerCase())}function bb(o){return o=Gt(o),o&&o.replace(xd,$I).replace(Id,"")}function Jz(o,l,f){o=Gt(o),l=bn(l);var m=o.length;f=f===e?m:Dr(Lt(f),0,m);var b=f;return f-=l.length,f>=0&&o.slice(f,b)==l}function tU(o){return o=Gt(o),o&&od.test(o)?o.replace(ol,YI):o}function eU(o){return o=Gt(o),o&&ud.test(o)?o.replace(ko,"\\$&"):o}var nU=bs(function(o,l,f){return o+(f?"-":"")+l.toLowerCase()}),iU=bs(function(o,l,f){return o+(f?" ":"")+l.toLowerCase()}),rU=w_("toLowerCase");function sU(o,l,f){o=Gt(o),l=Lt(l);var m=l?fs(o):0;if(!l||m>=l)return o;var b=(l-m)/2;return Ql(zl(b),f)+o+Ql(Bl(b),f)}function oU(o,l,f){o=Gt(o),l=Lt(l);var m=l?fs(o):0;return l&&m<l?o+Ql(l-m,f):o}function aU(o,l,f){o=Gt(o),l=Lt(l);var m=l?fs(o):0;return l&&m<l?Ql(l-m,f)+o:o}function lU(o,l,f){return f||l==null?l=0:l&&(l=+l),mL(Gt(o).replace(Co,""),l||0)}function cU(o,l,f){return(f?Ze(o,l,f):l===e)?l=1:l=Lt(l),cf(Gt(o),l)}function uU(){var o=arguments,l=Gt(o[0]);return o.length<3?l:l.replace(o[1],o[2])}var dU=bs(function(o,l,f){return o+(f?"_":"")+l.toLowerCase()});function fU(o,l,f){return f&&typeof f!="number"&&Ze(o,l,f)&&(l=f=e),f=f===e?V:f>>>0,f?(o=Gt(o),o&&(typeof l=="string"||l!=null&&!Rf(l))&&(l=bn(l),!l&&ds(o))?Xi(Fn(o),0,f):o.split(l,f)):[]}var hU=bs(function(o,l,f){return o+(f?" ":"")+Nf(l)});function pU(o,l,f){return o=Gt(o),f=f==null?0:Dr(Lt(f),0,o.length),l=bn(l),o.slice(f,f+l.length)==l}function gU(o,l,f){var m=w.templateSettings;f&&Ze(o,l,f)&&(l=e),o=Gt(o),l=Pf({},l,m,C_);var b=Pf({},l.imports,m.imports,C_),M=Re(b),A=Vd(b,M);yn(M,function(xt){if(ll.test(xt))throw new Ct(u)});var R,z,j=0,K=l.interpolate||es,et="__p += '",at=jd((l.escape||es).source+"|"+K.source+"|"+(K===Do?Hi:es).source+"|"+(l.evaluate||es).source+"|$","g"),yt="//# sourceURL="+(jt.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Fd+"]")+`
10
+ `;o.replace(at,function(xt,zt,Ht,wn,Qe,vn){return Ht||(Ht=wn),et+=o.slice(j,vn).replace(wd,VI),zt&&(R=!0,et+=`' +
11
+ __e(`+zt+`) +
12
+ '`),Qe&&(z=!0,et+=`';
13
+ `+Qe+`;
14
+ __p += '`),Ht&&(et+=`' +
15
+ ((__t = (`+Ht+`)) == null ? '' : __t) +
16
+ '`),j=vn+xt.length,xt}),et+=`';
17
+ `;var St=jt.call(l,"variable")&&l.variable;if(!St)et=`with (obj) {
18
+ `+et+`
19
+ }
20
+ `;else if(ll.test(St))throw new Ct(c);et=(z?et.replace(So,""):et).replace(To,"$1").replace(Mo,"$1;"),et="function("+(St||"obj")+`) {
21
+ `+(St?"":`obj || (obj = {});
22
+ `)+"var __t, __p = ''"+(R?", __e = _.escape":"")+(z?`, __j = Array.prototype.join;
23
+ function print() { __p += __j.call(arguments, '') }
24
+ `:`;
25
+ `)+et+`return __p
26
+ }`;var Nt=wb(function(){return $t(M,yt+"return "+et).apply(e,A)});if(Nt.source=et,Ef(Nt))throw Nt;return Nt}function mU(o){return Gt(o).toLowerCase()}function yU(o){return Gt(o).toUpperCase()}function _U(o,l,f){if(o=Gt(o),o&&(f||l===e))return O0(o);if(!o||!(l=bn(l)))return o;var m=Fn(o),b=Fn(l),M=A0(m,b),A=E0(m,b)+1;return Xi(m,M,A).join("")}function bU(o,l,f){if(o=Gt(o),o&&(f||l===e))return o.slice(0,P0(o)+1);if(!o||!(l=bn(l)))return o;var m=Fn(o),b=E0(m,Fn(l))+1;return Xi(m,0,b).join("")}function xU(o,l,f){if(o=Gt(o),o&&(f||l===e))return o.replace(Co,"");if(!o||!(l=bn(l)))return o;var m=Fn(o),b=A0(m,Fn(l));return Xi(m,b).join("")}function wU(o,l){var f=L,m=W;if(fe(l)){var b="separator"in l?l.separator:b;f="length"in l?Lt(l.length):f,m="omission"in l?bn(l.omission):m}o=Gt(o);var M=o.length;if(ds(o)){var A=Fn(o);M=A.length}if(f>=M)return o;var R=f-fs(m);if(R<1)return m;var z=A?Xi(A,0,R).join(""):o.slice(0,R);if(b===e)return z+m;if(A&&(R+=z.length-R),Rf(b)){if(o.slice(R).search(b)){var j,K=z;for(b.global||(b=jd(b.source,Gt(cl.exec(b))+"g")),b.lastIndex=0;j=b.exec(K);)var et=j.index;z=z.slice(0,et===e?R:et)}}else if(o.indexOf(bn(b),R)!=R){var at=z.lastIndexOf(b);at>-1&&(z=z.slice(0,at))}return z+m}function vU(o){return o=Gt(o),o&&sd.test(o)?o.replace(Ui,QI):o}var SU=bs(function(o,l,f){return o+(f?" ":"")+l.toUpperCase()}),Nf=w_("toUpperCase");function xb(o,l,f){return o=Gt(o),l=f?e:l,l===e?jI(o)?eL(o):BI(o):o.match(l)||[]}var wb=Ft(function(o,l){try{return mn(o,e,l)}catch(f){return Ef(f)?f:new Ct(f)}}),TU=gi(function(o,l){return yn(l,function(f){f=zn(f),Xn(o,f,Of(o[f],o))}),o});function MU(o){var l=o==null?0:o.length,f=vt();return o=l?ue(o,function(m){if(typeof m[1]!="function")throw new Cn(a);return[f(m[0]),m[1]]}):[],Ft(function(m){for(var b=-1;++b<l;){var M=o[b];if(mn(M[0],this,m))return mn(M[1],this,m)}})}function DU(o){return QL(An(o,y))}function Ff(o){return function(){return o}}function kU(o,l){return o==null||o!==o?l:o}var CU=S_(),OU=S_(!0);function dn(o){return o}function Bf(o){return J0(typeof o=="function"?o:An(o,y))}function AU(o){return e_(An(o,y))}function EU(o,l){return n_(o,An(l,y))}var RU=Ft(function(o,l){return function(f){return Yo(f,o,l)}}),PU=Ft(function(o,l){return function(f){return Yo(o,f,l)}});function zf(o,l,f){var m=Re(l),b=Vl(l,m);f==null&&!(fe(l)&&(b.length||!m.length))&&(f=l,l=o,o=this,b=Vl(l,Re(l)));var M=!(fe(f)&&"chain"in f)||!!f.chain,A=yi(o);return yn(b,function(R){var z=l[R];o[R]=z,A&&(o.prototype[R]=function(){var j=this.__chain__;if(M||j){var K=o(this.__wrapped__),et=K.__actions__=ln(this.__actions__);return et.push({func:z,args:arguments,thisArg:o}),K.__chain__=j,K}return z.apply(o,Yi([this.value()],arguments))})}),o}function IU(){return ce._===this&&(ce._=aL),this}function Uf(){}function LU(o){return o=Lt(o),Ft(function(l){return i_(l,o)})}var NU=mf(ue),FU=mf(T0),BU=mf(Ud);function vb(o){return Sf(o)?Hd(zn(o)):gN(o)}function zU(o){return function(l){return o==null?e:kr(o,l)}}var UU=M_(),HU=M_(!0);function Hf(){return[]}function Wf(){return!1}function WU(){return{}}function $U(){return""}function YU(){return!0}function VU(o,l){if(o=Lt(o),o<1||o>st)return[];var f=V,m=Ve(o,V);l=vt(l),o-=V;for(var b=Yd(m,l);++f<o;)l(f);return b}function qU(o){return Et(o)?ue(o,zn):xn(o)?[o]:ln(H_(Gt(o)))}function jU(o){var l=++sL;return Gt(o)+l}var GU=Zl(function(o,l){return o+l},0),KU=yf("ceil"),XU=Zl(function(o,l){return o/l},1),ZU=yf("floor");function QU(o){return o&&o.length?Yl(o,dn,ef):e}function JU(o,l){return o&&o.length?Yl(o,vt(l,2),ef):e}function tH(o){return k0(o,dn)}function eH(o,l){return k0(o,vt(l,2))}function nH(o){return o&&o.length?Yl(o,dn,of):e}function iH(o,l){return o&&o.length?Yl(o,vt(l,2),of):e}var rH=Zl(function(o,l){return o*l},1),sH=yf("round"),oH=Zl(function(o,l){return o-l},0);function aH(o){return o&&o.length?$d(o,dn):0}function lH(o,l){return o&&o.length?$d(o,vt(l,2)):0}return w.after=EB,w.ary=Q_,w.assign=_z,w.assignIn=fb,w.assignInWith=hb,w.assignWith=Pf,w.at=bz,w.before=J_,w.bind=Of,w.bindAll=TU,w.bindKey=tb,w.castArray=$B,w.chain=K_,w.chunk=QN,w.compact=JN,w.concat=tF,w.cond=MU,w.conforms=DU,w.constant=Ff,w.countBy=lB,w.create=xz,w.curry=eb,w.curryRight=nb,w.debounce=ib,w.defaults=wz,w.defaultsDeep=vz,w.defer=RB,w.delay=PB,w.difference=eF,w.differenceBy=nF,w.differenceWith=iF,w.drop=rF,w.dropRight=sF,w.dropRightWhile=oF,w.dropWhile=aF,w.fill=lF,w.filter=uB,w.flatMap=hB,w.flatMapDeep=pB,w.flatMapDepth=gB,w.flatten=V_,w.flattenDeep=cF,w.flattenDepth=uF,w.flip=IB,w.flow=CU,w.flowRight=OU,w.fromPairs=dF,w.functions=Oz,w.functionsIn=Az,w.groupBy=mB,w.initial=hF,w.intersection=pF,w.intersectionBy=gF,w.intersectionWith=mF,w.invert=Rz,w.invertBy=Pz,w.invokeMap=_B,w.iteratee=Bf,w.keyBy=bB,w.keys=Re,w.keysIn=un,w.map=rc,w.mapKeys=Lz,w.mapValues=Nz,w.matches=AU,w.matchesProperty=EU,w.memoize=oc,w.merge=Fz,w.mergeWith=pb,w.method=RU,w.methodOf=PU,w.mixin=zf,w.negate=ac,w.nthArg=LU,w.omit=Bz,w.omitBy=zz,w.once=LB,w.orderBy=xB,w.over=NU,w.overArgs=NB,w.overEvery=FU,w.overSome=BU,w.partial=Af,w.partialRight=rb,w.partition=wB,w.pick=Uz,w.pickBy=gb,w.property=vb,w.propertyOf=zU,w.pull=xF,w.pullAll=j_,w.pullAllBy=wF,w.pullAllWith=vF,w.pullAt=SF,w.range=UU,w.rangeRight=HU,w.rearg=FB,w.reject=TB,w.remove=TF,w.rest=BB,w.reverse=kf,w.sampleSize=DB,w.set=Wz,w.setWith=$z,w.shuffle=kB,w.slice=MF,w.sortBy=AB,w.sortedUniq=RF,w.sortedUniqBy=PF,w.split=fU,w.spread=zB,w.tail=IF,w.take=LF,w.takeRight=NF,w.takeRightWhile=FF,w.takeWhile=BF,w.tap=JF,w.throttle=UB,w.thru=ic,w.toArray=cb,w.toPairs=mb,w.toPairsIn=yb,w.toPath=qU,w.toPlainObject=db,w.transform=Yz,w.unary=HB,w.union=zF,w.unionBy=UF,w.unionWith=HF,w.uniq=WF,w.uniqBy=$F,w.uniqWith=YF,w.unset=Vz,w.unzip=Cf,w.unzipWith=G_,w.update=qz,w.updateWith=jz,w.values=vs,w.valuesIn=Gz,w.without=VF,w.words=xb,w.wrap=WB,w.xor=qF,w.xorBy=jF,w.xorWith=GF,w.zip=KF,w.zipObject=XF,w.zipObjectDeep=ZF,w.zipWith=QF,w.entries=mb,w.entriesIn=yb,w.extend=fb,w.extendWith=hb,zf(w,w),w.add=GU,w.attempt=wb,w.camelCase=Qz,w.capitalize=_b,w.ceil=KU,w.clamp=Kz,w.clone=YB,w.cloneDeep=qB,w.cloneDeepWith=jB,w.cloneWith=VB,w.conformsTo=GB,w.deburr=bb,w.defaultTo=kU,w.divide=XU,w.endsWith=Jz,w.eq=Un,w.escape=tU,w.escapeRegExp=eU,w.every=cB,w.find=dB,w.findIndex=$_,w.findKey=Sz,w.findLast=fB,w.findLastIndex=Y_,w.findLastKey=Tz,w.floor=ZU,w.forEach=X_,w.forEachRight=Z_,w.forIn=Mz,w.forInRight=Dz,w.forOwn=kz,w.forOwnRight=Cz,w.get=If,w.gt=KB,w.gte=XB,w.has=Ez,w.hasIn=Lf,w.head=q_,w.identity=dn,w.includes=yB,w.indexOf=fF,w.inRange=Xz,w.invoke=Iz,w.isArguments=Ar,w.isArray=Et,w.isArrayBuffer=ZB,w.isArrayLike=cn,w.isArrayLikeObject=_e,w.isBoolean=QB,w.isBuffer=Zi,w.isDate=JB,w.isElement=tz,w.isEmpty=ez,w.isEqual=nz,w.isEqualWith=iz,w.isError=Ef,w.isFinite=rz,w.isFunction=yi,w.isInteger=sb,w.isLength=lc,w.isMap=ob,w.isMatch=sz,w.isMatchWith=oz,w.isNaN=az,w.isNative=lz,w.isNil=uz,w.isNull=cz,w.isNumber=ab,w.isObject=fe,w.isObjectLike=ge,w.isPlainObject=Xo,w.isRegExp=Rf,w.isSafeInteger=dz,w.isSet=lb,w.isString=cc,w.isSymbol=xn,w.isTypedArray=ws,w.isUndefined=fz,w.isWeakMap=hz,w.isWeakSet=pz,w.join=yF,w.kebabCase=nU,w.last=Rn,w.lastIndexOf=_F,w.lowerCase=iU,w.lowerFirst=rU,w.lt=gz,w.lte=mz,w.max=QU,w.maxBy=JU,w.mean=tH,w.meanBy=eH,w.min=nH,w.minBy=iH,w.stubArray=Hf,w.stubFalse=Wf,w.stubObject=WU,w.stubString=$U,w.stubTrue=YU,w.multiply=rH,w.nth=bF,w.noConflict=IU,w.noop=Uf,w.now=sc,w.pad=sU,w.padEnd=oU,w.padStart=aU,w.parseInt=lU,w.random=Zz,w.reduce=vB,w.reduceRight=SB,w.repeat=cU,w.replace=uU,w.result=Hz,w.round=sH,w.runInContext=F,w.sample=MB,w.size=CB,w.snakeCase=dU,w.some=OB,w.sortedIndex=DF,w.sortedIndexBy=kF,w.sortedIndexOf=CF,w.sortedLastIndex=OF,w.sortedLastIndexBy=AF,w.sortedLastIndexOf=EF,w.startCase=hU,w.startsWith=pU,w.subtract=oH,w.sum=aH,w.sumBy=lH,w.template=gU,w.times=VU,w.toFinite=_i,w.toInteger=Lt,w.toLength=ub,w.toLower=mU,w.toNumber=Pn,w.toSafeInteger=yz,w.toString=Gt,w.toUpper=yU,w.trim=_U,w.trimEnd=bU,w.trimStart=xU,w.truncate=wU,w.unescape=vU,w.uniqueId=jU,w.upperCase=SU,w.upperFirst=Nf,w.each=X_,w.eachRight=Z_,w.first=q_,zf(w,(function(){var o={};return Zn(w,function(l,f){jt.call(w.prototype,f)||(o[f]=l)}),o})(),{chain:!1}),w.VERSION=i,yn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){w[o].placeholder=w}),yn(["drop","take"],function(o,l){Ut.prototype[o]=function(f){f=f===e?1:ke(Lt(f),0);var m=this.__filtered__&&!l?new Ut(this):this.clone();return m.__filtered__?m.__takeCount__=Ve(f,m.__takeCount__):m.__views__.push({size:Ve(f,V),type:o+(m.__dir__<0?"Right":"")}),m},Ut.prototype[o+"Right"]=function(f){return this.reverse()[o](f).reverse()}}),yn(["filter","map","takeWhile"],function(o,l){var f=l+1,m=f==nt||f==Q;Ut.prototype[o]=function(b){var M=this.clone();return M.__iteratees__.push({iteratee:vt(b,3),type:f}),M.__filtered__=M.__filtered__||m,M}}),yn(["head","last"],function(o,l){var f="take"+(l?"Right":"");Ut.prototype[o]=function(){return this[f](1).value()[0]}}),yn(["initial","tail"],function(o,l){var f="drop"+(l?"":"Right");Ut.prototype[o]=function(){return this.__filtered__?new Ut(this):this[f](1)}}),Ut.prototype.compact=function(){return this.filter(dn)},Ut.prototype.find=function(o){return this.filter(o).head()},Ut.prototype.findLast=function(o){return this.reverse().find(o)},Ut.prototype.invokeMap=Ft(function(o,l){return typeof o=="function"?new Ut(this):this.map(function(f){return Yo(f,o,l)})}),Ut.prototype.reject=function(o){return this.filter(ac(vt(o)))},Ut.prototype.slice=function(o,l){o=Lt(o);var f=this;return f.__filtered__&&(o>0||l<0)?new Ut(f):(o<0?f=f.takeRight(-o):o&&(f=f.drop(o)),l!==e&&(l=Lt(l),f=l<0?f.dropRight(-l):f.take(l-o)),f)},Ut.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Ut.prototype.toArray=function(){return this.take(V)},Zn(Ut.prototype,function(o,l){var f=/^(?:filter|find|map|reject)|While$/.test(l),m=/^(?:head|last)$/.test(l),b=w[m?"take"+(l=="last"?"Right":""):l],M=m||/^find/.test(l);b&&(w.prototype[l]=function(){var A=this.__wrapped__,R=m?[1]:arguments,z=A instanceof Ut,j=R[0],K=z||Et(A),et=function(zt){var Ht=b.apply(w,Yi([zt],R));return m&&at?Ht[0]:Ht};K&&f&&typeof j=="function"&&j.length!=1&&(z=K=!1);var at=this.__chain__,yt=!!this.__actions__.length,St=M&&!at,Nt=z&&!yt;if(!M&&K){A=Nt?A:new Ut(this);var xt=o.apply(A,R);return xt.__actions__.push({func:ic,args:[et],thisArg:e}),new On(xt,at)}return St&&Nt?o.apply(this,R):(xt=this.thru(et),St?m?xt.value()[0]:xt.value():xt)})}),yn(["pop","push","shift","sort","splice","unshift"],function(o){var l=Ol[o],f=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",m=/^(?:pop|shift)$/.test(o);w.prototype[o]=function(){var b=arguments;if(m&&!this.__chain__){var M=this.value();return l.apply(Et(M)?M:[],b)}return this[f](function(A){return l.apply(Et(A)?A:[],b)})}}),Zn(Ut.prototype,function(o,l){var f=w[l];if(f){var m=f.name+"";jt.call(ms,m)||(ms[m]=[]),ms[m].push({name:l,func:f})}}),ms[Xl(e,E).name]=[{name:"wrapper",func:e}],Ut.prototype.clone=SL,Ut.prototype.reverse=TL,Ut.prototype.value=ML,w.prototype.at=tB,w.prototype.chain=eB,w.prototype.commit=nB,w.prototype.next=iB,w.prototype.plant=sB,w.prototype.reverse=oB,w.prototype.toJSON=w.prototype.valueOf=w.prototype.value=aB,w.prototype.first=w.prototype.head,Fo&&(w.prototype[Fo]=rB),w}),hs=nL();Kn?((Kn.exports=hs)._=hs,cs._=hs):ce._=hs}).call(_I)})(xo,xo.exports)),xo.exports}var p0=bI(),rl={exports:{}},xI=rl.exports,g0;function wI(){return g0||(g0=1,(function(n,t){(function(e,i){i()})(xI,function(){function e(d,h){return typeof h>"u"?h={autoBom:!1}:typeof h!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),h={autoBom:!h}),h.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(d.type)?new Blob(["\uFEFF",d],{type:d.type}):d}function i(d,h,g){var y=new XMLHttpRequest;y.open("GET",d),y.responseType="blob",y.onload=function(){u(y.response,h,g)},y.onerror=function(){console.error("could not download file")},y.send()}function r(d){var h=new XMLHttpRequest;h.open("HEAD",d,!1);try{h.send()}catch{}return 200<=h.status&&299>=h.status}function s(d){try{d.dispatchEvent(new MouseEvent("click"))}catch{var h=document.createEvent("MouseEvents");h.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),d.dispatchEvent(h)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Bi=="object"&&Bi.global===Bi?Bi:void 0,c=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!c?function(d,h,g){var y=a.URL||a.webkitURL,_=document.createElement("a");h=h||d.name||"download",_.download=h,_.rel="noopener",typeof d=="string"?(_.href=d,_.origin===location.origin?s(_):r(_.href)?i(d,h,g):s(_,_.target="_blank")):(_.href=y.createObjectURL(d),setTimeout(function(){y.revokeObjectURL(_.href)},4e4),setTimeout(function(){s(_)},0))}:"msSaveOrOpenBlob"in navigator?function(d,h,g){if(h=h||d.name||"download",typeof d!="string")navigator.msSaveOrOpenBlob(e(d,g),h);else if(r(d))i(d,h,g);else{var y=document.createElement("a");y.href=d,y.target="_blank",setTimeout(function(){s(y)})}}:function(d,h,g,y){if(y=y||open("","_blank"),y&&(y.document.title=y.document.body.innerText="downloading..."),typeof d=="string")return i(d,h,g);var _=d.type==="application/octet-stream",x=/constructor/i.test(a.HTMLElement)||a.safari,v=/CriOS\/[\d]+/.test(navigator.userAgent);if((v||_&&x||c)&&typeof FileReader<"u"){var S=new FileReader;S.onloadend=function(){var U=S.result;U=v?U:U.replace(/^data:[^;]*;/,"data:attachment/file;"),y?y.location.href=U:location=U,y=null},S.readAsDataURL(d)}else{var C=a.URL||a.webkitURL,E=C.createObjectURL(d);y?y.location=E:location.href=E,y=null,setTimeout(function(){C.revokeObjectURL(E)},4e4)}});a.saveAs=u.saveAs=u,n.exports=u})})(rl)),rl.exports}var vI=wI(),sl={exports:{}};var SI=sl.exports,m0;function TI(){return m0||(m0=1,(function(n,t){((e,i)=>{n.exports=i()})(SI,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},r,s=!i.document&&!!i.postMessage,a=i.IS_PAPA_WORKER||!1,c={},u=0,d={};function h(T){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(D){var O=I(D);O.chunkSize=parseInt(O.chunkSize),D.step||D.chunk||(O.chunkSize=null),this._handle=new v(O),(this._handle.streamer=this)._config=O}).call(this,T),this.parseChunk=function(D,O){var L=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<L){let tt=this._config.newline;tt||(W=this._config.quoteChar||'"',tt=this._handle.guessLineEndings(D,W)),D=[...D.split(tt).slice(L)].join(tt)}this.isFirstChunk&&N(this._config.beforeFirstChunk)&&(W=this._config.beforeFirstChunk(D))!==void 0&&(D=W),this.isFirstChunk=!1,this._halted=!1;var L=this._partialLine+D,W=(this._partialLine="",this._handle.parse(L,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(D=W.meta.cursor,L=(this._finished||(this._partialLine=L.substring(D-this._baseIndex),this._baseIndex=D),W&&W.data&&(this._rowCount+=W.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),a)i.postMessage({results:W,workerId:d.WORKER_ID,finished:L});else if(N(this._config.chunk)&&!O){if(this._config.chunk(W,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=W=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(W.data),this._completeResults.errors=this._completeResults.errors.concat(W.errors),this._completeResults.meta=W.meta),this._completed||!L||!N(this._config.complete)||W&&W.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),L||W&&W.meta.paused||this._nextChunk(),W}this._halted=!0},this._sendError=function(D){N(this._config.error)?this._config.error(D):a&&this._config.error&&i.postMessage({workerId:d.WORKER_ID,error:D,finished:!1})}}function g(T){var D;(T=T||{}).chunkSize||(T.chunkSize=d.RemoteChunkSize),h.call(this,T),this._nextChunk=s?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(O){this._input=O,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(D=new XMLHttpRequest,this._config.withCredentials&&(D.withCredentials=this._config.withCredentials),s||(D.onload=B(this._chunkLoaded,this),D.onerror=B(this._chunkError,this)),D.open(this._config.downloadRequestBody?"POST":"GET",this._input,!s),this._config.downloadRequestHeaders){var O,L=this._config.downloadRequestHeaders;for(O in L)D.setRequestHeader(O,L[O])}var W;this._config.chunkSize&&(W=this._start+this._config.chunkSize-1,D.setRequestHeader("Range","bytes="+this._start+"-"+W));try{D.send(this._config.downloadRequestBody)}catch(tt){this._chunkError(tt.message)}s&&D.status===0&&this._chunkError()}},this._chunkLoaded=function(){D.readyState===4&&(D.status<200||400<=D.status?this._chunkError():(this._start+=this._config.chunkSize||D.responseText.length,this._finished=!this._config.chunkSize||this._start>=(O=>(O=O.getResponseHeader("Content-Range"))!==null?parseInt(O.substring(O.lastIndexOf("/")+1)):-1)(D),this.parseChunk(D.responseText)))},this._chunkError=function(O){O=D.statusText||O,this._sendError(new Error(O))}}function y(T){(T=T||{}).chunkSize||(T.chunkSize=d.LocalChunkSize),h.call(this,T);var D,O,L=typeof FileReader<"u";this.stream=function(W){this._input=W,O=W.slice||W.webkitSlice||W.mozSlice,L?((D=new FileReader).onload=B(this._chunkLoaded,this),D.onerror=B(this._chunkError,this)):D=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var W=this._input,tt=(this._config.chunkSize&&(tt=Math.min(this._start+this._config.chunkSize,this._input.size),W=O.call(W,this._start,tt)),D.readAsText(W,this._config.encoding));L||this._chunkLoaded({target:{result:tt}})},this._chunkLoaded=function(W){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(W.target.result)},this._chunkError=function(){this._sendError(D.error)}}function _(T){var D;h.call(this,T=T||{}),this.stream=function(O){return D=O,this._nextChunk()},this._nextChunk=function(){var O,L;if(!this._finished)return O=this._config.chunkSize,D=O?(L=D.substring(0,O),D.substring(O)):(L=D,""),this._finished=!D,this.parseChunk(L)}}function x(T){h.call(this,T=T||{});var D=[],O=!0,L=!1;this.pause=function(){h.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){h.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(W){this._input=W,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){L&&D.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),D.length?this.parseChunk(D.shift()):O=!0},this._streamData=B(function(W){try{D.push(typeof W=="string"?W:W.toString(this._config.encoding)),O&&(O=!1,this._checkIsFinished(),this.parseChunk(D.shift()))}catch(tt){this._streamError(tt)}},this),this._streamError=B(function(W){this._streamCleanUp(),this._sendError(W)},this),this._streamEnd=B(function(){this._streamCleanUp(),L=!0,this._streamData("")},this),this._streamCleanUp=B(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function v(T){var D,O,L,W,tt=Math.pow(2,53),G=-tt,nt=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,X=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,Q=this,rt=0,st=0,ot=!1,H=!1,V=[],J={data:[],errors:[],meta:{}};function _t(ut){return T.skipEmptyLines==="greedy"?ut.join("").trim()==="":ut.length===1&&ut[0].length===0}function pt(){if(J&&L&&(ft("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+d.DefaultDelimiter+"'"),L=!1),T.skipEmptyLines&&(J.data=J.data.filter(function(lt){return!_t(lt)})),it()){let lt=function(It,Bt){N(T.transformHeader)&&(It=T.transformHeader(It,Bt)),V.push(It)};if(J)if(Array.isArray(J.data[0])){for(var ut=0;it()&&ut<J.data.length;ut++)J.data[ut].forEach(lt);J.data.splice(0,1)}else J.data.forEach(lt)}function dt(lt,It){for(var Bt=T.header?{}:[],wt=0;wt<lt.length;wt++){var kt=wt,Dt=lt[wt],Dt=((ve,bt)=>(Vt=>(T.dynamicTypingFunction&&T.dynamicTyping[Vt]===void 0&&(T.dynamicTyping[Vt]=T.dynamicTypingFunction(Vt)),(T.dynamicTyping[Vt]||T.dynamicTyping)===!0))(ve)?bt==="true"||bt==="TRUE"||bt!=="false"&&bt!=="FALSE"&&((Vt=>{if(nt.test(Vt)&&(Vt=parseFloat(Vt),G<Vt&&Vt<tt))return 1})(bt)?parseFloat(bt):X.test(bt)?new Date(bt):bt===""?null:bt):bt)(kt=T.header?wt>=V.length?"__parsed_extra":V[wt]:kt,Dt=T.transform?T.transform(Dt,kt):Dt);kt==="__parsed_extra"?(Bt[kt]=Bt[kt]||[],Bt[kt].push(Dt)):Bt[kt]=Dt}return T.header&&(wt>V.length?ft("FieldMismatch","TooManyFields","Too many fields: expected "+V.length+" fields but parsed "+wt,st+It):wt<V.length&&ft("FieldMismatch","TooFewFields","Too few fields: expected "+V.length+" fields but parsed "+wt,st+It)),Bt}var gt;J&&(T.header||T.dynamicTyping||T.transform)&&(gt=1,!J.data.length||Array.isArray(J.data[0])?(J.data=J.data.map(dt),gt=J.data.length):J.data=dt(J.data,0),T.header&&J.meta&&(J.meta.fields=V),st+=gt)}function it(){return T.header&&V.length===0}function ft(ut,dt,gt,lt){ut={type:ut,code:dt,message:gt},lt!==void 0&&(ut.row=lt),J.errors.push(ut)}N(T.step)&&(W=T.step,T.step=function(ut){J=ut,it()?pt():(pt(),J.data.length!==0&&(rt+=ut.data.length,T.preview&&rt>T.preview?O.abort():(J.data=J.data[0],W(J,Q))))}),this.parse=function(ut,dt,gt){var lt=T.quoteChar||'"',lt=(T.newline||(T.newline=this.guessLineEndings(ut,lt)),L=!1,T.delimiter?N(T.delimiter)&&(T.delimiter=T.delimiter(ut),J.meta.delimiter=T.delimiter):((lt=((It,Bt,wt,kt,Dt)=>{var ve,bt,Vt,Se;Dt=Dt||[","," ","|",";",d.RECORD_SEP,d.UNIT_SEP];for(var Ae=0;Ae<Dt.length;Ae++){for(var oe,on=Dt[Ae],qt=0,Ie=0,ie=0,Te=(Vt=void 0,new C({comments:kt,delimiter:on,newline:Bt,preview:10}).parse(It)),Ee=0;Ee<Te.data.length;Ee++)wt&&_t(Te.data[Ee])?ie++:(oe=Te.data[Ee].length,Ie+=oe,Vt===void 0?Vt=oe:0<oe&&(qt+=Math.abs(oe-Vt),Vt=oe));0<Te.data.length&&(Ie/=Te.data.length-ie),(bt===void 0||qt<=bt)&&(Se===void 0||Se<Ie)&&1.99<Ie&&(bt=qt,ve=on,Se=Ie)}return{successful:!!(T.delimiter=ve),bestDelimiter:ve}})(ut,T.newline,T.skipEmptyLines,T.comments,T.delimitersToGuess)).successful?T.delimiter=lt.bestDelimiter:(L=!0,T.delimiter=d.DefaultDelimiter),J.meta.delimiter=T.delimiter),I(T));return T.preview&&T.header&&lt.preview++,D=ut,O=new C(lt),J=O.parse(D,dt,gt),pt(),ot?{meta:{paused:!0}}:J||{meta:{paused:!1}}},this.paused=function(){return ot},this.pause=function(){ot=!0,O.abort(),D=N(T.chunk)?"":D.substring(O.getCharIndex())},this.resume=function(){Q.streamer._halted?(ot=!1,Q.streamer.parseChunk(D,!0)):setTimeout(Q.resume,3)},this.aborted=function(){return H},this.abort=function(){H=!0,O.abort(),J.meta.aborted=!0,N(T.complete)&&T.complete(J),D=""},this.guessLineEndings=function(It,lt){It=It.substring(0,1048576);var lt=new RegExp(S(lt)+"([^]*?)"+S(lt),"gm"),gt=(It=It.replace(lt,"")).split("\r"),lt=It.split(`
27
+ `),It=1<lt.length&&lt[0].length<gt[0].length;if(gt.length===1||It)return`
28
+ `;for(var Bt=0,wt=0;wt<gt.length;wt++)gt[wt][0]===`
29
+ `&&Bt++;return Bt>=gt.length/2?`\r
30
+ `:"\r"}}function S(T){return T.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function C(T){var D=(T=T||{}).delimiter,O=T.newline,L=T.comments,W=T.step,tt=T.preview,G=T.fastMode,nt=null,X=!1,Q=T.quoteChar==null?'"':T.quoteChar,rt=Q;if(T.escapeChar!==void 0&&(rt=T.escapeChar),(typeof D!="string"||-1<d.BAD_DELIMITERS.indexOf(D))&&(D=","),L===D)throw new Error("Comment character same as delimiter");L===!0?L="#":(typeof L!="string"||-1<d.BAD_DELIMITERS.indexOf(L))&&(L=!1),O!==`
31
+ `&&O!=="\r"&&O!==`\r
32
+ `&&(O=`
33
+ `);var st=0,ot=!1;this.parse=function(H,V,J){if(typeof H!="string")throw new Error("Input must be a string");var _t=H.length,pt=D.length,it=O.length,ft=L.length,ut=N(W),dt=[],gt=[],lt=[],It=st=0;if(!H)return qt();if(G||G!==!1&&H.indexOf(Q)===-1){for(var Bt=H.split(O),wt=0;wt<Bt.length;wt++){if(lt=Bt[wt],st+=lt.length,wt!==Bt.length-1)st+=O.length;else if(J)return qt();if(!L||lt.substring(0,ft)!==L){if(ut){if(dt=[],Se(lt.split(D)),Ie(),ot)return qt()}else Se(lt.split(D));if(tt&&tt<=wt)return dt=dt.slice(0,tt),qt(!0)}}return qt()}for(var kt=H.indexOf(D,st),Dt=H.indexOf(O,st),ve=new RegExp(S(rt)+S(Q),"g"),bt=H.indexOf(Q,st);;)if(H[st]===Q)for(bt=st,st++;;){if((bt=H.indexOf(Q,bt+1))===-1)return J||gt.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:dt.length,index:st}),oe();if(bt===_t-1)return oe(H.substring(st,bt).replace(ve,Q));if(Q===rt&&H[bt+1]===rt)bt++;else if(Q===rt||bt===0||H[bt-1]!==rt){kt!==-1&&kt<bt+1&&(kt=H.indexOf(D,bt+1));var Vt=Ae((Dt=Dt!==-1&&Dt<bt+1?H.indexOf(O,bt+1):Dt)===-1?kt:Math.min(kt,Dt));if(H.substr(bt+1+Vt,pt)===D){lt.push(H.substring(st,bt).replace(ve,Q)),H[st=bt+1+Vt+pt]!==Q&&(bt=H.indexOf(Q,st)),kt=H.indexOf(D,st),Dt=H.indexOf(O,st);break}if(Vt=Ae(Dt),H.substring(bt+1+Vt,bt+1+Vt+it)===O){if(lt.push(H.substring(st,bt).replace(ve,Q)),on(bt+1+Vt+it),kt=H.indexOf(D,st),bt=H.indexOf(Q,st),ut&&(Ie(),ot))return qt();if(tt&&dt.length>=tt)return qt(!0);break}gt.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:dt.length,index:st}),bt++}}else if(L&&lt.length===0&&H.substring(st,st+ft)===L){if(Dt===-1)return qt();st=Dt+it,Dt=H.indexOf(O,st),kt=H.indexOf(D,st)}else if(kt!==-1&&(kt<Dt||Dt===-1))lt.push(H.substring(st,kt)),st=kt+pt,kt=H.indexOf(D,st);else{if(Dt===-1)break;if(lt.push(H.substring(st,Dt)),on(Dt+it),ut&&(Ie(),ot))return qt();if(tt&&dt.length>=tt)return qt(!0)}return oe();function Se(ie){dt.push(ie),It=st}function Ae(ie){var Te=0;return Te=ie!==-1&&(ie=H.substring(bt+1,ie))&&ie.trim()===""?ie.length:Te}function oe(ie){return J||(ie===void 0&&(ie=H.substring(st)),lt.push(ie),st=_t,Se(lt),ut&&Ie()),qt()}function on(ie){st=ie,Se(lt),lt=[],Dt=H.indexOf(O,st)}function qt(ie){if(T.header&&!V&&dt.length&&!X){var Te=dt[0],Ee=Object.create(null),gn=new Set(Te);let zi=!1;for(let kn=0;kn<Te.length;kn++){let $e=Te[kn];if(Ee[$e=N(T.transformHeader)?T.transformHeader($e,kn):$e]){let In,li=Ee[$e];for(;In=$e+"_"+li,li++,gn.has(In););gn.add(In),Te[kn]=In,Ee[$e]++,zi=!0,(nt=nt===null?{}:nt)[In]=$e}else Ee[$e]=1,Te[kn]=$e;gn.add($e)}zi&&console.warn("Duplicate headers found and renamed."),X=!0}return{data:dt,errors:gt,meta:{delimiter:D,linebreak:O,aborted:ot,truncated:!!ie,cursor:It+(V||0),renamedHeaders:nt}}}function Ie(){W(qt()),dt=[],gt=[]}},this.abort=function(){ot=!0},this.getCharIndex=function(){return st}}function E(T){var D=T.data,O=c[D.workerId],L=!1;if(D.error)O.userError(D.error,D.file);else if(D.results&&D.results.data){var W={abort:function(){L=!0,U(D.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:P,resume:P};if(N(O.userStep)){for(var tt=0;tt<D.results.data.length&&(O.userStep({data:D.results.data[tt],errors:D.results.errors,meta:D.results.meta},W),!L);tt++);delete D.results}else N(O.userChunk)&&(O.userChunk(D.results,W,D.file),delete D.results)}D.finished&&!L&&U(D.workerId,D.results)}function U(T,D){var O=c[T];N(O.userComplete)&&O.userComplete(D),O.terminate(),delete c[T]}function P(){throw new Error("Not implemented.")}function I(T){if(typeof T!="object"||T===null)return T;var D,O=Array.isArray(T)?[]:{};for(D in T)O[D]=I(T[D]);return O}function B(T,D){return function(){T.apply(D,arguments)}}function N(T){return typeof T=="function"}return d.parse=function(T,D){var O=(D=D||{}).dynamicTyping||!1;if(N(O)&&(D.dynamicTypingFunction=O,O={}),D.dynamicTyping=O,D.transform=!!N(D.transform)&&D.transform,!D.worker||!d.WORKERS_SUPPORTED)return O=null,d.NODE_STREAM_INPUT,typeof T=="string"?(T=(L=>L.charCodeAt(0)!==65279?L:L.slice(1))(T),O=new(D.download?g:_)(D)):T.readable===!0&&N(T.read)&&N(T.on)?O=new x(D):(i.File&&T instanceof File||T instanceof Object)&&(O=new y(D)),O.stream(T);(O=(()=>{var L;return!!d.WORKERS_SUPPORTED&&(L=(()=>{var W=i.URL||i.webkitURL||null,tt=e.toString();return d.BLOB_URL||(d.BLOB_URL=W.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",tt,")();"],{type:"text/javascript"})))})(),(L=new i.Worker(L)).onmessage=E,L.id=u++,c[L.id]=L)})()).userStep=D.step,O.userChunk=D.chunk,O.userComplete=D.complete,O.userError=D.error,D.step=N(D.step),D.chunk=N(D.chunk),D.complete=N(D.complete),D.error=N(D.error),delete D.worker,O.postMessage({input:T,config:D,workerId:O.id})},d.unparse=function(T,D){var O=!1,L=!0,W=",",tt=`\r
34
+ `,G='"',nt=G+G,X=!1,Q=null,rt=!1,st=((()=>{if(typeof D=="object"){if(typeof D.delimiter!="string"||d.BAD_DELIMITERS.filter(function(V){return D.delimiter.indexOf(V)!==-1}).length||(W=D.delimiter),typeof D.quotes!="boolean"&&typeof D.quotes!="function"&&!Array.isArray(D.quotes)||(O=D.quotes),typeof D.skipEmptyLines!="boolean"&&typeof D.skipEmptyLines!="string"||(X=D.skipEmptyLines),typeof D.newline=="string"&&(tt=D.newline),typeof D.quoteChar=="string"&&(G=D.quoteChar),typeof D.header=="boolean"&&(L=D.header),Array.isArray(D.columns)){if(D.columns.length===0)throw new Error("Option columns is empty");Q=D.columns}D.escapeChar!==void 0&&(nt=D.escapeChar+G),D.escapeFormulae instanceof RegExp?rt=D.escapeFormulae:typeof D.escapeFormulae=="boolean"&&D.escapeFormulae&&(rt=/^[=+\-@\t\r].*$/)}})(),new RegExp(S(G),"g"));if(typeof T=="string"&&(T=JSON.parse(T)),Array.isArray(T)){if(!T.length||Array.isArray(T[0]))return ot(null,T,X);if(typeof T[0]=="object")return ot(Q||Object.keys(T[0]),T,X)}else if(typeof T=="object")return typeof T.data=="string"&&(T.data=JSON.parse(T.data)),Array.isArray(T.data)&&(T.fields||(T.fields=T.meta&&T.meta.fields||Q),T.fields||(T.fields=Array.isArray(T.data[0])?T.fields:typeof T.data[0]=="object"?Object.keys(T.data[0]):[]),Array.isArray(T.data[0])||typeof T.data[0]=="object"||(T.data=[T.data])),ot(T.fields||[],T.data||[],X);throw new Error("Unable to serialize unrecognized input");function ot(V,J,_t){var pt="",it=(typeof V=="string"&&(V=JSON.parse(V)),typeof J=="string"&&(J=JSON.parse(J)),Array.isArray(V)&&0<V.length),ft=!Array.isArray(J[0]);if(it&&L){for(var ut=0;ut<V.length;ut++)0<ut&&(pt+=W),pt+=H(V[ut],ut);0<J.length&&(pt+=tt)}for(var dt=0;dt<J.length;dt++){var gt=(it?V:J[dt]).length,lt=!1,It=it?Object.keys(J[dt]).length===0:J[dt].length===0;if(_t&&!it&&(lt=_t==="greedy"?J[dt].join("").trim()==="":J[dt].length===1&&J[dt][0].length===0),_t==="greedy"&&it){for(var Bt=[],wt=0;wt<gt;wt++){var kt=ft?V[wt]:wt;Bt.push(J[dt][kt])}lt=Bt.join("").trim()===""}if(!lt){for(var Dt=0;Dt<gt;Dt++){0<Dt&&!It&&(pt+=W);var ve=it&&ft?V[Dt]:Dt;pt+=H(J[dt][ve],Dt)}dt<J.length-1&&(!_t||0<gt&&!It)&&(pt+=tt)}}return pt}function H(V,J){var _t,pt;return V==null?"":V.constructor===Date?JSON.stringify(V).slice(1,25):(pt=!1,rt&&typeof V=="string"&&rt.test(V)&&(V="'"+V,pt=!0),_t=V.toString().replace(st,nt),(pt=pt||O===!0||typeof O=="function"&&O(V,J)||Array.isArray(O)&&O[J]||((it,ft)=>{for(var ut=0;ut<ft.length;ut++)if(-1<it.indexOf(ft[ut]))return!0;return!1})(_t,d.BAD_DELIMITERS)||-1<_t.indexOf(W)||_t.charAt(0)===" "||_t.charAt(_t.length-1)===" ")?G+_t+G:_t)}},d.RECORD_SEP="",d.UNIT_SEP="",d.BYTE_ORDER_MARK="\uFEFF",d.BAD_DELIMITERS=["\r",`
35
+ `,'"',d.BYTE_ORDER_MARK],d.WORKERS_SUPPORTED=!s&&!!i.Worker,d.NODE_STREAM_INPUT=1,d.LocalChunkSize=10485760,d.RemoteChunkSize=5242880,d.DefaultDelimiter=",",d.Parser=C,d.ParserHandle=v,d.NetworkStreamer=g,d.FileStreamer=y,d.StringStreamer=_,d.ReadableStreamStreamer=x,i.jQuery&&((r=i.jQuery).fn.parse=function(T){var D=T.config||{},O=[];return this.each(function(tt){if(!(r(this).prop("tagName").toUpperCase()==="INPUT"&&r(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var G=0;G<this.files.length;G++)O.push({file:this.files[G],inputElem:this,instanceConfig:r.extend({},D)})}),L(),this;function L(){if(O.length===0)N(T.complete)&&T.complete();else{var tt,G,nt,X,Q=O[0];if(N(T.before)){var rt=T.before(Q.file,Q.inputElem);if(typeof rt=="object"){if(rt.action==="abort")return tt="AbortError",G=Q.file,nt=Q.inputElem,X=rt.reason,void(N(T.error)&&T.error({name:tt},G,nt,X));if(rt.action==="skip")return void W();typeof rt.config=="object"&&(Q.instanceConfig=r.extend(Q.instanceConfig,rt.config))}else if(rt==="skip")return void W()}var st=Q.instanceConfig.complete;Q.instanceConfig.complete=function(ot){N(st)&&st(ot,Q.file,Q.inputElem),W()},d.parse(Q.file,Q.instanceConfig)}}function W(){O.splice(0,1),L()}}),a&&(i.onmessage=function(T){T=T.data,d.WORKER_ID===void 0&&T&&(d.WORKER_ID=T.workerId),typeof T.input=="string"?i.postMessage({workerId:d.WORKER_ID,results:d.parse(T.input,T.config),finished:!0}):(i.File&&T.input instanceof File||T.input instanceof Object)&&(T=d.parse(T.input,T.config))&&i.postMessage({workerId:d.WORKER_ID,results:T,finished:!0})}),(g.prototype=Object.create(h.prototype)).constructor=g,(y.prototype=Object.create(h.prototype)).constructor=y,(_.prototype=Object.create(_.prototype)).constructor=_,(x.prototype=Object.create(h.prototype)).constructor=x,d})})(sl)),sl.exports}var MI=TI();const DI=["id"],kI=p.defineComponent({__name:"VueJsonCsv",props:{data:{type:Array,required:!0},fields:{type:Array,required:!1,default:null},labels:{type:Object,required:!1,default:null},filename:{type:String,default:"report-data.csv"},delimiter:{type:String,default:",",required:!1},separatorExcel:{type:Boolean,default:!1},encoding:{type:String,default:"utf-8"},testing:{type:Boolean,required:!1,default:!1}},emits:["export-started","export-finished"],setup(n,{emit:t}){const e=t,i=n,r=p.computed(()=>`export_${new Date().getTime()}`),s=p.computed(()=>{const h=u();return h.length?h:null}),a=()=>{const h=i.labels;if(typeof i.fields!==_r.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof h===_r.Object?g=>p0.mapKeys(g,(y,_)=>h[_]||_):g=>g},c=()=>{const h=i.fields;if(typeof i.fields!==_r.Object&&!Array.isArray(h))throw new Error("Fields needs to be an array of strings.");return Array.isArray(h)?g=>p0.pick(g,h):g=>g},u=()=>{if(typeof i.fields===_r.Undefined&&typeof i.labels===_r.Undefined)return i.data;const h=a(),g=c();return i.data.map(y=>h(g(y)))},d=()=>{if(!s?.value){console.warn("No data to export");return}e("export-started",s.value);let h=MI.unparse(s.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(h="SEP="+i.delimiter+`\r
36
+ `+h),i.encoding==="utf-8"&&(h="\uFEFF"+h),e("export-finished",i.filename),!i.testing){const g=new Blob([h],{type:"text/csv;charset="+i.encoding});vI.saveAs(g,i.filename)}};return(h,g)=>(p.openBlock(),p.createElementBlock("div",{id:r.value,"data-testid":"export-csv",onClick:d},[p.renderSlot(h.$slots,"default",{},()=>[p.createTextVNode("Download "+p.toDisplayString(n.filename),1)])],8,DI))}}),CI=p.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=p.computed(()=>Object.keys(t.headers));return(i,r)=>(p.openBlock(),p.createElementBlock("div",null,[p.createVNode(kI,{data:n.rows,fields:e.value,filename:n.filename,labels:n.headers},{default:p.withCtx(()=>[p.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),OI={class:"kong-ui-public-csv-export-modal"},AI={key:0,class:"selected-range"},EI={key:4,class:"text-muted",tag:"span"},y0=3,RI=p.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(n,{emit:t}){const{i18n:e}=Pt.useI18n(),i=n,r=t,s=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,a=p.ref(1),c=p.computed(()=>y.value.rows.length),u=p.computed(()=>i.exportState.status==="success"&&!!i.exportState.chartData?.data?.length),d=p.computed(()=>i.exportState.status!=="success"?"":Pt.useChartSelectedRange(p.toRef(i.exportState,"chartData"))),h=p.computed(()=>i.exportState.status!=="success"?"":e.t("csvExport.previewRows",{rowsMax:Math.min(y0,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),g=()=>{r("closeModal")},y=p.computed(()=>{if(i.exportState.status!=="success"||!u.value||!i.exportState.chartData?.meta.metric_names)return{headers:[],rows:[],csvHeaders:{}};const x=i.exportState.chartData,v=x.data.some(I=>I.timestamp!==x.data[0].timestamp),S=x.data.map(I=>{const B=new Date(I.timestamp);return{...Object.keys(I.event).reduce((T,D)=>{if(D in x.meta.display){const O=I.event[D],L=x.meta.display[D];T[D]=O&&L&&L[O].name||I.event[D]}else T[D]=I.event[D];return T},{}),...v?{timestamp:Iu(B,"yyyy-MM-dd HH:mm:ss"),tzOffset:Iu(B,"XXX")}:{}}});let C=[];v&&(C=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const E="display"in i.exportState.chartData.meta&&i.exportState.chartData.meta?.display?i.exportState.chartData.meta?.display:{},U=[...C,...Object.keys(E).map(I=>({label:e.t(`chartLabels.${I}`),key:I})),...i.exportState.chartData.meta.metric_names.map(I=>({label:e.t(`chartLabels.${I}`),key:I}))],P=U.reduce((I,B)=>(I[B.key]=B.label,I),{});return{headers:U,csvHeaders:P,rows:S}}),_=async()=>{if(i.exportState.status!=="success")return{total:0,data:[]};const{rows:x}=y.value;return{total:Number(x.length)||0,data:x.slice(0,y0)}};return p.watch(y,()=>{a.value++}),(x,v)=>{const S=p.resolveComponent("KSkeleton"),C=p.resolveComponent("KEmptyState"),E=p.resolveComponent("KTableData"),U=p.resolveComponent("KTooltip"),P=p.resolveComponent("KButton"),I=p.resolveComponent("KModal");return p.openBlock(),p.createElementBlock("div",OI,[p.createVNode(I,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:p.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:g,onKeyup:p.withKeys(g,["esc"])},{default:p.withCtx(()=>[p.createElementVNode("div",null,[n.exportState.status==="success"&&u.value?(p.openBlock(),p.createElementBlock("div",AI,[p.createElementVNode("p",null,p.toDisplayString(n.modalDescription?n.modalDescription:p.unref(e).t("csvExport.exportDescription")),1),p.createElementVNode("p",null,p.toDisplayString(p.unref(e).t("csvExport.exportTimeRange"))+": "+p.toDisplayString(d.value),1)])):p.createCommentVNode("",!0),n.exportState.status==="loading"?(p.openBlock(),p.createBlock(S,{key:1,class:"chart-skeleton",type:"table"})):n.exportState.status==="success"?(p.openBlock(),p.createBlock(E,{key:2,class:"vitals-table",fetcher:_,"fetcher-cache-key":String(a.value),headers:y.value?.headers||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":p.withCtx(()=>[p.createVNode(C,{"action-button-visible":!1},{title:p.withCtx(()=>[p.createElementVNode("h5",null,p.toDisplayString(p.unref(e).t("csvExport.noDataRange")),1)]),default:p.withCtx(()=>[p.createElementVNode("p",null,p.toDisplayString(p.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):n.exportState.status==="error"?(p.openBlock(),p.createBlock(C,{key:3,"action-button-visible":!1},{title:p.withCtx(()=>[p.createElementVNode("h5",null,p.toDisplayString(p.unref(e).t("csvExport.dataError")),1)]),_:1})):p.createCommentVNode("",!0),n.exportState.status==="success"&&u.value?(p.openBlock(),p.createElementBlock("div",EI,[p.createTextVNode(p.toDisplayString(h.value)+" ",1),p.createVNode(U,{class:"preview-tooltip",placement:"right",text:p.unref(e).t("csvExport.maximumRecordAmount",{value:p.unref(wD)})},{default:p.withCtx(()=>[p.createVNode(p.unref(Ss.InfoIcon),{color:`var(--kui-color-text-neutral, ${p.unref(vu)})`,size:`var(--kui-icon-size-30, ${p.unref(so)})`},null,8,["color","size"])]),_:1},8,["text"])])):p.createCommentVNode("",!0)])]),"footer-actions":p.withCtx(()=>[p.createVNode(P,{appearance:"tertiary",class:"cancel-btn",onClick:g},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("csvExport.cancelButton")),1)]),_:1}),p.createVNode(CI,{class:"vitals-report-export-button",filename:s,headers:y.value.csvHeaders,rows:y.value.rows},{default:p.withCtx(()=>[p.createVNode(P,{appearance:"primary","data-testid":"csv-download-button",disabled:n.exportState.status!=="success"||!u.value},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}});Jt.AnalyticsChart=U2,Jt.ChartLegendPosition=sn,Jt.CsvExportModal=RI,Jt.DECIMAL_DISPLAY=HC,Jt.FONT_SIZE_REGULAR=Rm,Jt.FONT_SIZE_SMALL=Em,Jt.MAX_LABEL_LENGTH=$a,Jt.SimpleChart=nI,Jt.SparklineChart=yI,Jt.TopNTable=hI,Jt.ValidType=_r,Jt.chartTypes=k2,Jt.handleQueryError=cE,Jt.isCancellationError=Jm,Jt.lookupStatusCodeColor=Fm,Jt.simpleChartMetricDisplay=D2,Jt.simpleChartTypes=C2,Jt.statusCodeBadgeBackgroundColor=_A,Object.defineProperty(Jt,Symbol.toStringTag,{value:"Module"})}));