@kong-ui-public/analytics-utilities 5.9.0 → 5.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"timeframes.d.ts","sourceRoot":"","sources":["../../src/timeframes.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,yBAAyB,EAAE,WAAW,EACtC,iBAAiB,EAClB,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAOnD,qBAAa,SAAU,YAAW,UAAU;IAC1C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAE9B,QAAQ,CAAC,GAAG,EAAE,yBAAyB,GAAG,QAAQ,CAAA;IAElD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IAExB,QAAQ,CAAC,eAAe,EAAE,MAAM,MAAM,CAAA;IAEtC,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAIpC,QAAQ,CAAC,0BAA0B,EAAE,iBAAiB,CAAA;IAKtD,QAAQ,CAAC,eAAe,EAAE,iBAAiB,CAAA;IAO3C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAE5B,OAAO,CAAC,YAAY,CAAC,CAAM;IAE3B,OAAO,CAAC,UAAU,CAAC,CAAM;IAEzB,OAAO,CAAC,6BAA6B,CAAC,CAAqB;gBAE/C,IAAI,EAAE,gBAAgB;IAiBlC,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI;IAO1B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI;IAI5B,iBAAiB;IAIjB,sBAAsB;IAKtB,oBAAoB,CAAC,SAAS,CAAC,EAAE,OAAO;IAgCxC,QAAQ,IAAI,MAAM;IASlB,OAAO,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,WAAW;IAkBjC,SAAS,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;CAU5C;AA8FD,eAAO,MAAM,WAAW,wBAiLtB,CAAA;AAEF,wBAAgB,8BAA8B,CAAC,mBAAmB,EAAE,mBAAmB,GAAG,SAAS,CA0BlG;AAED,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,SAAS,GAAG,mBAAmB,CAQxF;AAED,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAUhF;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,GAAG,MAAM,CAEzD"}
1
+ {"version":3,"file":"timeframes.d.ts","sourceRoot":"","sources":["../../src/timeframes.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,yBAAyB,EAAE,WAAW,EACtC,iBAAiB,EAClB,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAOnD,qBAAa,SAAU,YAAW,UAAU;IAC1C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAE9B,QAAQ,CAAC,GAAG,EAAE,yBAAyB,GAAG,QAAQ,CAAA;IAElD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IAExB,QAAQ,CAAC,eAAe,EAAE,MAAM,MAAM,CAAA;IAEtC,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAIpC,QAAQ,CAAC,0BAA0B,EAAE,iBAAiB,CAAA;IAKtD,QAAQ,CAAC,eAAe,EAAE,iBAAiB,CAAA;IAO3C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAE5B,OAAO,CAAC,YAAY,CAAC,CAAM;IAE3B,OAAO,CAAC,UAAU,CAAC,CAAM;IAEzB,OAAO,CAAC,6BAA6B,CAAC,CAAqB;gBAE/C,IAAI,EAAE,gBAAgB;IAiBlC,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI;IAO1B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI;IAI5B,iBAAiB;IAIjB,sBAAsB;IAKtB,oBAAoB,CAAC,SAAS,CAAC,EAAE,OAAO;IAgCxC,QAAQ,IAAI,MAAM;IASlB,OAAO,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,WAAW;IAkBjC,SAAS,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;CAU5C;AA8FD,eAAO,MAAM,WAAW,wBAmLtB,CAAA;AAEF,wBAAgB,8BAA8B,CAAC,mBAAmB,EAAE,mBAAmB,GAAG,SAAS,CA0BlG;AAED,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,SAAS,GAAG,mBAAmB,CAQxF;AAED,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAUhF;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,GAAG,MAAM,CAEzD"}
@@ -1,2 +1,2 @@
1
- "use strict";var Je=Object.defineProperty;var Ke=(e,t,n)=>t in e?Je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var h=(e,t,n)=>Ke(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const et=30*1e3;var m=(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))(m||{});const tt=["horizontal_bar","vertical_bar","timeseries_line","choropleth_map","timeseries_bar"],nt=["in","not_in","selector"],rt=["=","!="],at=["=","!=","<",">","<=",">="],it=["empty","not_empty"],st=["starts_with","ends_with"],ot=["absolute","relative"],ut=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],ve=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],W=e=>e.filter(t=>t!=="time"),K=["api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","route","status_code","status_code_grouped","time"],xe=W(K),Se=["active_services","request_count","request_per_minute","response_latency_average"],Ee=[...K,"application","consumer","country_code","iso_code"],ke=W(Ee),ct=[...Se,"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","request_size_p99","request_size_p95","request_size_p50","request_size_average","response_size_average"],Ne=["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"],Ye=W(Ne),lt=["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"],Re=["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","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"],dt=W(Re),Pe=["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"],ft=Pe,Ie=["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"],mt=W(Ie),ht=["15M","1H","6H","12H","24H","7D"],yt=["basic","advanced","ai"],We={basic:new Set(xe),advanced:new Set(ke),ai:new Set(Ye)},gt=(e,t)=>t.filter(n=>We[e].has(n.dimension)),Fe=6048e5,wt=864e5,Tt=60,_t=3600,ie=Symbol.for("constructDateFrom");function D(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&ie in e?e[ie](t):e instanceof Date?new e.constructor(t):new Date(t)}function y(e,t){return D(t||e,e)}function se(e,t,n){const r=y(e,n==null?void 0:n.in);return isNaN(t)?D(e,NaN):(r.setDate(r.getDate()+t),r)}function Dt(e,t,n){const r=y(e,n==null?void 0:n.in);if(isNaN(t))return D(e,NaN);const a=r.getDate(),i=D(e,r.getTime());i.setMonth(r.getMonth()+t+1,0);const s=i.getDate();return a>=s?i:(r.setFullYear(i.getFullYear(),i.getMonth(),a),r)}let Mt={};function F(){return Mt}function O(e,t){var o,u,l,c;const n=F(),r=(t==null?void 0:t.weekStartsOn)??((u=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((c=(l=n.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??0,a=y(e,t==null?void 0:t.in),i=a.getDay(),s=(i<r?7:0)+i-r;return a.setDate(a.getDate()-s),a.setHours(0,0,0,0),a}function C(e,t){return O(e,{...t,weekStartsOn:1})}function He(e,t){const n=y(e,t==null?void 0:t.in),r=n.getFullYear(),a=D(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const i=C(a),s=D(n,0);s.setFullYear(r,0,4),s.setHours(0,0,0,0);const o=C(s);return n.getTime()>=i.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function oe(e){const t=y(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function pt(e,...t){const n=D.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function q(e,t){const n=y(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function bt(e,t,n){const[r,a]=pt(n==null?void 0:n.in,e,t),i=q(r),s=q(a),o=+i-oe(i),u=+s-oe(s);return Math.round((o-u)/wt)}function Ot(e,t){const n=He(e,t),r=D(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),C(r)}function vt(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function xt(e){return!(!vt(e)&&typeof e!="number"||isNaN(+y(e)))}function N(e,t){const n=y(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function St(e,t){const n=y(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Et={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"}},kt=(e,t,n)=>{let r;const a=Et[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function V(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Nt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Yt={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Rt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Pt={date:V({formats:Nt,defaultWidth:"full"}),time:V({formats:Yt,defaultWidth:"full"}),dateTime:V({formats:Rt,defaultWidth:"full"})},It={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Wt=(e,t,n,r)=>It[e];function R(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):s;a=e.formattingValues[o]||e.formattingValues[s]}else{const s=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[o]||e.values[s]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const Ft={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ht={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ct={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"]},qt={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"]},Gt={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"}},Lt={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"}},Ut=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},zt={ordinalNumber:Ut,era:R({values:Ft,defaultWidth:"wide"}),quarter:R({values:Ht,defaultWidth:"wide",argumentCallback:e=>e-1}),month:R({values:Ct,defaultWidth:"wide"}),day:R({values:qt,defaultWidth:"wide"}),dayPeriod:R({values:Gt,defaultWidth:"wide",formattingValues:Lt,defaultFormattingWidth:"wide"})};function P(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const s=i[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(o)?Vt(o,d=>d.test(s)):At(o,d=>d.test(s));let l;l=e.valueCallback?e.valueCallback(u):u,l=n.valueCallback?n.valueCallback(l):l;const c=t.slice(s.length);return{value:l,rest:c}}}function At(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Vt(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Xt(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;const o=t.slice(a.length);return{value:s,rest:o}}}const $t=/^(\d+)(th|st|nd|rd)?/i,jt=/\d+/i,Qt={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},Zt={any:[/^b/i,/^(a|c)/i]},Bt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Jt={any:[/1/i,/2/i,/3/i,/4/i]},Kt={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},en={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]},tn={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},nn={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]},rn={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},an={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}},sn={ordinalNumber:Xt({matchPattern:$t,parsePattern:jt,valueCallback:e=>parseInt(e,10)}),era:P({matchPatterns:Qt,defaultMatchWidth:"wide",parsePatterns:Zt,defaultParseWidth:"any"}),quarter:P({matchPatterns:Bt,defaultMatchWidth:"wide",parsePatterns:Jt,defaultParseWidth:"any",valueCallback:e=>e+1}),month:P({matchPatterns:Kt,defaultMatchWidth:"wide",parsePatterns:en,defaultParseWidth:"any"}),day:P({matchPatterns:tn,defaultMatchWidth:"wide",parsePatterns:nn,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:rn,defaultMatchWidth:"any",parsePatterns:an,defaultParseWidth:"any"})},on={code:"en-US",formatDistance:kt,formatLong:Pt,formatRelative:Wt,localize:zt,match:sn,options:{weekStartsOn:0,firstWeekContainsDate:1}};function un(e,t){const n=y(e,t==null?void 0:t.in);return bt(n,St(n))+1}function cn(e,t){const n=y(e,t==null?void 0:t.in),r=+C(n)-+Ot(n);return Math.round(r/Fe)+1}function Ce(e,t){var c,d,p,M;const n=y(e,t==null?void 0:t.in),r=n.getFullYear(),a=F(),i=(t==null?void 0:t.firstWeekContainsDate)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??a.firstWeekContainsDate??((M=(p=a.locale)==null?void 0:p.options)==null?void 0:M.firstWeekContainsDate)??1,s=D((t==null?void 0:t.in)||e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const o=O(s,t),u=D((t==null?void 0:t.in)||e,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const l=O(u,t);return+n>=+o?r+1:+n>=+l?r:r-1}function ln(e,t){var o,u,l,c;const n=F(),r=(t==null?void 0:t.firstWeekContainsDate)??((u=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((c=(l=n.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??1,a=Ce(e,t),i=D((t==null?void 0:t.in)||e,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),O(i,t)}function dn(e,t){const n=y(e,t==null?void 0:t.in),r=+O(n,t)-+ln(n,t);return Math.round(r/Fe)+1}function f(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const v={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return f(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):f(n+1,2)},d(e,t){return f(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return f(e.getHours()%12||12,t.length)},H(e,t){return f(e.getHours(),t.length)},m(e,t){return f(e.getMinutes(),t.length)},s(e,t){return f(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return f(a,t.length)}},E={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ue={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return v.y(e,t)},Y:function(e,t,n,r){const a=Ce(e,r),i=a>0?a:1-a;if(t==="YY"){const s=i%100;return f(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):f(i,t.length)},R:function(e,t){const n=He(e);return f(n,t.length)},u:function(e,t){const n=e.getFullYear();return f(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return f(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return f(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return v.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return f(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=dn(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):f(a,t.length)},I:function(e,t,n){const r=cn(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):f(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):v.d(e,t)},D:function(e,t,n){const r=un(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):f(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return f(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return f(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return f(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=E.noon:r===0?a=E.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=E.evening:r>=12?a=E.afternoon:r>=4?a=E.morning:a=E.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return v.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):v.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):f(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):f(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):v.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):v.s(e,t)},S:function(e,t){return v.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return le(r);case"XXXX":case"XX":return x(r);case"XXXXX":case"XXX":default:return x(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return le(r);case"xxxx":case"xx":return x(r);case"xxxxx":case"xxx":default:return x(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ce(r,":");case"OOOO":default:return"GMT"+x(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ce(r,":");case"zzzz":default:return"GMT"+x(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return f(r,t.length)},T:function(e,t,n){return f(+e,t.length)}};function ce(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+t+f(i,2)}function le(e,t){return e%60===0?(e>0?"-":"+")+f(Math.abs(e)/60,2):x(e,t)}function x(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=f(Math.trunc(r/60),2),i=f(r%60,2);return n+a+t+i}const de=(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"})}},qe=(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"})}},fn=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return de(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",de(r,t)).replace("{{time}}",qe(a,t))},mn={p:qe,P:fn},hn=/^D+$/,yn=/^Y+$/,gn=["D","DD","YY","YYYY"];function wn(e){return hn.test(e)}function Tn(e){return yn.test(e)}function _n(e,t,n){const r=Dn(e,t,n);if(console.warn(r),gn.includes(e))throw new RangeError(r)}function Dn(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Mn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,pn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bn=/^'([^]*?)'?$/,On=/''/g,vn=/[a-zA-Z]/;function Ge(e,t,n){var c,d,p,M,b,S,re,ae;const r=F(),a=(n==null?void 0:n.locale)??r.locale??on,i=(n==null?void 0:n.firstWeekContainsDate)??((d=(c=n==null?void 0:n.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((M=(p=r.locale)==null?void 0:p.options)==null?void 0:M.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((S=(b=n==null?void 0:n.locale)==null?void 0:b.options)==null?void 0:S.weekStartsOn)??r.weekStartsOn??((ae=(re=r.locale)==null?void 0:re.options)==null?void 0:ae.weekStartsOn)??0,o=y(e,n==null?void 0:n.in);if(!xt(o))throw new RangeError("Invalid time value");let u=t.match(pn).map(T=>{const w=T[0];if(w==="p"||w==="P"){const A=mn[w];return A(T,a.formatLong)}return T}).join("").match(Mn).map(T=>{if(T==="''")return{isToken:!1,value:"'"};const w=T[0];if(w==="'")return{isToken:!1,value:xn(T)};if(ue[w])return{isToken:!0,value:T};if(w.match(vn))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:T}});a.localize.preprocessor&&(u=a.localize.preprocessor(o,u));const l={firstWeekContainsDate:i,weekStartsOn:s,locale:a};return u.map(T=>{if(!T.isToken)return T.value;const w=T.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Tn(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&wn(w))&&_n(w,t,String(e));const A=ue[w[0]];return A(o,w,a.localize,l)}).join("")}function xn(e){const t=e.match(bn);return t?t[1].replace(On,"'"):e}function Sn(e,t){const n=y(e,t==null?void 0:t.in),r=n.getFullYear(),a=n.getMonth(),i=D(n,0);return i.setFullYear(r,a+1,0),i.setHours(0,0,0,0),i.getDate()}function En(){return Object.assign({},F())}function fe(e){return+y(e)}function me(e){return Math.trunc(+y(e)/1e3)}function kn(e){return Math.trunc(e*_t)}function Nn(e){const t=e/Tt;return Math.trunc(t)}function Le(e,t,n){return Dt(e,-t,n)}function he(e,t,n){const r=En(),a=Pn(e,n.timeZone,n.locale??r.locale);return"formatToParts"in a?Yn(a,t):Rn(a,t)}function Yn(e,t){const n=e.formatToParts(t);for(let r=n.length-1;r>=0;--r)if(n[r].type==="timeZoneName")return n[r].value}function Rn(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/ [\w-+ ]+$/.exec(n);return r?r[0].substr(1):""}function Pn(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function In(e,t){const n=qn(t);return"formatToParts"in n?Fn(n,e):Hn(n,e)}const Wn={year:0,month:1,day:2,hour:3,minute:4,second:5};function Fn(e,t){try{const n=e.formatToParts(t),r=[];for(let a=0;a<n.length;a++){const i=Wn[n[a].type];i!==void 0&&(r[i]=parseInt(n[a].value,10))}return r}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function Hn(e,t){const n=e.format(t),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(r[3],10),parseInt(r[1],10),parseInt(r[2],10),parseInt(r[4],10),parseInt(r[5],10),parseInt(r[6],10)]}const X={},ye=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")),Cn=ye==="06/25/2014, 00:00:00"||ye==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function qn(e){return X[e]||(X[e]=Cn?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"})),X[e]}function ee(e,t,n,r,a,i,s){const o=new Date(0);return o.setUTCFullYear(e,t,n),o.setUTCHours(r,a,i,s),o}const ge=36e5,Gn=6e4,$={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function H(e,t,n){if(!e)return 0;let r=$.timezoneZ.exec(e);if(r)return 0;let a,i;if(r=$.timezoneHH.exec(e),r)return a=parseInt(r[1],10),we(a)?-(a*ge):NaN;if(r=$.timezoneHHMM.exec(e),r){a=parseInt(r[2],10);const s=parseInt(r[3],10);return we(a,s)?(i=Math.abs(a)*ge+s*Gn,r[1]==="+"?-i:i):NaN}if(zn(e)){t=new Date(t||Date.now());const s=n?t:Ln(t),o=B(s,e);return-(n?o:Un(t,o,e))}return NaN}function Ln(e){return ee(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function B(e,t){const n=In(e,t),r=ee(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let a=e.getTime();const i=a%1e3;return a-=i>=0?i:1e3+i,r-a}function Un(e,t,n){let a=e.getTime()-t;const i=B(new Date(a),n);if(t===i)return t;a-=i-t;const s=B(new Date(a),n);return i===s?i:Math.max(i,s)}function we(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Te={};function zn(e){if(Te[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Te[e]=!0,!0}catch{return!1}}const An=60*1e3,Vn={X:function(e,t,n){const r=j(n.timeZone,e);if(r===0)return"Z";switch(t){case"X":return _e(r);case"XXXX":case"XX":return k(r);case"XXXXX":case"XXX":default:return k(r,":")}},x:function(e,t,n){const r=j(n.timeZone,e);switch(t){case"x":return _e(r);case"xxxx":case"xx":return k(r);case"xxxxx":case"xxx":default:return k(r,":")}},O:function(e,t,n){const r=j(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+Xn(r,":");case"OOOO":default:return"GMT"+k(r,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return he("short",e,n);case"zzzz":default:return he("long",e,n)}}};function j(e,t){const n=e?H(e,t,!0)/An:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function G(e,t){const n=e<0?"-":"";let r=Math.abs(e).toString();for(;r.length<t;)r="0"+r;return n+r}function k(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=G(Math.floor(r/60),2),i=G(Math.floor(r%60),2);return n+a+t+i}function _e(e,t){return e%60===0?(e>0?"-":"+")+G(Math.abs(e)/60,2):k(e,t)}function Xn(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.floor(r/60),i=r%60;return i===0?n+String(a):n+String(a)+t+G(i,2)}function De(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 Ue=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Q=36e5,Me=6e4,$n=2,g={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,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:Ue};function L(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?$n:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const r=jn(e),{year:a,restDateString:i}=Qn(r.date,n),s=Zn(i,a);if(s===null||isNaN(s.getTime()))return new Date(NaN);if(s){const o=s.getTime();let u=0,l;if(r.time&&(u=Bn(r.time),u===null||isNaN(u)))return new Date(NaN);if(r.timeZone||t.timeZone){if(l=H(r.timeZone||t.timeZone,new Date(o+u)),isNaN(l))return new Date(NaN)}else l=De(new Date(o+u)),l=De(new Date(o+u+l));return new Date(o+u+l)}else return new Date(NaN)}function jn(e){const t={};let n=g.dateTimePattern.exec(e),r;if(n?(t.date=n[1],r=n[3]):(n=g.datePattern.exec(e),n?(t.date=n[1],r=n[2]):(t.date=null,r=e)),r){const a=g.timeZone.exec(r);a?(t.time=r.replace(a[1],""),t.timeZone=a[1].trim()):t.time=r}return t}function Qn(e,t){if(e){const n=g.YYY[t],r=g.YYYYY[t];let a=g.YYYY.exec(e)||r.exec(e);if(a){const i=a[1];return{year:parseInt(i,10),restDateString:e.slice(i.length)}}if(a=g.YY.exec(e)||n.exec(e),a){const i=a[1];return{year:parseInt(i,10)*100,restDateString:e.slice(i.length)}}}return{year:null}}function Zn(e,t){if(t===null)return null;let n,r,a;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let i=g.MM.exec(e);if(i)return n=new Date(0),r=parseInt(i[1],10)-1,be(t,r)?(n.setUTCFullYear(t,r),n):new Date(NaN);if(i=g.DDD.exec(e),i){n=new Date(0);const s=parseInt(i[1],10);return er(t,s)?(n.setUTCFullYear(t,0,s),n):new Date(NaN)}if(i=g.MMDD.exec(e),i){n=new Date(0),r=parseInt(i[1],10)-1;const s=parseInt(i[2],10);return be(t,r,s)?(n.setUTCFullYear(t,r,s),n):new Date(NaN)}if(i=g.Www.exec(e),i)return a=parseInt(i[1],10)-1,Oe(a)?pe(t,a):new Date(NaN);if(i=g.WwwD.exec(e),i){a=parseInt(i[1],10)-1;const s=parseInt(i[2],10)-1;return Oe(a,s)?pe(t,a,s):new Date(NaN)}return null}function Bn(e){let t,n,r=g.HH.exec(e);if(r)return t=parseFloat(r[1].replace(",",".")),Z(t)?t%24*Q:NaN;if(r=g.HHMM.exec(e),r)return t=parseInt(r[1],10),n=parseFloat(r[2].replace(",",".")),Z(t,n)?t%24*Q+n*Me:NaN;if(r=g.HHMMSS.exec(e),r){t=parseInt(r[1],10),n=parseInt(r[2],10);const a=parseFloat(r[3].replace(",","."));return Z(t,n,a)?t%24*Q+n*Me+a*1e3:NaN}return null}function pe(e,t,n){t=t||0,n=n||0;const r=new Date(0);r.setUTCFullYear(e,0,4);const a=r.getUTCDay()||7,i=t*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const Jn=[31,28,31,30,31,30,31,31,30,31,30,31],Kn=[31,29,31,30,31,30,31,31,30,31,30,31];function ze(e){return e%400===0||e%4===0&&e%100!==0}function be(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const r=ze(e);if(r&&n>Kn[t]||!r&&n>Jn[t])return!1}return!0}function er(e,t){if(t<1)return!1;const n=ze(e);return!(n&&t>366||!n&&t>365)}function Oe(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Z(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const tr=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function nr(e,t,n={}){t=String(t);const r=t.match(tr);if(r){const a=L(n.originalDate||e,n);t=r.reduce(function(i,s){if(s[0]==="'")return i;const o=i.indexOf(s),u=i[o-1]==="'",l=i.replace(s,"'"+Vn[s[0]](a,s,n)+"'");return u?l.substring(0,o-1)+l.substring(o+1):l},t)}return Ge(e,t,n)}function Ae(e,t,n){e=L(e,n);const r=H(t,e,!0),a=new Date(e.getTime()-r),i=new Date(0);return i.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),i.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),i}function rr(e,t,n,r){return r={...r,timeZone:t,originalDate:e},nr(Ae(e,t,{timeZone:r.timeZone}),n,r)}function ar(e,t,n){if(typeof e=="string"&&!e.match(Ue))return L(e,{...n,timeZone:t});e=L(e,n);const r=ee(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),a=H(t,new Date(r));return new Date(r+a)}function Ve(e,t){return-H(e,t)}function ir(e){return Ge(e,"yyyy-MM-dd'T'HH:mm:ss.SSSXXX")}function J(e,t={}){if(!e)return e;const n=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let r="MMM dd, yyy hh:mm a";t.short&&(r="MMM dd, yyy"),t.includeTZ&&(r+=" (z)");const a=new Date(e);return rr(a,n,r)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}function sr(e,t){return`${J(e.getTime())} - ${J(t.getTime(),{includeTZ:!0})}`}const I={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 or(e,t){return e.map(n=>({value:n,label:t.t(`configuration.vitals.reports.granularity.${n}`)}))}function Xe(e,t){return{duration:e,type:"duration",origin:t}}function ur(e){return e&&ve.find(n=>e<=I[n])||null}function $e(e,t,n,r){const a=I[n];let i=0;return a>=I.daily&&(r?i=-Ve(r,t):i=t.getTimezoneOffset()*60*1e3),new Date(e((t.getTime()-i)/a)*a+i)}function je(e,t,n){return $e(Math.floor,e,t,n)}function te(e,t,n){return $e(Math.ceil,e,t,n)}class U{constructor(t,n,r){h(this,"timeframe");h(this,"tz");h(this,"dataGranularity");if(this.constructor===U)throw new Error("BaseQueryTime is not meant to be used directly.");this.timeframe=t,this.tz=n,this.dataGranularity=r??t.dataGranularity}calculateStartDate(t,n,r=1){if(t)return new Date(this.endDate().getTime()-this.timeframe.timeframeLengthMs()*r);{const a=this.endDate(),i=this.timeframe.rawStart(this.tz),s=je(i,n,this.tz),u=(a.getTime()-s.getTime())*(r-1);return new Date(s.getTime()-u)}}granularitySeconds(){return Math.floor(this.granularityMs()/1e3)}granularityDruid(){return Xe(this.granularityMs(),this.startDate().toISOString())}startSeconds(){return me(this.startDate())}endSeconds(){return me(this.endDate())}startMs(){return fe(this.startDate())}endMs(){return fe(this.endDate())}}class cr extends U{constructor(n,r,a,i,s){super(n,a,i);h(this,"granularity");if(r&&n.allowedGranularities(s).has(r))this.granularity=r;else if(s){const o=n.allowedGranularities(s).keys().next().value;this.granularity=o??n.defaultResponseGranularity}else this.granularity=n.defaultResponseGranularity}startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.granularity)}endDate(){return te(this.timeframe.rawEnd(),this.granularity,this.tz)}granularityMs(){return I[this.granularity]}}class Qe extends U{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity)}endDate(){return te(this.timeframe.rawEnd(this.tz),this.dataGranularity,this.tz)}granularityMs(){return this.endDate().getTime()-this.startDate().getTime()}}class lr extends Qe{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity,2)}granularityMs(){return this.endDate().getTime()-super.startDate().getTime()}}const Y=(e,t)=>new Date(e.getTime()-Ve(t,e));class _{constructor(t){h(this,"timeframeText");h(this,"key");h(this,"display");h(this,"timeframeLength");h(this,"allowedTiers");h(this,"defaultResponseGranularity");h(this,"dataGranularity");h(this,"isRelative");h(this,"_startCustom");h(this,"_endCustom");h(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}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const n=new Set,r=this.maximumTimeframeLength()/3600;return r<=6&&n.add("minutely"),r>=2&&r<=7*24&&n.add("hourly"),r>=2*24&&n.add("daily"),r>=2*24*14&&n.add("weekly"),n}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const n=ar(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Ae(n,t)}}class dr extends _{rawStart(t){let n=O(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=Y(n,t)),n}maximumTimeframeLength(){return 60*60*24*7}}class fr extends _{rawStart(t){let n=N(this.tzAdjustedDate(t));return t&&(n=Y(n,t)),n}maximumTimeframeLength(){return 60*60*24*31}}class mr extends _{rawEnd(t){let n=O(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=Y(n,t)),n}rawStart(t){const n=this.tzAdjustedDate(t);let r=O(n.setDate(n.getDate()-7),{weekStartsOn:1});return t&&(r=Y(r,t)),r}}class hr extends _{rawEnd(t){let n=N(this.tzAdjustedDate(t));return t&&(n=Y(n,t)),n}rawStart(t){let n=N(Le(this.tzAdjustedDate(t),1));return t&&(n=Y(n,t)),n}}const Ze=new Map([[m.FIFTEEN_MIN,new _({key:m.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]})],[m.ONE_HOUR,new _({key:m.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]})],[m.SIX_HOUR,new _({key:m.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[m.TWELVE_HOUR,new _({key:m.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[m.ONE_DAY,new _({key:m.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[m.SEVEN_DAY,new _({key:m.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[m.THIRTY_DAY,new _({key:m.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]})],[m.CURRENT_WEEK,new dr({key:m.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=O(new Date,{weekStartsOn:1});return(q(se(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[m.CURRENT_MONTH,new fr({key:m.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=N(new Date);return(q(se(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[m.PREVIOUS_WEEK,new mr({key:m.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[m.PREVIOUS_MONTH,new hr({key:m.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=N(new Date),n=N(Le(new Date,1));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=Be(t,n)),60*60*24*Sn(new Date().setMonth(new Date().getMonth()-1))+kn(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})]]);function yr(e){const t=new Date(e.start),n=new Date(e.end),r=(n.getTime()-t.getTime())/1e3;return e.timePeriodsKey&&Ze.get(e.timePeriodsKey)||new _({key:"custom",timeframeText:"custom",display:"custom",startCustom:t,endCustom:n,timeframeLength:()=>r,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["free","plus","enterprise"]})}function gr(e){return{...e.key!=="custom"&&{timePeriodsKey:e.key},start:e.rawStart(),end:e.rawEnd()}}function wr(e){return{key:e.key,display:e.display,timeframeText:e.timeframeText,timeframeLength:()=>e.key,start:()=>e.rawStart(),end:()=>e.rawEnd()}}function Be(e,t){return Nn(e.getTimezoneOffset()-t.getTimezoneOffset())}class z{constructor(t){h(this,"_seed");this._seed=t}next(t,n){const r=Math.sin(this._seed++)*1e4,a=r-Math.floor(r);return Math.floor(a*(n-t+1))+t}}const Tr=(e,t)=>{const n=ne(10,1e4),r=new z(n),a=Date.now()-6*60*60*1e3,i=Date.now(),s=[];let o=0;for(let c=a;c<=i;c+=60*60*1e3)if(t)for(const d in t)t[d].forEach(p=>{o+=r.next(50,500);const M={[d]:p,[e.name]:o},b={version:"1.0",timestamp:new Date(c).toISOString(),event:M};s.push(b)});else{o+=r.next(50,500);const d={version:"1.0",timestamp:new Date(c).toISOString(),event:{[e.name]:o}};s.push(d)}const u={};if(t)for(const c in t)u[c]={},t[c].forEach(d=>{u[c][d]={name:d,deleted:!1}});const l={start_ms:a,end_ms:i,query_id:"12345",metric_names:[e.name],metric_units:{[e.name]:e.unit},granularity_ms:60*60*1e3,display:u};return{data:s,meta:l}},_r=e=>{const t=ne(10,1e4),n=new z(t),r=Date.now()-6*60*60*1e3,a=Date.now(),i=[],s={};e.forEach(u=>{s[u.name]=0});for(let u=r;u<=a;u+=60*60*1e3){const l={};e.forEach(d=>{s[d.name]+=n.next(50,500),l[d.name]=s[d.name]});const c={version:"1.0",timestamp:new Date(u).toISOString(),event:l};i.push(c)}const o={start_ms:r,end_ms:a,query_id:"12345",metric_names:e.map(u=>u.name),metric_units:e.reduce((u,l)=>(u[l.name]=l.unit,u),{}),granularity_ms:60*60*1e3,display:{}};return{data:i,meta:o}},Dr=(e,t)=>{const n=Math.floor(Math.random()*9991)+10,r=new z(n),a=Date.now()-6*60*60*1e3,i=Date.now(),s=new Date((a+i)/2).toISOString(),o=[];if(t){const c=Object.keys(t),d=Object.values(t),p=(M,b)=>{if(b===c.length){e.forEach(S=>{M[S.name]=r.next(50,500)}),o.push({version:"1.0",timestamp:new Date().toISOString(),event:{...M}});return}d[b].forEach(S=>{p({...M,[c[b]]:S},b+1)})};p({},0)}else{const c={};e.forEach(d=>{c[d.name]=r.next(50,500)}),o.push({version:"1.0",timestamp:s,event:c})}const u={};if(t)for(const c in t)u[c]={},t[c].forEach(d=>{u[c][d]={name:d,deleted:!1}});const l={start_ms:a,end_ms:i,query_id:"12345",metric_names:e.map(c=>c.name),metric_units:e.reduce((c,d)=>(c[d.name]=d.unit,c),{}),truncated:!1,limit:50,display:u,granularity_ms:i-a};return{data:o,meta:l}};function ne(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)}exports.DeltaQueryTime=lr;exports.Granularities=I;exports.REFRESH_INTERVAL_MS=et;exports.SeededRandom=z;exports.TimePeriods=Ze;exports.Timeframe=_;exports.TimeframeKeys=m;exports.TimeseriesQueryTime=cr;exports.UnaryQueryTime=Qe;exports.aiExploreAggregations=lt;exports.basicExploreAggregations=Se;exports.ceilToNearestTimeGrain=te;exports.datasourceToFilterableDimensions=We;exports.datePickerSelectionToTimeframe=yr;exports.dstOffsetHours=Be;exports.exploreAggregations=ct;exports.exploreFilterTypesV2=nt;exports.filterableAiExploreDimensions=Ye;exports.filterableBasicExploreDimensions=xe;exports.filterableExploreDimensions=ke;exports.filterableRequestDimensions=dt;exports.filterableRequestMetrics=mt;exports.filterableRequestWildcardDimensions=ft;exports.floorToNearestTimeGrain=je;exports.formatISOTimeWithTZ=ir;exports.formatTime=J;exports.formatTimeRange=sr;exports.generateCrossSectionalData=Dr;exports.generateMultipleMetricTimeSeriesData=_r;exports.generateSingleMetricTimeSeriesData=Tr;exports.granularitiesToOptions=or;exports.granularityMsToQuery=Xe;exports.granularityValues=ve;exports.msToGranularity=ur;exports.queryDatasources=yt;exports.queryableAiExploreDimensions=Ne;exports.queryableBasicExploreDimensions=K;exports.queryableExploreDimensions=Ee;exports.queryableRequestDimensions=Re;exports.queryableRequestMetrics=Ie;exports.queryableRequestWildcardDimensions=Pe;exports.rand=ne;exports.relativeTimeRangeValuesRequestV2=ht;exports.relativeTimeRangeValuesV4=ut;exports.reportChartTypes=tt;exports.requestFilterTypeEmptyV2=it;exports.requestFilterTypeEqualsV2=rt;exports.requestFilterTypeMetricV2=at;exports.requestFilterTypeWildcardV2=st;exports.stripUnknownFilters=gt;exports.timeRangeTypeV2=ot;exports.timeframeToDatepickerSelection=gr;exports.timeframeToDatepickerTimeperiod=wr;
1
+ "use strict";var Je=Object.defineProperty;var Ke=(e,t,n)=>t in e?Je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var h=(e,t,n)=>Ke(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const et=30*1e3;var m=(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))(m||{});const tt=["horizontal_bar","vertical_bar","timeseries_line","choropleth_map","timeseries_bar"],nt=["in","not_in","selector"],rt=["=","!="],at=["=","!=","<",">","<=",">="],it=["empty","not_empty"],st=["starts_with","ends_with"],ot=["absolute","relative"],ut=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],ve=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],W=e=>e.filter(t=>t!=="time"),K=["api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","route","status_code","status_code_grouped","time"],xe=W(K),Se=["active_services","request_count","request_per_minute","response_latency_average"],Ee=[...K,"application","consumer","country_code","iso_code"],ke=W(Ee),ct=[...Se,"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","request_size_p99","request_size_p95","request_size_p50","request_size_average","response_size_average"],Ne=["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"],Ye=W(Ne),lt=["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"],Re=["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","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"],dt=W(Re),Pe=["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"],ft=Pe,Ie=["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"],mt=W(Ie),ht=["15M","1H","6H","12H","24H","7D"],yt=["basic","advanced","ai"],We={basic:new Set(xe),advanced:new Set(ke),ai:new Set(Ye)},gt=(e,t)=>t.filter(n=>We[e].has(n.dimension)),Fe=6048e5,wt=864e5,Tt=60,_t=3600,ie=Symbol.for("constructDateFrom");function D(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&ie in e?e[ie](t):e instanceof Date?new e.constructor(t):new Date(t)}function y(e,t){return D(t||e,e)}function se(e,t,n){const r=y(e,n==null?void 0:n.in);return isNaN(t)?D(e,NaN):(r.setDate(r.getDate()+t),r)}function Dt(e,t,n){const r=y(e,n==null?void 0:n.in);if(isNaN(t))return D(e,NaN);const a=r.getDate(),i=D(e,r.getTime());i.setMonth(r.getMonth()+t+1,0);const s=i.getDate();return a>=s?i:(r.setFullYear(i.getFullYear(),i.getMonth(),a),r)}let Mt={};function F(){return Mt}function O(e,t){var o,u,l,c;const n=F(),r=(t==null?void 0:t.weekStartsOn)??((u=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((c=(l=n.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??0,a=y(e,t==null?void 0:t.in),i=a.getDay(),s=(i<r?7:0)+i-r;return a.setDate(a.getDate()-s),a.setHours(0,0,0,0),a}function C(e,t){return O(e,{...t,weekStartsOn:1})}function He(e,t){const n=y(e,t==null?void 0:t.in),r=n.getFullYear(),a=D(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const i=C(a),s=D(n,0);s.setFullYear(r,0,4),s.setHours(0,0,0,0);const o=C(s);return n.getTime()>=i.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function oe(e){const t=y(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function pt(e,...t){const n=D.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function q(e,t){const n=y(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function bt(e,t,n){const[r,a]=pt(n==null?void 0:n.in,e,t),i=q(r),s=q(a),o=+i-oe(i),u=+s-oe(s);return Math.round((o-u)/wt)}function Ot(e,t){const n=He(e,t),r=D(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),C(r)}function vt(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function xt(e){return!(!vt(e)&&typeof e!="number"||isNaN(+y(e)))}function N(e,t){const n=y(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function St(e,t){const n=y(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Et={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"}},kt=(e,t,n)=>{let r;const a=Et[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function V(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Nt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Yt={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Rt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Pt={date:V({formats:Nt,defaultWidth:"full"}),time:V({formats:Yt,defaultWidth:"full"}),dateTime:V({formats:Rt,defaultWidth:"full"})},It={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Wt=(e,t,n,r)=>It[e];function R(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):s;a=e.formattingValues[o]||e.formattingValues[s]}else{const s=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[o]||e.values[s]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const Ft={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ht={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ct={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"]},qt={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"]},Gt={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"}},Lt={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"}},Ut=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},zt={ordinalNumber:Ut,era:R({values:Ft,defaultWidth:"wide"}),quarter:R({values:Ht,defaultWidth:"wide",argumentCallback:e=>e-1}),month:R({values:Ct,defaultWidth:"wide"}),day:R({values:qt,defaultWidth:"wide"}),dayPeriod:R({values:Gt,defaultWidth:"wide",formattingValues:Lt,defaultFormattingWidth:"wide"})};function P(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const s=i[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(o)?Vt(o,d=>d.test(s)):At(o,d=>d.test(s));let l;l=e.valueCallback?e.valueCallback(u):u,l=n.valueCallback?n.valueCallback(l):l;const c=t.slice(s.length);return{value:l,rest:c}}}function At(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Vt(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Xt(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;const o=t.slice(a.length);return{value:s,rest:o}}}const $t=/^(\d+)(th|st|nd|rd)?/i,jt=/\d+/i,Qt={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},Zt={any:[/^b/i,/^(a|c)/i]},Bt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Jt={any:[/1/i,/2/i,/3/i,/4/i]},Kt={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},en={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]},tn={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},nn={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]},rn={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},an={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}},sn={ordinalNumber:Xt({matchPattern:$t,parsePattern:jt,valueCallback:e=>parseInt(e,10)}),era:P({matchPatterns:Qt,defaultMatchWidth:"wide",parsePatterns:Zt,defaultParseWidth:"any"}),quarter:P({matchPatterns:Bt,defaultMatchWidth:"wide",parsePatterns:Jt,defaultParseWidth:"any",valueCallback:e=>e+1}),month:P({matchPatterns:Kt,defaultMatchWidth:"wide",parsePatterns:en,defaultParseWidth:"any"}),day:P({matchPatterns:tn,defaultMatchWidth:"wide",parsePatterns:nn,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:rn,defaultMatchWidth:"any",parsePatterns:an,defaultParseWidth:"any"})},on={code:"en-US",formatDistance:kt,formatLong:Pt,formatRelative:Wt,localize:zt,match:sn,options:{weekStartsOn:0,firstWeekContainsDate:1}};function un(e,t){const n=y(e,t==null?void 0:t.in);return bt(n,St(n))+1}function cn(e,t){const n=y(e,t==null?void 0:t.in),r=+C(n)-+Ot(n);return Math.round(r/Fe)+1}function Ce(e,t){var c,d,p,M;const n=y(e,t==null?void 0:t.in),r=n.getFullYear(),a=F(),i=(t==null?void 0:t.firstWeekContainsDate)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??a.firstWeekContainsDate??((M=(p=a.locale)==null?void 0:p.options)==null?void 0:M.firstWeekContainsDate)??1,s=D((t==null?void 0:t.in)||e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const o=O(s,t),u=D((t==null?void 0:t.in)||e,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const l=O(u,t);return+n>=+o?r+1:+n>=+l?r:r-1}function ln(e,t){var o,u,l,c;const n=F(),r=(t==null?void 0:t.firstWeekContainsDate)??((u=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((c=(l=n.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??1,a=Ce(e,t),i=D((t==null?void 0:t.in)||e,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),O(i,t)}function dn(e,t){const n=y(e,t==null?void 0:t.in),r=+O(n,t)-+ln(n,t);return Math.round(r/Fe)+1}function f(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const v={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return f(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):f(n+1,2)},d(e,t){return f(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return f(e.getHours()%12||12,t.length)},H(e,t){return f(e.getHours(),t.length)},m(e,t){return f(e.getMinutes(),t.length)},s(e,t){return f(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return f(a,t.length)}},E={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ue={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return v.y(e,t)},Y:function(e,t,n,r){const a=Ce(e,r),i=a>0?a:1-a;if(t==="YY"){const s=i%100;return f(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):f(i,t.length)},R:function(e,t){const n=He(e);return f(n,t.length)},u:function(e,t){const n=e.getFullYear();return f(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return f(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return f(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return v.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return f(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=dn(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):f(a,t.length)},I:function(e,t,n){const r=cn(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):f(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):v.d(e,t)},D:function(e,t,n){const r=un(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):f(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return f(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return f(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return f(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=E.noon:r===0?a=E.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=E.evening:r>=12?a=E.afternoon:r>=4?a=E.morning:a=E.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return v.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):v.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):f(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):f(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):v.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):v.s(e,t)},S:function(e,t){return v.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return le(r);case"XXXX":case"XX":return x(r);case"XXXXX":case"XXX":default:return x(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return le(r);case"xxxx":case"xx":return x(r);case"xxxxx":case"xxx":default:return x(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ce(r,":");case"OOOO":default:return"GMT"+x(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ce(r,":");case"zzzz":default:return"GMT"+x(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return f(r,t.length)},T:function(e,t,n){return f(+e,t.length)}};function ce(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+t+f(i,2)}function le(e,t){return e%60===0?(e>0?"-":"+")+f(Math.abs(e)/60,2):x(e,t)}function x(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=f(Math.trunc(r/60),2),i=f(r%60,2);return n+a+t+i}const de=(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"})}},qe=(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"})}},fn=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return de(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",de(r,t)).replace("{{time}}",qe(a,t))},mn={p:qe,P:fn},hn=/^D+$/,yn=/^Y+$/,gn=["D","DD","YY","YYYY"];function wn(e){return hn.test(e)}function Tn(e){return yn.test(e)}function _n(e,t,n){const r=Dn(e,t,n);if(console.warn(r),gn.includes(e))throw new RangeError(r)}function Dn(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Mn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,pn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bn=/^'([^]*?)'?$/,On=/''/g,vn=/[a-zA-Z]/;function Ge(e,t,n){var c,d,p,M,b,S,re,ae;const r=F(),a=(n==null?void 0:n.locale)??r.locale??on,i=(n==null?void 0:n.firstWeekContainsDate)??((d=(c=n==null?void 0:n.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((M=(p=r.locale)==null?void 0:p.options)==null?void 0:M.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((S=(b=n==null?void 0:n.locale)==null?void 0:b.options)==null?void 0:S.weekStartsOn)??r.weekStartsOn??((ae=(re=r.locale)==null?void 0:re.options)==null?void 0:ae.weekStartsOn)??0,o=y(e,n==null?void 0:n.in);if(!xt(o))throw new RangeError("Invalid time value");let u=t.match(pn).map(T=>{const w=T[0];if(w==="p"||w==="P"){const A=mn[w];return A(T,a.formatLong)}return T}).join("").match(Mn).map(T=>{if(T==="''")return{isToken:!1,value:"'"};const w=T[0];if(w==="'")return{isToken:!1,value:xn(T)};if(ue[w])return{isToken:!0,value:T};if(w.match(vn))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:T}});a.localize.preprocessor&&(u=a.localize.preprocessor(o,u));const l={firstWeekContainsDate:i,weekStartsOn:s,locale:a};return u.map(T=>{if(!T.isToken)return T.value;const w=T.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Tn(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&wn(w))&&_n(w,t,String(e));const A=ue[w[0]];return A(o,w,a.localize,l)}).join("")}function xn(e){const t=e.match(bn);return t?t[1].replace(On,"'"):e}function Sn(e,t){const n=y(e,t==null?void 0:t.in),r=n.getFullYear(),a=n.getMonth(),i=D(n,0);return i.setFullYear(r,a+1,0),i.setHours(0,0,0,0),i.getDate()}function En(){return Object.assign({},F())}function fe(e){return+y(e)}function me(e){return Math.trunc(+y(e)/1e3)}function kn(e){return Math.trunc(e*_t)}function Nn(e){const t=e/Tt;return Math.trunc(t)}function Le(e,t,n){return Dt(e,-t,n)}function he(e,t,n){const r=En(),a=Pn(e,n.timeZone,n.locale??r.locale);return"formatToParts"in a?Yn(a,t):Rn(a,t)}function Yn(e,t){const n=e.formatToParts(t);for(let r=n.length-1;r>=0;--r)if(n[r].type==="timeZoneName")return n[r].value}function Rn(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/ [\w-+ ]+$/.exec(n);return r?r[0].substr(1):""}function Pn(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function In(e,t){const n=qn(t);return"formatToParts"in n?Fn(n,e):Hn(n,e)}const Wn={year:0,month:1,day:2,hour:3,minute:4,second:5};function Fn(e,t){try{const n=e.formatToParts(t),r=[];for(let a=0;a<n.length;a++){const i=Wn[n[a].type];i!==void 0&&(r[i]=parseInt(n[a].value,10))}return r}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function Hn(e,t){const n=e.format(t),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(r[3],10),parseInt(r[1],10),parseInt(r[2],10),parseInt(r[4],10),parseInt(r[5],10),parseInt(r[6],10)]}const X={},ye=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")),Cn=ye==="06/25/2014, 00:00:00"||ye==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function qn(e){return X[e]||(X[e]=Cn?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"})),X[e]}function ee(e,t,n,r,a,i,s){const o=new Date(0);return o.setUTCFullYear(e,t,n),o.setUTCHours(r,a,i,s),o}const ge=36e5,Gn=6e4,$={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function H(e,t,n){if(!e)return 0;let r=$.timezoneZ.exec(e);if(r)return 0;let a,i;if(r=$.timezoneHH.exec(e),r)return a=parseInt(r[1],10),we(a)?-(a*ge):NaN;if(r=$.timezoneHHMM.exec(e),r){a=parseInt(r[2],10);const s=parseInt(r[3],10);return we(a,s)?(i=Math.abs(a)*ge+s*Gn,r[1]==="+"?-i:i):NaN}if(zn(e)){t=new Date(t||Date.now());const s=n?t:Ln(t),o=B(s,e);return-(n?o:Un(t,o,e))}return NaN}function Ln(e){return ee(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function B(e,t){const n=In(e,t),r=ee(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let a=e.getTime();const i=a%1e3;return a-=i>=0?i:1e3+i,r-a}function Un(e,t,n){let a=e.getTime()-t;const i=B(new Date(a),n);if(t===i)return t;a-=i-t;const s=B(new Date(a),n);return i===s?i:Math.max(i,s)}function we(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Te={};function zn(e){if(Te[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Te[e]=!0,!0}catch{return!1}}const An=60*1e3,Vn={X:function(e,t,n){const r=j(n.timeZone,e);if(r===0)return"Z";switch(t){case"X":return _e(r);case"XXXX":case"XX":return k(r);case"XXXXX":case"XXX":default:return k(r,":")}},x:function(e,t,n){const r=j(n.timeZone,e);switch(t){case"x":return _e(r);case"xxxx":case"xx":return k(r);case"xxxxx":case"xxx":default:return k(r,":")}},O:function(e,t,n){const r=j(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+Xn(r,":");case"OOOO":default:return"GMT"+k(r,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return he("short",e,n);case"zzzz":default:return he("long",e,n)}}};function j(e,t){const n=e?H(e,t,!0)/An:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function G(e,t){const n=e<0?"-":"";let r=Math.abs(e).toString();for(;r.length<t;)r="0"+r;return n+r}function k(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=G(Math.floor(r/60),2),i=G(Math.floor(r%60),2);return n+a+t+i}function _e(e,t){return e%60===0?(e>0?"-":"+")+G(Math.abs(e)/60,2):k(e,t)}function Xn(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.floor(r/60),i=r%60;return i===0?n+String(a):n+String(a)+t+G(i,2)}function De(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 Ue=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Q=36e5,Me=6e4,$n=2,g={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,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:Ue};function L(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?$n:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const r=jn(e),{year:a,restDateString:i}=Qn(r.date,n),s=Zn(i,a);if(s===null||isNaN(s.getTime()))return new Date(NaN);if(s){const o=s.getTime();let u=0,l;if(r.time&&(u=Bn(r.time),u===null||isNaN(u)))return new Date(NaN);if(r.timeZone||t.timeZone){if(l=H(r.timeZone||t.timeZone,new Date(o+u)),isNaN(l))return new Date(NaN)}else l=De(new Date(o+u)),l=De(new Date(o+u+l));return new Date(o+u+l)}else return new Date(NaN)}function jn(e){const t={};let n=g.dateTimePattern.exec(e),r;if(n?(t.date=n[1],r=n[3]):(n=g.datePattern.exec(e),n?(t.date=n[1],r=n[2]):(t.date=null,r=e)),r){const a=g.timeZone.exec(r);a?(t.time=r.replace(a[1],""),t.timeZone=a[1].trim()):t.time=r}return t}function Qn(e,t){if(e){const n=g.YYY[t],r=g.YYYYY[t];let a=g.YYYY.exec(e)||r.exec(e);if(a){const i=a[1];return{year:parseInt(i,10),restDateString:e.slice(i.length)}}if(a=g.YY.exec(e)||n.exec(e),a){const i=a[1];return{year:parseInt(i,10)*100,restDateString:e.slice(i.length)}}}return{year:null}}function Zn(e,t){if(t===null)return null;let n,r,a;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let i=g.MM.exec(e);if(i)return n=new Date(0),r=parseInt(i[1],10)-1,be(t,r)?(n.setUTCFullYear(t,r),n):new Date(NaN);if(i=g.DDD.exec(e),i){n=new Date(0);const s=parseInt(i[1],10);return er(t,s)?(n.setUTCFullYear(t,0,s),n):new Date(NaN)}if(i=g.MMDD.exec(e),i){n=new Date(0),r=parseInt(i[1],10)-1;const s=parseInt(i[2],10);return be(t,r,s)?(n.setUTCFullYear(t,r,s),n):new Date(NaN)}if(i=g.Www.exec(e),i)return a=parseInt(i[1],10)-1,Oe(a)?pe(t,a):new Date(NaN);if(i=g.WwwD.exec(e),i){a=parseInt(i[1],10)-1;const s=parseInt(i[2],10)-1;return Oe(a,s)?pe(t,a,s):new Date(NaN)}return null}function Bn(e){let t,n,r=g.HH.exec(e);if(r)return t=parseFloat(r[1].replace(",",".")),Z(t)?t%24*Q:NaN;if(r=g.HHMM.exec(e),r)return t=parseInt(r[1],10),n=parseFloat(r[2].replace(",",".")),Z(t,n)?t%24*Q+n*Me:NaN;if(r=g.HHMMSS.exec(e),r){t=parseInt(r[1],10),n=parseInt(r[2],10);const a=parseFloat(r[3].replace(",","."));return Z(t,n,a)?t%24*Q+n*Me+a*1e3:NaN}return null}function pe(e,t,n){t=t||0,n=n||0;const r=new Date(0);r.setUTCFullYear(e,0,4);const a=r.getUTCDay()||7,i=t*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const Jn=[31,28,31,30,31,30,31,31,30,31,30,31],Kn=[31,29,31,30,31,30,31,31,30,31,30,31];function ze(e){return e%400===0||e%4===0&&e%100!==0}function be(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const r=ze(e);if(r&&n>Kn[t]||!r&&n>Jn[t])return!1}return!0}function er(e,t){if(t<1)return!1;const n=ze(e);return!(n&&t>366||!n&&t>365)}function Oe(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Z(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const tr=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function nr(e,t,n={}){t=String(t);const r=t.match(tr);if(r){const a=L(n.originalDate||e,n);t=r.reduce(function(i,s){if(s[0]==="'")return i;const o=i.indexOf(s),u=i[o-1]==="'",l=i.replace(s,"'"+Vn[s[0]](a,s,n)+"'");return u?l.substring(0,o-1)+l.substring(o+1):l},t)}return Ge(e,t,n)}function Ae(e,t,n){e=L(e,n);const r=H(t,e,!0),a=new Date(e.getTime()-r),i=new Date(0);return i.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),i.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),i}function rr(e,t,n,r){return r={...r,timeZone:t,originalDate:e},nr(Ae(e,t,{timeZone:r.timeZone}),n,r)}function ar(e,t,n){if(typeof e=="string"&&!e.match(Ue))return L(e,{...n,timeZone:t});e=L(e,n);const r=ee(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),a=H(t,new Date(r));return new Date(r+a)}function Ve(e,t){return-H(e,t)}function ir(e){return Ge(e,"yyyy-MM-dd'T'HH:mm:ss.SSSXXX")}function J(e,t={}){if(!e)return e;const n=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let r="MMM dd, yyy hh:mm a";t.short&&(r="MMM dd, yyy"),t.includeTZ&&(r+=" (z)");const a=new Date(e);return rr(a,n,r)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}function sr(e,t){return`${J(e.getTime())} - ${J(t.getTime(),{includeTZ:!0})}`}const I={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 or(e,t){return e.map(n=>({value:n,label:t.t(`configuration.vitals.reports.granularity.${n}`)}))}function Xe(e,t){return{duration:e,type:"duration",origin:t}}function ur(e){return e&&ve.find(n=>e<=I[n])||null}function $e(e,t,n,r){const a=I[n];let i=0;return a>=I.daily&&(r?i=-Ve(r,t):i=t.getTimezoneOffset()*60*1e3),new Date(e((t.getTime()-i)/a)*a+i)}function je(e,t,n){return $e(Math.floor,e,t,n)}function te(e,t,n){return $e(Math.ceil,e,t,n)}class U{constructor(t,n,r){h(this,"timeframe");h(this,"tz");h(this,"dataGranularity");if(this.constructor===U)throw new Error("BaseQueryTime is not meant to be used directly.");this.timeframe=t,this.tz=n,this.dataGranularity=r??t.dataGranularity}calculateStartDate(t,n,r=1){if(t)return new Date(this.endDate().getTime()-this.timeframe.timeframeLengthMs()*r);{const a=this.endDate(),i=this.timeframe.rawStart(this.tz),s=je(i,n,this.tz),u=(a.getTime()-s.getTime())*(r-1);return new Date(s.getTime()-u)}}granularitySeconds(){return Math.floor(this.granularityMs()/1e3)}granularityDruid(){return Xe(this.granularityMs(),this.startDate().toISOString())}startSeconds(){return me(this.startDate())}endSeconds(){return me(this.endDate())}startMs(){return fe(this.startDate())}endMs(){return fe(this.endDate())}}class cr extends U{constructor(n,r,a,i,s){super(n,a,i);h(this,"granularity");if(r&&n.allowedGranularities(s).has(r))this.granularity=r;else if(s){const o=n.allowedGranularities(s).keys().next().value;this.granularity=o??n.defaultResponseGranularity}else this.granularity=n.defaultResponseGranularity}startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.granularity)}endDate(){return te(this.timeframe.rawEnd(),this.granularity,this.tz)}granularityMs(){return I[this.granularity]}}class Qe extends U{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity)}endDate(){return te(this.timeframe.rawEnd(this.tz),this.dataGranularity,this.tz)}granularityMs(){return this.endDate().getTime()-this.startDate().getTime()}}class lr extends Qe{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity,2)}granularityMs(){return this.endDate().getTime()-super.startDate().getTime()}}const Y=(e,t)=>new Date(e.getTime()-Ve(t,e));class _{constructor(t){h(this,"timeframeText");h(this,"key");h(this,"display");h(this,"timeframeLength");h(this,"allowedTiers");h(this,"defaultResponseGranularity");h(this,"dataGranularity");h(this,"isRelative");h(this,"_startCustom");h(this,"_endCustom");h(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}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const n=new Set,r=this.maximumTimeframeLength()/3600;return r<=6&&n.add("minutely"),r>=2&&r<=7*24&&n.add("hourly"),r>=2*24&&n.add("daily"),r>=2*24*14&&n.add("weekly"),n}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const n=ar(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Ae(n,t)}}class dr extends _{rawStart(t){let n=O(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=Y(n,t)),n}maximumTimeframeLength(){return 60*60*24*7}}class fr extends _{rawStart(t){let n=N(this.tzAdjustedDate(t));return t&&(n=Y(n,t)),n}maximumTimeframeLength(){return 60*60*24*31}}class mr extends _{rawEnd(t){let n=O(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=Y(n,t)),n}rawStart(t){const n=this.tzAdjustedDate(t);let r=O(n.setDate(n.getDate()-7),{weekStartsOn:1});return t&&(r=Y(r,t)),r}}class hr extends _{rawEnd(t){let n=N(this.tzAdjustedDate(t));return t&&(n=Y(n,t)),n}rawStart(t){let n=N(Le(this.tzAdjustedDate(t),1));return t&&(n=Y(n,t)),n}}const Ze=new Map([[m.FIFTEEN_MIN,new _({key:m.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]})],[m.ONE_HOUR,new _({key:m.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]})],[m.SIX_HOUR,new _({key:m.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[m.TWELVE_HOUR,new _({key:m.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[m.ONE_DAY,new _({key:m.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[m.SEVEN_DAY,new _({key:m.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[m.THIRTY_DAY,new _({key:m.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]})],[m.CURRENT_WEEK,new dr({key:m.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=O(new Date,{weekStartsOn:1});return(q(se(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[m.CURRENT_MONTH,new fr({key:m.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=N(new Date);return(q(se(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[m.PREVIOUS_WEEK,new mr({key:m.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[m.PREVIOUS_MONTH,new hr({key:m.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=N(new Date),n=N(Le(new Date,1));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=Be(t,n)),60*60*24*Sn(new Date().setMonth(new Date().getMonth()-1))+kn(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})]]);function yr(e){const t=new Date(e.start),n=new Date(e.end),r=(n.getTime()-t.getTime())/1e3;return e.timePeriodsKey&&Ze.get(e.timePeriodsKey)||new _({key:"custom",timeframeText:"custom",display:"custom",startCustom:t,endCustom:n,timeframeLength:()=>r,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["free","plus","enterprise"]})}function gr(e){return{...e.key!=="custom"&&{timePeriodsKey:e.key},start:e.rawStart(),end:e.rawEnd()}}function wr(e){return{key:e.key,display:e.display,timeframeText:e.timeframeText,timeframeLength:()=>e.key,start:()=>e.rawStart(),end:()=>e.rawEnd()}}function Be(e,t){return Nn(e.getTimezoneOffset()-t.getTimezoneOffset())}class z{constructor(t){h(this,"_seed");this._seed=t}next(t,n){const r=Math.sin(this._seed++)*1e4,a=r-Math.floor(r);return Math.floor(a*(n-t+1))+t}}const Tr=(e,t)=>{const n=ne(10,1e4),r=new z(n),a=Date.now()-6*60*60*1e3,i=Date.now(),s=[];let o=0;for(let c=a;c<=i;c+=60*60*1e3)if(t)for(const d in t)t[d].forEach(p=>{o+=r.next(50,500);const M={[d]:p,[e.name]:o},b={version:"1.0",timestamp:new Date(c).toISOString(),event:M};s.push(b)});else{o+=r.next(50,500);const d={version:"1.0",timestamp:new Date(c).toISOString(),event:{[e.name]:o}};s.push(d)}const u={};if(t)for(const c in t)u[c]={},t[c].forEach(d=>{u[c][d]={name:d,deleted:!1}});const l={start_ms:a,end_ms:i,query_id:"12345",metric_names:[e.name],metric_units:{[e.name]:e.unit},granularity_ms:60*60*1e3,display:u};return{data:s,meta:l}},_r=e=>{const t=ne(10,1e4),n=new z(t),r=Date.now()-6*60*60*1e3,a=Date.now(),i=[],s={};e.forEach(u=>{s[u.name]=0});for(let u=r;u<=a;u+=60*60*1e3){const l={};e.forEach(d=>{s[d.name]+=n.next(50,500),l[d.name]=s[d.name]});const c={version:"1.0",timestamp:new Date(u).toISOString(),event:l};i.push(c)}const o={start_ms:r,end_ms:a,query_id:"12345",metric_names:e.map(u=>u.name),metric_units:e.reduce((u,l)=>(u[l.name]=l.unit,u),{}),granularity_ms:60*60*1e3,display:{}};return{data:i,meta:o}},Dr=(e,t)=>{const n=Math.floor(Math.random()*9991)+10,r=new z(n),a=Date.now()-6*60*60*1e3,i=Date.now(),s=new Date((a+i)/2).toISOString(),o=[];if(t){const c=Object.keys(t),d=Object.values(t),p=(M,b)=>{if(b===c.length){e.forEach(S=>{M[S.name]=r.next(50,500)}),o.push({version:"1.0",timestamp:new Date().toISOString(),event:{...M}});return}d[b].forEach(S=>{p({...M,[c[b]]:S},b+1)})};p({},0)}else{const c={};e.forEach(d=>{c[d.name]=r.next(50,500)}),o.push({version:"1.0",timestamp:s,event:c})}const u={};if(t)for(const c in t)u[c]={},t[c].forEach(d=>{u[c][d]={name:d,deleted:!1}});const l={start_ms:a,end_ms:i,query_id:"12345",metric_names:e.map(c=>c.name),metric_units:e.reduce((c,d)=>(c[d.name]=d.unit,c),{}),truncated:!1,limit:50,display:u,granularity_ms:i-a};return{data:o,meta:l}};function ne(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)}exports.DeltaQueryTime=lr;exports.Granularities=I;exports.REFRESH_INTERVAL_MS=et;exports.SeededRandom=z;exports.TimePeriods=Ze;exports.Timeframe=_;exports.TimeframeKeys=m;exports.TimeseriesQueryTime=cr;exports.UnaryQueryTime=Qe;exports.aiExploreAggregations=lt;exports.basicExploreAggregations=Se;exports.ceilToNearestTimeGrain=te;exports.datasourceToFilterableDimensions=We;exports.datePickerSelectionToTimeframe=yr;exports.dstOffsetHours=Be;exports.exploreAggregations=ct;exports.exploreFilterTypesV2=nt;exports.filterableAiExploreDimensions=Ye;exports.filterableBasicExploreDimensions=xe;exports.filterableExploreDimensions=ke;exports.filterableRequestDimensions=dt;exports.filterableRequestMetrics=mt;exports.filterableRequestWildcardDimensions=ft;exports.floorToNearestTimeGrain=je;exports.formatISOTimeWithTZ=ir;exports.formatTime=J;exports.formatTimeRange=sr;exports.generateCrossSectionalData=Dr;exports.generateMultipleMetricTimeSeriesData=_r;exports.generateSingleMetricTimeSeriesData=Tr;exports.granularitiesToOptions=or;exports.granularityMsToQuery=Xe;exports.granularityValues=ve;exports.msToGranularity=ur;exports.queryDatasources=yt;exports.queryableAiExploreDimensions=Ne;exports.queryableBasicExploreDimensions=K;exports.queryableExploreDimensions=Ee;exports.queryableRequestDimensions=Re;exports.queryableRequestMetrics=Ie;exports.queryableRequestWildcardDimensions=Pe;exports.rand=ne;exports.relativeTimeRangeValuesRequestV2=ht;exports.relativeTimeRangeValuesV4=ut;exports.reportChartTypes=tt;exports.requestFilterTypeEmptyV2=it;exports.requestFilterTypeEqualsV2=rt;exports.requestFilterTypeMetricV2=at;exports.requestFilterTypeWildcardV2=st;exports.stripUnknownFilters=gt;exports.timeRangeTypeV2=ot;exports.timeframeToDatepickerSelection=gr;exports.timeframeToDatepickerTimeperiod=wr;
2
2
  //# sourceMappingURL=vitals-utilities.cjs.map