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