@kong-ui-public/analytics-utilities 5.6.0 → 5.7.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.
- package/dist/types/granularity.d.ts +9 -2
- package/dist/types/granularity.d.ts.map +1 -1
- package/dist/types/queryTime.d.ts +4 -3
- package/dist/types/queryTime.d.ts.map +1 -1
- package/dist/types/timeframes.d.ts +2 -1
- package/dist/types/timeframes.d.ts.map +1 -1
- package/dist/types/types/druid-granularity.d.ts +2 -4
- package/dist/types/types/druid-granularity.d.ts.map +1 -1
- package/dist/types/types/explore/common.d.ts +1 -1
- package/dist/types/types/explore/common.d.ts.map +1 -1
- package/dist/types/types/query-time.d.ts +1 -1
- package/dist/types/types/query-time.d.ts.map +1 -1
- package/dist/types/types/timeframe-options.d.ts +1 -0
- package/dist/types/types/timeframe-options.d.ts.map +1 -1
- package/dist/types/types/timeframe.d.ts +1 -1
- package/dist/types/types/timeframe.d.ts.map +1 -1
- package/dist/vitals-utilities.cjs +1 -1
- package/dist/vitals-utilities.cjs.map +1 -1
- package/dist/vitals-utilities.es.js +796 -765
- package/dist/vitals-utilities.es.js.map +1 -1
- package/dist/vitals-utilities.umd.js +1 -1
- package/dist/vitals-utilities.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var He = Object.defineProperty;
|
|
2
|
+
var Fe = (e, t, n) => t in e ? He(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var h = (e, t, n) => Fe(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
const Vn = 3e4;
|
|
5
|
-
var m = /* @__PURE__ */ ((
|
|
5
|
+
var m = /* @__PURE__ */ ((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 || {});
|
|
6
6
|
const jn = [
|
|
7
7
|
"horizontal_bar",
|
|
8
8
|
"vertical_bar",
|
|
@@ -21,14 +21,21 @@ const jn = [
|
|
|
21
21
|
"30d",
|
|
22
22
|
"current_month",
|
|
23
23
|
"previous_month"
|
|
24
|
-
],
|
|
24
|
+
], Ce = [
|
|
25
25
|
"secondly",
|
|
26
|
+
"tenSecondly",
|
|
27
|
+
"thirtySecondly",
|
|
26
28
|
"minutely",
|
|
29
|
+
"fiveMinutely",
|
|
30
|
+
"tenMinutely",
|
|
31
|
+
"thirtyMinutely",
|
|
27
32
|
"hourly",
|
|
33
|
+
"twoHourly",
|
|
34
|
+
"twelveHourly",
|
|
28
35
|
"daily",
|
|
29
36
|
"weekly",
|
|
30
37
|
"trend"
|
|
31
|
-
], I = (
|
|
38
|
+
], I = (e) => e.filter((t) => t !== "time"), be = [
|
|
32
39
|
"api_product",
|
|
33
40
|
"api_product_version",
|
|
34
41
|
"control_plane",
|
|
@@ -39,18 +46,18 @@ const jn = [
|
|
|
39
46
|
"status_code",
|
|
40
47
|
"status_code_grouped",
|
|
41
48
|
"time"
|
|
42
|
-
],
|
|
49
|
+
], Ge = I(be), Le = [
|
|
43
50
|
"active_services",
|
|
44
51
|
"request_count",
|
|
45
52
|
"request_per_minute",
|
|
46
53
|
"response_latency_average"
|
|
47
|
-
],
|
|
54
|
+
], qe = [
|
|
48
55
|
...be,
|
|
49
56
|
"application",
|
|
50
57
|
"consumer",
|
|
51
58
|
"iso_code"
|
|
52
|
-
],
|
|
53
|
-
...
|
|
59
|
+
], Ue = I(qe), nr = [
|
|
60
|
+
...Le,
|
|
54
61
|
"response_latency_p99",
|
|
55
62
|
"response_latency_p95",
|
|
56
63
|
"response_latency_p50",
|
|
@@ -70,7 +77,7 @@ const jn = [
|
|
|
70
77
|
"request_size_p50",
|
|
71
78
|
"request_size_average",
|
|
72
79
|
"response_size_average"
|
|
73
|
-
],
|
|
80
|
+
], ze = [
|
|
74
81
|
"control_plane",
|
|
75
82
|
"control_plane_group",
|
|
76
83
|
"gateway_service",
|
|
@@ -84,7 +91,7 @@ const jn = [
|
|
|
84
91
|
"llm_embeddings_provider",
|
|
85
92
|
"llm_embeddings_model",
|
|
86
93
|
"time"
|
|
87
|
-
], Ae = I(
|
|
94
|
+
], Ae = I(ze), rr = [
|
|
88
95
|
"total_tokens",
|
|
89
96
|
"prompt_tokens",
|
|
90
97
|
"completion_tokens",
|
|
@@ -142,7 +149,7 @@ const jn = [
|
|
|
142
149
|
"service_protocol",
|
|
143
150
|
"trace_id",
|
|
144
151
|
"upstream_uri"
|
|
145
|
-
],
|
|
152
|
+
], ir = $e, Ve = [
|
|
146
153
|
"ai_count",
|
|
147
154
|
"latencies_response_ms",
|
|
148
155
|
"latencies_upstream_ms",
|
|
@@ -152,7 +159,7 @@ const jn = [
|
|
|
152
159
|
"response_header_content_length",
|
|
153
160
|
"status_code",
|
|
154
161
|
"upstream_status_code"
|
|
155
|
-
],
|
|
162
|
+
], sr = I(Ve), or = [
|
|
156
163
|
"15M",
|
|
157
164
|
"1H",
|
|
158
165
|
"6H",
|
|
@@ -160,29 +167,29 @@ const jn = [
|
|
|
160
167
|
"24H",
|
|
161
168
|
"7D"
|
|
162
169
|
], ur = ["basic", "advanced", "ai"], je = {
|
|
163
|
-
basic: new Set(
|
|
164
|
-
advanced: new Set(
|
|
170
|
+
basic: new Set(Ge),
|
|
171
|
+
advanced: new Set(Ue),
|
|
165
172
|
ai: new Set(Ae)
|
|
166
|
-
}, cr = (
|
|
167
|
-
function D(
|
|
168
|
-
return typeof
|
|
169
|
-
}
|
|
170
|
-
function
|
|
171
|
-
return D(
|
|
172
|
-
}
|
|
173
|
-
function ne(
|
|
174
|
-
const r =
|
|
175
|
-
return isNaN(
|
|
176
|
-
}
|
|
177
|
-
function Je(
|
|
178
|
-
const r =
|
|
179
|
-
if (isNaN(
|
|
180
|
-
const a = r.getDate(),
|
|
181
|
-
|
|
182
|
-
const
|
|
183
|
-
return a >=
|
|
184
|
-
|
|
185
|
-
|
|
173
|
+
}, cr = (e, t) => t.filter((n) => je[e].has(n.dimension)), Oe = 6048e5, Ze = 864e5, Qe = 60, Be = 3600, te = Symbol.for("constructDateFrom");
|
|
174
|
+
function D(e, t) {
|
|
175
|
+
return typeof e == "function" ? e(t) : e && typeof e == "object" && te in e ? e[te](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
176
|
+
}
|
|
177
|
+
function y(e, t) {
|
|
178
|
+
return D(t || e, e);
|
|
179
|
+
}
|
|
180
|
+
function ne(e, t, n) {
|
|
181
|
+
const r = y(e, n == null ? void 0 : n.in);
|
|
182
|
+
return isNaN(t) ? D(e, NaN) : (r.setDate(r.getDate() + t), r);
|
|
183
|
+
}
|
|
184
|
+
function Je(e, t, n) {
|
|
185
|
+
const r = y(e, n == null ? void 0 : n.in);
|
|
186
|
+
if (isNaN(t)) return D(e, NaN);
|
|
187
|
+
const a = r.getDate(), i = D(e, r.getTime());
|
|
188
|
+
i.setMonth(r.getMonth() + t + 1, 0);
|
|
189
|
+
const s = i.getDate();
|
|
190
|
+
return a >= s ? i : (r.setFullYear(
|
|
191
|
+
i.getFullYear(),
|
|
192
|
+
i.getMonth(),
|
|
186
193
|
a
|
|
187
194
|
), r);
|
|
188
195
|
}
|
|
@@ -190,74 +197,74 @@ let Ke = {};
|
|
|
190
197
|
function W() {
|
|
191
198
|
return Ke;
|
|
192
199
|
}
|
|
193
|
-
function
|
|
200
|
+
function p(e, t) {
|
|
194
201
|
var o, u, l, c;
|
|
195
|
-
const n = W(), r = (
|
|
196
|
-
return a.setDate(a.getDate() -
|
|
202
|
+
const n = W(), 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;
|
|
203
|
+
return a.setDate(a.getDate() - s), a.setHours(0, 0, 0, 0), a;
|
|
197
204
|
}
|
|
198
|
-
function
|
|
199
|
-
return
|
|
205
|
+
function F(e, t) {
|
|
206
|
+
return p(e, { ...t, weekStartsOn: 1 });
|
|
200
207
|
}
|
|
201
|
-
function
|
|
202
|
-
const n =
|
|
208
|
+
function pe(e, t) {
|
|
209
|
+
const n = y(e, t == null ? void 0 : t.in), r = n.getFullYear(), a = D(n, 0);
|
|
203
210
|
a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
const o =
|
|
207
|
-
return n.getTime() >=
|
|
211
|
+
const i = F(a), s = D(n, 0);
|
|
212
|
+
s.setFullYear(r, 0, 4), s.setHours(0, 0, 0, 0);
|
|
213
|
+
const o = F(s);
|
|
214
|
+
return n.getTime() >= i.getTime() ? r + 1 : n.getTime() >= o.getTime() ? r : r - 1;
|
|
208
215
|
}
|
|
209
|
-
function re(
|
|
210
|
-
const
|
|
216
|
+
function re(e) {
|
|
217
|
+
const t = y(e), n = new Date(
|
|
211
218
|
Date.UTC(
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
+
t.getFullYear(),
|
|
220
|
+
t.getMonth(),
|
|
221
|
+
t.getDate(),
|
|
222
|
+
t.getHours(),
|
|
223
|
+
t.getMinutes(),
|
|
224
|
+
t.getSeconds(),
|
|
225
|
+
t.getMilliseconds()
|
|
219
226
|
)
|
|
220
227
|
);
|
|
221
|
-
return n.setUTCFullYear(
|
|
228
|
+
return n.setUTCFullYear(t.getFullYear()), +e - +n;
|
|
222
229
|
}
|
|
223
|
-
function et(
|
|
230
|
+
function et(e, ...t) {
|
|
224
231
|
const n = D.bind(
|
|
225
232
|
null,
|
|
226
|
-
|
|
233
|
+
t.find((r) => typeof r == "object")
|
|
227
234
|
);
|
|
228
|
-
return
|
|
235
|
+
return t.map(n);
|
|
229
236
|
}
|
|
230
|
-
function
|
|
231
|
-
const n =
|
|
237
|
+
function C(e, t) {
|
|
238
|
+
const n = y(e, t == null ? void 0 : t.in);
|
|
232
239
|
return n.setHours(0, 0, 0, 0), n;
|
|
233
240
|
}
|
|
234
|
-
function tt(
|
|
241
|
+
function tt(e, t, n) {
|
|
235
242
|
const [r, a] = et(
|
|
236
243
|
n == null ? void 0 : n.in,
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
),
|
|
244
|
+
e,
|
|
245
|
+
t
|
|
246
|
+
), i = C(r), s = C(a), o = +i - re(i), u = +s - re(s);
|
|
240
247
|
return Math.round((o - u) / Ze);
|
|
241
248
|
}
|
|
242
|
-
function nt(
|
|
243
|
-
const n =
|
|
244
|
-
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0),
|
|
249
|
+
function nt(e, t) {
|
|
250
|
+
const n = pe(e, t), r = D(e, 0);
|
|
251
|
+
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), F(r);
|
|
245
252
|
}
|
|
246
|
-
function rt(
|
|
247
|
-
return
|
|
253
|
+
function rt(e) {
|
|
254
|
+
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
248
255
|
}
|
|
249
|
-
function at(
|
|
250
|
-
return !(!rt(
|
|
256
|
+
function at(e) {
|
|
257
|
+
return !(!rt(e) && typeof e != "number" || isNaN(+y(e)));
|
|
251
258
|
}
|
|
252
|
-
function E(
|
|
253
|
-
const n =
|
|
259
|
+
function E(e, t) {
|
|
260
|
+
const n = y(e, t == null ? void 0 : t.in);
|
|
254
261
|
return n.setDate(1), n.setHours(0, 0, 0, 0), n;
|
|
255
262
|
}
|
|
256
|
-
function
|
|
257
|
-
const n =
|
|
263
|
+
function it(e, t) {
|
|
264
|
+
const n = y(e, t == null ? void 0 : t.in);
|
|
258
265
|
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
259
266
|
}
|
|
260
|
-
const
|
|
267
|
+
const st = {
|
|
261
268
|
lessThanXSeconds: {
|
|
262
269
|
one: "less than a second",
|
|
263
270
|
other: "less than {{count}} seconds"
|
|
@@ -319,15 +326,15 @@ const it = {
|
|
|
319
326
|
one: "almost 1 year",
|
|
320
327
|
other: "almost {{count}} years"
|
|
321
328
|
}
|
|
322
|
-
}, ot = (
|
|
329
|
+
}, ot = (e, t, n) => {
|
|
323
330
|
let r;
|
|
324
|
-
const a =
|
|
325
|
-
return typeof a == "string" ? r = a :
|
|
331
|
+
const a = st[e];
|
|
332
|
+
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;
|
|
326
333
|
};
|
|
327
|
-
function A(
|
|
328
|
-
return (
|
|
329
|
-
const n =
|
|
330
|
-
return
|
|
334
|
+
function A(e) {
|
|
335
|
+
return (t = {}) => {
|
|
336
|
+
const n = t.width ? String(t.width) : e.defaultWidth;
|
|
337
|
+
return e.formats[n] || e.formats[e.defaultWidth];
|
|
331
338
|
};
|
|
332
339
|
}
|
|
333
340
|
const ut = {
|
|
@@ -365,31 +372,31 @@ const ut = {
|
|
|
365
372
|
tomorrow: "'tomorrow at' p",
|
|
366
373
|
nextWeek: "eeee 'at' p",
|
|
367
374
|
other: "P"
|
|
368
|
-
}, mt = (
|
|
369
|
-
function P(
|
|
370
|
-
return (
|
|
375
|
+
}, mt = (e, t, n, r) => ft[e];
|
|
376
|
+
function P(e) {
|
|
377
|
+
return (t, n) => {
|
|
371
378
|
const r = n != null && n.context ? String(n.context) : "standalone";
|
|
372
379
|
let a;
|
|
373
|
-
if (r === "formatting" &&
|
|
374
|
-
const
|
|
375
|
-
a =
|
|
380
|
+
if (r === "formatting" && e.formattingValues) {
|
|
381
|
+
const s = e.defaultFormattingWidth || e.defaultWidth, o = n != null && n.width ? String(n.width) : s;
|
|
382
|
+
a = e.formattingValues[o] || e.formattingValues[s];
|
|
376
383
|
} else {
|
|
377
|
-
const
|
|
378
|
-
a =
|
|
384
|
+
const s = e.defaultWidth, o = n != null && n.width ? String(n.width) : e.defaultWidth;
|
|
385
|
+
a = e.values[o] || e.values[s];
|
|
379
386
|
}
|
|
380
|
-
const
|
|
381
|
-
return a[
|
|
387
|
+
const i = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
388
|
+
return a[i];
|
|
382
389
|
};
|
|
383
390
|
}
|
|
384
391
|
const ht = {
|
|
385
392
|
narrow: ["B", "A"],
|
|
386
393
|
abbreviated: ["BC", "AD"],
|
|
387
394
|
wide: ["Before Christ", "Anno Domini"]
|
|
388
|
-
},
|
|
395
|
+
}, yt = {
|
|
389
396
|
narrow: ["1", "2", "3", "4"],
|
|
390
397
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
391
398
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
392
|
-
},
|
|
399
|
+
}, gt = {
|
|
393
400
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
394
401
|
abbreviated: [
|
|
395
402
|
"Jan",
|
|
@@ -494,8 +501,8 @@ const ht = {
|
|
|
494
501
|
evening: "in the evening",
|
|
495
502
|
night: "at night"
|
|
496
503
|
}
|
|
497
|
-
}, Dt = (
|
|
498
|
-
const n = Number(
|
|
504
|
+
}, Dt = (e, t) => {
|
|
505
|
+
const n = Number(e), r = n % 100;
|
|
499
506
|
if (r > 20 || r < 10)
|
|
500
507
|
switch (r % 10) {
|
|
501
508
|
case 1:
|
|
@@ -513,12 +520,12 @@ const ht = {
|
|
|
513
520
|
defaultWidth: "wide"
|
|
514
521
|
}),
|
|
515
522
|
quarter: P({
|
|
516
|
-
values:
|
|
523
|
+
values: yt,
|
|
517
524
|
defaultWidth: "wide",
|
|
518
|
-
argumentCallback: (
|
|
525
|
+
argumentCallback: (e) => e - 1
|
|
519
526
|
}),
|
|
520
527
|
month: P({
|
|
521
|
-
values:
|
|
528
|
+
values: gt,
|
|
522
529
|
defaultWidth: "wide"
|
|
523
530
|
}),
|
|
524
531
|
day: P({
|
|
@@ -532,47 +539,47 @@ const ht = {
|
|
|
532
539
|
defaultFormattingWidth: "wide"
|
|
533
540
|
})
|
|
534
541
|
};
|
|
535
|
-
function R(
|
|
536
|
-
return (
|
|
537
|
-
const r = n.width, a = r &&
|
|
538
|
-
if (!
|
|
542
|
+
function R(e) {
|
|
543
|
+
return (t, n = {}) => {
|
|
544
|
+
const r = n.width, a = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], i = t.match(a);
|
|
545
|
+
if (!i)
|
|
539
546
|
return null;
|
|
540
|
-
const
|
|
547
|
+
const s = i[0], o = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], u = Array.isArray(o) ? Ot(o, (d) => d.test(s)) : (
|
|
541
548
|
// [TODO] -- I challenge you to fix the type
|
|
542
|
-
bt(o, (d) => d.test(
|
|
549
|
+
bt(o, (d) => d.test(s))
|
|
543
550
|
);
|
|
544
551
|
let l;
|
|
545
|
-
l =
|
|
552
|
+
l = e.valueCallback ? e.valueCallback(u) : u, l = n.valueCallback ? (
|
|
546
553
|
// [TODO] -- I challenge you to fix the type
|
|
547
554
|
n.valueCallback(l)
|
|
548
555
|
) : l;
|
|
549
|
-
const c =
|
|
556
|
+
const c = t.slice(s.length);
|
|
550
557
|
return { value: l, rest: c };
|
|
551
558
|
};
|
|
552
559
|
}
|
|
553
|
-
function bt(
|
|
554
|
-
for (const n in
|
|
555
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
560
|
+
function bt(e, t) {
|
|
561
|
+
for (const n in e)
|
|
562
|
+
if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
|
|
556
563
|
return n;
|
|
557
564
|
}
|
|
558
|
-
function
|
|
559
|
-
for (let n = 0; n <
|
|
560
|
-
if (e
|
|
565
|
+
function Ot(e, t) {
|
|
566
|
+
for (let n = 0; n < e.length; n++)
|
|
567
|
+
if (t(e[n]))
|
|
561
568
|
return n;
|
|
562
569
|
}
|
|
563
|
-
function
|
|
564
|
-
return (
|
|
565
|
-
const r =
|
|
570
|
+
function pt(e) {
|
|
571
|
+
return (t, n = {}) => {
|
|
572
|
+
const r = t.match(e.matchPattern);
|
|
566
573
|
if (!r) return null;
|
|
567
|
-
const a = r[0],
|
|
568
|
-
if (!
|
|
569
|
-
let
|
|
570
|
-
|
|
571
|
-
const o =
|
|
572
|
-
return { value:
|
|
574
|
+
const a = r[0], i = t.match(e.parsePattern);
|
|
575
|
+
if (!i) return null;
|
|
576
|
+
let s = e.valueCallback ? e.valueCallback(i[0]) : i[0];
|
|
577
|
+
s = n.valueCallback ? n.valueCallback(s) : s;
|
|
578
|
+
const o = t.slice(a.length);
|
|
579
|
+
return { value: s, rest: o };
|
|
573
580
|
};
|
|
574
581
|
}
|
|
575
|
-
const
|
|
582
|
+
const vt = /^(\d+)(th|st|nd|rd)?/i, xt = /\d+/i, St = {
|
|
576
583
|
narrow: /^(b|a)/i,
|
|
577
584
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
578
585
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
@@ -628,7 +635,7 @@ const xt = /^(\d+)(th|st|nd|rd)?/i, vt = /\d+/i, St = {
|
|
|
628
635
|
}, Wt = {
|
|
629
636
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
630
637
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
631
|
-
},
|
|
638
|
+
}, Ht = {
|
|
632
639
|
any: {
|
|
633
640
|
am: /^a/i,
|
|
634
641
|
pm: /^p/i,
|
|
@@ -639,11 +646,11 @@ const xt = /^(\d+)(th|st|nd|rd)?/i, vt = /\d+/i, St = {
|
|
|
639
646
|
evening: /evening/i,
|
|
640
647
|
night: /night/i
|
|
641
648
|
}
|
|
642
|
-
},
|
|
643
|
-
ordinalNumber:
|
|
644
|
-
matchPattern:
|
|
645
|
-
parsePattern:
|
|
646
|
-
valueCallback: (
|
|
649
|
+
}, Ft = {
|
|
650
|
+
ordinalNumber: pt({
|
|
651
|
+
matchPattern: vt,
|
|
652
|
+
parsePattern: xt,
|
|
653
|
+
valueCallback: (e) => parseInt(e, 10)
|
|
647
654
|
}),
|
|
648
655
|
era: R({
|
|
649
656
|
matchPatterns: St,
|
|
@@ -656,7 +663,7 @@ const xt = /^(\d+)(th|st|nd|rd)?/i, vt = /\d+/i, St = {
|
|
|
656
663
|
defaultMatchWidth: "wide",
|
|
657
664
|
parsePatterns: Et,
|
|
658
665
|
defaultParseWidth: "any",
|
|
659
|
-
valueCallback: (
|
|
666
|
+
valueCallback: (e) => e + 1
|
|
660
667
|
}),
|
|
661
668
|
month: R({
|
|
662
669
|
matchPatterns: Yt,
|
|
@@ -673,70 +680,70 @@ const xt = /^(\d+)(th|st|nd|rd)?/i, vt = /\d+/i, St = {
|
|
|
673
680
|
dayPeriod: R({
|
|
674
681
|
matchPatterns: Wt,
|
|
675
682
|
defaultMatchWidth: "any",
|
|
676
|
-
parsePatterns:
|
|
683
|
+
parsePatterns: Ht,
|
|
677
684
|
defaultParseWidth: "any"
|
|
678
685
|
})
|
|
679
|
-
},
|
|
686
|
+
}, Ct = {
|
|
680
687
|
code: "en-US",
|
|
681
688
|
formatDistance: ot,
|
|
682
689
|
formatLong: dt,
|
|
683
690
|
formatRelative: mt,
|
|
684
691
|
localize: Mt,
|
|
685
|
-
match:
|
|
692
|
+
match: Ft,
|
|
686
693
|
options: {
|
|
687
694
|
weekStartsOn: 0,
|
|
688
695
|
firstWeekContainsDate: 1
|
|
689
696
|
}
|
|
690
697
|
};
|
|
691
|
-
function
|
|
692
|
-
const n =
|
|
693
|
-
return tt(n,
|
|
698
|
+
function Gt(e, t) {
|
|
699
|
+
const n = y(e, t == null ? void 0 : t.in);
|
|
700
|
+
return tt(n, it(n)) + 1;
|
|
694
701
|
}
|
|
695
|
-
function
|
|
696
|
-
const n =
|
|
697
|
-
return Math.round(r /
|
|
702
|
+
function Lt(e, t) {
|
|
703
|
+
const n = y(e, t == null ? void 0 : t.in), r = +F(n) - +nt(n);
|
|
704
|
+
return Math.round(r / Oe) + 1;
|
|
698
705
|
}
|
|
699
|
-
function
|
|
706
|
+
function ve(e, t) {
|
|
700
707
|
var c, d, b, M;
|
|
701
|
-
const n =
|
|
702
|
-
|
|
703
|
-
const o =
|
|
704
|
-
u.setFullYear(r, 0,
|
|
705
|
-
const l =
|
|
708
|
+
const n = y(e, t == null ? void 0 : t.in), r = n.getFullYear(), a = W(), 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 = (b = a.locale) == null ? void 0 : b.options) == null ? void 0 : M.firstWeekContainsDate) ?? 1, s = D((t == null ? void 0 : t.in) || e, 0);
|
|
709
|
+
s.setFullYear(r + 1, 0, i), s.setHours(0, 0, 0, 0);
|
|
710
|
+
const o = p(s, t), u = D((t == null ? void 0 : t.in) || e, 0);
|
|
711
|
+
u.setFullYear(r, 0, i), u.setHours(0, 0, 0, 0);
|
|
712
|
+
const l = p(u, t);
|
|
706
713
|
return +n >= +o ? r + 1 : +n >= +l ? r : r - 1;
|
|
707
714
|
}
|
|
708
|
-
function
|
|
715
|
+
function qt(e, t) {
|
|
709
716
|
var o, u, l, c;
|
|
710
|
-
const n = W(), r = (
|
|
711
|
-
return
|
|
717
|
+
const n = W(), 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 = ve(e, t), i = D((t == null ? void 0 : t.in) || e, 0);
|
|
718
|
+
return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), p(i, t);
|
|
712
719
|
}
|
|
713
|
-
function
|
|
714
|
-
const n =
|
|
715
|
-
return Math.round(r /
|
|
720
|
+
function Ut(e, t) {
|
|
721
|
+
const n = y(e, t == null ? void 0 : t.in), r = +p(n, t) - +qt(n, t);
|
|
722
|
+
return Math.round(r / Oe) + 1;
|
|
716
723
|
}
|
|
717
|
-
function f(
|
|
718
|
-
const n =
|
|
724
|
+
function f(e, t) {
|
|
725
|
+
const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
|
|
719
726
|
return n + r;
|
|
720
727
|
}
|
|
721
|
-
const
|
|
728
|
+
const v = {
|
|
722
729
|
// Year
|
|
723
|
-
y(
|
|
724
|
-
const n =
|
|
725
|
-
return f(
|
|
730
|
+
y(e, t) {
|
|
731
|
+
const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
732
|
+
return f(t === "yy" ? r % 100 : r, t.length);
|
|
726
733
|
},
|
|
727
734
|
// Month
|
|
728
|
-
M(
|
|
729
|
-
const n =
|
|
730
|
-
return
|
|
735
|
+
M(e, t) {
|
|
736
|
+
const n = e.getMonth();
|
|
737
|
+
return t === "M" ? String(n + 1) : f(n + 1, 2);
|
|
731
738
|
},
|
|
732
739
|
// Day of the month
|
|
733
|
-
d(
|
|
734
|
-
return f(
|
|
740
|
+
d(e, t) {
|
|
741
|
+
return f(e.getDate(), t.length);
|
|
735
742
|
},
|
|
736
743
|
// AM or PM
|
|
737
|
-
a(
|
|
738
|
-
const n =
|
|
739
|
-
switch (
|
|
744
|
+
a(e, t) {
|
|
745
|
+
const n = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
746
|
+
switch (t) {
|
|
740
747
|
case "a":
|
|
741
748
|
case "aa":
|
|
742
749
|
return n.toUpperCase();
|
|
@@ -750,27 +757,27 @@ const x = {
|
|
|
750
757
|
}
|
|
751
758
|
},
|
|
752
759
|
// Hour [1-12]
|
|
753
|
-
h(
|
|
754
|
-
return f(
|
|
760
|
+
h(e, t) {
|
|
761
|
+
return f(e.getHours() % 12 || 12, t.length);
|
|
755
762
|
},
|
|
756
763
|
// Hour [0-23]
|
|
757
|
-
H(
|
|
758
|
-
return f(
|
|
764
|
+
H(e, t) {
|
|
765
|
+
return f(e.getHours(), t.length);
|
|
759
766
|
},
|
|
760
767
|
// Minute
|
|
761
|
-
m(
|
|
762
|
-
return f(
|
|
768
|
+
m(e, t) {
|
|
769
|
+
return f(e.getMinutes(), t.length);
|
|
763
770
|
},
|
|
764
771
|
// Second
|
|
765
|
-
s(
|
|
766
|
-
return f(
|
|
772
|
+
s(e, t) {
|
|
773
|
+
return f(e.getSeconds(), t.length);
|
|
767
774
|
},
|
|
768
775
|
// Fraction of second
|
|
769
|
-
S(
|
|
770
|
-
const n =
|
|
776
|
+
S(e, t) {
|
|
777
|
+
const n = t.length, r = e.getMilliseconds(), a = Math.trunc(
|
|
771
778
|
r * Math.pow(10, n - 3)
|
|
772
779
|
);
|
|
773
|
-
return f(a,
|
|
780
|
+
return f(a, t.length);
|
|
774
781
|
}
|
|
775
782
|
}, k = {
|
|
776
783
|
am: "am",
|
|
@@ -783,9 +790,9 @@ const x = {
|
|
|
783
790
|
night: "night"
|
|
784
791
|
}, ae = {
|
|
785
792
|
// Era
|
|
786
|
-
G: function(
|
|
787
|
-
const r =
|
|
788
|
-
switch (
|
|
793
|
+
G: function(e, t, n) {
|
|
794
|
+
const r = e.getFullYear() > 0 ? 1 : 0;
|
|
795
|
+
switch (t) {
|
|
789
796
|
case "G":
|
|
790
797
|
case "GG":
|
|
791
798
|
case "GGG":
|
|
@@ -798,26 +805,26 @@ const x = {
|
|
|
798
805
|
}
|
|
799
806
|
},
|
|
800
807
|
// Year
|
|
801
|
-
y: function(
|
|
802
|
-
if (
|
|
803
|
-
const r =
|
|
808
|
+
y: function(e, t, n) {
|
|
809
|
+
if (t === "yo") {
|
|
810
|
+
const r = e.getFullYear(), a = r > 0 ? r : 1 - r;
|
|
804
811
|
return n.ordinalNumber(a, { unit: "year" });
|
|
805
812
|
}
|
|
806
|
-
return
|
|
813
|
+
return v.y(e, t);
|
|
807
814
|
},
|
|
808
815
|
// Local week-numbering year
|
|
809
|
-
Y: function(
|
|
810
|
-
const a =
|
|
811
|
-
if (
|
|
812
|
-
const
|
|
813
|
-
return f(
|
|
816
|
+
Y: function(e, t, n, r) {
|
|
817
|
+
const a = ve(e, r), i = a > 0 ? a : 1 - a;
|
|
818
|
+
if (t === "YY") {
|
|
819
|
+
const s = i % 100;
|
|
820
|
+
return f(s, 2);
|
|
814
821
|
}
|
|
815
|
-
return
|
|
822
|
+
return t === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : f(i, t.length);
|
|
816
823
|
},
|
|
817
824
|
// ISO week-numbering year
|
|
818
|
-
R: function(
|
|
819
|
-
const n =
|
|
820
|
-
return f(n,
|
|
825
|
+
R: function(e, t) {
|
|
826
|
+
const n = pe(e);
|
|
827
|
+
return f(n, t.length);
|
|
821
828
|
},
|
|
822
829
|
// Extended year. This is a single number designating the year of this calendar system.
|
|
823
830
|
// The main difference between `y` and `u` localizers are B.C. years:
|
|
@@ -828,14 +835,14 @@ const x = {
|
|
|
828
835
|
// | BC 2 | 2 | -1 |
|
|
829
836
|
// Also `yy` always returns the last two digits of a year,
|
|
830
837
|
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
831
|
-
u: function(
|
|
832
|
-
const n =
|
|
833
|
-
return f(n,
|
|
838
|
+
u: function(e, t) {
|
|
839
|
+
const n = e.getFullYear();
|
|
840
|
+
return f(n, t.length);
|
|
834
841
|
},
|
|
835
842
|
// Quarter
|
|
836
|
-
Q: function(
|
|
837
|
-
const r = Math.ceil((
|
|
838
|
-
switch (
|
|
843
|
+
Q: function(e, t, n) {
|
|
844
|
+
const r = Math.ceil((e.getMonth() + 1) / 3);
|
|
845
|
+
switch (t) {
|
|
839
846
|
case "Q":
|
|
840
847
|
return String(r);
|
|
841
848
|
case "QQ":
|
|
@@ -861,9 +868,9 @@ const x = {
|
|
|
861
868
|
}
|
|
862
869
|
},
|
|
863
870
|
// Stand-alone quarter
|
|
864
|
-
q: function(
|
|
865
|
-
const r = Math.ceil((
|
|
866
|
-
switch (
|
|
871
|
+
q: function(e, t, n) {
|
|
872
|
+
const r = Math.ceil((e.getMonth() + 1) / 3);
|
|
873
|
+
switch (t) {
|
|
867
874
|
case "q":
|
|
868
875
|
return String(r);
|
|
869
876
|
case "qq":
|
|
@@ -889,12 +896,12 @@ const x = {
|
|
|
889
896
|
}
|
|
890
897
|
},
|
|
891
898
|
// Month
|
|
892
|
-
M: function(
|
|
893
|
-
const r =
|
|
894
|
-
switch (
|
|
899
|
+
M: function(e, t, n) {
|
|
900
|
+
const r = e.getMonth();
|
|
901
|
+
switch (t) {
|
|
895
902
|
case "M":
|
|
896
903
|
case "MM":
|
|
897
|
-
return
|
|
904
|
+
return v.M(e, t);
|
|
898
905
|
case "Mo":
|
|
899
906
|
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
900
907
|
case "MMM":
|
|
@@ -913,9 +920,9 @@ const x = {
|
|
|
913
920
|
}
|
|
914
921
|
},
|
|
915
922
|
// Stand-alone month
|
|
916
|
-
L: function(
|
|
917
|
-
const r =
|
|
918
|
-
switch (
|
|
923
|
+
L: function(e, t, n) {
|
|
924
|
+
const r = e.getMonth();
|
|
925
|
+
switch (t) {
|
|
919
926
|
case "L":
|
|
920
927
|
return String(r + 1);
|
|
921
928
|
case "LL":
|
|
@@ -938,28 +945,28 @@ const x = {
|
|
|
938
945
|
}
|
|
939
946
|
},
|
|
940
947
|
// Local week of year
|
|
941
|
-
w: function(
|
|
942
|
-
const a =
|
|
943
|
-
return
|
|
948
|
+
w: function(e, t, n, r) {
|
|
949
|
+
const a = Ut(e, r);
|
|
950
|
+
return t === "wo" ? n.ordinalNumber(a, { unit: "week" }) : f(a, t.length);
|
|
944
951
|
},
|
|
945
952
|
// ISO week of year
|
|
946
|
-
I: function(
|
|
947
|
-
const r =
|
|
948
|
-
return
|
|
953
|
+
I: function(e, t, n) {
|
|
954
|
+
const r = Lt(e);
|
|
955
|
+
return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : f(r, t.length);
|
|
949
956
|
},
|
|
950
957
|
// Day of the month
|
|
951
|
-
d: function(
|
|
952
|
-
return
|
|
958
|
+
d: function(e, t, n) {
|
|
959
|
+
return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : v.d(e, t);
|
|
953
960
|
},
|
|
954
961
|
// Day of year
|
|
955
|
-
D: function(
|
|
956
|
-
const r =
|
|
957
|
-
return
|
|
962
|
+
D: function(e, t, n) {
|
|
963
|
+
const r = Gt(e);
|
|
964
|
+
return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : f(r, t.length);
|
|
958
965
|
},
|
|
959
966
|
// Day of week
|
|
960
|
-
E: function(
|
|
961
|
-
const r =
|
|
962
|
-
switch (
|
|
967
|
+
E: function(e, t, n) {
|
|
968
|
+
const r = e.getDay();
|
|
969
|
+
switch (t) {
|
|
963
970
|
case "E":
|
|
964
971
|
case "EE":
|
|
965
972
|
case "EEE":
|
|
@@ -986,15 +993,15 @@ const x = {
|
|
|
986
993
|
}
|
|
987
994
|
},
|
|
988
995
|
// Local day of week
|
|
989
|
-
e: function(
|
|
990
|
-
const a =
|
|
991
|
-
switch (
|
|
996
|
+
e: function(e, t, n, r) {
|
|
997
|
+
const a = e.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
998
|
+
switch (t) {
|
|
992
999
|
case "e":
|
|
993
|
-
return String(
|
|
1000
|
+
return String(i);
|
|
994
1001
|
case "ee":
|
|
995
|
-
return f(
|
|
1002
|
+
return f(i, 2);
|
|
996
1003
|
case "eo":
|
|
997
|
-
return n.ordinalNumber(
|
|
1004
|
+
return n.ordinalNumber(i, { unit: "day" });
|
|
998
1005
|
case "eee":
|
|
999
1006
|
return n.day(a, {
|
|
1000
1007
|
width: "abbreviated",
|
|
@@ -1019,15 +1026,15 @@ const x = {
|
|
|
1019
1026
|
}
|
|
1020
1027
|
},
|
|
1021
1028
|
// Stand-alone local day of week
|
|
1022
|
-
c: function(
|
|
1023
|
-
const a =
|
|
1024
|
-
switch (
|
|
1029
|
+
c: function(e, t, n, r) {
|
|
1030
|
+
const a = e.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
1031
|
+
switch (t) {
|
|
1025
1032
|
case "c":
|
|
1026
|
-
return String(
|
|
1033
|
+
return String(i);
|
|
1027
1034
|
case "cc":
|
|
1028
|
-
return f(
|
|
1035
|
+
return f(i, t.length);
|
|
1029
1036
|
case "co":
|
|
1030
|
-
return n.ordinalNumber(
|
|
1037
|
+
return n.ordinalNumber(i, { unit: "day" });
|
|
1031
1038
|
case "ccc":
|
|
1032
1039
|
return n.day(a, {
|
|
1033
1040
|
width: "abbreviated",
|
|
@@ -1052,13 +1059,13 @@ const x = {
|
|
|
1052
1059
|
}
|
|
1053
1060
|
},
|
|
1054
1061
|
// ISO day of week
|
|
1055
|
-
i: function(
|
|
1056
|
-
const r =
|
|
1057
|
-
switch (
|
|
1062
|
+
i: function(e, t, n) {
|
|
1063
|
+
const r = e.getDay(), a = r === 0 ? 7 : r;
|
|
1064
|
+
switch (t) {
|
|
1058
1065
|
case "i":
|
|
1059
1066
|
return String(a);
|
|
1060
1067
|
case "ii":
|
|
1061
|
-
return f(a,
|
|
1068
|
+
return f(a, t.length);
|
|
1062
1069
|
case "io":
|
|
1063
1070
|
return n.ordinalNumber(a, { unit: "day" });
|
|
1064
1071
|
case "iii":
|
|
@@ -1085,9 +1092,9 @@ const x = {
|
|
|
1085
1092
|
}
|
|
1086
1093
|
},
|
|
1087
1094
|
// AM or PM
|
|
1088
|
-
a: function(
|
|
1089
|
-
const a =
|
|
1090
|
-
switch (
|
|
1095
|
+
a: function(e, t, n) {
|
|
1096
|
+
const a = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1097
|
+
switch (t) {
|
|
1091
1098
|
case "a":
|
|
1092
1099
|
case "aa":
|
|
1093
1100
|
return n.dayPeriod(a, {
|
|
@@ -1113,10 +1120,10 @@ const x = {
|
|
|
1113
1120
|
}
|
|
1114
1121
|
},
|
|
1115
1122
|
// AM, PM, midnight, noon
|
|
1116
|
-
b: function(
|
|
1117
|
-
const r =
|
|
1123
|
+
b: function(e, t, n) {
|
|
1124
|
+
const r = e.getHours();
|
|
1118
1125
|
let a;
|
|
1119
|
-
switch (r === 12 ? a = k.noon : r === 0 ? a = k.midnight : a = r / 12 >= 1 ? "pm" : "am",
|
|
1126
|
+
switch (r === 12 ? a = k.noon : r === 0 ? a = k.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
|
|
1120
1127
|
case "b":
|
|
1121
1128
|
case "bb":
|
|
1122
1129
|
return n.dayPeriod(a, {
|
|
@@ -1142,10 +1149,10 @@ const x = {
|
|
|
1142
1149
|
}
|
|
1143
1150
|
},
|
|
1144
1151
|
// in the morning, in the afternoon, in the evening, at night
|
|
1145
|
-
B: function(
|
|
1146
|
-
const r =
|
|
1152
|
+
B: function(e, t, n) {
|
|
1153
|
+
const r = e.getHours();
|
|
1147
1154
|
let a;
|
|
1148
|
-
switch (r >= 17 ? a = k.evening : r >= 12 ? a = k.afternoon : r >= 4 ? a = k.morning : a = k.night,
|
|
1155
|
+
switch (r >= 17 ? a = k.evening : r >= 12 ? a = k.afternoon : r >= 4 ? a = k.morning : a = k.night, t) {
|
|
1149
1156
|
case "B":
|
|
1150
1157
|
case "BB":
|
|
1151
1158
|
case "BBB":
|
|
@@ -1167,192 +1174,192 @@ const x = {
|
|
|
1167
1174
|
}
|
|
1168
1175
|
},
|
|
1169
1176
|
// Hour [1-12]
|
|
1170
|
-
h: function(
|
|
1171
|
-
if (
|
|
1172
|
-
let r =
|
|
1177
|
+
h: function(e, t, n) {
|
|
1178
|
+
if (t === "ho") {
|
|
1179
|
+
let r = e.getHours() % 12;
|
|
1173
1180
|
return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
|
|
1174
1181
|
}
|
|
1175
|
-
return
|
|
1182
|
+
return v.h(e, t);
|
|
1176
1183
|
},
|
|
1177
1184
|
// Hour [0-23]
|
|
1178
|
-
H: function(
|
|
1179
|
-
return
|
|
1185
|
+
H: function(e, t, n) {
|
|
1186
|
+
return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : v.H(e, t);
|
|
1180
1187
|
},
|
|
1181
1188
|
// Hour [0-11]
|
|
1182
|
-
K: function(
|
|
1183
|
-
const r =
|
|
1184
|
-
return
|
|
1189
|
+
K: function(e, t, n) {
|
|
1190
|
+
const r = e.getHours() % 12;
|
|
1191
|
+
return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : f(r, t.length);
|
|
1185
1192
|
},
|
|
1186
1193
|
// Hour [1-24]
|
|
1187
|
-
k: function(
|
|
1188
|
-
let r =
|
|
1189
|
-
return r === 0 && (r = 24),
|
|
1194
|
+
k: function(e, t, n) {
|
|
1195
|
+
let r = e.getHours();
|
|
1196
|
+
return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : f(r, t.length);
|
|
1190
1197
|
},
|
|
1191
1198
|
// Minute
|
|
1192
|
-
m: function(
|
|
1193
|
-
return
|
|
1199
|
+
m: function(e, t, n) {
|
|
1200
|
+
return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : v.m(e, t);
|
|
1194
1201
|
},
|
|
1195
1202
|
// Second
|
|
1196
|
-
s: function(
|
|
1197
|
-
return
|
|
1203
|
+
s: function(e, t, n) {
|
|
1204
|
+
return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : v.s(e, t);
|
|
1198
1205
|
},
|
|
1199
1206
|
// Fraction of second
|
|
1200
|
-
S: function(
|
|
1201
|
-
return
|
|
1207
|
+
S: function(e, t) {
|
|
1208
|
+
return v.S(e, t);
|
|
1202
1209
|
},
|
|
1203
1210
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1204
|
-
X: function(
|
|
1205
|
-
const r =
|
|
1211
|
+
X: function(e, t, n) {
|
|
1212
|
+
const r = e.getTimezoneOffset();
|
|
1206
1213
|
if (r === 0)
|
|
1207
1214
|
return "Z";
|
|
1208
|
-
switch (
|
|
1215
|
+
switch (t) {
|
|
1209
1216
|
case "X":
|
|
1210
|
-
return
|
|
1217
|
+
return se(r);
|
|
1211
1218
|
case "XXXX":
|
|
1212
1219
|
case "XX":
|
|
1213
|
-
return
|
|
1220
|
+
return x(r);
|
|
1214
1221
|
case "XXXXX":
|
|
1215
1222
|
case "XXX":
|
|
1216
1223
|
default:
|
|
1217
|
-
return
|
|
1224
|
+
return x(r, ":");
|
|
1218
1225
|
}
|
|
1219
1226
|
},
|
|
1220
1227
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1221
|
-
x: function(
|
|
1222
|
-
const r =
|
|
1223
|
-
switch (
|
|
1228
|
+
x: function(e, t, n) {
|
|
1229
|
+
const r = e.getTimezoneOffset();
|
|
1230
|
+
switch (t) {
|
|
1224
1231
|
case "x":
|
|
1225
|
-
return
|
|
1232
|
+
return se(r);
|
|
1226
1233
|
case "xxxx":
|
|
1227
1234
|
case "xx":
|
|
1228
|
-
return
|
|
1235
|
+
return x(r);
|
|
1229
1236
|
case "xxxxx":
|
|
1230
1237
|
case "xxx":
|
|
1231
1238
|
default:
|
|
1232
|
-
return
|
|
1239
|
+
return x(r, ":");
|
|
1233
1240
|
}
|
|
1234
1241
|
},
|
|
1235
1242
|
// Timezone (GMT)
|
|
1236
|
-
O: function(
|
|
1237
|
-
const r =
|
|
1238
|
-
switch (
|
|
1243
|
+
O: function(e, t, n) {
|
|
1244
|
+
const r = e.getTimezoneOffset();
|
|
1245
|
+
switch (t) {
|
|
1239
1246
|
case "O":
|
|
1240
1247
|
case "OO":
|
|
1241
1248
|
case "OOO":
|
|
1242
|
-
return "GMT" +
|
|
1249
|
+
return "GMT" + ie(r, ":");
|
|
1243
1250
|
case "OOOO":
|
|
1244
1251
|
default:
|
|
1245
|
-
return "GMT" +
|
|
1252
|
+
return "GMT" + x(r, ":");
|
|
1246
1253
|
}
|
|
1247
1254
|
},
|
|
1248
1255
|
// Timezone (specific non-location)
|
|
1249
|
-
z: function(
|
|
1250
|
-
const r =
|
|
1251
|
-
switch (
|
|
1256
|
+
z: function(e, t, n) {
|
|
1257
|
+
const r = e.getTimezoneOffset();
|
|
1258
|
+
switch (t) {
|
|
1252
1259
|
case "z":
|
|
1253
1260
|
case "zz":
|
|
1254
1261
|
case "zzz":
|
|
1255
|
-
return "GMT" +
|
|
1262
|
+
return "GMT" + ie(r, ":");
|
|
1256
1263
|
case "zzzz":
|
|
1257
1264
|
default:
|
|
1258
|
-
return "GMT" +
|
|
1265
|
+
return "GMT" + x(r, ":");
|
|
1259
1266
|
}
|
|
1260
1267
|
},
|
|
1261
1268
|
// Seconds timestamp
|
|
1262
|
-
t: function(
|
|
1263
|
-
const r = Math.trunc(+
|
|
1264
|
-
return f(r,
|
|
1269
|
+
t: function(e, t, n) {
|
|
1270
|
+
const r = Math.trunc(+e / 1e3);
|
|
1271
|
+
return f(r, t.length);
|
|
1265
1272
|
},
|
|
1266
1273
|
// Milliseconds timestamp
|
|
1267
|
-
T: function(
|
|
1268
|
-
return f(+
|
|
1274
|
+
T: function(e, t, n) {
|
|
1275
|
+
return f(+e, t.length);
|
|
1269
1276
|
}
|
|
1270
1277
|
};
|
|
1271
|
-
function
|
|
1272
|
-
const n =
|
|
1273
|
-
return
|
|
1278
|
+
function ie(e, t = "") {
|
|
1279
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.trunc(r / 60), i = r % 60;
|
|
1280
|
+
return i === 0 ? n + String(a) : n + String(a) + t + f(i, 2);
|
|
1274
1281
|
}
|
|
1275
|
-
function
|
|
1276
|
-
return
|
|
1282
|
+
function se(e, t) {
|
|
1283
|
+
return e % 60 === 0 ? (e > 0 ? "-" : "+") + f(Math.abs(e) / 60, 2) : x(e, t);
|
|
1277
1284
|
}
|
|
1278
|
-
function
|
|
1279
|
-
const n =
|
|
1280
|
-
return n + a +
|
|
1285
|
+
function x(e, t = "") {
|
|
1286
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = f(Math.trunc(r / 60), 2), i = f(r % 60, 2);
|
|
1287
|
+
return n + a + t + i;
|
|
1281
1288
|
}
|
|
1282
|
-
const oe = (
|
|
1283
|
-
switch (
|
|
1289
|
+
const oe = (e, t) => {
|
|
1290
|
+
switch (e) {
|
|
1284
1291
|
case "P":
|
|
1285
|
-
return
|
|
1292
|
+
return t.date({ width: "short" });
|
|
1286
1293
|
case "PP":
|
|
1287
|
-
return
|
|
1294
|
+
return t.date({ width: "medium" });
|
|
1288
1295
|
case "PPP":
|
|
1289
|
-
return
|
|
1296
|
+
return t.date({ width: "long" });
|
|
1290
1297
|
case "PPPP":
|
|
1291
1298
|
default:
|
|
1292
|
-
return
|
|
1299
|
+
return t.date({ width: "full" });
|
|
1293
1300
|
}
|
|
1294
|
-
},
|
|
1295
|
-
switch (
|
|
1301
|
+
}, xe = (e, t) => {
|
|
1302
|
+
switch (e) {
|
|
1296
1303
|
case "p":
|
|
1297
|
-
return
|
|
1304
|
+
return t.time({ width: "short" });
|
|
1298
1305
|
case "pp":
|
|
1299
|
-
return
|
|
1306
|
+
return t.time({ width: "medium" });
|
|
1300
1307
|
case "ppp":
|
|
1301
|
-
return
|
|
1308
|
+
return t.time({ width: "long" });
|
|
1302
1309
|
case "pppp":
|
|
1303
1310
|
default:
|
|
1304
|
-
return
|
|
1311
|
+
return t.time({ width: "full" });
|
|
1305
1312
|
}
|
|
1306
|
-
},
|
|
1307
|
-
const n =
|
|
1313
|
+
}, zt = (e, t) => {
|
|
1314
|
+
const n = e.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
|
|
1308
1315
|
if (!a)
|
|
1309
|
-
return oe(
|
|
1310
|
-
let
|
|
1316
|
+
return oe(e, t);
|
|
1317
|
+
let i;
|
|
1311
1318
|
switch (r) {
|
|
1312
1319
|
case "P":
|
|
1313
|
-
|
|
1320
|
+
i = t.dateTime({ width: "short" });
|
|
1314
1321
|
break;
|
|
1315
1322
|
case "PP":
|
|
1316
|
-
|
|
1323
|
+
i = t.dateTime({ width: "medium" });
|
|
1317
1324
|
break;
|
|
1318
1325
|
case "PPP":
|
|
1319
|
-
|
|
1326
|
+
i = t.dateTime({ width: "long" });
|
|
1320
1327
|
break;
|
|
1321
1328
|
case "PPPP":
|
|
1322
1329
|
default:
|
|
1323
|
-
|
|
1330
|
+
i = t.dateTime({ width: "full" });
|
|
1324
1331
|
break;
|
|
1325
1332
|
}
|
|
1326
|
-
return
|
|
1333
|
+
return i.replace("{{date}}", oe(r, t)).replace("{{time}}", xe(a, t));
|
|
1327
1334
|
}, At = {
|
|
1328
|
-
p:
|
|
1329
|
-
P:
|
|
1335
|
+
p: xe,
|
|
1336
|
+
P: zt
|
|
1330
1337
|
}, Xt = /^D+$/, $t = /^Y+$/, Vt = ["D", "DD", "YY", "YYYY"];
|
|
1331
|
-
function jt(
|
|
1332
|
-
return Xt.test(
|
|
1338
|
+
function jt(e) {
|
|
1339
|
+
return Xt.test(e);
|
|
1333
1340
|
}
|
|
1334
|
-
function Zt(
|
|
1335
|
-
return $t.test(
|
|
1341
|
+
function Zt(e) {
|
|
1342
|
+
return $t.test(e);
|
|
1336
1343
|
}
|
|
1337
|
-
function Qt(
|
|
1338
|
-
const r = Bt(
|
|
1339
|
-
if (console.warn(r), Vt.includes(
|
|
1344
|
+
function Qt(e, t, n) {
|
|
1345
|
+
const r = Bt(e, t, n);
|
|
1346
|
+
if (console.warn(r), Vt.includes(e)) throw new RangeError(r);
|
|
1340
1347
|
}
|
|
1341
|
-
function Bt(
|
|
1342
|
-
const r =
|
|
1343
|
-
return `Use \`${
|
|
1348
|
+
function Bt(e, t, n) {
|
|
1349
|
+
const r = e[0] === "Y" ? "years" : "days of the month";
|
|
1350
|
+
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`;
|
|
1344
1351
|
}
|
|
1345
1352
|
const Jt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Kt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, en = /^'([^]*?)'?$/, tn = /''/g, nn = /[a-zA-Z]/;
|
|
1346
|
-
function Se(
|
|
1347
|
-
var c, d, b, M,
|
|
1348
|
-
const r = W(), a = (n == null ? void 0 : n.locale) ?? r.locale ??
|
|
1353
|
+
function Se(e, t, n) {
|
|
1354
|
+
var c, d, b, M, O, S, K, ee;
|
|
1355
|
+
const r = W(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? Ct, 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 = (b = r.locale) == null ? void 0 : b.options) == null ? void 0 : M.firstWeekContainsDate) ?? 1, s = (n == null ? void 0 : n.weekStartsOn) ?? ((S = (O = n == null ? void 0 : n.locale) == null ? void 0 : O.options) == null ? void 0 : S.weekStartsOn) ?? r.weekStartsOn ?? ((ee = (K = r.locale) == null ? void 0 : K.options) == null ? void 0 : ee.weekStartsOn) ?? 0, o = y(e, n == null ? void 0 : n.in);
|
|
1349
1356
|
if (!at(o))
|
|
1350
1357
|
throw new RangeError("Invalid time value");
|
|
1351
|
-
let u =
|
|
1358
|
+
let u = t.match(Kt).map((_) => {
|
|
1352
1359
|
const w = _[0];
|
|
1353
1360
|
if (w === "p" || w === "P") {
|
|
1354
|
-
const
|
|
1355
|
-
return
|
|
1361
|
+
const z = At[w];
|
|
1362
|
+
return z(_, a.formatLong);
|
|
1356
1363
|
}
|
|
1357
1364
|
return _;
|
|
1358
1365
|
}).join("").match(Jt).map((_) => {
|
|
@@ -1371,68 +1378,68 @@ function Se(t, e, n) {
|
|
|
1371
1378
|
});
|
|
1372
1379
|
a.localize.preprocessor && (u = a.localize.preprocessor(o, u));
|
|
1373
1380
|
const l = {
|
|
1374
|
-
firstWeekContainsDate:
|
|
1375
|
-
weekStartsOn:
|
|
1381
|
+
firstWeekContainsDate: i,
|
|
1382
|
+
weekStartsOn: s,
|
|
1376
1383
|
locale: a
|
|
1377
1384
|
};
|
|
1378
1385
|
return u.map((_) => {
|
|
1379
1386
|
if (!_.isToken) return _.value;
|
|
1380
1387
|
const w = _.value;
|
|
1381
|
-
(!(n != null && n.useAdditionalWeekYearTokens) && Zt(w) || !(n != null && n.useAdditionalDayOfYearTokens) && jt(w)) && Qt(w,
|
|
1382
|
-
const
|
|
1383
|
-
return
|
|
1388
|
+
(!(n != null && n.useAdditionalWeekYearTokens) && Zt(w) || !(n != null && n.useAdditionalDayOfYearTokens) && jt(w)) && Qt(w, t, String(e));
|
|
1389
|
+
const z = ae[w[0]];
|
|
1390
|
+
return z(o, w, a.localize, l);
|
|
1384
1391
|
}).join("");
|
|
1385
1392
|
}
|
|
1386
|
-
function rn(
|
|
1387
|
-
const
|
|
1388
|
-
return
|
|
1393
|
+
function rn(e) {
|
|
1394
|
+
const t = e.match(en);
|
|
1395
|
+
return t ? t[1].replace(tn, "'") : e;
|
|
1389
1396
|
}
|
|
1390
|
-
function an(
|
|
1391
|
-
const n =
|
|
1392
|
-
return
|
|
1397
|
+
function an(e, t) {
|
|
1398
|
+
const n = y(e, t == null ? void 0 : t.in), r = n.getFullYear(), a = n.getMonth(), i = D(n, 0);
|
|
1399
|
+
return i.setFullYear(r, a + 1, 0), i.setHours(0, 0, 0, 0), i.getDate();
|
|
1393
1400
|
}
|
|
1394
1401
|
function sn() {
|
|
1395
1402
|
return Object.assign({}, W());
|
|
1396
1403
|
}
|
|
1397
|
-
function ue(
|
|
1398
|
-
return +
|
|
1404
|
+
function ue(e) {
|
|
1405
|
+
return +y(e);
|
|
1399
1406
|
}
|
|
1400
|
-
function ce(
|
|
1401
|
-
return Math.trunc(+
|
|
1407
|
+
function ce(e) {
|
|
1408
|
+
return Math.trunc(+y(e) / 1e3);
|
|
1402
1409
|
}
|
|
1403
|
-
function on(
|
|
1404
|
-
return Math.trunc(
|
|
1410
|
+
function on(e) {
|
|
1411
|
+
return Math.trunc(e * Be);
|
|
1405
1412
|
}
|
|
1406
|
-
function un(
|
|
1407
|
-
const
|
|
1408
|
-
return Math.trunc(
|
|
1413
|
+
function un(e) {
|
|
1414
|
+
const t = e / Qe;
|
|
1415
|
+
return Math.trunc(t);
|
|
1409
1416
|
}
|
|
1410
|
-
function ke(
|
|
1411
|
-
return Je(
|
|
1417
|
+
function ke(e, t, n) {
|
|
1418
|
+
return Je(e, -t, n);
|
|
1412
1419
|
}
|
|
1413
|
-
function le(
|
|
1414
|
-
const r = sn(), a = dn(
|
|
1415
|
-
return "formatToParts" in a ? cn(a,
|
|
1420
|
+
function le(e, t, n) {
|
|
1421
|
+
const r = sn(), a = dn(e, n.timeZone, n.locale ?? r.locale);
|
|
1422
|
+
return "formatToParts" in a ? cn(a, t) : ln(a, t);
|
|
1416
1423
|
}
|
|
1417
|
-
function cn(
|
|
1418
|
-
const n =
|
|
1424
|
+
function cn(e, t) {
|
|
1425
|
+
const n = e.formatToParts(t);
|
|
1419
1426
|
for (let r = n.length - 1; r >= 0; --r)
|
|
1420
1427
|
if (n[r].type === "timeZoneName")
|
|
1421
1428
|
return n[r].value;
|
|
1422
1429
|
}
|
|
1423
|
-
function ln(
|
|
1424
|
-
const n =
|
|
1430
|
+
function ln(e, t) {
|
|
1431
|
+
const n = e.format(t).replace(/\u200E/g, ""), r = / [\w-+ ]+$/.exec(n);
|
|
1425
1432
|
return r ? r[0].substr(1) : "";
|
|
1426
1433
|
}
|
|
1427
|
-
function dn(
|
|
1434
|
+
function dn(e, t, n) {
|
|
1428
1435
|
return new Intl.DateTimeFormat(n ? [n.code, "en-US"] : void 0, {
|
|
1429
|
-
timeZone:
|
|
1430
|
-
timeZoneName:
|
|
1436
|
+
timeZone: t,
|
|
1437
|
+
timeZoneName: e
|
|
1431
1438
|
});
|
|
1432
1439
|
}
|
|
1433
|
-
function fn(
|
|
1434
|
-
const n = wn(
|
|
1435
|
-
return "formatToParts" in n ? hn(n,
|
|
1440
|
+
function fn(e, t) {
|
|
1441
|
+
const n = wn(t);
|
|
1442
|
+
return "formatToParts" in n ? hn(n, e) : yn(n, e);
|
|
1436
1443
|
}
|
|
1437
1444
|
const mn = {
|
|
1438
1445
|
year: 0,
|
|
@@ -1442,12 +1449,12 @@ const mn = {
|
|
|
1442
1449
|
minute: 4,
|
|
1443
1450
|
second: 5
|
|
1444
1451
|
};
|
|
1445
|
-
function hn(
|
|
1452
|
+
function hn(e, t) {
|
|
1446
1453
|
try {
|
|
1447
|
-
const n =
|
|
1454
|
+
const n = e.formatToParts(t), r = [];
|
|
1448
1455
|
for (let a = 0; a < n.length; a++) {
|
|
1449
|
-
const
|
|
1450
|
-
|
|
1456
|
+
const i = mn[n[a].type];
|
|
1457
|
+
i !== void 0 && (r[i] = parseInt(n[a].value, 10));
|
|
1451
1458
|
}
|
|
1452
1459
|
return r;
|
|
1453
1460
|
} catch (n) {
|
|
@@ -1456,8 +1463,8 @@ function hn(t, e) {
|
|
|
1456
1463
|
throw n;
|
|
1457
1464
|
}
|
|
1458
1465
|
}
|
|
1459
|
-
function
|
|
1460
|
-
const n =
|
|
1466
|
+
function yn(e, t) {
|
|
1467
|
+
const n = e.format(t), r = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);
|
|
1461
1468
|
return [
|
|
1462
1469
|
parseInt(r[3], 10),
|
|
1463
1470
|
parseInt(r[1], 10),
|
|
@@ -1476,11 +1483,11 @@ const X = {}, de = new Intl.DateTimeFormat("en-US", {
|
|
|
1476
1483
|
hour: "2-digit",
|
|
1477
1484
|
minute: "2-digit",
|
|
1478
1485
|
second: "2-digit"
|
|
1479
|
-
}).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")),
|
|
1480
|
-
function wn(
|
|
1481
|
-
return X[
|
|
1486
|
+
}).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), gn = de === "06/25/2014, 00:00:00" || de === "06/25/2014 00:00:00";
|
|
1487
|
+
function wn(e) {
|
|
1488
|
+
return X[e] || (X[e] = gn ? new Intl.DateTimeFormat("en-US", {
|
|
1482
1489
|
hourCycle: "h23",
|
|
1483
|
-
timeZone:
|
|
1490
|
+
timeZone: e,
|
|
1484
1491
|
year: "numeric",
|
|
1485
1492
|
month: "numeric",
|
|
1486
1493
|
day: "2-digit",
|
|
@@ -1489,18 +1496,18 @@ function wn(t) {
|
|
|
1489
1496
|
second: "2-digit"
|
|
1490
1497
|
}) : new Intl.DateTimeFormat("en-US", {
|
|
1491
1498
|
hour12: !1,
|
|
1492
|
-
timeZone:
|
|
1499
|
+
timeZone: e,
|
|
1493
1500
|
year: "numeric",
|
|
1494
1501
|
month: "numeric",
|
|
1495
1502
|
day: "2-digit",
|
|
1496
1503
|
hour: "2-digit",
|
|
1497
1504
|
minute: "2-digit",
|
|
1498
1505
|
second: "2-digit"
|
|
1499
|
-
})), X[
|
|
1506
|
+
})), X[e];
|
|
1500
1507
|
}
|
|
1501
|
-
function B(
|
|
1508
|
+
function B(e, t, n, r, a, i, s) {
|
|
1502
1509
|
const o = /* @__PURE__ */ new Date(0);
|
|
1503
|
-
return o.setUTCFullYear(
|
|
1510
|
+
return o.setUTCFullYear(e, t, n), o.setUTCHours(r, a, i, s), o;
|
|
1504
1511
|
}
|
|
1505
1512
|
const fe = 36e5, _n = 6e4, $ = {
|
|
1506
1513
|
timezone: /([Z+-].*)$/,
|
|
@@ -1508,67 +1515,67 @@ const fe = 36e5, _n = 6e4, $ = {
|
|
|
1508
1515
|
timezoneHH: /^([+-]\d{2})$/,
|
|
1509
1516
|
timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/
|
|
1510
1517
|
};
|
|
1511
|
-
function
|
|
1512
|
-
if (!
|
|
1518
|
+
function H(e, t, n) {
|
|
1519
|
+
if (!e)
|
|
1513
1520
|
return 0;
|
|
1514
|
-
let r = $.timezoneZ.exec(
|
|
1521
|
+
let r = $.timezoneZ.exec(e);
|
|
1515
1522
|
if (r)
|
|
1516
1523
|
return 0;
|
|
1517
|
-
let a,
|
|
1518
|
-
if (r = $.timezoneHH.exec(
|
|
1524
|
+
let a, i;
|
|
1525
|
+
if (r = $.timezoneHH.exec(e), r)
|
|
1519
1526
|
return a = parseInt(r[1], 10), me(a) ? -(a * fe) : NaN;
|
|
1520
|
-
if (r = $.timezoneHHMM.exec(
|
|
1527
|
+
if (r = $.timezoneHHMM.exec(e), r) {
|
|
1521
1528
|
a = parseInt(r[2], 10);
|
|
1522
|
-
const
|
|
1523
|
-
return me(a,
|
|
1529
|
+
const s = parseInt(r[3], 10);
|
|
1530
|
+
return me(a, s) ? (i = Math.abs(a) * fe + s * _n, r[1] === "+" ? -i : i) : NaN;
|
|
1524
1531
|
}
|
|
1525
|
-
if (Mn(
|
|
1526
|
-
|
|
1527
|
-
const
|
|
1528
|
-
return -(n ? o : Dn(
|
|
1532
|
+
if (Mn(e)) {
|
|
1533
|
+
t = new Date(t || Date.now());
|
|
1534
|
+
const s = n ? t : Tn(t), o = Q(s, e);
|
|
1535
|
+
return -(n ? o : Dn(t, o, e));
|
|
1529
1536
|
}
|
|
1530
1537
|
return NaN;
|
|
1531
1538
|
}
|
|
1532
|
-
function Tn(
|
|
1533
|
-
return B(
|
|
1539
|
+
function Tn(e) {
|
|
1540
|
+
return B(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
|
|
1534
1541
|
}
|
|
1535
|
-
function Q(
|
|
1536
|
-
const n = fn(
|
|
1537
|
-
let a =
|
|
1538
|
-
const
|
|
1539
|
-
return a -=
|
|
1542
|
+
function Q(e, t) {
|
|
1543
|
+
const n = fn(e, t), r = B(n[0], n[1] - 1, n[2], n[3] % 24, n[4], n[5], 0).getTime();
|
|
1544
|
+
let a = e.getTime();
|
|
1545
|
+
const i = a % 1e3;
|
|
1546
|
+
return a -= i >= 0 ? i : 1e3 + i, r - a;
|
|
1540
1547
|
}
|
|
1541
|
-
function Dn(
|
|
1542
|
-
let a =
|
|
1543
|
-
const s = Q(new Date(a), n);
|
|
1544
|
-
if (e === s)
|
|
1545
|
-
return e;
|
|
1546
|
-
a -= s - e;
|
|
1548
|
+
function Dn(e, t, n) {
|
|
1549
|
+
let a = e.getTime() - t;
|
|
1547
1550
|
const i = Q(new Date(a), n);
|
|
1548
|
-
|
|
1551
|
+
if (t === i)
|
|
1552
|
+
return t;
|
|
1553
|
+
a -= i - t;
|
|
1554
|
+
const s = Q(new Date(a), n);
|
|
1555
|
+
return i === s ? i : Math.max(i, s);
|
|
1549
1556
|
}
|
|
1550
|
-
function me(
|
|
1551
|
-
return -23 <=
|
|
1557
|
+
function me(e, t) {
|
|
1558
|
+
return -23 <= e && e <= 23 && (t == null || 0 <= t && t <= 59);
|
|
1552
1559
|
}
|
|
1553
1560
|
const he = {};
|
|
1554
|
-
function Mn(
|
|
1555
|
-
if (he[
|
|
1561
|
+
function Mn(e) {
|
|
1562
|
+
if (he[e])
|
|
1556
1563
|
return !0;
|
|
1557
1564
|
try {
|
|
1558
|
-
return new Intl.DateTimeFormat(void 0, { timeZone:
|
|
1565
|
+
return new Intl.DateTimeFormat(void 0, { timeZone: e }), he[e] = !0, !0;
|
|
1559
1566
|
} catch {
|
|
1560
1567
|
return !1;
|
|
1561
1568
|
}
|
|
1562
1569
|
}
|
|
1563
|
-
const bn = 60 * 1e3,
|
|
1570
|
+
const bn = 60 * 1e3, On = {
|
|
1564
1571
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1565
|
-
X: function(
|
|
1566
|
-
const r = V(n.timeZone,
|
|
1572
|
+
X: function(e, t, n) {
|
|
1573
|
+
const r = V(n.timeZone, e);
|
|
1567
1574
|
if (r === 0)
|
|
1568
1575
|
return "Z";
|
|
1569
|
-
switch (
|
|
1576
|
+
switch (t) {
|
|
1570
1577
|
case "X":
|
|
1571
|
-
return
|
|
1578
|
+
return ye(r);
|
|
1572
1579
|
case "XXXX":
|
|
1573
1580
|
case "XX":
|
|
1574
1581
|
return N(r);
|
|
@@ -1579,11 +1586,11 @@ const bn = 60 * 1e3, pn = {
|
|
|
1579
1586
|
}
|
|
1580
1587
|
},
|
|
1581
1588
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1582
|
-
x: function(
|
|
1583
|
-
const r = V(n.timeZone,
|
|
1584
|
-
switch (
|
|
1589
|
+
x: function(e, t, n) {
|
|
1590
|
+
const r = V(n.timeZone, e);
|
|
1591
|
+
switch (t) {
|
|
1585
1592
|
case "x":
|
|
1586
|
-
return
|
|
1593
|
+
return ye(r);
|
|
1587
1594
|
case "xxxx":
|
|
1588
1595
|
case "xx":
|
|
1589
1596
|
return N(r);
|
|
@@ -1594,60 +1601,60 @@ const bn = 60 * 1e3, pn = {
|
|
|
1594
1601
|
}
|
|
1595
1602
|
},
|
|
1596
1603
|
// Timezone (GMT)
|
|
1597
|
-
O: function(
|
|
1598
|
-
const r = V(n.timeZone,
|
|
1599
|
-
switch (
|
|
1604
|
+
O: function(e, t, n) {
|
|
1605
|
+
const r = V(n.timeZone, e);
|
|
1606
|
+
switch (t) {
|
|
1600
1607
|
case "O":
|
|
1601
1608
|
case "OO":
|
|
1602
1609
|
case "OOO":
|
|
1603
|
-
return "GMT" +
|
|
1610
|
+
return "GMT" + pn(r, ":");
|
|
1604
1611
|
case "OOOO":
|
|
1605
1612
|
default:
|
|
1606
1613
|
return "GMT" + N(r, ":");
|
|
1607
1614
|
}
|
|
1608
1615
|
},
|
|
1609
1616
|
// Timezone (specific non-location)
|
|
1610
|
-
z: function(
|
|
1611
|
-
switch (
|
|
1617
|
+
z: function(e, t, n) {
|
|
1618
|
+
switch (t) {
|
|
1612
1619
|
case "z":
|
|
1613
1620
|
case "zz":
|
|
1614
1621
|
case "zzz":
|
|
1615
|
-
return le("short",
|
|
1622
|
+
return le("short", e, n);
|
|
1616
1623
|
case "zzzz":
|
|
1617
1624
|
default:
|
|
1618
|
-
return le("long",
|
|
1625
|
+
return le("long", e, n);
|
|
1619
1626
|
}
|
|
1620
1627
|
}
|
|
1621
1628
|
};
|
|
1622
|
-
function V(
|
|
1623
|
-
const n =
|
|
1629
|
+
function V(e, t) {
|
|
1630
|
+
const n = e ? H(e, t, !0) / bn : (t == null ? void 0 : t.getTimezoneOffset()) ?? 0;
|
|
1624
1631
|
if (Number.isNaN(n))
|
|
1625
|
-
throw new RangeError("Invalid time zone specified: " +
|
|
1632
|
+
throw new RangeError("Invalid time zone specified: " + e);
|
|
1626
1633
|
return n;
|
|
1627
1634
|
}
|
|
1628
|
-
function
|
|
1629
|
-
const n =
|
|
1630
|
-
let r = Math.abs(
|
|
1631
|
-
for (; r.length <
|
|
1635
|
+
function G(e, t) {
|
|
1636
|
+
const n = e < 0 ? "-" : "";
|
|
1637
|
+
let r = Math.abs(e).toString();
|
|
1638
|
+
for (; r.length < t; )
|
|
1632
1639
|
r = "0" + r;
|
|
1633
1640
|
return n + r;
|
|
1634
1641
|
}
|
|
1635
|
-
function N(
|
|
1636
|
-
const n =
|
|
1637
|
-
return n + a +
|
|
1642
|
+
function N(e, t = "") {
|
|
1643
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = G(Math.floor(r / 60), 2), i = G(Math.floor(r % 60), 2);
|
|
1644
|
+
return n + a + t + i;
|
|
1638
1645
|
}
|
|
1639
|
-
function
|
|
1640
|
-
return
|
|
1646
|
+
function ye(e, t) {
|
|
1647
|
+
return e % 60 === 0 ? (e > 0 ? "-" : "+") + G(Math.abs(e) / 60, 2) : N(e, t);
|
|
1641
1648
|
}
|
|
1642
|
-
function
|
|
1643
|
-
const n =
|
|
1644
|
-
return
|
|
1649
|
+
function pn(e, t = "") {
|
|
1650
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.floor(r / 60), i = r % 60;
|
|
1651
|
+
return i === 0 ? n + String(a) : n + String(a) + t + G(i, 2);
|
|
1645
1652
|
}
|
|
1646
|
-
function
|
|
1647
|
-
const
|
|
1648
|
-
return
|
|
1653
|
+
function ge(e) {
|
|
1654
|
+
const t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
|
|
1655
|
+
return t.setUTCFullYear(e.getFullYear()), +e - +t;
|
|
1649
1656
|
}
|
|
1650
|
-
const Ne = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, j = 36e5, we = 6e4,
|
|
1657
|
+
const Ne = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, j = 36e5, we = 6e4, vn = 2, g = {
|
|
1651
1658
|
dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
|
|
1652
1659
|
datePattern: /^([0-9W+-]+)(.*)/,
|
|
1653
1660
|
plainTime: /:/,
|
|
@@ -1682,62 +1689,62 @@ const Ne = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)
|
|
|
1682
1689
|
// time zone tokens (to identify the presence of a tz)
|
|
1683
1690
|
timeZone: Ne
|
|
1684
1691
|
};
|
|
1685
|
-
function
|
|
1692
|
+
function L(e, t = {}) {
|
|
1686
1693
|
if (arguments.length < 1)
|
|
1687
1694
|
throw new TypeError("1 argument required, but only " + arguments.length + " present");
|
|
1688
|
-
if (
|
|
1695
|
+
if (e === null)
|
|
1689
1696
|
return /* @__PURE__ */ new Date(NaN);
|
|
1690
|
-
const n =
|
|
1697
|
+
const n = t.additionalDigits == null ? vn : Number(t.additionalDigits);
|
|
1691
1698
|
if (n !== 2 && n !== 1 && n !== 0)
|
|
1692
1699
|
throw new RangeError("additionalDigits must be 0, 1 or 2");
|
|
1693
|
-
if (
|
|
1694
|
-
return new Date(
|
|
1695
|
-
if (typeof
|
|
1696
|
-
return new Date(
|
|
1697
|
-
if (Object.prototype.toString.call(
|
|
1700
|
+
if (e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]")
|
|
1701
|
+
return new Date(e.getTime());
|
|
1702
|
+
if (typeof e == "number" || Object.prototype.toString.call(e) === "[object Number]")
|
|
1703
|
+
return new Date(e);
|
|
1704
|
+
if (Object.prototype.toString.call(e) !== "[object String]")
|
|
1698
1705
|
return /* @__PURE__ */ new Date(NaN);
|
|
1699
|
-
const r =
|
|
1700
|
-
if (
|
|
1706
|
+
const r = xn(e), { year: a, restDateString: i } = Sn(r.date, n), s = kn(i, a);
|
|
1707
|
+
if (s === null || isNaN(s.getTime()))
|
|
1701
1708
|
return /* @__PURE__ */ new Date(NaN);
|
|
1702
|
-
if (
|
|
1703
|
-
const o =
|
|
1709
|
+
if (s) {
|
|
1710
|
+
const o = s.getTime();
|
|
1704
1711
|
let u = 0, l;
|
|
1705
1712
|
if (r.time && (u = Nn(r.time), u === null || isNaN(u)))
|
|
1706
1713
|
return /* @__PURE__ */ new Date(NaN);
|
|
1707
|
-
if (r.timeZone ||
|
|
1708
|
-
if (l =
|
|
1714
|
+
if (r.timeZone || t.timeZone) {
|
|
1715
|
+
if (l = H(r.timeZone || t.timeZone, new Date(o + u)), isNaN(l))
|
|
1709
1716
|
return /* @__PURE__ */ new Date(NaN);
|
|
1710
1717
|
} else
|
|
1711
|
-
l =
|
|
1718
|
+
l = ge(new Date(o + u)), l = ge(new Date(o + u + l));
|
|
1712
1719
|
return new Date(o + u + l);
|
|
1713
1720
|
} else
|
|
1714
1721
|
return /* @__PURE__ */ new Date(NaN);
|
|
1715
1722
|
}
|
|
1716
|
-
function
|
|
1717
|
-
const
|
|
1718
|
-
let n =
|
|
1719
|
-
if (n ? (
|
|
1720
|
-
const a =
|
|
1721
|
-
a ? (
|
|
1723
|
+
function xn(e) {
|
|
1724
|
+
const t = {};
|
|
1725
|
+
let n = g.dateTimePattern.exec(e), r;
|
|
1726
|
+
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) {
|
|
1727
|
+
const a = g.timeZone.exec(r);
|
|
1728
|
+
a ? (t.time = r.replace(a[1], ""), t.timeZone = a[1].trim()) : t.time = r;
|
|
1722
1729
|
}
|
|
1723
|
-
return
|
|
1730
|
+
return t;
|
|
1724
1731
|
}
|
|
1725
|
-
function Sn(
|
|
1726
|
-
if (
|
|
1727
|
-
const n =
|
|
1728
|
-
let a =
|
|
1732
|
+
function Sn(e, t) {
|
|
1733
|
+
if (e) {
|
|
1734
|
+
const n = g.YYY[t], r = g.YYYYY[t];
|
|
1735
|
+
let a = g.YYYY.exec(e) || r.exec(e);
|
|
1729
1736
|
if (a) {
|
|
1730
|
-
const
|
|
1737
|
+
const i = a[1];
|
|
1731
1738
|
return {
|
|
1732
|
-
year: parseInt(
|
|
1733
|
-
restDateString:
|
|
1739
|
+
year: parseInt(i, 10),
|
|
1740
|
+
restDateString: e.slice(i.length)
|
|
1734
1741
|
};
|
|
1735
1742
|
}
|
|
1736
|
-
if (a =
|
|
1737
|
-
const
|
|
1743
|
+
if (a = g.YY.exec(e) || n.exec(e), a) {
|
|
1744
|
+
const i = a[1];
|
|
1738
1745
|
return {
|
|
1739
|
-
year: parseInt(
|
|
1740
|
-
restDateString:
|
|
1746
|
+
year: parseInt(i, 10) * 100,
|
|
1747
|
+
restDateString: e.slice(i.length)
|
|
1741
1748
|
};
|
|
1742
1749
|
}
|
|
1743
1750
|
}
|
|
@@ -1745,194 +1752,202 @@ function Sn(t, e) {
|
|
|
1745
1752
|
year: null
|
|
1746
1753
|
};
|
|
1747
1754
|
}
|
|
1748
|
-
function kn(
|
|
1749
|
-
if (
|
|
1755
|
+
function kn(e, t) {
|
|
1756
|
+
if (t === null)
|
|
1750
1757
|
return null;
|
|
1751
1758
|
let n, r, a;
|
|
1752
|
-
if (!
|
|
1753
|
-
return n = /* @__PURE__ */ new Date(0), n.setUTCFullYear(
|
|
1754
|
-
let
|
|
1755
|
-
if (
|
|
1756
|
-
return n = /* @__PURE__ */ new Date(0), r = parseInt(
|
|
1757
|
-
if (
|
|
1759
|
+
if (!e || !e.length)
|
|
1760
|
+
return n = /* @__PURE__ */ new Date(0), n.setUTCFullYear(t), n;
|
|
1761
|
+
let i = g.MM.exec(e);
|
|
1762
|
+
if (i)
|
|
1763
|
+
return n = /* @__PURE__ */ new Date(0), r = parseInt(i[1], 10) - 1, Te(t, r) ? (n.setUTCFullYear(t, r), n) : /* @__PURE__ */ new Date(NaN);
|
|
1764
|
+
if (i = g.DDD.exec(e), i) {
|
|
1758
1765
|
n = /* @__PURE__ */ new Date(0);
|
|
1759
|
-
const
|
|
1760
|
-
return Pn(
|
|
1766
|
+
const s = parseInt(i[1], 10);
|
|
1767
|
+
return Pn(t, s) ? (n.setUTCFullYear(t, 0, s), n) : /* @__PURE__ */ new Date(NaN);
|
|
1761
1768
|
}
|
|
1762
|
-
if (
|
|
1763
|
-
n = /* @__PURE__ */ new Date(0), r = parseInt(
|
|
1764
|
-
const
|
|
1765
|
-
return Te(
|
|
1769
|
+
if (i = g.MMDD.exec(e), i) {
|
|
1770
|
+
n = /* @__PURE__ */ new Date(0), r = parseInt(i[1], 10) - 1;
|
|
1771
|
+
const s = parseInt(i[2], 10);
|
|
1772
|
+
return Te(t, r, s) ? (n.setUTCFullYear(t, r, s), n) : /* @__PURE__ */ new Date(NaN);
|
|
1766
1773
|
}
|
|
1767
|
-
if (
|
|
1768
|
-
return a = parseInt(
|
|
1769
|
-
if (
|
|
1770
|
-
a = parseInt(
|
|
1771
|
-
const
|
|
1772
|
-
return De(a,
|
|
1774
|
+
if (i = g.Www.exec(e), i)
|
|
1775
|
+
return a = parseInt(i[1], 10) - 1, De(a) ? _e(t, a) : /* @__PURE__ */ new Date(NaN);
|
|
1776
|
+
if (i = g.WwwD.exec(e), i) {
|
|
1777
|
+
a = parseInt(i[1], 10) - 1;
|
|
1778
|
+
const s = parseInt(i[2], 10) - 1;
|
|
1779
|
+
return De(a, s) ? _e(t, a, s) : /* @__PURE__ */ new Date(NaN);
|
|
1773
1780
|
}
|
|
1774
1781
|
return null;
|
|
1775
1782
|
}
|
|
1776
|
-
function Nn(
|
|
1777
|
-
let
|
|
1783
|
+
function Nn(e) {
|
|
1784
|
+
let t, n, r = g.HH.exec(e);
|
|
1778
1785
|
if (r)
|
|
1779
|
-
return
|
|
1780
|
-
if (r =
|
|
1781
|
-
return
|
|
1782
|
-
if (r =
|
|
1783
|
-
|
|
1786
|
+
return t = parseFloat(r[1].replace(",", ".")), Z(t) ? t % 24 * j : NaN;
|
|
1787
|
+
if (r = g.HHMM.exec(e), r)
|
|
1788
|
+
return t = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")), Z(t, n) ? t % 24 * j + n * we : NaN;
|
|
1789
|
+
if (r = g.HHMMSS.exec(e), r) {
|
|
1790
|
+
t = parseInt(r[1], 10), n = parseInt(r[2], 10);
|
|
1784
1791
|
const a = parseFloat(r[3].replace(",", "."));
|
|
1785
|
-
return Z(
|
|
1792
|
+
return Z(t, n, a) ? t % 24 * j + n * we + a * 1e3 : NaN;
|
|
1786
1793
|
}
|
|
1787
1794
|
return null;
|
|
1788
1795
|
}
|
|
1789
|
-
function _e(
|
|
1790
|
-
|
|
1796
|
+
function _e(e, t, n) {
|
|
1797
|
+
t = t || 0, n = n || 0;
|
|
1791
1798
|
const r = /* @__PURE__ */ new Date(0);
|
|
1792
|
-
r.setUTCFullYear(
|
|
1793
|
-
const a = r.getUTCDay() || 7,
|
|
1794
|
-
return r.setUTCDate(r.getUTCDate() +
|
|
1799
|
+
r.setUTCFullYear(e, 0, 4);
|
|
1800
|
+
const a = r.getUTCDay() || 7, i = t * 7 + n + 1 - a;
|
|
1801
|
+
return r.setUTCDate(r.getUTCDate() + i), r;
|
|
1795
1802
|
}
|
|
1796
1803
|
const En = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Yn = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
1797
|
-
function Ee(
|
|
1798
|
-
return
|
|
1804
|
+
function Ee(e) {
|
|
1805
|
+
return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
|
|
1799
1806
|
}
|
|
1800
|
-
function Te(
|
|
1801
|
-
if (
|
|
1807
|
+
function Te(e, t, n) {
|
|
1808
|
+
if (t < 0 || t > 11)
|
|
1802
1809
|
return !1;
|
|
1803
1810
|
if (n != null) {
|
|
1804
1811
|
if (n < 1)
|
|
1805
1812
|
return !1;
|
|
1806
|
-
const r = Ee(
|
|
1807
|
-
if (r && n > Yn[
|
|
1813
|
+
const r = Ee(e);
|
|
1814
|
+
if (r && n > Yn[t] || !r && n > En[t])
|
|
1808
1815
|
return !1;
|
|
1809
1816
|
}
|
|
1810
1817
|
return !0;
|
|
1811
1818
|
}
|
|
1812
|
-
function Pn(
|
|
1813
|
-
if (
|
|
1819
|
+
function Pn(e, t) {
|
|
1820
|
+
if (t < 1)
|
|
1814
1821
|
return !1;
|
|
1815
|
-
const n = Ee(
|
|
1816
|
-
return !(n &&
|
|
1822
|
+
const n = Ee(e);
|
|
1823
|
+
return !(n && t > 366 || !n && t > 365);
|
|
1817
1824
|
}
|
|
1818
|
-
function De(
|
|
1819
|
-
return !(
|
|
1825
|
+
function De(e, t) {
|
|
1826
|
+
return !(e < 0 || e > 52 || t != null && (t < 0 || t > 6));
|
|
1820
1827
|
}
|
|
1821
|
-
function Z(
|
|
1822
|
-
return !(
|
|
1828
|
+
function Z(e, t, n) {
|
|
1829
|
+
return !(e < 0 || e >= 25 || t != null && (t < 0 || t >= 60) || n != null && (n < 0 || n >= 60));
|
|
1823
1830
|
}
|
|
1824
1831
|
const Rn = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
|
|
1825
|
-
function In(
|
|
1826
|
-
|
|
1827
|
-
const r =
|
|
1832
|
+
function In(e, t, n = {}) {
|
|
1833
|
+
t = String(t);
|
|
1834
|
+
const r = t.match(Rn);
|
|
1828
1835
|
if (r) {
|
|
1829
|
-
const a =
|
|
1830
|
-
|
|
1831
|
-
if (
|
|
1832
|
-
return
|
|
1833
|
-
const o =
|
|
1836
|
+
const a = L(n.originalDate || e, n);
|
|
1837
|
+
t = r.reduce(function(i, s) {
|
|
1838
|
+
if (s[0] === "'")
|
|
1839
|
+
return i;
|
|
1840
|
+
const o = i.indexOf(s), u = i[o - 1] === "'", l = i.replace(s, "'" + On[s[0]](a, s, n) + "'");
|
|
1834
1841
|
return u ? l.substring(0, o - 1) + l.substring(o + 1) : l;
|
|
1835
|
-
},
|
|
1842
|
+
}, t);
|
|
1836
1843
|
}
|
|
1837
|
-
return Se(
|
|
1844
|
+
return Se(e, t, n);
|
|
1838
1845
|
}
|
|
1839
|
-
function Ye(
|
|
1840
|
-
|
|
1841
|
-
const r =
|
|
1842
|
-
return
|
|
1846
|
+
function Ye(e, t, n) {
|
|
1847
|
+
e = L(e, n);
|
|
1848
|
+
const r = H(t, e, !0), a = new Date(e.getTime() - r), i = /* @__PURE__ */ new Date(0);
|
|
1849
|
+
return i.setFullYear(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate()), i.setHours(a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds(), a.getUTCMilliseconds()), i;
|
|
1843
1850
|
}
|
|
1844
|
-
function Wn(
|
|
1851
|
+
function Wn(e, t, n, r) {
|
|
1845
1852
|
return r = {
|
|
1846
1853
|
...r,
|
|
1847
|
-
timeZone:
|
|
1848
|
-
originalDate:
|
|
1849
|
-
}, In(Ye(
|
|
1850
|
-
}
|
|
1851
|
-
function
|
|
1852
|
-
if (typeof
|
|
1853
|
-
return
|
|
1854
|
-
|
|
1855
|
-
const r = B(
|
|
1854
|
+
timeZone: t,
|
|
1855
|
+
originalDate: e
|
|
1856
|
+
}, In(Ye(e, t, { timeZone: r.timeZone }), n, r);
|
|
1857
|
+
}
|
|
1858
|
+
function Hn(e, t, n) {
|
|
1859
|
+
if (typeof e == "string" && !e.match(Ne))
|
|
1860
|
+
return L(e, { ...n, timeZone: t });
|
|
1861
|
+
e = L(e, n);
|
|
1862
|
+
const r = B(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()).getTime(), a = H(t, new Date(r));
|
|
1856
1863
|
return new Date(r + a);
|
|
1857
1864
|
}
|
|
1858
|
-
function Pe(
|
|
1859
|
-
return -
|
|
1865
|
+
function Pe(e, t) {
|
|
1866
|
+
return -H(e, t);
|
|
1860
1867
|
}
|
|
1861
|
-
function lr(
|
|
1862
|
-
return Se(
|
|
1868
|
+
function lr(e) {
|
|
1869
|
+
return Se(e, "yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
|
|
1863
1870
|
}
|
|
1864
|
-
function Me(
|
|
1865
|
-
if (!
|
|
1866
|
-
return
|
|
1867
|
-
const n =
|
|
1871
|
+
function Me(e, t = {}) {
|
|
1872
|
+
if (!e)
|
|
1873
|
+
return e;
|
|
1874
|
+
const n = t.tz || Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
1868
1875
|
try {
|
|
1869
1876
|
let r = "MMM dd, yyy hh:mm a";
|
|
1870
|
-
|
|
1871
|
-
const a = new Date(
|
|
1877
|
+
t.short && (r = "MMM dd, yyy"), t.includeTZ && (r += " (z)");
|
|
1878
|
+
const a = new Date(e);
|
|
1872
1879
|
return Wn(a, n, r);
|
|
1873
1880
|
} catch {
|
|
1874
|
-
return console.error("Invalid value passed to formatTime",
|
|
1881
|
+
return console.error("Invalid value passed to formatTime", e), "(invalid date)";
|
|
1875
1882
|
}
|
|
1876
1883
|
}
|
|
1877
|
-
function dr(
|
|
1878
|
-
return `${Me(
|
|
1884
|
+
function dr(e, t) {
|
|
1885
|
+
return `${Me(e.getTime())} - ${Me(t.getTime(), { includeTZ: !0 })}`;
|
|
1879
1886
|
}
|
|
1880
|
-
const
|
|
1887
|
+
const q = {
|
|
1881
1888
|
secondly: 1e3,
|
|
1889
|
+
tenSecondly: 10 * 1e3,
|
|
1890
|
+
thirtySecondly: 30 * 1e3,
|
|
1882
1891
|
minutely: 60 * 1e3,
|
|
1892
|
+
fiveMinutely: 5 * 60 * 1e3,
|
|
1893
|
+
tenMinutely: 10 * 60 * 1e3,
|
|
1894
|
+
thirtyMinutely: 30 * 60 * 1e3,
|
|
1883
1895
|
hourly: 60 * 60 * 1e3,
|
|
1896
|
+
twoHourly: 2 * 60 * 60 * 1e3,
|
|
1897
|
+
twelveHourly: 12 * 60 * 60 * 1e3,
|
|
1884
1898
|
daily: 60 * 60 * 24 * 1e3,
|
|
1885
1899
|
weekly: 60 * 60 * 24 * 7 * 1e3,
|
|
1886
1900
|
trend: 0
|
|
1887
1901
|
};
|
|
1888
|
-
function fr(
|
|
1889
|
-
return
|
|
1902
|
+
function fr(e, t) {
|
|
1903
|
+
return e.map((n) => ({
|
|
1890
1904
|
value: n,
|
|
1891
|
-
label:
|
|
1905
|
+
label: t.t(`configuration.vitals.reports.granularity.${n}`)
|
|
1892
1906
|
}));
|
|
1893
1907
|
}
|
|
1894
|
-
function
|
|
1895
|
-
return
|
|
1896
|
-
duration:
|
|
1908
|
+
function Fn(e, t) {
|
|
1909
|
+
return {
|
|
1910
|
+
duration: e,
|
|
1897
1911
|
type: "duration",
|
|
1898
|
-
origin:
|
|
1899
|
-
}
|
|
1912
|
+
origin: t
|
|
1913
|
+
};
|
|
1900
1914
|
}
|
|
1901
|
-
function mr(
|
|
1902
|
-
return
|
|
1915
|
+
function mr(e) {
|
|
1916
|
+
return e && Ce.find((n) => e <= q[n]) || null;
|
|
1903
1917
|
}
|
|
1904
|
-
function Re(
|
|
1905
|
-
const a =
|
|
1906
|
-
let
|
|
1907
|
-
return a >=
|
|
1918
|
+
function Re(e, t, n, r) {
|
|
1919
|
+
const a = q[n];
|
|
1920
|
+
let i = 0;
|
|
1921
|
+
return a >= q.daily && (r ? i = -Pe(r, t) : i = t.getTimezoneOffset() * 60 * 1e3), new Date(e((t.getTime() - i) / a) * a + i);
|
|
1908
1922
|
}
|
|
1909
|
-
function
|
|
1910
|
-
return Re(Math.floor,
|
|
1923
|
+
function Cn(e, t, n) {
|
|
1924
|
+
return Re(Math.floor, e, t, n);
|
|
1911
1925
|
}
|
|
1912
|
-
function Ie(
|
|
1913
|
-
return Re(Math.ceil,
|
|
1926
|
+
function Ie(e, t, n) {
|
|
1927
|
+
return Re(Math.ceil, e, t, n);
|
|
1914
1928
|
}
|
|
1915
|
-
class
|
|
1916
|
-
constructor(
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1929
|
+
class U {
|
|
1930
|
+
constructor(t, n, r) {
|
|
1931
|
+
h(this, "timeframe");
|
|
1932
|
+
h(this, "tz");
|
|
1933
|
+
h(this, "dataGranularity");
|
|
1934
|
+
if (this.constructor === U)
|
|
1920
1935
|
throw new Error("BaseQueryTime is not meant to be used directly.");
|
|
1921
|
-
this.timeframe =
|
|
1936
|
+
this.timeframe = t, this.tz = n, this.dataGranularity = r ?? t.dataGranularity;
|
|
1922
1937
|
}
|
|
1923
|
-
calculateStartDate(
|
|
1924
|
-
if (
|
|
1938
|
+
calculateStartDate(t, n, r = 1) {
|
|
1939
|
+
if (t)
|
|
1925
1940
|
return new Date(this.endDate().getTime() - this.timeframe.timeframeLengthMs() * r);
|
|
1926
1941
|
{
|
|
1927
|
-
const a = this.endDate(),
|
|
1928
|
-
return new Date(
|
|
1942
|
+
const a = this.endDate(), i = this.timeframe.rawStart(this.tz), s = Cn(i, n, this.tz), u = (a.getTime() - s.getTime()) * (r - 1);
|
|
1943
|
+
return new Date(s.getTime() - u);
|
|
1929
1944
|
}
|
|
1930
1945
|
}
|
|
1931
1946
|
granularitySeconds() {
|
|
1932
1947
|
return Math.floor(this.granularityMs() / 1e3);
|
|
1933
1948
|
}
|
|
1934
1949
|
granularityDruid() {
|
|
1935
|
-
return
|
|
1950
|
+
return Fn(this.granularityMs(), this.startDate().toISOString());
|
|
1936
1951
|
}
|
|
1937
1952
|
// Return a UNIX timestamp suitable for use in the `start` query param.
|
|
1938
1953
|
startSeconds() {
|
|
@@ -1951,11 +1966,17 @@ class z {
|
|
|
1951
1966
|
return ue(this.endDate());
|
|
1952
1967
|
}
|
|
1953
1968
|
}
|
|
1954
|
-
class hr extends
|
|
1955
|
-
constructor(n, r, a) {
|
|
1956
|
-
super(n, a);
|
|
1957
|
-
|
|
1958
|
-
r && n.allowedGranularities().has(r)
|
|
1969
|
+
class hr extends U {
|
|
1970
|
+
constructor(n, r, a, i, s) {
|
|
1971
|
+
super(n, a, i);
|
|
1972
|
+
h(this, "granularity");
|
|
1973
|
+
if (r && n.allowedGranularities(s).has(r))
|
|
1974
|
+
this.granularity = r;
|
|
1975
|
+
else if (s) {
|
|
1976
|
+
const o = n.allowedGranularities(s).keys().next().value;
|
|
1977
|
+
this.granularity = o ?? n.defaultResponseGranularity;
|
|
1978
|
+
} else
|
|
1979
|
+
this.granularity = n.defaultResponseGranularity;
|
|
1959
1980
|
}
|
|
1960
1981
|
startDate() {
|
|
1961
1982
|
return this.calculateStartDate(this.timeframe.isRelative, this.granularity);
|
|
@@ -1964,63 +1985,64 @@ class hr extends z {
|
|
|
1964
1985
|
return Ie(this.timeframe.rawEnd(), this.granularity, this.tz);
|
|
1965
1986
|
}
|
|
1966
1987
|
granularityMs() {
|
|
1967
|
-
return
|
|
1988
|
+
return q[this.granularity];
|
|
1968
1989
|
}
|
|
1969
1990
|
}
|
|
1970
|
-
class
|
|
1991
|
+
class Gn extends U {
|
|
1971
1992
|
startDate() {
|
|
1972
|
-
return this.calculateStartDate(this.timeframe.isRelative, this.
|
|
1993
|
+
return this.calculateStartDate(this.timeframe.isRelative, this.dataGranularity);
|
|
1973
1994
|
}
|
|
1974
1995
|
endDate() {
|
|
1975
|
-
return Ie(this.timeframe.rawEnd(this.tz), this.
|
|
1996
|
+
return Ie(this.timeframe.rawEnd(this.tz), this.dataGranularity, this.tz);
|
|
1976
1997
|
}
|
|
1977
1998
|
granularityMs() {
|
|
1978
1999
|
return this.endDate().getTime() - this.startDate().getTime();
|
|
1979
2000
|
}
|
|
1980
2001
|
}
|
|
1981
|
-
class
|
|
2002
|
+
class yr extends Gn {
|
|
1982
2003
|
startDate() {
|
|
1983
|
-
return this.calculateStartDate(this.timeframe.isRelative, this.
|
|
2004
|
+
return this.calculateStartDate(this.timeframe.isRelative, this.dataGranularity, 2);
|
|
1984
2005
|
}
|
|
1985
2006
|
granularityMs() {
|
|
1986
2007
|
return this.endDate().getTime() - super.startDate().getTime();
|
|
1987
2008
|
}
|
|
1988
2009
|
}
|
|
1989
|
-
const Y = (
|
|
2010
|
+
const Y = (e, t) => new Date(e.getTime() - Pe(t, e));
|
|
1990
2011
|
class T {
|
|
1991
|
-
constructor(
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
2012
|
+
constructor(t) {
|
|
2013
|
+
h(this, "timeframeText");
|
|
2014
|
+
h(this, "key");
|
|
2015
|
+
h(this, "display");
|
|
2016
|
+
h(this, "timeframeLength");
|
|
2017
|
+
h(this, "allowedTiers");
|
|
1997
2018
|
// defaultResponseGranularity tracks which of the allowed granularities is picked for a given
|
|
1998
2019
|
// timeframe if the user does not or cannot specify a granularity.
|
|
1999
|
-
|
|
2020
|
+
h(this, "defaultResponseGranularity");
|
|
2000
2021
|
// dataGranularity tracks the granularity of the available data on the server for a specific timeframe.
|
|
2001
2022
|
// As of writing, it's always the same as the default response granularity, but it may not always be.
|
|
2002
2023
|
// It controls how timeframes are rounded to ensure complete time buckets from the server.
|
|
2003
|
-
|
|
2024
|
+
h(this, "dataGranularity");
|
|
2004
2025
|
// isRelative impacts whether we take the `floor` or the `ceil` of the start time.
|
|
2005
2026
|
// If the time range is relative, we want the ceil -- because we take the ceil of the
|
|
2006
2027
|
// end time to make sure we're showing all the data we can for the last time bucket.
|
|
2007
2028
|
// If the time range is absolute, we want the floor -- because otherwise we wouldn't be including
|
|
2008
2029
|
// the first time bucket.
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
this
|
|
2030
|
+
h(this, "isRelative");
|
|
2031
|
+
h(this, "_startCustom");
|
|
2032
|
+
h(this, "_endCustom");
|
|
2033
|
+
h(this, "_allowedGranularitiesOverride");
|
|
2034
|
+
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;
|
|
2013
2035
|
}
|
|
2014
2036
|
// rawEnd does not consider granularity and should not be used directly in queries.
|
|
2015
2037
|
// Use `new QueryTime(timeframe, granularity?).queryEndSeconds()` instead.
|
|
2016
2038
|
// eslint-disable-next-line -- `tz` is required because it's used in subclasses.
|
|
2017
|
-
rawEnd(
|
|
2039
|
+
rawEnd(t) {
|
|
2018
2040
|
return this._endCustom || /* @__PURE__ */ new Date();
|
|
2019
2041
|
}
|
|
2020
2042
|
// rawStart does not consider granularity and should not be used directly in queries.
|
|
2021
2043
|
// Use `new QueryTime(timeframe, granularity?).queryStartSeconds()` instead.
|
|
2022
2044
|
// eslint-disable-next-line -- `tz` is required because it's used in subclasses.
|
|
2023
|
-
rawStart(
|
|
2045
|
+
rawStart(t) {
|
|
2024
2046
|
return this._startCustom || new Date(this.rawEnd().getTime() - this.timeframeLengthMs());
|
|
2025
2047
|
}
|
|
2026
2048
|
timeframeLengthMs() {
|
|
@@ -2029,71 +2051,73 @@ class T {
|
|
|
2029
2051
|
maximumTimeframeLength() {
|
|
2030
2052
|
return this.timeframeLength();
|
|
2031
2053
|
}
|
|
2032
|
-
allowedGranularities() {
|
|
2033
|
-
|
|
2034
|
-
|
|
2054
|
+
allowedGranularities(t) {
|
|
2055
|
+
if (this._allowedGranularitiesOverride && t)
|
|
2056
|
+
return new Set(this._allowedGranularitiesOverride);
|
|
2057
|
+
const n = /* @__PURE__ */ new Set(), r = this.maximumTimeframeLength() / 3600;
|
|
2058
|
+
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;
|
|
2035
2059
|
}
|
|
2036
2060
|
cacheKey() {
|
|
2037
2061
|
return this.key !== "custom" ? this.key : `${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`;
|
|
2038
2062
|
}
|
|
2039
|
-
v4Query(
|
|
2063
|
+
v4Query(t) {
|
|
2040
2064
|
return this.key === "custom" ? {
|
|
2041
2065
|
type: "absolute",
|
|
2042
2066
|
start: this.rawStart(),
|
|
2043
2067
|
end: this.rawEnd(),
|
|
2044
|
-
tz:
|
|
2068
|
+
tz: t
|
|
2045
2069
|
} : {
|
|
2046
2070
|
type: "relative",
|
|
2047
2071
|
time_range: this.key,
|
|
2048
|
-
tz:
|
|
2072
|
+
tz: t
|
|
2049
2073
|
};
|
|
2050
2074
|
}
|
|
2051
|
-
tzAdjustedDate(
|
|
2052
|
-
if (!
|
|
2075
|
+
tzAdjustedDate(t) {
|
|
2076
|
+
if (!t)
|
|
2053
2077
|
return /* @__PURE__ */ new Date();
|
|
2054
|
-
const n =
|
|
2055
|
-
return Ye(n,
|
|
2078
|
+
const n = Hn(/* @__PURE__ */ new Date(), new Intl.DateTimeFormat().resolvedOptions().timeZone);
|
|
2079
|
+
return Ye(n, t);
|
|
2056
2080
|
}
|
|
2057
2081
|
}
|
|
2058
|
-
class
|
|
2059
|
-
rawStart(
|
|
2060
|
-
let n =
|
|
2061
|
-
return
|
|
2082
|
+
class Ln extends T {
|
|
2083
|
+
rawStart(t) {
|
|
2084
|
+
let n = p(this.tzAdjustedDate(t), { weekStartsOn: 1 });
|
|
2085
|
+
return t && (n = Y(n, t)), n;
|
|
2062
2086
|
}
|
|
2063
2087
|
maximumTimeframeLength() {
|
|
2064
2088
|
return 60 * 60 * 24 * 7;
|
|
2065
2089
|
}
|
|
2066
2090
|
}
|
|
2067
|
-
class
|
|
2068
|
-
rawStart(
|
|
2069
|
-
let n = E(this.tzAdjustedDate(
|
|
2070
|
-
return
|
|
2091
|
+
class qn extends T {
|
|
2092
|
+
rawStart(t) {
|
|
2093
|
+
let n = E(this.tzAdjustedDate(t));
|
|
2094
|
+
return t && (n = Y(n, t)), n;
|
|
2071
2095
|
}
|
|
2072
2096
|
maximumTimeframeLength() {
|
|
2073
2097
|
return 60 * 60 * 24 * 31;
|
|
2074
2098
|
}
|
|
2075
2099
|
}
|
|
2076
|
-
class
|
|
2077
|
-
rawEnd(
|
|
2078
|
-
let n =
|
|
2079
|
-
return
|
|
2100
|
+
class Un extends T {
|
|
2101
|
+
rawEnd(t) {
|
|
2102
|
+
let n = p(this.tzAdjustedDate(t), { weekStartsOn: 1 });
|
|
2103
|
+
return t && (n = Y(n, t)), n;
|
|
2080
2104
|
}
|
|
2081
|
-
rawStart(
|
|
2082
|
-
const n = this.tzAdjustedDate(
|
|
2083
|
-
let r =
|
|
2105
|
+
rawStart(t) {
|
|
2106
|
+
const n = this.tzAdjustedDate(t);
|
|
2107
|
+
let r = p(n.setDate(n.getDate() - 7), {
|
|
2084
2108
|
weekStartsOn: 1
|
|
2085
2109
|
});
|
|
2086
|
-
return
|
|
2110
|
+
return t && (r = Y(r, t)), r;
|
|
2087
2111
|
}
|
|
2088
2112
|
}
|
|
2089
|
-
class
|
|
2090
|
-
rawEnd(
|
|
2091
|
-
let n = E(this.tzAdjustedDate(
|
|
2092
|
-
return
|
|
2113
|
+
class zn extends T {
|
|
2114
|
+
rawEnd(t) {
|
|
2115
|
+
let n = E(this.tzAdjustedDate(t));
|
|
2116
|
+
return t && (n = Y(n, t)), n;
|
|
2093
2117
|
}
|
|
2094
|
-
rawStart(
|
|
2095
|
-
let n = E(ke(this.tzAdjustedDate(
|
|
2096
|
-
return
|
|
2118
|
+
rawStart(t) {
|
|
2119
|
+
let n = E(ke(this.tzAdjustedDate(t), 1));
|
|
2120
|
+
return t && (n = Y(n, t)), n;
|
|
2097
2121
|
}
|
|
2098
2122
|
}
|
|
2099
2123
|
const An = /* @__PURE__ */ new Map([
|
|
@@ -2107,7 +2131,8 @@ const An = /* @__PURE__ */ new Map([
|
|
|
2107
2131
|
defaultResponseGranularity: "minutely",
|
|
2108
2132
|
dataGranularity: "minutely",
|
|
2109
2133
|
isRelative: !0,
|
|
2110
|
-
allowedTiers: ["free", "trial", "plus", "enterprise"]
|
|
2134
|
+
allowedTiers: ["free", "trial", "plus", "enterprise"],
|
|
2135
|
+
allowedGranularitiesOverride: ["tenSecondly", "thirtySecondly", "minutely"]
|
|
2111
2136
|
})
|
|
2112
2137
|
],
|
|
2113
2138
|
[
|
|
@@ -2120,7 +2145,8 @@ const An = /* @__PURE__ */ new Map([
|
|
|
2120
2145
|
defaultResponseGranularity: "minutely",
|
|
2121
2146
|
dataGranularity: "minutely",
|
|
2122
2147
|
isRelative: !0,
|
|
2123
|
-
allowedTiers: ["free", "trial", "plus", "enterprise"]
|
|
2148
|
+
allowedTiers: ["free", "trial", "plus", "enterprise"],
|
|
2149
|
+
allowedGranularitiesOverride: ["tenSecondly", "thirtySecondly", "minutely", "fiveMinutely", "tenMinutely"]
|
|
2124
2150
|
})
|
|
2125
2151
|
],
|
|
2126
2152
|
[
|
|
@@ -2133,7 +2159,8 @@ const An = /* @__PURE__ */ new Map([
|
|
|
2133
2159
|
defaultResponseGranularity: "hourly",
|
|
2134
2160
|
dataGranularity: "hourly",
|
|
2135
2161
|
isRelative: !0,
|
|
2136
|
-
allowedTiers: ["free", "trial", "plus", "enterprise"]
|
|
2162
|
+
allowedTiers: ["free", "trial", "plus", "enterprise"],
|
|
2163
|
+
allowedGranularitiesOverride: ["thirtySecondly", "minutely", "fiveMinutely", "tenMinutely", "thirtyMinutely"]
|
|
2137
2164
|
})
|
|
2138
2165
|
],
|
|
2139
2166
|
[
|
|
@@ -2146,7 +2173,8 @@ const An = /* @__PURE__ */ new Map([
|
|
|
2146
2173
|
defaultResponseGranularity: "hourly",
|
|
2147
2174
|
dataGranularity: "hourly",
|
|
2148
2175
|
isRelative: !0,
|
|
2149
|
-
allowedTiers: ["free", "trial", "plus", "enterprise"]
|
|
2176
|
+
allowedTiers: ["free", "trial", "plus", "enterprise"],
|
|
2177
|
+
allowedGranularitiesOverride: ["minutely", "fiveMinutely", "tenMinutely", "thirtyMinutely", "hourly"]
|
|
2150
2178
|
})
|
|
2151
2179
|
],
|
|
2152
2180
|
[
|
|
@@ -2159,7 +2187,8 @@ const An = /* @__PURE__ */ new Map([
|
|
|
2159
2187
|
defaultResponseGranularity: "hourly",
|
|
2160
2188
|
dataGranularity: "hourly",
|
|
2161
2189
|
isRelative: !0,
|
|
2162
|
-
allowedTiers: ["free", "trial", "plus", "enterprise"]
|
|
2190
|
+
allowedTiers: ["free", "trial", "plus", "enterprise"],
|
|
2191
|
+
allowedGranularitiesOverride: ["fiveMinutely", "tenMinutely", "thirtyMinutely", "hourly"]
|
|
2163
2192
|
})
|
|
2164
2193
|
],
|
|
2165
2194
|
[
|
|
@@ -2172,7 +2201,8 @@ const An = /* @__PURE__ */ new Map([
|
|
|
2172
2201
|
defaultResponseGranularity: "daily",
|
|
2173
2202
|
dataGranularity: "daily",
|
|
2174
2203
|
isRelative: !0,
|
|
2175
|
-
allowedTiers: ["trial", "plus", "enterprise"]
|
|
2204
|
+
allowedTiers: ["trial", "plus", "enterprise"],
|
|
2205
|
+
allowedGranularitiesOverride: ["thirtyMinutely", "hourly", "twoHourly", "twelveHourly", "daily"]
|
|
2176
2206
|
})
|
|
2177
2207
|
],
|
|
2178
2208
|
[
|
|
@@ -2185,18 +2215,19 @@ const An = /* @__PURE__ */ new Map([
|
|
|
2185
2215
|
defaultResponseGranularity: "daily",
|
|
2186
2216
|
dataGranularity: "daily",
|
|
2187
2217
|
isRelative: !0,
|
|
2188
|
-
allowedTiers: ["trial", "plus", "enterprise"]
|
|
2218
|
+
allowedTiers: ["trial", "plus", "enterprise"],
|
|
2219
|
+
allowedGranularitiesOverride: ["hourly", "twoHourly", "twelveHourly", "daily", "weekly"]
|
|
2189
2220
|
})
|
|
2190
2221
|
],
|
|
2191
2222
|
[
|
|
2192
2223
|
m.CURRENT_WEEK,
|
|
2193
|
-
new
|
|
2224
|
+
new Ln({
|
|
2194
2225
|
key: m.CURRENT_WEEK,
|
|
2195
2226
|
display: "This week",
|
|
2196
2227
|
timeframeText: "Week",
|
|
2197
2228
|
timeframeLength: () => {
|
|
2198
|
-
const
|
|
2199
|
-
return (
|
|
2229
|
+
const e = p(/* @__PURE__ */ new Date(), { weekStartsOn: 1 });
|
|
2230
|
+
return (C(ne(/* @__PURE__ */ new Date(), 1)).getTime() - e.getTime()) / 1e3;
|
|
2200
2231
|
},
|
|
2201
2232
|
defaultResponseGranularity: "daily",
|
|
2202
2233
|
dataGranularity: "daily",
|
|
@@ -2206,13 +2237,13 @@ const An = /* @__PURE__ */ new Map([
|
|
|
2206
2237
|
],
|
|
2207
2238
|
[
|
|
2208
2239
|
m.CURRENT_MONTH,
|
|
2209
|
-
new
|
|
2240
|
+
new qn({
|
|
2210
2241
|
key: m.CURRENT_MONTH,
|
|
2211
2242
|
display: "This month",
|
|
2212
2243
|
timeframeText: "Month",
|
|
2213
2244
|
timeframeLength: () => {
|
|
2214
|
-
const
|
|
2215
|
-
return (
|
|
2245
|
+
const e = E(/* @__PURE__ */ new Date());
|
|
2246
|
+
return (C(ne(/* @__PURE__ */ new Date(), 1)).getTime() - e.getTime()) / 1e3;
|
|
2216
2247
|
},
|
|
2217
2248
|
defaultResponseGranularity: "daily",
|
|
2218
2249
|
dataGranularity: "daily",
|
|
@@ -2222,7 +2253,7 @@ const An = /* @__PURE__ */ new Map([
|
|
|
2222
2253
|
],
|
|
2223
2254
|
[
|
|
2224
2255
|
m.PREVIOUS_WEEK,
|
|
2225
|
-
new
|
|
2256
|
+
new Un({
|
|
2226
2257
|
key: m.PREVIOUS_WEEK,
|
|
2227
2258
|
display: "Previous week",
|
|
2228
2259
|
timeframeText: "Week",
|
|
@@ -2235,14 +2266,14 @@ const An = /* @__PURE__ */ new Map([
|
|
|
2235
2266
|
],
|
|
2236
2267
|
[
|
|
2237
2268
|
m.PREVIOUS_MONTH,
|
|
2238
|
-
new
|
|
2269
|
+
new zn({
|
|
2239
2270
|
key: m.PREVIOUS_MONTH,
|
|
2240
2271
|
display: "Previous month",
|
|
2241
2272
|
timeframeText: "Month",
|
|
2242
2273
|
timeframeLength: () => {
|
|
2243
|
-
let
|
|
2244
|
-
const
|
|
2245
|
-
return
|
|
2274
|
+
let e = 0;
|
|
2275
|
+
const t = E(/* @__PURE__ */ new Date()), n = E(ke(/* @__PURE__ */ new Date(), 1));
|
|
2276
|
+
return t.getTimezoneOffset() !== n.getTimezoneOffset() && (e = Xn(t, n)), 60 * 60 * 24 * an((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() - 1)) + on(e);
|
|
2246
2277
|
},
|
|
2247
2278
|
defaultResponseGranularity: "daily",
|
|
2248
2279
|
dataGranularity: "daily",
|
|
@@ -2251,13 +2282,13 @@ const An = /* @__PURE__ */ new Map([
|
|
|
2251
2282
|
})
|
|
2252
2283
|
]
|
|
2253
2284
|
]);
|
|
2254
|
-
function
|
|
2255
|
-
const
|
|
2256
|
-
return
|
|
2285
|
+
function gr(e) {
|
|
2286
|
+
const t = new Date(e.start), n = new Date(e.end), r = (n.getTime() - t.getTime()) / 1e3;
|
|
2287
|
+
return e.timePeriodsKey && An.get(e.timePeriodsKey) || new T({
|
|
2257
2288
|
key: "custom",
|
|
2258
2289
|
timeframeText: "custom",
|
|
2259
2290
|
display: "custom",
|
|
2260
|
-
startCustom:
|
|
2291
|
+
startCustom: t,
|
|
2261
2292
|
endCustom: n,
|
|
2262
2293
|
timeframeLength: () => r,
|
|
2263
2294
|
defaultResponseGranularity: "daily",
|
|
@@ -2266,54 +2297,54 @@ function yr(t) {
|
|
|
2266
2297
|
allowedTiers: ["free", "plus", "enterprise"]
|
|
2267
2298
|
});
|
|
2268
2299
|
}
|
|
2269
|
-
function wr(
|
|
2300
|
+
function wr(e) {
|
|
2270
2301
|
return {
|
|
2271
|
-
...
|
|
2272
|
-
start:
|
|
2273
|
-
end:
|
|
2302
|
+
...e.key !== "custom" && { timePeriodsKey: e.key },
|
|
2303
|
+
start: e.rawStart(),
|
|
2304
|
+
end: e.rawEnd()
|
|
2274
2305
|
};
|
|
2275
2306
|
}
|
|
2276
|
-
function _r(
|
|
2307
|
+
function _r(e) {
|
|
2277
2308
|
return {
|
|
2278
|
-
key:
|
|
2279
|
-
display:
|
|
2280
|
-
timeframeText:
|
|
2281
|
-
timeframeLength: () =>
|
|
2309
|
+
key: e.key,
|
|
2310
|
+
display: e.display,
|
|
2311
|
+
timeframeText: e.timeframeText,
|
|
2312
|
+
timeframeLength: () => e.key,
|
|
2282
2313
|
// Used to generate test IDs for the Kongponent.
|
|
2283
|
-
start: () =>
|
|
2284
|
-
end: () =>
|
|
2314
|
+
start: () => e.rawStart(),
|
|
2315
|
+
end: () => e.rawEnd()
|
|
2285
2316
|
};
|
|
2286
2317
|
}
|
|
2287
|
-
function Xn(
|
|
2288
|
-
return un(
|
|
2318
|
+
function Xn(e, t) {
|
|
2319
|
+
return un(e.getTimezoneOffset() - t.getTimezoneOffset());
|
|
2289
2320
|
}
|
|
2290
2321
|
class J {
|
|
2291
|
-
constructor(
|
|
2292
|
-
|
|
2293
|
-
this._seed =
|
|
2322
|
+
constructor(t) {
|
|
2323
|
+
h(this, "_seed");
|
|
2324
|
+
this._seed = t;
|
|
2294
2325
|
}
|
|
2295
|
-
next(
|
|
2326
|
+
next(t, n) {
|
|
2296
2327
|
const r = Math.sin(this._seed++) * 1e4, a = r - Math.floor(r);
|
|
2297
|
-
return Math.floor(a * (n -
|
|
2328
|
+
return Math.floor(a * (n - t + 1)) + t;
|
|
2298
2329
|
}
|
|
2299
2330
|
}
|
|
2300
|
-
const Tr = (
|
|
2301
|
-
const n = We(10, 1e4), r = new J(n), a = Date.now() - 6 * 60 * 60 * 1e3,
|
|
2331
|
+
const Tr = (e, t) => {
|
|
2332
|
+
const n = We(10, 1e4), r = new J(n), a = Date.now() - 6 * 60 * 60 * 1e3, i = Date.now(), s = [];
|
|
2302
2333
|
let o = 0;
|
|
2303
|
-
for (let c = a; c <=
|
|
2304
|
-
if (
|
|
2305
|
-
for (const d in
|
|
2306
|
-
|
|
2334
|
+
for (let c = a; c <= i; c += 60 * 60 * 1e3)
|
|
2335
|
+
if (t)
|
|
2336
|
+
for (const d in t)
|
|
2337
|
+
t[d].forEach((b) => {
|
|
2307
2338
|
o += r.next(50, 500);
|
|
2308
2339
|
const M = {
|
|
2309
2340
|
[d]: b,
|
|
2310
|
-
[
|
|
2311
|
-
},
|
|
2341
|
+
[e.name]: o
|
|
2342
|
+
}, O = {
|
|
2312
2343
|
version: "1.0",
|
|
2313
2344
|
timestamp: new Date(c).toISOString(),
|
|
2314
2345
|
event: M
|
|
2315
2346
|
};
|
|
2316
|
-
|
|
2347
|
+
s.push(O);
|
|
2317
2348
|
});
|
|
2318
2349
|
else {
|
|
2319
2350
|
o += r.next(50, 500);
|
|
@@ -2321,15 +2352,15 @@ const Tr = (t, e) => {
|
|
|
2321
2352
|
version: "1.0",
|
|
2322
2353
|
timestamp: new Date(c).toISOString(),
|
|
2323
2354
|
event: {
|
|
2324
|
-
[
|
|
2355
|
+
[e.name]: o
|
|
2325
2356
|
}
|
|
2326
2357
|
};
|
|
2327
|
-
|
|
2358
|
+
s.push(d);
|
|
2328
2359
|
}
|
|
2329
2360
|
const u = {};
|
|
2330
|
-
if (
|
|
2331
|
-
for (const c in
|
|
2332
|
-
u[c] = {},
|
|
2361
|
+
if (t)
|
|
2362
|
+
for (const c in t)
|
|
2363
|
+
u[c] = {}, t[c].forEach((d) => {
|
|
2333
2364
|
u[c][d] = {
|
|
2334
2365
|
name: d,
|
|
2335
2366
|
deleted: !1
|
|
@@ -2337,57 +2368,57 @@ const Tr = (t, e) => {
|
|
|
2337
2368
|
});
|
|
2338
2369
|
const l = {
|
|
2339
2370
|
start_ms: a,
|
|
2340
|
-
end_ms:
|
|
2371
|
+
end_ms: i,
|
|
2341
2372
|
query_id: "12345",
|
|
2342
|
-
metric_names: [
|
|
2373
|
+
metric_names: [e.name],
|
|
2343
2374
|
metric_units: {
|
|
2344
|
-
[
|
|
2375
|
+
[e.name]: e.unit
|
|
2345
2376
|
},
|
|
2346
2377
|
granularity_ms: 60 * 60 * 1e3,
|
|
2347
2378
|
// 1 hour in ms
|
|
2348
2379
|
display: u
|
|
2349
2380
|
};
|
|
2350
2381
|
return {
|
|
2351
|
-
data:
|
|
2382
|
+
data: s,
|
|
2352
2383
|
meta: l
|
|
2353
2384
|
};
|
|
2354
|
-
}, Dr = (
|
|
2355
|
-
const
|
|
2356
|
-
|
|
2357
|
-
|
|
2385
|
+
}, Dr = (e) => {
|
|
2386
|
+
const t = We(10, 1e4), n = new J(t), r = Date.now() - 6 * 60 * 60 * 1e3, a = Date.now(), i = [], s = {};
|
|
2387
|
+
e.forEach((u) => {
|
|
2388
|
+
s[u.name] = 0;
|
|
2358
2389
|
});
|
|
2359
2390
|
for (let u = r; u <= a; u += 60 * 60 * 1e3) {
|
|
2360
2391
|
const l = {};
|
|
2361
|
-
|
|
2362
|
-
|
|
2392
|
+
e.forEach((d) => {
|
|
2393
|
+
s[d.name] += n.next(50, 500), l[d.name] = s[d.name];
|
|
2363
2394
|
});
|
|
2364
2395
|
const c = {
|
|
2365
2396
|
version: "1.0",
|
|
2366
2397
|
timestamp: new Date(u).toISOString(),
|
|
2367
2398
|
event: l
|
|
2368
2399
|
};
|
|
2369
|
-
|
|
2400
|
+
i.push(c);
|
|
2370
2401
|
}
|
|
2371
2402
|
const o = {
|
|
2372
2403
|
start_ms: r,
|
|
2373
2404
|
end_ms: a,
|
|
2374
2405
|
query_id: "12345",
|
|
2375
|
-
metric_names:
|
|
2376
|
-
metric_units:
|
|
2406
|
+
metric_names: e.map((u) => u.name),
|
|
2407
|
+
metric_units: e.reduce((u, l) => (u[l.name] = l.unit, u), {}),
|
|
2377
2408
|
granularity_ms: 60 * 60 * 1e3,
|
|
2378
2409
|
// 1 hour in ms
|
|
2379
2410
|
display: {}
|
|
2380
2411
|
};
|
|
2381
2412
|
return {
|
|
2382
|
-
data:
|
|
2413
|
+
data: i,
|
|
2383
2414
|
meta: o
|
|
2384
2415
|
};
|
|
2385
|
-
}, Mr = (
|
|
2386
|
-
const n = Math.floor(Math.random() * 9991) + 10, r = new J(n), a = Date.now() - 6 * 60 * 60 * 1e3,
|
|
2387
|
-
if (
|
|
2388
|
-
const c = Object.keys(
|
|
2389
|
-
if (
|
|
2390
|
-
|
|
2416
|
+
}, Mr = (e, t) => {
|
|
2417
|
+
const n = Math.floor(Math.random() * 9991) + 10, r = new J(n), a = Date.now() - 6 * 60 * 60 * 1e3, i = Date.now(), s = new Date((a + i) / 2).toISOString(), o = [];
|
|
2418
|
+
if (t) {
|
|
2419
|
+
const c = Object.keys(t), d = Object.values(t), b = (M, O) => {
|
|
2420
|
+
if (O === c.length) {
|
|
2421
|
+
e.forEach((S) => {
|
|
2391
2422
|
M[S.name] = r.next(50, 500);
|
|
2392
2423
|
}), o.push({
|
|
2393
2424
|
version: "1.0",
|
|
@@ -2396,25 +2427,25 @@ const Tr = (t, e) => {
|
|
|
2396
2427
|
});
|
|
2397
2428
|
return;
|
|
2398
2429
|
}
|
|
2399
|
-
d[
|
|
2400
|
-
b({ ...M, [c[
|
|
2430
|
+
d[O].forEach((S) => {
|
|
2431
|
+
b({ ...M, [c[O]]: S }, O + 1);
|
|
2401
2432
|
});
|
|
2402
2433
|
};
|
|
2403
2434
|
b({}, 0);
|
|
2404
2435
|
} else {
|
|
2405
2436
|
const c = {};
|
|
2406
|
-
|
|
2437
|
+
e.forEach((d) => {
|
|
2407
2438
|
c[d.name] = r.next(50, 500);
|
|
2408
2439
|
}), o.push({
|
|
2409
2440
|
version: "1.0",
|
|
2410
|
-
timestamp:
|
|
2441
|
+
timestamp: s,
|
|
2411
2442
|
event: c
|
|
2412
2443
|
});
|
|
2413
2444
|
}
|
|
2414
2445
|
const u = {};
|
|
2415
|
-
if (
|
|
2416
|
-
for (const c in
|
|
2417
|
-
u[c] = {},
|
|
2446
|
+
if (t)
|
|
2447
|
+
for (const c in t)
|
|
2448
|
+
u[c] = {}, t[c].forEach((d) => {
|
|
2418
2449
|
u[c][d] = {
|
|
2419
2450
|
name: d,
|
|
2420
2451
|
deleted: !1
|
|
@@ -2422,48 +2453,48 @@ const Tr = (t, e) => {
|
|
|
2422
2453
|
});
|
|
2423
2454
|
const l = {
|
|
2424
2455
|
start_ms: a,
|
|
2425
|
-
end_ms:
|
|
2456
|
+
end_ms: i,
|
|
2426
2457
|
query_id: "12345",
|
|
2427
|
-
metric_names:
|
|
2428
|
-
metric_units:
|
|
2458
|
+
metric_names: e.map((c) => c.name),
|
|
2459
|
+
metric_units: e.reduce((c, d) => (c[d.name] = d.unit, c), {}),
|
|
2429
2460
|
truncated: !1,
|
|
2430
2461
|
limit: 50,
|
|
2431
2462
|
display: u,
|
|
2432
|
-
granularity_ms:
|
|
2463
|
+
granularity_ms: i - a
|
|
2433
2464
|
};
|
|
2434
2465
|
return {
|
|
2435
2466
|
data: o,
|
|
2436
2467
|
meta: l
|
|
2437
2468
|
};
|
|
2438
2469
|
};
|
|
2439
|
-
function We(
|
|
2440
|
-
return
|
|
2470
|
+
function We(e, t) {
|
|
2471
|
+
return e = Math.ceil(e), t = Math.floor(t), Math.floor(Math.random() * (t - e + 1) + e);
|
|
2441
2472
|
}
|
|
2442
2473
|
export {
|
|
2443
|
-
|
|
2444
|
-
|
|
2474
|
+
yr as DeltaQueryTime,
|
|
2475
|
+
q as Granularities,
|
|
2445
2476
|
Vn as REFRESH_INTERVAL_MS,
|
|
2446
2477
|
J as SeededRandom,
|
|
2447
2478
|
An as TimePeriods,
|
|
2448
2479
|
T as Timeframe,
|
|
2449
2480
|
m as TimeframeKeys,
|
|
2450
2481
|
hr as TimeseriesQueryTime,
|
|
2451
|
-
|
|
2482
|
+
Gn as UnaryQueryTime,
|
|
2452
2483
|
rr as aiExploreAggregations,
|
|
2453
|
-
|
|
2484
|
+
Le as basicExploreAggregations,
|
|
2454
2485
|
Ie as ceilToNearestTimeGrain,
|
|
2455
2486
|
je as datasourceToFilterableDimensions,
|
|
2456
|
-
|
|
2487
|
+
gr as datePickerSelectionToTimeframe,
|
|
2457
2488
|
Xn as dstOffsetHours,
|
|
2458
2489
|
nr as exploreAggregations,
|
|
2459
2490
|
Zn as exploreFilterTypesV2,
|
|
2460
2491
|
Ae as filterableAiExploreDimensions,
|
|
2461
|
-
|
|
2462
|
-
|
|
2492
|
+
Ge as filterableBasicExploreDimensions,
|
|
2493
|
+
Ue as filterableExploreDimensions,
|
|
2463
2494
|
ar as filterableRequestDimensions,
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2495
|
+
sr as filterableRequestMetrics,
|
|
2496
|
+
ir as filterableRequestWildcardDimensions,
|
|
2497
|
+
Cn as floorToNearestTimeGrain,
|
|
2467
2498
|
lr as formatISOTimeWithTZ,
|
|
2468
2499
|
Me as formatTime,
|
|
2469
2500
|
dr as formatTimeRange,
|
|
@@ -2471,13 +2502,13 @@ export {
|
|
|
2471
2502
|
Dr as generateMultipleMetricTimeSeriesData,
|
|
2472
2503
|
Tr as generateSingleMetricTimeSeriesData,
|
|
2473
2504
|
fr as granularitiesToOptions,
|
|
2474
|
-
|
|
2475
|
-
|
|
2505
|
+
Fn as granularityMsToQuery,
|
|
2506
|
+
Ce as granularityValues,
|
|
2476
2507
|
mr as msToGranularity,
|
|
2477
2508
|
ur as queryDatasources,
|
|
2478
|
-
|
|
2509
|
+
ze as queryableAiExploreDimensions,
|
|
2479
2510
|
be as queryableBasicExploreDimensions,
|
|
2480
|
-
|
|
2511
|
+
qe as queryableExploreDimensions,
|
|
2481
2512
|
Xe as queryableRequestDimensions,
|
|
2482
2513
|
Ve as queryableRequestMetrics,
|
|
2483
2514
|
$e as queryableRequestWildcardDimensions,
|