@kong-ui-public/analytics-utilities 10.1.2 → 10.1.3

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,2 +1,2 @@
1
- (function(c,I){typeof exports=="object"&&typeof module<"u"?I(exports):typeof define=="function"&&define.amd?define(["exports"],I):(c=typeof globalThis<"u"?globalThis:c||self,I(c["kong-ui-public-vitals-utilities"]={}))})(this,function(c){"use strict";var mo=Object.defineProperty;var ho=(c,I,h)=>I in c?mo(c,I,{enumerable:!0,configurable:!0,writable:!0,value:h}):c[I]=h;var T=(c,I,h)=>ho(c,typeof I!="symbol"?I+"":I,h);var h=(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.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e))(h||{});const Dn=["horizontal_bar","vertical_bar","timeseries_line","choropleth_map","timeseries_bar","donut","single_value"],Fe=["in","not_in","selector"],Sn=["=","!="],On=["=","!=","<",">","<=",">="],je=["empty","not_empty"],Mn=["starts_with","ends_with"],vn=["absolute","relative"],Ge=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],_e=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],oe=e=>e.filter(t=>t!=="time"),ue=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],W=oe(ue),we=["active_services","request_count","request_per_minute","response_latency_average"],be=[...ue,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],L=oe(be),We=[...we,"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","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"],Te=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin"],U=oe(Te),Le=["total_tokens","prompt_tokens","completion_tokens","ai_request_count","cost","llm_cache_embeddings_latency_average","llm_cache_fetch_latency_average","llm_latency_average","llm_embeddings_tokens","llm_embeddings_cost"],_t=["api","api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","iso_code","portal","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"],wt=oe(_t),bt=["auth_type","client_ip","country_code","data_plane_node_version","header_host","header_user_agent","http_method","request_id","request_uri","response_header_content_type","response_source","service_port","service_protocol","trace_id","upstream_uri"],En=bt,Tt=["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"],Dt=oe(Tt),Pn=["15M","1H","6H","12H","24H","7D"],Nn=["basic","api_usage","llm_usage"],St={basic:new Set(W),api_usage:new Set(L),llm_usage:new Set(U)},Cn=(e,t)=>t.filter(r=>St[e].has(r.field)),In=["horizontal_bar","vertical_bar","gauge","donut","timeseries_line","timeseries_bar","golden_signals","top_n","slottable","single_value"],ce={type:"string"},$={type:"string"},Ot={type:"boolean"},Mt={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},vt={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},Et={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chartDatasetColors:Mt,syntheticsDataKey:ce,chartTitle:$,allowCsvExport:Ot},required:["type"],additionalProperties:!1},Pt={type:"object",properties:{type:{type:"string",enum:["timeseries_line","timeseries_bar"]},stacked:{type:"boolean"},threshold:{type:"object",additionalProperties:{type:"number"}},chartDatasetColors:Mt,syntheticsDataKey:ce,chartTitle:$,allowCsvExport:Ot},required:["type"],additionalProperties:!1},Nt={type:"object",properties:{type:{type:"string",enum:["gauge"]},metricDisplay:{type:"string",enum:["hidden","single","full"]},reverseDataset:{type:"boolean"},numerator:{type:"number"},syntheticsDataKey:ce,chartTitle:$},required:["type"],additionalProperties:!1},Ct={type:"object",properties:{type:{type:"string",enum:["donut"]},syntheticsDataKey:ce,chartTitle:$},required:["type"],additionalProperties:!1},It={type:"object",properties:{chartTitle:$,syntheticsDataKey:ce,type:{type:"string",enum:["top_n"]},description:{type:"string"},entityLink:{type:"string"}},required:["type"],additionalProperties:!1},kt={type:"object",properties:{chartTitle:$,type:{type:"string",enum:["golden_signals"]},longCardTitles:{type:"boolean"},description:{type:"string"},percentileLatency:{type:"boolean"}},required:["type"],additionalProperties:!1},xt={type:"object",properties:{type:{type:"string",enum:["single_value"]},decimalPoints:{type:"number"},chartTitle:$},required:["type"],additionalProperties:!1},Ue={granularity:{type:"string",description:'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',enum:_e},time_range:{type:"object",description:"The time range to query.",anyOf:[{type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:Ge,default:"1h"}},required:["type","time_range"],additionalProperties:!1},{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}],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},$e=e=>({type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:e}}),ze=e=>({type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:e}}),De=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:Fe},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:je}},required:["field","operator"],additionalProperties:!1}]}}),Rt={type:"object",description:"A query to launch at the advanced explore API",properties:{datasource:{type:"string",enum:["advanced"]},metrics:$e(We),dimensions:ze(be),filters:De(L),...Ue},required:["datasource"],additionalProperties:!1},qt={type:"object",description:"A query to launch at the basic explore API",properties:{datasource:{type:"string",enum:["basic"]},metrics:$e(we),dimensions:ze(ue),filters:De(W),...Ue},required:["datasource"],additionalProperties:!1},Yt={type:"object",description:"A query to launch at the AI explore API",properties:{datasource:{type:"string",enum:["ai"]},metrics:$e(Le),dimensions:ze(Te),filters:De(U),...Ue},required:["datasource"],additionalProperties:!1},At={anyOf:[Rt,qt,Yt]},Ht={type:"object",properties:{query:At,chart:{anyOf:[Et,Nt,Ct,Pt,kt,It,vt,xt]}},required:["query","chart"],additionalProperties:!1},Ft={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"},fitToContent:{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},jt={type:"object",properties:{definition:Ht,layout:Ft,id:{type:"string",description:"Unique identifier for the tile. If not provided, one will be generated."}},required:["definition","layout"],additionalProperties:!1},kn={type:"object",properties:{tiles:{type:"array",items:jt},tileHeight:{type:"number",description:"Height of each tile in pixels."},gridSize:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"}},description:"Number of columns and rows in the grid.",required:["cols","rows"],additionalProperties:!1},global_filters:De([...new Set([...L,...W,...U])])},required:["tiles"],additionalProperties:!1},xn=Object.freeze(Object.defineProperty({__proto__:null,aiQuerySchema:Yt,barChartSchema:Et,basicQuerySchema:qt,dashboardConfigSchema:kn,dashboardTileTypes:In,donutChartSchema:Ct,exploreV4QuerySchema:Rt,gaugeChartSchema:Nt,metricCardSchema:kt,singleValueSchema:xt,slottableSchema:vt,tileConfigSchema:jt,tileDefinitionSchema:Ht,tileLayoutSchema:Ft,timeseriesChartSchema:Pt,topNTableSchema:It,validDashboardQuery:At},Symbol.toStringTag,{value:"Module"})),Rn=["horizontal_bar","vertical_bar","gauge","donut","timeseries_line","timeseries_bar","golden_signals","top_n","slottable","single_value"],le={type:"string"},z={type:"string"},Gt={type:"boolean"},Wt={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},Lt={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},Ut={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chart_dataset_colors:Wt,synthetics_data_key:le,chart_title:z,allow_csv_export:Gt},required:["type"],additionalProperties:!1},$t={type:"object",properties:{type:{type:"string",enum:["timeseries_line","timeseries_bar"]},stacked:{type:"boolean"},threshold:{type:"object",additionalProperties:{type:"number"}},chart_dataset_colors:Wt,synthetics_data_key:le,chart_title:z,allow_csv_export:Gt},required:["type"],additionalProperties:!1},zt={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:le,chart_title:z},required:["type"],additionalProperties:!1},Vt={type:"object",properties:{type:{type:"string",enum:["donut"]},synthetics_data_key:le,chart_title:z},required:["type"],additionalProperties:!1},Qt={type:"object",properties:{chart_title:z,synthetics_data_key:le,type:{type:"string",enum:["top_n"]},description:{type:"string"},entity_link:{type:"string"}},required:["type"],additionalProperties:!1},Xt={type:"object",properties:{chart_title:z,type:{type:"string",enum:["golden_signals"]},long_card_titles:{type:"boolean"},description:{type:"string"},percentile_latency:{type:"boolean"}},required:["type"],additionalProperties:!1},Zt={type:"object",properties:{type:{type:"string",enum:["single_value"]},decimal_points:{type:"number"},chart_title:z},required:["type"],additionalProperties:!1},Ve={granularity:{type:"string",description:'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',enum:_e},time_range:{type:"object",description:"The time range to query.",anyOf:[{type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:Ge,default:"1h"}},required:["type","time_range"],additionalProperties:!1},{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}],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},Qe=e=>({type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:e}}),Xe=e=>({type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:e}}),Se=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:Fe},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:je}},required:["field","operator"],additionalProperties:!1}]}}),Bt={type:"object",description:"A query to launch at the advanced explore API",properties:{datasource:{type:"string",enum:["api_usage"]},metrics:Qe(We),dimensions:Xe(be),filters:Se(L),...Ve},required:["datasource"],additionalProperties:!1},Kt={type:"object",description:"A query to launch at the basic explore API",properties:{datasource:{type:"string",enum:["basic"]},metrics:Qe(we),dimensions:Xe(ue),filters:Se(W),...Ve},required:["datasource"],additionalProperties:!1},Jt={type:"object",description:"A query to launch at the AI explore API",properties:{datasource:{type:"string",enum:["llm_usage"]},metrics:Qe(Le),dimensions:Xe(Te),filters:Se(U),...Ve},required:["datasource"],additionalProperties:!1},er={anyOf:[Bt,Kt,Jt]},tr={type:"object",properties:{query:er,chart:{anyOf:[Ut,zt,Vt,$t,Xt,Qt,Lt,Zt]}},required:["query","chart"],additionalProperties:!1},rr={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},nr={type:"object",properties:{type:{type:"string",enum:["chart"]},definition:tr,layout:rr,id:{type:"string",description:"Unique identifier for the tile. If not provided, one will be generated."}},required:["type","definition","layout"],additionalProperties:!1},qn={type:"object",properties:{tiles:{type:"array",items:nr},tile_height:{type:"number",description:"Height of each tile in pixels."},preset_filters:Se([...new Set([...L,...W,...U])])},required:["tiles"],additionalProperties:!1},Yn=e=>{const t=[];return W.includes(e)&&t.push("basic"),L.includes(e)&&t.push("api_usage"),U.includes(e)&&t.push("llm_usage"),(wt.includes(e)||Dt.includes(e))&&t.push("requests"),t},ar=6048e5,An=864e5,Hn=60,Fn=3600,ir=Symbol.for("constructDateFrom");function k(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&ir in e?e[ir](t):e instanceof Date?new e.constructor(t):new Date(t)}function D(e,t){return k(t||e,e)}function sr(e,t,r){const n=D(e,r==null?void 0:r.in);return isNaN(t)?k(e,NaN):(n.setDate(n.getDate()+t),n)}function jn(e,t,r){const n=D(e,r==null?void 0:r.in);if(isNaN(t))return k(e,NaN);const i=n.getDate(),o=k(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const l=o.getDate();return i>=l?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}let Gn={};function de(){return Gn}function q(e,t){var f,y,m,w;const r=de(),n=(t==null?void 0:t.weekStartsOn)??((y=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:y.weekStartsOn)??r.weekStartsOn??((w=(m=r.locale)==null?void 0:m.options)==null?void 0:w.weekStartsOn)??0,i=D(e,t==null?void 0:t.in),o=i.getDay(),l=(o<n?7:0)+o-n;return i.setDate(i.getDate()-l),i.setHours(0,0,0,0),i}function Oe(e,t){return q(e,{...t,weekStartsOn:1})}function or(e,t){const r=D(e,t==null?void 0:t.in),n=r.getFullYear(),i=k(r,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const o=Oe(i),l=k(r,0);l.setFullYear(n,0,4),l.setHours(0,0,0,0);const f=Oe(l);return r.getTime()>=o.getTime()?n+1:r.getTime()>=f.getTime()?n:n-1}function ur(e){const t=D(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Wn(e,...t){const r=k.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function Me(e,t){const r=D(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function Ln(e,t,r){const[n,i]=Wn(r==null?void 0:r.in,e,t),o=Me(n),l=Me(i),f=+o-ur(o),y=+l-ur(l);return Math.round((f-y)/An)}function Un(e,t){const r=or(e,t),n=k(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Oe(n)}function $n(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function zn(e){return!(!$n(e)&&typeof e!="number"||isNaN(+D(e)))}function J(e,t){const r=D(e,t==null?void 0:t.in);return r.setDate(1),r.setHours(0,0,0,0),r}function Vn(e,t){const r=D(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const Qn={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"}},Xn=(e,t,r)=>{let n;const i=Qn[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function Ze(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const Zn={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Bn={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Kn={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Jn={date:Ze({formats:Zn,defaultWidth:"full"}),time:Ze({formats:Bn,defaultWidth:"full"}),dateTime:Ze({formats:Kn,defaultWidth:"full"})},ea={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ta=(e,t,r,n)=>ea[e];function fe(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let i;if(n==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,f=r!=null&&r.width?String(r.width):l;i=e.formattingValues[f]||e.formattingValues[l]}else{const l=e.defaultWidth,f=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[f]||e.values[l]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const ra={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},na={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},aa={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"]},ia={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"]},sa={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"}},oa={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"}},ua={ordinalNumber:(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:fe({values:ra,defaultWidth:"wide"}),quarter:fe({values:na,defaultWidth:"wide",argumentCallback:e=>e-1}),month:fe({values:aa,defaultWidth:"wide"}),day:fe({values:ia,defaultWidth:"wide"}),dayPeriod:fe({values:sa,defaultWidth:"wide",formattingValues:oa,defaultFormattingWidth:"wide"})};function me(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const l=o[0],f=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],y=Array.isArray(f)?la(f,p=>p.test(l)):ca(f,p=>p.test(l));let m;m=e.valueCallback?e.valueCallback(y):y,m=r.valueCallback?r.valueCallback(m):m;const w=t.slice(l.length);return{value:m,rest:w}}}function ca(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function la(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function da(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],o=t.match(e.parsePattern);if(!o)return null;let l=e.valueCallback?e.valueCallback(o[0]):o[0];l=r.valueCallback?r.valueCallback(l):l;const f=t.slice(i.length);return{value:l,rest:f}}}const fa=/^(\d+)(th|st|nd|rd)?/i,ma=/\d+/i,ha={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},ya={any:[/^b/i,/^(a|c)/i]},pa={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ga={any:[/1/i,/2/i,/3/i,/4/i]},_a={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},wa={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]},ba={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},Ta={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]},Da={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},Sa={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}},Oa={ordinalNumber:da({matchPattern:fa,parsePattern:ma,valueCallback:e=>parseInt(e,10)}),era:me({matchPatterns:ha,defaultMatchWidth:"wide",parsePatterns:ya,defaultParseWidth:"any"}),quarter:me({matchPatterns:pa,defaultMatchWidth:"wide",parsePatterns:ga,defaultParseWidth:"any",valueCallback:e=>e+1}),month:me({matchPatterns:_a,defaultMatchWidth:"wide",parsePatterns:wa,defaultParseWidth:"any"}),day:me({matchPatterns:ba,defaultMatchWidth:"wide",parsePatterns:Ta,defaultParseWidth:"any"}),dayPeriod:me({matchPatterns:Da,defaultMatchWidth:"any",parsePatterns:Sa,defaultParseWidth:"any"})},Ma={code:"en-US",formatDistance:Xn,formatLong:Jn,formatRelative:ta,localize:ua,match:Oa,options:{weekStartsOn:0,firstWeekContainsDate:1}};function va(e,t){const r=D(e,t==null?void 0:t.in);return Ln(r,Vn(r))+1}function Ea(e,t){const r=D(e,t==null?void 0:t.in),n=+Oe(r)-+Un(r);return Math.round(n/ar)+1}function cr(e,t){var w,p,g,C;const r=D(e,t==null?void 0:t.in),n=r.getFullYear(),i=de(),o=(t==null?void 0:t.firstWeekContainsDate)??((p=(w=t==null?void 0:t.locale)==null?void 0:w.options)==null?void 0:p.firstWeekContainsDate)??i.firstWeekContainsDate??((C=(g=i.locale)==null?void 0:g.options)==null?void 0:C.firstWeekContainsDate)??1,l=k((t==null?void 0:t.in)||e,0);l.setFullYear(n+1,0,o),l.setHours(0,0,0,0);const f=q(l,t),y=k((t==null?void 0:t.in)||e,0);y.setFullYear(n,0,o),y.setHours(0,0,0,0);const m=q(y,t);return+r>=+f?n+1:+r>=+m?n:n-1}function Pa(e,t){var f,y,m,w;const r=de(),n=(t==null?void 0:t.firstWeekContainsDate)??((y=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:y.firstWeekContainsDate)??r.firstWeekContainsDate??((w=(m=r.locale)==null?void 0:m.options)==null?void 0:w.firstWeekContainsDate)??1,i=cr(e,t),o=k((t==null?void 0:t.in)||e,0);return o.setFullYear(i,0,n),o.setHours(0,0,0,0),q(o,t)}function Na(e,t){const r=D(e,t==null?void 0:t.in),n=+q(r,t)-+Pa(r,t);return Math.round(n/ar)+1}function _(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const j={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return _(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):_(r+1,2)},d(e,t){return _(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return _(e.getHours()%12||12,t.length)},H(e,t){return _(e.getHours(),t.length)},m(e,t){return _(e.getMinutes(),t.length)},s(e,t){return _(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return _(i,t.length)}},ee={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},lr={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return j.y(e,t)},Y:function(e,t,r,n){const i=cr(e,n),o=i>0?i:1-i;if(t==="YY"){const l=o%100;return _(l,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):_(o,t.length)},R:function(e,t){const r=or(e);return _(r,t.length)},u:function(e,t){const r=e.getFullYear();return _(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return _(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return _(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return j.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return _(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const i=Na(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):_(i,t.length)},I:function(e,t,r){const n=Ea(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):_(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):j.d(e,t)},D:function(e,t,r){const n=va(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):_(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return _(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return _(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return _(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(n===12?i=ee.noon:n===0?i=ee.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(n>=17?i=ee.evening:n>=12?i=ee.afternoon:n>=4?i=ee.morning:i=ee.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return j.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):j.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):_(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):_(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):j.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):j.s(e,t)},S:function(e,t){return j.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return fr(n);case"XXXX":case"XX":return V(n);case"XXXXX":case"XXX":default:return V(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return fr(n);case"xxxx":case"xx":return V(n);case"xxxxx":case"xxx":default:return V(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+dr(n,":");case"OOOO":default:return"GMT"+V(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+dr(n,":");case"zzzz":default:return"GMT"+V(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return _(n,t.length)},T:function(e,t,r){return _(+e,t.length)}};function dr(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),o=n%60;return o===0?r+String(i):r+String(i)+t+_(o,2)}function fr(e,t){return e%60===0?(e>0?"-":"+")+_(Math.abs(e)/60,2):V(e,t)}function V(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=_(Math.trunc(n/60),2),o=_(n%60,2);return r+i+t+o}const mr=(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"});case"PPPP":default:return t.date({width:"full"})}},hr=(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"});case"pppp":default:return t.time({width:"full"})}},Ca={p:hr,P:(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return mr(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",mr(n,t)).replace("{{time}}",hr(i,t))}},Ia=/^D+$/,ka=/^Y+$/,xa=["D","DD","YY","YYYY"];function Ra(e){return Ia.test(e)}function qa(e){return ka.test(e)}function Ya(e,t,r){const n=Aa(e,t,r);if(console.warn(n),xa.includes(e))throw new RangeError(n)}function Aa(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Ha=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Fa=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ja=/^'([^]*?)'?$/,Ga=/''/g,Wa=/[a-zA-Z]/;function yr(e,t,r){var w,p,g,C,x,R,Y,Q;const n=de(),i=(r==null?void 0:r.locale)??n.locale??Ma,o=(r==null?void 0:r.firstWeekContainsDate)??((p=(w=r==null?void 0:r.locale)==null?void 0:w.options)==null?void 0:p.firstWeekContainsDate)??n.firstWeekContainsDate??((C=(g=n.locale)==null?void 0:g.options)==null?void 0:C.firstWeekContainsDate)??1,l=(r==null?void 0:r.weekStartsOn)??((R=(x=r==null?void 0:r.locale)==null?void 0:x.options)==null?void 0:R.weekStartsOn)??n.weekStartsOn??((Q=(Y=n.locale)==null?void 0:Y.options)==null?void 0:Q.weekStartsOn)??0,f=D(e,r==null?void 0:r.in);if(!zn(f))throw new RangeError("Invalid time value");let y=t.match(Fa).map(M=>{const S=M[0];if(S==="p"||S==="P"){const X=Ca[S];return X(M,i.formatLong)}return M}).join("").match(Ha).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const S=M[0];if(S==="'")return{isToken:!1,value:La(M)};if(lr[S])return{isToken:!0,value:M};if(S.match(Wa))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:M}});i.localize.preprocessor&&(y=i.localize.preprocessor(f,y));const m={firstWeekContainsDate:o,weekStartsOn:l,locale:i};return y.map(M=>{if(!M.isToken)return M.value;const S=M.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&qa(S)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&Ra(S))&&Ya(S,t,String(e));const X=lr[S[0]];return X(f,S,i.localize,m)}).join("")}function La(e){const t=e.match(ja);return t?t[1].replace(Ga,"'"):e}function Ua(e,t){const r=D(e,t==null?void 0:t.in),n=r.getFullYear(),i=r.getMonth(),o=k(r,0);return o.setFullYear(n,i+1,0),o.setHours(0,0,0,0),o.getDate()}function $a(){return Object.assign({},de())}function pr(e){return+D(e)}function gr(e){return Math.trunc(+D(e)/1e3)}function za(e){return Math.trunc(e*Fn)}function Va(e){const t=e/Hn;return Math.trunc(t)}function _r(e,t,r){return jn(e,-1,r)}function wr(e,t,r){const n=$a(),i=Za(e,r.timeZone,r.locale??n.locale);return"formatToParts"in i?Qa(i,t):Xa(i,t)}function Qa(e,t){const r=e.formatToParts(t);for(let n=r.length-1;n>=0;--n)if(r[n].type==="timeZoneName")return r[n].value}function Xa(e,t){const r=e.format(t).replace(/\u200E/g,""),n=/ [\w-+ ]+$/.exec(r);return n?n[0].substr(1):""}function Za(e,t,r){return new Intl.DateTimeFormat(r?[r.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function Ba(e,t){const r=ri(t);return"formatToParts"in r?Ja(r,e):ei(r,e)}const Ka={year:0,month:1,day:2,hour:3,minute:4,second:5};function Ja(e,t){try{const r=e.formatToParts(t),n=[];for(let i=0;i<r.length;i++){const o=Ka[r[i].type];o!==void 0&&(n[o]=parseInt(r[i].value,10))}return n}catch(r){if(r instanceof RangeError)return[NaN];throw r}}function ei(e,t){const r=e.format(t),n=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);return[parseInt(n[3],10),parseInt(n[1],10),parseInt(n[2],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10)]}const Be={},br=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")),ti=br==="06/25/2014, 00:00:00"||br==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function ri(e){return Be[e]||(Be[e]=ti?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"})),Be[e]}function Ke(e,t,r,n,i,o,l){const f=new Date(0);return f.setUTCFullYear(e,t,r),f.setUTCHours(n,i,o,l),f}const Tr=36e5,ni=6e4,Je={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function he(e,t,r){if(!e)return 0;let n=Je.timezoneZ.exec(e);if(n)return 0;let i,o;if(n=Je.timezoneHH.exec(e),n)return i=parseInt(n[1],10),Dr(i)?-(i*Tr):NaN;if(n=Je.timezoneHHMM.exec(e),n){i=parseInt(n[2],10);const l=parseInt(n[3],10);return Dr(i,l)?(o=Math.abs(i)*Tr+l*ni,n[1]==="+"?-o:o):NaN}if(si(e)){t=new Date(t||Date.now());const l=r?t:ai(t),f=et(l,e);return-(r?f:ii(t,f,e))}return NaN}function ai(e){return Ke(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function et(e,t){const r=Ba(e,t),n=Ke(r[0],r[1]-1,r[2],r[3]%24,r[4],r[5],0).getTime();let i=e.getTime();const o=i%1e3;return i-=o>=0?o:1e3+o,n-i}function ii(e,t,r){let i=e.getTime()-t;const o=et(new Date(i),r);if(t===o)return t;i-=o-t;const l=et(new Date(i),r);return o===l?o:Math.max(o,l)}function Dr(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Sr={};function si(e){if(Sr[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Sr[e]=!0,!0}catch{return!1}}const oi=60*1e3,ui={X:function(e,t,r){const n=tt(r.timeZone,e);if(n===0)return"Z";switch(t){case"X":return Or(n);case"XXXX":case"XX":return te(n);case"XXXXX":case"XXX":default:return te(n,":")}},x:function(e,t,r){const n=tt(r.timeZone,e);switch(t){case"x":return Or(n);case"xxxx":case"xx":return te(n);case"xxxxx":case"xxx":default:return te(n,":")}},O:function(e,t,r){const n=tt(r.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+ci(n,":");case"OOOO":default:return"GMT"+te(n,":")}},z:function(e,t,r){switch(t){case"z":case"zz":case"zzz":return wr("short",e,r);case"zzzz":default:return wr("long",e,r)}}};function tt(e,t){const r=e?he(e,t,!0)/oi:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(r))throw new RangeError("Invalid time zone specified: "+e);return r}function ve(e,t){const r=e<0?"-":"";let n=Math.abs(e).toString();for(;n.length<t;)n="0"+n;return r+n}function te(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=ve(Math.floor(n/60),2),o=ve(Math.floor(n%60),2);return r+i+t+o}function Or(e,t){return e%60===0?(e>0?"-":"+")+ve(Math.abs(e)/60,2):te(e,t)}function ci(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),o=n%60;return o===0?r+String(i):r+String(i)+t+ve(o,2)}function Mr(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 vr=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,rt=36e5,Er=6e4,li=2,v={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:vr};function Ee(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 r=t.additionalDigits==null?li:Number(t.additionalDigits);if(r!==2&&r!==1&&r!==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 n=di(e),{year:i,restDateString:o}=fi(n.date,r),l=mi(o,i);if(l===null||isNaN(l.getTime()))return new Date(NaN);if(l){const f=l.getTime();let y=0,m;if(n.time&&(y=hi(n.time),y===null||isNaN(y)))return new Date(NaN);if(n.timeZone||t.timeZone){if(m=he(n.timeZone||t.timeZone,new Date(f+y)),isNaN(m))return new Date(NaN)}else m=Mr(new Date(f+y)),m=Mr(new Date(f+y+m));return new Date(f+y+m)}else return new Date(NaN)}function di(e){const t={};let r=v.dateTimePattern.exec(e),n;if(r?(t.date=r[1],n=r[3]):(r=v.datePattern.exec(e),r?(t.date=r[1],n=r[2]):(t.date=null,n=e)),n){const i=v.timeZone.exec(n);i?(t.time=n.replace(i[1],""),t.timeZone=i[1].trim()):t.time=n}return t}function fi(e,t){if(e){const r=v.YYY[t],n=v.YYYYY[t];let i=v.YYYY.exec(e)||n.exec(e);if(i){const o=i[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(i=v.YY.exec(e)||r.exec(e),i){const o=i[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function mi(e,t){if(t===null)return null;let r,n,i;if(!e||!e.length)return r=new Date(0),r.setUTCFullYear(t),r;let o=v.MM.exec(e);if(o)return r=new Date(0),n=parseInt(o[1],10)-1,Cr(t,n)?(r.setUTCFullYear(t,n),r):new Date(NaN);if(o=v.DDD.exec(e),o){r=new Date(0);const l=parseInt(o[1],10);return gi(t,l)?(r.setUTCFullYear(t,0,l),r):new Date(NaN)}if(o=v.MMDD.exec(e),o){r=new Date(0),n=parseInt(o[1],10)-1;const l=parseInt(o[2],10);return Cr(t,n,l)?(r.setUTCFullYear(t,n,l),r):new Date(NaN)}if(o=v.Www.exec(e),o)return i=parseInt(o[1],10)-1,Ir(i)?Pr(t,i):new Date(NaN);if(o=v.WwwD.exec(e),o){i=parseInt(o[1],10)-1;const l=parseInt(o[2],10)-1;return Ir(i,l)?Pr(t,i,l):new Date(NaN)}return null}function hi(e){let t,r,n=v.HH.exec(e);if(n)return t=parseFloat(n[1].replace(",",".")),nt(t)?t%24*rt:NaN;if(n=v.HHMM.exec(e),n)return t=parseInt(n[1],10),r=parseFloat(n[2].replace(",",".")),nt(t,r)?t%24*rt+r*Er:NaN;if(n=v.HHMMSS.exec(e),n){t=parseInt(n[1],10),r=parseInt(n[2],10);const i=parseFloat(n[3].replace(",","."));return nt(t,r,i)?t%24*rt+r*Er+i*1e3:NaN}return null}function Pr(e,t,r){t=t||0,r=r||0;const n=new Date(0);n.setUTCFullYear(e,0,4);const i=n.getUTCDay()||7,o=t*7+r+1-i;return n.setUTCDate(n.getUTCDate()+o),n}const yi=[31,28,31,30,31,30,31,31,30,31,30,31],pi=[31,29,31,30,31,30,31,31,30,31,30,31];function Nr(e){return e%400===0||e%4===0&&e%100!==0}function Cr(e,t,r){if(t<0||t>11)return!1;if(r!=null){if(r<1)return!1;const n=Nr(e);if(n&&r>pi[t]||!n&&r>yi[t])return!1}return!0}function gi(e,t){if(t<1)return!1;const r=Nr(e);return!(r&&t>366||!r&&t>365)}function Ir(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function nt(e,t,r){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||r!=null&&(r<0||r>=60))}const _i=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function wi(e,t,r={}){t=String(t);const n=t.match(_i);if(n){const i=Ee(r.originalDate||e,r);t=n.reduce(function(o,l){if(l[0]==="'")return o;const f=o.indexOf(l),y=o[f-1]==="'",m=o.replace(l,"'"+ui[l[0]](i,l,r)+"'");return y?m.substring(0,f-1)+m.substring(f+1):m},t)}return yr(e,t,r)}function kr(e,t,r){e=Ee(e,r);const n=he(t,e,!0),i=new Date(e.getTime()-n),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 bi(e,t,r,n){return n={...n,timeZone:t,originalDate:e},wi(kr(e,t,{timeZone:n.timeZone}),r,n)}function Ti(e,t,r){if(typeof e=="string"&&!e.match(vr))return Ee(e,{...r,timeZone:t});e=Ee(e,r);const n=Ke(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),i=he(t,new Date(n));return new Date(n+i)}function xr(e,t){return-he(e,t)}function Di(e){return yr(e,"yyyy-MM-dd'T'HH:mm:ss.SSSXXX")}function at(e,t={}){if(!e)return e;const r=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let n="MMM dd, yyy hh:mm a";t.short&&(n="MMM dd, yyy"),t.includeTZ&&(n+=" (z)");const i=new Date(e);return bi(i,r,n)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}function Si(e,t){return`${at(e.getTime())} - ${at(t.getTime(),{includeTZ:!0})}`}const ye={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function Oi(e,t){return e.map(r=>({value:r,label:t.t(`configuration.vitals.reports.granularity.${r}`)}))}function Rr(e,t){return{duration:e,type:"duration",origin:t}}function Mi(e){return e&&_e.find(r=>e<=ye[r])||null}function qr(e,t,r,n){const i=ye[r];let o=0;return i>=ye.daily&&(n?o=-xr(n,t):o=t.getTimezoneOffset()*60*1e3),new Date(e((t.getTime()-o)/i)*i+o)}function Yr(e,t,r){return qr(Math.floor,e,t,r)}function it(e,t,r){return qr(Math.ceil,e,t,r)}class Pe{constructor(t,r,n){T(this,"timeframe");T(this,"tz");T(this,"dataGranularity");if(this.constructor===Pe)throw new Error("BaseQueryTime is not meant to be used directly.");this.timeframe=t,this.tz=r,this.dataGranularity=n??t.dataGranularity}calculateStartDate(t,r,n=1){if(t)return new Date(this.endDate().getTime()-this.timeframe.timeframeLengthMs()*n);{const i=this.endDate(),o=this.timeframe.rawStart(this.tz),l=Yr(o,r,this.tz),y=(i.getTime()-l.getTime())*(n-1);return new Date(l.getTime()-y)}}granularitySeconds(){return Math.floor(this.granularityMs()/1e3)}granularityDruid(){return Rr(this.granularityMs(),this.startDate().toISOString())}startSeconds(){return gr(this.startDate())}endSeconds(){return gr(this.endDate())}startMs(){return pr(this.startDate())}endMs(){return pr(this.endDate())}}class vi extends Pe{constructor(r,n,i,o,l){super(r,i,o);T(this,"granularity");n&&r.allowedGranularities(l).has(n)?this.granularity=n:l?this.granularity=r.fineGrainedDefaultGranularity??r.defaultResponseGranularity:this.granularity=r.defaultResponseGranularity}startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.granularity)}endDate(){return it(this.timeframe.rawEnd(),this.granularity,this.tz)}granularityMs(){return ye[this.granularity]}}class Ar extends Pe{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity)}endDate(){return it(this.timeframe.rawEnd(this.tz),this.dataGranularity,this.tz)}granularityMs(){return this.endDate().getTime()-this.startDate().getTime()}}class Ei extends Ar{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity,2)}granularityMs(){return this.endDate().getTime()-super.startDate().getTime()}}var Ne=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ce={exports:{}};Ce.exports,function(e,t){var r=200,n="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",l="[object Array]",f="[object Boolean]",y="[object Date]",m="[object Error]",w="[object Function]",p="[object GeneratorFunction]",g="[object Map]",C="[object Number]",x="[object Object]",R="[object Promise]",Y="[object RegExp]",Q="[object Set]",M="[object String]",S="[object Symbol]",X="[object WeakMap]",jr="[object ArrayBuffer]",ke="[object DataView]",Gr="[object Float32Array]",Wr="[object Float64Array]",Lr="[object Int8Array]",Ur="[object Int16Array]",$r="[object Int32Array]",zr="[object Uint8Array]",Vr="[object Uint8ClampedArray]",Qr="[object Uint16Array]",Xr="[object Uint32Array]",Wi=/[\\^$.*+?()[\]{}|]/g,Li=/\w*$/,Ui=/^\[object .+?Constructor\]$/,$i=/^(?:0|[1-9]\d*)$/,b={};b[o]=b[l]=b[jr]=b[ke]=b[f]=b[y]=b[Gr]=b[Wr]=b[Lr]=b[Ur]=b[$r]=b[g]=b[C]=b[x]=b[Y]=b[Q]=b[M]=b[S]=b[zr]=b[Vr]=b[Qr]=b[Xr]=!0,b[m]=b[w]=b[X]=!1;var zi=typeof Ne=="object"&&Ne&&Ne.Object===Object&&Ne,Vi=typeof self=="object"&&self&&self.Object===Object&&self,A=zi||Vi||Function("return this")(),Zr=t&&!t.nodeType&&t,Br=Zr&&!0&&e&&!e.nodeType&&e,Qi=Br&&Br.exports===Zr;function Xi(a,s){return a.set(s[0],s[1]),a}function Zi(a,s){return a.add(s),a}function Bi(a,s){for(var u=-1,d=a?a.length:0;++u<d&&s(a[u],u,a)!==!1;);return a}function Ki(a,s){for(var u=-1,d=s.length,O=a.length;++u<d;)a[O+u]=s[u];return a}function Kr(a,s,u,d){for(var O=-1,E=a?a.length:0;++O<E;)u=s(u,a[O],O,a);return u}function Ji(a,s){for(var u=-1,d=Array(a);++u<a;)d[u]=s(u);return d}function es(a,s){return a==null?void 0:a[s]}function Jr(a){var s=!1;if(a!=null&&typeof a.toString!="function")try{s=!!(a+"")}catch{}return s}function en(a){var s=-1,u=Array(a.size);return a.forEach(function(d,O){u[++s]=[O,d]}),u}function ot(a,s){return function(u){return a(s(u))}}function tn(a){var s=-1,u=Array(a.size);return a.forEach(function(d){u[++s]=d}),u}var ts=Array.prototype,rs=Function.prototype,xe=Object.prototype,ut=A["__core-js_shared__"],rn=function(){var a=/[^.]+$/.exec(ut&&ut.keys&&ut.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),nn=rs.toString,G=xe.hasOwnProperty,Re=xe.toString,ns=RegExp("^"+nn.call(G).replace(Wi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),an=Qi?A.Buffer:void 0,sn=A.Symbol,on=A.Uint8Array,as=ot(Object.getPrototypeOf,Object),is=Object.create,ss=xe.propertyIsEnumerable,os=ts.splice,un=Object.getOwnPropertySymbols,us=an?an.isBuffer:void 0,cs=ot(Object.keys,Object),ct=ie(A,"DataView"),pe=ie(A,"Map"),lt=ie(A,"Promise"),dt=ie(A,"Set"),ft=ie(A,"WeakMap"),ge=ie(Object,"create"),ls=K(ct),ds=K(pe),fs=K(lt),ms=K(dt),hs=K(ft),cn=sn?sn.prototype:void 0,ln=cn?cn.valueOf:void 0;function Z(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var d=a[s];this.set(d[0],d[1])}}function ys(){this.__data__=ge?ge(null):{}}function ps(a){return this.has(a)&&delete this.__data__[a]}function gs(a){var s=this.__data__;if(ge){var u=s[a];return u===n?void 0:u}return G.call(s,a)?s[a]:void 0}function _s(a){var s=this.__data__;return ge?s[a]!==void 0:G.call(s,a)}function ws(a,s){var u=this.__data__;return u[a]=ge&&s===void 0?n:s,this}Z.prototype.clear=ys,Z.prototype.delete=ps,Z.prototype.get=gs,Z.prototype.has=_s,Z.prototype.set=ws;function H(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var d=a[s];this.set(d[0],d[1])}}function bs(){this.__data__=[]}function Ts(a){var s=this.__data__,u=qe(s,a);if(u<0)return!1;var d=s.length-1;return u==d?s.pop():os.call(s,u,1),!0}function Ds(a){var s=this.__data__,u=qe(s,a);return u<0?void 0:s[u][1]}function Ss(a){return qe(this.__data__,a)>-1}function Os(a,s){var u=this.__data__,d=qe(u,a);return d<0?u.push([a,s]):u[d][1]=s,this}H.prototype.clear=bs,H.prototype.delete=Ts,H.prototype.get=Ds,H.prototype.has=Ss,H.prototype.set=Os;function ne(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var d=a[s];this.set(d[0],d[1])}}function Ms(){this.__data__={hash:new Z,map:new(pe||H),string:new Z}}function vs(a){return Ye(this,a).delete(a)}function Es(a){return Ye(this,a).get(a)}function Ps(a){return Ye(this,a).has(a)}function Ns(a,s){return Ye(this,a).set(a,s),this}ne.prototype.clear=Ms,ne.prototype.delete=vs,ne.prototype.get=Es,ne.prototype.has=Ps,ne.prototype.set=Ns;function ae(a){this.__data__=new H(a)}function Cs(){this.__data__=new H}function Is(a){return this.__data__.delete(a)}function ks(a){return this.__data__.get(a)}function xs(a){return this.__data__.has(a)}function Rs(a,s){var u=this.__data__;if(u instanceof H){var d=u.__data__;if(!pe||d.length<r-1)return d.push([a,s]),this;u=this.__data__=new ne(d)}return u.set(a,s),this}ae.prototype.clear=Cs,ae.prototype.delete=Is,ae.prototype.get=ks,ae.prototype.has=xs,ae.prototype.set=Rs;function qs(a,s){var u=yt(a)||io(a)?Ji(a.length,String):[],d=u.length,O=!!d;for(var E in a)G.call(a,E)&&!(O&&(E=="length"||to(E,d)))&&u.push(E);return u}function dn(a,s,u){var d=a[s];(!(G.call(a,s)&&yn(d,u))||u===void 0&&!(s in a))&&(a[s]=u)}function qe(a,s){for(var u=a.length;u--;)if(yn(a[u][0],s))return u;return-1}function Ys(a,s){return a&&fn(s,pt(s),a)}function mt(a,s,u,d,O,E,F){var P;if(d&&(P=E?d(a,O,E,F):d(a)),P!==void 0)return P;if(!Ae(a))return a;var _n=yt(a);if(_n){if(P=Ks(a),!s)return Xs(a,P)}else{var se=B(a),wn=se==w||se==p;if(oo(a))return Ws(a,s);if(se==x||se==o||wn&&!E){if(Jr(a))return E?a:{};if(P=Js(wn?{}:a),!s)return Zs(a,Ys(P,a))}else{if(!b[se])return E?a:{};P=eo(a,se,mt,s)}}F||(F=new ae);var bn=F.get(a);if(bn)return bn;if(F.set(a,P),!_n)var Tn=u?Bs(a):pt(a);return Bi(Tn||a,function(gt,He){Tn&&(He=gt,gt=a[He]),dn(P,He,mt(gt,s,u,d,He,a,F))}),P}function As(a){return Ae(a)?is(a):{}}function Hs(a,s,u){var d=s(a);return yt(a)?d:Ki(d,u(a))}function Fs(a){return Re.call(a)}function js(a){if(!Ae(a)||no(a))return!1;var s=gn(a)||Jr(a)?ns:Ui;return s.test(K(a))}function Gs(a){if(!hn(a))return cs(a);var s=[];for(var u in Object(a))G.call(a,u)&&u!="constructor"&&s.push(u);return s}function Ws(a,s){if(s)return a.slice();var u=new a.constructor(a.length);return a.copy(u),u}function ht(a){var s=new a.constructor(a.byteLength);return new on(s).set(new on(a)),s}function Ls(a,s){var u=s?ht(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.byteLength)}function Us(a,s,u){var d=s?u(en(a),!0):en(a);return Kr(d,Xi,new a.constructor)}function $s(a){var s=new a.constructor(a.source,Li.exec(a));return s.lastIndex=a.lastIndex,s}function zs(a,s,u){var d=s?u(tn(a),!0):tn(a);return Kr(d,Zi,new a.constructor)}function Vs(a){return ln?Object(ln.call(a)):{}}function Qs(a,s){var u=s?ht(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.length)}function Xs(a,s){var u=-1,d=a.length;for(s||(s=Array(d));++u<d;)s[u]=a[u];return s}function fn(a,s,u,d){u||(u={});for(var O=-1,E=s.length;++O<E;){var F=s[O],P=void 0;dn(u,F,P===void 0?a[F]:P)}return u}function Zs(a,s){return fn(a,mn(a),s)}function Bs(a){return Hs(a,pt,mn)}function Ye(a,s){var u=a.__data__;return ro(s)?u[typeof s=="string"?"string":"hash"]:u.map}function ie(a,s){var u=es(a,s);return js(u)?u:void 0}var mn=un?ot(un,Object):lo,B=Fs;(ct&&B(new ct(new ArrayBuffer(1)))!=ke||pe&&B(new pe)!=g||lt&&B(lt.resolve())!=R||dt&&B(new dt)!=Q||ft&&B(new ft)!=X)&&(B=function(a){var s=Re.call(a),u=s==x?a.constructor:void 0,d=u?K(u):void 0;if(d)switch(d){case ls:return ke;case ds:return g;case fs:return R;case ms:return Q;case hs:return X}return s});function Ks(a){var s=a.length,u=a.constructor(s);return s&&typeof a[0]=="string"&&G.call(a,"index")&&(u.index=a.index,u.input=a.input),u}function Js(a){return typeof a.constructor=="function"&&!hn(a)?As(as(a)):{}}function eo(a,s,u,d){var O=a.constructor;switch(s){case jr:return ht(a);case f:case y:return new O(+a);case ke:return Ls(a,d);case Gr:case Wr:case Lr:case Ur:case $r:case zr:case Vr:case Qr:case Xr:return Qs(a,d);case g:return Us(a,d,u);case C:case M:return new O(a);case Y:return $s(a);case Q:return zs(a,d,u);case S:return Vs(a)}}function to(a,s){return s=s??i,!!s&&(typeof a=="number"||$i.test(a))&&a>-1&&a%1==0&&a<s}function ro(a){var s=typeof a;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?a!=="__proto__":a===null}function no(a){return!!rn&&rn in a}function hn(a){var s=a&&a.constructor,u=typeof s=="function"&&s.prototype||xe;return a===u}function K(a){if(a!=null){try{return nn.call(a)}catch{}try{return a+""}catch{}}return""}function ao(a){return mt(a,!0,!0)}function yn(a,s){return a===s||a!==a&&s!==s}function io(a){return so(a)&&G.call(a,"callee")&&(!ss.call(a,"callee")||Re.call(a)==o)}var yt=Array.isArray;function pn(a){return a!=null&&uo(a.length)&&!gn(a)}function so(a){return co(a)&&pn(a)}var oo=us||fo;function gn(a){var s=Ae(a)?Re.call(a):"";return s==w||s==p}function uo(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=i}function Ae(a){var s=typeof a;return!!a&&(s=="object"||s=="function")}function co(a){return!!a&&typeof a=="object"}function pt(a){return pn(a)?qs(a):Gs(a)}function lo(){return[]}function fo(){return!1}e.exports=ao}(Ce,Ce.exports);var Ni=Ce.exports;const Ci=Pi(Ni),re=(e,t)=>new Date(e.getTime()-xr(t,e));class N{constructor(t){T(this,"timeframeText");T(this,"key");T(this,"display");T(this,"timeframeLength");T(this,"allowedTiers");T(this,"defaultResponseGranularity");T(this,"dataGranularity");T(this,"isRelative");T(this,"fineGrainedDefaultGranularity");T(this,"_startCustom");T(this,"_endCustom");T(this,"_allowedGranularitiesOverride");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 r=new Set,n=this.maximumTimeframeLength()/3600;return n<=6&&r.add("minutely"),n>=2&&n<=7*24&&r.add("hourly"),n>=2*24&&r.add("daily"),n>=2*24*14&&r.add("weekly"),r}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 r=Ti(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return kr(r,t)}}class Ii extends N{rawStart(t){let r=q(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=re(r,t)),r}maximumTimeframeLength(){return 60*60*24*7}}class ki extends N{rawStart(t){let r=J(this.tzAdjustedDate(t));return t&&(r=re(r,t)),r}maximumTimeframeLength(){return 60*60*24*31}}class xi extends N{rawEnd(t){let r=q(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=re(r,t)),r}rawStart(t){const r=this.tzAdjustedDate(t);let n=q(r.setDate(r.getDate()-7),{weekStartsOn:1});return t&&(n=re(n,t)),n}}class Ri extends N{rawEnd(t){let r=J(this.tzAdjustedDate(t));return t&&(r=re(r,t)),r}rawStart(t){let r=J(_r(this.tzAdjustedDate(t)));return t&&(r=re(r,t)),r}}const Hr=new Map([[h.FIFTEEN_MIN,new N({key:h.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]})],[h.ONE_HOUR,new N({key:h.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]})],[h.SIX_HOUR,new N({key:h.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.TWELVE_HOUR,new N({key:h.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.ONE_DAY,new N({key:h.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.SEVEN_DAY,new N({key:h.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.THIRTY_DAY,new N({key:h.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]})],[h.CURRENT_WEEK,new Ii({key:h.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=q(new Date,{weekStartsOn:1});return(Me(sr(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.CURRENT_MONTH,new ki({key:h.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=J(new Date);return(Me(sr(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[h.PREVIOUS_WEEK,new xi({key:h.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.PREVIOUS_MONTH,new Ri({key:h.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=J(new Date),r=J(_r(new Date));return t.getTimezoneOffset()!==r.getTimezoneOffset()&&(e=Fr(t,r)),60*60*24*Ua(new Date().setMonth(new Date().getMonth()-1))+za(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})]]);function qi(e){const t=new Date(e.start),r=new Date(e.end),n=(r.getTime()-t.getTime())/1e3;return e.timePeriodsKey&&Ci(Hr.get(e.timePeriodsKey))||new N({key:"custom",timeframeText:"custom",display:"custom",startCustom:t,endCustom:r,timeframeLength:()=>n,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["free","plus","enterprise"]})}function Yi(e){return{...e.key!=="custom"&&{timePeriodsKey:e.key},start:e.rawStart(),end:e.rawEnd()}}function Ai(e){return{key:e.key,display:e.display,timeframeText:e.timeframeText,timeframeLength:()=>e.key,start:()=>e.rawStart(),end:()=>e.rawEnd()}}function Fr(e,t){return Va(e.getTimezoneOffset()-t.getTimezoneOffset())}const Hi={"15M":h.FIFTEEN_MIN,"1H":h.ONE_HOUR,"6H":h.SIX_HOUR,"12H":h.TWELVE_HOUR,"24H":h.ONE_DAY,"7D":h.SEVEN_DAY,"15m":h.FIFTEEN_MIN,"1h":h.ONE_HOUR,"6h":h.SIX_HOUR,"12h":h.TWELVE_HOUR,"24h":h.ONE_DAY,"7d":h.SEVEN_DAY,"30d":h.THIRTY_DAY,current_week:h.CURRENT_WEEK,current_month:h.CURRENT_MONTH,previous_week:h.PREVIOUS_WEEK,previous_month:h.PREVIOUS_MONTH};class Ie{constructor(t){T(this,"_seed");this._seed=t}next(t,r){const n=Math.sin(this._seed++)*1e4,i=n-Math.floor(n);return Math.floor(i*(r-t+1))+t}}const Fi=(e,t,r)=>{const n=st(10,1e4),i=new Ie(n),o=Date.now()-6*60*60*1e3,l=Date.now(),f=[];let y=0;for(let p=o;p<=l;p+=60*60*1e3)if(t)for(const g in t)t[g].forEach(C=>{y+=i.next(50,500);const x={[g]:C,[e.name]:y},R={version:"1.0",timestamp:new Date(p).toISOString(),event:x};f.push(R)});else{y+=i.next(50,500);const g={version:"1.0",timestamp:new Date(p).toISOString(),event:{[e.name]:y}};f.push(g)}const m={};if(t)for(const p in t)m[p]={},t[p].forEach(g=>{m[p][g]={name:g,deleted:!1}});const w={start_ms:o,end_ms:l,start:new Date(o).toISOString(),end:new Date(l).toISOString(),query_id:"12345",metric_names:[e.name],metric_units:{[e.name]:e.unit},granularity_ms:60*60*1e3,display:m,...r??{}};return{data:f,meta:w}},ji=(e,t)=>{const r=st(10,1e4),n=new Ie(r),i=Date.now()-6*60*60*1e3,o=Date.now(),l=[],f={};e.forEach(m=>{f[m.name]=0});for(let m=i;m<=o;m+=60*60*1e3){const w={};e.forEach(g=>{f[g.name]+=n.next(50,500),w[g.name]=f[g.name]});const p={version:"1.0",timestamp:new Date(m).toISOString(),event:w};l.push(p)}const y={start_ms:i,end_ms:o,start:new Date(i).toISOString(),end:new Date(o).toISOString(),query_id:"12345",metric_names:e.map(m=>m.name),metric_units:e.reduce((m,w)=>(m[w.name]=w.unit,m),{}),granularity_ms:60*60*1e3,display:{},...t??{}};return{data:l,meta:y}},Gi=(e,t,r)=>{const n=Math.floor(Math.random()*9991)+10,i=new Ie(n),o=Date.now()-6*60*60*1e3,l=Date.now(),f=new Date((o+l)/2).toISOString(),y=[];if(t){const p=Object.keys(t),g=Object.values(t),C=(x,R)=>{if(R===p.length){e.forEach(Y=>{x[Y.name]=i.next(1e3,5e7)}),y.push({version:"1.0",timestamp:new Date().toISOString(),event:{...x}});return}g[R].forEach(Y=>{C({...x,[p[R]]:Y},R+1)})};C({},0)}else{const p={};e.forEach(g=>{p[g.name]=i.next(50,500)}),y.push({version:"1.0",timestamp:f,event:p})}const m={};if(t)for(const p in t)m[p]={},t[p].forEach(g=>{m[p][g]={name:g,deleted:!1}});const w={start_ms:o,end_ms:l,start:new Date(o).toISOString(),end:new Date(l).toISOString(),query_id:"12345",metric_names:e.map(p=>p.name),metric_units:e.reduce((p,g)=>(p[g.name]=g.unit,p),{}),truncated:!1,limit:50,display:m,granularity_ms:l-o,...r??{}};return{data:y,meta:w}};function st(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)}c.DeltaQueryTime=Ei,c.Granularities=ye,c.REFRESH_INTERVAL_MS=3e4,c.SeededRandom=Ie,c.TIMEFRAME_LOOKUP=Hi,c.TimePeriods=Hr,c.Timeframe=N,c.TimeframeKeys=h,c.TimeseriesQueryTime=vi,c.UnaryQueryTime=Ar,c.aiExploreAggregations=Le,c.apiUsageQuerySchema=Bt,c.barChartSchema=Ut,c.basicExploreAggregations=we,c.basicQuerySchema=Kt,c.ceilToNearestTimeGrain=it,c.dashboardConfigSchema=qn,c.dashboardTileTypes=Rn,c.dashboardsSchemaV1=xn,c.datasourceToFilterableDimensions=St,c.datePickerSelectionToTimeframe=qi,c.donutChartSchema=Vt,c.dstOffsetHours=Fr,c.exploreAggregations=We,c.exploreFilterTypesV2=Fe,c.filterableAiExploreDimensions=U,c.filterableBasicExploreDimensions=W,c.filterableExploreDimensions=L,c.filterableRequestDimensions=wt,c.filterableRequestMetrics=Dt,c.filterableRequestWildcardDimensions=En,c.floorToNearestTimeGrain=Yr,c.formatISOTimeWithTZ=Di,c.formatTime=at,c.formatTimeRange=Si,c.gaugeChartSchema=zt,c.generateCrossSectionalData=Gi,c.generateMultipleMetricTimeSeriesData=ji,c.generateSingleMetricTimeSeriesData=Fi,c.getFieldDataSources=Yn,c.granularitiesToOptions=Oi,c.granularityMsToQuery=Rr,c.granularityValues=_e,c.llmUsageSchema=Jt,c.metricCardSchema=Xt,c.msToGranularity=Mi,c.queryDatasources=Nn,c.queryableAiExploreDimensions=Te,c.queryableBasicExploreDimensions=ue,c.queryableExploreDimensions=be,c.queryableRequestDimensions=_t,c.queryableRequestMetrics=Tt,c.queryableRequestWildcardDimensions=bt,c.rand=st,c.relativeTimeRangeValuesRequestV2=Pn,c.relativeTimeRangeValuesV4=Ge,c.reportChartTypes=Dn,c.requestFilterTypeEmptyV2=je,c.requestFilterTypeEqualsV2=Sn,c.requestFilterTypeMetricV2=On,c.requestFilterTypeWildcardV2=Mn,c.singleValueSchema=Zt,c.slottableSchema=Lt,c.stripUnknownFilters=Cn,c.tileConfigSchema=nr,c.tileDefinitionSchema=tr,c.tileLayoutSchema=rr,c.timeRangeTypeV2=vn,c.timeframeToDatepickerSelection=Yi,c.timeframeToDatepickerTimeperiod=Ai,c.timeseriesChartSchema=$t,c.topNTableSchema=Qt,c.validDashboardQuery=er,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
1
+ (function(c,I){typeof exports=="object"&&typeof module<"u"?I(exports):typeof define=="function"&&define.amd?define(["exports"],I):(c=typeof globalThis<"u"?globalThis:c||self,I(c["kong-ui-public-vitals-utilities"]={}))})(this,function(c){"use strict";var mo=Object.defineProperty;var ho=(c,I,h)=>I in c?mo(c,I,{enumerable:!0,configurable:!0,writable:!0,value:h}):c[I]=h;var T=(c,I,h)=>ho(c,typeof I!="symbol"?I+"":I,h);var h=(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.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e))(h||{});const Dn=["horizontal_bar","vertical_bar","timeseries_line","choropleth_map","timeseries_bar","donut","single_value"],Fe=["in","not_in","selector"],Sn=["=","!="],On=["=","!=","<",">","<=",">="],je=["empty","not_empty"],Mn=["starts_with","ends_with"],vn=["absolute","relative"],Ge=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],_e=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],oe=e=>e.filter(t=>t!=="time"),ue=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],W=oe(ue),we=["active_services","request_count","request_per_minute","response_latency_average"],be=[...ue,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],L=oe(be),We=[...we,"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","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"],Te=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin"],U=oe(Te),Le=["total_tokens","prompt_tokens","completion_tokens","ai_request_count","cost","llm_cache_embeddings_latency_average","llm_cache_fetch_latency_average","llm_latency_average","llm_embeddings_tokens","llm_embeddings_cost"],_t=["api","api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","iso_code","portal","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"],wt=oe(_t),bt=["auth_type","client_ip","country_code","data_plane_node_version","header_host","header_user_agent","http_method","request_id","request_uri","response_header_content_type","response_source","service_port","service_protocol","trace_id","upstream_uri"],En=bt,Tt=["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"],Dt=oe(Tt),Pn=["15M","1H","6H","12H","24H","7D"],Nn=["basic","api_usage","llm_usage"],St={basic:new Set(W),api_usage:new Set(L),llm_usage:new Set(U)},Cn=(e,t)=>t.filter(r=>St[e].has(r.field)),In=["horizontal_bar","vertical_bar","gauge","donut","timeseries_line","timeseries_bar","golden_signals","top_n","slottable","single_value"],ce={type:"string"},$={type:"string"},Ot={type:"boolean"},Mt={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},vt={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},Et={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chartDatasetColors:Mt,syntheticsDataKey:ce,chartTitle:$,allowCsvExport:Ot},required:["type"],additionalProperties:!1},Pt={type:"object",properties:{type:{type:"string",enum:["timeseries_line","timeseries_bar"]},stacked:{type:"boolean"},threshold:{type:"object",additionalProperties:{type:"number"}},chartDatasetColors:Mt,syntheticsDataKey:ce,chartTitle:$,allowCsvExport:Ot},required:["type"],additionalProperties:!1},Nt={type:"object",properties:{type:{type:"string",enum:["gauge"]},metricDisplay:{type:"string",enum:["hidden","single","full"]},reverseDataset:{type:"boolean"},numerator:{type:"number"},syntheticsDataKey:ce,chartTitle:$},required:["type"],additionalProperties:!1},Ct={type:"object",properties:{type:{type:"string",enum:["donut"]},syntheticsDataKey:ce,chartTitle:$},required:["type"],additionalProperties:!1},It={type:"object",properties:{chartTitle:$,syntheticsDataKey:ce,type:{type:"string",enum:["top_n"]},description:{type:"string"},entityLink:{type:"string"}},required:["type"],additionalProperties:!1},kt={type:"object",properties:{chartTitle:$,type:{type:"string",enum:["golden_signals"]},longCardTitles:{type:"boolean"},description:{type:"string"},percentileLatency:{type:"boolean"}},required:["type"],additionalProperties:!1},xt={type:"object",properties:{type:{type:"string",enum:["single_value"]},decimalPoints:{type:"number"},chartTitle:$},required:["type"],additionalProperties:!1},Ue={granularity:{type:"string",description:'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',enum:_e},time_range:{type:"object",description:"The time range to query.",anyOf:[{type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:Ge,default:"1h"}},required:["type","time_range"],additionalProperties:!1},{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}],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},$e=e=>({type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:e}}),ze=e=>({type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:e}}),De=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:Fe},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:je}},required:["field","operator"],additionalProperties:!1}]}}),Rt={type:"object",description:"A query to launch at the advanced explore API",properties:{datasource:{type:"string",enum:["advanced"]},metrics:$e(We),dimensions:ze(be),filters:De(L),...Ue},required:["datasource"],additionalProperties:!1},qt={type:"object",description:"A query to launch at the basic explore API",properties:{datasource:{type:"string",enum:["basic"]},metrics:$e(we),dimensions:ze(ue),filters:De(W),...Ue},required:["datasource"],additionalProperties:!1},Yt={type:"object",description:"A query to launch at the AI explore API",properties:{datasource:{type:"string",enum:["ai"]},metrics:$e(Le),dimensions:ze(Te),filters:De(U),...Ue},required:["datasource"],additionalProperties:!1},At={anyOf:[Rt,qt,Yt]},Ht={type:"object",properties:{query:At,chart:{anyOf:[Et,Nt,Ct,Pt,kt,It,vt,xt]}},required:["query","chart"],additionalProperties:!1},Ft={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"},fitToContent:{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},jt={type:"object",properties:{definition:Ht,layout:Ft,id:{type:"string",description:"Unique identifier for the tile. If not provided, one will be generated."}},required:["definition","layout"],additionalProperties:!1},kn={type:"object",properties:{tiles:{type:"array",items:jt},tileHeight:{type:"number",description:"Height of each tile in pixels."},gridSize:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"}},description:"Number of columns and rows in the grid.",required:["cols","rows"],additionalProperties:!1},global_filters:De([...new Set([...L,...W,...U])])},required:["tiles"],additionalProperties:!1},xn=Object.freeze(Object.defineProperty({__proto__:null,aiQuerySchema:Yt,barChartSchema:Et,basicQuerySchema:qt,dashboardConfigSchema:kn,dashboardTileTypes:In,donutChartSchema:Ct,exploreV4QuerySchema:Rt,gaugeChartSchema:Nt,metricCardSchema:kt,singleValueSchema:xt,slottableSchema:vt,tileConfigSchema:jt,tileDefinitionSchema:Ht,tileLayoutSchema:Ft,timeseriesChartSchema:Pt,topNTableSchema:It,validDashboardQuery:At},Symbol.toStringTag,{value:"Module"})),Rn=["horizontal_bar","vertical_bar","gauge","donut","timeseries_line","timeseries_bar","golden_signals","top_n","slottable","single_value"],le={type:"string"},z={type:"string"},Gt={type:"boolean"},Wt={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},Lt={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},Ut={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chart_dataset_colors:Wt,synthetics_data_key:le,chart_title:z,allow_csv_export:Gt},required:["type"],additionalProperties:!1},$t={type:"object",properties:{type:{type:"string",enum:["timeseries_line","timeseries_bar"]},stacked:{type:"boolean"},threshold:{type:"object",additionalProperties:{type:"number"}},chart_dataset_colors:Wt,synthetics_data_key:le,chart_title:z,allow_csv_export:Gt},required:["type"],additionalProperties:!1},zt={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:le,chart_title:z},required:["type"],additionalProperties:!1},Vt={type:"object",properties:{type:{type:"string",enum:["donut"]},synthetics_data_key:le,chart_title:z},required:["type"],additionalProperties:!1},Qt={type:"object",properties:{chart_title:z,synthetics_data_key:le,type:{type:"string",enum:["top_n"]},description:{type:"string"},entity_link:{type:"string"}},required:["type"],additionalProperties:!1},Xt={type:"object",properties:{chart_title:z,type:{type:"string",enum:["golden_signals"]},long_card_titles:{type:"boolean"},description:{type:"string"},percentile_latency:{type:"boolean"}},required:["type"],additionalProperties:!1},Zt={type:"object",properties:{type:{type:"string",enum:["single_value"]},decimal_points:{type:"number"},chart_title:z},required:["type"],additionalProperties:!1},Ve={granularity:{type:"string",description:'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',enum:_e},time_range:{type:"object",description:"The time range to query.",anyOf:[{type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:Ge,default:"1h"}},required:["type","time_range"],additionalProperties:!1},{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}],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},Qe=e=>({type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:e}}),Xe=e=>({type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:e}}),Se=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:Fe},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:je}},required:["field","operator"],additionalProperties:!1}]}}),Bt={type:"object",description:"A query to launch at the advanced explore API",properties:{datasource:{type:"string",enum:["api_usage"]},metrics:Qe(We),dimensions:Xe(be),filters:Se(L),...Ve},required:["datasource"],additionalProperties:!1},Kt={type:"object",description:"A query to launch at the basic explore API",properties:{datasource:{type:"string",enum:["basic"]},metrics:Qe(we),dimensions:Xe(ue),filters:Se(W),...Ve},required:["datasource"],additionalProperties:!1},Jt={type:"object",description:"A query to launch at the AI explore API",properties:{datasource:{type:"string",enum:["llm_usage"]},metrics:Qe(Le),dimensions:Xe(Te),filters:Se(U),...Ve},required:["datasource"],additionalProperties:!1},er={anyOf:[Bt,Kt,Jt]},tr={type:"object",properties:{query:er,chart:{anyOf:[Ut,zt,Vt,$t,Xt,Qt,Lt,Zt]}},required:["query","chart"],additionalProperties:!1},rr={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},nr={type:"object",properties:{type:{type:"string",enum:["chart"]},definition:tr,layout:rr,id:{type:"string",description:"Unique identifier for the tile. If not provided, one will be generated."}},required:["type","definition","layout"],additionalProperties:!1},qn={type:"object",properties:{tiles:{type:"array",items:nr},tile_height:{type:"number",description:"Height of each tile in pixels."},preset_filters:Se([...new Set([...L,...W,...U])]),template_id:{type:["string","null"],description:"Template id which was used to instantiate this dashboard."}},required:["tiles"],additionalProperties:!1},Yn=e=>{const t=[];return W.includes(e)&&t.push("basic"),L.includes(e)&&t.push("api_usage"),U.includes(e)&&t.push("llm_usage"),(wt.includes(e)||Dt.includes(e))&&t.push("requests"),t},ar=6048e5,An=864e5,Hn=60,Fn=3600,ir=Symbol.for("constructDateFrom");function k(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&ir in e?e[ir](t):e instanceof Date?new e.constructor(t):new Date(t)}function D(e,t){return k(t||e,e)}function sr(e,t,r){const n=D(e,r==null?void 0:r.in);return isNaN(t)?k(e,NaN):(n.setDate(n.getDate()+t),n)}function jn(e,t,r){const n=D(e,r==null?void 0:r.in);if(isNaN(t))return k(e,NaN);const i=n.getDate(),o=k(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const l=o.getDate();return i>=l?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}let Gn={};function de(){return Gn}function q(e,t){var f,y,m,w;const r=de(),n=(t==null?void 0:t.weekStartsOn)??((y=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:y.weekStartsOn)??r.weekStartsOn??((w=(m=r.locale)==null?void 0:m.options)==null?void 0:w.weekStartsOn)??0,i=D(e,t==null?void 0:t.in),o=i.getDay(),l=(o<n?7:0)+o-n;return i.setDate(i.getDate()-l),i.setHours(0,0,0,0),i}function Oe(e,t){return q(e,{...t,weekStartsOn:1})}function or(e,t){const r=D(e,t==null?void 0:t.in),n=r.getFullYear(),i=k(r,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const o=Oe(i),l=k(r,0);l.setFullYear(n,0,4),l.setHours(0,0,0,0);const f=Oe(l);return r.getTime()>=o.getTime()?n+1:r.getTime()>=f.getTime()?n:n-1}function ur(e){const t=D(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Wn(e,...t){const r=k.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function Me(e,t){const r=D(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function Ln(e,t,r){const[n,i]=Wn(r==null?void 0:r.in,e,t),o=Me(n),l=Me(i),f=+o-ur(o),y=+l-ur(l);return Math.round((f-y)/An)}function Un(e,t){const r=or(e,t),n=k(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Oe(n)}function $n(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function zn(e){return!(!$n(e)&&typeof e!="number"||isNaN(+D(e)))}function J(e,t){const r=D(e,t==null?void 0:t.in);return r.setDate(1),r.setHours(0,0,0,0),r}function Vn(e,t){const r=D(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const Qn={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"}},Xn=(e,t,r)=>{let n;const i=Qn[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function Ze(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const Zn={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Bn={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Kn={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Jn={date:Ze({formats:Zn,defaultWidth:"full"}),time:Ze({formats:Bn,defaultWidth:"full"}),dateTime:Ze({formats:Kn,defaultWidth:"full"})},ea={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ta=(e,t,r,n)=>ea[e];function fe(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let i;if(n==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,f=r!=null&&r.width?String(r.width):l;i=e.formattingValues[f]||e.formattingValues[l]}else{const l=e.defaultWidth,f=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[f]||e.values[l]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const ra={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},na={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},aa={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"]},ia={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"]},sa={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"}},oa={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"}},ua={ordinalNumber:(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:fe({values:ra,defaultWidth:"wide"}),quarter:fe({values:na,defaultWidth:"wide",argumentCallback:e=>e-1}),month:fe({values:aa,defaultWidth:"wide"}),day:fe({values:ia,defaultWidth:"wide"}),dayPeriod:fe({values:sa,defaultWidth:"wide",formattingValues:oa,defaultFormattingWidth:"wide"})};function me(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const l=o[0],f=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],y=Array.isArray(f)?la(f,p=>p.test(l)):ca(f,p=>p.test(l));let m;m=e.valueCallback?e.valueCallback(y):y,m=r.valueCallback?r.valueCallback(m):m;const w=t.slice(l.length);return{value:m,rest:w}}}function ca(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function la(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function da(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],o=t.match(e.parsePattern);if(!o)return null;let l=e.valueCallback?e.valueCallback(o[0]):o[0];l=r.valueCallback?r.valueCallback(l):l;const f=t.slice(i.length);return{value:l,rest:f}}}const fa=/^(\d+)(th|st|nd|rd)?/i,ma=/\d+/i,ha={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},ya={any:[/^b/i,/^(a|c)/i]},pa={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ga={any:[/1/i,/2/i,/3/i,/4/i]},_a={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},wa={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]},ba={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},Ta={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]},Da={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},Sa={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}},Oa={ordinalNumber:da({matchPattern:fa,parsePattern:ma,valueCallback:e=>parseInt(e,10)}),era:me({matchPatterns:ha,defaultMatchWidth:"wide",parsePatterns:ya,defaultParseWidth:"any"}),quarter:me({matchPatterns:pa,defaultMatchWidth:"wide",parsePatterns:ga,defaultParseWidth:"any",valueCallback:e=>e+1}),month:me({matchPatterns:_a,defaultMatchWidth:"wide",parsePatterns:wa,defaultParseWidth:"any"}),day:me({matchPatterns:ba,defaultMatchWidth:"wide",parsePatterns:Ta,defaultParseWidth:"any"}),dayPeriod:me({matchPatterns:Da,defaultMatchWidth:"any",parsePatterns:Sa,defaultParseWidth:"any"})},Ma={code:"en-US",formatDistance:Xn,formatLong:Jn,formatRelative:ta,localize:ua,match:Oa,options:{weekStartsOn:0,firstWeekContainsDate:1}};function va(e,t){const r=D(e,t==null?void 0:t.in);return Ln(r,Vn(r))+1}function Ea(e,t){const r=D(e,t==null?void 0:t.in),n=+Oe(r)-+Un(r);return Math.round(n/ar)+1}function cr(e,t){var w,p,g,C;const r=D(e,t==null?void 0:t.in),n=r.getFullYear(),i=de(),o=(t==null?void 0:t.firstWeekContainsDate)??((p=(w=t==null?void 0:t.locale)==null?void 0:w.options)==null?void 0:p.firstWeekContainsDate)??i.firstWeekContainsDate??((C=(g=i.locale)==null?void 0:g.options)==null?void 0:C.firstWeekContainsDate)??1,l=k((t==null?void 0:t.in)||e,0);l.setFullYear(n+1,0,o),l.setHours(0,0,0,0);const f=q(l,t),y=k((t==null?void 0:t.in)||e,0);y.setFullYear(n,0,o),y.setHours(0,0,0,0);const m=q(y,t);return+r>=+f?n+1:+r>=+m?n:n-1}function Pa(e,t){var f,y,m,w;const r=de(),n=(t==null?void 0:t.firstWeekContainsDate)??((y=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:y.firstWeekContainsDate)??r.firstWeekContainsDate??((w=(m=r.locale)==null?void 0:m.options)==null?void 0:w.firstWeekContainsDate)??1,i=cr(e,t),o=k((t==null?void 0:t.in)||e,0);return o.setFullYear(i,0,n),o.setHours(0,0,0,0),q(o,t)}function Na(e,t){const r=D(e,t==null?void 0:t.in),n=+q(r,t)-+Pa(r,t);return Math.round(n/ar)+1}function _(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const j={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return _(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):_(r+1,2)},d(e,t){return _(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return _(e.getHours()%12||12,t.length)},H(e,t){return _(e.getHours(),t.length)},m(e,t){return _(e.getMinutes(),t.length)},s(e,t){return _(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return _(i,t.length)}},ee={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},lr={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return j.y(e,t)},Y:function(e,t,r,n){const i=cr(e,n),o=i>0?i:1-i;if(t==="YY"){const l=o%100;return _(l,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):_(o,t.length)},R:function(e,t){const r=or(e);return _(r,t.length)},u:function(e,t){const r=e.getFullYear();return _(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return _(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return _(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return j.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return _(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const i=Na(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):_(i,t.length)},I:function(e,t,r){const n=Ea(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):_(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):j.d(e,t)},D:function(e,t,r){const n=va(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):_(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return _(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return _(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return _(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(n===12?i=ee.noon:n===0?i=ee.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(n>=17?i=ee.evening:n>=12?i=ee.afternoon:n>=4?i=ee.morning:i=ee.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return j.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):j.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):_(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):_(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):j.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):j.s(e,t)},S:function(e,t){return j.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return fr(n);case"XXXX":case"XX":return V(n);case"XXXXX":case"XXX":default:return V(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return fr(n);case"xxxx":case"xx":return V(n);case"xxxxx":case"xxx":default:return V(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+dr(n,":");case"OOOO":default:return"GMT"+V(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+dr(n,":");case"zzzz":default:return"GMT"+V(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return _(n,t.length)},T:function(e,t,r){return _(+e,t.length)}};function dr(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),o=n%60;return o===0?r+String(i):r+String(i)+t+_(o,2)}function fr(e,t){return e%60===0?(e>0?"-":"+")+_(Math.abs(e)/60,2):V(e,t)}function V(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=_(Math.trunc(n/60),2),o=_(n%60,2);return r+i+t+o}const mr=(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"});case"PPPP":default:return t.date({width:"full"})}},hr=(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"});case"pppp":default:return t.time({width:"full"})}},Ca={p:hr,P:(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return mr(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",mr(n,t)).replace("{{time}}",hr(i,t))}},Ia=/^D+$/,ka=/^Y+$/,xa=["D","DD","YY","YYYY"];function Ra(e){return Ia.test(e)}function qa(e){return ka.test(e)}function Ya(e,t,r){const n=Aa(e,t,r);if(console.warn(n),xa.includes(e))throw new RangeError(n)}function Aa(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Ha=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Fa=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ja=/^'([^]*?)'?$/,Ga=/''/g,Wa=/[a-zA-Z]/;function yr(e,t,r){var w,p,g,C,x,R,Y,Q;const n=de(),i=(r==null?void 0:r.locale)??n.locale??Ma,o=(r==null?void 0:r.firstWeekContainsDate)??((p=(w=r==null?void 0:r.locale)==null?void 0:w.options)==null?void 0:p.firstWeekContainsDate)??n.firstWeekContainsDate??((C=(g=n.locale)==null?void 0:g.options)==null?void 0:C.firstWeekContainsDate)??1,l=(r==null?void 0:r.weekStartsOn)??((R=(x=r==null?void 0:r.locale)==null?void 0:x.options)==null?void 0:R.weekStartsOn)??n.weekStartsOn??((Q=(Y=n.locale)==null?void 0:Y.options)==null?void 0:Q.weekStartsOn)??0,f=D(e,r==null?void 0:r.in);if(!zn(f))throw new RangeError("Invalid time value");let y=t.match(Fa).map(M=>{const S=M[0];if(S==="p"||S==="P"){const X=Ca[S];return X(M,i.formatLong)}return M}).join("").match(Ha).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const S=M[0];if(S==="'")return{isToken:!1,value:La(M)};if(lr[S])return{isToken:!0,value:M};if(S.match(Wa))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:M}});i.localize.preprocessor&&(y=i.localize.preprocessor(f,y));const m={firstWeekContainsDate:o,weekStartsOn:l,locale:i};return y.map(M=>{if(!M.isToken)return M.value;const S=M.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&qa(S)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&Ra(S))&&Ya(S,t,String(e));const X=lr[S[0]];return X(f,S,i.localize,m)}).join("")}function La(e){const t=e.match(ja);return t?t[1].replace(Ga,"'"):e}function Ua(e,t){const r=D(e,t==null?void 0:t.in),n=r.getFullYear(),i=r.getMonth(),o=k(r,0);return o.setFullYear(n,i+1,0),o.setHours(0,0,0,0),o.getDate()}function $a(){return Object.assign({},de())}function pr(e){return+D(e)}function gr(e){return Math.trunc(+D(e)/1e3)}function za(e){return Math.trunc(e*Fn)}function Va(e){const t=e/Hn;return Math.trunc(t)}function _r(e,t,r){return jn(e,-1,r)}function wr(e,t,r){const n=$a(),i=Za(e,r.timeZone,r.locale??n.locale);return"formatToParts"in i?Qa(i,t):Xa(i,t)}function Qa(e,t){const r=e.formatToParts(t);for(let n=r.length-1;n>=0;--n)if(r[n].type==="timeZoneName")return r[n].value}function Xa(e,t){const r=e.format(t).replace(/\u200E/g,""),n=/ [\w-+ ]+$/.exec(r);return n?n[0].substr(1):""}function Za(e,t,r){return new Intl.DateTimeFormat(r?[r.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function Ba(e,t){const r=ri(t);return"formatToParts"in r?Ja(r,e):ei(r,e)}const Ka={year:0,month:1,day:2,hour:3,minute:4,second:5};function Ja(e,t){try{const r=e.formatToParts(t),n=[];for(let i=0;i<r.length;i++){const o=Ka[r[i].type];o!==void 0&&(n[o]=parseInt(r[i].value,10))}return n}catch(r){if(r instanceof RangeError)return[NaN];throw r}}function ei(e,t){const r=e.format(t),n=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);return[parseInt(n[3],10),parseInt(n[1],10),parseInt(n[2],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10)]}const Be={},br=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")),ti=br==="06/25/2014, 00:00:00"||br==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function ri(e){return Be[e]||(Be[e]=ti?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"})),Be[e]}function Ke(e,t,r,n,i,o,l){const f=new Date(0);return f.setUTCFullYear(e,t,r),f.setUTCHours(n,i,o,l),f}const Tr=36e5,ni=6e4,Je={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function he(e,t,r){if(!e)return 0;let n=Je.timezoneZ.exec(e);if(n)return 0;let i,o;if(n=Je.timezoneHH.exec(e),n)return i=parseInt(n[1],10),Dr(i)?-(i*Tr):NaN;if(n=Je.timezoneHHMM.exec(e),n){i=parseInt(n[2],10);const l=parseInt(n[3],10);return Dr(i,l)?(o=Math.abs(i)*Tr+l*ni,n[1]==="+"?-o:o):NaN}if(si(e)){t=new Date(t||Date.now());const l=r?t:ai(t),f=et(l,e);return-(r?f:ii(t,f,e))}return NaN}function ai(e){return Ke(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function et(e,t){const r=Ba(e,t),n=Ke(r[0],r[1]-1,r[2],r[3]%24,r[4],r[5],0).getTime();let i=e.getTime();const o=i%1e3;return i-=o>=0?o:1e3+o,n-i}function ii(e,t,r){let i=e.getTime()-t;const o=et(new Date(i),r);if(t===o)return t;i-=o-t;const l=et(new Date(i),r);return o===l?o:Math.max(o,l)}function Dr(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Sr={};function si(e){if(Sr[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Sr[e]=!0,!0}catch{return!1}}const oi=60*1e3,ui={X:function(e,t,r){const n=tt(r.timeZone,e);if(n===0)return"Z";switch(t){case"X":return Or(n);case"XXXX":case"XX":return te(n);case"XXXXX":case"XXX":default:return te(n,":")}},x:function(e,t,r){const n=tt(r.timeZone,e);switch(t){case"x":return Or(n);case"xxxx":case"xx":return te(n);case"xxxxx":case"xxx":default:return te(n,":")}},O:function(e,t,r){const n=tt(r.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+ci(n,":");case"OOOO":default:return"GMT"+te(n,":")}},z:function(e,t,r){switch(t){case"z":case"zz":case"zzz":return wr("short",e,r);case"zzzz":default:return wr("long",e,r)}}};function tt(e,t){const r=e?he(e,t,!0)/oi:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(r))throw new RangeError("Invalid time zone specified: "+e);return r}function ve(e,t){const r=e<0?"-":"";let n=Math.abs(e).toString();for(;n.length<t;)n="0"+n;return r+n}function te(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=ve(Math.floor(n/60),2),o=ve(Math.floor(n%60),2);return r+i+t+o}function Or(e,t){return e%60===0?(e>0?"-":"+")+ve(Math.abs(e)/60,2):te(e,t)}function ci(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),o=n%60;return o===0?r+String(i):r+String(i)+t+ve(o,2)}function Mr(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 vr=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,rt=36e5,Er=6e4,li=2,v={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:vr};function Ee(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 r=t.additionalDigits==null?li:Number(t.additionalDigits);if(r!==2&&r!==1&&r!==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 n=di(e),{year:i,restDateString:o}=fi(n.date,r),l=mi(o,i);if(l===null||isNaN(l.getTime()))return new Date(NaN);if(l){const f=l.getTime();let y=0,m;if(n.time&&(y=hi(n.time),y===null||isNaN(y)))return new Date(NaN);if(n.timeZone||t.timeZone){if(m=he(n.timeZone||t.timeZone,new Date(f+y)),isNaN(m))return new Date(NaN)}else m=Mr(new Date(f+y)),m=Mr(new Date(f+y+m));return new Date(f+y+m)}else return new Date(NaN)}function di(e){const t={};let r=v.dateTimePattern.exec(e),n;if(r?(t.date=r[1],n=r[3]):(r=v.datePattern.exec(e),r?(t.date=r[1],n=r[2]):(t.date=null,n=e)),n){const i=v.timeZone.exec(n);i?(t.time=n.replace(i[1],""),t.timeZone=i[1].trim()):t.time=n}return t}function fi(e,t){if(e){const r=v.YYY[t],n=v.YYYYY[t];let i=v.YYYY.exec(e)||n.exec(e);if(i){const o=i[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(i=v.YY.exec(e)||r.exec(e),i){const o=i[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function mi(e,t){if(t===null)return null;let r,n,i;if(!e||!e.length)return r=new Date(0),r.setUTCFullYear(t),r;let o=v.MM.exec(e);if(o)return r=new Date(0),n=parseInt(o[1],10)-1,Cr(t,n)?(r.setUTCFullYear(t,n),r):new Date(NaN);if(o=v.DDD.exec(e),o){r=new Date(0);const l=parseInt(o[1],10);return gi(t,l)?(r.setUTCFullYear(t,0,l),r):new Date(NaN)}if(o=v.MMDD.exec(e),o){r=new Date(0),n=parseInt(o[1],10)-1;const l=parseInt(o[2],10);return Cr(t,n,l)?(r.setUTCFullYear(t,n,l),r):new Date(NaN)}if(o=v.Www.exec(e),o)return i=parseInt(o[1],10)-1,Ir(i)?Pr(t,i):new Date(NaN);if(o=v.WwwD.exec(e),o){i=parseInt(o[1],10)-1;const l=parseInt(o[2],10)-1;return Ir(i,l)?Pr(t,i,l):new Date(NaN)}return null}function hi(e){let t,r,n=v.HH.exec(e);if(n)return t=parseFloat(n[1].replace(",",".")),nt(t)?t%24*rt:NaN;if(n=v.HHMM.exec(e),n)return t=parseInt(n[1],10),r=parseFloat(n[2].replace(",",".")),nt(t,r)?t%24*rt+r*Er:NaN;if(n=v.HHMMSS.exec(e),n){t=parseInt(n[1],10),r=parseInt(n[2],10);const i=parseFloat(n[3].replace(",","."));return nt(t,r,i)?t%24*rt+r*Er+i*1e3:NaN}return null}function Pr(e,t,r){t=t||0,r=r||0;const n=new Date(0);n.setUTCFullYear(e,0,4);const i=n.getUTCDay()||7,o=t*7+r+1-i;return n.setUTCDate(n.getUTCDate()+o),n}const yi=[31,28,31,30,31,30,31,31,30,31,30,31],pi=[31,29,31,30,31,30,31,31,30,31,30,31];function Nr(e){return e%400===0||e%4===0&&e%100!==0}function Cr(e,t,r){if(t<0||t>11)return!1;if(r!=null){if(r<1)return!1;const n=Nr(e);if(n&&r>pi[t]||!n&&r>yi[t])return!1}return!0}function gi(e,t){if(t<1)return!1;const r=Nr(e);return!(r&&t>366||!r&&t>365)}function Ir(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function nt(e,t,r){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||r!=null&&(r<0||r>=60))}const _i=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function wi(e,t,r={}){t=String(t);const n=t.match(_i);if(n){const i=Ee(r.originalDate||e,r);t=n.reduce(function(o,l){if(l[0]==="'")return o;const f=o.indexOf(l),y=o[f-1]==="'",m=o.replace(l,"'"+ui[l[0]](i,l,r)+"'");return y?m.substring(0,f-1)+m.substring(f+1):m},t)}return yr(e,t,r)}function kr(e,t,r){e=Ee(e,r);const n=he(t,e,!0),i=new Date(e.getTime()-n),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 bi(e,t,r,n){return n={...n,timeZone:t,originalDate:e},wi(kr(e,t,{timeZone:n.timeZone}),r,n)}function Ti(e,t,r){if(typeof e=="string"&&!e.match(vr))return Ee(e,{...r,timeZone:t});e=Ee(e,r);const n=Ke(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),i=he(t,new Date(n));return new Date(n+i)}function xr(e,t){return-he(e,t)}function Di(e){return yr(e,"yyyy-MM-dd'T'HH:mm:ss.SSSXXX")}function at(e,t={}){if(!e)return e;const r=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let n="MMM dd, yyy hh:mm a";t.short&&(n="MMM dd, yyy"),t.includeTZ&&(n+=" (z)");const i=new Date(e);return bi(i,r,n)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}function Si(e,t){return`${at(e.getTime())} - ${at(t.getTime(),{includeTZ:!0})}`}const ye={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function Oi(e,t){return e.map(r=>({value:r,label:t.t(`configuration.vitals.reports.granularity.${r}`)}))}function Rr(e,t){return{duration:e,type:"duration",origin:t}}function Mi(e){return e&&_e.find(r=>e<=ye[r])||null}function qr(e,t,r,n){const i=ye[r];let o=0;return i>=ye.daily&&(n?o=-xr(n,t):o=t.getTimezoneOffset()*60*1e3),new Date(e((t.getTime()-o)/i)*i+o)}function Yr(e,t,r){return qr(Math.floor,e,t,r)}function it(e,t,r){return qr(Math.ceil,e,t,r)}class Pe{constructor(t,r,n){T(this,"timeframe");T(this,"tz");T(this,"dataGranularity");if(this.constructor===Pe)throw new Error("BaseQueryTime is not meant to be used directly.");this.timeframe=t,this.tz=r,this.dataGranularity=n??t.dataGranularity}calculateStartDate(t,r,n=1){if(t)return new Date(this.endDate().getTime()-this.timeframe.timeframeLengthMs()*n);{const i=this.endDate(),o=this.timeframe.rawStart(this.tz),l=Yr(o,r,this.tz),y=(i.getTime()-l.getTime())*(n-1);return new Date(l.getTime()-y)}}granularitySeconds(){return Math.floor(this.granularityMs()/1e3)}granularityDruid(){return Rr(this.granularityMs(),this.startDate().toISOString())}startSeconds(){return gr(this.startDate())}endSeconds(){return gr(this.endDate())}startMs(){return pr(this.startDate())}endMs(){return pr(this.endDate())}}class vi extends Pe{constructor(r,n,i,o,l){super(r,i,o);T(this,"granularity");n&&r.allowedGranularities(l).has(n)?this.granularity=n:l?this.granularity=r.fineGrainedDefaultGranularity??r.defaultResponseGranularity:this.granularity=r.defaultResponseGranularity}startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.granularity)}endDate(){return it(this.timeframe.rawEnd(),this.granularity,this.tz)}granularityMs(){return ye[this.granularity]}}class Ar extends Pe{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity)}endDate(){return it(this.timeframe.rawEnd(this.tz),this.dataGranularity,this.tz)}granularityMs(){return this.endDate().getTime()-this.startDate().getTime()}}class Ei extends Ar{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity,2)}granularityMs(){return this.endDate().getTime()-super.startDate().getTime()}}var Ne=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ce={exports:{}};Ce.exports,function(e,t){var r=200,n="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",l="[object Array]",f="[object Boolean]",y="[object Date]",m="[object Error]",w="[object Function]",p="[object GeneratorFunction]",g="[object Map]",C="[object Number]",x="[object Object]",R="[object Promise]",Y="[object RegExp]",Q="[object Set]",M="[object String]",S="[object Symbol]",X="[object WeakMap]",jr="[object ArrayBuffer]",ke="[object DataView]",Gr="[object Float32Array]",Wr="[object Float64Array]",Lr="[object Int8Array]",Ur="[object Int16Array]",$r="[object Int32Array]",zr="[object Uint8Array]",Vr="[object Uint8ClampedArray]",Qr="[object Uint16Array]",Xr="[object Uint32Array]",Wi=/[\\^$.*+?()[\]{}|]/g,Li=/\w*$/,Ui=/^\[object .+?Constructor\]$/,$i=/^(?:0|[1-9]\d*)$/,b={};b[o]=b[l]=b[jr]=b[ke]=b[f]=b[y]=b[Gr]=b[Wr]=b[Lr]=b[Ur]=b[$r]=b[g]=b[C]=b[x]=b[Y]=b[Q]=b[M]=b[S]=b[zr]=b[Vr]=b[Qr]=b[Xr]=!0,b[m]=b[w]=b[X]=!1;var zi=typeof Ne=="object"&&Ne&&Ne.Object===Object&&Ne,Vi=typeof self=="object"&&self&&self.Object===Object&&self,A=zi||Vi||Function("return this")(),Zr=t&&!t.nodeType&&t,Br=Zr&&!0&&e&&!e.nodeType&&e,Qi=Br&&Br.exports===Zr;function Xi(a,s){return a.set(s[0],s[1]),a}function Zi(a,s){return a.add(s),a}function Bi(a,s){for(var u=-1,d=a?a.length:0;++u<d&&s(a[u],u,a)!==!1;);return a}function Ki(a,s){for(var u=-1,d=s.length,O=a.length;++u<d;)a[O+u]=s[u];return a}function Kr(a,s,u,d){for(var O=-1,E=a?a.length:0;++O<E;)u=s(u,a[O],O,a);return u}function Ji(a,s){for(var u=-1,d=Array(a);++u<a;)d[u]=s(u);return d}function es(a,s){return a==null?void 0:a[s]}function Jr(a){var s=!1;if(a!=null&&typeof a.toString!="function")try{s=!!(a+"")}catch{}return s}function en(a){var s=-1,u=Array(a.size);return a.forEach(function(d,O){u[++s]=[O,d]}),u}function ot(a,s){return function(u){return a(s(u))}}function tn(a){var s=-1,u=Array(a.size);return a.forEach(function(d){u[++s]=d}),u}var ts=Array.prototype,rs=Function.prototype,xe=Object.prototype,ut=A["__core-js_shared__"],rn=function(){var a=/[^.]+$/.exec(ut&&ut.keys&&ut.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),nn=rs.toString,G=xe.hasOwnProperty,Re=xe.toString,ns=RegExp("^"+nn.call(G).replace(Wi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),an=Qi?A.Buffer:void 0,sn=A.Symbol,on=A.Uint8Array,as=ot(Object.getPrototypeOf,Object),is=Object.create,ss=xe.propertyIsEnumerable,os=ts.splice,un=Object.getOwnPropertySymbols,us=an?an.isBuffer:void 0,cs=ot(Object.keys,Object),ct=ie(A,"DataView"),pe=ie(A,"Map"),lt=ie(A,"Promise"),dt=ie(A,"Set"),ft=ie(A,"WeakMap"),ge=ie(Object,"create"),ls=K(ct),ds=K(pe),fs=K(lt),ms=K(dt),hs=K(ft),cn=sn?sn.prototype:void 0,ln=cn?cn.valueOf:void 0;function Z(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var d=a[s];this.set(d[0],d[1])}}function ys(){this.__data__=ge?ge(null):{}}function ps(a){return this.has(a)&&delete this.__data__[a]}function gs(a){var s=this.__data__;if(ge){var u=s[a];return u===n?void 0:u}return G.call(s,a)?s[a]:void 0}function _s(a){var s=this.__data__;return ge?s[a]!==void 0:G.call(s,a)}function ws(a,s){var u=this.__data__;return u[a]=ge&&s===void 0?n:s,this}Z.prototype.clear=ys,Z.prototype.delete=ps,Z.prototype.get=gs,Z.prototype.has=_s,Z.prototype.set=ws;function H(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var d=a[s];this.set(d[0],d[1])}}function bs(){this.__data__=[]}function Ts(a){var s=this.__data__,u=qe(s,a);if(u<0)return!1;var d=s.length-1;return u==d?s.pop():os.call(s,u,1),!0}function Ds(a){var s=this.__data__,u=qe(s,a);return u<0?void 0:s[u][1]}function Ss(a){return qe(this.__data__,a)>-1}function Os(a,s){var u=this.__data__,d=qe(u,a);return d<0?u.push([a,s]):u[d][1]=s,this}H.prototype.clear=bs,H.prototype.delete=Ts,H.prototype.get=Ds,H.prototype.has=Ss,H.prototype.set=Os;function ne(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var d=a[s];this.set(d[0],d[1])}}function Ms(){this.__data__={hash:new Z,map:new(pe||H),string:new Z}}function vs(a){return Ye(this,a).delete(a)}function Es(a){return Ye(this,a).get(a)}function Ps(a){return Ye(this,a).has(a)}function Ns(a,s){return Ye(this,a).set(a,s),this}ne.prototype.clear=Ms,ne.prototype.delete=vs,ne.prototype.get=Es,ne.prototype.has=Ps,ne.prototype.set=Ns;function ae(a){this.__data__=new H(a)}function Cs(){this.__data__=new H}function Is(a){return this.__data__.delete(a)}function ks(a){return this.__data__.get(a)}function xs(a){return this.__data__.has(a)}function Rs(a,s){var u=this.__data__;if(u instanceof H){var d=u.__data__;if(!pe||d.length<r-1)return d.push([a,s]),this;u=this.__data__=new ne(d)}return u.set(a,s),this}ae.prototype.clear=Cs,ae.prototype.delete=Is,ae.prototype.get=ks,ae.prototype.has=xs,ae.prototype.set=Rs;function qs(a,s){var u=yt(a)||io(a)?Ji(a.length,String):[],d=u.length,O=!!d;for(var E in a)G.call(a,E)&&!(O&&(E=="length"||to(E,d)))&&u.push(E);return u}function dn(a,s,u){var d=a[s];(!(G.call(a,s)&&yn(d,u))||u===void 0&&!(s in a))&&(a[s]=u)}function qe(a,s){for(var u=a.length;u--;)if(yn(a[u][0],s))return u;return-1}function Ys(a,s){return a&&fn(s,pt(s),a)}function mt(a,s,u,d,O,E,F){var P;if(d&&(P=E?d(a,O,E,F):d(a)),P!==void 0)return P;if(!Ae(a))return a;var _n=yt(a);if(_n){if(P=Ks(a),!s)return Xs(a,P)}else{var se=B(a),wn=se==w||se==p;if(oo(a))return Ws(a,s);if(se==x||se==o||wn&&!E){if(Jr(a))return E?a:{};if(P=Js(wn?{}:a),!s)return Zs(a,Ys(P,a))}else{if(!b[se])return E?a:{};P=eo(a,se,mt,s)}}F||(F=new ae);var bn=F.get(a);if(bn)return bn;if(F.set(a,P),!_n)var Tn=u?Bs(a):pt(a);return Bi(Tn||a,function(gt,He){Tn&&(He=gt,gt=a[He]),dn(P,He,mt(gt,s,u,d,He,a,F))}),P}function As(a){return Ae(a)?is(a):{}}function Hs(a,s,u){var d=s(a);return yt(a)?d:Ki(d,u(a))}function Fs(a){return Re.call(a)}function js(a){if(!Ae(a)||no(a))return!1;var s=gn(a)||Jr(a)?ns:Ui;return s.test(K(a))}function Gs(a){if(!hn(a))return cs(a);var s=[];for(var u in Object(a))G.call(a,u)&&u!="constructor"&&s.push(u);return s}function Ws(a,s){if(s)return a.slice();var u=new a.constructor(a.length);return a.copy(u),u}function ht(a){var s=new a.constructor(a.byteLength);return new on(s).set(new on(a)),s}function Ls(a,s){var u=s?ht(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.byteLength)}function Us(a,s,u){var d=s?u(en(a),!0):en(a);return Kr(d,Xi,new a.constructor)}function $s(a){var s=new a.constructor(a.source,Li.exec(a));return s.lastIndex=a.lastIndex,s}function zs(a,s,u){var d=s?u(tn(a),!0):tn(a);return Kr(d,Zi,new a.constructor)}function Vs(a){return ln?Object(ln.call(a)):{}}function Qs(a,s){var u=s?ht(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.length)}function Xs(a,s){var u=-1,d=a.length;for(s||(s=Array(d));++u<d;)s[u]=a[u];return s}function fn(a,s,u,d){u||(u={});for(var O=-1,E=s.length;++O<E;){var F=s[O],P=void 0;dn(u,F,P===void 0?a[F]:P)}return u}function Zs(a,s){return fn(a,mn(a),s)}function Bs(a){return Hs(a,pt,mn)}function Ye(a,s){var u=a.__data__;return ro(s)?u[typeof s=="string"?"string":"hash"]:u.map}function ie(a,s){var u=es(a,s);return js(u)?u:void 0}var mn=un?ot(un,Object):lo,B=Fs;(ct&&B(new ct(new ArrayBuffer(1)))!=ke||pe&&B(new pe)!=g||lt&&B(lt.resolve())!=R||dt&&B(new dt)!=Q||ft&&B(new ft)!=X)&&(B=function(a){var s=Re.call(a),u=s==x?a.constructor:void 0,d=u?K(u):void 0;if(d)switch(d){case ls:return ke;case ds:return g;case fs:return R;case ms:return Q;case hs:return X}return s});function Ks(a){var s=a.length,u=a.constructor(s);return s&&typeof a[0]=="string"&&G.call(a,"index")&&(u.index=a.index,u.input=a.input),u}function Js(a){return typeof a.constructor=="function"&&!hn(a)?As(as(a)):{}}function eo(a,s,u,d){var O=a.constructor;switch(s){case jr:return ht(a);case f:case y:return new O(+a);case ke:return Ls(a,d);case Gr:case Wr:case Lr:case Ur:case $r:case zr:case Vr:case Qr:case Xr:return Qs(a,d);case g:return Us(a,d,u);case C:case M:return new O(a);case Y:return $s(a);case Q:return zs(a,d,u);case S:return Vs(a)}}function to(a,s){return s=s??i,!!s&&(typeof a=="number"||$i.test(a))&&a>-1&&a%1==0&&a<s}function ro(a){var s=typeof a;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?a!=="__proto__":a===null}function no(a){return!!rn&&rn in a}function hn(a){var s=a&&a.constructor,u=typeof s=="function"&&s.prototype||xe;return a===u}function K(a){if(a!=null){try{return nn.call(a)}catch{}try{return a+""}catch{}}return""}function ao(a){return mt(a,!0,!0)}function yn(a,s){return a===s||a!==a&&s!==s}function io(a){return so(a)&&G.call(a,"callee")&&(!ss.call(a,"callee")||Re.call(a)==o)}var yt=Array.isArray;function pn(a){return a!=null&&uo(a.length)&&!gn(a)}function so(a){return co(a)&&pn(a)}var oo=us||fo;function gn(a){var s=Ae(a)?Re.call(a):"";return s==w||s==p}function uo(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=i}function Ae(a){var s=typeof a;return!!a&&(s=="object"||s=="function")}function co(a){return!!a&&typeof a=="object"}function pt(a){return pn(a)?qs(a):Gs(a)}function lo(){return[]}function fo(){return!1}e.exports=ao}(Ce,Ce.exports);var Ni=Ce.exports;const Ci=Pi(Ni),re=(e,t)=>new Date(e.getTime()-xr(t,e));class N{constructor(t){T(this,"timeframeText");T(this,"key");T(this,"display");T(this,"timeframeLength");T(this,"allowedTiers");T(this,"defaultResponseGranularity");T(this,"dataGranularity");T(this,"isRelative");T(this,"fineGrainedDefaultGranularity");T(this,"_startCustom");T(this,"_endCustom");T(this,"_allowedGranularitiesOverride");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 r=new Set,n=this.maximumTimeframeLength()/3600;return n<=6&&r.add("minutely"),n>=2&&n<=7*24&&r.add("hourly"),n>=2*24&&r.add("daily"),n>=2*24*14&&r.add("weekly"),r}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 r=Ti(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return kr(r,t)}}class Ii extends N{rawStart(t){let r=q(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=re(r,t)),r}maximumTimeframeLength(){return 60*60*24*7}}class ki extends N{rawStart(t){let r=J(this.tzAdjustedDate(t));return t&&(r=re(r,t)),r}maximumTimeframeLength(){return 60*60*24*31}}class xi extends N{rawEnd(t){let r=q(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=re(r,t)),r}rawStart(t){const r=this.tzAdjustedDate(t);let n=q(r.setDate(r.getDate()-7),{weekStartsOn:1});return t&&(n=re(n,t)),n}}class Ri extends N{rawEnd(t){let r=J(this.tzAdjustedDate(t));return t&&(r=re(r,t)),r}rawStart(t){let r=J(_r(this.tzAdjustedDate(t)));return t&&(r=re(r,t)),r}}const Hr=new Map([[h.FIFTEEN_MIN,new N({key:h.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]})],[h.ONE_HOUR,new N({key:h.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]})],[h.SIX_HOUR,new N({key:h.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.TWELVE_HOUR,new N({key:h.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.ONE_DAY,new N({key:h.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.SEVEN_DAY,new N({key:h.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.THIRTY_DAY,new N({key:h.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]})],[h.CURRENT_WEEK,new Ii({key:h.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=q(new Date,{weekStartsOn:1});return(Me(sr(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.CURRENT_MONTH,new ki({key:h.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=J(new Date);return(Me(sr(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[h.PREVIOUS_WEEK,new xi({key:h.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.PREVIOUS_MONTH,new Ri({key:h.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=J(new Date),r=J(_r(new Date));return t.getTimezoneOffset()!==r.getTimezoneOffset()&&(e=Fr(t,r)),60*60*24*Ua(new Date().setMonth(new Date().getMonth()-1))+za(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})]]);function qi(e){const t=new Date(e.start),r=new Date(e.end),n=(r.getTime()-t.getTime())/1e3;return e.timePeriodsKey&&Ci(Hr.get(e.timePeriodsKey))||new N({key:"custom",timeframeText:"custom",display:"custom",startCustom:t,endCustom:r,timeframeLength:()=>n,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["free","plus","enterprise"]})}function Yi(e){return{...e.key!=="custom"&&{timePeriodsKey:e.key},start:e.rawStart(),end:e.rawEnd()}}function Ai(e){return{key:e.key,display:e.display,timeframeText:e.timeframeText,timeframeLength:()=>e.key,start:()=>e.rawStart(),end:()=>e.rawEnd()}}function Fr(e,t){return Va(e.getTimezoneOffset()-t.getTimezoneOffset())}const Hi={"15M":h.FIFTEEN_MIN,"1H":h.ONE_HOUR,"6H":h.SIX_HOUR,"12H":h.TWELVE_HOUR,"24H":h.ONE_DAY,"7D":h.SEVEN_DAY,"15m":h.FIFTEEN_MIN,"1h":h.ONE_HOUR,"6h":h.SIX_HOUR,"12h":h.TWELVE_HOUR,"24h":h.ONE_DAY,"7d":h.SEVEN_DAY,"30d":h.THIRTY_DAY,current_week:h.CURRENT_WEEK,current_month:h.CURRENT_MONTH,previous_week:h.PREVIOUS_WEEK,previous_month:h.PREVIOUS_MONTH};class Ie{constructor(t){T(this,"_seed");this._seed=t}next(t,r){const n=Math.sin(this._seed++)*1e4,i=n-Math.floor(n);return Math.floor(i*(r-t+1))+t}}const Fi=(e,t,r)=>{const n=st(10,1e4),i=new Ie(n),o=Date.now()-6*60*60*1e3,l=Date.now(),f=[];let y=0;for(let p=o;p<=l;p+=60*60*1e3)if(t)for(const g in t)t[g].forEach(C=>{y+=i.next(50,500);const x={[g]:C,[e.name]:y},R={version:"1.0",timestamp:new Date(p).toISOString(),event:x};f.push(R)});else{y+=i.next(50,500);const g={version:"1.0",timestamp:new Date(p).toISOString(),event:{[e.name]:y}};f.push(g)}const m={};if(t)for(const p in t)m[p]={},t[p].forEach(g=>{m[p][g]={name:g,deleted:!1}});const w={start_ms:o,end_ms:l,start:new Date(o).toISOString(),end:new Date(l).toISOString(),query_id:"12345",metric_names:[e.name],metric_units:{[e.name]:e.unit},granularity_ms:60*60*1e3,display:m,...r??{}};return{data:f,meta:w}},ji=(e,t)=>{const r=st(10,1e4),n=new Ie(r),i=Date.now()-6*60*60*1e3,o=Date.now(),l=[],f={};e.forEach(m=>{f[m.name]=0});for(let m=i;m<=o;m+=60*60*1e3){const w={};e.forEach(g=>{f[g.name]+=n.next(50,500),w[g.name]=f[g.name]});const p={version:"1.0",timestamp:new Date(m).toISOString(),event:w};l.push(p)}const y={start_ms:i,end_ms:o,start:new Date(i).toISOString(),end:new Date(o).toISOString(),query_id:"12345",metric_names:e.map(m=>m.name),metric_units:e.reduce((m,w)=>(m[w.name]=w.unit,m),{}),granularity_ms:60*60*1e3,display:{},...t??{}};return{data:l,meta:y}},Gi=(e,t,r)=>{const n=Math.floor(Math.random()*9991)+10,i=new Ie(n),o=Date.now()-6*60*60*1e3,l=Date.now(),f=new Date((o+l)/2).toISOString(),y=[];if(t){const p=Object.keys(t),g=Object.values(t),C=(x,R)=>{if(R===p.length){e.forEach(Y=>{x[Y.name]=i.next(1e3,5e7)}),y.push({version:"1.0",timestamp:new Date().toISOString(),event:{...x}});return}g[R].forEach(Y=>{C({...x,[p[R]]:Y},R+1)})};C({},0)}else{const p={};e.forEach(g=>{p[g.name]=i.next(50,500)}),y.push({version:"1.0",timestamp:f,event:p})}const m={};if(t)for(const p in t)m[p]={},t[p].forEach(g=>{m[p][g]={name:g,deleted:!1}});const w={start_ms:o,end_ms:l,start:new Date(o).toISOString(),end:new Date(l).toISOString(),query_id:"12345",metric_names:e.map(p=>p.name),metric_units:e.reduce((p,g)=>(p[g.name]=g.unit,p),{}),truncated:!1,limit:50,display:m,granularity_ms:l-o,...r??{}};return{data:y,meta:w}};function st(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)}c.DeltaQueryTime=Ei,c.Granularities=ye,c.REFRESH_INTERVAL_MS=3e4,c.SeededRandom=Ie,c.TIMEFRAME_LOOKUP=Hi,c.TimePeriods=Hr,c.Timeframe=N,c.TimeframeKeys=h,c.TimeseriesQueryTime=vi,c.UnaryQueryTime=Ar,c.aiExploreAggregations=Le,c.apiUsageQuerySchema=Bt,c.barChartSchema=Ut,c.basicExploreAggregations=we,c.basicQuerySchema=Kt,c.ceilToNearestTimeGrain=it,c.dashboardConfigSchema=qn,c.dashboardTileTypes=Rn,c.dashboardsSchemaV1=xn,c.datasourceToFilterableDimensions=St,c.datePickerSelectionToTimeframe=qi,c.donutChartSchema=Vt,c.dstOffsetHours=Fr,c.exploreAggregations=We,c.exploreFilterTypesV2=Fe,c.filterableAiExploreDimensions=U,c.filterableBasicExploreDimensions=W,c.filterableExploreDimensions=L,c.filterableRequestDimensions=wt,c.filterableRequestMetrics=Dt,c.filterableRequestWildcardDimensions=En,c.floorToNearestTimeGrain=Yr,c.formatISOTimeWithTZ=Di,c.formatTime=at,c.formatTimeRange=Si,c.gaugeChartSchema=zt,c.generateCrossSectionalData=Gi,c.generateMultipleMetricTimeSeriesData=ji,c.generateSingleMetricTimeSeriesData=Fi,c.getFieldDataSources=Yn,c.granularitiesToOptions=Oi,c.granularityMsToQuery=Rr,c.granularityValues=_e,c.llmUsageSchema=Jt,c.metricCardSchema=Xt,c.msToGranularity=Mi,c.queryDatasources=Nn,c.queryableAiExploreDimensions=Te,c.queryableBasicExploreDimensions=ue,c.queryableExploreDimensions=be,c.queryableRequestDimensions=_t,c.queryableRequestMetrics=Tt,c.queryableRequestWildcardDimensions=bt,c.rand=st,c.relativeTimeRangeValuesRequestV2=Pn,c.relativeTimeRangeValuesV4=Ge,c.reportChartTypes=Dn,c.requestFilterTypeEmptyV2=je,c.requestFilterTypeEqualsV2=Sn,c.requestFilterTypeMetricV2=On,c.requestFilterTypeWildcardV2=Mn,c.singleValueSchema=Zt,c.slottableSchema=Lt,c.stripUnknownFilters=Cn,c.tileConfigSchema=nr,c.tileDefinitionSchema=tr,c.tileLayoutSchema=rr,c.timeRangeTypeV2=vn,c.timeframeToDatepickerSelection=Yi,c.timeframeToDatepickerTimeperiod=Ai,c.timeseriesChartSchema=$t,c.topNTableSchema=Qt,c.validDashboardQuery=er,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
2
2
  //# sourceMappingURL=vitals-utilities.umd.js.map