@kong-ui-public/analytics-utilities 13.0.1 → 13.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- export declare const reportChartTypes: readonly ["horizontal_bar", "vertical_bar", "timeseries_line", "choropleth_map", "timeseries_bar", "donut", "single_value", "top_n", "table", "scatter"];
1
+ export declare const reportChartTypes: readonly ["horizontal_bar", "vertical_bar", "timeseries_line", "choropleth_map", "timeseries_bar", "donut", "single_value", "top_n", "table", "scatter", "heatmap", "treemap"];
2
2
  export type ReportChartTypes = typeof reportChartTypes[number];
3
3
  //# sourceMappingURL=chart-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chart-types.d.ts","sourceRoot":"","sources":["../../../src/types/chart-types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,0JAWnB,CAAA;AAEV,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAA"}
1
+ {"version":3,"file":"chart-types.d.ts","sourceRoot":"","sources":["../../../src/types/chart-types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,gLAanB,CAAA;AAEV,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAA"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ce="kapture:prepare",Ie="kapture:restore";async function Ei(){const e=[];window.dispatchEvent(new CustomEvent(Ce,{detail:{waitUntil:t=>e.push(t)}})),await Promise.allSettled(e)}function Oi(){window.dispatchEvent(new CustomEvent(Ie))}function Gn(e){let t;const n=()=>{t?.(),t=void 0},r=i=>{i.detail?.waitUntil((async()=>{t=await e()})())};return window.addEventListener(Ce,r),window.addEventListener(Ie,n),()=>{window.removeEventListener(Ce,r),window.removeEventListener(Ie,n),n()}}function vi(e,t={}){return Gn(async()=>{const n=e();if(!n)return;t.redraw?.();const r=new Image;return r.src=n.toDataURL("image/png"),await r.decode(),r.style.cssText=`position:absolute;top:0;left:0;width:${n.clientWidth}px;height:${n.clientHeight}px;`,n.parentElement?.appendChild(r),n.style.visibility="hidden",()=>{r.remove(),n.style.visibility=""}})}const Ri=30*1e3,Pi=1e3,xi="analytics-query-provider";var d=(e=>(e.FIFTEEN_MIN="15m",e.ONE_HOUR="1h",e.SIX_HOUR="6h",e.TWELVE_HOUR="12h",e.ONE_DAY="24h",e.SEVEN_DAY="7d",e.THIRTY_DAY="30d",e.NINETY_DAY="90d",e.ONE_HUNDRED_EIGHTY_DAY="180d",e.ONE_YEAR="365d",e.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.CURRENT_YEAR="current_year",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e.PREVIOUS_YEAR="previous_year",e))(d||{});const Ni=["90d","180d","365d","current_quarter","previous_quarter","current_year","previous_year"],Ci=["horizontal_bar","vertical_bar","timeseries_line","choropleth_map","timeseries_bar","donut","single_value","top_n","table","scatter"],Yn=["in","not_in","selector"],Ii=["=","!="],Ai=["=","!=","<",">","<=",">="],qn=["empty","not_empty"],ki=["starts_with","ends_with"],Gi=["absolute","relative"],Yi=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],dt=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Q=e=>e.filter(t=>t!=="time"),Ye=["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"],he=Q(Ye),mt=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],qe=[...Ye,"ai_gateway","ai_gateway_consumer","ai_gateway_consumer_group","ai_gateway_data_plane_node","application","bot_info_action","bot_info_detection_reason","bot_info_ban_type","cache_status","consumer","consumer_group","country_code","oidc_credential","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm","portal_api","principal"],ye=Q(qe),ft=[...mt,"share_of_requests","cache_hit_rate","response_latency_p99","response_latency_p95","response_latency_p50","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","kong_internal_latency_p99","kong_internal_latency_p95","kong_internal_latency_p50","kong_internal_latency_average","response_size_p99","response_size_p95","response_size_p50","response_size_average","response_size_sum","request_size_p99","request_size_p95","request_size_p50","request_size_average","request_size_sum"],pt=["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","upstream_status_code","upstream_status_code_grouped","response_source"],ge=Q(pt),Fn=["active_agents","ai_request_count","cached_tokens","completion_tokens","cost","cost_per_request_average","error_rate","llm_cache_embeddings_latency_average","llm_cache_fetch_latency_average","llm_embeddings_cost","llm_embeddings_tokens","llm_latency_average","llm_latency_p50","llm_latency_p95","llm_latency_p99","prompt_tokens","share_of_cost","share_of_requests","time_per_token_average","time_per_token_p50","time_per_token_p95","time_per_token_p99","time_to_first_token_average","time_to_first_token_p50","time_to_first_token_p95","time_to_first_token_p99","total_tokens","total_tokens_per_minute"],Un=["a2a_context_id","a2a_error","a2a_method","a2a_task_id","a2a_task_state","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"],ht=Q(Un),Hn=["auth_type","cache_status","client_ip","data_plane_node_version","header_host","header_user_agent","http_method","oidc_credential","request_id","request_uri","response_header_content_type","response_source","service_port","service_protocol","trace_id","upstream_uri"],Ln=Hn,jn=["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"],yt=Q(jn),qi=["15M","1H","6H","12H","24H","7D"],ot=1e3,Wn=["platform","platform_usage"],Fi=e=>Wn.includes(e),gt=[...qe.filter(e=>e!=="consumer_group"),"a2a_context_id","a2a_error","a2a_method","a2a_task_id","a2a_task_state","ai_gateway_agent","ai_gateway_mcp_server","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],_e=Q(gt),Vn=[...ft,"a2a_latency_average","a2a_response_size_sum","active_agents","mcp_latency_average","mcp_latency_p99","mcp_latency_p95","mcp_latency_p50","mcp_response_size_sum"],_t=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],Fe=Q(_t),zn=["cache_eviction_rate","cache_expiration_rate","cache_items_average","cache_memory_utilization_max"],Ui=["basic","api_usage","llm_usage","agentic_usage","platform","platform_usage","managed_cache_usage"],$n={basic:new Set(he),api_usage:new Set(ye),llm_usage:new Set(ge),agentic_usage:new Set(_e),platform:new Set,platform_usage:new Set,managed_cache_usage:new Set(Fe)},Hi=(e,t)=>e.startsWith("goap")||e==="platform"||e==="platform_usage"?t:t.filter(n=>$n[e].has(n.field)),wt=[{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"}],Li=["heatmap","treemap","horizontal_bar","vertical_bar","gauge","donut","timeseries_line","timeseries_bar","scatter","golden_signals","top_n","top_talkers","table","slottable","single_value","choropleth_map"],B={type:"string"},N={type:"string"},bt={type:"boolean"},Tt={type:"string",description:"Text rendered in the tile header. Supports the {timeframe} token, "},Qn={type:"object",additionalProperties:{type:"string"}},Dt={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},Bn={type:"object",deprecated:!0,description:"Deprecated: use the top-level tile shape { type: 'slottable', id, layout } instead of a chart-level 'slottable' definition.",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},Xn={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chart_dataset_colors:Dt,synthetics_data_key:B,chart_title:N,allow_csv_export:bt},required:["type"],additionalProperties:!1},Zn={type:"object",properties:{type:{type:"string",enum:["warning","error","neutral"]},value:{type:"number"},label:{type:"string"},highlightIntersections:{type:"boolean",default:!1}},required:["type","value"],additionalProperties:!1},Kn=["left","right"],st={type:"object",properties:{show_grid:{type:"boolean"},title:{type:"string"}},additionalProperties:!1},Jn={type:"object",properties:{type:{type:"string",enum:["timeseries_line","timeseries_bar"]},stacked:{type:"boolean"},threshold:{type:"object",additionalProperties:{type:"array",items:Zn}},metric_axis_map:{type:"object",description:"Maps a metric to the specified y axis, by default the metric will only use the left y axis. Only applies to timeseries_line.",additionalProperties:{type:"string",enum:Kn}},y_axes:{type:"object",properties:{left:st,right:st},additionalProperties:!1},chart_dataset_colors:Dt,synthetics_data_key:B,chart_title:N,allow_csv_export:bt},required:["type"],additionalProperties:!1},er={type:"object",properties:{percentile:{type:"number",minimum:0,maximum:100},label:{type:"string",description:"Overrides the default label."},border_dash:{type:"array",description:"Dash pattern for the line.",items:{type:"number"}},color:{type:"string"}},required:["percentile"],additionalProperties:!1},St={type:"object",description:"Plots one point per record, percentiles are computed from the records returned.",properties:{type:{type:"string",enum:["scatter"]},percentile_lines:{type:"array",description:"Reference lines derived from the plotted values.",items:er},outlier_percentile:{type:"number",description:"Percentile above which points are colored in the outlier color, in place.",minimum:0,maximum:100},shade_outlier_region:{type:"boolean",default:!1},jitter_ms:{type:"number",description:"Maximum horizontal jitter so records sharing a timestamp do not stack into one column.",minimum:0},point_radius:{type:"number",minimum:0},point_opacity:{type:"number",description:"Opacity of plotted points.",minimum:0,maximum:1},chart_dataset_colors:Dt,synthetics_data_key:B,chart_title:N,allow_csv_export:bt},required:["type"],additionalProperties:!1},tr={type:"object",properties:{type:{type:"string",enum:["gauge"]},metric_display:{type:"string",enum:["hidden","single","full"]},reverse_dataset:{type:"boolean"},numerator:{type:"number"},synthetics_data_key:B,chart_title:N},required:["type"],additionalProperties:!1},nr={type:"object",properties:{type:{type:"string",enum:["donut"]},synthetics_data_key:B,chart_title:N},required:["type"],additionalProperties:!1},rr={type:"object",properties:{type:{type:"string",enum:["heatmap"]},chart_title:N},required:["type"],additionalProperties:!1},ar={type:"object",properties:{type:{type:"string",enum:["treemap"]},chart_title:N},required:["type"],additionalProperties:!1},ir=["ai_provider"],Mt={type:"object",properties:{label:{type:"string"},value:{type:"string",enum:["raw","relative"],description:"`relative` shows the value's percentage of the column total across the returned rows next to the raw value."},bar:{type:"string",enum:["relative","max"],description:"Renders a bar sized relative to the column total (`relative`) or the column maximum (`max`)."},icon_set:{type:"string",enum:ir},thresholds:{type:"array",description:"Colors the bar (or the value when there is no bar) once the raw metric value reaches a threshold.",items:{type:"object",properties:{type:{type:"string",enum:["warning","error"]},value:{type:"number"}},required:["type","value"],additionalProperties:!1}}},additionalProperties:!1},or={type:"object",properties:{chart_title:N,synthetics_data_key:B,type:{type:"string",enum:["top_n"]},description:{type:"string",deprecated:!0,description:"Deprecated: use `header_description` on the tile definition."},entity_link:{type:"string"},entity_links:Qn,column_options:{type:"object",description:"Per-column rendering options keyed by metric or dimension name.",additionalProperties:Mt}},required:["type"],additionalProperties:!1},L=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:Yn},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:qn}},required:["field","operator"],additionalProperties:!1}]}}),ji={type:"object",properties:{dimension:{type:"string",description:"Dimension to group this column by."},label:{type:"string",description:"Column heading, defaults to the translated dimension name."},filters:{...L(),description:"Filters applied to this column only, in addition to the query filters."}},required:["dimension"],additionalProperties:!1},sr={type:"object",properties:{chart_title:N,synthetics_data_key:B,type:{type:"string",enum:["top_talkers"]},columns:{type:"array",minItems:1,items:ji},size_metric:{type:"string",description:"Metric for computing the block size and the percentage label, defaults to the first entry in the query metrics."},column_options:{type:"object",description:"Per-metric or per-dimension rendering options, keyed by name. Applies to tooltip rows as well as headings.",additionalProperties:Mt},entity_links:Qn},required:["type","columns"],additionalProperties:!1},cr={type:"object",properties:{type:{type:"string",enum:["table"]},chart_title:N},required:["type"],additionalProperties:!1},ur={type:"object",properties:{chart_title:N,type:{type:"string",enum:["golden_signals"]},long_card_titles:{type:"boolean"},percentile_latency:{type:"boolean"}},required:["type"],additionalProperties:!1},lr={type:"object",properties:{type:{type:"string",enum:["single_value"]},decimal_points:{type:"number"},align_x:{type:"string",enum:["left","center","right"]},chart_title:N},required:["type"],additionalProperties:!1},dr={type:"object",properties:{type:{type:"string",enum:["choropleth_map"]},chart_title:N,fit_to_country:{type:"string",enum:wt.map(e=>e.code)},legend:{type:"boolean",default:!1},bounds:{type:"array",minItems:2,maxItems:2,items:{type:"array",minItems:2,maxItems:2,items:[{type:"number",minimum:-180,maximum:180},{type:"number",minimum:-90,maximum:90}]}}},required:["type"],additionalProperties:!1},Wi={type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string"}},required:["type","time_range"],additionalProperties:!1},Vi={type:"object",description:"A duration representing an exact start and end time.",properties:{tz:{type:"string"},type:{type:"string",enum:["absolute"]},start:{type:"string"},end:{type:"string"}},required:["type","start","end"],additionalProperties:!1},X={granularity:{type:"string",description:'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',enum:dt},time_range:{type:"object",description:"The time range to query.",anyOf:[Wi,Vi],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},se=e=>({type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",...e?{enum:e}:{}}}),ce=e=>({type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:3,items:{type:"string",...e?{enum:e}:{}}}),mr=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"],fr=()=>({type:"array",description:"A list of filters to apply to the platform query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string"},operator:{type:"string"},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string"},operator:{type:"string"}},required:["field","operator"],additionalProperties:!1}]}}),pr={type:"object",description:"A query to launch at the advanced explore API",properties:{datasource:{type:"string",enum:["api_usage"]},metrics:se(ft),dimensions:ce(qe),filters:L(ye),...X},required:["datasource"],additionalProperties:!1},hr={type:"object",description:"A query to launch at the basic explore API",properties:{datasource:{type:"string",enum:["basic"]},metrics:se(mt),dimensions:ce(Ye),filters:L(he),...X},required:["datasource"],additionalProperties:!1},yr={type:"object",description:"A query to launch at the AI explore API",properties:{datasource:{type:"string",enum:["llm_usage"]},metrics:se(Fn),dimensions:ce(pt),filters:L(ge),...X},required:["datasource"],additionalProperties:!1},gr={type:"object",description:"A query to launch at the Agentic explore API",properties:{datasource:{type:"string",enum:["agentic_usage"]},metrics:se(Vn),dimensions:ce(gt),filters:L(_e),...X},required:["datasource"],additionalProperties:!1},_r={type:"object",description:"A query to launch at the Managed Cache explore API",properties:{datasource:{type:"string",enum:["managed_cache_usage"]},metrics:se(zn),dimensions:ce(_t),filters:L(Fe),...X},required:["datasource"],additionalProperties:!1},wr={oneOf:[{const:"platform_usage"},{const:"platform",deprecated:!0,description:"Deprecated: use 'platform_usage'."}]},br={type:"object",description:"A query to launch at the platform dashboard API. Use datasource 'platform_usage'; 'platform' is accepted for backward compatibility but deprecated.",properties:{datasource:wr,metrics:se(),dimensions:ce(),filters:fr(),...X},required:["datasource"],additionalProperties:!1},Tr={type:"object",description:"A query to launch at the platform tabular explore API. Use datasource 'platform_usage'; 'platform' is accepted for backward compatibility but deprecated.",properties:{datasource:wr,entity:{type:"string"},columns:{type:"array",minItems:1,items:{type:"string"}},filters:fr(),cursor:{type:"string"},page_size:{type:"number"}},required:["datasource"],additionalProperties:!1},Dr={type:"object",properties:{field:{type:"string",description:"Field to read, dotted for a nested one."},label:{type:"string",description:"Tooltip label, defaults to the field name."},unit:{type:"string",description:"Unit to format the value with, e.g. `ms` or `token count`."}},required:["field"],additionalProperties:!1},Sr={type:"object",description:"A query for the api-requests endpoint.",properties:{datasource:{type:"string",enum:["requests"]},metric:{type:"string",description:"Field plotted on the y axis."},dimension:{type:"string",description:"Field used to split points into series."},filters:L(Array.from(new Set([...ht,...Ln,...yt]))),time_range:X.time_range,max_records:{type:"number",description:"Ceiling on records gathered across pages. The endpoint serves at most 1000 per page. Defaults to 10000.",minimum:1},unroll:{type:"string",description:"A nested collection on a request record (`ai`, `mcp_info.rpc`) to expand into one point per entry rather than one per request."},extra_fields:{type:"array",description:"Values to annotate each point with in the tooltip. Read from the unrolled entry first, then the request record.",items:Dr}},required:["datasource","metric"],additionalProperties:!1},Mr=[pr,hr,yr,gr,_r,br],Er={anyOf:Mr},Or=[Tr],vr={anyOf:Or},zi={anyOf:[...Mr,...Or]},$i={anyOf:[Xn,tr,nr,rr,ar,Jn,St,ur,or,sr,Bn,lr,dr]},Qi={type:"object",properties:{query:Er,chart:$i,header_description:Tt},required:["query","chart"],additionalProperties:!1},Bi={type:"object",properties:{query:vr,chart:cr,header_description:Tt},required:["query","chart"],additionalProperties:!1},Xi={type:"object",properties:{query:Sr,chart:St,header_description:Tt},required:["query","chart"],additionalProperties:!1},Rr={anyOf:[Qi,Bi,Xi]},Et={type:"object",properties:{position:{type:"object",properties:{col:{type:"number"},row:{type:"number"}},description:"Position of the tile in the grid.",required:["col","row"],additionalProperties:!1},size:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"},fit_to_content:{type:"boolean"}},description:"Number of columns and rows the tile occupies. If fitToContent is true for every tile in a row, and each tile only occupies 1 row, then the row will auto-fit to its content.",required:["cols","rows"],additionalProperties:!1}},required:["position","size"],additionalProperties:!1},Pr={type:"object",properties:{type:{type:"string",enum:["chart"]},definition:Rr,layout:Et,id:{type:"string",description:"Unique identifier for the tile. If not provided, one will be generated."}},required:["type","definition","layout"],additionalProperties:!1},xr={type:"object",description:"A tile that renders arbitrary content into a named slot instead of a chart. The slot name is the tile `id`.",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string",description:"Unique identifier for the tile, and the name of the slot the host application should supply."},layout:Et},required:["type","id","layout"],additionalProperties:!1},Nr={anyOf:[Pr,xr]},Zi={type:"object",properties:{tiles:{type:"array",items:Nr},tile_height:{type:"number",description:"Height of each tile in pixels."},columns:{type:"number",description:"Number of columns in the dashboard grid."},preset_filters:L([...new Set([...ye,...he,...ge,..._e,...mr,...Fe])]),template_id:{type:["string","null"],description:"Template id which was used to instantiate this dashboard."}},required:["tiles"],additionalProperties:!1},Ki=e=>{const t=[];return he.includes(e)&&t.push("basic"),ye.includes(e)&&t.push("api_usage"),ge.includes(e)&&t.push("llm_usage"),_e.includes(e)&&t.push("agentic_usage"),(ht.includes(e)||yt.includes(e))&&t.push("requests"),t},Ji={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"}},eo=(e,t,n)=>{let r;const i=Ji[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function et(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const to={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},no={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ro={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ao={date:et({formats:to,defaultWidth:"full"}),time:et({formats:no,defaultWidth:"full"}),dateTime:et({formats:ro,defaultWidth:"full"})},io={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},oo=(e,t,n,r)=>io[e];function de(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const c=e.defaultFormattingWidth||e.defaultWidth,l=n?.width?String(n.width):c;i=e.formattingValues[l]||e.formattingValues[c]}else{const c=e.defaultWidth,l=n?.width?String(n.width):e.defaultWidth;i=e.values[l]||e.values[c]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const so={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},co={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},uo={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"]},lo={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"]},mo={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"}},fo={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"}},po=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ho={ordinalNumber:po,era:de({values:so,defaultWidth:"wide"}),quarter:de({values:co,defaultWidth:"wide",argumentCallback:e=>e-1}),month:de({values:uo,defaultWidth:"wide"}),day:de({values:lo,defaultWidth:"wide"}),dayPeriod:de({values:mo,defaultWidth:"wide",formattingValues:fo,defaultFormattingWidth:"wide"})};function me(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const c=o[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],f=Array.isArray(l)?go(l,g=>g.test(c)):yo(l,g=>g.test(c));let p;p=e.valueCallback?e.valueCallback(f):f,p=n.valueCallback?n.valueCallback(p):p;const y=t.slice(c.length);return{value:p,rest:y}}}function yo(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function go(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function _o(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let c=e.valueCallback?e.valueCallback(o[0]):o[0];c=n.valueCallback?n.valueCallback(c):c;const l=t.slice(i.length);return{value:c,rest:l}}}const wo=/^(\d+)(th|st|nd|rd)?/i,bo=/\d+/i,To={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},Do={any:[/^b/i,/^(a|c)/i]},So={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Mo={any:[/1/i,/2/i,/3/i,/4/i]},Eo={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},Oo={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]},vo={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},Ro={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]},Po={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},xo={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}},No={ordinalNumber:_o({matchPattern:wo,parsePattern:bo,valueCallback:e=>parseInt(e,10)}),era:me({matchPatterns:To,defaultMatchWidth:"wide",parsePatterns:Do,defaultParseWidth:"any"}),quarter:me({matchPatterns:So,defaultMatchWidth:"wide",parsePatterns:Mo,defaultParseWidth:"any",valueCallback:e=>e+1}),month:me({matchPatterns:Eo,defaultMatchWidth:"wide",parsePatterns:Oo,defaultParseWidth:"any"}),day:me({matchPatterns:vo,defaultMatchWidth:"wide",parsePatterns:Ro,defaultParseWidth:"any"}),dayPeriod:me({matchPatterns:Po,defaultMatchWidth:"any",parsePatterns:xo,defaultParseWidth:"any"})},Co={code:"en-US",formatDistance:eo,formatLong:ao,formatRelative:oo,localize:ho,match:No,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Io={};function we(){return Io}const Cr=6048e5,Ao=864e5,ko=60,Go=3600,dn=Symbol.for("constructDateFrom");function I(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&dn in e?e[dn](t):e instanceof Date?new e.constructor(t):new Date(t)}function M(e,t){return I(t||e,e)}function mn(e){const t=M(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Yo(e,...t){const n=I.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function ae(e,t){const n=M(e,t?.in);return n.setHours(0,0,0,0),n}function qo(e,t,n){const[r,i]=Yo(n?.in,e,t),o=ae(r),c=ae(i),l=+o-mn(o),f=+c-mn(c);return Math.round((l-f)/Ao)}function Fo(e,t){const n=M(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Uo(e,t){const n=M(e,t?.in);return qo(n,Fo(n))+1}function F(e,t){const n=we(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=M(e,t?.in),o=i.getDay(),c=(o<r?7:0)+o-r;return i.setDate(i.getDate()-c),i.setHours(0,0,0,0),i}function Ae(e,t){return F(e,{...t,weekStartsOn:1})}function Ir(e,t){const n=M(e,t?.in),r=n.getFullYear(),i=I(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const o=Ae(i),c=I(n,0);c.setFullYear(r,0,4),c.setHours(0,0,0,0);const l=Ae(c);return n.getTime()>=o.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function Ho(e,t){const n=Ir(e,t),r=I(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Ae(r)}function Lo(e,t){const n=M(e,t?.in),r=+Ae(n)-+Ho(n);return Math.round(r/Cr)+1}function Ar(e,t){const n=M(e,t?.in),r=n.getFullYear(),i=we(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,c=I(t?.in||e,0);c.setFullYear(r+1,0,o),c.setHours(0,0,0,0);const l=F(c,t),f=I(t?.in||e,0);f.setFullYear(r,0,o),f.setHours(0,0,0,0);const p=F(f,t);return+n>=+l?r+1:+n>=+p?r:r-1}function jo(e,t){const n=we(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Ar(e,t),o=I(t?.in||e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),F(o,t)}function Wo(e,t){const n=M(e,t?.in),r=+F(n,t)-+jo(n,t);return Math.round(r/Cr)+1}function b(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const H={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return b(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):b(n+1,2)},d(e,t){return b(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return b(e.getHours()%12||12,t.length)},H(e,t){return b(e.getHours(),t.length)},m(e,t){return b(e.getMinutes(),t.length)},s(e,t){return b(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return b(i,t.length)}},te={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},fn={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return H.y(e,t)},Y:function(e,t,n,r){const i=Ar(e,r),o=i>0?i:1-i;if(t==="YY"){const c=o%100;return b(c,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):b(o,t.length)},R:function(e,t){const n=Ir(e);return b(n,t.length)},u:function(e,t){const n=e.getFullYear();return b(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return b(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return b(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return H.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return b(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=Wo(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):b(i,t.length)},I:function(e,t,n){const r=Lo(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):b(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):H.d(e,t)},D:function(e,t,n){const r=Uo(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):b(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return b(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return b(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return b(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=te.noon:r===0?i=te.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=te.evening:r>=12?i=te.afternoon:r>=4?i=te.morning:i=te.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return H.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):H.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):b(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):b(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):H.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):H.s(e,t)},S:function(e,t){return H.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return hn(r);case"XXXX":case"XX":return z(r);default:return z(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return hn(r);case"xxxx":case"xx":return z(r);default:return z(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+pn(r,":");default:return"GMT"+z(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+pn(r,":");default:return"GMT"+z(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return b(r,t.length)},T:function(e,t,n){return b(+e,t.length)}};function pn(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+b(o,2)}function hn(e,t){return e%60===0?(e>0?"-":"+")+b(Math.abs(e)/60,2):z(e,t)}function z(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=b(Math.trunc(r/60),2),o=b(r%60,2);return n+i+t+o}const yn=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},kr=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Vo=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return yn(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",yn(r,t)).replace("{{time}}",kr(i,t))},zo={p:kr,P:Vo},$o=/^D+$/,Qo=/^Y+$/,Bo=["D","DD","YY","YYYY"];function Xo(e){return $o.test(e)}function Zo(e){return Qo.test(e)}function Ko(e,t,n){const r=Jo(e,t,n);if(console.warn(r),Bo.includes(e))throw new RangeError(r)}function Jo(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function es(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ts(e){return!(!es(e)&&typeof e!="number"||isNaN(+M(e)))}const ns=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rs=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,as=/^'([^]*?)'?$/,is=/''/g,os=/[a-zA-Z]/;function ss(e,t,n){const r=we(),i=n?.locale??r.locale??Co,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,c=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=M(e,n?.in);if(!ts(l))throw new RangeError("Invalid time value");let f=t.match(rs).map(y=>{const g=y[0];if(g==="p"||g==="P"){const w=zo[g];return w(y,i.formatLong)}return y}).join("").match(ns).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const g=y[0];if(g==="'")return{isToken:!1,value:cs(y)};if(fn[g])return{isToken:!0,value:y};if(g.match(os))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:y}});i.localize.preprocessor&&(f=i.localize.preprocessor(l,f));const p={firstWeekContainsDate:o,weekStartsOn:c,locale:i};return f.map(y=>{if(!y.isToken)return y.value;const g=y.value;(!n?.useAdditionalWeekYearTokens&&Zo(g)||!n?.useAdditionalDayOfYearTokens&&Xo(g))&&Ko(g,t,String(e));const w=fn[g[0]];return w(l,g,i.localize,p)}).join("")}function cs(e){const t=e.match(as);return t?t[1].replace(is,"'"):e}function Re(e,t,n){const r=M(e,n?.in);return isNaN(t)?I(e,NaN):(r.setDate(r.getDate()+t),r)}function Gr(e,t,n){const r=M(e,n?.in);if(isNaN(t))return I(e,NaN);if(!t)return r;const i=r.getDate(),o=I(e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const c=o.getDate();return i>=c?o:(r.setFullYear(o.getFullYear(),o.getMonth(),i),r)}function us(e,t,n){return Gr(e,t*3,n)}function ie(e,t){const n=M(e,t?.in),r=n.getMonth(),i=r-r%3;return n.setMonth(i,1),n.setHours(0,0,0,0),n}function oe(e,t){const n=M(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function ls(e,t){const n=M(e,t?.in),r=n.getFullYear(),i=n.getMonth(),o=I(n,0);return o.setFullYear(r,i+1,0),o.setHours(0,0,0,0),o.getDate()}function ds(){return Object.assign({},we())}function gn(e){return+M(e)}function _n(e){return Math.trunc(+M(e)/1e3)}function wn(e){return Math.trunc(e*Go)}function ms(e){const t=e/ko;return Math.trunc(t)}function Yr(e,t,n){return Gr(e,-1,n)}function qr(e,t,n){return us(e,-1,n)}function bn(e,t,n){const r=ds(),i=hs(e,n.timeZone,n.locale??r.locale);return"formatToParts"in i?fs(i,t):ps(i,t)}function fs(e,t){const n=e.formatToParts(t);for(let r=n.length-1;r>=0;--r)if(n[r].type==="timeZoneName")return n[r].value}function ps(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/ [\w-+ ]+$/.exec(n);return r?r[0].substr(1):""}function hs(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function ys(e,t){const n=Ts(t);return"formatToParts"in n?_s(n,e):ws(n,e)}const gs={year:0,month:1,day:2,hour:3,minute:4,second:5};function _s(e,t){try{const n=e.formatToParts(t),r=[];for(let i=0;i<n.length;i++){const o=gs[n[i].type];o!==void 0&&(r[o]=parseInt(n[i].value,10))}return r}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function ws(e,t){const n=e.format(t),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(r[3],10),parseInt(r[1],10),parseInt(r[2],10),parseInt(r[4],10),parseInt(r[5],10),parseInt(r[6],10)]}const tt={},Tn=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")),bs=Tn==="06/25/2014, 00:00:00"||Tn==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Ts(e){return tt[e]||(tt[e]=bs?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),tt[e]}function Ot(e,t,n,r,i,o,c){const l=new Date(0);return l.setUTCFullYear(e,t,n),l.setUTCHours(r,i,o,c),l}const Dn=36e5,Ds=6e4,nt={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function be(e,t,n){if(!e)return 0;let r=nt.timezoneZ.exec(e);if(r)return 0;let i,o;if(r=nt.timezoneHH.exec(e),r)return i=parseInt(r[1],10),Sn(i)?-(i*Dn):NaN;if(r=nt.timezoneHHMM.exec(e),r){i=parseInt(r[2],10);const c=parseInt(r[3],10);return Sn(i,c)?(o=Math.abs(i)*Dn+c*Ds,r[1]==="+"?-o:o):NaN}if(Es(e)){t=new Date(t||Date.now());const c=n?t:Ss(t),l=ct(c,e);return-(n?l:Ms(t,l,e))}return NaN}function Ss(e){return Ot(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function ct(e,t){const n=ys(e,t),r=Ot(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let i=e.getTime();const o=i%1e3;return i-=o>=0?o:1e3+o,r-i}function Ms(e,t,n){let i=e.getTime()-t;const o=ct(new Date(i),n);if(t===o)return t;i-=o-t;const c=ct(new Date(i),n);return o===c?o:Math.max(o,c)}function Sn(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Mn={};function Es(e){if(Mn[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Mn[e]=!0,!0}catch{return!1}}const Os=60*1e3,vs={X:function(e,t,n){const r=rt(n.timeZone,e);if(r===0)return"Z";switch(t){case"X":return En(r);case"XXXX":case"XX":return re(r);default:return re(r,":")}},x:function(e,t,n){const r=rt(n.timeZone,e);switch(t){case"x":return En(r);case"xxxx":case"xx":return re(r);default:return re(r,":")}},O:function(e,t,n){const r=rt(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+Rs(r,":");default:return"GMT"+re(r,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return bn("short",e,n);default:return bn("long",e,n)}}};function rt(e,t){const n=e?be(e,t,!0)/Os:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function ke(e,t){const n=e<0?"-":"";let r=Math.abs(e).toString();for(;r.length<t;)r="0"+r;return n+r}function re(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=ke(Math.floor(r/60),2),o=ke(Math.floor(r%60),2);return n+i+t+o}function En(e,t){return e%60===0?(e>0?"-":"+")+ke(Math.abs(e)/60,2):re(e,t)}function Rs(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+ke(o,2)}function On(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const Fr=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,at=36e5,vn=6e4,Ps=2,O={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:Fr};function Ge(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?Ps:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const r=xs(e),{year:i,restDateString:o}=Ns(r.date,n),c=Cs(o,i);if(c===null||isNaN(c.getTime()))return new Date(NaN);if(c){const l=c.getTime();let f=0,p;if(r.time&&(f=Is(r.time),f===null||isNaN(f)))return new Date(NaN);if(r.timeZone||t.timeZone){if(p=be(r.timeZone||t.timeZone,new Date(l+f)),isNaN(p))return new Date(NaN)}else p=On(new Date(l+f)),p=On(new Date(l+f+p));return new Date(l+f+p)}else return new Date(NaN)}function xs(e){const t={};let n=O.dateTimePattern.exec(e),r;if(n?(t.date=n[1],r=n[3]):(n=O.datePattern.exec(e),n?(t.date=n[1],r=n[2]):(t.date=null,r=e)),r){const i=O.timeZone.exec(r);i?(t.time=r.replace(i[1],""),t.timeZone=i[1].trim()):t.time=r}return t}function Ns(e,t){if(e){const n=O.YYY[t],r=O.YYYYY[t];let i=O.YYYY.exec(e)||r.exec(e);if(i){const o=i[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(i=O.YY.exec(e)||n.exec(e),i){const o=i[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function Cs(e,t){if(t===null)return null;let n,r,i;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let o=O.MM.exec(e);if(o)return n=new Date(0),r=parseInt(o[1],10)-1,Pn(t,r)?(n.setUTCFullYear(t,r),n):new Date(NaN);if(o=O.DDD.exec(e),o){n=new Date(0);const c=parseInt(o[1],10);return Gs(t,c)?(n.setUTCFullYear(t,0,c),n):new Date(NaN)}if(o=O.MMDD.exec(e),o){n=new Date(0),r=parseInt(o[1],10)-1;const c=parseInt(o[2],10);return Pn(t,r,c)?(n.setUTCFullYear(t,r,c),n):new Date(NaN)}if(o=O.Www.exec(e),o)return i=parseInt(o[1],10)-1,xn(i)?Rn(t,i):new Date(NaN);if(o=O.WwwD.exec(e),o){i=parseInt(o[1],10)-1;const c=parseInt(o[2],10)-1;return xn(i,c)?Rn(t,i,c):new Date(NaN)}return null}function Is(e){let t,n,r=O.HH.exec(e);if(r)return t=parseFloat(r[1].replace(",",".")),it(t)?t%24*at:NaN;if(r=O.HHMM.exec(e),r)return t=parseInt(r[1],10),n=parseFloat(r[2].replace(",",".")),it(t,n)?t%24*at+n*vn:NaN;if(r=O.HHMMSS.exec(e),r){t=parseInt(r[1],10),n=parseInt(r[2],10);const i=parseFloat(r[3].replace(",","."));return it(t,n,i)?t%24*at+n*vn+i*1e3:NaN}return null}function Rn(e,t,n){t=t||0,n=n||0;const r=new Date(0);r.setUTCFullYear(e,0,4);const i=r.getUTCDay()||7,o=t*7+n+1-i;return r.setUTCDate(r.getUTCDate()+o),r}const As=[31,28,31,30,31,30,31,31,30,31,30,31],ks=[31,29,31,30,31,30,31,31,30,31,30,31];function Ur(e){return e%400===0||e%4===0&&e%100!==0}function Pn(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const r=Ur(e);if(r&&n>ks[t]||!r&&n>As[t])return!1}return!0}function Gs(e,t){if(t<1)return!1;const n=Ur(e);return!(n&&t>366||!n&&t>365)}function xn(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function it(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const Ys=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function qs(e,t,n={}){t=String(t);const r=t.match(Ys);if(r){const i=Ge(n.originalDate||e,n);t=r.reduce(function(o,c){if(c[0]==="'")return o;const l=o.indexOf(c),f=o[l-1]==="'",p=o.replace(c,"'"+vs[c[0]](i,c,n)+"'");return f?p.substring(0,l-1)+p.substring(l+1):p},t)}return ss(e,t,n)}function Hr(e,t,n){e=Ge(e,n);const r=be(t,e,!0),i=new Date(e.getTime()-r),o=new Date(0);return o.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),o.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),o}function Lr(e,t,n,r){return r={...r,timeZone:t,originalDate:e},qs(Hr(e,t,{timeZone:r.timeZone}),n,r)}function Fs(e,t,n){if(typeof e=="string"&&!e.match(Fr))return Ge(e,{...n,timeZone:t});e=Ge(e,n);const r=Ot(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),i=be(t,new Date(r));return new Date(r+i)}function jr(e,t){return-be(e,t)}function Us(e,t={}){const n=t?.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;let r="MMM dd, yyy hh:mm a";switch(t.format){case"short":r="MMM dd, yyyy";break;case"default":r="MMM dd, yyyy hh:mm a";break;case"full":r="MMM dd, yyyy hh:mm:ss.SSS a";break}return t.includeTZ&&(r+=" (z)"),Lr(e,n,r)}function ut(e,t={}){if(!e)return e;const n=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let r="MMM dd, yyy hh:mm a";t.short&&(r="MMM dd, yyy"),t.includeTZ&&(r+=" (z)");const i=new Date(e);return Lr(i,n,r)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}function Hs(e,t){return`${ut(e.getTime())} - ${ut(t.getTime(),{includeTZ:!0})}`}const $={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 Ls(e,t){return e.map(n=>({value:n,label:t.t(`configuration.vitals.reports.granularity.${n}`)}))}function Wr(e,t){return{duration:e,type:"duration",origin:t}}function js(e){return e&&dt.find(n=>e<=$[n])||null}function Ws(e){const t=$.hourly,n=$.daily;return e<=t?"tenSecondly":e<=6*t?"thirtySecondly":e<=12*t?"minutely":e<=n?"fiveMinutely":e<=7*n?"thirtyMinutely":e<60*n?"hourly":"daily"}function Vr(e,t,n,r){const i=$[n];let o=0;return i>=$.daily&&(r?o=-jr(r,t):o=t.getTimezoneOffset()*60*1e3),new Date(e((t.getTime()-o)/i)*i+o)}function zr(e,t,n){return Vr(Math.floor,e,t,n)}function vt(e,t,n){return Vr(Math.ceil,e,t,n)}class Ue{timeframe;tz;dataGranularity;constructor(t,n,r){if(this.constructor===Ue)throw new Error("BaseQueryTime is not meant to be used directly.");this.timeframe=t,this.tz=n,this.dataGranularity=r??t.dataGranularity}calculateStartDate(t,n,r=1){if(t)return new Date(this.endDate().getTime()-this.timeframe.timeframeLengthMs()*r);{const i=this.endDate(),o=this.timeframe.rawStart(this.tz),c=zr(o,n,this.tz),f=(i.getTime()-c.getTime())*(r-1);return new Date(c.getTime()-f)}}granularitySeconds(){return Math.floor(this.granularityMs()/1e3)}granularityDruid(){return Wr(this.granularityMs(),this.startDate().toISOString())}startSeconds(){return _n(this.startDate())}endSeconds(){return _n(this.endDate())}startMs(){return gn(this.startDate())}endMs(){return gn(this.endDate())}}class Vs extends Ue{granularity;constructor(t,n,r,i,o){super(t,r,i),n&&t.allowedGranularities(o).has(n)?this.granularity=n:o?this.granularity=t.fineGrainedDefaultGranularity??t.defaultResponseGranularity:this.granularity=t.defaultResponseGranularity}startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.granularity)}endDate(){return vt(this.timeframe.rawEnd(),this.granularity,this.tz)}granularityMs(){return $[this.granularity]}}class $r extends Ue{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity)}endDate(){return vt(this.timeframe.rawEnd(this.tz),this.dataGranularity,this.tz)}granularityMs(){return this.endDate().getTime()-this.startDate().getTime()}}class zs extends $r{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity,2)}granularityMs(){return this.endDate().getTime()-super.startDate().getTime()}}var Pe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fe={exports:{}};fe.exports;var Nn;function Qs(){return Nn||(Nn=1,(function(e,t){var n=200,r="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",c="[object Array]",l="[object Boolean]",f="[object Date]",p="[object Error]",y="[object Function]",g="[object GeneratorFunction]",w="[object Map]",D="[object Number]",h="[object Object]",_="[object Promise]",v="[object RegExp]",x="[object Set]",C="[object String]",k="[object Symbol]",Le="[object WeakMap]",Pt="[object ArrayBuffer]",Te="[object DataView]",xt="[object Float32Array]",Nt="[object Float64Array]",Ct="[object Int8Array]",It="[object Int16Array]",At="[object Int32Array]",kt="[object Uint8Array]",Gt="[object Uint8ClampedArray]",Yt="[object Uint16Array]",qt="[object Uint32Array]",ta=/[\\^$.*+?()[\]{}|]/g,na=/\w*$/,ra=/^\[object .+?Constructor\]$/,aa=/^(?:0|[1-9]\d*)$/,T={};T[o]=T[c]=T[Pt]=T[Te]=T[l]=T[f]=T[xt]=T[Nt]=T[Ct]=T[It]=T[At]=T[w]=T[D]=T[h]=T[v]=T[x]=T[C]=T[k]=T[kt]=T[Gt]=T[Yt]=T[qt]=!0,T[p]=T[y]=T[Le]=!1;var ia=typeof Pe=="object"&&Pe&&Pe.Object===Object&&Pe,oa=typeof self=="object"&&self&&self.Object===Object&&self,G=ia||oa||Function("return this")(),Ft=t&&!t.nodeType&&t,Ut=Ft&&!0&&e&&!e.nodeType&&e,sa=Ut&&Ut.exports===Ft;function ca(a,s){return a.set(s[0],s[1]),a}function ua(a,s){return a.add(s),a}function la(a,s){for(var u=-1,m=a?a.length:0;++u<m&&s(a[u],u,a)!==!1;);return a}function da(a,s){for(var u=-1,m=s.length,E=a.length;++u<m;)a[E+u]=s[u];return a}function Ht(a,s,u,m){for(var E=-1,R=a?a.length:0;++E<R;)u=s(u,a[E],E,a);return u}function ma(a,s){for(var u=-1,m=Array(a);++u<a;)m[u]=s(u);return m}function fa(a,s){return a?.[s]}function Lt(a){var s=!1;if(a!=null&&typeof a.toString!="function")try{s=!!(a+"")}catch{}return s}function jt(a){var s=-1,u=Array(a.size);return a.forEach(function(m,E){u[++s]=[E,m]}),u}function je(a,s){return function(u){return a(s(u))}}function Wt(a){var s=-1,u=Array(a.size);return a.forEach(function(m){u[++s]=m}),u}var pa=Array.prototype,ha=Function.prototype,De=Object.prototype,We=G["__core-js_shared__"],Vt=(function(){var a=/[^.]+$/.exec(We&&We.keys&&We.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})(),zt=ha.toString,U=De.hasOwnProperty,Se=De.toString,ya=RegExp("^"+zt.call(U).replace(ta,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$t=sa?G.Buffer:void 0,Qt=G.Symbol,Bt=G.Uint8Array,ga=je(Object.getPrototypeOf,Object),_a=Object.create,wa=De.propertyIsEnumerable,ba=pa.splice,Xt=Object.getOwnPropertySymbols,Ta=$t?$t.isBuffer:void 0,Da=je(Object.keys,Object),Ve=J(G,"DataView"),ue=J(G,"Map"),ze=J(G,"Promise"),$e=J(G,"Set"),Qe=J(G,"WeakMap"),le=J(Object,"create"),Sa=V(Ve),Ma=V(ue),Ea=V(ze),Oa=V($e),va=V(Qe),Zt=Qt?Qt.prototype:void 0,Kt=Zt?Zt.valueOf:void 0;function j(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var m=a[s];this.set(m[0],m[1])}}function Ra(){this.__data__=le?le(null):{}}function Pa(a){return this.has(a)&&delete this.__data__[a]}function xa(a){var s=this.__data__;if(le){var u=s[a];return u===r?void 0:u}return U.call(s,a)?s[a]:void 0}function Na(a){var s=this.__data__;return le?s[a]!==void 0:U.call(s,a)}function Ca(a,s){var u=this.__data__;return u[a]=le&&s===void 0?r:s,this}j.prototype.clear=Ra,j.prototype.delete=Pa,j.prototype.get=xa,j.prototype.has=Na,j.prototype.set=Ca;function Y(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var m=a[s];this.set(m[0],m[1])}}function Ia(){this.__data__=[]}function Aa(a){var s=this.__data__,u=Me(s,a);if(u<0)return!1;var m=s.length-1;return u==m?s.pop():ba.call(s,u,1),!0}function ka(a){var s=this.__data__,u=Me(s,a);return u<0?void 0:s[u][1]}function Ga(a){return Me(this.__data__,a)>-1}function Ya(a,s){var u=this.__data__,m=Me(u,a);return m<0?u.push([a,s]):u[m][1]=s,this}Y.prototype.clear=Ia,Y.prototype.delete=Aa,Y.prototype.get=ka,Y.prototype.has=Ga,Y.prototype.set=Ya;function Z(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var m=a[s];this.set(m[0],m[1])}}function qa(){this.__data__={hash:new j,map:new(ue||Y),string:new j}}function Fa(a){return Ee(this,a).delete(a)}function Ua(a){return Ee(this,a).get(a)}function Ha(a){return Ee(this,a).has(a)}function La(a,s){return Ee(this,a).set(a,s),this}Z.prototype.clear=qa,Z.prototype.delete=Fa,Z.prototype.get=Ua,Z.prototype.has=Ha,Z.prototype.set=La;function K(a){this.__data__=new Y(a)}function ja(){this.__data__=new Y}function Wa(a){return this.__data__.delete(a)}function Va(a){return this.__data__.get(a)}function za(a){return this.__data__.has(a)}function $a(a,s){var u=this.__data__;if(u instanceof Y){var m=u.__data__;if(!ue||m.length<n-1)return m.push([a,s]),this;u=this.__data__=new Z(m)}return u.set(a,s),this}K.prototype.clear=ja,K.prototype.delete=Wa,K.prototype.get=Va,K.prototype.has=za,K.prototype.set=$a;function Qa(a,s){var u=Ze(a)||_i(a)?ma(a.length,String):[],m=u.length,E=!!m;for(var R in a)U.call(a,R)&&!(E&&(R=="length"||pi(R,m)))&&u.push(R);return u}function Jt(a,s,u){var m=a[s];(!(U.call(a,s)&&rn(m,u))||u===void 0&&!(s in a))&&(a[s]=u)}function Me(a,s){for(var u=a.length;u--;)if(rn(a[u][0],s))return u;return-1}function Ba(a,s){return a&&en(s,Ke(s),a)}function Be(a,s,u,m,E,R,q){var P;if(m&&(P=R?m(a,E,R,q):m(a)),P!==void 0)return P;if(!Oe(a))return a;var sn=Ze(a);if(sn){if(P=di(a),!s)return ci(a,P)}else{var ee=W(a),cn=ee==y||ee==g;if(bi(a))return ti(a,s);if(ee==h||ee==o||cn&&!R){if(Lt(a))return R?a:{};if(P=mi(cn?{}:a),!s)return ui(a,Ba(P,a))}else{if(!T[ee])return R?a:{};P=fi(a,ee,Be,s)}}q||(q=new K);var un=q.get(a);if(un)return un;if(q.set(a,P),!sn)var ln=u?li(a):Ke(a);return la(ln||a,function(Je,ve){ln&&(ve=Je,Je=a[ve]),Jt(P,ve,Be(Je,s,u,m,ve,a,q))}),P}function Xa(a){return Oe(a)?_a(a):{}}function Za(a,s,u){var m=s(a);return Ze(a)?m:da(m,u(a))}function Ka(a){return Se.call(a)}function Ja(a){if(!Oe(a)||yi(a))return!1;var s=on(a)||Lt(a)?ya:ra;return s.test(V(a))}function ei(a){if(!nn(a))return Da(a);var s=[];for(var u in Object(a))U.call(a,u)&&u!="constructor"&&s.push(u);return s}function ti(a,s){if(s)return a.slice();var u=new a.constructor(a.length);return a.copy(u),u}function Xe(a){var s=new a.constructor(a.byteLength);return new Bt(s).set(new Bt(a)),s}function ni(a,s){var u=s?Xe(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.byteLength)}function ri(a,s,u){var m=s?u(jt(a),!0):jt(a);return Ht(m,ca,new a.constructor)}function ai(a){var s=new a.constructor(a.source,na.exec(a));return s.lastIndex=a.lastIndex,s}function ii(a,s,u){var m=s?u(Wt(a),!0):Wt(a);return Ht(m,ua,new a.constructor)}function oi(a){return Kt?Object(Kt.call(a)):{}}function si(a,s){var u=s?Xe(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.length)}function ci(a,s){var u=-1,m=a.length;for(s||(s=Array(m));++u<m;)s[u]=a[u];return s}function en(a,s,u,m){u||(u={});for(var E=-1,R=s.length;++E<R;){var q=s[E],P=void 0;Jt(u,q,P===void 0?a[q]:P)}return u}function ui(a,s){return en(a,tn(a),s)}function li(a){return Za(a,Ke,tn)}function Ee(a,s){var u=a.__data__;return hi(s)?u[typeof s=="string"?"string":"hash"]:u.map}function J(a,s){var u=fa(a,s);return Ja(u)?u:void 0}var tn=Xt?je(Xt,Object):Si,W=Ka;(Ve&&W(new Ve(new ArrayBuffer(1)))!=Te||ue&&W(new ue)!=w||ze&&W(ze.resolve())!=_||$e&&W(new $e)!=x||Qe&&W(new Qe)!=Le)&&(W=function(a){var s=Se.call(a),u=s==h?a.constructor:void 0,m=u?V(u):void 0;if(m)switch(m){case Sa:return Te;case Ma:return w;case Ea:return _;case Oa:return x;case va:return Le}return s});function di(a){var s=a.length,u=a.constructor(s);return s&&typeof a[0]=="string"&&U.call(a,"index")&&(u.index=a.index,u.input=a.input),u}function mi(a){return typeof a.constructor=="function"&&!nn(a)?Xa(ga(a)):{}}function fi(a,s,u,m){var E=a.constructor;switch(s){case Pt:return Xe(a);case l:case f:return new E(+a);case Te:return ni(a,m);case xt:case Nt:case Ct:case It:case At:case kt:case Gt:case Yt:case qt:return si(a,m);case w:return ri(a,m,u);case D:case C:return new E(a);case v:return ai(a);case x:return ii(a,m,u);case k:return oi(a)}}function pi(a,s){return s=s??i,!!s&&(typeof a=="number"||aa.test(a))&&a>-1&&a%1==0&&a<s}function hi(a){var s=typeof a;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?a!=="__proto__":a===null}function yi(a){return!!Vt&&Vt in a}function nn(a){var s=a&&a.constructor,u=typeof s=="function"&&s.prototype||De;return a===u}function V(a){if(a!=null){try{return zt.call(a)}catch{}try{return a+""}catch{}}return""}function gi(a){return Be(a,!0,!0)}function rn(a,s){return a===s||a!==a&&s!==s}function _i(a){return wi(a)&&U.call(a,"callee")&&(!wa.call(a,"callee")||Se.call(a)==o)}var Ze=Array.isArray;function an(a){return a!=null&&Ti(a.length)&&!on(a)}function wi(a){return Di(a)&&an(a)}var bi=Ta||Mi;function on(a){var s=Oe(a)?Se.call(a):"";return s==y||s==g}function Ti(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=i}function Oe(a){var s=typeof a;return!!a&&(s=="object"||s=="function")}function Di(a){return!!a&&typeof a=="object"}function Ke(a){return an(a)?Qa(a):ei(a)}function Si(){return[]}function Mi(){return!1}e.exports=gi})(fe,fe.exports)),fe.exports}var Bs=Qs();const Xs=$s(Bs),A=(e,t)=>new Date(e.getTime()-jr(t,e));class S{timeframeText;key;display;timeframeLength;allowedTiers;defaultResponseGranularity;dataGranularity;isRelative;fineGrainedDefaultGranularity;_startCustom;_endCustom;_allowedGranularitiesOverride;constructor(t){this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const n=new Set,r=this.maximumTimeframeLength()/3600;return r<=6&&n.add("minutely"),r>=2&&r<=168&&n.add("hourly"),r>=48&&n.add("daily"),r>=672&&n.add("weekly"),n}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const n=Fs(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Hr(n,t)}}class Zs extends S{rawStart(t){let n=F(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=A(n,t)),n}maximumTimeframeLength(){return 3600*24*7}}class Ks extends S{rawStart(t){let n=oe(this.tzAdjustedDate(t));return t&&(n=A(n,t)),n}maximumTimeframeLength(){return 3600*24*31}}class Js extends S{rawStart(t){let n=ie(this.tzAdjustedDate(t));return t&&(n=A(n,t)),n}maximumTimeframeLength(){return 3600*24*92}}class ec extends S{rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=A(n,t)),n}maximumTimeframeLength(){return 3600*24*366}}class tc extends S{rawEnd(t){let n=F(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=A(n,t)),n}rawStart(t){const n=this.tzAdjustedDate(t);let r=F(n.setDate(n.getDate()-7),{weekStartsOn:1});return t&&(r=A(r,t)),r}}class nc extends S{rawEnd(t){let n=ie(this.tzAdjustedDate(t));return t&&(n=A(n,t)),n}rawStart(t){let n=ie(qr(this.tzAdjustedDate(t)));return t&&(n=A(n,t)),n}}class rc extends S{rawEnd(t){let n=oe(this.tzAdjustedDate(t));return t&&(n=A(n,t)),n}rawStart(t){let n=oe(Yr(this.tzAdjustedDate(t)));return t&&(n=A(n,t)),n}}class ac extends S{rawEnd(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=A(n,t)),n}rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(n=A(n,t)),n}}const Qr=new Map([[d.FIFTEEN_MIN,new S({key:d.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"]})],[d.ONE_HOUR,new S({key:d.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"]})],[d.SIX_HOUR,new S({key:d.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"]})],[d.TWELVE_HOUR,new S({key:d.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"]})],[d.ONE_DAY,new S({key:d.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"]})],[d.SEVEN_DAY,new S({key:d.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"]})],[d.THIRTY_DAY,new S({key:d.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"]})],[d.NINETY_DAY,new S({key:d.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"]})],[d.ONE_HUNDRED_EIGHTY_DAY,new S({key:d.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"]})],[d.ONE_YEAR,new S({key:d.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"]})],[d.CURRENT_WEEK,new Zs({key:d.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=F(new Date,{weekStartsOn:1});return(ae(Re(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[d.CURRENT_MONTH,new Ks({key:d.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=oe(new Date);return(ae(Re(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[d.CURRENT_QUARTER,new Js({key:d.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=ie(new Date);return(ae(Re(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[d.CURRENT_YEAR,new ec({key:d.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1);return(ae(Re(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[d.PREVIOUS_WEEK,new tc({key:d.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"]})],[d.PREVIOUS_MONTH,new rc({key:d.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=oe(new Date),n=oe(Yr(new Date));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=lt(t,n)),3600*24*ls(new Date().setMonth(new Date().getMonth()-1))+wn(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[d.PREVIOUS_QUARTER,new nc({key:d.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=ie(new Date),t=ie(qr(new Date));return(e.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[d.PREVIOUS_YEAR,new ac({key:d.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let n=0;return e.getTimezoneOffset()!==t.getTimezoneOffset()&&(n=lt(e,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+wn(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})]]);function ic(e){const t=new Date(e.start),n=new Date(e.end),r=(n.getTime()-t.getTime())/1e3;return e.timePeriodsKey&&Xs(Qr.get(e.timePeriodsKey))||new S({key:"custom",timeframeText:"custom",display:"custom",startCustom:t,endCustom:n,timeframeLength:()=>r,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["free","plus","enterprise"]})}function oc(e){return{...e.key!=="custom"&&{timePeriodsKey:e.key},start:e.rawStart(),end:e.rawEnd()}}function sc(e){return{key:e.key,display:e.display,timeframeText:e.timeframeText,timeframeLength:()=>e.key,start:()=>e.rawStart(),end:()=>e.rawEnd()}}function lt(e,t){return ms(e.getTimezoneOffset()-t.getTimezoneOffset())}const cc={"15M":d.FIFTEEN_MIN,"1H":d.ONE_HOUR,"6H":d.SIX_HOUR,"12H":d.TWELVE_HOUR,"24H":d.ONE_DAY,"7D":d.SEVEN_DAY,"15m":d.FIFTEEN_MIN,"1h":d.ONE_HOUR,"6h":d.SIX_HOUR,"12h":d.TWELVE_HOUR,"24h":d.ONE_DAY,"7d":d.SEVEN_DAY,"30d":d.THIRTY_DAY,"90d":d.NINETY_DAY,"180d":d.ONE_HUNDRED_EIGHTY_DAY,"365d":d.ONE_YEAR,current_week:d.CURRENT_WEEK,current_month:d.CURRENT_MONTH,current_quarter:d.CURRENT_QUARTER,current_year:d.CURRENT_YEAR,previous_week:d.PREVIOUS_WEEK,previous_month:d.PREVIOUS_MONTH,previous_quarter:d.PREVIOUS_QUARTER,previous_year:d.PREVIOUS_YEAR};class He{_seed;constructor(t){this._seed=t}next(t,n){const r=Math.sin(this._seed++)*1e4,i=r-Math.floor(r);return Math.floor(i*(n-t+1))+t}}const uc=({metrics:e,dimensionMap:t,metaOverrides:n,valueRange:r=[50,500],timeSeries:i=!1})=>i?e.length===1?Br(e[0],t,n,r):Xr(e,t,n,r):Zr(e,t,n,r),Br=(e,t,n,r)=>{const i=Rt(10,1e4),o=new He(i),[c,l]=r||[50,500],f=Date.now()-360*60*1e3,p=Date.now(),y=[];let g=0;for(let h=f;h<=p;h+=3600*1e3)if(t)for(const _ in t)t[_].forEach(v=>{g+=o.next(c,l);const x={[_]:v,[e.name]:g},C={version:"1.0",timestamp:new Date(h).toISOString(),event:x};y.push(C)});else{g+=o.next(c,l);const _={version:"1.0",timestamp:new Date(h).toISOString(),event:{[e.name]:g}};y.push(_)}const w={};if(t)for(const h in t)w[h]={},t[h].forEach(_=>{w[h][_]={name:_,deleted:!1}});const D={start:new Date(f).toISOString(),end:new Date(p).toISOString(),query_id:"12345",metric_names:[e.name],metric_units:{[e.name]:e.unit},granularity_ms:3600*1e3,display:w,...n??{}};return{data:y,meta:D}},lc=(e,t,n)=>Xr(e,void 0,t,n),Xr=(e,t,n,r)=>{const i=Rt(10,1e4),o=new He(i),[c,l]=r||[50,500],f=Date.now()-360*60*1e3,p=Date.now(),y=[],g={};e.forEach(h=>{g[h.name]=0});for(let h=f;h<=p;h+=3600*1e3)if(t)for(const _ in t)t[_].forEach(v=>{const x={[_]:v};e.forEach(C=>{const k=`${_}:${v}:${C.name}`;g[k]=(g[k]||0)+o.next(c,l),x[C.name]=g[k]}),y.push({version:"1.0",timestamp:new Date(h).toISOString(),event:x})});else{const _={};e.forEach(v=>{g[v.name]+=o.next(c,l),_[v.name]=g[v.name]}),y.push({version:"1.0",timestamp:new Date(h).toISOString(),event:_})}const w={};if(t)for(const h in t)w[h]={},t[h].forEach(_=>{w[h][_]={name:_,deleted:!1}});const D={start:new Date(f).toISOString(),end:new Date(p).toISOString(),query_id:"12345",metric_names:e.map(h=>h.name),metric_units:e.reduce((h,_)=>(h[_.name]=_.unit,h),{}),granularity_ms:3600*1e3,display:w,...n??{}};return{data:y,meta:D}},Zr=(e,t,n,r)=>{const i=Math.floor(Math.random()*9991)+10,o=new He(i),[c,l]=r||[50,500],f=Date.now()-360*60*1e3,p=Date.now(),y=new Date((f+p)/2).toISOString(),g=[];if(t){const h=Object.keys(t),_=Object.values(t),v=(x,C)=>{if(C===h.length){e.forEach(k=>{x[k.name]=o.next(c,l)}),g.push({version:"1.0",timestamp:new Date().toISOString(),event:{...x}});return}_[C].forEach(k=>{v({...x,[h[C]]:k},C+1)})};v({},0)}else{const h={};e.forEach(_=>{h[_.name]=o.next(c,l)}),g.push({version:"1.0",timestamp:y,event:h})}const w={};if(t)for(const h in t)w[h]={},t[h].forEach(_=>{w[h][_]={name:_,deleted:!1}});const D={start:new Date(f).toISOString(),end:new Date(p).toISOString(),query_id:"12345",metric_names:e.map(h=>h.name),metric_units:e.reduce((h,_)=>(h[_.name]=_.unit,h),{}),truncated:!1,limit:50,display:w,granularity_ms:p-f,...n??{}};return{data:g,meta:D}};function Rt(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)}const Kr=new Map(wt.map(e=>[e.code,{code:e.code,name:e.name}])),dc=e=>Kr.get(e)?.name||e,Cn=1e3,mc=1e4,In=1e6,An=1e9,kn=1e12,pe=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",r=[];return Math.round(e).toString().split("").reverse().forEach((o,c)=>{c&&c%3===0&&r.push(n),r.push(o)}),r.reverse().join("")},ne=(e,t,n)=>{const r=e/t,i=n.round?"round":"floor";if(n.decimal===!1)return Math[i](r).toString();let o;n.precision?o=r:o=r<10?Math[i](r*10)/10:Math[i](r);let c=o.toString();return typeof n.decimal=="string"&&(c=c.replace(".",n.decimal)),c};function xe(e,t={}){let n;const r=e<0;r&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const i=t.min10k?mc:Cn;return e<i||t.precision&&t.precision>Math.log10(e)?n=pe(ne(e,1,t),t):e<In?n=`${ne(e,Cn,t)}k`:e<An?n=`${ne(e,In,t)}m`:e<kn?n=`${pe(ne(e,An,t),t)}b`:n=`${pe(ne(e,kn,t),t)}t`,r&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}xe.addCommas=pe;const fc=typeof document<"u"&&document.documentElement?.lang||"en-US",Ne=new Intl.NumberFormat(fc),pc=new Set(["%"]),Jr=e=>pc.has(e)?"flush":"spaced";function hc({i18n:e}){const t=(c,l)=>{if(isNaN(c))return"0 B";const f=l?Math.pow(2,50):1e15,p=l?Math.pow(2,40):1e12,y=l?Math.pow(2,30):1e9,g=l?Math.pow(2,20):1e6,w=l?Math.pow(2,10):1e3;let D;return c>=f?D=e.formatNumber(Number.parseFloat((c/f).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):c>=p?D=e.formatNumber(Number.parseFloat((c/p).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):c>=y?D=e.formatNumber(Number.parseFloat((c/y).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):c>=g?D=e.formatNumber(Number.parseFloat((c/g).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):c>=w?D=e.formatNumber(Number.parseFloat((c/w).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):D=e.formatNumber(Number.parseFloat(c.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),D.replace(/([a-zA-Z]*)$/," $1")},n=(c,l="USD")=>isNaN(c)?l==="USD"?"$0.00":`${c}`:c>=.01||l!=="USD"?e.formatNumber(c,{style:"currency",currency:l}):c<1e-4?"< $0.0001":`$${Number.parseFloat(c.toPrecision(4))}`,r=(c,l,f)=>{if(!f)return c;const p=Jr(l)==="flush"?"":" ";return`${c}${p}${f}`};return{formatUnit:(c,l,{isBytes1024:f=!1,currency:p="USD",approximate:y=!1,translateUnit:g=w=>w}={})=>{const w=g(l,c);switch(l){case"bytes":return t(c,f);case"usd":return n(c,p);default:return isNaN(c)?`${c}`:y?r(xe(c,{capital:!0}),l,w):c<.01?r(`${Number.parseFloat(c.toPrecision(4))}`,l,w):r(Ne.format(Number.parseFloat(c.toFixed(2))),l,w)}},formatBytes:t,formatCost:n,formatRange:(c,l,f,{isBytes1024:p=!1,currency:y="USD",approximate:g=!1,translateUnit:w=D=>D}={})=>{const D=w(f,l);switch(f){case"bytes":return`${t(c,p)} - ${t(l,p)}`;case"usd":return`${n(c,y)} - ${n(l,y)}`;default:if(isNaN(c)||isNaN(l))return`${c} - ${l}`;if(g)return r(`${xe(c,{capital:!0})} - ${xe(l,{capital:!0})}`,f,D)}const h=c>=.01?`${Ne.format(Number.parseFloat(c.toFixed(2)))}`:`${Number.parseFloat(c.toPrecision(4))}`,_=l>=.01?`${Ne.format(Number.parseFloat(l.toFixed(2)))}`:`${Number.parseFloat(l.toPrecision(4))}`;return r(`${h} - ${_}`,f,D)}}}const ea=1e4,yc=async(e,t,n,r={})=>{const i=Math.max(0,r.maxRecords??ea),o=Math.min(ot,Math.max(1,r.pageSize??ot)),c=[];let l=t.query.cursor,f;for(;c.length<i;){const p=Math.min(o,i-c.length),y=await e({datasource:t.datasource,query:{...t.query,size:p,...l?{cursor:l}:{}}},n);if(f=y,c.push(...y.results??[]),r.onPage?.(c.length,y),l=y.meta?.cursor,!l||!y.results?.length||y.results.length<p)break}return{results:c,meta:{...f?.meta??{query_id:"",time_range:{start:"",end:""},size:0},size:c.length},truncated:!!l&&c.length>=i,limit:i}};exports.API_REQUESTS_MAX_PAGE_SIZE=ot;exports.CAPTURE_PREPARE_EVENT=Ce;exports.CAPTURE_RESTORE_EVENT=Ie;exports.COUNTRIES=wt;exports.DEFAULT_MAX_REQUEST_RECORDS=ea;exports.DeltaQueryTime=zs;exports.EXPORT_RECORD_LIMIT=Pi;exports.Granularities=$;exports.INJECT_QUERY_PROVIDER=xi;exports.PLATFORM_DATASOURCES=Wn;exports.REFRESH_INTERVAL_MS=Ri;exports.SeededRandom=He;exports.TIMEFRAME_LOOKUP=cc;exports.TimePeriods=Qr;exports.Timeframe=S;exports.TimeframeKeys=d;exports.TimeseriesQueryTime=Vs;exports.UnaryQueryTime=$r;exports.agenticExploreAggregations=Vn;exports.agenticUsageSchema=gr;exports.aiExploreAggregations=Fn;exports.apiRequestsExtraFieldSchema=Dr;exports.apiRequestsQuerySchema=Sr;exports.apiUsageQuerySchema=pr;exports.barChartSchema=Xn;exports.basicExploreAggregations=mt;exports.basicQuerySchema=hr;exports.ceilToNearestTimeGrain=vt;exports.chartTileConfigSchema=Pr;exports.choroplethMapSchema=dr;exports.columnIconSet=ir;exports.countries=Kr;exports.dashboardConfigSchema=Zi;exports.dashboardTileTypes=Li;exports.datasourceToFilterableDimensions=$n;exports.datePickerSelectionToTimeframe=ic;exports.donutChartSchema=nr;exports.dstOffsetHours=lt;exports.exploreAggregations=ft;exports.exploreFilterTypesV2=Yn;exports.extendedRelativeTimeRangeValues=Ni;exports.fetchAllRequests=yc;exports.filterableAgenticExploreDimensions=_e;exports.filterableAiExploreDimensions=ge;exports.filterableBasicExploreDimensions=he;exports.filterableExploreDimensions=ye;exports.filterableManagedCacheExploreDimensions=Fe;exports.filterablePlatformPresetFilterDimensions=mr;exports.filterableRequestDimensions=ht;exports.filterableRequestMetrics=yt;exports.filterableRequestWildcardDimensions=Ln;exports.finestGranularityForDuration=Ws;exports.floorToNearestTimeGrain=zr;exports.formatTime=ut;exports.formatTimeRange=Hs;exports.formatTimestamp=Us;exports.gaugeChartSchema=tr;exports.generateCrossSectionalData=Zr;exports.generateData=uc;exports.generateMultipleMetricTimeSeriesData=lc;exports.generateSingleMetricTimeSeriesData=Br;exports.getCountryName=dc;exports.getFieldDataSources=Ki;exports.granularitiesToOptions=Ls;exports.granularityMsToQuery=Wr;exports.granularityValues=dt;exports.heatmapChartSchema=rr;exports.isPlatformDatasource=Fi;exports.llmUsageSchema=yr;exports.managedCacheExploreAggregations=zn;exports.managedCacheUsageQuerySchema=_r;exports.metricCardSchema=ur;exports.msToGranularity=js;exports.numberFormatter=Ne;exports.platformQuerySchema=br;exports.platformTabularQuerySchema=Tr;exports.prepareForCapture=Ei;exports.queryDatasources=Ui;exports.queryableAgenticExploreDimensions=gt;exports.queryableAiExploreDimensions=pt;exports.queryableBasicExploreDimensions=Ye;exports.queryableExploreDimensions=qe;exports.queryableManagedCacheExploreDimensions=_t;exports.queryableRequestDimensions=Un;exports.queryableRequestMetrics=jn;exports.queryableRequestWildcardDimensions=Hn;exports.rand=Rt;exports.registerCapture=Gn;exports.registerWebglCapture=vi;exports.relativeTimeRangeValuesRequestV2=qi;exports.relativeTimeRangeValuesV4=Yi;exports.reportChartTypes=Ci;exports.requestFilterTypeEmptyV2=qn;exports.requestFilterTypeEqualsV2=Ii;exports.requestFilterTypeMetricV2=Ai;exports.requestFilterTypeWildcardV2=ki;exports.restoreAfterCapture=Oi;exports.scatterChartSchema=St;exports.scatterPercentileLineSchema=er;exports.singleValueSchema=lr;exports.slottableSchema=Bn;exports.slottableTileConfigSchema=xr;exports.stripUnknownFilters=Hi;exports.tableChartSchema=cr;exports.thresholdSchema=Zn;exports.tileConfigSchema=Nr;exports.tileDefinitionSchema=Rr;exports.tileLayoutSchema=Et;exports.timeRangeTypeV2=Gi;exports.timeframeToDatepickerSelection=oc;exports.timeframeToDatepickerTimeperiod=sc;exports.timeseriesChartSchema=Jn;exports.topNColumnOptionsSchema=Mt;exports.topNTableSchema=or;exports.topTalkersSchema=sr;exports.treemapChartSchema=ar;exports.unitFormatter=hc;exports.unitPlacement=Jr;exports.validDashboardChartQuery=Er;exports.validDashboardQuery=zi;exports.validDashboardTableQuery=vr;exports.yAxisPositions=Kn;exports.yAxisSchema=st;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ce="kapture:prepare",Ie="kapture:restore";async function Ei(){const e=[];window.dispatchEvent(new CustomEvent(Ce,{detail:{waitUntil:t=>e.push(t)}})),await Promise.allSettled(e)}function Oi(){window.dispatchEvent(new CustomEvent(Ie))}function Gn(e){let t;const n=()=>{t?.(),t=void 0},r=i=>{i.detail?.waitUntil((async()=>{t=await e()})())};return window.addEventListener(Ce,r),window.addEventListener(Ie,n),()=>{window.removeEventListener(Ce,r),window.removeEventListener(Ie,n),n()}}function vi(e,t={}){return Gn(async()=>{const n=e();if(!n)return;t.redraw?.();const r=new Image;return r.src=n.toDataURL("image/png"),await r.decode(),r.style.cssText=`position:absolute;top:0;left:0;width:${n.clientWidth}px;height:${n.clientHeight}px;`,n.parentElement?.appendChild(r),n.style.visibility="hidden",()=>{r.remove(),n.style.visibility=""}})}const Ri=30*1e3,Pi=1e3,xi="analytics-query-provider";var d=(e=>(e.FIFTEEN_MIN="15m",e.ONE_HOUR="1h",e.SIX_HOUR="6h",e.TWELVE_HOUR="12h",e.ONE_DAY="24h",e.SEVEN_DAY="7d",e.THIRTY_DAY="30d",e.NINETY_DAY="90d",e.ONE_HUNDRED_EIGHTY_DAY="180d",e.ONE_YEAR="365d",e.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.CURRENT_YEAR="current_year",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e.PREVIOUS_YEAR="previous_year",e))(d||{});const Ni=["90d","180d","365d","current_quarter","previous_quarter","current_year","previous_year"],Ci=["horizontal_bar","vertical_bar","timeseries_line","choropleth_map","timeseries_bar","donut","single_value","top_n","table","scatter","heatmap","treemap"],Yn=["in","not_in","selector"],Ii=["=","!="],Ai=["=","!=","<",">","<=",">="],qn=["empty","not_empty"],ki=["starts_with","ends_with"],Gi=["absolute","relative"],Yi=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],dt=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Q=e=>e.filter(t=>t!=="time"),Ye=["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"],he=Q(Ye),mt=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],qe=[...Ye,"ai_gateway","ai_gateway_consumer","ai_gateway_consumer_group","ai_gateway_data_plane_node","application","bot_info_action","bot_info_detection_reason","bot_info_ban_type","cache_status","consumer","consumer_group","country_code","oidc_credential","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm","portal_api","principal"],ye=Q(qe),ft=[...mt,"share_of_requests","cache_hit_rate","response_latency_p99","response_latency_p95","response_latency_p50","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","kong_internal_latency_p99","kong_internal_latency_p95","kong_internal_latency_p50","kong_internal_latency_average","response_size_p99","response_size_p95","response_size_p50","response_size_average","response_size_sum","request_size_p99","request_size_p95","request_size_p50","request_size_average","request_size_sum"],pt=["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","upstream_status_code","upstream_status_code_grouped","response_source"],ge=Q(pt),Fn=["active_agents","ai_request_count","cached_tokens","completion_tokens","cost","cost_per_request_average","error_rate","llm_cache_embeddings_latency_average","llm_cache_fetch_latency_average","llm_embeddings_cost","llm_embeddings_tokens","llm_latency_average","llm_latency_p50","llm_latency_p95","llm_latency_p99","prompt_tokens","share_of_cost","share_of_requests","time_per_token_average","time_per_token_p50","time_per_token_p95","time_per_token_p99","time_to_first_token_average","time_to_first_token_p50","time_to_first_token_p95","time_to_first_token_p99","total_tokens","total_tokens_per_minute"],Un=["a2a_context_id","a2a_error","a2a_method","a2a_task_id","a2a_task_state","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"],ht=Q(Un),Hn=["auth_type","cache_status","client_ip","data_plane_node_version","header_host","header_user_agent","http_method","oidc_credential","request_id","request_uri","response_header_content_type","response_source","service_port","service_protocol","trace_id","upstream_uri"],Ln=Hn,jn=["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"],yt=Q(jn),qi=["15M","1H","6H","12H","24H","7D"],ot=1e3,Wn=["platform","platform_usage"],Fi=e=>Wn.includes(e),gt=[...qe.filter(e=>e!=="consumer_group"),"a2a_context_id","a2a_error","a2a_method","a2a_task_id","a2a_task_state","ai_gateway_agent","ai_gateway_mcp_server","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],_e=Q(gt),Vn=[...ft,"a2a_latency_average","a2a_response_size_sum","active_agents","mcp_latency_average","mcp_latency_p99","mcp_latency_p95","mcp_latency_p50","mcp_response_size_sum"],_t=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],Fe=Q(_t),zn=["cache_eviction_rate","cache_expiration_rate","cache_items_average","cache_memory_utilization_max"],Ui=["basic","api_usage","llm_usage","agentic_usage","platform","platform_usage","managed_cache_usage"],$n={basic:new Set(he),api_usage:new Set(ye),llm_usage:new Set(ge),agentic_usage:new Set(_e),platform:new Set,platform_usage:new Set,managed_cache_usage:new Set(Fe)},Hi=(e,t)=>e.startsWith("goap")||e==="platform"||e==="platform_usage"?t:t.filter(n=>$n[e].has(n.field)),wt=[{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"}],Li=["heatmap","treemap","horizontal_bar","vertical_bar","gauge","donut","timeseries_line","timeseries_bar","scatter","golden_signals","top_n","top_talkers","table","slottable","single_value","choropleth_map"],B={type:"string"},N={type:"string"},bt={type:"boolean"},Tt={type:"string",description:"Text rendered in the tile header. Supports the {timeframe} token, "},Qn={type:"object",additionalProperties:{type:"string"}},Dt={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},Bn={type:"object",deprecated:!0,description:"Deprecated: use the top-level tile shape { type: 'slottable', id, layout } instead of a chart-level 'slottable' definition.",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},Xn={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chart_dataset_colors:Dt,synthetics_data_key:B,chart_title:N,allow_csv_export:bt},required:["type"],additionalProperties:!1},Zn={type:"object",properties:{type:{type:"string",enum:["warning","error","neutral"]},value:{type:"number"},label:{type:"string"},highlightIntersections:{type:"boolean",default:!1}},required:["type","value"],additionalProperties:!1},Kn=["left","right"],st={type:"object",properties:{show_grid:{type:"boolean"},title:{type:"string"}},additionalProperties:!1},Jn={type:"object",properties:{type:{type:"string",enum:["timeseries_line","timeseries_bar"]},stacked:{type:"boolean"},threshold:{type:"object",additionalProperties:{type:"array",items:Zn}},metric_axis_map:{type:"object",description:"Maps a metric to the specified y axis, by default the metric will only use the left y axis. Only applies to timeseries_line.",additionalProperties:{type:"string",enum:Kn}},y_axes:{type:"object",properties:{left:st,right:st},additionalProperties:!1},chart_dataset_colors:Dt,synthetics_data_key:B,chart_title:N,allow_csv_export:bt},required:["type"],additionalProperties:!1},er={type:"object",properties:{percentile:{type:"number",minimum:0,maximum:100},label:{type:"string",description:"Overrides the default label."},border_dash:{type:"array",description:"Dash pattern for the line.",items:{type:"number"}},color:{type:"string"}},required:["percentile"],additionalProperties:!1},St={type:"object",description:"Plots one point per record, percentiles are computed from the records returned.",properties:{type:{type:"string",enum:["scatter"]},percentile_lines:{type:"array",description:"Reference lines derived from the plotted values.",items:er},outlier_percentile:{type:"number",description:"Percentile above which points are colored in the outlier color, in place.",minimum:0,maximum:100},shade_outlier_region:{type:"boolean",default:!1},jitter_ms:{type:"number",description:"Maximum horizontal jitter so records sharing a timestamp do not stack into one column.",minimum:0},point_radius:{type:"number",minimum:0},point_opacity:{type:"number",description:"Opacity of plotted points.",minimum:0,maximum:1},chart_dataset_colors:Dt,synthetics_data_key:B,chart_title:N,allow_csv_export:bt},required:["type"],additionalProperties:!1},tr={type:"object",properties:{type:{type:"string",enum:["gauge"]},metric_display:{type:"string",enum:["hidden","single","full"]},reverse_dataset:{type:"boolean"},numerator:{type:"number"},synthetics_data_key:B,chart_title:N},required:["type"],additionalProperties:!1},nr={type:"object",properties:{type:{type:"string",enum:["donut"]},synthetics_data_key:B,chart_title:N},required:["type"],additionalProperties:!1},rr={type:"object",properties:{type:{type:"string",enum:["heatmap"]},chart_title:N},required:["type"],additionalProperties:!1},ar={type:"object",properties:{type:{type:"string",enum:["treemap"]},chart_title:N},required:["type"],additionalProperties:!1},ir=["ai_provider"],Mt={type:"object",properties:{label:{type:"string"},value:{type:"string",enum:["raw","relative"],description:"`relative` shows the value's percentage of the column total across the returned rows next to the raw value."},bar:{type:"string",enum:["relative","max"],description:"Renders a bar sized relative to the column total (`relative`) or the column maximum (`max`)."},icon_set:{type:"string",enum:ir},thresholds:{type:"array",description:"Colors the bar (or the value when there is no bar) once the raw metric value reaches a threshold.",items:{type:"object",properties:{type:{type:"string",enum:["warning","error"]},value:{type:"number"}},required:["type","value"],additionalProperties:!1}}},additionalProperties:!1},or={type:"object",properties:{chart_title:N,synthetics_data_key:B,type:{type:"string",enum:["top_n"]},description:{type:"string",deprecated:!0,description:"Deprecated: use `header_description` on the tile definition."},entity_link:{type:"string"},entity_links:Qn,column_options:{type:"object",description:"Per-column rendering options keyed by metric or dimension name.",additionalProperties:Mt}},required:["type"],additionalProperties:!1},L=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:Yn},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:qn}},required:["field","operator"],additionalProperties:!1}]}}),ji={type:"object",properties:{dimension:{type:"string",description:"Dimension to group this column by."},label:{type:"string",description:"Column heading, defaults to the translated dimension name."},filters:{...L(),description:"Filters applied to this column only, in addition to the query filters."}},required:["dimension"],additionalProperties:!1},sr={type:"object",properties:{chart_title:N,synthetics_data_key:B,type:{type:"string",enum:["top_talkers"]},columns:{type:"array",minItems:1,items:ji},size_metric:{type:"string",description:"Metric for computing the block size and the percentage label, defaults to the first entry in the query metrics."},column_options:{type:"object",description:"Per-metric or per-dimension rendering options, keyed by name. Applies to tooltip rows as well as headings.",additionalProperties:Mt},entity_links:Qn},required:["type","columns"],additionalProperties:!1},cr={type:"object",properties:{type:{type:"string",enum:["table"]},chart_title:N},required:["type"],additionalProperties:!1},ur={type:"object",properties:{chart_title:N,type:{type:"string",enum:["golden_signals"]},long_card_titles:{type:"boolean"},percentile_latency:{type:"boolean"}},required:["type"],additionalProperties:!1},lr={type:"object",properties:{type:{type:"string",enum:["single_value"]},decimal_points:{type:"number"},align_x:{type:"string",enum:["left","center","right"]},chart_title:N},required:["type"],additionalProperties:!1},dr={type:"object",properties:{type:{type:"string",enum:["choropleth_map"]},chart_title:N,fit_to_country:{type:"string",enum:wt.map(e=>e.code)},legend:{type:"boolean",default:!1},bounds:{type:"array",minItems:2,maxItems:2,items:{type:"array",minItems:2,maxItems:2,items:[{type:"number",minimum:-180,maximum:180},{type:"number",minimum:-90,maximum:90}]}}},required:["type"],additionalProperties:!1},Wi={type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string"}},required:["type","time_range"],additionalProperties:!1},Vi={type:"object",description:"A duration representing an exact start and end time.",properties:{tz:{type:"string"},type:{type:"string",enum:["absolute"]},start:{type:"string"},end:{type:"string"}},required:["type","start","end"],additionalProperties:!1},X={granularity:{type:"string",description:'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',enum:dt},time_range:{type:"object",description:"The time range to query.",anyOf:[Wi,Vi],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},se=e=>({type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",...e?{enum:e}:{}}}),ce=e=>({type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:3,items:{type:"string",...e?{enum:e}:{}}}),mr=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"],fr=()=>({type:"array",description:"A list of filters to apply to the platform query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string"},operator:{type:"string"},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string"},operator:{type:"string"}},required:["field","operator"],additionalProperties:!1}]}}),pr={type:"object",description:"A query to launch at the advanced explore API",properties:{datasource:{type:"string",enum:["api_usage"]},metrics:se(ft),dimensions:ce(qe),filters:L(ye),...X},required:["datasource"],additionalProperties:!1},hr={type:"object",description:"A query to launch at the basic explore API",properties:{datasource:{type:"string",enum:["basic"]},metrics:se(mt),dimensions:ce(Ye),filters:L(he),...X},required:["datasource"],additionalProperties:!1},yr={type:"object",description:"A query to launch at the AI explore API",properties:{datasource:{type:"string",enum:["llm_usage"]},metrics:se(Fn),dimensions:ce(pt),filters:L(ge),...X},required:["datasource"],additionalProperties:!1},gr={type:"object",description:"A query to launch at the Agentic explore API",properties:{datasource:{type:"string",enum:["agentic_usage"]},metrics:se(Vn),dimensions:ce(gt),filters:L(_e),...X},required:["datasource"],additionalProperties:!1},_r={type:"object",description:"A query to launch at the Managed Cache explore API",properties:{datasource:{type:"string",enum:["managed_cache_usage"]},metrics:se(zn),dimensions:ce(_t),filters:L(Fe),...X},required:["datasource"],additionalProperties:!1},wr={oneOf:[{const:"platform_usage"},{const:"platform",deprecated:!0,description:"Deprecated: use 'platform_usage'."}]},br={type:"object",description:"A query to launch at the platform dashboard API. Use datasource 'platform_usage'; 'platform' is accepted for backward compatibility but deprecated.",properties:{datasource:wr,metrics:se(),dimensions:ce(),filters:fr(),...X},required:["datasource"],additionalProperties:!1},Tr={type:"object",description:"A query to launch at the platform tabular explore API. Use datasource 'platform_usage'; 'platform' is accepted for backward compatibility but deprecated.",properties:{datasource:wr,entity:{type:"string"},columns:{type:"array",minItems:1,items:{type:"string"}},filters:fr(),cursor:{type:"string"},page_size:{type:"number"}},required:["datasource"],additionalProperties:!1},Dr={type:"object",properties:{field:{type:"string",description:"Field to read, dotted for a nested one."},label:{type:"string",description:"Tooltip label, defaults to the field name."},unit:{type:"string",description:"Unit to format the value with, e.g. `ms` or `token count`."}},required:["field"],additionalProperties:!1},Sr={type:"object",description:"A query for the api-requests endpoint.",properties:{datasource:{type:"string",enum:["requests"]},metric:{type:"string",description:"Field plotted on the y axis."},dimension:{type:"string",description:"Field used to split points into series."},filters:L(Array.from(new Set([...ht,...Ln,...yt]))),time_range:X.time_range,max_records:{type:"number",description:"Ceiling on records gathered across pages. The endpoint serves at most 1000 per page. Defaults to 10000.",minimum:1},unroll:{type:"string",description:"A nested collection on a request record (`ai`, `mcp_info.rpc`) to expand into one point per entry rather than one per request."},extra_fields:{type:"array",description:"Values to annotate each point with in the tooltip. Read from the unrolled entry first, then the request record.",items:Dr}},required:["datasource","metric"],additionalProperties:!1},Mr=[pr,hr,yr,gr,_r,br],Er={anyOf:Mr},Or=[Tr],vr={anyOf:Or},zi={anyOf:[...Mr,...Or]},$i={anyOf:[Xn,tr,nr,rr,ar,Jn,St,ur,or,sr,Bn,lr,dr]},Qi={type:"object",properties:{query:Er,chart:$i,header_description:Tt},required:["query","chart"],additionalProperties:!1},Bi={type:"object",properties:{query:vr,chart:cr,header_description:Tt},required:["query","chart"],additionalProperties:!1},Xi={type:"object",properties:{query:Sr,chart:St,header_description:Tt},required:["query","chart"],additionalProperties:!1},Rr={anyOf:[Qi,Bi,Xi]},Et={type:"object",properties:{position:{type:"object",properties:{col:{type:"number"},row:{type:"number"}},description:"Position of the tile in the grid.",required:["col","row"],additionalProperties:!1},size:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"},fit_to_content:{type:"boolean"}},description:"Number of columns and rows the tile occupies. If fitToContent is true for every tile in a row, and each tile only occupies 1 row, then the row will auto-fit to its content.",required:["cols","rows"],additionalProperties:!1}},required:["position","size"],additionalProperties:!1},Pr={type:"object",properties:{type:{type:"string",enum:["chart"]},definition:Rr,layout:Et,id:{type:"string",description:"Unique identifier for the tile. If not provided, one will be generated."}},required:["type","definition","layout"],additionalProperties:!1},xr={type:"object",description:"A tile that renders arbitrary content into a named slot instead of a chart. The slot name is the tile `id`.",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string",description:"Unique identifier for the tile, and the name of the slot the host application should supply."},layout:Et},required:["type","id","layout"],additionalProperties:!1},Nr={anyOf:[Pr,xr]},Zi={type:"object",properties:{tiles:{type:"array",items:Nr},tile_height:{type:"number",description:"Height of each tile in pixels."},columns:{type:"number",description:"Number of columns in the dashboard grid."},preset_filters:L([...new Set([...ye,...he,...ge,..._e,...mr,...Fe])]),template_id:{type:["string","null"],description:"Template id which was used to instantiate this dashboard."}},required:["tiles"],additionalProperties:!1},Ki=e=>{const t=[];return he.includes(e)&&t.push("basic"),ye.includes(e)&&t.push("api_usage"),ge.includes(e)&&t.push("llm_usage"),_e.includes(e)&&t.push("agentic_usage"),(ht.includes(e)||yt.includes(e))&&t.push("requests"),t},Ji={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"}},eo=(e,t,n)=>{let r;const i=Ji[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function et(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const to={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},no={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ro={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ao={date:et({formats:to,defaultWidth:"full"}),time:et({formats:no,defaultWidth:"full"}),dateTime:et({formats:ro,defaultWidth:"full"})},io={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},oo=(e,t,n,r)=>io[e];function de(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const c=e.defaultFormattingWidth||e.defaultWidth,l=n?.width?String(n.width):c;i=e.formattingValues[l]||e.formattingValues[c]}else{const c=e.defaultWidth,l=n?.width?String(n.width):e.defaultWidth;i=e.values[l]||e.values[c]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const so={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},co={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},uo={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"]},lo={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"]},mo={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"}},fo={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"}},po=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ho={ordinalNumber:po,era:de({values:so,defaultWidth:"wide"}),quarter:de({values:co,defaultWidth:"wide",argumentCallback:e=>e-1}),month:de({values:uo,defaultWidth:"wide"}),day:de({values:lo,defaultWidth:"wide"}),dayPeriod:de({values:mo,defaultWidth:"wide",formattingValues:fo,defaultFormattingWidth:"wide"})};function me(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const c=o[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],f=Array.isArray(l)?go(l,g=>g.test(c)):yo(l,g=>g.test(c));let p;p=e.valueCallback?e.valueCallback(f):f,p=n.valueCallback?n.valueCallback(p):p;const y=t.slice(c.length);return{value:p,rest:y}}}function yo(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function go(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function _o(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let c=e.valueCallback?e.valueCallback(o[0]):o[0];c=n.valueCallback?n.valueCallback(c):c;const l=t.slice(i.length);return{value:c,rest:l}}}const wo=/^(\d+)(th|st|nd|rd)?/i,bo=/\d+/i,To={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},Do={any:[/^b/i,/^(a|c)/i]},So={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Mo={any:[/1/i,/2/i,/3/i,/4/i]},Eo={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},Oo={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]},vo={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},Ro={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]},Po={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},xo={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}},No={ordinalNumber:_o({matchPattern:wo,parsePattern:bo,valueCallback:e=>parseInt(e,10)}),era:me({matchPatterns:To,defaultMatchWidth:"wide",parsePatterns:Do,defaultParseWidth:"any"}),quarter:me({matchPatterns:So,defaultMatchWidth:"wide",parsePatterns:Mo,defaultParseWidth:"any",valueCallback:e=>e+1}),month:me({matchPatterns:Eo,defaultMatchWidth:"wide",parsePatterns:Oo,defaultParseWidth:"any"}),day:me({matchPatterns:vo,defaultMatchWidth:"wide",parsePatterns:Ro,defaultParseWidth:"any"}),dayPeriod:me({matchPatterns:Po,defaultMatchWidth:"any",parsePatterns:xo,defaultParseWidth:"any"})},Co={code:"en-US",formatDistance:eo,formatLong:ao,formatRelative:oo,localize:ho,match:No,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Io={};function we(){return Io}const Cr=6048e5,Ao=864e5,ko=60,Go=3600,dn=Symbol.for("constructDateFrom");function I(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&dn in e?e[dn](t):e instanceof Date?new e.constructor(t):new Date(t)}function M(e,t){return I(t||e,e)}function mn(e){const t=M(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Yo(e,...t){const n=I.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function ae(e,t){const n=M(e,t?.in);return n.setHours(0,0,0,0),n}function qo(e,t,n){const[r,i]=Yo(n?.in,e,t),o=ae(r),c=ae(i),l=+o-mn(o),f=+c-mn(c);return Math.round((l-f)/Ao)}function Fo(e,t){const n=M(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Uo(e,t){const n=M(e,t?.in);return qo(n,Fo(n))+1}function F(e,t){const n=we(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=M(e,t?.in),o=i.getDay(),c=(o<r?7:0)+o-r;return i.setDate(i.getDate()-c),i.setHours(0,0,0,0),i}function Ae(e,t){return F(e,{...t,weekStartsOn:1})}function Ir(e,t){const n=M(e,t?.in),r=n.getFullYear(),i=I(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const o=Ae(i),c=I(n,0);c.setFullYear(r,0,4),c.setHours(0,0,0,0);const l=Ae(c);return n.getTime()>=o.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function Ho(e,t){const n=Ir(e,t),r=I(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Ae(r)}function Lo(e,t){const n=M(e,t?.in),r=+Ae(n)-+Ho(n);return Math.round(r/Cr)+1}function Ar(e,t){const n=M(e,t?.in),r=n.getFullYear(),i=we(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,c=I(t?.in||e,0);c.setFullYear(r+1,0,o),c.setHours(0,0,0,0);const l=F(c,t),f=I(t?.in||e,0);f.setFullYear(r,0,o),f.setHours(0,0,0,0);const p=F(f,t);return+n>=+l?r+1:+n>=+p?r:r-1}function jo(e,t){const n=we(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Ar(e,t),o=I(t?.in||e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),F(o,t)}function Wo(e,t){const n=M(e,t?.in),r=+F(n,t)-+jo(n,t);return Math.round(r/Cr)+1}function b(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const H={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return b(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):b(n+1,2)},d(e,t){return b(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return b(e.getHours()%12||12,t.length)},H(e,t){return b(e.getHours(),t.length)},m(e,t){return b(e.getMinutes(),t.length)},s(e,t){return b(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return b(i,t.length)}},te={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},fn={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return H.y(e,t)},Y:function(e,t,n,r){const i=Ar(e,r),o=i>0?i:1-i;if(t==="YY"){const c=o%100;return b(c,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):b(o,t.length)},R:function(e,t){const n=Ir(e);return b(n,t.length)},u:function(e,t){const n=e.getFullYear();return b(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return b(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return b(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return H.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return b(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=Wo(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):b(i,t.length)},I:function(e,t,n){const r=Lo(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):b(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):H.d(e,t)},D:function(e,t,n){const r=Uo(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):b(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return b(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return b(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return b(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=te.noon:r===0?i=te.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=te.evening:r>=12?i=te.afternoon:r>=4?i=te.morning:i=te.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return H.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):H.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):b(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):b(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):H.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):H.s(e,t)},S:function(e,t){return H.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return hn(r);case"XXXX":case"XX":return z(r);default:return z(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return hn(r);case"xxxx":case"xx":return z(r);default:return z(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+pn(r,":");default:return"GMT"+z(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+pn(r,":");default:return"GMT"+z(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return b(r,t.length)},T:function(e,t,n){return b(+e,t.length)}};function pn(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+b(o,2)}function hn(e,t){return e%60===0?(e>0?"-":"+")+b(Math.abs(e)/60,2):z(e,t)}function z(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=b(Math.trunc(r/60),2),o=b(r%60,2);return n+i+t+o}const yn=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},kr=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},Vo=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return yn(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",yn(r,t)).replace("{{time}}",kr(i,t))},zo={p:kr,P:Vo},$o=/^D+$/,Qo=/^Y+$/,Bo=["D","DD","YY","YYYY"];function Xo(e){return $o.test(e)}function Zo(e){return Qo.test(e)}function Ko(e,t,n){const r=Jo(e,t,n);if(console.warn(r),Bo.includes(e))throw new RangeError(r)}function Jo(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function es(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ts(e){return!(!es(e)&&typeof e!="number"||isNaN(+M(e)))}const ns=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rs=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,as=/^'([^]*?)'?$/,is=/''/g,os=/[a-zA-Z]/;function ss(e,t,n){const r=we(),i=n?.locale??r.locale??Co,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,c=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=M(e,n?.in);if(!ts(l))throw new RangeError("Invalid time value");let f=t.match(rs).map(y=>{const g=y[0];if(g==="p"||g==="P"){const w=zo[g];return w(y,i.formatLong)}return y}).join("").match(ns).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const g=y[0];if(g==="'")return{isToken:!1,value:cs(y)};if(fn[g])return{isToken:!0,value:y};if(g.match(os))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:y}});i.localize.preprocessor&&(f=i.localize.preprocessor(l,f));const p={firstWeekContainsDate:o,weekStartsOn:c,locale:i};return f.map(y=>{if(!y.isToken)return y.value;const g=y.value;(!n?.useAdditionalWeekYearTokens&&Zo(g)||!n?.useAdditionalDayOfYearTokens&&Xo(g))&&Ko(g,t,String(e));const w=fn[g[0]];return w(l,g,i.localize,p)}).join("")}function cs(e){const t=e.match(as);return t?t[1].replace(is,"'"):e}function Re(e,t,n){const r=M(e,n?.in);return isNaN(t)?I(e,NaN):(r.setDate(r.getDate()+t),r)}function Gr(e,t,n){const r=M(e,n?.in);if(isNaN(t))return I(e,NaN);if(!t)return r;const i=r.getDate(),o=I(e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const c=o.getDate();return i>=c?o:(r.setFullYear(o.getFullYear(),o.getMonth(),i),r)}function us(e,t,n){return Gr(e,t*3,n)}function ie(e,t){const n=M(e,t?.in),r=n.getMonth(),i=r-r%3;return n.setMonth(i,1),n.setHours(0,0,0,0),n}function oe(e,t){const n=M(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function ls(e,t){const n=M(e,t?.in),r=n.getFullYear(),i=n.getMonth(),o=I(n,0);return o.setFullYear(r,i+1,0),o.setHours(0,0,0,0),o.getDate()}function ds(){return Object.assign({},we())}function gn(e){return+M(e)}function _n(e){return Math.trunc(+M(e)/1e3)}function wn(e){return Math.trunc(e*Go)}function ms(e){const t=e/ko;return Math.trunc(t)}function Yr(e,t,n){return Gr(e,-1,n)}function qr(e,t,n){return us(e,-1,n)}function bn(e,t,n){const r=ds(),i=hs(e,n.timeZone,n.locale??r.locale);return"formatToParts"in i?fs(i,t):ps(i,t)}function fs(e,t){const n=e.formatToParts(t);for(let r=n.length-1;r>=0;--r)if(n[r].type==="timeZoneName")return n[r].value}function ps(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/ [\w-+ ]+$/.exec(n);return r?r[0].substr(1):""}function hs(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function ys(e,t){const n=Ts(t);return"formatToParts"in n?_s(n,e):ws(n,e)}const gs={year:0,month:1,day:2,hour:3,minute:4,second:5};function _s(e,t){try{const n=e.formatToParts(t),r=[];for(let i=0;i<n.length;i++){const o=gs[n[i].type];o!==void 0&&(r[o]=parseInt(n[i].value,10))}return r}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function ws(e,t){const n=e.format(t),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(r[3],10),parseInt(r[1],10),parseInt(r[2],10),parseInt(r[4],10),parseInt(r[5],10),parseInt(r[6],10)]}const tt={},Tn=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")),bs=Tn==="06/25/2014, 00:00:00"||Tn==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Ts(e){return tt[e]||(tt[e]=bs?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),tt[e]}function Ot(e,t,n,r,i,o,c){const l=new Date(0);return l.setUTCFullYear(e,t,n),l.setUTCHours(r,i,o,c),l}const Dn=36e5,Ds=6e4,nt={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function be(e,t,n){if(!e)return 0;let r=nt.timezoneZ.exec(e);if(r)return 0;let i,o;if(r=nt.timezoneHH.exec(e),r)return i=parseInt(r[1],10),Sn(i)?-(i*Dn):NaN;if(r=nt.timezoneHHMM.exec(e),r){i=parseInt(r[2],10);const c=parseInt(r[3],10);return Sn(i,c)?(o=Math.abs(i)*Dn+c*Ds,r[1]==="+"?-o:o):NaN}if(Es(e)){t=new Date(t||Date.now());const c=n?t:Ss(t),l=ct(c,e);return-(n?l:Ms(t,l,e))}return NaN}function Ss(e){return Ot(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function ct(e,t){const n=ys(e,t),r=Ot(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let i=e.getTime();const o=i%1e3;return i-=o>=0?o:1e3+o,r-i}function Ms(e,t,n){let i=e.getTime()-t;const o=ct(new Date(i),n);if(t===o)return t;i-=o-t;const c=ct(new Date(i),n);return o===c?o:Math.max(o,c)}function Sn(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Mn={};function Es(e){if(Mn[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Mn[e]=!0,!0}catch{return!1}}const Os=60*1e3,vs={X:function(e,t,n){const r=rt(n.timeZone,e);if(r===0)return"Z";switch(t){case"X":return En(r);case"XXXX":case"XX":return re(r);default:return re(r,":")}},x:function(e,t,n){const r=rt(n.timeZone,e);switch(t){case"x":return En(r);case"xxxx":case"xx":return re(r);default:return re(r,":")}},O:function(e,t,n){const r=rt(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+Rs(r,":");default:return"GMT"+re(r,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return bn("short",e,n);default:return bn("long",e,n)}}};function rt(e,t){const n=e?be(e,t,!0)/Os:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function ke(e,t){const n=e<0?"-":"";let r=Math.abs(e).toString();for(;r.length<t;)r="0"+r;return n+r}function re(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=ke(Math.floor(r/60),2),o=ke(Math.floor(r%60),2);return n+i+t+o}function En(e,t){return e%60===0?(e>0?"-":"+")+ke(Math.abs(e)/60,2):re(e,t)}function Rs(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+ke(o,2)}function On(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const Fr=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,at=36e5,vn=6e4,Ps=2,O={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:Fr};function Ge(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?Ps:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const r=xs(e),{year:i,restDateString:o}=Ns(r.date,n),c=Cs(o,i);if(c===null||isNaN(c.getTime()))return new Date(NaN);if(c){const l=c.getTime();let f=0,p;if(r.time&&(f=Is(r.time),f===null||isNaN(f)))return new Date(NaN);if(r.timeZone||t.timeZone){if(p=be(r.timeZone||t.timeZone,new Date(l+f)),isNaN(p))return new Date(NaN)}else p=On(new Date(l+f)),p=On(new Date(l+f+p));return new Date(l+f+p)}else return new Date(NaN)}function xs(e){const t={};let n=O.dateTimePattern.exec(e),r;if(n?(t.date=n[1],r=n[3]):(n=O.datePattern.exec(e),n?(t.date=n[1],r=n[2]):(t.date=null,r=e)),r){const i=O.timeZone.exec(r);i?(t.time=r.replace(i[1],""),t.timeZone=i[1].trim()):t.time=r}return t}function Ns(e,t){if(e){const n=O.YYY[t],r=O.YYYYY[t];let i=O.YYYY.exec(e)||r.exec(e);if(i){const o=i[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(i=O.YY.exec(e)||n.exec(e),i){const o=i[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function Cs(e,t){if(t===null)return null;let n,r,i;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let o=O.MM.exec(e);if(o)return n=new Date(0),r=parseInt(o[1],10)-1,Pn(t,r)?(n.setUTCFullYear(t,r),n):new Date(NaN);if(o=O.DDD.exec(e),o){n=new Date(0);const c=parseInt(o[1],10);return Gs(t,c)?(n.setUTCFullYear(t,0,c),n):new Date(NaN)}if(o=O.MMDD.exec(e),o){n=new Date(0),r=parseInt(o[1],10)-1;const c=parseInt(o[2],10);return Pn(t,r,c)?(n.setUTCFullYear(t,r,c),n):new Date(NaN)}if(o=O.Www.exec(e),o)return i=parseInt(o[1],10)-1,xn(i)?Rn(t,i):new Date(NaN);if(o=O.WwwD.exec(e),o){i=parseInt(o[1],10)-1;const c=parseInt(o[2],10)-1;return xn(i,c)?Rn(t,i,c):new Date(NaN)}return null}function Is(e){let t,n,r=O.HH.exec(e);if(r)return t=parseFloat(r[1].replace(",",".")),it(t)?t%24*at:NaN;if(r=O.HHMM.exec(e),r)return t=parseInt(r[1],10),n=parseFloat(r[2].replace(",",".")),it(t,n)?t%24*at+n*vn:NaN;if(r=O.HHMMSS.exec(e),r){t=parseInt(r[1],10),n=parseInt(r[2],10);const i=parseFloat(r[3].replace(",","."));return it(t,n,i)?t%24*at+n*vn+i*1e3:NaN}return null}function Rn(e,t,n){t=t||0,n=n||0;const r=new Date(0);r.setUTCFullYear(e,0,4);const i=r.getUTCDay()||7,o=t*7+n+1-i;return r.setUTCDate(r.getUTCDate()+o),r}const As=[31,28,31,30,31,30,31,31,30,31,30,31],ks=[31,29,31,30,31,30,31,31,30,31,30,31];function Ur(e){return e%400===0||e%4===0&&e%100!==0}function Pn(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const r=Ur(e);if(r&&n>ks[t]||!r&&n>As[t])return!1}return!0}function Gs(e,t){if(t<1)return!1;const n=Ur(e);return!(n&&t>366||!n&&t>365)}function xn(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function it(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const Ys=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function qs(e,t,n={}){t=String(t);const r=t.match(Ys);if(r){const i=Ge(n.originalDate||e,n);t=r.reduce(function(o,c){if(c[0]==="'")return o;const l=o.indexOf(c),f=o[l-1]==="'",p=o.replace(c,"'"+vs[c[0]](i,c,n)+"'");return f?p.substring(0,l-1)+p.substring(l+1):p},t)}return ss(e,t,n)}function Hr(e,t,n){e=Ge(e,n);const r=be(t,e,!0),i=new Date(e.getTime()-r),o=new Date(0);return o.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),o.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),o}function Lr(e,t,n,r){return r={...r,timeZone:t,originalDate:e},qs(Hr(e,t,{timeZone:r.timeZone}),n,r)}function Fs(e,t,n){if(typeof e=="string"&&!e.match(Fr))return Ge(e,{...n,timeZone:t});e=Ge(e,n);const r=Ot(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),i=be(t,new Date(r));return new Date(r+i)}function jr(e,t){return-be(e,t)}function Us(e,t={}){const n=t?.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;let r="MMM dd, yyy hh:mm a";switch(t.format){case"short":r="MMM dd, yyyy";break;case"default":r="MMM dd, yyyy hh:mm a";break;case"full":r="MMM dd, yyyy hh:mm:ss.SSS a";break}return t.includeTZ&&(r+=" (z)"),Lr(e,n,r)}function ut(e,t={}){if(!e)return e;const n=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let r="MMM dd, yyy hh:mm a";t.short&&(r="MMM dd, yyy"),t.includeTZ&&(r+=" (z)");const i=new Date(e);return Lr(i,n,r)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}function Hs(e,t){return`${ut(e.getTime())} - ${ut(t.getTime(),{includeTZ:!0})}`}const $={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 Ls(e,t){return e.map(n=>({value:n,label:t.t(`configuration.vitals.reports.granularity.${n}`)}))}function Wr(e,t){return{duration:e,type:"duration",origin:t}}function js(e){return e&&dt.find(n=>e<=$[n])||null}function Ws(e){const t=$.hourly,n=$.daily;return e<=t?"tenSecondly":e<=6*t?"thirtySecondly":e<=12*t?"minutely":e<=n?"fiveMinutely":e<=7*n?"thirtyMinutely":e<60*n?"hourly":"daily"}function Vr(e,t,n,r){const i=$[n];let o=0;return i>=$.daily&&(r?o=-jr(r,t):o=t.getTimezoneOffset()*60*1e3),new Date(e((t.getTime()-o)/i)*i+o)}function zr(e,t,n){return Vr(Math.floor,e,t,n)}function vt(e,t,n){return Vr(Math.ceil,e,t,n)}class Ue{timeframe;tz;dataGranularity;constructor(t,n,r){if(this.constructor===Ue)throw new Error("BaseQueryTime is not meant to be used directly.");this.timeframe=t,this.tz=n,this.dataGranularity=r??t.dataGranularity}calculateStartDate(t,n,r=1){if(t)return new Date(this.endDate().getTime()-this.timeframe.timeframeLengthMs()*r);{const i=this.endDate(),o=this.timeframe.rawStart(this.tz),c=zr(o,n,this.tz),f=(i.getTime()-c.getTime())*(r-1);return new Date(c.getTime()-f)}}granularitySeconds(){return Math.floor(this.granularityMs()/1e3)}granularityDruid(){return Wr(this.granularityMs(),this.startDate().toISOString())}startSeconds(){return _n(this.startDate())}endSeconds(){return _n(this.endDate())}startMs(){return gn(this.startDate())}endMs(){return gn(this.endDate())}}class Vs extends Ue{granularity;constructor(t,n,r,i,o){super(t,r,i),n&&t.allowedGranularities(o).has(n)?this.granularity=n:o?this.granularity=t.fineGrainedDefaultGranularity??t.defaultResponseGranularity:this.granularity=t.defaultResponseGranularity}startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.granularity)}endDate(){return vt(this.timeframe.rawEnd(),this.granularity,this.tz)}granularityMs(){return $[this.granularity]}}class $r extends Ue{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity)}endDate(){return vt(this.timeframe.rawEnd(this.tz),this.dataGranularity,this.tz)}granularityMs(){return this.endDate().getTime()-this.startDate().getTime()}}class zs extends $r{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity,2)}granularityMs(){return this.endDate().getTime()-super.startDate().getTime()}}var Pe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fe={exports:{}};fe.exports;var Nn;function Qs(){return Nn||(Nn=1,(function(e,t){var n=200,r="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",c="[object Array]",l="[object Boolean]",f="[object Date]",p="[object Error]",y="[object Function]",g="[object GeneratorFunction]",w="[object Map]",D="[object Number]",h="[object Object]",_="[object Promise]",v="[object RegExp]",x="[object Set]",C="[object String]",k="[object Symbol]",Le="[object WeakMap]",Pt="[object ArrayBuffer]",Te="[object DataView]",xt="[object Float32Array]",Nt="[object Float64Array]",Ct="[object Int8Array]",It="[object Int16Array]",At="[object Int32Array]",kt="[object Uint8Array]",Gt="[object Uint8ClampedArray]",Yt="[object Uint16Array]",qt="[object Uint32Array]",ta=/[\\^$.*+?()[\]{}|]/g,na=/\w*$/,ra=/^\[object .+?Constructor\]$/,aa=/^(?:0|[1-9]\d*)$/,T={};T[o]=T[c]=T[Pt]=T[Te]=T[l]=T[f]=T[xt]=T[Nt]=T[Ct]=T[It]=T[At]=T[w]=T[D]=T[h]=T[v]=T[x]=T[C]=T[k]=T[kt]=T[Gt]=T[Yt]=T[qt]=!0,T[p]=T[y]=T[Le]=!1;var ia=typeof Pe=="object"&&Pe&&Pe.Object===Object&&Pe,oa=typeof self=="object"&&self&&self.Object===Object&&self,G=ia||oa||Function("return this")(),Ft=t&&!t.nodeType&&t,Ut=Ft&&!0&&e&&!e.nodeType&&e,sa=Ut&&Ut.exports===Ft;function ca(a,s){return a.set(s[0],s[1]),a}function ua(a,s){return a.add(s),a}function la(a,s){for(var u=-1,m=a?a.length:0;++u<m&&s(a[u],u,a)!==!1;);return a}function da(a,s){for(var u=-1,m=s.length,E=a.length;++u<m;)a[E+u]=s[u];return a}function Ht(a,s,u,m){for(var E=-1,R=a?a.length:0;++E<R;)u=s(u,a[E],E,a);return u}function ma(a,s){for(var u=-1,m=Array(a);++u<a;)m[u]=s(u);return m}function fa(a,s){return a?.[s]}function Lt(a){var s=!1;if(a!=null&&typeof a.toString!="function")try{s=!!(a+"")}catch{}return s}function jt(a){var s=-1,u=Array(a.size);return a.forEach(function(m,E){u[++s]=[E,m]}),u}function je(a,s){return function(u){return a(s(u))}}function Wt(a){var s=-1,u=Array(a.size);return a.forEach(function(m){u[++s]=m}),u}var pa=Array.prototype,ha=Function.prototype,De=Object.prototype,We=G["__core-js_shared__"],Vt=(function(){var a=/[^.]+$/.exec(We&&We.keys&&We.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})(),zt=ha.toString,U=De.hasOwnProperty,Se=De.toString,ya=RegExp("^"+zt.call(U).replace(ta,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$t=sa?G.Buffer:void 0,Qt=G.Symbol,Bt=G.Uint8Array,ga=je(Object.getPrototypeOf,Object),_a=Object.create,wa=De.propertyIsEnumerable,ba=pa.splice,Xt=Object.getOwnPropertySymbols,Ta=$t?$t.isBuffer:void 0,Da=je(Object.keys,Object),Ve=J(G,"DataView"),ue=J(G,"Map"),ze=J(G,"Promise"),$e=J(G,"Set"),Qe=J(G,"WeakMap"),le=J(Object,"create"),Sa=V(Ve),Ma=V(ue),Ea=V(ze),Oa=V($e),va=V(Qe),Zt=Qt?Qt.prototype:void 0,Kt=Zt?Zt.valueOf:void 0;function j(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var m=a[s];this.set(m[0],m[1])}}function Ra(){this.__data__=le?le(null):{}}function Pa(a){return this.has(a)&&delete this.__data__[a]}function xa(a){var s=this.__data__;if(le){var u=s[a];return u===r?void 0:u}return U.call(s,a)?s[a]:void 0}function Na(a){var s=this.__data__;return le?s[a]!==void 0:U.call(s,a)}function Ca(a,s){var u=this.__data__;return u[a]=le&&s===void 0?r:s,this}j.prototype.clear=Ra,j.prototype.delete=Pa,j.prototype.get=xa,j.prototype.has=Na,j.prototype.set=Ca;function Y(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var m=a[s];this.set(m[0],m[1])}}function Ia(){this.__data__=[]}function Aa(a){var s=this.__data__,u=Me(s,a);if(u<0)return!1;var m=s.length-1;return u==m?s.pop():ba.call(s,u,1),!0}function ka(a){var s=this.__data__,u=Me(s,a);return u<0?void 0:s[u][1]}function Ga(a){return Me(this.__data__,a)>-1}function Ya(a,s){var u=this.__data__,m=Me(u,a);return m<0?u.push([a,s]):u[m][1]=s,this}Y.prototype.clear=Ia,Y.prototype.delete=Aa,Y.prototype.get=ka,Y.prototype.has=Ga,Y.prototype.set=Ya;function Z(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var m=a[s];this.set(m[0],m[1])}}function qa(){this.__data__={hash:new j,map:new(ue||Y),string:new j}}function Fa(a){return Ee(this,a).delete(a)}function Ua(a){return Ee(this,a).get(a)}function Ha(a){return Ee(this,a).has(a)}function La(a,s){return Ee(this,a).set(a,s),this}Z.prototype.clear=qa,Z.prototype.delete=Fa,Z.prototype.get=Ua,Z.prototype.has=Ha,Z.prototype.set=La;function K(a){this.__data__=new Y(a)}function ja(){this.__data__=new Y}function Wa(a){return this.__data__.delete(a)}function Va(a){return this.__data__.get(a)}function za(a){return this.__data__.has(a)}function $a(a,s){var u=this.__data__;if(u instanceof Y){var m=u.__data__;if(!ue||m.length<n-1)return m.push([a,s]),this;u=this.__data__=new Z(m)}return u.set(a,s),this}K.prototype.clear=ja,K.prototype.delete=Wa,K.prototype.get=Va,K.prototype.has=za,K.prototype.set=$a;function Qa(a,s){var u=Ze(a)||_i(a)?ma(a.length,String):[],m=u.length,E=!!m;for(var R in a)U.call(a,R)&&!(E&&(R=="length"||pi(R,m)))&&u.push(R);return u}function Jt(a,s,u){var m=a[s];(!(U.call(a,s)&&rn(m,u))||u===void 0&&!(s in a))&&(a[s]=u)}function Me(a,s){for(var u=a.length;u--;)if(rn(a[u][0],s))return u;return-1}function Ba(a,s){return a&&en(s,Ke(s),a)}function Be(a,s,u,m,E,R,q){var P;if(m&&(P=R?m(a,E,R,q):m(a)),P!==void 0)return P;if(!Oe(a))return a;var sn=Ze(a);if(sn){if(P=di(a),!s)return ci(a,P)}else{var ee=W(a),cn=ee==y||ee==g;if(bi(a))return ti(a,s);if(ee==h||ee==o||cn&&!R){if(Lt(a))return R?a:{};if(P=mi(cn?{}:a),!s)return ui(a,Ba(P,a))}else{if(!T[ee])return R?a:{};P=fi(a,ee,Be,s)}}q||(q=new K);var un=q.get(a);if(un)return un;if(q.set(a,P),!sn)var ln=u?li(a):Ke(a);return la(ln||a,function(Je,ve){ln&&(ve=Je,Je=a[ve]),Jt(P,ve,Be(Je,s,u,m,ve,a,q))}),P}function Xa(a){return Oe(a)?_a(a):{}}function Za(a,s,u){var m=s(a);return Ze(a)?m:da(m,u(a))}function Ka(a){return Se.call(a)}function Ja(a){if(!Oe(a)||yi(a))return!1;var s=on(a)||Lt(a)?ya:ra;return s.test(V(a))}function ei(a){if(!nn(a))return Da(a);var s=[];for(var u in Object(a))U.call(a,u)&&u!="constructor"&&s.push(u);return s}function ti(a,s){if(s)return a.slice();var u=new a.constructor(a.length);return a.copy(u),u}function Xe(a){var s=new a.constructor(a.byteLength);return new Bt(s).set(new Bt(a)),s}function ni(a,s){var u=s?Xe(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.byteLength)}function ri(a,s,u){var m=s?u(jt(a),!0):jt(a);return Ht(m,ca,new a.constructor)}function ai(a){var s=new a.constructor(a.source,na.exec(a));return s.lastIndex=a.lastIndex,s}function ii(a,s,u){var m=s?u(Wt(a),!0):Wt(a);return Ht(m,ua,new a.constructor)}function oi(a){return Kt?Object(Kt.call(a)):{}}function si(a,s){var u=s?Xe(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.length)}function ci(a,s){var u=-1,m=a.length;for(s||(s=Array(m));++u<m;)s[u]=a[u];return s}function en(a,s,u,m){u||(u={});for(var E=-1,R=s.length;++E<R;){var q=s[E],P=void 0;Jt(u,q,P===void 0?a[q]:P)}return u}function ui(a,s){return en(a,tn(a),s)}function li(a){return Za(a,Ke,tn)}function Ee(a,s){var u=a.__data__;return hi(s)?u[typeof s=="string"?"string":"hash"]:u.map}function J(a,s){var u=fa(a,s);return Ja(u)?u:void 0}var tn=Xt?je(Xt,Object):Si,W=Ka;(Ve&&W(new Ve(new ArrayBuffer(1)))!=Te||ue&&W(new ue)!=w||ze&&W(ze.resolve())!=_||$e&&W(new $e)!=x||Qe&&W(new Qe)!=Le)&&(W=function(a){var s=Se.call(a),u=s==h?a.constructor:void 0,m=u?V(u):void 0;if(m)switch(m){case Sa:return Te;case Ma:return w;case Ea:return _;case Oa:return x;case va:return Le}return s});function di(a){var s=a.length,u=a.constructor(s);return s&&typeof a[0]=="string"&&U.call(a,"index")&&(u.index=a.index,u.input=a.input),u}function mi(a){return typeof a.constructor=="function"&&!nn(a)?Xa(ga(a)):{}}function fi(a,s,u,m){var E=a.constructor;switch(s){case Pt:return Xe(a);case l:case f:return new E(+a);case Te:return ni(a,m);case xt:case Nt:case Ct:case It:case At:case kt:case Gt:case Yt:case qt:return si(a,m);case w:return ri(a,m,u);case D:case C:return new E(a);case v:return ai(a);case x:return ii(a,m,u);case k:return oi(a)}}function pi(a,s){return s=s??i,!!s&&(typeof a=="number"||aa.test(a))&&a>-1&&a%1==0&&a<s}function hi(a){var s=typeof a;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?a!=="__proto__":a===null}function yi(a){return!!Vt&&Vt in a}function nn(a){var s=a&&a.constructor,u=typeof s=="function"&&s.prototype||De;return a===u}function V(a){if(a!=null){try{return zt.call(a)}catch{}try{return a+""}catch{}}return""}function gi(a){return Be(a,!0,!0)}function rn(a,s){return a===s||a!==a&&s!==s}function _i(a){return wi(a)&&U.call(a,"callee")&&(!wa.call(a,"callee")||Se.call(a)==o)}var Ze=Array.isArray;function an(a){return a!=null&&Ti(a.length)&&!on(a)}function wi(a){return Di(a)&&an(a)}var bi=Ta||Mi;function on(a){var s=Oe(a)?Se.call(a):"";return s==y||s==g}function Ti(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=i}function Oe(a){var s=typeof a;return!!a&&(s=="object"||s=="function")}function Di(a){return!!a&&typeof a=="object"}function Ke(a){return an(a)?Qa(a):ei(a)}function Si(){return[]}function Mi(){return!1}e.exports=gi})(fe,fe.exports)),fe.exports}var Bs=Qs();const Xs=$s(Bs),A=(e,t)=>new Date(e.getTime()-jr(t,e));class S{timeframeText;key;display;timeframeLength;allowedTiers;defaultResponseGranularity;dataGranularity;isRelative;fineGrainedDefaultGranularity;_startCustom;_endCustom;_allowedGranularitiesOverride;constructor(t){this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const n=new Set,r=this.maximumTimeframeLength()/3600;return r<=6&&n.add("minutely"),r>=2&&r<=168&&n.add("hourly"),r>=48&&n.add("daily"),r>=672&&n.add("weekly"),n}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const n=Fs(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Hr(n,t)}}class Zs extends S{rawStart(t){let n=F(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=A(n,t)),n}maximumTimeframeLength(){return 3600*24*7}}class Ks extends S{rawStart(t){let n=oe(this.tzAdjustedDate(t));return t&&(n=A(n,t)),n}maximumTimeframeLength(){return 3600*24*31}}class Js extends S{rawStart(t){let n=ie(this.tzAdjustedDate(t));return t&&(n=A(n,t)),n}maximumTimeframeLength(){return 3600*24*92}}class ec extends S{rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=A(n,t)),n}maximumTimeframeLength(){return 3600*24*366}}class tc extends S{rawEnd(t){let n=F(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=A(n,t)),n}rawStart(t){const n=this.tzAdjustedDate(t);let r=F(n.setDate(n.getDate()-7),{weekStartsOn:1});return t&&(r=A(r,t)),r}}class nc extends S{rawEnd(t){let n=ie(this.tzAdjustedDate(t));return t&&(n=A(n,t)),n}rawStart(t){let n=ie(qr(this.tzAdjustedDate(t)));return t&&(n=A(n,t)),n}}class rc extends S{rawEnd(t){let n=oe(this.tzAdjustedDate(t));return t&&(n=A(n,t)),n}rawStart(t){let n=oe(Yr(this.tzAdjustedDate(t)));return t&&(n=A(n,t)),n}}class ac extends S{rawEnd(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=A(n,t)),n}rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(n=A(n,t)),n}}const Qr=new Map([[d.FIFTEEN_MIN,new S({key:d.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"]})],[d.ONE_HOUR,new S({key:d.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"]})],[d.SIX_HOUR,new S({key:d.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"]})],[d.TWELVE_HOUR,new S({key:d.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"]})],[d.ONE_DAY,new S({key:d.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"]})],[d.SEVEN_DAY,new S({key:d.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"]})],[d.THIRTY_DAY,new S({key:d.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"]})],[d.NINETY_DAY,new S({key:d.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"]})],[d.ONE_HUNDRED_EIGHTY_DAY,new S({key:d.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"]})],[d.ONE_YEAR,new S({key:d.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"]})],[d.CURRENT_WEEK,new Zs({key:d.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=F(new Date,{weekStartsOn:1});return(ae(Re(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[d.CURRENT_MONTH,new Ks({key:d.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=oe(new Date);return(ae(Re(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[d.CURRENT_QUARTER,new Js({key:d.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=ie(new Date);return(ae(Re(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[d.CURRENT_YEAR,new ec({key:d.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1);return(ae(Re(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[d.PREVIOUS_WEEK,new tc({key:d.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"]})],[d.PREVIOUS_MONTH,new rc({key:d.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=oe(new Date),n=oe(Yr(new Date));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=lt(t,n)),3600*24*ls(new Date().setMonth(new Date().getMonth()-1))+wn(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[d.PREVIOUS_QUARTER,new nc({key:d.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=ie(new Date),t=ie(qr(new Date));return(e.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[d.PREVIOUS_YEAR,new ac({key:d.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let n=0;return e.getTimezoneOffset()!==t.getTimezoneOffset()&&(n=lt(e,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+wn(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})]]);function ic(e){const t=new Date(e.start),n=new Date(e.end),r=(n.getTime()-t.getTime())/1e3;return e.timePeriodsKey&&Xs(Qr.get(e.timePeriodsKey))||new S({key:"custom",timeframeText:"custom",display:"custom",startCustom:t,endCustom:n,timeframeLength:()=>r,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["free","plus","enterprise"]})}function oc(e){return{...e.key!=="custom"&&{timePeriodsKey:e.key},start:e.rawStart(),end:e.rawEnd()}}function sc(e){return{key:e.key,display:e.display,timeframeText:e.timeframeText,timeframeLength:()=>e.key,start:()=>e.rawStart(),end:()=>e.rawEnd()}}function lt(e,t){return ms(e.getTimezoneOffset()-t.getTimezoneOffset())}const cc={"15M":d.FIFTEEN_MIN,"1H":d.ONE_HOUR,"6H":d.SIX_HOUR,"12H":d.TWELVE_HOUR,"24H":d.ONE_DAY,"7D":d.SEVEN_DAY,"15m":d.FIFTEEN_MIN,"1h":d.ONE_HOUR,"6h":d.SIX_HOUR,"12h":d.TWELVE_HOUR,"24h":d.ONE_DAY,"7d":d.SEVEN_DAY,"30d":d.THIRTY_DAY,"90d":d.NINETY_DAY,"180d":d.ONE_HUNDRED_EIGHTY_DAY,"365d":d.ONE_YEAR,current_week:d.CURRENT_WEEK,current_month:d.CURRENT_MONTH,current_quarter:d.CURRENT_QUARTER,current_year:d.CURRENT_YEAR,previous_week:d.PREVIOUS_WEEK,previous_month:d.PREVIOUS_MONTH,previous_quarter:d.PREVIOUS_QUARTER,previous_year:d.PREVIOUS_YEAR};class He{_seed;constructor(t){this._seed=t}next(t,n){const r=Math.sin(this._seed++)*1e4,i=r-Math.floor(r);return Math.floor(i*(n-t+1))+t}}const uc=({metrics:e,dimensionMap:t,metaOverrides:n,valueRange:r=[50,500],timeSeries:i=!1})=>i?e.length===1?Br(e[0],t,n,r):Xr(e,t,n,r):Zr(e,t,n,r),Br=(e,t,n,r)=>{const i=Rt(10,1e4),o=new He(i),[c,l]=r||[50,500],f=Date.now()-360*60*1e3,p=Date.now(),y=[];let g=0;for(let h=f;h<=p;h+=3600*1e3)if(t)for(const _ in t)t[_].forEach(v=>{g+=o.next(c,l);const x={[_]:v,[e.name]:g},C={version:"1.0",timestamp:new Date(h).toISOString(),event:x};y.push(C)});else{g+=o.next(c,l);const _={version:"1.0",timestamp:new Date(h).toISOString(),event:{[e.name]:g}};y.push(_)}const w={};if(t)for(const h in t)w[h]={},t[h].forEach(_=>{w[h][_]={name:_,deleted:!1}});const D={start:new Date(f).toISOString(),end:new Date(p).toISOString(),query_id:"12345",metric_names:[e.name],metric_units:{[e.name]:e.unit},granularity_ms:3600*1e3,display:w,...n??{}};return{data:y,meta:D}},lc=(e,t,n)=>Xr(e,void 0,t,n),Xr=(e,t,n,r)=>{const i=Rt(10,1e4),o=new He(i),[c,l]=r||[50,500],f=Date.now()-360*60*1e3,p=Date.now(),y=[],g={};e.forEach(h=>{g[h.name]=0});for(let h=f;h<=p;h+=3600*1e3)if(t)for(const _ in t)t[_].forEach(v=>{const x={[_]:v};e.forEach(C=>{const k=`${_}:${v}:${C.name}`;g[k]=(g[k]||0)+o.next(c,l),x[C.name]=g[k]}),y.push({version:"1.0",timestamp:new Date(h).toISOString(),event:x})});else{const _={};e.forEach(v=>{g[v.name]+=o.next(c,l),_[v.name]=g[v.name]}),y.push({version:"1.0",timestamp:new Date(h).toISOString(),event:_})}const w={};if(t)for(const h in t)w[h]={},t[h].forEach(_=>{w[h][_]={name:_,deleted:!1}});const D={start:new Date(f).toISOString(),end:new Date(p).toISOString(),query_id:"12345",metric_names:e.map(h=>h.name),metric_units:e.reduce((h,_)=>(h[_.name]=_.unit,h),{}),granularity_ms:3600*1e3,display:w,...n??{}};return{data:y,meta:D}},Zr=(e,t,n,r)=>{const i=Math.floor(Math.random()*9991)+10,o=new He(i),[c,l]=r||[50,500],f=Date.now()-360*60*1e3,p=Date.now(),y=new Date((f+p)/2).toISOString(),g=[];if(t){const h=Object.keys(t),_=Object.values(t),v=(x,C)=>{if(C===h.length){e.forEach(k=>{x[k.name]=o.next(c,l)}),g.push({version:"1.0",timestamp:new Date().toISOString(),event:{...x}});return}_[C].forEach(k=>{v({...x,[h[C]]:k},C+1)})};v({},0)}else{const h={};e.forEach(_=>{h[_.name]=o.next(c,l)}),g.push({version:"1.0",timestamp:y,event:h})}const w={};if(t)for(const h in t)w[h]={},t[h].forEach(_=>{w[h][_]={name:_,deleted:!1}});const D={start:new Date(f).toISOString(),end:new Date(p).toISOString(),query_id:"12345",metric_names:e.map(h=>h.name),metric_units:e.reduce((h,_)=>(h[_.name]=_.unit,h),{}),truncated:!1,limit:50,display:w,granularity_ms:p-f,...n??{}};return{data:g,meta:D}};function Rt(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)}const Kr=new Map(wt.map(e=>[e.code,{code:e.code,name:e.name}])),dc=e=>Kr.get(e)?.name||e,Cn=1e3,mc=1e4,In=1e6,An=1e9,kn=1e12,pe=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",r=[];return Math.round(e).toString().split("").reverse().forEach((o,c)=>{c&&c%3===0&&r.push(n),r.push(o)}),r.reverse().join("")},ne=(e,t,n)=>{const r=e/t,i=n.round?"round":"floor";if(n.decimal===!1)return Math[i](r).toString();let o;n.precision?o=r:o=r<10?Math[i](r*10)/10:Math[i](r);let c=o.toString();return typeof n.decimal=="string"&&(c=c.replace(".",n.decimal)),c};function xe(e,t={}){let n;const r=e<0;r&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const i=t.min10k?mc:Cn;return e<i||t.precision&&t.precision>Math.log10(e)?n=pe(ne(e,1,t),t):e<In?n=`${ne(e,Cn,t)}k`:e<An?n=`${ne(e,In,t)}m`:e<kn?n=`${pe(ne(e,An,t),t)}b`:n=`${pe(ne(e,kn,t),t)}t`,r&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}xe.addCommas=pe;const fc=typeof document<"u"&&document.documentElement?.lang||"en-US",Ne=new Intl.NumberFormat(fc),pc=new Set(["%"]),Jr=e=>pc.has(e)?"flush":"spaced";function hc({i18n:e}){const t=(c,l)=>{if(isNaN(c))return"0 B";const f=l?Math.pow(2,50):1e15,p=l?Math.pow(2,40):1e12,y=l?Math.pow(2,30):1e9,g=l?Math.pow(2,20):1e6,w=l?Math.pow(2,10):1e3;let D;return c>=f?D=e.formatNumber(Number.parseFloat((c/f).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):c>=p?D=e.formatNumber(Number.parseFloat((c/p).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):c>=y?D=e.formatNumber(Number.parseFloat((c/y).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):c>=g?D=e.formatNumber(Number.parseFloat((c/g).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):c>=w?D=e.formatNumber(Number.parseFloat((c/w).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):D=e.formatNumber(Number.parseFloat(c.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),D.replace(/([a-zA-Z]*)$/," $1")},n=(c,l="USD")=>isNaN(c)?l==="USD"?"$0.00":`${c}`:c>=.01||l!=="USD"?e.formatNumber(c,{style:"currency",currency:l}):c<1e-4?"< $0.0001":`$${Number.parseFloat(c.toPrecision(4))}`,r=(c,l,f)=>{if(!f)return c;const p=Jr(l)==="flush"?"":" ";return`${c}${p}${f}`};return{formatUnit:(c,l,{isBytes1024:f=!1,currency:p="USD",approximate:y=!1,translateUnit:g=w=>w}={})=>{const w=g(l,c);switch(l){case"bytes":return t(c,f);case"usd":return n(c,p);default:return isNaN(c)?`${c}`:y?r(xe(c,{capital:!0}),l,w):c<.01?r(`${Number.parseFloat(c.toPrecision(4))}`,l,w):r(Ne.format(Number.parseFloat(c.toFixed(2))),l,w)}},formatBytes:t,formatCost:n,formatRange:(c,l,f,{isBytes1024:p=!1,currency:y="USD",approximate:g=!1,translateUnit:w=D=>D}={})=>{const D=w(f,l);switch(f){case"bytes":return`${t(c,p)} - ${t(l,p)}`;case"usd":return`${n(c,y)} - ${n(l,y)}`;default:if(isNaN(c)||isNaN(l))return`${c} - ${l}`;if(g)return r(`${xe(c,{capital:!0})} - ${xe(l,{capital:!0})}`,f,D)}const h=c>=.01?`${Ne.format(Number.parseFloat(c.toFixed(2)))}`:`${Number.parseFloat(c.toPrecision(4))}`,_=l>=.01?`${Ne.format(Number.parseFloat(l.toFixed(2)))}`:`${Number.parseFloat(l.toPrecision(4))}`;return r(`${h} - ${_}`,f,D)}}}const ea=1e4,yc=async(e,t,n,r={})=>{const i=Math.max(0,r.maxRecords??ea),o=Math.min(ot,Math.max(1,r.pageSize??ot)),c=[];let l=t.query.cursor,f;for(;c.length<i;){const p=Math.min(o,i-c.length),y=await e({datasource:t.datasource,query:{...t.query,size:p,...l?{cursor:l}:{}}},n);if(f=y,c.push(...y.results??[]),r.onPage?.(c.length,y),l=y.meta?.cursor,!l||!y.results?.length||y.results.length<p)break}return{results:c,meta:{...f?.meta??{query_id:"",time_range:{start:"",end:""},size:0},size:c.length},truncated:!!l&&c.length>=i,limit:i}};exports.API_REQUESTS_MAX_PAGE_SIZE=ot;exports.CAPTURE_PREPARE_EVENT=Ce;exports.CAPTURE_RESTORE_EVENT=Ie;exports.COUNTRIES=wt;exports.DEFAULT_MAX_REQUEST_RECORDS=ea;exports.DeltaQueryTime=zs;exports.EXPORT_RECORD_LIMIT=Pi;exports.Granularities=$;exports.INJECT_QUERY_PROVIDER=xi;exports.PLATFORM_DATASOURCES=Wn;exports.REFRESH_INTERVAL_MS=Ri;exports.SeededRandom=He;exports.TIMEFRAME_LOOKUP=cc;exports.TimePeriods=Qr;exports.Timeframe=S;exports.TimeframeKeys=d;exports.TimeseriesQueryTime=Vs;exports.UnaryQueryTime=$r;exports.agenticExploreAggregations=Vn;exports.agenticUsageSchema=gr;exports.aiExploreAggregations=Fn;exports.apiRequestsExtraFieldSchema=Dr;exports.apiRequestsQuerySchema=Sr;exports.apiUsageQuerySchema=pr;exports.barChartSchema=Xn;exports.basicExploreAggregations=mt;exports.basicQuerySchema=hr;exports.ceilToNearestTimeGrain=vt;exports.chartTileConfigSchema=Pr;exports.choroplethMapSchema=dr;exports.columnIconSet=ir;exports.countries=Kr;exports.dashboardConfigSchema=Zi;exports.dashboardTileTypes=Li;exports.datasourceToFilterableDimensions=$n;exports.datePickerSelectionToTimeframe=ic;exports.donutChartSchema=nr;exports.dstOffsetHours=lt;exports.exploreAggregations=ft;exports.exploreFilterTypesV2=Yn;exports.extendedRelativeTimeRangeValues=Ni;exports.fetchAllRequests=yc;exports.filterableAgenticExploreDimensions=_e;exports.filterableAiExploreDimensions=ge;exports.filterableBasicExploreDimensions=he;exports.filterableExploreDimensions=ye;exports.filterableManagedCacheExploreDimensions=Fe;exports.filterablePlatformPresetFilterDimensions=mr;exports.filterableRequestDimensions=ht;exports.filterableRequestMetrics=yt;exports.filterableRequestWildcardDimensions=Ln;exports.finestGranularityForDuration=Ws;exports.floorToNearestTimeGrain=zr;exports.formatTime=ut;exports.formatTimeRange=Hs;exports.formatTimestamp=Us;exports.gaugeChartSchema=tr;exports.generateCrossSectionalData=Zr;exports.generateData=uc;exports.generateMultipleMetricTimeSeriesData=lc;exports.generateSingleMetricTimeSeriesData=Br;exports.getCountryName=dc;exports.getFieldDataSources=Ki;exports.granularitiesToOptions=Ls;exports.granularityMsToQuery=Wr;exports.granularityValues=dt;exports.heatmapChartSchema=rr;exports.isPlatformDatasource=Fi;exports.llmUsageSchema=yr;exports.managedCacheExploreAggregations=zn;exports.managedCacheUsageQuerySchema=_r;exports.metricCardSchema=ur;exports.msToGranularity=js;exports.numberFormatter=Ne;exports.platformQuerySchema=br;exports.platformTabularQuerySchema=Tr;exports.prepareForCapture=Ei;exports.queryDatasources=Ui;exports.queryableAgenticExploreDimensions=gt;exports.queryableAiExploreDimensions=pt;exports.queryableBasicExploreDimensions=Ye;exports.queryableExploreDimensions=qe;exports.queryableManagedCacheExploreDimensions=_t;exports.queryableRequestDimensions=Un;exports.queryableRequestMetrics=jn;exports.queryableRequestWildcardDimensions=Hn;exports.rand=Rt;exports.registerCapture=Gn;exports.registerWebglCapture=vi;exports.relativeTimeRangeValuesRequestV2=qi;exports.relativeTimeRangeValuesV4=Yi;exports.reportChartTypes=Ci;exports.requestFilterTypeEmptyV2=qn;exports.requestFilterTypeEqualsV2=Ii;exports.requestFilterTypeMetricV2=Ai;exports.requestFilterTypeWildcardV2=ki;exports.restoreAfterCapture=Oi;exports.scatterChartSchema=St;exports.scatterPercentileLineSchema=er;exports.singleValueSchema=lr;exports.slottableSchema=Bn;exports.slottableTileConfigSchema=xr;exports.stripUnknownFilters=Hi;exports.tableChartSchema=cr;exports.thresholdSchema=Zn;exports.tileConfigSchema=Nr;exports.tileDefinitionSchema=Rr;exports.tileLayoutSchema=Et;exports.timeRangeTypeV2=Gi;exports.timeframeToDatepickerSelection=oc;exports.timeframeToDatepickerTimeperiod=sc;exports.timeseriesChartSchema=Jn;exports.topNColumnOptionsSchema=Mt;exports.topNTableSchema=or;exports.topTalkersSchema=sr;exports.treemapChartSchema=ar;exports.unitFormatter=hc;exports.unitPlacement=Jr;exports.validDashboardChartQuery=Er;exports.validDashboardQuery=zi;exports.validDashboardTableQuery=vr;exports.yAxisPositions=Kn;exports.yAxisSchema=st;
2
2
  //# sourceMappingURL=vitals-utilities.cjs.map