@kong-ui-public/analytics-utilities 11.2.0 → 11.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/dashboardSchema.v2.d.ts +89 -4
- package/dist/types/dashboardSchema.v2.d.ts.map +1 -1
- package/dist/vitals-utilities.cjs +1 -1
- package/dist/vitals-utilities.cjs.map +1 -1
- package/dist/vitals-utilities.es.js +299 -281
- package/dist/vitals-utilities.es.js.map +1 -1
- package/dist/vitals-utilities.umd.js +1 -1
- package/dist/vitals-utilities.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var jn = Object.defineProperty;
|
|
2
2
|
var zn = (e, t, r) => t in e ? jn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var b = (e, t, r) => zn(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
const
|
|
4
|
+
const Ms = 3e4, Os = 250, Ss = "analytics-query-provider";
|
|
5
5
|
var m = /* @__PURE__ */ ((e) => (e.FIFTEEN_MIN = "15m", e.ONE_HOUR = "1h", e.SIX_HOUR = "6h", e.TWELVE_HOUR = "12h", e.ONE_DAY = "24h", e.SEVEN_DAY = "7d", e.THIRTY_DAY = "30d", e.CURRENT_WEEK = "current_week", e.CURRENT_MONTH = "current_month", e.CURRENT_QUARTER = "current_quarter", e.PREVIOUS_WEEK = "previous_week", e.PREVIOUS_MONTH = "previous_month", e.PREVIOUS_QUARTER = "previous_quarter", e))(m || {});
|
|
6
|
-
const
|
|
6
|
+
const vs = [
|
|
7
7
|
"horizontal_bar",
|
|
8
8
|
"vertical_bar",
|
|
9
9
|
"timeseries_line",
|
|
@@ -11,7 +11,7 @@ const Ss = [
|
|
|
11
11
|
"timeseries_bar",
|
|
12
12
|
"donut",
|
|
13
13
|
"single_value"
|
|
14
|
-
], Vn = ["in", "not_in", "selector"],
|
|
14
|
+
], Vn = ["in", "not_in", "selector"], Es = ["=", "!="], xs = ["=", "!=", "<", ">", "<=", ">="], Bn = ["empty", "not_empty"], Ns = ["starts_with", "ends_with"], Ps = ["absolute", "relative"], Xn = [
|
|
15
15
|
"15m",
|
|
16
16
|
"1h",
|
|
17
17
|
"6h",
|
|
@@ -169,7 +169,7 @@ const Ss = [
|
|
|
169
169
|
"service_protocol",
|
|
170
170
|
"trace_id",
|
|
171
171
|
"upstream_uri"
|
|
172
|
-
],
|
|
172
|
+
], Is = Jn, ea = [
|
|
173
173
|
"ai_count",
|
|
174
174
|
"latencies_response_ms",
|
|
175
175
|
"latencies_upstream_ms",
|
|
@@ -179,18 +179,18 @@ const Ss = [
|
|
|
179
179
|
"response_header_content_length",
|
|
180
180
|
"status_code",
|
|
181
181
|
"upstream_status_code"
|
|
182
|
-
], ta = ie(ea),
|
|
182
|
+
], ta = ie(ea), Cs = [
|
|
183
183
|
"15M",
|
|
184
184
|
"1H",
|
|
185
185
|
"6H",
|
|
186
186
|
"12H",
|
|
187
187
|
"24H",
|
|
188
188
|
"7D"
|
|
189
|
-
],
|
|
189
|
+
], Rs = ["basic", "api_usage", "llm_usage"], ra = {
|
|
190
190
|
basic: new Set(Me),
|
|
191
191
|
api_usage: new Set(Oe),
|
|
192
192
|
llm_usage: new Set(Se)
|
|
193
|
-
},
|
|
193
|
+
}, ks = (e, t) => t.filter((r) => ra[e].has(r.field)), na = [
|
|
194
194
|
"AF",
|
|
195
195
|
// Afghanistan
|
|
196
196
|
"AX",
|
|
@@ -689,7 +689,7 @@ const Ss = [
|
|
|
689
689
|
// Zambia
|
|
690
690
|
"ZW"
|
|
691
691
|
// Zimbabwe
|
|
692
|
-
],
|
|
692
|
+
], Ys = [
|
|
693
693
|
"horizontal_bar",
|
|
694
694
|
"vertical_bar",
|
|
695
695
|
"gauge",
|
|
@@ -746,6 +746,22 @@ const Ss = [
|
|
|
746
746
|
required: ["type"],
|
|
747
747
|
additionalProperties: !1
|
|
748
748
|
}, sa = {
|
|
749
|
+
type: "object",
|
|
750
|
+
properties: {
|
|
751
|
+
type: {
|
|
752
|
+
type: "string",
|
|
753
|
+
enum: ["warning", "error", "neutral"]
|
|
754
|
+
},
|
|
755
|
+
value: {
|
|
756
|
+
type: "number"
|
|
757
|
+
},
|
|
758
|
+
label: {
|
|
759
|
+
type: "string"
|
|
760
|
+
}
|
|
761
|
+
},
|
|
762
|
+
required: ["type", "value"],
|
|
763
|
+
additionalProperties: !1
|
|
764
|
+
}, oa = {
|
|
749
765
|
type: "object",
|
|
750
766
|
properties: {
|
|
751
767
|
type: {
|
|
@@ -758,7 +774,8 @@ const Ss = [
|
|
|
758
774
|
threshold: {
|
|
759
775
|
type: "object",
|
|
760
776
|
additionalProperties: {
|
|
761
|
-
type: "
|
|
777
|
+
type: "array",
|
|
778
|
+
items: sa
|
|
762
779
|
}
|
|
763
780
|
},
|
|
764
781
|
chart_dataset_colors: ir,
|
|
@@ -768,7 +785,7 @@ const Ss = [
|
|
|
768
785
|
},
|
|
769
786
|
required: ["type"],
|
|
770
787
|
additionalProperties: !1
|
|
771
|
-
},
|
|
788
|
+
}, ua = {
|
|
772
789
|
type: "object",
|
|
773
790
|
properties: {
|
|
774
791
|
type: {
|
|
@@ -791,7 +808,7 @@ const Ss = [
|
|
|
791
808
|
},
|
|
792
809
|
required: ["type"],
|
|
793
810
|
additionalProperties: !1
|
|
794
|
-
},
|
|
811
|
+
}, ca = {
|
|
795
812
|
type: "object",
|
|
796
813
|
properties: {
|
|
797
814
|
type: {
|
|
@@ -803,7 +820,7 @@ const Ss = [
|
|
|
803
820
|
},
|
|
804
821
|
required: ["type"],
|
|
805
822
|
additionalProperties: !1
|
|
806
|
-
},
|
|
823
|
+
}, la = {
|
|
807
824
|
type: "object",
|
|
808
825
|
properties: {
|
|
809
826
|
chart_title: W,
|
|
@@ -821,7 +838,7 @@ const Ss = [
|
|
|
821
838
|
},
|
|
822
839
|
required: ["type"],
|
|
823
840
|
additionalProperties: !1
|
|
824
|
-
},
|
|
841
|
+
}, da = {
|
|
825
842
|
type: "object",
|
|
826
843
|
properties: {
|
|
827
844
|
chart_title: W,
|
|
@@ -841,7 +858,7 @@ const Ss = [
|
|
|
841
858
|
},
|
|
842
859
|
required: ["type"],
|
|
843
860
|
additionalProperties: !1
|
|
844
|
-
},
|
|
861
|
+
}, fa = {
|
|
845
862
|
type: "object",
|
|
846
863
|
properties: {
|
|
847
864
|
type: {
|
|
@@ -855,7 +872,7 @@ const Ss = [
|
|
|
855
872
|
},
|
|
856
873
|
required: ["type"],
|
|
857
874
|
additionalProperties: !1
|
|
858
|
-
},
|
|
875
|
+
}, ha = {
|
|
859
876
|
type: "object",
|
|
860
877
|
properties: {
|
|
861
878
|
type: {
|
|
@@ -888,7 +905,7 @@ const Ss = [
|
|
|
888
905
|
},
|
|
889
906
|
required: ["type"],
|
|
890
907
|
additionalProperties: !1
|
|
891
|
-
},
|
|
908
|
+
}, ma = {
|
|
892
909
|
type: "object",
|
|
893
910
|
properties: {
|
|
894
911
|
tz: {
|
|
@@ -912,7 +929,7 @@ const Ss = [
|
|
|
912
929
|
"time_range"
|
|
913
930
|
],
|
|
914
931
|
additionalProperties: !1
|
|
915
|
-
},
|
|
932
|
+
}, ya = {
|
|
916
933
|
type: "object",
|
|
917
934
|
description: "A duration representing an exact start and end time.",
|
|
918
935
|
properties: {
|
|
@@ -948,8 +965,8 @@ const Ss = [
|
|
|
948
965
|
type: "object",
|
|
949
966
|
description: "The time range to query.",
|
|
950
967
|
anyOf: [
|
|
951
|
-
|
|
952
|
-
|
|
968
|
+
ma,
|
|
969
|
+
ya
|
|
953
970
|
],
|
|
954
971
|
default: {
|
|
955
972
|
type: "relative",
|
|
@@ -1030,7 +1047,7 @@ const Ss = [
|
|
|
1030
1047
|
}
|
|
1031
1048
|
]
|
|
1032
1049
|
}
|
|
1033
|
-
}),
|
|
1050
|
+
}), ga = {
|
|
1034
1051
|
type: "object",
|
|
1035
1052
|
description: "A query to launch at the advanced explore API",
|
|
1036
1053
|
properties: {
|
|
@@ -1047,7 +1064,7 @@ const Ss = [
|
|
|
1047
1064
|
},
|
|
1048
1065
|
required: ["datasource"],
|
|
1049
1066
|
additionalProperties: !1
|
|
1050
|
-
},
|
|
1067
|
+
}, pa = {
|
|
1051
1068
|
type: "object",
|
|
1052
1069
|
description: "A query to launch at the basic explore API",
|
|
1053
1070
|
properties: {
|
|
@@ -1064,7 +1081,7 @@ const Ss = [
|
|
|
1064
1081
|
},
|
|
1065
1082
|
required: ["datasource"],
|
|
1066
1083
|
additionalProperties: !1
|
|
1067
|
-
},
|
|
1084
|
+
}, _a = {
|
|
1068
1085
|
type: "object",
|
|
1069
1086
|
description: "A query to launch at the AI explore API",
|
|
1070
1087
|
properties: {
|
|
@@ -1081,29 +1098,29 @@ const Ss = [
|
|
|
1081
1098
|
},
|
|
1082
1099
|
required: ["datasource"],
|
|
1083
1100
|
additionalProperties: !1
|
|
1084
|
-
}, _a = {
|
|
1085
|
-
anyOf: [ya, ga, pa]
|
|
1086
1101
|
}, wa = {
|
|
1102
|
+
anyOf: [ga, pa, _a]
|
|
1103
|
+
}, ba = {
|
|
1087
1104
|
type: "object",
|
|
1088
1105
|
properties: {
|
|
1089
|
-
query:
|
|
1106
|
+
query: wa,
|
|
1090
1107
|
chart: {
|
|
1091
1108
|
anyOf: [
|
|
1092
1109
|
ia,
|
|
1093
|
-
oa,
|
|
1094
1110
|
ua,
|
|
1095
|
-
sa,
|
|
1096
|
-
la,
|
|
1097
1111
|
ca,
|
|
1098
|
-
|
|
1112
|
+
oa,
|
|
1099
1113
|
da,
|
|
1100
|
-
|
|
1114
|
+
la,
|
|
1115
|
+
aa,
|
|
1116
|
+
fa,
|
|
1117
|
+
ha
|
|
1101
1118
|
]
|
|
1102
1119
|
}
|
|
1103
1120
|
},
|
|
1104
1121
|
required: ["query", "chart"],
|
|
1105
1122
|
additionalProperties: !1
|
|
1106
|
-
},
|
|
1123
|
+
}, Ta = {
|
|
1107
1124
|
type: "object",
|
|
1108
1125
|
properties: {
|
|
1109
1126
|
position: {
|
|
@@ -1140,15 +1157,15 @@ const Ss = [
|
|
|
1140
1157
|
},
|
|
1141
1158
|
required: ["position", "size"],
|
|
1142
1159
|
additionalProperties: !1
|
|
1143
|
-
},
|
|
1160
|
+
}, Da = {
|
|
1144
1161
|
type: "object",
|
|
1145
1162
|
properties: {
|
|
1146
1163
|
type: {
|
|
1147
1164
|
type: "string",
|
|
1148
1165
|
enum: ["chart"]
|
|
1149
1166
|
},
|
|
1150
|
-
definition:
|
|
1151
|
-
layout:
|
|
1167
|
+
definition: ba,
|
|
1168
|
+
layout: Ta,
|
|
1152
1169
|
id: {
|
|
1153
1170
|
type: "string",
|
|
1154
1171
|
description: "Unique identifier for the tile. If not provided, one will be generated."
|
|
@@ -1156,12 +1173,12 @@ const Ss = [
|
|
|
1156
1173
|
},
|
|
1157
1174
|
required: ["type", "definition", "layout"],
|
|
1158
1175
|
additionalProperties: !1
|
|
1159
|
-
},
|
|
1176
|
+
}, Gs = {
|
|
1160
1177
|
type: "object",
|
|
1161
1178
|
properties: {
|
|
1162
1179
|
tiles: {
|
|
1163
1180
|
type: "array",
|
|
1164
|
-
items:
|
|
1181
|
+
items: Da
|
|
1165
1182
|
},
|
|
1166
1183
|
tile_height: {
|
|
1167
1184
|
type: "number",
|
|
@@ -1175,10 +1192,10 @@ const Ss = [
|
|
|
1175
1192
|
},
|
|
1176
1193
|
required: ["tiles"],
|
|
1177
1194
|
additionalProperties: !1
|
|
1178
|
-
},
|
|
1195
|
+
}, As = (e) => {
|
|
1179
1196
|
const t = [];
|
|
1180
1197
|
return Me.includes(e) && t.push("basic"), Oe.includes(e) && t.push("api_usage"), Se.includes(e) && t.push("llm_usage"), (Kn.includes(e) || ta.includes(e)) && t.push("requests"), t;
|
|
1181
|
-
}, sr = 6048e5,
|
|
1198
|
+
}, sr = 6048e5, Ma = 864e5, Oa = 60, Sa = 3600, Rt = Symbol.for("constructDateFrom");
|
|
1182
1199
|
function C(e, t) {
|
|
1183
1200
|
return typeof e == "function" ? e(t) : e && typeof e == "object" && Rt in e ? e[Rt](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
1184
1201
|
}
|
|
@@ -1189,7 +1206,7 @@ function kt(e, t, r) {
|
|
|
1189
1206
|
const n = M(e, r == null ? void 0 : r.in);
|
|
1190
1207
|
return isNaN(t) ? C(e, NaN) : (n.setDate(n.getDate() + t), n);
|
|
1191
1208
|
}
|
|
1192
|
-
function
|
|
1209
|
+
function va(e, t, r) {
|
|
1193
1210
|
const n = M(e, r == null ? void 0 : r.in);
|
|
1194
1211
|
if (isNaN(t)) return C(e, NaN);
|
|
1195
1212
|
const i = n.getDate(), o = C(e, n.getTime());
|
|
@@ -1201,9 +1218,9 @@ function Sa(e, t, r) {
|
|
|
1201
1218
|
i
|
|
1202
1219
|
), n);
|
|
1203
1220
|
}
|
|
1204
|
-
let
|
|
1221
|
+
let Ea = {};
|
|
1205
1222
|
function oe() {
|
|
1206
|
-
return
|
|
1223
|
+
return Ea;
|
|
1207
1224
|
}
|
|
1208
1225
|
function A(e, t) {
|
|
1209
1226
|
var d, h, f, _;
|
|
@@ -1235,7 +1252,7 @@ function Yt(e) {
|
|
|
1235
1252
|
);
|
|
1236
1253
|
return r.setUTCFullYear(t.getFullYear()), +e - +r;
|
|
1237
1254
|
}
|
|
1238
|
-
function
|
|
1255
|
+
function xa(e, ...t) {
|
|
1239
1256
|
const r = C.bind(
|
|
1240
1257
|
null,
|
|
1241
1258
|
t.find((n) => typeof n == "object")
|
|
@@ -1246,33 +1263,33 @@ function _e(e, t) {
|
|
|
1246
1263
|
const r = M(e, t == null ? void 0 : t.in);
|
|
1247
1264
|
return r.setHours(0, 0, 0, 0), r;
|
|
1248
1265
|
}
|
|
1249
|
-
function
|
|
1250
|
-
const [n, i] =
|
|
1266
|
+
function Na(e, t, r) {
|
|
1267
|
+
const [n, i] = xa(
|
|
1251
1268
|
r == null ? void 0 : r.in,
|
|
1252
1269
|
e,
|
|
1253
1270
|
t
|
|
1254
1271
|
), o = _e(n), c = _e(i), d = +o - Yt(o), h = +c - Yt(c);
|
|
1255
|
-
return Math.round((d - h) /
|
|
1272
|
+
return Math.round((d - h) / Ma);
|
|
1256
1273
|
}
|
|
1257
|
-
function
|
|
1274
|
+
function Pa(e, t) {
|
|
1258
1275
|
const r = or(e, t), n = C(e, 0);
|
|
1259
1276
|
return n.setFullYear(r, 0, 4), n.setHours(0, 0, 0, 0), pe(n);
|
|
1260
1277
|
}
|
|
1261
|
-
function
|
|
1278
|
+
function Ia(e) {
|
|
1262
1279
|
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
1263
1280
|
}
|
|
1264
|
-
function
|
|
1265
|
-
return !(!
|
|
1281
|
+
function Ca(e) {
|
|
1282
|
+
return !(!Ia(e) && typeof e != "number" || isNaN(+M(e)));
|
|
1266
1283
|
}
|
|
1267
1284
|
function J(e, t) {
|
|
1268
1285
|
const r = M(e, t == null ? void 0 : t.in);
|
|
1269
1286
|
return r.setDate(1), r.setHours(0, 0, 0, 0), r;
|
|
1270
1287
|
}
|
|
1271
|
-
function
|
|
1288
|
+
function Ra(e, t) {
|
|
1272
1289
|
const r = M(e, t == null ? void 0 : t.in);
|
|
1273
1290
|
return r.setFullYear(r.getFullYear(), 0, 1), r.setHours(0, 0, 0, 0), r;
|
|
1274
1291
|
}
|
|
1275
|
-
const
|
|
1292
|
+
const ka = {
|
|
1276
1293
|
lessThanXSeconds: {
|
|
1277
1294
|
one: "less than a second",
|
|
1278
1295
|
other: "less than {{count}} seconds"
|
|
@@ -1334,9 +1351,9 @@ const Ra = {
|
|
|
1334
1351
|
one: "almost 1 year",
|
|
1335
1352
|
other: "almost {{count}} years"
|
|
1336
1353
|
}
|
|
1337
|
-
},
|
|
1354
|
+
}, Ya = (e, t, r) => {
|
|
1338
1355
|
let n;
|
|
1339
|
-
const i =
|
|
1356
|
+
const i = ka[e];
|
|
1340
1357
|
return typeof i == "string" ? n = i : t === 1 ? n = i.one : n = i.other.replace("{{count}}", t.toString()), r != null && r.addSuffix ? r.comparison && r.comparison > 0 ? "in " + n : n + " ago" : n;
|
|
1341
1358
|
};
|
|
1342
1359
|
function Fe(e) {
|
|
@@ -1345,42 +1362,42 @@ function Fe(e) {
|
|
|
1345
1362
|
return e.formats[r] || e.formats[e.defaultWidth];
|
|
1346
1363
|
};
|
|
1347
1364
|
}
|
|
1348
|
-
const
|
|
1365
|
+
const Ga = {
|
|
1349
1366
|
full: "EEEE, MMMM do, y",
|
|
1350
1367
|
long: "MMMM do, y",
|
|
1351
1368
|
medium: "MMM d, y",
|
|
1352
1369
|
short: "MM/dd/yyyy"
|
|
1353
|
-
},
|
|
1370
|
+
}, Aa = {
|
|
1354
1371
|
full: "h:mm:ss a zzzz",
|
|
1355
1372
|
long: "h:mm:ss a z",
|
|
1356
1373
|
medium: "h:mm:ss a",
|
|
1357
1374
|
short: "h:mm a"
|
|
1358
|
-
},
|
|
1375
|
+
}, Ha = {
|
|
1359
1376
|
full: "{{date}} 'at' {{time}}",
|
|
1360
1377
|
long: "{{date}} 'at' {{time}}",
|
|
1361
1378
|
medium: "{{date}}, {{time}}",
|
|
1362
1379
|
short: "{{date}}, {{time}}"
|
|
1363
|
-
},
|
|
1380
|
+
}, Fa = {
|
|
1364
1381
|
date: Fe({
|
|
1365
|
-
formats:
|
|
1382
|
+
formats: Ga,
|
|
1366
1383
|
defaultWidth: "full"
|
|
1367
1384
|
}),
|
|
1368
1385
|
time: Fe({
|
|
1369
|
-
formats:
|
|
1386
|
+
formats: Aa,
|
|
1370
1387
|
defaultWidth: "full"
|
|
1371
1388
|
}),
|
|
1372
1389
|
dateTime: Fe({
|
|
1373
|
-
formats:
|
|
1390
|
+
formats: Ha,
|
|
1374
1391
|
defaultWidth: "full"
|
|
1375
1392
|
})
|
|
1376
|
-
},
|
|
1393
|
+
}, Wa = {
|
|
1377
1394
|
lastWeek: "'last' eeee 'at' p",
|
|
1378
1395
|
yesterday: "'yesterday at' p",
|
|
1379
1396
|
today: "'today at' p",
|
|
1380
1397
|
tomorrow: "'tomorrow at' p",
|
|
1381
1398
|
nextWeek: "eeee 'at' p",
|
|
1382
1399
|
other: "P"
|
|
1383
|
-
},
|
|
1400
|
+
}, La = (e, t, r, n) => Wa[e];
|
|
1384
1401
|
function ne(e) {
|
|
1385
1402
|
return (t, r) => {
|
|
1386
1403
|
const n = r != null && r.context ? String(r.context) : "standalone";
|
|
@@ -1396,15 +1413,15 @@ function ne(e) {
|
|
|
1396
1413
|
return i[o];
|
|
1397
1414
|
};
|
|
1398
1415
|
}
|
|
1399
|
-
const
|
|
1416
|
+
const qa = {
|
|
1400
1417
|
narrow: ["B", "A"],
|
|
1401
1418
|
abbreviated: ["BC", "AD"],
|
|
1402
1419
|
wide: ["Before Christ", "Anno Domini"]
|
|
1403
|
-
},
|
|
1420
|
+
}, Ua = {
|
|
1404
1421
|
narrow: ["1", "2", "3", "4"],
|
|
1405
1422
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
1406
1423
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
1407
|
-
},
|
|
1424
|
+
}, ja = {
|
|
1408
1425
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
1409
1426
|
abbreviated: [
|
|
1410
1427
|
"Jan",
|
|
@@ -1434,7 +1451,7 @@ const La = {
|
|
|
1434
1451
|
"November",
|
|
1435
1452
|
"December"
|
|
1436
1453
|
]
|
|
1437
|
-
},
|
|
1454
|
+
}, za = {
|
|
1438
1455
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
1439
1456
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
1440
1457
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
@@ -1447,7 +1464,7 @@ const La = {
|
|
|
1447
1464
|
"Friday",
|
|
1448
1465
|
"Saturday"
|
|
1449
1466
|
]
|
|
1450
|
-
},
|
|
1467
|
+
}, Va = {
|
|
1451
1468
|
narrow: {
|
|
1452
1469
|
am: "a",
|
|
1453
1470
|
pm: "p",
|
|
@@ -1478,7 +1495,7 @@ const La = {
|
|
|
1478
1495
|
evening: "evening",
|
|
1479
1496
|
night: "night"
|
|
1480
1497
|
}
|
|
1481
|
-
},
|
|
1498
|
+
}, Ba = {
|
|
1482
1499
|
narrow: {
|
|
1483
1500
|
am: "a",
|
|
1484
1501
|
pm: "p",
|
|
@@ -1509,7 +1526,7 @@ const La = {
|
|
|
1509
1526
|
evening: "in the evening",
|
|
1510
1527
|
night: "at night"
|
|
1511
1528
|
}
|
|
1512
|
-
},
|
|
1529
|
+
}, Xa = (e, t) => {
|
|
1513
1530
|
const r = Number(e), n = r % 100;
|
|
1514
1531
|
if (n > 20 || n < 10)
|
|
1515
1532
|
switch (n % 10) {
|
|
@@ -1521,29 +1538,29 @@ const La = {
|
|
|
1521
1538
|
return r + "rd";
|
|
1522
1539
|
}
|
|
1523
1540
|
return r + "th";
|
|
1524
|
-
},
|
|
1525
|
-
ordinalNumber:
|
|
1541
|
+
}, $a = {
|
|
1542
|
+
ordinalNumber: Xa,
|
|
1526
1543
|
era: ne({
|
|
1527
|
-
values:
|
|
1544
|
+
values: qa,
|
|
1528
1545
|
defaultWidth: "wide"
|
|
1529
1546
|
}),
|
|
1530
1547
|
quarter: ne({
|
|
1531
|
-
values:
|
|
1548
|
+
values: Ua,
|
|
1532
1549
|
defaultWidth: "wide",
|
|
1533
1550
|
argumentCallback: (e) => e - 1
|
|
1534
1551
|
}),
|
|
1535
1552
|
month: ne({
|
|
1536
|
-
values:
|
|
1553
|
+
values: ja,
|
|
1537
1554
|
defaultWidth: "wide"
|
|
1538
1555
|
}),
|
|
1539
1556
|
day: ne({
|
|
1540
|
-
values:
|
|
1557
|
+
values: za,
|
|
1541
1558
|
defaultWidth: "wide"
|
|
1542
1559
|
}),
|
|
1543
1560
|
dayPeriod: ne({
|
|
1544
|
-
values:
|
|
1561
|
+
values: Va,
|
|
1545
1562
|
defaultWidth: "wide",
|
|
1546
|
-
formattingValues:
|
|
1563
|
+
formattingValues: Ba,
|
|
1547
1564
|
defaultFormattingWidth: "wide"
|
|
1548
1565
|
})
|
|
1549
1566
|
};
|
|
@@ -1552,9 +1569,9 @@ function ae(e) {
|
|
|
1552
1569
|
const n = r.width, i = n && e.matchPatterns[n] || e.matchPatterns[e.defaultMatchWidth], o = t.match(i);
|
|
1553
1570
|
if (!o)
|
|
1554
1571
|
return null;
|
|
1555
|
-
const c = o[0], d = n && e.parsePatterns[n] || e.parsePatterns[e.defaultParseWidth], h = Array.isArray(d) ?
|
|
1572
|
+
const c = o[0], d = n && e.parsePatterns[n] || e.parsePatterns[e.defaultParseWidth], h = Array.isArray(d) ? Qa(d, (y) => y.test(c)) : (
|
|
1556
1573
|
// [TODO] -- I challenge you to fix the type
|
|
1557
|
-
|
|
1574
|
+
Za(d, (y) => y.test(c))
|
|
1558
1575
|
);
|
|
1559
1576
|
let f;
|
|
1560
1577
|
f = e.valueCallback ? e.valueCallback(h) : h, f = r.valueCallback ? (
|
|
@@ -1565,17 +1582,17 @@ function ae(e) {
|
|
|
1565
1582
|
return { value: f, rest: _ };
|
|
1566
1583
|
};
|
|
1567
1584
|
}
|
|
1568
|
-
function
|
|
1585
|
+
function Za(e, t) {
|
|
1569
1586
|
for (const r in e)
|
|
1570
1587
|
if (Object.prototype.hasOwnProperty.call(e, r) && t(e[r]))
|
|
1571
1588
|
return r;
|
|
1572
1589
|
}
|
|
1573
|
-
function
|
|
1590
|
+
function Qa(e, t) {
|
|
1574
1591
|
for (let r = 0; r < e.length; r++)
|
|
1575
1592
|
if (t(e[r]))
|
|
1576
1593
|
return r;
|
|
1577
1594
|
}
|
|
1578
|
-
function
|
|
1595
|
+
function Ka(e) {
|
|
1579
1596
|
return (t, r = {}) => {
|
|
1580
1597
|
const n = t.match(e.matchPattern);
|
|
1581
1598
|
if (!n) return null;
|
|
@@ -1587,23 +1604,23 @@ function Qa(e) {
|
|
|
1587
1604
|
return { value: c, rest: d };
|
|
1588
1605
|
};
|
|
1589
1606
|
}
|
|
1590
|
-
const
|
|
1607
|
+
const Ja = /^(\d+)(th|st|nd|rd)?/i, ei = /\d+/i, ti = {
|
|
1591
1608
|
narrow: /^(b|a)/i,
|
|
1592
1609
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
1593
1610
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
1594
|
-
}, ti = {
|
|
1595
|
-
any: [/^b/i, /^(a|c)/i]
|
|
1596
1611
|
}, ri = {
|
|
1612
|
+
any: [/^b/i, /^(a|c)/i]
|
|
1613
|
+
}, ni = {
|
|
1597
1614
|
narrow: /^[1234]/i,
|
|
1598
1615
|
abbreviated: /^q[1234]/i,
|
|
1599
1616
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
1600
|
-
}, ni = {
|
|
1601
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
1602
1617
|
}, ai = {
|
|
1618
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
1619
|
+
}, ii = {
|
|
1603
1620
|
narrow: /^[jfmasond]/i,
|
|
1604
1621
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
1605
1622
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
1606
|
-
},
|
|
1623
|
+
}, si = {
|
|
1607
1624
|
narrow: [
|
|
1608
1625
|
/^j/i,
|
|
1609
1626
|
/^f/i,
|
|
@@ -1632,18 +1649,18 @@ const Ka = /^(\d+)(th|st|nd|rd)?/i, Ja = /\d+/i, ei = {
|
|
|
1632
1649
|
/^n/i,
|
|
1633
1650
|
/^d/i
|
|
1634
1651
|
]
|
|
1635
|
-
},
|
|
1652
|
+
}, oi = {
|
|
1636
1653
|
narrow: /^[smtwf]/i,
|
|
1637
1654
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
1638
1655
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
1639
1656
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
1640
|
-
},
|
|
1657
|
+
}, ui = {
|
|
1641
1658
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
1642
1659
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
1643
|
-
},
|
|
1660
|
+
}, ci = {
|
|
1644
1661
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
1645
1662
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
1646
|
-
},
|
|
1663
|
+
}, li = {
|
|
1647
1664
|
any: {
|
|
1648
1665
|
am: /^a/i,
|
|
1649
1666
|
pm: /^p/i,
|
|
@@ -1654,61 +1671,61 @@ const Ka = /^(\d+)(th|st|nd|rd)?/i, Ja = /\d+/i, ei = {
|
|
|
1654
1671
|
evening: /evening/i,
|
|
1655
1672
|
night: /night/i
|
|
1656
1673
|
}
|
|
1657
|
-
},
|
|
1658
|
-
ordinalNumber:
|
|
1659
|
-
matchPattern:
|
|
1660
|
-
parsePattern:
|
|
1674
|
+
}, di = {
|
|
1675
|
+
ordinalNumber: Ka({
|
|
1676
|
+
matchPattern: Ja,
|
|
1677
|
+
parsePattern: ei,
|
|
1661
1678
|
valueCallback: (e) => parseInt(e, 10)
|
|
1662
1679
|
}),
|
|
1663
1680
|
era: ae({
|
|
1664
|
-
matchPatterns:
|
|
1681
|
+
matchPatterns: ti,
|
|
1665
1682
|
defaultMatchWidth: "wide",
|
|
1666
|
-
parsePatterns:
|
|
1683
|
+
parsePatterns: ri,
|
|
1667
1684
|
defaultParseWidth: "any"
|
|
1668
1685
|
}),
|
|
1669
1686
|
quarter: ae({
|
|
1670
|
-
matchPatterns:
|
|
1687
|
+
matchPatterns: ni,
|
|
1671
1688
|
defaultMatchWidth: "wide",
|
|
1672
|
-
parsePatterns:
|
|
1689
|
+
parsePatterns: ai,
|
|
1673
1690
|
defaultParseWidth: "any",
|
|
1674
1691
|
valueCallback: (e) => e + 1
|
|
1675
1692
|
}),
|
|
1676
1693
|
month: ae({
|
|
1677
|
-
matchPatterns:
|
|
1694
|
+
matchPatterns: ii,
|
|
1678
1695
|
defaultMatchWidth: "wide",
|
|
1679
|
-
parsePatterns:
|
|
1696
|
+
parsePatterns: si,
|
|
1680
1697
|
defaultParseWidth: "any"
|
|
1681
1698
|
}),
|
|
1682
1699
|
day: ae({
|
|
1683
|
-
matchPatterns:
|
|
1700
|
+
matchPatterns: oi,
|
|
1684
1701
|
defaultMatchWidth: "wide",
|
|
1685
|
-
parsePatterns:
|
|
1702
|
+
parsePatterns: ui,
|
|
1686
1703
|
defaultParseWidth: "any"
|
|
1687
1704
|
}),
|
|
1688
1705
|
dayPeriod: ae({
|
|
1689
|
-
matchPatterns:
|
|
1706
|
+
matchPatterns: ci,
|
|
1690
1707
|
defaultMatchWidth: "any",
|
|
1691
|
-
parsePatterns:
|
|
1708
|
+
parsePatterns: li,
|
|
1692
1709
|
defaultParseWidth: "any"
|
|
1693
1710
|
})
|
|
1694
|
-
},
|
|
1711
|
+
}, fi = {
|
|
1695
1712
|
code: "en-US",
|
|
1696
|
-
formatDistance:
|
|
1697
|
-
formatLong:
|
|
1698
|
-
formatRelative:
|
|
1699
|
-
localize:
|
|
1700
|
-
match:
|
|
1713
|
+
formatDistance: Ya,
|
|
1714
|
+
formatLong: Fa,
|
|
1715
|
+
formatRelative: La,
|
|
1716
|
+
localize: $a,
|
|
1717
|
+
match: di,
|
|
1701
1718
|
options: {
|
|
1702
1719
|
weekStartsOn: 0,
|
|
1703
1720
|
firstWeekContainsDate: 1
|
|
1704
1721
|
}
|
|
1705
1722
|
};
|
|
1706
|
-
function
|
|
1723
|
+
function hi(e, t) {
|
|
1707
1724
|
const r = M(e, t == null ? void 0 : t.in);
|
|
1708
|
-
return
|
|
1725
|
+
return Na(r, Ra(r)) + 1;
|
|
1709
1726
|
}
|
|
1710
|
-
function
|
|
1711
|
-
const r = M(e, t == null ? void 0 : t.in), n = +pe(r) - +
|
|
1727
|
+
function mi(e, t) {
|
|
1728
|
+
const r = M(e, t == null ? void 0 : t.in), n = +pe(r) - +Pa(r);
|
|
1712
1729
|
return Math.round(n / sr) + 1;
|
|
1713
1730
|
}
|
|
1714
1731
|
function ur(e, t) {
|
|
@@ -1720,13 +1737,13 @@ function ur(e, t) {
|
|
|
1720
1737
|
const f = A(h, t);
|
|
1721
1738
|
return +r >= +d ? n + 1 : +r >= +f ? n : n - 1;
|
|
1722
1739
|
}
|
|
1723
|
-
function
|
|
1740
|
+
function yi(e, t) {
|
|
1724
1741
|
var d, h, f, _;
|
|
1725
1742
|
const r = oe(), n = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((h = (d = t == null ? void 0 : t.locale) == null ? void 0 : d.options) == null ? void 0 : h.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((_ = (f = r.locale) == null ? void 0 : f.options) == null ? void 0 : _.firstWeekContainsDate) ?? 1, i = ur(e, t), o = C((t == null ? void 0 : t.in) || e, 0);
|
|
1726
1743
|
return o.setFullYear(i, 0, n), o.setHours(0, 0, 0, 0), A(o, t);
|
|
1727
1744
|
}
|
|
1728
|
-
function
|
|
1729
|
-
const r = M(e, t == null ? void 0 : t.in), n = +A(r, t) - +
|
|
1745
|
+
function gi(e, t) {
|
|
1746
|
+
const r = M(e, t == null ? void 0 : t.in), n = +A(r, t) - +yi(r, t);
|
|
1730
1747
|
return Math.round(n / sr) + 1;
|
|
1731
1748
|
}
|
|
1732
1749
|
function p(e, t) {
|
|
@@ -1952,12 +1969,12 @@ const F = {
|
|
|
1952
1969
|
},
|
|
1953
1970
|
// Local week of year
|
|
1954
1971
|
w: function(e, t, r, n) {
|
|
1955
|
-
const i =
|
|
1972
|
+
const i = gi(e, n);
|
|
1956
1973
|
return t === "wo" ? r.ordinalNumber(i, { unit: "week" }) : p(i, t.length);
|
|
1957
1974
|
},
|
|
1958
1975
|
// ISO week of year
|
|
1959
1976
|
I: function(e, t, r) {
|
|
1960
|
-
const n =
|
|
1977
|
+
const n = mi(e);
|
|
1961
1978
|
return t === "Io" ? r.ordinalNumber(n, { unit: "week" }) : p(n, t.length);
|
|
1962
1979
|
},
|
|
1963
1980
|
// Day of the month
|
|
@@ -1966,7 +1983,7 @@ const F = {
|
|
|
1966
1983
|
},
|
|
1967
1984
|
// Day of year
|
|
1968
1985
|
D: function(e, t, r) {
|
|
1969
|
-
const n =
|
|
1986
|
+
const n = hi(e);
|
|
1970
1987
|
return t === "Do" ? r.ordinalNumber(n, { unit: "dayOfYear" }) : p(n, t.length);
|
|
1971
1988
|
},
|
|
1972
1989
|
// Day of week
|
|
@@ -2316,7 +2333,7 @@ const Ft = (e, t) => {
|
|
|
2316
2333
|
default:
|
|
2317
2334
|
return t.time({ width: "full" });
|
|
2318
2335
|
}
|
|
2319
|
-
},
|
|
2336
|
+
}, pi = (e, t) => {
|
|
2320
2337
|
const r = e.match(/(P+)(p+)?/) || [], n = r[1], i = r[2];
|
|
2321
2338
|
if (!i)
|
|
2322
2339
|
return Ft(e, t);
|
|
@@ -2337,46 +2354,46 @@ const Ft = (e, t) => {
|
|
|
2337
2354
|
break;
|
|
2338
2355
|
}
|
|
2339
2356
|
return o.replace("{{date}}", Ft(n, t)).replace("{{time}}", cr(i, t));
|
|
2340
|
-
},
|
|
2357
|
+
}, _i = {
|
|
2341
2358
|
p: cr,
|
|
2342
|
-
P:
|
|
2343
|
-
},
|
|
2344
|
-
function Ti(e) {
|
|
2345
|
-
return _i.test(e);
|
|
2346
|
-
}
|
|
2359
|
+
P: pi
|
|
2360
|
+
}, wi = /^D+$/, bi = /^Y+$/, Ti = ["D", "DD", "YY", "YYYY"];
|
|
2347
2361
|
function Di(e) {
|
|
2348
2362
|
return wi.test(e);
|
|
2349
2363
|
}
|
|
2350
|
-
function Mi(e
|
|
2351
|
-
|
|
2352
|
-
if (console.warn(n), bi.includes(e)) throw new RangeError(n);
|
|
2364
|
+
function Mi(e) {
|
|
2365
|
+
return bi.test(e);
|
|
2353
2366
|
}
|
|
2354
2367
|
function Oi(e, t, r) {
|
|
2368
|
+
const n = Si(e, t, r);
|
|
2369
|
+
if (console.warn(n), Ti.includes(e)) throw new RangeError(n);
|
|
2370
|
+
}
|
|
2371
|
+
function Si(e, t, r) {
|
|
2355
2372
|
const n = e[0] === "Y" ? "years" : "days of the month";
|
|
2356
2373
|
return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
2357
2374
|
}
|
|
2358
|
-
const
|
|
2375
|
+
const vi = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Ei = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, xi = /^'([^]*?)'?$/, Ni = /''/g, Pi = /[a-zA-Z]/;
|
|
2359
2376
|
function lr(e, t, r) {
|
|
2360
2377
|
var _, y, g, x, N, P, R, L;
|
|
2361
|
-
const n = oe(), i = (r == null ? void 0 : r.locale) ?? n.locale ??
|
|
2362
|
-
if (!
|
|
2378
|
+
const n = oe(), i = (r == null ? void 0 : r.locale) ?? n.locale ?? fi, o = (r == null ? void 0 : r.firstWeekContainsDate) ?? ((y = (_ = r == null ? void 0 : r.locale) == null ? void 0 : _.options) == null ? void 0 : y.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((x = (g = n.locale) == null ? void 0 : g.options) == null ? void 0 : x.firstWeekContainsDate) ?? 1, c = (r == null ? void 0 : r.weekStartsOn) ?? ((P = (N = r == null ? void 0 : r.locale) == null ? void 0 : N.options) == null ? void 0 : P.weekStartsOn) ?? n.weekStartsOn ?? ((L = (R = n.locale) == null ? void 0 : R.options) == null ? void 0 : L.weekStartsOn) ?? 0, d = M(e, r == null ? void 0 : r.in);
|
|
2379
|
+
if (!Ca(d))
|
|
2363
2380
|
throw new RangeError("Invalid time value");
|
|
2364
|
-
let h = t.match(
|
|
2381
|
+
let h = t.match(Ei).map((O) => {
|
|
2365
2382
|
const T = O[0];
|
|
2366
2383
|
if (T === "p" || T === "P") {
|
|
2367
|
-
const q =
|
|
2384
|
+
const q = _i[T];
|
|
2368
2385
|
return q(O, i.formatLong);
|
|
2369
2386
|
}
|
|
2370
2387
|
return O;
|
|
2371
|
-
}).join("").match(
|
|
2388
|
+
}).join("").match(vi).map((O) => {
|
|
2372
2389
|
if (O === "''")
|
|
2373
2390
|
return { isToken: !1, value: "'" };
|
|
2374
2391
|
const T = O[0];
|
|
2375
2392
|
if (T === "'")
|
|
2376
|
-
return { isToken: !1, value:
|
|
2393
|
+
return { isToken: !1, value: Ii(O) };
|
|
2377
2394
|
if (Gt[T])
|
|
2378
2395
|
return { isToken: !0, value: O };
|
|
2379
|
-
if (T.match(
|
|
2396
|
+
if (T.match(Pi))
|
|
2380
2397
|
throw new RangeError(
|
|
2381
2398
|
"Format string contains an unescaped latin alphabet character `" + T + "`"
|
|
2382
2399
|
);
|
|
@@ -2391,20 +2408,20 @@ function lr(e, t, r) {
|
|
|
2391
2408
|
return h.map((O) => {
|
|
2392
2409
|
if (!O.isToken) return O.value;
|
|
2393
2410
|
const T = O.value;
|
|
2394
|
-
(!(r != null && r.useAdditionalWeekYearTokens) &&
|
|
2411
|
+
(!(r != null && r.useAdditionalWeekYearTokens) && Mi(T) || !(r != null && r.useAdditionalDayOfYearTokens) && Di(T)) && Oi(T, t, String(e));
|
|
2395
2412
|
const q = Gt[T[0]];
|
|
2396
2413
|
return q(d, T, i.localize, f);
|
|
2397
2414
|
}).join("");
|
|
2398
2415
|
}
|
|
2399
|
-
function
|
|
2400
|
-
const t = e.match(
|
|
2401
|
-
return t ? t[1].replace(
|
|
2416
|
+
function Ii(e) {
|
|
2417
|
+
const t = e.match(xi);
|
|
2418
|
+
return t ? t[1].replace(Ni, "'") : e;
|
|
2402
2419
|
}
|
|
2403
|
-
function
|
|
2420
|
+
function Ci(e, t) {
|
|
2404
2421
|
const r = M(e, t == null ? void 0 : t.in), n = r.getFullYear(), i = r.getMonth(), o = C(r, 0);
|
|
2405
2422
|
return o.setFullYear(n, i + 1, 0), o.setHours(0, 0, 0, 0), o.getDate();
|
|
2406
2423
|
}
|
|
2407
|
-
function
|
|
2424
|
+
function Ri() {
|
|
2408
2425
|
return Object.assign({}, oe());
|
|
2409
2426
|
}
|
|
2410
2427
|
function Wt(e) {
|
|
@@ -2413,41 +2430,41 @@ function Wt(e) {
|
|
|
2413
2430
|
function Lt(e) {
|
|
2414
2431
|
return Math.trunc(+M(e) / 1e3);
|
|
2415
2432
|
}
|
|
2416
|
-
function Ri(e) {
|
|
2417
|
-
return Math.trunc(e * Oa);
|
|
2418
|
-
}
|
|
2419
2433
|
function ki(e) {
|
|
2420
|
-
|
|
2434
|
+
return Math.trunc(e * Sa);
|
|
2435
|
+
}
|
|
2436
|
+
function Yi(e) {
|
|
2437
|
+
const t = e / Oa;
|
|
2421
2438
|
return Math.trunc(t);
|
|
2422
2439
|
}
|
|
2423
2440
|
function dr(e, t, r) {
|
|
2424
|
-
return
|
|
2441
|
+
return va(e, -1, r);
|
|
2425
2442
|
}
|
|
2426
2443
|
function qt(e, t, r) {
|
|
2427
|
-
const n =
|
|
2428
|
-
return "formatToParts" in i ?
|
|
2444
|
+
const n = Ri(), i = Hi(e, r.timeZone, r.locale ?? n.locale);
|
|
2445
|
+
return "formatToParts" in i ? Gi(i, t) : Ai(i, t);
|
|
2429
2446
|
}
|
|
2430
|
-
function
|
|
2447
|
+
function Gi(e, t) {
|
|
2431
2448
|
const r = e.formatToParts(t);
|
|
2432
2449
|
for (let n = r.length - 1; n >= 0; --n)
|
|
2433
2450
|
if (r[n].type === "timeZoneName")
|
|
2434
2451
|
return r[n].value;
|
|
2435
2452
|
}
|
|
2436
|
-
function
|
|
2453
|
+
function Ai(e, t) {
|
|
2437
2454
|
const r = e.format(t).replace(/\u200E/g, ""), n = / [\w-+ ]+$/.exec(r);
|
|
2438
2455
|
return n ? n[0].substr(1) : "";
|
|
2439
2456
|
}
|
|
2440
|
-
function
|
|
2457
|
+
function Hi(e, t, r) {
|
|
2441
2458
|
return new Intl.DateTimeFormat(r ? [r.code, "en-US"] : void 0, {
|
|
2442
2459
|
timeZone: t,
|
|
2443
2460
|
timeZoneName: e
|
|
2444
2461
|
});
|
|
2445
2462
|
}
|
|
2446
|
-
function
|
|
2447
|
-
const r =
|
|
2448
|
-
return "formatToParts" in r ?
|
|
2463
|
+
function Fi(e, t) {
|
|
2464
|
+
const r = ji(t);
|
|
2465
|
+
return "formatToParts" in r ? Li(r, e) : qi(r, e);
|
|
2449
2466
|
}
|
|
2450
|
-
const
|
|
2467
|
+
const Wi = {
|
|
2451
2468
|
year: 0,
|
|
2452
2469
|
month: 1,
|
|
2453
2470
|
day: 2,
|
|
@@ -2455,11 +2472,11 @@ const Fi = {
|
|
|
2455
2472
|
minute: 4,
|
|
2456
2473
|
second: 5
|
|
2457
2474
|
};
|
|
2458
|
-
function
|
|
2475
|
+
function Li(e, t) {
|
|
2459
2476
|
try {
|
|
2460
2477
|
const r = e.formatToParts(t), n = [];
|
|
2461
2478
|
for (let i = 0; i < r.length; i++) {
|
|
2462
|
-
const o =
|
|
2479
|
+
const o = Wi[r[i].type];
|
|
2463
2480
|
o !== void 0 && (n[o] = parseInt(r[i].value, 10));
|
|
2464
2481
|
}
|
|
2465
2482
|
return n;
|
|
@@ -2469,7 +2486,7 @@ function Wi(e, t) {
|
|
|
2469
2486
|
throw r;
|
|
2470
2487
|
}
|
|
2471
2488
|
}
|
|
2472
|
-
function
|
|
2489
|
+
function qi(e, t) {
|
|
2473
2490
|
const r = e.format(t), n = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);
|
|
2474
2491
|
return [
|
|
2475
2492
|
parseInt(n[3], 10),
|
|
@@ -2489,9 +2506,9 @@ const We = {}, Ut = new Intl.DateTimeFormat("en-US", {
|
|
|
2489
2506
|
hour: "2-digit",
|
|
2490
2507
|
minute: "2-digit",
|
|
2491
2508
|
second: "2-digit"
|
|
2492
|
-
}).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")),
|
|
2493
|
-
function
|
|
2494
|
-
return We[e] || (We[e] =
|
|
2509
|
+
}).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), Ui = Ut === "06/25/2014, 00:00:00" || Ut === "06/25/2014 00:00:00";
|
|
2510
|
+
function ji(e) {
|
|
2511
|
+
return We[e] || (We[e] = Ui ? new Intl.DateTimeFormat("en-US", {
|
|
2495
2512
|
hourCycle: "h23",
|
|
2496
2513
|
timeZone: e,
|
|
2497
2514
|
year: "numeric",
|
|
@@ -2515,7 +2532,7 @@ function Ze(e, t, r, n, i, o, c) {
|
|
|
2515
2532
|
const d = /* @__PURE__ */ new Date(0);
|
|
2516
2533
|
return d.setUTCFullYear(e, t, r), d.setUTCHours(n, i, o, c), d;
|
|
2517
2534
|
}
|
|
2518
|
-
const jt = 36e5,
|
|
2535
|
+
const jt = 36e5, zi = 6e4, Le = {
|
|
2519
2536
|
timezoneZ: /^(Z)$/,
|
|
2520
2537
|
timezoneHH: /^([+-]\d{2})$/,
|
|
2521
2538
|
timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/
|
|
@@ -2532,25 +2549,25 @@ function ue(e, t, r) {
|
|
|
2532
2549
|
if (n = Le.timezoneHHMM.exec(e), n) {
|
|
2533
2550
|
i = parseInt(n[2], 10);
|
|
2534
2551
|
const c = parseInt(n[3], 10);
|
|
2535
|
-
return zt(i, c) ? (o = Math.abs(i) * jt + c *
|
|
2552
|
+
return zt(i, c) ? (o = Math.abs(i) * jt + c * zi, n[1] === "+" ? -o : o) : NaN;
|
|
2536
2553
|
}
|
|
2537
|
-
if (
|
|
2554
|
+
if (Xi(e)) {
|
|
2538
2555
|
t = new Date(t || Date.now());
|
|
2539
|
-
const c = r ? t :
|
|
2540
|
-
return -(r ? d :
|
|
2556
|
+
const c = r ? t : Vi(t), d = ze(c, e);
|
|
2557
|
+
return -(r ? d : Bi(t, d, e));
|
|
2541
2558
|
}
|
|
2542
2559
|
return NaN;
|
|
2543
2560
|
}
|
|
2544
|
-
function
|
|
2561
|
+
function Vi(e) {
|
|
2545
2562
|
return Ze(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
|
|
2546
2563
|
}
|
|
2547
2564
|
function ze(e, t) {
|
|
2548
|
-
const r =
|
|
2565
|
+
const r = Fi(e, t), n = Ze(r[0], r[1] - 1, r[2], r[3] % 24, r[4], r[5], 0).getTime();
|
|
2549
2566
|
let i = e.getTime();
|
|
2550
2567
|
const o = i % 1e3;
|
|
2551
2568
|
return i -= o >= 0 ? o : 1e3 + o, n - i;
|
|
2552
2569
|
}
|
|
2553
|
-
function
|
|
2570
|
+
function Bi(e, t, r) {
|
|
2554
2571
|
let i = e.getTime() - t;
|
|
2555
2572
|
const o = ze(new Date(i), r);
|
|
2556
2573
|
if (t === o)
|
|
@@ -2563,7 +2580,7 @@ function zt(e, t) {
|
|
|
2563
2580
|
return -23 <= e && e <= 23 && (t == null || 0 <= t && t <= 59);
|
|
2564
2581
|
}
|
|
2565
2582
|
const Vt = {};
|
|
2566
|
-
function
|
|
2583
|
+
function Xi(e) {
|
|
2567
2584
|
if (Vt[e])
|
|
2568
2585
|
return !0;
|
|
2569
2586
|
try {
|
|
@@ -2572,7 +2589,7 @@ function Bi(e) {
|
|
|
2572
2589
|
return !1;
|
|
2573
2590
|
}
|
|
2574
2591
|
}
|
|
2575
|
-
const
|
|
2592
|
+
const $i = 60 * 1e3, Zi = {
|
|
2576
2593
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
2577
2594
|
X: function(e, t, r) {
|
|
2578
2595
|
const n = qe(r.timeZone, e);
|
|
@@ -2612,7 +2629,7 @@ const Xi = 60 * 1e3, $i = {
|
|
|
2612
2629
|
case "O":
|
|
2613
2630
|
case "OO":
|
|
2614
2631
|
case "OOO":
|
|
2615
|
-
return "GMT" +
|
|
2632
|
+
return "GMT" + Qi(n, ":");
|
|
2616
2633
|
case "OOOO":
|
|
2617
2634
|
default:
|
|
2618
2635
|
return "GMT" + K(n, ":");
|
|
@@ -2632,7 +2649,7 @@ const Xi = 60 * 1e3, $i = {
|
|
|
2632
2649
|
}
|
|
2633
2650
|
};
|
|
2634
2651
|
function qe(e, t) {
|
|
2635
|
-
const r = e ? ue(e, t, !0) /
|
|
2652
|
+
const r = e ? ue(e, t, !0) / $i : (t == null ? void 0 : t.getTimezoneOffset()) ?? 0;
|
|
2636
2653
|
if (Number.isNaN(r))
|
|
2637
2654
|
throw new RangeError("Invalid time zone specified: " + e);
|
|
2638
2655
|
return r;
|
|
@@ -2651,7 +2668,7 @@ function K(e, t = "") {
|
|
|
2651
2668
|
function Bt(e, t) {
|
|
2652
2669
|
return e % 60 === 0 ? (e > 0 ? "-" : "+") + we(Math.abs(e) / 60, 2) : K(e, t);
|
|
2653
2670
|
}
|
|
2654
|
-
function
|
|
2671
|
+
function Qi(e, t = "") {
|
|
2655
2672
|
const r = e > 0 ? "-" : "+", n = Math.abs(e), i = Math.floor(n / 60), o = n % 60;
|
|
2656
2673
|
return o === 0 ? r + String(i) : r + String(i) + t + we(o, 2);
|
|
2657
2674
|
}
|
|
@@ -2659,7 +2676,7 @@ function Xt(e) {
|
|
|
2659
2676
|
const t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
|
|
2660
2677
|
return t.setUTCFullYear(e.getFullYear()), +e - +t;
|
|
2661
2678
|
}
|
|
2662
|
-
const fr = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, Ue = 36e5, $t = 6e4,
|
|
2679
|
+
const fr = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, Ue = 36e5, $t = 6e4, Ki = 2, S = {
|
|
2663
2680
|
dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
|
|
2664
2681
|
datePattern: /^([0-9W+-]+)(.*)/,
|
|
2665
2682
|
// year tokens
|
|
@@ -2698,7 +2715,7 @@ function be(e, t = {}) {
|
|
|
2698
2715
|
throw new TypeError("1 argument required, but only " + arguments.length + " present");
|
|
2699
2716
|
if (e === null)
|
|
2700
2717
|
return /* @__PURE__ */ new Date(NaN);
|
|
2701
|
-
const r = t.additionalDigits == null ?
|
|
2718
|
+
const r = t.additionalDigits == null ? Ki : Number(t.additionalDigits);
|
|
2702
2719
|
if (r !== 2 && r !== 1 && r !== 0)
|
|
2703
2720
|
throw new RangeError("additionalDigits must be 0, 1 or 2");
|
|
2704
2721
|
if (e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]")
|
|
@@ -2707,13 +2724,13 @@ function be(e, t = {}) {
|
|
|
2707
2724
|
return new Date(e);
|
|
2708
2725
|
if (Object.prototype.toString.call(e) !== "[object String]")
|
|
2709
2726
|
return /* @__PURE__ */ new Date(NaN);
|
|
2710
|
-
const n =
|
|
2727
|
+
const n = Ji(e), { year: i, restDateString: o } = es(n.date, r), c = ts(o, i);
|
|
2711
2728
|
if (c === null || isNaN(c.getTime()))
|
|
2712
2729
|
return /* @__PURE__ */ new Date(NaN);
|
|
2713
2730
|
if (c) {
|
|
2714
2731
|
const d = c.getTime();
|
|
2715
2732
|
let h = 0, f;
|
|
2716
|
-
if (n.time && (h =
|
|
2733
|
+
if (n.time && (h = rs(n.time), h === null || isNaN(h)))
|
|
2717
2734
|
return /* @__PURE__ */ new Date(NaN);
|
|
2718
2735
|
if (n.timeZone || t.timeZone) {
|
|
2719
2736
|
if (f = ue(n.timeZone || t.timeZone, new Date(d + h)), isNaN(f))
|
|
@@ -2724,7 +2741,7 @@ function be(e, t = {}) {
|
|
|
2724
2741
|
} else
|
|
2725
2742
|
return /* @__PURE__ */ new Date(NaN);
|
|
2726
2743
|
}
|
|
2727
|
-
function
|
|
2744
|
+
function Ji(e) {
|
|
2728
2745
|
const t = {};
|
|
2729
2746
|
let r = S.dateTimePattern.exec(e), n;
|
|
2730
2747
|
if (r ? (t.date = r[1], n = r[3]) : (r = S.datePattern.exec(e), r ? (t.date = r[1], n = r[2]) : (t.date = null, n = e)), n) {
|
|
@@ -2733,7 +2750,7 @@ function Ki(e) {
|
|
|
2733
2750
|
}
|
|
2734
2751
|
return t;
|
|
2735
2752
|
}
|
|
2736
|
-
function
|
|
2753
|
+
function es(e, t) {
|
|
2737
2754
|
if (e) {
|
|
2738
2755
|
const r = S.YYY[t], n = S.YYYYY[t];
|
|
2739
2756
|
let i = S.YYYY.exec(e) || n.exec(e);
|
|
@@ -2756,7 +2773,7 @@ function Ji(e, t) {
|
|
|
2756
2773
|
year: null
|
|
2757
2774
|
};
|
|
2758
2775
|
}
|
|
2759
|
-
function
|
|
2776
|
+
function ts(e, t) {
|
|
2760
2777
|
if (t === null)
|
|
2761
2778
|
return null;
|
|
2762
2779
|
let r, n, i;
|
|
@@ -2768,7 +2785,7 @@ function es(e, t) {
|
|
|
2768
2785
|
if (o = S.DDD.exec(e), o) {
|
|
2769
2786
|
r = /* @__PURE__ */ new Date(0);
|
|
2770
2787
|
const c = parseInt(o[1], 10);
|
|
2771
|
-
return
|
|
2788
|
+
return is(t, c) ? (r.setUTCFullYear(t, 0, c), r) : /* @__PURE__ */ new Date(NaN);
|
|
2772
2789
|
}
|
|
2773
2790
|
if (o = S.MMDD.exec(e), o) {
|
|
2774
2791
|
r = /* @__PURE__ */ new Date(0), n = parseInt(o[1], 10) - 1;
|
|
@@ -2784,7 +2801,7 @@ function es(e, t) {
|
|
|
2784
2801
|
}
|
|
2785
2802
|
return null;
|
|
2786
2803
|
}
|
|
2787
|
-
function
|
|
2804
|
+
function rs(e) {
|
|
2788
2805
|
let t, r, n = S.HH.exec(e);
|
|
2789
2806
|
if (n)
|
|
2790
2807
|
return t = parseFloat(n[1].replace(",", ".")), je(t) ? t % 24 * Ue : NaN;
|
|
@@ -2804,7 +2821,7 @@ function Zt(e, t, r) {
|
|
|
2804
2821
|
const i = n.getUTCDay() || 7, o = t * 7 + r + 1 - i;
|
|
2805
2822
|
return n.setUTCDate(n.getUTCDate() + o), n;
|
|
2806
2823
|
}
|
|
2807
|
-
const
|
|
2824
|
+
const ns = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], as = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
2808
2825
|
function hr(e) {
|
|
2809
2826
|
return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
|
|
2810
2827
|
}
|
|
@@ -2815,12 +2832,12 @@ function Qt(e, t, r) {
|
|
|
2815
2832
|
if (r < 1)
|
|
2816
2833
|
return !1;
|
|
2817
2834
|
const n = hr(e);
|
|
2818
|
-
if (n && r >
|
|
2835
|
+
if (n && r > as[t] || !n && r > ns[t])
|
|
2819
2836
|
return !1;
|
|
2820
2837
|
}
|
|
2821
2838
|
return !0;
|
|
2822
2839
|
}
|
|
2823
|
-
function
|
|
2840
|
+
function is(e, t) {
|
|
2824
2841
|
if (t < 1)
|
|
2825
2842
|
return !1;
|
|
2826
2843
|
const r = hr(e);
|
|
@@ -2832,16 +2849,16 @@ function Kt(e, t) {
|
|
|
2832
2849
|
function je(e, t, r) {
|
|
2833
2850
|
return !(e < 0 || e >= 25 || t != null && (t < 0 || t >= 60) || r != null && (r < 0 || r >= 60));
|
|
2834
2851
|
}
|
|
2835
|
-
const
|
|
2836
|
-
function
|
|
2852
|
+
const ss = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
|
|
2853
|
+
function os(e, t, r = {}) {
|
|
2837
2854
|
t = String(t);
|
|
2838
|
-
const n = t.match(
|
|
2855
|
+
const n = t.match(ss);
|
|
2839
2856
|
if (n) {
|
|
2840
2857
|
const i = be(r.originalDate || e, r);
|
|
2841
2858
|
t = n.reduce(function(o, c) {
|
|
2842
2859
|
if (c[0] === "'")
|
|
2843
2860
|
return o;
|
|
2844
|
-
const d = o.indexOf(c), h = o[d - 1] === "'", f = o.replace(c, "'" +
|
|
2861
|
+
const d = o.indexOf(c), h = o[d - 1] === "'", f = o.replace(c, "'" + Zi[c[0]](i, c, r) + "'");
|
|
2845
2862
|
return h ? f.substring(0, d - 1) + f.substring(d + 1) : f;
|
|
2846
2863
|
}, t);
|
|
2847
2864
|
}
|
|
@@ -2852,14 +2869,14 @@ function mr(e, t, r) {
|
|
|
2852
2869
|
const n = ue(t, e, !0), i = new Date(e.getTime() - n), o = /* @__PURE__ */ new Date(0);
|
|
2853
2870
|
return o.setFullYear(i.getUTCFullYear(), i.getUTCMonth(), i.getUTCDate()), o.setHours(i.getUTCHours(), i.getUTCMinutes(), i.getUTCSeconds(), i.getUTCMilliseconds()), o;
|
|
2854
2871
|
}
|
|
2855
|
-
function
|
|
2872
|
+
function us(e, t, r, n) {
|
|
2856
2873
|
return n = {
|
|
2857
2874
|
...n,
|
|
2858
2875
|
timeZone: t,
|
|
2859
2876
|
originalDate: e
|
|
2860
|
-
},
|
|
2877
|
+
}, os(mr(e, t, { timeZone: n.timeZone }), r, n);
|
|
2861
2878
|
}
|
|
2862
|
-
function
|
|
2879
|
+
function cs(e, t, r) {
|
|
2863
2880
|
if (typeof e == "string" && !e.match(fr))
|
|
2864
2881
|
return be(e, { ...r, timeZone: t });
|
|
2865
2882
|
e = be(e, r);
|
|
@@ -2869,7 +2886,7 @@ function us(e, t, r) {
|
|
|
2869
2886
|
function yr(e, t) {
|
|
2870
2887
|
return -ue(e, t);
|
|
2871
2888
|
}
|
|
2872
|
-
function
|
|
2889
|
+
function Hs(e) {
|
|
2873
2890
|
return lr(e, "yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
|
|
2874
2891
|
}
|
|
2875
2892
|
function Jt(e, t = {}) {
|
|
@@ -2880,12 +2897,12 @@ function Jt(e, t = {}) {
|
|
|
2880
2897
|
let n = "MMM dd, yyy hh:mm a";
|
|
2881
2898
|
t.short && (n = "MMM dd, yyy"), t.includeTZ && (n += " (z)");
|
|
2882
2899
|
const i = new Date(e);
|
|
2883
|
-
return
|
|
2900
|
+
return us(i, r, n);
|
|
2884
2901
|
} catch {
|
|
2885
2902
|
return console.error("Invalid value passed to formatTime", e), "(invalid date)";
|
|
2886
2903
|
}
|
|
2887
2904
|
}
|
|
2888
|
-
function
|
|
2905
|
+
function Fs(e, t) {
|
|
2889
2906
|
return `${Jt(e.getTime())} - ${Jt(t.getTime(), { includeTZ: !0 })}`;
|
|
2890
2907
|
}
|
|
2891
2908
|
const Te = {
|
|
@@ -2903,20 +2920,20 @@ const Te = {
|
|
|
2903
2920
|
weekly: 60 * 60 * 24 * 7 * 1e3,
|
|
2904
2921
|
trend: 0
|
|
2905
2922
|
};
|
|
2906
|
-
function
|
|
2923
|
+
function Ws(e, t) {
|
|
2907
2924
|
return e.map((r) => ({
|
|
2908
2925
|
value: r,
|
|
2909
2926
|
label: t.t(`configuration.vitals.reports.granularity.${r}`)
|
|
2910
2927
|
}));
|
|
2911
2928
|
}
|
|
2912
|
-
function
|
|
2929
|
+
function ls(e, t) {
|
|
2913
2930
|
return {
|
|
2914
2931
|
duration: e,
|
|
2915
2932
|
type: "duration",
|
|
2916
2933
|
origin: t
|
|
2917
2934
|
};
|
|
2918
2935
|
}
|
|
2919
|
-
function
|
|
2936
|
+
function Ls(e) {
|
|
2920
2937
|
return e && er.find((r) => e <= Te[r]) || null;
|
|
2921
2938
|
}
|
|
2922
2939
|
function gr(e, t, r, n) {
|
|
@@ -2924,7 +2941,7 @@ function gr(e, t, r, n) {
|
|
|
2924
2941
|
let o = 0;
|
|
2925
2942
|
return i >= Te.daily && (n ? o = -yr(n, t) : o = t.getTimezoneOffset() * 60 * 1e3), new Date(e((t.getTime() - o) / i) * i + o);
|
|
2926
2943
|
}
|
|
2927
|
-
function
|
|
2944
|
+
function ds(e, t, r) {
|
|
2928
2945
|
return gr(Math.floor, e, t, r);
|
|
2929
2946
|
}
|
|
2930
2947
|
function pr(e, t, r) {
|
|
@@ -2943,7 +2960,7 @@ class Ee {
|
|
|
2943
2960
|
if (t)
|
|
2944
2961
|
return new Date(this.endDate().getTime() - this.timeframe.timeframeLengthMs() * n);
|
|
2945
2962
|
{
|
|
2946
|
-
const i = this.endDate(), o = this.timeframe.rawStart(this.tz), c =
|
|
2963
|
+
const i = this.endDate(), o = this.timeframe.rawStart(this.tz), c = ds(o, r, this.tz), h = (i.getTime() - c.getTime()) * (n - 1);
|
|
2947
2964
|
return new Date(c.getTime() - h);
|
|
2948
2965
|
}
|
|
2949
2966
|
}
|
|
@@ -2951,7 +2968,7 @@ class Ee {
|
|
|
2951
2968
|
return Math.floor(this.granularityMs() / 1e3);
|
|
2952
2969
|
}
|
|
2953
2970
|
granularityDruid() {
|
|
2954
|
-
return
|
|
2971
|
+
return ls(this.granularityMs(), this.startDate().toISOString());
|
|
2955
2972
|
}
|
|
2956
2973
|
// Return a UNIX timestamp suitable for use in the `start` query param.
|
|
2957
2974
|
startSeconds() {
|
|
@@ -2970,7 +2987,7 @@ class Ee {
|
|
|
2970
2987
|
return Wt(this.endDate());
|
|
2971
2988
|
}
|
|
2972
2989
|
}
|
|
2973
|
-
class
|
|
2990
|
+
class qs extends Ee {
|
|
2974
2991
|
constructor(r, n, i, o, c) {
|
|
2975
2992
|
super(r, i, o);
|
|
2976
2993
|
b(this, "granularity");
|
|
@@ -2986,7 +3003,7 @@ class Ls extends Ee {
|
|
|
2986
3003
|
return Te[this.granularity];
|
|
2987
3004
|
}
|
|
2988
3005
|
}
|
|
2989
|
-
class
|
|
3006
|
+
class fs extends Ee {
|
|
2990
3007
|
startDate() {
|
|
2991
3008
|
return this.calculateStartDate(this.timeframe.isRelative, this.dataGranularity);
|
|
2992
3009
|
}
|
|
@@ -2997,7 +3014,7 @@ class ds extends Ee {
|
|
|
2997
3014
|
return this.endDate().getTime() - this.startDate().getTime();
|
|
2998
3015
|
}
|
|
2999
3016
|
}
|
|
3000
|
-
class
|
|
3017
|
+
class Us extends fs {
|
|
3001
3018
|
startDate() {
|
|
3002
3019
|
return this.calculateStartDate(this.timeframe.isRelative, this.dataGranularity, 2);
|
|
3003
3020
|
}
|
|
@@ -3006,7 +3023,7 @@ class qs extends ds {
|
|
|
3006
3023
|
}
|
|
3007
3024
|
}
|
|
3008
3025
|
var ge = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
3009
|
-
function
|
|
3026
|
+
function hs(e) {
|
|
3010
3027
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3011
3028
|
}
|
|
3012
3029
|
var De = { exports: {} };
|
|
@@ -3454,8 +3471,8 @@ De.exports;
|
|
|
3454
3471
|
}
|
|
3455
3472
|
e.exports = Gn;
|
|
3456
3473
|
})(De, De.exports);
|
|
3457
|
-
var
|
|
3458
|
-
const
|
|
3474
|
+
var ms = De.exports;
|
|
3475
|
+
const ys = /* @__PURE__ */ hs(ms), ee = (e, t) => new Date(e.getTime() - yr(t, e));
|
|
3459
3476
|
class I {
|
|
3460
3477
|
constructor(t) {
|
|
3461
3478
|
b(this, "timeframeText");
|
|
@@ -3524,11 +3541,11 @@ class I {
|
|
|
3524
3541
|
tzAdjustedDate(t) {
|
|
3525
3542
|
if (!t)
|
|
3526
3543
|
return /* @__PURE__ */ new Date();
|
|
3527
|
-
const r =
|
|
3544
|
+
const r = cs(/* @__PURE__ */ new Date(), new Intl.DateTimeFormat().resolvedOptions().timeZone);
|
|
3528
3545
|
return mr(r, t);
|
|
3529
3546
|
}
|
|
3530
3547
|
}
|
|
3531
|
-
class
|
|
3548
|
+
class gs extends I {
|
|
3532
3549
|
rawStart(t) {
|
|
3533
3550
|
let r = A(this.tzAdjustedDate(t), { weekStartsOn: 1 });
|
|
3534
3551
|
return t && (r = ee(r, t)), r;
|
|
@@ -3537,7 +3554,7 @@ class ys extends I {
|
|
|
3537
3554
|
return 60 * 60 * 24 * 7;
|
|
3538
3555
|
}
|
|
3539
3556
|
}
|
|
3540
|
-
class
|
|
3557
|
+
class ps extends I {
|
|
3541
3558
|
rawStart(t) {
|
|
3542
3559
|
let r = J(this.tzAdjustedDate(t));
|
|
3543
3560
|
return t && (r = ee(r, t)), r;
|
|
@@ -3546,7 +3563,7 @@ class gs extends I {
|
|
|
3546
3563
|
return 60 * 60 * 24 * 31;
|
|
3547
3564
|
}
|
|
3548
3565
|
}
|
|
3549
|
-
class
|
|
3566
|
+
class _s extends I {
|
|
3550
3567
|
rawEnd(t) {
|
|
3551
3568
|
let r = A(this.tzAdjustedDate(t), { weekStartsOn: 1 });
|
|
3552
3569
|
return t && (r = ee(r, t)), r;
|
|
@@ -3559,7 +3576,7 @@ class ps extends I {
|
|
|
3559
3576
|
return t && (n = ee(n, t)), n;
|
|
3560
3577
|
}
|
|
3561
3578
|
}
|
|
3562
|
-
class
|
|
3579
|
+
class ws extends I {
|
|
3563
3580
|
rawEnd(t) {
|
|
3564
3581
|
let r = J(this.tzAdjustedDate(t));
|
|
3565
3582
|
return t && (r = ee(r, t)), r;
|
|
@@ -3569,7 +3586,7 @@ class _s extends I {
|
|
|
3569
3586
|
return t && (r = ee(r, t)), r;
|
|
3570
3587
|
}
|
|
3571
3588
|
}
|
|
3572
|
-
const
|
|
3589
|
+
const bs = /* @__PURE__ */ new Map([
|
|
3573
3590
|
[
|
|
3574
3591
|
m.FIFTEEN_MIN,
|
|
3575
3592
|
new I({
|
|
@@ -3677,7 +3694,7 @@ const ws = /* @__PURE__ */ new Map([
|
|
|
3677
3694
|
],
|
|
3678
3695
|
[
|
|
3679
3696
|
m.CURRENT_WEEK,
|
|
3680
|
-
new
|
|
3697
|
+
new gs({
|
|
3681
3698
|
key: m.CURRENT_WEEK,
|
|
3682
3699
|
display: "This week",
|
|
3683
3700
|
timeframeText: "Week",
|
|
@@ -3695,7 +3712,7 @@ const ws = /* @__PURE__ */ new Map([
|
|
|
3695
3712
|
],
|
|
3696
3713
|
[
|
|
3697
3714
|
m.CURRENT_MONTH,
|
|
3698
|
-
new
|
|
3715
|
+
new ps({
|
|
3699
3716
|
key: m.CURRENT_MONTH,
|
|
3700
3717
|
display: "This month",
|
|
3701
3718
|
timeframeText: "Month",
|
|
@@ -3711,7 +3728,7 @@ const ws = /* @__PURE__ */ new Map([
|
|
|
3711
3728
|
],
|
|
3712
3729
|
[
|
|
3713
3730
|
m.PREVIOUS_WEEK,
|
|
3714
|
-
new
|
|
3731
|
+
new _s({
|
|
3715
3732
|
key: m.PREVIOUS_WEEK,
|
|
3716
3733
|
display: "Previous week",
|
|
3717
3734
|
timeframeText: "Week",
|
|
@@ -3726,14 +3743,14 @@ const ws = /* @__PURE__ */ new Map([
|
|
|
3726
3743
|
],
|
|
3727
3744
|
[
|
|
3728
3745
|
m.PREVIOUS_MONTH,
|
|
3729
|
-
new
|
|
3746
|
+
new ws({
|
|
3730
3747
|
key: m.PREVIOUS_MONTH,
|
|
3731
3748
|
display: "Previous month",
|
|
3732
3749
|
timeframeText: "Month",
|
|
3733
3750
|
timeframeLength: () => {
|
|
3734
3751
|
let e = 0;
|
|
3735
3752
|
const t = J(/* @__PURE__ */ new Date()), r = J(dr(/* @__PURE__ */ new Date()));
|
|
3736
|
-
return t.getTimezoneOffset() !== r.getTimezoneOffset() && (e =
|
|
3753
|
+
return t.getTimezoneOffset() !== r.getTimezoneOffset() && (e = Ts(t, r)), 60 * 60 * 24 * Ci((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() - 1)) + ki(e);
|
|
3737
3754
|
},
|
|
3738
3755
|
defaultResponseGranularity: "daily",
|
|
3739
3756
|
dataGranularity: "daily",
|
|
@@ -3742,9 +3759,9 @@ const ws = /* @__PURE__ */ new Map([
|
|
|
3742
3759
|
})
|
|
3743
3760
|
]
|
|
3744
3761
|
]);
|
|
3745
|
-
function
|
|
3762
|
+
function js(e) {
|
|
3746
3763
|
const t = new Date(e.start), r = new Date(e.end), n = (r.getTime() - t.getTime()) / 1e3;
|
|
3747
|
-
return e.timePeriodsKey &&
|
|
3764
|
+
return e.timePeriodsKey && ys(bs.get(e.timePeriodsKey)) || new I({
|
|
3748
3765
|
key: "custom",
|
|
3749
3766
|
timeframeText: "custom",
|
|
3750
3767
|
display: "custom",
|
|
@@ -3757,14 +3774,14 @@ function Us(e) {
|
|
|
3757
3774
|
allowedTiers: ["free", "plus", "enterprise"]
|
|
3758
3775
|
});
|
|
3759
3776
|
}
|
|
3760
|
-
function
|
|
3777
|
+
function zs(e) {
|
|
3761
3778
|
return {
|
|
3762
3779
|
...e.key !== "custom" && { timePeriodsKey: e.key },
|
|
3763
3780
|
start: e.rawStart(),
|
|
3764
3781
|
end: e.rawEnd()
|
|
3765
3782
|
};
|
|
3766
3783
|
}
|
|
3767
|
-
function
|
|
3784
|
+
function Vs(e) {
|
|
3768
3785
|
return {
|
|
3769
3786
|
key: e.key,
|
|
3770
3787
|
display: e.display,
|
|
@@ -3775,10 +3792,10 @@ function zs(e) {
|
|
|
3775
3792
|
end: () => e.rawEnd()
|
|
3776
3793
|
};
|
|
3777
3794
|
}
|
|
3778
|
-
function
|
|
3779
|
-
return
|
|
3795
|
+
function Ts(e, t) {
|
|
3796
|
+
return Yi(e.getTimezoneOffset() - t.getTimezoneOffset());
|
|
3780
3797
|
}
|
|
3781
|
-
const
|
|
3798
|
+
const Bs = {
|
|
3782
3799
|
"15M": m.FIFTEEN_MIN,
|
|
3783
3800
|
"1H": m.ONE_HOUR,
|
|
3784
3801
|
"6H": m.SIX_HOUR,
|
|
@@ -3807,7 +3824,7 @@ class Qe {
|
|
|
3807
3824
|
return Math.floor(i * (r - t + 1)) + t;
|
|
3808
3825
|
}
|
|
3809
3826
|
}
|
|
3810
|
-
const
|
|
3827
|
+
const Xs = (e, t, r) => {
|
|
3811
3828
|
const n = _r(10, 1e4), i = new Qe(n), o = Date.now() - 6 * 60 * 60 * 1e3, c = Date.now(), d = [];
|
|
3812
3829
|
let h = 0;
|
|
3813
3830
|
for (let y = o; y <= c; y += 60 * 60 * 1e3)
|
|
@@ -3864,7 +3881,7 @@ const Bs = (e, t, r) => {
|
|
|
3864
3881
|
data: d,
|
|
3865
3882
|
meta: _
|
|
3866
3883
|
};
|
|
3867
|
-
},
|
|
3884
|
+
}, $s = (e, t) => {
|
|
3868
3885
|
const r = _r(10, 1e4), n = new Qe(r), i = Date.now() - 6 * 60 * 60 * 1e3, o = Date.now(), c = [], d = {};
|
|
3869
3886
|
e.forEach((f) => {
|
|
3870
3887
|
d[f.name] = 0;
|
|
@@ -3898,7 +3915,7 @@ const Bs = (e, t, r) => {
|
|
|
3898
3915
|
data: c,
|
|
3899
3916
|
meta: h
|
|
3900
3917
|
};
|
|
3901
|
-
},
|
|
3918
|
+
}, Zs = (e, t, r) => {
|
|
3902
3919
|
const n = Math.floor(Math.random() * 9991) + 10, i = new Qe(n), o = Date.now() - 6 * 60 * 60 * 1e3, c = Date.now(), d = new Date((o + c) / 2).toISOString(), h = [];
|
|
3903
3920
|
if (t) {
|
|
3904
3921
|
const y = Object.keys(t), g = Object.values(t), x = (N, P) => {
|
|
@@ -3959,32 +3976,32 @@ function _r(e, t) {
|
|
|
3959
3976
|
return e = Math.ceil(e), t = Math.floor(t), Math.floor(Math.random() * (t - e + 1) + e);
|
|
3960
3977
|
}
|
|
3961
3978
|
export {
|
|
3962
|
-
|
|
3963
|
-
|
|
3979
|
+
Us as DeltaQueryTime,
|
|
3980
|
+
Os as EXPORT_RECORD_LIMIT,
|
|
3964
3981
|
Te as Granularities,
|
|
3965
|
-
|
|
3966
|
-
|
|
3982
|
+
Ss as INJECT_QUERY_PROVIDER,
|
|
3983
|
+
Ms as REFRESH_INTERVAL_MS,
|
|
3967
3984
|
Qe as SeededRandom,
|
|
3968
|
-
|
|
3969
|
-
|
|
3985
|
+
Bs as TIMEFRAME_LOOKUP,
|
|
3986
|
+
bs as TimePeriods,
|
|
3970
3987
|
I as Timeframe,
|
|
3971
3988
|
m as TimeframeKeys,
|
|
3972
|
-
|
|
3973
|
-
|
|
3989
|
+
qs as TimeseriesQueryTime,
|
|
3990
|
+
fs as UnaryQueryTime,
|
|
3974
3991
|
Zn as aiExploreAggregations,
|
|
3975
|
-
|
|
3992
|
+
ga as apiUsageQuerySchema,
|
|
3976
3993
|
ia as barChartSchema,
|
|
3977
3994
|
tr as basicExploreAggregations,
|
|
3978
|
-
|
|
3995
|
+
pa as basicQuerySchema,
|
|
3979
3996
|
pr as ceilToNearestTimeGrain,
|
|
3980
|
-
|
|
3997
|
+
ha as choroplethMapSchema,
|
|
3981
3998
|
na as countryISOA2,
|
|
3982
|
-
|
|
3983
|
-
|
|
3999
|
+
Gs as dashboardConfigSchema,
|
|
4000
|
+
Ys as dashboardTileTypes,
|
|
3984
4001
|
ra as datasourceToFilterableDimensions,
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
4002
|
+
js as datePickerSelectionToTimeframe,
|
|
4003
|
+
ca as donutChartSchema,
|
|
4004
|
+
Ts as dstOffsetHours,
|
|
3988
4005
|
$n as exploreAggregations,
|
|
3989
4006
|
Vn as exploreFilterTypesV2,
|
|
3990
4007
|
Se as filterableAiExploreDimensions,
|
|
@@ -3992,23 +4009,23 @@ export {
|
|
|
3992
4009
|
Oe as filterableExploreDimensions,
|
|
3993
4010
|
Kn as filterableRequestDimensions,
|
|
3994
4011
|
ta as filterableRequestMetrics,
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
4012
|
+
Is as filterableRequestWildcardDimensions,
|
|
4013
|
+
ds as floorToNearestTimeGrain,
|
|
4014
|
+
Hs as formatISOTimeWithTZ,
|
|
3998
4015
|
Jt as formatTime,
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4016
|
+
Fs as formatTimeRange,
|
|
4017
|
+
ua as gaugeChartSchema,
|
|
4018
|
+
Zs as generateCrossSectionalData,
|
|
4019
|
+
$s as generateMultipleMetricTimeSeriesData,
|
|
4020
|
+
Xs as generateSingleMetricTimeSeriesData,
|
|
4021
|
+
As as getFieldDataSources,
|
|
4022
|
+
Ws as granularitiesToOptions,
|
|
4023
|
+
ls as granularityMsToQuery,
|
|
4007
4024
|
er as granularityValues,
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4025
|
+
_a as llmUsageSchema,
|
|
4026
|
+
da as metricCardSchema,
|
|
4027
|
+
Ls as msToGranularity,
|
|
4028
|
+
Rs as queryDatasources,
|
|
4012
4029
|
nr as queryableAiExploreDimensions,
|
|
4013
4030
|
Ve as queryableBasicExploreDimensions,
|
|
4014
4031
|
rr as queryableExploreDimensions,
|
|
@@ -4016,24 +4033,25 @@ export {
|
|
|
4016
4033
|
ea as queryableRequestMetrics,
|
|
4017
4034
|
Jn as queryableRequestWildcardDimensions,
|
|
4018
4035
|
_r as rand,
|
|
4019
|
-
|
|
4036
|
+
Cs as relativeTimeRangeValuesRequestV2,
|
|
4020
4037
|
Xn as relativeTimeRangeValuesV4,
|
|
4021
|
-
|
|
4038
|
+
vs as reportChartTypes,
|
|
4022
4039
|
Bn as requestFilterTypeEmptyV2,
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4040
|
+
Es as requestFilterTypeEqualsV2,
|
|
4041
|
+
xs as requestFilterTypeMetricV2,
|
|
4042
|
+
Ns as requestFilterTypeWildcardV2,
|
|
4043
|
+
fa as singleValueSchema,
|
|
4027
4044
|
aa as slottableSchema,
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
ba as
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
zs as
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4045
|
+
ks as stripUnknownFilters,
|
|
4046
|
+
sa as thresholdSchema,
|
|
4047
|
+
Da as tileConfigSchema,
|
|
4048
|
+
ba as tileDefinitionSchema,
|
|
4049
|
+
Ta as tileLayoutSchema,
|
|
4050
|
+
Ps as timeRangeTypeV2,
|
|
4051
|
+
zs as timeframeToDatepickerSelection,
|
|
4052
|
+
Vs as timeframeToDatepickerTimeperiod,
|
|
4053
|
+
oa as timeseriesChartSchema,
|
|
4054
|
+
la as topNTableSchema,
|
|
4055
|
+
wa as validDashboardQuery
|
|
4038
4056
|
};
|
|
4039
4057
|
//# sourceMappingURL=vitals-utilities.es.js.map
|