@kong-ui-public/analytics-utilities 9.8.1-pr.2172.9564bc8f4.0 → 9.9.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/constants.d.ts +2 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/dashboardSchema.d.ts +2978 -0
- package/dist/types/dashboardSchema.d.ts.map +1 -0
- package/dist/types/dashboardSchema.v2.d.ts +2976 -0
- package/dist/types/dashboardSchema.v2.d.ts.map +1 -0
- package/dist/types/format.d.ts +15 -0
- package/dist/types/format.d.ts.map +1 -0
- package/dist/types/format.spec.tz.d.ts +2 -0
- package/dist/types/format.spec.tz.d.ts.map +1 -0
- package/dist/types/granularity.d.ts +27 -0
- package/dist/types/granularity.d.ts.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/queryTime.d.ts +36 -0
- package/dist/types/queryTime.d.ts.map +1 -0
- package/dist/types/queryTime.spec.tz.d.ts +2 -0
- package/dist/types/queryTime.spec.tz.d.ts.map +1 -0
- package/dist/types/specUtils.d.ts +3 -0
- package/dist/types/specUtils.d.ts.map +1 -0
- package/dist/types/timeframes.d.ts +33 -0
- package/dist/types/timeframes.d.ts.map +1 -0
- package/dist/types/types/analytics-config.d.ts +23 -0
- package/dist/types/types/analytics-config.d.ts.map +1 -0
- package/dist/types/types/chart-types.d.ts +3 -0
- package/dist/types/types/chart-types.d.ts.map +1 -0
- package/dist/types/types/datepicker-selection.d.ts +6 -0
- package/dist/types/types/datepicker-selection.d.ts.map +1 -0
- package/dist/types/types/druid-granularity.d.ts +6 -0
- package/dist/types/types/druid-granularity.d.ts.map +1 -0
- package/dist/types/types/explore/advanced.d.ts +20 -0
- package/dist/types/types/explore/advanced.d.ts.map +1 -0
- package/dist/types/types/explore/ai.d.ts +20 -0
- package/dist/types/types/explore/ai.d.ts.map +1 -0
- package/dist/types/types/explore/all.d.ts +15 -0
- package/dist/types/types/explore/all.d.ts.map +1 -0
- package/dist/types/types/explore/basic.d.ts +31 -0
- package/dist/types/types/explore/basic.d.ts.map +1 -0
- package/dist/types/types/explore/common.d.ts +34 -0
- package/dist/types/types/explore/common.d.ts.map +1 -0
- package/dist/types/types/explore/index.d.ts +8 -0
- package/dist/types/types/explore/index.d.ts.map +1 -0
- package/dist/types/types/explore/requests.d.ts +57 -0
- package/dist/types/types/explore/requests.d.ts.map +1 -0
- package/dist/types/types/explore/result.d.ts +48 -0
- package/dist/types/types/explore/result.d.ts.map +1 -0
- package/dist/types/types/explore/util.d.ts +8 -0
- package/dist/types/types/explore/util.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +12 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/query-bridge.d.ts +24 -0
- package/dist/types/types/query-bridge.d.ts.map +1 -0
- package/dist/types/types/query-time.d.ts +13 -0
- package/dist/types/types/query-time.d.ts.map +1 -0
- package/dist/types/types/time-period.d.ts +9 -0
- package/dist/types/types/time-period.d.ts.map +1 -0
- package/dist/types/types/timeframe-keys.d.ts +16 -0
- package/dist/types/types/timeframe-keys.d.ts.map +1 -0
- package/dist/types/types/timeframe-options.d.ts +16 -0
- package/dist/types/types/timeframe-options.d.ts.map +1 -0
- package/dist/types/types/timeframe.d.ts +17 -0
- package/dist/types/types/timeframe.d.ts.map +1 -0
- package/dist/types/utils/SeedRandom.d.ts +6 -0
- package/dist/types/utils/SeedRandom.d.ts.map +1 -0
- package/dist/types/utils/chartDataGenerator.d.ts +9 -0
- package/dist/types/utils/chartDataGenerator.d.ts.map +1 -0
- package/dist/types/utils/helpers.d.ts +2 -0
- package/dist/types/utils/helpers.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +4 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/vitals-utilities.cjs +2 -0
- package/dist/vitals-utilities.cjs.map +1 -0
- package/dist/vitals-utilities.es.js +3978 -0
- package/dist/vitals-utilities.es.js.map +1 -0
- package/dist/vitals-utilities.umd.js +2 -0
- package/dist/vitals-utilities.umd.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,3978 @@
|
|
|
1
|
+
var _a = Object.defineProperty;
|
|
2
|
+
var wa = (e, t, r) => t in e ? _a(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var b = (e, t, r) => wa(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
const zs = 3e4;
|
|
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
|
+
const $s = [
|
|
7
|
+
"horizontal_bar",
|
|
8
|
+
"vertical_bar",
|
|
9
|
+
"timeseries_line",
|
|
10
|
+
"choropleth_map",
|
|
11
|
+
"timeseries_bar",
|
|
12
|
+
"donut",
|
|
13
|
+
"single_value"
|
|
14
|
+
], lr = ["in", "not_in", "selector"], Vs = ["=", "!="], Xs = ["=", "!=", "<", ">", "<=", ">="], dr = ["empty", "not_empty"], Qs = ["starts_with", "ends_with"], Zs = ["absolute", "relative"], fr = [
|
|
15
|
+
"15m",
|
|
16
|
+
"1h",
|
|
17
|
+
"6h",
|
|
18
|
+
"12h",
|
|
19
|
+
"24h",
|
|
20
|
+
"7d",
|
|
21
|
+
"current_week",
|
|
22
|
+
"previous_week",
|
|
23
|
+
"30d",
|
|
24
|
+
"current_month",
|
|
25
|
+
"previous_month"
|
|
26
|
+
], Ze = [
|
|
27
|
+
"secondly",
|
|
28
|
+
"tenSecondly",
|
|
29
|
+
"thirtySecondly",
|
|
30
|
+
"minutely",
|
|
31
|
+
"fiveMinutely",
|
|
32
|
+
"tenMinutely",
|
|
33
|
+
"thirtyMinutely",
|
|
34
|
+
"hourly",
|
|
35
|
+
"twoHourly",
|
|
36
|
+
"twelveHourly",
|
|
37
|
+
"daily",
|
|
38
|
+
"weekly",
|
|
39
|
+
"trend"
|
|
40
|
+
], se = (e) => e.filter((t) => t !== "time"), Ee = [
|
|
41
|
+
"api",
|
|
42
|
+
"api_product",
|
|
43
|
+
"api_product_version",
|
|
44
|
+
"control_plane",
|
|
45
|
+
"control_plane_group",
|
|
46
|
+
"data_plane_node",
|
|
47
|
+
"gateway_service",
|
|
48
|
+
"portal",
|
|
49
|
+
"route",
|
|
50
|
+
"status_code",
|
|
51
|
+
"status_code_grouped",
|
|
52
|
+
"time"
|
|
53
|
+
], oe = se(Ee), Be = [
|
|
54
|
+
"active_services",
|
|
55
|
+
"request_count",
|
|
56
|
+
"request_per_minute",
|
|
57
|
+
"response_latency_average"
|
|
58
|
+
], Ke = [
|
|
59
|
+
...Ee,
|
|
60
|
+
"application",
|
|
61
|
+
"consumer",
|
|
62
|
+
"country_code",
|
|
63
|
+
"iso_code",
|
|
64
|
+
"upstream_status_code",
|
|
65
|
+
"upstream_status_code_grouped",
|
|
66
|
+
"response_source",
|
|
67
|
+
"data_plane_node_version",
|
|
68
|
+
"realm"
|
|
69
|
+
], ue = se(Ke), hr = [
|
|
70
|
+
...Be,
|
|
71
|
+
"response_latency_p99",
|
|
72
|
+
"response_latency_p95",
|
|
73
|
+
"response_latency_p50",
|
|
74
|
+
"upstream_latency_p99",
|
|
75
|
+
"upstream_latency_p95",
|
|
76
|
+
"upstream_latency_p50",
|
|
77
|
+
"upstream_latency_average",
|
|
78
|
+
"kong_latency_p99",
|
|
79
|
+
"kong_latency_p95",
|
|
80
|
+
"kong_latency_p50",
|
|
81
|
+
"kong_latency_average",
|
|
82
|
+
"response_size_p99",
|
|
83
|
+
"response_size_p95",
|
|
84
|
+
"response_size_p50",
|
|
85
|
+
"response_size_average",
|
|
86
|
+
"response_size_sum",
|
|
87
|
+
"request_size_p99",
|
|
88
|
+
"request_size_p95",
|
|
89
|
+
"request_size_p50",
|
|
90
|
+
"request_size_average",
|
|
91
|
+
"request_size_sum"
|
|
92
|
+
], Je = [
|
|
93
|
+
"control_plane",
|
|
94
|
+
"control_plane_group",
|
|
95
|
+
"gateway_service",
|
|
96
|
+
"consumer",
|
|
97
|
+
"application",
|
|
98
|
+
"route",
|
|
99
|
+
"ai_provider",
|
|
100
|
+
"ai_response_model",
|
|
101
|
+
"ai_request_model",
|
|
102
|
+
"llm_cache_status",
|
|
103
|
+
"llm_embeddings_provider",
|
|
104
|
+
"llm_embeddings_model",
|
|
105
|
+
"time",
|
|
106
|
+
"realm",
|
|
107
|
+
"status_code",
|
|
108
|
+
"status_code_grouped",
|
|
109
|
+
"ai_plugin"
|
|
110
|
+
], ce = se(Je), mr = [
|
|
111
|
+
"total_tokens",
|
|
112
|
+
"prompt_tokens",
|
|
113
|
+
"completion_tokens",
|
|
114
|
+
"ai_request_count",
|
|
115
|
+
"cost",
|
|
116
|
+
"llm_cache_embeddings_latency_average",
|
|
117
|
+
"llm_cache_fetch_latency_average",
|
|
118
|
+
"llm_latency_average",
|
|
119
|
+
"llm_embeddings_tokens",
|
|
120
|
+
"llm_embeddings_cost"
|
|
121
|
+
], ba = [
|
|
122
|
+
"api",
|
|
123
|
+
"api_product",
|
|
124
|
+
"api_product_version",
|
|
125
|
+
"application",
|
|
126
|
+
"auth_type",
|
|
127
|
+
"client_ip",
|
|
128
|
+
"consumer",
|
|
129
|
+
"consumer_group",
|
|
130
|
+
"control_plane",
|
|
131
|
+
"control_plane_group",
|
|
132
|
+
"country_code",
|
|
133
|
+
"data_plane_node",
|
|
134
|
+
"data_plane_node_version",
|
|
135
|
+
"gateway_service",
|
|
136
|
+
"header_host",
|
|
137
|
+
"header_user_agent",
|
|
138
|
+
"http_method",
|
|
139
|
+
"iso_code",
|
|
140
|
+
"portal",
|
|
141
|
+
"realm",
|
|
142
|
+
"request_id",
|
|
143
|
+
"request_uri",
|
|
144
|
+
"response_header_content_type",
|
|
145
|
+
"response_source",
|
|
146
|
+
"route",
|
|
147
|
+
"service_port",
|
|
148
|
+
"service_protocol",
|
|
149
|
+
"sse",
|
|
150
|
+
"status_code_grouped",
|
|
151
|
+
"time",
|
|
152
|
+
"trace_id",
|
|
153
|
+
"upstream_uri",
|
|
154
|
+
"upstream_status_code_grouped",
|
|
155
|
+
"websocket"
|
|
156
|
+
], Bs = se(ba), Ta = [
|
|
157
|
+
"auth_type",
|
|
158
|
+
"client_ip",
|
|
159
|
+
"country_code",
|
|
160
|
+
"data_plane_node_version",
|
|
161
|
+
"header_host",
|
|
162
|
+
"header_user_agent",
|
|
163
|
+
"http_method",
|
|
164
|
+
"request_id",
|
|
165
|
+
"request_uri",
|
|
166
|
+
"response_header_content_type",
|
|
167
|
+
"response_source",
|
|
168
|
+
"service_port",
|
|
169
|
+
"service_protocol",
|
|
170
|
+
"trace_id",
|
|
171
|
+
"upstream_uri"
|
|
172
|
+
], Ks = Ta, Da = [
|
|
173
|
+
"ai_count",
|
|
174
|
+
"latencies_response_ms",
|
|
175
|
+
"latencies_upstream_ms",
|
|
176
|
+
"latencies_kong_gateway_ms",
|
|
177
|
+
"request_body_size",
|
|
178
|
+
"response_body_size",
|
|
179
|
+
"response_header_content_length",
|
|
180
|
+
"status_code",
|
|
181
|
+
"upstream_status_code"
|
|
182
|
+
], Js = se(Da), eo = [
|
|
183
|
+
"15M",
|
|
184
|
+
"1H",
|
|
185
|
+
"6H",
|
|
186
|
+
"12H",
|
|
187
|
+
"24H",
|
|
188
|
+
"7D"
|
|
189
|
+
], to = ["basic", "advanced", "ai"], Oa = {
|
|
190
|
+
basic: new Set(oe),
|
|
191
|
+
advanced: new Set(ue),
|
|
192
|
+
ai: new Set(ce)
|
|
193
|
+
}, ro = (e, t) => t.filter((r) => Oa[e].has(r.field)), no = [
|
|
194
|
+
"horizontal_bar",
|
|
195
|
+
"vertical_bar",
|
|
196
|
+
"gauge",
|
|
197
|
+
"donut",
|
|
198
|
+
"timeseries_line",
|
|
199
|
+
"timeseries_bar",
|
|
200
|
+
"golden_signals",
|
|
201
|
+
"top_n",
|
|
202
|
+
"slottable",
|
|
203
|
+
"single_value"
|
|
204
|
+
], le = {
|
|
205
|
+
type: "string"
|
|
206
|
+
}, $ = {
|
|
207
|
+
type: "string"
|
|
208
|
+
}, yr = {
|
|
209
|
+
type: "boolean"
|
|
210
|
+
}, pr = {
|
|
211
|
+
type: ["object", "array"],
|
|
212
|
+
items: {
|
|
213
|
+
type: "string"
|
|
214
|
+
},
|
|
215
|
+
additionalProperties: {
|
|
216
|
+
type: "string"
|
|
217
|
+
}
|
|
218
|
+
}, Sa = {
|
|
219
|
+
type: "object",
|
|
220
|
+
properties: {
|
|
221
|
+
type: {
|
|
222
|
+
type: "string",
|
|
223
|
+
enum: ["slottable"]
|
|
224
|
+
},
|
|
225
|
+
id: {
|
|
226
|
+
type: "string"
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
required: ["type", "id"],
|
|
230
|
+
additionalProperties: !1
|
|
231
|
+
}, va = {
|
|
232
|
+
type: "object",
|
|
233
|
+
properties: {
|
|
234
|
+
type: {
|
|
235
|
+
type: "string",
|
|
236
|
+
enum: ["horizontal_bar", "vertical_bar"]
|
|
237
|
+
},
|
|
238
|
+
stacked: {
|
|
239
|
+
type: "boolean"
|
|
240
|
+
},
|
|
241
|
+
chartDatasetColors: pr,
|
|
242
|
+
syntheticsDataKey: le,
|
|
243
|
+
chartTitle: $,
|
|
244
|
+
allowCsvExport: yr
|
|
245
|
+
},
|
|
246
|
+
required: ["type"],
|
|
247
|
+
additionalProperties: !1
|
|
248
|
+
}, Ma = {
|
|
249
|
+
type: "object",
|
|
250
|
+
properties: {
|
|
251
|
+
type: {
|
|
252
|
+
type: "string",
|
|
253
|
+
enum: ["timeseries_line", "timeseries_bar"]
|
|
254
|
+
},
|
|
255
|
+
stacked: {
|
|
256
|
+
type: "boolean"
|
|
257
|
+
},
|
|
258
|
+
threshold: {
|
|
259
|
+
type: "object",
|
|
260
|
+
additionalProperties: {
|
|
261
|
+
type: "number"
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
chartDatasetColors: pr,
|
|
265
|
+
syntheticsDataKey: le,
|
|
266
|
+
chartTitle: $,
|
|
267
|
+
allowCsvExport: yr
|
|
268
|
+
},
|
|
269
|
+
required: ["type"],
|
|
270
|
+
additionalProperties: !1
|
|
271
|
+
}, xa = {
|
|
272
|
+
type: "object",
|
|
273
|
+
properties: {
|
|
274
|
+
type: {
|
|
275
|
+
type: "string",
|
|
276
|
+
enum: ["gauge"]
|
|
277
|
+
},
|
|
278
|
+
metricDisplay: {
|
|
279
|
+
type: "string",
|
|
280
|
+
enum: ["hidden", "single", "full"]
|
|
281
|
+
// This matches the SimpleChartMetricDisplay type.
|
|
282
|
+
},
|
|
283
|
+
reverseDataset: {
|
|
284
|
+
type: "boolean"
|
|
285
|
+
},
|
|
286
|
+
numerator: {
|
|
287
|
+
type: "number"
|
|
288
|
+
},
|
|
289
|
+
syntheticsDataKey: le,
|
|
290
|
+
chartTitle: $
|
|
291
|
+
},
|
|
292
|
+
required: ["type"],
|
|
293
|
+
additionalProperties: !1
|
|
294
|
+
}, Ea = {
|
|
295
|
+
type: "object",
|
|
296
|
+
properties: {
|
|
297
|
+
type: {
|
|
298
|
+
type: "string",
|
|
299
|
+
enum: ["donut"]
|
|
300
|
+
},
|
|
301
|
+
syntheticsDataKey: le,
|
|
302
|
+
chartTitle: $
|
|
303
|
+
},
|
|
304
|
+
required: ["type"],
|
|
305
|
+
additionalProperties: !1
|
|
306
|
+
}, Pa = {
|
|
307
|
+
type: "object",
|
|
308
|
+
properties: {
|
|
309
|
+
chartTitle: $,
|
|
310
|
+
syntheticsDataKey: le,
|
|
311
|
+
type: {
|
|
312
|
+
type: "string",
|
|
313
|
+
enum: ["top_n"]
|
|
314
|
+
},
|
|
315
|
+
description: {
|
|
316
|
+
type: "string"
|
|
317
|
+
},
|
|
318
|
+
entityLink: {
|
|
319
|
+
type: "string"
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
required: ["type"],
|
|
323
|
+
additionalProperties: !1
|
|
324
|
+
}, Na = {
|
|
325
|
+
type: "object",
|
|
326
|
+
properties: {
|
|
327
|
+
chartTitle: $,
|
|
328
|
+
type: {
|
|
329
|
+
type: "string",
|
|
330
|
+
enum: ["golden_signals"]
|
|
331
|
+
},
|
|
332
|
+
longCardTitles: {
|
|
333
|
+
type: "boolean"
|
|
334
|
+
},
|
|
335
|
+
description: {
|
|
336
|
+
type: "string"
|
|
337
|
+
},
|
|
338
|
+
percentileLatency: {
|
|
339
|
+
type: "boolean"
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
required: ["type"],
|
|
343
|
+
additionalProperties: !1
|
|
344
|
+
}, Ca = {
|
|
345
|
+
type: "object",
|
|
346
|
+
properties: {
|
|
347
|
+
type: {
|
|
348
|
+
type: "string",
|
|
349
|
+
enum: ["single_value"]
|
|
350
|
+
},
|
|
351
|
+
decimalPoints: {
|
|
352
|
+
type: "number"
|
|
353
|
+
},
|
|
354
|
+
chartTitle: $
|
|
355
|
+
},
|
|
356
|
+
required: ["type"],
|
|
357
|
+
additionalProperties: !1
|
|
358
|
+
}, Ia = {
|
|
359
|
+
type: "object",
|
|
360
|
+
properties: {
|
|
361
|
+
tz: {
|
|
362
|
+
type: "string",
|
|
363
|
+
default: "Etc/UTC"
|
|
364
|
+
},
|
|
365
|
+
type: {
|
|
366
|
+
type: "string",
|
|
367
|
+
enum: [
|
|
368
|
+
"relative"
|
|
369
|
+
]
|
|
370
|
+
},
|
|
371
|
+
time_range: {
|
|
372
|
+
type: "string",
|
|
373
|
+
enum: fr,
|
|
374
|
+
default: "1h"
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
required: [
|
|
378
|
+
"type",
|
|
379
|
+
"time_range"
|
|
380
|
+
],
|
|
381
|
+
additionalProperties: !1
|
|
382
|
+
}, ka = {
|
|
383
|
+
type: "object",
|
|
384
|
+
description: "A duration representing an exact start and end time.",
|
|
385
|
+
properties: {
|
|
386
|
+
tz: {
|
|
387
|
+
type: "string"
|
|
388
|
+
},
|
|
389
|
+
type: {
|
|
390
|
+
type: "string",
|
|
391
|
+
enum: [
|
|
392
|
+
"absolute"
|
|
393
|
+
]
|
|
394
|
+
},
|
|
395
|
+
start: {
|
|
396
|
+
type: "string"
|
|
397
|
+
},
|
|
398
|
+
end: {
|
|
399
|
+
type: "string"
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
required: [
|
|
403
|
+
"type",
|
|
404
|
+
"start",
|
|
405
|
+
"end"
|
|
406
|
+
],
|
|
407
|
+
additionalProperties: !1
|
|
408
|
+
}, et = {
|
|
409
|
+
granularity: {
|
|
410
|
+
type: "string",
|
|
411
|
+
description: 'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',
|
|
412
|
+
enum: Ze
|
|
413
|
+
},
|
|
414
|
+
time_range: {
|
|
415
|
+
type: "object",
|
|
416
|
+
description: "The time range to query.",
|
|
417
|
+
anyOf: [
|
|
418
|
+
Ia,
|
|
419
|
+
ka
|
|
420
|
+
],
|
|
421
|
+
default: {
|
|
422
|
+
type: "relative",
|
|
423
|
+
time_range: "1h"
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
limit: {
|
|
427
|
+
type: "number"
|
|
428
|
+
},
|
|
429
|
+
meta: {
|
|
430
|
+
type: "object"
|
|
431
|
+
}
|
|
432
|
+
}, tt = (e) => ({
|
|
433
|
+
type: "array",
|
|
434
|
+
description: "List of aggregated metrics to collect across the requested time span.",
|
|
435
|
+
items: {
|
|
436
|
+
type: "string",
|
|
437
|
+
enum: e
|
|
438
|
+
}
|
|
439
|
+
}), rt = (e) => ({
|
|
440
|
+
type: "array",
|
|
441
|
+
description: "List of attributes or entity types to group by.",
|
|
442
|
+
minItems: 0,
|
|
443
|
+
maxItems: 2,
|
|
444
|
+
items: {
|
|
445
|
+
type: "string",
|
|
446
|
+
enum: e
|
|
447
|
+
}
|
|
448
|
+
}), Pe = (e) => ({
|
|
449
|
+
type: "array",
|
|
450
|
+
description: "A list of filters to apply to the query",
|
|
451
|
+
items: {
|
|
452
|
+
oneOf: [
|
|
453
|
+
{
|
|
454
|
+
type: "object",
|
|
455
|
+
description: "In filter",
|
|
456
|
+
properties: {
|
|
457
|
+
field: {
|
|
458
|
+
type: "string",
|
|
459
|
+
enum: e
|
|
460
|
+
},
|
|
461
|
+
operator: {
|
|
462
|
+
type: "string",
|
|
463
|
+
enum: lr
|
|
464
|
+
},
|
|
465
|
+
value: {
|
|
466
|
+
type: "array",
|
|
467
|
+
items: {
|
|
468
|
+
type: ["string", "number", "null"]
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
required: [
|
|
473
|
+
"field",
|
|
474
|
+
"operator",
|
|
475
|
+
"value"
|
|
476
|
+
],
|
|
477
|
+
additionalProperties: !1
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
type: "object",
|
|
481
|
+
description: "Empty filter",
|
|
482
|
+
properties: {
|
|
483
|
+
field: {
|
|
484
|
+
type: "string",
|
|
485
|
+
enum: e
|
|
486
|
+
},
|
|
487
|
+
operator: {
|
|
488
|
+
type: "string",
|
|
489
|
+
enum: dr
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
required: [
|
|
493
|
+
"field",
|
|
494
|
+
"operator"
|
|
495
|
+
],
|
|
496
|
+
additionalProperties: !1
|
|
497
|
+
}
|
|
498
|
+
]
|
|
499
|
+
}
|
|
500
|
+
}), Ya = {
|
|
501
|
+
type: "object",
|
|
502
|
+
description: "A query to launch at the advanced explore API",
|
|
503
|
+
properties: {
|
|
504
|
+
datasource: {
|
|
505
|
+
type: "string",
|
|
506
|
+
enum: [
|
|
507
|
+
"advanced"
|
|
508
|
+
]
|
|
509
|
+
},
|
|
510
|
+
metrics: tt(hr),
|
|
511
|
+
dimensions: rt(Ke),
|
|
512
|
+
filters: Pe(ue),
|
|
513
|
+
...et
|
|
514
|
+
},
|
|
515
|
+
required: ["datasource"],
|
|
516
|
+
additionalProperties: !1
|
|
517
|
+
}, Ra = {
|
|
518
|
+
type: "object",
|
|
519
|
+
description: "A query to launch at the basic explore API",
|
|
520
|
+
properties: {
|
|
521
|
+
datasource: {
|
|
522
|
+
type: "string",
|
|
523
|
+
enum: [
|
|
524
|
+
"basic"
|
|
525
|
+
]
|
|
526
|
+
},
|
|
527
|
+
metrics: tt(Be),
|
|
528
|
+
dimensions: rt(Ee),
|
|
529
|
+
filters: Pe(oe),
|
|
530
|
+
...et
|
|
531
|
+
},
|
|
532
|
+
required: ["datasource"],
|
|
533
|
+
additionalProperties: !1
|
|
534
|
+
}, qa = {
|
|
535
|
+
type: "object",
|
|
536
|
+
description: "A query to launch at the AI explore API",
|
|
537
|
+
properties: {
|
|
538
|
+
datasource: {
|
|
539
|
+
type: "string",
|
|
540
|
+
enum: [
|
|
541
|
+
"ai"
|
|
542
|
+
]
|
|
543
|
+
},
|
|
544
|
+
metrics: tt(mr),
|
|
545
|
+
dimensions: rt(Je),
|
|
546
|
+
filters: Pe(ce),
|
|
547
|
+
...et
|
|
548
|
+
},
|
|
549
|
+
required: ["datasource"],
|
|
550
|
+
additionalProperties: !1
|
|
551
|
+
}, Ha = {
|
|
552
|
+
anyOf: [Ya, Ra, qa]
|
|
553
|
+
}, ja = {
|
|
554
|
+
type: "object",
|
|
555
|
+
properties: {
|
|
556
|
+
query: Ha,
|
|
557
|
+
chart: {
|
|
558
|
+
anyOf: [
|
|
559
|
+
va,
|
|
560
|
+
xa,
|
|
561
|
+
Ea,
|
|
562
|
+
Ma,
|
|
563
|
+
Na,
|
|
564
|
+
Pa,
|
|
565
|
+
Sa,
|
|
566
|
+
Ca
|
|
567
|
+
]
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
required: ["query", "chart"],
|
|
571
|
+
additionalProperties: !1
|
|
572
|
+
}, Aa = {
|
|
573
|
+
type: "object",
|
|
574
|
+
properties: {
|
|
575
|
+
position: {
|
|
576
|
+
type: "object",
|
|
577
|
+
properties: {
|
|
578
|
+
col: {
|
|
579
|
+
type: "number"
|
|
580
|
+
},
|
|
581
|
+
row: {
|
|
582
|
+
type: "number"
|
|
583
|
+
}
|
|
584
|
+
},
|
|
585
|
+
description: "Position of the tile in the grid.",
|
|
586
|
+
required: ["col", "row"],
|
|
587
|
+
additionalProperties: !1
|
|
588
|
+
},
|
|
589
|
+
size: {
|
|
590
|
+
type: "object",
|
|
591
|
+
properties: {
|
|
592
|
+
cols: {
|
|
593
|
+
type: "number"
|
|
594
|
+
},
|
|
595
|
+
rows: {
|
|
596
|
+
type: "number"
|
|
597
|
+
},
|
|
598
|
+
fitToContent: {
|
|
599
|
+
type: "boolean"
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
description: "Number of columns and rows the tile occupies. If fitToContent is true for every tile in a row, and each tile only occupies 1 row, then the row will auto-fit to its content.",
|
|
603
|
+
required: ["cols", "rows"],
|
|
604
|
+
additionalProperties: !1
|
|
605
|
+
}
|
|
606
|
+
},
|
|
607
|
+
required: ["position", "size"],
|
|
608
|
+
additionalProperties: !1
|
|
609
|
+
}, Ga = {
|
|
610
|
+
type: "object",
|
|
611
|
+
properties: {
|
|
612
|
+
definition: ja,
|
|
613
|
+
layout: Aa,
|
|
614
|
+
id: {
|
|
615
|
+
type: "string",
|
|
616
|
+
description: "Unique identifier for the tile. If not provided, one will be generated."
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
required: ["definition", "layout"],
|
|
620
|
+
additionalProperties: !1
|
|
621
|
+
}, ao = {
|
|
622
|
+
type: "object",
|
|
623
|
+
properties: {
|
|
624
|
+
tiles: {
|
|
625
|
+
type: "array",
|
|
626
|
+
items: Ga
|
|
627
|
+
},
|
|
628
|
+
tileHeight: {
|
|
629
|
+
type: "number",
|
|
630
|
+
description: "Height of each tile in pixels."
|
|
631
|
+
},
|
|
632
|
+
gridSize: {
|
|
633
|
+
type: "object",
|
|
634
|
+
properties: {
|
|
635
|
+
cols: {
|
|
636
|
+
type: "number"
|
|
637
|
+
},
|
|
638
|
+
rows: {
|
|
639
|
+
type: "number"
|
|
640
|
+
}
|
|
641
|
+
},
|
|
642
|
+
description: "Number of columns and rows in the grid.",
|
|
643
|
+
required: ["cols", "rows"],
|
|
644
|
+
additionalProperties: !1
|
|
645
|
+
},
|
|
646
|
+
global_filters: Pe([.../* @__PURE__ */ new Set([...ue, ...oe, ...ce])])
|
|
647
|
+
},
|
|
648
|
+
required: ["tiles"],
|
|
649
|
+
additionalProperties: !1
|
|
650
|
+
}, Fa = [
|
|
651
|
+
"horizontal_bar",
|
|
652
|
+
"vertical_bar",
|
|
653
|
+
"gauge",
|
|
654
|
+
"donut",
|
|
655
|
+
"timeseries_line",
|
|
656
|
+
"timeseries_bar",
|
|
657
|
+
"golden_signals",
|
|
658
|
+
"top_n",
|
|
659
|
+
"slottable",
|
|
660
|
+
"single_value"
|
|
661
|
+
], de = {
|
|
662
|
+
type: "string"
|
|
663
|
+
}, V = {
|
|
664
|
+
type: "string"
|
|
665
|
+
}, gr = {
|
|
666
|
+
type: "boolean"
|
|
667
|
+
}, _r = {
|
|
668
|
+
type: ["object", "array"],
|
|
669
|
+
items: {
|
|
670
|
+
type: "string"
|
|
671
|
+
},
|
|
672
|
+
additionalProperties: {
|
|
673
|
+
type: "string"
|
|
674
|
+
}
|
|
675
|
+
}, wr = {
|
|
676
|
+
type: "object",
|
|
677
|
+
properties: {
|
|
678
|
+
type: {
|
|
679
|
+
type: "string",
|
|
680
|
+
enum: ["slottable"]
|
|
681
|
+
},
|
|
682
|
+
id: {
|
|
683
|
+
type: "string"
|
|
684
|
+
}
|
|
685
|
+
},
|
|
686
|
+
required: ["type", "id"],
|
|
687
|
+
additionalProperties: !1
|
|
688
|
+
}, br = {
|
|
689
|
+
type: "object",
|
|
690
|
+
properties: {
|
|
691
|
+
type: {
|
|
692
|
+
type: "string",
|
|
693
|
+
enum: ["horizontal_bar", "vertical_bar"]
|
|
694
|
+
},
|
|
695
|
+
stacked: {
|
|
696
|
+
type: "boolean"
|
|
697
|
+
},
|
|
698
|
+
chart_dataset_colors: _r,
|
|
699
|
+
synthetics_data_key: de,
|
|
700
|
+
chart_title: V,
|
|
701
|
+
allow_csv_export: gr
|
|
702
|
+
},
|
|
703
|
+
required: ["type"],
|
|
704
|
+
additionalProperties: !1
|
|
705
|
+
}, Tr = {
|
|
706
|
+
type: "object",
|
|
707
|
+
properties: {
|
|
708
|
+
type: {
|
|
709
|
+
type: "string",
|
|
710
|
+
enum: ["timeseries_line", "timeseries_bar"]
|
|
711
|
+
},
|
|
712
|
+
stacked: {
|
|
713
|
+
type: "boolean"
|
|
714
|
+
},
|
|
715
|
+
threshold: {
|
|
716
|
+
type: "object",
|
|
717
|
+
additionalProperties: {
|
|
718
|
+
type: "number"
|
|
719
|
+
}
|
|
720
|
+
},
|
|
721
|
+
chart_dataset_colors: _r,
|
|
722
|
+
synthetics_data_key: de,
|
|
723
|
+
chart_title: V,
|
|
724
|
+
allow_csv_export: gr
|
|
725
|
+
},
|
|
726
|
+
required: ["type"],
|
|
727
|
+
additionalProperties: !1
|
|
728
|
+
}, Dr = {
|
|
729
|
+
type: "object",
|
|
730
|
+
properties: {
|
|
731
|
+
type: {
|
|
732
|
+
type: "string",
|
|
733
|
+
enum: ["gauge"]
|
|
734
|
+
},
|
|
735
|
+
metric_display: {
|
|
736
|
+
type: "string",
|
|
737
|
+
enum: ["hidden", "single", "full"]
|
|
738
|
+
// This matches the SimpleChartMetricDisplay type.
|
|
739
|
+
},
|
|
740
|
+
reverse_dataset: {
|
|
741
|
+
type: "boolean"
|
|
742
|
+
},
|
|
743
|
+
numerator: {
|
|
744
|
+
type: "number"
|
|
745
|
+
},
|
|
746
|
+
synthetics_data_key: de,
|
|
747
|
+
chart_title: V
|
|
748
|
+
},
|
|
749
|
+
required: ["type"],
|
|
750
|
+
additionalProperties: !1
|
|
751
|
+
}, Or = {
|
|
752
|
+
type: "object",
|
|
753
|
+
properties: {
|
|
754
|
+
type: {
|
|
755
|
+
type: "string",
|
|
756
|
+
enum: ["donut"]
|
|
757
|
+
},
|
|
758
|
+
synthetics_data_key: de,
|
|
759
|
+
chart_title: V
|
|
760
|
+
},
|
|
761
|
+
required: ["type"],
|
|
762
|
+
additionalProperties: !1
|
|
763
|
+
}, Sr = {
|
|
764
|
+
type: "object",
|
|
765
|
+
properties: {
|
|
766
|
+
chart_title: V,
|
|
767
|
+
synthetics_data_key: de,
|
|
768
|
+
type: {
|
|
769
|
+
type: "string",
|
|
770
|
+
enum: ["top_n"]
|
|
771
|
+
},
|
|
772
|
+
description: {
|
|
773
|
+
type: "string"
|
|
774
|
+
},
|
|
775
|
+
entity_link: {
|
|
776
|
+
type: "string"
|
|
777
|
+
}
|
|
778
|
+
},
|
|
779
|
+
required: ["type"],
|
|
780
|
+
additionalProperties: !1
|
|
781
|
+
}, vr = {
|
|
782
|
+
type: "object",
|
|
783
|
+
properties: {
|
|
784
|
+
chart_title: V,
|
|
785
|
+
type: {
|
|
786
|
+
type: "string",
|
|
787
|
+
enum: ["golden_signals"]
|
|
788
|
+
},
|
|
789
|
+
long_card_titles: {
|
|
790
|
+
type: "boolean"
|
|
791
|
+
},
|
|
792
|
+
description: {
|
|
793
|
+
type: "string"
|
|
794
|
+
},
|
|
795
|
+
percentile_latency: {
|
|
796
|
+
type: "boolean"
|
|
797
|
+
}
|
|
798
|
+
},
|
|
799
|
+
required: ["type"],
|
|
800
|
+
additionalProperties: !1
|
|
801
|
+
}, Mr = {
|
|
802
|
+
type: "object",
|
|
803
|
+
properties: {
|
|
804
|
+
type: {
|
|
805
|
+
type: "string",
|
|
806
|
+
enum: ["single_value"]
|
|
807
|
+
},
|
|
808
|
+
decimal_points: {
|
|
809
|
+
type: "number"
|
|
810
|
+
},
|
|
811
|
+
chart_title: V
|
|
812
|
+
},
|
|
813
|
+
required: ["type"],
|
|
814
|
+
additionalProperties: !1
|
|
815
|
+
}, Wa = {
|
|
816
|
+
type: "object",
|
|
817
|
+
properties: {
|
|
818
|
+
tz: {
|
|
819
|
+
type: "string",
|
|
820
|
+
default: "Etc/UTC"
|
|
821
|
+
},
|
|
822
|
+
type: {
|
|
823
|
+
type: "string",
|
|
824
|
+
enum: [
|
|
825
|
+
"relative"
|
|
826
|
+
]
|
|
827
|
+
},
|
|
828
|
+
time_range: {
|
|
829
|
+
type: "string",
|
|
830
|
+
enum: fr,
|
|
831
|
+
default: "1h"
|
|
832
|
+
}
|
|
833
|
+
},
|
|
834
|
+
required: [
|
|
835
|
+
"type",
|
|
836
|
+
"time_range"
|
|
837
|
+
],
|
|
838
|
+
additionalProperties: !1
|
|
839
|
+
}, La = {
|
|
840
|
+
type: "object",
|
|
841
|
+
description: "A duration representing an exact start and end time.",
|
|
842
|
+
properties: {
|
|
843
|
+
tz: {
|
|
844
|
+
type: "string"
|
|
845
|
+
},
|
|
846
|
+
type: {
|
|
847
|
+
type: "string",
|
|
848
|
+
enum: [
|
|
849
|
+
"absolute"
|
|
850
|
+
]
|
|
851
|
+
},
|
|
852
|
+
start: {
|
|
853
|
+
type: "string"
|
|
854
|
+
},
|
|
855
|
+
end: {
|
|
856
|
+
type: "string"
|
|
857
|
+
}
|
|
858
|
+
},
|
|
859
|
+
required: [
|
|
860
|
+
"type",
|
|
861
|
+
"start",
|
|
862
|
+
"end"
|
|
863
|
+
],
|
|
864
|
+
additionalProperties: !1
|
|
865
|
+
}, nt = {
|
|
866
|
+
granularity: {
|
|
867
|
+
type: "string",
|
|
868
|
+
description: 'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',
|
|
869
|
+
enum: Ze
|
|
870
|
+
},
|
|
871
|
+
time_range: {
|
|
872
|
+
type: "object",
|
|
873
|
+
description: "The time range to query.",
|
|
874
|
+
anyOf: [
|
|
875
|
+
Wa,
|
|
876
|
+
La
|
|
877
|
+
],
|
|
878
|
+
default: {
|
|
879
|
+
type: "relative",
|
|
880
|
+
time_range: "1h"
|
|
881
|
+
}
|
|
882
|
+
},
|
|
883
|
+
limit: {
|
|
884
|
+
type: "number"
|
|
885
|
+
},
|
|
886
|
+
meta: {
|
|
887
|
+
type: "object"
|
|
888
|
+
}
|
|
889
|
+
}, at = (e) => ({
|
|
890
|
+
type: "array",
|
|
891
|
+
description: "List of aggregated metrics to collect across the requested time span.",
|
|
892
|
+
items: {
|
|
893
|
+
type: "string",
|
|
894
|
+
enum: e
|
|
895
|
+
}
|
|
896
|
+
}), it = (e) => ({
|
|
897
|
+
type: "array",
|
|
898
|
+
description: "List of attributes or entity types to group by.",
|
|
899
|
+
minItems: 0,
|
|
900
|
+
maxItems: 2,
|
|
901
|
+
items: {
|
|
902
|
+
type: "string",
|
|
903
|
+
enum: e
|
|
904
|
+
}
|
|
905
|
+
}), Ne = (e) => ({
|
|
906
|
+
type: "array",
|
|
907
|
+
description: "A list of filters to apply to the query",
|
|
908
|
+
items: {
|
|
909
|
+
oneOf: [
|
|
910
|
+
{
|
|
911
|
+
type: "object",
|
|
912
|
+
description: "In filter",
|
|
913
|
+
properties: {
|
|
914
|
+
field: {
|
|
915
|
+
type: "string",
|
|
916
|
+
enum: e
|
|
917
|
+
},
|
|
918
|
+
operator: {
|
|
919
|
+
type: "string",
|
|
920
|
+
enum: lr
|
|
921
|
+
},
|
|
922
|
+
value: {
|
|
923
|
+
type: "array",
|
|
924
|
+
items: {
|
|
925
|
+
type: ["string", "number", "null"]
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
},
|
|
929
|
+
required: [
|
|
930
|
+
"field",
|
|
931
|
+
"operator",
|
|
932
|
+
"value"
|
|
933
|
+
],
|
|
934
|
+
additionalProperties: !1
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
type: "object",
|
|
938
|
+
description: "Empty filter",
|
|
939
|
+
properties: {
|
|
940
|
+
field: {
|
|
941
|
+
type: "string",
|
|
942
|
+
enum: e
|
|
943
|
+
},
|
|
944
|
+
operator: {
|
|
945
|
+
type: "string",
|
|
946
|
+
enum: dr
|
|
947
|
+
}
|
|
948
|
+
},
|
|
949
|
+
required: [
|
|
950
|
+
"field",
|
|
951
|
+
"operator"
|
|
952
|
+
],
|
|
953
|
+
additionalProperties: !1
|
|
954
|
+
}
|
|
955
|
+
]
|
|
956
|
+
}
|
|
957
|
+
}), xr = {
|
|
958
|
+
type: "object",
|
|
959
|
+
description: "A query to launch at the advanced explore API",
|
|
960
|
+
properties: {
|
|
961
|
+
datasource: {
|
|
962
|
+
type: "string",
|
|
963
|
+
enum: [
|
|
964
|
+
"api_usage"
|
|
965
|
+
]
|
|
966
|
+
},
|
|
967
|
+
metrics: at(hr),
|
|
968
|
+
dimensions: it(Ke),
|
|
969
|
+
filters: Ne(ue),
|
|
970
|
+
...nt
|
|
971
|
+
},
|
|
972
|
+
required: ["datasource"],
|
|
973
|
+
additionalProperties: !1
|
|
974
|
+
}, Er = {
|
|
975
|
+
type: "object",
|
|
976
|
+
description: "A query to launch at the basic explore API",
|
|
977
|
+
properties: {
|
|
978
|
+
datasource: {
|
|
979
|
+
type: "string",
|
|
980
|
+
enum: [
|
|
981
|
+
"basic"
|
|
982
|
+
]
|
|
983
|
+
},
|
|
984
|
+
metrics: at(Be),
|
|
985
|
+
dimensions: it(Ee),
|
|
986
|
+
filters: Ne(oe),
|
|
987
|
+
...nt
|
|
988
|
+
},
|
|
989
|
+
required: ["datasource"],
|
|
990
|
+
additionalProperties: !1
|
|
991
|
+
}, Pr = {
|
|
992
|
+
type: "object",
|
|
993
|
+
description: "A query to launch at the AI explore API",
|
|
994
|
+
properties: {
|
|
995
|
+
datasource: {
|
|
996
|
+
type: "string",
|
|
997
|
+
enum: [
|
|
998
|
+
"llm_usage"
|
|
999
|
+
]
|
|
1000
|
+
},
|
|
1001
|
+
metrics: at(mr),
|
|
1002
|
+
dimensions: it(Je),
|
|
1003
|
+
filters: Ne(ce),
|
|
1004
|
+
...nt
|
|
1005
|
+
},
|
|
1006
|
+
required: ["datasource"],
|
|
1007
|
+
additionalProperties: !1
|
|
1008
|
+
}, Nr = {
|
|
1009
|
+
anyOf: [xr, Er, Pr]
|
|
1010
|
+
}, Cr = {
|
|
1011
|
+
type: "object",
|
|
1012
|
+
properties: {
|
|
1013
|
+
query: Nr,
|
|
1014
|
+
chart: {
|
|
1015
|
+
anyOf: [
|
|
1016
|
+
br,
|
|
1017
|
+
Dr,
|
|
1018
|
+
Or,
|
|
1019
|
+
Tr,
|
|
1020
|
+
vr,
|
|
1021
|
+
Sr,
|
|
1022
|
+
wr,
|
|
1023
|
+
Mr
|
|
1024
|
+
]
|
|
1025
|
+
}
|
|
1026
|
+
},
|
|
1027
|
+
required: ["query", "chart"],
|
|
1028
|
+
additionalProperties: !1
|
|
1029
|
+
}, Ir = {
|
|
1030
|
+
type: "object",
|
|
1031
|
+
properties: {
|
|
1032
|
+
position: {
|
|
1033
|
+
type: "object",
|
|
1034
|
+
properties: {
|
|
1035
|
+
col: {
|
|
1036
|
+
type: "number"
|
|
1037
|
+
},
|
|
1038
|
+
row: {
|
|
1039
|
+
type: "number"
|
|
1040
|
+
}
|
|
1041
|
+
},
|
|
1042
|
+
description: "Position of the tile in the grid.",
|
|
1043
|
+
required: ["col", "row"],
|
|
1044
|
+
additionalProperties: !1
|
|
1045
|
+
},
|
|
1046
|
+
size: {
|
|
1047
|
+
type: "object",
|
|
1048
|
+
properties: {
|
|
1049
|
+
cols: {
|
|
1050
|
+
type: "number"
|
|
1051
|
+
},
|
|
1052
|
+
rows: {
|
|
1053
|
+
type: "number"
|
|
1054
|
+
},
|
|
1055
|
+
fit_to_content: {
|
|
1056
|
+
type: "boolean"
|
|
1057
|
+
}
|
|
1058
|
+
},
|
|
1059
|
+
description: "Number of columns and rows the tile occupies. If fitToContent is true for every tile in a row, and each tile only occupies 1 row, then the row will auto-fit to its content.",
|
|
1060
|
+
required: ["cols", "rows"],
|
|
1061
|
+
additionalProperties: !1
|
|
1062
|
+
}
|
|
1063
|
+
},
|
|
1064
|
+
required: ["position", "size"],
|
|
1065
|
+
additionalProperties: !1
|
|
1066
|
+
}, kr = {
|
|
1067
|
+
type: "object",
|
|
1068
|
+
properties: {
|
|
1069
|
+
type: {
|
|
1070
|
+
type: "string",
|
|
1071
|
+
enum: ["chart"]
|
|
1072
|
+
},
|
|
1073
|
+
definition: Cr,
|
|
1074
|
+
layout: Ir,
|
|
1075
|
+
id: {
|
|
1076
|
+
type: "string",
|
|
1077
|
+
description: "Unique identifier for the tile. If not provided, one will be generated."
|
|
1078
|
+
}
|
|
1079
|
+
},
|
|
1080
|
+
required: ["type", "definition", "layout"],
|
|
1081
|
+
additionalProperties: !1
|
|
1082
|
+
}, Ua = {
|
|
1083
|
+
type: "object",
|
|
1084
|
+
properties: {
|
|
1085
|
+
version: {
|
|
1086
|
+
type: "string",
|
|
1087
|
+
enum: ["v2"]
|
|
1088
|
+
},
|
|
1089
|
+
tiles: {
|
|
1090
|
+
type: "array",
|
|
1091
|
+
items: kr
|
|
1092
|
+
},
|
|
1093
|
+
tile_height: {
|
|
1094
|
+
type: "number",
|
|
1095
|
+
description: "Height of each tile in pixels."
|
|
1096
|
+
},
|
|
1097
|
+
preset_filters: Ne([.../* @__PURE__ */ new Set([...ue, ...oe, ...ce])])
|
|
1098
|
+
},
|
|
1099
|
+
required: ["version", "tiles"],
|
|
1100
|
+
additionalProperties: !1
|
|
1101
|
+
}, io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1102
|
+
__proto__: null,
|
|
1103
|
+
apiUsageQuerySchema: xr,
|
|
1104
|
+
barChartSchema: br,
|
|
1105
|
+
basicQuerySchema: Er,
|
|
1106
|
+
dashboardConfigSchema: Ua,
|
|
1107
|
+
dashboardTileTypes: Fa,
|
|
1108
|
+
donutChartSchema: Or,
|
|
1109
|
+
gaugeChartSchema: Dr,
|
|
1110
|
+
llmUsageSchema: Pr,
|
|
1111
|
+
metricCardSchema: vr,
|
|
1112
|
+
singleValueSchema: Mr,
|
|
1113
|
+
slottableSchema: wr,
|
|
1114
|
+
tileConfigSchema: kr,
|
|
1115
|
+
tileDefinitionSchema: Cr,
|
|
1116
|
+
tileLayoutSchema: Ir,
|
|
1117
|
+
timeseriesChartSchema: Tr,
|
|
1118
|
+
topNTableSchema: Sr,
|
|
1119
|
+
validDashboardQuery: Nr
|
|
1120
|
+
}, Symbol.toStringTag, { value: "Module" })), Yr = 6048e5, za = 864e5, $a = 60, Va = 3600, Lt = Symbol.for("constructDateFrom");
|
|
1121
|
+
function I(e, t) {
|
|
1122
|
+
return typeof e == "function" ? e(t) : e && typeof e == "object" && Lt in e ? e[Lt](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
1123
|
+
}
|
|
1124
|
+
function O(e, t) {
|
|
1125
|
+
return I(t || e, e);
|
|
1126
|
+
}
|
|
1127
|
+
function Ut(e, t, r) {
|
|
1128
|
+
const n = O(e, r == null ? void 0 : r.in);
|
|
1129
|
+
return isNaN(t) ? I(e, NaN) : (n.setDate(n.getDate() + t), n);
|
|
1130
|
+
}
|
|
1131
|
+
function Xa(e, t, r) {
|
|
1132
|
+
const n = O(e, r == null ? void 0 : r.in);
|
|
1133
|
+
if (isNaN(t)) return I(e, NaN);
|
|
1134
|
+
const i = n.getDate(), o = I(e, n.getTime());
|
|
1135
|
+
o.setMonth(n.getMonth() + t + 1, 0);
|
|
1136
|
+
const c = o.getDate();
|
|
1137
|
+
return i >= c ? o : (n.setFullYear(
|
|
1138
|
+
o.getFullYear(),
|
|
1139
|
+
o.getMonth(),
|
|
1140
|
+
i
|
|
1141
|
+
), n);
|
|
1142
|
+
}
|
|
1143
|
+
let Qa = {};
|
|
1144
|
+
function fe() {
|
|
1145
|
+
return Qa;
|
|
1146
|
+
}
|
|
1147
|
+
function H(e, t) {
|
|
1148
|
+
var d, h, f, _;
|
|
1149
|
+
const r = fe(), n = (t == null ? void 0 : t.weekStartsOn) ?? ((h = (d = t == null ? void 0 : t.locale) == null ? void 0 : d.options) == null ? void 0 : h.weekStartsOn) ?? r.weekStartsOn ?? ((_ = (f = r.locale) == null ? void 0 : f.options) == null ? void 0 : _.weekStartsOn) ?? 0, i = O(e, t == null ? void 0 : t.in), o = i.getDay(), c = (o < n ? 7 : 0) + o - n;
|
|
1150
|
+
return i.setDate(i.getDate() - c), i.setHours(0, 0, 0, 0), i;
|
|
1151
|
+
}
|
|
1152
|
+
function De(e, t) {
|
|
1153
|
+
return H(e, { ...t, weekStartsOn: 1 });
|
|
1154
|
+
}
|
|
1155
|
+
function Rr(e, t) {
|
|
1156
|
+
const r = O(e, t == null ? void 0 : t.in), n = r.getFullYear(), i = I(r, 0);
|
|
1157
|
+
i.setFullYear(n + 1, 0, 4), i.setHours(0, 0, 0, 0);
|
|
1158
|
+
const o = De(i), c = I(r, 0);
|
|
1159
|
+
c.setFullYear(n, 0, 4), c.setHours(0, 0, 0, 0);
|
|
1160
|
+
const d = De(c);
|
|
1161
|
+
return r.getTime() >= o.getTime() ? n + 1 : r.getTime() >= d.getTime() ? n : n - 1;
|
|
1162
|
+
}
|
|
1163
|
+
function zt(e) {
|
|
1164
|
+
const t = O(e), r = new Date(
|
|
1165
|
+
Date.UTC(
|
|
1166
|
+
t.getFullYear(),
|
|
1167
|
+
t.getMonth(),
|
|
1168
|
+
t.getDate(),
|
|
1169
|
+
t.getHours(),
|
|
1170
|
+
t.getMinutes(),
|
|
1171
|
+
t.getSeconds(),
|
|
1172
|
+
t.getMilliseconds()
|
|
1173
|
+
)
|
|
1174
|
+
);
|
|
1175
|
+
return r.setUTCFullYear(t.getFullYear()), +e - +r;
|
|
1176
|
+
}
|
|
1177
|
+
function Za(e, ...t) {
|
|
1178
|
+
const r = I.bind(
|
|
1179
|
+
null,
|
|
1180
|
+
t.find((n) => typeof n == "object")
|
|
1181
|
+
);
|
|
1182
|
+
return t.map(r);
|
|
1183
|
+
}
|
|
1184
|
+
function Oe(e, t) {
|
|
1185
|
+
const r = O(e, t == null ? void 0 : t.in);
|
|
1186
|
+
return r.setHours(0, 0, 0, 0), r;
|
|
1187
|
+
}
|
|
1188
|
+
function Ba(e, t, r) {
|
|
1189
|
+
const [n, i] = Za(
|
|
1190
|
+
r == null ? void 0 : r.in,
|
|
1191
|
+
e,
|
|
1192
|
+
t
|
|
1193
|
+
), o = Oe(n), c = Oe(i), d = +o - zt(o), h = +c - zt(c);
|
|
1194
|
+
return Math.round((d - h) / za);
|
|
1195
|
+
}
|
|
1196
|
+
function Ka(e, t) {
|
|
1197
|
+
const r = Rr(e, t), n = I(e, 0);
|
|
1198
|
+
return n.setFullYear(r, 0, 4), n.setHours(0, 0, 0, 0), De(n);
|
|
1199
|
+
}
|
|
1200
|
+
function Ja(e) {
|
|
1201
|
+
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
1202
|
+
}
|
|
1203
|
+
function ei(e) {
|
|
1204
|
+
return !(!Ja(e) && typeof e != "number" || isNaN(+O(e)));
|
|
1205
|
+
}
|
|
1206
|
+
function ee(e, t) {
|
|
1207
|
+
const r = O(e, t == null ? void 0 : t.in);
|
|
1208
|
+
return r.setDate(1), r.setHours(0, 0, 0, 0), r;
|
|
1209
|
+
}
|
|
1210
|
+
function ti(e, t) {
|
|
1211
|
+
const r = O(e, t == null ? void 0 : t.in);
|
|
1212
|
+
return r.setFullYear(r.getFullYear(), 0, 1), r.setHours(0, 0, 0, 0), r;
|
|
1213
|
+
}
|
|
1214
|
+
const ri = {
|
|
1215
|
+
lessThanXSeconds: {
|
|
1216
|
+
one: "less than a second",
|
|
1217
|
+
other: "less than {{count}} seconds"
|
|
1218
|
+
},
|
|
1219
|
+
xSeconds: {
|
|
1220
|
+
one: "1 second",
|
|
1221
|
+
other: "{{count}} seconds"
|
|
1222
|
+
},
|
|
1223
|
+
halfAMinute: "half a minute",
|
|
1224
|
+
lessThanXMinutes: {
|
|
1225
|
+
one: "less than a minute",
|
|
1226
|
+
other: "less than {{count}} minutes"
|
|
1227
|
+
},
|
|
1228
|
+
xMinutes: {
|
|
1229
|
+
one: "1 minute",
|
|
1230
|
+
other: "{{count}} minutes"
|
|
1231
|
+
},
|
|
1232
|
+
aboutXHours: {
|
|
1233
|
+
one: "about 1 hour",
|
|
1234
|
+
other: "about {{count}} hours"
|
|
1235
|
+
},
|
|
1236
|
+
xHours: {
|
|
1237
|
+
one: "1 hour",
|
|
1238
|
+
other: "{{count}} hours"
|
|
1239
|
+
},
|
|
1240
|
+
xDays: {
|
|
1241
|
+
one: "1 day",
|
|
1242
|
+
other: "{{count}} days"
|
|
1243
|
+
},
|
|
1244
|
+
aboutXWeeks: {
|
|
1245
|
+
one: "about 1 week",
|
|
1246
|
+
other: "about {{count}} weeks"
|
|
1247
|
+
},
|
|
1248
|
+
xWeeks: {
|
|
1249
|
+
one: "1 week",
|
|
1250
|
+
other: "{{count}} weeks"
|
|
1251
|
+
},
|
|
1252
|
+
aboutXMonths: {
|
|
1253
|
+
one: "about 1 month",
|
|
1254
|
+
other: "about {{count}} months"
|
|
1255
|
+
},
|
|
1256
|
+
xMonths: {
|
|
1257
|
+
one: "1 month",
|
|
1258
|
+
other: "{{count}} months"
|
|
1259
|
+
},
|
|
1260
|
+
aboutXYears: {
|
|
1261
|
+
one: "about 1 year",
|
|
1262
|
+
other: "about {{count}} years"
|
|
1263
|
+
},
|
|
1264
|
+
xYears: {
|
|
1265
|
+
one: "1 year",
|
|
1266
|
+
other: "{{count}} years"
|
|
1267
|
+
},
|
|
1268
|
+
overXYears: {
|
|
1269
|
+
one: "over 1 year",
|
|
1270
|
+
other: "over {{count}} years"
|
|
1271
|
+
},
|
|
1272
|
+
almostXYears: {
|
|
1273
|
+
one: "almost 1 year",
|
|
1274
|
+
other: "almost {{count}} years"
|
|
1275
|
+
}
|
|
1276
|
+
}, ni = (e, t, r) => {
|
|
1277
|
+
let n;
|
|
1278
|
+
const i = ri[e];
|
|
1279
|
+
return typeof i == "string" ? n = i : t === 1 ? n = i.one : n = i.other.replace("{{count}}", t.toString()), r != null && r.addSuffix ? r.comparison && r.comparison > 0 ? "in " + n : n + " ago" : n;
|
|
1280
|
+
};
|
|
1281
|
+
function Le(e) {
|
|
1282
|
+
return (t = {}) => {
|
|
1283
|
+
const r = t.width ? String(t.width) : e.defaultWidth;
|
|
1284
|
+
return e.formats[r] || e.formats[e.defaultWidth];
|
|
1285
|
+
};
|
|
1286
|
+
}
|
|
1287
|
+
const ai = {
|
|
1288
|
+
full: "EEEE, MMMM do, y",
|
|
1289
|
+
long: "MMMM do, y",
|
|
1290
|
+
medium: "MMM d, y",
|
|
1291
|
+
short: "MM/dd/yyyy"
|
|
1292
|
+
}, ii = {
|
|
1293
|
+
full: "h:mm:ss a zzzz",
|
|
1294
|
+
long: "h:mm:ss a z",
|
|
1295
|
+
medium: "h:mm:ss a",
|
|
1296
|
+
short: "h:mm a"
|
|
1297
|
+
}, si = {
|
|
1298
|
+
full: "{{date}} 'at' {{time}}",
|
|
1299
|
+
long: "{{date}} 'at' {{time}}",
|
|
1300
|
+
medium: "{{date}}, {{time}}",
|
|
1301
|
+
short: "{{date}}, {{time}}"
|
|
1302
|
+
}, oi = {
|
|
1303
|
+
date: Le({
|
|
1304
|
+
formats: ai,
|
|
1305
|
+
defaultWidth: "full"
|
|
1306
|
+
}),
|
|
1307
|
+
time: Le({
|
|
1308
|
+
formats: ii,
|
|
1309
|
+
defaultWidth: "full"
|
|
1310
|
+
}),
|
|
1311
|
+
dateTime: Le({
|
|
1312
|
+
formats: si,
|
|
1313
|
+
defaultWidth: "full"
|
|
1314
|
+
})
|
|
1315
|
+
}, ui = {
|
|
1316
|
+
lastWeek: "'last' eeee 'at' p",
|
|
1317
|
+
yesterday: "'yesterday at' p",
|
|
1318
|
+
today: "'today at' p",
|
|
1319
|
+
tomorrow: "'tomorrow at' p",
|
|
1320
|
+
nextWeek: "eeee 'at' p",
|
|
1321
|
+
other: "P"
|
|
1322
|
+
}, ci = (e, t, r, n) => ui[e];
|
|
1323
|
+
function ae(e) {
|
|
1324
|
+
return (t, r) => {
|
|
1325
|
+
const n = r != null && r.context ? String(r.context) : "standalone";
|
|
1326
|
+
let i;
|
|
1327
|
+
if (n === "formatting" && e.formattingValues) {
|
|
1328
|
+
const c = e.defaultFormattingWidth || e.defaultWidth, d = r != null && r.width ? String(r.width) : c;
|
|
1329
|
+
i = e.formattingValues[d] || e.formattingValues[c];
|
|
1330
|
+
} else {
|
|
1331
|
+
const c = e.defaultWidth, d = r != null && r.width ? String(r.width) : e.defaultWidth;
|
|
1332
|
+
i = e.values[d] || e.values[c];
|
|
1333
|
+
}
|
|
1334
|
+
const o = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
1335
|
+
return i[o];
|
|
1336
|
+
};
|
|
1337
|
+
}
|
|
1338
|
+
const li = {
|
|
1339
|
+
narrow: ["B", "A"],
|
|
1340
|
+
abbreviated: ["BC", "AD"],
|
|
1341
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
1342
|
+
}, di = {
|
|
1343
|
+
narrow: ["1", "2", "3", "4"],
|
|
1344
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
1345
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
1346
|
+
}, fi = {
|
|
1347
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
1348
|
+
abbreviated: [
|
|
1349
|
+
"Jan",
|
|
1350
|
+
"Feb",
|
|
1351
|
+
"Mar",
|
|
1352
|
+
"Apr",
|
|
1353
|
+
"May",
|
|
1354
|
+
"Jun",
|
|
1355
|
+
"Jul",
|
|
1356
|
+
"Aug",
|
|
1357
|
+
"Sep",
|
|
1358
|
+
"Oct",
|
|
1359
|
+
"Nov",
|
|
1360
|
+
"Dec"
|
|
1361
|
+
],
|
|
1362
|
+
wide: [
|
|
1363
|
+
"January",
|
|
1364
|
+
"February",
|
|
1365
|
+
"March",
|
|
1366
|
+
"April",
|
|
1367
|
+
"May",
|
|
1368
|
+
"June",
|
|
1369
|
+
"July",
|
|
1370
|
+
"August",
|
|
1371
|
+
"September",
|
|
1372
|
+
"October",
|
|
1373
|
+
"November",
|
|
1374
|
+
"December"
|
|
1375
|
+
]
|
|
1376
|
+
}, hi = {
|
|
1377
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
1378
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
1379
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
1380
|
+
wide: [
|
|
1381
|
+
"Sunday",
|
|
1382
|
+
"Monday",
|
|
1383
|
+
"Tuesday",
|
|
1384
|
+
"Wednesday",
|
|
1385
|
+
"Thursday",
|
|
1386
|
+
"Friday",
|
|
1387
|
+
"Saturday"
|
|
1388
|
+
]
|
|
1389
|
+
}, mi = {
|
|
1390
|
+
narrow: {
|
|
1391
|
+
am: "a",
|
|
1392
|
+
pm: "p",
|
|
1393
|
+
midnight: "mi",
|
|
1394
|
+
noon: "n",
|
|
1395
|
+
morning: "morning",
|
|
1396
|
+
afternoon: "afternoon",
|
|
1397
|
+
evening: "evening",
|
|
1398
|
+
night: "night"
|
|
1399
|
+
},
|
|
1400
|
+
abbreviated: {
|
|
1401
|
+
am: "AM",
|
|
1402
|
+
pm: "PM",
|
|
1403
|
+
midnight: "midnight",
|
|
1404
|
+
noon: "noon",
|
|
1405
|
+
morning: "morning",
|
|
1406
|
+
afternoon: "afternoon",
|
|
1407
|
+
evening: "evening",
|
|
1408
|
+
night: "night"
|
|
1409
|
+
},
|
|
1410
|
+
wide: {
|
|
1411
|
+
am: "a.m.",
|
|
1412
|
+
pm: "p.m.",
|
|
1413
|
+
midnight: "midnight",
|
|
1414
|
+
noon: "noon",
|
|
1415
|
+
morning: "morning",
|
|
1416
|
+
afternoon: "afternoon",
|
|
1417
|
+
evening: "evening",
|
|
1418
|
+
night: "night"
|
|
1419
|
+
}
|
|
1420
|
+
}, yi = {
|
|
1421
|
+
narrow: {
|
|
1422
|
+
am: "a",
|
|
1423
|
+
pm: "p",
|
|
1424
|
+
midnight: "mi",
|
|
1425
|
+
noon: "n",
|
|
1426
|
+
morning: "in the morning",
|
|
1427
|
+
afternoon: "in the afternoon",
|
|
1428
|
+
evening: "in the evening",
|
|
1429
|
+
night: "at night"
|
|
1430
|
+
},
|
|
1431
|
+
abbreviated: {
|
|
1432
|
+
am: "AM",
|
|
1433
|
+
pm: "PM",
|
|
1434
|
+
midnight: "midnight",
|
|
1435
|
+
noon: "noon",
|
|
1436
|
+
morning: "in the morning",
|
|
1437
|
+
afternoon: "in the afternoon",
|
|
1438
|
+
evening: "in the evening",
|
|
1439
|
+
night: "at night"
|
|
1440
|
+
},
|
|
1441
|
+
wide: {
|
|
1442
|
+
am: "a.m.",
|
|
1443
|
+
pm: "p.m.",
|
|
1444
|
+
midnight: "midnight",
|
|
1445
|
+
noon: "noon",
|
|
1446
|
+
morning: "in the morning",
|
|
1447
|
+
afternoon: "in the afternoon",
|
|
1448
|
+
evening: "in the evening",
|
|
1449
|
+
night: "at night"
|
|
1450
|
+
}
|
|
1451
|
+
}, pi = (e, t) => {
|
|
1452
|
+
const r = Number(e), n = r % 100;
|
|
1453
|
+
if (n > 20 || n < 10)
|
|
1454
|
+
switch (n % 10) {
|
|
1455
|
+
case 1:
|
|
1456
|
+
return r + "st";
|
|
1457
|
+
case 2:
|
|
1458
|
+
return r + "nd";
|
|
1459
|
+
case 3:
|
|
1460
|
+
return r + "rd";
|
|
1461
|
+
}
|
|
1462
|
+
return r + "th";
|
|
1463
|
+
}, gi = {
|
|
1464
|
+
ordinalNumber: pi,
|
|
1465
|
+
era: ae({
|
|
1466
|
+
values: li,
|
|
1467
|
+
defaultWidth: "wide"
|
|
1468
|
+
}),
|
|
1469
|
+
quarter: ae({
|
|
1470
|
+
values: di,
|
|
1471
|
+
defaultWidth: "wide",
|
|
1472
|
+
argumentCallback: (e) => e - 1
|
|
1473
|
+
}),
|
|
1474
|
+
month: ae({
|
|
1475
|
+
values: fi,
|
|
1476
|
+
defaultWidth: "wide"
|
|
1477
|
+
}),
|
|
1478
|
+
day: ae({
|
|
1479
|
+
values: hi,
|
|
1480
|
+
defaultWidth: "wide"
|
|
1481
|
+
}),
|
|
1482
|
+
dayPeriod: ae({
|
|
1483
|
+
values: mi,
|
|
1484
|
+
defaultWidth: "wide",
|
|
1485
|
+
formattingValues: yi,
|
|
1486
|
+
defaultFormattingWidth: "wide"
|
|
1487
|
+
})
|
|
1488
|
+
};
|
|
1489
|
+
function ie(e) {
|
|
1490
|
+
return (t, r = {}) => {
|
|
1491
|
+
const n = r.width, i = n && e.matchPatterns[n] || e.matchPatterns[e.defaultMatchWidth], o = t.match(i);
|
|
1492
|
+
if (!o)
|
|
1493
|
+
return null;
|
|
1494
|
+
const c = o[0], d = n && e.parsePatterns[n] || e.parsePatterns[e.defaultParseWidth], h = Array.isArray(d) ? wi(d, (y) => y.test(c)) : (
|
|
1495
|
+
// [TODO] -- I challenge you to fix the type
|
|
1496
|
+
_i(d, (y) => y.test(c))
|
|
1497
|
+
);
|
|
1498
|
+
let f;
|
|
1499
|
+
f = e.valueCallback ? e.valueCallback(h) : h, f = r.valueCallback ? (
|
|
1500
|
+
// [TODO] -- I challenge you to fix the type
|
|
1501
|
+
r.valueCallback(f)
|
|
1502
|
+
) : f;
|
|
1503
|
+
const _ = t.slice(c.length);
|
|
1504
|
+
return { value: f, rest: _ };
|
|
1505
|
+
};
|
|
1506
|
+
}
|
|
1507
|
+
function _i(e, t) {
|
|
1508
|
+
for (const r in e)
|
|
1509
|
+
if (Object.prototype.hasOwnProperty.call(e, r) && t(e[r]))
|
|
1510
|
+
return r;
|
|
1511
|
+
}
|
|
1512
|
+
function wi(e, t) {
|
|
1513
|
+
for (let r = 0; r < e.length; r++)
|
|
1514
|
+
if (t(e[r]))
|
|
1515
|
+
return r;
|
|
1516
|
+
}
|
|
1517
|
+
function bi(e) {
|
|
1518
|
+
return (t, r = {}) => {
|
|
1519
|
+
const n = t.match(e.matchPattern);
|
|
1520
|
+
if (!n) return null;
|
|
1521
|
+
const i = n[0], o = t.match(e.parsePattern);
|
|
1522
|
+
if (!o) return null;
|
|
1523
|
+
let c = e.valueCallback ? e.valueCallback(o[0]) : o[0];
|
|
1524
|
+
c = r.valueCallback ? r.valueCallback(c) : c;
|
|
1525
|
+
const d = t.slice(i.length);
|
|
1526
|
+
return { value: c, rest: d };
|
|
1527
|
+
};
|
|
1528
|
+
}
|
|
1529
|
+
const Ti = /^(\d+)(th|st|nd|rd)?/i, Di = /\d+/i, Oi = {
|
|
1530
|
+
narrow: /^(b|a)/i,
|
|
1531
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
1532
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
1533
|
+
}, Si = {
|
|
1534
|
+
any: [/^b/i, /^(a|c)/i]
|
|
1535
|
+
}, vi = {
|
|
1536
|
+
narrow: /^[1234]/i,
|
|
1537
|
+
abbreviated: /^q[1234]/i,
|
|
1538
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
1539
|
+
}, Mi = {
|
|
1540
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
1541
|
+
}, xi = {
|
|
1542
|
+
narrow: /^[jfmasond]/i,
|
|
1543
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
1544
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
1545
|
+
}, Ei = {
|
|
1546
|
+
narrow: [
|
|
1547
|
+
/^j/i,
|
|
1548
|
+
/^f/i,
|
|
1549
|
+
/^m/i,
|
|
1550
|
+
/^a/i,
|
|
1551
|
+
/^m/i,
|
|
1552
|
+
/^j/i,
|
|
1553
|
+
/^j/i,
|
|
1554
|
+
/^a/i,
|
|
1555
|
+
/^s/i,
|
|
1556
|
+
/^o/i,
|
|
1557
|
+
/^n/i,
|
|
1558
|
+
/^d/i
|
|
1559
|
+
],
|
|
1560
|
+
any: [
|
|
1561
|
+
/^ja/i,
|
|
1562
|
+
/^f/i,
|
|
1563
|
+
/^mar/i,
|
|
1564
|
+
/^ap/i,
|
|
1565
|
+
/^may/i,
|
|
1566
|
+
/^jun/i,
|
|
1567
|
+
/^jul/i,
|
|
1568
|
+
/^au/i,
|
|
1569
|
+
/^s/i,
|
|
1570
|
+
/^o/i,
|
|
1571
|
+
/^n/i,
|
|
1572
|
+
/^d/i
|
|
1573
|
+
]
|
|
1574
|
+
}, Pi = {
|
|
1575
|
+
narrow: /^[smtwf]/i,
|
|
1576
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
1577
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
1578
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
1579
|
+
}, Ni = {
|
|
1580
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
1581
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
1582
|
+
}, Ci = {
|
|
1583
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
1584
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
1585
|
+
}, Ii = {
|
|
1586
|
+
any: {
|
|
1587
|
+
am: /^a/i,
|
|
1588
|
+
pm: /^p/i,
|
|
1589
|
+
midnight: /^mi/i,
|
|
1590
|
+
noon: /^no/i,
|
|
1591
|
+
morning: /morning/i,
|
|
1592
|
+
afternoon: /afternoon/i,
|
|
1593
|
+
evening: /evening/i,
|
|
1594
|
+
night: /night/i
|
|
1595
|
+
}
|
|
1596
|
+
}, ki = {
|
|
1597
|
+
ordinalNumber: bi({
|
|
1598
|
+
matchPattern: Ti,
|
|
1599
|
+
parsePattern: Di,
|
|
1600
|
+
valueCallback: (e) => parseInt(e, 10)
|
|
1601
|
+
}),
|
|
1602
|
+
era: ie({
|
|
1603
|
+
matchPatterns: Oi,
|
|
1604
|
+
defaultMatchWidth: "wide",
|
|
1605
|
+
parsePatterns: Si,
|
|
1606
|
+
defaultParseWidth: "any"
|
|
1607
|
+
}),
|
|
1608
|
+
quarter: ie({
|
|
1609
|
+
matchPatterns: vi,
|
|
1610
|
+
defaultMatchWidth: "wide",
|
|
1611
|
+
parsePatterns: Mi,
|
|
1612
|
+
defaultParseWidth: "any",
|
|
1613
|
+
valueCallback: (e) => e + 1
|
|
1614
|
+
}),
|
|
1615
|
+
month: ie({
|
|
1616
|
+
matchPatterns: xi,
|
|
1617
|
+
defaultMatchWidth: "wide",
|
|
1618
|
+
parsePatterns: Ei,
|
|
1619
|
+
defaultParseWidth: "any"
|
|
1620
|
+
}),
|
|
1621
|
+
day: ie({
|
|
1622
|
+
matchPatterns: Pi,
|
|
1623
|
+
defaultMatchWidth: "wide",
|
|
1624
|
+
parsePatterns: Ni,
|
|
1625
|
+
defaultParseWidth: "any"
|
|
1626
|
+
}),
|
|
1627
|
+
dayPeriod: ie({
|
|
1628
|
+
matchPatterns: Ci,
|
|
1629
|
+
defaultMatchWidth: "any",
|
|
1630
|
+
parsePatterns: Ii,
|
|
1631
|
+
defaultParseWidth: "any"
|
|
1632
|
+
})
|
|
1633
|
+
}, Yi = {
|
|
1634
|
+
code: "en-US",
|
|
1635
|
+
formatDistance: ni,
|
|
1636
|
+
formatLong: oi,
|
|
1637
|
+
formatRelative: ci,
|
|
1638
|
+
localize: gi,
|
|
1639
|
+
match: ki,
|
|
1640
|
+
options: {
|
|
1641
|
+
weekStartsOn: 0,
|
|
1642
|
+
firstWeekContainsDate: 1
|
|
1643
|
+
}
|
|
1644
|
+
};
|
|
1645
|
+
function Ri(e, t) {
|
|
1646
|
+
const r = O(e, t == null ? void 0 : t.in);
|
|
1647
|
+
return Ba(r, ti(r)) + 1;
|
|
1648
|
+
}
|
|
1649
|
+
function qi(e, t) {
|
|
1650
|
+
const r = O(e, t == null ? void 0 : t.in), n = +De(r) - +Ka(r);
|
|
1651
|
+
return Math.round(n / Yr) + 1;
|
|
1652
|
+
}
|
|
1653
|
+
function qr(e, t) {
|
|
1654
|
+
var _, y, p, E;
|
|
1655
|
+
const r = O(e, t == null ? void 0 : t.in), n = r.getFullYear(), i = fe(), o = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((y = (_ = t == null ? void 0 : t.locale) == null ? void 0 : _.options) == null ? void 0 : y.firstWeekContainsDate) ?? i.firstWeekContainsDate ?? ((E = (p = i.locale) == null ? void 0 : p.options) == null ? void 0 : E.firstWeekContainsDate) ?? 1, c = I((t == null ? void 0 : t.in) || e, 0);
|
|
1656
|
+
c.setFullYear(n + 1, 0, o), c.setHours(0, 0, 0, 0);
|
|
1657
|
+
const d = H(c, t), h = I((t == null ? void 0 : t.in) || e, 0);
|
|
1658
|
+
h.setFullYear(n, 0, o), h.setHours(0, 0, 0, 0);
|
|
1659
|
+
const f = H(h, t);
|
|
1660
|
+
return +r >= +d ? n + 1 : +r >= +f ? n : n - 1;
|
|
1661
|
+
}
|
|
1662
|
+
function Hi(e, t) {
|
|
1663
|
+
var d, h, f, _;
|
|
1664
|
+
const r = fe(), n = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((h = (d = t == null ? void 0 : t.locale) == null ? void 0 : d.options) == null ? void 0 : h.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((_ = (f = r.locale) == null ? void 0 : f.options) == null ? void 0 : _.firstWeekContainsDate) ?? 1, i = qr(e, t), o = I((t == null ? void 0 : t.in) || e, 0);
|
|
1665
|
+
return o.setFullYear(i, 0, n), o.setHours(0, 0, 0, 0), H(o, t);
|
|
1666
|
+
}
|
|
1667
|
+
function ji(e, t) {
|
|
1668
|
+
const r = O(e, t == null ? void 0 : t.in), n = +H(r, t) - +Hi(r, t);
|
|
1669
|
+
return Math.round(n / Yr) + 1;
|
|
1670
|
+
}
|
|
1671
|
+
function g(e, t) {
|
|
1672
|
+
const r = e < 0 ? "-" : "", n = Math.abs(e).toString().padStart(t, "0");
|
|
1673
|
+
return r + n;
|
|
1674
|
+
}
|
|
1675
|
+
const A = {
|
|
1676
|
+
// Year
|
|
1677
|
+
y(e, t) {
|
|
1678
|
+
const r = e.getFullYear(), n = r > 0 ? r : 1 - r;
|
|
1679
|
+
return g(t === "yy" ? n % 100 : n, t.length);
|
|
1680
|
+
},
|
|
1681
|
+
// Month
|
|
1682
|
+
M(e, t) {
|
|
1683
|
+
const r = e.getMonth();
|
|
1684
|
+
return t === "M" ? String(r + 1) : g(r + 1, 2);
|
|
1685
|
+
},
|
|
1686
|
+
// Day of the month
|
|
1687
|
+
d(e, t) {
|
|
1688
|
+
return g(e.getDate(), t.length);
|
|
1689
|
+
},
|
|
1690
|
+
// AM or PM
|
|
1691
|
+
a(e, t) {
|
|
1692
|
+
const r = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1693
|
+
switch (t) {
|
|
1694
|
+
case "a":
|
|
1695
|
+
case "aa":
|
|
1696
|
+
return r.toUpperCase();
|
|
1697
|
+
case "aaa":
|
|
1698
|
+
return r;
|
|
1699
|
+
case "aaaaa":
|
|
1700
|
+
return r[0];
|
|
1701
|
+
case "aaaa":
|
|
1702
|
+
default:
|
|
1703
|
+
return r === "am" ? "a.m." : "p.m.";
|
|
1704
|
+
}
|
|
1705
|
+
},
|
|
1706
|
+
// Hour [1-12]
|
|
1707
|
+
h(e, t) {
|
|
1708
|
+
return g(e.getHours() % 12 || 12, t.length);
|
|
1709
|
+
},
|
|
1710
|
+
// Hour [0-23]
|
|
1711
|
+
H(e, t) {
|
|
1712
|
+
return g(e.getHours(), t.length);
|
|
1713
|
+
},
|
|
1714
|
+
// Minute
|
|
1715
|
+
m(e, t) {
|
|
1716
|
+
return g(e.getMinutes(), t.length);
|
|
1717
|
+
},
|
|
1718
|
+
// Second
|
|
1719
|
+
s(e, t) {
|
|
1720
|
+
return g(e.getSeconds(), t.length);
|
|
1721
|
+
},
|
|
1722
|
+
// Fraction of second
|
|
1723
|
+
S(e, t) {
|
|
1724
|
+
const r = t.length, n = e.getMilliseconds(), i = Math.trunc(
|
|
1725
|
+
n * Math.pow(10, r - 3)
|
|
1726
|
+
);
|
|
1727
|
+
return g(i, t.length);
|
|
1728
|
+
}
|
|
1729
|
+
}, K = {
|
|
1730
|
+
am: "am",
|
|
1731
|
+
pm: "pm",
|
|
1732
|
+
midnight: "midnight",
|
|
1733
|
+
noon: "noon",
|
|
1734
|
+
morning: "morning",
|
|
1735
|
+
afternoon: "afternoon",
|
|
1736
|
+
evening: "evening",
|
|
1737
|
+
night: "night"
|
|
1738
|
+
}, $t = {
|
|
1739
|
+
// Era
|
|
1740
|
+
G: function(e, t, r) {
|
|
1741
|
+
const n = e.getFullYear() > 0 ? 1 : 0;
|
|
1742
|
+
switch (t) {
|
|
1743
|
+
case "G":
|
|
1744
|
+
case "GG":
|
|
1745
|
+
case "GGG":
|
|
1746
|
+
return r.era(n, { width: "abbreviated" });
|
|
1747
|
+
case "GGGGG":
|
|
1748
|
+
return r.era(n, { width: "narrow" });
|
|
1749
|
+
case "GGGG":
|
|
1750
|
+
default:
|
|
1751
|
+
return r.era(n, { width: "wide" });
|
|
1752
|
+
}
|
|
1753
|
+
},
|
|
1754
|
+
// Year
|
|
1755
|
+
y: function(e, t, r) {
|
|
1756
|
+
if (t === "yo") {
|
|
1757
|
+
const n = e.getFullYear(), i = n > 0 ? n : 1 - n;
|
|
1758
|
+
return r.ordinalNumber(i, { unit: "year" });
|
|
1759
|
+
}
|
|
1760
|
+
return A.y(e, t);
|
|
1761
|
+
},
|
|
1762
|
+
// Local week-numbering year
|
|
1763
|
+
Y: function(e, t, r, n) {
|
|
1764
|
+
const i = qr(e, n), o = i > 0 ? i : 1 - i;
|
|
1765
|
+
if (t === "YY") {
|
|
1766
|
+
const c = o % 100;
|
|
1767
|
+
return g(c, 2);
|
|
1768
|
+
}
|
|
1769
|
+
return t === "Yo" ? r.ordinalNumber(o, { unit: "year" }) : g(o, t.length);
|
|
1770
|
+
},
|
|
1771
|
+
// ISO week-numbering year
|
|
1772
|
+
R: function(e, t) {
|
|
1773
|
+
const r = Rr(e);
|
|
1774
|
+
return g(r, t.length);
|
|
1775
|
+
},
|
|
1776
|
+
// Extended year. This is a single number designating the year of this calendar system.
|
|
1777
|
+
// The main difference between `y` and `u` localizers are B.C. years:
|
|
1778
|
+
// | Year | `y` | `u` |
|
|
1779
|
+
// |------|-----|-----|
|
|
1780
|
+
// | AC 1 | 1 | 1 |
|
|
1781
|
+
// | BC 1 | 1 | 0 |
|
|
1782
|
+
// | BC 2 | 2 | -1 |
|
|
1783
|
+
// Also `yy` always returns the last two digits of a year,
|
|
1784
|
+
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
1785
|
+
u: function(e, t) {
|
|
1786
|
+
const r = e.getFullYear();
|
|
1787
|
+
return g(r, t.length);
|
|
1788
|
+
},
|
|
1789
|
+
// Quarter
|
|
1790
|
+
Q: function(e, t, r) {
|
|
1791
|
+
const n = Math.ceil((e.getMonth() + 1) / 3);
|
|
1792
|
+
switch (t) {
|
|
1793
|
+
case "Q":
|
|
1794
|
+
return String(n);
|
|
1795
|
+
case "QQ":
|
|
1796
|
+
return g(n, 2);
|
|
1797
|
+
case "Qo":
|
|
1798
|
+
return r.ordinalNumber(n, { unit: "quarter" });
|
|
1799
|
+
case "QQQ":
|
|
1800
|
+
return r.quarter(n, {
|
|
1801
|
+
width: "abbreviated",
|
|
1802
|
+
context: "formatting"
|
|
1803
|
+
});
|
|
1804
|
+
case "QQQQQ":
|
|
1805
|
+
return r.quarter(n, {
|
|
1806
|
+
width: "narrow",
|
|
1807
|
+
context: "formatting"
|
|
1808
|
+
});
|
|
1809
|
+
case "QQQQ":
|
|
1810
|
+
default:
|
|
1811
|
+
return r.quarter(n, {
|
|
1812
|
+
width: "wide",
|
|
1813
|
+
context: "formatting"
|
|
1814
|
+
});
|
|
1815
|
+
}
|
|
1816
|
+
},
|
|
1817
|
+
// Stand-alone quarter
|
|
1818
|
+
q: function(e, t, r) {
|
|
1819
|
+
const n = Math.ceil((e.getMonth() + 1) / 3);
|
|
1820
|
+
switch (t) {
|
|
1821
|
+
case "q":
|
|
1822
|
+
return String(n);
|
|
1823
|
+
case "qq":
|
|
1824
|
+
return g(n, 2);
|
|
1825
|
+
case "qo":
|
|
1826
|
+
return r.ordinalNumber(n, { unit: "quarter" });
|
|
1827
|
+
case "qqq":
|
|
1828
|
+
return r.quarter(n, {
|
|
1829
|
+
width: "abbreviated",
|
|
1830
|
+
context: "standalone"
|
|
1831
|
+
});
|
|
1832
|
+
case "qqqqq":
|
|
1833
|
+
return r.quarter(n, {
|
|
1834
|
+
width: "narrow",
|
|
1835
|
+
context: "standalone"
|
|
1836
|
+
});
|
|
1837
|
+
case "qqqq":
|
|
1838
|
+
default:
|
|
1839
|
+
return r.quarter(n, {
|
|
1840
|
+
width: "wide",
|
|
1841
|
+
context: "standalone"
|
|
1842
|
+
});
|
|
1843
|
+
}
|
|
1844
|
+
},
|
|
1845
|
+
// Month
|
|
1846
|
+
M: function(e, t, r) {
|
|
1847
|
+
const n = e.getMonth();
|
|
1848
|
+
switch (t) {
|
|
1849
|
+
case "M":
|
|
1850
|
+
case "MM":
|
|
1851
|
+
return A.M(e, t);
|
|
1852
|
+
case "Mo":
|
|
1853
|
+
return r.ordinalNumber(n + 1, { unit: "month" });
|
|
1854
|
+
case "MMM":
|
|
1855
|
+
return r.month(n, {
|
|
1856
|
+
width: "abbreviated",
|
|
1857
|
+
context: "formatting"
|
|
1858
|
+
});
|
|
1859
|
+
case "MMMMM":
|
|
1860
|
+
return r.month(n, {
|
|
1861
|
+
width: "narrow",
|
|
1862
|
+
context: "formatting"
|
|
1863
|
+
});
|
|
1864
|
+
case "MMMM":
|
|
1865
|
+
default:
|
|
1866
|
+
return r.month(n, { width: "wide", context: "formatting" });
|
|
1867
|
+
}
|
|
1868
|
+
},
|
|
1869
|
+
// Stand-alone month
|
|
1870
|
+
L: function(e, t, r) {
|
|
1871
|
+
const n = e.getMonth();
|
|
1872
|
+
switch (t) {
|
|
1873
|
+
case "L":
|
|
1874
|
+
return String(n + 1);
|
|
1875
|
+
case "LL":
|
|
1876
|
+
return g(n + 1, 2);
|
|
1877
|
+
case "Lo":
|
|
1878
|
+
return r.ordinalNumber(n + 1, { unit: "month" });
|
|
1879
|
+
case "LLL":
|
|
1880
|
+
return r.month(n, {
|
|
1881
|
+
width: "abbreviated",
|
|
1882
|
+
context: "standalone"
|
|
1883
|
+
});
|
|
1884
|
+
case "LLLLL":
|
|
1885
|
+
return r.month(n, {
|
|
1886
|
+
width: "narrow",
|
|
1887
|
+
context: "standalone"
|
|
1888
|
+
});
|
|
1889
|
+
case "LLLL":
|
|
1890
|
+
default:
|
|
1891
|
+
return r.month(n, { width: "wide", context: "standalone" });
|
|
1892
|
+
}
|
|
1893
|
+
},
|
|
1894
|
+
// Local week of year
|
|
1895
|
+
w: function(e, t, r, n) {
|
|
1896
|
+
const i = ji(e, n);
|
|
1897
|
+
return t === "wo" ? r.ordinalNumber(i, { unit: "week" }) : g(i, t.length);
|
|
1898
|
+
},
|
|
1899
|
+
// ISO week of year
|
|
1900
|
+
I: function(e, t, r) {
|
|
1901
|
+
const n = qi(e);
|
|
1902
|
+
return t === "Io" ? r.ordinalNumber(n, { unit: "week" }) : g(n, t.length);
|
|
1903
|
+
},
|
|
1904
|
+
// Day of the month
|
|
1905
|
+
d: function(e, t, r) {
|
|
1906
|
+
return t === "do" ? r.ordinalNumber(e.getDate(), { unit: "date" }) : A.d(e, t);
|
|
1907
|
+
},
|
|
1908
|
+
// Day of year
|
|
1909
|
+
D: function(e, t, r) {
|
|
1910
|
+
const n = Ri(e);
|
|
1911
|
+
return t === "Do" ? r.ordinalNumber(n, { unit: "dayOfYear" }) : g(n, t.length);
|
|
1912
|
+
},
|
|
1913
|
+
// Day of week
|
|
1914
|
+
E: function(e, t, r) {
|
|
1915
|
+
const n = e.getDay();
|
|
1916
|
+
switch (t) {
|
|
1917
|
+
case "E":
|
|
1918
|
+
case "EE":
|
|
1919
|
+
case "EEE":
|
|
1920
|
+
return r.day(n, {
|
|
1921
|
+
width: "abbreviated",
|
|
1922
|
+
context: "formatting"
|
|
1923
|
+
});
|
|
1924
|
+
case "EEEEE":
|
|
1925
|
+
return r.day(n, {
|
|
1926
|
+
width: "narrow",
|
|
1927
|
+
context: "formatting"
|
|
1928
|
+
});
|
|
1929
|
+
case "EEEEEE":
|
|
1930
|
+
return r.day(n, {
|
|
1931
|
+
width: "short",
|
|
1932
|
+
context: "formatting"
|
|
1933
|
+
});
|
|
1934
|
+
case "EEEE":
|
|
1935
|
+
default:
|
|
1936
|
+
return r.day(n, {
|
|
1937
|
+
width: "wide",
|
|
1938
|
+
context: "formatting"
|
|
1939
|
+
});
|
|
1940
|
+
}
|
|
1941
|
+
},
|
|
1942
|
+
// Local day of week
|
|
1943
|
+
e: function(e, t, r, n) {
|
|
1944
|
+
const i = e.getDay(), o = (i - n.weekStartsOn + 8) % 7 || 7;
|
|
1945
|
+
switch (t) {
|
|
1946
|
+
case "e":
|
|
1947
|
+
return String(o);
|
|
1948
|
+
case "ee":
|
|
1949
|
+
return g(o, 2);
|
|
1950
|
+
case "eo":
|
|
1951
|
+
return r.ordinalNumber(o, { unit: "day" });
|
|
1952
|
+
case "eee":
|
|
1953
|
+
return r.day(i, {
|
|
1954
|
+
width: "abbreviated",
|
|
1955
|
+
context: "formatting"
|
|
1956
|
+
});
|
|
1957
|
+
case "eeeee":
|
|
1958
|
+
return r.day(i, {
|
|
1959
|
+
width: "narrow",
|
|
1960
|
+
context: "formatting"
|
|
1961
|
+
});
|
|
1962
|
+
case "eeeeee":
|
|
1963
|
+
return r.day(i, {
|
|
1964
|
+
width: "short",
|
|
1965
|
+
context: "formatting"
|
|
1966
|
+
});
|
|
1967
|
+
case "eeee":
|
|
1968
|
+
default:
|
|
1969
|
+
return r.day(i, {
|
|
1970
|
+
width: "wide",
|
|
1971
|
+
context: "formatting"
|
|
1972
|
+
});
|
|
1973
|
+
}
|
|
1974
|
+
},
|
|
1975
|
+
// Stand-alone local day of week
|
|
1976
|
+
c: function(e, t, r, n) {
|
|
1977
|
+
const i = e.getDay(), o = (i - n.weekStartsOn + 8) % 7 || 7;
|
|
1978
|
+
switch (t) {
|
|
1979
|
+
case "c":
|
|
1980
|
+
return String(o);
|
|
1981
|
+
case "cc":
|
|
1982
|
+
return g(o, t.length);
|
|
1983
|
+
case "co":
|
|
1984
|
+
return r.ordinalNumber(o, { unit: "day" });
|
|
1985
|
+
case "ccc":
|
|
1986
|
+
return r.day(i, {
|
|
1987
|
+
width: "abbreviated",
|
|
1988
|
+
context: "standalone"
|
|
1989
|
+
});
|
|
1990
|
+
case "ccccc":
|
|
1991
|
+
return r.day(i, {
|
|
1992
|
+
width: "narrow",
|
|
1993
|
+
context: "standalone"
|
|
1994
|
+
});
|
|
1995
|
+
case "cccccc":
|
|
1996
|
+
return r.day(i, {
|
|
1997
|
+
width: "short",
|
|
1998
|
+
context: "standalone"
|
|
1999
|
+
});
|
|
2000
|
+
case "cccc":
|
|
2001
|
+
default:
|
|
2002
|
+
return r.day(i, {
|
|
2003
|
+
width: "wide",
|
|
2004
|
+
context: "standalone"
|
|
2005
|
+
});
|
|
2006
|
+
}
|
|
2007
|
+
},
|
|
2008
|
+
// ISO day of week
|
|
2009
|
+
i: function(e, t, r) {
|
|
2010
|
+
const n = e.getDay(), i = n === 0 ? 7 : n;
|
|
2011
|
+
switch (t) {
|
|
2012
|
+
case "i":
|
|
2013
|
+
return String(i);
|
|
2014
|
+
case "ii":
|
|
2015
|
+
return g(i, t.length);
|
|
2016
|
+
case "io":
|
|
2017
|
+
return r.ordinalNumber(i, { unit: "day" });
|
|
2018
|
+
case "iii":
|
|
2019
|
+
return r.day(n, {
|
|
2020
|
+
width: "abbreviated",
|
|
2021
|
+
context: "formatting"
|
|
2022
|
+
});
|
|
2023
|
+
case "iiiii":
|
|
2024
|
+
return r.day(n, {
|
|
2025
|
+
width: "narrow",
|
|
2026
|
+
context: "formatting"
|
|
2027
|
+
});
|
|
2028
|
+
case "iiiiii":
|
|
2029
|
+
return r.day(n, {
|
|
2030
|
+
width: "short",
|
|
2031
|
+
context: "formatting"
|
|
2032
|
+
});
|
|
2033
|
+
case "iiii":
|
|
2034
|
+
default:
|
|
2035
|
+
return r.day(n, {
|
|
2036
|
+
width: "wide",
|
|
2037
|
+
context: "formatting"
|
|
2038
|
+
});
|
|
2039
|
+
}
|
|
2040
|
+
},
|
|
2041
|
+
// AM or PM
|
|
2042
|
+
a: function(e, t, r) {
|
|
2043
|
+
const i = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
2044
|
+
switch (t) {
|
|
2045
|
+
case "a":
|
|
2046
|
+
case "aa":
|
|
2047
|
+
return r.dayPeriod(i, {
|
|
2048
|
+
width: "abbreviated",
|
|
2049
|
+
context: "formatting"
|
|
2050
|
+
});
|
|
2051
|
+
case "aaa":
|
|
2052
|
+
return r.dayPeriod(i, {
|
|
2053
|
+
width: "abbreviated",
|
|
2054
|
+
context: "formatting"
|
|
2055
|
+
}).toLowerCase();
|
|
2056
|
+
case "aaaaa":
|
|
2057
|
+
return r.dayPeriod(i, {
|
|
2058
|
+
width: "narrow",
|
|
2059
|
+
context: "formatting"
|
|
2060
|
+
});
|
|
2061
|
+
case "aaaa":
|
|
2062
|
+
default:
|
|
2063
|
+
return r.dayPeriod(i, {
|
|
2064
|
+
width: "wide",
|
|
2065
|
+
context: "formatting"
|
|
2066
|
+
});
|
|
2067
|
+
}
|
|
2068
|
+
},
|
|
2069
|
+
// AM, PM, midnight, noon
|
|
2070
|
+
b: function(e, t, r) {
|
|
2071
|
+
const n = e.getHours();
|
|
2072
|
+
let i;
|
|
2073
|
+
switch (n === 12 ? i = K.noon : n === 0 ? i = K.midnight : i = n / 12 >= 1 ? "pm" : "am", t) {
|
|
2074
|
+
case "b":
|
|
2075
|
+
case "bb":
|
|
2076
|
+
return r.dayPeriod(i, {
|
|
2077
|
+
width: "abbreviated",
|
|
2078
|
+
context: "formatting"
|
|
2079
|
+
});
|
|
2080
|
+
case "bbb":
|
|
2081
|
+
return r.dayPeriod(i, {
|
|
2082
|
+
width: "abbreviated",
|
|
2083
|
+
context: "formatting"
|
|
2084
|
+
}).toLowerCase();
|
|
2085
|
+
case "bbbbb":
|
|
2086
|
+
return r.dayPeriod(i, {
|
|
2087
|
+
width: "narrow",
|
|
2088
|
+
context: "formatting"
|
|
2089
|
+
});
|
|
2090
|
+
case "bbbb":
|
|
2091
|
+
default:
|
|
2092
|
+
return r.dayPeriod(i, {
|
|
2093
|
+
width: "wide",
|
|
2094
|
+
context: "formatting"
|
|
2095
|
+
});
|
|
2096
|
+
}
|
|
2097
|
+
},
|
|
2098
|
+
// in the morning, in the afternoon, in the evening, at night
|
|
2099
|
+
B: function(e, t, r) {
|
|
2100
|
+
const n = e.getHours();
|
|
2101
|
+
let i;
|
|
2102
|
+
switch (n >= 17 ? i = K.evening : n >= 12 ? i = K.afternoon : n >= 4 ? i = K.morning : i = K.night, t) {
|
|
2103
|
+
case "B":
|
|
2104
|
+
case "BB":
|
|
2105
|
+
case "BBB":
|
|
2106
|
+
return r.dayPeriod(i, {
|
|
2107
|
+
width: "abbreviated",
|
|
2108
|
+
context: "formatting"
|
|
2109
|
+
});
|
|
2110
|
+
case "BBBBB":
|
|
2111
|
+
return r.dayPeriod(i, {
|
|
2112
|
+
width: "narrow",
|
|
2113
|
+
context: "formatting"
|
|
2114
|
+
});
|
|
2115
|
+
case "BBBB":
|
|
2116
|
+
default:
|
|
2117
|
+
return r.dayPeriod(i, {
|
|
2118
|
+
width: "wide",
|
|
2119
|
+
context: "formatting"
|
|
2120
|
+
});
|
|
2121
|
+
}
|
|
2122
|
+
},
|
|
2123
|
+
// Hour [1-12]
|
|
2124
|
+
h: function(e, t, r) {
|
|
2125
|
+
if (t === "ho") {
|
|
2126
|
+
let n = e.getHours() % 12;
|
|
2127
|
+
return n === 0 && (n = 12), r.ordinalNumber(n, { unit: "hour" });
|
|
2128
|
+
}
|
|
2129
|
+
return A.h(e, t);
|
|
2130
|
+
},
|
|
2131
|
+
// Hour [0-23]
|
|
2132
|
+
H: function(e, t, r) {
|
|
2133
|
+
return t === "Ho" ? r.ordinalNumber(e.getHours(), { unit: "hour" }) : A.H(e, t);
|
|
2134
|
+
},
|
|
2135
|
+
// Hour [0-11]
|
|
2136
|
+
K: function(e, t, r) {
|
|
2137
|
+
const n = e.getHours() % 12;
|
|
2138
|
+
return t === "Ko" ? r.ordinalNumber(n, { unit: "hour" }) : g(n, t.length);
|
|
2139
|
+
},
|
|
2140
|
+
// Hour [1-24]
|
|
2141
|
+
k: function(e, t, r) {
|
|
2142
|
+
let n = e.getHours();
|
|
2143
|
+
return n === 0 && (n = 24), t === "ko" ? r.ordinalNumber(n, { unit: "hour" }) : g(n, t.length);
|
|
2144
|
+
},
|
|
2145
|
+
// Minute
|
|
2146
|
+
m: function(e, t, r) {
|
|
2147
|
+
return t === "mo" ? r.ordinalNumber(e.getMinutes(), { unit: "minute" }) : A.m(e, t);
|
|
2148
|
+
},
|
|
2149
|
+
// Second
|
|
2150
|
+
s: function(e, t, r) {
|
|
2151
|
+
return t === "so" ? r.ordinalNumber(e.getSeconds(), { unit: "second" }) : A.s(e, t);
|
|
2152
|
+
},
|
|
2153
|
+
// Fraction of second
|
|
2154
|
+
S: function(e, t) {
|
|
2155
|
+
return A.S(e, t);
|
|
2156
|
+
},
|
|
2157
|
+
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
2158
|
+
X: function(e, t, r) {
|
|
2159
|
+
const n = e.getTimezoneOffset();
|
|
2160
|
+
if (n === 0)
|
|
2161
|
+
return "Z";
|
|
2162
|
+
switch (t) {
|
|
2163
|
+
case "X":
|
|
2164
|
+
return Xt(n);
|
|
2165
|
+
case "XXXX":
|
|
2166
|
+
case "XX":
|
|
2167
|
+
return z(n);
|
|
2168
|
+
case "XXXXX":
|
|
2169
|
+
case "XXX":
|
|
2170
|
+
default:
|
|
2171
|
+
return z(n, ":");
|
|
2172
|
+
}
|
|
2173
|
+
},
|
|
2174
|
+
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
2175
|
+
x: function(e, t, r) {
|
|
2176
|
+
const n = e.getTimezoneOffset();
|
|
2177
|
+
switch (t) {
|
|
2178
|
+
case "x":
|
|
2179
|
+
return Xt(n);
|
|
2180
|
+
case "xxxx":
|
|
2181
|
+
case "xx":
|
|
2182
|
+
return z(n);
|
|
2183
|
+
case "xxxxx":
|
|
2184
|
+
case "xxx":
|
|
2185
|
+
default:
|
|
2186
|
+
return z(n, ":");
|
|
2187
|
+
}
|
|
2188
|
+
},
|
|
2189
|
+
// Timezone (GMT)
|
|
2190
|
+
O: function(e, t, r) {
|
|
2191
|
+
const n = e.getTimezoneOffset();
|
|
2192
|
+
switch (t) {
|
|
2193
|
+
case "O":
|
|
2194
|
+
case "OO":
|
|
2195
|
+
case "OOO":
|
|
2196
|
+
return "GMT" + Vt(n, ":");
|
|
2197
|
+
case "OOOO":
|
|
2198
|
+
default:
|
|
2199
|
+
return "GMT" + z(n, ":");
|
|
2200
|
+
}
|
|
2201
|
+
},
|
|
2202
|
+
// Timezone (specific non-location)
|
|
2203
|
+
z: function(e, t, r) {
|
|
2204
|
+
const n = e.getTimezoneOffset();
|
|
2205
|
+
switch (t) {
|
|
2206
|
+
case "z":
|
|
2207
|
+
case "zz":
|
|
2208
|
+
case "zzz":
|
|
2209
|
+
return "GMT" + Vt(n, ":");
|
|
2210
|
+
case "zzzz":
|
|
2211
|
+
default:
|
|
2212
|
+
return "GMT" + z(n, ":");
|
|
2213
|
+
}
|
|
2214
|
+
},
|
|
2215
|
+
// Seconds timestamp
|
|
2216
|
+
t: function(e, t, r) {
|
|
2217
|
+
const n = Math.trunc(+e / 1e3);
|
|
2218
|
+
return g(n, t.length);
|
|
2219
|
+
},
|
|
2220
|
+
// Milliseconds timestamp
|
|
2221
|
+
T: function(e, t, r) {
|
|
2222
|
+
return g(+e, t.length);
|
|
2223
|
+
}
|
|
2224
|
+
};
|
|
2225
|
+
function Vt(e, t = "") {
|
|
2226
|
+
const r = e > 0 ? "-" : "+", n = Math.abs(e), i = Math.trunc(n / 60), o = n % 60;
|
|
2227
|
+
return o === 0 ? r + String(i) : r + String(i) + t + g(o, 2);
|
|
2228
|
+
}
|
|
2229
|
+
function Xt(e, t) {
|
|
2230
|
+
return e % 60 === 0 ? (e > 0 ? "-" : "+") + g(Math.abs(e) / 60, 2) : z(e, t);
|
|
2231
|
+
}
|
|
2232
|
+
function z(e, t = "") {
|
|
2233
|
+
const r = e > 0 ? "-" : "+", n = Math.abs(e), i = g(Math.trunc(n / 60), 2), o = g(n % 60, 2);
|
|
2234
|
+
return r + i + t + o;
|
|
2235
|
+
}
|
|
2236
|
+
const Qt = (e, t) => {
|
|
2237
|
+
switch (e) {
|
|
2238
|
+
case "P":
|
|
2239
|
+
return t.date({ width: "short" });
|
|
2240
|
+
case "PP":
|
|
2241
|
+
return t.date({ width: "medium" });
|
|
2242
|
+
case "PPP":
|
|
2243
|
+
return t.date({ width: "long" });
|
|
2244
|
+
case "PPPP":
|
|
2245
|
+
default:
|
|
2246
|
+
return t.date({ width: "full" });
|
|
2247
|
+
}
|
|
2248
|
+
}, Hr = (e, t) => {
|
|
2249
|
+
switch (e) {
|
|
2250
|
+
case "p":
|
|
2251
|
+
return t.time({ width: "short" });
|
|
2252
|
+
case "pp":
|
|
2253
|
+
return t.time({ width: "medium" });
|
|
2254
|
+
case "ppp":
|
|
2255
|
+
return t.time({ width: "long" });
|
|
2256
|
+
case "pppp":
|
|
2257
|
+
default:
|
|
2258
|
+
return t.time({ width: "full" });
|
|
2259
|
+
}
|
|
2260
|
+
}, Ai = (e, t) => {
|
|
2261
|
+
const r = e.match(/(P+)(p+)?/) || [], n = r[1], i = r[2];
|
|
2262
|
+
if (!i)
|
|
2263
|
+
return Qt(e, t);
|
|
2264
|
+
let o;
|
|
2265
|
+
switch (n) {
|
|
2266
|
+
case "P":
|
|
2267
|
+
o = t.dateTime({ width: "short" });
|
|
2268
|
+
break;
|
|
2269
|
+
case "PP":
|
|
2270
|
+
o = t.dateTime({ width: "medium" });
|
|
2271
|
+
break;
|
|
2272
|
+
case "PPP":
|
|
2273
|
+
o = t.dateTime({ width: "long" });
|
|
2274
|
+
break;
|
|
2275
|
+
case "PPPP":
|
|
2276
|
+
default:
|
|
2277
|
+
o = t.dateTime({ width: "full" });
|
|
2278
|
+
break;
|
|
2279
|
+
}
|
|
2280
|
+
return o.replace("{{date}}", Qt(n, t)).replace("{{time}}", Hr(i, t));
|
|
2281
|
+
}, Gi = {
|
|
2282
|
+
p: Hr,
|
|
2283
|
+
P: Ai
|
|
2284
|
+
}, Fi = /^D+$/, Wi = /^Y+$/, Li = ["D", "DD", "YY", "YYYY"];
|
|
2285
|
+
function Ui(e) {
|
|
2286
|
+
return Fi.test(e);
|
|
2287
|
+
}
|
|
2288
|
+
function zi(e) {
|
|
2289
|
+
return Wi.test(e);
|
|
2290
|
+
}
|
|
2291
|
+
function $i(e, t, r) {
|
|
2292
|
+
const n = Vi(e, t, r);
|
|
2293
|
+
if (console.warn(n), Li.includes(e)) throw new RangeError(n);
|
|
2294
|
+
}
|
|
2295
|
+
function Vi(e, t, r) {
|
|
2296
|
+
const n = e[0] === "Y" ? "years" : "days of the month";
|
|
2297
|
+
return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
2298
|
+
}
|
|
2299
|
+
const Xi = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Qi = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Zi = /^'([^]*?)'?$/, Bi = /''/g, Ki = /[a-zA-Z]/;
|
|
2300
|
+
function jr(e, t, r) {
|
|
2301
|
+
var _, y, p, E, P, N, k, G;
|
|
2302
|
+
const n = fe(), i = (r == null ? void 0 : r.locale) ?? n.locale ?? Yi, o = (r == null ? void 0 : r.firstWeekContainsDate) ?? ((y = (_ = r == null ? void 0 : r.locale) == null ? void 0 : _.options) == null ? void 0 : y.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((E = (p = n.locale) == null ? void 0 : p.options) == null ? void 0 : E.firstWeekContainsDate) ?? 1, c = (r == null ? void 0 : r.weekStartsOn) ?? ((N = (P = r == null ? void 0 : r.locale) == null ? void 0 : P.options) == null ? void 0 : N.weekStartsOn) ?? n.weekStartsOn ?? ((G = (k = n.locale) == null ? void 0 : k.options) == null ? void 0 : G.weekStartsOn) ?? 0, d = O(e, r == null ? void 0 : r.in);
|
|
2303
|
+
if (!ei(d))
|
|
2304
|
+
throw new RangeError("Invalid time value");
|
|
2305
|
+
let h = t.match(Qi).map((S) => {
|
|
2306
|
+
const T = S[0];
|
|
2307
|
+
if (T === "p" || T === "P") {
|
|
2308
|
+
const F = Gi[T];
|
|
2309
|
+
return F(S, i.formatLong);
|
|
2310
|
+
}
|
|
2311
|
+
return S;
|
|
2312
|
+
}).join("").match(Xi).map((S) => {
|
|
2313
|
+
if (S === "''")
|
|
2314
|
+
return { isToken: !1, value: "'" };
|
|
2315
|
+
const T = S[0];
|
|
2316
|
+
if (T === "'")
|
|
2317
|
+
return { isToken: !1, value: Ji(S) };
|
|
2318
|
+
if ($t[T])
|
|
2319
|
+
return { isToken: !0, value: S };
|
|
2320
|
+
if (T.match(Ki))
|
|
2321
|
+
throw new RangeError(
|
|
2322
|
+
"Format string contains an unescaped latin alphabet character `" + T + "`"
|
|
2323
|
+
);
|
|
2324
|
+
return { isToken: !1, value: S };
|
|
2325
|
+
});
|
|
2326
|
+
i.localize.preprocessor && (h = i.localize.preprocessor(d, h));
|
|
2327
|
+
const f = {
|
|
2328
|
+
firstWeekContainsDate: o,
|
|
2329
|
+
weekStartsOn: c,
|
|
2330
|
+
locale: i
|
|
2331
|
+
};
|
|
2332
|
+
return h.map((S) => {
|
|
2333
|
+
if (!S.isToken) return S.value;
|
|
2334
|
+
const T = S.value;
|
|
2335
|
+
(!(r != null && r.useAdditionalWeekYearTokens) && zi(T) || !(r != null && r.useAdditionalDayOfYearTokens) && Ui(T)) && $i(T, t, String(e));
|
|
2336
|
+
const F = $t[T[0]];
|
|
2337
|
+
return F(d, T, i.localize, f);
|
|
2338
|
+
}).join("");
|
|
2339
|
+
}
|
|
2340
|
+
function Ji(e) {
|
|
2341
|
+
const t = e.match(Zi);
|
|
2342
|
+
return t ? t[1].replace(Bi, "'") : e;
|
|
2343
|
+
}
|
|
2344
|
+
function es(e, t) {
|
|
2345
|
+
const r = O(e, t == null ? void 0 : t.in), n = r.getFullYear(), i = r.getMonth(), o = I(r, 0);
|
|
2346
|
+
return o.setFullYear(n, i + 1, 0), o.setHours(0, 0, 0, 0), o.getDate();
|
|
2347
|
+
}
|
|
2348
|
+
function ts() {
|
|
2349
|
+
return Object.assign({}, fe());
|
|
2350
|
+
}
|
|
2351
|
+
function Zt(e) {
|
|
2352
|
+
return +O(e);
|
|
2353
|
+
}
|
|
2354
|
+
function Bt(e) {
|
|
2355
|
+
return Math.trunc(+O(e) / 1e3);
|
|
2356
|
+
}
|
|
2357
|
+
function rs(e) {
|
|
2358
|
+
return Math.trunc(e * Va);
|
|
2359
|
+
}
|
|
2360
|
+
function ns(e) {
|
|
2361
|
+
const t = e / $a;
|
|
2362
|
+
return Math.trunc(t);
|
|
2363
|
+
}
|
|
2364
|
+
function Ar(e, t, r) {
|
|
2365
|
+
return Xa(e, -t, r);
|
|
2366
|
+
}
|
|
2367
|
+
function Kt(e, t, r) {
|
|
2368
|
+
const n = ts(), i = ss(e, r.timeZone, r.locale ?? n.locale);
|
|
2369
|
+
return "formatToParts" in i ? as(i, t) : is(i, t);
|
|
2370
|
+
}
|
|
2371
|
+
function as(e, t) {
|
|
2372
|
+
const r = e.formatToParts(t);
|
|
2373
|
+
for (let n = r.length - 1; n >= 0; --n)
|
|
2374
|
+
if (r[n].type === "timeZoneName")
|
|
2375
|
+
return r[n].value;
|
|
2376
|
+
}
|
|
2377
|
+
function is(e, t) {
|
|
2378
|
+
const r = e.format(t).replace(/\u200E/g, ""), n = / [\w-+ ]+$/.exec(r);
|
|
2379
|
+
return n ? n[0].substr(1) : "";
|
|
2380
|
+
}
|
|
2381
|
+
function ss(e, t, r) {
|
|
2382
|
+
return new Intl.DateTimeFormat(r ? [r.code, "en-US"] : void 0, {
|
|
2383
|
+
timeZone: t,
|
|
2384
|
+
timeZoneName: e
|
|
2385
|
+
});
|
|
2386
|
+
}
|
|
2387
|
+
function os(e, t) {
|
|
2388
|
+
const r = fs(t);
|
|
2389
|
+
return "formatToParts" in r ? cs(r, e) : ls(r, e);
|
|
2390
|
+
}
|
|
2391
|
+
const us = {
|
|
2392
|
+
year: 0,
|
|
2393
|
+
month: 1,
|
|
2394
|
+
day: 2,
|
|
2395
|
+
hour: 3,
|
|
2396
|
+
minute: 4,
|
|
2397
|
+
second: 5
|
|
2398
|
+
};
|
|
2399
|
+
function cs(e, t) {
|
|
2400
|
+
try {
|
|
2401
|
+
const r = e.formatToParts(t), n = [];
|
|
2402
|
+
for (let i = 0; i < r.length; i++) {
|
|
2403
|
+
const o = us[r[i].type];
|
|
2404
|
+
o !== void 0 && (n[o] = parseInt(r[i].value, 10));
|
|
2405
|
+
}
|
|
2406
|
+
return n;
|
|
2407
|
+
} catch (r) {
|
|
2408
|
+
if (r instanceof RangeError)
|
|
2409
|
+
return [NaN];
|
|
2410
|
+
throw r;
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
function ls(e, t) {
|
|
2414
|
+
const r = e.format(t), n = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);
|
|
2415
|
+
return [
|
|
2416
|
+
parseInt(n[3], 10),
|
|
2417
|
+
parseInt(n[1], 10),
|
|
2418
|
+
parseInt(n[2], 10),
|
|
2419
|
+
parseInt(n[4], 10),
|
|
2420
|
+
parseInt(n[5], 10),
|
|
2421
|
+
parseInt(n[6], 10)
|
|
2422
|
+
];
|
|
2423
|
+
}
|
|
2424
|
+
const Ue = {}, Jt = new Intl.DateTimeFormat("en-US", {
|
|
2425
|
+
hourCycle: "h23",
|
|
2426
|
+
timeZone: "America/New_York",
|
|
2427
|
+
year: "numeric",
|
|
2428
|
+
month: "2-digit",
|
|
2429
|
+
day: "2-digit",
|
|
2430
|
+
hour: "2-digit",
|
|
2431
|
+
minute: "2-digit",
|
|
2432
|
+
second: "2-digit"
|
|
2433
|
+
}).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), ds = Jt === "06/25/2014, 00:00:00" || Jt === "06/25/2014 00:00:00";
|
|
2434
|
+
function fs(e) {
|
|
2435
|
+
return Ue[e] || (Ue[e] = ds ? new Intl.DateTimeFormat("en-US", {
|
|
2436
|
+
hourCycle: "h23",
|
|
2437
|
+
timeZone: e,
|
|
2438
|
+
year: "numeric",
|
|
2439
|
+
month: "numeric",
|
|
2440
|
+
day: "2-digit",
|
|
2441
|
+
hour: "2-digit",
|
|
2442
|
+
minute: "2-digit",
|
|
2443
|
+
second: "2-digit"
|
|
2444
|
+
}) : new Intl.DateTimeFormat("en-US", {
|
|
2445
|
+
hour12: !1,
|
|
2446
|
+
timeZone: e,
|
|
2447
|
+
year: "numeric",
|
|
2448
|
+
month: "numeric",
|
|
2449
|
+
day: "2-digit",
|
|
2450
|
+
hour: "2-digit",
|
|
2451
|
+
minute: "2-digit",
|
|
2452
|
+
second: "2-digit"
|
|
2453
|
+
})), Ue[e];
|
|
2454
|
+
}
|
|
2455
|
+
function st(e, t, r, n, i, o, c) {
|
|
2456
|
+
const d = /* @__PURE__ */ new Date(0);
|
|
2457
|
+
return d.setUTCFullYear(e, t, r), d.setUTCHours(n, i, o, c), d;
|
|
2458
|
+
}
|
|
2459
|
+
const er = 36e5, hs = 6e4, ze = {
|
|
2460
|
+
timezone: /([Z+-].*)$/,
|
|
2461
|
+
timezoneZ: /^(Z)$/,
|
|
2462
|
+
timezoneHH: /^([+-]\d{2})$/,
|
|
2463
|
+
timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/
|
|
2464
|
+
};
|
|
2465
|
+
function he(e, t, r) {
|
|
2466
|
+
if (!e)
|
|
2467
|
+
return 0;
|
|
2468
|
+
let n = ze.timezoneZ.exec(e);
|
|
2469
|
+
if (n)
|
|
2470
|
+
return 0;
|
|
2471
|
+
let i, o;
|
|
2472
|
+
if (n = ze.timezoneHH.exec(e), n)
|
|
2473
|
+
return i = parseInt(n[1], 10), tr(i) ? -(i * er) : NaN;
|
|
2474
|
+
if (n = ze.timezoneHHMM.exec(e), n) {
|
|
2475
|
+
i = parseInt(n[2], 10);
|
|
2476
|
+
const c = parseInt(n[3], 10);
|
|
2477
|
+
return tr(i, c) ? (o = Math.abs(i) * er + c * hs, n[1] === "+" ? -o : o) : NaN;
|
|
2478
|
+
}
|
|
2479
|
+
if (ps(e)) {
|
|
2480
|
+
t = new Date(t || Date.now());
|
|
2481
|
+
const c = r ? t : ms(t), d = Qe(c, e);
|
|
2482
|
+
return -(r ? d : ys(t, d, e));
|
|
2483
|
+
}
|
|
2484
|
+
return NaN;
|
|
2485
|
+
}
|
|
2486
|
+
function ms(e) {
|
|
2487
|
+
return st(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
|
|
2488
|
+
}
|
|
2489
|
+
function Qe(e, t) {
|
|
2490
|
+
const r = os(e, t), n = st(r[0], r[1] - 1, r[2], r[3] % 24, r[4], r[5], 0).getTime();
|
|
2491
|
+
let i = e.getTime();
|
|
2492
|
+
const o = i % 1e3;
|
|
2493
|
+
return i -= o >= 0 ? o : 1e3 + o, n - i;
|
|
2494
|
+
}
|
|
2495
|
+
function ys(e, t, r) {
|
|
2496
|
+
let i = e.getTime() - t;
|
|
2497
|
+
const o = Qe(new Date(i), r);
|
|
2498
|
+
if (t === o)
|
|
2499
|
+
return t;
|
|
2500
|
+
i -= o - t;
|
|
2501
|
+
const c = Qe(new Date(i), r);
|
|
2502
|
+
return o === c ? o : Math.max(o, c);
|
|
2503
|
+
}
|
|
2504
|
+
function tr(e, t) {
|
|
2505
|
+
return -23 <= e && e <= 23 && (t == null || 0 <= t && t <= 59);
|
|
2506
|
+
}
|
|
2507
|
+
const rr = {};
|
|
2508
|
+
function ps(e) {
|
|
2509
|
+
if (rr[e])
|
|
2510
|
+
return !0;
|
|
2511
|
+
try {
|
|
2512
|
+
return new Intl.DateTimeFormat(void 0, { timeZone: e }), rr[e] = !0, !0;
|
|
2513
|
+
} catch {
|
|
2514
|
+
return !1;
|
|
2515
|
+
}
|
|
2516
|
+
}
|
|
2517
|
+
const gs = 60 * 1e3, _s = {
|
|
2518
|
+
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
2519
|
+
X: function(e, t, r) {
|
|
2520
|
+
const n = $e(r.timeZone, e);
|
|
2521
|
+
if (n === 0)
|
|
2522
|
+
return "Z";
|
|
2523
|
+
switch (t) {
|
|
2524
|
+
case "X":
|
|
2525
|
+
return nr(n);
|
|
2526
|
+
case "XXXX":
|
|
2527
|
+
case "XX":
|
|
2528
|
+
return J(n);
|
|
2529
|
+
case "XXXXX":
|
|
2530
|
+
case "XXX":
|
|
2531
|
+
default:
|
|
2532
|
+
return J(n, ":");
|
|
2533
|
+
}
|
|
2534
|
+
},
|
|
2535
|
+
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
2536
|
+
x: function(e, t, r) {
|
|
2537
|
+
const n = $e(r.timeZone, e);
|
|
2538
|
+
switch (t) {
|
|
2539
|
+
case "x":
|
|
2540
|
+
return nr(n);
|
|
2541
|
+
case "xxxx":
|
|
2542
|
+
case "xx":
|
|
2543
|
+
return J(n);
|
|
2544
|
+
case "xxxxx":
|
|
2545
|
+
case "xxx":
|
|
2546
|
+
default:
|
|
2547
|
+
return J(n, ":");
|
|
2548
|
+
}
|
|
2549
|
+
},
|
|
2550
|
+
// Timezone (GMT)
|
|
2551
|
+
O: function(e, t, r) {
|
|
2552
|
+
const n = $e(r.timeZone, e);
|
|
2553
|
+
switch (t) {
|
|
2554
|
+
case "O":
|
|
2555
|
+
case "OO":
|
|
2556
|
+
case "OOO":
|
|
2557
|
+
return "GMT" + ws(n, ":");
|
|
2558
|
+
case "OOOO":
|
|
2559
|
+
default:
|
|
2560
|
+
return "GMT" + J(n, ":");
|
|
2561
|
+
}
|
|
2562
|
+
},
|
|
2563
|
+
// Timezone (specific non-location)
|
|
2564
|
+
z: function(e, t, r) {
|
|
2565
|
+
switch (t) {
|
|
2566
|
+
case "z":
|
|
2567
|
+
case "zz":
|
|
2568
|
+
case "zzz":
|
|
2569
|
+
return Kt("short", e, r);
|
|
2570
|
+
case "zzzz":
|
|
2571
|
+
default:
|
|
2572
|
+
return Kt("long", e, r);
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
};
|
|
2576
|
+
function $e(e, t) {
|
|
2577
|
+
const r = e ? he(e, t, !0) / gs : (t == null ? void 0 : t.getTimezoneOffset()) ?? 0;
|
|
2578
|
+
if (Number.isNaN(r))
|
|
2579
|
+
throw new RangeError("Invalid time zone specified: " + e);
|
|
2580
|
+
return r;
|
|
2581
|
+
}
|
|
2582
|
+
function Se(e, t) {
|
|
2583
|
+
const r = e < 0 ? "-" : "";
|
|
2584
|
+
let n = Math.abs(e).toString();
|
|
2585
|
+
for (; n.length < t; )
|
|
2586
|
+
n = "0" + n;
|
|
2587
|
+
return r + n;
|
|
2588
|
+
}
|
|
2589
|
+
function J(e, t = "") {
|
|
2590
|
+
const r = e > 0 ? "-" : "+", n = Math.abs(e), i = Se(Math.floor(n / 60), 2), o = Se(Math.floor(n % 60), 2);
|
|
2591
|
+
return r + i + t + o;
|
|
2592
|
+
}
|
|
2593
|
+
function nr(e, t) {
|
|
2594
|
+
return e % 60 === 0 ? (e > 0 ? "-" : "+") + Se(Math.abs(e) / 60, 2) : J(e, t);
|
|
2595
|
+
}
|
|
2596
|
+
function ws(e, t = "") {
|
|
2597
|
+
const r = e > 0 ? "-" : "+", n = Math.abs(e), i = Math.floor(n / 60), o = n % 60;
|
|
2598
|
+
return o === 0 ? r + String(i) : r + String(i) + t + Se(o, 2);
|
|
2599
|
+
}
|
|
2600
|
+
function ar(e) {
|
|
2601
|
+
const t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
|
|
2602
|
+
return t.setUTCFullYear(e.getFullYear()), +e - +t;
|
|
2603
|
+
}
|
|
2604
|
+
const Gr = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, Ve = 36e5, ir = 6e4, bs = 2, v = {
|
|
2605
|
+
dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
|
|
2606
|
+
datePattern: /^([0-9W+-]+)(.*)/,
|
|
2607
|
+
plainTime: /:/,
|
|
2608
|
+
// year tokens
|
|
2609
|
+
YY: /^(\d{2})$/,
|
|
2610
|
+
YYY: [
|
|
2611
|
+
/^([+-]\d{2})$/,
|
|
2612
|
+
// 0 additional digits
|
|
2613
|
+
/^([+-]\d{3})$/,
|
|
2614
|
+
// 1 additional digit
|
|
2615
|
+
/^([+-]\d{4})$/
|
|
2616
|
+
// 2 additional digits
|
|
2617
|
+
],
|
|
2618
|
+
YYYY: /^(\d{4})/,
|
|
2619
|
+
YYYYY: [
|
|
2620
|
+
/^([+-]\d{4})/,
|
|
2621
|
+
// 0 additional digits
|
|
2622
|
+
/^([+-]\d{5})/,
|
|
2623
|
+
// 1 additional digit
|
|
2624
|
+
/^([+-]\d{6})/
|
|
2625
|
+
// 2 additional digits
|
|
2626
|
+
],
|
|
2627
|
+
// date tokens
|
|
2628
|
+
MM: /^-(\d{2})$/,
|
|
2629
|
+
DDD: /^-?(\d{3})$/,
|
|
2630
|
+
MMDD: /^-?(\d{2})-?(\d{2})$/,
|
|
2631
|
+
Www: /^-?W(\d{2})$/,
|
|
2632
|
+
WwwD: /^-?W(\d{2})-?(\d{1})$/,
|
|
2633
|
+
HH: /^(\d{2}([.,]\d*)?)$/,
|
|
2634
|
+
HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
|
|
2635
|
+
HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
|
|
2636
|
+
// time zone tokens (to identify the presence of a tz)
|
|
2637
|
+
timeZone: Gr
|
|
2638
|
+
};
|
|
2639
|
+
function ve(e, t = {}) {
|
|
2640
|
+
if (arguments.length < 1)
|
|
2641
|
+
throw new TypeError("1 argument required, but only " + arguments.length + " present");
|
|
2642
|
+
if (e === null)
|
|
2643
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
2644
|
+
const r = t.additionalDigits == null ? bs : Number(t.additionalDigits);
|
|
2645
|
+
if (r !== 2 && r !== 1 && r !== 0)
|
|
2646
|
+
throw new RangeError("additionalDigits must be 0, 1 or 2");
|
|
2647
|
+
if (e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]")
|
|
2648
|
+
return new Date(e.getTime());
|
|
2649
|
+
if (typeof e == "number" || Object.prototype.toString.call(e) === "[object Number]")
|
|
2650
|
+
return new Date(e);
|
|
2651
|
+
if (Object.prototype.toString.call(e) !== "[object String]")
|
|
2652
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
2653
|
+
const n = Ts(e), { year: i, restDateString: o } = Ds(n.date, r), c = Os(o, i);
|
|
2654
|
+
if (c === null || isNaN(c.getTime()))
|
|
2655
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
2656
|
+
if (c) {
|
|
2657
|
+
const d = c.getTime();
|
|
2658
|
+
let h = 0, f;
|
|
2659
|
+
if (n.time && (h = Ss(n.time), h === null || isNaN(h)))
|
|
2660
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
2661
|
+
if (n.timeZone || t.timeZone) {
|
|
2662
|
+
if (f = he(n.timeZone || t.timeZone, new Date(d + h)), isNaN(f))
|
|
2663
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
2664
|
+
} else
|
|
2665
|
+
f = ar(new Date(d + h)), f = ar(new Date(d + h + f));
|
|
2666
|
+
return new Date(d + h + f);
|
|
2667
|
+
} else
|
|
2668
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
2669
|
+
}
|
|
2670
|
+
function Ts(e) {
|
|
2671
|
+
const t = {};
|
|
2672
|
+
let r = v.dateTimePattern.exec(e), n;
|
|
2673
|
+
if (r ? (t.date = r[1], n = r[3]) : (r = v.datePattern.exec(e), r ? (t.date = r[1], n = r[2]) : (t.date = null, n = e)), n) {
|
|
2674
|
+
const i = v.timeZone.exec(n);
|
|
2675
|
+
i ? (t.time = n.replace(i[1], ""), t.timeZone = i[1].trim()) : t.time = n;
|
|
2676
|
+
}
|
|
2677
|
+
return t;
|
|
2678
|
+
}
|
|
2679
|
+
function Ds(e, t) {
|
|
2680
|
+
if (e) {
|
|
2681
|
+
const r = v.YYY[t], n = v.YYYYY[t];
|
|
2682
|
+
let i = v.YYYY.exec(e) || n.exec(e);
|
|
2683
|
+
if (i) {
|
|
2684
|
+
const o = i[1];
|
|
2685
|
+
return {
|
|
2686
|
+
year: parseInt(o, 10),
|
|
2687
|
+
restDateString: e.slice(o.length)
|
|
2688
|
+
};
|
|
2689
|
+
}
|
|
2690
|
+
if (i = v.YY.exec(e) || r.exec(e), i) {
|
|
2691
|
+
const o = i[1];
|
|
2692
|
+
return {
|
|
2693
|
+
year: parseInt(o, 10) * 100,
|
|
2694
|
+
restDateString: e.slice(o.length)
|
|
2695
|
+
};
|
|
2696
|
+
}
|
|
2697
|
+
}
|
|
2698
|
+
return {
|
|
2699
|
+
year: null
|
|
2700
|
+
};
|
|
2701
|
+
}
|
|
2702
|
+
function Os(e, t) {
|
|
2703
|
+
if (t === null)
|
|
2704
|
+
return null;
|
|
2705
|
+
let r, n, i;
|
|
2706
|
+
if (!e || !e.length)
|
|
2707
|
+
return r = /* @__PURE__ */ new Date(0), r.setUTCFullYear(t), r;
|
|
2708
|
+
let o = v.MM.exec(e);
|
|
2709
|
+
if (o)
|
|
2710
|
+
return r = /* @__PURE__ */ new Date(0), n = parseInt(o[1], 10) - 1, or(t, n) ? (r.setUTCFullYear(t, n), r) : /* @__PURE__ */ new Date(NaN);
|
|
2711
|
+
if (o = v.DDD.exec(e), o) {
|
|
2712
|
+
r = /* @__PURE__ */ new Date(0);
|
|
2713
|
+
const c = parseInt(o[1], 10);
|
|
2714
|
+
return xs(t, c) ? (r.setUTCFullYear(t, 0, c), r) : /* @__PURE__ */ new Date(NaN);
|
|
2715
|
+
}
|
|
2716
|
+
if (o = v.MMDD.exec(e), o) {
|
|
2717
|
+
r = /* @__PURE__ */ new Date(0), n = parseInt(o[1], 10) - 1;
|
|
2718
|
+
const c = parseInt(o[2], 10);
|
|
2719
|
+
return or(t, n, c) ? (r.setUTCFullYear(t, n, c), r) : /* @__PURE__ */ new Date(NaN);
|
|
2720
|
+
}
|
|
2721
|
+
if (o = v.Www.exec(e), o)
|
|
2722
|
+
return i = parseInt(o[1], 10) - 1, ur(i) ? sr(t, i) : /* @__PURE__ */ new Date(NaN);
|
|
2723
|
+
if (o = v.WwwD.exec(e), o) {
|
|
2724
|
+
i = parseInt(o[1], 10) - 1;
|
|
2725
|
+
const c = parseInt(o[2], 10) - 1;
|
|
2726
|
+
return ur(i, c) ? sr(t, i, c) : /* @__PURE__ */ new Date(NaN);
|
|
2727
|
+
}
|
|
2728
|
+
return null;
|
|
2729
|
+
}
|
|
2730
|
+
function Ss(e) {
|
|
2731
|
+
let t, r, n = v.HH.exec(e);
|
|
2732
|
+
if (n)
|
|
2733
|
+
return t = parseFloat(n[1].replace(",", ".")), Xe(t) ? t % 24 * Ve : NaN;
|
|
2734
|
+
if (n = v.HHMM.exec(e), n)
|
|
2735
|
+
return t = parseInt(n[1], 10), r = parseFloat(n[2].replace(",", ".")), Xe(t, r) ? t % 24 * Ve + r * ir : NaN;
|
|
2736
|
+
if (n = v.HHMMSS.exec(e), n) {
|
|
2737
|
+
t = parseInt(n[1], 10), r = parseInt(n[2], 10);
|
|
2738
|
+
const i = parseFloat(n[3].replace(",", "."));
|
|
2739
|
+
return Xe(t, r, i) ? t % 24 * Ve + r * ir + i * 1e3 : NaN;
|
|
2740
|
+
}
|
|
2741
|
+
return null;
|
|
2742
|
+
}
|
|
2743
|
+
function sr(e, t, r) {
|
|
2744
|
+
t = t || 0, r = r || 0;
|
|
2745
|
+
const n = /* @__PURE__ */ new Date(0);
|
|
2746
|
+
n.setUTCFullYear(e, 0, 4);
|
|
2747
|
+
const i = n.getUTCDay() || 7, o = t * 7 + r + 1 - i;
|
|
2748
|
+
return n.setUTCDate(n.getUTCDate() + o), n;
|
|
2749
|
+
}
|
|
2750
|
+
const vs = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Ms = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
2751
|
+
function Fr(e) {
|
|
2752
|
+
return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
|
|
2753
|
+
}
|
|
2754
|
+
function or(e, t, r) {
|
|
2755
|
+
if (t < 0 || t > 11)
|
|
2756
|
+
return !1;
|
|
2757
|
+
if (r != null) {
|
|
2758
|
+
if (r < 1)
|
|
2759
|
+
return !1;
|
|
2760
|
+
const n = Fr(e);
|
|
2761
|
+
if (n && r > Ms[t] || !n && r > vs[t])
|
|
2762
|
+
return !1;
|
|
2763
|
+
}
|
|
2764
|
+
return !0;
|
|
2765
|
+
}
|
|
2766
|
+
function xs(e, t) {
|
|
2767
|
+
if (t < 1)
|
|
2768
|
+
return !1;
|
|
2769
|
+
const r = Fr(e);
|
|
2770
|
+
return !(r && t > 366 || !r && t > 365);
|
|
2771
|
+
}
|
|
2772
|
+
function ur(e, t) {
|
|
2773
|
+
return !(e < 0 || e > 52 || t != null && (t < 0 || t > 6));
|
|
2774
|
+
}
|
|
2775
|
+
function Xe(e, t, r) {
|
|
2776
|
+
return !(e < 0 || e >= 25 || t != null && (t < 0 || t >= 60) || r != null && (r < 0 || r >= 60));
|
|
2777
|
+
}
|
|
2778
|
+
const Es = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
|
|
2779
|
+
function Ps(e, t, r = {}) {
|
|
2780
|
+
t = String(t);
|
|
2781
|
+
const n = t.match(Es);
|
|
2782
|
+
if (n) {
|
|
2783
|
+
const i = ve(r.originalDate || e, r);
|
|
2784
|
+
t = n.reduce(function(o, c) {
|
|
2785
|
+
if (c[0] === "'")
|
|
2786
|
+
return o;
|
|
2787
|
+
const d = o.indexOf(c), h = o[d - 1] === "'", f = o.replace(c, "'" + _s[c[0]](i, c, r) + "'");
|
|
2788
|
+
return h ? f.substring(0, d - 1) + f.substring(d + 1) : f;
|
|
2789
|
+
}, t);
|
|
2790
|
+
}
|
|
2791
|
+
return jr(e, t, r);
|
|
2792
|
+
}
|
|
2793
|
+
function Wr(e, t, r) {
|
|
2794
|
+
e = ve(e, r);
|
|
2795
|
+
const n = he(t, e, !0), i = new Date(e.getTime() - n), o = /* @__PURE__ */ new Date(0);
|
|
2796
|
+
return o.setFullYear(i.getUTCFullYear(), i.getUTCMonth(), i.getUTCDate()), o.setHours(i.getUTCHours(), i.getUTCMinutes(), i.getUTCSeconds(), i.getUTCMilliseconds()), o;
|
|
2797
|
+
}
|
|
2798
|
+
function Ns(e, t, r, n) {
|
|
2799
|
+
return n = {
|
|
2800
|
+
...n,
|
|
2801
|
+
timeZone: t,
|
|
2802
|
+
originalDate: e
|
|
2803
|
+
}, Ps(Wr(e, t, { timeZone: n.timeZone }), r, n);
|
|
2804
|
+
}
|
|
2805
|
+
function Cs(e, t, r) {
|
|
2806
|
+
if (typeof e == "string" && !e.match(Gr))
|
|
2807
|
+
return ve(e, { ...r, timeZone: t });
|
|
2808
|
+
e = ve(e, r);
|
|
2809
|
+
const n = st(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()).getTime(), i = he(t, new Date(n));
|
|
2810
|
+
return new Date(n + i);
|
|
2811
|
+
}
|
|
2812
|
+
function Lr(e, t) {
|
|
2813
|
+
return -he(e, t);
|
|
2814
|
+
}
|
|
2815
|
+
function so(e) {
|
|
2816
|
+
return jr(e, "yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
|
|
2817
|
+
}
|
|
2818
|
+
function cr(e, t = {}) {
|
|
2819
|
+
if (!e)
|
|
2820
|
+
return e;
|
|
2821
|
+
const r = t.tz || Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
2822
|
+
try {
|
|
2823
|
+
let n = "MMM dd, yyy hh:mm a";
|
|
2824
|
+
t.short && (n = "MMM dd, yyy"), t.includeTZ && (n += " (z)");
|
|
2825
|
+
const i = new Date(e);
|
|
2826
|
+
return Ns(i, r, n);
|
|
2827
|
+
} catch {
|
|
2828
|
+
return console.error("Invalid value passed to formatTime", e), "(invalid date)";
|
|
2829
|
+
}
|
|
2830
|
+
}
|
|
2831
|
+
function oo(e, t) {
|
|
2832
|
+
return `${cr(e.getTime())} - ${cr(t.getTime(), { includeTZ: !0 })}`;
|
|
2833
|
+
}
|
|
2834
|
+
const Me = {
|
|
2835
|
+
secondly: 1e3,
|
|
2836
|
+
tenSecondly: 10 * 1e3,
|
|
2837
|
+
thirtySecondly: 30 * 1e3,
|
|
2838
|
+
minutely: 60 * 1e3,
|
|
2839
|
+
fiveMinutely: 5 * 60 * 1e3,
|
|
2840
|
+
tenMinutely: 10 * 60 * 1e3,
|
|
2841
|
+
thirtyMinutely: 30 * 60 * 1e3,
|
|
2842
|
+
hourly: 60 * 60 * 1e3,
|
|
2843
|
+
twoHourly: 2 * 60 * 60 * 1e3,
|
|
2844
|
+
twelveHourly: 12 * 60 * 60 * 1e3,
|
|
2845
|
+
daily: 60 * 60 * 24 * 1e3,
|
|
2846
|
+
weekly: 60 * 60 * 24 * 7 * 1e3,
|
|
2847
|
+
trend: 0
|
|
2848
|
+
};
|
|
2849
|
+
function uo(e, t) {
|
|
2850
|
+
return e.map((r) => ({
|
|
2851
|
+
value: r,
|
|
2852
|
+
label: t.t(`configuration.vitals.reports.granularity.${r}`)
|
|
2853
|
+
}));
|
|
2854
|
+
}
|
|
2855
|
+
function Is(e, t) {
|
|
2856
|
+
return {
|
|
2857
|
+
duration: e,
|
|
2858
|
+
type: "duration",
|
|
2859
|
+
origin: t
|
|
2860
|
+
};
|
|
2861
|
+
}
|
|
2862
|
+
function co(e) {
|
|
2863
|
+
return e && Ze.find((r) => e <= Me[r]) || null;
|
|
2864
|
+
}
|
|
2865
|
+
function Ur(e, t, r, n) {
|
|
2866
|
+
const i = Me[r];
|
|
2867
|
+
let o = 0;
|
|
2868
|
+
return i >= Me.daily && (n ? o = -Lr(n, t) : o = t.getTimezoneOffset() * 60 * 1e3), new Date(e((t.getTime() - o) / i) * i + o);
|
|
2869
|
+
}
|
|
2870
|
+
function ks(e, t, r) {
|
|
2871
|
+
return Ur(Math.floor, e, t, r);
|
|
2872
|
+
}
|
|
2873
|
+
function zr(e, t, r) {
|
|
2874
|
+
return Ur(Math.ceil, e, t, r);
|
|
2875
|
+
}
|
|
2876
|
+
class Ce {
|
|
2877
|
+
constructor(t, r, n) {
|
|
2878
|
+
b(this, "timeframe");
|
|
2879
|
+
b(this, "tz");
|
|
2880
|
+
b(this, "dataGranularity");
|
|
2881
|
+
if (this.constructor === Ce)
|
|
2882
|
+
throw new Error("BaseQueryTime is not meant to be used directly.");
|
|
2883
|
+
this.timeframe = t, this.tz = r, this.dataGranularity = n ?? t.dataGranularity;
|
|
2884
|
+
}
|
|
2885
|
+
calculateStartDate(t, r, n = 1) {
|
|
2886
|
+
if (t)
|
|
2887
|
+
return new Date(this.endDate().getTime() - this.timeframe.timeframeLengthMs() * n);
|
|
2888
|
+
{
|
|
2889
|
+
const i = this.endDate(), o = this.timeframe.rawStart(this.tz), c = ks(o, r, this.tz), h = (i.getTime() - c.getTime()) * (n - 1);
|
|
2890
|
+
return new Date(c.getTime() - h);
|
|
2891
|
+
}
|
|
2892
|
+
}
|
|
2893
|
+
granularitySeconds() {
|
|
2894
|
+
return Math.floor(this.granularityMs() / 1e3);
|
|
2895
|
+
}
|
|
2896
|
+
granularityDruid() {
|
|
2897
|
+
return Is(this.granularityMs(), this.startDate().toISOString());
|
|
2898
|
+
}
|
|
2899
|
+
// Return a UNIX timestamp suitable for use in the `start` query param.
|
|
2900
|
+
startSeconds() {
|
|
2901
|
+
return Bt(this.startDate());
|
|
2902
|
+
}
|
|
2903
|
+
// Return a UNIX timestamp suitable for use in the `end` query param.
|
|
2904
|
+
endSeconds() {
|
|
2905
|
+
return Bt(this.endDate());
|
|
2906
|
+
}
|
|
2907
|
+
// Return epoch time in milliseconds, suitable for use in the `startMs` query param.
|
|
2908
|
+
startMs() {
|
|
2909
|
+
return Zt(this.startDate());
|
|
2910
|
+
}
|
|
2911
|
+
// Return epoch time in milliseconds, suitable for use in the `endMs` query param.
|
|
2912
|
+
endMs() {
|
|
2913
|
+
return Zt(this.endDate());
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
class lo extends Ce {
|
|
2917
|
+
constructor(r, n, i, o, c) {
|
|
2918
|
+
super(r, i, o);
|
|
2919
|
+
b(this, "granularity");
|
|
2920
|
+
n && r.allowedGranularities(c).has(n) ? this.granularity = n : c ? this.granularity = r.fineGrainedDefaultGranularity ?? r.defaultResponseGranularity : this.granularity = r.defaultResponseGranularity;
|
|
2921
|
+
}
|
|
2922
|
+
startDate() {
|
|
2923
|
+
return this.calculateStartDate(this.timeframe.isRelative, this.granularity);
|
|
2924
|
+
}
|
|
2925
|
+
endDate() {
|
|
2926
|
+
return zr(this.timeframe.rawEnd(), this.granularity, this.tz);
|
|
2927
|
+
}
|
|
2928
|
+
granularityMs() {
|
|
2929
|
+
return Me[this.granularity];
|
|
2930
|
+
}
|
|
2931
|
+
}
|
|
2932
|
+
class Ys extends Ce {
|
|
2933
|
+
startDate() {
|
|
2934
|
+
return this.calculateStartDate(this.timeframe.isRelative, this.dataGranularity);
|
|
2935
|
+
}
|
|
2936
|
+
endDate() {
|
|
2937
|
+
return zr(this.timeframe.rawEnd(this.tz), this.dataGranularity, this.tz);
|
|
2938
|
+
}
|
|
2939
|
+
granularityMs() {
|
|
2940
|
+
return this.endDate().getTime() - this.startDate().getTime();
|
|
2941
|
+
}
|
|
2942
|
+
}
|
|
2943
|
+
class fo extends Ys {
|
|
2944
|
+
startDate() {
|
|
2945
|
+
return this.calculateStartDate(this.timeframe.isRelative, this.dataGranularity, 2);
|
|
2946
|
+
}
|
|
2947
|
+
granularityMs() {
|
|
2948
|
+
return this.endDate().getTime() - super.startDate().getTime();
|
|
2949
|
+
}
|
|
2950
|
+
}
|
|
2951
|
+
var Te = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2952
|
+
function Rs(e) {
|
|
2953
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
2954
|
+
}
|
|
2955
|
+
var xe = { exports: {} };
|
|
2956
|
+
xe.exports;
|
|
2957
|
+
(function(e, t) {
|
|
2958
|
+
var r = 200, n = "__lodash_hash_undefined__", i = 9007199254740991, o = "[object Arguments]", c = "[object Array]", d = "[object Boolean]", h = "[object Date]", f = "[object Error]", _ = "[object Function]", y = "[object GeneratorFunction]", p = "[object Map]", E = "[object Number]", P = "[object Object]", N = "[object Promise]", k = "[object RegExp]", G = "[object Set]", S = "[object String]", T = "[object Symbol]", F = "[object WeakMap]", ut = "[object ArrayBuffer]", me = "[object DataView]", ct = "[object Float32Array]", lt = "[object Float64Array]", dt = "[object Int8Array]", ft = "[object Int16Array]", ht = "[object Int32Array]", mt = "[object Uint8Array]", yt = "[object Uint8ClampedArray]", pt = "[object Uint16Array]", gt = "[object Uint32Array]", Vr = /[\\^$.*+?()[\]{}|]/g, Xr = /\w*$/, Qr = /^\[object .+?Constructor\]$/, Zr = /^(?:0|[1-9]\d*)$/, w = {};
|
|
2959
|
+
w[o] = w[c] = w[ut] = w[me] = w[d] = w[h] = w[ct] = w[lt] = w[dt] = w[ft] = w[ht] = w[p] = w[E] = w[P] = w[k] = w[G] = w[S] = w[T] = w[mt] = w[yt] = w[pt] = w[gt] = !0, w[f] = w[_] = w[F] = !1;
|
|
2960
|
+
var Br = typeof Te == "object" && Te && Te.Object === Object && Te, Kr = typeof self == "object" && self && self.Object === Object && self, Y = Br || Kr || Function("return this")(), _t = t && !t.nodeType && t, wt = _t && !0 && e && !e.nodeType && e, Jr = wt && wt.exports === _t;
|
|
2961
|
+
function en(a, s) {
|
|
2962
|
+
return a.set(s[0], s[1]), a;
|
|
2963
|
+
}
|
|
2964
|
+
function tn(a, s) {
|
|
2965
|
+
return a.add(s), a;
|
|
2966
|
+
}
|
|
2967
|
+
function rn(a, s) {
|
|
2968
|
+
for (var u = -1, l = a ? a.length : 0; ++u < l && s(a[u], u, a) !== !1; )
|
|
2969
|
+
;
|
|
2970
|
+
return a;
|
|
2971
|
+
}
|
|
2972
|
+
function nn(a, s) {
|
|
2973
|
+
for (var u = -1, l = s.length, D = a.length; ++u < l; )
|
|
2974
|
+
a[D + u] = s[u];
|
|
2975
|
+
return a;
|
|
2976
|
+
}
|
|
2977
|
+
function bt(a, s, u, l) {
|
|
2978
|
+
for (var D = -1, M = a ? a.length : 0; ++D < M; )
|
|
2979
|
+
u = s(u, a[D], D, a);
|
|
2980
|
+
return u;
|
|
2981
|
+
}
|
|
2982
|
+
function an(a, s) {
|
|
2983
|
+
for (var u = -1, l = Array(a); ++u < a; )
|
|
2984
|
+
l[u] = s(u);
|
|
2985
|
+
return l;
|
|
2986
|
+
}
|
|
2987
|
+
function sn(a, s) {
|
|
2988
|
+
return a == null ? void 0 : a[s];
|
|
2989
|
+
}
|
|
2990
|
+
function Tt(a) {
|
|
2991
|
+
var s = !1;
|
|
2992
|
+
if (a != null && typeof a.toString != "function")
|
|
2993
|
+
try {
|
|
2994
|
+
s = !!(a + "");
|
|
2995
|
+
} catch {
|
|
2996
|
+
}
|
|
2997
|
+
return s;
|
|
2998
|
+
}
|
|
2999
|
+
function Dt(a) {
|
|
3000
|
+
var s = -1, u = Array(a.size);
|
|
3001
|
+
return a.forEach(function(l, D) {
|
|
3002
|
+
u[++s] = [D, l];
|
|
3003
|
+
}), u;
|
|
3004
|
+
}
|
|
3005
|
+
function Ie(a, s) {
|
|
3006
|
+
return function(u) {
|
|
3007
|
+
return a(s(u));
|
|
3008
|
+
};
|
|
3009
|
+
}
|
|
3010
|
+
function Ot(a) {
|
|
3011
|
+
var s = -1, u = Array(a.size);
|
|
3012
|
+
return a.forEach(function(l) {
|
|
3013
|
+
u[++s] = l;
|
|
3014
|
+
}), u;
|
|
3015
|
+
}
|
|
3016
|
+
var on = Array.prototype, un = Function.prototype, ye = Object.prototype, ke = Y["__core-js_shared__"], St = function() {
|
|
3017
|
+
var a = /[^.]+$/.exec(ke && ke.keys && ke.keys.IE_PROTO || "");
|
|
3018
|
+
return a ? "Symbol(src)_1." + a : "";
|
|
3019
|
+
}(), vt = un.toString, j = ye.hasOwnProperty, pe = ye.toString, cn = RegExp(
|
|
3020
|
+
"^" + vt.call(j).replace(Vr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
3021
|
+
), Mt = Jr ? Y.Buffer : void 0, xt = Y.Symbol, Et = Y.Uint8Array, ln = Ie(Object.getPrototypeOf, Object), dn = Object.create, fn = ye.propertyIsEnumerable, hn = on.splice, Pt = Object.getOwnPropertySymbols, mn = Mt ? Mt.isBuffer : void 0, yn = Ie(Object.keys, Object), Ye = Z(Y, "DataView"), re = Z(Y, "Map"), Re = Z(Y, "Promise"), qe = Z(Y, "Set"), He = Z(Y, "WeakMap"), ne = Z(Object, "create"), pn = U(Ye), gn = U(re), _n = U(Re), wn = U(qe), bn = U(He), Nt = xt ? xt.prototype : void 0, Ct = Nt ? Nt.valueOf : void 0;
|
|
3022
|
+
function W(a) {
|
|
3023
|
+
var s = -1, u = a ? a.length : 0;
|
|
3024
|
+
for (this.clear(); ++s < u; ) {
|
|
3025
|
+
var l = a[s];
|
|
3026
|
+
this.set(l[0], l[1]);
|
|
3027
|
+
}
|
|
3028
|
+
}
|
|
3029
|
+
function Tn() {
|
|
3030
|
+
this.__data__ = ne ? ne(null) : {};
|
|
3031
|
+
}
|
|
3032
|
+
function Dn(a) {
|
|
3033
|
+
return this.has(a) && delete this.__data__[a];
|
|
3034
|
+
}
|
|
3035
|
+
function On(a) {
|
|
3036
|
+
var s = this.__data__;
|
|
3037
|
+
if (ne) {
|
|
3038
|
+
var u = s[a];
|
|
3039
|
+
return u === n ? void 0 : u;
|
|
3040
|
+
}
|
|
3041
|
+
return j.call(s, a) ? s[a] : void 0;
|
|
3042
|
+
}
|
|
3043
|
+
function Sn(a) {
|
|
3044
|
+
var s = this.__data__;
|
|
3045
|
+
return ne ? s[a] !== void 0 : j.call(s, a);
|
|
3046
|
+
}
|
|
3047
|
+
function vn(a, s) {
|
|
3048
|
+
var u = this.__data__;
|
|
3049
|
+
return u[a] = ne && s === void 0 ? n : s, this;
|
|
3050
|
+
}
|
|
3051
|
+
W.prototype.clear = Tn, W.prototype.delete = Dn, W.prototype.get = On, W.prototype.has = Sn, W.prototype.set = vn;
|
|
3052
|
+
function R(a) {
|
|
3053
|
+
var s = -1, u = a ? a.length : 0;
|
|
3054
|
+
for (this.clear(); ++s < u; ) {
|
|
3055
|
+
var l = a[s];
|
|
3056
|
+
this.set(l[0], l[1]);
|
|
3057
|
+
}
|
|
3058
|
+
}
|
|
3059
|
+
function Mn() {
|
|
3060
|
+
this.__data__ = [];
|
|
3061
|
+
}
|
|
3062
|
+
function xn(a) {
|
|
3063
|
+
var s = this.__data__, u = ge(s, a);
|
|
3064
|
+
if (u < 0)
|
|
3065
|
+
return !1;
|
|
3066
|
+
var l = s.length - 1;
|
|
3067
|
+
return u == l ? s.pop() : hn.call(s, u, 1), !0;
|
|
3068
|
+
}
|
|
3069
|
+
function En(a) {
|
|
3070
|
+
var s = this.__data__, u = ge(s, a);
|
|
3071
|
+
return u < 0 ? void 0 : s[u][1];
|
|
3072
|
+
}
|
|
3073
|
+
function Pn(a) {
|
|
3074
|
+
return ge(this.__data__, a) > -1;
|
|
3075
|
+
}
|
|
3076
|
+
function Nn(a, s) {
|
|
3077
|
+
var u = this.__data__, l = ge(u, a);
|
|
3078
|
+
return l < 0 ? u.push([a, s]) : u[l][1] = s, this;
|
|
3079
|
+
}
|
|
3080
|
+
R.prototype.clear = Mn, R.prototype.delete = xn, R.prototype.get = En, R.prototype.has = Pn, R.prototype.set = Nn;
|
|
3081
|
+
function X(a) {
|
|
3082
|
+
var s = -1, u = a ? a.length : 0;
|
|
3083
|
+
for (this.clear(); ++s < u; ) {
|
|
3084
|
+
var l = a[s];
|
|
3085
|
+
this.set(l[0], l[1]);
|
|
3086
|
+
}
|
|
3087
|
+
}
|
|
3088
|
+
function Cn() {
|
|
3089
|
+
this.__data__ = {
|
|
3090
|
+
hash: new W(),
|
|
3091
|
+
map: new (re || R)(),
|
|
3092
|
+
string: new W()
|
|
3093
|
+
};
|
|
3094
|
+
}
|
|
3095
|
+
function In(a) {
|
|
3096
|
+
return _e(this, a).delete(a);
|
|
3097
|
+
}
|
|
3098
|
+
function kn(a) {
|
|
3099
|
+
return _e(this, a).get(a);
|
|
3100
|
+
}
|
|
3101
|
+
function Yn(a) {
|
|
3102
|
+
return _e(this, a).has(a);
|
|
3103
|
+
}
|
|
3104
|
+
function Rn(a, s) {
|
|
3105
|
+
return _e(this, a).set(a, s), this;
|
|
3106
|
+
}
|
|
3107
|
+
X.prototype.clear = Cn, X.prototype.delete = In, X.prototype.get = kn, X.prototype.has = Yn, X.prototype.set = Rn;
|
|
3108
|
+
function Q(a) {
|
|
3109
|
+
this.__data__ = new R(a);
|
|
3110
|
+
}
|
|
3111
|
+
function qn() {
|
|
3112
|
+
this.__data__ = new R();
|
|
3113
|
+
}
|
|
3114
|
+
function Hn(a) {
|
|
3115
|
+
return this.__data__.delete(a);
|
|
3116
|
+
}
|
|
3117
|
+
function jn(a) {
|
|
3118
|
+
return this.__data__.get(a);
|
|
3119
|
+
}
|
|
3120
|
+
function An(a) {
|
|
3121
|
+
return this.__data__.has(a);
|
|
3122
|
+
}
|
|
3123
|
+
function Gn(a, s) {
|
|
3124
|
+
var u = this.__data__;
|
|
3125
|
+
if (u instanceof R) {
|
|
3126
|
+
var l = u.__data__;
|
|
3127
|
+
if (!re || l.length < r - 1)
|
|
3128
|
+
return l.push([a, s]), this;
|
|
3129
|
+
u = this.__data__ = new X(l);
|
|
3130
|
+
}
|
|
3131
|
+
return u.set(a, s), this;
|
|
3132
|
+
}
|
|
3133
|
+
Q.prototype.clear = qn, Q.prototype.delete = Hn, Q.prototype.get = jn, Q.prototype.has = An, Q.prototype.set = Gn;
|
|
3134
|
+
function Fn(a, s) {
|
|
3135
|
+
var u = Ge(a) || da(a) ? an(a.length, String) : [], l = u.length, D = !!l;
|
|
3136
|
+
for (var M in a)
|
|
3137
|
+
j.call(a, M) && !(D && (M == "length" || oa(M, l))) && u.push(M);
|
|
3138
|
+
return u;
|
|
3139
|
+
}
|
|
3140
|
+
function It(a, s, u) {
|
|
3141
|
+
var l = a[s];
|
|
3142
|
+
(!(j.call(a, s) && qt(l, u)) || u === void 0 && !(s in a)) && (a[s] = u);
|
|
3143
|
+
}
|
|
3144
|
+
function ge(a, s) {
|
|
3145
|
+
for (var u = a.length; u--; )
|
|
3146
|
+
if (qt(a[u][0], s))
|
|
3147
|
+
return u;
|
|
3148
|
+
return -1;
|
|
3149
|
+
}
|
|
3150
|
+
function Wn(a, s) {
|
|
3151
|
+
return a && kt(s, Fe(s), a);
|
|
3152
|
+
}
|
|
3153
|
+
function je(a, s, u, l, D, M, q) {
|
|
3154
|
+
var x;
|
|
3155
|
+
if (l && (x = M ? l(a, D, M, q) : l(a)), x !== void 0)
|
|
3156
|
+
return x;
|
|
3157
|
+
if (!we(a))
|
|
3158
|
+
return a;
|
|
3159
|
+
var At = Ge(a);
|
|
3160
|
+
if (At) {
|
|
3161
|
+
if (x = aa(a), !s)
|
|
3162
|
+
return ta(a, x);
|
|
3163
|
+
} else {
|
|
3164
|
+
var B = L(a), Gt = B == _ || B == y;
|
|
3165
|
+
if (ha(a))
|
|
3166
|
+
return Xn(a, s);
|
|
3167
|
+
if (B == P || B == o || Gt && !M) {
|
|
3168
|
+
if (Tt(a))
|
|
3169
|
+
return M ? a : {};
|
|
3170
|
+
if (x = ia(Gt ? {} : a), !s)
|
|
3171
|
+
return ra(a, Wn(x, a));
|
|
3172
|
+
} else {
|
|
3173
|
+
if (!w[B])
|
|
3174
|
+
return M ? a : {};
|
|
3175
|
+
x = sa(a, B, je, s);
|
|
3176
|
+
}
|
|
3177
|
+
}
|
|
3178
|
+
q || (q = new Q());
|
|
3179
|
+
var Ft = q.get(a);
|
|
3180
|
+
if (Ft)
|
|
3181
|
+
return Ft;
|
|
3182
|
+
if (q.set(a, x), !At)
|
|
3183
|
+
var Wt = u ? na(a) : Fe(a);
|
|
3184
|
+
return rn(Wt || a, function(We, be) {
|
|
3185
|
+
Wt && (be = We, We = a[be]), It(x, be, je(We, s, u, l, be, a, q));
|
|
3186
|
+
}), x;
|
|
3187
|
+
}
|
|
3188
|
+
function Ln(a) {
|
|
3189
|
+
return we(a) ? dn(a) : {};
|
|
3190
|
+
}
|
|
3191
|
+
function Un(a, s, u) {
|
|
3192
|
+
var l = s(a);
|
|
3193
|
+
return Ge(a) ? l : nn(l, u(a));
|
|
3194
|
+
}
|
|
3195
|
+
function zn(a) {
|
|
3196
|
+
return pe.call(a);
|
|
3197
|
+
}
|
|
3198
|
+
function $n(a) {
|
|
3199
|
+
if (!we(a) || ca(a))
|
|
3200
|
+
return !1;
|
|
3201
|
+
var s = jt(a) || Tt(a) ? cn : Qr;
|
|
3202
|
+
return s.test(U(a));
|
|
3203
|
+
}
|
|
3204
|
+
function Vn(a) {
|
|
3205
|
+
if (!Rt(a))
|
|
3206
|
+
return yn(a);
|
|
3207
|
+
var s = [];
|
|
3208
|
+
for (var u in Object(a))
|
|
3209
|
+
j.call(a, u) && u != "constructor" && s.push(u);
|
|
3210
|
+
return s;
|
|
3211
|
+
}
|
|
3212
|
+
function Xn(a, s) {
|
|
3213
|
+
if (s)
|
|
3214
|
+
return a.slice();
|
|
3215
|
+
var u = new a.constructor(a.length);
|
|
3216
|
+
return a.copy(u), u;
|
|
3217
|
+
}
|
|
3218
|
+
function Ae(a) {
|
|
3219
|
+
var s = new a.constructor(a.byteLength);
|
|
3220
|
+
return new Et(s).set(new Et(a)), s;
|
|
3221
|
+
}
|
|
3222
|
+
function Qn(a, s) {
|
|
3223
|
+
var u = s ? Ae(a.buffer) : a.buffer;
|
|
3224
|
+
return new a.constructor(u, a.byteOffset, a.byteLength);
|
|
3225
|
+
}
|
|
3226
|
+
function Zn(a, s, u) {
|
|
3227
|
+
var l = s ? u(Dt(a), !0) : Dt(a);
|
|
3228
|
+
return bt(l, en, new a.constructor());
|
|
3229
|
+
}
|
|
3230
|
+
function Bn(a) {
|
|
3231
|
+
var s = new a.constructor(a.source, Xr.exec(a));
|
|
3232
|
+
return s.lastIndex = a.lastIndex, s;
|
|
3233
|
+
}
|
|
3234
|
+
function Kn(a, s, u) {
|
|
3235
|
+
var l = s ? u(Ot(a), !0) : Ot(a);
|
|
3236
|
+
return bt(l, tn, new a.constructor());
|
|
3237
|
+
}
|
|
3238
|
+
function Jn(a) {
|
|
3239
|
+
return Ct ? Object(Ct.call(a)) : {};
|
|
3240
|
+
}
|
|
3241
|
+
function ea(a, s) {
|
|
3242
|
+
var u = s ? Ae(a.buffer) : a.buffer;
|
|
3243
|
+
return new a.constructor(u, a.byteOffset, a.length);
|
|
3244
|
+
}
|
|
3245
|
+
function ta(a, s) {
|
|
3246
|
+
var u = -1, l = a.length;
|
|
3247
|
+
for (s || (s = Array(l)); ++u < l; )
|
|
3248
|
+
s[u] = a[u];
|
|
3249
|
+
return s;
|
|
3250
|
+
}
|
|
3251
|
+
function kt(a, s, u, l) {
|
|
3252
|
+
u || (u = {});
|
|
3253
|
+
for (var D = -1, M = s.length; ++D < M; ) {
|
|
3254
|
+
var q = s[D], x = void 0;
|
|
3255
|
+
It(u, q, x === void 0 ? a[q] : x);
|
|
3256
|
+
}
|
|
3257
|
+
return u;
|
|
3258
|
+
}
|
|
3259
|
+
function ra(a, s) {
|
|
3260
|
+
return kt(a, Yt(a), s);
|
|
3261
|
+
}
|
|
3262
|
+
function na(a) {
|
|
3263
|
+
return Un(a, Fe, Yt);
|
|
3264
|
+
}
|
|
3265
|
+
function _e(a, s) {
|
|
3266
|
+
var u = a.__data__;
|
|
3267
|
+
return ua(s) ? u[typeof s == "string" ? "string" : "hash"] : u.map;
|
|
3268
|
+
}
|
|
3269
|
+
function Z(a, s) {
|
|
3270
|
+
var u = sn(a, s);
|
|
3271
|
+
return $n(u) ? u : void 0;
|
|
3272
|
+
}
|
|
3273
|
+
var Yt = Pt ? Ie(Pt, Object) : pa, L = zn;
|
|
3274
|
+
(Ye && L(new Ye(new ArrayBuffer(1))) != me || re && L(new re()) != p || Re && L(Re.resolve()) != N || qe && L(new qe()) != G || He && L(new He()) != F) && (L = function(a) {
|
|
3275
|
+
var s = pe.call(a), u = s == P ? a.constructor : void 0, l = u ? U(u) : void 0;
|
|
3276
|
+
if (l)
|
|
3277
|
+
switch (l) {
|
|
3278
|
+
case pn:
|
|
3279
|
+
return me;
|
|
3280
|
+
case gn:
|
|
3281
|
+
return p;
|
|
3282
|
+
case _n:
|
|
3283
|
+
return N;
|
|
3284
|
+
case wn:
|
|
3285
|
+
return G;
|
|
3286
|
+
case bn:
|
|
3287
|
+
return F;
|
|
3288
|
+
}
|
|
3289
|
+
return s;
|
|
3290
|
+
});
|
|
3291
|
+
function aa(a) {
|
|
3292
|
+
var s = a.length, u = a.constructor(s);
|
|
3293
|
+
return s && typeof a[0] == "string" && j.call(a, "index") && (u.index = a.index, u.input = a.input), u;
|
|
3294
|
+
}
|
|
3295
|
+
function ia(a) {
|
|
3296
|
+
return typeof a.constructor == "function" && !Rt(a) ? Ln(ln(a)) : {};
|
|
3297
|
+
}
|
|
3298
|
+
function sa(a, s, u, l) {
|
|
3299
|
+
var D = a.constructor;
|
|
3300
|
+
switch (s) {
|
|
3301
|
+
case ut:
|
|
3302
|
+
return Ae(a);
|
|
3303
|
+
case d:
|
|
3304
|
+
case h:
|
|
3305
|
+
return new D(+a);
|
|
3306
|
+
case me:
|
|
3307
|
+
return Qn(a, l);
|
|
3308
|
+
case ct:
|
|
3309
|
+
case lt:
|
|
3310
|
+
case dt:
|
|
3311
|
+
case ft:
|
|
3312
|
+
case ht:
|
|
3313
|
+
case mt:
|
|
3314
|
+
case yt:
|
|
3315
|
+
case pt:
|
|
3316
|
+
case gt:
|
|
3317
|
+
return ea(a, l);
|
|
3318
|
+
case p:
|
|
3319
|
+
return Zn(a, l, u);
|
|
3320
|
+
case E:
|
|
3321
|
+
case S:
|
|
3322
|
+
return new D(a);
|
|
3323
|
+
case k:
|
|
3324
|
+
return Bn(a);
|
|
3325
|
+
case G:
|
|
3326
|
+
return Kn(a, l, u);
|
|
3327
|
+
case T:
|
|
3328
|
+
return Jn(a);
|
|
3329
|
+
}
|
|
3330
|
+
}
|
|
3331
|
+
function oa(a, s) {
|
|
3332
|
+
return s = s ?? i, !!s && (typeof a == "number" || Zr.test(a)) && a > -1 && a % 1 == 0 && a < s;
|
|
3333
|
+
}
|
|
3334
|
+
function ua(a) {
|
|
3335
|
+
var s = typeof a;
|
|
3336
|
+
return s == "string" || s == "number" || s == "symbol" || s == "boolean" ? a !== "__proto__" : a === null;
|
|
3337
|
+
}
|
|
3338
|
+
function ca(a) {
|
|
3339
|
+
return !!St && St in a;
|
|
3340
|
+
}
|
|
3341
|
+
function Rt(a) {
|
|
3342
|
+
var s = a && a.constructor, u = typeof s == "function" && s.prototype || ye;
|
|
3343
|
+
return a === u;
|
|
3344
|
+
}
|
|
3345
|
+
function U(a) {
|
|
3346
|
+
if (a != null) {
|
|
3347
|
+
try {
|
|
3348
|
+
return vt.call(a);
|
|
3349
|
+
} catch {
|
|
3350
|
+
}
|
|
3351
|
+
try {
|
|
3352
|
+
return a + "";
|
|
3353
|
+
} catch {
|
|
3354
|
+
}
|
|
3355
|
+
}
|
|
3356
|
+
return "";
|
|
3357
|
+
}
|
|
3358
|
+
function la(a) {
|
|
3359
|
+
return je(a, !0, !0);
|
|
3360
|
+
}
|
|
3361
|
+
function qt(a, s) {
|
|
3362
|
+
return a === s || a !== a && s !== s;
|
|
3363
|
+
}
|
|
3364
|
+
function da(a) {
|
|
3365
|
+
return fa(a) && j.call(a, "callee") && (!fn.call(a, "callee") || pe.call(a) == o);
|
|
3366
|
+
}
|
|
3367
|
+
var Ge = Array.isArray;
|
|
3368
|
+
function Ht(a) {
|
|
3369
|
+
return a != null && ma(a.length) && !jt(a);
|
|
3370
|
+
}
|
|
3371
|
+
function fa(a) {
|
|
3372
|
+
return ya(a) && Ht(a);
|
|
3373
|
+
}
|
|
3374
|
+
var ha = mn || ga;
|
|
3375
|
+
function jt(a) {
|
|
3376
|
+
var s = we(a) ? pe.call(a) : "";
|
|
3377
|
+
return s == _ || s == y;
|
|
3378
|
+
}
|
|
3379
|
+
function ma(a) {
|
|
3380
|
+
return typeof a == "number" && a > -1 && a % 1 == 0 && a <= i;
|
|
3381
|
+
}
|
|
3382
|
+
function we(a) {
|
|
3383
|
+
var s = typeof a;
|
|
3384
|
+
return !!a && (s == "object" || s == "function");
|
|
3385
|
+
}
|
|
3386
|
+
function ya(a) {
|
|
3387
|
+
return !!a && typeof a == "object";
|
|
3388
|
+
}
|
|
3389
|
+
function Fe(a) {
|
|
3390
|
+
return Ht(a) ? Fn(a) : Vn(a);
|
|
3391
|
+
}
|
|
3392
|
+
function pa() {
|
|
3393
|
+
return [];
|
|
3394
|
+
}
|
|
3395
|
+
function ga() {
|
|
3396
|
+
return !1;
|
|
3397
|
+
}
|
|
3398
|
+
e.exports = la;
|
|
3399
|
+
})(xe, xe.exports);
|
|
3400
|
+
var qs = xe.exports;
|
|
3401
|
+
const Hs = /* @__PURE__ */ Rs(qs), te = (e, t) => new Date(e.getTime() - Lr(t, e));
|
|
3402
|
+
class C {
|
|
3403
|
+
constructor(t) {
|
|
3404
|
+
b(this, "timeframeText");
|
|
3405
|
+
b(this, "key");
|
|
3406
|
+
b(this, "display");
|
|
3407
|
+
b(this, "timeframeLength");
|
|
3408
|
+
b(this, "allowedTiers");
|
|
3409
|
+
// defaultResponseGranularity tracks which of the allowed granularities is picked for a given
|
|
3410
|
+
// timeframe if the user does not or cannot specify a granularity.
|
|
3411
|
+
b(this, "defaultResponseGranularity");
|
|
3412
|
+
// dataGranularity tracks the granularity of the available data on the server for a specific timeframe.
|
|
3413
|
+
// As of writing, it's always the same as the default response granularity, but it may not always be.
|
|
3414
|
+
// It controls how timeframes are rounded to ensure complete time buckets from the server.
|
|
3415
|
+
b(this, "dataGranularity");
|
|
3416
|
+
// isRelative impacts whether we take the `floor` or the `ceil` of the start time.
|
|
3417
|
+
// If the time range is relative, we want the ceil -- because we take the ceil of the
|
|
3418
|
+
// end time to make sure we're showing all the data we can for the last time bucket.
|
|
3419
|
+
// If the time range is absolute, we want the floor -- because otherwise we wouldn't be including
|
|
3420
|
+
// the first time bucket.
|
|
3421
|
+
b(this, "isRelative");
|
|
3422
|
+
b(this, "fineGrainedDefaultGranularity");
|
|
3423
|
+
b(this, "_startCustom");
|
|
3424
|
+
b(this, "_endCustom");
|
|
3425
|
+
b(this, "_allowedGranularitiesOverride");
|
|
3426
|
+
this.display = t.display, this.timeframeText = t.timeframeText, this.key = t.key, this.timeframeLength = t.timeframeLength, this.allowedTiers = t.allowedTiers, this.defaultResponseGranularity = t.defaultResponseGranularity, this.dataGranularity = t.dataGranularity, this.isRelative = t.isRelative, this._startCustom = t.startCustom, this._endCustom = t.endCustom, this._allowedGranularitiesOverride = t.allowedGranularitiesOverride, this.fineGrainedDefaultGranularity = t.fineGrainedDefaultGranularity;
|
|
3427
|
+
}
|
|
3428
|
+
// rawEnd does not consider granularity and should not be used directly in queries.
|
|
3429
|
+
// Use `new QueryTime(timeframe, granularity?).queryEndSeconds()` instead.
|
|
3430
|
+
// eslint-disable-next-line -- `tz` is required because it's used in subclasses.
|
|
3431
|
+
rawEnd(t) {
|
|
3432
|
+
return this._endCustom || /* @__PURE__ */ new Date();
|
|
3433
|
+
}
|
|
3434
|
+
// rawStart does not consider granularity and should not be used directly in queries.
|
|
3435
|
+
// Use `new QueryTime(timeframe, granularity?).queryStartSeconds()` instead.
|
|
3436
|
+
// eslint-disable-next-line -- `tz` is required because it's used in subclasses.
|
|
3437
|
+
rawStart(t) {
|
|
3438
|
+
return this._startCustom || new Date(this.rawEnd().getTime() - this.timeframeLengthMs());
|
|
3439
|
+
}
|
|
3440
|
+
timeframeLengthMs() {
|
|
3441
|
+
return this.timeframeLength() * 1e3;
|
|
3442
|
+
}
|
|
3443
|
+
maximumTimeframeLength() {
|
|
3444
|
+
return this.timeframeLength();
|
|
3445
|
+
}
|
|
3446
|
+
allowedGranularities(t) {
|
|
3447
|
+
if (this._allowedGranularitiesOverride && t)
|
|
3448
|
+
return new Set(this._allowedGranularitiesOverride);
|
|
3449
|
+
const r = /* @__PURE__ */ new Set(), n = this.maximumTimeframeLength() / 3600;
|
|
3450
|
+
return n <= 6 && r.add("minutely"), n >= 2 && n <= 7 * 24 && r.add("hourly"), n >= 2 * 24 && r.add("daily"), n >= 2 * 24 * 14 && r.add("weekly"), r;
|
|
3451
|
+
}
|
|
3452
|
+
cacheKey() {
|
|
3453
|
+
return this.key !== "custom" ? this.key : `${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`;
|
|
3454
|
+
}
|
|
3455
|
+
v4Query(t) {
|
|
3456
|
+
return this.key === "custom" ? {
|
|
3457
|
+
type: "absolute",
|
|
3458
|
+
start: this.rawStart(),
|
|
3459
|
+
end: this.rawEnd(),
|
|
3460
|
+
tz: t
|
|
3461
|
+
} : {
|
|
3462
|
+
type: "relative",
|
|
3463
|
+
time_range: this.key,
|
|
3464
|
+
tz: t
|
|
3465
|
+
};
|
|
3466
|
+
}
|
|
3467
|
+
tzAdjustedDate(t) {
|
|
3468
|
+
if (!t)
|
|
3469
|
+
return /* @__PURE__ */ new Date();
|
|
3470
|
+
const r = Cs(/* @__PURE__ */ new Date(), new Intl.DateTimeFormat().resolvedOptions().timeZone);
|
|
3471
|
+
return Wr(r, t);
|
|
3472
|
+
}
|
|
3473
|
+
}
|
|
3474
|
+
class js extends C {
|
|
3475
|
+
rawStart(t) {
|
|
3476
|
+
let r = H(this.tzAdjustedDate(t), { weekStartsOn: 1 });
|
|
3477
|
+
return t && (r = te(r, t)), r;
|
|
3478
|
+
}
|
|
3479
|
+
maximumTimeframeLength() {
|
|
3480
|
+
return 60 * 60 * 24 * 7;
|
|
3481
|
+
}
|
|
3482
|
+
}
|
|
3483
|
+
class As extends C {
|
|
3484
|
+
rawStart(t) {
|
|
3485
|
+
let r = ee(this.tzAdjustedDate(t));
|
|
3486
|
+
return t && (r = te(r, t)), r;
|
|
3487
|
+
}
|
|
3488
|
+
maximumTimeframeLength() {
|
|
3489
|
+
return 60 * 60 * 24 * 31;
|
|
3490
|
+
}
|
|
3491
|
+
}
|
|
3492
|
+
class Gs extends C {
|
|
3493
|
+
rawEnd(t) {
|
|
3494
|
+
let r = H(this.tzAdjustedDate(t), { weekStartsOn: 1 });
|
|
3495
|
+
return t && (r = te(r, t)), r;
|
|
3496
|
+
}
|
|
3497
|
+
rawStart(t) {
|
|
3498
|
+
const r = this.tzAdjustedDate(t);
|
|
3499
|
+
let n = H(r.setDate(r.getDate() - 7), {
|
|
3500
|
+
weekStartsOn: 1
|
|
3501
|
+
});
|
|
3502
|
+
return t && (n = te(n, t)), n;
|
|
3503
|
+
}
|
|
3504
|
+
}
|
|
3505
|
+
class Fs extends C {
|
|
3506
|
+
rawEnd(t) {
|
|
3507
|
+
let r = ee(this.tzAdjustedDate(t));
|
|
3508
|
+
return t && (r = te(r, t)), r;
|
|
3509
|
+
}
|
|
3510
|
+
rawStart(t) {
|
|
3511
|
+
let r = ee(Ar(this.tzAdjustedDate(t), 1));
|
|
3512
|
+
return t && (r = te(r, t)), r;
|
|
3513
|
+
}
|
|
3514
|
+
}
|
|
3515
|
+
const Ws = /* @__PURE__ */ new Map([
|
|
3516
|
+
[
|
|
3517
|
+
m.FIFTEEN_MIN,
|
|
3518
|
+
new C({
|
|
3519
|
+
key: m.FIFTEEN_MIN,
|
|
3520
|
+
display: "Last 15 minutes",
|
|
3521
|
+
timeframeText: "15 minutes",
|
|
3522
|
+
timeframeLength: () => 60 * 15,
|
|
3523
|
+
defaultResponseGranularity: "minutely",
|
|
3524
|
+
dataGranularity: "minutely",
|
|
3525
|
+
isRelative: !0,
|
|
3526
|
+
fineGrainedDefaultGranularity: "thirtySecondly",
|
|
3527
|
+
allowedTiers: ["free", "trial", "plus", "enterprise"],
|
|
3528
|
+
allowedGranularitiesOverride: ["tenSecondly", "thirtySecondly", "minutely"]
|
|
3529
|
+
})
|
|
3530
|
+
],
|
|
3531
|
+
[
|
|
3532
|
+
m.ONE_HOUR,
|
|
3533
|
+
new C({
|
|
3534
|
+
key: m.ONE_HOUR,
|
|
3535
|
+
display: "Last hour",
|
|
3536
|
+
timeframeText: "One hour",
|
|
3537
|
+
timeframeLength: () => 60 * 60 * 1,
|
|
3538
|
+
defaultResponseGranularity: "minutely",
|
|
3539
|
+
dataGranularity: "minutely",
|
|
3540
|
+
isRelative: !0,
|
|
3541
|
+
fineGrainedDefaultGranularity: "minutely",
|
|
3542
|
+
allowedTiers: ["free", "trial", "plus", "enterprise"],
|
|
3543
|
+
allowedGranularitiesOverride: ["tenSecondly", "thirtySecondly", "minutely", "fiveMinutely", "tenMinutely"]
|
|
3544
|
+
})
|
|
3545
|
+
],
|
|
3546
|
+
[
|
|
3547
|
+
m.SIX_HOUR,
|
|
3548
|
+
new C({
|
|
3549
|
+
key: m.SIX_HOUR,
|
|
3550
|
+
display: "Last 6 hours",
|
|
3551
|
+
timeframeText: "6 hours",
|
|
3552
|
+
timeframeLength: () => 60 * 60 * 6,
|
|
3553
|
+
defaultResponseGranularity: "hourly",
|
|
3554
|
+
dataGranularity: "hourly",
|
|
3555
|
+
isRelative: !0,
|
|
3556
|
+
fineGrainedDefaultGranularity: "fiveMinutely",
|
|
3557
|
+
allowedTiers: ["free", "trial", "plus", "enterprise"],
|
|
3558
|
+
allowedGranularitiesOverride: ["thirtySecondly", "minutely", "fiveMinutely", "tenMinutely", "thirtyMinutely", "hourly"]
|
|
3559
|
+
})
|
|
3560
|
+
],
|
|
3561
|
+
[
|
|
3562
|
+
m.TWELVE_HOUR,
|
|
3563
|
+
new C({
|
|
3564
|
+
key: m.TWELVE_HOUR,
|
|
3565
|
+
display: "Last 12 hours",
|
|
3566
|
+
timeframeText: "12 hours",
|
|
3567
|
+
timeframeLength: () => 60 * 60 * 12,
|
|
3568
|
+
defaultResponseGranularity: "hourly",
|
|
3569
|
+
dataGranularity: "hourly",
|
|
3570
|
+
isRelative: !0,
|
|
3571
|
+
fineGrainedDefaultGranularity: "tenMinutely",
|
|
3572
|
+
allowedTiers: ["free", "trial", "plus", "enterprise"],
|
|
3573
|
+
allowedGranularitiesOverride: ["minutely", "fiveMinutely", "tenMinutely", "thirtyMinutely", "hourly"]
|
|
3574
|
+
})
|
|
3575
|
+
],
|
|
3576
|
+
[
|
|
3577
|
+
m.ONE_DAY,
|
|
3578
|
+
new C({
|
|
3579
|
+
key: m.ONE_DAY,
|
|
3580
|
+
display: "Last 24 hours",
|
|
3581
|
+
timeframeText: "24 hours",
|
|
3582
|
+
timeframeLength: () => 60 * 60 * 24,
|
|
3583
|
+
defaultResponseGranularity: "hourly",
|
|
3584
|
+
dataGranularity: "hourly",
|
|
3585
|
+
isRelative: !0,
|
|
3586
|
+
fineGrainedDefaultGranularity: "thirtyMinutely",
|
|
3587
|
+
allowedTiers: ["free", "trial", "plus", "enterprise"],
|
|
3588
|
+
allowedGranularitiesOverride: ["fiveMinutely", "tenMinutely", "thirtyMinutely", "hourly"]
|
|
3589
|
+
})
|
|
3590
|
+
],
|
|
3591
|
+
[
|
|
3592
|
+
m.SEVEN_DAY,
|
|
3593
|
+
new C({
|
|
3594
|
+
key: m.SEVEN_DAY,
|
|
3595
|
+
display: "Last 7 days",
|
|
3596
|
+
timeframeText: "7 days",
|
|
3597
|
+
timeframeLength: () => 60 * 60 * 24 * 7,
|
|
3598
|
+
defaultResponseGranularity: "daily",
|
|
3599
|
+
dataGranularity: "daily",
|
|
3600
|
+
isRelative: !0,
|
|
3601
|
+
fineGrainedDefaultGranularity: "twoHourly",
|
|
3602
|
+
allowedTiers: ["trial", "plus", "enterprise"],
|
|
3603
|
+
allowedGranularitiesOverride: ["thirtyMinutely", "hourly", "twoHourly", "twelveHourly", "daily"]
|
|
3604
|
+
})
|
|
3605
|
+
],
|
|
3606
|
+
[
|
|
3607
|
+
m.THIRTY_DAY,
|
|
3608
|
+
new C({
|
|
3609
|
+
key: m.THIRTY_DAY,
|
|
3610
|
+
display: "Last 30 days",
|
|
3611
|
+
timeframeText: "30 days",
|
|
3612
|
+
timeframeLength: () => 60 * 60 * 24 * 30,
|
|
3613
|
+
defaultResponseGranularity: "daily",
|
|
3614
|
+
dataGranularity: "daily",
|
|
3615
|
+
isRelative: !0,
|
|
3616
|
+
fineGrainedDefaultGranularity: "twelveHourly",
|
|
3617
|
+
allowedTiers: ["trial", "plus", "enterprise"],
|
|
3618
|
+
allowedGranularitiesOverride: ["hourly", "twoHourly", "twelveHourly", "daily", "weekly"]
|
|
3619
|
+
})
|
|
3620
|
+
],
|
|
3621
|
+
[
|
|
3622
|
+
m.CURRENT_WEEK,
|
|
3623
|
+
new js({
|
|
3624
|
+
key: m.CURRENT_WEEK,
|
|
3625
|
+
display: "This week",
|
|
3626
|
+
timeframeText: "Week",
|
|
3627
|
+
timeframeLength: () => {
|
|
3628
|
+
const e = H(/* @__PURE__ */ new Date(), { weekStartsOn: 1 });
|
|
3629
|
+
return (Oe(Ut(/* @__PURE__ */ new Date(), 1)).getTime() - e.getTime()) / 1e3;
|
|
3630
|
+
},
|
|
3631
|
+
defaultResponseGranularity: "daily",
|
|
3632
|
+
dataGranularity: "daily",
|
|
3633
|
+
isRelative: !1,
|
|
3634
|
+
fineGrainedDefaultGranularity: "twoHourly",
|
|
3635
|
+
allowedTiers: ["plus", "enterprise"],
|
|
3636
|
+
allowedGranularitiesOverride: ["thirtyMinutely", "hourly", "twoHourly", "twelveHourly", "daily"]
|
|
3637
|
+
})
|
|
3638
|
+
],
|
|
3639
|
+
[
|
|
3640
|
+
m.CURRENT_MONTH,
|
|
3641
|
+
new As({
|
|
3642
|
+
key: m.CURRENT_MONTH,
|
|
3643
|
+
display: "This month",
|
|
3644
|
+
timeframeText: "Month",
|
|
3645
|
+
timeframeLength: () => {
|
|
3646
|
+
const e = ee(/* @__PURE__ */ new Date());
|
|
3647
|
+
return (Oe(Ut(/* @__PURE__ */ new Date(), 1)).getTime() - e.getTime()) / 1e3;
|
|
3648
|
+
},
|
|
3649
|
+
defaultResponseGranularity: "daily",
|
|
3650
|
+
dataGranularity: "daily",
|
|
3651
|
+
isRelative: !1,
|
|
3652
|
+
allowedTiers: ["plus", "enterprise"]
|
|
3653
|
+
})
|
|
3654
|
+
],
|
|
3655
|
+
[
|
|
3656
|
+
m.PREVIOUS_WEEK,
|
|
3657
|
+
new Gs({
|
|
3658
|
+
key: m.PREVIOUS_WEEK,
|
|
3659
|
+
display: "Previous week",
|
|
3660
|
+
timeframeText: "Week",
|
|
3661
|
+
timeframeLength: () => 60 * 60 * 24 * 7,
|
|
3662
|
+
defaultResponseGranularity: "daily",
|
|
3663
|
+
dataGranularity: "daily",
|
|
3664
|
+
isRelative: !1,
|
|
3665
|
+
fineGrainedDefaultGranularity: "twoHourly",
|
|
3666
|
+
allowedTiers: ["plus", "enterprise"],
|
|
3667
|
+
allowedGranularitiesOverride: ["thirtyMinutely", "hourly", "twoHourly", "twelveHourly", "daily"]
|
|
3668
|
+
})
|
|
3669
|
+
],
|
|
3670
|
+
[
|
|
3671
|
+
m.PREVIOUS_MONTH,
|
|
3672
|
+
new Fs({
|
|
3673
|
+
key: m.PREVIOUS_MONTH,
|
|
3674
|
+
display: "Previous month",
|
|
3675
|
+
timeframeText: "Month",
|
|
3676
|
+
timeframeLength: () => {
|
|
3677
|
+
let e = 0;
|
|
3678
|
+
const t = ee(/* @__PURE__ */ new Date()), r = ee(Ar(/* @__PURE__ */ new Date(), 1));
|
|
3679
|
+
return t.getTimezoneOffset() !== r.getTimezoneOffset() && (e = Ls(t, r)), 60 * 60 * 24 * es((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() - 1)) + rs(e);
|
|
3680
|
+
},
|
|
3681
|
+
defaultResponseGranularity: "daily",
|
|
3682
|
+
dataGranularity: "daily",
|
|
3683
|
+
isRelative: !1,
|
|
3684
|
+
allowedTiers: ["plus", "enterprise"]
|
|
3685
|
+
})
|
|
3686
|
+
]
|
|
3687
|
+
]);
|
|
3688
|
+
function ho(e) {
|
|
3689
|
+
const t = new Date(e.start), r = new Date(e.end), n = (r.getTime() - t.getTime()) / 1e3;
|
|
3690
|
+
return e.timePeriodsKey && Hs(Ws.get(e.timePeriodsKey)) || new C({
|
|
3691
|
+
key: "custom",
|
|
3692
|
+
timeframeText: "custom",
|
|
3693
|
+
display: "custom",
|
|
3694
|
+
startCustom: t,
|
|
3695
|
+
endCustom: r,
|
|
3696
|
+
timeframeLength: () => n,
|
|
3697
|
+
defaultResponseGranularity: "daily",
|
|
3698
|
+
dataGranularity: "daily",
|
|
3699
|
+
isRelative: !1,
|
|
3700
|
+
allowedTiers: ["free", "plus", "enterprise"]
|
|
3701
|
+
});
|
|
3702
|
+
}
|
|
3703
|
+
function mo(e) {
|
|
3704
|
+
return {
|
|
3705
|
+
...e.key !== "custom" && { timePeriodsKey: e.key },
|
|
3706
|
+
start: e.rawStart(),
|
|
3707
|
+
end: e.rawEnd()
|
|
3708
|
+
};
|
|
3709
|
+
}
|
|
3710
|
+
function yo(e) {
|
|
3711
|
+
return {
|
|
3712
|
+
key: e.key,
|
|
3713
|
+
display: e.display,
|
|
3714
|
+
timeframeText: e.timeframeText,
|
|
3715
|
+
timeframeLength: () => e.key,
|
|
3716
|
+
// Used to generate test IDs for the Kongponent.
|
|
3717
|
+
start: () => e.rawStart(),
|
|
3718
|
+
end: () => e.rawEnd()
|
|
3719
|
+
};
|
|
3720
|
+
}
|
|
3721
|
+
function Ls(e, t) {
|
|
3722
|
+
return ns(e.getTimezoneOffset() - t.getTimezoneOffset());
|
|
3723
|
+
}
|
|
3724
|
+
const po = {
|
|
3725
|
+
"15M": m.FIFTEEN_MIN,
|
|
3726
|
+
"1H": m.ONE_HOUR,
|
|
3727
|
+
"6H": m.SIX_HOUR,
|
|
3728
|
+
"12H": m.TWELVE_HOUR,
|
|
3729
|
+
"24H": m.ONE_DAY,
|
|
3730
|
+
"7D": m.SEVEN_DAY,
|
|
3731
|
+
"15m": m.FIFTEEN_MIN,
|
|
3732
|
+
"1h": m.ONE_HOUR,
|
|
3733
|
+
"6h": m.SIX_HOUR,
|
|
3734
|
+
"12h": m.TWELVE_HOUR,
|
|
3735
|
+
"24h": m.ONE_DAY,
|
|
3736
|
+
"7d": m.SEVEN_DAY,
|
|
3737
|
+
"30d": m.THIRTY_DAY,
|
|
3738
|
+
current_week: m.CURRENT_WEEK,
|
|
3739
|
+
current_month: m.CURRENT_MONTH,
|
|
3740
|
+
previous_week: m.PREVIOUS_WEEK,
|
|
3741
|
+
previous_month: m.PREVIOUS_MONTH
|
|
3742
|
+
};
|
|
3743
|
+
class ot {
|
|
3744
|
+
constructor(t) {
|
|
3745
|
+
b(this, "_seed");
|
|
3746
|
+
this._seed = t;
|
|
3747
|
+
}
|
|
3748
|
+
next(t, r) {
|
|
3749
|
+
const n = Math.sin(this._seed++) * 1e4, i = n - Math.floor(n);
|
|
3750
|
+
return Math.floor(i * (r - t + 1)) + t;
|
|
3751
|
+
}
|
|
3752
|
+
}
|
|
3753
|
+
const go = (e, t, r) => {
|
|
3754
|
+
const n = $r(10, 1e4), i = new ot(n), o = Date.now() - 6 * 60 * 60 * 1e3, c = Date.now(), d = [];
|
|
3755
|
+
let h = 0;
|
|
3756
|
+
for (let y = o; y <= c; y += 60 * 60 * 1e3)
|
|
3757
|
+
if (t)
|
|
3758
|
+
for (const p in t)
|
|
3759
|
+
t[p].forEach((E) => {
|
|
3760
|
+
h += i.next(50, 500);
|
|
3761
|
+
const P = {
|
|
3762
|
+
[p]: E,
|
|
3763
|
+
[e.name]: h
|
|
3764
|
+
}, N = {
|
|
3765
|
+
version: "1.0",
|
|
3766
|
+
timestamp: new Date(y).toISOString(),
|
|
3767
|
+
event: P
|
|
3768
|
+
};
|
|
3769
|
+
d.push(N);
|
|
3770
|
+
});
|
|
3771
|
+
else {
|
|
3772
|
+
h += i.next(50, 500);
|
|
3773
|
+
const p = {
|
|
3774
|
+
version: "1.0",
|
|
3775
|
+
timestamp: new Date(y).toISOString(),
|
|
3776
|
+
event: {
|
|
3777
|
+
[e.name]: h
|
|
3778
|
+
}
|
|
3779
|
+
};
|
|
3780
|
+
d.push(p);
|
|
3781
|
+
}
|
|
3782
|
+
const f = {};
|
|
3783
|
+
if (t)
|
|
3784
|
+
for (const y in t)
|
|
3785
|
+
f[y] = {}, t[y].forEach((p) => {
|
|
3786
|
+
f[y][p] = {
|
|
3787
|
+
name: p,
|
|
3788
|
+
deleted: !1
|
|
3789
|
+
};
|
|
3790
|
+
});
|
|
3791
|
+
const _ = {
|
|
3792
|
+
start_ms: o,
|
|
3793
|
+
end_ms: c,
|
|
3794
|
+
start: new Date(o).toISOString(),
|
|
3795
|
+
end: new Date(c).toISOString(),
|
|
3796
|
+
query_id: "12345",
|
|
3797
|
+
metric_names: [e.name],
|
|
3798
|
+
metric_units: {
|
|
3799
|
+
[e.name]: e.unit
|
|
3800
|
+
},
|
|
3801
|
+
granularity_ms: 60 * 60 * 1e3,
|
|
3802
|
+
// 1 hour in ms
|
|
3803
|
+
display: f,
|
|
3804
|
+
...r ?? {}
|
|
3805
|
+
};
|
|
3806
|
+
return {
|
|
3807
|
+
data: d,
|
|
3808
|
+
meta: _
|
|
3809
|
+
};
|
|
3810
|
+
}, _o = (e, t) => {
|
|
3811
|
+
const r = $r(10, 1e4), n = new ot(r), i = Date.now() - 6 * 60 * 60 * 1e3, o = Date.now(), c = [], d = {};
|
|
3812
|
+
e.forEach((f) => {
|
|
3813
|
+
d[f.name] = 0;
|
|
3814
|
+
});
|
|
3815
|
+
for (let f = i; f <= o; f += 60 * 60 * 1e3) {
|
|
3816
|
+
const _ = {};
|
|
3817
|
+
e.forEach((p) => {
|
|
3818
|
+
d[p.name] += n.next(50, 500), _[p.name] = d[p.name];
|
|
3819
|
+
});
|
|
3820
|
+
const y = {
|
|
3821
|
+
version: "1.0",
|
|
3822
|
+
timestamp: new Date(f).toISOString(),
|
|
3823
|
+
event: _
|
|
3824
|
+
};
|
|
3825
|
+
c.push(y);
|
|
3826
|
+
}
|
|
3827
|
+
const h = {
|
|
3828
|
+
start_ms: i,
|
|
3829
|
+
end_ms: o,
|
|
3830
|
+
start: new Date(i).toISOString(),
|
|
3831
|
+
end: new Date(o).toISOString(),
|
|
3832
|
+
query_id: "12345",
|
|
3833
|
+
metric_names: e.map((f) => f.name),
|
|
3834
|
+
metric_units: e.reduce((f, _) => (f[_.name] = _.unit, f), {}),
|
|
3835
|
+
granularity_ms: 60 * 60 * 1e3,
|
|
3836
|
+
// 1 hour in ms
|
|
3837
|
+
display: {},
|
|
3838
|
+
...t ?? {}
|
|
3839
|
+
};
|
|
3840
|
+
return {
|
|
3841
|
+
data: c,
|
|
3842
|
+
meta: h
|
|
3843
|
+
};
|
|
3844
|
+
}, wo = (e, t, r) => {
|
|
3845
|
+
const n = Math.floor(Math.random() * 9991) + 10, i = new ot(n), o = Date.now() - 6 * 60 * 60 * 1e3, c = Date.now(), d = new Date((o + c) / 2).toISOString(), h = [];
|
|
3846
|
+
if (t) {
|
|
3847
|
+
const y = Object.keys(t), p = Object.values(t), E = (P, N) => {
|
|
3848
|
+
if (N === y.length) {
|
|
3849
|
+
e.forEach((k) => {
|
|
3850
|
+
P[k.name] = i.next(1e3, 5e7);
|
|
3851
|
+
}), h.push({
|
|
3852
|
+
version: "1.0",
|
|
3853
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3854
|
+
event: { ...P }
|
|
3855
|
+
});
|
|
3856
|
+
return;
|
|
3857
|
+
}
|
|
3858
|
+
p[N].forEach((k) => {
|
|
3859
|
+
E({ ...P, [y[N]]: k }, N + 1);
|
|
3860
|
+
});
|
|
3861
|
+
};
|
|
3862
|
+
E({}, 0);
|
|
3863
|
+
} else {
|
|
3864
|
+
const y = {};
|
|
3865
|
+
e.forEach((p) => {
|
|
3866
|
+
y[p.name] = i.next(50, 500);
|
|
3867
|
+
}), h.push({
|
|
3868
|
+
version: "1.0",
|
|
3869
|
+
timestamp: d,
|
|
3870
|
+
event: y
|
|
3871
|
+
});
|
|
3872
|
+
}
|
|
3873
|
+
const f = {};
|
|
3874
|
+
if (t)
|
|
3875
|
+
for (const y in t)
|
|
3876
|
+
f[y] = {}, t[y].forEach((p) => {
|
|
3877
|
+
f[y][p] = {
|
|
3878
|
+
name: p,
|
|
3879
|
+
deleted: !1
|
|
3880
|
+
};
|
|
3881
|
+
});
|
|
3882
|
+
const _ = {
|
|
3883
|
+
start_ms: o,
|
|
3884
|
+
end_ms: c,
|
|
3885
|
+
start: new Date(o).toISOString(),
|
|
3886
|
+
end: new Date(c).toISOString(),
|
|
3887
|
+
query_id: "12345",
|
|
3888
|
+
metric_names: e.map((y) => y.name),
|
|
3889
|
+
metric_units: e.reduce((y, p) => (y[p.name] = p.unit, y), {}),
|
|
3890
|
+
truncated: !1,
|
|
3891
|
+
limit: 50,
|
|
3892
|
+
display: f,
|
|
3893
|
+
granularity_ms: c - o,
|
|
3894
|
+
...r ?? {}
|
|
3895
|
+
};
|
|
3896
|
+
return {
|
|
3897
|
+
data: h,
|
|
3898
|
+
meta: _
|
|
3899
|
+
};
|
|
3900
|
+
};
|
|
3901
|
+
function $r(e, t) {
|
|
3902
|
+
return e = Math.ceil(e), t = Math.floor(t), Math.floor(Math.random() * (t - e + 1) + e);
|
|
3903
|
+
}
|
|
3904
|
+
export {
|
|
3905
|
+
fo as DeltaQueryTime,
|
|
3906
|
+
Me as Granularities,
|
|
3907
|
+
zs as REFRESH_INTERVAL_MS,
|
|
3908
|
+
ot as SeededRandom,
|
|
3909
|
+
po as TIMEFRAME_LOOKUP,
|
|
3910
|
+
Ws as TimePeriods,
|
|
3911
|
+
C as Timeframe,
|
|
3912
|
+
m as TimeframeKeys,
|
|
3913
|
+
lo as TimeseriesQueryTime,
|
|
3914
|
+
Ys as UnaryQueryTime,
|
|
3915
|
+
mr as aiExploreAggregations,
|
|
3916
|
+
qa as aiQuerySchema,
|
|
3917
|
+
va as barChartSchema,
|
|
3918
|
+
Be as basicExploreAggregations,
|
|
3919
|
+
Ra as basicQuerySchema,
|
|
3920
|
+
zr as ceilToNearestTimeGrain,
|
|
3921
|
+
ao as dashboardConfigSchema,
|
|
3922
|
+
io as dashboardSchemaV2,
|
|
3923
|
+
no as dashboardTileTypes,
|
|
3924
|
+
Oa as datasourceToFilterableDimensions,
|
|
3925
|
+
ho as datePickerSelectionToTimeframe,
|
|
3926
|
+
Ea as donutChartSchema,
|
|
3927
|
+
Ls as dstOffsetHours,
|
|
3928
|
+
hr as exploreAggregations,
|
|
3929
|
+
lr as exploreFilterTypesV2,
|
|
3930
|
+
Ya as exploreV4QuerySchema,
|
|
3931
|
+
ce as filterableAiExploreDimensions,
|
|
3932
|
+
oe as filterableBasicExploreDimensions,
|
|
3933
|
+
ue as filterableExploreDimensions,
|
|
3934
|
+
Bs as filterableRequestDimensions,
|
|
3935
|
+
Js as filterableRequestMetrics,
|
|
3936
|
+
Ks as filterableRequestWildcardDimensions,
|
|
3937
|
+
ks as floorToNearestTimeGrain,
|
|
3938
|
+
so as formatISOTimeWithTZ,
|
|
3939
|
+
cr as formatTime,
|
|
3940
|
+
oo as formatTimeRange,
|
|
3941
|
+
xa as gaugeChartSchema,
|
|
3942
|
+
wo as generateCrossSectionalData,
|
|
3943
|
+
_o as generateMultipleMetricTimeSeriesData,
|
|
3944
|
+
go as generateSingleMetricTimeSeriesData,
|
|
3945
|
+
uo as granularitiesToOptions,
|
|
3946
|
+
Is as granularityMsToQuery,
|
|
3947
|
+
Ze as granularityValues,
|
|
3948
|
+
Na as metricCardSchema,
|
|
3949
|
+
co as msToGranularity,
|
|
3950
|
+
to as queryDatasources,
|
|
3951
|
+
Je as queryableAiExploreDimensions,
|
|
3952
|
+
Ee as queryableBasicExploreDimensions,
|
|
3953
|
+
Ke as queryableExploreDimensions,
|
|
3954
|
+
ba as queryableRequestDimensions,
|
|
3955
|
+
Da as queryableRequestMetrics,
|
|
3956
|
+
Ta as queryableRequestWildcardDimensions,
|
|
3957
|
+
$r as rand,
|
|
3958
|
+
eo as relativeTimeRangeValuesRequestV2,
|
|
3959
|
+
fr as relativeTimeRangeValuesV4,
|
|
3960
|
+
$s as reportChartTypes,
|
|
3961
|
+
dr as requestFilterTypeEmptyV2,
|
|
3962
|
+
Vs as requestFilterTypeEqualsV2,
|
|
3963
|
+
Xs as requestFilterTypeMetricV2,
|
|
3964
|
+
Qs as requestFilterTypeWildcardV2,
|
|
3965
|
+
Ca as singleValueSchema,
|
|
3966
|
+
Sa as slottableSchema,
|
|
3967
|
+
ro as stripUnknownFilters,
|
|
3968
|
+
Ga as tileConfigSchema,
|
|
3969
|
+
ja as tileDefinitionSchema,
|
|
3970
|
+
Aa as tileLayoutSchema,
|
|
3971
|
+
Zs as timeRangeTypeV2,
|
|
3972
|
+
mo as timeframeToDatepickerSelection,
|
|
3973
|
+
yo as timeframeToDatepickerTimeperiod,
|
|
3974
|
+
Ma as timeseriesChartSchema,
|
|
3975
|
+
Pa as topNTableSchema,
|
|
3976
|
+
Ha as validDashboardQuery
|
|
3977
|
+
};
|
|
3978
|
+
//# sourceMappingURL=vitals-utilities.es.js.map
|