@kong-ui-public/analytics-chart 10.25.12 → 10.25.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vitals-chart.es.js +2007 -2018
- package/dist/vitals-chart.umd.js +22 -22
- package/package.json +8 -8
package/dist/vitals-chart.umd.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
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 Mb={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_gateway:"AI gateway",ai_gateway_agent:"AI gateway agent",ai_gateway_consumer:"AI gateway consumer",ai_gateway_data_plane_node:"AI gateway data plane node",ai_gateway_mcp_server:"AI gateway MCP server",ai_gateway_model:"AI gateway model",ai_plugin:"AI plugin",ai_provider:"Provider",ai_request_model:"Request model",ai_response_model:"Response model",error_rate:"Error rate",request_count:"Request count",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",response_latency_average:"Response latency (avg)",response_latency_p99:"Response latency (p99)",response_latency_p95:"Response latency (p95)",response_latency_p50:"Response latency (p50)",kong_latency_average:"Kong latency (avg)",kong_latency_p99:"Kong latency (p99)",kong_latency_p95:"Kong latency (p95)",kong_latency_p50:"Kong latency (p50)",kong_internal_latency_average:"Kong internal latency (avg)",kong_internal_latency_p99:"Kong internal latency (p99)",kong_internal_latency_p95:"Kong internal latency (p95)",kong_internal_latency_p50:"Kong internal latency (p50)",llm_cache_status:"Cache status",llm_embeddings_model:"Embeddings model",llm_embeddings_provider:"Embeddings provider",upstream_latency_average:"Upstream latency (avg)",upstream_latency_p99:"Upstream latency (p99)",upstream_latency_p95:"Upstream latency (p95)",upstream_latency_p50:"Upstream latency (p50)",response_size_p99:"Response size (p99)",response_size_p95:"Response size (p95)",response_size_p50:"Response size (p50)",response_size_average:"Response size (avg)",response_size_sum:"Response size (sum)",response_source:"Response source",request_size_p99:"Request size (p99)",request_size_p95:"Request size (p95)",request_size_p50:"Request size (p50)",request_size_average:"Request size (avg)",request_size_sum:"Request size (sum)",control_plane:"Control plane",control_plane_group:"Control plane group",consumer:"Consumer",oidc_credential:"OIDC credential",country_code:"Country",country:"Country",data_plane_node:"Data plane node",data_plane_node_version:"Data plane node version",api_package:"API package",api_product:"API product",api_product_version:"API product version",portal:"Portal",realm:"Realm",runtime_group:"Runtime group",gateway_service:"Gateway service",route:"Route",application:"Application",status_code:"Status code",status_code_grouped:"Status code (grouped)",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",principal:"Principal",virtual_cluster_id:"Virtual cluster",backend_cluster_id:"Backend cluster",listener_id:"Listener",principal_name:"Principal name",principal_type:"Principal type",request_type:"Request type",topic_name:"Topic name",partition_index:"Partition index",api_key:"API key",data_plane_group:"Data plane group",managed_cache:"Managed cache",network:"Network",provider:"Provider",provider_region:"Provider region",region:"Region",cache_eviction_rate:"Cache eviction rate",cache_expiration_rate:"Cache expiration rate",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max)",cache_status:"Cache status",cache_hit_rate:"Cache hit rate"},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}",cached_tokens:"Cached tokens",time_to_first_token_average:"Time to first token (avg)",time_per_token_average:"Time per token (avg)"},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 kb(){const n=$f.createI18n("en-us",Mb);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],Cb=n=>uc[(n&240)>>4]+uc[n&15],Zo=n=>(n&240)>>4===(n&15),Ob=n=>Zo(n.r)&&Zo(n.g)&&Zo(n.b)&&Zo(n.a);function Ab(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 Eb=(n,t)=>n<255?t(n):"";function Rb(n){var t=Ob(n)?Db:Cb;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Eb(n.a,t):void 0}const Pb=/^(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 Ib(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 Lb(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 Nb(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=Nb(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 Fb(n,t,e){return fc(Lb,n,t,e)}function Bb(n,t,e){return fc(Ib,n,t,e)}function qf(n){return(n%360+360)%360}function zb(n){const t=Pb.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=Fb(r,s,a):t[1]==="hsv"?i=Bb(r,s,a):i=hc(r,s,a),{r:i[0],g:i[1],b:i[2],a:e}}function Ub(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 Hb(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 Wb(){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 $b(n){Qo||(Qo=Wb(),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 Yb=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Vb(n){const t=Yb.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 qb(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 jb(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 Gb(n){return n.charAt(0)==="r"?Vb(n):zb(n)}class ks{constructor(t){if(t instanceof ks)return t;const e=typeof t;let i;e==="object"?i=Xf(t):e==="string"&&(i=Ab(t)||$b(t)||Gb(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?qb(this._rgb):void 0}hexString(){return this._valid?Rb(this._rgb):void 0}hslString(){return this._valid?Hb(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=jb(this._rgb,t._rgb,e)),this}clone(){return new ks(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 Ub(this._rgb,t),this}}function ti(){}const Kb=(()=>{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 Xb=(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 Zb(n,t,e,i){if(!Qf(n))return;const r=t[n],s=e[n];Rt(r)&&Rt(s)?Ds(r,s,i):t[n]=ea(s)}function Ds(n,t,e){const i=Yt(t)?t:[t],r=i.length;if(!Rt(n))return n;e=e||{};const s=e.merger||Zb;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 Ds(n,t,{merger:Qb})}function Qb(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 Jb(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 tx(n){const t=Jb(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]=tx(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 ex(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const At=Math.PI,te=2*At,nx=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 ix(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 rx(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function Ti(n){return!rx(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function sx(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 ox(n,t){return(n-t+nx)%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 ax(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),lx=(n,t,e)=>yc(n,e,i=>n[i][t]>=e);function cx(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 ux(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 dx(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,fx=(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 ks(n)}function wc(n){return bc(n)?n:new ks(n).saturate(.5).darken(.1).hexString()}const hx=["x","y","borderWidth","radius","tension"],px=["color","borderColor","backgroundColor"];function gx(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:px},numbers:{type:"number",properties:hx}}),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 mx(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const hh=new Map;function yx(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 yx(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=_x(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 _x(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 bx(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"?Ds(Ps(n,t),e):Ds(Ps(n,""),t)}class xx{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 xx({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[gx,mx,bx]);function wx(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 vx(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 Sx(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 Tx(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 Mx(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 kx(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,Mx(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),kx(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 Cx=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Ox=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Ax(n,t){const e=(""+n).match(Cx);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 Ex=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]=Ex(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(Ox)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Mt(n.family,t.family),lineHeight:Ax(Mt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:Mt(n.weight,t.weight),string:""};return r.string=wx(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 Rx(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 ki(n,t){return Object.assign(Object.create(n),t)}function kc(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=>kc([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,()=>Ux(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,()=>Ix(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 Px=(n,t)=>n?n+gc(t):t,Dc=(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 Ix(n,t,e){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=n;let c=i[t];return tn(c)&&a.isScriptable(t)&&(c=Lx(t,c,n,e)),Yt(c)&&c.length&&(c=Nx(t,c,n,a.isIndexable)),Dc(t,c)&&(c=Ir(c,r,s&&s[t],a)),c}function Lx(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),Dc(n,u)&&(u=Cc(r._scopes,r,n,u)),u}function Nx(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 Fx=(n,t)=>n===!0?t:typeof n=="string"?vi(t,n):void 0;function Bx(n,t,e,i,r){for(const s of t){const a=Fx(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:kc(Array.from(c),[""],r,s,()=>zx(t,e,i))}function wh(n,t,e,i,r){for(;e;)e=Bx(n,t,e,i,r);return e}function zx(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return Yt(r)&&Rt(e)?e:r||{}}function Ux(n,t,e,i){let r;for(const s of t)if(r=vh(Px(s,n),e),typeof r<"u")return Dc(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=Hx(n._scopes)),t}function Hx(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 Wx=Number.EPSILON||1e-14,Lr=(n,t)=>t<n.length&&!n[t].skip&&n[t],Mh=n=>n==="x"?"y":"x";function $x(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 Yx(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,Wx)){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 Vx(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 qx(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]}Yx(n,r,s),Vx(n,s,t)}function ca(n,t,e){return Math.max(Math.min(n,e),t)}function jx(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 Gx(n,t,e,i,r){let s,a,c,u;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")qx(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=$x(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&&jx(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 Kx(n,t){return da(n).getPropertyValue(t)}const Xx=["top","right","bottom","left"];function nr(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const s=Xx[r];i[s]=parseFloat(n[t+"-"+s+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Zx=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Qx(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:s}=i;let a=!1,c,u;if(Zx(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 Di(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}=Qx(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 Jx(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 tw(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=Jx(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 kh(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 ew=(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 Dh(n,t){const e=Kx(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 nw(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 iw(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 rw=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}}},sw=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?rw(t,e):sw()}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:ox,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 ow(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:_}=ow(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,k=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:k),S!==null&&N()&&(x.push(Eh({start:S,end:T,loop:y,count:a,style:_})),S=null),k=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 aw(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 lw(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 cw(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const s=!!n._loop,{start:a,end:c}=aw(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,lw(e,a,u,d),e,t)}function Ih(n,t,e,i){return!i||!i.setContext||!e?t:uw(n,t,e,i)}function uw(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(ki(r,{type:"segment",p0:v,p1:C,p0DataIndex:(y-1)%u,p1DataIndex:y%u,datasetIndex:a}))),dw(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 dw(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 fw(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=fw(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 hw{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 hw;const Fh="transparent",pw={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 gw{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||pw[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=yw(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&mw(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 gw(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 mw(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 yw(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 _w(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 bw(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 xw(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 ww(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function vw(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 Sw(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=ww(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]=Sw(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 Tw(n,t){return ki(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Mw(n,t,e){return ki(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),kw=(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=xw(e,r)}else if(i!==e){if(i){sh(i,this);const r=this._cachedMeta;Fs(r),r._parsed=[]}e&&Object.isExtensible(e)&&ux(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=kw(e,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:g}=vw(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=bw(Mt(this.options.clip,_w(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=Mw(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=Tw(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 Cw(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 Ow(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 Aw(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 Ew(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)?Ew(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 Rw(n,t,e){return n!==0?Wn(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Pw(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 Iw(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}=Pw(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=Lw(n,t,e),n=jh(n,e,t)):n=jh(n,t,e),n}function Lw(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 Nw(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;Iw(E,U,C,a),Nw(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||Cw(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=Rw(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"?Aw(t,e,r,h*d):Ow(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 Fw 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 Bw(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(Xb(this.options.cutout,c),1),d=this._getRingWeight(this.index),{circumference:h,rotation:g}=this._getRotationExtents(),{ratioX:y,ratioY:_,offsetX:x,offsetY:v}=Bw(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),k=Tt(T[_]),O=N[y]=a.getPixelForValue(T[y],I),L=N[_]=s||k?c.getBasePixel():c.getPixelForValue(u?this.applyStack(c,T,u):T[_],I);N.skip=isNaN(O)||isNaN(L)||k,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 zw extends Bs{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class Uw 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 Hw 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]),k=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(k)||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 Ww=Object.freeze({__proto__:null,BarController:Gh,BubbleController:Fw,DoughnutController:Bs,LineController:Kh,PieController:zw,PolarAreaController:Xh,RadarController:Uw,ScatterController:Hw});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 $w(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?lx: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}=$w(s[c],t,a,r);for(let _=g;_<=y;++_){const x=h[_];x.skip||i(x,d,_)}}}function Yw(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 Vw(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 qw(n,t,e,i,r,s){let a=[];const c=Yw(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?Vw(n,t,e,r):qw(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=Di(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=Di(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=Di(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return Fc(n,r,s,i,a)},nearest(n,t,e,i){const r=Di(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=Di(t,n);return Qh(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=Di(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 jw(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 Gw(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 Kw(n,t){const e=Gw(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 Xw(n){const t=jw(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 Zw(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 Qw(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 Jw(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,Jw(c.horizontal,t));const{same:g,other:y}=Zw(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=Xw(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=Kw(u.concat(d),g);Ws(c.fullSize,_,g,x),Ws(u,_,g,x),Ws(d,_,g,x)&&Ws(u,_,g,x),Qw(_),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 tv extends rp{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const pa="$chartjs",ev={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},sp=n=>n===null||n==="";function nv(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=Dh(n,"width");s!==void 0&&(n.width=s)}if(sp(i))if(n.style.height==="")n.height=n.width/(t||2);else{const s=Dh(n,"height");s!==void 0&&(n.height=s)}return n}const op=ew?{passive:!0}:!1;function iv(n,t,e){n&&n.addEventListener(t,e,op)}function rv(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,op)}function sv(n,t){const e=ev[n.type]||n.type,{x:i,y:r}=Di(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 ov(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 av(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 lv(n,t){$s.size||window.addEventListener("resize",lp),$s.set(n,t)}function cv(n){$s.delete(n),$s.size||window.removeEventListener("resize",lp)}function uv(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),lv(n,s),a}function Uc(n,t,e){e&&e.disconnect(),t==="resize"&&cv(n)}function dv(n,t,e){const i=n.canvas,r=lh(s=>{n.ctx!==null&&e(sv(s,n))},n);return iv(i,t,r),r}class fv extends rp{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(nv(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:ov,detach:av,resize:uv}[e]||dv;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]||rv)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return tw(t,e,i,r)}isAttached(t){const e=t&&Ac(t);return!!(e&&e.isConnected)}}function hv(n){return!Oc()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?tv:fv}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 pv(n,t){const e=n.options.ticks,i=gv(n),r=Math.min(e.maxTicksLimit||i,i),s=e.major.enabled?yv(t):[],a=s.length,c=s[0],u=s[a-1],d=[];if(a>r)return _v(t,d,s,a/r),d;const h=mv(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 gv(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 mv(n,t,e){const i=bv(n),r=t.length/e;if(!i)return Math.max(r,1);const s=ix(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 yv(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function _v(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 bv(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 xv=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 wv(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 vv(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 Sv(n,t){return ki(n,{scale:t,type:"scale"})}function Tv(n,t,e){return ki(n,{tick:e,index:t,type:"tick"})}function Mv(n,t,e){let i=_c(n);return(e&&t!=="right"||!e&&t==="right")&&(i=xv(i)),i}function kv(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=Rx(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=pv(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)}vv(s,e);const B=a.indexOf(d),N=c.indexOf(h),T=k=>({width:a[k]||0,height:c[k]||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 ax(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=Tv(this.getContext(),t,i))}return this.$context||(this.$context=Sv(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,k,O,L,W,tt;if(a==="top")E=C(this.bottom),N=this.bottom-y,k=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,k=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],J=a[X];E=C(this.chart.scales[X].getPixelForValue(J))}L=t.top,tt=t.bottom,N=E+S,k=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],J=a[X];E=C(this.chart.scales[X].getPixelForValue(J))}B=E-S,T=B-y,O=t.left,W=t.right}const j=Mt(r.ticks.maxTicksLimit,g),nt=Math.max(1,Math.ceil(g/j));for(U=0;U<g;U+=nt){const X=this.getContext(U),J=s.setContext(X),rt=c.setContext(X),st=J.lineWidth,ot=J.color,H=rt.dash||[],V=rt.dashOffset,Z=J.tickWidth,pt=J.tickColor,ft=J.tickBorderDash||[],it=J.tickBorderDashOffset;P=wv(this,U,u),P!==void 0&&(I=tr(i,P,st),d?B=T=O=W=I:N=k=L=tt=I,_.push({tx1:B,ty1:N,tx2:T,ty2:k,x1:O,y1:L,x2:W,y2:tt,width:st,color:ot,borderDash:H,borderDashOffset:V,tickWidth:Z,tickColor:pt,tickBorderDash:ft,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,k,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 j=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,k=this._resolveTickFontOptions(C),O=k.lineHeight,L=Yt(P)?P.length:1;const X=L/2,J=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=-j.highest.height/2-X*O+O:W=-j.highest.height+O/2:d==="near"||v!==0?W=O/2:d==="center"?W=j.highest.height/2-X*O:W=j.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),Z=j.heights[C],pt=j.widths[C];let ft=W-V.top,it=0-V.left;switch(tt){case"middle":ft-=Z/2;break;case"bottom":ft-=Z;break}switch(N){case"center":it-=pt/2;break;case"right":it-=pt;break;case"inner":C===E-1?it-=pt:C>0&&(it-=pt/2);break}H={left:it,top:ft,width:pt+V.width,height:Z+V.height,color:nt.backdropColor}}S.push({label:P,font:k,textOffset:W,options:{rotation:v,color:J,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}=kv(this,u,e,c);er(t,i.text,0,0,s,{color:i.color,maxWidth:g,rotation:y,textAlign:Mv(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;Ov(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=Ds(Object.create(null),[e?se.get(e):{},se.get(t),n.defaults]);se.set(t,i),n.defaultRoutes&&Cv(t,n.defaultRoutes),n.descriptors&&se.describe(t,n.descriptors)}function Cv(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 Ov(n){return"id"in n&&"defaults"in n}class Av{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 Av;class Ev{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=Rv(i);return r===!1&&!e?[]:Iv(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 Rv(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 Pv(n,t){return!t&&n===!1?null:n===!0?{}:n}function Iv(n,{plugins:t,localIds:e},i,r){const s=[],a=n.getContext();for(const c of t){const u=c.id,d=Pv(i[u],r);d!==null&&s.push({plugin:c,options:Lv(n.config,{plugin:c,local:e[u]},d,a)})}return s}function Lv(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 Nv(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Fv(n,t){return n===t?"_index_":"_value_"}function hp(n){if(n==="x"||n==="y"||n==="r")return n}function Bv(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||Bv(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 zv(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 Uv(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,zv(a,n),se.scales[c.type]),d=Fv(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=Nv(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=Uv(n,t)}function mp(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Hv(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 Wv{constructor(t){this._config=Hv(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(Yv(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:kc(t,e),subPrefixes:e.filter(c=>!c.toLowerCase().includes("hover"))},i.set(r,s)),s}const $v=n=>Rt(n)&&Object.getOwnPropertyNames(n).some(t=>tn(n[t]));function Yv(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)||$v(c))||a&&Yt(c))return!0}return!1}var Vv="4.5.1";const qv=["top","bottom","left","right","chartArea"];function xp(n,t){return n==="top"||n==="bottom"||qv.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 jv(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 Gv(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 Kv(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=Vv;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 Wv(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||hv(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=Kb(),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 Ev,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=dx(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",jv),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():kh(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,kh(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;Gv(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=ki(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=ex(t),d=Kv(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 Xv(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 Zv(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 Qv(n){return Mc(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Jv(n,t,e,i){const r=Qv(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,J=(nt+X)/2,rt=J!==0?x*J/(J+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}=Jv(t,y,g,E-C),N=g-U,T=g-P,k=C+U/N,O=E-P/T,L=y+I,W=y+B,tt=C+I/L,j=E-B/W;if(n.beginPath(),s){const nt=(k+O)/2;if(n.arc(a,c,g,k,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,j,a,c);n.arc(st.x,st.y,B,E+re,j+Math.PI)}const J=(E-B/y+(C+I/y))/2;if(n.arc(a,c,y,E-B/y,J,!0),n.arc(a,c,y,J,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,k,a,c);n.arc(st.x,st.y,U,C-re,k)}}else{n.moveTo(a,c);const nt=Math.cos(k)*g+a,X=Math.sin(k)*g+c;n.lineTo(nt,X);const J=Math.cos(O)*g+a,rt=Math.sin(O)*g+c;n.lineTo(J,rt)}n.closePath()}function t1(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 e1(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&&Zv(n,t,v),u.selfJoin&&v-a>=At&&_===0&&h!=="miter"&&Xv(n,t,v),s||(xa(n,t,e,i,v,r),n.stroke())}class n1 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,t1(t,this,d,s,a),e1(t,this,d,s,a),t.restore()}}function kp(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 i1(n,t,e){n.lineTo(e.x,e.y)}function r1(n){return n.stepped?Sx:n.tension||n.cubicInterpolationMode==="monotone"?Tx:i1}function Dp(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 s1(n,t,e,i){const{points:r,options:s}=t,{count:a,start:c,loop:u,ilen:d}=Dp(r,e,i),h=r1(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 o1(n,t,e,i){const r=t.points,{count:s,start:a,ilen:c}=Dp(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?o1:s1}function a1(n){return n.stepped?nw:n.tension||n.cubicInterpolationMode==="monotone"?iw:ir}function l1(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),kp(n,t.options),n.stroke(r)}function c1(n,t,e,i){const{segments:r,options:s}=t,a=$c(t);for(const c of r)kp(n,s,c.style),n.beginPath(),a(n,t,c,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const u1=typeof Path2D=="function";function d1(n,t,e,i){u1&&!t.options.segment?l1(n,t,e,i):c1(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;Gx(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=cw(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=a1(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(),d1(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 f1 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 h1(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 p1(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 g1(n){const t=Op(n),e=t.right-t.left,i=t.bottom-t.top,r=h1(n,e/2,i/2),s=p1(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 m1(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function y1(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 _1 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}=g1(this),c=m1(a.radius)?Pr:y1;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 b1=Object.freeze({__proto__:null,ArcElement:n1,BarElement:_1,LineElement:wa,PointElement:f1});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 x1(n,t){return n.borderColor=Ep(t),n.backgroundColor=Rp(t),++t}function w1(n,t){return n.backgroundColor=n.data.map(()=>Ep(t++)),t}function v1(n,t){return n.backgroundColor=n.data.map(()=>Rp(t++)),t}function S1(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof Bs?t=w1(e,t):r instanceof Xh?t=v1(e,t):r&&(t=x1(e,t))}}function Pp(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function T1(n){return n&&(n.borderColor||n.backgroundColor)}function M1(){return se.borderColor!=="rgba(0,0,0,0.1)"||se.backgroundColor!=="rgba(0,0,0,0.1)"}var k1={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)||T1(r)||s&&Pp(s)||M1();if(!e.forceOverride&&a)return;const c=S1(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:k}=n[h];for(_=x=-1,E=B;E<N;E++)x=.5*Math.abs((T-S)*(n[E].y-k)-(T-n[E].x)*(C-k)),x>_&&(_=x,y=n[E],v=E);a[u++]=y,h=v}return a[u++]=n[d],a}function C1(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 O1(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 A1={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}=O1(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=C1(d,g,y,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=x})},destroy(n){Lp(n)}};function E1(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 R1(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=R1(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 P1(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 I1(n,t,e){const i=B1(n);if(Rt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return ae(r)&&Math.floor(r)===r?L1(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function L1(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function N1(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 F1(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 B1(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 z1(n){const{scale:t,index:e,line:i}=n,r=[],s=i.segments,a=i.points,c=U1(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++)H1(r,a[h],c)}return new wa({points:r,options:{}})}function U1(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 H1(n,t,e){const i=[];for(let r=0;r<e.length;r++){const s=e[r],{first:a,last:c,point:u}=W1(s,t,"x");if(!(!u||a&&c)){if(a)i.unshift(u);else if(n.push(u),!c)break}}n.push(...i)}function W1(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 $1(n){const{chart:t,fill:e,line:i}=n;if(ae(e))return Y1(t,e);if(e==="stack")return z1(n);if(e==="shape")return!0;const r=V1(n);return r instanceof zp?r:Fp(r,i)}function Y1(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function V1(n){return(n.scale||{}).getPointPositionForValue?j1(n):q1(n)}function q1(n){const{scale:t={},fill:e}=n,i=N1(e,t);if(ae(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function j1(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=F1(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=$1(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),G1(n,{line:a,target:i,above:y,below:_,area:e,scale:c,axis:u,clip:v}),Ls(n))}function G1(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=E1(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=_,K1(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 K1(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 X1={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:I1(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=P1(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)}},Z1=(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}=Q1(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 k=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=k,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:k},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(),k!==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,k=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=fx(k,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 j=d.lineHeight;_.y+=Vp(B,j)+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(!eS(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=Z1(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 Q1(n,t,e,i,r){const s=J1(i,n,t,e),a=tS(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function J1(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 tS(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 eS(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var nS={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 iS(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 rS={id:"title",_element:Xc,start(n,t,e){iS(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 sS={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(`
|
|
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 Mb={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_gateway:"AI gateway",ai_gateway_agent:"AI gateway agent",ai_gateway_consumer:"AI gateway consumer",ai_gateway_data_plane_node:"AI gateway data plane node",ai_gateway_mcp_server:"AI gateway MCP server",ai_gateway_model:"AI gateway model",ai_plugin:"AI plugin",ai_provider:"Provider",ai_request_model:"Request model",ai_response_model:"Response model",error_rate:"Error rate",request_count:"Request count",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",response_latency_average:"Response latency (avg)",response_latency_p99:"Response latency (p99)",response_latency_p95:"Response latency (p95)",response_latency_p50:"Response latency (p50)",kong_latency_average:"Kong latency (avg)",kong_latency_p99:"Kong latency (p99)",kong_latency_p95:"Kong latency (p95)",kong_latency_p50:"Kong latency (p50)",kong_internal_latency_average:"Kong internal latency (avg)",kong_internal_latency_p99:"Kong internal latency (p99)",kong_internal_latency_p95:"Kong internal latency (p95)",kong_internal_latency_p50:"Kong internal latency (p50)",llm_cache_status:"Cache status",llm_embeddings_model:"Embeddings model",llm_embeddings_provider:"Embeddings provider",upstream_latency_average:"Upstream latency (avg)",upstream_latency_p99:"Upstream latency (p99)",upstream_latency_p95:"Upstream latency (p95)",upstream_latency_p50:"Upstream latency (p50)",response_size_p99:"Response size (p99)",response_size_p95:"Response size (p95)",response_size_p50:"Response size (p50)",response_size_average:"Response size (avg)",response_size_sum:"Response size (sum)",response_source:"Response source",request_size_p99:"Request size (p99)",request_size_p95:"Request size (p95)",request_size_p50:"Request size (p50)",request_size_average:"Request size (avg)",request_size_sum:"Request size (sum)",control_plane:"Control plane",control_plane_group:"Control plane group",consumer:"Consumer",oidc_credential:"OIDC credential",country_code:"Country",country:"Country",data_plane_node:"Data plane node",data_plane_node_version:"Data plane node version",api_package:"API package",api_product:"API product",api_product_version:"API product version",portal:"Portal",realm:"Realm",runtime_group:"Runtime group",gateway_service:"Gateway service",route:"Route",application:"Application",status_code:"Status code",status_code_grouped:"Status code (grouped)",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",principal:"Principal",virtual_cluster_id:"Virtual cluster",backend_cluster_id:"Backend cluster",listener_id:"Listener",principal_name:"Principal name",principal_type:"Principal type",request_type:"Request type",topic_name:"Topic name",partition_index:"Partition index",api_key:"API key",data_plane_group:"Data plane group",managed_cache:"Managed cache",network:"Network",provider:"Provider",provider_region:"Provider region",region:"Region",cache_eviction_rate:"Cache eviction rate",cache_expiration_rate:"Cache expiration rate",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max)",cache_status:"Cache status",cache_hit_rate:"Cache hit rate"},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}",cached_tokens:"Cached tokens",time_to_first_token_average:"Time to first token (avg)",time_per_token_average:"Time per token (avg)"},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 kb(){const n=$f.createI18n("en-us",Mb);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],Cb=n=>uc[(n&240)>>4]+uc[n&15],Zo=n=>(n&240)>>4===(n&15),Ob=n=>Zo(n.r)&&Zo(n.g)&&Zo(n.b)&&Zo(n.a);function Ab(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 Eb=(n,t)=>n<255?t(n):"";function Rb(n){var t=Ob(n)?Db:Cb;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Eb(n.a,t):void 0}const Pb=/^(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 Ib(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 Lb(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 Nb(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=Nb(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 Fb(n,t,e){return fc(Lb,n,t,e)}function Bb(n,t,e){return fc(Ib,n,t,e)}function qf(n){return(n%360+360)%360}function zb(n){const t=Pb.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=Fb(r,s,a):t[1]==="hsv"?i=Bb(r,s,a):i=hc(r,s,a),{r:i[0],g:i[1],b:i[2],a:e}}function Ub(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 Hb(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 Wb(){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 $b(n){Qo||(Qo=Wb(),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 Yb=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Vb(n){const t=Yb.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 qb(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 jb(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 Gb(n){return n.charAt(0)==="r"?Vb(n):zb(n)}class ks{constructor(t){if(t instanceof ks)return t;const e=typeof t;let i;e==="object"?i=Xf(t):e==="string"&&(i=Ab(t)||$b(t)||Gb(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?qb(this._rgb):void 0}hexString(){return this._valid?Rb(this._rgb):void 0}hslString(){return this._valid?Hb(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=jb(this._rgb,t._rgb,e)),this}clone(){return new ks(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 Ub(this._rgb,t),this}}function ti(){}const Kb=(()=>{let n=0;return()=>n++})();function Tt(n){return n==null}function Vt(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 Xb=(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(Vt(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(Vt(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 Zb(n,t,e,i){if(!Qf(n))return;const r=t[n],s=e[n];Rt(r)&&Rt(s)?Ds(r,s,i):t[n]=ea(s)}function Ds(n,t,e){const i=Vt(t)?t:[t],r=i.length;if(!Rt(n))return n;e=e||{};const s=e.merger||Zb;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 Ds(n,t,{merger:Qb})}function Qb(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 Jb(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 tx(n){const t=Jb(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]=tx(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 ex(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const At=Math.PI,te=2*At,nx=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 ix(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 rx(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function Ti(n){return!rx(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function sx(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 ox(n,t){return(n-t+nx)%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 De(n,t,e){return Math.max(t,Math.min(e,n))}function ax(n){return De(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),lx=(n,t,e)=>yc(n,e,i=>n[i][t]>=e);function cx(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 ux(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 dx(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,fx=(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(T=>!Tt(T[c.axis]));r-=Math.max(0,v)}r=De(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 T=u.slice(v-1).findIndex(C=>!Tt(C[c.axis]));v+=Math.max(0,T)}s=De(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 ks(n)}function wc(n){return bc(n)?n:new ks(n).saturate(.5).darken(.1).hexString()}const hx=["x","y","borderWidth","radius","tension"],px=["color","borderColor","backgroundColor"];function gx(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:px},numbers:{type:"number",properties:hx}}),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 mx(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const hh=new Map;function yx(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 yx(t,e).format(n)}const ph={values(n){return Vt(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=_x(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 _x(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 bx(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"?Ds(Ps(n,t),e):Ds(Ps(n,""),t)}class xx{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 xx({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[gx,mx,bx]);function wx(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 vx(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&&!Vt(g))a=la(n,r,s,a,g);else if(Vt(g))for(d=0,h=g.length;d<h;d++)y=g[d],y!=null&&!Vt(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 T=(x||0)*mc;if(_&&typeof _=="object"&&(s=_.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(T),n.drawImage(_,-_.width/2,-_.height/2,_.width,_.height),n.restore();return}if(!(isNaN(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(T)*h,i-Math.cos(T)*v),T+=ia,n.lineTo(e+Math.sin(T)*h,i-Math.cos(T)*v),T+=ia,n.lineTo(e+Math.sin(T)*h,i-Math.cos(T)*v),n.closePath();break;case"rectRounded":d=v*.516,u=v-d,a=Math.cos(T+Tn)*u,g=Math.cos(T+Tn)*(r?r/2-d:u),c=Math.sin(T+Tn)*u,y=Math.sin(T+Tn)*(r?r/2-d:u),n.arc(e-g,i-c,d,T-At,T-re),n.arc(e+y,i-a,d,T-re,T),n.arc(e+g,i+c,d,T,T+re),n.arc(e-y,i+a,d,T+re,T+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}T+=Tn;case"rectRot":g=Math.cos(T)*(r?r/2:v),a=Math.cos(T)*v,c=Math.sin(T)*v,y=Math.sin(T)*(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":T+=Tn;case"cross":g=Math.cos(T)*(r?r/2:v),a=Math.cos(T)*v,c=Math.sin(T)*v,y=Math.sin(T)*(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(T)*(r?r/2:v),a=Math.cos(T)*v,c=Math.sin(T)*v,y=Math.sin(T)*(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),T+=Tn,g=Math.cos(T)*(r?r/2:v),a=Math.cos(T)*v,c=Math.sin(T)*v,y=Math.sin(T)*(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(T)*v,c=Math.sin(T)*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(T)*(r?r/2:v),i+Math.sin(T)*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 Sx(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 Tx(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 Mx(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 kx(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=Vt(t)?t:[t],c=s.strokeWidth>0&&s.strokeColor!=="";let u,d;for(n.save(),n.font=r.string,Mx(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),kx(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 Cx=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Ox=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Ax(n,t){const e=(""+n).match(Cx);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 Ex=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]=Ex(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(Ox)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Mt(n.family,t.family),lineHeight:Ax(Mt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:Mt(n.weight,t.weight),string:""};return r.string=wx(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 Rx(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 ki(n,t){return Object.assign(Object.create(n),t)}function kc(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=>kc([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,()=>Ux(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,()=>Ix(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 Px=(n,t)=>n?n+gc(t):t,Dc=(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 Ix(n,t,e){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=n;let c=i[t];return tn(c)&&a.isScriptable(t)&&(c=Lx(t,c,n,e)),Vt(c)&&c.length&&(c=Nx(t,c,n,a.isIndexable)),Dc(t,c)&&(c=Ir(c,r,s&&s[t],a)),c}function Lx(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),Dc(n,u)&&(u=Cc(r._scopes,r,n,u)),u}function Nx(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 Fx=(n,t)=>n===!0?t:typeof n=="string"?vi(t,n):void 0;function Bx(n,t,e,i,r){for(const s of t){const a=Fx(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:kc(Array.from(c),[""],r,s,()=>zx(t,e,i))}function wh(n,t,e,i,r){for(;e;)e=Bx(n,t,e,i,r);return e}function zx(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return Vt(r)&&Rt(e)?e:r||{}}function Ux(n,t,e,i){let r;for(const s of t)if(r=vh(Px(s,n),e),typeof r<"u")return Dc(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=Hx(n._scopes)),t}function Hx(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 Wx=Number.EPSILON||1e-14,Lr=(n,t)=>t<n.length&&!n[t].skip&&n[t],Mh=n=>n==="x"?"y":"x";function $x(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 Yx(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,Wx)){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 Vx(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 qx(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]}Yx(n,r,s),Vx(n,s,t)}function ca(n,t,e){return Math.max(Math.min(n,e),t)}function jx(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 Gx(n,t,e,i,r){let s,a,c,u;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")qx(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=$x(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&&jx(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 Kx(n,t){return da(n).getPropertyValue(t)}const Xx=["top","right","bottom","left"];function nr(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const s=Xx[r];i[s]=parseFloat(n[t+"-"+s+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Zx=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Qx(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:s}=i;let a=!1,c,u;if(Zx(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 Di(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}=Qx(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 Jx(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 tw(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=Jx(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 kh(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 ew=(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 Dh(n,t){const e=Kx(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 nw(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 iw(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 rw=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}}},sw=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?rw(t,e):sw()}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:ox,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 ow(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:_}=ow(n,t,e),x=[];let v=!1,T=null,C,E,U;const P=()=>u(r,U,C)&&c(r,U)!==0,I=()=>c(s,C)===0||u(s,U,C),N=()=>v||P(),F=()=>!v||I();for(let k=h,S=h;k<=g;++k)E=t[k%a],!E.skip&&(C=d(E[i]),C!==U&&(v=u(C,r,s),T===null&&N()&&(T=c(C,r)===0?k:S),T!==null&&F()&&(x.push(Eh({start:T,end:k,loop:y,count:a,style:_})),T=null),S=k,U=C));return T!==null&&x.push(Eh({start:T,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 aw(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 lw(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 cw(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const s=!!n._loop,{start:a,end:c}=aw(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,lw(e,a,u,d),e,t)}function Ih(n,t,e,i){return!i||!i.setContext||!e?t:uw(n,t,e,i)}function uw(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,T,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:T,style:C}),h=C,g=v%u)}}for(const x of t){g=c?g:x.start;let v=e[g%u],T;for(y=g+1;y<=x.end;y++){const C=e[y%u];T=Lh(i.setContext(ki(r,{type:"segment",p0:v,p1:C,p0DataIndex:(y-1)%u,p1DataIndex:y%u,datasetIndex:a}))),dw(T,h)&&_(g,y-1,x.loop,h),v=C,h=T}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 dw(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 fw(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=fw(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 hw{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 hw;const Fh="transparent",pw={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 gw{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||pw[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];(Vt(s.properties)&&s.properties||[r]).forEach(c=>{(c===r||!i.has(c))&&i.set(c,a)})})}_animateOptions(t,e){const i=e.options,r=yw(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&mw(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 gw(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 mw(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 yw(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 _w(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 bw(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 xw(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 ww(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function vw(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 Sw(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=ww(s,a,i),g=t.length;let y;for(let _=0;_<g;++_){const x=t[_],{[u]:v,[d]:T}=x,C=x._stacks||(x._stacks={});y=C[d]=Sw(r,h,v),y[c]=T,y._top=Hh(y,a,!0,i.type),y._bottom=Hh(y,a,!1,i.type);const E=y._visualValues||(y._visualValues={});E[c]=T}}function Pc(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Tw(n,t){return ki(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Mw(n,t,e){return ki(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),kw=(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=xw(e,r)}else if(i!==e){if(i){sh(i,this);const r=this._cachedMeta;Fs(r),r._parsed=[]}e&&Object.isExtensible(e)&&ux(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{Vt(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=kw(e,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:g}=vw(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=bw(Mt(this.options.clip,_w(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=Mw(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=Tw(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 Cw(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 Ow(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 Aw(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 Ew(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 Vt(n)?Ew(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 Rw(n,t,e){return n!==0?Wn(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Pw(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 Iw(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}=Pw(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=Lw(n,t,e),n=jh(n,e,t)):n=jh(n,t,e),n}function Lw(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 Nw(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(_),T=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:T.center,y:d?T.center:v.head,height:d?T.size:Math.abs(v.size),width:d?Math.abs(v.size):T.size};y&&(E.options=g||this.resolveDataElementOptions(_,t[_].active?"active":r));const U=E.options||t[_].options;Iw(E,U,C,a),Nw(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||Cw(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 T=!Tt(s)&&!h?s:y;let C=e.getPixelForValue(T);if(this.chart.getDataVisibility(t)?x=e.getPixelForValue(y+_):x=C,v=x-C,Math.abs(v)<a){v=Rw(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"?Aw(t,e,r,h*d):Ow(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 Fw 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={},T=v[h]=s?a.getPixelForDecimal(.5):a.getPixelForValue(x[h]),C=v[g]=s?c.getBasePixel():c.getPixelForValue(x[g]);v.skip=isNaN(T)||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 Bw(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),T=_(re,h,y),C=x(At,d,g),E=x(At+re,h,y);i=(v-C)/2,r=(T-E)/2,s=-(v+C)/2,a=-(T+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(Xb(this.options.cutout,c),1),d=this._getRingWeight(this.index),{circumference:h,rotation:g}=this._getRotationExtents(),{ratioX:y,ratioY:_,offsetX:x,offsetY:v}=Bw(g,h,u),T=(i.width-a)/y,C=(i.height-a)/_,E=Math.max(Math.min(T,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:T}=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:_};T&&(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,T=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 N=t[I],F=C?N:{};if(I<e||I>=E){F.skip=!0;continue}const k=this.getParsed(I),S=Tt(k[_]),O=F[y]=a.getPixelForValue(k[y],I),B=F[_]=s||S?c.getBasePixel():c.getPixelForValue(u?this.applyStack(c,k,u):k[_],I);F.skip=isNaN(O)||isNaN(B)||S,F.stop=I>0&&Math.abs(k[y]-P[y])>T,v&&(F.parsed=k,F.raw=d.data[I]),g&&(F.options=h||this.resolveDataElementOptions(I,N.active?"active":r)),C||this.updateElement(N,I,F,r),P=k}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const s=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,s,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class 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 T=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,T.active?"active":r)};this.updateElement(T,x,P,r)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?xe(this.resolveDataElementOptions(t,e).angle||i):0}}class zw extends Bs{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class Uw 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 Hw 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:T}=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],N=this.getParsed(P),F=E?I:{},k=Tt(N[x]),S=F[_]=a.getPixelForValue(N[_],P),O=F[x]=s||k?c.getBasePixel():c.getPixelForValue(u?this.applyStack(c,N,u):N[x],P);F.skip=isNaN(S)||isNaN(O)||k,F.stop=P>0&&Math.abs(N[_]-U[_])>C,T&&(F.parsed=N,F.raw=d.data[P]),y&&(F.options=g||this.resolveDataElementOptions(P,I.active?"active":r)),E||this.updateElement(I,P,F,r),U=N}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 Ww=Object.freeze({__proto__:null,BarController:Gh,BubbleController:Fw,DoughnutController:Bs,LineController:Kh,PieController:zw,PolarAreaController:Xh,RadarController:Uw,ScatterController:Hw});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 $w(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?lx: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}=$w(s[c],t,a,r);for(let _=g;_<=y;++_){const x=h[_];x.skip||i(x,d,_)}}}function Yw(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 Vw(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 qw(n,t,e,i,r,s){let a=[];const c=Yw(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 T=c(t,x);T<u?(a=[{element:h,datasetIndex:g,index:y}],u=T):T===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?Vw(n,t,e,r):qw(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=Di(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=Di(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=Di(t,n),s=e.axis||"xy",a=e.includeInvisible||!1;return Fc(n,r,s,i,a)},nearest(n,t,e,i){const r=Di(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=Di(t,n);return Qh(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=Di(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 jw(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 Gw(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 Kw(n,t){const e=Gw(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 Xw(n){const t=jw(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 Zw(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 Qw(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 Jw(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,Jw(c.horizontal,t));const{same:g,other:y}=Zw(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=Xw(n.boxes),u=c.vertical,d=c.horizontal;Xt(n.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const h=u.reduce((v,T)=>T.box.options&&T.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=Kw(u.concat(d),g);Ws(c.fullSize,_,g,x),Ws(u,_,g,x),Ws(d,_,g,x)&&Ws(u,_,g,x),Qw(_),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 T=v.box;Object.assign(T,n.chartArea),T.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 tv extends rp{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const pa="$chartjs",ev={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},sp=n=>n===null||n==="";function nv(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=Dh(n,"width");s!==void 0&&(n.width=s)}if(sp(i))if(n.style.height==="")n.height=n.width/(t||2);else{const s=Dh(n,"height");s!==void 0&&(n.height=s)}return n}const op=ew?{passive:!0}:!1;function iv(n,t,e){n&&n.addEventListener(t,e,op)}function rv(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,op)}function sv(n,t){const e=ev[n.type]||n.type,{x:i,y:r}=Di(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 ov(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 av(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 lv(n,t){$s.size||window.addEventListener("resize",lp),$s.set(n,t)}function cv(n){$s.delete(n),$s.size||window.removeEventListener("resize",lp)}function uv(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),lv(n,s),a}function Uc(n,t,e){e&&e.disconnect(),t==="resize"&&cv(n)}function dv(n,t,e){const i=n.canvas,r=lh(s=>{n.ctx!==null&&e(sv(s,n))},n);return iv(i,t,r),r}class fv extends rp{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(nv(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:ov,detach:av,resize:uv}[e]||dv;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]||rv)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return tw(t,e,i,r)}isAttached(t){const e=t&&Ac(t);return!!(e&&e.isConnected)}}function hv(n){return!Oc()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?tv:fv}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 pv(n,t){const e=n.options.ticks,i=gv(n),r=Math.min(e.maxTicksLimit||i,i),s=e.major.enabled?yv(t):[],a=s.length,c=s[0],u=s[a-1],d=[];if(a>r)return _v(t,d,s,a/r),d;const h=mv(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 gv(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 mv(n,t,e){const i=bv(n),r=t.length/e;if(!i)return Math.max(r,1);const s=ix(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 yv(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function _v(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 bv(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 xv=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 wv(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 vv(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(Vt(n.text)?n.text.length:1)*e.lineHeight+i.height}function Sv(n,t){return ki(n,{scale:t,type:"scale"})}function Tv(n,t,e){return ki(n,{tick:e,index:t,type:"tick"})}function Mv(n,t,e){let i=_c(n);return(e&&t!=="right"||!e&&t==="right")&&(i=xv(i)),i}function kv(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,T=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)-T+t}else e==="center"?_=(d.left+d.right)/2-T+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=Rx(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=pv(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,_=De(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(De((h.highest.height+6)/c,-1,1)),Math.asin(De(u/d,-1,1))-Math.asin(De(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),T=Math.sin(x);if(c){const C=i.mirror?0:T*g.width+v*y.height;t.height=Math.min(this.maxHeight,t.height+C+_)}else{const C=i.mirror?0:v*g.width+T*y.height;t.width=Math.min(this.maxWidth,t.width+C+_)}this._calculatePadding(d,h,T,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,T,C,E,U,P,I;for(g=0;g<e;g+=u){if(x=t[g].label,v=this._resolveTickFontOptions(g),r.font=T=v.string,C=s[T]=s[T]||{data:{},gc:[]},E=v.lineHeight,U=P=0,!Tt(x)&&!Vt(x))U=la(r,C.data,C.gc,U,x),P=E;else if(Vt(x))for(y=0,_=x.length;y<_;++y)I=x[y],!Tt(I)&&!Vt(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)}vv(s,e);const N=a.indexOf(d),F=c.indexOf(h),k=S=>({width:a[S]||0,height:c[S]||0});return{first:k(0),last:k(e-1),widest:k(N),highest:k(F),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 ax(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=Tv(this.getContext(),t,i))}return this.$context||(this.$context=Sv(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,T=v/2,C=function(Q){return tr(i,Q,v)};let E,U,P,I,N,F,k,S,O,B,$,et;if(a==="top")E=C(this.bottom),F=this.bottom-y,S=E-T,B=C(t.top)+T,et=t.bottom;else if(a==="bottom")E=C(this.top),B=t.top,et=C(t.bottom)-T,F=E+T,S=this.top+y;else if(a==="left")E=C(this.right),N=this.right-y,k=E-T,O=C(t.left)+T,$=t.right;else if(a==="right")E=C(this.left),O=t.left,$=C(t.right)-T,N=E+T,k=this.left+y;else if(e==="x"){if(a==="center")E=C((t.top+t.bottom)/2+.5);else if(Rt(a)){const Q=Object.keys(a)[0],it=a[Q];E=C(this.chart.scales[Q].getPixelForValue(it))}B=t.top,et=t.bottom,F=E+T,S=F+y}else if(e==="y"){if(a==="center")E=C((t.left+t.right)/2);else if(Rt(a)){const Q=Object.keys(a)[0],it=a[Q];E=C(this.chart.scales[Q].getPixelForValue(it))}N=E-T,k=N-y,O=t.left,$=t.right}const K=Mt(r.ticks.maxTicksLimit,g),nt=Math.max(1,Math.ceil(g/K));for(U=0;U<g;U+=nt){const Q=this.getContext(U),it=s.setContext(Q),st=c.setContext(Q),rt=it.lineWidth,at=it.color,H=st.dash||[],V=st.dashOffset,X=it.tickWidth,_t=it.tickColor,ut=it.tickBorderDash||[],J=it.tickBorderDashOffset;P=wv(this,U,u),P!==void 0&&(I=tr(i,P,rt),d?N=k=O=$=I:F=S=B=et=I,_.push({tx1:N,ty1:F,tx2:k,ty2:S,x1:O,y1:B,x2:$,y2:et,width:rt,color:at,borderDash:H,borderDashOffset:V,tickWidth:X,tickColor:_t,tickBorderDash:ut,tickBorderDashOffset:J}))}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),T=[];let C,E,U,P,I,N,F,k,S,O,B,$,et="middle";if(r==="top")N=this.bottom-x,F=this._getXAxisLabelAlignment();else if(r==="bottom")N=this.top+x,F=this._getXAxisLabelAlignment();else if(r==="left"){const nt=this._getYAxisLabelAlignment(y);F=nt.textAlign,I=nt.x}else if(r==="right"){const nt=this._getYAxisLabelAlignment(y);F=nt.textAlign,I=nt.x}else if(e==="x"){if(r==="center")N=(t.top+t.bottom)/2+_;else if(Rt(r)){const nt=Object.keys(r)[0],Q=r[nt];N=this.chart.scales[nt].getPixelForValue(Q)+_}F=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],Q=r[nt];I=this.chart.scales[nt].getPixelForValue(Q)}F=this._getYAxisLabelAlignment(y).textAlign}e==="y"&&(u==="start"?et="top":u==="end"&&(et="bottom"));const K=this._getLabelSizes();for(C=0,E=c.length;C<E;++C){U=c[C],P=U.label;const nt=s.setContext(this.getContext(C));k=this.getPixelForTick(C)+s.labelOffset,S=this._resolveTickFontOptions(C),O=S.lineHeight,B=Vt(P)?P.length:1;const Q=B/2,it=nt.color,st=nt.textStrokeColor,rt=nt.textStrokeWidth;let at=F;a?(I=k,F==="inner"&&(C===E-1?at=this.options.reverse?"left":"right":C===0?at=this.options.reverse?"right":"left":at="center"),r==="top"?d==="near"||v!==0?$=-B*O+O/2:d==="center"?$=-K.highest.height/2-Q*O+O:$=-K.highest.height+O/2:d==="near"||v!==0?$=O/2:d==="center"?$=K.highest.height/2-Q*O:$=K.highest.height-B*O,g&&($*=-1),v!==0&&!nt.showLabelBackdrop&&(I+=O/2*Math.sin(v))):(N=k,$=(1-B)*O/2);let H;if(nt.showLabelBackdrop){const V=we(nt.backdropPadding),X=K.heights[C],_t=K.widths[C];let ut=$-V.top,J=0-V.left;switch(et){case"middle":ut-=X/2;break;case"bottom":ut-=X;break}switch(F){case"center":J-=_t/2;break;case"right":J-=_t;break;case"inner":C===E-1?J-=_t:C>0&&(J-=_t/2);break}H={left:J,top:ut,width:_t+V.width,height:X+V.height,color:nt.backdropColor}}T.push({label:P,font:S,textOffset:$,options:{rotation:v,color:it,strokeColor:st,strokeWidth:rt,textAlign:at,textBaseline:et,translation:[I,N],backdrop:H}})}return T}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-xe(this.labelRotation))return t==="top"?"left":"right";let r="center";return e.align==="start"?r="left":e.align==="end"?r="right":e.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,a=this._getLabelSizes(),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,Vt(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;const{titleX:d,titleY:h,maxWidth:g,rotation:y}=kv(this,u,e,c);er(t,i.text,0,0,s,{color:i.color,maxWidth:g,rotation:y,textAlign:Mv(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;Ov(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=Ds(Object.create(null),[e?se.get(e):{},se.get(t),n.defaults]);se.set(t,i),n.defaultRoutes&&Cv(t,n.defaultRoutes),n.descriptors&&se.describe(t,n.descriptors)}function Cv(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 Ov(n){return"id"in n&&"defaults"in n}class Av{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 Av;class Ev{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=Rv(i);return r===!1&&!e?[]:Iv(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 Rv(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 Pv(n,t){return!t&&n===!1?null:n===!0?{}:n}function Iv(n,{plugins:t,localIds:e},i,r){const s=[],a=n.getContext();for(const c of t){const u=c.id,d=Pv(i[u],r);d!==null&&s.push({plugin:c,options:Lv(n.config,{plugin:c,local:e[u]},d,a)})}return s}function Lv(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 Nv(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Fv(n,t){return n===t?"_index_":"_value_"}function hp(n){if(n==="x"||n==="y"||n==="r")return n}function Bv(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||Bv(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 zv(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 Uv(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,zv(a,n),se.scales[c.type]),d=Fv(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=Nv(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=Uv(n,t)}function mp(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Hv(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 Wv{constructor(t){this._config=Hv(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(Yv(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:kc(t,e),subPrefixes:e.filter(c=>!c.toLowerCase().includes("hover"))},i.set(r,s)),s}const $v=n=>Rt(n)&&Object.getOwnPropertyNames(n).some(t=>tn(n[t]));function Yv(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)||$v(c))||a&&Vt(c))return!0}return!1}var Vv="4.5.1";const qv=["top","bottom","left","right","chartArea"];function xp(n,t){return n==="top"||n==="bottom"||qv.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 jv(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 Gv(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 Kv(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=Vv;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 Wv(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||hv(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=Kb(),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 Ev,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=dx(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",jv),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():kh(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,kh(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;Gv(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=ki(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=ex(t),d=Kv(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 Xv(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,T=_*Math.cos(i+At/2)+r,C=_*Math.sin(i+At/2)+s;n.lineTo(x,v),n.lineTo(T,C)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function Zv(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 Qv(n){return Mc(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Jv(n,t,e,i){const r=Qv(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 De(u,0,Math.min(s,d))};return{outerStart:c(r.outerStart),outerEnd:c(r.outerEnd),innerStart:De(r.innerStart,0,a),innerEnd:De(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,Q=g>0?g-i:0,it=(nt+Q)/2,st=it!==0?x*it/(it+i):x;_=(x-st)/2}const v=Math.max(.001,x*g-e/At)/g,T=(x-v)/2,C=u+T+_,E=r-T-_,{outerStart:U,outerEnd:P,innerStart:I,innerEnd:N}=Jv(t,y,g,E-C),F=g-U,k=g-P,S=C+U/F,O=E-P/k,B=y+I,$=y+N,et=C+I/B,K=E-N/$;if(n.beginPath(),s){const nt=(S+O)/2;if(n.arc(a,c,g,S,nt),n.arc(a,c,g,nt,O),P>0){const rt=Fr(k,O,a,c);n.arc(rt.x,rt.y,P,O,E+re)}const Q=Fr($,E,a,c);if(n.lineTo(Q.x,Q.y),N>0){const rt=Fr($,K,a,c);n.arc(rt.x,rt.y,N,E+re,K+Math.PI)}const it=(E-N/y+(C+I/y))/2;if(n.arc(a,c,y,E-N/y,it,!0),n.arc(a,c,y,it,C+I/y,!0),I>0){const rt=Fr(B,et,a,c);n.arc(rt.x,rt.y,I,et+Math.PI,C-re)}const st=Fr(F,C,a,c);if(n.lineTo(st.x,st.y),U>0){const rt=Fr(F,S,a,c);n.arc(rt.x,rt.y,U,C-re,S)}}else{n.moveTo(a,c);const nt=Math.cos(S)*g+a,Q=Math.sin(S)*g+c;n.lineTo(nt,Q);const it=Math.cos(O)*g+a,st=Math.sin(O)*g+c;n.lineTo(it,st)}n.closePath()}function t1(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 e1(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 T=0;T<s;++T)n.stroke();isNaN(c)||(v=a+(c%te||te))}x&&Zv(n,t,v),u.selfJoin&&v-a>=At&&_===0&&h!=="miter"&&Xv(n,t,v),s||(xa(n,t,e,i,v,r),n.stroke())}class n1 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,T=ei(a,d+y,h+y);return v&&T}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,t1(t,this,d,s,a),e1(t,this,d,s,a),t.restore()}}function kp(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 i1(n,t,e){n.lineTo(e.x,e.y)}function r1(n){return n.stepped?Sx:n.tension||n.cubicInterpolationMode==="monotone"?Tx:i1}function Dp(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 s1(n,t,e,i){const{points:r,options:s}=t,{count:a,start:c,loop:u,ilen:d}=Dp(r,e,i),h=r1(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 o1(n,t,e,i){const r=t.points,{count:s,start:a,ilen:c}=Dp(r,e,i),{move:u=!0,reverse:d}=i||{};let h=0,g=0,y,_,x,v,T,C;const E=P=>(a+(d?c-P:P))%s,U=()=>{v!==T&&(n.lineTo(h,T),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,N=P|0;N===x?(I<v?v=I:I>T&&(T=I),h=(g*h+P)/++g):(U(),n.lineTo(P,I),x=N,g=0,v=T=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?o1:s1}function a1(n){return n.stepped?nw:n.tension||n.cubicInterpolationMode==="monotone"?iw:ir}function l1(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),kp(n,t.options),n.stroke(r)}function c1(n,t,e,i){const{segments:r,options:s}=t,a=$c(t);for(const c of r)kp(n,s,c.style),n.beginPath(),a(n,t,c,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const u1=typeof Path2D=="function";function d1(n,t,e,i){u1&&!t.options.segment?l1(n,t,e,i):c1(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;Gx(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=cw(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=a1(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])),T=u(_,x,v,i.stepped);T[e]=t[e],c.push(T)}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(),d1(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 f1 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:De(t,e,i)}function h1(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 p1(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 g1(n){const t=Op(n),e=t.right-t.left,i=t.bottom-t.top,r=h1(n,e/2,i/2),s=p1(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 m1(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function y1(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 _1 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}=g1(this),c=m1(a.radius)?Pr:y1;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 b1=Object.freeze({__proto__:null,ArcElement:n1,BarElement:_1,LineElement:wa,PointElement:f1});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 x1(n,t){return n.borderColor=Ep(t),n.backgroundColor=Rp(t),++t}function w1(n,t){return n.backgroundColor=n.data.map(()=>Ep(t++)),t}function v1(n,t){return n.backgroundColor=n.data.map(()=>Rp(t++)),t}function S1(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof Bs?t=w1(e,t):r instanceof Xh?t=v1(e,t):r&&(t=x1(e,t))}}function Pp(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function T1(n){return n&&(n.borderColor||n.backgroundColor)}function M1(){return se.borderColor!=="rgba(0,0,0,0.1)"||se.backgroundColor!=="rgba(0,0,0,0.1)"}var k1={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)||T1(r)||s&&Pp(s)||M1();if(!e.forceOverride&&a)return;const c=S1(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 T=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++)T+=n[E].x,C+=n[E].y;T/=I,C/=I;const N=Math.floor(g*c)+1+t,F=Math.min(Math.floor((g+1)*c)+1,e)+t,{x:k,y:S}=n[h];for(_=x=-1,E=N;E<F;E++)x=.5*Math.abs((k-T)*(n[E].y-S)-(k-n[E].x)*(C-S)),x>_&&(_=x,y=n[E],v=E);a[u++]=y,h=v}return a[u++]=n[d],a}function C1(n,t,e,i){let r=0,s=0,a,c,u,d,h,g,y,_,x,v;const T=[],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 N=a-1;if(!Tt(g)&&!Tt(y)){const F=Math.min(g,y),k=Math.max(g,y);F!==_&&F!==N&&T.push({...n[F],x:r}),k!==_&&k!==N&&T.push({...n[k],x:r})}a>0&&N!==_&&T.push(n[N]),T.push(c),h=I,s=0,x=v=d,g=y=_=a}}return T}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 O1(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=De(ni(t,s.axis,a).lo,0,e-1)),d?r=De(ni(t,s.axis,c).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var A1={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}=O1(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=C1(d,g,y,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=x})},destroy(n){Lp(n)}};function E1(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 R1(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 Vt(n)?(i=!0,e=n):e=R1(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 P1(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 I1(n,t,e){const i=B1(n);if(Rt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return ae(r)&&Math.floor(r)===r?L1(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function L1(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function N1(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 F1(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 B1(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 z1(n){const{scale:t,index:e,line:i}=n,r=[],s=i.segments,a=i.points,c=U1(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++)H1(r,a[h],c)}return new wa({points:r,options:{}})}function U1(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 H1(n,t,e){const i=[];for(let r=0;r<e.length;r++){const s=e[r],{first:a,last:c,point:u}=W1(s,t,"x");if(!(!u||a&&c)){if(a)i.unshift(u);else if(n.push(u),!c)break}}n.push(...i)}function W1(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 $1(n){const{chart:t,fill:e,line:i}=n;if(ae(e))return Y1(t,e);if(e==="stack")return z1(n);if(e==="shape")return!0;const r=V1(n);return r instanceof zp?r:Fp(r,i)}function Y1(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function V1(n){return(n.scale||{}).getPointPositionForValue?j1(n):q1(n)}function q1(n){const{scale:t={},fill:e}=n,i=N1(e,t);if(ae(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function j1(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=F1(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=$1(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),G1(n,{line:a,target:i,above:y,below:_,area:e,scale:c,axis:u,clip:v}),Ls(n))}function G1(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=E1(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=_,K1(n,a,c,x&&jc(r,g,y)),n.beginPath();const v=!!e.pathSegment(n,d);let T;if(x){v?n.closePath():Wp(n,i,y,r);const C=!!i.pathSegment(n,h,{move:v,reverse:!0});T=v&&C,T||Wp(n,i,g,r)}n.closePath(),n.fill(T?"evenodd":"nonzero"),n.restore()}}function K1(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 X1={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:I1(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=P1(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)}},Z1=(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 T=i+e/2+s.measureText(x.text).width;(v===0||d[d.length-1]+T+2*c>a)&&(g+=h,d[d.length-(v>0?0:1)]=0,_+=h,y++),u[v]={left:0,top:_,row:y,width:T,height:r},d[d.length-1]+=T+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((T,C)=>{const{itemWidth:E,itemHeight:U}=Q1(i,e,s,T,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:T}=$p(a,g),C=function(N,F,k){if(isNaN(x)||x<=0||isNaN(v)||v<0)return;r.save();const S=Mt(k.lineWidth,1);if(r.fillStyle=Mt(k.fillStyle,c),r.lineCap=Mt(k.lineCap,"butt"),r.lineDashOffset=Mt(k.lineDashOffset,0),r.lineJoin=Mt(k.lineJoin,"miter"),r.lineWidth=S,r.strokeStyle=Mt(k.strokeStyle,c),r.setLineDash(Mt(k.lineDash,[])),a.usePointStyle){const O={radius:v*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:S},B=u.xPlus(N,x/2),$=F+y;mh(r,O,B,$,a.pointStyleWidth&&x)}else{const O=F+Math.max((g-v)/2,0),B=u.leftForLtr(N,x),$=Mi(k.borderRadius);r.beginPath(),Object.values($).some(et=>et!==0)?Pr(r,{x:B,y:O,w:x,h:v,radius:$}):r.rect(B,O,x,v),r.fill(),S!==0&&r.stroke()}r.restore()},E=function(N,F,k){er(r,k.text,N,F+T/2,d,{strikethrough:k.hidden,textAlign:u.textAlign(k.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=T+h;this.legendItems.forEach((N,F)=>{r.strokeStyle=N.fontColor,r.fillStyle=N.fontColor;const k=r.measureText(N.text).width,S=u.textAlign(N.textAlign||(N.textAlign=a.textAlign)),O=x+y+k;let B=_.x,$=_.y;u.setWidth(this.width),U?F>0&&B+O+h>this.right&&($=_.y+=I,_.line++,B=_.x=ze(s,this.left+h,this.right-i[_.line])):F>0&&$+I>this.bottom&&(B=_.x=B+e[_.line].width+h,_.line++,$=_.y=ze(s,this.top+P+h,this.bottom-e[_.line].height));const et=u.x(B);if(C(et,$,N),B=fx(S,B+x+y,U?B+O:this.right,t.rtl),E(u.x(B),$,N),U)_.x+=O+h;else if(typeof N.text!="string"){const K=d.lineHeight;_.y+=Vp(N,K)+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,T)=>Math.max(v,T.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(!eS(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=Z1(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 Q1(n,t,e,i,r){const s=J1(i,n,t,e),a=tS(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function J1(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 tS(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 eS(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var nS={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=Vt(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 iS(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 rS={id:"title",_element:Xc,start(n,t,e){iS(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 sS={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&&(Vt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function si(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
2
2
|
`)>-1?n.split(`
|
|
3
|
-
`):n}function oS(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 aS(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function lS(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 cS(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"),lS(d,n,t,e)&&(d="center"),d}function jp(n,t,e){const i=e.yAlign||t.yAlign||aS(n,e);return{xAlign:e.xAlign||t.xAlign||cS(n,t,e,i),yAlign:i}}function uS(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function dS(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=uS(t,c);const v=dS(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 fS(n,t,e){return ki(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=fS(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(oS(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"]},hS=Object.freeze({__proto__:null,Colors:k1,Decimation:A1,Filler:X1,Legend:nS,SubTitle:sS,Title:rS,Tooltip:hn});const pS=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function gS(n,t,e,i){const r=n.indexOf(t);if(r===-1)return pS(n,t,e,i);const s=n.lastIndexOf(t);return r!==s?e:r}const mS=(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 yS 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:gS(i,t,Mt(e,t),this._addedLabels),mS(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 _S(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,k;if(I<1e-14&&!C&&!E)return[{value:v},{value:S}];k=Math.ceil(S/I)-Math.floor(v/I),k>x&&(I=eh(k*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&&sx((c-a)/s,I/1e3)?(k=Math.round(Math.min((c-a)/I,h)),I=(c-a)/k,N=a,T=c):U?(N=C?a:N,T=E?c:T,k=d-1,I=(T-N)/k):(k=(T-N)/I,Os(k,Math.round(k),I/1e3)?k=Math.round(k):k=Math.ceil(k));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<k;++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=_S(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 bS 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 xS(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 wS(n,{min:t,max:e}){t=fn(n.min,t);const i=[],r=js(t);let s=xS(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 vS 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=wS(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 SS(n,t,e){return e=Yt(e)?e:[e],{w:vx(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 TS(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=SS(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);MS(e,t,_,v,S)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=CS(n,i,r)}function MS(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 kS(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=ES(u.y,c.h,d),g=OS(d),y=AS(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 CS(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=kS(n,h,u);i.push(g),c==="auto"&&(g.visible=DS(g,d),g.visible&&(d=g))}return i}function OS(n){return n===0||n===180?"center":n<180?"left":"right"}function AS(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function ES(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function RS(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 PS(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));RS(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 IS(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 LS(n,t,e){return ki(n,{label:e,index:t,type:"pointLabel"})}class NS 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?TS(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 LS(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&&PS(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);IS(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 ka={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(ka);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=ka[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 FS(n,t,e,i,r){for(let s=rn.length-1;s>=rn.indexOf(e);s--){const a=rn[s];if(ka[a].common&&n._adapter.diff(r,i,a)>=t-1)return a}return rn[e?rn.indexOf(e):0]}function BS(n){for(let t=rn.indexOf(n)+1,e=rn.length;t<e;++t)if(ka[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 zS(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:zS(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=cx(r,s,a);return this._unit=e.unit||(i.autoSkip?ag(e.minUnit,this.min,this.max,this._getLabelCapacity(s)):FS(this,c.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:BS(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 Da(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 US 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=Da(e,this.min),this._tableRange=Da(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(Da(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Da(this._table,i*this._tableRange+this._minPos,!0)}}var HS=Object.freeze({__proto__:null,CategoryScale:yS,LinearScale:bS,LogarithmicScale:vS,RadialLinearScale:NS,TimeScale:Qc,TimeSeriesScale:US});const WS=[Ww,b1,hS,HS],ug=6048e5,$S=864e5,Gs=6e4,Br=36e5,YS=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 VS(n,t,e){return tu(n,t*Br)}let qS={};function ar(){return qS}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)/$S)}function jS(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 GS(n,t,e){const i=Ot(n,e?.in);return i.setTime(i.getTime()+t*Gs),i}function KS(n,t,e){return Jc(n,t*3,e)}function XS(n,t,e){return tu(n,t*1e3)}function ZS(n,t,e){return Ca(n,t*7,e)}function QS(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 JS(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function nu(n){return!(!JS(n)&&typeof n!="number"||isNaN(+Ot(n)))}function tT(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 eT(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 nT(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 iT(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 rT(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(tT(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;rT(i)&&c===1&&Ks(i,s)===1&&(u=!1);const d=a*(c-+u);return d===0?0:d}function sT(n,t,e){const i=_g(n,t,e)/3;return Xs(e?.roundingMethod)(i)}function oT(n,t,e){const i=iu(n,t)/1e3;return Xs(e?.roundingMethod)(i)}function aT(n,t,e){const i=pg(n,t,e)/7;return Xs(e?.roundingMethod)(i)}function lT(n,t,e){const[i,r]=lr(e?.in,n,t),s=Ks(i,r),a=Math.abs(eT(i,r));i.setFullYear(1584),r.setFullYear(1584);const c=Ks(i,r)===-s,u=s*(a-+c);return u===0?0:u}function cT(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 uT(n,t){const e=Ot(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function dT(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 fT(n,t){const e=Ot(n,t?.in);return e.setMinutes(59,59,999),e}function hT(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 pT(n,t){const e=Ot(n,t?.in);return e.setSeconds(59,999),e}function gT(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 mT(n,t){const e=Ot(n,t?.in);return e.setMilliseconds(999),e}const yT={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"}},_T=(n,t,e)=>{let i;const r=yT[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 bT={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xT={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},wT={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},vT={date:ru({formats:bT,defaultWidth:"full"}),time:ru({formats:xT,defaultWidth:"full"}),dateTime:ru({formats:wT,defaultWidth:"full"})},ST={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},TT=(n,t,e,i)=>ST[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 MT={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},kT={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"]},CT={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"]},OT={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"}},AT={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"}},ET={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:MT,defaultWidth:"wide"}),quarter:Zs({values:kT,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Zs({values:DT,defaultWidth:"wide"}),day:Zs({values:CT,defaultWidth:"wide"}),dayPeriod:Zs({values:OT,defaultWidth:"wide",formattingValues:AT,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)?PT(c,g=>g.test(a)):RT(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 RT(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function PT(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function IT(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 LT=/^(\d+)(th|st|nd|rd)?/i,NT=/\d+/i,FT={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},BT={any:[/^b/i,/^(a|c)/i]},zT={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},UT={any:[/1/i,/2/i,/3/i,/4/i]},HT={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},WT={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]},$T={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},YT={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]},VT={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},qT={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}},jT={ordinalNumber:IT({matchPattern:LT,parsePattern:NT,valueCallback:n=>parseInt(n,10)}),era:Qs({matchPatterns:FT,defaultMatchWidth:"wide",parsePatterns:BT,defaultParseWidth:"any"}),quarter:Qs({matchPatterns:zT,defaultMatchWidth:"wide",parsePatterns:UT,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Qs({matchPatterns:HT,defaultMatchWidth:"wide",parsePatterns:WT,defaultParseWidth:"any"}),day:Qs({matchPatterns:$T,defaultMatchWidth:"wide",parsePatterns:YT,defaultParseWidth:"any"}),dayPeriod:Qs({matchPatterns:VT,defaultMatchWidth:"any",parsePatterns:qT,defaultParseWidth:"any"})},xg={code:"en-US",formatDistance:_T,formatLong:vT,formatRelative:TT,localize:ET,match:jT,options:{weekStartsOn:0,firstWeekContainsDate:1}};function GT(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)-+jS(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 KT(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)-+KT(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=GT(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 kg=(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"})}},Dg=(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:Dg,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return kg(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}}",kg(i,t)).replace("{{time}}",Dg(r,t))}},XT=/^D+$/,ZT=/^Y+$/,QT=["D","DD","YY","YYYY"];function Cg(n){return XT.test(n)}function Og(n){return ZT.test(n)}function au(n,t,e){const i=JT(n,t,e);if(console.warn(i),QT.includes(n))throw new RangeError(i)}function JT(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 tM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,eM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,nM=/^'([^]*?)'?$/,iM=/''/g,rM=/[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(eM).map(h=>{const g=h[0];if(g==="p"||g==="P"){const y=ou[g];return y(h,r.formatLong)}return h}).join("").match(tM).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:sM(h)};if(Sg[g])return{isToken:!0,value:h};if(g.match(rM))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 sM(n){const t=n.match(nM);return t?t[1].replace(iM,"'"):n}function Ag(){return Object.assign({},ar())}function oM(n,t){const e=Ot(n,t?.in).getDay();return e===0?7:e}function aM(n,t){const e=lM(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 lM(n){return typeof n=="function"&&n.prototype?.constructor===n}const cM=10;class Eg{subPriority=0;validate(t,e){return!0}}class uM 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 dM extends Eg{priority=cM;subPriority=-1;constructor(t,e){super(),this.context=t||(i=>he(e,i))}set(t,e){return e.timestampIsSet?t:he(t,aM(t,this.context))}}class Wt{run(t,e,i,r){const s=this.parse(t,e,i,r);return s?{setter:new uM(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,e,i){return!0}}class fM 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*YS),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 hM 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 pM 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 gM 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 mM 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 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:"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 _M 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 bM 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 xM 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 wM(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 vM 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(wM(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function SM(n,t,e){const i=Ot(n,e?.in),r=wg(i,e)-t;return i.setDate(i.getDate()-r*7),i}class TM 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(SM(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const MM=[31,28,31,30,31,30,31,31,30,31,30,31],kM=[31,29,31,30,31,30,31,31,30,31,30,31];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<=kM[s]:e>=1&&e<=MM[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 CM 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 OM 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 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"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 EM 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 RM(n,t,e){const i=Ot(n,e?.in),r=oM(i,e),s=t-r;return Ca(i,s,e)}class PM 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=RM(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 IM 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 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","H","k","t","T"]}class NM 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 FM 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 BM 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 zM 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 UM 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 HM 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 WM 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 $M 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 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=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 qM extends Wt{priority=40;parse(t){return Rg(t)}set(t,e,i){return[he(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class jM extends Wt{priority=20;parse(t){return Rg(t)}set(t,e,i){return[he(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const GM={G:new fM,y:new hM,Y:new pM,R:new gM,u:new mM,Q:new yM,q:new _M,M:new bM,L:new xM,w:new vM,I:new TM,d:new DM,D:new CM,E:new OM,e:new AM,c:new EM,i:new PM,a:new IM,b:new LM,B:new NM,h:new FM,H:new BM,K:new zM,k:new UM,m:new HM,s:new WM,S:new $M,X:new YM,x:new VM,t:new qM,T:new jM},KM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,XM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ZM=/^'([^]*?)'?$/,QM=/''/g,JM=/\S/,tk=/[a-zA-Z]/;function ek(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 dM(i?.in,e)],g=t.match(XM).map(S=>{const C=S[0];if(C in ou){const E=ou[C];return E(S,a.formatLong)}return S}).join("").match(KM),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=GM[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(tk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");if(S==="''"?S="'":C==="'"&&(S=nk(S)),n.indexOf(S)===0)n=n.slice(S.length);else return r()}}if(n.length>0&&JM.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 nk(n){return n.match(ZM)[1].replace(QM,"'")}function ik(n,t){const e=Ot(n,t?.in);return e.setMinutes(0,0,0),e}function rk(n,t){const e=Ot(n,t?.in);return e.setSeconds(0,0),e}function sk(n,t){const e=Ot(n,t?.in);return e.setMilliseconds(0),e}function ok(n){const t=n/Br;return Math.trunc(t)}function Lg(n,t){const e=()=>he(t?.in,NaN),i=t?.additionalDigits??2,r=uk(n);let s;if(r.date){const d=dk(r.date,i);s=fk(d.restDateString,d.year)}if(!s||isNaN(+s))return e();const a=+s;let c=0,u;if(r.time&&(c=hk(r.time),isNaN(c)))return e();if(r.timezone){if(u=pk(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+-].*)$/},ak=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,lk=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ck=/^([+-])(\d{2})(?::?(\d{2}))?$/;function uk(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 dk(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 fk(n,t){if(t===null)return new Date(NaN);const e=n.match(ak);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 bk(t,c,u)?gk(t,c,u):new Date(NaN);{const d=new Date(0);return!yk(t,s,a)||!_k(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function Js(n){return n?parseInt(n):1}function hk(n){const t=n.match(lk);if(!t)return NaN;const e=uu(t[1]),i=uu(t[2]),r=uu(t[3]);return xk(e,i,r)?e*Br+i*Gs+r*1e3:NaN}function uu(n){return n&&parseFloat(n.replace(",","."))||0}function pk(n){if(n==="Z")return 0;const t=n.match(ck);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return wk(i,r)?e*(i*Br+r*Gs):NaN}function gk(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 mk=[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 yk(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(mk[t]||(Ng(n)?29:28))}function _k(n,t){return t>=1&&t<=(Ng(n)?366:365)}function bk(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function xk(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function wk(n,t){return t>=0&&t<=59}const vk=1e3;var gt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.NINETY_DAY="90d",n.ONE_HUNDRED_EIGHTY_DAY="180d",n.ONE_YEAR="365d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.CURRENT_YEAR="current_year",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n.PREVIOUS_YEAR="previous_year",n))(gt||{});const Sk=["in","not_in","selector"],Tk=["empty","not_empty"],Mk=["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),kk=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],zg=[...Fg,"ai_gateway","ai_gateway_consumer","ai_gateway_data_plane_node","application","bot_info_action","bot_info_detection_reason","bot_info_ban_type","cache_status","consumer","consumer_group","country_code","oidc_credential","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm","portal_api","principal"],Ug=ur(zg),Dk=[...kk,"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"],Ck=["control_plane","control_plane_group","ai_gateway","gateway_service","consumer","ai_gateway_consumer","ai_gateway_consumer_group","application","oidc_credential","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin","principal","cache_status","ai_gateway_mcp_server","ai_gateway_model","ai_gateway_agent","ai_gateway_data_plane_node"],Hg=ur(Ck);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","ai_gateway_consumer","consumer_group","ai_gateway_consumer_group","control_plane","control_plane_group","ai_gateway","country_code","data_plane_node","data_plane_node_version","ai_gateway_data_plane_node","gateway_service","header_host","header_user_agent","http_method","mcp_error","mcp_method","mcp_session_id","mcp_tool_name","oidc_credential","portal","principal","realm","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"]),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 Ok=["platform","platform_usage"],Ak=n=>Ok.includes(n),Ek=[...zg,"a2a_context_id","a2a_error","a2a_method","a2a_task_id","ai_gateway_agent","ai_gateway_mcp_server","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],Wg=ur(Ek);[...Dk];const Rk=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],$g=ur(Rk);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 Pk=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:Sk},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:Tk}},required:["field","operator"],additionalProperties:!1}]}}),Ik=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];Pk([...new Set([...Ug,...Bg,...Hg,...Wg,...Ik,...$g])]);const Lk={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"}},Nk=(n,t,e)=>{let i;const r=Lk[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 Fk={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Bk={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},zk={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Uk={date:du({formats:Fk,defaultWidth:"full"}),time:du({formats:Bk,defaultWidth:"full"}),dateTime:du({formats:zk,defaultWidth:"full"})},Hk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Wk=(n,t,e,i)=>Hk[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 $k={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Yk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Vk={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"]},qk={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"]},jk={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"}},Gk={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"}},Kk=(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"},Xk={ordinalNumber:Kk,era:to({values:$k,defaultWidth:"wide"}),quarter:to({values:Yk,defaultWidth:"wide",argumentCallback:n=>n-1}),month:to({values:Vk,defaultWidth:"wide"}),day:to({values:qk,defaultWidth:"wide"}),dayPeriod:to({values:jk,defaultWidth:"wide",formattingValues:Gk,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)?Qk(c,g=>g.test(a)):Zk(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 Zk(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Qk(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Jk(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 tD=/^(\d+)(th|st|nd|rd)?/i,eD=/\d+/i,nD={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},iD={any:[/^b/i,/^(a|c)/i]},rD={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},sD={any:[/1/i,/2/i,/3/i,/4/i]},oD={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},aD={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]},lD={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},cD={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]},uD={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},dD={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}},fD={ordinalNumber:Jk({matchPattern:tD,parsePattern:eD,valueCallback:n=>parseInt(n,10)}),era:eo({matchPatterns:nD,defaultMatchWidth:"wide",parsePatterns:iD,defaultParseWidth:"any"}),quarter:eo({matchPatterns:rD,defaultMatchWidth:"wide",parsePatterns:sD,defaultParseWidth:"any",valueCallback:n=>n+1}),month:eo({matchPatterns:oD,defaultMatchWidth:"wide",parsePatterns:aD,defaultParseWidth:"any"}),day:eo({matchPatterns:lD,defaultMatchWidth:"wide",parsePatterns:cD,defaultParseWidth:"any"}),dayPeriod:eo({matchPatterns:uD,defaultMatchWidth:"any",parsePatterns:dD,defaultParseWidth:"any"})},hD={code:"en-US",formatDistance:Nk,formatLong:Uk,formatRelative:Wk,localize:Xk,match:fD,options:{weekStartsOn:0,firstWeekContainsDate:1}};let pD={};function no(){return pD}const Vg=6048e5,gD=864e5,mD=60,yD=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 _D(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 bD(n,t,e){const[i,r]=_D(e?.in,n,t),s=Hr(i),a=Hr(r),c=+s-jg(s),u=+a-jg(a);return Math.round((c-u)/gD)}function xD(n,t){const e=We(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function wD(n,t){const e=We(n,t?.in);return bD(e,xD(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 vD(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 SD(n,t){const e=We(n,t?.in),i=+Pa(e)-+vD(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 TD(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 MD(n,t){const e=We(n,t?.in),i=+oi(e,t)-+TD(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=MD(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Qt(r,t.length)},I:function(n,t,e){const i=SD(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=wD(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"})}},kD=(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))},DD={p:tm,P:kD},CD=/^D+$/,OD=/^Y+$/,AD=["D","DD","YY","YYYY"];function ED(n){return CD.test(n)}function RD(n){return OD.test(n)}function PD(n,t,e){const i=ID(n,t,e);if(console.warn(i),AD.includes(n))throw new RangeError(i)}function ID(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 LD(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ND(n){return!(!LD(n)&&typeof n!="number"||isNaN(+We(n)))}const FD=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,BD=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,zD=/^'([^]*?)'?$/,UD=/''/g,HD=/[a-zA-Z]/;function WD(n,t,e){const i=no(),r=e?.locale??i.locale??hD,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(!ND(c))throw new RangeError("Invalid time value");let u=t.match(BD).map(h=>{const g=h[0];if(g==="p"||g==="P"){const y=DD[g];return y(h,r.formatLong)}return h}).join("").match(FD).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:$D(h)};if(Xg[g])return{isToken:!0,value:h};if(g.match(HD))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&&RD(g)||!e?.useAdditionalDayOfYearTokens&&ED(g))&&PD(g,t,String(n));const y=Xg[g[0]];return y(c,g,r.localize,d)}).join("")}function $D(n){const t=n.match(zD);return t?t[1].replace(UD,"'"):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 YD(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 VD(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 qD(){return Object.assign({},no())}function nm(n){return Math.trunc(n*yD)}function jD(n){const t=n/mD;return Math.trunc(t)}function im(n,t,e){return em(n,-1,e)}function rm(n,t,e){return YD(n,-1,e)}function sm(n,t,e){const i=qD(),r=XD(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?GD(r,t):KD(r,t)}function GD(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 KD(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function XD(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function ZD(n,t){const e=nC(t);return"formatToParts"in e?JD(e,n):tC(e,n)}const QD={year:0,month:1,day:2,hour:3,minute:4,second:5};function JD(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=QD[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 tC(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")),eC=om==="06/25/2014, 00:00:00"||om==="06/25/2014 00:00:00";function nC(n){return fu[n]||(fu[n]=eC?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,iC=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*iC,i[1]==="+"?-s:s):NaN}if(oC(n)){t=new Date(t||Date.now());const a=e?t:rC(t),c=gu(a,n);return-(e?c:sC(t,c,n))}return NaN}function rC(n){return hu(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function gu(n,t){const e=ZD(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 sC(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 oC(n){if(cm[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),cm[n]=!0,!0}catch{return!1}}const aC=60*1e3,lC={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"+cC(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)/aC: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 cC(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,uC=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?uC: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=dC(n),{year:r,restDateString:s}=fC(i.date,e),a=hC(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=pC(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 dC(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 fC(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 hC(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 yC(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 pC(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 gC=[31,28,31,30,31,30,31,31,30,31,30,31],mC=[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>mC[t]||!i&&e>gC[t])return!1}return!0}function yC(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 _C=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function bC(n,t,e={}){t=String(t);const i=t.match(_C);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,"'"+lC[a[0]](r,a,e)+"'");return u?d.substring(0,c-1)+d.substring(c+1):d},t)}return WD(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},bC(_m(n,t,{timeZone:i.timeZone}),e,i)}function xC(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 wC(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 vC(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 SC={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&&Mk.find(t=>n<=SC[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 TC(){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]",k="[object Int8Array]",O="[object Int16Array]",L="[object Int32Array]",W="[object Uint8Array]",tt="[object Uint8ClampedArray]",j="[object Uint16Array]",nt="[object Uint32Array]",X=/[\\^$.*+?()[\]{}|]/g,J=/\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[k]=ot[O]=ot[L]=ot[y]=ot[_]=ot[x]=ot[S]=ot[C]=ot[E]=ot[U]=ot[W]=ot[tt]=ot[j]=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,Z=H||V||Function("return this")(),pt=t&&!t.nodeType&&t,ft=pt&&!0&&n&&!n.nodeType&&n,it=ft&&ft.exports===pt;function ht(D,$){return D.set($[0],$[1]),D}function ut(D,$){return D.add($),D}function dt(D,$){for(var Q=-1,yt=D?D.length:0;++Q<yt&&$(D[Q],Q,D)!==!1;);return D}function mt(D,$){for(var Q=-1,yt=$.length,Me=D.length;++Q<yt;)D[Me+Q]=$[Q];return D}function lt(D,$,Q,yt){for(var Me=-1,Ye=D?D.length:0;++Me<Ye;)Q=$(Q,D[Me],Me,D);return Q}function It(D,$){for(var Q=-1,yt=Array(D);++Q<D;)yt[Q]=$(Q);return yt}function Bt(D,$){return D?.[$]}function wt(D){var $=!1;if(D!=null&&typeof D.toString!="function")try{$=!!(D+"")}catch{}return $}function Dt(D){var $=-1,Q=Array(D.size);return D.forEach(function(yt,Me){Q[++$]=[Me,yt]}),Q}function kt(D,$){return function(Q){return D($(Q))}}function ve(D){var $=-1,Q=Array(D.size);return D.forEach(function(yt){Q[++$]=yt}),Q}var bt=Array.prototype,Vt=Function.prototype,Se=Object.prototype,Ae=Z["__core-js_shared__"],oe=(function(){var D=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||"");return D?"Symbol(src)_1."+D:""})(),on=Vt.toString,qt=Se.hasOwnProperty,Ie=Se.toString,ie=RegExp("^"+on.call(qt).replace(X,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Te=it?Z.Buffer:void 0,Ee=Z.Symbol,gn=Z.Uint8Array,zi=kt(Object.getPrototypeOf,Object),Dn=Object.create,$e=Se.propertyIsEnumerable,In=bt.splice,li=Object.getOwnPropertySymbols,wo=Te?Te.isBuffer:void 0,vo=kt(Object.keys,Object),br=Gn(Z,"DataView"),ci=Gn(Z,"Map"),So=Gn(Z,"Promise"),To=Gn(Z,"Set"),Mo=Gn(Z,"WeakMap"),Ui=Gn(Object,"create"),ol=di(br),sd=di(ci),od=di(So),ad=di(To),ld=di(Mo),ko=Ee?Ee.prototype:void 0,al=ko?ko.valueOf:void 0;function ui(D){var $=-1,Q=D?D.length:0;for(this.clear();++$<Q;){var yt=D[$];this.set(yt[0],yt[1])}}function cd(){this.__data__=Ui?Ui(null):{}}function Do(D){return this.has(D)&&delete this.__data__[D]}function ud(D){var $=this.__data__;if(Ui){var Q=$[D];return Q===i?void 0:Q}return qt.call($,D)?$[D]:void 0}function Co(D){var $=this.__data__;return Ui?$[D]!==void 0:qt.call($,D)}function dd(D,$){var Q=this.__data__;return Q[D]=Ui&&$===void 0?i:$,this}ui.prototype.clear=cd,ui.prototype.delete=Do,ui.prototype.get=ud,ui.prototype.has=Co,ui.prototype.set=dd;function Ln(D){var $=-1,Q=D?D.length:0;for(this.clear();++$<Q;){var yt=D[$];this.set(yt[0],yt[1])}}function fd(){this.__data__=[]}function hd(D){var $=this.__data__,Q=xr($,D);if(Q<0)return!1;var yt=$.length-1;return Q==yt?$.pop():In.call($,Q,1),!0}function pd(D){var $=this.__data__,Q=xr($,D);return Q<0?void 0:$[Q][1]}function ll(D){return xr(this.__data__,D)>-1}function gd(D,$){var Q=this.__data__,yt=xr(Q,D);return yt<0?Q.push([D,$]):Q[yt][1]=$,this}Ln.prototype.clear=fd,Ln.prototype.delete=hd,Ln.prototype.get=pd,Ln.prototype.has=ll,Ln.prototype.set=gd;function Hi(D){var $=-1,Q=D?D.length:0;for(this.clear();++$<Q;){var yt=D[$];this.set(yt[0],yt[1])}}function cl(){this.__data__={hash:new ui,map:new(ci||Ln),string:new ui}}function md(D){return wr(this,D).delete(D)}function yd(D){return wr(this,D).get(D)}function _d(D){return wr(this,D).has(D)}function bd(D,$){return wr(this,D).set(D,$),this}Hi.prototype.clear=cl,Hi.prototype.delete=md,Hi.prototype.get=yd,Hi.prototype.has=_d,Hi.prototype.set=bd;function Wi(D){this.__data__=new Ln(D)}function xd(){this.__data__=new Ln}function es(D){return this.__data__.delete(D)}function wd(D){return this.__data__.get(D)}function ns(D){return this.__data__.has(D)}function vd(D,$){var Q=this.__data__;if(Q instanceof Ln){var yt=Q.__data__;if(!ci||yt.length<e-1)return yt.push([D,$]),this;Q=this.__data__=new Hi(yt)}return Q.set(D,$),this}Wi.prototype.clear=xd,Wi.prototype.delete=es,Wi.prototype.get=wd,Wi.prototype.has=ns,Wi.prototype.set=vd;function Sd(D,$){var Q=Po(D)||Sl(D)?It(D.length,String):[],yt=Q.length,Me=!!yt;for(var Ye in D)qt.call(D,Ye)&&!(Me&&(Ye=="length"||bl(Ye,yt)))&&Q.push(Ye);return Q}function ul(D,$,Q){var yt=D[$];(!(qt.call(D,$)&&vl(yt,Q))||Q===void 0&&!($ in D))&&(D[$]=Q)}function xr(D,$){for(var Q=D.length;Q--;)if(vl(D[Q][0],$))return Q;return-1}function dl(D,$){return D&&Ao($,Io($),D)}function is(D,$,Q,yt,Me,Ye,Nn){var Le;if(yt&&(Le=Ye?yt(D,Me,Ye,Nn):yt(D)),Le!==void 0)return Le;if(!ls(D))return D;var Ml=Po(D);if(Ml){if(Le=yl(D),!$)return ml(D,Le)}else{var ce=an(D),cs=ce==h||ce==g;if(Id(D))return hl(D,$);if(ce==x||ce==s||cs&&!Ye){if(wt(D))return Ye?D:{};if(Le=_l(cs?{}:D),!$)return Eo(D,dl(Le,D))}else{if(!ot[ce])return Ye?D:{};Le=Ed(D,ce,is,$)}}Nn||(Nn=new Wi);var Kn=Nn.get(D);if(Kn)return Kn;if(Nn.set(D,Le),!Ml)var Lo=Q?Ad(D):Io(D);return dt(Lo||D,function(vr,Ne){Lo&&(Ne=vr,vr=D[Ne]),ul(Le,Ne,is(vr,$,Q,yt,Ne,D,Nn))}),Le}function Td(D){return ls(D)?Dn(D):{}}function Md(D,$,Q){var yt=$(D);return Po(D)?yt:mt(yt,Q(D))}function kd(D){return Ie.call(D)}function Dd(D){if(!ls(D)||wl(D))return!1;var $=as(D)||wt(D)?ie:rt;return $.test(di(D))}function fl(D){if(!Ro(D))return vo(D);var $=[];for(var Q in Object(D))qt.call(D,Q)&&Q!="constructor"&&$.push(Q);return $}function hl(D,$){if($)return D.slice();var Q=new D.constructor(D.length);return D.copy(Q),Q}function rs(D){var $=new D.constructor(D.byteLength);return new gn($).set(new gn(D)),$}function Oo(D,$){var Q=$?rs(D.buffer):D.buffer;return new D.constructor(Q,D.byteOffset,D.byteLength)}function Cd(D,$,Q){var yt=$?Q(Dt(D),!0):Dt(D);return lt(yt,ht,new D.constructor)}function pl(D){var $=new D.constructor(D.source,J.exec(D));return $.lastIndex=D.lastIndex,$}function ss(D,$,Q){var yt=$?Q(ve(D),!0):ve(D);return lt(yt,ut,new D.constructor)}function gl(D){return al?Object(al.call(D)):{}}function Od(D,$){var Q=$?rs(D.buffer):D.buffer;return new D.constructor(Q,D.byteOffset,D.length)}function ml(D,$){var Q=-1,yt=D.length;for($||($=Array(yt));++Q<yt;)$[Q]=D[Q];return $}function Ao(D,$,Q,yt){Q||(Q={});for(var Me=-1,Ye=$.length;++Me<Ye;){var Nn=$[Me],Le=void 0;ul(Q,Nn,Le===void 0?D[Nn]:Le)}return Q}function Eo(D,$){return Ao(D,os(D),$)}function Ad(D){return Md(D,Io,os)}function wr(D,$){var Q=D.__data__;return xl($)?Q[typeof $=="string"?"string":"hash"]:Q.map}function Gn(D,$){var Q=Bt(D,$);return Dd(Q)?Q:void 0}var os=li?kt(li,Object):Fd,an=kd;(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(D){var $=Ie.call(D),Q=$==x?D.constructor:void 0,yt=Q?di(Q):void 0;if(yt)switch(yt){case ol:return B;case sd:return y;case od:return v;case ad:return C;case ld:return P}return $});function yl(D){var $=D.length,Q=D.constructor($);return $&&typeof D[0]=="string"&&qt.call(D,"index")&&(Q.index=D.index,Q.input=D.input),Q}function _l(D){return typeof D.constructor=="function"&&!Ro(D)?Td(zi(D)):{}}function Ed(D,$,Q,yt){var Me=D.constructor;switch($){case I:return rs(D);case c:case u:return new Me(+D);case B:return Oo(D,yt);case N:case T:case k:case O:case L:case W:case tt:case j:case nt:return Od(D,yt);case y:return Cd(D,yt,Q);case _:case E:return new Me(D);case S:return pl(D);case C:return ss(D,yt,Q);case U:return gl(D)}}function bl(D,$){return $=$??r,!!$&&(typeof D=="number"||st.test(D))&&D>-1&&D%1==0&&D<$}function xl(D){var $=typeof D;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?D!=="__proto__":D===null}function wl(D){return!!oe&&oe in D}function Ro(D){var $=D&&D.constructor,Q=typeof $=="function"&&$.prototype||Se;return D===Q}function di(D){if(D!=null){try{return on.call(D)}catch{}try{return D+""}catch{}}return""}function Rd(D){return is(D,!0,!0)}function vl(D,$){return D===$||D!==D&&$!==$}function Sl(D){return Pd(D)&&qt.call(D,"callee")&&(!$e.call(D,"callee")||Ie.call(D)==s)}var Po=Array.isArray;function Tl(D){return D!=null&&Ld(D.length)&&!as(D)}function Pd(D){return Nd(D)&&Tl(D)}var Id=wo||ee;function as(D){var $=ls(D)?Ie.call(D):"";return $==h||$==g}function Ld(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=r}function ls(D){var $=typeof D;return!!D&&($=="object"||$=="function")}function Nd(D){return!!D&&typeof D=="object"}function Io(D){return Tl(D)?Sd(D):fl(D)}function Fd(){return[]}function ee(){return!1}n.exports=Rd})(Ba,Ba.exports)),Ba.exports}TC();const kn=(n,t)=>new Date(n.getTime()-wC(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=xC(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return _m(e,t)}}class MC extends Oe{rawStart(t){let e=oi(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=kn(e,t)),e}maximumTimeframeLength(){return 3600*24*7}}class kC extends Oe{rawStart(t){let e=Yr(this.tzAdjustedDate(t));return t&&(e=kn(e,t)),e}maximumTimeframeLength(){return 3600*24*31}}class DC extends Oe{rawStart(t){let e=$r(this.tzAdjustedDate(t));return t&&(e=kn(e,t)),e}maximumTimeframeLength(){return 3600*24*92}}class CC extends Oe{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=kn(e,t)),e}maximumTimeframeLength(){return 3600*24*366}}class OC extends Oe{rawEnd(t){let e=oi(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=kn(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=oi(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=kn(i,t)),i}}class AC extends Oe{rawEnd(t){let e=$r(this.tzAdjustedDate(t));return t&&(e=kn(e,t)),e}rawStart(t){let e=$r(rm(this.tzAdjustedDate(t)));return t&&(e=kn(e,t)),e}}class EC extends Oe{rawEnd(t){let e=Yr(this.tzAdjustedDate(t));return t&&(e=kn(e,t)),e}rawStart(t){let e=Yr(im(this.tzAdjustedDate(t)));return t&&(e=kn(e,t)),e}}class RC extends Oe{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=kn(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=kn(e,t)),e}}gt.FIFTEEN_MIN,new Oe({key:gt.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>900,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),gt.ONE_HOUR,new Oe({key:gt.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>3600*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),gt.SIX_HOUR,new Oe({key:gt.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>3600*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),gt.TWELVE_HOUR,new Oe({key:gt.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>3600*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),gt.ONE_DAY,new Oe({key:gt.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>3600*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),gt.SEVEN_DAY,new Oe({key:gt.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>3600*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),gt.THIRTY_DAY,new Oe({key:gt.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>3600*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),gt.NINETY_DAY,new Oe({key:gt.NINETY_DAY,display:"Last 90 days",timeframeText:"90 days",timeframeLength:()=>3600*24*90,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),gt.ONE_HUNDRED_EIGHTY_DAY,new Oe({key:gt.ONE_HUNDRED_EIGHTY_DAY,display:"Last 180 days",timeframeText:"180 days",timeframeLength:()=>3600*24*180,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),gt.ONE_YEAR,new Oe({key:gt.ONE_YEAR,display:"Last 365 days",timeframeText:"365 days",timeframeLength:()=>3600*24*365,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),gt.CURRENT_WEEK,new MC({key:gt.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"]}),gt.CURRENT_MONTH,new kC({key:gt.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"]}),gt.CURRENT_QUARTER,new DC({key:gt.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"]}),gt.CURRENT_YEAR,new CC({key:gt.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"]}),gt.PREVIOUS_WEEK,new OC({key:gt.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>3600*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),gt.PREVIOUS_MONTH,new EC({key:gt.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*VD(new Date().setMonth(new Date().getMonth()-1))+nm(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),gt.PREVIOUS_QUARTER,new AC({key:gt.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"]}),gt.PREVIOUS_YEAR,new RC({key:gt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let e=0;return n.getTimezoneOffset()!==t.getTimezoneOffset()&&(e=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 jD(n.getTimezoneOffset()-t.getTimezoneOffset())}gt.FIFTEEN_MIN,gt.ONE_HOUR,gt.SIX_HOUR,gt.TWELVE_HOUR,gt.ONE_DAY,gt.SEVEN_DAY,gt.FIFTEEN_MIN,gt.ONE_HOUR,gt.SIX_HOUR,gt.TWELVE_HOUR,gt.ONE_DAY,gt.SEVEN_DAY,gt.THIRTY_DAY,gt.NINETY_DAY,gt.ONE_HUNDRED_EIGHTY_DAY,gt.ONE_YEAR,gt.CURRENT_WEEK,gt.CURRENT_MONTH,gt.CURRENT_QUARTER,gt.CURRENT_YEAR,gt.PREVIOUS_WEEK,gt.PREVIOUS_MONTH,gt.PREVIOUS_QUARTER,gt.PREVIOUS_YEAR;const PC=new Map(Yg.map(n=>[n.code,{code:n.code,name:n.name}])),xu=n=>PC.get(n)?.name||n,Sm=1e3,IC=1e4,Tm=1e6,Mm=1e9,km=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?IC: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<km?e=`${za(ro(n,Mm,t),t)}b`:e=`${za(ro(n,km,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 LC=typeof document<"u"&&document.documentElement?.lang||"en-US",Ha=new Intl.NumberFormat(LC);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),Dm=(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}},NC=n=>n&&n.datasets&&n.datasets.length,FC=n=>NC(n)&&n.datasets.some(t=>t.data.length),BC=n=>n.datasets.some(t=>t.data[0]&&nu(t.data[0].x)),zC=n=>!!FC(n)&&n.datasets.some(t=>t.data.length==1),UC=n=>BC(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)},HC=(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)},WC=2,Em=10,Rm=12,$a=10,$C="#f1f0ff",YC="#e0e4ea",Pm="#6c7489",VC="#afb7c5",qC="#d60027",jC="#ad000e",vu="#6c7489",Im="#52596e",GC="#007d60",KC="#995c00",XC="#ffc400",ZC="'Inter', Roboto, Helvetica, sans-serif",so="16px",QC="20px",JC="#bee2ff",tO="#8fc1ff",eO="#5f9aff",nO="#306fff",iO="#b5ffee",rO="#00fabe",sO="#00d6a4",oO="#00a17b",aO="#007d60",lO="#005944",cO="#b5ffee",uO="#00fabe",dO="#b5ffee",fO="#00a17b",hO="#fff296",pO="#ffe04b",gO="#ffc400",mO="#b37600",yO="#995c00",_O="#804400",bO="#fff296",xO="#ffe04b",wO="#ffc2b3",vO="#ff9877",SO="#ff723c",TO="#f75008",MO="#d13500",kO="#a31f00",DO="#ffc2b3",CO="#ff9877",OO="#ff723c",AO="#f75008",EO="#d13500",RO="#a31f00",PO="#ffc2b3",IO="#ff9877",LO="#ff723c",NO="#f75008",FO="#d13500",BO="#a31f00",zO="#ffc2b3",UO="#ff9877",HO="#ff723c",WO="#f75008",$O="#d13500",YO="#a31f00",VO="#ffc2b3",qO="#ff9877",jO="#ff723c",GO="#f75008",KO="#d13500",XO="#ffabab",ZO="#ff7272",QO="#ff3954",JO="#f50045",tA="#d60027",eA="#ad000e",nA="#ffabab",iA="#ff7272",rA="#ff3954",sA="#f50045",oA="#d60027",aA="#eefaff",lA="#ecfffb",cA="#fffce0",uA="#fff1ef",dA="#ffe5e5",fA="#5f9aff",hA="#00d6a4",pA="#ffc400",gA="#ff723c",mA="#ff3954",Pi=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Su=(n,t)=>(t||Pi)[n%Pi.length],yA="#6f7787",_A={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"}},bA=n=>{const t=Math.floor(parseInt(n,10)/100)*100;return _A[t]?.background||"#fafafa"},xA=VC,Lm=(n,t,e,i)=>{let r;return e?r=xA:Array.isArray(i)?r=Su(n,i):r=i[t],r||Su(n)},Tu=n=>{switch(n){case"error":return qC;case"warning":return XC;case"neutral":return Pm;default:return Pm}},wA={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},vA=2,SA=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)},TA=n=>{const e=document.createElement("canvas").getContext("2d"),i=le({});return e.font=i.string,e.measureText(n).width},MA=()=>{const n="label_height";if(!Mu.has(n)){const t=le({});Mu.set(n,t.lineHeight)}return Mu.get(n)},kA=(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)}%)`,CA=YC,OA={100:JC,101:tO,102:eO,103:nO,200:iO,201:rO,202:sO,203:oO,204:aO,205:lO,206:cO,207:uO,208:dO,226:fO,300:hO,301:pO,302:gO,303:mO,304:yO,305:_O,307:bO,308:xO,400:wO,401:vO,402:SO,403:TO,404:MO,405:kO,406:DO,407:CO,408:OO,409:AO,410:EO,411:RO,412:PO,413:IO,414:LO,415:NO,416:FO,417:BO,418:zO,421:UO,422:HO,423:WO,424:$O,425:YO,426:VO,428:qO,429:jO,431:GO,451:KO,500:XO,501:ZO,502:QO,503:JO,504:tA,505:eA,506:nA,507:iA,508:rA,510:sA,511:oA},AA={100:aA,200:lA,300:cA,400:uA,500:dA},EA={"1XX":fA,"2XX":hA,"3XX":pA,"4XX":gA,"5XX":mA},Fm=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100;return OA[t]??AA[e]??CA},ku={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Fm(`${t}`),n),{}),____OTHER____:$C,...EA};function Bm(n,t,e){const i=Ag(),r=IA(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?RA(r,t):PA(r,t)}function RA(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 PA(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function IA(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function LA(n,t){const e=UA(t);return"formatToParts"in e?FA(e,n):BA(e,n)}const NA={year:0,month:1,day:2,hour:3,minute:4,second:5};function FA(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=NA[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 BA(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 Du={},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")),zA=zm==="06/25/2014, 00:00:00"||zm==="06/25/2014 00:00:00";function UA(n){return Du[n]||(Du[n]=zA?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"})),Du[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,HA=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*HA,i[1]==="+"?-s:s):NaN}if(YA(n)){t=new Date(t||Date.now());const a=e?t:WA(t),c=Au(a,n);return-(e?c:$A(t,c,n))}return NaN}function WA(n){return Um(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Au(n,t){const e=LA(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 $A(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 YA(n){if($m[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),$m[n]=!0,!0}catch{return!1}}const VA=60*1e3,qA={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"+jA(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)/VA: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 jA(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 GA=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ru=36e5,qm=6e4,KA=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:GA};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?KA: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=XA(n),{year:r,restDateString:s}=ZA(i.date,e),a=QA(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=JA(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 XA(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 ZA(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 QA(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 nE(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 JA(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 tE=[31,28,31,30,31,30,31,31,30,31,30,31],eE=[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>eE[t]||!i&&e>tE[t])return!1}return!0}function nE(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 iE=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Iu(n,t,e={}){t=String(t);const i=t.match(iE);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,"'"+qA[a[0]](r,a,e)+"'");return u?d.substring(0,c-1)+d.substring(c+1):d},t)}return Aa(n,t,e)}function rE(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(rE(n,t,{timeZone:i.timeZone}),e,i)}const sE=(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",oE="yyyy-MM-dd",Fu="MMM dd, yyyy h:mm:ss a",Ii="MMM dd, yyyy h:mm a",aE={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:()=>oE},lE={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 sE(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 cE=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>Qm({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:aE,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),ao=({tickValue:n,granularity:t,timezone:e})=>Qm({tickValue:n,granularity:t,timezone:e,tooltipMap:lE,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),Jm=n=>n?.code==="ERR_CANCELED"||n?.name==="CanceledError"||n?.name==="AbortError",uE=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"),dE=n=>{const t=n.toLocaleLowerCase();return["sum","count","cost","tokens"].some(e=>t.endsWith(e))};function fE(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=Di(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(...WS);const hE=(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 pE(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(hE(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,gE=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?gE: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 mE(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 yE(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 _E(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 bE(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 cE({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=HC(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 ok(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=>{Dm(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 xE(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 wE(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(k=>a.map((O,L)=>{const W=k.event[y],tt=d?`${W},${O}`:`${L},${O}`,j=k.event[O];return[tt,j]})):r.map(k=>{const O=d?`${k.event[y]},${k.event[_]}`:`${y},${_}`,L=k.event[a[0]];return[O,L]})),v=Object.keys(x).reduce((k,O)=>{const[L]=O.split(","),W=x[O];return k[L]?k[L]+=W:k[L]=W,k},{}),S=Object.entries(v).sort(([,k],[,O])=>Number(O)-Number(k)).map(([k])=>k),C=s[y],E=s[_];let U=d&&C&&Object.entries(C).map(([k,O])=>({id:k,name:O.name}))||a.map(k=>({id:k,name:k})),P=d&&E&&Object.entries(E).map(([k,O])=>({id:k,name:O.name}))||a.map(k=>({id:k,name:k}));if(d&&y==="country_code"&&(U=U.map(k=>({...k,name:xu(k.id)||k.name}))),d&&_==="country_code"&&(P=P.map(k=>({...k,name:xu(k.id)||k.name}))),y!=="status_code"&&y!=="status_code_grouped"&&(U.sort((k,O)=>S.indexOf(k.id)-S.indexOf(O.id)),P.sort((k,O)=>S.indexOf(k.id)-S.indexOf(O.id))),!U||!P)return{labels:[],datasets:[]};const I=xE({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:g,barSegmentLabels:P,pivotRecords:x,rowLabels:U,colorPalette:n.colorPalette||Pi}),B=d?U.map(k=>e&&e.te(`chartLabels.${k.name}`)&&e.t(`chartLabels.${k.name}`)||k.name):a.map(k=>e&&e.te(`chartLabels.${k}`)&&e.t(`chartLabels.${k}`)||k),N=U.map(k=>k.id==="empty");return{labels:B,datasets:I,isLabelEmpty:N,isMultiDimension:h}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const vE=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),SE=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},TE=(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 vE(c,u,e)};function ME(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=SE(d),C=TE(d,h,v,S,r),E=new Set,U=r?.length?r.reduce((B,N)=>{const T=new Date(N.timestamp).valueOf(),k=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=>{k[y]===L.id||O===L.id?(B[T][O]||(B[T][O]={}),B[T][O][L.id]=Math.round(Number(k[O])*1e3)/1e3):g.length||(B[T][O]||(B[T][O]={}),B[T][O][L.id]=Math.round(Number(k[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,k],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 j=Lm(O,T,k,W);return{rawDimension:T,rawMetric:B,label:e&&e.te(`chartLabels.${T}`)&&e.t(`chartLabels.${T}`)||T,borderColor:j,backgroundColor:j,data:L,total:L.reduce((nt,{y:X})=>nt+Number(X),0),...wA,fill:tt,borderWidth:tt?SA:vA,isSegmentEmpty:k}});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 kE=(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 CE="analytics-query-provider",ry=2;function OE(){const n=p.inject(CE);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 AE=n=>n!=null,EE=Object.prototype.toString,RE=n=>EE.call(n)==="[object Object]";function Va(n){return Array.isArray(n)?n:[n]}function PE(n){return p.getCurrentInstance()}function IE(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 LE(n,t=!0,e){PE()?p.onMounted(n,e):t?n():p.nextTick(n)}function NE(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 NE(()=>{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=RE(a)?{...a}:a,h=i.flatMap(g=>r.flatMap(y=>s.map(_=>t(g,y,_,d))));u(()=>{h.forEach(g=>g())})},{flush:"post"})}function FE(){const n=p.shallowRef(!1),t=p.getCurrentInstance();return t&&p.onMounted(()=>{n.value=!0},t),n}function ay(n){const t=FE();return p.computed(()=>(t.value,!!n()))}function BE(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(AE);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 zE(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 UE(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()},k=p.toValue(P),O=typeof k=="object"?{speed:(i=p.toValue(k.speed))!==null&&i!==void 0?i:ja.speed,margin:(r=p.toValue(k.margin))!==null&&r!==void 0?r:ja.margin,direction:(s=k.direction)!==null&&s!==void 0?s:ja.direction}:ja,L=H=>typeof H=="number"?[H,H]:[H.x,H.y],W=(H,V,Z)=>{const{clientWidth:pt,clientHeight:ft,scrollLeft:it,scrollTop:ht,scrollWidth:ut,scrollHeight:dt}=H,[mt,lt]=L(O.margin),[It,Bt]=L(O.speed);let wt=0,Dt=0;(O.direction==="x"||O.direction==="both")&&(Z.x<mt&&it>0?wt=-It:Z.x+V.width>pt-mt&&it<ut-pt&&(wt=It)),(O.direction==="y"||O.direction==="both")&&(Z.y<lt&&ht>0?Dt=-Bt:Z.y+V.height>ft-lt&&ht<dt-ft&&(Dt=Bt)),(wt||Dt)&&H.scrollBy({left:wt,top:Dt,behavior:"auto"})};let tt=null;const j=()=>{const H=p.toValue(S);H&&!tt&&(tt=setInterval(()=>{const V=p.toValue(n).getBoundingClientRect(),{x:Z,y:pt}=I.value,ft={x:Z-H.scrollLeft,y:pt-H.scrollTop};ft.x>=0&&ft.y>=0&&(W(H,V,ft),ft.x+=H.scrollLeft,ft.y+=H.scrollTop,I.value=ft)},1e3/60))},nt=()=>{tt&&(clearInterval(tt),tt=null)},X=(H,V,Z,pt)=>{const[ft,it]=typeof Z=="number"?[Z,Z]:[Z.x,Z.y],{clientWidth:ht,clientHeight:ut}=V;return H.x<ft||H.x+pt.width>ht-ft||H.y<it||H.y+pt.height>ut-it},J=()=>{if(p.toValue(t.disabled)||!B.value)return;const H=p.toValue(S);if(!H)return;const V=p.toValue(n).getBoundingClientRect(),{x:Z,y:pt}=I.value,ft={x:Z-H.scrollLeft,y:pt-H.scrollTop};X(ft,H,O.margin,V)?j():nt()};p.toValue(P)&&p.watch(I,J);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 Z=p.toValue(S),pt=Z==null||(V=Z.getBoundingClientRect)===null||V===void 0?void 0:V.call(Z),ft=p.toValue(n).getBoundingClientRect(),it={x:H.clientX-(Z?ft.left-pt.left+(P?0:Z.scrollLeft):ft.left),y:H.clientY-(Z?ft.top-pt.top+(P?0:Z.scrollTop):ft.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&&zE(V);const Z=p.toValue(n).getBoundingClientRect();let{x:pt,y:ft}=I.value;if((x==="x"||x==="both")&&(pt=H.clientX-B.value.x,V&&(pt=Math.min(Math.max(0,pt),V.scrollWidth-Z.width))),(x==="y"||x==="both")&&(ft=H.clientY-B.value.y,V&&(ft=Math.min(Math.max(0,ft),V.scrollHeight-Z.height))),p.toValue(P)&&V&&(tt===null&&W(V,Z,{x:pt,y:ft}),pt+=V.scrollLeft,ft+=V.scrollTop),V&&(U||P)){if(x!=="y"){const it=pt-V.scrollLeft;it<0?pt=V.scrollLeft:it>V.clientWidth-Z.width&&(pt=V.clientWidth-Z.width+V.scrollLeft)}if(x!=="x"){const it=ft-V.scrollTop;it<0?ft=V.scrollTop:it>V.clientHeight-Z.height&&(ft=V.clientHeight-Z.height+V.scrollTop)}}I.value={x:pt,y:ft},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","pointercancel"],ot,H)}return{...IE(I),position:I,isDragging:p.computed(()=>!!B.value),style:p.computed(()=>`
|
|
3
|
+
`):n}function oS(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,T=0,C=i.reduce((P,I)=>P+I.before.length+I.lines.length+I.after.length,0);if(C+=n.beforeBody.length+n.afterBody.length,g&&(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){T=Math.max(T,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(),T+=x.width,{width:T,height:v}}function aS(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function lS(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 cS(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"),lS(d,n,t,e)&&(d="center"),d}function jp(n,t,e){const i=e.yAlign||t.yAlign||aS(n,e);return{xAlign:e.xAlign||t.xAlign||cS(n,t,e,i),yAlign:i}}function uS(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function dS(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=uS(t,c);const v=dS(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:De(x,0,i.width-t.width),y:De(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 fS(n,t,e){return ki(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=fS(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(oS(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 T,C,E,U,P,I;return s==="center"?(P=_+v/2,r==="left"?(T=y,C=T-a,U=P+a,I=P-a):(T=y+x,C=T+a,U=P-a,I=P+a),E=T):(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,T=C-a,E=C+a):(U=_+v,P=U+a,T=C+a,E=C-a),I=U),{x1:T,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},T=r.leftForLtr(y,d)+d/2,C=x+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Tc(t,v,T,C),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Tc(t,v,T,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),T=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:T,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(T,x+1,d-2,u-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:r}=this,{bodySpacing:s,bodyAlign:a,displayColors: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(k){e.fillText(k,x.x(t.x+_),t.y+y/2),t.y+=y+s},T=x.textAlign(a);let C,E,U,P,I,N,F;for(e.textAlign=a,e.textBaseline="middle",e.font=g.string,t.x=Ta(this,T,i),e.fillStyle=i.bodyColor,Xt(this.beforeBody,v),_=c&&T!=="right"?a==="center"?d/2+h:d+2+h:0,P=0,N=r.length;P<N;++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,F=U.length;I<F;++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"]},hS=Object.freeze({__proto__:null,Colors:k1,Decimation:A1,Filler:X1,Legend:nS,SubTitle:sS,Title:rS,Tooltip:hn});const pS=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function gS(n,t,e,i){const r=n.indexOf(t);if(r===-1)return pS(n,t,e,i);const s=n.lastIndexOf(t);return r!==s?e:r}const mS=(n,t)=>n===null?null:De(Math.round(n),0,t);function Jp(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class yS 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:gS(i,t,Mt(e,t),this._addedLabels),mS(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 _S(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:T}=t,C=!Tt(a),E=!Tt(c),U=!Tt(d),P=(T-v)/(g+1);let I=eh((T-v)/x/_)*_,N,F,k,S;if(I<1e-14&&!C&&!E)return[{value:v},{value:T}];S=Math.ceil(T/I)-Math.floor(v/I),S>x&&(I=eh(S*I/x/_)*_),Tt(u)||(N=Math.pow(10,u),I=Math.ceil(I*N)/N),r==="ticks"?(F=Math.floor(v/I)*I,k=Math.ceil(T/I)*I):(F=v,k=T),C&&E&&s&&sx((c-a)/s,I/1e3)?(S=Math.round(Math.min((c-a)/I,h)),I=(c-a)/S,F=a,k=c):U?(F=C?a:F,k=E?c:k,S=d-1,I=(k-F)/S):(S=(k-F)/I,Os(S,Math.round(S),I/1e3)?S=Math.round(S):S=Math.ceil(S));const O=Math.max(ih(I),ih(F));N=Math.pow(10,Tt(u)?O:u),F=Math.round(F*N)/N,k=Math.round(k*N)/N;let B=0;for(C&&(y&&F!==a?(e.push({value:a}),F<a&&B++,Os(Math.round((F+B*I)*N)/N,a,tg(a,P,n))&&B++):F<a&&B++);B<S;++B){const $=Math.round((F+B*I)*N)/N;if(E&&$>c)break;e.push({value:$})}return E&&y&&k!==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||k===c)&&e.push({value:k}),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=_S(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 bS 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 xS(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 wS(n,{min:t,max:e}){t=fn(n.min,t);const i=[],r=js(t);let s=xS(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 vS 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=wS(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 SS(n,t,e){return e=Vt(e)?e:[e],{w:vx(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 TS(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=SS(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),T=ig(x,h.y,y.h,90,270);MS(e,t,_,v,T)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=CS(n,i,r)}function MS(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 kS(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=ES(u.y,c.h,d),g=OS(d),y=AS(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 CS(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=kS(n,h,u);i.push(g),c==="auto"&&(g.visible=DS(g,d),g.visible&&(d=g))}return i}function OS(n){return n===0||n===180?"center":n<180?"left":"right"}function AS(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function ES(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function RS(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 PS(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));RS(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 IS(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 LS(n,t,e){return ki(n,{label:e,index:t,type:"pointLabel"})}class NS 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?TS(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 LS(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&&PS(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);IS(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 ka={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(ka);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=ka[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 FS(n,t,e,i,r){for(let s=rn.length-1;s>=rn.indexOf(e);s--){const a=rn[s];if(ka[a].common&&n._adapter.diff(r,i,a)>=t-1)return a}return rn[e?rn.indexOf(e):0]}function BS(n){for(let t=rn.indexOf(n)+1,e=rn.length;t<e;++t)if(ka[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 zS(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:zS(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=cx(r,s,a);return this._unit=e.unit||(i.autoSkip?ag(e.minUnit,this.min,this.max,this._getLabelCapacity(s)):FS(this,c.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:BS(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=De(e,0,a),i=De(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 Da(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 US 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=Da(e,this.min),this._tableRange=Da(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(Da(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Da(this._table,i*this._tableRange+this._minPos,!0)}}var HS=Object.freeze({__proto__:null,CategoryScale:yS,LinearScale:bS,LogarithmicScale:vS,RadialLinearScale:NS,TimeScale:Qc,TimeSeriesScale:US});const WS=[Ww,b1,hS,HS],ug=6048e5,$S=864e5,Gs=6e4,Br=36e5,YS=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 VS(n,t,e){return tu(n,t*Br)}let qS={};function ar(){return qS}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)/$S)}function jS(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 GS(n,t,e){const i=Ot(n,e?.in);return i.setTime(i.getTime()+t*Gs),i}function KS(n,t,e){return Jc(n,t*3,e)}function XS(n,t,e){return tu(n,t*1e3)}function ZS(n,t,e){return Ca(n,t*7,e)}function QS(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 JS(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function nu(n){return!(!JS(n)&&typeof n!="number"||isNaN(+Ot(n)))}function tT(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 eT(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 nT(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 iT(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 rT(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(tT(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;rT(i)&&c===1&&Ks(i,s)===1&&(u=!1);const d=a*(c-+u);return d===0?0:d}function sT(n,t,e){const i=_g(n,t,e)/3;return Xs(e?.roundingMethod)(i)}function oT(n,t,e){const i=iu(n,t)/1e3;return Xs(e?.roundingMethod)(i)}function aT(n,t,e){const i=pg(n,t,e)/7;return Xs(e?.roundingMethod)(i)}function lT(n,t,e){const[i,r]=lr(e?.in,n,t),s=Ks(i,r),a=Math.abs(eT(i,r));i.setFullYear(1584),r.setFullYear(1584);const c=Ks(i,r)===-s,u=s*(a-+c);return u===0?0:u}function cT(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 uT(n,t){const e=Ot(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function dT(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 fT(n,t){const e=Ot(n,t?.in);return e.setMinutes(59,59,999),e}function hT(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 pT(n,t){const e=Ot(n,t?.in);return e.setSeconds(59,999),e}function gT(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 mT(n,t){const e=Ot(n,t?.in);return e.setMilliseconds(999),e}const yT={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"}},_T=(n,t,e)=>{let i;const r=yT[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 bT={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xT={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},wT={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},vT={date:ru({formats:bT,defaultWidth:"full"}),time:ru({formats:xT,defaultWidth:"full"}),dateTime:ru({formats:wT,defaultWidth:"full"})},ST={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},TT=(n,t,e,i)=>ST[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 MT={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},kT={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"]},CT={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"]},OT={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"}},AT={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"}},ET={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:MT,defaultWidth:"wide"}),quarter:Zs({values:kT,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Zs({values:DT,defaultWidth:"wide"}),day:Zs({values:CT,defaultWidth:"wide"}),dayPeriod:Zs({values:OT,defaultWidth:"wide",formattingValues:AT,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)?PT(c,g=>g.test(a)):RT(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 RT(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function PT(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function IT(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 LT=/^(\d+)(th|st|nd|rd)?/i,NT=/\d+/i,FT={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},BT={any:[/^b/i,/^(a|c)/i]},zT={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},UT={any:[/1/i,/2/i,/3/i,/4/i]},HT={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},WT={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]},$T={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},YT={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]},VT={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},qT={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}},jT={ordinalNumber:IT({matchPattern:LT,parsePattern:NT,valueCallback:n=>parseInt(n,10)}),era:Qs({matchPatterns:FT,defaultMatchWidth:"wide",parsePatterns:BT,defaultParseWidth:"any"}),quarter:Qs({matchPatterns:zT,defaultMatchWidth:"wide",parsePatterns:UT,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Qs({matchPatterns:HT,defaultMatchWidth:"wide",parsePatterns:WT,defaultParseWidth:"any"}),day:Qs({matchPatterns:$T,defaultMatchWidth:"wide",parsePatterns:YT,defaultParseWidth:"any"}),dayPeriod:Qs({matchPatterns:VT,defaultMatchWidth:"any",parsePatterns:qT,defaultParseWidth:"any"})},xg={code:"en-US",formatDistance:_T,formatLong:vT,formatRelative:TT,localize:ET,match:jT,options:{weekStartsOn:0,firstWeekContainsDate:1}};function GT(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)-+jS(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 KT(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)-+KT(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=GT(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 kg=(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"})}},Dg=(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:Dg,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],r=e[2];if(!r)return kg(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}}",kg(i,t)).replace("{{time}}",Dg(r,t))}},XT=/^D+$/,ZT=/^Y+$/,QT=["D","DD","YY","YYYY"];function Cg(n){return XT.test(n)}function Og(n){return ZT.test(n)}function au(n,t,e){const i=JT(n,t,e);if(console.warn(i),QT.includes(n))throw new RangeError(i)}function JT(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 tM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,eM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,nM=/^'([^]*?)'?$/,iM=/''/g,rM=/[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(eM).map(h=>{const g=h[0];if(g==="p"||g==="P"){const y=ou[g];return y(h,r.formatLong)}return h}).join("").match(tM).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:sM(h)};if(Sg[g])return{isToken:!0,value:h};if(g.match(rM))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 sM(n){const t=n.match(nM);return t?t[1].replace(iM,"'"):n}function Ag(){return Object.assign({},ar())}function oM(n,t){const e=Ot(n,t?.in).getDay();return e===0?7:e}function aM(n,t){const e=lM(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 lM(n){return typeof n=="function"&&n.prototype?.constructor===n}const cM=10;class Eg{subPriority=0;validate(t,e){return!0}}class uM 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 dM extends Eg{priority=cM;subPriority=-1;constructor(t,e){super(),this.context=t||(i=>he(e,i))}set(t,e){return e.timestampIsSet?t:he(t,aM(t,this.context))}}class Wt{run(t,e,i,r){const s=this.parse(t,e,i,r);return s?{setter:new uM(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,e,i){return!0}}class fM 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*YS),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 hM 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 pM 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 gM 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 mM 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 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:"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 _M 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 bM 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 xM 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 wM(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 vM 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(wM(t,i,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function SM(n,t,e){const i=Ot(n,e?.in),r=wg(i,e)-t;return i.setDate(i.getDate()-r*7),i}class TM 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(SM(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const MM=[31,28,31,30,31,30,31,31,30,31,30,31],kM=[31,29,31,30,31,30,31,31,30,31,30,31];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<=kM[s]:e>=1&&e<=MM[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 CM 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 OM 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 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"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 EM 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 RM(n,t,e){const i=Ot(n,e?.in),r=oM(i,e),s=t-r;return Ca(i,s,e)}class PM 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=RM(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 IM 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 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","H","k","t","T"]}class NM 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 FM 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 BM 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 zM 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 UM 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 HM 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 WM 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 $M 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 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=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 qM extends Wt{priority=40;parse(t){return Rg(t)}set(t,e,i){return[he(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class jM extends Wt{priority=20;parse(t){return Rg(t)}set(t,e,i){return[he(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const GM={G:new fM,y:new hM,Y:new pM,R:new gM,u:new mM,Q:new yM,q:new _M,M:new bM,L:new xM,w:new vM,I:new TM,d:new DM,D:new CM,E:new OM,e:new AM,c:new EM,i:new PM,a:new IM,b:new LM,B:new NM,h:new FM,H:new BM,K:new zM,k:new UM,m:new HM,s:new WM,S:new $M,X:new YM,x:new VM,t:new qM,T:new jM},KM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,XM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ZM=/^'([^]*?)'?$/,QM=/''/g,JM=/\S/,tk=/[a-zA-Z]/;function ek(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 dM(i?.in,e)],g=t.match(XM).map(T=>{const C=T[0];if(C in ou){const E=ou[C];return E(T,a.formatLong)}return T}).join("").match(KM),y=[];for(let T of g){!i?.useAdditionalWeekYearTokens&&Og(T)&&au(T,t,n),!i?.useAdditionalDayOfYearTokens&&Cg(T)&&au(T,t,n);const C=T[0],E=GM[C];if(E){const{incompatibleTokens:U}=E;if(Array.isArray(U)){const I=y.find(N=>U.includes(N.token)||N.token===C);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${T}\` at the same time`)}else if(E.incompatibleTokens==="*"&&y.length>0)throw new RangeError(`The format string mustn't contain \`${T}\` and any other token at the same time`);y.push({token:C,fullToken:T});const P=E.run(n,T,a.match,d);if(!P)return r();h.push(P.setter),n=P.rest}else{if(C.match(tk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");if(T==="''"?T="'":C==="'"&&(T=nk(T)),n.indexOf(T)===0)n=n.slice(T.length);else return r()}}if(n.length>0&&JM.test(n))return r();const _=h.map(T=>T.priority).sort((T,C)=>C-T).filter((T,C,E)=>E.indexOf(T)===C).map(T=>h.filter(C=>C.priority===T).sort((C,E)=>E.subPriority-C.subPriority)).map(T=>T[0]);let x=Ot(e,i?.in);if(isNaN(+x))return r();const v={};for(const T of _){if(!T.validate(x,d))return r();const C=T.set(x,v,d);Array.isArray(C)?(x=C[0],Object.assign(v,C[1])):x=C}return x}function nk(n){return n.match(ZM)[1].replace(QM,"'")}function ik(n,t){const e=Ot(n,t?.in);return e.setMinutes(0,0,0),e}function rk(n,t){const e=Ot(n,t?.in);return e.setSeconds(0,0),e}function sk(n,t){const e=Ot(n,t?.in);return e.setMilliseconds(0),e}function ok(n){const t=n/Br;return Math.trunc(t)}function Lg(n,t){const e=()=>he(t?.in,NaN),i=t?.additionalDigits??2,r=uk(n);let s;if(r.date){const d=dk(r.date,i);s=fk(d.restDateString,d.year)}if(!s||isNaN(+s))return e();const a=+s;let c=0,u;if(r.time&&(c=hk(r.time),isNaN(c)))return e();if(r.timezone){if(u=pk(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+-].*)$/},ak=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,lk=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ck=/^([+-])(\d{2})(?::?(\d{2}))?$/;function uk(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 dk(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 fk(n,t){if(t===null)return new Date(NaN);const e=n.match(ak);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 bk(t,c,u)?gk(t,c,u):new Date(NaN);{const d=new Date(0);return!yk(t,s,a)||!_k(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,a)),d)}}function Js(n){return n?parseInt(n):1}function hk(n){const t=n.match(lk);if(!t)return NaN;const e=uu(t[1]),i=uu(t[2]),r=uu(t[3]);return xk(e,i,r)?e*Br+i*Gs+r*1e3:NaN}function uu(n){return n&&parseFloat(n.replace(",","."))||0}function pk(n){if(n==="Z")return 0;const t=n.match(ck);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return wk(i,r)?e*(i*Br+r*Gs):NaN}function gk(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 mk=[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 yk(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(mk[t]||(Ng(n)?29:28))}function _k(n,t){return t>=1&&t<=(Ng(n)?366:365)}function bk(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function xk(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function wk(n,t){return t>=0&&t<=59}const vk=1e3;var pt=(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))(pt||{});const Sk=["in","not_in","selector"],Tk=["empty","not_empty"],Mk=["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),kk=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],zg=[...Fg,"ai_gateway","ai_gateway_consumer","ai_gateway_data_plane_node","application","bot_info_action","bot_info_detection_reason","bot_info_ban_type","cache_status","consumer","consumer_group","country_code","oidc_credential","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm","portal_api","principal"],Ug=ur(zg),Dk=[...kk,"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"],Ck=["control_plane","control_plane_group","ai_gateway","gateway_service","consumer","ai_gateway_consumer","ai_gateway_consumer_group","application","oidc_credential","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin","principal","cache_status","ai_gateway_mcp_server","ai_gateway_model","ai_gateway_agent","ai_gateway_data_plane_node"],Hg=ur(Ck);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","ai_gateway_consumer","consumer_group","ai_gateway_consumer_group","control_plane","control_plane_group","ai_gateway","country_code","data_plane_node","data_plane_node_version","ai_gateway_data_plane_node","gateway_service","header_host","header_user_agent","http_method","mcp_error","mcp_method","mcp_session_id","mcp_tool_name","oidc_credential","portal","principal","realm","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"]),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 Ok=["platform","platform_usage"],Ak=n=>Ok.includes(n),Ek=[...zg,"a2a_context_id","a2a_error","a2a_method","a2a_task_id","ai_gateway_agent","ai_gateway_mcp_server","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],Wg=ur(Ek);[...Dk];const Rk=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],$g=ur(Rk);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 Pk=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:Sk},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:Tk}},required:["field","operator"],additionalProperties:!1}]}}),Ik=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];Pk([...new Set([...Ug,...Bg,...Hg,...Wg,...Ik,...$g])]);const Lk={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"}},Nk=(n,t,e)=>{let i;const r=Lk[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 Fk={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Bk={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},zk={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Uk={date:du({formats:Fk,defaultWidth:"full"}),time:du({formats:Bk,defaultWidth:"full"}),dateTime:du({formats:zk,defaultWidth:"full"})},Hk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Wk=(n,t,e,i)=>Hk[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 $k={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Yk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Vk={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"]},qk={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"]},jk={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"}},Gk={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"}},Kk=(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"},Xk={ordinalNumber:Kk,era:to({values:$k,defaultWidth:"wide"}),quarter:to({values:Yk,defaultWidth:"wide",argumentCallback:n=>n-1}),month:to({values:Vk,defaultWidth:"wide"}),day:to({values:qk,defaultWidth:"wide"}),dayPeriod:to({values:jk,defaultWidth:"wide",formattingValues:Gk,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)?Qk(c,g=>g.test(a)):Zk(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 Zk(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Qk(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Jk(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 tD=/^(\d+)(th|st|nd|rd)?/i,eD=/\d+/i,nD={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},iD={any:[/^b/i,/^(a|c)/i]},rD={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},sD={any:[/1/i,/2/i,/3/i,/4/i]},oD={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},aD={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]},lD={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},cD={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]},uD={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},dD={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}},fD={ordinalNumber:Jk({matchPattern:tD,parsePattern:eD,valueCallback:n=>parseInt(n,10)}),era:eo({matchPatterns:nD,defaultMatchWidth:"wide",parsePatterns:iD,defaultParseWidth:"any"}),quarter:eo({matchPatterns:rD,defaultMatchWidth:"wide",parsePatterns:sD,defaultParseWidth:"any",valueCallback:n=>n+1}),month:eo({matchPatterns:oD,defaultMatchWidth:"wide",parsePatterns:aD,defaultParseWidth:"any"}),day:eo({matchPatterns:lD,defaultMatchWidth:"wide",parsePatterns:cD,defaultParseWidth:"any"}),dayPeriod:eo({matchPatterns:uD,defaultMatchWidth:"any",parsePatterns:dD,defaultParseWidth:"any"})},hD={code:"en-US",formatDistance:Nk,formatLong:Uk,formatRelative:Wk,localize:Xk,match:fD,options:{weekStartsOn:0,firstWeekContainsDate:1}};let pD={};function no(){return pD}const Vg=6048e5,gD=864e5,mD=60,yD=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 _D(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 bD(n,t,e){const[i,r]=_D(e?.in,n,t),s=Hr(i),a=Hr(r),c=+s-jg(s),u=+a-jg(a);return Math.round((c-u)/gD)}function xD(n,t){const e=We(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function wD(n,t){const e=We(n,t?.in);return bD(e,xD(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 vD(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 SD(n,t){const e=We(n,t?.in),i=+Pa(e)-+vD(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 TD(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 MD(n,t){const e=We(n,t?.in),i=+oi(e,t)-+TD(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=MD(n,i);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Qt(r,t.length)},I:function(n,t,e){const i=SD(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=wD(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"})}},kD=(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))},DD={p:tm,P:kD},CD=/^D+$/,OD=/^Y+$/,AD=["D","DD","YY","YYYY"];function ED(n){return CD.test(n)}function RD(n){return OD.test(n)}function PD(n,t,e){const i=ID(n,t,e);if(console.warn(i),AD.includes(n))throw new RangeError(i)}function ID(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 LD(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ND(n){return!(!LD(n)&&typeof n!="number"||isNaN(+We(n)))}const FD=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,BD=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,zD=/^'([^]*?)'?$/,UD=/''/g,HD=/[a-zA-Z]/;function WD(n,t,e){const i=no(),r=e?.locale??i.locale??hD,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(!ND(c))throw new RangeError("Invalid time value");let u=t.match(BD).map(h=>{const g=h[0];if(g==="p"||g==="P"){const y=DD[g];return y(h,r.formatLong)}return h}).join("").match(FD).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const g=h[0];if(g==="'")return{isToken:!1,value:$D(h)};if(Xg[g])return{isToken:!0,value:h};if(g.match(HD))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&&RD(g)||!e?.useAdditionalDayOfYearTokens&&ED(g))&&PD(g,t,String(n));const y=Xg[g[0]];return y(c,g,r.localize,d)}).join("")}function $D(n){const t=n.match(zD);return t?t[1].replace(UD,"'"):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 YD(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 VD(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 qD(){return Object.assign({},no())}function nm(n){return Math.trunc(n*yD)}function jD(n){const t=n/mD;return Math.trunc(t)}function im(n,t,e){return em(n,-1,e)}function rm(n,t,e){return YD(n,-1,e)}function sm(n,t,e){const i=qD(),r=XD(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?GD(r,t):KD(r,t)}function GD(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 KD(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function XD(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function ZD(n,t){const e=nC(t);return"formatToParts"in e?JD(e,n):tC(e,n)}const QD={year:0,month:1,day:2,hour:3,minute:4,second:5};function JD(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=QD[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 tC(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")),eC=om==="06/25/2014, 00:00:00"||om==="06/25/2014 00:00:00";function nC(n){return fu[n]||(fu[n]=eC?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,iC=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*iC,i[1]==="+"?-s:s):NaN}if(oC(n)){t=new Date(t||Date.now());const a=e?t:rC(t),c=gu(a,n);return-(e?c:sC(t,c,n))}return NaN}function rC(n){return hu(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function gu(n,t){const e=ZD(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 sC(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 oC(n){if(cm[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),cm[n]=!0,!0}catch{return!1}}const aC=60*1e3,lC={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"+cC(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)/aC: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 cC(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,uC=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?uC: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=dC(n),{year:r,restDateString:s}=fC(i.date,e),a=hC(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=pC(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 dC(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 fC(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 hC(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 yC(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 pC(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 gC=[31,28,31,30,31,30,31,31,30,31,30,31],mC=[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>mC[t]||!i&&e>gC[t])return!1}return!0}function yC(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 _C=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function bC(n,t,e={}){t=String(t);const i=t.match(_C);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,"'"+lC[a[0]](r,a,e)+"'");return u?d.substring(0,c-1)+d.substring(c+1):d},t)}return WD(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},bC(_m(n,t,{timeZone:i.timeZone}),e,i)}function xC(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 wC(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 vC(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 SC={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&&Mk.find(t=>n<=SC[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 TC(){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]",T="[object RegExp]",C="[object Set]",E="[object String]",U="[object Symbol]",P="[object WeakMap]",I="[object ArrayBuffer]",N="[object DataView]",F="[object Float32Array]",k="[object Float64Array]",S="[object Int8Array]",O="[object Int16Array]",B="[object Int32Array]",$="[object Uint8Array]",et="[object Uint8ClampedArray]",K="[object Uint16Array]",nt="[object Uint32Array]",Q=/[\\^$.*+?()[\]{}|]/g,it=/\w*$/,st=/^\[object .+?Constructor\]$/,rt=/^(?:0|[1-9]\d*)$/,at={};at[s]=at[a]=at[I]=at[N]=at[c]=at[u]=at[F]=at[k]=at[S]=at[O]=at[B]=at[y]=at[_]=at[x]=at[T]=at[C]=at[E]=at[U]=at[$]=at[et]=at[K]=at[nt]=!0,at[d]=at[h]=at[P]=!1;var H=typeof Fa=="object"&&Fa&&Fa.Object===Object&&Fa,V=typeof self=="object"&&self&&self.Object===Object&&self,X=H||V||Function("return this")(),_t=t&&!t.nodeType&&t,ut=_t&&!0&&n&&!n.nodeType&&n,J=ut&&ut.exports===_t;function ht(D,W){return D.set(W[0],W[1]),D}function ft(D,W){return D.add(W),D}function lt(D,W){for(var Z=-1,mt=D?D.length:0;++Z<mt&&W(D[Z],Z,D)!==!1;);return D}function gt(D,W){for(var Z=-1,mt=W.length,Te=D.length;++Z<mt;)D[Te+Z]=W[Z];return D}function ct(D,W,Z,mt){for(var Te=-1,Ye=D?D.length:0;++Te<Ye;)Z=W(Z,D[Te],Te,D);return Z}function Lt(D,W){for(var Z=-1,mt=Array(D);++Z<D;)mt[Z]=W(Z);return mt}function zt(D,W){return D?.[W]}function wt(D){var W=!1;if(D!=null&&typeof D.toString!="function")try{W=!!(D+"")}catch{}return W}function Dt(D){var W=-1,Z=Array(D.size);return D.forEach(function(mt,Te){Z[++W]=[Te,mt]}),Z}function kt(D,W){return function(Z){return D(W(Z))}}function ve(D){var W=-1,Z=Array(D.size);return D.forEach(function(mt){Z[++W]=mt}),Z}var bt=Array.prototype,qt=Function.prototype,Oe=Object.prototype,Ae=X["__core-js_shared__"],oe=(function(){var D=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||"");return D?"Symbol(src)_1."+D:""})(),on=qt.toString,$t=Oe.hasOwnProperty,Ie=Oe.toString,ie=RegExp("^"+on.call($t).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Se=J?X.Buffer:void 0,Ee=X.Symbol,gn=X.Uint8Array,zi=kt(Object.getPrototypeOf,Object),Dn=Object.create,$e=Oe.propertyIsEnumerable,In=bt.splice,li=Object.getOwnPropertySymbols,wo=Se?Se.isBuffer:void 0,vo=kt(Object.keys,Object),br=Gn(X,"DataView"),ci=Gn(X,"Map"),So=Gn(X,"Promise"),To=Gn(X,"Set"),Mo=Gn(X,"WeakMap"),Ui=Gn(Object,"create"),ol=di(br),sd=di(ci),od=di(So),ad=di(To),ld=di(Mo),ko=Ee?Ee.prototype:void 0,al=ko?ko.valueOf:void 0;function ui(D){var W=-1,Z=D?D.length:0;for(this.clear();++W<Z;){var mt=D[W];this.set(mt[0],mt[1])}}function cd(){this.__data__=Ui?Ui(null):{}}function Do(D){return this.has(D)&&delete this.__data__[D]}function ud(D){var W=this.__data__;if(Ui){var Z=W[D];return Z===i?void 0:Z}return $t.call(W,D)?W[D]:void 0}function Co(D){var W=this.__data__;return Ui?W[D]!==void 0:$t.call(W,D)}function dd(D,W){var Z=this.__data__;return Z[D]=Ui&&W===void 0?i:W,this}ui.prototype.clear=cd,ui.prototype.delete=Do,ui.prototype.get=ud,ui.prototype.has=Co,ui.prototype.set=dd;function Ln(D){var W=-1,Z=D?D.length:0;for(this.clear();++W<Z;){var mt=D[W];this.set(mt[0],mt[1])}}function fd(){this.__data__=[]}function hd(D){var W=this.__data__,Z=xr(W,D);if(Z<0)return!1;var mt=W.length-1;return Z==mt?W.pop():In.call(W,Z,1),!0}function pd(D){var W=this.__data__,Z=xr(W,D);return Z<0?void 0:W[Z][1]}function ll(D){return xr(this.__data__,D)>-1}function gd(D,W){var Z=this.__data__,mt=xr(Z,D);return mt<0?Z.push([D,W]):Z[mt][1]=W,this}Ln.prototype.clear=fd,Ln.prototype.delete=hd,Ln.prototype.get=pd,Ln.prototype.has=ll,Ln.prototype.set=gd;function Hi(D){var W=-1,Z=D?D.length:0;for(this.clear();++W<Z;){var mt=D[W];this.set(mt[0],mt[1])}}function cl(){this.__data__={hash:new ui,map:new(ci||Ln),string:new ui}}function md(D){return wr(this,D).delete(D)}function yd(D){return wr(this,D).get(D)}function _d(D){return wr(this,D).has(D)}function bd(D,W){return wr(this,D).set(D,W),this}Hi.prototype.clear=cl,Hi.prototype.delete=md,Hi.prototype.get=yd,Hi.prototype.has=_d,Hi.prototype.set=bd;function Wi(D){this.__data__=new Ln(D)}function xd(){this.__data__=new Ln}function es(D){return this.__data__.delete(D)}function wd(D){return this.__data__.get(D)}function ns(D){return this.__data__.has(D)}function vd(D,W){var Z=this.__data__;if(Z instanceof Ln){var mt=Z.__data__;if(!ci||mt.length<e-1)return mt.push([D,W]),this;Z=this.__data__=new Hi(mt)}return Z.set(D,W),this}Wi.prototype.clear=xd,Wi.prototype.delete=es,Wi.prototype.get=wd,Wi.prototype.has=ns,Wi.prototype.set=vd;function Sd(D,W){var Z=Po(D)||Sl(D)?Lt(D.length,String):[],mt=Z.length,Te=!!mt;for(var Ye in D)$t.call(D,Ye)&&!(Te&&(Ye=="length"||bl(Ye,mt)))&&Z.push(Ye);return Z}function ul(D,W,Z){var mt=D[W];(!($t.call(D,W)&&vl(mt,Z))||Z===void 0&&!(W in D))&&(D[W]=Z)}function xr(D,W){for(var Z=D.length;Z--;)if(vl(D[Z][0],W))return Z;return-1}function dl(D,W){return D&&Ao(W,Io(W),D)}function is(D,W,Z,mt,Te,Ye,Nn){var Le;if(mt&&(Le=Ye?mt(D,Te,Ye,Nn):mt(D)),Le!==void 0)return Le;if(!ls(D))return D;var Ml=Po(D);if(Ml){if(Le=yl(D),!W)return ml(D,Le)}else{var ce=an(D),cs=ce==h||ce==g;if(Id(D))return hl(D,W);if(ce==x||ce==s||cs&&!Ye){if(wt(D))return Ye?D:{};if(Le=_l(cs?{}:D),!W)return Eo(D,dl(Le,D))}else{if(!at[ce])return Ye?D:{};Le=Ed(D,ce,is,W)}}Nn||(Nn=new Wi);var Kn=Nn.get(D);if(Kn)return Kn;if(Nn.set(D,Le),!Ml)var Lo=Z?Ad(D):Io(D);return lt(Lo||D,function(vr,Ne){Lo&&(Ne=vr,vr=D[Ne]),ul(Le,Ne,is(vr,W,Z,mt,Ne,D,Nn))}),Le}function Td(D){return ls(D)?Dn(D):{}}function Md(D,W,Z){var mt=W(D);return Po(D)?mt:gt(mt,Z(D))}function kd(D){return Ie.call(D)}function Dd(D){if(!ls(D)||wl(D))return!1;var W=as(D)||wt(D)?ie:st;return W.test(di(D))}function fl(D){if(!Ro(D))return vo(D);var W=[];for(var Z in Object(D))$t.call(D,Z)&&Z!="constructor"&&W.push(Z);return W}function hl(D,W){if(W)return D.slice();var Z=new D.constructor(D.length);return D.copy(Z),Z}function rs(D){var W=new D.constructor(D.byteLength);return new gn(W).set(new gn(D)),W}function Oo(D,W){var Z=W?rs(D.buffer):D.buffer;return new D.constructor(Z,D.byteOffset,D.byteLength)}function Cd(D,W,Z){var mt=W?Z(Dt(D),!0):Dt(D);return ct(mt,ht,new D.constructor)}function pl(D){var W=new D.constructor(D.source,it.exec(D));return W.lastIndex=D.lastIndex,W}function ss(D,W,Z){var mt=W?Z(ve(D),!0):ve(D);return ct(mt,ft,new D.constructor)}function gl(D){return al?Object(al.call(D)):{}}function Od(D,W){var Z=W?rs(D.buffer):D.buffer;return new D.constructor(Z,D.byteOffset,D.length)}function ml(D,W){var Z=-1,mt=D.length;for(W||(W=Array(mt));++Z<mt;)W[Z]=D[Z];return W}function Ao(D,W,Z,mt){Z||(Z={});for(var Te=-1,Ye=W.length;++Te<Ye;){var Nn=W[Te],Le=void 0;ul(Z,Nn,Le===void 0?D[Nn]:Le)}return Z}function Eo(D,W){return Ao(D,os(D),W)}function Ad(D){return Md(D,Io,os)}function wr(D,W){var Z=D.__data__;return xl(W)?Z[typeof W=="string"?"string":"hash"]:Z.map}function Gn(D,W){var Z=zt(D,W);return Dd(Z)?Z:void 0}var os=li?kt(li,Object):Fd,an=kd;(br&&an(new br(new ArrayBuffer(1)))!=N||ci&&an(new ci)!=y||So&&an(So.resolve())!=v||To&&an(new To)!=C||Mo&&an(new Mo)!=P)&&(an=function(D){var W=Ie.call(D),Z=W==x?D.constructor:void 0,mt=Z?di(Z):void 0;if(mt)switch(mt){case ol:return N;case sd:return y;case od:return v;case ad:return C;case ld:return P}return W});function yl(D){var W=D.length,Z=D.constructor(W);return W&&typeof D[0]=="string"&&$t.call(D,"index")&&(Z.index=D.index,Z.input=D.input),Z}function _l(D){return typeof D.constructor=="function"&&!Ro(D)?Td(zi(D)):{}}function Ed(D,W,Z,mt){var Te=D.constructor;switch(W){case I:return rs(D);case c:case u:return new Te(+D);case N:return Oo(D,mt);case F:case k:case S:case O:case B:case $:case et:case K:case nt:return Od(D,mt);case y:return Cd(D,mt,Z);case _:case E:return new Te(D);case T:return pl(D);case C:return ss(D,mt,Z);case U:return gl(D)}}function bl(D,W){return W=W??r,!!W&&(typeof D=="number"||rt.test(D))&&D>-1&&D%1==0&&D<W}function xl(D){var W=typeof D;return W=="string"||W=="number"||W=="symbol"||W=="boolean"?D!=="__proto__":D===null}function wl(D){return!!oe&&oe in D}function Ro(D){var W=D&&D.constructor,Z=typeof W=="function"&&W.prototype||Oe;return D===Z}function di(D){if(D!=null){try{return on.call(D)}catch{}try{return D+""}catch{}}return""}function Rd(D){return is(D,!0,!0)}function vl(D,W){return D===W||D!==D&&W!==W}function Sl(D){return Pd(D)&&$t.call(D,"callee")&&(!$e.call(D,"callee")||Ie.call(D)==s)}var Po=Array.isArray;function Tl(D){return D!=null&&Ld(D.length)&&!as(D)}function Pd(D){return Nd(D)&&Tl(D)}var Id=wo||ee;function as(D){var W=ls(D)?Ie.call(D):"";return W==h||W==g}function Ld(D){return typeof D=="number"&&D>-1&&D%1==0&&D<=r}function ls(D){var W=typeof D;return!!D&&(W=="object"||W=="function")}function Nd(D){return!!D&&typeof D=="object"}function Io(D){return Tl(D)?Sd(D):fl(D)}function Fd(){return[]}function ee(){return!1}n.exports=Rd})(Ba,Ba.exports)),Ba.exports}TC();const kn=(n,t)=>new Date(n.getTime()-wC(t,n));class Ce{timeframeText;key;display;timeframeLength;allowedTiers;defaultResponseGranularity;dataGranularity;isRelative;fineGrainedDefaultGranularity;_startCustom;_endCustom;_allowedGranularitiesOverride;constructor(t){this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=168&&e.add("hourly"),i>=48&&e.add("daily"),i>=672&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=xC(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return _m(e,t)}}class MC extends Ce{rawStart(t){let e=oi(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=kn(e,t)),e}maximumTimeframeLength(){return 3600*24*7}}class kC extends Ce{rawStart(t){let e=Yr(this.tzAdjustedDate(t));return t&&(e=kn(e,t)),e}maximumTimeframeLength(){return 3600*24*31}}class DC extends Ce{rawStart(t){let e=$r(this.tzAdjustedDate(t));return t&&(e=kn(e,t)),e}maximumTimeframeLength(){return 3600*24*92}}class CC extends Ce{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=kn(e,t)),e}maximumTimeframeLength(){return 3600*24*366}}class OC extends Ce{rawEnd(t){let e=oi(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=kn(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=oi(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=kn(i,t)),i}}class AC extends Ce{rawEnd(t){let e=$r(this.tzAdjustedDate(t));return t&&(e=kn(e,t)),e}rawStart(t){let e=$r(rm(this.tzAdjustedDate(t)));return t&&(e=kn(e,t)),e}}class EC extends Ce{rawEnd(t){let e=Yr(this.tzAdjustedDate(t));return t&&(e=kn(e,t)),e}rawStart(t){let e=Yr(im(this.tzAdjustedDate(t)));return t&&(e=kn(e,t)),e}}class RC extends Ce{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=kn(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=kn(e,t)),e}}pt.FIFTEEN_MIN,new Ce({key:pt.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"]}),pt.ONE_HOUR,new Ce({key:pt.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"]}),pt.SIX_HOUR,new Ce({key:pt.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"]}),pt.TWELVE_HOUR,new Ce({key:pt.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"]}),pt.ONE_DAY,new Ce({key:pt.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"]}),pt.SEVEN_DAY,new Ce({key:pt.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"]}),pt.THIRTY_DAY,new Ce({key:pt.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"]}),pt.NINETY_DAY,new Ce({key:pt.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"]}),pt.ONE_HUNDRED_EIGHTY_DAY,new Ce({key:pt.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"]}),pt.ONE_YEAR,new Ce({key:pt.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"]}),pt.CURRENT_WEEK,new MC({key:pt.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"]}),pt.CURRENT_MONTH,new kC({key:pt.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"]}),pt.CURRENT_QUARTER,new DC({key:pt.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"]}),pt.CURRENT_YEAR,new CC({key:pt.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"]}),pt.PREVIOUS_WEEK,new OC({key:pt.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"]}),pt.PREVIOUS_MONTH,new EC({key:pt.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*VD(new Date().setMonth(new Date().getMonth()-1))+nm(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),pt.PREVIOUS_QUARTER,new AC({key:pt.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"]}),pt.PREVIOUS_YEAR,new RC({key:pt.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 jD(n.getTimezoneOffset()-t.getTimezoneOffset())}pt.FIFTEEN_MIN,pt.ONE_HOUR,pt.SIX_HOUR,pt.TWELVE_HOUR,pt.ONE_DAY,pt.SEVEN_DAY,pt.FIFTEEN_MIN,pt.ONE_HOUR,pt.SIX_HOUR,pt.TWELVE_HOUR,pt.ONE_DAY,pt.SEVEN_DAY,pt.THIRTY_DAY,pt.NINETY_DAY,pt.ONE_HUNDRED_EIGHTY_DAY,pt.ONE_YEAR,pt.CURRENT_WEEK,pt.CURRENT_MONTH,pt.CURRENT_QUARTER,pt.CURRENT_YEAR,pt.PREVIOUS_WEEK,pt.PREVIOUS_MONTH,pt.PREVIOUS_QUARTER,pt.PREVIOUS_YEAR;const PC=new Map(Yg.map(n=>[n.code,{code:n.code,name:n.name}])),xu=n=>PC.get(n)?.name||n,Sm=1e3,IC=1e4,Tm=1e6,Mm=1e9,km=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?IC: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<km?e=`${za(ro(n,Mm,t),t)}b`:e=`${za(ro(n,km,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 LC=typeof document<"u"&&document.documentElement?.lang||"en-US",Ha=new Intl.NumberFormat(LC);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),Dm=(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}},NC=n=>n&&n.datasets&&n.datasets.length,FC=n=>NC(n)&&n.datasets.some(t=>t.data.length),BC=n=>n.datasets.some(t=>t.data[0]&&nu(t.data[0].x)),zC=n=>!!FC(n)&&n.datasets.some(t=>t.data.length==1),UC=n=>BC(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)},HC=(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)},WC=2,Em=10,Rm=12,$a=10,$C="#f1f0ff",YC="#e0e4ea",Pm="#6c7489",VC="#afb7c5",qC="#d60027",jC="#ad000e",vu="#6c7489",Im="#52596e",GC="#007d60",KC="#995c00",XC="#ffc400",ZC="'Inter', Roboto, Helvetica, sans-serif",so="16px",QC="20px",JC="#bee2ff",tO="#8fc1ff",eO="#5f9aff",nO="#306fff",iO="#b5ffee",rO="#00fabe",sO="#00d6a4",oO="#00a17b",aO="#007d60",lO="#005944",cO="#b5ffee",uO="#00fabe",dO="#b5ffee",fO="#00a17b",hO="#fff296",pO="#ffe04b",gO="#ffc400",mO="#b37600",yO="#995c00",_O="#804400",bO="#fff296",xO="#ffe04b",wO="#ffc2b3",vO="#ff9877",SO="#ff723c",TO="#f75008",MO="#d13500",kO="#a31f00",DO="#ffc2b3",CO="#ff9877",OO="#ff723c",AO="#f75008",EO="#d13500",RO="#a31f00",PO="#ffc2b3",IO="#ff9877",LO="#ff723c",NO="#f75008",FO="#d13500",BO="#a31f00",zO="#ffc2b3",UO="#ff9877",HO="#ff723c",WO="#f75008",$O="#d13500",YO="#a31f00",VO="#ffc2b3",qO="#ff9877",jO="#ff723c",GO="#f75008",KO="#d13500",XO="#ffabab",ZO="#ff7272",QO="#ff3954",JO="#f50045",tA="#d60027",eA="#ad000e",nA="#ffabab",iA="#ff7272",rA="#ff3954",sA="#f50045",oA="#d60027",aA="#eefaff",lA="#ecfffb",cA="#fffce0",uA="#fff1ef",dA="#ffe5e5",fA="#5f9aff",hA="#00d6a4",pA="#ffc400",gA="#ff723c",mA="#ff3954",Pi=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Su=(n,t)=>(t||Pi)[n%Pi.length],yA="#6f7787",_A={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"}},bA=n=>{const t=Math.floor(parseInt(n,10)/100)*100;return _A[t]?.background||"#fafafa"},xA=VC,Lm=(n,t,e,i)=>{let r;return e?r=xA:Array.isArray(i)?r=Su(n,i):r=i[t],r||Su(n)},Tu=n=>{switch(n){case"error":return qC;case"warning":return XC;case"neutral":return Pm;default:return Pm}},wA={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},vA=2,SA=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)},TA=n=>{const e=document.createElement("canvas").getContext("2d"),i=le({});return e.font=i.string,e.measureText(n).width},MA=()=>{const n="label_height";if(!Mu.has(n)){const t=le({});Mu.set(n,t.lineHeight)}return Mu.get(n)},kA=(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)}%)`,CA=YC,OA={100:JC,101:tO,102:eO,103:nO,200:iO,201:rO,202:sO,203:oO,204:aO,205:lO,206:cO,207:uO,208:dO,226:fO,300:hO,301:pO,302:gO,303:mO,304:yO,305:_O,307:bO,308:xO,400:wO,401:vO,402:SO,403:TO,404:MO,405:kO,406:DO,407:CO,408:OO,409:AO,410:EO,411:RO,412:PO,413:IO,414:LO,415:NO,416:FO,417:BO,418:zO,421:UO,422:HO,423:WO,424:$O,425:YO,426:VO,428:qO,429:jO,431:GO,451:KO,500:XO,501:ZO,502:QO,503:JO,504:tA,505:eA,506:nA,507:iA,508:rA,510:sA,511:oA},AA={100:aA,200:lA,300:cA,400:uA,500:dA},EA={"1XX":fA,"2XX":hA,"3XX":pA,"4XX":gA,"5XX":mA},Fm=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100;return OA[t]??AA[e]??CA},ku={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Fm(`${t}`),n),{}),____OTHER____:$C,...EA};function Bm(n,t,e){const i=Ag(),r=IA(n,e.timeZone,e.locale??i.locale);return"formatToParts"in r?RA(r,t):PA(r,t)}function RA(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 PA(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function IA(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function LA(n,t){const e=UA(t);return"formatToParts"in e?FA(e,n):BA(e,n)}const NA={year:0,month:1,day:2,hour:3,minute:4,second:5};function FA(n,t){try{const e=n.formatToParts(t),i=[];for(let r=0;r<e.length;r++){const s=NA[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 BA(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 Du={},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")),zA=zm==="06/25/2014, 00:00:00"||zm==="06/25/2014 00:00:00";function UA(n){return Du[n]||(Du[n]=zA?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"})),Du[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,HA=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*HA,i[1]==="+"?-s:s):NaN}if(YA(n)){t=new Date(t||Date.now());const a=e?t:WA(t),c=Au(a,n);return-(e?c:$A(t,c,n))}return NaN}function WA(n){return Um(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Au(n,t){const e=LA(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 $A(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 YA(n){if($m[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),$m[n]=!0,!0}catch{return!1}}const VA=60*1e3,qA={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"+jA(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)/VA: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 jA(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 GA=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ru=36e5,qm=6e4,KA=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:GA};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?KA: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=XA(n),{year:r,restDateString:s}=ZA(i.date,e),a=QA(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=JA(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 XA(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 ZA(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 QA(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 nE(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 JA(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 tE=[31,28,31,30,31,30,31,31,30,31,30,31],eE=[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>eE[t]||!i&&e>tE[t])return!1}return!0}function nE(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 iE=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Iu(n,t,e={}){t=String(t);const i=t.match(iE);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,"'"+qA[a[0]](r,a,e)+"'");return u?d.substring(0,c-1)+d.substring(c+1):d},t)}return Aa(n,t,e)}function rE(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(rE(n,t,{timeZone:i.timeZone}),e,i)}const sE=(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",oE="yyyy-MM-dd",Fu="MMM dd, yyyy h:mm:ss a",Ii="MMM dd, yyyy h:mm a",aE={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:()=>oE},lE={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 sE(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 cE=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>Qm({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:aE,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),ao=({tickValue:n,granularity:t,timezone:e})=>Qm({tickValue:n,granularity:t,timezone:e,tooltipMap:lE,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),Jm=n=>n?.code==="ERR_CANCELED"||n?.name==="CanceledError"||n?.name==="AbortError",uE=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"),dE=n=>{const t=n.toLocaleLowerCase();return["sum","count","cost","tokens"].some(e=>t.endsWith(e))};function fE(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=Di(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(...WS);const hE=(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 pE(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(hE(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,gE=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?gE: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 mE(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 yE(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 _E(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 bE(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 cE({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 T=HC(d,y,x);const C=d.y<x?"top":"bottom",E=d.x<_?"left":"center";return y>h.height&&(T=0),{x:v,y:T,xAlign:E,yAlign:C}};const a=p.computed(()=>{const u=Number(n.timeRangeMs.value),d=new Date,h=new Date(d.getTime()-u);return ok(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=>{Dm(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 xE(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 wE(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(S=>a.map((O,B)=>{const $=S.event[y],et=d?`${$},${O}`:`${B},${O}`,K=S.event[O];return[et,K]})):r.map(S=>{const O=d?`${S.event[y]},${S.event[_]}`:`${y},${_}`,B=S.event[a[0]];return[O,B]})),v=Object.keys(x).reduce((S,O)=>{const[B]=O.split(","),$=x[O];return S[B]?S[B]+=$:S[B]=$,S},{}),T=Object.entries(v).sort(([,S],[,O])=>Number(O)-Number(S)).map(([S])=>S),C=s[y],E=s[_];let U=d&&C&&Object.entries(C).map(([S,O])=>({id:S,name:O.name}))||a.map(S=>({id:S,name:S})),P=d&&E&&Object.entries(E).map(([S,O])=>({id:S,name:O.name}))||a.map(S=>({id:S,name:S}));if(d&&y==="country_code"&&(U=U.map(S=>({...S,name:xu(S.id)||S.name}))),d&&_==="country_code"&&(P=P.map(S=>({...S,name:xu(S.id)||S.name}))),y!=="status_code"&&y!=="status_code_grouped"&&(U.sort((S,O)=>T.indexOf(S.id)-T.indexOf(O.id)),P.sort((S,O)=>T.indexOf(S.id)-T.indexOf(O.id))),!U||!P)return{labels:[],datasets:[]};const I=xE({isMultiMetric:u,hasDimensions:d,metricNames:a,dimensionFieldNames:g,barSegmentLabels:P,pivotRecords:x,rowLabels:U,colorPalette:n.colorPalette||Pi}),N=d?U.map(S=>e&&e.te(`chartLabels.${S.name}`)&&e.t(`chartLabels.${S.name}`)||S.name):a.map(S=>e&&e.te(`chartLabels.${S}`)&&e.t(`chartLabels.${S}`)||S),F=U.map(S=>S.id==="empty");return{labels:N,datasets:I,isLabelEmpty:F,isMultiDimension:h}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const vE=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),SE=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},TE=(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 vE(c,u,e)};function ME(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(N=>({id:N,name:_[N].name}))||a.map(N=>({id:N,name:N}));y==="country_code"&&(x=x.map(N=>({...N,name:xu(N.id)||N.name})));const v=t.value.meta.granularity_ms;if(typeof v!="number"||isNaN(v)||!isFinite(v)||v===0)return console.error("Invalid step value:",v),{datasets:[],labels:[]};if(!r.length)return{datasets:[],labels:[]};const T=SE(d),C=TE(d,h,v,T,r),E=new Set,U=r?.length?r.reduce((N,F)=>{const k=new Date(F.timestamp).valueOf(),S=F.event;for(const O of a)E.add(O),k in N||(N[k]={}),O in N[k]||(N[k][O]={});for(const O of a)x.forEach(B=>{S[y]===B.id||O===B.id?(N[k][O]||(N[k][O]={}),N[k][O][B.id]=Math.round(Number(S[O])*1e3)/1e3):g.length||(N[k][O]||(N[k][O]={}),N[k][O][B.id]=Math.round(Number(S[B.id])*1e3)/1e3)});return N},{}):{},I=[...a.length===1?a.flatMap(N=>x.map(F=>[N,F.id,F.name,F.id==="empty"])):x.map(N=>[N.name,N.id,N.name,N.id==="empty"])].map(([N,F,k,S],O)=>{const B=C.map(nt=>nt in U&&N in U[nt]?{x:nt,y:U[nt][N][F]||0}:{x:nt,y:0});let{colorPalette:$,fill:et}=n;Tt($)&&($=Pi);const K=Lm(O,k,S,$);return{rawDimension:k,rawMetric:N,label:e&&e.te(`chartLabels.${k}`)&&e.t(`chartLabels.${k}`)||k,borderColor:K,backgroundColor:K,data:B,total:B.reduce((nt,{y:Q})=>nt+Number(Q),0),...wA,fill:et,borderWidth:et?SA:vA,isSegmentEmpty:S}});return y==="status_code"||y==="status_code_grouped"?I.sort((N,F)=>(N.label??"")<(F.label??"")?-1:1):I.sort((N,F)=>Number(N.total)<Number(F.total)?-1:1),{datasets:I}}}catch(r){return console.error(r),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const kE=(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 CE="analytics-query-provider",ry=2;function OE(){const n=p.inject(CE);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 AE=n=>n!=null,EE=Object.prototype.toString,RE=n=>EE.call(n)==="[object Object]";function Va(n){return Array.isArray(n)?n:[n]}function PE(n){return p.getCurrentInstance()}function IE(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 LE(n,t=!0,e){PE()?p.onMounted(n,e):t?n():p.nextTick(n)}function NE(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 NE(()=>{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=RE(a)?{...a}:a,h=i.flatMap(g=>r.flatMap(y=>s.map(_=>t(g,y,_,d))));u(()=>{h.forEach(g=>g())})},{flush:"post"})}function FE(){const n=p.shallowRef(!1),t=p.getCurrentInstance();return t&&p.onMounted(()=>{n.value=!0},t),n}function ay(n){const t=FE();return p.computed(()=>(t.value,!!n()))}function BE(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(AE);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 zE(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 UE(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:T,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}),N=p.ref(),F=H=>a?a.includes(H.pointerType):!0,k=H=>{p.toValue(c)&&H.preventDefault(),p.toValue(u)&&H.stopPropagation()},S=p.toValue(P),O=typeof S=="object"?{speed:(i=p.toValue(S.speed))!==null&&i!==void 0?i:ja.speed,margin:(r=p.toValue(S.margin))!==null&&r!==void 0?r:ja.margin,direction:(s=S.direction)!==null&&s!==void 0?s:ja.direction}:ja,B=H=>typeof H=="number"?[H,H]:[H.x,H.y],$=(H,V,X)=>{const{clientWidth:_t,clientHeight:ut,scrollLeft:J,scrollTop:ht,scrollWidth:ft,scrollHeight:lt}=H,[gt,ct]=B(O.margin),[Lt,zt]=B(O.speed);let wt=0,Dt=0;(O.direction==="x"||O.direction==="both")&&(X.x<gt&&J>0?wt=-Lt:X.x+V.width>_t-gt&&J<ft-_t&&(wt=Lt)),(O.direction==="y"||O.direction==="both")&&(X.y<ct&&ht>0?Dt=-zt:X.y+V.height>ut-ct&&ht<lt-ut&&(Dt=zt)),(wt||Dt)&&H.scrollBy({left:wt,top:Dt,behavior:"auto"})};let et=null;const K=()=>{const H=p.toValue(T);H&&!et&&(et=setInterval(()=>{const V=p.toValue(n).getBoundingClientRect(),{x:X,y:_t}=I.value,ut={x:X-H.scrollLeft,y:_t-H.scrollTop};ut.x>=0&&ut.y>=0&&($(H,V,ut),ut.x+=H.scrollLeft,ut.y+=H.scrollTop,I.value=ut)},1e3/60))},nt=()=>{et&&(clearInterval(et),et=null)},Q=(H,V,X,_t)=>{const[ut,J]=typeof X=="number"?[X,X]:[X.x,X.y],{clientWidth:ht,clientHeight:ft}=V;return H.x<ut||H.x+_t.width>ht-ut||H.y<J||H.y+_t.height>ft-J},it=()=>{if(p.toValue(t.disabled)||!N.value)return;const H=p.toValue(T);if(!H)return;const V=p.toValue(n).getBoundingClientRect(),{x:X,y:_t}=I.value,ut={x:X-H.scrollLeft,y:_t-H.scrollTop};Q(ut,H,O.margin,V)?K():nt()};p.toValue(P)&&p.watch(I,it);const st=H=>{var V;if(!p.toValue(E).includes(H.button)||p.toValue(t.disabled)||!F(H)||p.toValue(d)&&H.target!==p.toValue(n))return;const X=p.toValue(T),_t=X==null||(V=X.getBoundingClientRect)===null||V===void 0?void 0:V.call(X),ut=p.toValue(n).getBoundingClientRect(),J={x:H.clientX-(X?ut.left-_t.left+(P?0:X.scrollLeft):ut.left),y:H.clientY-(X?ut.top-_t.top+(P?0:X.scrollTop):ut.top)};y?.(J,H)!==!1&&(N.value=J,k(H))},rt=H=>{if(p.toValue(t.disabled)||!F(H)||!N.value)return;const V=p.toValue(T);V instanceof HTMLElement&&zE(V);const X=p.toValue(n).getBoundingClientRect();let{x:_t,y:ut}=I.value;if((x==="x"||x==="both")&&(_t=H.clientX-N.value.x,V&&(_t=Math.min(Math.max(0,_t),V.scrollWidth-X.width))),(x==="y"||x==="both")&&(ut=H.clientY-N.value.y,V&&(ut=Math.min(Math.max(0,ut),V.scrollHeight-X.height))),p.toValue(P)&&V&&(et===null&&$(V,X,{x:_t,y:ut}),_t+=V.scrollLeft,ut+=V.scrollTop),V&&(U||P)){if(x!=="y"){const J=_t-V.scrollLeft;J<0?_t=V.scrollLeft:J>V.clientWidth-X.width&&(_t=V.clientWidth-X.width+V.scrollLeft)}if(x!=="x"){const J=ut-V.scrollTop;J<0?ut=V.scrollTop:J>V.clientHeight-X.height&&(ut=V.clientHeight-X.height+V.scrollTop)}}I.value={x:_t,y:ut},h?.(I.value,H),k(H)},at=H=>{p.toValue(t.disabled)||!F(H)||N.value&&(N.value=void 0,P&&nt(),g?.(I.value,H),k(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",st,H),fo(v,"pointermove",rt,H),fo(v,["pointerup","pointercancel"],at,H)}return{...IE(I),position:I,isDragging:p.computed(()=>!!N.value),style:p.computed(()=>`
|
|
4
4
|
left: ${I.value.x}px;
|
|
5
5
|
top: ${I.value.y}px;
|
|
6
6
|
${P?"text-wrap: nowrap;":""}
|
|
7
|
-
`)}}function HE(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 WE(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 HE(n,S),p.watch(()=>Kr(n),C=>!C&&S()),BE(n,S,{attributeFilter:["style","class"]}),r&&fo("scroll",S,{capture:!0,passive:!0}),i&&fo("resize",S,{passive:!0}),LE(()=>{s&&S()}),{height:c,bottom:u,left:d,right:h,top:g,width:y,x:_,y:x,update:S}}function $E(n,t){const{top:e,left:i}=WE(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 YE=({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({}),VE=n=>(ho.value[n]||(ho.value[n]=ly()),ho.value[n]),qE=(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 jE({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?VE(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:YE({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 j=0;j<P.value.length;j++)tt+=P.value[j].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:j})=>[...tt,...j.map(({y:nt})=>nt)],[]),L=O.length?O[0]:0,W=O.reduce((tt,j)=>Math.min(tt,j),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)}),k=p.computed(()=>Object.values(h.maxCounts).reduce((O,L)=>Math.max(O,L),0));return p.onUnmounted(()=>{n!==void 0&&e!==void 0&&qE(n,e)}),{syncedMinStamp:v,syncedMaxStamp:S,syncedRenderPoints:C,syncedChartDatasets:P,syncedGroupSizeMs:E,syncedMinCount:T,syncedMaxCount:k}}const Pt={useBarChartOptions:fE,useChartJSCommon:pE,useChartLegendValues:mE,useChartSelectedRange:yE,useExploreResultToDatasets:wE,useExploreResultToTimeDataset:ME,useDonutChartOptions:_E,useLineChartOptions:bE,useI18n:kb,useReportChartDataForSynthetics:kE,useTranslatedUnits:DE,useEvaluateFeatureFlag:OE,useTooltipAbsolutePosition:$E,useSparklineSync:jE};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 XE(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 GE(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 KE(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):GE(i,t,e.axis))}function XE(n,t,e){let i=Number.POSITIVE_INFINITY;return Ga(n,t,e).reduce((r,s)=>{const a=s.getCenterPoint(),c=KE(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 ZE=(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 QE(n,t,e){for(const i of Object.keys(n))n[i]=Ka(n[i],t,e);return n}function JE(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 tR(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(ZE(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}),eR={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 nR(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 iR(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 eR[e](n)}function iR(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,rR=n=>isNaN(n)||n<=0,sR=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()+sR(i)+r+(n._measureText?"-spriting":"");return Hu.has(a)||Hu.set(a,cR(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:QE(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=fR(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=nR(t,e),h=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,oR(n,e)&&uR(n,{x:d,y:h},s,a),dR(n,{x:d,y:h},s,{fonts:a,colors:u}),n.restore()}function oR(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function aR(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}rR(r)||lR(n,{x:e,y:i,radius:r,rotation:c,style:a,rad:u})}function lR(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 cR(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 uR(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 dR(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 fR(n,t){const e=Ti(n)?n:t;return Ti(e)?Ka(e,0,1):1}const My=["left","bottom","top","right"];function hR(n,t){const{pointX:e,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&_R(t,s);if(!a||xR(t,s,a))return;if(n.save(),n.beginPath(),!ai(n,s))return n.restore();const{separatorStart:u,separatorEnd:d}=pR(t,a),{sideStart:h,sideEnd:g}=mR(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 pR(n,t){const{x:e,y:i,x2:r,y2:s}=n,a=gR(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 gR(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 mR(n,t,e){const{y:i,width:r,height:s,options:a}=n,c=a.callout.start,u=yR(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 yR(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function _R(n,t){const e=t.position;return My.includes(e)?e:bR(n,t)}function bR(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 xR(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 ky={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 Dy(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 vR(n,t)}function wR(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?SR(r,s,t):TR(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 vR(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=Dy(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function SR(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 TR(n,t,e){for(const i of Object.keys(ky)){const r=n[yr(n,e,i)];if(r){const{min:s,max:a,start:c,end:u,startProp:d,endProp:h}=ky[i],g=Dy(r,{min:e[s],max:e[a],start:r[c],end:r[u]});t[d]=g.start,t[h]=g.end}}}function MR({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 kR({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=MR({properties:t,options:e},a,r,s),u=kR({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 CR(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 OR(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return AR(n,t,e);case"click":return ER(n,t,e)}}function AR(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 ER(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 RR(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 PR(n,t,e){const i=BR(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 IR(n,t){for(const e of n)NR(e,t)}function Ny(n,t,e,i){if(ae(t[e])&&!LR(n.options,e,i)){const r=n[e]!==t[e];return n[e]=t[e],r}}function LR(n,t,e){return Je(n[t])||Je(n[e])}function NR(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=yr(t,n,e);i&&!t[i]&&FR(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function FR(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 BR(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||(YR(t,this),t.save(),Za(t,this.getCenterPoint(),this.rotation),Ty(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=zR(t,e);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=HR(t,e,i);let c=Qa(t.ctx,e);const u=WR(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 zR(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const r=i.controller;return r instanceof Bs&&UR(n,t,i.data)&&(!e||r.innerRadius<e.controller.innerRadius)&&r.options.circumference>=90?i:e},void 0)}function UR(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 HR({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=$R(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 WR({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function $R(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 YR(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),hR(t,this),Sy(t,this,e),Ty(t,VR(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 VR({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,qR=(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 XR(this,a,d,r)||Gu(this,a,r)}return jR(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 rP(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=wR(t,e),{x:r,y:s,x2:a,y2:c}=i,u=GR(i,t.chartArea),d=u?KR({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=iP(d,e,Rr(g,y))}const h=ZR(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 jR(n,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s}){const a=qR(t,e,n.getProps(["x","y","x2","y2"],s),i);return uy(a,r)||Gu(n,{mouseX:t,mouseY:e},s,i)}function GR({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 KR(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 XR(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 ZR(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 JR(t,e,{width:a,height:c,padding:r},n.chartArea)}function QR(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 JR(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"?QR(n):xe(t.rotation),y=tP(r,s,g),_=eP(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 tP(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 eP(n,t,e,i){let r;const s=nP(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 nP(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 iP(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 rP(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 sP({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 sP(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"?JE({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);aR(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&&aP(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=oP(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 oP({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 aP(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 lP={update:Object.assign},cP=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 uP(n,t,e,i){const r=fP(n,e.animations,i),s=t.annotations,a=gP(t.elements,s);for(let c=0;c<s.length;c++){const u=s[c],d=Xy(a,c,u.type),h=u.setContext(pP(n,d,a,u)),g=d.resolveElementProperties(n,h);g.skip=dP(g),"elements"in g&&(hP(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 dP(n){return isNaN(n.x)||isNaN(n.y)}function fP(n,t,e){return e==="reset"||e==="none"||e==="resize"?lP:new Ec(n,t)}function hP(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 cP)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 pP(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 gP(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 mP="3.1.0";const Fi=new Map,Qy=n=>n.type!=="doughnutLabel",yP=Yu.concat(Ja);var Jy={id:"annotation",version:mP,beforeRegister(){tR("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),IR(r.filter(Qy),n.scales)},afterDataLimits(n,t){const e=Fi.get(n);PR(n,t.scale,e.annotations.filter(Qy).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=Fi.get(n);CR(n,i,e),uP(n,i,e,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),RR(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);OR(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=>!yP.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=_P(s.visibleElements,t).sort((c,u)=>c.element.options.z-u.element.options.z);for(const c of a)bP(i,r,s,c);e&&Ls(i)}function _P(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 bP(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 xP={class:"zoom-timerange-container"},wP={class:"zoom-timerange-details"},vP={class:"label","data-testid":"zoom-timerange-from"},SP={class:"label","data-testid":"zoom-timerange-to"},TP=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",xP,[p.createElementVNode("div",wP,[p.createElementVNode("div",vP,p.toDisplayString(p.unref(e).t("zoom_time_range.from")),1),p.createElementVNode("div",null,p.toDisplayString(i.value),1),p.createElementVNode("div",SP,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},t_=pn(TP,[["__scopeId","data-v-4fa681cf"]]),MP={class:"zoom-actions-container"},kP={class:"zoom-actions-heading"},DP={class:"zoom-action-select"},CP=["data-testid"],OP=["aria-disabled","href"],AP=["onClick"],EP=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",MP,[p.createElementVNode("div",kP,[p.createVNode(t_,{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,OP)):(p.openBlock(),p.createElementBlock("div",{key:1,onClick:u=>r(c)},p.toDisplayString(c.label),9,AP))],10,CP))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),RP={key:2},PP={class:"tooltip-title"},IP={class:"title"},LP={key:0,class:"subtitle"},NP={class:"context"},FP={class:"metric"},BP={class:"tooltip"},zP={key:0},UP={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}=UE(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(t_,{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(EP,{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",RP,[p.createElementVNode("div",PP,[p.createElementVNode("div",IP,[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",LP,[p.createElementVNode("div",NP,p.toDisplayString(h.value),1),p.createElementVNode("div",FP,p.toDisplayString(g.value),1)])):p.createCommentVNode("",!0)]),p.createElementVNode("ul",BP,[(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",zP,[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",UP,p.toDisplayString(E),1)])):p.createCommentVNode("",!0)],64))),128))])]))],6)):p.createCommentVNode("",!0)}}),[["__scopeId","data-v-34c60646"]]),HP={key:0,class:"legend-container","data-testid":"legend"},WP=["onClick"],$P=["title"],YP={class:"label truncate-label"},VP={key:0,class:"sub-label"},qP={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,h=a(c,u);!d.getDatasetMeta(c).dataset&&u!==void 0?d.toggleDataVisibility(u):h?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",HP,[(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",YP,p.toDisplayString(y),1),v&&p.unref(i)?(p.openBlock(),p.createElementBlock("div",VP,p.toDisplayString(v.formatted),1)):p.createCommentVNode("",!0)],10,$P)]),_:2},[S?{name:"content",fn:p.withCtx(()=>[p.createElementVNode("div",qP,p.toDisplayString(p.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,WP))),128))])):p.createCommentVNode("",!0)}}}),[["__scopeId","data-v-388cf4f5"]]),Pe=[];for(let n=0;n<256;++n)Pe.push((n+256).toString(16).slice(1));function jP(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 GP=new Uint8Array(16);function KP(){return crypto.getRandomValues(GP)}function td(n,t,e){return crypto.randomUUID?crypto.randomUUID():XP(n)}function XP(n,t,e){n=n||{};const i=n.random??n.rng?.()??KP();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,jP(i)}const e_=(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 n_{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&e_(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,e_(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 ZP=["id"],QP=["id"],JP={class:"axis-tooltip-content"},t2="100%",e2="100%",n2=20,i2=20,i_=6,r2=0,s2=10,o2=10,a2=1,l2=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 n_,c=p.useTemplateRef("chartContainer"),u=p.useTemplateRef("chartParent"),d=({chart:it},ht)=>{const ut=it.data,dt=ut.labels?.indexOf(ht);return ut.datasets.reduce((mt,lt,It)=>{if(it.isDatasetVisible(It)){const Bt=lt.data[dt];return isNaN(Bt)?mt:mt+Bt}else return mt},0)},h=(it,ht,ut,dt)=>{const mt=dt==="horizontal";ht===null&&(ht=e.t("entityNoName"));const lt={type:"label",yValue:wt=>mt?ht:d(wt,ht),xValue:wt=>mt?d(wt,ht):ht},It={...lt,position:mt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>mt?0:-Math.abs(MA()),content:wt=>Nm(d(wt,ht),ut)},Bt={...lt,content:wt=>DA(d(wt,ht),kA(wt.chart,it)),position:mt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:wt=>mt?TA(Nm(d(wt,ht),ut)):0,color:yA};return{[`${ht}-value`]:It,[`${ht}-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,ht)=>Object.assign(it,h(t.chartData,ht,E.value,t.orientation)),{}),k={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=[k,{id:"axisHover",afterEvent(it,ht){if(C.show=!1,ht.event.type==="mousemove"){const ut=ht.event,dt=it.options.indexAxis,mt=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((kt=>kt==="x"?ut.y>mt.x.top:ut.x<mt.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),j=p.ref(0),nt=p.ref(0),X=new ResizeObserver(Om(it=>{j.value=it[0].contentRect.width,nt.value=it[0].contentRect.height},100)),J=p.computed(()=>{const it=t.chartData?.labels?.length;return g.value&&it&&!U.value?`${Math.max(it*(n2+i_),j.value)}px`:t2}),rt=p.computed(()=>{const it=t.chartData?.labels?.length;return g.value&&it&&U.value?`${Math.max(it*(i2+i_),nt.value)}px`:e2});Pt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey")),p.onMounted(()=>{t.annotations&&en.register(Jy),c.value&&(j.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,ht=ot.value,ut=ht.scales.y.width*it+a2,dt=(ht.scales.y.height+ht.scales.y.top+ht.scales.x.height)*it,mt=y.value.getContext("2d");return mt.scale(it,it),mt.canvas.width=ut,mt.canvas.height=dt,mt.canvas.style.width=`${ut/it}px`,mt.canvas.style.height=`${dt/it}px`,{scale:it,width:ut*it,height:dt*it,targetCtx:mt}}return null}),Z=it=>{const ht=it.target;if(V.value&&ot.value&&!U.value){const ut=V.value.scale,dt=V.value.targetCtx,mt=V.value.width,lt=V.value.height,It=ot.value,Bt=It.canvas;dt.fillStyle="white",ht.scrollLeft>=r2&&ht.scrollLeft<=s2?(dt.globalCompositeOperation="source-over",dt.clearRect(0,0,mt,lt),dt.drawImage(Bt,0,0,mt,lt,0,0,mt,lt),dt.globalCompositeOperation="destination-over",dt.fillRect(0,0,mt,lt)):(dt.globalCompositeOperation="source-over",dt.fillRect(0,(It.scales.y.height+It.scales.y.top+o2)*ut,mt,It.scales.x.height*ut))}P.offsetY=ht.scrollTop,P.offsetX=ht.scrollLeft,C.offset=ht.scrollLeft},pt=({width:it,height:ht})=>{P.width=it,P.height=ht};p.watch(()=>t.orientation,()=>{if(y.value&&V.value){const it=V.value.width,ht=V.value.height;(y.value?.getContext("2d")).clearRect(0,0,it,ht)}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 ft=()=>{P.showTooltip&&(P.interactionMode!=="idle"?P.interactionMode="idle":P.interactionMode="interactive")};return(it,ht)=>(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,ZP),p.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:ht[0]||(ht[0]=ut=>ft()),onScroll:Z},[p.createElementVNode("div",{class:"chart-body",style:p.normalizeStyle({width:J.value,height:rt.value})},[p.createElementVNode("canvas",{id:p.unref(s),ref:"canvas",class:"chart-canvas"},null,8,QP)],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",JP,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:pt},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 c2={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 c2},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=ek(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 XS(n,t);case"minute":return GS(n,t);case"hour":return VS(n,t);case"day":return Ca(n,t);case"week":return ZS(n,t);case"month":return Jc(n,t);case"quarter":return KS(n,t);case"year":return QS(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return iu(n,t);case"second":return oT(n,t);case"minute":return iT(n,t);case"hour":return nT(n,t);case"day":return pg(n,t);case"week":return aT(n,t);case"month":return _g(n,t);case"quarter":return sT(n,t);case"year":return lT(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return sk(n);case"minute":return rk(n);case"hour":return ik(n);case"day":return eu(n);case"week":return Vn(n);case"isoWeek":return Vn(n,{weekStartsOn:+e});case"month":return uT(n);case"quarter":return cT(n);case"year":return bg(n);default:return n}},endOf:function(n,t){switch(t){case"second":return mT(n);case"minute":return pT(n);case"hour":return fT(n);case"day":return mg(n);case"week":return hT(n);case"month":return yg(n);case"quarter":return gT(n);case"year":return dT(n);default:return n}}});const r_={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},u2={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...r_,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},d2=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 f2(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return p.isProxy(t)?new Proxy(n,{}):n}function h2(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function s_(n,t){n.labels=t}function o_(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 p2(n,t){const e={labels:[],datasets:[]};return s_(e,n.labels),o_(e,n.datasets,t),e}const g2=p.defineComponent({props:u2,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=p2(h,_),v=f2(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&&(h2(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&&(s_(v.config.data,C),S=!0),U&&U!==P&&(o_(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:r_,setup(e,i){let{expose:r}=i;const s=p.shallowRef(null),a=c=>{s.value=c?.chart};return r({chart:s}),()=>p.h(g2,d2({ref:a},{type:n,...e}))}})}const a_=ed("bar",Gh),l_=ed("doughnut",Bs),c_=ed("line",Kh),m2={class:"chart-container"},y2={key:0,class:"chart-center-metric"},_2={class:"chart-center-total"},b2={key:0,class:"chart-center-unit"},x2=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,k)=>(T.labels.push(k.label),T.backgroundColor.push(k.backgroundColor),T.hoverBorderColor.push(xc(k.backgroundColor).saturate(.5).darken(.15).hexString()),T.data.push(k.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(()=>dE(t.metricName??"")),S=p.computed(()=>{const N=_.value[0]?.data.reduce((T,k)=>T+k,0)??0;return x(N,t.metricUnit,{approximate:!0,translateUnit:(T,k)=>e(T,k)}).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",m2,[p.createVNode(p.unref(l_),{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",y2,[p.createElementVNode("span",_2,p.toDisplayString(S.value),1),C.value?(p.openBlock(),p.createElementBlock("span",b2,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))}}),w2=pn(x2,[["__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={},v2=()=>{Ke.x=void 0,Ke.chart=void 0,Ke.strategy=void 0,Ke.group=void 0},S2=10;class u_{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<S2)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(v2(),e)for(const i of Object.values(en.instances))i!==t&&i.update("none")}}}const T2=(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()},M2=(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()},d_=(n,t)=>{const e=n.scales.x.getValueForPixel(t.startX),i=n.scales.x.getValueForPixel(t.endX);if(!(e===void 0||i===void 0))return{xStart:Math.min(e,i),xEnd:Math.max(e,i)}},f_=(n,t,e)=>{t.canvas.dispatchEvent(new CustomEvent(n,{detail:e}))};class k2{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,this._endX=this._startX},150)},s=c=>{const u=e.getBoundingClientRect();if(i&&this._isDragging){this._endX=c.clientX-u.left;const d=d_(t,this);d&&f_("dragSelectMove",t,d)}},a=c=>{const u=e.getBoundingClientRect();if(clearTimeout(this._dragTimeout),i&&this._isDragging){this._endX=c.clientX-u.left,i=!1,this._isDragging=!1;const d=d_(t,this);d?f_("dragSelect",t,d):this.clearSelectionArea()}};e.addEventListener("mousedown",r),e.addEventListener("mousemove",s),e.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:r,onMouseMove:s,onMouseUp:a}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:r,onMouseUp:s}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",r),e.removeEventListener("mouseup",s)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(M2(t,this._startX,this._endX),T2(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 C2=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],O2=["gauge","top_n","single_value"],A2=20,E2="rgba(255, 171, 171, 0.4)",R2="rgba(255, 196, 0, 0.2)",h_=(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)},P2=(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=h_(s[d-1],s[d],a.value):c[d-1].aboveThreshold&&!c[d].aboveThreshold&&u!==void 0&&(e.push({start:u,end:h_(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},I2=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 L2{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)<A2})}}};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=ZC,i.fillText(g,t.chartArea.left,h-4),i.restore())});const a=P2(t,s);I2(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"?E2:R2,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 N2=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 u_,a=new n_,c=new k2,u=new L2(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(H){_.value=Am(H,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(H=>H.id).join("-")}`),T=p.computed(()=>`bar-${B.value.map(H=>H.id).join("-")}`),k=p.computed(()=>e.chartData&&zC(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:k,threshold:p.toRef(e,"threshold")});Pt.useReportChartDataForSynthetics(p.toRef(e,"chartData"),p.toRef(e,"syntheticsDataKey"));const L=H=>H?H.end.getTime()>H.start.getTime():!1,W=H=>({[sn.Bottom]:"column",[sn.Hidden]:"hidden"})[H],tt=({width:H,height:V})=>{E.width=H,E.height=V},j=(H=!0)=>{E.interactionMode="idle",E.showTooltip=!1,c.clearSelectionArea(),a.isPaused&&a.resume(H),s.isPaused&&s.resume()},nt=()=>{E.interactionMode="interactive"},X=()=>{!h.value||!h.value.chart.tooltip?.dataPoints?.length||(E.interactionMode==="interactive"?s.clickedSegment=h.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},J=()=>{if(C.value){C.value=!1;return}E.interactionMode!=="idle"?j():nt(),X()};p.watch(()=>e.type,()=>{E.interactionMode="idle",E.showTooltip=!1,s.destroyClickedSegment()});const rt=H=>{H.preventDefault(),H.stopPropagation();const{xStart:V,xEnd:Z}=H.detail,pt={start:new Date(V),end:new Date(Z),type:"absolute"};if(!L(pt)){S.value=void 0,j(!1);return}S.value=pt,E.interactionMode="zoom-interactive",pt&&i("select-chart-range",pt)},st=H=>{E.interactionMode="selecting-chart-area",C.value=!0,s.pause(),a.pause();const{xStart:V,xEnd:Z}=H.detail;S.value={start:new Date(V),end:new Date(Z),type:"absolute"}},ot=H=>{if(!v.value||E.interactionMode==="idle")return;const V=H.target;V&&v.value.contains(V)||C.value||j(!1)};return p.watch(()=>h.value?.chart,()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",rt),h.value.chart.canvas.removeEventListener("dragSelectMove",st),h.value.chart.canvas.addEventListener("dragSelect",rt),h.value.chart.canvas.addEventListener("dragSelectMove",st))}),p.onMounted(()=>{document.addEventListener("click",ot,!0)}),p.onUnmounted(()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",rt),h.value.chart.canvas.removeEventListener("dragSelectMove",st)),document.removeEventListener("click",ot,!0)}),(H,V)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",W(p.unref(x))]),"data-testid":"line-chart-parent"},[p.createElementVNode("div",{class:"chart-container",onClick:V[0]||(V[0]=Z=>J())},[n.type==="timeseries_line"?(p.openBlock(),p.createBlock(p.unref(c_),{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(a_),{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:tt,onOnAction:V[1]||(V[1]=()=>j(!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-399f4923"]]),F2={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},B2={class:"tooltip-content"},z2={key:2,class:"analytics-chart-parent"},U2=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||ku},p.toRef(i,"chartData")).value:Pt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||ku},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 j=new Date(i.chartData.meta.start).getTime();return new Date(i.chartData.meta.end).getTime()-j}}),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(j=>j===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 j=i.chartData.meta.metric_names[0],nt=i.chartData.meta.metric_units[j]||"";if(i.chartData.meta.metric_names.length>1){if(j.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${nt}`,{plural:"s"})});if(j.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${nt}`,{plural:"s"})})}if(j)return lo(nt)&&r.te(`metricAxisTitles.${j}`)?r.t(`metricAxisTitles.${j}`)||void 0:r.te(`chartLabels.${j}`)?r.t(`chartLabels.${j}`):j}),P=p.computed(()=>{if(i.chartOptions?.metricAxesTitle)return i.chartOptions?.metricAxesTitle;if(!i.chartData?.meta.metric_names||!i.chartData?.meta.metric_units)return;const j=i.chartData.meta.metric_names[0],nt=i.chartData.meta.metric_units[j]||"";if(i.chartData.meta.metric_names.length>1){if(j.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${nt}`,{plural:"s"})});if(j.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${nt}`,{plural:"s"})})}return r.te(`metricAxisTitles.${j}`)&&(lo(nt)||r.te(`chartUnits.${nt}`))?lo(nt)?r.t(`metricAxisTitles.${j}`)||void 0:r.t(`metricAxisTitles.${j}`,{unit:r.t(`chartUnits.${nt}`,{plural:"s"})})||void 0:j||void 0}),I=p.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const j=S.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];if(j)return r.te(`chartLabels.${j}`)?r.t(`chartLabels.${j}`):j}),B=p.computed(()=>{if(Ak(i.chartData.meta.datasource))return r.t("timestampAxisTitles.platform");const j=bu(Number(i.chartData.meta.granularity_ms));if(j)return r.te(`granularityAxisTitles.${j}`)?r.t(`granularityAxisTitles.${j}`):j}),N=p.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),T=p.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),k=p.computed(()=>S.value?UC(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:(j,nt)=>j.text===r.t("chartLabels.____OTHER____")?1:nt.text===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(j.text,10))&&!isNaN(parseInt(nt.text,10))?j.text<nt.text?-1:1:j.value&&nt.value?nt.value.raw-j.value.raw:0),W=p.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(j,nt)=>j.label===r.t("chartLabels.____OTHER____")?1:nt.label===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(j.label,10))&&!isNaN(parseInt(nt.label,10))?j.label<nt.label?-1:1:j.value&&nt.value?nt.rawValue-j.rawValue:0),tt=p.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:j=>e("zoom-time-range",j)}]:[],...i.exploreLink?[{label:r.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:r.t("zoom_action_items.view_requests"),key:"view-requests",href:i.requestsLink.href}]:[]]);return p.provide("showLegendValues",h),p.provide("legendPosition",p.toRef(i,"legendPosition")),(j,nt)=>{const X=p.resolveComponent("KTooltip"),J=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["analytics-chart-shell",{"show-values":h.value}])},[k.value&&_.value&&y.value?(p.openBlock(),p.createElementBlock("div",F2,[p.createVNode(X,{class:"tooltip","max-width":"500",placement:"right"},{content:p.withCtx(()=>[p.createElementVNode("div",B2,p.toDisplayString(x.value),1)]),default:p.withCtx(()=>[p.createVNode(p.unref(Ss.WarningIcon),{color:`var(--kui-color-text-warning, ${p.unref(KC)})`,size:`var(--kui-icon-size-40, ${p.unref(QC)})`},null,8,["color","size"])]),_:1})])):p.createCommentVNode("",!0),k.value?(p.openBlock(),p.createElementBlock("div",z2,[S.value?(p.openBlock(),p.createBlock(N2,{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(l2,{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(w2,{key:2,"chart-data":s.value,"dataset-colors":n.chartOptions.chartDatasetColors||p.unref(ku),"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(J,{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)}}}),H2=pn(U2,[["__scopeId","data-v-346b2111"]]),W2={class:"chart-parent","data-testid":"gauge-chart-parent"},$2={class:"chart-totals-flex"},Y2={key:1,class:"metric-small","data-testid":"gauge-chart-total"},V2=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",W2,[p.createElementVNode("div",$2,[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",Y2,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(l_),{"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),q2={key:1,class:"single-value-wrapper"},j2={class:"single-value-metric"},G2={class:"name-unit-alignment"},K2={class:"single-value","data-testid":"single-value-chart"},X2={key:0,class:"single-value-unit"},Z2={class:"single-value-metric-name"},Q2={key:0,class:"single-value-trend"},J2={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},id="t1",rd="t2",tI=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",k=O=>O>0?GC:O<0?jC: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",q2,[p.createElementVNode("div",j2,[p.createElementVNode("div",G2,[p.createElementVNode("span",K2,p.toDisplayString(C.value),1),_.value&&y.value?(p.openBlock(),p.createElementBlock("span",X2," "+p.toDisplayString(y.value),1)):p.createCommentVNode("",!0)]),p.createElementVNode("div",Z2,p.toDisplayString(g.value),1)]),n.showTrend?(p.openBlock(),p.createElementBlock("div",Q2,[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:k(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",J2,p.toDisplayString(p.unref(N)),1)):p.createCommentVNode("",!0)])):p.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-0203459f"]]),eI={class:"simple-chart-shell"},nI={key:1,class:"analytics-chart-parent"},iI=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",eI,[u.value?(p.openBlock(),p.createElementBlock("div",nI,[s.value?(p.openBlock(),p.createBlock(V2,{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(tI,{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"]]),rI={class:"top-n-card-title","data-testid":"top-n-card-title"},sI={class:"top-n-card-description","data-testid":"top-n-card-description"},oI={key:3,class:"top-n-table","data-testid":"top-n-table"},aI={"data-testid":"top-n-table-header"},lI={class:"top-n-table-header-row"},cI={class:"table-header-label"},uI=["data-testid"],dI=["data-testid"],fI=["data-testid"],hI=3,pI=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,hI):[]),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?j(y.value):""),x=p.computed(()=>{const X=a.value.map(J=>({key:J,label:u.value?j(J):e.t("topNTable.nameLabel"),type:"dimension"}));return y.value&&X.push({key:"value",label:_.value,type:"metric"}),g.value.forEach((J,rt)=>{rt!==0&&X.push({key:J,label:j(J),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 J=X.event;return String(J[c.value])},P=(X,J)=>{const rt=String(X.event[J]),st=t.data.meta?.display?.[J]?.[rt];return{dimension:J,id:rt,name:st?.name||"-",deleted:!!st?.deleted}},I=X=>{const J=U(X),rt=h.value&&h.value[J];return rt?rt.name:"-"},B=X=>{const J=U(X),rt=h.value&&h.value[J];return rt?!!rt.deleted:!1},N=(X,J)=>{const rt=X.event[J];if(rt==null)return"–";const st=typeof rt=="number"?rt:Number(rt);if(Number.isNaN(st))return"–";const ot=t.data.meta?.metric_units?.[J]||"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):"–",k=p.computed(()=>r.value?.length?r.value.map(X=>{const J=a.value.map(H=>P(X,H)),rt=J[0],st=rt?.id||U(X),ot={id:st,rowKey:J.map(H=>`${H.dimension}:${H.id}`).join("|")||st,name:rt?.name||I(X),deleted:B(X),dimensions:J,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,J)=>{const rt=X[J];return typeof rt=="string"?rt:rt==null?"–":String(rt)},W=(X,J)=>X.dimensions.find(rt=>rt.dimension===J)?.name||"–",tt=(X,J)=>{const rt=X.dimensions.find(st=>st.dimension===J);return{id:rt?.id||"",name:rt?.name||"–",deleted:rt?.deleted||!1,dimension:J,dimensions:X.dimensions,isEmpty:rt?.id==="empty"}},j=X=>e.te(`chartLabels.${X}`)?e.t(`chartLabels.${X}`):X,nt=(X,J)=>{if(lo(X)||X==="count"||X==="requests")return"";const rt=J===1?"":"s";return e.te(`chartUnits.${X}`)?e.t(`chartUnits.${X}`,{plural:rt}):X};return(X,J)=>{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",oI,[p.createElementVNode("table",{class:p.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":u.value}])},[p.createElementVNode("thead",aI,[p.createElementVNode("tr",lI,[(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",cI,p.toDisplayString(H.label),1)],2))),128))])]),p.createElementVNode("tbody",null,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(k.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,uI)],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,dI)):(p.openBlock(),p.createElementBlock("span",{key:1,"data-testid":`row-${H.id}-${V.key}`},p.toDisplayString(L(H,V.key)),9,fI))]))),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",rI,p.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:p.withCtx(()=>[p.createElementVNode("div",sI,p.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-bd2cedcf"]]),gI={class:"container"},mI={key:0,class:"no-data","data-testid":"sparkline-empty"},yI=["title"],_I=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 u_({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:k})=>({...N,[k]: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,k=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=>{Dm(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"),`${vC(L)} - ${tt}`}})}}},scales:{x:{min:T,max:k,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 k=10,O=this.chart.canvas.getBoundingClientRect(),L=h.width||this.width,W=h.height||this.height,tt=O.top-W>0,j=tt?O.top-W-k:O.top+O.height+k,nt=O.left>L/2-T.x,X=Math.max(k,window.innerWidth-k-L),J=Math.min(X,nt?Math.floor(O.left-L/2)+T.x:0+k);return I.value=`${j}px`,B.value=`${J}px`,{x:J,y:j,xAlign:"center",yAlign:tt?"top":"bottom"}}}),p.onUnmounted(()=>{hn.positioners[U]&&delete hn.positioners[U]}),(N,T)=>(p.openBlock(),p.createElementBlock("div",gI,[S.value?n.type==="sparkline_bar"?(p.openBlock(),p.createBlock(p.unref(a_),{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(c_),{key:2,"chart-id":p.unref(t),data:C.value,"data-testid":n.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:P.value,plugins:y.value},null,8,["chart-id","data","data-testid","options","plugins"])):p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",mI,[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,yI)):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 bI=xo.exports,p_;function xI(){return p_||(p_=1,(function(n,t){(function(){var e,i="4.18.1",r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",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,k=256,O=512,L=30,W="...",tt=800,j=16,nt=1,X=2,J=3,rt=1/0,st=9007199254740991,ot=17976931348623157e292,H=NaN,V=4294967295,Z=V-1,pt=V>>>1,ft=[["ary",T],["bind",C],["bindKey",E],["curry",P],["curryRight",I],["flip",O],["partial",B],["partialRight",N],["rearg",k]],it="[object Arguments]",ht="[object Array]",ut="[object AsyncFunction]",dt="[object Boolean]",mt="[object Date]",lt="[object DOMException]",It="[object Error]",Bt="[object Function]",wt="[object GeneratorFunction]",Dt="[object Map]",kt="[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]",Dn="[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,ko=/<%=([\s\S]+?)%>/g,al=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ui=/^\w*$/,cd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Do=/[\\^$.*+?()[\]{}|]/g,ud=RegExp(Do.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",kd="\\u2000-\\u206f",Dd=" \\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+kd+Dd,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[Dn]=ee[$e]=ee[In]=ee[li]=ee[wo]=ee[vo]=ee[br]=ee[ci]=!0,ee[it]=ee[ht]=ee[Ee]=ee[dt]=ee[gn]=ee[mt]=ee[It]=ee[Bt]=ee[Dt]=ee[kt]=ee[bt]=ee[Ae]=ee[oe]=ee[on]=ee[ie]=!1;var D={};D[it]=D[ht]=D[Ee]=D[gn]=D[dt]=D[mt]=D[zi]=D[Dn]=D[$e]=D[In]=D[li]=D[Dt]=D[kt]=D[bt]=D[Ae]=D[oe]=D[on]=D[qt]=D[wo]=D[vo]=D[br]=D[ci]=!0,D[It]=D[Bt]=D[ie]=!1;var $={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Q={"&":"&","<":"<",">":">",'"':""","'":"'"},yt={"&":"&","<":"<",">":">",""":'"',"'":"'"},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{}})(),b_=Ne&&Ne.isArrayBuffer,x_=Ne&&Ne.isDate,w_=Ne&&Ne.isMap,v_=Ne&&Ne.isRegExp,S_=Ne&&Ne.isSet,T_=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 II(F,q,Y,ct){for(var Ct=-1,$t=F==null?0:F.length;++Ct<$t;){var ke=F[Ct];q(ct,ke,Y(ke),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 LI(F,q){for(var Y=F==null?0:F.length;Y--&&q(F[Y],Y,F)!==!1;);return F}function M_(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 ke=F[Y];q(ke,Y,F)&&($t[Ct++]=ke)}return $t}function kl(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 NI(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 FI=Hd("length");function BI(F){return F.split("")}function zI(F){return F.match(pd)||[]}function k_(F,q,Y){var ct;return Y(F,function(Ct,$t,ke){if(q(Ct,$t,ke))return ct=$t,!1}),ct}function Dl(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?ZI(F,q,Y):Dl(F,D_,Y)}function UI(F,q,Y,ct){for(var Ct=Y-1,$t=F.length;++Ct<$t;)if(ct(F[Ct],q))return Ct;return-1}function D_(F){return F!==F}function C_(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 O_(F,q,Y,ct,Ct){return Ct(F,function($t,ke,ne){Y=ct?(ct=!1,$t):q(Y,$t,ke,ne)}),Y}function HI(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 WI(F,q){return ue(q,function(Y){return[Y,F[Y]]})}function A_(F){return F&&F.slice(0,I_(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 E_(F,q){for(var Y=-1,ct=F.length;++Y<ct&&us(q,F[Y],0)>-1;);return Y}function R_(F,q){for(var Y=F.length;Y--&&us(q,F[Y],0)>-1;);return Y}function $I(F,q){for(var Y=F.length,ct=0;Y--;)F[Y]===q&&++ct;return ct}var YI=Wd($),VI=Wd(Q);function qI(F){return"\\"+Me[F]}function jI(F,q){return F==null?e:F[q]}function ds(F){return ls.test(F)}function GI(F){return Nd.test(F)}function KI(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 P_(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 ke=F[Y];(ke===q||ke===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 XI(F){var q=-1,Y=Array(F.size);return F.forEach(function(ct){Y[++q]=[ct,ct]}),Y}function ZI(F,q,Y){for(var ct=Y-1,Ct=F.length;++ct<Ct;)if(F[ct]===q)return ct;return-1}function QI(F,q,Y){for(var ct=Y+1;ct--;)if(F[ct]===q)return ct;return ct}function fs(F){return ds(F)?tL(F):FI(F)}function Fn(F){return ds(F)?eL(F):BI(F)}function I_(F){for(var q=F.length;q--&&dd.test(F.charAt(q)););return q}var JI=Wd(yt);function tL(F){for(var q=as.lastIndex=0;as.test(F);)++q;return q}function eL(F){return F.match(as)||[]}function nL(F){return F.match(Ld)||[]}var iL=(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,ke=q.Math,ne=q.Object,jd=q.RegExp,rL=q.String,Cn=q.TypeError,Ol=Y.prototype,sL=$t.prototype,ps=ne.prototype,Al=q["__core-js_shared__"],El=sL.toString,jt=ps.hasOwnProperty,oL=0,L_=(function(){var o=/[^.]+$/.exec(Al&&Al.keys&&Al.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),Rl=ps.toString,aL=El.call(ne),lL=ce._,cL=jd("^"+El.call(jt).replace(Do,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pl=Lo?q.Buffer:e,qi=q.Symbol,Il=q.Uint8Array,N_=Pl?Pl.allocUnsafe:e,Ll=P_(ne.getPrototypeOf,ne),F_=ne.create,B_=ps.propertyIsEnumerable,Nl=Ol.splice,z_=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{}})(),uL=q.clearTimeout!==ce.clearTimeout&&q.clearTimeout,dL=ct&&ct.now!==ce.Date.now&&ct.now,fL=q.setTimeout!==ce.setTimeout&&q.setTimeout,Bl=ke.ceil,zl=ke.floor,Gd=ne.getOwnPropertySymbols,hL=Pl?Pl.isBuffer:e,U_=q.isFinite,pL=Ol.join,gL=P_(ne.keys,ne),De=ke.max,Ve=ke.min,mL=ct.now,yL=q.parseInt,H_=ke.random,_L=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={},bL=Or(Kd),xL=Or(Bo),wL=Or(Xd),vL=Or(gs),SL=Or(zo),Hl=qi?qi.prototype:e,Ho=Hl?Hl.valueOf:e,W_=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 $0(o)}return new On(o)}var ys=(function(){function o(){}return function(l){if(!fe(l))return{};if(F_)return F_(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:ko,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 TL(){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 ML(){if(this.__filtered__){var o=new Ut(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function kL(){var o=this.__wrapped__.value(),l=this.__dir__,f=Et(o),m=l<0,b=f?o.length:0,M=BN(0,b,this.__views__),A=M.start,R=M.end,z=R-A,G=m?R:A-1,K=this.__iteratees__,et=K.length,at=0,_t=Ve(z,this.__takeCount__);if(!f||!m&&b==z&&_t==z)return f0(o,this.__actions__);var St=[];t:for(;z--&&at<_t;){G+=l;for(var Nt=-1,xt=o[G];++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 CL(o){var l=this.has(o)&&delete this.__data__[o];return this.size-=l?1:0,l}function OL(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 AL(o){var l=this.__data__;return Uo?l[o]!==e:jt.call(l,o)}function EL(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=CL,Tr.prototype.get=OL,Tr.prototype.has=AL,Tr.prototype.set=EL;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 RL(){this.__data__=[],this.size=0}function PL(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 IL(o){var l=this.__data__,f=$l(l,o);return f<0?e:l[f][1]}function LL(o){return $l(this.__data__,o)>-1}function NL(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=RL,fi.prototype.delete=PL,fi.prototype.get=IL,fi.prototype.has=LL,fi.prototype.set=NL;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 FL(){this.size=0,this.__data__={hash:new Tr,map:new(Bo||fi),string:new Tr}}function BL(o){var l=ec(this,o).delete(o);return this.size-=l?1:0,l}function zL(o){return ec(this,o).get(o)}function UL(o){return ec(this,o).has(o)}function HL(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=FL,hi.prototype.delete=BL,hi.prototype.get=zL,hi.prototype.has=UL,hi.prototype.set=HL;function Mr(o){var l=-1,f=o==null?0:o.length;for(this.__data__=new hi;++l<f;)this.add(o[l])}function WL(o){return this.__data__.set(o,d),this}function $L(o){return this.__data__.has(o)}Mr.prototype.add=Mr.prototype.push=WL,Mr.prototype.has=$L;function Bn(o){var l=this.__data__=new fi(o);this.size=l.size}function YL(){this.__data__=new fi,this.size=0}function VL(o){var l=this.__data__,f=l.delete(o);return this.size=l.size,f}function qL(o){return this.__data__.get(o)}function jL(o){return this.__data__.has(o)}function GL(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=YL,Bn.prototype.delete=VL,Bn.prototype.get=qL,Bn.prototype.has=jL,Bn.prototype.set=GL;function $_(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,rL):[],z=R.length;for(var G in o)(l||jt.call(o,G))&&!(A&&(G=="length"||b&&(G=="offset"||G=="parent")||M&&(G=="buffer"||G=="byteLength"||G=="byteOffset")||mi(G,z)))&&R.push(G);return R}function Y_(o){var l=o.length;return l?o[lf(0,l-1)]:e}function KL(o,l){return nc(ln(o),kr(l,0,o.length))}function XL(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 ZL(o,l,f,m){return ji(o,function(b,M,A){l(m,b,f(b),A)}),m}function V_(o,l){return o&&Qn(l,Re(l),o)}function QL(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 kr(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&_,G=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=UN(o),!R)return ln(o,A)}else{var et=qe(o),at=et==Bt||et==wt;if(Zi(o))return g0(o,R);if(et==bt||et==it||at&&!b){if(A=z||at?{}:I0(o),!R)return z?ON(o,QL(A,o)):CN(o,V_(A,o))}else{if(!D[et])return b?o:{};A=HN(o,et,R)}}M||(M=new Bn);var _t=M.get(o);if(_t)return _t;M.set(o,A),cb(o)?o.forEach(function(xt){A.add(An(xt,l,f,xt,o,M))}):ab(o)&&o.forEach(function(xt,zt){A.set(zt,An(xt,l,f,zt,o,M))});var St=G?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 JL(o){var l=Re(o);return function(f){return q_(f,o,l)}}function q_(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 j_(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=kl,A=!0,R=o.length,z=[],G=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=G;at--;)if(l[at]===et)continue t;z.push(K)}else M(l,et,m)||z.push(K)}return z}var ji=x0(Zn),G_=x0(tf,!0);function tN(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 eN(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:db(m);f<m;)o[f++]=l;return o}function K_(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=$N),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=w0(),X_=w0(!0);function Zn(o,l){return o&&Jd(o,l,Re)}function tf(o,l){return o&&X_(o,l,Re)}function Vl(o,l){return $i(l,function(f){return yi(o[f])})}function Dr(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 Z_(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)?FN(o):XN(o)}function ef(o,l){return o>l}function nN(o,l){return o!=null&&jt.call(o,l)}function iN(o,l){return o!=null&&l in ne(o)}function rN(o,l,f){return o>=Ve(l,f)&&o<De(l,f)}function nf(o,l,f){for(var m=f?Bd:kl,b=o[0].length,M=o.length,A=M,R=Y(M),z=1/0,G=[];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&&G.length<z;){var _t=K[et],St=l?l(_t):_t;if(_t=f||_t!==0?_t:0,!(at?No(at,St):m(G,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),G.push(_t)}}return G}function sN(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=B0(o,l);var m=o==null?o:o[zn(Rn(l))];return m==null?e:mn(m,o,f)}function Q_(o){return ge(o)&&Xe(o)==it}function oN(o){return ge(o)&&Xe(o)==Ee}function aN(o){return ge(o)&&Xe(o)==mt}function Vo(o,l,f,m,b){return o===l?!0:o==null||l==null||!ge(o)&&!ge(l)?o!==o&&l!==l:lN(o,l,f,m,Vo,b)}function lN(o,l,f,m,b,M){var A=Et(o),R=Et(l),z=A?ht:qe(o),G=R?ht:qe(l);z=z==it?bt:z,G=G==it?bt:G;var K=z==bt,et=G==bt,at=z==G;if(at&&Zi(o)){if(!Zi(l))return!1;A=!0,K=!1}if(at&&!K)return M||(M=new Bn),A||ws(o)?E0(o,l,f,m,b,M):LN(o,l,z,f,m,b,M);if(!(f&v)){var _t=K&&jt.call(o,"__wrapped__"),St=et&&jt.call(l,"__wrapped__");if(_t||St){var Nt=_t?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),NN(o,l,f,m,b,M)):!1}function cN(o){return ge(o)&&qe(o)==Dt}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],G=o[z],K=R[1];if(A&&R[2]){if(G===e&&!(z in o))return!1}else{var et=new Bn;if(m)var at=m(G,K,z,o,l,et);if(!(at===e?Vo(K,G,v|S,m,et):at))return!1}}return!0}function J_(o){if(!fe(o)||VN(o))return!1;var l=yi(o)?cL:_d;return l.test(Or(o))}function uN(o){return ge(o)&&Xe(o)==Ae}function dN(o){return ge(o)&&qe(o)==oe}function fN(o){return ge(o)&&lc(o.length)&&!!ee[Xe(o)]}function t0(o){return typeof o=="function"?o:o==null?dn:typeof o=="object"?Et(o)?i0(o[0],o[1]):n0(o):Sb(o)}function sf(o){if(!Go(o))return gL(o);var l=[];for(var f in ne(o))jt.call(o,f)&&f!="constructor"&&l.push(f);return l}function hN(o){if(!fe(o))return KN(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 e0(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 n0(o){var l=wf(o);return l.length==1&&l[0][2]?N0(l[0][0],l[0][1]):function(f){return f===o||rf(f,o,l)}}function i0(o,l){return Sf(o)&&L0(l)?N0(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))pN(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 pN(o,l,f,m,b,M,A){var R=Mf(o,f),z=Mf(l,f),G=A.get(z);if(G){Zd(o,f,G);return}var K=M?M(R,z,f+"",o,l,A):e,et=K===e;if(et){var at=Et(z),_t=!at&&Zi(z),St=!at&&!_t&&ws(z);K=z,at||_t||St?Et(R)?K=R:_e(R)?K=ln(R):_t?(et=!1,K=g0(z,!0)):St?(et=!1,K=m0(z,!0)):K=[]:Xo(z)||Ar(z)?(K=R,Ar(R)?K=fb(R):(!fe(R)||yi(R))&&(K=I0(z))):et=!1}et&&(A.set(z,K),b(K,z,m,M,A),A.delete(z)),Zd(o,f,K)}function r0(o,l){var f=o.length;if(f)return l+=l<0?f:0,mi(l,f)?o[l]:e}function s0(o,l,f){l.length?l=ue(l,function(M){return Et(M)?function(A){return Dr(A,M.length===1?M[0]:M)}:M}):l=[dn];var m=-1;l=ue(l,_n(vt()));var b=e0(o,function(M,A,R){var z=ue(l,function(G){return G(M)});return{criteria:z,index:++m,value:M}});return HI(b,function(M,A){return DN(M,A,f)})}function gN(o,l){return o0(o,l,function(f,m){return Lf(o,m)})}function o0(o,l,f){for(var m=-1,b=l.length,M={};++m<b;){var A=l[m],R=Dr(o,A);f(R,A)&&qo(M,Ki(A,o),R)}return M}function mN(o){return function(l){return Dr(l,o)}}function af(o,l,f,m){var b=m?UI: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,G=l[M],K=f?f(G):G;(z=b(R,K,z,m))>-1;)R!==o&&Nl.call(R,z,1),Nl.call(o,z,1);return o}function a0(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(H_()*(l-o+1))}function yN(o,l,f,m){for(var b=-1,M=De(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 kf(F0(o,l,dn),o+"")}function _N(o){return Y_(vs(o))}function bN(o,l){var f=vs(o);return nc(f,kr(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]),G=f;if(z==="__proto__"||z==="constructor"||z==="prototype")return o;if(b!=A){var K=R[z];G=m?m(K,z,R):e,G===e&&(G=fe(K)?K:mi(l[b+1])?[]:{})}Wo(R,z,G),R=R[z]}return o}var l0=Ul?function(o,l){return Ul.set(o,l),o}:dn,xN=Fl?function(o,l){return Fl(o,"toString",{configurable:!0,enumerable:!1,value:Ff(l),writable:!0})}:dn;function wN(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 vN(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<=pt){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),G=l===e;b<M;){var K=zl((b+M)/2),et=f(o[K]),at=et!==e,_t=et===null,St=et===et,Nt=xn(et);if(A)var xt=m||St;else G?xt=St&&(m||at):R?xt=St&&at&&(m||!_t):z?xt=St&&at&&!_t&&(m||!Nt):_t||Nt?xt=!1:xt=m?et<=l:et<l;xt?b=K+1:M=K}return Ve(M,Z)}function c0(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 u0(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 W_?W_.call(o):"";var l=o+"";return l=="0"&&1/o==-rt?"-0":l}function Gi(o,l,f){var m=-1,b=kl,M=o.length,A=!0,R=[],z=R;if(f)A=!1,b=Bd;else if(M>=r){var G=l?null:PN(o);if(G)return Cl(G);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=B0(o,l);return M==null||delete M[zn(Rn(l))]}function d0(o,l,f,m){return qo(o,l,f(Dr(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 f0(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 h0(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]:W0(Gt(o))}var SN=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 p0=uL||function(o){return ce.clearTimeout(o)};function g0(o,l){if(l)return o.slice();var f=o.length,m=N_?N_(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 TN(o,l){var f=l?gf(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.byteLength)}function MN(o){var l=new o.constructor(o.source,cl.exec(o));return l.lastIndex=o.lastIndex,l}function kN(o){return Ho?ne(Ho.call(o)):{}}function m0(o,l){var f=l?gf(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.length)}function y0(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,G=xn(l);if(!R&&!G&&!M&&o>l||M&&A&&z&&!R&&!G||m&&A&&z||!f&&z||!b)return 1;if(!m&&!M&&!G&&o<l||G&&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=y0(b[m],M[m]);if(z){if(m>=R)return z;var G=f[m];return z*(G=="desc"?-1:1)}}return o.index-l.index}function _0(o,l,f,m){for(var b=-1,M=o.length,A=f.length,R=-1,z=l.length,G=De(M-A,0),K=Y(z+G),et=!m;++R<z;)K[R]=l[R];for(;++b<A;)(et||b<M)&&(K[f[b]]=o[b]);for(;G--;)K[R++]=o[b++];return K}function b0(o,l,f,m){for(var b=-1,M=o.length,A=-1,R=f.length,z=-1,G=l.length,K=De(M-R,0),et=Y(K+G),at=!m;++b<K;)et[b]=o[b];for(var _t=b;++z<G;)et[_t+z]=l[z];for(;++A<R;)(at||b<M)&&(et[_t+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 CN(o,l){return Qn(o,vf(o),l)}function ON(o,l){return Qn(o,R0(o),l)}function Kl(o,l){return function(f,m){var b=Et(f)?II:ZL,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 x0(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 w0(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 AN(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 v0(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(wb(xb(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 EN(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 G=M<3&&A[0]!==z&&A[M-1]!==z?[]:Vi(A,z);if(M-=G.length,M<f)return D0(o,l,Xl,b.placeholder,e,A,G,e,e,f-M);var K=this&&this!==ce&&this instanceof b?m:o;return mn(K,this,A)}return b}function S0(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 T0(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|k)&&!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 G=arguments,K=G[0];if(A&&G.length==1&&Et(K))return A.plant(K).value();for(var et=0,at=f?l[et].apply(this,G):K;++et<f;)at=l[et].call(this,at);return at}})}function Xl(o,l,f,m,b,M,A,R,z,G){var K=l&T,et=l&C,at=l&E,_t=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(_t)var Qe=xs(xt),vn=$I(Ht,Qe);if(m&&(Ht=_0(Ht,m,b,_t)),M&&(Ht=b0(Ht,M,A,_t)),zt-=vn,_t&&zt<G){var be=Vi(Ht,Qe);return D0(o,l,Xl,xt.placeholder,f,Ht,be,R,z,G-zt)}var Hn=et?f:this,bi=at?Hn[o]:o;return zt=Ht.length,R?Ht=ZN(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 M0(o,l){return function(f,m){return sN(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=u0(f),m=u0(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 RN(o,l,f,m){var b=l&C,M=jo(o);function A(){for(var R=-1,z=arguments.length,G=-1,K=m.length,et=Y(K+z),at=this&&this!==ce&&this instanceof A?M:o;++G<K;)et[G]=m[G];for(;z--;)et[G++]=arguments[++R];return mn(at,b?f:this,et)}return A}function k0(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),yN(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 D0(o,l,f,m,b,M,A,R,z,G){var K=l&P,et=K?A:e,at=K?e:A,_t=K?M:e,St=K?e:M;l|=K?B:N,l&=~(K?N:B),l&U||(l&=-4);var Nt=[o,l,b,_t,et,St,at,R,z,G],xt=f.apply(e,Nt);return Tf(o)&&z0(xt,Nt),xt.placeholder=m,U0(xt,o,l)}function yf(o){var l=ke[o];return function(f,m){if(f=Pn(f),m=m==null?0:Ve(Lt(m),292),m&&U_(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 PN=gs&&1/Cl(new gs([,-0]))[1]==rt?function(o){return new gs(o)}:Uf;function C0(o){return function(l){var f=qe(l);return f==Dt?qd(l):f==oe?XI(l):WI(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 G=m?m.length:0;if(G||(l&=-97,m=b=e),A=A===e?A:De(Lt(A),0),R=R===e?R:Lt(R),G-=b?b.length:0,l&N){var K=m,et=b;m=b=e}var at=z?e:xf(o),_t=[o,l,f,m,b,K,et,M,A,R];if(at&&GN(_t,at),o=_t[0],l=_t[1],f=_t[2],m=_t[3],b=_t[4],R=_t[9]=_t[9]===e?z?0:o.length:De(_t[9]-G,0),!R&&l&(P|I)&&(l&=-25),!l||l==C)var St=AN(o,l,f);else l==P||l==I?St=EN(o,l,R):(l==B||l==(C|B))&&!b.length?St=RN(o,l,f,m):St=Xl.apply(e,_t);var Nt=at?l0:z0;return U0(Nt(St,_t),o,l)}function O0(o,l,f,m){return o===e||Un(o,ps[f])&&!jt.call(m,f)?l:o}function A0(o,l,f,m,b,M){return fe(o)&&fe(l)&&(M.set(l,o),ql(o,l,e,A0,M),M.delete(l)),o}function IN(o){return Xo(o)?e:o}function E0(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 G=M.get(o),K=M.get(l);if(G&&K)return G==l&&K==o;var et=-1,at=!0,_t=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(_t){if(!Ud(l,function(zt,Ht){if(!No(_t,Ht)&&(St===zt||b(St,zt,f,m,M)))return _t.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 LN(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 mt:case kt:return Un(+o,+l);case It:return o.name==l.name&&o.message==l.message;case Ae:case on:return o==l+"";case Dt:var R=qd;case oe:var z=m&v;if(R||(R=Cl),o.size!=l.size&&!z)return!1;var G=A.get(o);if(G)return G==l;m|=S,A.set(o,l);var K=E0(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 NN(o,l,f,m,b,M){var A=f&v,R=_f(o),z=R.length,G=_f(l),K=G.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 _t=M.get(o),St=M.get(l);if(_t&&St)return _t==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 kf(F0(o,e,q0),o+"")}function _f(o){return Z_(o,Re,vf)}function bf(o){return Z_(o,un,R0)}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?t0:o,arguments.length?o(arguments[0],arguments[1]):o}function ec(o,l){var f=o.__data__;return YN(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,L0(b)]}return l}function Cr(o,l){var f=jI(o,l);return J_(f)?f:e}function FN(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 B_.call(o,l)}))}:Hf,R0=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)!=Dt||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 bL:return gn;case xL:return Dt;case wL:return Vt;case vL:return oe;case SL:return ie}return l});function BN(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=De(o,l-A);break}}return{start:o,end:l}}function zN(o){var l=o.match(fd);return l?l[1].split(hd):[]}function P0(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 UN(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 I0(o){return typeof o.constructor=="function"&&!Go(o)?ys(Ll(o)):{}}function HN(o,l,f){var m=o.constructor;switch(l){case Ee:return gf(o);case dt:case mt:return new m(+o);case gn:return TN(o,f);case zi:case Dn:case $e:case In:case li:case wo:case vo:case br:case ci:return m0(o,f);case Dt:return new m;case kt:case on:return new m(o);case Ae:return MN(o);case oe:return new m;case qt:return kN(o)}}function WN(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,`{
|
|
7
|
+
`)}}function HE(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 WE(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 T(){a==="sync"?v():a==="next-frame"&&requestAnimationFrame(()=>v())}return HE(n,T),p.watch(()=>Kr(n),C=>!C&&T()),BE(n,T,{attributeFilter:["style","class"]}),r&&fo("scroll",T,{capture:!0,passive:!0}),i&&fo("resize",T,{passive:!0}),LE(()=>{s&&T()}),{height:c,bottom:u,left:d,right:h,top:g,width:y,x:_,y:x,update:T}}function $E(n,t){const{top:e,left:i}=WE(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 YE=({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({}),VE=n=>(ho.value[n]||(ho.value[n]=ly()),ho.value[n]),qE=(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 jE({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?VE(e):ly(),g=n!==void 0?n:"static-chart-key",y=p.computed(()=>t.reduce((O,{timestamps:B})=>[...O,...B],[])),_=p.computed(()=>i||y.value.reduce((O,B)=>O===0?B:Math.min(O,B),0)),x=p.computed(()=>r||y.value.reduce((O,B)=>Math.max(O,B),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,B)=>O===0?B:Math.min(O,B),0)),T=p.computed(()=>Object.values(h.maxStamps).reduce((O,B)=>Math.max(O,B),0)),C=p.computed(()=>{const O=Object.values(h.renderPoints);return O.length===0?24:O.reduce((B,$)=>Math.max(B,$),2)}),E=p.computed(()=>{const O=T.value-v.value;return Math.ceil(O/C.value)}),U=p.computed(()=>t.length>1),P=p.computed(()=>t.map(({timestamps:O,color:B,label:$})=>({data:YE({bucketCount:C.value,minStamp:v.value,maxStamp:T.value,timestamps:O}).map(([nt,Q])=>({x:nt,y:Q})),label:$,...(u==="sparkline_bar"||U.value)&&B&&{backgroundColor:B},...u!=="sparkline_bar"&&B&&{borderColor:B},...U.value&&u!=="sparkline_bar"&&{fill:!0}}))),I=p.computed(()=>{const O=P.value[0]?.data?.length??0,B=[];for(let $=0;$<O;$++){let et=0;for(let K=0;K<P.value.length;K++)et+=P.value[K].data[$].y;B.push(et)}return B}),N=p.computed(()=>{const O=I.value.reduce((B,$)=>Math.max(B,$),0);return Math.max(O,a??0)}),F=p.computed(()=>{const O=P.value.reduce((et,{data:K})=>[...et,...K.map(({y:nt})=>nt)],[]),B=O.length?O[0]:0,$=O.reduce((et,K)=>Math.min(et,K),B);return s===void 0?$:Math.min($,s)});p.watchEffect(()=>{h.maxCounts[g]=N.value,h.minCounts[g]=F.value});const k=p.computed(()=>{const O=Object.values(h.minCounts),B=O.length?O[0]:0;return O.reduce(($,et)=>Math.min($,et),B)}),S=p.computed(()=>Object.values(h.maxCounts).reduce((O,B)=>Math.max(O,B),0));return p.onUnmounted(()=>{n!==void 0&&e!==void 0&&qE(n,e)}),{syncedMinStamp:v,syncedMaxStamp:T,syncedRenderPoints:C,syncedChartDatasets:P,syncedGroupSizeMs:E,syncedMinCount:k,syncedMaxCount:S}}const Pt={useBarChartOptions:fE,useChartJSCommon:pE,useChartLegendValues:mE,useChartSelectedRange:yE,useExploreResultToDatasets:wE,useExploreResultToTimeDataset:ME,useDonutChartOptions:_E,useLineChartOptions:bE,useI18n:kb,useReportChartDataForSynthetics:kE,useTranslatedUnits:DE,useEvaluateFeatureFlag:OE,useTooltipAbsolutePosition:$E,useSparklineSync:jE};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 XE(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 GE(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 KE(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):GE(i,t,e.axis))}function XE(n,t,e){let i=Number.POSITIVE_INFINITY;return Ga(n,t,e).reduce((r,s)=>{const a=s.getCenterPoint(),c=KE(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 ZE=(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 QE(n,t,e){for(const i of Object.keys(n))n[i]=Ka(n[i],t,e);return n}function JE(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 tR(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(ZE(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}),eR={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 nR(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=Vt(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 iR(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 eR[e](n)}function iR(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,rR=n=>isNaN(n)||n<=0,sR=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=Vt(e)?e:[e],a=s.join()+sR(i)+r+(n._measureText?"-spriting":"");return Hu.has(a)||Hu.set(a,cR(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:QE(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=fR(e.opacity,r.style.opacity),n.drawImage(r,t.x,t.y,t.width,t.height),n.restore();return}const s=Vt(r)?r:[r],a=_y(e,i),c=e.color,u=Vt(c)?c:[c],d=nR(t,e),h=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,oR(n,e)&&uR(n,{x:d,y:h},s,a),dR(n,{x:d,y:h},s,{fonts:a,colors:u}),n.restore()}function oR(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function aR(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}rR(r)||lR(n,{x:e,y:i,radius:r,rotation:c,style:a,rad:u})}function lR(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 cR(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 uR(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 dR(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 fR(n,t){const e=Ti(n)?n:t;return Ti(e)?Ka(e,0,1):1}const My=["left","bottom","top","right"];function hR(n,t){const{pointX:e,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&_R(t,s);if(!a||xR(t,s,a))return;if(n.save(),n.beginPath(),!ai(n,s))return n.restore();const{separatorStart:u,separatorEnd:d}=pR(t,a),{sideStart:h,sideEnd:g}=mR(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 pR(n,t){const{x:e,y:i,x2:r,y2:s}=n,a=gR(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 gR(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 mR(n,t,e){const{y:i,width:r,height:s,options:a}=n,c=a.callout.start,u=yR(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 yR(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function _R(n,t){const e=t.position;return My.includes(e)?e:bR(n,t)}function bR(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),T=Li(c,x),C=[e,e+v,e+v,r],E=[i+T,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 xR(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 ky={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 Dy(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 vR(n,t)}function wR(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?SR(r,s,t):TR(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 vR(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=Dy(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function SR(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 TR(n,t,e){for(const i of Object.keys(ky)){const r=n[yr(n,e,i)];if(r){const{min:s,max:a,start:c,end:u,startProp:d,endProp:h}=ky[i],g=Dy(r,{min:e[s],max:e[a],start:r[c],end:r[u]});t[d]=g.start,t[h]=g.end}}}function MR({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 kR({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=MR({properties:t,options:e},a,r,s),u=kR({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 CR(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 OR(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return AR(n,t,e);case"click":return ER(n,t,e)}}function AR(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 ER(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 RR(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 PR(n,t,e){const i=BR(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 IR(n,t){for(const e of n)NR(e,t)}function Ny(n,t,e,i){if(ae(t[e])&&!LR(n.options,e,i)){const r=n[e]!==t[e];return n[e]=t[e],r}}function LR(n,t,e){return Je(n[t])||Je(n[e])}function NR(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=yr(t,n,e);i&&!t[i]&&FR(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function FR(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 BR(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||(YR(t,this),t.save(),Za(t,this.getCenterPoint(),this.rotation),Ty(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=zR(t,e);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=HR(t,e,i);let c=Qa(t.ctx,e);const u=WR(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 zR(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const r=i.controller;return r instanceof Bs&&UR(n,t,i.data)&&(!e||r.innerRadius<e.controller.innerRadius)&&r.options.circumference>=90?i:e},void 0)}function UR(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 HR({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,T=_.y>g,C=T?r+x:a-x,E=$R(C,h,g,v);return{controllerMeta:{_centerX:h,_centerY:g,_radius:v,_counterclockwise:T,...E},point:_,radius:Math.min(c,Math.min(y.right-y.left,y.bottom-y.top)/2)}}function WR({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function $R(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 YR(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),hR(t,this),Sy(t,this,e),Ty(t,VR(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 VR({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,qR=(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 XR(this,a,d,r)||Gu(this,a,r)}return jR(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 rP(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=wR(t,e),{x:r,y:s,x2:a,y2:c}=i,u=GR(i,t.chartArea),d=u?KR({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=iP(d,e,Rr(g,y))}const h=ZR(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 jR(n,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s}){const a=qR(t,e,n.getProps(["x","y","x2","y2"],s),i);return uy(a,r)||Gu(n,{mouseX:t,mouseY:e},s,i)}function GR({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 KR(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 XR(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 ZR(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 JR(t,e,{width:a,height:c,padding:r},n.chartArea)}function QR(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 JR(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"?QR(n):xe(t.rotation),y=tP(r,s,g),_=eP(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},T={size:y.h,min:i.top,max:i.bottom,padding:a.top},C=Vy(x.x,v)+c,E=Vy(x.y,T)+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 tP(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 eP(n,t,e,i){let r;const s=nP(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 nP(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 iP(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 rP(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),T=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:T,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 sP({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 sP(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"?JE({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);aR(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&&aP(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=oP(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 oP({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 aP(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 lP={update:Object.assign},cP=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 uP(n,t,e,i){const r=fP(n,e.animations,i),s=t.annotations,a=gP(t.elements,s);for(let c=0;c<s.length;c++){const u=s[c],d=Xy(a,c,u.type),h=u.setContext(pP(n,d,a,u)),g=d.resolveElementProperties(n,h);g.skip=dP(g),"elements"in g&&(hP(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 dP(n){return isNaN(n.x)||isNaN(n.y)}function fP(n,t,e){return e==="reset"||e==="none"||e==="resize"?lP:new Ec(n,t)}function hP(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 cP)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)&&Vt(s)?e[i]=s.map(a=>Ky(a,r)):e[i]=Ky(s,r)}return e}function pP(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 gP(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 mP="3.1.0";const Fi=new Map,Qy=n=>n.type!=="doughnutLabel",yP=Yu.concat(Ja);var Jy={id:"annotation",version:mP,beforeRegister(){tR("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))}):Vt(s)&&r.push(...s),IR(r.filter(Qy),n.scales)},afterDataLimits(n,t){const e=Fi.get(n);PR(n,t.scale,e.annotations.filter(Qy).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=Fi.get(n);CR(n,i,e),uP(n,i,e,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),RR(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);OR(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=>!yP.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=_P(s.visibleElements,t).sort((c,u)=>c.element.options.z-u.element.options.z);for(const c of a)bP(i,r,s,c);e&&Ls(i)}function _P(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 bP(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 xP={class:"zoom-timerange-container"},wP={class:"zoom-timerange-details"},vP={class:"label","data-testid":"zoom-timerange-from"},SP={class:"label","data-testid":"zoom-timerange-to"},TP=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",xP,[p.createElementVNode("div",wP,[p.createElementVNode("div",vP,p.toDisplayString(p.unref(e).t("zoom_time_range.from")),1),p.createElementVNode("div",null,p.toDisplayString(i.value),1),p.createElementVNode("div",SP,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},t_=pn(TP,[["__scopeId","data-v-4fa681cf"]]),MP={class:"zoom-actions-container"},kP={class:"zoom-actions-heading"},DP={class:"zoom-action-select"},CP=["data-testid"],OP=["aria-disabled","href"],AP=["onClick"],EP=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",MP,[p.createElementVNode("div",kP,[p.createVNode(t_,{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,OP)):(p.openBlock(),p.createElementBlock("div",{key:1,onClick:u=>r(c)},p.toDisplayString(c.label),9,AP))],10,CP))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),RP={key:2},PP={class:"tooltip-title"},IP={class:"title"},LP={key:0,class:"subtitle"},NP={class:"context"},FP={class:"metric"},BP={class:"tooltip"},zP={key:0},UP={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}=UE(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(t_,{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(EP,{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",RP,[p.createElementVNode("div",PP,[p.createElementVNode("div",IP,[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",LP,[p.createElementVNode("div",NP,p.toDisplayString(h.value),1),p.createElementVNode("div",FP,p.toDisplayString(g.value),1)])):p.createCommentVNode("",!0)]),p.createElementVNode("ul",BP,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.state.tooltipSeries,({backgroundColor:v,borderColor:T,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",zP,[p.createElementVNode("div",{class:"square-marker",style:p.normalizeStyle({background:String(v),borderColor:String(T)})},null,4),p.createElementVNode("span",{class:p.normalizeClass(["display-label",{empty:U}])},p.toDisplayString(C),3),p.createElementVNode("span",UP,p.toDisplayString(E),1)])):p.createCommentVNode("",!0)],64))),128))])]))],6)):p.createCommentVNode("",!0)}}),[["__scopeId","data-v-34c60646"]]),HP={key:0,class:"legend-container","data-testid":"legend"},WP=["onClick"],$P=["title"],YP={class:"label truncate-label"},VP={key:0,class:"sub-label"},qP={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,h=a(c,u);!d.getDatasetMeta(c).dataset&&u!==void 0?d.toggleDataVisibility(u):h?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",HP,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(n.items,({fillStyle:h,strokeStyle:g,text:y,datasetIndex:_,index:x,value:v,isSegmentEmpty:T})=>(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",YP,p.toDisplayString(y),1),v&&p.unref(i)?(p.openBlock(),p.createElementBlock("div",VP,p.toDisplayString(v.formatted),1)):p.createCommentVNode("",!0)],10,$P)]),_:2},[T?{name:"content",fn:p.withCtx(()=>[p.createElementVNode("div",qP,p.toDisplayString(p.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,WP))),128))])):p.createCommentVNode("",!0)}}}),[["__scopeId","data-v-388cf4f5"]]),Pe=[];for(let n=0;n<256;++n)Pe.push((n+256).toString(16).slice(1));function jP(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 GP=new Uint8Array(16);function KP(){return crypto.getRandomValues(GP)}function td(n,t,e){return crypto.randomUUID?crypto.randomUUID():XP(n)}function XP(n,t,e){n=n||{};const i=n.random??n.rng?.()??KP();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,jP(i)}const e_=(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 n_{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&e_(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,e_(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 ZP=["id"],QP=["id"],JP={class:"axis-tooltip-content"},t2="100%",e2="100%",n2=20,i2=20,i_=6,r2=0,s2=10,o2=10,a2=1,l2=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 n_,c=p.useTemplateRef("chartContainer"),u=p.useTemplateRef("chartParent"),d=({chart:J},ht)=>{const ft=J.data,lt=ft.labels?.indexOf(ht);return ft.datasets.reduce((gt,ct,Lt)=>{if(J.isDatasetVisible(Lt)){const zt=ct.data[lt];return isNaN(zt)?gt:gt+zt}else return gt},0)},h=(J,ht,ft,lt)=>{const gt=lt==="horizontal";ht===null&&(ht=e.t("entityNoName"));const ct={type:"label",yValue:wt=>gt?ht:d(wt,ht),xValue:wt=>gt?d(wt,ht):ht},Lt={...ct,position:gt?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>gt?0:-Math.abs(MA()),content:wt=>Nm(d(wt,ht),ft)},zt={...ct,content:wt=>DA(d(wt,ht),kA(wt.chart,J)),position:gt?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:wt=>gt?TA(Nm(d(wt,ht),ft)):0,color:yA};return{[`${ht}-value`]:Lt,[`${ht}-percent`]:zt}},g=p.useTemplateRef("canvas"),y=p.useTemplateRef("axis"),_=td(),x=td(),v=p.ref([]),T=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:N}=Pt.useTooltipAbsolutePosition(u,P),F=p.ref(0),k=()=>t.annotations&&t.chartData.labels?.reduce((J,ht)=>Object.assign(J,h(t.chartData,ht,E.value,t.orientation)),{}),S={id:_,afterUpdate(J){F.value+=1,v.value=Am(J,t.legendValues,t.chartLegendSortFn)}},O={id:x,afterUpdate(J){J.options.plugins.annotation.annotations=t.annotations?k():{}}},$=[S,{id:"axisHover",afterEvent(J,ht){if(C.show=!1,ht.event.type==="mousemove"){const ft=ht.event,lt=J.options.indexAxis,gt=J.scales,ct=J.scales[lt].getLabelForValue(Number(J.scales[lt].getValueForPixel(ft[lt]))),zt=J.scales[lt].getLabels().indexOf(ct),wt=t.chartData.isLabelEmpty?.[zt];if((kt=>kt==="x"?ft.y>gt.x.top:ft.x<gt.y.right)(lt)){P.interactionMode!=="interactive"&&(P.showTooltip=!1);const ve=J.canvas.getContext("2d").measureText(ct).width,bt=Math.abs(Math.round(ft.x-ve*.5)),qt=Math.round(ft.x+ve*.5),Oe=J.canvas.getBoundingClientRect(),Ae=40;C.left=lt==="x"?`${(bt>0?bt:qt)-C.offset+Oe.left}px`:`${ft.x-ve*.5-C.offset+Oe.left}px`,C.top=`${ft.y-Ae+Oe.top}px`,ct.length>$a?(C.show=!0,C.text=ct):wt?(C.text=e.t("emptyEntityInfo"),C.show=!0):C.show=!1}else C.show=!1}}},a,...t.annotations?[O]:[]],et=p.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),K=p.ref(0),nt=p.ref(0),Q=new ResizeObserver(Om(J=>{K.value=J[0].contentRect.width,nt.value=J[0].contentRect.height},100)),it=p.computed(()=>{const J=t.chartData?.labels?.length;return g.value&&J&&!U.value?`${Math.max(J*(n2+i_),K.value)}px`:t2}),st=p.computed(()=>{const J=t.chartData?.labels?.length;return g.value&&J&&U.value?`${Math.max(J*(i2+i_),nt.value)}px`:e2});Pt.useReportChartDataForSynthetics(p.toRef(t,"chartData"),p.toRef(t,"syntheticsDataKey")),p.onMounted(()=>{t.annotations&&en.register(Jy),c.value&&(K.value=c.value.offsetWidth,nt.value=c.value.offsetHeight,Q.observe(c.value))}),p.onUnmounted(()=>{c.value&&Q.unobserve(c.value)});const rt=p.computed(()=>{const J=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:et});return{...J.value,plugins:{...J.value.plugins,annotation:{annotations:k(),clip:!1}}}}),at=Pt.useChartJSCommon("bar",g,p.toRef(t,"chartData"),$,rt);p.onBeforeUnmount(()=>{en.unregister(Jy)});const H={[sn.Bottom]:"column"},V=p.computed(()=>{if(y.value&&at.value){const J=window.devicePixelRatio,ht=at.value,ft=ht.scales.y.width*J+a2,lt=(ht.scales.y.height+ht.scales.y.top+ht.scales.x.height)*J,gt=y.value.getContext("2d");return gt.scale(J,J),gt.canvas.width=ft,gt.canvas.height=lt,gt.canvas.style.width=`${ft/J}px`,gt.canvas.style.height=`${lt/J}px`,{scale:J,width:ft*J,height:lt*J,targetCtx:gt}}return null}),X=J=>{const ht=J.target;if(V.value&&at.value&&!U.value){const ft=V.value.scale,lt=V.value.targetCtx,gt=V.value.width,ct=V.value.height,Lt=at.value,zt=Lt.canvas;lt.fillStyle="white",ht.scrollLeft>=r2&&ht.scrollLeft<=s2?(lt.globalCompositeOperation="source-over",lt.clearRect(0,0,gt,ct),lt.drawImage(zt,0,0,gt,ct,0,0,gt,ct),lt.globalCompositeOperation="destination-over",lt.fillRect(0,0,gt,ct)):(lt.globalCompositeOperation="source-over",lt.fillRect(0,(Lt.scales.y.height+Lt.scales.y.top+o2)*ft,gt,Lt.scales.x.height*ft))}P.offsetY=ht.scrollTop,P.offsetX=ht.scrollLeft,C.offset=ht.scrollLeft},_t=({width:J,height:ht})=>{P.width=J,P.height=ht};p.watch(()=>t.orientation,()=>{if(y.value&&V.value){const J=V.value.width,ht=V.value.height;(y.value?.getContext("2d")).clearRect(0,0,J,ht)}P.showTooltip=!1,P.interactionMode="idle"}),p.watch(()=>t.annotations,J=>{at.value&&(J?at.value.options.plugins.annotation.annotations=k(t.chartData):delete at.value.options.plugins.annotation.annotations)});const ut=()=>{P.showTooltip&&(P.interactionMode!=="idle"?P.interactionMode="idle":P.interactionMode="interactive")};return(J,ht)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",H[p.unref(T)]])},[p.createElementVNode("canvas",{id:p.unref(r),ref:"axis",class:"axis"},null,8,ZP),p.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:ht[0]||(ht[0]=ft=>ut()),onScroll:X},[p.createElementVNode("div",{class:"chart-body",style:p.normalizeStyle({width:it.value,height:st.value})},[p.createElementVNode("canvas",{id:p.unref(s),ref:"canvas",class:"chart-canvas"},null,8,QP)],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",JP,p.toDisplayString(C.text),1)],4)):p.createCommentVNode("",!0),p.createVNode(il,{"absolute-left":p.unref(I),"absolute-top":p.unref(N),"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(at),items:v.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-60e5a1a7"]]);const c2={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 c2},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=ek(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 XS(n,t);case"minute":return GS(n,t);case"hour":return VS(n,t);case"day":return Ca(n,t);case"week":return ZS(n,t);case"month":return Jc(n,t);case"quarter":return KS(n,t);case"year":return QS(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return iu(n,t);case"second":return oT(n,t);case"minute":return iT(n,t);case"hour":return nT(n,t);case"day":return pg(n,t);case"week":return aT(n,t);case"month":return _g(n,t);case"quarter":return sT(n,t);case"year":return lT(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return sk(n);case"minute":return rk(n);case"hour":return ik(n);case"day":return eu(n);case"week":return Vn(n);case"isoWeek":return Vn(n,{weekStartsOn:+e});case"month":return uT(n);case"quarter":return cT(n);case"year":return bg(n);default:return n}},endOf:function(n,t){switch(t){case"second":return mT(n);case"minute":return pT(n);case"hour":return fT(n);case"day":return mg(n);case"week":return hT(n);case"month":return yg(n);case"quarter":return gT(n);case"year":return dT(n);default:return n}}});const r_={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},u2={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...r_,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},d2=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 f2(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return p.isProxy(t)?new Proxy(n,{}):n}function h2(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function s_(n,t){n.labels=t}function o_(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 p2(n,t){const e={labels:[],datasets:[]};return s_(e,n.labels),o_(e,n.datasets,t),e}const g2=p.defineComponent({props:u2,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=p2(h,_),v=f2(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 T=!1;if(g){const C=ts(g),E=ts(_);C&&C!==E&&(h2(v,C),T=!0)}if(y){const C=ts(y.labels),E=ts(x.labels),U=ts(y.datasets),P=ts(x.datasets);C!==E&&(s_(v.config.data,C),T=!0),U&&U!==P&&(o_(v.config.data,U,n.datasetIdKey),T=!0)}T&&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:r_,setup(e,i){let{expose:r}=i;const s=p.shallowRef(null),a=p.shallowRef(null);p.watch(()=>a.value?.chart??null,u=>{s.value=u},{flush:"sync"}),r({chart:s});const c=u=>{a.value=u};return()=>p.h(g2,d2({ref:c},{type:n,...e}))}})}const a_=ed("bar",Gh),l_=ed("doughnut",Bs),c_=ed("line",Kh),m2={class:"chart-container"},y2={key:0,class:"chart-center-metric"},_2={class:"chart-center-total"},b2={key:0,class:"chart-center-unit"},x2=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(F){a.value=F.options.plugins.legend.labels.generateLabels(F).map(k=>({...k,value:t.legendValues&&t.legendValues[k.text],hidden:!1}))}},y=p.computed(()=>[g]),_=p.computed(()=>[t.chartData.datasets.reduce((k,S)=>(k.labels.push(S.label),k.backgroundColor.push(S.backgroundColor),k.hoverBorderColor.push(xc(S.backgroundColor).saturate(.5).darken(.15).hexString()),k.data.push(S.data.reduce((O,B)=>O+B,0)),k),{labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:x}=fr({i18n:i}),v=p.computed(()=>dE(t.metricName??"")),T=p.computed(()=>{const F=_.value[0]?.data.reduce((k,S)=>k+S,0)??0;return x(F,t.metricUnit,{approximate:!0,translateUnit:(k,S)=>e(k,S)}).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=F=>({[sn.Bottom]:"column",[sn.Hidden]:"hidden"})[F],N=({width:F,height:k})=>{u.width=F,u.height=k};return(F,k)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",I(n.legendPosition)]),"data-testid":"donut-chart-parent"},[p.createElementVNode("div",m2,[p.createVNode(p.unref(l_),{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",y2,[p.createElementVNode("span",_2,p.toDisplayString(T.value),1),C.value?(p.openBlock(),p.createElementBlock("span",b2,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:N},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))}}),w2=pn(x2,[["__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={},v2=()=>{Ke.x=void 0,Ke.chart=void 0,Ke.strategy=void 0,Ke.group=void 0},S2=10;class u_{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<S2)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(v2(),e)for(const i of Object.values(en.instances))i!==t&&i.update("none")}}}const T2=(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()},M2=(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()},d_=(n,t)=>{const e=n.scales.x.getValueForPixel(t.startX),i=n.scales.x.getValueForPixel(t.endX);if(!(e===void 0||i===void 0))return{xStart:Math.min(e,i),xEnd:Math.max(e,i)}},f_=(n,t,e)=>{t.canvas.dispatchEvent(new CustomEvent(n,{detail:e}))};class k2{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,this._endX=this._startX},150)},s=c=>{const u=e.getBoundingClientRect();if(i&&this._isDragging){this._endX=c.clientX-u.left;const d=d_(t,this);d&&f_("dragSelectMove",t,d)}},a=c=>{const u=e.getBoundingClientRect();if(clearTimeout(this._dragTimeout),i&&this._isDragging){this._endX=c.clientX-u.left,i=!1,this._isDragging=!1;const d=d_(t,this);d?f_("dragSelect",t,d):this.clearSelectionArea()}};e.addEventListener("mousedown",r),e.addEventListener("mousemove",s),e.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:r,onMouseMove:s,onMouseUp:a}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:r,onMouseUp:s}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",r),e.removeEventListener("mouseup",s)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(M2(t,this._startX,this._endX),T2(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 C2=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],O2=["gauge","top_n","single_value"],A2=20,E2="rgba(255, 171, 171, 0.4)",R2="rgba(255, 196, 0, 0.2)",h_=(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)},P2=(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=h_(s[d-1],s[d],a.value):c[d-1].aboveThreshold&&!c[d].aboveThreshold&&u!==void 0&&(e.push({start:u,end:h_(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},I2=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 L2{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)<A2})}}};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=ZC,i.fillText(g,t.chartArea.left,h-4),i.restore())});const a=P2(t,s);I2(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"?E2:R2,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 N2=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 u_,a=new n_,c=new k2,u=new L2(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"),T=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(H){_.value=Am(H,e.legendValues,e.chartLegendSortFn)}},N=p.computed(()=>[I,a,...e.brush?[c]:[],...e.type==="timeseries_line"?[s]:[],...e.threshold?[u]:[]]),F=p.computed(()=>`line-${N.value.map(H=>H.id).join("-")}`),k=p.computed(()=>`bar-${N.value.map(H=>H.id).join("-")}`),S=p.computed(()=>e.chartData&&zC(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:S,threshold:p.toRef(e,"threshold")});Pt.useReportChartDataForSynthetics(p.toRef(e,"chartData"),p.toRef(e,"syntheticsDataKey"));const B=H=>H?H.end.getTime()>H.start.getTime():!1,$=H=>({[sn.Bottom]:"column",[sn.Hidden]:"hidden"})[H],et=({width:H,height:V})=>{E.width=H,E.height=V},K=(H=!0)=>{E.interactionMode="idle",E.showTooltip=!1,c.clearSelectionArea(),a.isPaused&&a.resume(H),s.isPaused&&s.resume()},nt=()=>{E.interactionMode="interactive"},Q=()=>{!h.value||!h.value.chart.tooltip?.dataPoints?.length||(E.interactionMode==="interactive"?s.clickedSegment=h.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},it=()=>{if(C.value){C.value=!1;return}E.interactionMode!=="idle"?K():nt(),Q()};p.watch(()=>e.type,()=>{E.interactionMode="idle",E.showTooltip=!1,s.destroyClickedSegment()});const st=H=>{H.preventDefault(),H.stopPropagation();const{xStart:V,xEnd:X}=H.detail,_t={start:new Date(V),end:new Date(X),type:"absolute"};if(!B(_t)){T.value=void 0,K(!1);return}T.value=_t,E.interactionMode="zoom-interactive",_t&&i("select-chart-range",_t)},rt=H=>{E.interactionMode="selecting-chart-area",C.value=!0,s.pause(),a.pause();const{xStart:V,xEnd:X}=H.detail;T.value={start:new Date(V),end:new Date(X),type:"absolute"}},at=H=>{if(!v.value||E.interactionMode==="idle")return;const V=H.target;V&&v.value.contains(V)||C.value||K(!1)};return p.watch(()=>h.value?.chart,()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",st),h.value.chart.canvas.removeEventListener("dragSelectMove",rt),h.value.chart.canvas.addEventListener("dragSelect",st),h.value.chart.canvas.addEventListener("dragSelectMove",rt))}),p.onMounted(()=>{document.addEventListener("click",at,!0)}),p.onUnmounted(()=>{h.value?.chart&&(h.value.chart.canvas.removeEventListener("dragSelect",st),h.value.chart.canvas.removeEventListener("dragSelectMove",rt)),document.removeEventListener("click",at,!0)}),(H,V)=>(p.openBlock(),p.createElementBlock("div",{ref:"chartParent",class:p.normalizeClass(["chart-parent",$(p.unref(x))]),"data-testid":"line-chart-parent"},[p.createElementVNode("div",{class:"chart-container",onClick:V[0]||(V[0]=X=>it())},[n.type==="timeseries_line"?(p.openBlock(),p.createBlock(p.unref(c_),{key:F.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:N.value},null,8,["chart-id","data","options","plugins"])):n.type==="timeseries_bar"?(p.openBlock(),p.createBlock(p.unref(a_),{key:k.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:N.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":T.value,onDimensions:et,onOnAction:V[1]||(V[1]=()=>K(!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-399f4923"]]),F2={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},B2={class:"tooltip-content"},z2={key:2,class:"analytics-chart-parent"},U2=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(()=>T.value?Pt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||ku},p.toRef(i,"chartData")).value:Pt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||ku},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 K=new Date(i.chartData.meta.start).getTime();return new Date(i.chartData.meta.end).getTime()-K}}),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)),T=p.computed(()=>["timeseries_bar","timeseries_line"].some(K=>K===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 K=i.chartData.meta.metric_names[0],nt=i.chartData.meta.metric_units[K]||"";if(i.chartData.meta.metric_names.length>1){if(K.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${nt}`,{plural:"s"})});if(K.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${nt}`,{plural:"s"})})}if(K)return lo(nt)&&r.te(`metricAxisTitles.${K}`)?r.t(`metricAxisTitles.${K}`)||void 0:r.te(`chartLabels.${K}`)?r.t(`chartLabels.${K}`):K}),P=p.computed(()=>{if(i.chartOptions?.metricAxesTitle)return i.chartOptions?.metricAxesTitle;if(!i.chartData?.meta.metric_names||!i.chartData?.meta.metric_units)return;const K=i.chartData.meta.metric_names[0],nt=i.chartData.meta.metric_units[K]||"";if(i.chartData.meta.metric_names.length>1){if(K.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${nt}`,{plural:"s"})});if(K.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${nt}`,{plural:"s"})})}return r.te(`metricAxisTitles.${K}`)&&(lo(nt)||r.te(`chartUnits.${nt}`))?lo(nt)?r.t(`metricAxisTitles.${K}`)||void 0:r.t(`metricAxisTitles.${K}`,{unit:r.t(`chartUnits.${nt}`,{plural:"s"})})||void 0:K||void 0}),I=p.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const K=T.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];if(K)return r.te(`chartLabels.${K}`)?r.t(`chartLabels.${K}`):K}),N=p.computed(()=>{if(Ak(i.chartData.meta.datasource))return r.t("timestampAxisTitles.platform");const K=bu(Number(i.chartData.meta.granularity_ms));if(K)return r.te(`granularityAxisTitles.${K}`)?r.t(`granularityAxisTitles.${K}`):K}),F=p.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),k=p.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),S=p.computed(()=>T.value?UC(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"),B=p.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(K,nt)=>K.text===r.t("chartLabels.____OTHER____")?1:nt.text===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(K.text,10))&&!isNaN(parseInt(nt.text,10))?K.text<nt.text?-1:1:K.value&&nt.value?nt.value.raw-K.value.raw:0),$=p.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(K,nt)=>K.label===r.t("chartLabels.____OTHER____")?1:nt.label===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(K.label,10))&&!isNaN(parseInt(nt.label,10))?K.label<nt.label?-1:1:K.value&&nt.value?nt.rawValue-K.rawValue:0),et=p.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:K=>e("zoom-time-range",K)}]:[],...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")),(K,nt)=>{const Q=p.resolveComponent("KTooltip"),it=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["analytics-chart-shell",{"show-values":h.value}])},[S.value&&_.value&&y.value?(p.openBlock(),p.createElementBlock("div",F2,[p.createVNode(Q,{class:"tooltip","max-width":"500",placement:"right"},{content:p.withCtx(()=>[p.createElementVNode("div",B2,p.toDisplayString(x.value),1)]),default:p.withCtx(()=>[p.createVNode(p.unref(Ss.WarningIcon),{color:`var(--kui-color-text-warning, ${p.unref(KC)})`,size:`var(--kui-icon-size-40, ${p.unref(QC)})`},null,8,["color","size"])]),_:1})])):p.createCommentVNode("",!0),S.value?(p.openBlock(),p.createElementBlock("div",z2,[T.value?(p.openBlock(),p.createBlock(N2,{key:0,brush:a.value,"chart-data":s.value,"chart-legend-sort-fn":B.value,"chart-tooltip-sort-fn":$.value,"dimension-axes-title":N.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":et.value,onSelectChartRange:nt[0]||(nt[0]=st=>e("select-chart-range",st)),onZoomTimeRange:nt[1]||(nt[1]=st=>e("zoom-time-range",st))},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(l2,{key:1,annotations:n.showAnnotations,"chart-data":s.value,"chart-legend-sort-fn":B.value,"chart-tooltip-sort-fn":$.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(w2,{key:2,"chart-data":s.value,"dataset-colors":n.chartOptions.chartDatasetColors||p.unref(ku),"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(it,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(F.value),1)]),default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(k.value),1)]),_:1}))],2)}}}),H2=pn(U2,[["__scopeId","data-v-346b2111"]]),W2={class:"chart-parent","data-testid":"gauge-chart-parent"},$2={class:"chart-totals-flex"},Y2={key:1,class:"metric-small","data-testid":"gauge-chart-total"},V2=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,T)=>v+T,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",W2,[p.createElementVNode("div",$2,[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",Y2,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(l_),{"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),q2={key:1,class:"single-value-wrapper"},j2={class:"single-value-metric"},G2={class:"name-unit-alignment"},K2={class:"single-value","data-testid":"single-value-chart"},X2={key:0,class:"single-value-unit"},Z2={class:"single-value-metric-name"},Q2={key:0,class:"single-value-trend"},J2={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},id="t1",rd="t2",tI=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 B=`chartUnits.${O}`;return t.te(B)?t.t(B,{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}),T=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 B=h.value?r.data.meta?.metric_units?.[h.value]:void 0;if(B==="usd")return i(O);if(B==="bytes")return e(O);if(O>=1e9){const et=(O/1e9).toFixed(1);return et.endsWith(".0")?`${Math.floor(O/1e9)}B`:`${et}B`}if(O>=1e7){const et=(O/1e6).toFixed(1);return et.endsWith(".0")?`${Math.floor(O/1e6)}M`:`${et}M`}const $=r.decimalPoints&&typeof r.decimalPoints=="number"?r.decimalPoints:ry;return O.toLocaleString("en-US",{maximumFractionDigits:$})}),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)),N=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"))}),F=Qi.useTrendRange(p.computed(()=>r.showTrend),void 0,p.computed(()=>r.data.meta)),k=O=>O>0?"positive":O<0?"negative":"neutral",S=O=>O>0?GC:O<0?jC: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,B)=>{const $=p.resolveComponent("KEmptyState");return p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["chart-parent",s.value]),"data-testid":"single-value-parent"},[T.value?(p.openBlock(),p.createBlock($,{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",q2,[p.createElementVNode("div",j2,[p.createElementVNode("div",G2,[p.createElementVNode("span",K2,p.toDisplayString(C.value),1),_.value&&y.value?(p.openBlock(),p.createElementBlock("span",X2," "+p.toDisplayString(y.value),1)):p.createCommentVNode("",!0)]),p.createElementVNode("div",Z2,p.toDisplayString(g.value),1)]),n.showTrend?(p.openBlock(),p.createElementBlock("div",Q2,[p.createElementVNode("div",{class:p.normalizeClass(["trend-change",k(P.value)]),"data-testid":"single-value-trend"},[E.value||P.value!==0?(p.openBlock(),p.createBlock(p.resolveDynamicComponent(I.value),{key:0,color:S(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(N.value),1)],2),p.unref(F)?(p.openBlock(),p.createElementBlock("div",J2,p.toDisplayString(p.unref(F)),1)):p.createCommentVNode("",!0)])):p.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-0203459f"]]),eI={class:"simple-chart-shell"},nI={key:1,class:"analytics-chart-parent"},iI=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",eI,[u.value?(p.openBlock(),p.createElementBlock("div",nI,[s.value?(p.openBlock(),p.createBlock(V2,{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(tI,{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"]]),rI={class:"top-n-card-title","data-testid":"top-n-card-title"},sI={class:"top-n-card-description","data-testid":"top-n-card-description"},oI={key:3,class:"top-n-table","data-testid":"top-n-table"},aI={"data-testid":"top-n-table-header"},lI={class:"top-n-table-header-row"},cI={class:"table-header-label"},uI=["data-testid"],dI=["data-testid"],fI=["data-testid"],hI=3,pI=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,hI):[]),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?K(y.value):""),x=p.computed(()=>{const Q=a.value.map(it=>({key:it,label:u.value?K(it):e.t("topNTable.nameLabel"),type:"dimension"}));return y.value&&Q.push({key:"value",label:_.value,type:"metric"}),g.value.forEach((it,st)=>{st!==0&&Q.push({key:it,label:K(it),type:"metric"})}),Q}),v=p.computed(()=>x.value.filter(Q=>Q.type==="metric")),T=p.computed(()=>x.value.filter(Q=>Q.type==="dimension").slice(1)),C=Q=>Q.type==="dimension"&&Q.key===d.value,E=Q=>u.value&&Q.type==="dimension"&&!C(Q),U=Q=>{const it=Q.event;return String(it[c.value])},P=(Q,it)=>{const st=String(Q.event[it]),rt=t.data.meta?.display?.[it]?.[st];return{dimension:it,id:st,name:rt?.name||"-",deleted:!!rt?.deleted}},I=Q=>{const it=U(Q),st=h.value&&h.value[it];return st?st.name:"-"},N=Q=>{const it=U(Q),st=h.value&&h.value[it];return st?!!st.deleted:!1},F=(Q,it)=>{const st=Q.event[it];if(st==null)return"–";const rt=typeof st=="number"?st:Number(st);if(Number.isNaN(rt))return"–";const at=t.data.meta?.metric_units?.[it]||"count",H=["count","count/minute","token count"].includes(at);return i(rt,at,{approximate:H,isBytes1024:!0,translateUnit:V=>nt(V,rt)})},k=Q=>y.value?F(Q,y.value):"–",S=p.computed(()=>r.value?.length?r.value.map(Q=>{const it=a.value.map(H=>P(Q,H)),st=it[0],rt=st?.id||U(Q),at={id:rt,rowKey:it.map(H=>`${H.dimension}:${H.id}`).join("|")||rt,name:st?.name||I(Q),deleted:N(Q),dimensions:it,original:Q};return y.value&&(at.value=k(Q)),g.value.forEach((H,V)=>{V!==0&&(at[H]=F(Q,H))}),at}):[]),O=p.computed(()=>{if(!s.value)return"";if(t.data.meta){if(a.value.some(Q=>!Object.keys(t.data.meta.display[Q]||{}).length))return e.t("topNTable.errors.display");if(!y.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),B=(Q,it)=>{const st=Q[it];return typeof st=="string"?st:st==null?"–":String(st)},$=(Q,it)=>Q.dimensions.find(st=>st.dimension===it)?.name||"–",et=(Q,it)=>{const st=Q.dimensions.find(rt=>rt.dimension===it);return{id:st?.id||"",name:st?.name||"–",deleted:st?.deleted||!1,dimension:it,dimensions:Q.dimensions,isEmpty:st?.id==="empty"}},K=Q=>e.te(`chartLabels.${Q}`)?e.t(`chartLabels.${Q}`):Q,nt=(Q,it)=>{if(lo(Q)||Q==="count"||Q==="requests")return"";const st=it===1?"":"s";return e.te(`chartUnits.${Q}`)?e.t(`chartUnits.${Q}`,{plural:st}):Q};return(Q,it)=>{const st=p.resolveComponent("KEmptyState"),rt=p.resolveComponent("KSkeleton"),at=p.resolveComponent("KCard");return p.openBlock(),p.createBlock(at,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},p.createSlots({default:p.withCtx(()=>[O.value?(p.openBlock(),p.createBlock(st,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(p.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(O.value),1)]),_:1})):n.isLoading?(p.openBlock(),p.createBlock(rt,{key:1,"table-columns":2,type:"table"})):s.value?(p.openBlock(),p.createElementBlock("div",oI,[p.createElementVNode("table",{class:p.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":u.value}])},[p.createElementVNode("thead",aI,[p.createElementVNode("tr",lI,[(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",cI,p.toDisplayString(H.label),1)],2))),128))])]),p.createElementVNode("tbody",null,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(S.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(Q.$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,uI)],2),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(T.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(Q.$slots,"name",{record:et(H,V.key)},()=>[p.createTextVNode(p.toDisplayString($(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(B(H,V.key)),9,dI)):(p.openBlock(),p.createElementBlock("span",{key:1,"data-testid":`row-${H.id}-${V.key}`},p.toDisplayString(B(H,V.key)),9,fI))]))),128))]))),128))])],2)])):(p.openBlock(),p.createBlock(st,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(n.emptyStateTitle||p.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:p.withCtx(()=>[p.createElementVNode("span",rI,p.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:p.withCtx(()=>[p.createElementVNode("div",sI,p.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-bd2cedcf"]]),gI={class:"container"},mI={key:0,class:"no-data","data-testid":"sparkline-empty"},yI=["title"],_I=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:F,height:k})=>{h.width=F,h.height=k},y=p.computed(()=>n.disableTooltip?[]:[new u_({enableBrushing:n.groupKey!==void 0&&n.chartKey!==void 0&&n.enableBrushing,brushStrategy:"group",brushGroup:n.groupKey})]),_=p.computed(()=>d.value.reduce((F,{data:k,label:S})=>({...F,[S]:k.reduce((O,{y:B})=>O+B,0)}),{})),x=p.computed(()=>d.value.map(({label:F})=>[_.value[F],`${F}: ${_.value[F]}`]).sort(([F],[k])=>k-F).map(([,F])=>F).join(", ")),v=p.computed(()=>Object.keys(_.value).map(F=>_.value[F]).reduce((F,k)=>F+k,0)),T=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 F=n.type==="sparkline_bar",k=F?r.value-1:r.value,S=F?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:F?0:2,right:F?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:U,external:O=>{Dm(h,O,"minutely",{contextFormatter:B=>{const $=B+i.value;let et="";return i.value>1440*60*1e3?et=Aa(new Date($),"MMM dd, yyy hh:mm a"):et=Aa(new Date($),"hh:mm a"),`${vC(B)} - ${et}`}})}}},scales:{x:{min:k,max:S,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"),N=p.ref("0");return p.onMounted(()=>{hn.positioners[U]=function(F,k){if(!F.length||h.interactionMode==="interactive"||k.x===null)return!1;const S=10,O=this.chart.canvas.getBoundingClientRect(),B=h.width||this.width,$=h.height||this.height,et=O.top-$>0,K=et?O.top-$-S:O.top+O.height+S,nt=O.left>B/2-k.x,Q=Math.max(S,window.innerWidth-S-B),it=Math.min(Q,nt?Math.floor(O.left-B/2)+k.x:0+S);return I.value=`${K}px`,N.value=`${it}px`,{x:it,y:K,xAlign:"center",yAlign:et?"top":"bottom"}}}),p.onUnmounted(()=>{hn.positioners[U]&&delete hn.positioners[U]}),(F,k)=>(p.openBlock(),p.createElementBlock("div",gI,[T.value?n.type==="sparkline_bar"?(p.openBlock(),p.createBlock(p.unref(a_),{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(c_),{key:2,"chart-id":p.unref(t),data:C.value,"data-testid":n.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:P.value,plugins:y.value},null,8,["chart-id","data","data-testid","options","plugins"])):p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",mI,[p.renderSlot(F.$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":N.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"])),T.value&&n.showLabel?(p.openBlock(),p.createElementBlock("div",{key:4,class:"label",title:F.$slots.label?"":x.value},[p.renderSlot(F.$slots,"label",{total:v.value,totalByDataset:_.value},()=>[p.createTextVNode(p.toDisplayString(x.value),1)],!0)],8,yI)):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 bI=xo.exports,p_;function xI(){return p_||(p_=1,(function(n,t){(function(){var e,i="4.18.1",r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",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,T=2,C=1,E=2,U=4,P=8,I=16,N=32,F=64,k=128,S=256,O=512,B=30,$="...",et=800,K=16,nt=1,Q=2,it=3,st=1/0,rt=9007199254740991,at=17976931348623157e292,H=NaN,V=4294967295,X=V-1,_t=V>>>1,ut=[["ary",k],["bind",C],["bindKey",E],["curry",P],["curryRight",I],["flip",O],["partial",N],["partialRight",F],["rearg",S]],J="[object Arguments]",ht="[object Array]",ft="[object AsyncFunction]",lt="[object Boolean]",gt="[object Date]",ct="[object DOMException]",Lt="[object Error]",zt="[object Function]",wt="[object GeneratorFunction]",Dt="[object Map]",kt="[object Number]",ve="[object Null]",bt="[object Object]",qt="[object Promise]",Oe="[object Proxy]",Ae="[object RegExp]",oe="[object Set]",on="[object String]",$t="[object Symbol]",Ie="[object Undefined]",ie="[object WeakMap]",Se="[object WeakSet]",Ee="[object ArrayBuffer]",gn="[object DataView]",zi="[object Float32Array]",Dn="[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,ko=/<%=([\s\S]+?)%>/g,al=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ui=/^\w*$/,cd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Do=/[\\^$.*+?()[\]{}|]/g,ud=RegExp(Do.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",kd="\\u2000-\\u206f",Dd=" \\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+kd+Dd,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[Dn]=ee[$e]=ee[In]=ee[li]=ee[wo]=ee[vo]=ee[br]=ee[ci]=!0,ee[J]=ee[ht]=ee[Ee]=ee[lt]=ee[gn]=ee[gt]=ee[Lt]=ee[zt]=ee[Dt]=ee[kt]=ee[bt]=ee[Ae]=ee[oe]=ee[on]=ee[ie]=!1;var D={};D[J]=D[ht]=D[Ee]=D[gn]=D[lt]=D[gt]=D[zi]=D[Dn]=D[$e]=D[In]=D[li]=D[Dt]=D[kt]=D[bt]=D[Ae]=D[oe]=D[on]=D[$t]=D[wo]=D[vo]=D[br]=D[ci]=!0,D[Lt]=D[zt]=D[ie]=!1;var W={À:"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={"&":"&","<":"<",">":">",'"':""","'":"'"},mt={"&":"&","<":"<",">":">",""":'"',"'":"'"},Te={"\\":"\\","'":"'","\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 L=Kn&&Kn.require&&Kn.require("util").types;return L||vr&&vr.binding&&vr.binding("util")}catch{}})(),b_=Ne&&Ne.isArrayBuffer,x_=Ne&&Ne.isDate,w_=Ne&&Ne.isMap,v_=Ne&&Ne.isRegExp,S_=Ne&&Ne.isSet,T_=Ne&&Ne.isTypedArray;function mn(L,q,Y){switch(Y.length){case 0:return L.call(q);case 1:return L.call(q,Y[0]);case 2:return L.call(q,Y[0],Y[1]);case 3:return L.call(q,Y[0],Y[1],Y[2])}return L.apply(q,Y)}function II(L,q,Y,dt){for(var Ct=-1,Yt=L==null?0:L.length;++Ct<Yt;){var Me=L[Ct];q(dt,Me,Y(Me),L)}return dt}function yn(L,q){for(var Y=-1,dt=L==null?0:L.length;++Y<dt&&q(L[Y],Y,L)!==!1;);return L}function LI(L,q){for(var Y=L==null?0:L.length;Y--&&q(L[Y],Y,L)!==!1;);return L}function M_(L,q){for(var Y=-1,dt=L==null?0:L.length;++Y<dt;)if(!q(L[Y],Y,L))return!1;return!0}function $i(L,q){for(var Y=-1,dt=L==null?0:L.length,Ct=0,Yt=[];++Y<dt;){var Me=L[Y];q(Me,Y,L)&&(Yt[Ct++]=Me)}return Yt}function kl(L,q){var Y=L==null?0:L.length;return!!Y&&us(L,q,0)>-1}function Bd(L,q,Y){for(var dt=-1,Ct=L==null?0:L.length;++dt<Ct;)if(Y(q,L[dt]))return!0;return!1}function ue(L,q){for(var Y=-1,dt=L==null?0:L.length,Ct=Array(dt);++Y<dt;)Ct[Y]=q(L[Y],Y,L);return Ct}function Yi(L,q){for(var Y=-1,dt=q.length,Ct=L.length;++Y<dt;)L[Ct+Y]=q[Y];return L}function zd(L,q,Y,dt){var Ct=-1,Yt=L==null?0:L.length;for(dt&&Yt&&(Y=L[++Ct]);++Ct<Yt;)Y=q(Y,L[Ct],Ct,L);return Y}function NI(L,q,Y,dt){var Ct=L==null?0:L.length;for(dt&&Ct&&(Y=L[--Ct]);Ct--;)Y=q(Y,L[Ct],Ct,L);return Y}function Ud(L,q){for(var Y=-1,dt=L==null?0:L.length;++Y<dt;)if(q(L[Y],Y,L))return!0;return!1}var FI=Hd("length");function BI(L){return L.split("")}function zI(L){return L.match(pd)||[]}function k_(L,q,Y){var dt;return Y(L,function(Ct,Yt,Me){if(q(Ct,Yt,Me))return dt=Yt,!1}),dt}function Dl(L,q,Y,dt){for(var Ct=L.length,Yt=Y+(dt?1:-1);dt?Yt--:++Yt<Ct;)if(q(L[Yt],Yt,L))return Yt;return-1}function us(L,q,Y){return q===q?ZI(L,q,Y):Dl(L,D_,Y)}function UI(L,q,Y,dt){for(var Ct=Y-1,Yt=L.length;++Ct<Yt;)if(dt(L[Ct],q))return Ct;return-1}function D_(L){return L!==L}function C_(L,q){var Y=L==null?0:L.length;return Y?$d(L,q)/Y:H}function Hd(L){return function(q){return q==null?e:q[L]}}function Wd(L){return function(q){return L==null?e:L[q]}}function O_(L,q,Y,dt,Ct){return Ct(L,function(Yt,Me,ne){Y=dt?(dt=!1,Yt):q(Y,Yt,Me,ne)}),Y}function HI(L,q){var Y=L.length;for(L.sort(q);Y--;)L[Y]=L[Y].value;return L}function $d(L,q){for(var Y,dt=-1,Ct=L.length;++dt<Ct;){var Yt=q(L[dt]);Yt!==e&&(Y=Y===e?Yt:Y+Yt)}return Y}function Yd(L,q){for(var Y=-1,dt=Array(L);++Y<L;)dt[Y]=q(Y);return dt}function WI(L,q){return ue(q,function(Y){return[Y,L[Y]]})}function A_(L){return L&&L.slice(0,I_(L)+1).replace(Co,"")}function _n(L){return function(q){return L(q)}}function Vd(L,q){return ue(q,function(Y){return L[Y]})}function No(L,q){return L.has(q)}function E_(L,q){for(var Y=-1,dt=L.length;++Y<dt&&us(q,L[Y],0)>-1;);return Y}function R_(L,q){for(var Y=L.length;Y--&&us(q,L[Y],0)>-1;);return Y}function $I(L,q){for(var Y=L.length,dt=0;Y--;)L[Y]===q&&++dt;return dt}var YI=Wd(W),VI=Wd(Z);function qI(L){return"\\"+Te[L]}function jI(L,q){return L==null?e:L[q]}function ds(L){return ls.test(L)}function GI(L){return Nd.test(L)}function KI(L){for(var q,Y=[];!(q=L.next()).done;)Y.push(q.value);return Y}function qd(L){var q=-1,Y=Array(L.size);return L.forEach(function(dt,Ct){Y[++q]=[Ct,dt]}),Y}function P_(L,q){return function(Y){return L(q(Y))}}function Vi(L,q){for(var Y=-1,dt=L.length,Ct=0,Yt=[];++Y<dt;){var Me=L[Y];(Me===q||Me===g)&&(L[Y]=g,Yt[Ct++]=Y)}return Yt}function Cl(L){var q=-1,Y=Array(L.size);return L.forEach(function(dt){Y[++q]=dt}),Y}function XI(L){var q=-1,Y=Array(L.size);return L.forEach(function(dt){Y[++q]=[dt,dt]}),Y}function ZI(L,q,Y){for(var dt=Y-1,Ct=L.length;++dt<Ct;)if(L[dt]===q)return dt;return-1}function QI(L,q,Y){for(var dt=Y+1;dt--;)if(L[dt]===q)return dt;return dt}function fs(L){return ds(L)?tL(L):FI(L)}function Fn(L){return ds(L)?eL(L):BI(L)}function I_(L){for(var q=L.length;q--&&dd.test(L.charAt(q)););return q}var JI=Wd(mt);function tL(L){for(var q=as.lastIndex=0;as.test(L);)++q;return q}function eL(L){return L.match(as)||[]}function nL(L){return L.match(Ld)||[]}var iL=(function L(q){q=q==null?ce:hs.defaults(ce.Object(),q,hs.pick(ce,Io));var Y=q.Array,dt=q.Date,Ct=q.Error,Yt=q.Function,Me=q.Math,ne=q.Object,jd=q.RegExp,rL=q.String,Cn=q.TypeError,Ol=Y.prototype,sL=Yt.prototype,ps=ne.prototype,Al=q["__core-js_shared__"],El=sL.toString,jt=ps.hasOwnProperty,oL=0,L_=(function(){var o=/[^.]+$/.exec(Al&&Al.keys&&Al.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),Rl=ps.toString,aL=El.call(ne),lL=ce._,cL=jd("^"+El.call(jt).replace(Do,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pl=Lo?q.Buffer:e,qi=q.Symbol,Il=q.Uint8Array,N_=Pl?Pl.allocUnsafe:e,Ll=P_(ne.getPrototypeOf,ne),F_=ne.create,B_=ps.propertyIsEnumerable,Nl=Ol.splice,z_=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{}})(),uL=q.clearTimeout!==ce.clearTimeout&&q.clearTimeout,dL=dt&&dt.now!==ce.Date.now&&dt.now,fL=q.setTimeout!==ce.setTimeout&&q.setTimeout,Bl=Me.ceil,zl=Me.floor,Gd=ne.getOwnPropertySymbols,hL=Pl?Pl.isBuffer:e,U_=q.isFinite,pL=Ol.join,gL=P_(ne.keys,ne),ke=Me.max,Ve=Me.min,mL=dt.now,yL=q.parseInt,H_=Me.random,_L=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={},bL=Or(Kd),xL=Or(Bo),wL=Or(Xd),vL=Or(gs),SL=Or(zo),Hl=qi?qi.prototype:e,Ho=Hl?Hl.valueOf:e,W_=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 $0(o)}return new On(o)}var ys=(function(){function o(){}return function(l){if(!fe(l))return{};if(F_)return F_(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:ko,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 TL(){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 ML(){if(this.__filtered__){var o=new Ut(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function kL(){var o=this.__wrapped__.value(),l=this.__dir__,f=Et(o),m=l<0,b=f?o.length:0,M=BN(0,b,this.__views__),A=M.start,R=M.end,z=R-A,j=m?R:A-1,G=this.__iteratees__,tt=G.length,ot=0,yt=Ve(z,this.__takeCount__);if(!f||!m&&b==z&&yt==z)return f0(o,this.__actions__);var St=[];t:for(;z--&&ot<yt;){j+=l;for(var Nt=-1,xt=o[j];++Nt<tt;){var Bt=G[Nt],Ht=Bt.iteratee,wn=Bt.type,Qe=Ht(xt);if(wn==Q)xt=Qe;else if(!Qe){if(wn==nt)continue t;break t}}St[ot++]=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 CL(o){var l=this.has(o)&&delete this.__data__[o];return this.size-=l?1:0,l}function OL(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 AL(o){var l=this.__data__;return Uo?l[o]!==e:jt.call(l,o)}function EL(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=CL,Tr.prototype.get=OL,Tr.prototype.has=AL,Tr.prototype.set=EL;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 RL(){this.__data__=[],this.size=0}function PL(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 IL(o){var l=this.__data__,f=$l(l,o);return f<0?e:l[f][1]}function LL(o){return $l(this.__data__,o)>-1}function NL(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=RL,fi.prototype.delete=PL,fi.prototype.get=IL,fi.prototype.has=LL,fi.prototype.set=NL;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 FL(){this.size=0,this.__data__={hash:new Tr,map:new(Bo||fi),string:new Tr}}function BL(o){var l=ec(this,o).delete(o);return this.size-=l?1:0,l}function zL(o){return ec(this,o).get(o)}function UL(o){return ec(this,o).has(o)}function HL(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=FL,hi.prototype.delete=BL,hi.prototype.get=zL,hi.prototype.has=UL,hi.prototype.set=HL;function Mr(o){var l=-1,f=o==null?0:o.length;for(this.__data__=new hi;++l<f;)this.add(o[l])}function WL(o){return this.__data__.set(o,d),this}function $L(o){return this.__data__.has(o)}Mr.prototype.add=Mr.prototype.push=WL,Mr.prototype.has=$L;function Bn(o){var l=this.__data__=new fi(o);this.size=l.size}function YL(){this.__data__=new fi,this.size=0}function VL(o){var l=this.__data__,f=l.delete(o);return this.size=l.size,f}function qL(o){return this.__data__.get(o)}function jL(o){return this.__data__.has(o)}function GL(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=YL,Bn.prototype.delete=VL,Bn.prototype.get=qL,Bn.prototype.has=jL,Bn.prototype.set=GL;function $_(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,rL):[],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 Y_(o){var l=o.length;return l?o[lf(0,l-1)]:e}function KL(o,l){return nc(ln(o),kr(l,0,o.length))}function XL(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 ZL(o,l,f,m){return ji(o,function(b,M,A){l(m,b,f(b),A)}),m}function V_(o,l){return o&&Qn(l,Re(l),o)}function QL(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 kr(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 G=Et(o);if(G){if(A=UN(o),!R)return ln(o,A)}else{var tt=qe(o),ot=tt==zt||tt==wt;if(Zi(o))return g0(o,R);if(tt==bt||tt==J||ot&&!b){if(A=z||ot?{}:I0(o),!R)return z?ON(o,QL(A,o)):CN(o,V_(A,o))}else{if(!D[tt])return b?o:{};A=HN(o,tt,R)}}M||(M=new Bn);var yt=M.get(o);if(yt)return yt;M.set(o,A),cb(o)?o.forEach(function(xt){A.add(An(xt,l,f,xt,o,M))}):ab(o)&&o.forEach(function(xt,Bt){A.set(Bt,An(xt,l,f,Bt,o,M))});var St=j?z?bf:_f:z?un:Re,Nt=G?e:St(o);return yn(Nt||o,function(xt,Bt){Nt&&(Bt=xt,xt=o[Bt]),Wo(A,Bt,An(xt,l,f,Bt,o,M))}),A}function JL(o){var l=Re(o);return function(f){return q_(f,o,l)}}function q_(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 j_(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=kl,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 G=o[b],tt=f==null?G:f(G);if(G=m||G!==0?G:0,A&&tt===tt){for(var ot=j;ot--;)if(l[ot]===tt)continue t;z.push(G)}else M(l,tt,m)||z.push(G)}return z}var ji=x0(Zn),G_=x0(tf,!0);function tN(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 eN(o,l,f,m){var b=o.length;for(f=It(f),f<0&&(f=-f>b?0:b+f),m=m===e||m>b?b:It(m),m<0&&(m+=b),m=f>m?0:db(m);f<m;)o[f++]=l;return o}function K_(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=$N),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=w0(),X_=w0(!0);function Zn(o,l){return o&&Jd(o,l,Re)}function tf(o,l){return o&&X_(o,l,Re)}function Vl(o,l){return $i(l,function(f){return yi(o[f])})}function Dr(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 Z_(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)?FN(o):XN(o)}function ef(o,l){return o>l}function nN(o,l){return o!=null&&jt.call(o,l)}function iN(o,l){return o!=null&&l in ne(o)}function rN(o,l,f){return o>=Ve(l,f)&&o<ke(l,f)}function nf(o,l,f){for(var m=f?Bd:kl,b=o[0].length,M=o.length,A=M,R=Y(M),z=1/0,j=[];A--;){var G=o[A];A&&l&&(G=ue(G,_n(l))),z=Ve(G.length,z),R[A]=!f&&(l||b>=120&&G.length>=120)?new Mr(A&&G):e}G=o[0];var tt=-1,ot=R[0];t:for(;++tt<b&&j.length<z;){var yt=G[tt],St=l?l(yt):yt;if(yt=f||yt!==0?yt:0,!(ot?No(ot,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}ot&&ot.push(St),j.push(yt)}}return j}function sN(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=B0(o,l);var m=o==null?o:o[zn(Rn(l))];return m==null?e:mn(m,o,f)}function Q_(o){return ge(o)&&Xe(o)==J}function oN(o){return ge(o)&&Xe(o)==Ee}function aN(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:lN(o,l,f,m,Vo,b)}function lN(o,l,f,m,b,M){var A=Et(o),R=Et(l),z=A?ht:qe(o),j=R?ht:qe(l);z=z==J?bt:z,j=j==J?bt:j;var G=z==bt,tt=j==bt,ot=z==j;if(ot&&Zi(o)){if(!Zi(l))return!1;A=!0,G=!1}if(ot&&!G)return M||(M=new Bn),A||ws(o)?E0(o,l,f,m,b,M):LN(o,l,z,f,m,b,M);if(!(f&v)){var yt=G&&jt.call(o,"__wrapped__"),St=tt&&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 ot?(M||(M=new Bn),NN(o,l,f,m,b,M)):!1}function cN(o){return ge(o)&&qe(o)==Dt}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],G=R[1];if(A&&R[2]){if(j===e&&!(z in o))return!1}else{var tt=new Bn;if(m)var ot=m(j,G,z,o,l,tt);if(!(ot===e?Vo(G,j,v|T,m,tt):ot))return!1}}return!0}function J_(o){if(!fe(o)||VN(o))return!1;var l=yi(o)?cL:_d;return l.test(Or(o))}function uN(o){return ge(o)&&Xe(o)==Ae}function dN(o){return ge(o)&&qe(o)==oe}function fN(o){return ge(o)&&lc(o.length)&&!!ee[Xe(o)]}function t0(o){return typeof o=="function"?o:o==null?dn:typeof o=="object"?Et(o)?i0(o[0],o[1]):n0(o):Sb(o)}function sf(o){if(!Go(o))return gL(o);var l=[];for(var f in ne(o))jt.call(o,f)&&f!="constructor"&&l.push(f);return l}function hN(o){if(!fe(o))return KN(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 e0(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 n0(o){var l=wf(o);return l.length==1&&l[0][2]?N0(l[0][0],l[0][1]):function(f){return f===o||rf(f,o,l)}}function i0(o,l){return Sf(o)&&L0(l)?N0(zn(o),l):function(f){var m=If(f,o);return m===e&&m===l?Lf(f,o):Vo(l,m,v|T)}}function ql(o,l,f,m,b){o!==l&&Jd(l,function(M,A){if(b||(b=new Bn),fe(M))pN(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 pN(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 G=M?M(R,z,f+"",o,l,A):e,tt=G===e;if(tt){var ot=Et(z),yt=!ot&&Zi(z),St=!ot&&!yt&&ws(z);G=z,ot||yt||St?Et(R)?G=R:_e(R)?G=ln(R):yt?(tt=!1,G=g0(z,!0)):St?(tt=!1,G=m0(z,!0)):G=[]:Xo(z)||Ar(z)?(G=R,Ar(R)?G=fb(R):(!fe(R)||yi(R))&&(G=I0(z))):tt=!1}tt&&(A.set(z,G),b(G,z,m,M,A),A.delete(z)),Zd(o,f,G)}function r0(o,l){var f=o.length;if(f)return l+=l<0?f:0,mi(l,f)?o[l]:e}function s0(o,l,f){l.length?l=ue(l,function(M){return Et(M)?function(A){return Dr(A,M.length===1?M[0]:M)}:M}):l=[dn];var m=-1;l=ue(l,_n(vt()));var b=e0(o,function(M,A,R){var z=ue(l,function(j){return j(M)});return{criteria:z,index:++m,value:M}});return HI(b,function(M,A){return DN(M,A,f)})}function gN(o,l){return o0(o,l,function(f,m){return Lf(o,m)})}function o0(o,l,f){for(var m=-1,b=l.length,M={};++m<b;){var A=l[m],R=Dr(o,A);f(R,A)&&qo(M,Ki(A,o),R)}return M}function mN(o){return function(l){return Dr(l,o)}}function af(o,l,f,m){var b=m?UI: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],G=f?f(j):j;(z=b(R,G,z,m))>-1;)R!==o&&Nl.call(R,z,1),Nl.call(o,z,1);return o}function a0(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(H_()*(l-o+1))}function yN(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>rt)return f;do l%2&&(f+=o),l=zl(l/2),l&&(o+=o);while(l);return f}function Ft(o,l){return kf(F0(o,l,dn),o+"")}function _N(o){return Y_(vs(o))}function bN(o,l){var f=vs(o);return nc(f,kr(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 G=R[z];j=m?m(G,z,R):e,j===e&&(j=fe(G)?G:mi(l[b+1])?[]:{})}Wo(R,z,j),R=R[z]}return o}var l0=Ul?function(o,l){return Ul.set(o,l),o}:dn,xN=Fl?function(o,l){return Fl(o,"toString",{configurable:!0,enumerable:!1,value:Ff(l),writable:!0})}:dn;function wN(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 vN(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 G=zl((b+M)/2),tt=f(o[G]),ot=tt!==e,yt=tt===null,St=tt===tt,Nt=xn(tt);if(A)var xt=m||St;else j?xt=St&&(m||ot):R?xt=St&&ot&&(m||!yt):z?xt=St&&ot&&!yt&&(m||!Nt):yt||Nt?xt=!1:xt=m?tt<=l:tt<l;xt?b=G+1:M=G}return Ve(M,X)}function c0(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 u0(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 W_?W_.call(o):"";var l=o+"";return l=="0"&&1/o==-st?"-0":l}function Gi(o,l,f){var m=-1,b=kl,M=o.length,A=!0,R=[],z=R;if(f)A=!1,b=Bd;else if(M>=r){var j=l?null:PN(o);if(j)return Cl(j);A=!1,b=No,z=new Mr}else z=l?[]:R;t:for(;++m<M;){var G=o[m],tt=l?l(G):G;if(G=f||G!==0?G:0,A&&tt===tt){for(var ot=z.length;ot--;)if(z[ot]===tt)continue t;l&&z.push(tt),R.push(G)}else b(z,tt,f)||(z!==R&&z.push(tt),R.push(G))}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=B0(o,l);return M==null||delete M[zn(Rn(l))]}function d0(o,l,f,m){return qo(o,l,f(Dr(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 f0(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 h0(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]:W0(Gt(o))}var SN=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 p0=uL||function(o){return ce.clearTimeout(o)};function g0(o,l){if(l)return o.slice();var f=o.length,m=N_?N_(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 TN(o,l){var f=l?gf(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.byteLength)}function MN(o){var l=new o.constructor(o.source,cl.exec(o));return l.lastIndex=o.lastIndex,l}function kN(o){return Ho?ne(Ho.call(o)):{}}function m0(o,l){var f=l?gf(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.length)}function y0(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=y0(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 _0(o,l,f,m){for(var b=-1,M=o.length,A=f.length,R=-1,z=l.length,j=ke(M-A,0),G=Y(z+j),tt=!m;++R<z;)G[R]=l[R];for(;++b<A;)(tt||b<M)&&(G[f[b]]=o[b]);for(;j--;)G[R++]=o[b++];return G}function b0(o,l,f,m){for(var b=-1,M=o.length,A=-1,R=f.length,z=-1,j=l.length,G=ke(M-R,0),tt=Y(G+j),ot=!m;++b<G;)tt[b]=o[b];for(var yt=b;++z<j;)tt[yt+z]=l[z];for(;++A<R;)(ot||b<M)&&(tt[yt+f[A]]=o[b++]);return tt}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 CN(o,l){return Qn(o,vf(o),l)}function ON(o,l){return Qn(o,R0(o),l)}function Kl(o,l){return function(f,m){var b=Et(f)?II:ZL,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 x0(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 w0(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 AN(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 v0(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(wb(xb(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 EN(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 D0(o,l,Xl,b.placeholder,e,A,j,e,e,f-M);var G=this&&this!==ce&&this instanceof b?m:o;return mn(G,this,A)}return b}function S0(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 T0(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]==(k|P|N|S)&&!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,G=j[0];if(A&&j.length==1&&Et(G))return A.plant(G).value();for(var tt=0,ot=f?l[tt].apply(this,j):G;++tt<f;)ot=l[tt].call(this,ot);return ot}})}function Xl(o,l,f,m,b,M,A,R,z,j){var G=l&k,tt=l&C,ot=l&E,yt=l&(P|I),St=l&O,Nt=ot?e:jo(o);function xt(){for(var Bt=arguments.length,Ht=Y(Bt),wn=Bt;wn--;)Ht[wn]=arguments[wn];if(yt)var Qe=xs(xt),vn=$I(Ht,Qe);if(m&&(Ht=_0(Ht,m,b,yt)),M&&(Ht=b0(Ht,M,A,yt)),Bt-=vn,yt&&Bt<j){var be=Vi(Ht,Qe);return D0(o,l,Xl,xt.placeholder,f,Ht,be,R,z,j-Bt)}var Hn=tt?f:this,bi=ot?Hn[o]:o;return Bt=Ht.length,R?Ht=ZN(Ht,R):St&&Bt>1&&Ht.reverse(),G&&z<Bt&&(Ht.length=z),this&&this!==ce&&this instanceof xt&&(bi=Nt||jo(bi)),bi.apply(Hn,Ht)}return xt}function M0(o,l){return function(f,m){return sN(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=u0(f),m=u0(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 RN(o,l,f,m){var b=l&C,M=jo(o);function A(){for(var R=-1,z=arguments.length,j=-1,G=m.length,tt=Y(G+z),ot=this&&this!==ce&&this instanceof A?M:o;++j<G;)tt[j]=m[j];for(;z--;)tt[j++]=arguments[++R];return mn(ot,b?f:this,tt)}return A}function k0(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),yN(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 D0(o,l,f,m,b,M,A,R,z,j){var G=l&P,tt=G?A:e,ot=G?e:A,yt=G?M:e,St=G?e:M;l|=G?N:F,l&=~(G?F:N),l&U||(l&=-4);var Nt=[o,l,b,yt,tt,St,ot,R,z,j],xt=f.apply(e,Nt);return Tf(o)&&z0(xt,Nt),xt.placeholder=m,U0(xt,o,l)}function yf(o){var l=Me[o];return function(f,m){if(f=Pn(f),m=m==null?0:Ve(It(m),292),m&&U_(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 PN=gs&&1/Cl(new gs([,-0]))[1]==st?function(o){return new gs(o)}:Uf;function C0(o){return function(l){var f=qe(l);return f==Dt?qd(l):f==oe?XI(l):WI(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(It(A),0),R=R===e?R:It(R),j-=b?b.length:0,l&F){var G=m,tt=b;m=b=e}var ot=z?e:xf(o),yt=[o,l,f,m,b,G,tt,M,A,R];if(ot&&GN(yt,ot),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=AN(o,l,f);else l==P||l==I?St=EN(o,l,R):(l==N||l==(C|N))&&!b.length?St=RN(o,l,f,m):St=Xl.apply(e,yt);var Nt=ot?l0:z0;return U0(Nt(St,yt),o,l)}function O0(o,l,f,m){return o===e||Un(o,ps[f])&&!jt.call(m,f)?l:o}function A0(o,l,f,m,b,M){return fe(o)&&fe(l)&&(M.set(l,o),ql(o,l,e,A0,M),M.delete(l)),o}function IN(o){return Xo(o)?e:o}function E0(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),G=M.get(l);if(j&&G)return j==l&&G==o;var tt=-1,ot=!0,yt=f&T?new Mr:e;for(M.set(o,l),M.set(l,o);++tt<R;){var St=o[tt],Nt=l[tt];if(m)var xt=A?m(Nt,St,tt,l,o,M):m(St,Nt,tt,o,l,M);if(xt!==e){if(xt)continue;ot=!1;break}if(yt){if(!Ud(l,function(Bt,Ht){if(!No(yt,Ht)&&(St===Bt||b(St,Bt,f,m,M)))return yt.push(Ht)})){ot=!1;break}}else if(!(St===Nt||b(St,Nt,f,m,M))){ot=!1;break}}return M.delete(o),M.delete(l),ot}function LN(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 lt:case gt:case kt:return Un(+o,+l);case Lt:return o.name==l.name&&o.message==l.message;case Ae:case on:return o==l+"";case Dt: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|=T,A.set(o,l);var G=E0(R(o),R(l),m,b,M,A);return A.delete(o),G;case $t:if(Ho)return Ho.call(o)==Ho.call(l)}return!1}function NN(o,l,f,m,b,M){var A=f&v,R=_f(o),z=R.length,j=_f(l),G=j.length;if(z!=G&&!A)return!1;for(var tt=z;tt--;){var ot=R[tt];if(!(A?ot in l:jt.call(l,ot)))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;++tt<z;){ot=R[tt];var Bt=o[ot],Ht=l[ot];if(m)var wn=A?m(Ht,Bt,ot,l,o,M):m(Bt,Ht,ot,o,l,M);if(!(wn===e?Bt===Ht||b(Bt,Ht,f,m,M):wn)){Nt=!1;break}xt||(xt=ot=="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 kf(F0(o,e,q0),o+"")}function _f(o){return Z_(o,Re,vf)}function bf(o){return Z_(o,un,R0)}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?t0:o,arguments.length?o(arguments[0],arguments[1]):o}function ec(o,l){var f=o.__data__;return YN(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,L0(b)]}return l}function Cr(o,l){var f=jI(o,l);return J_(f)?f:e}function FN(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 B_.call(o,l)}))}:Hf,R0=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)!=Dt||Xd&&qe(Xd.resolve())!=qt||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 bL:return gn;case xL:return Dt;case wL:return qt;case vL:return oe;case SL:return ie}return l});function BN(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 zN(o){var l=o.match(fd);return l?l[1].split(hd):[]}function P0(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 UN(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 I0(o){return typeof o.constructor=="function"&&!Go(o)?ys(Ll(o)):{}}function HN(o,l,f){var m=o.constructor;switch(l){case Ee:return gf(o);case lt:case gt:return new m(+o);case gn:return TN(o,f);case zi:case Dn:case $e:case In:case li:case wo:case vo:case br:case ci:return m0(o,f);case Dt:return new m;case kt:case on:return new m(o);case Ae:return MN(o);case oe:return new m;case $t:return kN(o)}}function WN(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
8
|
/* [wrapped with `+l+`] */
|
|
9
|
-
`)}function $N(o){return Et(o)||Ar(o)||!!(z_&&o&&o[z_])}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 YN(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 VN(o){return!!L_&&L_ in o}var qN=Al?yi:Wf;function Go(o){var l=o&&o.constructor,f=typeof l=="function"&&l.prototype||ps;return o===f}function L0(o){return o===o&&!fe(o)}function N0(o,l){return function(f){return f==null?!1:f[o]===l&&(l!==e||o in ne(f))}}function jN(o){var l=oc(o,function(m){return f.size===h&&f.clear(),m}),f=l.cache;return l}function GN(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==k&&o[7].length<=l[8]||m==(T|k)&&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?_0(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?b0(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 KN(o){var l=[];if(o!=null)for(var f in ne(o))l.push(f);return l}function XN(o){return Rl.call(o)}function F0(o,l,f){return l=De(l===e?o.length-1:l,0),function(){for(var m=arguments,b=-1,M=De(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 B0(o,l){return l.length<2?o:Dr(o,En(l,0,-1))}function ZN(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 z0=H0(l0),Ko=fL||function(o,l){return ce.setTimeout(o,l)},kf=H0(xN);function U0(o,l,f){var m=l+"";return kf(o,WN(m,QN(zN(m),f)))}function H0(o){var l=0,f=0;return function(){var m=mL(),b=j-(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 W0=jN(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 QN(o,l){return yn(ft,function(f){var m="_."+f[0];l&f[1]&&!kl(o,m)&&o.push(m)}),o.sort()}function $0(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 JN(o,l,f){(f?Ze(o,l,f):l===e)?l=1:l=De(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 tF(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 eF(){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 nF=Ft(function(o,l){return _e(o)?$o(o,Fe(l,1,_e,!0)):[]}),iF=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)):[]}),rF=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 sF(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 oF(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 aF(o,l){return o&&o.length?Gl(o,vt(l,3),!0,!0):[]}function lF(o,l){return o&&o.length?Gl(o,vt(l,3),!0):[]}function cF(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),eN(o,l,f,m)):[]}function Y0(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=De(m+b,0)),Dl(o,vt(l,3),b)}function V0(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?De(m+b,0):Ve(b,m-1)),Dl(o,vt(l,3),b,!0)}function q0(o){var l=o==null?0:o.length;return l?Fe(o,1):[]}function uF(o){var l=o==null?0:o.length;return l?Fe(o,rt):[]}function dF(o,l){var f=o==null?0:o.length;return f?(l=l===e?1:Lt(l),Fe(o,l)):[]}function fF(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 j0(o){return o&&o.length?o[0]:e}function hF(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=De(m+b,0)),us(o,l,b)}function pF(o){var l=o==null?0:o.length;return l?En(o,0,-1):[]}var gF=Ft(function(o){var l=ue(o,hf);return l.length&&l[0]===o[0]?nf(l):[]}),mF=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)):[]}),yF=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 _F(o,l){return o==null?"":pL.call(o,l)}function Rn(o){var l=o==null?0:o.length;return l?o[l-1]:e}function bF(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?De(m+b,0):Ve(b,m-1)),l===l?QI(o,l,b):Dl(o,D_,b,!0)}function xF(o,l){return o&&o.length?r0(o,Lt(l)):e}var wF=Ft(G0);function G0(o,l){return o&&o.length&&l&&l.length?af(o,l):o}function vF(o,l,f){return o&&o.length&&l&&l.length?af(o,l,vt(f,2)):o}function SF(o,l,f){return o&&o.length&&l&&l.length?af(o,l,e,f):o}var TF=gi(function(o,l){var f=o==null?0:o.length,m=Qd(o,l);return a0(o,ue(l,function(b){return mi(b,f)?+b:b}).sort(y0)),m});function MF(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 a0(o,b),f}function Df(o){return o==null?o:_L.call(o)}function kF(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 CF(o,l,f){return uf(o,l,vt(f,2))}function OF(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 AF(o,l){return jl(o,l,!0)}function EF(o,l,f){return uf(o,l,vt(f,2),!0)}function RF(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 PF(o){return o&&o.length?c0(o):[]}function IF(o,l){return o&&o.length?c0(o,vt(l,2)):[]}function LF(o){var l=o==null?0:o.length;return l?En(o,1,l):[]}function NF(o,l,f){return o&&o.length?(l=f||l===e?1:Lt(l),En(o,0,l<0?0:l)):[]}function FF(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 BF(o,l){return o&&o.length?Gl(o,vt(l,3),!1,!0):[]}function zF(o,l){return o&&o.length?Gl(o,vt(l,3)):[]}var UF=Ft(function(o){return Gi(Fe(o,1,_e,!0))}),HF=Ft(function(o){var l=Rn(o);return _e(l)&&(l=e),Gi(Fe(o,1,_e,!0),vt(l,2))}),WF=Ft(function(o){var l=Rn(o);return l=typeof l=="function"?l:e,Gi(Fe(o,1,_e,!0),e,l)});function $F(o){return o&&o.length?Gi(o):[]}function YF(o,l){return o&&o.length?Gi(o,vt(l,2)):[]}function VF(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=De(f.length,l),!0}),Yd(l,function(f){return ue(o,Hd(f))})}function K0(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 qF=Ft(function(o,l){return _e(o)?$o(o,l):[]}),jF=Ft(function(o){return ff($i(o,_e))}),GF=Ft(function(o){var l=Rn(o);return _e(l)&&(l=e),ff($i(o,_e),vt(l,2))}),KF=Ft(function(o){var l=Rn(o);return l=typeof l=="function"?l:e,ff($i(o,_e),e,l)}),XF=Ft(Cf);function ZF(o,l){return h0(o||[],l||[],Wo)}function QF(o,l){return h0(o||[],l||[],qo)}var JF=Ft(function(o){var l=o.length,f=l>1?o[l-1]:e;return f=typeof f=="function"?(o.pop(),f):e,K0(o,f)});function X0(o){var l=w(o);return l.__chain__=!0,l}function tB(o,l){return l(o),o}function ic(o,l){return l(o)}var eB=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 nB(){return X0(this)}function iB(){return new On(this.value(),this.__chain__)}function rB(){this.__values__===e&&(this.__values__=ub(this.value()));var o=this.__index__>=this.__values__.length,l=o?e:this.__values__[this.__index__++];return{done:o,value:l}}function sB(){return this}function oB(o){for(var l,f=this;f instanceof Wl;){var m=$0(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 aB(){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:[Df],thisArg:e}),new On(l,this.__chain__)}return this.thru(Df)}function lB(){return f0(this.__wrapped__,this.__actions__)}var cB=Kl(function(o,l,f){jt.call(o,f)?++o[f]:Xn(o,f,1)});function uB(o,l,f){var m=Et(o)?M_:tN;return f&&Ze(o,l,f)&&(l=e),m(o,vt(l,3))}function dB(o,l){var f=Et(o)?$i:K_;return f(o,vt(l,3))}var fB=S0(Y0),hB=S0(V0);function pB(o,l){return Fe(rc(o,l),1)}function gB(o,l){return Fe(rc(o,l),rt)}function mB(o,l,f){return f=f===e?1:Lt(f),Fe(rc(o,l),f)}function Z0(o,l){var f=Et(o)?yn:ji;return f(o,vt(l,3))}function Q0(o,l){var f=Et(o)?LI:G_;return f(o,vt(l,3))}var yB=Kl(function(o,l,f){jt.call(o,f)?o[f].push(l):Xn(o,f,[l])});function _B(o,l,f,m){o=cn(o)?o:vs(o),f=f&&!m?Lt(f):0;var b=o.length;return f<0&&(f=De(b+f,0)),cc(o)?f<=b&&o.indexOf(l,f)>-1:!!b&&us(o,l,f)>-1}var bB=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}),xB=Kl(function(o,l,f){Xn(o,f,l)});function rc(o,l){var f=Et(o)?ue:e0;return f(o,vt(l,3))}function wB(o,l,f,m){return o==null?[]:(Et(l)||(l=l==null?[]:[l]),f=m?e:f,Et(f)||(f=f==null?[]:[f]),s0(o,l,f))}var vB=Kl(function(o,l,f){o[f?0:1].push(l)},function(){return[[],[]]});function SB(o,l,f){var m=Et(o)?zd:O_,b=arguments.length<3;return m(o,vt(l,4),f,b,ji)}function TB(o,l,f){var m=Et(o)?NI:O_,b=arguments.length<3;return m(o,vt(l,4),f,b,G_)}function MB(o,l){var f=Et(o)?$i:K_;return f(o,ac(vt(l,3)))}function kB(o){var l=Et(o)?Y_:_N;return l(o)}function DB(o,l,f){(f?Ze(o,l,f):l===e)?l=1:l=Lt(l);var m=Et(o)?KL:bN;return m(o,l)}function CB(o){var l=Et(o)?XL:wN;return l(o)}function OB(o){if(o==null)return 0;if(cn(o))return cc(o)?fs(o):o.length;var l=qe(o);return l==Dt||l==oe?o.size:sf(o).length}function AB(o,l,f){var m=Et(o)?Ud:vN;return f&&Ze(o,l,f)&&(l=e),m(o,vt(l,3))}var EB=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]]),s0(o,Fe(l,1),[])}),sc=dL||function(){return ce.Date.now()};function RB(o,l){if(typeof l!="function")throw new Cn(a);return o=Lt(o),function(){if(--o<1)return l.apply(this,arguments)}}function J0(o,l,f){return l=f?e:l,l=o&&l==null?o.length:l,pi(o,T,e,e,e,e,l)}function tb(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)}),eb=Ft(function(o,l,f){var m=C|E;if(f.length){var b=Vi(f,xs(eb));m|=B}return pi(l,m,o,f,b)});function nb(o,l,f){l=f?e:l;var m=pi(o,P,e,e,e,e,e,l);return m.placeholder=nb.placeholder,m}function ib(o,l,f){l=f?e:l;var m=pi(o,I,e,e,e,e,e,l);return m.placeholder=ib.placeholder,m}function rb(o,l,f){var m,b,M,A,R,z,G=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?De(Pn(f.maxWait)||0,l):M,at="trailing"in f?!!f.trailing:at);function _t(be){var Hn=m,bi=b;return m=b=e,G=be,A=o.apply(bi,Hn),A}function St(be){return G=be,R=Ko(zt,l),K?_t(be):A}function Nt(be){var Hn=be-z,bi=be-G,Tb=l-Hn;return et?Ve(Tb,M-bi):Tb}function xt(be){var Hn=be-z,bi=be-G;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?_t(be):(m=b=e,A)}function wn(){R!==e&&p0(R),G=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 p0(R),R=Ko(zt,l),_t(z)}return R===e&&(R=Ko(zt,l)),A}return vn.cancel=wn,vn.flush=Qe,vn}var PB=Ft(function(o,l){return j_(o,1,l)}),IB=Ft(function(o,l,f){return j_(o,Pn(l)||0,f)});function LB(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 NB(o){return tb(2,o)}var FB=SN(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)}),sb=Ft(function(o,l){var f=Vi(l,xs(sb));return pi(o,N,e,l,f)}),BB=gi(function(o,l){return pi(o,k,e,e,e,l)});function zB(o,l){if(typeof o!="function")throw new Cn(a);return l=l===e?l:Lt(l),Ft(o,l)}function UB(o,l){if(typeof o!="function")throw new Cn(a);return l=l==null?0:De(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 HB(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),rb(o,l,{leading:m,maxWait:l,trailing:b})}function WB(o){return J0(o,1)}function $B(o,l){return Af(pf(l),o)}function YB(){if(!arguments.length)return[];var o=arguments[0];return Et(o)?o:[o]}function VB(o){return An(o,x)}function qB(o,l){return l=typeof l=="function"?l:e,An(o,x,l)}function jB(o){return An(o,y|x)}function GB(o,l){return l=typeof l=="function"?l:e,An(o,y|x,l)}function KB(o,l){return l==null||q_(o,l,Re(l))}function Un(o,l){return o===l||o!==o&&l!==l}var XB=Jl(ef),ZB=Jl(function(o,l){return o>=l}),Ar=Q_((function(){return arguments})())?Q_:function(o){return ge(o)&&jt.call(o,"callee")&&!B_.call(o,"callee")},Et=Y.isArray,QB=b_?_n(b_):oN;function cn(o){return o!=null&&lc(o.length)&&!yi(o)}function _e(o){return ge(o)&&cn(o)}function JB(o){return o===!0||o===!1||ge(o)&&Xe(o)==dt}var Zi=hL||Wf,tz=x_?_n(x_):aN;function ez(o){return ge(o)&&o.nodeType===1&&!Xo(o)}function nz(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==Dt||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 iz(o,l){return Vo(o,l)}function rz(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 sz(o){return typeof o=="number"&&U_(o)}function yi(o){if(!fe(o))return!1;var l=Xe(o);return l==Bt||l==wt||l==ut||l==Se}function ob(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 ab=w_?_n(w_):cN;function oz(o,l){return o===l||rf(o,l,wf(l))}function az(o,l,f){return f=typeof f=="function"?f:e,rf(o,l,wf(l),f)}function lz(o){return lb(o)&&o!=+o}function cz(o){if(qN(o))throw new Ct(s);return J_(o)}function uz(o){return o===null}function dz(o){return o==null}function lb(o){return typeof o=="number"||ge(o)&&Xe(o)==kt}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)==aL}var Rf=v_?_n(v_):uN;function fz(o){return ob(o)&&o>=-st&&o<=st}var cb=S_?_n(S_):dN;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=T_?_n(T_):fN;function hz(o){return o===e}function pz(o){return ge(o)&&qe(o)==ie}function gz(o){return ge(o)&&Xe(o)==Te}var mz=Jl(of),yz=Jl(function(o,l){return o<=l});function ub(o){if(!o)return[];if(cn(o))return cc(o)?Fn(o):ln(o);if(Fo&&o[Fo])return KI(o[Fo]());var l=qe(o),f=l==Dt?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 db(o){return o?kr(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=A_(o);var f=yd.test(o);return f||bd.test(o)?Nn(o.slice(2),f?2:8):md.test(o)?H:+o}function fb(o){return Qn(o,un(o))}function _z(o){return o?kr(Lt(o),-st,st):o===0?o:0}function Gt(o){return o==null?"":bn(o)}var bz=_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])}),hb=_s(function(o,l){Qn(l,un(l),o)}),pb=_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)}),xz=gi(Qd);function wz(o,l){var f=ys(o);return l==null?f:V_(f,l)}var vz=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 G=A[R],K=o[G];(K===e||Un(K,ps[G])&&!jt.call(o,G))&&(o[G]=M[G])}return o}),Sz=Ft(function(o){return o.push(e,A0),mn(gb,e,o)});function Tz(o,l){return k_(o,vt(l,3),Zn)}function Mz(o,l){return k_(o,vt(l,3),tf)}function kz(o,l){return o==null?o:Jd(o,vt(l,3),un)}function Dz(o,l){return o==null?o:X_(o,vt(l,3),un)}function Cz(o,l){return o&&Zn(o,vt(l,3))}function Oz(o,l){return o&&tf(o,vt(l,3))}function Az(o){return o==null?[]:Vl(o,Re(o))}function Ez(o){return o==null?[]:Vl(o,un(o))}function If(o,l,f){var m=o==null?e:Dr(o,l);return m===e?f:m}function Rz(o,l){return o!=null&&P0(o,l,nN)}function Lf(o,l){return o!=null&&P0(o,l,iN)}var Pz=M0(function(o,l,f){l!=null&&typeof l.toString!="function"&&(l=Rl.call(l)),o[l]=f},Ff(dn)),Iz=M0(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),Lz=Ft(Yo);function Re(o){return cn(o)?$_(o):sf(o)}function un(o){return cn(o)?$_(o,!0):hN(o)}function Nz(o,l){var f={};return l=vt(l,3),Zn(o,function(m,b,M){Xn(f,l(m,b,M),m)}),f}function Fz(o,l){var f={};return l=vt(l,3),Zn(o,function(m,b,M){Xn(f,b,l(m,b,M))}),f}var Bz=_s(function(o,l,f){ql(o,l,f)}),gb=_s(function(o,l,f,m){ql(o,l,f,m)}),zz=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,IN));for(var b=l.length;b--;)df(f,l[b]);return f});function Uz(o,l){return mb(o,ac(vt(l)))}var Hz=gi(function(o,l){return o==null?{}:gN(o,l)});function mb(o,l){if(o==null)return{};var f=ue(bf(o),function(m){return[m]});return l=vt(l),o0(o,f,function(m,b){return l(m,b[0])})}function Wz(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 $z(o,l,f){return o==null?o:qo(o,l,f)}function Yz(o,l,f,m){return m=typeof m=="function"?m:e,o==null?o:qo(o,l,f,m)}var yb=C0(Re),_b=C0(un);function Vz(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 qz(o,l){return o==null?!0:df(o,l)}function jz(o,l,f){return o==null?o:d0(o,l,pf(f))}function Gz(o,l,f,m){return m=typeof m=="function"?m:e,o==null?o:d0(o,l,pf(f),m)}function vs(o){return o==null?[]:Vd(o,Re(o))}function Kz(o){return o==null?[]:Vd(o,un(o))}function Xz(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),kr(Pn(o),l,f)}function Zz(o,l,f){return l=_i(l),f===e?(f=l,l=0):f=_i(f),o=Pn(o),rN(o,l,f)}function Qz(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=H_();return Ve(o+b*(l-o+Ye("1e-"+((b+"").length-1))),l)}return lf(o,l)}var Jz=bs(function(o,l,f){return l=l.toLowerCase(),o+(f?bb(l):l)});function bb(o){return Nf(Gt(o).toLowerCase())}function xb(o){return o=Gt(o),o&&o.replace(xd,YI).replace(Id,"")}function tU(o,l,f){o=Gt(o),l=bn(l);var m=o.length;f=f===e?m:kr(Lt(f),0,m);var b=f;return f-=l.length,f>=0&&o.slice(f,b)==l}function eU(o){return o=Gt(o),o&&od.test(o)?o.replace(ol,VI):o}function nU(o){return o=Gt(o),o&&ud.test(o)?o.replace(Do,"\\$&"):o}var iU=bs(function(o,l,f){return o+(f?"-":"")+l.toLowerCase()}),rU=bs(function(o,l,f){return o+(f?" ":"")+l.toLowerCase()}),sU=v0("toLowerCase");function oU(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 aU(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 lU(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 cU(o,l,f){return f||l==null?l=0:l&&(l=+l),yL(Gt(o).replace(Co,""),l||0)}function uU(o,l,f){return(f?Ze(o,l,f):l===e)?l=1:l=Lt(l),cf(Gt(o),l)}function dU(){var o=arguments,l=Gt(o[0]);return o.length<3?l:l.replace(o[1],o[2])}var fU=bs(function(o,l,f){return o+(f?"_":"")+l.toLowerCase()});function hU(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 pU=bs(function(o,l,f){return o+(f?" ":"")+Nf(l)});function gU(o,l,f){return o=Gt(o),f=f==null?0:kr(Lt(f),0,o.length),l=bn(l),o.slice(f,f+l.length)==l}function mU(o,l,f){var m=w.templateSettings;f&&Ze(o,l,f)&&(l=e),o=Gt(o),l=Pf({},l,m,O0);var b=Pf({},l.imports,m.imports,O0),M=Re(b),A=Vd(b,M);yn(M,function(xt){if(ll.test(xt))throw new Ct(u)});var R,z,G=0,K=l.interpolate||es,et="__p += '",at=jd((l.escape||es).source+"|"+K.source+"|"+(K===ko?Hi:es).source+"|"+(l.evaluate||es).source+"|$","g"),_t="//# sourceURL="+(jt.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Fd+"]")+`
|
|
10
|
-
`;o.replace(
|
|
11
|
-
__e(`+
|
|
12
|
-
'`),Qe&&(z=!0,
|
|
9
|
+
`)}function $N(o){return Et(o)||Ar(o)||!!(z_&&o&&o[z_])}function mi(o,l){var f=typeof o;return l=l??rt,!!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 YN(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 VN(o){return!!L_&&L_ in o}var qN=Al?yi:Wf;function Go(o){var l=o&&o.constructor,f=typeof l=="function"&&l.prototype||ps;return o===f}function L0(o){return o===o&&!fe(o)}function N0(o,l){return function(f){return f==null?!1:f[o]===l&&(l!==e||o in ne(f))}}function jN(o){var l=oc(o,function(m){return f.size===h&&f.clear(),m}),f=l.cache;return l}function GN(o,l){var f=o[1],m=l[1],b=f|m,M=b<(C|E|k),A=m==k&&f==P||m==k&&f==S&&o[7].length<=l[8]||m==(k|S)&&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?_0(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?b0(z,R,l[6]):R,o[6]=z?Vi(o[5],g):l[6]),R=l[7],R&&(o[7]=R),m&k&&(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 KN(o){var l=[];if(o!=null)for(var f in ne(o))l.push(f);return l}function XN(o){return Rl.call(o)}function F0(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 B0(o,l){return l.length<2?o:Dr(o,En(l,0,-1))}function ZN(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 z0=H0(l0),Ko=fL||function(o,l){return ce.setTimeout(o,l)},kf=H0(xN);function U0(o,l,f){var m=l+"";return kf(o,WN(m,QN(zN(m),f)))}function H0(o){var l=0,f=0;return function(){var m=mL(),b=K-(m-f);if(f=m,b>0){if(++l>=et)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 W0=jN(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==-st?"-0":l}function Or(o){if(o!=null){try{return El.call(o)}catch{}try{return o+""}catch{}}return""}function QN(o,l){return yn(ut,function(f){var m="_."+f[0];l&f[1]&&!kl(o,m)&&o.push(m)}),o.sort()}function $0(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 JN(o,l,f){(f?Ze(o,l,f):l===e)?l=1:l=ke(It(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 tF(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 eF(){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 nF=Ft(function(o,l){return _e(o)?$o(o,Fe(l,1,_e,!0)):[]}),iF=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)):[]}),rF=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 sF(o,l,f){var m=o==null?0:o.length;return m?(l=f||l===e?1:It(l),En(o,l<0?0:l,m)):[]}function oF(o,l,f){var m=o==null?0:o.length;return m?(l=f||l===e?1:It(l),l=m-l,En(o,0,l<0?0:l)):[]}function aF(o,l){return o&&o.length?Gl(o,vt(l,3),!0,!0):[]}function lF(o,l){return o&&o.length?Gl(o,vt(l,3),!0):[]}function cF(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),eN(o,l,f,m)):[]}function Y0(o,l,f){var m=o==null?0:o.length;if(!m)return-1;var b=f==null?0:It(f);return b<0&&(b=ke(m+b,0)),Dl(o,vt(l,3),b)}function V0(o,l,f){var m=o==null?0:o.length;if(!m)return-1;var b=m-1;return f!==e&&(b=It(f),b=f<0?ke(m+b,0):Ve(b,m-1)),Dl(o,vt(l,3),b,!0)}function q0(o){var l=o==null?0:o.length;return l?Fe(o,1):[]}function uF(o){var l=o==null?0:o.length;return l?Fe(o,st):[]}function dF(o,l){var f=o==null?0:o.length;return f?(l=l===e?1:It(l),Fe(o,l)):[]}function fF(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 j0(o){return o&&o.length?o[0]:e}function hF(o,l,f){var m=o==null?0:o.length;if(!m)return-1;var b=f==null?0:It(f);return b<0&&(b=ke(m+b,0)),us(o,l,b)}function pF(o){var l=o==null?0:o.length;return l?En(o,0,-1):[]}var gF=Ft(function(o){var l=ue(o,hf);return l.length&&l[0]===o[0]?nf(l):[]}),mF=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)):[]}),yF=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 _F(o,l){return o==null?"":pL.call(o,l)}function Rn(o){var l=o==null?0:o.length;return l?o[l-1]:e}function bF(o,l,f){var m=o==null?0:o.length;if(!m)return-1;var b=m;return f!==e&&(b=It(f),b=b<0?ke(m+b,0):Ve(b,m-1)),l===l?QI(o,l,b):Dl(o,D_,b,!0)}function xF(o,l){return o&&o.length?r0(o,It(l)):e}var wF=Ft(G0);function G0(o,l){return o&&o.length&&l&&l.length?af(o,l):o}function vF(o,l,f){return o&&o.length&&l&&l.length?af(o,l,vt(f,2)):o}function SF(o,l,f){return o&&o.length&&l&&l.length?af(o,l,e,f):o}var TF=gi(function(o,l){var f=o==null?0:o.length,m=Qd(o,l);return a0(o,ue(l,function(b){return mi(b,f)?+b:b}).sort(y0)),m});function MF(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 a0(o,b),f}function Df(o){return o==null?o:_L.call(o)}function kF(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:It(l),f=f===e?m:It(f)),En(o,l,f)):[]}function DF(o,l){return jl(o,l)}function CF(o,l,f){return uf(o,l,vt(f,2))}function OF(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 AF(o,l){return jl(o,l,!0)}function EF(o,l,f){return uf(o,l,vt(f,2),!0)}function RF(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 PF(o){return o&&o.length?c0(o):[]}function IF(o,l){return o&&o.length?c0(o,vt(l,2)):[]}function LF(o){var l=o==null?0:o.length;return l?En(o,1,l):[]}function NF(o,l,f){return o&&o.length?(l=f||l===e?1:It(l),En(o,0,l<0?0:l)):[]}function FF(o,l,f){var m=o==null?0:o.length;return m?(l=f||l===e?1:It(l),l=m-l,En(o,l<0?0:l,m)):[]}function BF(o,l){return o&&o.length?Gl(o,vt(l,3),!1,!0):[]}function zF(o,l){return o&&o.length?Gl(o,vt(l,3)):[]}var UF=Ft(function(o){return Gi(Fe(o,1,_e,!0))}),HF=Ft(function(o){var l=Rn(o);return _e(l)&&(l=e),Gi(Fe(o,1,_e,!0),vt(l,2))}),WF=Ft(function(o){var l=Rn(o);return l=typeof l=="function"?l:e,Gi(Fe(o,1,_e,!0),e,l)});function $F(o){return o&&o.length?Gi(o):[]}function YF(o,l){return o&&o.length?Gi(o,vt(l,2)):[]}function VF(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 K0(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 qF=Ft(function(o,l){return _e(o)?$o(o,l):[]}),jF=Ft(function(o){return ff($i(o,_e))}),GF=Ft(function(o){var l=Rn(o);return _e(l)&&(l=e),ff($i(o,_e),vt(l,2))}),KF=Ft(function(o){var l=Rn(o);return l=typeof l=="function"?l:e,ff($i(o,_e),e,l)}),XF=Ft(Cf);function ZF(o,l){return h0(o||[],l||[],Wo)}function QF(o,l){return h0(o||[],l||[],qo)}var JF=Ft(function(o){var l=o.length,f=l>1?o[l-1]:e;return f=typeof f=="function"?(o.pop(),f):e,K0(o,f)});function X0(o){var l=w(o);return l.__chain__=!0,l}function tB(o,l){return l(o),o}function ic(o,l){return l(o)}var eB=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 nB(){return X0(this)}function iB(){return new On(this.value(),this.__chain__)}function rB(){this.__values__===e&&(this.__values__=ub(this.value()));var o=this.__index__>=this.__values__.length,l=o?e:this.__values__[this.__index__++];return{done:o,value:l}}function sB(){return this}function oB(o){for(var l,f=this;f instanceof Wl;){var m=$0(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 aB(){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:[Df],thisArg:e}),new On(l,this.__chain__)}return this.thru(Df)}function lB(){return f0(this.__wrapped__,this.__actions__)}var cB=Kl(function(o,l,f){jt.call(o,f)?++o[f]:Xn(o,f,1)});function uB(o,l,f){var m=Et(o)?M_:tN;return f&&Ze(o,l,f)&&(l=e),m(o,vt(l,3))}function dB(o,l){var f=Et(o)?$i:K_;return f(o,vt(l,3))}var fB=S0(Y0),hB=S0(V0);function pB(o,l){return Fe(rc(o,l),1)}function gB(o,l){return Fe(rc(o,l),st)}function mB(o,l,f){return f=f===e?1:It(f),Fe(rc(o,l),f)}function Z0(o,l){var f=Et(o)?yn:ji;return f(o,vt(l,3))}function Q0(o,l){var f=Et(o)?LI:G_;return f(o,vt(l,3))}var yB=Kl(function(o,l,f){jt.call(o,f)?o[f].push(l):Xn(o,f,[l])});function _B(o,l,f,m){o=cn(o)?o:vs(o),f=f&&!m?It(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 bB=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}),xB=Kl(function(o,l,f){Xn(o,f,l)});function rc(o,l){var f=Et(o)?ue:e0;return f(o,vt(l,3))}function wB(o,l,f,m){return o==null?[]:(Et(l)||(l=l==null?[]:[l]),f=m?e:f,Et(f)||(f=f==null?[]:[f]),s0(o,l,f))}var vB=Kl(function(o,l,f){o[f?0:1].push(l)},function(){return[[],[]]});function SB(o,l,f){var m=Et(o)?zd:O_,b=arguments.length<3;return m(o,vt(l,4),f,b,ji)}function TB(o,l,f){var m=Et(o)?NI:O_,b=arguments.length<3;return m(o,vt(l,4),f,b,G_)}function MB(o,l){var f=Et(o)?$i:K_;return f(o,ac(vt(l,3)))}function kB(o){var l=Et(o)?Y_:_N;return l(o)}function DB(o,l,f){(f?Ze(o,l,f):l===e)?l=1:l=It(l);var m=Et(o)?KL:bN;return m(o,l)}function CB(o){var l=Et(o)?XL:wN;return l(o)}function OB(o){if(o==null)return 0;if(cn(o))return cc(o)?fs(o):o.length;var l=qe(o);return l==Dt||l==oe?o.size:sf(o).length}function AB(o,l,f){var m=Et(o)?Ud:vN;return f&&Ze(o,l,f)&&(l=e),m(o,vt(l,3))}var EB=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]]),s0(o,Fe(l,1),[])}),sc=dL||function(){return ce.Date.now()};function RB(o,l){if(typeof l!="function")throw new Cn(a);return o=It(o),function(){if(--o<1)return l.apply(this,arguments)}}function J0(o,l,f){return l=f?e:l,l=o&&l==null?o.length:l,pi(o,k,e,e,e,e,l)}function tb(o,l){var f;if(typeof l!="function")throw new Cn(a);return o=It(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|=N}return pi(o,m,l,f,b)}),eb=Ft(function(o,l,f){var m=C|E;if(f.length){var b=Vi(f,xs(eb));m|=N}return pi(l,m,o,f,b)});function nb(o,l,f){l=f?e:l;var m=pi(o,P,e,e,e,e,e,l);return m.placeholder=nb.placeholder,m}function ib(o,l,f){l=f?e:l;var m=pi(o,I,e,e,e,e,e,l);return m.placeholder=ib.placeholder,m}function rb(o,l,f){var m,b,M,A,R,z,j=0,G=!1,tt=!1,ot=!0;if(typeof o!="function")throw new Cn(a);l=Pn(l)||0,fe(f)&&(G=!!f.leading,tt="maxWait"in f,M=tt?ke(Pn(f.maxWait)||0,l):M,ot="trailing"in f?!!f.trailing:ot);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(Bt,l),G?yt(be):A}function Nt(be){var Hn=be-z,bi=be-j,Tb=l-Hn;return tt?Ve(Tb,M-bi):Tb}function xt(be){var Hn=be-z,bi=be-j;return z===e||Hn>=l||Hn<0||tt&&bi>=M}function Bt(){var be=sc();if(xt(be))return Ht(be);R=Ko(Bt,Nt(be))}function Ht(be){return R=e,ot&&m?yt(be):(m=b=e,A)}function wn(){R!==e&&p0(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(tt)return p0(R),R=Ko(Bt,l),yt(z)}return R===e&&(R=Ko(Bt,l)),A}return vn.cancel=wn,vn.flush=Qe,vn}var PB=Ft(function(o,l){return j_(o,1,l)}),IB=Ft(function(o,l,f){return j_(o,Pn(l)||0,f)});function LB(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 NB(o){return tb(2,o)}var FB=SN(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,N,e,l,f)}),sb=Ft(function(o,l){var f=Vi(l,xs(sb));return pi(o,F,e,l,f)}),BB=gi(function(o,l){return pi(o,S,e,e,e,l)});function zB(o,l){if(typeof o!="function")throw new Cn(a);return l=l===e?l:It(l),Ft(o,l)}function UB(o,l){if(typeof o!="function")throw new Cn(a);return l=l==null?0:ke(It(l),0),Ft(function(f){var m=f[l],b=Xi(f,0,l);return m&&Yi(b,m),mn(o,this,b)})}function HB(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),rb(o,l,{leading:m,maxWait:l,trailing:b})}function WB(o){return J0(o,1)}function $B(o,l){return Af(pf(l),o)}function YB(){if(!arguments.length)return[];var o=arguments[0];return Et(o)?o:[o]}function VB(o){return An(o,x)}function qB(o,l){return l=typeof l=="function"?l:e,An(o,x,l)}function jB(o){return An(o,y|x)}function GB(o,l){return l=typeof l=="function"?l:e,An(o,y|x,l)}function KB(o,l){return l==null||q_(o,l,Re(l))}function Un(o,l){return o===l||o!==o&&l!==l}var XB=Jl(ef),ZB=Jl(function(o,l){return o>=l}),Ar=Q_((function(){return arguments})())?Q_:function(o){return ge(o)&&jt.call(o,"callee")&&!B_.call(o,"callee")},Et=Y.isArray,QB=b_?_n(b_):oN;function cn(o){return o!=null&&lc(o.length)&&!yi(o)}function _e(o){return ge(o)&&cn(o)}function JB(o){return o===!0||o===!1||ge(o)&&Xe(o)==lt}var Zi=hL||Wf,tz=x_?_n(x_):aN;function ez(o){return ge(o)&&o.nodeType===1&&!Xo(o)}function nz(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==Dt||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 iz(o,l){return Vo(o,l)}function rz(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==Lt||l==ct||typeof o.message=="string"&&typeof o.name=="string"&&!Xo(o)}function sz(o){return typeof o=="number"&&U_(o)}function yi(o){if(!fe(o))return!1;var l=Xe(o);return l==zt||l==wt||l==ft||l==Oe}function ob(o){return typeof o=="number"&&o==It(o)}function lc(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=rt}function fe(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function ge(o){return o!=null&&typeof o=="object"}var ab=w_?_n(w_):cN;function oz(o,l){return o===l||rf(o,l,wf(l))}function az(o,l,f){return f=typeof f=="function"?f:e,rf(o,l,wf(l),f)}function lz(o){return lb(o)&&o!=+o}function cz(o){if(qN(o))throw new Ct(s);return J_(o)}function uz(o){return o===null}function dz(o){return o==null}function lb(o){return typeof o=="number"||ge(o)&&Xe(o)==kt}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)==aL}var Rf=v_?_n(v_):uN;function fz(o){return ob(o)&&o>=-rt&&o<=rt}var cb=S_?_n(S_):dN;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)==$t}var ws=T_?_n(T_):fN;function hz(o){return o===e}function pz(o){return ge(o)&&qe(o)==ie}function gz(o){return ge(o)&&Xe(o)==Se}var mz=Jl(of),yz=Jl(function(o,l){return o<=l});function ub(o){if(!o)return[];if(cn(o))return cc(o)?Fn(o):ln(o);if(Fo&&o[Fo])return KI(o[Fo]());var l=qe(o),f=l==Dt?qd:l==oe?Cl:vs;return f(o)}function _i(o){if(!o)return o===0?o:0;if(o=Pn(o),o===st||o===-st){var l=o<0?-1:1;return l*at}return o===o?o:0}function It(o){var l=_i(o),f=l%1;return l===l?f?l-f:l:0}function db(o){return o?kr(It(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=A_(o);var f=yd.test(o);return f||bd.test(o)?Nn(o.slice(2),f?2:8):md.test(o)?H:+o}function fb(o){return Qn(o,un(o))}function _z(o){return o?kr(It(o),-rt,rt):o===0?o:0}function Gt(o){return o==null?"":bn(o)}var bz=_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])}),hb=_s(function(o,l){Qn(l,un(l),o)}),pb=_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)}),xz=gi(Qd);function wz(o,l){var f=ys(o);return l==null?f:V_(f,l)}var vz=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],G=o[j];(G===e||Un(G,ps[j])&&!jt.call(o,j))&&(o[j]=M[j])}return o}),Sz=Ft(function(o){return o.push(e,A0),mn(gb,e,o)});function Tz(o,l){return k_(o,vt(l,3),Zn)}function Mz(o,l){return k_(o,vt(l,3),tf)}function kz(o,l){return o==null?o:Jd(o,vt(l,3),un)}function Dz(o,l){return o==null?o:X_(o,vt(l,3),un)}function Cz(o,l){return o&&Zn(o,vt(l,3))}function Oz(o,l){return o&&tf(o,vt(l,3))}function Az(o){return o==null?[]:Vl(o,Re(o))}function Ez(o){return o==null?[]:Vl(o,un(o))}function If(o,l,f){var m=o==null?e:Dr(o,l);return m===e?f:m}function Rz(o,l){return o!=null&&P0(o,l,nN)}function Lf(o,l){return o!=null&&P0(o,l,iN)}var Pz=M0(function(o,l,f){l!=null&&typeof l.toString!="function"&&(l=Rl.call(l)),o[l]=f},Ff(dn)),Iz=M0(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),Lz=Ft(Yo);function Re(o){return cn(o)?$_(o):sf(o)}function un(o){return cn(o)?$_(o,!0):hN(o)}function Nz(o,l){var f={};return l=vt(l,3),Zn(o,function(m,b,M){Xn(f,l(m,b,M),m)}),f}function Fz(o,l){var f={};return l=vt(l,3),Zn(o,function(m,b,M){Xn(f,b,l(m,b,M))}),f}var Bz=_s(function(o,l,f){ql(o,l,f)}),gb=_s(function(o,l,f,m){ql(o,l,f,m)}),zz=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,IN));for(var b=l.length;b--;)df(f,l[b]);return f});function Uz(o,l){return mb(o,ac(vt(l)))}var Hz=gi(function(o,l){return o==null?{}:gN(o,l)});function mb(o,l){if(o==null)return{};var f=ue(bf(o),function(m){return[m]});return l=vt(l),o0(o,f,function(m,b){return l(m,b[0])})}function Wz(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 $z(o,l,f){return o==null?o:qo(o,l,f)}function Yz(o,l,f,m){return m=typeof m=="function"?m:e,o==null?o:qo(o,l,f,m)}var yb=C0(Re),_b=C0(un);function Vz(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 qz(o,l){return o==null?!0:df(o,l)}function jz(o,l,f){return o==null?o:d0(o,l,pf(f))}function Gz(o,l,f,m){return m=typeof m=="function"?m:e,o==null?o:d0(o,l,pf(f),m)}function vs(o){return o==null?[]:Vd(o,Re(o))}function Kz(o){return o==null?[]:Vd(o,un(o))}function Xz(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),kr(Pn(o),l,f)}function Zz(o,l,f){return l=_i(l),f===e?(f=l,l=0):f=_i(f),o=Pn(o),rN(o,l,f)}function Qz(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=H_();return Ve(o+b*(l-o+Ye("1e-"+((b+"").length-1))),l)}return lf(o,l)}var Jz=bs(function(o,l,f){return l=l.toLowerCase(),o+(f?bb(l):l)});function bb(o){return Nf(Gt(o).toLowerCase())}function xb(o){return o=Gt(o),o&&o.replace(xd,YI).replace(Id,"")}function tU(o,l,f){o=Gt(o),l=bn(l);var m=o.length;f=f===e?m:kr(It(f),0,m);var b=f;return f-=l.length,f>=0&&o.slice(f,b)==l}function eU(o){return o=Gt(o),o&&od.test(o)?o.replace(ol,VI):o}function nU(o){return o=Gt(o),o&&ud.test(o)?o.replace(Do,"\\$&"):o}var iU=bs(function(o,l,f){return o+(f?"-":"")+l.toLowerCase()}),rU=bs(function(o,l,f){return o+(f?" ":"")+l.toLowerCase()}),sU=v0("toLowerCase");function oU(o,l,f){o=Gt(o),l=It(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 aU(o,l,f){o=Gt(o),l=It(l);var m=l?fs(o):0;return l&&m<l?o+Ql(l-m,f):o}function lU(o,l,f){o=Gt(o),l=It(l);var m=l?fs(o):0;return l&&m<l?Ql(l-m,f)+o:o}function cU(o,l,f){return f||l==null?l=0:l&&(l=+l),yL(Gt(o).replace(Co,""),l||0)}function uU(o,l,f){return(f?Ze(o,l,f):l===e)?l=1:l=It(l),cf(Gt(o),l)}function dU(){var o=arguments,l=Gt(o[0]);return o.length<3?l:l.replace(o[1],o[2])}var fU=bs(function(o,l,f){return o+(f?"_":"")+l.toLowerCase()});function hU(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 pU=bs(function(o,l,f){return o+(f?" ":"")+Nf(l)});function gU(o,l,f){return o=Gt(o),f=f==null?0:kr(It(f),0,o.length),l=bn(l),o.slice(f,f+l.length)==l}function mU(o,l,f){var m=w.templateSettings;f&&Ze(o,l,f)&&(l=e),o=Gt(o),l=Pf({},l,m,O0);var b=Pf({},l.imports,m.imports,O0),M=Re(b),A=Vd(b,M);yn(M,function(xt){if(ll.test(xt))throw new Ct(u)});var R,z,j=0,G=l.interpolate||es,tt="__p += '",ot=jd((l.escape||es).source+"|"+G.source+"|"+(G===ko?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(ot,function(xt,Bt,Ht,wn,Qe,vn){return Ht||(Ht=wn),tt+=o.slice(j,vn).replace(wd,qI),Bt&&(R=!0,tt+=`' +
|
|
11
|
+
__e(`+Bt+`) +
|
|
12
|
+
'`),Qe&&(z=!0,tt+=`';
|
|
13
13
|
`+Qe+`;
|
|
14
|
-
__p += '`),Ht&&(
|
|
14
|
+
__p += '`),Ht&&(tt+=`' +
|
|
15
15
|
((__t = (`+Ht+`)) == null ? '' : __t) +
|
|
16
|
-
'`),
|
|
17
|
-
`;var St=jt.call(l,"variable")&&l.variable;if(!St)
|
|
18
|
-
`+
|
|
16
|
+
'`),j=vn+xt.length,xt}),tt+=`';
|
|
17
|
+
`;var St=jt.call(l,"variable")&&l.variable;if(!St)tt=`with (obj) {
|
|
18
|
+
`+tt+`
|
|
19
19
|
}
|
|
20
|
-
`;else if(ll.test(St))throw new Ct(c);
|
|
20
|
+
`;else if(ll.test(St))throw new Ct(c);tt=(z?tt.replace(So,""):tt).replace(To,"$1").replace(Mo,"$1;"),tt="function("+(St||"obj")+`) {
|
|
21
21
|
`+(St?"":`obj || (obj = {});
|
|
22
22
|
`)+"var __t, __p = ''"+(R?", __e = _.escape":"")+(z?`, __j = Array.prototype.join;
|
|
23
23
|
function print() { __p += __j.call(arguments, '') }
|
|
24
24
|
`:`;
|
|
25
|
-
`)+
|
|
26
|
-
}`;var Nt=vb(function(){return $t(M,_t+"return "+et).apply(e,A)});if(Nt.source=et,Ef(Nt))throw Nt;return Nt}function yU(o){return Gt(o).toLowerCase()}function _U(o){return Gt(o).toUpperCase()}function bU(o,l,f){if(o=Gt(o),o&&(f||l===e))return A_(o);if(!o||!(l=bn(l)))return o;var m=Fn(o),b=Fn(l),M=E_(m,b),A=R_(m,b)+1;return Xi(m,M,A).join("")}function xU(o,l,f){if(o=Gt(o),o&&(f||l===e))return o.slice(0,I_(o)+1);if(!o||!(l=bn(l)))return o;var m=Fn(o),b=R_(m,Fn(l))+1;return Xi(m,0,b).join("")}function wU(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=E_(m,Fn(l));return Xi(m,b).join("")}function vU(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 G,K=z;for(b.global||(b=jd(b.source,Gt(cl.exec(b))+"g")),b.lastIndex=0;G=b.exec(K);)var et=G.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 SU(o){return o=Gt(o),o&&sd.test(o)?o.replace(Ui,JI):o}var TU=bs(function(o,l,f){return o+(f?" ":"")+l.toUpperCase()}),Nf=v0("toUpperCase");function wb(o,l,f){return o=Gt(o),l=f?e:l,l===e?GI(o)?nL(o):zI(o):o.match(l)||[]}var vb=Ft(function(o,l){try{return mn(o,e,l)}catch(f){return Ef(f)?f:new Ct(f)}}),MU=gi(function(o,l){return yn(l,function(f){f=zn(f),Xn(o,f,Of(o[f],o))}),o});function kU(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 JL(An(o,y))}function Ff(o){return function(){return o}}function CU(o,l){return o==null||o!==o?l:o}var OU=T0(),AU=T0(!0);function dn(o){return o}function Bf(o){return t0(typeof o=="function"?o:An(o,y))}function EU(o){return n0(An(o,y))}function RU(o,l){return i0(o,An(l,y))}var PU=Ft(function(o,l){return function(f){return Yo(f,o,l)}}),IU=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 G=this.__chain__;if(M||G){var K=o(this.__wrapped__),et=K.__actions__=ln(this.__actions__);return et.push({func:z,args:arguments,thisArg:o}),K.__chain__=G,K}return z.apply(o,Yi([this.value()],arguments))})}),o}function LU(){return ce._===this&&(ce._=lL),this}function Uf(){}function NU(o){return o=Lt(o),Ft(function(l){return r0(l,o)})}var FU=mf(ue),BU=mf(M_),zU=mf(Ud);function Sb(o){return Sf(o)?Hd(zn(o)):mN(o)}function UU(o){return function(l){return o==null?e:Dr(o,l)}}var HU=k0(),WU=k0(!0);function Hf(){return[]}function Wf(){return!1}function $U(){return{}}function YU(){return""}function VU(){return!0}function qU(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 jU(o){return Et(o)?ue(o,zn):xn(o)?[o]:ln(W0(Gt(o)))}function GU(o){var l=++oL;return Gt(o)+l}var KU=Zl(function(o,l){return o+l},0),XU=yf("ceil"),ZU=Zl(function(o,l){return o/l},1),QU=yf("floor");function JU(o){return o&&o.length?Yl(o,dn,ef):e}function tH(o,l){return o&&o.length?Yl(o,vt(l,2),ef):e}function eH(o){return C_(o,dn)}function nH(o,l){return C_(o,vt(l,2))}function iH(o){return o&&o.length?Yl(o,dn,of):e}function rH(o,l){return o&&o.length?Yl(o,vt(l,2),of):e}var sH=Zl(function(o,l){return o*l},1),oH=yf("round"),aH=Zl(function(o,l){return o-l},0);function lH(o){return o&&o.length?$d(o,dn):0}function cH(o,l){return o&&o.length?$d(o,vt(l,2)):0}return w.after=RB,w.ary=J0,w.assign=bz,w.assignIn=hb,w.assignInWith=pb,w.assignWith=Pf,w.at=xz,w.before=tb,w.bind=Of,w.bindAll=MU,w.bindKey=eb,w.castArray=YB,w.chain=X0,w.chunk=JN,w.compact=tF,w.concat=eF,w.cond=kU,w.conforms=DU,w.constant=Ff,w.countBy=cB,w.create=wz,w.curry=nb,w.curryRight=ib,w.debounce=rb,w.defaults=vz,w.defaultsDeep=Sz,w.defer=PB,w.delay=IB,w.difference=nF,w.differenceBy=iF,w.differenceWith=rF,w.drop=sF,w.dropRight=oF,w.dropRightWhile=aF,w.dropWhile=lF,w.fill=cF,w.filter=dB,w.flatMap=pB,w.flatMapDeep=gB,w.flatMapDepth=mB,w.flatten=q0,w.flattenDeep=uF,w.flattenDepth=dF,w.flip=LB,w.flow=OU,w.flowRight=AU,w.fromPairs=fF,w.functions=Az,w.functionsIn=Ez,w.groupBy=yB,w.initial=pF,w.intersection=gF,w.intersectionBy=mF,w.intersectionWith=yF,w.invert=Pz,w.invertBy=Iz,w.invokeMap=bB,w.iteratee=Bf,w.keyBy=xB,w.keys=Re,w.keysIn=un,w.map=rc,w.mapKeys=Nz,w.mapValues=Fz,w.matches=EU,w.matchesProperty=RU,w.memoize=oc,w.merge=Bz,w.mergeWith=gb,w.method=PU,w.methodOf=IU,w.mixin=zf,w.negate=ac,w.nthArg=NU,w.omit=zz,w.omitBy=Uz,w.once=NB,w.orderBy=wB,w.over=FU,w.overArgs=FB,w.overEvery=BU,w.overSome=zU,w.partial=Af,w.partialRight=sb,w.partition=vB,w.pick=Hz,w.pickBy=mb,w.property=Sb,w.propertyOf=UU,w.pull=wF,w.pullAll=G0,w.pullAllBy=vF,w.pullAllWith=SF,w.pullAt=TF,w.range=HU,w.rangeRight=WU,w.rearg=BB,w.reject=MB,w.remove=MF,w.rest=zB,w.reverse=Df,w.sampleSize=DB,w.set=$z,w.setWith=Yz,w.shuffle=CB,w.slice=kF,w.sortBy=EB,w.sortedUniq=PF,w.sortedUniqBy=IF,w.split=hU,w.spread=UB,w.tail=LF,w.take=NF,w.takeRight=FF,w.takeRightWhile=BF,w.takeWhile=zF,w.tap=tB,w.throttle=HB,w.thru=ic,w.toArray=ub,w.toPairs=yb,w.toPairsIn=_b,w.toPath=jU,w.toPlainObject=fb,w.transform=Vz,w.unary=WB,w.union=UF,w.unionBy=HF,w.unionWith=WF,w.uniq=$F,w.uniqBy=YF,w.uniqWith=VF,w.unset=qz,w.unzip=Cf,w.unzipWith=K0,w.update=jz,w.updateWith=Gz,w.values=vs,w.valuesIn=Kz,w.without=qF,w.words=wb,w.wrap=$B,w.xor=jF,w.xorBy=GF,w.xorWith=KF,w.zip=XF,w.zipObject=ZF,w.zipObjectDeep=QF,w.zipWith=JF,w.entries=yb,w.entriesIn=_b,w.extend=hb,w.extendWith=pb,zf(w,w),w.add=KU,w.attempt=vb,w.camelCase=Jz,w.capitalize=bb,w.ceil=XU,w.clamp=Xz,w.clone=VB,w.cloneDeep=jB,w.cloneDeepWith=GB,w.cloneWith=qB,w.conformsTo=KB,w.deburr=xb,w.defaultTo=CU,w.divide=ZU,w.endsWith=tU,w.eq=Un,w.escape=eU,w.escapeRegExp=nU,w.every=uB,w.find=fB,w.findIndex=Y0,w.findKey=Tz,w.findLast=hB,w.findLastIndex=V0,w.findLastKey=Mz,w.floor=QU,w.forEach=Z0,w.forEachRight=Q0,w.forIn=kz,w.forInRight=Dz,w.forOwn=Cz,w.forOwnRight=Oz,w.get=If,w.gt=XB,w.gte=ZB,w.has=Rz,w.hasIn=Lf,w.head=j0,w.identity=dn,w.includes=_B,w.indexOf=hF,w.inRange=Zz,w.invoke=Lz,w.isArguments=Ar,w.isArray=Et,w.isArrayBuffer=QB,w.isArrayLike=cn,w.isArrayLikeObject=_e,w.isBoolean=JB,w.isBuffer=Zi,w.isDate=tz,w.isElement=ez,w.isEmpty=nz,w.isEqual=iz,w.isEqualWith=rz,w.isError=Ef,w.isFinite=sz,w.isFunction=yi,w.isInteger=ob,w.isLength=lc,w.isMap=ab,w.isMatch=oz,w.isMatchWith=az,w.isNaN=lz,w.isNative=cz,w.isNil=dz,w.isNull=uz,w.isNumber=lb,w.isObject=fe,w.isObjectLike=ge,w.isPlainObject=Xo,w.isRegExp=Rf,w.isSafeInteger=fz,w.isSet=cb,w.isString=cc,w.isSymbol=xn,w.isTypedArray=ws,w.isUndefined=hz,w.isWeakMap=pz,w.isWeakSet=gz,w.join=_F,w.kebabCase=iU,w.last=Rn,w.lastIndexOf=bF,w.lowerCase=rU,w.lowerFirst=sU,w.lt=mz,w.lte=yz,w.max=JU,w.maxBy=tH,w.mean=eH,w.meanBy=nH,w.min=iH,w.minBy=rH,w.stubArray=Hf,w.stubFalse=Wf,w.stubObject=$U,w.stubString=YU,w.stubTrue=VU,w.multiply=sH,w.nth=xF,w.noConflict=LU,w.noop=Uf,w.now=sc,w.pad=oU,w.padEnd=aU,w.padStart=lU,w.parseInt=cU,w.random=Qz,w.reduce=SB,w.reduceRight=TB,w.repeat=uU,w.replace=dU,w.result=Wz,w.round=oH,w.runInContext=F,w.sample=kB,w.size=OB,w.snakeCase=fU,w.some=AB,w.sortedIndex=DF,w.sortedIndexBy=CF,w.sortedIndexOf=OF,w.sortedLastIndex=AF,w.sortedLastIndexBy=EF,w.sortedLastIndexOf=RF,w.startCase=pU,w.startsWith=gU,w.subtract=aH,w.sum=lH,w.sumBy=cH,w.template=mU,w.times=qU,w.toFinite=_i,w.toInteger=Lt,w.toLength=db,w.toLower=yU,w.toNumber=Pn,w.toSafeInteger=_z,w.toString=Gt,w.toUpper=_U,w.trim=bU,w.trimEnd=xU,w.trimStart=wU,w.truncate=vU,w.unescape=SU,w.uniqueId=GU,w.upperCase=TU,w.upperFirst=Nf,w.each=Z0,w.eachRight=Q0,w.first=j0,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:De(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==J;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,G=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 G=="function"&&G.length!=1&&(z=K=!1);var at=this.__chain__,_t=!!this.__actions__.length,St=M&&!at,Nt=z&&!_t;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=TL,Ut.prototype.reverse=ML,Ut.prototype.value=kL,w.prototype.at=eB,w.prototype.chain=nB,w.prototype.commit=iB,w.prototype.next=rB,w.prototype.plant=oB,w.prototype.reverse=aB,w.prototype.toJSON=w.prototype.valueOf=w.prototype.value=lB,w.prototype.first=w.prototype.head,Fo&&(w.prototype[Fo]=sB),w}),hs=iL();Kn?((Kn.exports=hs)._=hs,cs._=hs):ce._=hs}).call(bI)})(xo,xo.exports)),xo.exports}var g_=xI(),rl={exports:{}},wI=rl.exports,m_;function vI(){return m_||(m_=1,(function(n,t){(function(e,i){i()})(wI,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 SI=vI(),sl={exports:{}};var TI=sl.exports,y_;function MI(){return y_||(y_=1,(function(n,t){((e,i)=>{n.exports=i()})(TI,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(k){var O=I(k);O.chunkSize=parseInt(O.chunkSize),k.step||k.chunk||(O.chunkSize=null),this._handle=new v(O),(this._handle.streamer=this)._config=O}).call(this,T),this.parseChunk=function(k,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(k,W)),k=[...k.split(tt).slice(L)].join(tt)}this.isFirstChunk&&N(this._config.beforeFirstChunk)&&(W=this._config.beforeFirstChunk(k))!==void 0&&(k=W),this.isFirstChunk=!1,this._halted=!1;var L=this._partialLine+k,W=(this._partialLine="",this._handle.parse(L,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(k=W.meta.cursor,L=(this._finished||(this._partialLine=L.substring(k-this._baseIndex),this._baseIndex=k),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(k){N(this._config.error)?this._config.error(k):a&&this._config.error&&i.postMessage({workerId:d.WORKER_ID,error:k,finished:!1})}}function g(T){var k;(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(k=new XMLHttpRequest,this._config.withCredentials&&(k.withCredentials=this._config.withCredentials),s||(k.onload=B(this._chunkLoaded,this),k.onerror=B(this._chunkError,this)),k.open(this._config.downloadRequestBody?"POST":"GET",this._input,!s),this._config.downloadRequestHeaders){var O,L=this._config.downloadRequestHeaders;for(O in L)k.setRequestHeader(O,L[O])}var W;this._config.chunkSize&&(W=this._start+this._config.chunkSize-1,k.setRequestHeader("Range","bytes="+this._start+"-"+W));try{k.send(this._config.downloadRequestBody)}catch(tt){this._chunkError(tt.message)}s&&k.status===0&&this._chunkError()}},this._chunkLoaded=function(){k.readyState===4&&(k.status<200||400<=k.status?this._chunkError():(this._start+=this._config.chunkSize||k.responseText.length,this._finished=!this._config.chunkSize||this._start>=(O=>(O=O.getResponseHeader("Content-Range"))!==null?parseInt(O.substring(O.lastIndexOf("/")+1)):-1)(k),this.parseChunk(k.responseText)))},this._chunkError=function(O){O=k.statusText||O,this._sendError(new Error(O))}}function y(T){(T=T||{}).chunkSize||(T.chunkSize=d.LocalChunkSize),h.call(this,T);var k,O,L=typeof FileReader<"u";this.stream=function(W){this._input=W,O=W.slice||W.webkitSlice||W.mozSlice,L?((k=new FileReader).onload=B(this._chunkLoaded,this),k.onerror=B(this._chunkError,this)):k=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)),k.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(k.error)}}function _(T){var k;h.call(this,T=T||{}),this.stream=function(O){return k=O,this._nextChunk()},this._nextChunk=function(){var O,L;if(!this._finished)return O=this._config.chunkSize,k=O?(L=k.substring(0,O),k.substring(O)):(L=k,""),this._finished=!k,this.parseChunk(L)}}function x(T){h.call(this,T=T||{});var k=[],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&&k.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),k.length?this.parseChunk(k.shift()):O=!0},this._streamData=B(function(W){try{k.push(typeof W=="string"?W:W.toString(this._config.encoding)),O&&(O=!1,this._checkIsFinished(),this.parseChunk(k.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 k,O,L,W,tt=Math.pow(2,53),j=-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)))$/,J=this,rt=0,st=0,ot=!1,H=!1,V=[],Z={data:[],errors:[],meta:{}};function pt(ut){return T.skipEmptyLines==="greedy"?ut.join("").trim()==="":ut.length===1&&ut[0].length===0}function ft(){if(Z&&L&&(ht("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+d.DefaultDelimiter+"'"),L=!1),T.skipEmptyLines&&(Z.data=Z.data.filter(function(lt){return!pt(lt)})),it()){let lt=function(It,Bt){N(T.transformHeader)&&(It=T.transformHeader(It,Bt)),V.push(It)};if(Z)if(Array.isArray(Z.data[0])){for(var ut=0;it()&&ut<Z.data.length;ut++)Z.data[ut].forEach(lt);Z.data.splice(0,1)}else Z.data.forEach(lt)}function dt(lt,It){for(var Bt=T.header?{}:[],wt=0;wt<lt.length;wt++){var Dt=wt,kt=lt[wt],kt=((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),j<Vt&&Vt<tt))return 1})(bt)?parseFloat(bt):X.test(bt)?new Date(bt):bt===""?null:bt):bt)(Dt=T.header?wt>=V.length?"__parsed_extra":V[wt]:Dt,kt=T.transform?T.transform(kt,Dt):kt);Dt==="__parsed_extra"?(Bt[Dt]=Bt[Dt]||[],Bt[Dt].push(kt)):Bt[Dt]=kt}return T.header&&(wt>V.length?ht("FieldMismatch","TooManyFields","Too many fields: expected "+V.length+" fields but parsed "+wt,st+It):wt<V.length&&ht("FieldMismatch","TooFewFields","Too few fields: expected "+V.length+" fields but parsed "+wt,st+It)),Bt}var mt;Z&&(T.header||T.dynamicTyping||T.transform)&&(mt=1,!Z.data.length||Array.isArray(Z.data[0])?(Z.data=Z.data.map(dt),mt=Z.data.length):Z.data=dt(Z.data,0),T.header&&Z.meta&&(Z.meta.fields=V),st+=mt)}function it(){return T.header&&V.length===0}function ht(ut,dt,mt,lt){ut={type:ut,code:dt,message:mt},lt!==void 0&&(ut.row=lt),Z.errors.push(ut)}N(T.step)&&(W=T.step,T.step=function(ut){Z=ut,it()?ft():(ft(),Z.data.length!==0&&(rt+=ut.data.length,T.preview&&rt>T.preview?O.abort():(Z.data=Z.data[0],W(Z,J))))}),this.parse=function(ut,dt,mt){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),Z.meta.delimiter=T.delimiter):((lt=((It,Bt,wt,Dt,kt)=>{var ve,bt,Vt,Se;kt=kt||[","," ","|",";",d.RECORD_SEP,d.UNIT_SEP];for(var Ae=0;Ae<kt.length;Ae++){for(var oe,on=kt[Ae],qt=0,Ie=0,ie=0,Te=(Vt=void 0,new C({comments:Dt,delimiter:on,newline:Bt,preview:10}).parse(It)),Ee=0;Ee<Te.data.length;Ee++)wt&&pt(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),Z.meta.delimiter=T.delimiter),I(T));return T.preview&&T.header&<.preview++,k=ut,O=new C(lt),Z=O.parse(k,dt,mt),ft(),ot?{meta:{paused:!0}}:Z||{meta:{paused:!1}}},this.paused=function(){return ot},this.pause=function(){ot=!0,O.abort(),k=N(T.chunk)?"":k.substring(O.getCharIndex())},this.resume=function(){J.streamer._halted?(ot=!1,J.streamer.parseChunk(k,!0)):setTimeout(J.resume,3)},this.aborted=function(){return H},this.abort=function(){H=!0,O.abort(),Z.meta.aborted=!0,N(T.complete)&&T.complete(Z),k=""},this.guessLineEndings=function(It,lt){It=It.substring(0,1048576);var lt=new RegExp(S(lt)+"([^]*?)"+S(lt),"gm"),mt=(It=It.replace(lt,"")).split("\r"),lt=It.split(`
|
|
27
|
-
`),
|
|
28
|
-
`;for(var
|
|
29
|
-
`&&
|
|
30
|
-
`:"\r"}}function
|
|
25
|
+
`)+tt+`return __p
|
|
26
|
+
}`;var Nt=vb(function(){return Yt(M,yt+"return "+tt).apply(e,A)});if(Nt.source=tt,Ef(Nt))throw Nt;return Nt}function yU(o){return Gt(o).toLowerCase()}function _U(o){return Gt(o).toUpperCase()}function bU(o,l,f){if(o=Gt(o),o&&(f||l===e))return A_(o);if(!o||!(l=bn(l)))return o;var m=Fn(o),b=Fn(l),M=E_(m,b),A=R_(m,b)+1;return Xi(m,M,A).join("")}function xU(o,l,f){if(o=Gt(o),o&&(f||l===e))return o.slice(0,I_(o)+1);if(!o||!(l=bn(l)))return o;var m=Fn(o),b=R_(m,Fn(l))+1;return Xi(m,0,b).join("")}function wU(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=E_(m,Fn(l));return Xi(m,b).join("")}function vU(o,l){var f=B,m=$;if(fe(l)){var b="separator"in l?l.separator:b;f="length"in l?It(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,G=z;for(b.global||(b=jd(b.source,Gt(cl.exec(b))+"g")),b.lastIndex=0;j=b.exec(G);)var tt=j.index;z=z.slice(0,tt===e?R:tt)}}else if(o.indexOf(bn(b),R)!=R){var ot=z.lastIndexOf(b);ot>-1&&(z=z.slice(0,ot))}return z+m}function SU(o){return o=Gt(o),o&&sd.test(o)?o.replace(Ui,JI):o}var TU=bs(function(o,l,f){return o+(f?" ":"")+l.toUpperCase()}),Nf=v0("toUpperCase");function wb(o,l,f){return o=Gt(o),l=f?e:l,l===e?GI(o)?nL(o):zI(o):o.match(l)||[]}var vb=Ft(function(o,l){try{return mn(o,e,l)}catch(f){return Ef(f)?f:new Ct(f)}}),MU=gi(function(o,l){return yn(l,function(f){f=zn(f),Xn(o,f,Of(o[f],o))}),o});function kU(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 JL(An(o,y))}function Ff(o){return function(){return o}}function CU(o,l){return o==null||o!==o?l:o}var OU=T0(),AU=T0(!0);function dn(o){return o}function Bf(o){return t0(typeof o=="function"?o:An(o,y))}function EU(o){return n0(An(o,y))}function RU(o,l){return i0(o,An(l,y))}var PU=Ft(function(o,l){return function(f){return Yo(f,o,l)}}),IU=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 G=o(this.__wrapped__),tt=G.__actions__=ln(this.__actions__);return tt.push({func:z,args:arguments,thisArg:o}),G.__chain__=j,G}return z.apply(o,Yi([this.value()],arguments))})}),o}function LU(){return ce._===this&&(ce._=lL),this}function Uf(){}function NU(o){return o=It(o),Ft(function(l){return r0(l,o)})}var FU=mf(ue),BU=mf(M_),zU=mf(Ud);function Sb(o){return Sf(o)?Hd(zn(o)):mN(o)}function UU(o){return function(l){return o==null?e:Dr(o,l)}}var HU=k0(),WU=k0(!0);function Hf(){return[]}function Wf(){return!1}function $U(){return{}}function YU(){return""}function VU(){return!0}function qU(o,l){if(o=It(o),o<1||o>rt)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 jU(o){return Et(o)?ue(o,zn):xn(o)?[o]:ln(W0(Gt(o)))}function GU(o){var l=++oL;return Gt(o)+l}var KU=Zl(function(o,l){return o+l},0),XU=yf("ceil"),ZU=Zl(function(o,l){return o/l},1),QU=yf("floor");function JU(o){return o&&o.length?Yl(o,dn,ef):e}function tH(o,l){return o&&o.length?Yl(o,vt(l,2),ef):e}function eH(o){return C_(o,dn)}function nH(o,l){return C_(o,vt(l,2))}function iH(o){return o&&o.length?Yl(o,dn,of):e}function rH(o,l){return o&&o.length?Yl(o,vt(l,2),of):e}var sH=Zl(function(o,l){return o*l},1),oH=yf("round"),aH=Zl(function(o,l){return o-l},0);function lH(o){return o&&o.length?$d(o,dn):0}function cH(o,l){return o&&o.length?$d(o,vt(l,2)):0}return w.after=RB,w.ary=J0,w.assign=bz,w.assignIn=hb,w.assignInWith=pb,w.assignWith=Pf,w.at=xz,w.before=tb,w.bind=Of,w.bindAll=MU,w.bindKey=eb,w.castArray=YB,w.chain=X0,w.chunk=JN,w.compact=tF,w.concat=eF,w.cond=kU,w.conforms=DU,w.constant=Ff,w.countBy=cB,w.create=wz,w.curry=nb,w.curryRight=ib,w.debounce=rb,w.defaults=vz,w.defaultsDeep=Sz,w.defer=PB,w.delay=IB,w.difference=nF,w.differenceBy=iF,w.differenceWith=rF,w.drop=sF,w.dropRight=oF,w.dropRightWhile=aF,w.dropWhile=lF,w.fill=cF,w.filter=dB,w.flatMap=pB,w.flatMapDeep=gB,w.flatMapDepth=mB,w.flatten=q0,w.flattenDeep=uF,w.flattenDepth=dF,w.flip=LB,w.flow=OU,w.flowRight=AU,w.fromPairs=fF,w.functions=Az,w.functionsIn=Ez,w.groupBy=yB,w.initial=pF,w.intersection=gF,w.intersectionBy=mF,w.intersectionWith=yF,w.invert=Pz,w.invertBy=Iz,w.invokeMap=bB,w.iteratee=Bf,w.keyBy=xB,w.keys=Re,w.keysIn=un,w.map=rc,w.mapKeys=Nz,w.mapValues=Fz,w.matches=EU,w.matchesProperty=RU,w.memoize=oc,w.merge=Bz,w.mergeWith=gb,w.method=PU,w.methodOf=IU,w.mixin=zf,w.negate=ac,w.nthArg=NU,w.omit=zz,w.omitBy=Uz,w.once=NB,w.orderBy=wB,w.over=FU,w.overArgs=FB,w.overEvery=BU,w.overSome=zU,w.partial=Af,w.partialRight=sb,w.partition=vB,w.pick=Hz,w.pickBy=mb,w.property=Sb,w.propertyOf=UU,w.pull=wF,w.pullAll=G0,w.pullAllBy=vF,w.pullAllWith=SF,w.pullAt=TF,w.range=HU,w.rangeRight=WU,w.rearg=BB,w.reject=MB,w.remove=MF,w.rest=zB,w.reverse=Df,w.sampleSize=DB,w.set=$z,w.setWith=Yz,w.shuffle=CB,w.slice=kF,w.sortBy=EB,w.sortedUniq=PF,w.sortedUniqBy=IF,w.split=hU,w.spread=UB,w.tail=LF,w.take=NF,w.takeRight=FF,w.takeRightWhile=BF,w.takeWhile=zF,w.tap=tB,w.throttle=HB,w.thru=ic,w.toArray=ub,w.toPairs=yb,w.toPairsIn=_b,w.toPath=jU,w.toPlainObject=fb,w.transform=Vz,w.unary=WB,w.union=UF,w.unionBy=HF,w.unionWith=WF,w.uniq=$F,w.uniqBy=YF,w.uniqWith=VF,w.unset=qz,w.unzip=Cf,w.unzipWith=K0,w.update=jz,w.updateWith=Gz,w.values=vs,w.valuesIn=Kz,w.without=qF,w.words=wb,w.wrap=$B,w.xor=jF,w.xorBy=GF,w.xorWith=KF,w.zip=XF,w.zipObject=ZF,w.zipObjectDeep=QF,w.zipWith=JF,w.entries=yb,w.entriesIn=_b,w.extend=hb,w.extendWith=pb,zf(w,w),w.add=KU,w.attempt=vb,w.camelCase=Jz,w.capitalize=bb,w.ceil=XU,w.clamp=Xz,w.clone=VB,w.cloneDeep=jB,w.cloneDeepWith=GB,w.cloneWith=qB,w.conformsTo=KB,w.deburr=xb,w.defaultTo=CU,w.divide=ZU,w.endsWith=tU,w.eq=Un,w.escape=eU,w.escapeRegExp=nU,w.every=uB,w.find=fB,w.findIndex=Y0,w.findKey=Tz,w.findLast=hB,w.findLastIndex=V0,w.findLastKey=Mz,w.floor=QU,w.forEach=Z0,w.forEachRight=Q0,w.forIn=kz,w.forInRight=Dz,w.forOwn=Cz,w.forOwnRight=Oz,w.get=If,w.gt=XB,w.gte=ZB,w.has=Rz,w.hasIn=Lf,w.head=j0,w.identity=dn,w.includes=_B,w.indexOf=hF,w.inRange=Zz,w.invoke=Lz,w.isArguments=Ar,w.isArray=Et,w.isArrayBuffer=QB,w.isArrayLike=cn,w.isArrayLikeObject=_e,w.isBoolean=JB,w.isBuffer=Zi,w.isDate=tz,w.isElement=ez,w.isEmpty=nz,w.isEqual=iz,w.isEqualWith=rz,w.isError=Ef,w.isFinite=sz,w.isFunction=yi,w.isInteger=ob,w.isLength=lc,w.isMap=ab,w.isMatch=oz,w.isMatchWith=az,w.isNaN=lz,w.isNative=cz,w.isNil=dz,w.isNull=uz,w.isNumber=lb,w.isObject=fe,w.isObjectLike=ge,w.isPlainObject=Xo,w.isRegExp=Rf,w.isSafeInteger=fz,w.isSet=cb,w.isString=cc,w.isSymbol=xn,w.isTypedArray=ws,w.isUndefined=hz,w.isWeakMap=pz,w.isWeakSet=gz,w.join=_F,w.kebabCase=iU,w.last=Rn,w.lastIndexOf=bF,w.lowerCase=rU,w.lowerFirst=sU,w.lt=mz,w.lte=yz,w.max=JU,w.maxBy=tH,w.mean=eH,w.meanBy=nH,w.min=iH,w.minBy=rH,w.stubArray=Hf,w.stubFalse=Wf,w.stubObject=$U,w.stubString=YU,w.stubTrue=VU,w.multiply=sH,w.nth=xF,w.noConflict=LU,w.noop=Uf,w.now=sc,w.pad=oU,w.padEnd=aU,w.padStart=lU,w.parseInt=cU,w.random=Qz,w.reduce=SB,w.reduceRight=TB,w.repeat=uU,w.replace=dU,w.result=Wz,w.round=oH,w.runInContext=L,w.sample=kB,w.size=OB,w.snakeCase=fU,w.some=AB,w.sortedIndex=DF,w.sortedIndexBy=CF,w.sortedIndexOf=OF,w.sortedLastIndex=AF,w.sortedLastIndexBy=EF,w.sortedLastIndexOf=RF,w.startCase=pU,w.startsWith=gU,w.subtract=aH,w.sum=lH,w.sumBy=cH,w.template=mU,w.times=qU,w.toFinite=_i,w.toInteger=It,w.toLength=db,w.toLower=yU,w.toNumber=Pn,w.toSafeInteger=_z,w.toString=Gt,w.toUpper=_U,w.trim=bU,w.trimEnd=xU,w.trimStart=wU,w.truncate=vU,w.unescape=SU,w.uniqueId=GU,w.upperCase=TU,w.upperFirst=Nf,w.each=Z0,w.eachRight=Q0,w.first=j0,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(It(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==it;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=It(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=It(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],G=z||Et(A),tt=function(Bt){var Ht=b.apply(w,Yi([Bt],R));return m&&ot?Ht[0]:Ht};G&&f&&typeof j=="function"&&j.length!=1&&(z=G=!1);var ot=this.__chain__,yt=!!this.__actions__.length,St=M&&!ot,Nt=z&&!yt;if(!M&&G){A=Nt?A:new Ut(this);var xt=o.apply(A,R);return xt.__actions__.push({func:ic,args:[tt],thisArg:e}),new On(xt,ot)}return St&&Nt?o.apply(this,R):(xt=this.thru(tt),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=TL,Ut.prototype.reverse=ML,Ut.prototype.value=kL,w.prototype.at=eB,w.prototype.chain=nB,w.prototype.commit=iB,w.prototype.next=rB,w.prototype.plant=oB,w.prototype.reverse=aB,w.prototype.toJSON=w.prototype.valueOf=w.prototype.value=lB,w.prototype.first=w.prototype.head,Fo&&(w.prototype[Fo]=sB),w}),hs=iL();Kn?((Kn.exports=hs)._=hs,cs._=hs):ce._=hs}).call(bI)})(xo,xo.exports)),xo.exports}var g_=xI(),rl={exports:{}},wI=rl.exports,m_;function vI(){return m_||(m_=1,(function(n,t){(function(e,i){i()})(wI,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 T=new FileReader;T.onloadend=function(){var U=T.result;U=v?U:U.replace(/^data:[^;]*;/,"data:attachment/file;"),y?y.location.href=U:location=U,y=null},T.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 SI=vI(),sl={exports:{}};var TI=sl.exports,y_;function MI(){return y_||(y_=1,(function(n,t){((e,i)=>{n.exports=i()})(TI,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},r=!i.document&&!!i.postMessage,s=i.IS_PAPA_WORKER||!1,a={},c=0,u={};function d(k){return k.charCodeAt(0)===65279?k.slice(1):k}function h(k){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(S){var O=I(S);O.chunkSize=parseInt(O.chunkSize),S.step||S.chunk||(O.chunkSize=null),this._handle=new v(O),(this._handle.streamer=this)._config=O}).call(this,k),this.parseChunk=function(S,O){var B=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<B){let et=this._config.newline;et||($=this._config.quoteChar||'"',et=this._handle.guessLineEndings(S,$)),S=[...S.split(et).slice(B)].join(et)}this.isFirstChunk&&F(this._config.beforeFirstChunk)&&($=this._config.beforeFirstChunk(S))!==void 0&&(S=$),this.isFirstChunk=!1,this._halted=!1;var B=this._partialLine+S,$=(this._partialLine="",this._handle.parse(B,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(S=$.meta.cursor,B=(this._finished||(this._partialLine=B.substring(S-this._baseIndex),this._baseIndex=S),$&&$.data&&(this._rowCount+=$.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),s)i.postMessage({results:$,workerId:u.WORKER_ID,finished:B});else if(F(this._config.chunk)&&!O){if(this._config.chunk($,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=$=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat($.data),this._completeResults.errors=this._completeResults.errors.concat($.errors),this._completeResults.meta=$.meta),this._completed||!B||!F(this._config.complete)||$&&$.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),B||$&&$.meta.paused||this._nextChunk(),$}this._halted=!0},this._sendError=function(S){F(this._config.error)?this._config.error(S):s&&this._config.error&&i.postMessage({workerId:u.WORKER_ID,error:S,finished:!1})}}function g(k){var S;(k=k||{}).chunkSize||(k.chunkSize=u.RemoteChunkSize),h.call(this,k),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(O){this._input=O,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(S=new XMLHttpRequest,this._config.withCredentials&&(S.withCredentials=this._config.withCredentials),r||(S.onload=N(this._chunkLoaded,this),S.onerror=N(this._chunkError,this)),S.ontimeout=N(this._chunkTimeout,this),S.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadTimeout&&!r&&(S.timeout=this._config.downloadTimeout),this._config.downloadRequestHeaders){var O,B=this._config.downloadRequestHeaders;for(O in B)S.setRequestHeader(O,B[O])}var $;this._config.chunkSize&&($=this._start+this._config.chunkSize-1,S.setRequestHeader("Range","bytes="+this._start+"-"+$));try{S.send(this._config.downloadRequestBody)}catch(et){this._chunkError(et.message)}r&&S.status===0&&this._chunkError()}},this._chunkLoaded=function(){S.readyState===4&&(S.status<200||400<=S.status?this._chunkError():(this._start+=this._config.chunkSize||S.responseText.length,this._finished=!this._config.chunkSize||this._start>=(O=>(O=O.getResponseHeader("Content-Range"))!==null?parseInt(O.substring(O.lastIndexOf("/")+1)):-1)(S),this.parseChunk(S.responseText)))},this._chunkError=function(O){O=S.statusText||O,this._sendError(new Error(O))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function y(k){(k=k||{}).chunkSize||(k.chunkSize=u.LocalChunkSize),h.call(this,k);var S,O,B=typeof FileReader<"u";this.stream=function($){this._input=$,O=$.slice||$.webkitSlice||$.mozSlice,B?((S=new FileReader).onload=N(this._chunkLoaded,this),S.onerror=N(this._chunkError,this)):S=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var $=this._input,et=(this._config.chunkSize&&(et=Math.min(this._start+this._config.chunkSize,this._input.size),$=O.call($,this._start,et)),S.readAsText($,this._config.encoding));B||this._chunkLoaded({target:{result:et}})},this._chunkLoaded=function($){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk($.target.result)},this._chunkError=function(){this._sendError(S.error)}}function _(k){var S;h.call(this,k=k||{}),this.stream=function(O){return S=O,this._nextChunk()},this._nextChunk=function(){var O,B;if(!this._finished)return O=this._config.chunkSize,S=O?(B=S.substring(0,O),S.substring(O)):(B=S,""),this._finished=!S,this.parseChunk(B)}}function x(k){h.call(this,k=k||{});var S=[],O=!0,B=!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($){this._input=$,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){B&&S.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),S.length?this.parseChunk(S.shift()):O=!0},this._streamData=N(function($){try{S.push(typeof $=="string"?$:$.toString(this._config.encoding)),O&&(O=!1,this._checkIsFinished(),this.parseChunk(S.shift()))}catch(et){this._streamError(et)}},this),this._streamError=N(function($){this._streamCleanUp(),this._sendError($)},this),this._streamEnd=N(function(){this._streamCleanUp(),B=!0,this._streamData("")},this),this._streamCleanUp=N(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function v(k){var S,O,B,$,et=Math.pow(2,53),K=-et,nt=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,Q=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,it=this,st=0,rt=0,at=!1,H=!1,V=[],X={data:[],errors:[],meta:{}};function _t(ft){return k.skipEmptyLines==="greedy"?ft.join("").trim()==="":ft.length===1&&ft[0].length===0}function ut(){if(X&&B&&(ht("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),B=!1),k.skipEmptyLines&&(X.data=X.data.filter(function(ct){return!_t(ct)})),J()){let ct=function(Lt){V.push(Lt)};if(X)if(Array.isArray(X.data[0])){for(var ft=0;J()&&ft<X.data.length;ft++)X.data[ft].forEach(ct);X.data.splice(0,1)}else X.data.forEach(ct)}function lt(ct,Lt){for(var zt=k.header?{}:[],wt=0;wt<ct.length;wt++){var Dt=wt,kt=ct[wt],kt=((ve,bt)=>(qt=>(k.dynamicTypingFunction&&k.dynamicTyping[qt]===void 0&&(k.dynamicTyping[qt]=k.dynamicTypingFunction(qt)),(k.dynamicTyping[qt]||k.dynamicTyping)===!0))(ve)?bt==="true"||bt==="TRUE"||bt!=="false"&&bt!=="FALSE"&&((qt=>{if(nt.test(qt)&&(qt=parseFloat(qt),K<qt&&qt<et))return 1})(bt)?parseFloat(bt):Q.test(bt)?new Date(bt):bt===""?null:bt):bt)(Dt=k.header?wt>=V.length?"__parsed_extra":V[wt]:Dt,kt=k.transform?k.transform(kt,Dt):kt);Dt==="__parsed_extra"?(zt[Dt]=zt[Dt]||[],zt[Dt].push(kt)):zt[Dt]=kt}return k.header&&(wt>V.length?ht("FieldMismatch","TooManyFields","Too many fields: expected "+V.length+" fields but parsed "+wt,rt+Lt):wt<V.length&&ht("FieldMismatch","TooFewFields","Too few fields: expected "+V.length+" fields but parsed "+wt,rt+Lt)),zt}var gt;X&&(k.header||k.dynamicTyping||k.transform)&&(gt=1,!X.data.length||Array.isArray(X.data[0])?(X.data=X.data.map(lt),gt=X.data.length):X.data=lt(X.data,0),k.header&&X.meta&&(X.meta.fields=V),rt+=gt)}function J(){return k.header&&V.length===0}function ht(ft,lt,gt,ct){ft={type:ft,code:lt,message:gt},ct!==void 0&&(ft.row=ct),X.errors.push(ft)}F(k.step)&&($=k.step,k.step=function(ft){X=ft,J()?ut():(ut(),X.data.length!==0&&(st+=ft.data.length,k.preview&&st>k.preview?O.abort():(X.data=X.data[0],$(X,it))))}),this.parse=function(ft,lt,gt){var ct=k.quoteChar||'"',ct=(k.newline||(k.newline=this.guessLineEndings(ft,ct)),B=!1,k.delimiter?F(k.delimiter)&&(k.delimiter=k.delimiter(ft),X.meta.delimiter=k.delimiter):((ct=((Lt,zt,wt,Dt,kt)=>{var ve,bt,qt,Oe;kt=kt||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var Ae=0;Ae<kt.length;Ae++){for(var oe,on=kt[Ae],$t=0,Ie=0,ie=0,Se=(qt=void 0,new C({comments:Dt,delimiter:on,newline:zt,preview:10}).parse(Lt)),Ee=0;Ee<Se.data.length;Ee++)wt&&_t(Se.data[Ee])?ie++:(oe=Se.data[Ee].length,Ie+=oe,qt===void 0?qt=oe:0<oe&&($t+=Math.abs(oe-qt),qt=oe));0<Se.data.length&&(Ie/=Se.data.length-ie),1.99<Ie&&(bt===void 0||$t<bt||$t===bt&&Oe<Ie)&&(bt=$t,ve=on,Oe=Ie)}return{successful:!!(k.delimiter=ve),bestDelimiter:ve}})(ft,k.newline,k.skipEmptyLines,k.comments,k.delimitersToGuess)).successful?k.delimiter=ct.bestDelimiter:(B=!0,k.delimiter=u.DefaultDelimiter),X.meta.delimiter=k.delimiter),I(k));return ct.header=J(),k.preview&&k.header&&ct.preview++,S=ft,O=new C(ct),X=O.parse(S,lt,gt),ut(),at?{meta:{paused:!0}}:X||{meta:{paused:!1}}},this.paused=function(){return at},this.pause=function(){at=!0,O.abort(),S=F(k.chunk)?"":S.substring(O.getCharIndex())},this.resume=function(){it.streamer._halted?(at=!1,it.streamer.parseChunk(S,!0)):setTimeout(it.resume,3)},this.aborted=function(){return H},this.abort=function(){H=!0,O.abort(),X.meta.aborted=!0,F(k.complete)&&k.complete(X),S=""},this.guessLineEndings=function(Lt,ct){Lt=Lt.substring(0,1048576);var ct=new RegExp(T(ct)+"([^]*?)"+T(ct),"gm"),gt=(Lt=Lt.replace(ct,"")).split("\r"),ct=Lt.split(`
|
|
27
|
+
`),Lt=1<ct.length&&ct[0].length<gt[0].length;if(gt.length===1||Lt)return`
|
|
28
|
+
`;for(var zt=0,wt=0;wt<gt.length;wt++)gt[wt][0]===`
|
|
29
|
+
`&&zt++;return zt>=gt.length/2?`\r
|
|
30
|
+
`:"\r"}}function T(k){return k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function C(k){var S=(k=k||{}).delimiter,O=k.newline,B=k.comments,$=k.step,et=k.preview,K=k.fastMode,nt=null,Q=!1,it=k.quoteChar==null?'"':k.quoteChar,st=it;if(k.escapeChar!==void 0&&(st=k.escapeChar),(typeof S!="string"||-1<u.BAD_DELIMITERS.indexOf(S))&&(S=","),B===S)throw new Error("Comment character same as delimiter");B===!0?B="#":(typeof B!="string"||-1<u.BAD_DELIMITERS.indexOf(B))&&(B=!1),O!==`
|
|
31
31
|
`&&O!=="\r"&&O!==`\r
|
|
32
32
|
`&&(O=`
|
|
33
|
-
`);var
|
|
34
|
-
`,
|
|
35
|
-
`,'"',
|
|
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});SI.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))}}),OI=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(CI,{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"])]))}}),AI={class:"kong-ui-public-csv-export-modal"},EI={key:0,class:"selected-range"},RI={key:4,class:"text-muted",tag:"span"},__=3,PI=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(__,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),
|
|
33
|
+
`);var rt=0,at=!1;this.parse=function(H,V,X){if(typeof H!="string")throw new Error("Input must be a string");var _t=H.length,ut=S.length,J=O.length,ht=B.length,ft=F($),lt=[],gt=[],ct=[],Lt=rt=0;if(!H)return $t();if(K||K!==!1&&H.indexOf(it)===-1){for(var zt=H.split(O),wt=0;wt<zt.length;wt++){if(ct=zt[wt],rt+=ct.length,wt!==zt.length-1)rt+=O.length;else if(X)return $t();if(!B||ct.substring(0,ht)!==B){if(ft){if(lt=[],Oe(ct.split(S)),Ie(),at)return $t()}else Oe(ct.split(S));if(et&&et<=wt)return lt=lt.slice(0,et),$t(!0)}}return $t()}for(var Dt=H.indexOf(S,rt),kt=H.indexOf(O,rt),ve=new RegExp(T(st)+T(it),"g"),bt=H.indexOf(it,rt);;)if(H[rt]===it)for(bt=rt,rt++;;){if((bt=H.indexOf(it,bt+1))===-1)return X||gt.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:lt.length,index:rt}),oe();if(bt===_t-1)return oe(H.substring(rt,bt).replace(ve,it));if(it===st&&H[bt+1]===st)bt++;else if(it===st||bt===0||H[bt-1]!==st){Dt!==-1&&Dt<bt+1&&(Dt=H.indexOf(S,bt+1));var qt=Ae((kt=kt!==-1&&kt<bt+1?H.indexOf(O,bt+1):kt)===-1?Dt:Math.min(Dt,kt));if(H.substr(bt+1+qt,ut)===S){ct.push(H.substring(rt,bt).replace(ve,it)),H[rt=bt+1+qt+ut]!==it&&(bt=H.indexOf(it,rt)),Dt=H.indexOf(S,rt),kt=H.indexOf(O,rt);break}if(qt=Ae(kt),H.substring(bt+1+qt,bt+1+qt+J)===O){if(ct.push(H.substring(rt,bt).replace(ve,it)),on(bt+1+qt+J),Dt=H.indexOf(S,rt),bt=H.indexOf(it,rt),ft&&(Ie(),at))return $t();if(et&<.length>=et)return $t(!0);break}gt.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:lt.length,index:rt}),bt++}}else if(B&&ct.length===0&&H.substring(rt,rt+ht)===B){if(kt===-1)return $t();rt=kt+J,kt=H.indexOf(O,rt),Dt=H.indexOf(S,rt)}else if(Dt!==-1&&(Dt<kt||kt===-1))ct.push(H.substring(rt,Dt)),rt=Dt+ut,Dt=H.indexOf(S,rt);else{if(kt===-1)break;if(ct.push(H.substring(rt,kt)),on(kt+J),ft&&(Ie(),at))return $t();if(et&<.length>=et)return $t(!0)}return oe();function Oe(ie){lt.push(ie),Lt=rt}function Ae(ie){var Se=0;return Se=ie!==-1&&(ie=H.substring(bt+1,ie))&&ie.trim()===""?ie.length:Se}function oe(ie){return X||(ie===void 0&&(ie=H.substring(rt)),ct.push(ie),rt=_t,Oe(ct),ft&&Ie()),$t()}function on(ie){rt=ie,Oe(ct),ct=[],kt=H.indexOf(O,rt)}function $t(ie){if(k.header&&!V&<.length&&!Q){var Se=lt[0],Ee=Object.create(null),gn=new Set(Se);let zi=!1;for(let Dn=0;Dn<Se.length;Dn++){let $e=d(Se[Dn]);if(Ee[$e=F(k.transformHeader)?k.transformHeader($e,Dn):$e]){let In,li=Ee[$e];for(;In=$e+"_"+li,li++,gn.has(In););gn.add(In),Se[Dn]=In,Ee[$e]++,zi=!0,(nt=nt===null?{}:nt)[In]=$e}else Ee[$e]=1,Se[Dn]=$e;gn.add($e)}zi&&console.warn("Duplicate headers found and renamed."),Q=!0}return{data:lt,errors:gt,meta:{delimiter:S,linebreak:O,aborted:at,truncated:!!ie,cursor:Lt+(V||0),renamedHeaders:nt}}}function Ie(){$($t()),lt=[],gt=[]}},this.abort=function(){at=!0},this.getCharIndex=function(){return rt}}function E(k){var S=k.data,O=a[S.workerId],B=!1;if(S.error)O.userError(S.error,S.file);else if(S.results&&S.results.data){var $={abort:function(){B=!0,U(S.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:P,resume:P};if(F(O.userStep)){for(var et=0;et<S.results.data.length&&(O.userStep({data:S.results.data[et],errors:S.results.errors,meta:S.results.meta},$),!B);et++);delete S.results}else F(O.userChunk)&&(O.userChunk(S.results,$,S.file),delete S.results)}S.finished&&!B&&U(S.workerId,S.results)}function U(k,S){var O=a[k];F(O.userComplete)&&O.userComplete(S),O.terminate(),delete a[k]}function P(){throw new Error("Not implemented.")}function I(k){if(typeof k!="object"||k===null)return k;var S,O=Array.isArray(k)?[]:{};for(S in k)O[S]=I(k[S]);return O}function N(k,S){return function(){k.apply(S,arguments)}}function F(k){return typeof k=="function"}return u.parse=function(k,S){var O=(S=S||{}).dynamicTyping||!1;if(F(O)&&(S.dynamicTypingFunction=O,O={}),S.dynamicTyping=O,S.transform=!!F(S.transform)&&S.transform,S.downloadTimeout!==void 0){var O=parseInt(S.downloadTimeout);if(isNaN(O))throw new Error("Config downloadTimeout value ("+S.downloadTimeout+") not parsable by parseInt(val).");S.downloadTimeout=O}if(!S.worker||!u.WORKERS_SUPPORTED)return O=null,u.NODE_STREAM_INPUT,typeof k=="string"?(k=d(k),O=new(S.download?g:_)(S)):k.readable===!0&&F(k.read)&&F(k.on)?O=new x(S):(i.File&&k instanceof File||k instanceof Object)&&(O=new y(S)),O.stream(k);(O=(()=>{var B;return!!u.WORKERS_SUPPORTED&&(B=(()=>{var $=i.URL||i.webkitURL||null,et=e.toString();return u.BLOB_URL||(u.BLOB_URL=$.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; ","(",et,")();"],{type:"text/javascript"})))})(),(B=new i.Worker(B)).onmessage=E,B.id=c++,a[B.id]=B)})()).userStep=S.step,O.userChunk=S.chunk,O.userComplete=S.complete,O.userError=S.error,S.step=F(S.step),S.chunk=F(S.chunk),S.complete=F(S.complete),S.error=F(S.error),delete S.worker,O.postMessage({input:k,config:S,workerId:O.id})},u.unparse=function(k,S){var O=!1,B=!0,$=",",et=`\r
|
|
34
|
+
`,K='"',nt=K+K,Q=!1,it=null,st=!1,rt=((()=>{if(typeof S=="object"){if(typeof S.delimiter!="string"||u.BAD_DELIMITERS.filter(function(V){return S.delimiter.indexOf(V)!==-1}).length||($=S.delimiter),typeof S.quotes!="boolean"&&typeof S.quotes!="function"&&!Array.isArray(S.quotes)||(O=S.quotes),typeof S.skipEmptyLines!="boolean"&&typeof S.skipEmptyLines!="string"||(Q=S.skipEmptyLines),typeof S.newline=="string"&&(et=S.newline),typeof S.quoteChar=="string"&&(K=S.quoteChar,nt=K+K),typeof S.header=="boolean"&&(B=S.header),Array.isArray(S.columns)){if(S.columns.length===0)throw new Error("Option columns is empty");it=S.columns}S.escapeChar!==void 0&&(nt=S.escapeChar+K),S.escapeFormulae instanceof RegExp?st=S.escapeFormulae:typeof S.escapeFormulae=="boolean"&&S.escapeFormulae&&(st=/^[=+\-@\t\r].*$/)}})(),new RegExp(T(K),"g"));if(typeof k=="string"&&(k=JSON.parse(k)),Array.isArray(k)){if(!k.length||Array.isArray(k[0]))return at(null,k,Q);if(typeof k[0]=="object")return at(it||Object.keys(k[0]),k,Q)}else if(typeof k=="object")return typeof k.data=="string"&&(k.data=JSON.parse(k.data)),Array.isArray(k.data)&&(k.fields||(k.fields=k.meta&&k.meta.fields||it),k.fields||(k.fields=Array.isArray(k.data[0])?k.fields:typeof k.data[0]=="object"?Object.keys(k.data[0]):[]),Array.isArray(k.data[0])||typeof k.data[0]=="object"||(k.data=[k.data])),at(k.fields||[],k.data||[],Q);throw new Error("Unable to serialize unrecognized input");function at(V,X,_t){var ut="",J=(typeof V=="string"&&(V=JSON.parse(V)),typeof X=="string"&&(X=JSON.parse(X)),Array.isArray(V)&&0<V.length),ht=!Array.isArray(X[0]);if(J&&B){for(var ft=0;ft<V.length;ft++)0<ft&&(ut+=$),ut+=H(V[ft],ft);0<X.length&&(ut+=et)}for(var lt=0;lt<X.length;lt++){var gt=(J?V:X[lt]).length,ct=!1,Lt=J?Object.keys(X[lt]).length===0:X[lt].length===0;if(_t&&!J&&(ct=_t==="greedy"?X[lt].join("").trim()==="":X[lt].length===1&&X[lt][0].length===0),_t==="greedy"&&J){for(var zt=[],wt=0;wt<gt;wt++){var Dt=ht?V[wt]:wt;zt.push(X[lt][Dt])}ct=zt.join("").trim()===""}if(!ct){for(var kt=0;kt<gt;kt++){0<kt&&!Lt&&(ut+=$);var ve=J&&ht?V[kt]:kt;ut+=H(X[lt][ve],kt)}lt<X.length-1&&(!_t||0<gt&&!Lt)&&(ut+=et)}}return ut}function H(V,X){var _t,ut,J;return V==null?"":V.constructor===Date?isNaN(V.getTime())?"":V.toISOString():(J=!1,st&&typeof V=="string"&&st.test(V)&&(V="'"+V,J=!0),ut=(_t=V.toString()).replace(rt,nt),(J=J||O===!0||typeof O=="function"&&O(V,X)||Array.isArray(O)&&O[X]||((ht,ft)=>{for(var lt=0;lt<ft.length;lt++)if(-1<ht.indexOf(ft[lt]))return!0;return!1})(ut,u.BAD_DELIMITERS)||-1<ut.indexOf($)||-1<_t.indexOf(K)||ut.charAt(0)===" "||ut.charAt(ut.length-1)===" ")?K+ut+K:ut)}},u.RECORD_SEP="",u.UNIT_SEP="",u.BYTE_ORDER_MARK="\uFEFF",u.BAD_DELIMITERS=["\r",`
|
|
35
|
+
`,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!r&&!!i.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=C,u.ParserHandle=v,u.NetworkStreamer=g,u.FileStreamer=y,u.StringStreamer=_,u.ReadableStreamStreamer=x,s&&(i.onmessage=function(k){k=k.data,u.WORKER_ID===void 0&&k&&(u.WORKER_ID=k.workerId),typeof k.input=="string"?i.postMessage({workerId:u.WORKER_ID,results:u.parse(k.input,k.config),finished:!0}):(i.File&&k.input instanceof File||k.input instanceof Object)&&(k=u.parse(k.input,k.config))&&i.postMessage({workerId:u.WORKER_ID,results:k,finished:!0})}),(g.prototype=Object.create(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,u})})(sl)),sl.exports}var kI=MI();const DI=["id"],CI=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=>g_.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=>g_.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=kI.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});SI.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))}}),OI=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(CI,{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"])]))}}),AI={class:"kong-ui-public-csv-export-modal"},EI={key:0,class:"selected-range"},RI={key:4,class:"text-muted",tag:"span"},__=3,PI=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(__,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),T=x.data.map(I=>{const N=new Date(I.timestamp);return{...Object.keys(I.event).reduce((k,S)=>{if(S in x.meta.display){const O=I.event[S],B=x.meta.display[S];k[S]=O&&B&&B[O].name||I.event[S]}else k[S]=I.event[S];return k},{}),...v?{timestamp:Iu(N,"yyyy-MM-dd HH:mm:ss"),tzOffset:Iu(N,"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,N)=>(I[N.key]=N.label,I),{});return{headers:U,csvHeaders:P,rows:T}}),_=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,__)}};return p.watch(y,()=>{a.value++}),(x,v)=>{const T=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",AI,[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",EI,[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(T,{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",RI,[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(vk)})},{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(OI,{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=H2,Jt.ChartLegendPosition=sn,Jt.CsvExportModal=PI,Jt.DECIMAL_DISPLAY=WC,Jt.FONT_SIZE_REGULAR=Rm,Jt.FONT_SIZE_SMALL=Em,Jt.MAX_LABEL_LENGTH=$a,Jt.SimpleChart=iI,Jt.SparklineChart=_I,Jt.TopNTable=pI,Jt.ValidType=_r,Jt.chartTypes=C2,Jt.handleQueryError=uE,Jt.isCancellationError=Jm,Jt.lookupStatusCodeColor=Fm,Jt.simpleChartMetricDisplay=D2,Jt.simpleChartTypes=O2,Jt.statusCodeBadgeBackgroundColor=bA,Object.defineProperty(Jt,Symbol.toStringTag,{value:"Module"})}));
|