@ssgc/alert-console 2.10.9 → 2.10.11
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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +984 -995
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsx as c, jsxs as f, Fragment as
|
|
2
|
-
import { useContext as Li, useMemo as ve, createContext as Fi, useRef as pr, useState as S, useCallback as bn, useEffect as oe, useLayoutEffect as $i, forwardRef as gr, createElement as
|
|
3
|
-
import { Select as
|
|
1
|
+
import { jsx as c, jsxs as f, Fragment as rn } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as Li, useMemo as ve, createContext as Fi, useRef as pr, useState as S, useCallback as bn, useEffect as oe, useLayoutEffect as $i, forwardRef as gr, createElement as Hs } from "react";
|
|
3
|
+
import { Select as Pe, Table as an, Row as Ze, Col as K, Input as Pi, Tag as wt, Space as st, Tooltip as In, Button as ze, Progress as Wi, Dropdown as Vi, Typography as Jt, Spin as Ns, Checkbox as Ot, Divider as Zt, TimePicker as kn, Tabs as on, Card as Ds, Steps as Bi, Timeline as Zi, Modal as zi, Carousel as Hi } from "antd";
|
|
4
4
|
import { MessageOutlined as Gi, MailOutlined as qi, MoreOutlined as Yi, PlusOutlined as _i, EditOutlined as ji, LeftOutlined as Ji, RightOutlined as Ki } from "@ant-design/icons";
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useQueryClient as Qi, useMutation as Xi, useQuery as
|
|
7
|
-
const sa = "#FF3B30", na = "#FF9500", ra = "#FFCC00", ia = "#34C759",
|
|
5
|
+
import { toast as Ee } from "react-toastify";
|
|
6
|
+
import { useQueryClient as Qi, useMutation as Xi, useQuery as ln, QueryClient as ea, QueryClientProvider as ta } from "@tanstack/react-query";
|
|
7
|
+
const sa = "#FF3B30", na = "#FF9500", ra = "#FFCC00", ia = "#34C759", ns = {
|
|
8
8
|
critical: sa,
|
|
9
9
|
high: na,
|
|
10
10
|
medium: ra,
|
|
11
11
|
low: ia
|
|
12
12
|
}, xn = {
|
|
13
|
-
Critical:
|
|
14
|
-
High:
|
|
15
|
-
Medium:
|
|
16
|
-
Low:
|
|
13
|
+
Critical: ns.critical,
|
|
14
|
+
High: ns.high,
|
|
15
|
+
Medium: ns.medium,
|
|
16
|
+
Low: ns.low
|
|
17
17
|
};
|
|
18
18
|
function aa(t) {
|
|
19
19
|
return xn[t] || xn.Low;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function En(t) {
|
|
22
22
|
if (!t || typeof t != "string") return 0;
|
|
23
23
|
const e = t.trim().split(":");
|
|
24
24
|
if (e.length !== 3) return 0;
|
|
25
25
|
const [s, n, r] = e, i = Number.parseInt(s, 10), a = Number.parseInt(n, 10), o = Number.parseFloat(r || "0"), l = Number.isFinite(i) ? i : 0, u = Number.isFinite(a) ? a : 0, m = Number.isFinite(o) ? o : 0;
|
|
26
26
|
return l * 3600 + u * 60 + m;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function On(t) {
|
|
29
29
|
return t.toLowerCase().replaceAll("'", "").replaceAll("‘", "").replaceAll("’", "");
|
|
30
30
|
}
|
|
31
31
|
const Sr = "", oa = Sr, la = "", ca = "", ua = "", da = "", Mn = {
|
|
@@ -245,7 +245,7 @@ function ha() {
|
|
|
245
245
|
return {};
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
async function
|
|
248
|
+
async function rs(t, e) {
|
|
249
249
|
const s = {
|
|
250
250
|
...e.headers,
|
|
251
251
|
...ha()
|
|
@@ -274,22 +274,22 @@ function ya(t) {
|
|
|
274
274
|
}, s = Dn(t.baseUrl, "/api/Rules"), n = Dn(t.baseUrl, "/api/Rules/lookups");
|
|
275
275
|
return {
|
|
276
276
|
async getRules() {
|
|
277
|
-
const r = await
|
|
277
|
+
const r = await rs(s, { method: "GET", headers: e });
|
|
278
278
|
return Array.isArray(r) ? r : [];
|
|
279
279
|
},
|
|
280
280
|
async setEscalationSettings(r) {
|
|
281
|
-
return
|
|
281
|
+
return rs(s, {
|
|
282
282
|
method: "POST",
|
|
283
283
|
headers: e,
|
|
284
284
|
body: JSON.stringify(r ?? {})
|
|
285
285
|
});
|
|
286
286
|
},
|
|
287
287
|
async getLookups() {
|
|
288
|
-
return
|
|
288
|
+
return rs(n, { method: "GET", headers: e });
|
|
289
289
|
},
|
|
290
290
|
async updateRule(r, i) {
|
|
291
291
|
const a = `${s}/${r}`;
|
|
292
|
-
return
|
|
292
|
+
return rs(a, {
|
|
293
293
|
method: "PUT",
|
|
294
294
|
headers: e,
|
|
295
295
|
body: JSON.stringify(i ?? {})
|
|
@@ -300,64 +300,64 @@ function ya(t) {
|
|
|
300
300
|
function pa(t) {
|
|
301
301
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
302
302
|
}
|
|
303
|
-
var
|
|
303
|
+
var hs = { exports: {} }, ga = hs.exports, Cn;
|
|
304
304
|
function Sa() {
|
|
305
305
|
return Cn || (Cn = 1, (function(t, e) {
|
|
306
306
|
(function(s, n) {
|
|
307
307
|
t.exports = n();
|
|
308
308
|
})(ga, (function() {
|
|
309
|
-
var s = 1e3, n = 6e4, r = 36e5, i = "millisecond", a = "second", o = "minute", l = "hour", u = "day", m = "week", d = "month", y = "quarter", p = "year", v = "date", k = "Invalid Date", b = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,
|
|
310
|
-
var N = ["th", "st", "nd", "rd"],
|
|
311
|
-
return "[" +
|
|
312
|
-
} }, Q = function(
|
|
313
|
-
var
|
|
314
|
-
return !
|
|
315
|
-
}, x = { s: Q, z: function(
|
|
316
|
-
var N = -
|
|
317
|
-
return (N <= 0 ? "+" : "-") + Q(
|
|
318
|
-
}, m: function
|
|
319
|
-
if (N.date() <
|
|
320
|
-
var
|
|
321
|
-
return +(-(
|
|
322
|
-
}, a: function(
|
|
323
|
-
return
|
|
324
|
-
}, p: function(
|
|
325
|
-
return { M: d, y: p, w: m, d: u, D: v, h: l, m: o, s: a, ms: i, Q: y }[
|
|
326
|
-
}, u: function(
|
|
327
|
-
return
|
|
309
|
+
var s = 1e3, n = 6e4, r = 36e5, i = "millisecond", a = "second", o = "minute", l = "hour", u = "day", m = "week", d = "month", y = "quarter", p = "year", v = "date", k = "Invalid Date", b = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, B = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, q = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(O) {
|
|
310
|
+
var N = ["th", "st", "nd", "rd"], A = O % 100;
|
|
311
|
+
return "[" + O + (N[(A - 20) % 10] || N[A] || N[0]) + "]";
|
|
312
|
+
} }, Q = function(O, N, A) {
|
|
313
|
+
var E = String(O);
|
|
314
|
+
return !E || E.length >= N ? O : "" + Array(N + 1 - E.length).join(A) + O;
|
|
315
|
+
}, x = { s: Q, z: function(O) {
|
|
316
|
+
var N = -O.utcOffset(), A = Math.abs(N), E = Math.floor(A / 60), T = A % 60;
|
|
317
|
+
return (N <= 0 ? "+" : "-") + Q(E, 2, "0") + ":" + Q(T, 2, "0");
|
|
318
|
+
}, m: function O(N, A) {
|
|
319
|
+
if (N.date() < A.date()) return -O(A, N);
|
|
320
|
+
var E = 12 * (A.year() - N.year()) + (A.month() - N.month()), T = N.clone().add(E, d), D = A - T < 0, L = N.clone().add(E + (D ? -1 : 1), d);
|
|
321
|
+
return +(-(E + (A - T) / (D ? T - L : L - T)) || 0);
|
|
322
|
+
}, a: function(O) {
|
|
323
|
+
return O < 0 ? Math.ceil(O) || 0 : Math.floor(O);
|
|
324
|
+
}, p: function(O) {
|
|
325
|
+
return { M: d, y: p, w: m, d: u, D: v, h: l, m: o, s: a, ms: i, Q: y }[O] || String(O || "").toLowerCase().replace(/s$/, "");
|
|
326
|
+
}, u: function(O) {
|
|
327
|
+
return O === void 0;
|
|
328
328
|
} }, C = "en", Z = {};
|
|
329
329
|
Z[C] = q;
|
|
330
|
-
var R = "$isDayjsObject", G = function(
|
|
331
|
-
return
|
|
332
|
-
}, h = function
|
|
330
|
+
var R = "$isDayjsObject", G = function(O) {
|
|
331
|
+
return O instanceof ie || !(!O || !O[R]);
|
|
332
|
+
}, h = function O(N, A, E) {
|
|
333
333
|
var T;
|
|
334
334
|
if (!N) return C;
|
|
335
335
|
if (typeof N == "string") {
|
|
336
336
|
var D = N.toLowerCase();
|
|
337
|
-
Z[D] && (T = D),
|
|
337
|
+
Z[D] && (T = D), A && (Z[D] = A, T = D);
|
|
338
338
|
var L = N.split("-");
|
|
339
|
-
if (!T && L.length > 1) return
|
|
339
|
+
if (!T && L.length > 1) return O(L[0]);
|
|
340
340
|
} else {
|
|
341
341
|
var _ = N.name;
|
|
342
342
|
Z[_] = N, T = _;
|
|
343
343
|
}
|
|
344
|
-
return !
|
|
345
|
-
}, g = function(
|
|
346
|
-
if (G(
|
|
347
|
-
var
|
|
348
|
-
return
|
|
344
|
+
return !E && T && (C = T), T || !E && C;
|
|
345
|
+
}, g = function(O, N) {
|
|
346
|
+
if (G(O)) return O.clone();
|
|
347
|
+
var A = typeof N == "object" ? N : {};
|
|
348
|
+
return A.date = O, A.args = arguments, new ie(A);
|
|
349
349
|
}, M = x;
|
|
350
|
-
M.l = h, M.i = G, M.w = function(
|
|
351
|
-
return g(
|
|
350
|
+
M.l = h, M.i = G, M.w = function(O, N) {
|
|
351
|
+
return g(O, { locale: N.$L, utc: N.$u, x: N.$x, $offset: N.$offset });
|
|
352
352
|
};
|
|
353
353
|
var ie = (function() {
|
|
354
|
-
function
|
|
355
|
-
this.$L = h(
|
|
354
|
+
function O(A) {
|
|
355
|
+
this.$L = h(A.locale, null, !0), this.parse(A), this.$x = this.$x || A.x || {}, this[R] = !0;
|
|
356
356
|
}
|
|
357
|
-
var N =
|
|
358
|
-
return N.parse = function(
|
|
359
|
-
this.$d = (function(
|
|
360
|
-
var T =
|
|
357
|
+
var N = O.prototype;
|
|
358
|
+
return N.parse = function(A) {
|
|
359
|
+
this.$d = (function(E) {
|
|
360
|
+
var T = E.date, D = E.utc;
|
|
361
361
|
if (T === null) return /* @__PURE__ */ new Date(NaN);
|
|
362
362
|
if (M.u(T)) return /* @__PURE__ */ new Date();
|
|
363
363
|
if (T instanceof Date) return new Date(T);
|
|
@@ -369,120 +369,120 @@ function Sa() {
|
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
371
|
return new Date(T);
|
|
372
|
-
})(
|
|
372
|
+
})(A), this.init();
|
|
373
373
|
}, N.init = function() {
|
|
374
|
-
var
|
|
375
|
-
this.$y =
|
|
374
|
+
var A = this.$d;
|
|
375
|
+
this.$y = A.getFullYear(), this.$M = A.getMonth(), this.$D = A.getDate(), this.$W = A.getDay(), this.$H = A.getHours(), this.$m = A.getMinutes(), this.$s = A.getSeconds(), this.$ms = A.getMilliseconds();
|
|
376
376
|
}, N.$utils = function() {
|
|
377
377
|
return M;
|
|
378
378
|
}, N.isValid = function() {
|
|
379
379
|
return this.$d.toString() !== k;
|
|
380
|
-
}, N.isSame = function(
|
|
381
|
-
var T = g(
|
|
382
|
-
return this.startOf(
|
|
383
|
-
}, N.isAfter = function(
|
|
384
|
-
return g(
|
|
385
|
-
}, N.isBefore = function(
|
|
386
|
-
return this.endOf(
|
|
387
|
-
}, N.$g = function(
|
|
388
|
-
return M.u(
|
|
380
|
+
}, N.isSame = function(A, E) {
|
|
381
|
+
var T = g(A);
|
|
382
|
+
return this.startOf(E) <= T && T <= this.endOf(E);
|
|
383
|
+
}, N.isAfter = function(A, E) {
|
|
384
|
+
return g(A) < this.startOf(E);
|
|
385
|
+
}, N.isBefore = function(A, E) {
|
|
386
|
+
return this.endOf(E) < g(A);
|
|
387
|
+
}, N.$g = function(A, E, T) {
|
|
388
|
+
return M.u(A) ? this[E] : this.set(T, A);
|
|
389
389
|
}, N.unix = function() {
|
|
390
390
|
return Math.floor(this.valueOf() / 1e3);
|
|
391
391
|
}, N.valueOf = function() {
|
|
392
392
|
return this.$d.getTime();
|
|
393
|
-
}, N.startOf = function(
|
|
394
|
-
var T = this, D = !!M.u(
|
|
395
|
-
var P = M.w(T.$u ? Date.UTC(T.$y,
|
|
393
|
+
}, N.startOf = function(A, E) {
|
|
394
|
+
var T = this, D = !!M.u(E) || E, L = M.p(A), _ = function(ke, pe) {
|
|
395
|
+
var P = M.w(T.$u ? Date.UTC(T.$y, pe, ke) : new Date(T.$y, pe, ke), T);
|
|
396
396
|
return D ? P : P.endOf(u);
|
|
397
|
-
}, Y = function(ke,
|
|
398
|
-
return M.w(T.toDate()[ke].apply(T.toDate("s"), (D ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(
|
|
399
|
-
}, j = this.$W,
|
|
397
|
+
}, Y = function(ke, pe) {
|
|
398
|
+
return M.w(T.toDate()[ke].apply(T.toDate("s"), (D ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(pe)), T);
|
|
399
|
+
}, j = this.$W, ce = this.$M, me = this.$D, Oe = "set" + (this.$u ? "UTC" : "");
|
|
400
400
|
switch (L) {
|
|
401
401
|
case p:
|
|
402
402
|
return D ? _(1, 0) : _(31, 11);
|
|
403
403
|
case d:
|
|
404
|
-
return D ? _(1,
|
|
404
|
+
return D ? _(1, ce) : _(0, ce + 1);
|
|
405
405
|
case m:
|
|
406
406
|
var te = this.$locale().weekStart || 0, Se = (j < te ? j + 7 : j) - te;
|
|
407
|
-
return _(D ?
|
|
407
|
+
return _(D ? me - Se : me + (6 - Se), ce);
|
|
408
408
|
case u:
|
|
409
409
|
case v:
|
|
410
|
-
return Y(
|
|
410
|
+
return Y(Oe + "Hours", 0);
|
|
411
411
|
case l:
|
|
412
|
-
return Y(
|
|
412
|
+
return Y(Oe + "Minutes", 1);
|
|
413
413
|
case o:
|
|
414
|
-
return Y(
|
|
414
|
+
return Y(Oe + "Seconds", 2);
|
|
415
415
|
case a:
|
|
416
|
-
return Y(
|
|
416
|
+
return Y(Oe + "Milliseconds", 3);
|
|
417
417
|
default:
|
|
418
418
|
return this.clone();
|
|
419
419
|
}
|
|
420
|
-
}, N.endOf = function(
|
|
421
|
-
return this.startOf(
|
|
422
|
-
}, N.$set = function(
|
|
423
|
-
var T, D = M.p(
|
|
420
|
+
}, N.endOf = function(A) {
|
|
421
|
+
return this.startOf(A, !1);
|
|
422
|
+
}, N.$set = function(A, E) {
|
|
423
|
+
var T, D = M.p(A), L = "set" + (this.$u ? "UTC" : ""), _ = (T = {}, T[u] = L + "Date", T[v] = L + "Date", T[d] = L + "Month", T[p] = L + "FullYear", T[l] = L + "Hours", T[o] = L + "Minutes", T[a] = L + "Seconds", T[i] = L + "Milliseconds", T)[D], Y = D === u ? this.$D + (E - this.$W) : E;
|
|
424
424
|
if (D === d || D === p) {
|
|
425
425
|
var j = this.clone().set(v, 1);
|
|
426
426
|
j.$d[_](Y), j.init(), this.$d = j.set(v, Math.min(this.$D, j.daysInMonth())).$d;
|
|
427
427
|
} else _ && this.$d[_](Y);
|
|
428
428
|
return this.init(), this;
|
|
429
|
-
}, N.set = function(
|
|
430
|
-
return this.clone().$set(
|
|
431
|
-
}, N.get = function(
|
|
432
|
-
return this[M.p(
|
|
433
|
-
}, N.add = function(
|
|
429
|
+
}, N.set = function(A, E) {
|
|
430
|
+
return this.clone().$set(A, E);
|
|
431
|
+
}, N.get = function(A) {
|
|
432
|
+
return this[M.p(A)]();
|
|
433
|
+
}, N.add = function(A, E) {
|
|
434
434
|
var T, D = this;
|
|
435
|
-
|
|
436
|
-
var L = M.p(
|
|
437
|
-
var
|
|
438
|
-
return M.w(
|
|
435
|
+
A = Number(A);
|
|
436
|
+
var L = M.p(E), _ = function(ce) {
|
|
437
|
+
var me = g(D);
|
|
438
|
+
return M.w(me.date(me.date() + Math.round(ce * A)), D);
|
|
439
439
|
};
|
|
440
|
-
if (L === d) return this.set(d, this.$M +
|
|
441
|
-
if (L === p) return this.set(p, this.$y +
|
|
440
|
+
if (L === d) return this.set(d, this.$M + A);
|
|
441
|
+
if (L === p) return this.set(p, this.$y + A);
|
|
442
442
|
if (L === u) return _(1);
|
|
443
443
|
if (L === m) return _(7);
|
|
444
|
-
var Y = (T = {}, T[o] = n, T[l] = r, T[a] = s, T)[L] || 1, j = this.$d.getTime() +
|
|
444
|
+
var Y = (T = {}, T[o] = n, T[l] = r, T[a] = s, T)[L] || 1, j = this.$d.getTime() + A * Y;
|
|
445
445
|
return M.w(j, this);
|
|
446
|
-
}, N.subtract = function(
|
|
447
|
-
return this.add(-1 *
|
|
448
|
-
}, N.format = function(
|
|
449
|
-
var
|
|
446
|
+
}, N.subtract = function(A, E) {
|
|
447
|
+
return this.add(-1 * A, E);
|
|
448
|
+
}, N.format = function(A) {
|
|
449
|
+
var E = this, T = this.$locale();
|
|
450
450
|
if (!this.isValid()) return T.invalidDate || k;
|
|
451
|
-
var D =
|
|
452
|
-
return
|
|
453
|
-
}, Se = function(
|
|
454
|
-
return M.s(_ % 12 || 12,
|
|
455
|
-
}, ke =
|
|
456
|
-
var
|
|
457
|
-
return W ?
|
|
451
|
+
var D = A || "YYYY-MM-DDTHH:mm:ssZ", L = M.z(this), _ = this.$H, Y = this.$m, j = this.$M, ce = T.weekdays, me = T.months, Oe = T.meridiem, te = function(pe, P, W, ge) {
|
|
452
|
+
return pe && (pe[P] || pe(E, D)) || W[P].slice(0, ge);
|
|
453
|
+
}, Se = function(pe) {
|
|
454
|
+
return M.s(_ % 12 || 12, pe, "0");
|
|
455
|
+
}, ke = Oe || function(pe, P, W) {
|
|
456
|
+
var ge = pe < 12 ? "AM" : "PM";
|
|
457
|
+
return W ? ge.toLowerCase() : ge;
|
|
458
458
|
};
|
|
459
|
-
return D.replace(
|
|
459
|
+
return D.replace(B, (function(pe, P) {
|
|
460
460
|
return P || (function(W) {
|
|
461
461
|
switch (W) {
|
|
462
462
|
case "YY":
|
|
463
|
-
return String(
|
|
463
|
+
return String(E.$y).slice(-2);
|
|
464
464
|
case "YYYY":
|
|
465
|
-
return M.s(
|
|
465
|
+
return M.s(E.$y, 4, "0");
|
|
466
466
|
case "M":
|
|
467
467
|
return j + 1;
|
|
468
468
|
case "MM":
|
|
469
469
|
return M.s(j + 1, 2, "0");
|
|
470
470
|
case "MMM":
|
|
471
|
-
return te(T.monthsShort, j,
|
|
471
|
+
return te(T.monthsShort, j, me, 3);
|
|
472
472
|
case "MMMM":
|
|
473
|
-
return te(
|
|
473
|
+
return te(me, j);
|
|
474
474
|
case "D":
|
|
475
|
-
return
|
|
475
|
+
return E.$D;
|
|
476
476
|
case "DD":
|
|
477
|
-
return M.s(
|
|
477
|
+
return M.s(E.$D, 2, "0");
|
|
478
478
|
case "d":
|
|
479
|
-
return String(
|
|
479
|
+
return String(E.$W);
|
|
480
480
|
case "dd":
|
|
481
|
-
return te(T.weekdaysMin,
|
|
481
|
+
return te(T.weekdaysMin, E.$W, ce, 2);
|
|
482
482
|
case "ddd":
|
|
483
|
-
return te(T.weekdaysShort,
|
|
483
|
+
return te(T.weekdaysShort, E.$W, ce, 3);
|
|
484
484
|
case "dddd":
|
|
485
|
-
return
|
|
485
|
+
return ce[E.$W];
|
|
486
486
|
case "H":
|
|
487
487
|
return String(_);
|
|
488
488
|
case "HH":
|
|
@@ -500,59 +500,59 @@ function Sa() {
|
|
|
500
500
|
case "mm":
|
|
501
501
|
return M.s(Y, 2, "0");
|
|
502
502
|
case "s":
|
|
503
|
-
return String(
|
|
503
|
+
return String(E.$s);
|
|
504
504
|
case "ss":
|
|
505
|
-
return M.s(
|
|
505
|
+
return M.s(E.$s, 2, "0");
|
|
506
506
|
case "SSS":
|
|
507
|
-
return M.s(
|
|
507
|
+
return M.s(E.$ms, 3, "0");
|
|
508
508
|
case "Z":
|
|
509
509
|
return L;
|
|
510
510
|
}
|
|
511
511
|
return null;
|
|
512
|
-
})(
|
|
512
|
+
})(pe) || L.replace(":", "");
|
|
513
513
|
}));
|
|
514
514
|
}, N.utcOffset = function() {
|
|
515
515
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
516
|
-
}, N.diff = function(
|
|
517
|
-
var D, L = this, _ = M.p(
|
|
516
|
+
}, N.diff = function(A, E, T) {
|
|
517
|
+
var D, L = this, _ = M.p(E), Y = g(A), j = (Y.utcOffset() - this.utcOffset()) * n, ce = this - Y, me = function() {
|
|
518
518
|
return M.m(L, Y);
|
|
519
519
|
};
|
|
520
520
|
switch (_) {
|
|
521
521
|
case p:
|
|
522
|
-
D =
|
|
522
|
+
D = me() / 12;
|
|
523
523
|
break;
|
|
524
524
|
case d:
|
|
525
|
-
D =
|
|
525
|
+
D = me();
|
|
526
526
|
break;
|
|
527
527
|
case y:
|
|
528
|
-
D =
|
|
528
|
+
D = me() / 3;
|
|
529
529
|
break;
|
|
530
530
|
case m:
|
|
531
|
-
D = (
|
|
531
|
+
D = (ce - j) / 6048e5;
|
|
532
532
|
break;
|
|
533
533
|
case u:
|
|
534
|
-
D = (
|
|
534
|
+
D = (ce - j) / 864e5;
|
|
535
535
|
break;
|
|
536
536
|
case l:
|
|
537
|
-
D =
|
|
537
|
+
D = ce / r;
|
|
538
538
|
break;
|
|
539
539
|
case o:
|
|
540
|
-
D =
|
|
540
|
+
D = ce / n;
|
|
541
541
|
break;
|
|
542
542
|
case a:
|
|
543
|
-
D =
|
|
543
|
+
D = ce / s;
|
|
544
544
|
break;
|
|
545
545
|
default:
|
|
546
|
-
D =
|
|
546
|
+
D = ce;
|
|
547
547
|
}
|
|
548
548
|
return T ? D : M.a(D);
|
|
549
549
|
}, N.daysInMonth = function() {
|
|
550
550
|
return this.endOf(d).$D;
|
|
551
551
|
}, N.$locale = function() {
|
|
552
552
|
return Z[this.$L];
|
|
553
|
-
}, N.locale = function(
|
|
554
|
-
if (!
|
|
555
|
-
var T = this.clone(), D = h(
|
|
553
|
+
}, N.locale = function(A, E) {
|
|
554
|
+
if (!A) return this.$L;
|
|
555
|
+
var T = this.clone(), D = h(A, E, !0);
|
|
556
556
|
return D && (T.$L = D), T;
|
|
557
557
|
}, N.clone = function() {
|
|
558
558
|
return M.w(this.$d, this);
|
|
@@ -564,19 +564,19 @@ function Sa() {
|
|
|
564
564
|
return this.$d.toISOString();
|
|
565
565
|
}, N.toString = function() {
|
|
566
566
|
return this.$d.toUTCString();
|
|
567
|
-
},
|
|
568
|
-
})(),
|
|
569
|
-
return g.prototype =
|
|
570
|
-
|
|
571
|
-
return this.$g(N,
|
|
567
|
+
}, O;
|
|
568
|
+
})(), ye = ie.prototype;
|
|
569
|
+
return g.prototype = ye, [["$ms", i], ["$s", a], ["$m", o], ["$H", l], ["$W", u], ["$M", d], ["$y", p], ["$D", v]].forEach((function(O) {
|
|
570
|
+
ye[O[1]] = function(N) {
|
|
571
|
+
return this.$g(N, O[0], O[1]);
|
|
572
572
|
};
|
|
573
|
-
})), g.extend = function(
|
|
574
|
-
return
|
|
575
|
-
}, g.locale = h, g.isDayjs = G, g.unix = function(
|
|
576
|
-
return g(1e3 *
|
|
573
|
+
})), g.extend = function(O, N) {
|
|
574
|
+
return O.$i || (O(N, ie, g), O.$i = !0), g;
|
|
575
|
+
}, g.locale = h, g.isDayjs = G, g.unix = function(O) {
|
|
576
|
+
return g(1e3 * O);
|
|
577
577
|
}, g.en = Z[C], g.Ls = Z, g.p = {}, g;
|
|
578
578
|
}));
|
|
579
|
-
})(
|
|
579
|
+
})(hs)), hs.exports;
|
|
580
580
|
}
|
|
581
581
|
var va = Sa();
|
|
582
582
|
const wa = /* @__PURE__ */ pa(va);
|
|
@@ -594,7 +594,7 @@ function Rn(t) {
|
|
|
594
594
|
const { hours: e, minutes: s, seconds: n } = wr(t);
|
|
595
595
|
return wa().hour(e).minute(s).second(n).millisecond(0);
|
|
596
596
|
}
|
|
597
|
-
function
|
|
597
|
+
function Fe(t, e) {
|
|
598
598
|
const s = (t || "").replace(/\/+$/, ""), n = e.startsWith("/") ? e : `/${e}`;
|
|
599
599
|
return `${s}${n}`;
|
|
600
600
|
}
|
|
@@ -606,14 +606,14 @@ function Aa() {
|
|
|
606
606
|
return {};
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
|
-
function
|
|
609
|
+
function is(t, e) {
|
|
610
610
|
if (!e) return t;
|
|
611
611
|
const s = new URL(t);
|
|
612
612
|
return Object.entries(e).forEach(([n, r]) => {
|
|
613
613
|
r != null && String(r).length > 0 && s.searchParams.set(n, String(r));
|
|
614
614
|
}), s.toString();
|
|
615
615
|
}
|
|
616
|
-
async function
|
|
616
|
+
async function $e(t, e) {
|
|
617
617
|
const s = {
|
|
618
618
|
...e.headers,
|
|
619
619
|
...Aa()
|
|
@@ -635,8 +635,8 @@ async function Ve(t, e) {
|
|
|
635
635
|
}
|
|
636
636
|
return i;
|
|
637
637
|
}
|
|
638
|
-
const
|
|
639
|
-
function
|
|
638
|
+
const he = (...t) => t.find((e) => e != null);
|
|
639
|
+
function zt(t, e, s = {}) {
|
|
640
640
|
const n = {};
|
|
641
641
|
for (const r of e) {
|
|
642
642
|
const i = s[r] ?? r.charAt(0).toUpperCase() + r.slice(1);
|
|
@@ -645,46 +645,53 @@ function Ht(t, e, s = {}) {
|
|
|
645
645
|
return n;
|
|
646
646
|
}
|
|
647
647
|
function Na(t) {
|
|
648
|
-
return Array.isArray(t) ? t.map(
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
648
|
+
return Array.isArray(t) ? t.map(
|
|
649
|
+
(e) => zt(e, [
|
|
650
|
+
"alertLogId",
|
|
651
|
+
"alertId",
|
|
652
|
+
"status",
|
|
653
|
+
"description",
|
|
654
|
+
"actionNotes",
|
|
655
|
+
"createdDate",
|
|
656
|
+
"createdBy",
|
|
657
|
+
"modifiedDate",
|
|
658
|
+
"modifiedBy"
|
|
659
|
+
])
|
|
660
|
+
) : t;
|
|
659
661
|
}
|
|
660
662
|
function Ta(t) {
|
|
661
663
|
return {
|
|
662
664
|
// important: do not fall back to `id` here; only AlertId/alertId are considered the Alert ID
|
|
663
|
-
id: String(
|
|
664
|
-
alertNumber:
|
|
665
|
-
priority:
|
|
666
|
-
timestamp:
|
|
667
|
-
statusType:
|
|
668
|
-
description:
|
|
669
|
-
eventName:
|
|
670
|
-
ruleName:
|
|
671
|
-
spaceId:
|
|
672
|
-
spaceName:
|
|
673
|
-
anomalyId:
|
|
674
|
-
severityId:
|
|
675
|
-
assignTeam:
|
|
676
|
-
cameraName:
|
|
677
|
-
type:
|
|
678
|
-
mediaDetails:
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
665
|
+
id: String(he(t?.AlertId, t?.alertId) ?? ""),
|
|
666
|
+
alertNumber: he(t?.AlertNumber, t?.alertNumber),
|
|
667
|
+
priority: he(t?.Priority, t?.priority, "Low"),
|
|
668
|
+
timestamp: he(t?.UpdatedUtc, t?.timestamp, ""),
|
|
669
|
+
statusType: he(t?.Status, t?.statusType, ""),
|
|
670
|
+
description: he(t?.Description, t?.description, ""),
|
|
671
|
+
eventName: he(t?.EventName, t?.eventName),
|
|
672
|
+
ruleName: he(t?.RuleName, t?.ruleName),
|
|
673
|
+
spaceId: he(t?.SpaceId, t?.spaceId),
|
|
674
|
+
spaceName: he(t?.SpaceName, t?.spaceName),
|
|
675
|
+
anomalyId: he(t?.AnomalyId, t?.anomalyId),
|
|
676
|
+
severityId: he(t?.SeverityId, t?.severityId),
|
|
677
|
+
assignTeam: he(t?.AssignTeam, t?.assignTeam),
|
|
678
|
+
cameraName: he(t?.CameraName, t?.cameraName),
|
|
679
|
+
type: he(t?.Type, t?.type),
|
|
680
|
+
mediaDetails: he(
|
|
681
|
+
t?.MediaDetails,
|
|
682
|
+
t?.mediaDetails,
|
|
683
|
+
t?.MediaUrls,
|
|
684
|
+
t?.mediaUrls
|
|
685
|
+
),
|
|
686
|
+
additionalMedia: he(t?.AdditionalMedia, t?.additionalMedia),
|
|
687
|
+
timeElapsed: he(t?.TimeElapsed, t?.timeElapsed),
|
|
688
|
+
timeRemaining: he(t?.TimeRemaining, t?.timeRemaining),
|
|
689
|
+
anomalyName: he(t?.AnomalyName, t?.anomalyName),
|
|
690
|
+
alertDetails: he(t?.AlertDetails, t?.alertDetails),
|
|
691
|
+
statusHistory: Na(he(t?.StatusHistory, t?.statusHistory)),
|
|
692
|
+
isEmailSent: he(t?.IsEmailSent, t?.isEmailSent),
|
|
693
|
+
isSMSSent: he(t?.IsSMSSent, t?.isSMSSent),
|
|
694
|
+
timeZoneUniqueId: he(t?.TimeZoneUniqueId, t?.timeZoneUniqueId)
|
|
688
695
|
};
|
|
689
696
|
}
|
|
690
697
|
function ba(t) {
|
|
@@ -694,7 +701,7 @@ function ba(t) {
|
|
|
694
701
|
};
|
|
695
702
|
return {
|
|
696
703
|
async listAlerts(s) {
|
|
697
|
-
const n =
|
|
704
|
+
const n = Fe(t.baseUrl, "/api/detectionpolicy/alerts"), r = is(n, {
|
|
698
705
|
customerId: "99e5c8b5-b9d4-4d35-8885-7f121c532664",
|
|
699
706
|
pageSize: s?.pageSize ?? 10,
|
|
700
707
|
page: s?.pageNumber ?? 1,
|
|
@@ -704,58 +711,63 @@ function ba(t) {
|
|
|
704
711
|
...s?.thirdPartyIds?.length && { ThirdPartyIds: s.thirdPartyIds.join(",") },
|
|
705
712
|
...s?.searchText && { searchText: s.searchText },
|
|
706
713
|
isArchived: s?.isArchived ?? !1
|
|
707
|
-
}), i = await
|
|
714
|
+
}), i = await $e(r, {
|
|
708
715
|
method: "GET",
|
|
709
716
|
headers: e
|
|
710
717
|
});
|
|
711
718
|
return { items: Array.isArray(i?.Items) ? i.Items.map(Ta) : [], total: i?.Total };
|
|
712
719
|
},
|
|
713
720
|
async getAlertStatusList() {
|
|
714
|
-
const s =
|
|
721
|
+
const s = Fe(t.baseUrl, "/api/detectionpolicy/alerts/StatusList"), n = await $e(s, {
|
|
715
722
|
method: "GET",
|
|
716
723
|
headers: e
|
|
717
724
|
});
|
|
718
|
-
return (Array.isArray(n) ? n : []).map(
|
|
719
|
-
"alertStatusId",
|
|
720
|
-
|
|
721
|
-
"statusName"
|
|
722
|
-
]));
|
|
725
|
+
return (Array.isArray(n) ? n : []).map(
|
|
726
|
+
(i) => zt(i, ["alertStatusId", "value", "statusName"])
|
|
727
|
+
);
|
|
723
728
|
},
|
|
724
729
|
async getAlertsReport(s) {
|
|
725
|
-
const n =
|
|
730
|
+
const n = Fe(t.baseUrl, "/api/detectionpolicy/alerts/GetAlertsReport"), r = is(n, s), i = await $e(r, {
|
|
726
731
|
method: "GET",
|
|
727
732
|
headers: e
|
|
728
733
|
});
|
|
729
734
|
return Array.isArray(i) ? i : [];
|
|
730
735
|
},
|
|
731
736
|
async updateAlertStatus(s) {
|
|
732
|
-
const n =
|
|
737
|
+
const n = Fe(t.baseUrl, "/api/detectionpolicy/alerts/Log"), r = {
|
|
733
738
|
AlertId: s.alertId ?? s.alertUniqueId ?? s.AlertId,
|
|
734
739
|
Status: s.status ?? s.Status ?? "",
|
|
735
740
|
Notes: s.notes ?? s.Notes ?? ""
|
|
736
741
|
};
|
|
737
|
-
return
|
|
742
|
+
return $e(n, {
|
|
738
743
|
method: "POST",
|
|
739
744
|
headers: e,
|
|
740
745
|
body: JSON.stringify(r)
|
|
741
746
|
});
|
|
742
747
|
},
|
|
748
|
+
async getAlertTimeline(s) {
|
|
749
|
+
const n = Fe(t.baseUrl, `/api/detectionpolicy/alerts/alertTimelines/${s}`);
|
|
750
|
+
return $e(n, {
|
|
751
|
+
method: "GET",
|
|
752
|
+
headers: e
|
|
753
|
+
});
|
|
754
|
+
},
|
|
743
755
|
async getAdminSettings() {
|
|
744
|
-
const s =
|
|
756
|
+
const s = Fe(t.baseUrl, "/api/detectionpolicy/alerts/GetAdminSettings"), n = await $e(s, {
|
|
745
757
|
method: "GET",
|
|
746
758
|
headers: e
|
|
747
759
|
});
|
|
748
760
|
if (n && typeof n == "object") {
|
|
749
761
|
const r = n.data ?? n.Data ?? n;
|
|
750
762
|
if (r && typeof r == "object")
|
|
751
|
-
return
|
|
763
|
+
return zt(r, ["userId", "isAdminSetting", "sortBy"], {
|
|
752
764
|
sortBy: "SortOption"
|
|
753
765
|
});
|
|
754
766
|
}
|
|
755
767
|
return null;
|
|
756
768
|
},
|
|
757
769
|
async setAdminSettings(s) {
|
|
758
|
-
const n =
|
|
770
|
+
const n = Fe(t.baseUrl, "/api/detectionpolicy/alerts/SetAdminSettings"), r = {
|
|
759
771
|
Settings: {
|
|
760
772
|
UserId: 0,
|
|
761
773
|
IsAdminSetting: !0,
|
|
@@ -763,14 +775,14 @@ function ba(t) {
|
|
|
763
775
|
GroupBy: s?.groupBy ?? null
|
|
764
776
|
}
|
|
765
777
|
};
|
|
766
|
-
return
|
|
778
|
+
return $e(n, {
|
|
767
779
|
method: "POST",
|
|
768
780
|
headers: e,
|
|
769
781
|
body: JSON.stringify(r)
|
|
770
782
|
});
|
|
771
783
|
},
|
|
772
784
|
async getPreferenceSettings() {
|
|
773
|
-
const s =
|
|
785
|
+
const s = Fe(t.baseUrl, "/api/detectionpolicy/alerts/GetPreferenceSettings"), n = await $e(s, {
|
|
774
786
|
method: "GET",
|
|
775
787
|
headers: e
|
|
776
788
|
});
|
|
@@ -781,7 +793,7 @@ function ba(t) {
|
|
|
781
793
|
return null;
|
|
782
794
|
},
|
|
783
795
|
async setPreferenceSettings(s) {
|
|
784
|
-
const n =
|
|
796
|
+
const n = Fe(t.baseUrl, "/api/detectionpolicy/alerts/SetPreferenceSettings"), r = (u) => {
|
|
785
797
|
const { hours: m, minutes: d, seconds: y } = wr(u);
|
|
786
798
|
return (m * 3600 + d * 60 + y) * 1e7;
|
|
787
799
|
}, i = {
|
|
@@ -795,7 +807,7 @@ function ba(t) {
|
|
|
795
807
|
Email: !!s?.email,
|
|
796
808
|
SortBy: s?.sortBy ?? ""
|
|
797
809
|
}
|
|
798
|
-
}, a = await
|
|
810
|
+
}, a = await $e(n, {
|
|
799
811
|
method: "POST",
|
|
800
812
|
headers: e,
|
|
801
813
|
body: JSON.stringify(i)
|
|
@@ -808,45 +820,52 @@ function ba(t) {
|
|
|
808
820
|
};
|
|
809
821
|
},
|
|
810
822
|
async sendSMSorEmailNotifications(s, n, r) {
|
|
811
|
-
const i =
|
|
812
|
-
|
|
823
|
+
const i = Fe(
|
|
824
|
+
t.baseUrl,
|
|
825
|
+
"/api/detectionpolicy/alerts/SendSMSorEmailNotifications"
|
|
826
|
+
), a = is(i, { alertId: s, isEmail: n, isSMS: r });
|
|
827
|
+
return $e(a, {
|
|
813
828
|
method: "POST",
|
|
814
829
|
headers: e
|
|
815
830
|
});
|
|
816
831
|
},
|
|
817
832
|
async getAlertNotifications(s) {
|
|
818
|
-
const n =
|
|
833
|
+
const n = Fe(t.baseUrl, "/api/detectionpolicy/alerts/GetNotifications"), r = is(n, { alertId: s }), i = await $e(r, {
|
|
819
834
|
method: "GET",
|
|
820
835
|
headers: e
|
|
821
836
|
});
|
|
822
837
|
let a = [];
|
|
823
|
-
return Array.isArray(i) ? a = i : Array.isArray(i?.data) && (a = i.data), a.map(
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
838
|
+
return Array.isArray(i) ? a = i : Array.isArray(i?.data) && (a = i.data), a.map(
|
|
839
|
+
(o) => zt(o, [
|
|
840
|
+
"alertNotificationSentId",
|
|
841
|
+
"alertId",
|
|
842
|
+
"notificationType",
|
|
843
|
+
"receipientName",
|
|
844
|
+
"receipentPhoneNumber",
|
|
845
|
+
"messageSID",
|
|
846
|
+
"messageStatus",
|
|
847
|
+
"receipientEmail",
|
|
848
|
+
"notificationReceipientType",
|
|
849
|
+
"sentAt"
|
|
850
|
+
])
|
|
851
|
+
);
|
|
835
852
|
},
|
|
836
853
|
async getTimeZoneMasters() {
|
|
837
|
-
const s =
|
|
854
|
+
const s = Fe(t.baseUrl, "/api/TimeZoneMaster"), n = await $e(s, {
|
|
838
855
|
method: "GET",
|
|
839
856
|
headers: e
|
|
840
857
|
});
|
|
841
|
-
return (Array.isArray(n?.Data) ? n.Data : []).map(
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
858
|
+
return (Array.isArray(n?.Data) ? n.Data : []).map(
|
|
859
|
+
(i) => zt(i, [
|
|
860
|
+
"timeZoneUniqueId",
|
|
861
|
+
"ianaTimeZoneId",
|
|
862
|
+
"timeZoneName",
|
|
863
|
+
"offset"
|
|
864
|
+
])
|
|
865
|
+
);
|
|
847
866
|
},
|
|
848
867
|
async getAllSpaces() {
|
|
849
|
-
const s = t.spacesBaseUrl || t.baseUrl, n =
|
|
868
|
+
const s = t.spacesBaseUrl || t.baseUrl, n = Fe(s, "/api/AllSpaces"), r = await $e(n, {
|
|
850
869
|
method: "GET",
|
|
851
870
|
headers: e
|
|
852
871
|
});
|
|
@@ -856,12 +875,12 @@ function ba(t) {
|
|
|
856
875
|
}));
|
|
857
876
|
},
|
|
858
877
|
async getMyAppPreferences() {
|
|
859
|
-
const s =
|
|
878
|
+
const s = Fe(t.baseUrl, "/MyProfile"), n = await $e(s, {
|
|
860
879
|
method: "GET",
|
|
861
880
|
headers: e
|
|
862
881
|
}), r = n?.data?.userGuid ?? n?.Data?.userGuid ?? n?.userGuid;
|
|
863
882
|
if (!r) return null;
|
|
864
|
-
const i =
|
|
883
|
+
const i = Fe(t.baseUrl, `/api/GetMyAppPreferences/${r}`), a = await $e(i, {
|
|
865
884
|
method: "GET",
|
|
866
885
|
headers: e
|
|
867
886
|
});
|
|
@@ -944,7 +963,7 @@ function ka(t) {
|
|
|
944
963
|
if (h.status !== "fulfilled") return [];
|
|
945
964
|
const g = h.value;
|
|
946
965
|
return Array.isArray(g) ? g : Array.isArray(g?.Data) ? g.Data : Array.isArray(g?.data) ? g.data : [];
|
|
947
|
-
}, p = y(a), v = y(o), k = y(l), b = y(u),
|
|
966
|
+
}, p = y(a), v = y(o), k = y(l), b = y(u), B = y(m), q = d.status === "fulfilled" ? d.value : null;
|
|
948
967
|
let Q = [];
|
|
949
968
|
Array.isArray(q) ? Q = q : Array.isArray(q?.Data) ? Q = q.Data : Array.isArray(q?.data) && (Q = q.data);
|
|
950
969
|
const x = p.map((h) => ({
|
|
@@ -967,7 +986,7 @@ function ka(t) {
|
|
|
967
986
|
return b.length && (G.severities = b.map((h) => ({
|
|
968
987
|
severityId: h?.SeverityId ?? h?.severityId,
|
|
969
988
|
severityName: h?.DisplayName ?? h?.SeverityName ?? h?.Name ?? h?.name ?? ""
|
|
970
|
-
}))),
|
|
989
|
+
}))), B.length && (G.scheduleTypes = B), R.length && (G.userRoles = R), G;
|
|
971
990
|
},
|
|
972
991
|
async updateRule(n, r) {
|
|
973
992
|
const i = `${s}/${n}`, { escalationSettings: a, Anomaly: o, Severity: l, ...u } = r ?? {};
|
|
@@ -1022,7 +1041,7 @@ async function ct(t, e) {
|
|
|
1022
1041
|
}
|
|
1023
1042
|
return i;
|
|
1024
1043
|
}
|
|
1025
|
-
function
|
|
1044
|
+
function Ea(t) {
|
|
1026
1045
|
const e = {
|
|
1027
1046
|
"Content-Type": "application/json",
|
|
1028
1047
|
...t.headers || {}
|
|
@@ -1067,7 +1086,7 @@ function Oa(t) {
|
|
|
1067
1086
|
if (R.status !== "fulfilled") return [];
|
|
1068
1087
|
const G = R.value;
|
|
1069
1088
|
return Array.isArray(G) ? G : Array.isArray(G?.data) ? G.data : [];
|
|
1070
|
-
}, y = d(a), p = d(o), v = d(l), k = d(u), b = m.status === "fulfilled" ? m.value : null,
|
|
1089
|
+
}, y = d(a), p = d(o), v = d(l), k = d(u), b = m.status === "fulfilled" ? m.value : null, B = y.map((R) => ({
|
|
1071
1090
|
actionTypeId: R?.ActionTypeUniqueId,
|
|
1072
1091
|
name: R?.Name ?? ""
|
|
1073
1092
|
})), q = p.map((R) => ({
|
|
@@ -1083,7 +1102,7 @@ function Oa(t) {
|
|
|
1083
1102
|
userRoleId: R.userRoleId ?? 0,
|
|
1084
1103
|
userRoleName: R.userRoleName ?? ""
|
|
1085
1104
|
})), Z = {
|
|
1086
|
-
actionTypes:
|
|
1105
|
+
actionTypes: B,
|
|
1087
1106
|
anomalies: q,
|
|
1088
1107
|
thirdParties: Q
|
|
1089
1108
|
};
|
|
@@ -1123,7 +1142,7 @@ function qe(t, e) {
|
|
|
1123
1142
|
const s = (t || "").replace(/\/+$/, ""), n = e.startsWith("/") ? e : `/${e}`;
|
|
1124
1143
|
return `${s}${n}`;
|
|
1125
1144
|
}
|
|
1126
|
-
function
|
|
1145
|
+
function Oa() {
|
|
1127
1146
|
try {
|
|
1128
1147
|
const t = localStorage.getItem("authToken");
|
|
1129
1148
|
return t ? { Authorization: `Bearer ${t}` } : {};
|
|
@@ -1131,7 +1150,7 @@ function Ea() {
|
|
|
1131
1150
|
return {};
|
|
1132
1151
|
}
|
|
1133
1152
|
}
|
|
1134
|
-
function
|
|
1153
|
+
function as(t, e) {
|
|
1135
1154
|
if (!e) return t;
|
|
1136
1155
|
const s = new URL(t);
|
|
1137
1156
|
return Object.entries(e).forEach(([n, r]) => {
|
|
@@ -1141,7 +1160,7 @@ function os(t, e) {
|
|
|
1141
1160
|
async function Ye(t, e) {
|
|
1142
1161
|
const s = {
|
|
1143
1162
|
...e.headers,
|
|
1144
|
-
...
|
|
1163
|
+
...Oa()
|
|
1145
1164
|
}, n = await fetch(t, { ...e, headers: s });
|
|
1146
1165
|
if (n.status === 401)
|
|
1147
1166
|
throw window.location.href = "/login", new Error("Unauthorized");
|
|
@@ -1167,7 +1186,7 @@ function Ma(t) {
|
|
|
1167
1186
|
};
|
|
1168
1187
|
return {
|
|
1169
1188
|
async listAlerts(s) {
|
|
1170
|
-
const n = qe(t.baseUrl, "/api/Alerts"), r =
|
|
1189
|
+
const n = qe(t.baseUrl, "/api/Alerts"), r = as(n, {
|
|
1171
1190
|
pageSize: s?.pageSize ?? 10,
|
|
1172
1191
|
pageNumber: s?.pageNumber ?? 1,
|
|
1173
1192
|
...s?.spaceNumber !== void 0 && { spaceNumber: s.spaceNumber },
|
|
@@ -1199,7 +1218,7 @@ function Ma(t) {
|
|
|
1199
1218
|
return Array.isArray(n) ? n : n && typeof n == "object" && Array.isArray(n.data) ? n.data : [];
|
|
1200
1219
|
},
|
|
1201
1220
|
async getAlertsReport(s) {
|
|
1202
|
-
const n = qe(t.baseUrl, "/Alerts/GetAlertsReport"), r =
|
|
1221
|
+
const n = qe(t.baseUrl, "/Alerts/GetAlertsReport"), r = as(n, s), i = await Ye(r, {
|
|
1203
1222
|
method: "GET",
|
|
1204
1223
|
headers: e
|
|
1205
1224
|
});
|
|
@@ -1266,14 +1285,14 @@ function Ma(t) {
|
|
|
1266
1285
|
};
|
|
1267
1286
|
},
|
|
1268
1287
|
async getAlertNotifications(s) {
|
|
1269
|
-
const n = qe(t.baseUrl, "/api/Alerts/GetNotifications"), r =
|
|
1288
|
+
const n = qe(t.baseUrl, "/api/Alerts/GetNotifications"), r = as(n, { alertId: s }), i = await Ye(r, {
|
|
1270
1289
|
method: "GET",
|
|
1271
1290
|
headers: e
|
|
1272
1291
|
});
|
|
1273
1292
|
return Array.isArray(i) ? i : i && typeof i == "object" && Array.isArray(i.data) ? i.data : [];
|
|
1274
1293
|
},
|
|
1275
1294
|
async sendSMSorEmailNotifications(s, n, r) {
|
|
1276
|
-
const i = qe(t.baseUrl, "/api/Alerts/SendSMSorEmailNotifications"), a =
|
|
1295
|
+
const i = qe(t.baseUrl, "/api/Alerts/SendSMSorEmailNotifications"), a = as(i, { alertId: s, isEmail: n, isSMS: r });
|
|
1277
1296
|
return Ye(a, {
|
|
1278
1297
|
method: "POST",
|
|
1279
1298
|
headers: e
|
|
@@ -1329,7 +1348,7 @@ function Da({
|
|
|
1329
1348
|
snl: () => fa(l)
|
|
1330
1349
|
}, d = {
|
|
1331
1350
|
schools: () => ka({ ...u, userManagementBaseUrl: a.userManagementDomain }),
|
|
1332
|
-
transit: () =>
|
|
1351
|
+
transit: () => Ea({ ...u, userManagementBaseUrl: a.userManagementDomain }),
|
|
1333
1352
|
snl: () => ya({ baseUrl: a.alertsBaseUrl, headers: a.headers })
|
|
1334
1353
|
};
|
|
1335
1354
|
return {
|
|
@@ -1355,20 +1374,20 @@ const Ca = {
|
|
|
1355
1374
|
High: "#FFB86A",
|
|
1356
1375
|
Medium: "#FFCC00",
|
|
1357
1376
|
Low: "#007AFF"
|
|
1358
|
-
},
|
|
1377
|
+
}, cn = 6, un = 7;
|
|
1359
1378
|
function Un(t, e, s) {
|
|
1360
|
-
const n = t ===
|
|
1379
|
+
const n = t === cn, r = t === un, i = e.isEmailSent ?? !1, a = e.isSMSSent ?? !1, o = n && i || r && a, l = n ? "Send Email" : r ? "Send SMS" : s, u = n && i ? "Email sent" : r && a ? "SMS sent" : l, m = n && i ? "Email sent" : r && a ? "SMS sent" : `Click to ${l}`;
|
|
1361
1380
|
return { isDisabled: o, buttonText: u, tooltipTitle: m };
|
|
1362
1381
|
}
|
|
1363
|
-
function
|
|
1382
|
+
function Cs(t, e) {
|
|
1364
1383
|
return `${t}-${e ? "email" : "sms"}`;
|
|
1365
1384
|
}
|
|
1366
|
-
function
|
|
1367
|
-
return t ===
|
|
1385
|
+
function os(t) {
|
|
1386
|
+
return t === cn || t === un;
|
|
1368
1387
|
}
|
|
1369
|
-
function
|
|
1388
|
+
function Ts({ value: t, onChange: e, options: s, className: n, dropdownWidth: r }) {
|
|
1370
1389
|
return /* @__PURE__ */ c(
|
|
1371
|
-
|
|
1390
|
+
Pe,
|
|
1372
1391
|
{
|
|
1373
1392
|
className: n,
|
|
1374
1393
|
options: s,
|
|
@@ -1386,7 +1405,7 @@ const Ua = [
|
|
|
1386
1405
|
{ label: "Low", value: "Low" }
|
|
1387
1406
|
];
|
|
1388
1407
|
function La({ value: t, onChange: e, options: s }) {
|
|
1389
|
-
return /* @__PURE__ */ c(
|
|
1408
|
+
return /* @__PURE__ */ c(Ts, { className: "w-[140px]", value: t, onChange: e, options: s || Ua });
|
|
1390
1409
|
}
|
|
1391
1410
|
const Fa = [
|
|
1392
1411
|
{ label: "All Types", value: "All" },
|
|
@@ -1395,10 +1414,10 @@ const Fa = [
|
|
|
1395
1414
|
{ label: "Aggressive Behavior", value: "Aggressive" }
|
|
1396
1415
|
];
|
|
1397
1416
|
function $a({ value: t, onChange: e, options: s }) {
|
|
1398
|
-
return /* @__PURE__ */ c(
|
|
1417
|
+
return /* @__PURE__ */ c(Ts, { className: "w-[220px]", dropdownWidth: 280, value: t, onChange: e, options: s || Fa });
|
|
1399
1418
|
}
|
|
1400
1419
|
function Pa({ value: t, onChange: e, options: s }) {
|
|
1401
|
-
return /* @__PURE__ */ c(
|
|
1420
|
+
return /* @__PURE__ */ c(Ts, { className: "w-[100px]", value: t, onChange: e, options: s || [] });
|
|
1402
1421
|
}
|
|
1403
1422
|
const Wa = [
|
|
1404
1423
|
{ label: "All", value: "All" },
|
|
@@ -1408,10 +1427,10 @@ const Wa = [
|
|
|
1408
1427
|
{ label: "Eli", value: "Eli" },
|
|
1409
1428
|
{ label: "Skydio", value: "Skydio" }
|
|
1410
1429
|
];
|
|
1411
|
-
function
|
|
1412
|
-
return /* @__PURE__ */ c(
|
|
1430
|
+
function Va({ value: t, onChange: e, options: s }) {
|
|
1431
|
+
return /* @__PURE__ */ c(Ts, { className: "w-[130px]", value: t, onChange: e, options: s || Wa });
|
|
1413
1432
|
}
|
|
1414
|
-
function
|
|
1433
|
+
function Ba({
|
|
1415
1434
|
columns: t,
|
|
1416
1435
|
data: e,
|
|
1417
1436
|
loading: s = !1,
|
|
@@ -1427,7 +1446,7 @@ function Va({
|
|
|
1427
1446
|
return /* @__PURE__ */ f("div", { children: [
|
|
1428
1447
|
o,
|
|
1429
1448
|
/* @__PURE__ */ c(
|
|
1430
|
-
|
|
1449
|
+
an,
|
|
1431
1450
|
{
|
|
1432
1451
|
rowKey: a,
|
|
1433
1452
|
dataSource: e,
|
|
@@ -1452,7 +1471,7 @@ function Za(t) {
|
|
|
1452
1471
|
const e = t.split("?")[0].toLowerCase();
|
|
1453
1472
|
return e.endsWith(".mp4") || e.endsWith(".webm") || e.endsWith(".ogg") || e.endsWith(".m3u8");
|
|
1454
1473
|
}
|
|
1455
|
-
function
|
|
1474
|
+
function Gs(t) {
|
|
1456
1475
|
const e = (t?.mediaType || t?.type || "").toString().toLowerCase();
|
|
1457
1476
|
return e === "video" || e === "mp4" ? !0 : Za(t?.mediaUrl || t);
|
|
1458
1477
|
}
|
|
@@ -1481,7 +1500,7 @@ const ut = 16, dt = 2, Ln = {
|
|
|
1481
1500
|
};
|
|
1482
1501
|
function Tr({ boxes: t, priority: e = "High" }) {
|
|
1483
1502
|
const s = Ln[e] ?? Ln.High;
|
|
1484
|
-
return /* @__PURE__ */ c(
|
|
1503
|
+
return /* @__PURE__ */ c(rn, { children: t.map((n, r) => /* @__PURE__ */ f(
|
|
1485
1504
|
"div",
|
|
1486
1505
|
{
|
|
1487
1506
|
className: "absolute pointer-events-none",
|
|
@@ -1717,7 +1736,7 @@ const ja = gr(
|
|
|
1717
1736
|
children: i,
|
|
1718
1737
|
iconNode: a,
|
|
1719
1738
|
...o
|
|
1720
|
-
}, l) =>
|
|
1739
|
+
}, l) => Hs(
|
|
1721
1740
|
"svg",
|
|
1722
1741
|
{
|
|
1723
1742
|
ref: l,
|
|
@@ -1731,14 +1750,14 @@ const ja = gr(
|
|
|
1731
1750
|
...o
|
|
1732
1751
|
},
|
|
1733
1752
|
[
|
|
1734
|
-
...a.map(([u, m]) =>
|
|
1753
|
+
...a.map(([u, m]) => Hs(u, m)),
|
|
1735
1754
|
...Array.isArray(i) ? i : [i]
|
|
1736
1755
|
]
|
|
1737
1756
|
)
|
|
1738
1757
|
);
|
|
1739
|
-
const
|
|
1758
|
+
const dn = (t, e) => {
|
|
1740
1759
|
const s = gr(
|
|
1741
|
-
({ className: n, ...r }, i) =>
|
|
1760
|
+
({ className: n, ...r }, i) => Hs(ja, {
|
|
1742
1761
|
ref: i,
|
|
1743
1762
|
iconNode: e,
|
|
1744
1763
|
className: xr(
|
|
@@ -1764,21 +1783,21 @@ const Ja = [
|
|
|
1764
1783
|
}
|
|
1765
1784
|
],
|
|
1766
1785
|
["path", { d: "M21 15V5a2 2 0 0 0-2-2H9", key: "43el77" }]
|
|
1767
|
-
],
|
|
1768
|
-
const Ka = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], Qa =
|
|
1786
|
+
], Er = dn("image-off", Ja);
|
|
1787
|
+
const Ka = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], Qa = dn("loader-circle", Ka);
|
|
1769
1788
|
const Xa = [
|
|
1770
1789
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
1771
1790
|
["path", { d: "m21 3-7 7", key: "1l2asr" }],
|
|
1772
1791
|
["path", { d: "m3 21 7-7", key: "tjx5ai" }],
|
|
1773
1792
|
["path", { d: "M9 21H3v-6", key: "wtvkvv" }]
|
|
1774
|
-
], eo =
|
|
1793
|
+
], eo = dn("maximize-2", Xa);
|
|
1775
1794
|
function to(t) {
|
|
1776
1795
|
const s = Nr(t.mediaDetails)[0];
|
|
1777
1796
|
if (!s) return null;
|
|
1778
1797
|
const n = s.mediaUrl ?? s;
|
|
1779
1798
|
return typeof n != "string" || !n.length ? null : { url: n, item: s };
|
|
1780
1799
|
}
|
|
1781
|
-
function
|
|
1800
|
+
function Or({ record: t }) {
|
|
1782
1801
|
const e = ve(() => to(t), [t]), [s, n] = S(!1), [r, i] = S(!1), a = ve(
|
|
1783
1802
|
() => t.bbox_xyxy ? [{ bbox_xyxy: t.bbox_xyxy, personName: t.personName }] : [],
|
|
1784
1803
|
[t.bbox_xyxy, t.personName]
|
|
@@ -1787,8 +1806,8 @@ function Er({ record: t }) {
|
|
|
1787
1806
|
i(!1);
|
|
1788
1807
|
}, [e?.url]), !e)
|
|
1789
1808
|
return /* @__PURE__ */ c("span", { className: "text-gray-400 text-sm", children: "—" });
|
|
1790
|
-
const { url: o, item: l } = e, u =
|
|
1791
|
-
return /* @__PURE__ */ f(
|
|
1809
|
+
const { url: o, item: l } = e, u = Gs(l), m = u ? "video" : "image", d = "block w-[72px] h-[54px] object-cover bg-gray-100 border border-gray-200 rounded-sm";
|
|
1810
|
+
return /* @__PURE__ */ f(rn, { children: [
|
|
1792
1811
|
/* @__PURE__ */ c(
|
|
1793
1812
|
"button",
|
|
1794
1813
|
{
|
|
@@ -1797,7 +1816,7 @@ function Er({ record: t }) {
|
|
|
1797
1816
|
className: "p-0 border-0 bg-transparent rounded-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 cursor-pointer disabled:cursor-not-allowed disabled:opacity-60",
|
|
1798
1817
|
"aria-label": r ? "Preview unavailable" : "Expand preview",
|
|
1799
1818
|
onClick: () => n(!0),
|
|
1800
|
-
children: r ? /* @__PURE__ */ c("span", { className: `${d} flex items-center justify-center text-gray-400`, children: /* @__PURE__ */ c(
|
|
1819
|
+
children: r ? /* @__PURE__ */ c("span", { className: `${d} flex items-center justify-center text-gray-400`, children: /* @__PURE__ */ c(Er, { size: 20, "aria-hidden": !0 }) }) : u ? /* @__PURE__ */ c(
|
|
1801
1820
|
"video",
|
|
1802
1821
|
{
|
|
1803
1822
|
src: o,
|
|
@@ -1844,15 +1863,15 @@ function Mr({
|
|
|
1844
1863
|
onFilterChange: m,
|
|
1845
1864
|
resetKey: d
|
|
1846
1865
|
}) {
|
|
1847
|
-
const [y, p] = S("All"), [v, k] = S("All"), [b,
|
|
1866
|
+
const [y, p] = S("All"), [v, k] = S("All"), [b, B] = S("All"), [q, Q] = S("All"), [x, C] = S(""), [Z, R] = S(r ?? 1);
|
|
1848
1867
|
oe(() => {
|
|
1849
|
-
d !== void 0 && (p("All"), k("All"),
|
|
1868
|
+
d !== void 0 && (p("All"), k("All"), B("All"), Q("All"), C(""), R(1));
|
|
1850
1869
|
}, [d]), oe(() => {
|
|
1851
1870
|
r !== void 0 && R(r);
|
|
1852
1871
|
}, [r]);
|
|
1853
1872
|
const [G, h] = S([
|
|
1854
1873
|
{ label: "All", value: "All" }
|
|
1855
|
-
]), [g, M] = S([]), [ie,
|
|
1874
|
+
]), [g, M] = S([]), [ie, ye] = S([]), [O, N] = S([]), [A, E] = S(/* @__PURE__ */ new Set()), { rules: T, alerts: D, config: L } = Ge(), _ = L.tenant === "schools", Y = L.tenant === "transit", j = so(x, 600), ce = _ && j.trim() ? 100 : s, me = {
|
|
1856
1875
|
6: { title: "Email", kind: "icon", icon: /* @__PURE__ */ c(qi, {}) },
|
|
1857
1876
|
7: { title: "SMS", kind: "icon", icon: /* @__PURE__ */ c(Gi, {}) }
|
|
1858
1877
|
};
|
|
@@ -1863,11 +1882,11 @@ function Mr({
|
|
|
1863
1882
|
try {
|
|
1864
1883
|
const W = await D.getAllSpaces();
|
|
1865
1884
|
if (P) {
|
|
1866
|
-
const
|
|
1867
|
-
label: Y ? String(
|
|
1868
|
-
value: String(Y ?
|
|
1885
|
+
const ge = W.map((ue) => ({
|
|
1886
|
+
label: Y ? String(ue.spaceNumber ?? ue.spaceName ?? "") : ue.spaceName,
|
|
1887
|
+
value: String(Y ? ue.spaceNumber ?? ue.spaceId : ue.spaceId)
|
|
1869
1888
|
}));
|
|
1870
|
-
M([{ label: "All", value: "All" }, ...
|
|
1889
|
+
M([{ label: "All", value: "All" }, ...ge]);
|
|
1871
1890
|
}
|
|
1872
1891
|
} catch (W) {
|
|
1873
1892
|
console.error("Error loading space options", W);
|
|
@@ -1879,7 +1898,7 @@ function Mr({
|
|
|
1879
1898
|
let P = !0;
|
|
1880
1899
|
return (async () => {
|
|
1881
1900
|
try {
|
|
1882
|
-
const W = await T.getLookups(),
|
|
1901
|
+
const W = await T.getLookups(), ue = (Array.isArray(W.thirdParties) ? W.thirdParties : []).map((Ne) => ({
|
|
1883
1902
|
label: Ne.thirdPartyName,
|
|
1884
1903
|
value: String(Ne.thirdPartyId)
|
|
1885
1904
|
})), be = (Array.isArray(W.anomalies) ? W.anomalies : []).map((Ne) => ({
|
|
@@ -1889,7 +1908,7 @@ function Mr({
|
|
|
1889
1908
|
label: Ne.severityName,
|
|
1890
1909
|
value: String(Ne.severityId)
|
|
1891
1910
|
}));
|
|
1892
|
-
P && (h([{ label: "All", value: "All" }, ...
|
|
1911
|
+
P && (h([{ label: "All", value: "All" }, ...ue]), be.length && ye([{ label: "All Types", value: "All" }, ...be]), Me.length && N([{ label: "All levels", value: "All" }, ...Me]));
|
|
1893
1912
|
} catch (W) {
|
|
1894
1913
|
console.error("Error loading filter options", W);
|
|
1895
1914
|
}
|
|
@@ -1898,12 +1917,12 @@ function Mr({
|
|
|
1898
1917
|
};
|
|
1899
1918
|
}, [T]), oe(() => {
|
|
1900
1919
|
if (!m) return;
|
|
1901
|
-
const P =
|
|
1920
|
+
const P = O.find((ge) => ge.value === y), W = {
|
|
1902
1921
|
anomalyId: ie.length > 1 && v !== "All" ? v : void 0,
|
|
1903
1922
|
spaceId: !Y && g.length > 1 && b !== "All" ? b : void 0,
|
|
1904
1923
|
spaceNumber: Y && g.length > 1 && b !== "All" ? b : void 0,
|
|
1905
|
-
severityId:
|
|
1906
|
-
severityName:
|
|
1924
|
+
severityId: O.length > 1 && y !== "All" ? y : void 0,
|
|
1925
|
+
severityName: O.length > 1 && y !== "All" ? P?.label : void 0,
|
|
1907
1926
|
thirdPartyIds: q === "All" ? void 0 : [Number(q)],
|
|
1908
1927
|
searchText: j.trim() || void 0
|
|
1909
1928
|
};
|
|
@@ -1916,18 +1935,18 @@ function Mr({
|
|
|
1916
1935
|
j,
|
|
1917
1936
|
ie.length,
|
|
1918
1937
|
g.length,
|
|
1919
|
-
|
|
1938
|
+
O.length,
|
|
1920
1939
|
Y,
|
|
1921
1940
|
_
|
|
1922
1941
|
]);
|
|
1923
|
-
const
|
|
1942
|
+
const Oe = ie.length > 1 ? ie : void 0, te = g.length > 1 ? g : void 0, Se = O.length > 1 ? O : void 0, ke = [
|
|
1924
1943
|
{
|
|
1925
1944
|
title: "Severity",
|
|
1926
1945
|
dataIndex: "priority",
|
|
1927
1946
|
key: "priority",
|
|
1928
1947
|
width: 120,
|
|
1929
1948
|
render: (P) => /* @__PURE__ */ c(
|
|
1930
|
-
|
|
1949
|
+
wt,
|
|
1931
1950
|
{
|
|
1932
1951
|
className: "px-[10px] py-[2px]",
|
|
1933
1952
|
style: {
|
|
@@ -1945,8 +1964,8 @@ function Mr({
|
|
|
1945
1964
|
render: (P, W) => /* @__PURE__ */ c(
|
|
1946
1965
|
"a",
|
|
1947
1966
|
{
|
|
1948
|
-
onClick: (
|
|
1949
|
-
|
|
1967
|
+
onClick: (ge) => {
|
|
1968
|
+
ge.preventDefault(), o?.(W, { tab: "track", sourceTab: "active" });
|
|
1950
1969
|
},
|
|
1951
1970
|
className: "text-blue-600 hover:underline",
|
|
1952
1971
|
children: "Tracker"
|
|
@@ -1958,53 +1977,53 @@ function Mr({
|
|
|
1958
1977
|
key: "actions",
|
|
1959
1978
|
width: 320,
|
|
1960
1979
|
render: (P, W) => {
|
|
1961
|
-
if (a) return /* @__PURE__ */ c(
|
|
1962
|
-
const
|
|
1963
|
-
const
|
|
1964
|
-
|
|
1980
|
+
if (a) return /* @__PURE__ */ c(rn, { children: a(W) });
|
|
1981
|
+
const ge = async (Be, Tt) => {
|
|
1982
|
+
const bt = Cs(W.id, Be);
|
|
1983
|
+
E((xe) => new Set(xe).add(bt));
|
|
1965
1984
|
try {
|
|
1966
|
-
const xe = await D.sendSMSorEmailNotifications?.(W.id,
|
|
1967
|
-
xe?.responseStatus || xe?.Success || xe?.success ? (
|
|
1968
|
-
xe?.message || xe.data || (
|
|
1969
|
-
), l?.()) :
|
|
1985
|
+
const xe = await D.sendSMSorEmailNotifications?.(W.id, Be, Tt);
|
|
1986
|
+
xe?.responseStatus || xe?.Success || xe?.success ? (Ee.success(
|
|
1987
|
+
xe?.message || xe.data || (Be ? "Email sent successfully" : "SMS sent successfully")
|
|
1988
|
+
), l?.()) : Ee.error(
|
|
1970
1989
|
xe?.message || xe?.data || xe?.errorMessage || "Failed to send notification"
|
|
1971
1990
|
);
|
|
1972
1991
|
} catch (xe) {
|
|
1973
|
-
|
|
1992
|
+
Ee.error(xe?.message || "Failed to send notification");
|
|
1974
1993
|
} finally {
|
|
1975
|
-
|
|
1976
|
-
const
|
|
1977
|
-
return
|
|
1994
|
+
E((xe) => {
|
|
1995
|
+
const It = new Set(xe);
|
|
1996
|
+
return It.delete(bt), It;
|
|
1978
1997
|
});
|
|
1979
1998
|
}
|
|
1980
|
-
},
|
|
1999
|
+
}, ue = cn, Ve = un, be = me[ue], Ke = me[Ve], Me = Un(ue, W, be?.title), Ne = Un(Ve, W, Ke?.title), Pt = Cs(W.id, !0), pt = Cs(W.id, !1), Nt = os(ue) && A.has(Pt), nt = os(Ve) && A.has(pt);
|
|
1981
2000
|
return /* @__PURE__ */ f(st, { size: "middle", children: [
|
|
1982
2001
|
/* @__PURE__ */ c(In, { title: Me.tooltipTitle, children: /* @__PURE__ */ c(
|
|
1983
2002
|
ze,
|
|
1984
2003
|
{
|
|
1985
2004
|
size: "small",
|
|
1986
2005
|
disabled: Me.isDisabled,
|
|
1987
|
-
loading:
|
|
1988
|
-
onClick:
|
|
1989
|
-
icon: !
|
|
2006
|
+
loading: Nt,
|
|
2007
|
+
onClick: os(ue) ? () => ge(!0, !1) : void 0,
|
|
2008
|
+
icon: !Nt && be?.icon,
|
|
1990
2009
|
className: "flex flex-col items-center justify-center gap-1",
|
|
1991
2010
|
style: { height: "fit-content" },
|
|
1992
2011
|
children: Me.buttonText
|
|
1993
2012
|
}
|
|
1994
|
-
) }, String(
|
|
2013
|
+
) }, String(ue)),
|
|
1995
2014
|
/* @__PURE__ */ c(In, { title: Ne.tooltipTitle, children: /* @__PURE__ */ c(
|
|
1996
2015
|
ze,
|
|
1997
2016
|
{
|
|
1998
2017
|
size: "small",
|
|
1999
2018
|
disabled: Ne.isDisabled,
|
|
2000
2019
|
loading: nt,
|
|
2001
|
-
onClick:
|
|
2020
|
+
onClick: os(Ve) ? () => ge(!1, !0) : void 0,
|
|
2002
2021
|
icon: !nt && Ke?.icon,
|
|
2003
2022
|
className: "flex flex-col items-center justify-center gap-1",
|
|
2004
2023
|
style: { height: "fit-content" },
|
|
2005
2024
|
children: Ne.buttonText
|
|
2006
2025
|
}
|
|
2007
|
-
) }, String(
|
|
2026
|
+
) }, String(Ve))
|
|
2008
2027
|
] });
|
|
2009
2028
|
}
|
|
2010
2029
|
},
|
|
@@ -2014,11 +2033,11 @@ function Mr({
|
|
|
2014
2033
|
key: "timestamp",
|
|
2015
2034
|
width: 220,
|
|
2016
2035
|
render: (P, W) => {
|
|
2017
|
-
const
|
|
2036
|
+
const ge = W?.timeElapsed, ue = W?.timeRemaining, Ve = ge ? En(ge) : 0, be = ue ? En(ue) : 0, Ke = Math.round(Ve / (Ve + be) * 100);
|
|
2018
2037
|
return /* @__PURE__ */ f("div", { children: [
|
|
2019
2038
|
/* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
|
|
2020
2039
|
/* @__PURE__ */ c("span", { className: "w-[70px]", children: "Elapsed:" }),
|
|
2021
|
-
/* @__PURE__ */ c("span", { className: "font-medium", children:
|
|
2040
|
+
/* @__PURE__ */ c("span", { className: "font-medium", children: ge ?? "-" })
|
|
2022
2041
|
] }),
|
|
2023
2042
|
/* @__PURE__ */ c(
|
|
2024
2043
|
Wi,
|
|
@@ -2031,7 +2050,7 @@ function Mr({
|
|
|
2031
2050
|
),
|
|
2032
2051
|
/* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
|
|
2033
2052
|
/* @__PURE__ */ c("span", { className: "w-[70px]", children: "Remaining" }),
|
|
2034
|
-
/* @__PURE__ */ c("span", { className: "font-medium", children:
|
|
2053
|
+
/* @__PURE__ */ c("span", { className: "font-medium", children: ue ?? "-" })
|
|
2035
2054
|
] })
|
|
2036
2055
|
] });
|
|
2037
2056
|
}
|
|
@@ -2050,8 +2069,8 @@ function Mr({
|
|
|
2050
2069
|
/* @__PURE__ */ c(
|
|
2051
2070
|
"a",
|
|
2052
2071
|
{
|
|
2053
|
-
onClick: (
|
|
2054
|
-
|
|
2072
|
+
onClick: (ge) => {
|
|
2073
|
+
ge.preventDefault(), o?.(W, { sourceTab: "active" });
|
|
2055
2074
|
},
|
|
2056
2075
|
className: "inline-block mb-1 text-blue-600",
|
|
2057
2076
|
children: W.alertNumber
|
|
@@ -2065,17 +2084,17 @@ function Mr({
|
|
|
2065
2084
|
key: "preview",
|
|
2066
2085
|
width: 100,
|
|
2067
2086
|
align: "center",
|
|
2068
|
-
render: (P, W) => /* @__PURE__ */ c(
|
|
2087
|
+
render: (P, W) => /* @__PURE__ */ c(Or, { record: W })
|
|
2069
2088
|
}
|
|
2070
|
-
],
|
|
2089
|
+
], pe = i && i.length ? i : ke;
|
|
2071
2090
|
return /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
|
|
2072
|
-
|
|
2091
|
+
Ba,
|
|
2073
2092
|
{
|
|
2074
2093
|
rowKey: "id",
|
|
2075
2094
|
data: t,
|
|
2076
|
-
columns:
|
|
2095
|
+
columns: pe,
|
|
2077
2096
|
loading: e,
|
|
2078
|
-
pageSize:
|
|
2097
|
+
pageSize: ce,
|
|
2079
2098
|
total: n,
|
|
2080
2099
|
currentPage: Z,
|
|
2081
2100
|
onPageChange: u,
|
|
@@ -2098,18 +2117,18 @@ function Mr({
|
|
|
2098
2117
|
{
|
|
2099
2118
|
value: v,
|
|
2100
2119
|
onChange: k,
|
|
2101
|
-
options:
|
|
2120
|
+
options: Oe
|
|
2102
2121
|
}
|
|
2103
2122
|
)
|
|
2104
2123
|
] }) }),
|
|
2105
2124
|
/* @__PURE__ */ c(K, { flex: "none", children: /* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
|
|
2106
2125
|
/* @__PURE__ */ c("span", { children: Y ? "Bus Number" : "Space" }),
|
|
2107
|
-
/* @__PURE__ */ c(Pa, { value: b, onChange:
|
|
2126
|
+
/* @__PURE__ */ c(Pa, { value: b, onChange: B, options: te })
|
|
2108
2127
|
] }) }),
|
|
2109
2128
|
/* @__PURE__ */ c(K, { flex: "none", children: /* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
|
|
2110
2129
|
/* @__PURE__ */ c("span", { children: "Action Taken" }),
|
|
2111
2130
|
/* @__PURE__ */ c(
|
|
2112
|
-
|
|
2131
|
+
Va,
|
|
2113
2132
|
{
|
|
2114
2133
|
value: q,
|
|
2115
2134
|
onChange: Q,
|
|
@@ -2150,38 +2169,38 @@ function Dr() {
|
|
|
2150
2169
|
}
|
|
2151
2170
|
});
|
|
2152
2171
|
}
|
|
2153
|
-
class
|
|
2172
|
+
class At extends Error {
|
|
2154
2173
|
}
|
|
2155
|
-
class ro extends
|
|
2174
|
+
class ro extends At {
|
|
2156
2175
|
constructor(e) {
|
|
2157
2176
|
super(`Invalid DateTime: ${e.toMessage()}`);
|
|
2158
2177
|
}
|
|
2159
2178
|
}
|
|
2160
|
-
class io extends
|
|
2179
|
+
class io extends At {
|
|
2161
2180
|
constructor(e) {
|
|
2162
2181
|
super(`Invalid Interval: ${e.toMessage()}`);
|
|
2163
2182
|
}
|
|
2164
2183
|
}
|
|
2165
|
-
class ao extends
|
|
2184
|
+
class ao extends At {
|
|
2166
2185
|
constructor(e) {
|
|
2167
2186
|
super(`Invalid Duration: ${e.toMessage()}`);
|
|
2168
2187
|
}
|
|
2169
2188
|
}
|
|
2170
|
-
class
|
|
2189
|
+
class Mt extends At {
|
|
2171
2190
|
}
|
|
2172
|
-
class Cr extends
|
|
2191
|
+
class Cr extends At {
|
|
2173
2192
|
constructor(e) {
|
|
2174
2193
|
super(`Invalid unit ${e}`);
|
|
2175
2194
|
}
|
|
2176
2195
|
}
|
|
2177
|
-
class De extends
|
|
2196
|
+
class De extends At {
|
|
2178
2197
|
}
|
|
2179
|
-
class mt extends
|
|
2198
|
+
class mt extends At {
|
|
2180
2199
|
constructor() {
|
|
2181
2200
|
super("Zone is an abstract class");
|
|
2182
2201
|
}
|
|
2183
2202
|
}
|
|
2184
|
-
const I = "numeric", tt = "short", He = "long",
|
|
2203
|
+
const I = "numeric", tt = "short", He = "long", Ss = {
|
|
2185
2204
|
year: I,
|
|
2186
2205
|
month: I,
|
|
2187
2206
|
day: I
|
|
@@ -2220,11 +2239,11 @@ const I = "numeric", tt = "short", He = "long", vs = {
|
|
|
2220
2239
|
minute: I,
|
|
2221
2240
|
second: I,
|
|
2222
2241
|
timeZoneName: He
|
|
2223
|
-
},
|
|
2242
|
+
}, Vr = {
|
|
2224
2243
|
hour: I,
|
|
2225
2244
|
minute: I,
|
|
2226
2245
|
hourCycle: "h23"
|
|
2227
|
-
},
|
|
2246
|
+
}, Br = {
|
|
2228
2247
|
hour: I,
|
|
2229
2248
|
minute: I,
|
|
2230
2249
|
second: I,
|
|
@@ -2307,7 +2326,7 @@ const I = "numeric", tt = "short", He = "long", vs = {
|
|
|
2307
2326
|
second: I,
|
|
2308
2327
|
timeZoneName: He
|
|
2309
2328
|
};
|
|
2310
|
-
class
|
|
2329
|
+
class Kt {
|
|
2311
2330
|
/**
|
|
2312
2331
|
* The type of zone
|
|
2313
2332
|
* @abstract
|
|
@@ -2391,14 +2410,14 @@ class Qt {
|
|
|
2391
2410
|
throw new mt();
|
|
2392
2411
|
}
|
|
2393
2412
|
}
|
|
2394
|
-
let
|
|
2395
|
-
class
|
|
2413
|
+
let Rs = null;
|
|
2414
|
+
class bs extends Kt {
|
|
2396
2415
|
/**
|
|
2397
2416
|
* Get a singleton instance of the local zone
|
|
2398
2417
|
* @return {SystemZone}
|
|
2399
2418
|
*/
|
|
2400
2419
|
static get instance() {
|
|
2401
|
-
return
|
|
2420
|
+
return Rs === null && (Rs = new bs()), Rs;
|
|
2402
2421
|
}
|
|
2403
2422
|
/** @override **/
|
|
2404
2423
|
get type() {
|
|
@@ -2418,7 +2437,7 @@ class Is extends Qt {
|
|
|
2418
2437
|
}
|
|
2419
2438
|
/** @override **/
|
|
2420
2439
|
formatOffset(e, s) {
|
|
2421
|
-
return
|
|
2440
|
+
return Yt(this.offset(e), s);
|
|
2422
2441
|
}
|
|
2423
2442
|
/** @override **/
|
|
2424
2443
|
offset(e) {
|
|
@@ -2433,9 +2452,9 @@ class Is extends Qt {
|
|
|
2433
2452
|
return !0;
|
|
2434
2453
|
}
|
|
2435
2454
|
}
|
|
2436
|
-
const
|
|
2455
|
+
const qs = /* @__PURE__ */ new Map();
|
|
2437
2456
|
function co(t) {
|
|
2438
|
-
let e =
|
|
2457
|
+
let e = qs.get(t);
|
|
2439
2458
|
return e === void 0 && (e = new Intl.DateTimeFormat("en-US", {
|
|
2440
2459
|
hour12: !1,
|
|
2441
2460
|
timeZone: t,
|
|
@@ -2446,7 +2465,7 @@ function co(t) {
|
|
|
2446
2465
|
minute: "2-digit",
|
|
2447
2466
|
second: "2-digit",
|
|
2448
2467
|
era: "short"
|
|
2449
|
-
}),
|
|
2468
|
+
}), qs.set(t, e)), e;
|
|
2450
2469
|
}
|
|
2451
2470
|
const uo = {
|
|
2452
2471
|
year: 0,
|
|
@@ -2469,22 +2488,22 @@ function fo(t, e) {
|
|
|
2469
2488
|
}
|
|
2470
2489
|
return n;
|
|
2471
2490
|
}
|
|
2472
|
-
const
|
|
2473
|
-
class lt extends
|
|
2491
|
+
const Us = /* @__PURE__ */ new Map();
|
|
2492
|
+
class lt extends Kt {
|
|
2474
2493
|
/**
|
|
2475
2494
|
* @param {string} name - Zone name
|
|
2476
2495
|
* @return {IANAZone}
|
|
2477
2496
|
*/
|
|
2478
2497
|
static create(e) {
|
|
2479
|
-
let s =
|
|
2480
|
-
return s === void 0 &&
|
|
2498
|
+
let s = Us.get(e);
|
|
2499
|
+
return s === void 0 && Us.set(e, s = new lt(e)), s;
|
|
2481
2500
|
}
|
|
2482
2501
|
/**
|
|
2483
2502
|
* Reset local caches. Should only be necessary in testing scenarios.
|
|
2484
2503
|
* @return {void}
|
|
2485
2504
|
*/
|
|
2486
2505
|
static resetCache() {
|
|
2487
|
-
|
|
2506
|
+
Us.clear(), qs.clear();
|
|
2488
2507
|
}
|
|
2489
2508
|
/**
|
|
2490
2509
|
* Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.
|
|
@@ -2563,7 +2582,7 @@ class lt extends Qt {
|
|
|
2563
2582
|
* @return {string}
|
|
2564
2583
|
*/
|
|
2565
2584
|
formatOffset(e, s) {
|
|
2566
|
-
return
|
|
2585
|
+
return Yt(this.offset(e), s);
|
|
2567
2586
|
}
|
|
2568
2587
|
/**
|
|
2569
2588
|
* Return the offset in minutes for this zone at the specified timestamp.
|
|
@@ -2578,7 +2597,7 @@ class lt extends Qt {
|
|
|
2578
2597
|
const n = co(this.name);
|
|
2579
2598
|
let [r, i, a, o, l, u, m] = n.formatToParts ? fo(n, s) : mo(n, s);
|
|
2580
2599
|
o === "BC" && (r = -Math.abs(r) + 1);
|
|
2581
|
-
const y =
|
|
2600
|
+
const y = ks({
|
|
2582
2601
|
year: r,
|
|
2583
2602
|
month: i,
|
|
2584
2603
|
day: a,
|
|
@@ -2615,39 +2634,39 @@ function ho(t, e = {}) {
|
|
|
2615
2634
|
let n = Pn[s];
|
|
2616
2635
|
return n || (n = new Intl.ListFormat(t, e), Pn[s] = n), n;
|
|
2617
2636
|
}
|
|
2618
|
-
const
|
|
2619
|
-
function
|
|
2637
|
+
const Ys = /* @__PURE__ */ new Map();
|
|
2638
|
+
function _s(t, e = {}) {
|
|
2620
2639
|
const s = JSON.stringify([t, e]);
|
|
2621
|
-
let n =
|
|
2622
|
-
return n === void 0 && (n = new Intl.DateTimeFormat(t, e),
|
|
2640
|
+
let n = Ys.get(s);
|
|
2641
|
+
return n === void 0 && (n = new Intl.DateTimeFormat(t, e), Ys.set(s, n)), n;
|
|
2623
2642
|
}
|
|
2624
|
-
const
|
|
2643
|
+
const js = /* @__PURE__ */ new Map();
|
|
2625
2644
|
function yo(t, e = {}) {
|
|
2626
2645
|
const s = JSON.stringify([t, e]);
|
|
2627
|
-
let n =
|
|
2628
|
-
return n === void 0 && (n = new Intl.NumberFormat(t, e),
|
|
2646
|
+
let n = js.get(s);
|
|
2647
|
+
return n === void 0 && (n = new Intl.NumberFormat(t, e), js.set(s, n)), n;
|
|
2629
2648
|
}
|
|
2630
|
-
const
|
|
2649
|
+
const Js = /* @__PURE__ */ new Map();
|
|
2631
2650
|
function po(t, e = {}) {
|
|
2632
2651
|
const { base: s, ...n } = e, r = JSON.stringify([t, n]);
|
|
2633
|
-
let i =
|
|
2634
|
-
return i === void 0 && (i = new Intl.RelativeTimeFormat(t, e),
|
|
2652
|
+
let i = Js.get(r);
|
|
2653
|
+
return i === void 0 && (i = new Intl.RelativeTimeFormat(t, e), Js.set(r, i)), i;
|
|
2635
2654
|
}
|
|
2636
|
-
let
|
|
2655
|
+
let Ht = null;
|
|
2637
2656
|
function go() {
|
|
2638
|
-
return
|
|
2657
|
+
return Ht || (Ht = new Intl.DateTimeFormat().resolvedOptions().locale, Ht);
|
|
2639
2658
|
}
|
|
2640
|
-
const
|
|
2659
|
+
const Ks = /* @__PURE__ */ new Map();
|
|
2641
2660
|
function Qr(t) {
|
|
2642
|
-
let e =
|
|
2643
|
-
return e === void 0 && (e = new Intl.DateTimeFormat(t).resolvedOptions(),
|
|
2661
|
+
let e = Ks.get(t);
|
|
2662
|
+
return e === void 0 && (e = new Intl.DateTimeFormat(t).resolvedOptions(), Ks.set(t, e)), e;
|
|
2644
2663
|
}
|
|
2645
|
-
const
|
|
2664
|
+
const Qs = /* @__PURE__ */ new Map();
|
|
2646
2665
|
function So(t) {
|
|
2647
|
-
let e =
|
|
2666
|
+
let e = Qs.get(t);
|
|
2648
2667
|
if (!e) {
|
|
2649
2668
|
const s = new Intl.Locale(t);
|
|
2650
|
-
e = "getWeekInfo" in s ? s.getWeekInfo() : s.weekInfo, "minimalDays" in e || (e = { ...Xr, ...e }),
|
|
2669
|
+
e = "getWeekInfo" in s ? s.getWeekInfo() : s.weekInfo, "minimalDays" in e || (e = { ...Xr, ...e }), Qs.set(t, e);
|
|
2651
2670
|
}
|
|
2652
2671
|
return e;
|
|
2653
2672
|
}
|
|
@@ -2660,10 +2679,10 @@ function vo(t) {
|
|
|
2660
2679
|
{
|
|
2661
2680
|
let n, r;
|
|
2662
2681
|
try {
|
|
2663
|
-
n =
|
|
2682
|
+
n = _s(t).resolvedOptions(), r = t;
|
|
2664
2683
|
} catch {
|
|
2665
2684
|
const l = t.substring(0, s);
|
|
2666
|
-
n =
|
|
2685
|
+
n = _s(l).resolvedOptions(), r = l;
|
|
2667
2686
|
}
|
|
2668
2687
|
const { numberingSystem: i, calendar: a } = n;
|
|
2669
2688
|
return [r, i, a];
|
|
@@ -2688,7 +2707,7 @@ function No(t) {
|
|
|
2688
2707
|
}
|
|
2689
2708
|
return e;
|
|
2690
2709
|
}
|
|
2691
|
-
function
|
|
2710
|
+
function ls(t, e, s, n) {
|
|
2692
2711
|
const r = t.listingMode();
|
|
2693
2712
|
return r === "error" ? null : r === "en" ? s(e) : n(e);
|
|
2694
2713
|
}
|
|
@@ -2709,7 +2728,7 @@ class bo {
|
|
|
2709
2728
|
const s = this.floor ? Math.floor(e) : e;
|
|
2710
2729
|
return this.inf.format(s);
|
|
2711
2730
|
} else {
|
|
2712
|
-
const s = this.floor ? Math.floor(e) :
|
|
2731
|
+
const s = this.floor ? Math.floor(e) : pn(e, 3);
|
|
2713
2732
|
return Te(s, this.padTo);
|
|
2714
2733
|
}
|
|
2715
2734
|
}
|
|
@@ -2725,7 +2744,7 @@ class Io {
|
|
|
2725
2744
|
e.offset !== 0 && lt.create(o).valid ? (r = o, this.dt = e) : (r = "UTC", this.dt = e.offset === 0 ? e : e.setZone("UTC").plus({ minutes: e.offset }), this.originalZone = e.zone);
|
|
2726
2745
|
} else e.zone.type === "system" ? this.dt = e : e.zone.type === "iana" ? (this.dt = e, r = e.zone.name) : (r = "UTC", this.dt = e.setZone("UTC").plus({ minutes: e.offset }), this.originalZone = e.zone);
|
|
2727
2746
|
const i = { ...this.opts };
|
|
2728
|
-
i.timeZone = i.timeZone || r, this.dtf =
|
|
2747
|
+
i.timeZone = i.timeZone || r, this.dtf = _s(s, i);
|
|
2729
2748
|
}
|
|
2730
2749
|
format() {
|
|
2731
2750
|
return this.originalZone ? this.formatToParts().map(({ value: e }) => e).join("") : this.dtf.format(this.dt.toJSDate());
|
|
@@ -2777,11 +2796,11 @@ class re {
|
|
|
2777
2796
|
);
|
|
2778
2797
|
}
|
|
2779
2798
|
static create(e, s, n, r, i = !1) {
|
|
2780
|
-
const a = e || Ae.defaultLocale, o = a || (i ? "en-US" : go()), l = s || Ae.defaultNumberingSystem, u = n || Ae.defaultOutputCalendar, m =
|
|
2799
|
+
const a = e || Ae.defaultLocale, o = a || (i ? "en-US" : go()), l = s || Ae.defaultNumberingSystem, u = n || Ae.defaultOutputCalendar, m = en(r) || Ae.defaultWeekSettings;
|
|
2781
2800
|
return new re(o, l, u, m, a);
|
|
2782
2801
|
}
|
|
2783
2802
|
static resetCache() {
|
|
2784
|
-
|
|
2803
|
+
Ht = null, Ys.clear(), js.clear(), Js.clear(), Ks.clear(), Qs.clear();
|
|
2785
2804
|
}
|
|
2786
2805
|
static fromObject({ locale: e, numberingSystem: s, outputCalendar: n, weekSettings: r } = {}) {
|
|
2787
2806
|
return re.create(e, s, n, r);
|
|
@@ -2802,7 +2821,7 @@ class re {
|
|
|
2802
2821
|
e.locale || this.specifiedLocale,
|
|
2803
2822
|
e.numberingSystem || this.numberingSystem,
|
|
2804
2823
|
e.outputCalendar || this.outputCalendar,
|
|
2805
|
-
|
|
2824
|
+
en(e.weekSettings) || this.weekSettings,
|
|
2806
2825
|
e.defaultToEN || !1
|
|
2807
2826
|
);
|
|
2808
2827
|
}
|
|
@@ -2813,7 +2832,7 @@ class re {
|
|
|
2813
2832
|
return this.clone({ ...e, defaultToEN: !1 });
|
|
2814
2833
|
}
|
|
2815
2834
|
months(e, s = !1) {
|
|
2816
|
-
return
|
|
2835
|
+
return ls(this, e, di, () => {
|
|
2817
2836
|
const n = this.intl === "ja" || this.intl.startsWith("ja-");
|
|
2818
2837
|
s &= !n;
|
|
2819
2838
|
const r = s ? { month: e, day: "numeric" } : { month: e }, i = s ? "format" : "standalone";
|
|
@@ -2825,7 +2844,7 @@ class re {
|
|
|
2825
2844
|
});
|
|
2826
2845
|
}
|
|
2827
2846
|
weekdays(e, s = !1) {
|
|
2828
|
-
return
|
|
2847
|
+
return ls(this, e, hi, () => {
|
|
2829
2848
|
const n = s ? { weekday: e, year: "numeric", month: "long", day: "numeric" } : { weekday: e }, r = s ? "format" : "standalone";
|
|
2830
2849
|
return this.weekdaysCache[r][e] || (this.weekdaysCache[r][e] = No(
|
|
2831
2850
|
(i) => this.extract(i, n, "weekday")
|
|
@@ -2833,7 +2852,7 @@ class re {
|
|
|
2833
2852
|
});
|
|
2834
2853
|
}
|
|
2835
2854
|
meridiems() {
|
|
2836
|
-
return
|
|
2855
|
+
return ls(
|
|
2837
2856
|
this,
|
|
2838
2857
|
void 0,
|
|
2839
2858
|
() => yi,
|
|
@@ -2849,7 +2868,7 @@ class re {
|
|
|
2849
2868
|
);
|
|
2850
2869
|
}
|
|
2851
2870
|
eras(e) {
|
|
2852
|
-
return
|
|
2871
|
+
return ls(this, e, pi, () => {
|
|
2853
2872
|
const s = { era: e };
|
|
2854
2873
|
return this.eraCache[e] || (this.eraCache[e] = [F.utc(-40, 1, 1), F.utc(2017, 1, 1)].map(
|
|
2855
2874
|
(n) => this.extract(n, s, "era")
|
|
@@ -2894,14 +2913,14 @@ class re {
|
|
|
2894
2913
|
return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`;
|
|
2895
2914
|
}
|
|
2896
2915
|
}
|
|
2897
|
-
let
|
|
2898
|
-
class
|
|
2916
|
+
let Ls = null;
|
|
2917
|
+
class We extends Kt {
|
|
2899
2918
|
/**
|
|
2900
2919
|
* Get a singleton instance of UTC
|
|
2901
2920
|
* @return {FixedOffsetZone}
|
|
2902
2921
|
*/
|
|
2903
2922
|
static get utcInstance() {
|
|
2904
|
-
return
|
|
2923
|
+
return Ls === null && (Ls = new We(0)), Ls;
|
|
2905
2924
|
}
|
|
2906
2925
|
/**
|
|
2907
2926
|
* Get an instance with a specified offset
|
|
@@ -2909,7 +2928,7 @@ class $e extends Qt {
|
|
|
2909
2928
|
* @return {FixedOffsetZone}
|
|
2910
2929
|
*/
|
|
2911
2930
|
static instance(e) {
|
|
2912
|
-
return e === 0 ?
|
|
2931
|
+
return e === 0 ? We.utcInstance : new We(e);
|
|
2913
2932
|
}
|
|
2914
2933
|
/**
|
|
2915
2934
|
* Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6"
|
|
@@ -2923,7 +2942,7 @@ class $e extends Qt {
|
|
|
2923
2942
|
if (e) {
|
|
2924
2943
|
const s = e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);
|
|
2925
2944
|
if (s)
|
|
2926
|
-
return new
|
|
2945
|
+
return new We(xs(s[1], s[2]));
|
|
2927
2946
|
}
|
|
2928
2947
|
return null;
|
|
2929
2948
|
}
|
|
@@ -2945,7 +2964,7 @@ class $e extends Qt {
|
|
|
2945
2964
|
* @type {string}
|
|
2946
2965
|
*/
|
|
2947
2966
|
get name() {
|
|
2948
|
-
return this.fixed === 0 ? "UTC" : `UTC${
|
|
2967
|
+
return this.fixed === 0 ? "UTC" : `UTC${Yt(this.fixed, "narrow")}`;
|
|
2949
2968
|
}
|
|
2950
2969
|
/**
|
|
2951
2970
|
* The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn`
|
|
@@ -2954,7 +2973,7 @@ class $e extends Qt {
|
|
|
2954
2973
|
* @type {string}
|
|
2955
2974
|
*/
|
|
2956
2975
|
get ianaName() {
|
|
2957
|
-
return this.fixed === 0 ? "Etc/UTC" : `Etc/GMT${
|
|
2976
|
+
return this.fixed === 0 ? "Etc/UTC" : `Etc/GMT${Yt(-this.fixed, "narrow")}`;
|
|
2958
2977
|
}
|
|
2959
2978
|
/**
|
|
2960
2979
|
* Returns the offset's common name at the specified timestamp.
|
|
@@ -2974,7 +2993,7 @@ class $e extends Qt {
|
|
|
2974
2993
|
* @return {string}
|
|
2975
2994
|
*/
|
|
2976
2995
|
formatOffset(e, s) {
|
|
2977
|
-
return
|
|
2996
|
+
return Yt(this.fixed, s);
|
|
2978
2997
|
}
|
|
2979
2998
|
/**
|
|
2980
2999
|
* Returns whether the offset is known to be fixed for the whole year:
|
|
@@ -3014,7 +3033,7 @@ class $e extends Qt {
|
|
|
3014
3033
|
return !0;
|
|
3015
3034
|
}
|
|
3016
3035
|
}
|
|
3017
|
-
class xo extends
|
|
3036
|
+
class xo extends Kt {
|
|
3018
3037
|
constructor(e) {
|
|
3019
3038
|
super(), this.zoneName = e;
|
|
3020
3039
|
}
|
|
@@ -3054,14 +3073,14 @@ class xo extends Qt {
|
|
|
3054
3073
|
function ht(t, e) {
|
|
3055
3074
|
if ($(t) || t === null)
|
|
3056
3075
|
return e;
|
|
3057
|
-
if (t instanceof
|
|
3076
|
+
if (t instanceof Kt)
|
|
3058
3077
|
return t;
|
|
3059
3078
|
if (Ro(t)) {
|
|
3060
3079
|
const s = t.toLowerCase();
|
|
3061
|
-
return s === "default" ? e : s === "local" || s === "system" ?
|
|
3062
|
-
} else return yt(t) ?
|
|
3080
|
+
return s === "default" ? e : s === "local" || s === "system" ? bs.instance : s === "utc" || s === "gmt" ? We.utcInstance : We.parseSpecifier(s) || lt.create(t);
|
|
3081
|
+
} else return yt(t) ? We.instance(t) : typeof t == "object" && "offset" in t && typeof t.offset == "function" ? t : new xo(t);
|
|
3063
3082
|
}
|
|
3064
|
-
const
|
|
3083
|
+
const mn = {
|
|
3065
3084
|
arab: "[٠-٩]",
|
|
3066
3085
|
arabext: "[۰-۹]",
|
|
3067
3086
|
bali: "[᭐-᭙]",
|
|
@@ -3103,15 +3122,15 @@ const fn = {
|
|
|
3103
3122
|
telu: [3174, 3183],
|
|
3104
3123
|
thai: [3664, 3673],
|
|
3105
3124
|
tibt: [3872, 3881]
|
|
3106
|
-
},
|
|
3107
|
-
function
|
|
3125
|
+
}, Eo = mn.hanidec.replace(/[\[|\]]/g, "").split("");
|
|
3126
|
+
function Oo(t) {
|
|
3108
3127
|
let e = parseInt(t, 10);
|
|
3109
3128
|
if (isNaN(e)) {
|
|
3110
3129
|
e = "";
|
|
3111
3130
|
for (let s = 0; s < t.length; s++) {
|
|
3112
3131
|
const n = t.charCodeAt(s);
|
|
3113
|
-
if (t[s].search(
|
|
3114
|
-
e +=
|
|
3132
|
+
if (t[s].search(mn.hanidec) !== -1)
|
|
3133
|
+
e += Eo.indexOf(t[s]);
|
|
3115
3134
|
else
|
|
3116
3135
|
for (const r in Wn) {
|
|
3117
3136
|
const [i, a] = Wn[r];
|
|
@@ -3122,25 +3141,25 @@ function Eo(t) {
|
|
|
3122
3141
|
} else
|
|
3123
3142
|
return e;
|
|
3124
3143
|
}
|
|
3125
|
-
const
|
|
3144
|
+
const Xs = /* @__PURE__ */ new Map();
|
|
3126
3145
|
function Mo() {
|
|
3127
|
-
|
|
3146
|
+
Xs.clear();
|
|
3128
3147
|
}
|
|
3129
3148
|
function Qe({ numberingSystem: t }, e = "") {
|
|
3130
3149
|
const s = t || "latn";
|
|
3131
|
-
let n =
|
|
3132
|
-
n === void 0 && (n = /* @__PURE__ */ new Map(),
|
|
3150
|
+
let n = Xs.get(s);
|
|
3151
|
+
n === void 0 && (n = /* @__PURE__ */ new Map(), Xs.set(s, n));
|
|
3133
3152
|
let r = n.get(e);
|
|
3134
|
-
return r === void 0 && (r = new RegExp(`${
|
|
3153
|
+
return r === void 0 && (r = new RegExp(`${mn[s]}${e}`), n.set(e, r)), r;
|
|
3135
3154
|
}
|
|
3136
|
-
let
|
|
3155
|
+
let Vn = () => Date.now(), Bn = "system", Zn = null, zn = null, Hn = null, Gn = 60, qn, Yn = null;
|
|
3137
3156
|
class Ae {
|
|
3138
3157
|
/**
|
|
3139
3158
|
* Get the callback for returning the current timestamp.
|
|
3140
3159
|
* @type {function}
|
|
3141
3160
|
*/
|
|
3142
3161
|
static get now() {
|
|
3143
|
-
return
|
|
3162
|
+
return Vn;
|
|
3144
3163
|
}
|
|
3145
3164
|
/**
|
|
3146
3165
|
* Set the callback for returning the current timestamp.
|
|
@@ -3150,7 +3169,7 @@ class Ae {
|
|
|
3150
3169
|
* @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time
|
|
3151
3170
|
*/
|
|
3152
3171
|
static set now(e) {
|
|
3153
|
-
|
|
3172
|
+
Vn = e;
|
|
3154
3173
|
}
|
|
3155
3174
|
/**
|
|
3156
3175
|
* Set the default time zone to create DateTimes in. Does not affect existing instances.
|
|
@@ -3158,7 +3177,7 @@ class Ae {
|
|
|
3158
3177
|
* @type {string}
|
|
3159
3178
|
*/
|
|
3160
3179
|
static set defaultZone(e) {
|
|
3161
|
-
|
|
3180
|
+
Bn = e;
|
|
3162
3181
|
}
|
|
3163
3182
|
/**
|
|
3164
3183
|
* Get the default time zone object currently used to create DateTimes. Does not affect existing instances.
|
|
@@ -3166,7 +3185,7 @@ class Ae {
|
|
|
3166
3185
|
* @type {Zone}
|
|
3167
3186
|
*/
|
|
3168
3187
|
static get defaultZone() {
|
|
3169
|
-
return ht(
|
|
3188
|
+
return ht(Bn, bs.instance);
|
|
3170
3189
|
}
|
|
3171
3190
|
/**
|
|
3172
3191
|
* Get the default locale to create DateTimes with. Does not affect existing instances.
|
|
@@ -3230,7 +3249,7 @@ class Ae {
|
|
|
3230
3249
|
* @param {WeekSettings|null} weekSettings
|
|
3231
3250
|
*/
|
|
3232
3251
|
static set defaultWeekSettings(e) {
|
|
3233
|
-
Yn =
|
|
3252
|
+
Yn = en(e);
|
|
3234
3253
|
}
|
|
3235
3254
|
/**
|
|
3236
3255
|
* Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.
|
|
@@ -3288,35 +3307,35 @@ function je(t, e) {
|
|
|
3288
3307
|
`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`
|
|
3289
3308
|
);
|
|
3290
3309
|
}
|
|
3291
|
-
function
|
|
3310
|
+
function fn(t, e, s) {
|
|
3292
3311
|
const n = new Date(Date.UTC(t, e - 1, s));
|
|
3293
3312
|
t < 100 && t >= 0 && n.setUTCFullYear(n.getUTCFullYear() - 1900);
|
|
3294
3313
|
const r = n.getUTCDay();
|
|
3295
3314
|
return r === 0 ? 7 : r;
|
|
3296
3315
|
}
|
|
3297
3316
|
function si(t, e, s) {
|
|
3298
|
-
return s + (
|
|
3317
|
+
return s + (Qt(t) ? ti : ei)[e - 1];
|
|
3299
3318
|
}
|
|
3300
3319
|
function ni(t, e) {
|
|
3301
|
-
const s =
|
|
3320
|
+
const s = Qt(t) ? ti : ei, n = s.findIndex((i) => i < e), r = e - s[n];
|
|
3302
3321
|
return { month: n + 1, day: r };
|
|
3303
3322
|
}
|
|
3304
|
-
function
|
|
3323
|
+
function hn(t, e) {
|
|
3305
3324
|
return (t - e + 7) % 7 + 1;
|
|
3306
3325
|
}
|
|
3307
|
-
function
|
|
3308
|
-
const { year: n, month: r, day: i } = t, a = si(n, r, i), o =
|
|
3326
|
+
function vs(t, e = 4, s = 1) {
|
|
3327
|
+
const { year: n, month: r, day: i } = t, a = si(n, r, i), o = hn(fn(n, r, i), s);
|
|
3309
3328
|
let l = Math.floor((a - o + 14 - e) / 7), u;
|
|
3310
|
-
return l < 1 ? (u = n - 1, l =
|
|
3329
|
+
return l < 1 ? (u = n - 1, l = _t(u, e, s)) : l > _t(n, e, s) ? (u = n + 1, l = 1) : u = n, { weekYear: u, weekNumber: l, weekday: o, ...Es(t) };
|
|
3311
3330
|
}
|
|
3312
3331
|
function _n(t, e = 4, s = 1) {
|
|
3313
|
-
const { weekYear: n, weekNumber: r, weekday: i } = t, a =
|
|
3332
|
+
const { weekYear: n, weekNumber: r, weekday: i } = t, a = hn(fn(n, 1, e), s), o = Dt(n);
|
|
3314
3333
|
let l = r * 7 + i - a - 7 + e, u;
|
|
3315
|
-
l < 1 ? (u = n - 1, l +=
|
|
3334
|
+
l < 1 ? (u = n - 1, l += Dt(u)) : l > o ? (u = n + 1, l -= Dt(n)) : u = n;
|
|
3316
3335
|
const { month: m, day: d } = ni(u, l);
|
|
3317
3336
|
return { year: u, month: m, day: d, ...Es(t) };
|
|
3318
3337
|
}
|
|
3319
|
-
function
|
|
3338
|
+
function Fs(t) {
|
|
3320
3339
|
const { year: e, month: s, day: n } = t, r = si(e, s, n);
|
|
3321
3340
|
return { year: e, ordinal: r, ...Es(t) };
|
|
3322
3341
|
}
|
|
@@ -3327,7 +3346,7 @@ function jn(t) {
|
|
|
3327
3346
|
function Jn(t, e) {
|
|
3328
3347
|
if (!$(t.localWeekday) || !$(t.localWeekNumber) || !$(t.localWeekYear)) {
|
|
3329
3348
|
if (!$(t.weekday) || !$(t.weekNumber) || !$(t.weekYear))
|
|
3330
|
-
throw new
|
|
3349
|
+
throw new Mt(
|
|
3331
3350
|
"Cannot mix locale-based week fields with ISO-based week fields"
|
|
3332
3351
|
);
|
|
3333
3352
|
return $(t.localWeekday) || (t.weekday = t.localWeekday), $(t.localWeekNumber) || (t.weekNumber = t.localWeekNumber), $(t.localWeekYear) || (t.weekYear = t.localWeekYear), delete t.localWeekday, delete t.localWeekNumber, delete t.localWeekYear, {
|
|
@@ -3338,19 +3357,19 @@ function Jn(t, e) {
|
|
|
3338
3357
|
return { minDaysInFirstWeek: 4, startOfWeek: 1 };
|
|
3339
3358
|
}
|
|
3340
3359
|
function Do(t, e = 4, s = 1) {
|
|
3341
|
-
const n =
|
|
3360
|
+
const n = Is(t.weekYear), r = Je(
|
|
3342
3361
|
t.weekNumber,
|
|
3343
3362
|
1,
|
|
3344
|
-
|
|
3363
|
+
_t(t.weekYear, e, s)
|
|
3345
3364
|
), i = Je(t.weekday, 1, 7);
|
|
3346
3365
|
return n ? r ? i ? !1 : je("weekday", t.weekday) : je("week", t.weekNumber) : je("weekYear", t.weekYear);
|
|
3347
3366
|
}
|
|
3348
3367
|
function Co(t) {
|
|
3349
|
-
const e =
|
|
3368
|
+
const e = Is(t.year), s = Je(t.ordinal, 1, Dt(t.year));
|
|
3350
3369
|
return e ? s ? !1 : je("ordinal", t.ordinal) : je("year", t.year);
|
|
3351
3370
|
}
|
|
3352
3371
|
function ri(t) {
|
|
3353
|
-
const e =
|
|
3372
|
+
const e = Is(t.year), s = Je(t.month, 1, 12), n = Je(t.day, 1, ws(t.year, t.month));
|
|
3354
3373
|
return e ? s ? n ? !1 : je("day", t.day) : je("month", t.month) : je("year", t.year);
|
|
3355
3374
|
}
|
|
3356
3375
|
function ii(t) {
|
|
@@ -3363,7 +3382,7 @@ function $(t) {
|
|
|
3363
3382
|
function yt(t) {
|
|
3364
3383
|
return typeof t == "number";
|
|
3365
3384
|
}
|
|
3366
|
-
function
|
|
3385
|
+
function Is(t) {
|
|
3367
3386
|
return typeof t == "number" && t % 1 === 0;
|
|
3368
3387
|
}
|
|
3369
3388
|
function Ro(t) {
|
|
@@ -3399,10 +3418,10 @@ function Kn(t, e, s) {
|
|
|
3399
3418
|
function Fo(t, e) {
|
|
3400
3419
|
return e.reduce((s, n) => (s[n] = t[n], s), {});
|
|
3401
3420
|
}
|
|
3402
|
-
function
|
|
3421
|
+
function Rt(t, e) {
|
|
3403
3422
|
return Object.prototype.hasOwnProperty.call(t, e);
|
|
3404
3423
|
}
|
|
3405
|
-
function
|
|
3424
|
+
function en(t) {
|
|
3406
3425
|
if (t == null)
|
|
3407
3426
|
return null;
|
|
3408
3427
|
if (typeof t != "object")
|
|
@@ -3416,7 +3435,7 @@ function tn(t) {
|
|
|
3416
3435
|
};
|
|
3417
3436
|
}
|
|
3418
3437
|
function Je(t, e, s) {
|
|
3419
|
-
return
|
|
3438
|
+
return Is(t) && t >= e && t <= s;
|
|
3420
3439
|
}
|
|
3421
3440
|
function $o(t, e) {
|
|
3422
3441
|
return t - e * Math.floor(t / e);
|
|
@@ -3430,17 +3449,17 @@ function ft(t) {
|
|
|
3430
3449
|
if (!($(t) || t === null || t === ""))
|
|
3431
3450
|
return parseInt(t, 10);
|
|
3432
3451
|
}
|
|
3433
|
-
function
|
|
3452
|
+
function gt(t) {
|
|
3434
3453
|
if (!($(t) || t === null || t === ""))
|
|
3435
3454
|
return parseFloat(t);
|
|
3436
3455
|
}
|
|
3437
|
-
function
|
|
3456
|
+
function yn(t) {
|
|
3438
3457
|
if (!($(t) || t === null || t === "")) {
|
|
3439
3458
|
const e = parseFloat("0." + t) * 1e3;
|
|
3440
3459
|
return Math.floor(e);
|
|
3441
3460
|
}
|
|
3442
3461
|
}
|
|
3443
|
-
function
|
|
3462
|
+
function pn(t, e, s = "round") {
|
|
3444
3463
|
const n = 10 ** e;
|
|
3445
3464
|
switch (s) {
|
|
3446
3465
|
case "expand":
|
|
@@ -3457,17 +3476,17 @@ function gn(t, e, s = "round") {
|
|
|
3457
3476
|
throw new RangeError(`Value rounding ${s} is out of range`);
|
|
3458
3477
|
}
|
|
3459
3478
|
}
|
|
3460
|
-
function
|
|
3479
|
+
function Qt(t) {
|
|
3461
3480
|
return t % 4 === 0 && (t % 100 !== 0 || t % 400 === 0);
|
|
3462
3481
|
}
|
|
3463
|
-
function
|
|
3464
|
-
return
|
|
3482
|
+
function Dt(t) {
|
|
3483
|
+
return Qt(t) ? 366 : 365;
|
|
3465
3484
|
}
|
|
3466
|
-
function
|
|
3485
|
+
function ws(t, e) {
|
|
3467
3486
|
const s = $o(e - 1, 12) + 1, n = t + (e - s) / 12;
|
|
3468
|
-
return s === 2 ?
|
|
3487
|
+
return s === 2 ? Qt(n) ? 29 : 28 : [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][s - 1];
|
|
3469
3488
|
}
|
|
3470
|
-
function
|
|
3489
|
+
function ks(t) {
|
|
3471
3490
|
let e = Date.UTC(
|
|
3472
3491
|
t.year,
|
|
3473
3492
|
t.month - 1,
|
|
@@ -3480,13 +3499,13 @@ function xs(t) {
|
|
|
3480
3499
|
return t.year < 100 && t.year >= 0 && (e = new Date(e), e.setUTCFullYear(t.year, t.month - 1, t.day)), +e;
|
|
3481
3500
|
}
|
|
3482
3501
|
function Qn(t, e, s) {
|
|
3483
|
-
return -
|
|
3502
|
+
return -hn(fn(t, 1, e), s) + e - 1;
|
|
3484
3503
|
}
|
|
3485
|
-
function
|
|
3504
|
+
function _t(t, e = 4, s = 1) {
|
|
3486
3505
|
const n = Qn(t, e, s), r = Qn(t + 1, e, s);
|
|
3487
|
-
return (
|
|
3506
|
+
return (Dt(t) - n + r) / 7;
|
|
3488
3507
|
}
|
|
3489
|
-
function
|
|
3508
|
+
function tn(t) {
|
|
3490
3509
|
return t > 99 ? t : t > Ae.twoDigitCutoffYear ? 1900 + t : 2e3 + t;
|
|
3491
3510
|
}
|
|
3492
3511
|
function li(t, e, s, n = null) {
|
|
@@ -3502,7 +3521,7 @@ function li(t, e, s, n = null) {
|
|
|
3502
3521
|
const a = { timeZoneName: e, ...i }, o = new Intl.DateTimeFormat(s, a).formatToParts(r).find((l) => l.type.toLowerCase() === "timezonename");
|
|
3503
3522
|
return o ? o.value : null;
|
|
3504
3523
|
}
|
|
3505
|
-
function
|
|
3524
|
+
function xs(t, e) {
|
|
3506
3525
|
let s = parseInt(t, 10);
|
|
3507
3526
|
Number.isNaN(s) && (s = 0);
|
|
3508
3527
|
const n = parseInt(e, 10) || 0, r = s < 0 || Object.is(s, -0) ? -n : n;
|
|
@@ -3514,17 +3533,17 @@ function ci(t) {
|
|
|
3514
3533
|
throw new De(`Invalid unit value ${t}`);
|
|
3515
3534
|
return e;
|
|
3516
3535
|
}
|
|
3517
|
-
function
|
|
3536
|
+
function As(t, e) {
|
|
3518
3537
|
const s = {};
|
|
3519
3538
|
for (const n in t)
|
|
3520
|
-
if (
|
|
3539
|
+
if (Rt(t, n)) {
|
|
3521
3540
|
const r = t[n];
|
|
3522
3541
|
if (r == null) continue;
|
|
3523
3542
|
s[e(n)] = ci(r);
|
|
3524
3543
|
}
|
|
3525
3544
|
return s;
|
|
3526
3545
|
}
|
|
3527
|
-
function
|
|
3546
|
+
function Yt(t, e) {
|
|
3528
3547
|
const s = Math.trunc(Math.abs(t / 60)), n = Math.trunc(Math.abs(t % 60)), r = t >= 0 ? "+" : "-";
|
|
3529
3548
|
switch (e) {
|
|
3530
3549
|
case "short":
|
|
@@ -3591,11 +3610,11 @@ const mi = [
|
|
|
3591
3610
|
"Friday",
|
|
3592
3611
|
"Saturday",
|
|
3593
3612
|
"Sunday"
|
|
3594
|
-
], fi = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
|
|
3613
|
+
], fi = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], Vo = ["M", "T", "W", "T", "F", "S", "S"];
|
|
3595
3614
|
function hi(t) {
|
|
3596
3615
|
switch (t) {
|
|
3597
3616
|
case "narrow":
|
|
3598
|
-
return [...
|
|
3617
|
+
return [...Vo];
|
|
3599
3618
|
case "short":
|
|
3600
3619
|
return [...fi];
|
|
3601
3620
|
case "long":
|
|
@@ -3606,7 +3625,7 @@ function hi(t) {
|
|
|
3606
3625
|
return null;
|
|
3607
3626
|
}
|
|
3608
3627
|
}
|
|
3609
|
-
const yi = ["AM", "PM"],
|
|
3628
|
+
const yi = ["AM", "PM"], Bo = ["Before Christ", "Anno Domini"], Zo = ["BC", "AD"], zo = ["B", "A"];
|
|
3610
3629
|
function pi(t) {
|
|
3611
3630
|
switch (t) {
|
|
3612
3631
|
case "narrow":
|
|
@@ -3614,7 +3633,7 @@ function pi(t) {
|
|
|
3614
3633
|
case "short":
|
|
3615
3634
|
return [...Zo];
|
|
3616
3635
|
case "long":
|
|
3617
|
-
return [...
|
|
3636
|
+
return [...Bo];
|
|
3618
3637
|
default:
|
|
3619
3638
|
return null;
|
|
3620
3639
|
}
|
|
@@ -3663,7 +3682,7 @@ function Xn(t, e) {
|
|
|
3663
3682
|
return s;
|
|
3664
3683
|
}
|
|
3665
3684
|
const jo = {
|
|
3666
|
-
D:
|
|
3685
|
+
D: Ss,
|
|
3667
3686
|
DD: Rr,
|
|
3668
3687
|
DDD: Ur,
|
|
3669
3688
|
DDDD: Lr,
|
|
@@ -3671,8 +3690,8 @@ const jo = {
|
|
|
3671
3690
|
tt: $r,
|
|
3672
3691
|
ttt: Pr,
|
|
3673
3692
|
tttt: Wr,
|
|
3674
|
-
T:
|
|
3675
|
-
TT:
|
|
3693
|
+
T: Vr,
|
|
3694
|
+
TT: Br,
|
|
3676
3695
|
TTT: Zr,
|
|
3677
3696
|
TTTT: zr,
|
|
3678
3697
|
f: Hr,
|
|
@@ -3925,11 +3944,11 @@ class Ce {
|
|
|
3925
3944
|
}
|
|
3926
3945
|
}
|
|
3927
3946
|
const gi = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
|
|
3928
|
-
function
|
|
3947
|
+
function Ut(...t) {
|
|
3929
3948
|
const e = t.reduce((s, n) => s + n.source, "");
|
|
3930
3949
|
return RegExp(`^${e}$`);
|
|
3931
3950
|
}
|
|
3932
|
-
function
|
|
3951
|
+
function Lt(...t) {
|
|
3933
3952
|
return (e) => t.reduce(
|
|
3934
3953
|
([s, n, r], i) => {
|
|
3935
3954
|
const [a, o, l] = i(e, r);
|
|
@@ -3938,7 +3957,7 @@ function $t(...t) {
|
|
|
3938
3957
|
[{}, null, 1]
|
|
3939
3958
|
).slice(0, 2);
|
|
3940
3959
|
}
|
|
3941
|
-
function
|
|
3960
|
+
function Ft(t, ...e) {
|
|
3942
3961
|
if (t == null)
|
|
3943
3962
|
return [null, null];
|
|
3944
3963
|
for (const [s, n] of e) {
|
|
@@ -3957,49 +3976,49 @@ function Si(...t) {
|
|
|
3957
3976
|
return [n, null, s + r];
|
|
3958
3977
|
};
|
|
3959
3978
|
}
|
|
3960
|
-
const vi = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/, Jo = `(?:${vi.source}?(?:\\[(${gi.source})\\])?)?`,
|
|
3961
|
-
`${
|
|
3979
|
+
const vi = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/, Jo = `(?:${vi.source}?(?:\\[(${gi.source})\\])?)?`, gn = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/, wi = RegExp(`${gn.source}${Jo}`), Sn = RegExp(`(?:[Tt]${wi.source})?`), Ko = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/, Qo = /(\d{4})-?W(\d\d)(?:-?(\d))?/, Xo = /(\d{4})-?(\d{3})/, el = Si("weekYear", "weekNumber", "weekDay"), tl = Si("year", "ordinal"), sl = /(\d{4})-(\d\d)-(\d\d)/, Ai = RegExp(
|
|
3980
|
+
`${gn.source} ?(?:${vi.source}|(${gi.source}))?`
|
|
3962
3981
|
), nl = RegExp(`(?: ${Ai.source})?`);
|
|
3963
|
-
function
|
|
3982
|
+
function Ct(t, e, s) {
|
|
3964
3983
|
const n = t[e];
|
|
3965
3984
|
return $(n) ? s : ft(n);
|
|
3966
3985
|
}
|
|
3967
3986
|
function rl(t, e) {
|
|
3968
3987
|
return [{
|
|
3969
|
-
year:
|
|
3970
|
-
month:
|
|
3971
|
-
day:
|
|
3988
|
+
year: Ct(t, e),
|
|
3989
|
+
month: Ct(t, e + 1, 1),
|
|
3990
|
+
day: Ct(t, e + 2, 1)
|
|
3972
3991
|
}, null, e + 3];
|
|
3973
3992
|
}
|
|
3974
|
-
function
|
|
3993
|
+
function $t(t, e) {
|
|
3975
3994
|
return [{
|
|
3976
|
-
hours:
|
|
3977
|
-
minutes:
|
|
3978
|
-
seconds:
|
|
3979
|
-
milliseconds:
|
|
3995
|
+
hours: Ct(t, e, 0),
|
|
3996
|
+
minutes: Ct(t, e + 1, 0),
|
|
3997
|
+
seconds: Ct(t, e + 2, 0),
|
|
3998
|
+
milliseconds: yn(t[e + 3])
|
|
3980
3999
|
}, null, e + 4];
|
|
3981
4000
|
}
|
|
3982
|
-
function
|
|
3983
|
-
const s = !t[e] && !t[e + 1], n =
|
|
4001
|
+
function Xt(t, e) {
|
|
4002
|
+
const s = !t[e] && !t[e + 1], n = xs(t[e + 1], t[e + 2]), r = s ? null : We.instance(n);
|
|
3984
4003
|
return [{}, r, e + 3];
|
|
3985
4004
|
}
|
|
3986
|
-
function
|
|
4005
|
+
function es(t, e) {
|
|
3987
4006
|
const s = t[e] ? lt.create(t[e]) : null;
|
|
3988
4007
|
return [{}, s, e + 1];
|
|
3989
4008
|
}
|
|
3990
|
-
const il = RegExp(`^T?${
|
|
4009
|
+
const il = RegExp(`^T?${gn.source}$`), al = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;
|
|
3991
4010
|
function ol(t) {
|
|
3992
4011
|
const [e, s, n, r, i, a, o, l, u] = t, m = e[0] === "-", d = l && l[0] === "-", y = (p, v = !1) => p !== void 0 && (v || p && m) ? -p : p;
|
|
3993
4012
|
return [
|
|
3994
4013
|
{
|
|
3995
|
-
years: y(
|
|
3996
|
-
months: y(
|
|
3997
|
-
weeks: y(
|
|
3998
|
-
days: y(
|
|
3999
|
-
hours: y(
|
|
4000
|
-
minutes: y(
|
|
4001
|
-
seconds: y(
|
|
4002
|
-
milliseconds: y(
|
|
4014
|
+
years: y(gt(s)),
|
|
4015
|
+
months: y(gt(n)),
|
|
4016
|
+
weeks: y(gt(r)),
|
|
4017
|
+
days: y(gt(i)),
|
|
4018
|
+
hours: y(gt(a)),
|
|
4019
|
+
minutes: y(gt(o)),
|
|
4020
|
+
seconds: y(gt(l), l === "-0"),
|
|
4021
|
+
milliseconds: y(yn(u), d)
|
|
4003
4022
|
}
|
|
4004
4023
|
];
|
|
4005
4024
|
}
|
|
@@ -4014,9 +4033,9 @@ const ll = {
|
|
|
4014
4033
|
PDT: -420,
|
|
4015
4034
|
PST: -480
|
|
4016
4035
|
};
|
|
4017
|
-
function
|
|
4036
|
+
function vn(t, e, s, n, r, i, a) {
|
|
4018
4037
|
const o = {
|
|
4019
|
-
year: e.length === 2 ?
|
|
4038
|
+
year: e.length === 2 ? tn(ft(e)) : ft(e),
|
|
4020
4039
|
month: ui.indexOf(s) + 1,
|
|
4021
4040
|
day: ft(n),
|
|
4022
4041
|
hour: ft(r),
|
|
@@ -4039,9 +4058,9 @@ function ul(t) {
|
|
|
4039
4058
|
u,
|
|
4040
4059
|
m,
|
|
4041
4060
|
d
|
|
4042
|
-
] = t, y =
|
|
4061
|
+
] = t, y = vn(e, r, n, s, i, a, o);
|
|
4043
4062
|
let p;
|
|
4044
|
-
return l ? p = ll[l] : u ? p = 0 : p =
|
|
4063
|
+
return l ? p = ll[l] : u ? p = 0 : p = xs(m, d), [y, new We(p)];
|
|
4045
4064
|
}
|
|
4046
4065
|
function dl(t) {
|
|
4047
4066
|
return t.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
|
|
@@ -4049,34 +4068,34 @@ function dl(t) {
|
|
|
4049
4068
|
const ml = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, fl = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, hl = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;
|
|
4050
4069
|
function er(t) {
|
|
4051
4070
|
const [, e, s, n, r, i, a, o] = t;
|
|
4052
|
-
return [
|
|
4071
|
+
return [vn(e, r, n, s, i, a, o), We.utcInstance];
|
|
4053
4072
|
}
|
|
4054
4073
|
function yl(t) {
|
|
4055
4074
|
const [, e, s, n, r, i, a, o] = t;
|
|
4056
|
-
return [
|
|
4075
|
+
return [vn(e, o, s, n, r, i, a), We.utcInstance];
|
|
4057
4076
|
}
|
|
4058
|
-
const pl =
|
|
4077
|
+
const pl = Ut(Ko, Sn), gl = Ut(Qo, Sn), Sl = Ut(Xo, Sn), vl = Ut(wi), Ni = Lt(
|
|
4059
4078
|
rl,
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
), wl =
|
|
4079
|
+
$t,
|
|
4080
|
+
Xt,
|
|
4081
|
+
es
|
|
4082
|
+
), wl = Lt(
|
|
4064
4083
|
el,
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
), Al =
|
|
4084
|
+
$t,
|
|
4085
|
+
Xt,
|
|
4086
|
+
es
|
|
4087
|
+
), Al = Lt(
|
|
4069
4088
|
tl,
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
), Nl =
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4089
|
+
$t,
|
|
4090
|
+
Xt,
|
|
4091
|
+
es
|
|
4092
|
+
), Nl = Lt(
|
|
4093
|
+
$t,
|
|
4094
|
+
Xt,
|
|
4095
|
+
es
|
|
4077
4096
|
);
|
|
4078
4097
|
function Tl(t) {
|
|
4079
|
-
return
|
|
4098
|
+
return Ft(
|
|
4080
4099
|
t,
|
|
4081
4100
|
[pl, Ni],
|
|
4082
4101
|
[gl, wl],
|
|
@@ -4085,10 +4104,10 @@ function Tl(t) {
|
|
|
4085
4104
|
);
|
|
4086
4105
|
}
|
|
4087
4106
|
function bl(t) {
|
|
4088
|
-
return
|
|
4107
|
+
return Ft(dl(t), [cl, ul]);
|
|
4089
4108
|
}
|
|
4090
4109
|
function Il(t) {
|
|
4091
|
-
return
|
|
4110
|
+
return Ft(
|
|
4092
4111
|
t,
|
|
4093
4112
|
[ml, er],
|
|
4094
4113
|
[fl, er],
|
|
@@ -4096,21 +4115,21 @@ function Il(t) {
|
|
|
4096
4115
|
);
|
|
4097
4116
|
}
|
|
4098
4117
|
function kl(t) {
|
|
4099
|
-
return
|
|
4118
|
+
return Ft(t, [al, ol]);
|
|
4100
4119
|
}
|
|
4101
|
-
const xl = $t
|
|
4102
|
-
function
|
|
4103
|
-
return
|
|
4120
|
+
const xl = Lt($t);
|
|
4121
|
+
function El(t) {
|
|
4122
|
+
return Ft(t, [il, xl]);
|
|
4104
4123
|
}
|
|
4105
|
-
const
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4124
|
+
const Ol = Ut(sl, nl), Ml = Ut(Ai), Dl = Lt(
|
|
4125
|
+
$t,
|
|
4126
|
+
Xt,
|
|
4127
|
+
es
|
|
4109
4128
|
);
|
|
4110
4129
|
function Cl(t) {
|
|
4111
|
-
return
|
|
4130
|
+
return Ft(
|
|
4112
4131
|
t,
|
|
4113
|
-
[
|
|
4132
|
+
[Ol, Ni],
|
|
4114
4133
|
[Ml, Dl]
|
|
4115
4134
|
);
|
|
4116
4135
|
}
|
|
@@ -4160,7 +4179,7 @@ const tr = "Invalid Duration", Ti = {
|
|
|
4160
4179
|
milliseconds: 720 * 60 * 60 * 1e3
|
|
4161
4180
|
},
|
|
4162
4181
|
...Ti
|
|
4163
|
-
}, _e = 146097 / 400,
|
|
4182
|
+
}, _e = 146097 / 400, kt = 146097 / 4800, Ul = {
|
|
4164
4183
|
years: {
|
|
4165
4184
|
quarters: 4,
|
|
4166
4185
|
months: 12,
|
|
@@ -4181,15 +4200,15 @@ const tr = "Invalid Duration", Ti = {
|
|
|
4181
4200
|
milliseconds: _e * 24 * 60 * 60 * 1e3 / 4
|
|
4182
4201
|
},
|
|
4183
4202
|
months: {
|
|
4184
|
-
weeks:
|
|
4185
|
-
days:
|
|
4186
|
-
hours:
|
|
4187
|
-
minutes:
|
|
4188
|
-
seconds:
|
|
4189
|
-
milliseconds:
|
|
4203
|
+
weeks: kt / 7,
|
|
4204
|
+
days: kt,
|
|
4205
|
+
hours: kt * 24,
|
|
4206
|
+
minutes: kt * 24 * 60,
|
|
4207
|
+
seconds: kt * 24 * 60 * 60,
|
|
4208
|
+
milliseconds: kt * 24 * 60 * 60 * 1e3
|
|
4190
4209
|
},
|
|
4191
4210
|
...Ti
|
|
4192
|
-
},
|
|
4211
|
+
}, vt = [
|
|
4193
4212
|
"years",
|
|
4194
4213
|
"quarters",
|
|
4195
4214
|
"months",
|
|
@@ -4199,7 +4218,7 @@ const tr = "Invalid Duration", Ti = {
|
|
|
4199
4218
|
"minutes",
|
|
4200
4219
|
"seconds",
|
|
4201
4220
|
"milliseconds"
|
|
4202
|
-
], Ll =
|
|
4221
|
+
], Ll = vt.slice(0).reverse();
|
|
4203
4222
|
function at(t, e, s = !1) {
|
|
4204
4223
|
const n = {
|
|
4205
4224
|
values: s ? e.values : { ...t.values, ...e.values || {} },
|
|
@@ -4217,7 +4236,7 @@ function bi(t, e) {
|
|
|
4217
4236
|
}
|
|
4218
4237
|
function sr(t, e) {
|
|
4219
4238
|
const s = bi(t, e) < 0 ? -1 : 1;
|
|
4220
|
-
|
|
4239
|
+
vt.reduceRight((n, r) => {
|
|
4221
4240
|
if ($(e[r]))
|
|
4222
4241
|
return n;
|
|
4223
4242
|
if (n) {
|
|
@@ -4225,7 +4244,7 @@ function sr(t, e) {
|
|
|
4225
4244
|
e[r] += o * s, e[n] -= o * a * s;
|
|
4226
4245
|
}
|
|
4227
4246
|
return r;
|
|
4228
|
-
}, null),
|
|
4247
|
+
}, null), vt.reduce((n, r) => {
|
|
4229
4248
|
if ($(e[r]))
|
|
4230
4249
|
return n;
|
|
4231
4250
|
if (n) {
|
|
@@ -4288,7 +4307,7 @@ class X {
|
|
|
4288
4307
|
`Duration.fromObject: argument expected to be an object, got ${e === null ? "null" : typeof e}`
|
|
4289
4308
|
);
|
|
4290
4309
|
return new X({
|
|
4291
|
-
values:
|
|
4310
|
+
values: As(e, X.normalizeUnit),
|
|
4292
4311
|
loc: re.fromObject(s),
|
|
4293
4312
|
conversionAccuracy: s.conversionAccuracy,
|
|
4294
4313
|
matrix: s.matrix
|
|
@@ -4350,7 +4369,7 @@ class X {
|
|
|
4350
4369
|
* @return {Duration}
|
|
4351
4370
|
*/
|
|
4352
4371
|
static fromISOTime(e, s) {
|
|
4353
|
-
const [n] =
|
|
4372
|
+
const [n] = El(e);
|
|
4354
4373
|
return n ? X.fromObject(n, s) : X.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
|
|
4355
4374
|
}
|
|
4356
4375
|
/**
|
|
@@ -4468,7 +4487,7 @@ class X {
|
|
|
4468
4487
|
*/
|
|
4469
4488
|
toHuman(e = {}) {
|
|
4470
4489
|
if (!this.isValid) return tr;
|
|
4471
|
-
const s = e.showZeros !== !1, n =
|
|
4490
|
+
const s = e.showZeros !== !1, n = vt.map((r) => {
|
|
4472
4491
|
const i = this.values[r];
|
|
4473
4492
|
return $(i) || i === 0 && !s ? null : this.loc.numberFormatter({ style: "unit", unitDisplay: "long", ...e, unit: r.slice(0, -1) }).format(i);
|
|
4474
4493
|
}).filter((r) => r);
|
|
@@ -4495,7 +4514,7 @@ class X {
|
|
|
4495
4514
|
toISO() {
|
|
4496
4515
|
if (!this.isValid) return null;
|
|
4497
4516
|
let e = "P";
|
|
4498
|
-
return this.years !== 0 && (e += this.years + "Y"), (this.months !== 0 || this.quarters !== 0) && (e += this.months + this.quarters * 3 + "M"), this.weeks !== 0 && (e += this.weeks + "W"), this.days !== 0 && (e += this.days + "D"), (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) && (e += "T"), this.hours !== 0 && (e += this.hours + "H"), this.minutes !== 0 && (e += this.minutes + "M"), (this.seconds !== 0 || this.milliseconds !== 0) && (e +=
|
|
4517
|
+
return this.years !== 0 && (e += this.years + "Y"), (this.months !== 0 || this.quarters !== 0) && (e += this.months + this.quarters * 3 + "M"), this.weeks !== 0 && (e += this.weeks + "W"), this.days !== 0 && (e += this.days + "D"), (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) && (e += "T"), this.hours !== 0 && (e += this.hours + "H"), this.minutes !== 0 && (e += this.minutes + "M"), (this.seconds !== 0 || this.milliseconds !== 0) && (e += pn(this.seconds + this.milliseconds / 1e3, 3) + "S"), e === "P" && (e += "T0S"), e;
|
|
4499
4518
|
}
|
|
4500
4519
|
/**
|
|
4501
4520
|
* Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.
|
|
@@ -4568,8 +4587,8 @@ class X {
|
|
|
4568
4587
|
plus(e) {
|
|
4569
4588
|
if (!this.isValid) return this;
|
|
4570
4589
|
const s = X.fromDurationLike(e), n = {};
|
|
4571
|
-
for (const r of
|
|
4572
|
-
(
|
|
4590
|
+
for (const r of vt)
|
|
4591
|
+
(Rt(s.values, r) || Rt(this.values, r)) && (n[r] = s.get(r) + this.get(r));
|
|
4573
4592
|
return at(this, { values: n }, !0);
|
|
4574
4593
|
}
|
|
4575
4594
|
/**
|
|
@@ -4616,7 +4635,7 @@ class X {
|
|
|
4616
4635
|
*/
|
|
4617
4636
|
set(e) {
|
|
4618
4637
|
if (!this.isValid) return this;
|
|
4619
|
-
const s = { ...this.values, ...
|
|
4638
|
+
const s = { ...this.values, ...As(e, X.normalizeUnit) };
|
|
4620
4639
|
return at(this, { values: s });
|
|
4621
4640
|
}
|
|
4622
4641
|
/**
|
|
@@ -4681,7 +4700,7 @@ class X {
|
|
|
4681
4700
|
e = e.map((a) => X.normalizeUnit(a));
|
|
4682
4701
|
const s = {}, n = {}, r = this.toObject();
|
|
4683
4702
|
let i;
|
|
4684
|
-
for (const a of
|
|
4703
|
+
for (const a of vt)
|
|
4685
4704
|
if (e.indexOf(a) >= 0) {
|
|
4686
4705
|
i = a;
|
|
4687
4706
|
let o = 0;
|
|
@@ -4831,13 +4850,13 @@ class X {
|
|
|
4831
4850
|
function s(n, r) {
|
|
4832
4851
|
return n === void 0 || n === 0 ? r === void 0 || r === 0 : n === r;
|
|
4833
4852
|
}
|
|
4834
|
-
for (const n of
|
|
4853
|
+
for (const n of vt)
|
|
4835
4854
|
if (!s(this.values[n], e.values[n]))
|
|
4836
4855
|
return !1;
|
|
4837
4856
|
return !0;
|
|
4838
4857
|
}
|
|
4839
4858
|
}
|
|
4840
|
-
const
|
|
4859
|
+
const xt = "Invalid Interval";
|
|
4841
4860
|
function Fl(t, e) {
|
|
4842
4861
|
return !t || !t.isValid ? we.invalid("missing or invalid start") : !e || !e.isValid ? we.invalid("missing or invalid end") : e < t ? we.invalid(
|
|
4843
4862
|
"end before start",
|
|
@@ -4872,7 +4891,7 @@ class we {
|
|
|
4872
4891
|
* @return {Interval}
|
|
4873
4892
|
*/
|
|
4874
4893
|
static fromDateTimes(e, s) {
|
|
4875
|
-
const n =
|
|
4894
|
+
const n = Bt(e), r = Bt(s), i = Fl(n, r);
|
|
4876
4895
|
return i ?? new we({
|
|
4877
4896
|
start: n,
|
|
4878
4897
|
end: r
|
|
@@ -4885,7 +4904,7 @@ class we {
|
|
|
4885
4904
|
* @return {Interval}
|
|
4886
4905
|
*/
|
|
4887
4906
|
static after(e, s) {
|
|
4888
|
-
const n = X.fromDurationLike(s), r =
|
|
4907
|
+
const n = X.fromDurationLike(s), r = Bt(e);
|
|
4889
4908
|
return we.fromDateTimes(r, r.plus(n));
|
|
4890
4909
|
}
|
|
4891
4910
|
/**
|
|
@@ -4895,7 +4914,7 @@ class we {
|
|
|
4895
4914
|
* @return {Interval}
|
|
4896
4915
|
*/
|
|
4897
4916
|
static before(e, s) {
|
|
4898
|
-
const n = X.fromDurationLike(s), r =
|
|
4917
|
+
const n = X.fromDurationLike(s), r = Bt(e);
|
|
4899
4918
|
return we.fromDateTimes(r.minus(n), r);
|
|
4900
4919
|
}
|
|
4901
4920
|
/**
|
|
@@ -5065,7 +5084,7 @@ class we {
|
|
|
5065
5084
|
*/
|
|
5066
5085
|
splitAt(...e) {
|
|
5067
5086
|
if (!this.isValid) return [];
|
|
5068
|
-
const s = e.map(
|
|
5087
|
+
const s = e.map(Bt).filter((a) => this.contains(a)).sort((a, o) => a.toMillis() - o.toMillis()), n = [];
|
|
5069
5088
|
let { s: r } = this, i = 0;
|
|
5070
5089
|
for (; r < this.e; ) {
|
|
5071
5090
|
const a = s[i] || this.e, o = +a > +this.e ? this.e : a;
|
|
@@ -5206,7 +5225,7 @@ class we {
|
|
|
5206
5225
|
* @return {string}
|
|
5207
5226
|
*/
|
|
5208
5227
|
toString() {
|
|
5209
|
-
return this.isValid ? `[${this.s.toISO()} – ${this.e.toISO()})` :
|
|
5228
|
+
return this.isValid ? `[${this.s.toISO()} – ${this.e.toISO()})` : xt;
|
|
5210
5229
|
}
|
|
5211
5230
|
/**
|
|
5212
5231
|
* Returns a string representation of this Interval appropriate for the REPL.
|
|
@@ -5233,8 +5252,8 @@ class we {
|
|
|
5233
5252
|
* @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p
|
|
5234
5253
|
* @return {string}
|
|
5235
5254
|
*/
|
|
5236
|
-
toLocaleString(e =
|
|
5237
|
-
return this.isValid ? Ce.create(this.s.loc.clone(s), e).formatInterval(this) :
|
|
5255
|
+
toLocaleString(e = Ss, s = {}) {
|
|
5256
|
+
return this.isValid ? Ce.create(this.s.loc.clone(s), e).formatInterval(this) : xt;
|
|
5238
5257
|
}
|
|
5239
5258
|
/**
|
|
5240
5259
|
* Returns an ISO 8601-compliant string representation of this Interval.
|
|
@@ -5243,7 +5262,7 @@ class we {
|
|
|
5243
5262
|
* @return {string}
|
|
5244
5263
|
*/
|
|
5245
5264
|
toISO(e) {
|
|
5246
|
-
return this.isValid ? `${this.s.toISO(e)}/${this.e.toISO(e)}` :
|
|
5265
|
+
return this.isValid ? `${this.s.toISO(e)}/${this.e.toISO(e)}` : xt;
|
|
5247
5266
|
}
|
|
5248
5267
|
/**
|
|
5249
5268
|
* Returns an ISO 8601-compliant string representation of date of this Interval.
|
|
@@ -5252,7 +5271,7 @@ class we {
|
|
|
5252
5271
|
* @return {string}
|
|
5253
5272
|
*/
|
|
5254
5273
|
toISODate() {
|
|
5255
|
-
return this.isValid ? `${this.s.toISODate()}/${this.e.toISODate()}` :
|
|
5274
|
+
return this.isValid ? `${this.s.toISODate()}/${this.e.toISODate()}` : xt;
|
|
5256
5275
|
}
|
|
5257
5276
|
/**
|
|
5258
5277
|
* Returns an ISO 8601-compliant string representation of time of this Interval.
|
|
@@ -5262,7 +5281,7 @@ class we {
|
|
|
5262
5281
|
* @return {string}
|
|
5263
5282
|
*/
|
|
5264
5283
|
toISOTime(e) {
|
|
5265
|
-
return this.isValid ? `${this.s.toISOTime(e)}/${this.e.toISOTime(e)}` :
|
|
5284
|
+
return this.isValid ? `${this.s.toISOTime(e)}/${this.e.toISOTime(e)}` : xt;
|
|
5266
5285
|
}
|
|
5267
5286
|
/**
|
|
5268
5287
|
* Returns a string representation of this Interval formatted according to the specified format
|
|
@@ -5276,7 +5295,7 @@ class we {
|
|
|
5276
5295
|
* @return {string}
|
|
5277
5296
|
*/
|
|
5278
5297
|
toFormat(e, { separator: s = " – " } = {}) {
|
|
5279
|
-
return this.isValid ? `${this.s.toFormat(e)}${s}${this.e.toFormat(e)}` :
|
|
5298
|
+
return this.isValid ? `${this.s.toFormat(e)}${s}${this.e.toFormat(e)}` : xt;
|
|
5280
5299
|
}
|
|
5281
5300
|
/**
|
|
5282
5301
|
* Return a Duration representing the time spanned by this interval.
|
|
@@ -5304,7 +5323,7 @@ class we {
|
|
|
5304
5323
|
return we.fromDateTimes(e(this.s), e(this.e));
|
|
5305
5324
|
}
|
|
5306
5325
|
}
|
|
5307
|
-
class
|
|
5326
|
+
class cs {
|
|
5308
5327
|
/**
|
|
5309
5328
|
* Return whether the specified zone contains a DST.
|
|
5310
5329
|
* @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.
|
|
@@ -5509,10 +5528,10 @@ function Pl(t, e, s, n) {
|
|
|
5509
5528
|
}
|
|
5510
5529
|
const Wl = "missing Intl.DateTimeFormat.formatToParts support";
|
|
5511
5530
|
function ee(t, e = (s) => s) {
|
|
5512
|
-
return { regex: t, deser: ([s]) => e(
|
|
5531
|
+
return { regex: t, deser: ([s]) => e(Oo(s)) };
|
|
5513
5532
|
}
|
|
5514
|
-
const
|
|
5515
|
-
function
|
|
5533
|
+
const Vl = " ", Ii = `[ ${Vl}]`, ki = new RegExp(Ii, "g");
|
|
5534
|
+
function Bl(t) {
|
|
5516
5535
|
return t.replace(/\./g, "\\.?").replace(ki, Ii);
|
|
5517
5536
|
}
|
|
5518
5537
|
function ir(t) {
|
|
@@ -5520,21 +5539,21 @@ function ir(t) {
|
|
|
5520
5539
|
}
|
|
5521
5540
|
function Xe(t, e) {
|
|
5522
5541
|
return t === null ? null : {
|
|
5523
|
-
regex: RegExp(t.map(
|
|
5542
|
+
regex: RegExp(t.map(Bl).join("|")),
|
|
5524
5543
|
deser: ([s]) => t.findIndex((n) => ir(s) === ir(n)) + e
|
|
5525
5544
|
};
|
|
5526
5545
|
}
|
|
5527
5546
|
function ar(t, e) {
|
|
5528
|
-
return { regex: t, deser: ([, s, n]) =>
|
|
5547
|
+
return { regex: t, deser: ([, s, n]) => xs(s, n), groups: e };
|
|
5529
5548
|
}
|
|
5530
|
-
function
|
|
5549
|
+
function us(t) {
|
|
5531
5550
|
return { regex: t, deser: ([e]) => e };
|
|
5532
5551
|
}
|
|
5533
5552
|
function Zl(t) {
|
|
5534
5553
|
return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
|
5535
5554
|
}
|
|
5536
5555
|
function zl(t, e) {
|
|
5537
|
-
const s = Qe(e), n = Qe(e, "{2}"), r = Qe(e, "{3}"), i = Qe(e, "{4}"), a = Qe(e, "{6}"), o = Qe(e, "{1,2}"), l = Qe(e, "{1,3}"), u = Qe(e, "{1,6}"), m = Qe(e, "{1,9}"), d = Qe(e, "{2,4}"), y = Qe(e, "{4,6}"), p = (b) => ({ regex: RegExp(Zl(b.val)), deser: ([
|
|
5556
|
+
const s = Qe(e), n = Qe(e, "{2}"), r = Qe(e, "{3}"), i = Qe(e, "{4}"), a = Qe(e, "{6}"), o = Qe(e, "{1,2}"), l = Qe(e, "{1,3}"), u = Qe(e, "{1,6}"), m = Qe(e, "{1,9}"), d = Qe(e, "{2,4}"), y = Qe(e, "{4,6}"), p = (b) => ({ regex: RegExp(Zl(b.val)), deser: ([B]) => B, literal: !0 }), k = ((b) => {
|
|
5538
5557
|
if (t.literal)
|
|
5539
5558
|
return p(b);
|
|
5540
5559
|
switch (b.val) {
|
|
@@ -5547,7 +5566,7 @@ function zl(t, e) {
|
|
|
5547
5566
|
case "y":
|
|
5548
5567
|
return ee(u);
|
|
5549
5568
|
case "yy":
|
|
5550
|
-
return ee(d,
|
|
5569
|
+
return ee(d, tn);
|
|
5551
5570
|
case "yyyy":
|
|
5552
5571
|
return ee(i);
|
|
5553
5572
|
case "yyyyy":
|
|
@@ -5607,9 +5626,9 @@ function zl(t, e) {
|
|
|
5607
5626
|
case "SSS":
|
|
5608
5627
|
return ee(r);
|
|
5609
5628
|
case "u":
|
|
5610
|
-
return
|
|
5629
|
+
return us(m);
|
|
5611
5630
|
case "uu":
|
|
5612
|
-
return
|
|
5631
|
+
return us(o);
|
|
5613
5632
|
case "uuu":
|
|
5614
5633
|
return ee(s);
|
|
5615
5634
|
// meridiem
|
|
@@ -5619,7 +5638,7 @@ function zl(t, e) {
|
|
|
5619
5638
|
case "kkkk":
|
|
5620
5639
|
return ee(i);
|
|
5621
5640
|
case "kk":
|
|
5622
|
-
return ee(d,
|
|
5641
|
+
return ee(d, tn);
|
|
5623
5642
|
// weekNumber (W)
|
|
5624
5643
|
case "W":
|
|
5625
5644
|
return ee(o);
|
|
@@ -5646,11 +5665,11 @@ function zl(t, e) {
|
|
|
5646
5665
|
// we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing
|
|
5647
5666
|
// because we don't have any way to figure out what they are
|
|
5648
5667
|
case "z":
|
|
5649
|
-
return
|
|
5668
|
+
return us(/[a-z_+-/]{1,256}?/i);
|
|
5650
5669
|
// this special-case "token" represents a place where a macro-token expanded into a white-space literal
|
|
5651
5670
|
// in this case we accept any non-newline white-space
|
|
5652
5671
|
case " ":
|
|
5653
|
-
return
|
|
5672
|
+
return us(/[^\S\n\r]/);
|
|
5654
5673
|
default:
|
|
5655
5674
|
return p(b);
|
|
5656
5675
|
}
|
|
@@ -5729,7 +5748,7 @@ function Yl(t, e, s) {
|
|
|
5729
5748
|
const r = {};
|
|
5730
5749
|
let i = 1;
|
|
5731
5750
|
for (const a in s)
|
|
5732
|
-
if (
|
|
5751
|
+
if (Rt(s, a)) {
|
|
5733
5752
|
const o = s[a], l = o.groups ? o.groups + 1 : 1;
|
|
5734
5753
|
!o.literal && o.token && (r[o.token.val[0]] = o.deser(n.slice(i, i + l))), i += l;
|
|
5735
5754
|
}
|
|
@@ -5772,14 +5791,14 @@ function _l(t) {
|
|
|
5772
5791
|
}
|
|
5773
5792
|
};
|
|
5774
5793
|
let s = null, n;
|
|
5775
|
-
return $(t.z) || (s = lt.create(t.z)), $(t.Z) || (s || (s = new
|
|
5794
|
+
return $(t.z) || (s = lt.create(t.z)), $(t.Z) || (s || (s = new We(t.Z)), n = t.Z), $(t.q) || (t.M = (t.q - 1) * 3 + 1), $(t.h) || (t.h < 12 && t.a === 1 ? t.h += 12 : t.h === 12 && t.a === 0 && (t.h = 0)), t.G === 0 && t.y && (t.y = -t.y), $(t.u) || (t.S = yn(t.u)), [Object.keys(t).reduce((i, a) => {
|
|
5776
5795
|
const o = e(a);
|
|
5777
5796
|
return o && (i[o] = t[a]), i;
|
|
5778
5797
|
}, {}), s, n];
|
|
5779
5798
|
}
|
|
5780
|
-
let
|
|
5799
|
+
let $s = null;
|
|
5781
5800
|
function jl() {
|
|
5782
|
-
return
|
|
5801
|
+
return $s || ($s = F.fromMillis(1555555555555)), $s;
|
|
5783
5802
|
}
|
|
5784
5803
|
function Jl(t, e) {
|
|
5785
5804
|
if (t.literal)
|
|
@@ -5790,7 +5809,7 @@ function Jl(t, e) {
|
|
|
5790
5809
|
function xi(t, e) {
|
|
5791
5810
|
return Array.prototype.concat(...t.map((s) => Jl(s, e)));
|
|
5792
5811
|
}
|
|
5793
|
-
class
|
|
5812
|
+
class Ei {
|
|
5794
5813
|
constructor(e, s) {
|
|
5795
5814
|
if (this.locale = e, this.format = s, this.tokens = xi(Ce.parseFormat(s), e), this.units = this.tokens.map((n) => zl(n, e)), this.disqualifyingUnit = this.units.find((n) => n.invalidReason), !this.disqualifyingUnit) {
|
|
5796
5815
|
const [n, r] = ql(this.units);
|
|
@@ -5800,8 +5819,8 @@ class Oi {
|
|
|
5800
5819
|
explainFromTokens(e) {
|
|
5801
5820
|
if (this.isValid) {
|
|
5802
5821
|
const [s, n] = Yl(e, this.regex, this.handlers), [r, i, a] = n ? _l(n) : [null, null, void 0];
|
|
5803
|
-
if (
|
|
5804
|
-
throw new
|
|
5822
|
+
if (Rt(n, "a") && Rt(n, "H"))
|
|
5823
|
+
throw new Mt(
|
|
5805
5824
|
"Can't include meridiem when specifying 24-hour format"
|
|
5806
5825
|
);
|
|
5807
5826
|
return {
|
|
@@ -5824,11 +5843,11 @@ class Oi {
|
|
|
5824
5843
|
return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;
|
|
5825
5844
|
}
|
|
5826
5845
|
}
|
|
5827
|
-
function
|
|
5828
|
-
return new
|
|
5846
|
+
function Oi(t, e, s) {
|
|
5847
|
+
return new Ei(t, s).explainFromTokens(e);
|
|
5829
5848
|
}
|
|
5830
5849
|
function Kl(t, e, s) {
|
|
5831
|
-
const { result: n, zone: r, specificOffset: i, invalidReason: a } =
|
|
5850
|
+
const { result: n, zone: r, specificOffset: i, invalidReason: a } = Oi(t, e, s);
|
|
5832
5851
|
return [n, r, i, a];
|
|
5833
5852
|
}
|
|
5834
5853
|
function Mi(t, e) {
|
|
@@ -5837,21 +5856,21 @@ function Mi(t, e) {
|
|
|
5837
5856
|
const n = Ce.create(e, t).dtFormatter(jl()), r = n.formatToParts(), i = n.resolvedOptions();
|
|
5838
5857
|
return r.map((a) => Gl(a, t, i));
|
|
5839
5858
|
}
|
|
5840
|
-
const
|
|
5841
|
-
function
|
|
5859
|
+
const Ps = "Invalid DateTime", or = 864e13;
|
|
5860
|
+
function Gt(t) {
|
|
5842
5861
|
return new et("unsupported zone", `the zone "${t.name}" is not supported`);
|
|
5843
5862
|
}
|
|
5844
|
-
function
|
|
5845
|
-
return t.weekData === null && (t.weekData =
|
|
5863
|
+
function Ws(t) {
|
|
5864
|
+
return t.weekData === null && (t.weekData = vs(t.c)), t.weekData;
|
|
5846
5865
|
}
|
|
5847
5866
|
function Vs(t) {
|
|
5848
|
-
return t.localWeekData === null && (t.localWeekData =
|
|
5867
|
+
return t.localWeekData === null && (t.localWeekData = vs(
|
|
5849
5868
|
t.c,
|
|
5850
5869
|
t.loc.getMinDaysInFirstWeek(),
|
|
5851
5870
|
t.loc.getStartOfWeek()
|
|
5852
5871
|
)), t.localWeekData;
|
|
5853
5872
|
}
|
|
5854
|
-
function
|
|
5873
|
+
function St(t, e) {
|
|
5855
5874
|
const s = {
|
|
5856
5875
|
ts: t.ts,
|
|
5857
5876
|
zone: t.zone,
|
|
@@ -5871,7 +5890,7 @@ function Di(t, e, s) {
|
|
|
5871
5890
|
const i = s.offset(n);
|
|
5872
5891
|
return r === i ? [n, r] : [t - Math.min(r, i) * 60 * 1e3, Math.max(r, i)];
|
|
5873
5892
|
}
|
|
5874
|
-
function
|
|
5893
|
+
function ds(t, e) {
|
|
5875
5894
|
t += e * 60 * 1e3;
|
|
5876
5895
|
const s = new Date(t);
|
|
5877
5896
|
return {
|
|
@@ -5884,15 +5903,15 @@ function ms(t, e) {
|
|
|
5884
5903
|
millisecond: s.getUTCMilliseconds()
|
|
5885
5904
|
};
|
|
5886
5905
|
}
|
|
5887
|
-
function
|
|
5888
|
-
return Di(
|
|
5906
|
+
function ys(t, e, s) {
|
|
5907
|
+
return Di(ks(t), e, s);
|
|
5889
5908
|
}
|
|
5890
5909
|
function lr(t, e) {
|
|
5891
5910
|
const s = t.o, n = t.c.year + Math.trunc(e.years), r = t.c.month + Math.trunc(e.months) + Math.trunc(e.quarters) * 3, i = {
|
|
5892
5911
|
...t.c,
|
|
5893
5912
|
year: n,
|
|
5894
5913
|
month: r,
|
|
5895
|
-
day: Math.min(t.c.day,
|
|
5914
|
+
day: Math.min(t.c.day, ws(n, r)) + Math.trunc(e.days) + Math.trunc(e.weeks) * 7
|
|
5896
5915
|
}, a = X.fromObject({
|
|
5897
5916
|
years: e.years - Math.trunc(e.years),
|
|
5898
5917
|
quarters: e.quarters - Math.trunc(e.quarters),
|
|
@@ -5903,11 +5922,11 @@ function lr(t, e) {
|
|
|
5903
5922
|
minutes: e.minutes,
|
|
5904
5923
|
seconds: e.seconds,
|
|
5905
5924
|
milliseconds: e.milliseconds
|
|
5906
|
-
}).as("milliseconds"), o =
|
|
5925
|
+
}).as("milliseconds"), o = ks(i);
|
|
5907
5926
|
let [l, u] = Di(o, s, t.zone);
|
|
5908
5927
|
return a !== 0 && (l += a, u = t.zone.offset(l)), { ts: l, o: u };
|
|
5909
5928
|
}
|
|
5910
|
-
function
|
|
5929
|
+
function Et(t, e, s, n, r, i) {
|
|
5911
5930
|
const { setZone: a, zone: o } = s;
|
|
5912
5931
|
if (t && Object.keys(t).length !== 0 || e) {
|
|
5913
5932
|
const l = e || o, u = F.fromObject(t, {
|
|
@@ -5921,13 +5940,13 @@ function Mt(t, e, s, n, r, i) {
|
|
|
5921
5940
|
new et("unparsable", `the input "${r}" can't be parsed as ${n}`)
|
|
5922
5941
|
);
|
|
5923
5942
|
}
|
|
5924
|
-
function
|
|
5943
|
+
function ms(t, e, s = !0) {
|
|
5925
5944
|
return t.isValid ? Ce.create(re.create("en-US"), {
|
|
5926
5945
|
allowZ: s,
|
|
5927
5946
|
forceSimple: !0
|
|
5928
5947
|
}).formatDateTimeFromString(t, e) : null;
|
|
5929
5948
|
}
|
|
5930
|
-
function
|
|
5949
|
+
function Bs(t, e, s) {
|
|
5931
5950
|
const n = t.c.year > 9999 || t.c.year < 0;
|
|
5932
5951
|
let r = "";
|
|
5933
5952
|
if (n && t.c.year >= 0 && (r += "+"), r += Te(t.c.year, n ? 6 : 4), s === "year") return r;
|
|
@@ -5978,7 +5997,7 @@ const Ci = {
|
|
|
5978
5997
|
minute: 0,
|
|
5979
5998
|
second: 0,
|
|
5980
5999
|
millisecond: 0
|
|
5981
|
-
},
|
|
6000
|
+
}, ps = ["year", "month", "day", "hour", "minute", "second", "millisecond"], ec = [
|
|
5982
6001
|
"weekYear",
|
|
5983
6002
|
"weekNumber",
|
|
5984
6003
|
"weekday",
|
|
@@ -5987,7 +6006,7 @@ const Ci = {
|
|
|
5987
6006
|
"second",
|
|
5988
6007
|
"millisecond"
|
|
5989
6008
|
], tc = ["year", "ordinal", "hour", "minute", "second", "millisecond"];
|
|
5990
|
-
function
|
|
6009
|
+
function gs(t) {
|
|
5991
6010
|
const e = {
|
|
5992
6011
|
year: "year",
|
|
5993
6012
|
years: "year",
|
|
@@ -6029,37 +6048,37 @@ function ur(t) {
|
|
|
6029
6048
|
case "localweekyears":
|
|
6030
6049
|
return "localWeekYear";
|
|
6031
6050
|
default:
|
|
6032
|
-
return
|
|
6051
|
+
return gs(t);
|
|
6033
6052
|
}
|
|
6034
6053
|
}
|
|
6035
6054
|
function sc(t) {
|
|
6036
|
-
if (
|
|
6037
|
-
return t.offset(
|
|
6055
|
+
if (qt === void 0 && (qt = Ae.now()), t.type !== "iana")
|
|
6056
|
+
return t.offset(qt);
|
|
6038
6057
|
const e = t.name;
|
|
6039
|
-
let s =
|
|
6040
|
-
return s === void 0 && (s = t.offset(
|
|
6058
|
+
let s = sn.get(e);
|
|
6059
|
+
return s === void 0 && (s = t.offset(qt), sn.set(e, s)), s;
|
|
6041
6060
|
}
|
|
6042
6061
|
function dr(t, e) {
|
|
6043
6062
|
const s = ht(e.zone, Ae.defaultZone);
|
|
6044
6063
|
if (!s.isValid)
|
|
6045
|
-
return F.invalid(
|
|
6064
|
+
return F.invalid(Gt(s));
|
|
6046
6065
|
const n = re.fromObject(e);
|
|
6047
6066
|
let r, i;
|
|
6048
6067
|
if ($(t.year))
|
|
6049
6068
|
r = Ae.now();
|
|
6050
6069
|
else {
|
|
6051
|
-
for (const l of
|
|
6070
|
+
for (const l of ps)
|
|
6052
6071
|
$(t[l]) && (t[l] = Ci[l]);
|
|
6053
6072
|
const a = ri(t) || ii(t);
|
|
6054
6073
|
if (a)
|
|
6055
6074
|
return F.invalid(a);
|
|
6056
6075
|
const o = sc(s);
|
|
6057
|
-
[r, i] =
|
|
6076
|
+
[r, i] = ys(t, o, s);
|
|
6058
6077
|
}
|
|
6059
6078
|
return new F({ ts: r, zone: s, loc: n, o: i });
|
|
6060
6079
|
}
|
|
6061
6080
|
function mr(t, e, s) {
|
|
6062
|
-
const n = $(s.round) ? !0 : s.round, r = $(s.rounding) ? "trunc" : s.rounding, i = (o, l) => (o =
|
|
6081
|
+
const n = $(s.round) ? !0 : s.round, r = $(s.rounding) ? "trunc" : s.rounding, i = (o, l) => (o = pn(o, n || s.calendary ? 0 : 2, s.calendary ? "round" : r), e.loc.clone(s).relFormatter(s).format(o, l)), a = (o) => s.calendary ? e.hasSame(t, o) ? 0 : e.startOf(o).diff(t.startOf(o), o).get(o) : e.diff(t, o).get(o);
|
|
6063
6082
|
if (s.unit)
|
|
6064
6083
|
return i(a(s.unit), s.unit);
|
|
6065
6084
|
for (const o of s.units) {
|
|
@@ -6073,15 +6092,15 @@ function fr(t) {
|
|
|
6073
6092
|
let e = {}, s;
|
|
6074
6093
|
return t.length > 0 && typeof t[t.length - 1] == "object" ? (e = t[t.length - 1], s = Array.from(t).slice(0, t.length - 1)) : s = Array.from(t), [e, s];
|
|
6075
6094
|
}
|
|
6076
|
-
let
|
|
6077
|
-
const
|
|
6095
|
+
let qt;
|
|
6096
|
+
const sn = /* @__PURE__ */ new Map();
|
|
6078
6097
|
class F {
|
|
6079
6098
|
/**
|
|
6080
6099
|
* @access private
|
|
6081
6100
|
*/
|
|
6082
6101
|
constructor(e) {
|
|
6083
6102
|
const s = e.zone || Ae.defaultZone;
|
|
6084
|
-
let n = e.invalid || (Number.isNaN(e.ts) ? new et("invalid input") : null) || (s.isValid ? null :
|
|
6103
|
+
let n = e.invalid || (Number.isNaN(e.ts) ? new et("invalid input") : null) || (s.isValid ? null : Gt(s));
|
|
6085
6104
|
this.ts = $(e.ts) ? Ae.now() : e.ts;
|
|
6086
6105
|
let r = null, i = null;
|
|
6087
6106
|
if (!n)
|
|
@@ -6089,7 +6108,7 @@ class F {
|
|
|
6089
6108
|
[r, i] = [e.old.c, e.old.o];
|
|
6090
6109
|
else {
|
|
6091
6110
|
const o = yt(e.o) && !e.old ? e.o : s.offset(this.ts);
|
|
6092
|
-
r =
|
|
6111
|
+
r = ds(this.ts, o), n = Number.isNaN(r.year) ? new et("invalid input") : null, r = n ? null : r, i = n ? null : o;
|
|
6093
6112
|
}
|
|
6094
6113
|
this._zone = s, this.loc = e.loc || re.create(), this.invalid = n, this.weekData = null, this.localWeekData = null, this.c = r, this.o = i, this.isLuxonDateTime = !0;
|
|
6095
6114
|
}
|
|
@@ -6156,7 +6175,7 @@ class F {
|
|
|
6156
6175
|
*/
|
|
6157
6176
|
static utc() {
|
|
6158
6177
|
const [e, s] = fr(arguments), [n, r, i, a, o, l, u] = s;
|
|
6159
|
-
return e.zone =
|
|
6178
|
+
return e.zone = We.utcInstance, dr({ year: n, month: r, day: i, hour: a, minute: o, second: l, millisecond: u }, e);
|
|
6160
6179
|
}
|
|
6161
6180
|
/**
|
|
6162
6181
|
* Create a DateTime from a JavaScript Date object. Uses the default zone.
|
|
@@ -6174,7 +6193,7 @@ class F {
|
|
|
6174
6193
|
ts: n,
|
|
6175
6194
|
zone: r,
|
|
6176
6195
|
loc: re.fromObject(s)
|
|
6177
|
-
}) : F.invalid(
|
|
6196
|
+
}) : F.invalid(Gt(r));
|
|
6178
6197
|
}
|
|
6179
6198
|
/**
|
|
6180
6199
|
* Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.
|
|
@@ -6255,26 +6274,26 @@ class F {
|
|
|
6255
6274
|
e = e || {};
|
|
6256
6275
|
const n = ht(s.zone, Ae.defaultZone);
|
|
6257
6276
|
if (!n.isValid)
|
|
6258
|
-
return F.invalid(
|
|
6259
|
-
const r = re.fromObject(s), i =
|
|
6277
|
+
return F.invalid(Gt(n));
|
|
6278
|
+
const r = re.fromObject(s), i = As(e, ur), { minDaysInFirstWeek: a, startOfWeek: o } = Jn(i, r), l = Ae.now(), u = $(s.specificOffset) ? n.offset(l) : s.specificOffset, m = !$(i.ordinal), d = !$(i.year), y = !$(i.month) || !$(i.day), p = d || y, v = i.weekYear || i.weekNumber;
|
|
6260
6279
|
if ((p || m) && v)
|
|
6261
|
-
throw new
|
|
6280
|
+
throw new Mt(
|
|
6262
6281
|
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
|
|
6263
6282
|
);
|
|
6264
6283
|
if (y && m)
|
|
6265
|
-
throw new
|
|
6284
|
+
throw new Mt("Can't mix ordinal dates with month/day");
|
|
6266
6285
|
const k = v || i.weekday && !p;
|
|
6267
|
-
let b,
|
|
6268
|
-
k ? (b = ec,
|
|
6286
|
+
let b, B, q = ds(l, u);
|
|
6287
|
+
k ? (b = ec, B = Ql, q = vs(q, a, o)) : m ? (b = tc, B = Xl, q = Fs(q)) : (b = ps, B = Ci);
|
|
6269
6288
|
let Q = !1;
|
|
6270
6289
|
for (const g of b) {
|
|
6271
6290
|
const M = i[g];
|
|
6272
|
-
$(M) ? Q ? i[g] =
|
|
6291
|
+
$(M) ? Q ? i[g] = B[g] : i[g] = q[g] : Q = !0;
|
|
6273
6292
|
}
|
|
6274
6293
|
const x = k ? Do(i, a, o) : m ? Co(i) : ri(i), C = x || ii(i);
|
|
6275
6294
|
if (C)
|
|
6276
6295
|
return F.invalid(C);
|
|
6277
|
-
const Z = k ? _n(i, a, o) : m ? jn(i) : i, [R, G] =
|
|
6296
|
+
const Z = k ? _n(i, a, o) : m ? jn(i) : i, [R, G] = ys(Z, u, n), h = new F({
|
|
6278
6297
|
ts: R,
|
|
6279
6298
|
zone: n,
|
|
6280
6299
|
o: G,
|
|
@@ -6304,7 +6323,7 @@ class F {
|
|
|
6304
6323
|
*/
|
|
6305
6324
|
static fromISO(e, s = {}) {
|
|
6306
6325
|
const [n, r] = Tl(e);
|
|
6307
|
-
return
|
|
6326
|
+
return Et(n, r, s, "ISO 8601", e);
|
|
6308
6327
|
}
|
|
6309
6328
|
/**
|
|
6310
6329
|
* Create a DateTime from an RFC 2822 string
|
|
@@ -6323,7 +6342,7 @@ class F {
|
|
|
6323
6342
|
*/
|
|
6324
6343
|
static fromRFC2822(e, s = {}) {
|
|
6325
6344
|
const [n, r] = bl(e);
|
|
6326
|
-
return
|
|
6345
|
+
return Et(n, r, s, "RFC 2822", e);
|
|
6327
6346
|
}
|
|
6328
6347
|
/**
|
|
6329
6348
|
* Create a DateTime from an HTTP header date
|
|
@@ -6343,7 +6362,7 @@ class F {
|
|
|
6343
6362
|
*/
|
|
6344
6363
|
static fromHTTP(e, s = {}) {
|
|
6345
6364
|
const [n, r] = Il(e);
|
|
6346
|
-
return
|
|
6365
|
+
return Et(n, r, s, "HTTP", s);
|
|
6347
6366
|
}
|
|
6348
6367
|
/**
|
|
6349
6368
|
* Create a DateTime from an input string and format string.
|
|
@@ -6367,7 +6386,7 @@ class F {
|
|
|
6367
6386
|
numberingSystem: i,
|
|
6368
6387
|
defaultToEN: !0
|
|
6369
6388
|
}), [o, l, u, m] = Kl(a, e, s);
|
|
6370
|
-
return m ? F.invalid(m) :
|
|
6389
|
+
return m ? F.invalid(m) : Et(o, l, n, `format ${s}`, e, u);
|
|
6371
6390
|
}
|
|
6372
6391
|
/**
|
|
6373
6392
|
* @deprecated use fromFormat instead
|
|
@@ -6398,7 +6417,7 @@ class F {
|
|
|
6398
6417
|
*/
|
|
6399
6418
|
static fromSQL(e, s = {}) {
|
|
6400
6419
|
const [n, r] = Cl(e);
|
|
6401
|
-
return
|
|
6420
|
+
return Et(n, r, s, "SQL", e);
|
|
6402
6421
|
}
|
|
6403
6422
|
/**
|
|
6404
6423
|
* Create an invalid DateTime.
|
|
@@ -6443,7 +6462,7 @@ class F {
|
|
|
6443
6462
|
return xi(Ce.parseFormat(e), re.fromObject(s)).map((r) => r.val).join("");
|
|
6444
6463
|
}
|
|
6445
6464
|
static resetCache() {
|
|
6446
|
-
|
|
6465
|
+
qt = void 0, sn.clear();
|
|
6447
6466
|
}
|
|
6448
6467
|
// INFO
|
|
6449
6468
|
/**
|
|
@@ -6588,7 +6607,7 @@ class F {
|
|
|
6588
6607
|
* @type {number}
|
|
6589
6608
|
*/
|
|
6590
6609
|
get weekYear() {
|
|
6591
|
-
return this.isValid ?
|
|
6610
|
+
return this.isValid ? Ws(this).weekYear : NaN;
|
|
6592
6611
|
}
|
|
6593
6612
|
/**
|
|
6594
6613
|
* Get the week number of the week year (1-52ish).
|
|
@@ -6597,7 +6616,7 @@ class F {
|
|
|
6597
6616
|
* @type {number}
|
|
6598
6617
|
*/
|
|
6599
6618
|
get weekNumber() {
|
|
6600
|
-
return this.isValid ?
|
|
6619
|
+
return this.isValid ? Ws(this).weekNumber : NaN;
|
|
6601
6620
|
}
|
|
6602
6621
|
/**
|
|
6603
6622
|
* Get the day of the week.
|
|
@@ -6607,7 +6626,7 @@ class F {
|
|
|
6607
6626
|
* @type {number}
|
|
6608
6627
|
*/
|
|
6609
6628
|
get weekday() {
|
|
6610
|
-
return this.isValid ?
|
|
6629
|
+
return this.isValid ? Ws(this).weekday : NaN;
|
|
6611
6630
|
}
|
|
6612
6631
|
/**
|
|
6613
6632
|
* Returns true if this date is on a weekend according to the locale, false otherwise
|
|
@@ -6648,7 +6667,7 @@ class F {
|
|
|
6648
6667
|
* @type {number|DateTime}
|
|
6649
6668
|
*/
|
|
6650
6669
|
get ordinal() {
|
|
6651
|
-
return this.isValid ?
|
|
6670
|
+
return this.isValid ? Fs(this.c).ordinal : NaN;
|
|
6652
6671
|
}
|
|
6653
6672
|
/**
|
|
6654
6673
|
* Get the human readable short month name, such as 'Oct'.
|
|
@@ -6657,7 +6676,7 @@ class F {
|
|
|
6657
6676
|
* @type {string}
|
|
6658
6677
|
*/
|
|
6659
6678
|
get monthShort() {
|
|
6660
|
-
return this.isValid ?
|
|
6679
|
+
return this.isValid ? cs.months("short", { locObj: this.loc })[this.month - 1] : null;
|
|
6661
6680
|
}
|
|
6662
6681
|
/**
|
|
6663
6682
|
* Get the human readable long month name, such as 'October'.
|
|
@@ -6666,7 +6685,7 @@ class F {
|
|
|
6666
6685
|
* @type {string}
|
|
6667
6686
|
*/
|
|
6668
6687
|
get monthLong() {
|
|
6669
|
-
return this.isValid ?
|
|
6688
|
+
return this.isValid ? cs.months("long", { locObj: this.loc })[this.month - 1] : null;
|
|
6670
6689
|
}
|
|
6671
6690
|
/**
|
|
6672
6691
|
* Get the human readable short weekday, such as 'Mon'.
|
|
@@ -6675,7 +6694,7 @@ class F {
|
|
|
6675
6694
|
* @type {string}
|
|
6676
6695
|
*/
|
|
6677
6696
|
get weekdayShort() {
|
|
6678
|
-
return this.isValid ?
|
|
6697
|
+
return this.isValid ? cs.weekdays("short", { locObj: this.loc })[this.weekday - 1] : null;
|
|
6679
6698
|
}
|
|
6680
6699
|
/**
|
|
6681
6700
|
* Get the human readable long weekday, such as 'Monday'.
|
|
@@ -6684,7 +6703,7 @@ class F {
|
|
|
6684
6703
|
* @type {string}
|
|
6685
6704
|
*/
|
|
6686
6705
|
get weekdayLong() {
|
|
6687
|
-
return this.isValid ?
|
|
6706
|
+
return this.isValid ? cs.weekdays("long", { locObj: this.loc })[this.weekday - 1] : null;
|
|
6688
6707
|
}
|
|
6689
6708
|
/**
|
|
6690
6709
|
* Get the UTC offset of this DateTime in minutes
|
|
@@ -6741,11 +6760,11 @@ class F {
|
|
|
6741
6760
|
getPossibleOffsets() {
|
|
6742
6761
|
if (!this.isValid || this.isOffsetFixed)
|
|
6743
6762
|
return [this];
|
|
6744
|
-
const e = 864e5, s = 6e4, n =
|
|
6763
|
+
const e = 864e5, s = 6e4, n = ks(this.c), r = this.zone.offset(n - e), i = this.zone.offset(n + e), a = this.zone.offset(n - r * s), o = this.zone.offset(n - i * s);
|
|
6745
6764
|
if (a === o)
|
|
6746
6765
|
return [this];
|
|
6747
|
-
const l = n - a * s, u = n - o * s, m =
|
|
6748
|
-
return m.hour === d.hour && m.minute === d.minute && m.second === d.second && m.millisecond === d.millisecond ? [
|
|
6766
|
+
const l = n - a * s, u = n - o * s, m = ds(l, a), d = ds(u, o);
|
|
6767
|
+
return m.hour === d.hour && m.minute === d.minute && m.second === d.second && m.millisecond === d.millisecond ? [St(this, { ts: l }), St(this, { ts: u })] : [this];
|
|
6749
6768
|
}
|
|
6750
6769
|
/**
|
|
6751
6770
|
* Returns true if this DateTime is in a leap year, false otherwise
|
|
@@ -6754,7 +6773,7 @@ class F {
|
|
|
6754
6773
|
* @type {boolean}
|
|
6755
6774
|
*/
|
|
6756
6775
|
get isInLeapYear() {
|
|
6757
|
-
return
|
|
6776
|
+
return Qt(this.year);
|
|
6758
6777
|
}
|
|
6759
6778
|
/**
|
|
6760
6779
|
* Returns the number of days in this DateTime's month
|
|
@@ -6763,7 +6782,7 @@ class F {
|
|
|
6763
6782
|
* @type {number}
|
|
6764
6783
|
*/
|
|
6765
6784
|
get daysInMonth() {
|
|
6766
|
-
return
|
|
6785
|
+
return ws(this.year, this.month);
|
|
6767
6786
|
}
|
|
6768
6787
|
/**
|
|
6769
6788
|
* Returns the number of days in this DateTime's year
|
|
@@ -6772,7 +6791,7 @@ class F {
|
|
|
6772
6791
|
* @type {number}
|
|
6773
6792
|
*/
|
|
6774
6793
|
get daysInYear() {
|
|
6775
|
-
return this.isValid ?
|
|
6794
|
+
return this.isValid ? Dt(this.year) : NaN;
|
|
6776
6795
|
}
|
|
6777
6796
|
/**
|
|
6778
6797
|
* Returns the number of weeks in this DateTime's year
|
|
@@ -6782,7 +6801,7 @@ class F {
|
|
|
6782
6801
|
* @type {number}
|
|
6783
6802
|
*/
|
|
6784
6803
|
get weeksInWeekYear() {
|
|
6785
|
-
return this.isValid ?
|
|
6804
|
+
return this.isValid ? _t(this.weekYear) : NaN;
|
|
6786
6805
|
}
|
|
6787
6806
|
/**
|
|
6788
6807
|
* Returns the number of weeks in this DateTime's local week year
|
|
@@ -6791,7 +6810,7 @@ class F {
|
|
|
6791
6810
|
* @type {number}
|
|
6792
6811
|
*/
|
|
6793
6812
|
get weeksInLocalWeekYear() {
|
|
6794
|
-
return this.isValid ?
|
|
6813
|
+
return this.isValid ? _t(
|
|
6795
6814
|
this.localWeekYear,
|
|
6796
6815
|
this.loc.getMinDaysInFirstWeek(),
|
|
6797
6816
|
this.loc.getStartOfWeek()
|
|
@@ -6820,7 +6839,7 @@ class F {
|
|
|
6820
6839
|
* @return {DateTime}
|
|
6821
6840
|
*/
|
|
6822
6841
|
toUTC(e = 0, s = {}) {
|
|
6823
|
-
return this.setZone(
|
|
6842
|
+
return this.setZone(We.instance(e), s);
|
|
6824
6843
|
}
|
|
6825
6844
|
/**
|
|
6826
6845
|
* "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.
|
|
@@ -6847,11 +6866,11 @@ class F {
|
|
|
6847
6866
|
let r = this.ts;
|
|
6848
6867
|
if (s || n) {
|
|
6849
6868
|
const i = e.offset(this.ts), a = this.toObject();
|
|
6850
|
-
[r] =
|
|
6869
|
+
[r] = ys(a, i, e);
|
|
6851
6870
|
}
|
|
6852
|
-
return
|
|
6871
|
+
return St(this, { ts: r, zone: e });
|
|
6853
6872
|
} else
|
|
6854
|
-
return F.invalid(
|
|
6873
|
+
return F.invalid(Gt(e));
|
|
6855
6874
|
}
|
|
6856
6875
|
/**
|
|
6857
6876
|
* "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.
|
|
@@ -6861,7 +6880,7 @@ class F {
|
|
|
6861
6880
|
*/
|
|
6862
6881
|
reconfigure({ locale: e, numberingSystem: s, outputCalendar: n } = {}) {
|
|
6863
6882
|
const r = this.loc.clone({ locale: e, numberingSystem: s, outputCalendar: n });
|
|
6864
|
-
return
|
|
6883
|
+
return St(this, { loc: r });
|
|
6865
6884
|
}
|
|
6866
6885
|
/**
|
|
6867
6886
|
* "Set" the locale. Returns a newly-constructed DateTime.
|
|
@@ -6887,21 +6906,21 @@ class F {
|
|
|
6887
6906
|
*/
|
|
6888
6907
|
set(e) {
|
|
6889
6908
|
if (!this.isValid) return this;
|
|
6890
|
-
const s =
|
|
6909
|
+
const s = As(e, ur), { minDaysInFirstWeek: n, startOfWeek: r } = Jn(s, this.loc), i = !$(s.weekYear) || !$(s.weekNumber) || !$(s.weekday), a = !$(s.ordinal), o = !$(s.year), l = !$(s.month) || !$(s.day), u = o || l, m = s.weekYear || s.weekNumber;
|
|
6891
6910
|
if ((u || a) && m)
|
|
6892
|
-
throw new
|
|
6911
|
+
throw new Mt(
|
|
6893
6912
|
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
|
|
6894
6913
|
);
|
|
6895
6914
|
if (l && a)
|
|
6896
|
-
throw new
|
|
6915
|
+
throw new Mt("Can't mix ordinal dates with month/day");
|
|
6897
6916
|
let d;
|
|
6898
6917
|
i ? d = _n(
|
|
6899
|
-
{ ...
|
|
6918
|
+
{ ...vs(this.c, n, r), ...s },
|
|
6900
6919
|
n,
|
|
6901
6920
|
r
|
|
6902
|
-
) : $(s.ordinal) ? (d = { ...this.toObject(), ...s }, $(s.day) && (d.day = Math.min(
|
|
6903
|
-
const [y, p] =
|
|
6904
|
-
return
|
|
6921
|
+
) : $(s.ordinal) ? (d = { ...this.toObject(), ...s }, $(s.day) && (d.day = Math.min(ws(d.year, d.month), d.day))) : d = jn({ ...Fs(this.c), ...s });
|
|
6922
|
+
const [y, p] = ys(d, this.o, this.zone);
|
|
6923
|
+
return St(this, { ts: y, o: p });
|
|
6905
6924
|
}
|
|
6906
6925
|
/**
|
|
6907
6926
|
* Add a period of time to this DateTime and return the resulting DateTime
|
|
@@ -6919,7 +6938,7 @@ class F {
|
|
|
6919
6938
|
plus(e) {
|
|
6920
6939
|
if (!this.isValid) return this;
|
|
6921
6940
|
const s = X.fromDurationLike(e);
|
|
6922
|
-
return
|
|
6941
|
+
return St(this, lr(this, s));
|
|
6923
6942
|
}
|
|
6924
6943
|
/**
|
|
6925
6944
|
* Subtract a period of time to this DateTime and return the resulting DateTime
|
|
@@ -6930,7 +6949,7 @@ class F {
|
|
|
6930
6949
|
minus(e) {
|
|
6931
6950
|
if (!this.isValid) return this;
|
|
6932
6951
|
const s = X.fromDurationLike(e).negate();
|
|
6933
|
-
return
|
|
6952
|
+
return St(this, lr(this, s));
|
|
6934
6953
|
}
|
|
6935
6954
|
/**
|
|
6936
6955
|
* "Set" this DateTime to the beginning of a unit of time.
|
|
@@ -7010,7 +7029,7 @@ class F {
|
|
|
7010
7029
|
* @return {string}
|
|
7011
7030
|
*/
|
|
7012
7031
|
toFormat(e, s = {}) {
|
|
7013
|
-
return this.isValid ? Ce.create(this.loc.redefaultToEN(s)).formatDateTimeFromString(this, e) :
|
|
7032
|
+
return this.isValid ? Ce.create(this.loc.redefaultToEN(s)).formatDateTimeFromString(this, e) : Ps;
|
|
7014
7033
|
}
|
|
7015
7034
|
/**
|
|
7016
7035
|
* Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.
|
|
@@ -7031,8 +7050,8 @@ class F {
|
|
|
7031
7050
|
* @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'
|
|
7032
7051
|
* @return {string}
|
|
7033
7052
|
*/
|
|
7034
|
-
toLocaleString(e =
|
|
7035
|
-
return this.isValid ? Ce.create(this.loc.clone(s), e).formatDateTime(this) :
|
|
7053
|
+
toLocaleString(e = Ss, s = {}) {
|
|
7054
|
+
return this.isValid ? Ce.create(this.loc.clone(s), e).formatDateTime(this) : Ps;
|
|
7036
7055
|
}
|
|
7037
7056
|
/**
|
|
7038
7057
|
* Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.
|
|
@@ -7077,10 +7096,10 @@ class F {
|
|
|
7077
7096
|
} = {}) {
|
|
7078
7097
|
if (!this.isValid)
|
|
7079
7098
|
return null;
|
|
7080
|
-
a =
|
|
7099
|
+
a = gs(a);
|
|
7081
7100
|
const o = e === "extended";
|
|
7082
|
-
let l =
|
|
7083
|
-
return
|
|
7101
|
+
let l = Bs(this, o, a);
|
|
7102
|
+
return ps.indexOf(a) >= 3 && (l += "T"), l += cr(
|
|
7084
7103
|
this,
|
|
7085
7104
|
o,
|
|
7086
7105
|
s,
|
|
@@ -7101,7 +7120,7 @@ class F {
|
|
|
7101
7120
|
* @return {string|null}
|
|
7102
7121
|
*/
|
|
7103
7122
|
toISODate({ format: e = "extended", precision: s = "day" } = {}) {
|
|
7104
|
-
return this.isValid ?
|
|
7123
|
+
return this.isValid ? Bs(this, e === "extended", gs(s)) : null;
|
|
7105
7124
|
}
|
|
7106
7125
|
/**
|
|
7107
7126
|
* Returns an ISO 8601-compliant string representation of this DateTime's week date
|
|
@@ -7109,7 +7128,7 @@ class F {
|
|
|
7109
7128
|
* @return {string}
|
|
7110
7129
|
*/
|
|
7111
7130
|
toISOWeekDate() {
|
|
7112
|
-
return
|
|
7131
|
+
return ms(this, "kkkk-'W'WW-c");
|
|
7113
7132
|
}
|
|
7114
7133
|
/**
|
|
7115
7134
|
* Returns an ISO 8601-compliant string representation of this DateTime's time component
|
|
@@ -7137,7 +7156,7 @@ class F {
|
|
|
7137
7156
|
format: a = "extended",
|
|
7138
7157
|
precision: o = "milliseconds"
|
|
7139
7158
|
} = {}) {
|
|
7140
|
-
return this.isValid ? (o =
|
|
7159
|
+
return this.isValid ? (o = gs(o), (r && ps.indexOf(o) >= 3 ? "T" : "") + cr(
|
|
7141
7160
|
this,
|
|
7142
7161
|
a === "extended",
|
|
7143
7162
|
s,
|
|
@@ -7154,7 +7173,7 @@ class F {
|
|
|
7154
7173
|
* @return {string}
|
|
7155
7174
|
*/
|
|
7156
7175
|
toRFC2822() {
|
|
7157
|
-
return
|
|
7176
|
+
return ms(this, "EEE, dd LLL yyyy HH:mm:ss ZZZ", !1);
|
|
7158
7177
|
}
|
|
7159
7178
|
/**
|
|
7160
7179
|
* Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.
|
|
@@ -7165,7 +7184,7 @@ class F {
|
|
|
7165
7184
|
* @return {string}
|
|
7166
7185
|
*/
|
|
7167
7186
|
toHTTP() {
|
|
7168
|
-
return
|
|
7187
|
+
return ms(this.toUTC(), "EEE, dd LLL yyyy HH:mm:ss 'GMT'");
|
|
7169
7188
|
}
|
|
7170
7189
|
/**
|
|
7171
7190
|
* Returns a string representation of this DateTime appropriate for use in SQL Date
|
|
@@ -7173,7 +7192,7 @@ class F {
|
|
|
7173
7192
|
* @return {string|null}
|
|
7174
7193
|
*/
|
|
7175
7194
|
toSQLDate() {
|
|
7176
|
-
return this.isValid ?
|
|
7195
|
+
return this.isValid ? Bs(this, !0) : null;
|
|
7177
7196
|
}
|
|
7178
7197
|
/**
|
|
7179
7198
|
* Returns a string representation of this DateTime appropriate for use in SQL Time
|
|
@@ -7189,7 +7208,7 @@ class F {
|
|
|
7189
7208
|
*/
|
|
7190
7209
|
toSQLTime({ includeOffset: e = !0, includeZone: s = !1, includeOffsetSpace: n = !0 } = {}) {
|
|
7191
7210
|
let r = "HH:mm:ss.SSS";
|
|
7192
|
-
return (s || e) && (n && (r += " "), s ? r += "z" : e && (r += "ZZ")),
|
|
7211
|
+
return (s || e) && (n && (r += " "), s ? r += "z" : e && (r += "ZZ")), ms(this, r, !0);
|
|
7193
7212
|
}
|
|
7194
7213
|
/**
|
|
7195
7214
|
* Returns a string representation of this DateTime appropriate for use in SQL DateTime
|
|
@@ -7211,7 +7230,7 @@ class F {
|
|
|
7211
7230
|
* @return {string}
|
|
7212
7231
|
*/
|
|
7213
7232
|
toString() {
|
|
7214
|
-
return this.isValid ? this.toISO() :
|
|
7233
|
+
return this.isValid ? this.toISO() : Ps;
|
|
7215
7234
|
}
|
|
7216
7235
|
/**
|
|
7217
7236
|
* Returns a string representation of this DateTime appropriate for the REPL.
|
|
@@ -7433,7 +7452,7 @@ class F {
|
|
|
7433
7452
|
numberingSystem: i,
|
|
7434
7453
|
defaultToEN: !0
|
|
7435
7454
|
});
|
|
7436
|
-
return
|
|
7455
|
+
return Oi(a, e, s);
|
|
7437
7456
|
}
|
|
7438
7457
|
/**
|
|
7439
7458
|
* @deprecated use fromFormatExplain instead
|
|
@@ -7459,7 +7478,7 @@ class F {
|
|
|
7459
7478
|
numberingSystem: r,
|
|
7460
7479
|
defaultToEN: !0
|
|
7461
7480
|
});
|
|
7462
|
-
return new
|
|
7481
|
+
return new Ei(i, e);
|
|
7463
7482
|
}
|
|
7464
7483
|
/**
|
|
7465
7484
|
* Create a DateTime from an input string and format parser.
|
|
@@ -7486,7 +7505,7 @@ class F {
|
|
|
7486
7505
|
`fromFormatParser called with a locale of ${a}, but the format parser was created for ${s.locale}`
|
|
7487
7506
|
);
|
|
7488
7507
|
const { result: o, zone: l, specificOffset: u, invalidReason: m } = s.explainFromTokens(e);
|
|
7489
|
-
return m ? F.invalid(m) :
|
|
7508
|
+
return m ? F.invalid(m) : Et(
|
|
7490
7509
|
o,
|
|
7491
7510
|
l,
|
|
7492
7511
|
n,
|
|
@@ -7501,7 +7520,7 @@ class F {
|
|
|
7501
7520
|
* @type {Object}
|
|
7502
7521
|
*/
|
|
7503
7522
|
static get DATE_SHORT() {
|
|
7504
|
-
return
|
|
7523
|
+
return Ss;
|
|
7505
7524
|
}
|
|
7506
7525
|
/**
|
|
7507
7526
|
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983'
|
|
@@ -7564,14 +7583,14 @@ class F {
|
|
|
7564
7583
|
* @type {Object}
|
|
7565
7584
|
*/
|
|
7566
7585
|
static get TIME_24_SIMPLE() {
|
|
7567
|
-
return
|
|
7586
|
+
return Vr;
|
|
7568
7587
|
}
|
|
7569
7588
|
/**
|
|
7570
7589
|
* {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.
|
|
7571
7590
|
* @type {Object}
|
|
7572
7591
|
*/
|
|
7573
7592
|
static get TIME_24_WITH_SECONDS() {
|
|
7574
|
-
return
|
|
7593
|
+
return Br;
|
|
7575
7594
|
}
|
|
7576
7595
|
/**
|
|
7577
7596
|
* {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.
|
|
@@ -7651,7 +7670,7 @@ class F {
|
|
|
7651
7670
|
return Kr;
|
|
7652
7671
|
}
|
|
7653
7672
|
}
|
|
7654
|
-
function
|
|
7673
|
+
function Bt(t) {
|
|
7655
7674
|
if (F.isDateTime(t))
|
|
7656
7675
|
return t;
|
|
7657
7676
|
if (t && t.valueOf && yt(t.valueOf()))
|
|
@@ -7688,7 +7707,7 @@ function ic(t) {
|
|
|
7688
7707
|
return "-";
|
|
7689
7708
|
}
|
|
7690
7709
|
}
|
|
7691
|
-
function
|
|
7710
|
+
function jt(t, e = "UTC", s = !1) {
|
|
7692
7711
|
if (!t) return "-";
|
|
7693
7712
|
const n = F.fromISO(t, { zone: "utc" }).setZone(e);
|
|
7694
7713
|
if (!n.isValid) return "-";
|
|
@@ -7729,14 +7748,14 @@ function lc({
|
|
|
7729
7748
|
modifiedBy: 0
|
|
7730
7749
|
});
|
|
7731
7750
|
if (b?.responseStatus || b?.Success) {
|
|
7732
|
-
const
|
|
7733
|
-
|
|
7751
|
+
const B = b?.Message || b?.data || "Alert reopened successfully.";
|
|
7752
|
+
Ee.success(B);
|
|
7734
7753
|
} else {
|
|
7735
|
-
const
|
|
7736
|
-
|
|
7754
|
+
const B = b?.errorMessage || b?.Message || "Failed to reopen alert";
|
|
7755
|
+
Ee.error(B);
|
|
7737
7756
|
}
|
|
7738
7757
|
} catch {
|
|
7739
|
-
|
|
7758
|
+
Ee.error("Failed to reopen alert. Please try again.");
|
|
7740
7759
|
}
|
|
7741
7760
|
}, p = [
|
|
7742
7761
|
{
|
|
@@ -7745,7 +7764,7 @@ function lc({
|
|
|
7745
7764
|
key: "priority",
|
|
7746
7765
|
width: 120,
|
|
7747
7766
|
render: (k) => /* @__PURE__ */ c(
|
|
7748
|
-
|
|
7767
|
+
wt,
|
|
7749
7768
|
{
|
|
7750
7769
|
className: "px-[10px] py-[2px]",
|
|
7751
7770
|
style: {
|
|
@@ -7777,8 +7796,8 @@ function lc({
|
|
|
7777
7796
|
/* @__PURE__ */ c(
|
|
7778
7797
|
"a",
|
|
7779
7798
|
{
|
|
7780
|
-
onClick: (
|
|
7781
|
-
|
|
7799
|
+
onClick: (B) => {
|
|
7800
|
+
B.preventDefault(), i?.(b, { sourceTab: "archived" });
|
|
7782
7801
|
},
|
|
7783
7802
|
className: "inline-block mb-1 text-blue-600",
|
|
7784
7803
|
children: b.alertNumber
|
|
@@ -7792,7 +7811,7 @@ function lc({
|
|
|
7792
7811
|
key: "preview",
|
|
7793
7812
|
width: 100,
|
|
7794
7813
|
align: "center",
|
|
7795
|
-
render: (k, b) => /* @__PURE__ */ c(
|
|
7814
|
+
render: (k, b) => /* @__PURE__ */ c(Or, { record: b })
|
|
7796
7815
|
},
|
|
7797
7816
|
{
|
|
7798
7817
|
title: "",
|
|
@@ -7800,13 +7819,13 @@ function lc({
|
|
|
7800
7819
|
width: 60,
|
|
7801
7820
|
align: "right",
|
|
7802
7821
|
render: (k, b) => /* @__PURE__ */ c(
|
|
7803
|
-
|
|
7822
|
+
Vi,
|
|
7804
7823
|
{
|
|
7805
7824
|
trigger: ["click"],
|
|
7806
7825
|
menu: {
|
|
7807
7826
|
items: [{ key: "reopen", label: "Reopen" }],
|
|
7808
|
-
onClick: ({ key:
|
|
7809
|
-
|
|
7827
|
+
onClick: ({ key: B }) => {
|
|
7828
|
+
B === "reopen" && y(b);
|
|
7810
7829
|
}
|
|
7811
7830
|
},
|
|
7812
7831
|
children: /* @__PURE__ */ c(ze, { type: "text", icon: /* @__PURE__ */ c(Yi, {}) })
|
|
@@ -7814,8 +7833,8 @@ function lc({
|
|
|
7814
7833
|
)
|
|
7815
7834
|
}
|
|
7816
7835
|
], v = o ? t : (t || []).filter((k) => {
|
|
7817
|
-
const b =
|
|
7818
|
-
return no.some((
|
|
7836
|
+
const b = On(k.statusType || "");
|
|
7837
|
+
return no.some((B) => b.includes(On(B)));
|
|
7819
7838
|
});
|
|
7820
7839
|
return /* @__PURE__ */ c(
|
|
7821
7840
|
Mr,
|
|
@@ -7865,7 +7884,7 @@ function cc({
|
|
|
7865
7884
|
"aria-label": "Analog Clock",
|
|
7866
7885
|
children: [
|
|
7867
7886
|
[...Array(12)].map((m, d) => {
|
|
7868
|
-
const y = d * 30, p = 6, v = u - 4, k = v - p, b = (y - 90) * (Math.PI / 180),
|
|
7887
|
+
const y = d * 30, p = 6, v = u - 4, k = v - p, b = (y - 90) * (Math.PI / 180), B = u + k * Math.cos(b), q = u + k * Math.sin(b), Q = u + v * Math.cos(b), x = u + v * Math.sin(b);
|
|
7869
7888
|
return /* @__PURE__ */ c(
|
|
7870
7889
|
"svg",
|
|
7871
7890
|
{
|
|
@@ -7875,7 +7894,7 @@ function cc({
|
|
|
7875
7894
|
children: /* @__PURE__ */ c(
|
|
7876
7895
|
"line",
|
|
7877
7896
|
{
|
|
7878
|
-
x1:
|
|
7897
|
+
x1: B,
|
|
7879
7898
|
y1: q,
|
|
7880
7899
|
x2: Q,
|
|
7881
7900
|
y2: x,
|
|
@@ -7989,13 +8008,13 @@ function uc({ label: t = "USA", timeZone: e = "America/New_York", updateInterval
|
|
|
7989
8008
|
] })
|
|
7990
8009
|
] });
|
|
7991
8010
|
}
|
|
7992
|
-
const { Text: dc } =
|
|
8011
|
+
const { Text: dc } = Jt;
|
|
7993
8012
|
function mc({ sortBy: t, onChange: e, showActions: s, onSave: n, onClear: r, saving: i }) {
|
|
7994
8013
|
return /* @__PURE__ */ f(Ze, { gutter: [16, 16], align: "middle", children: [
|
|
7995
8014
|
/* @__PURE__ */ c(K, { xs: 24, md: 8, lg: 5, children: /* @__PURE__ */ f(st, { className: "w-full items-center", direction: "horizontal", size: 12, children: [
|
|
7996
8015
|
/* @__PURE__ */ c(dc, { className: "text-gray-600 whitespace-nowrap", children: "Sort By:" }),
|
|
7997
8016
|
/* @__PURE__ */ c(
|
|
7998
|
-
|
|
8017
|
+
Pe,
|
|
7999
8018
|
{
|
|
8000
8019
|
placeholder: "By Severity",
|
|
8001
8020
|
value: t,
|
|
@@ -8015,12 +8034,12 @@ function mc({ sortBy: t, onChange: e, showActions: s, onSave: n, onClear: r, sav
|
|
|
8015
8034
|
] }) : null })
|
|
8016
8035
|
] });
|
|
8017
8036
|
}
|
|
8018
|
-
const
|
|
8037
|
+
const nn = (t) => /* @__PURE__ */ f(wt, { children: [
|
|
8019
8038
|
/* @__PURE__ */ c(_i, {}),
|
|
8020
8039
|
" ",
|
|
8021
8040
|
t.length,
|
|
8022
8041
|
" more"
|
|
8023
|
-
] }), { Text: ot } =
|
|
8042
|
+
] }), { Text: ot } = Jt;
|
|
8024
8043
|
function fc(t) {
|
|
8025
8044
|
const {
|
|
8026
8045
|
// escBasis, setEscBasis,
|
|
@@ -8041,7 +8060,7 @@ function fc(t) {
|
|
|
8041
8060
|
l3mins: v,
|
|
8042
8061
|
setL3mins: k,
|
|
8043
8062
|
l3role: b,
|
|
8044
|
-
setL3role:
|
|
8063
|
+
setL3role: B,
|
|
8045
8064
|
actions: q,
|
|
8046
8065
|
setActions: Q,
|
|
8047
8066
|
thirdPartyIds: x,
|
|
@@ -8053,19 +8072,19 @@ function fc(t) {
|
|
|
8053
8072
|
onClear: g,
|
|
8054
8073
|
onSave: M,
|
|
8055
8074
|
saving: ie,
|
|
8056
|
-
onActionTypesLoaded:
|
|
8057
|
-
} = t, { rules:
|
|
8075
|
+
onActionTypesLoaded: ye
|
|
8076
|
+
} = t, { rules: O, config: N } = Ge(), A = N.tenant === "schools", [E, T] = S([]), [D, L] = S([]), [_, Y] = S(!1);
|
|
8058
8077
|
oe(() => {
|
|
8059
8078
|
let te = !1;
|
|
8060
8079
|
return (async () => {
|
|
8061
8080
|
try {
|
|
8062
8081
|
Y(!0);
|
|
8063
|
-
const Se = await
|
|
8082
|
+
const Se = await O.getLookups();
|
|
8064
8083
|
if (te || !Se || !Array.isArray(Se.actionTypes)) return;
|
|
8065
8084
|
const ke = Se.actionTypes.map((P) => ({ label: P.name, value: String(P.actionTypeId) }));
|
|
8066
|
-
T(ke),
|
|
8067
|
-
const
|
|
8068
|
-
L(
|
|
8085
|
+
T(ke), ye && ye(Se.actionTypes);
|
|
8086
|
+
const pe = Array.isArray(Se.thirdParties) ? Se.thirdParties.map((P) => ({ label: P.thirdPartyName, value: P.thirdPartyIds ?? P.thirdPartyId })) : [];
|
|
8087
|
+
L(pe);
|
|
8069
8088
|
} catch (Se) {
|
|
8070
8089
|
console.error("Error loading lookups", Se);
|
|
8071
8090
|
} finally {
|
|
@@ -8075,13 +8094,13 @@ function fc(t) {
|
|
|
8075
8094
|
te = !0;
|
|
8076
8095
|
};
|
|
8077
8096
|
}, []);
|
|
8078
|
-
const j = typeof a == "number" || typeof l == "number",
|
|
8079
|
-
return /* @__PURE__ */ f(
|
|
8097
|
+
const j = typeof a == "number" || typeof l == "number", ce = typeof m == "number" || typeof y == "number", me = typeof a == "number" || typeof l == "number" || typeof m == "number" || typeof y == "number" || typeof v == "number" || typeof b == "number" || Array.isArray(q) && q.length > 0 || Array.isArray(x) && x.length > 0 || !!Z || !!G;
|
|
8098
|
+
return /* @__PURE__ */ f(Ns, { spinning: !!ie || _, children: [
|
|
8080
8099
|
/* @__PURE__ */ f(Ze, { gutter: [16, 16], align: "bottom", children: [
|
|
8081
8100
|
/* @__PURE__ */ c(K, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ f("div", { children: [
|
|
8082
8101
|
/* @__PURE__ */ c(ot, { className: "text-gray-700 font-medium block mb-1", children: "Rules" }),
|
|
8083
8102
|
/* @__PURE__ */ c(
|
|
8084
|
-
|
|
8103
|
+
Pe,
|
|
8085
8104
|
{
|
|
8086
8105
|
placeholder: "Rules",
|
|
8087
8106
|
value: e,
|
|
@@ -8098,7 +8117,7 @@ function fc(t) {
|
|
|
8098
8117
|
] }),
|
|
8099
8118
|
/* @__PURE__ */ f(Ze, { gutter: 8, children: [
|
|
8100
8119
|
/* @__PURE__ */ c(K, { span: 10, children: /* @__PURE__ */ c(
|
|
8101
|
-
|
|
8120
|
+
Pe,
|
|
8102
8121
|
{
|
|
8103
8122
|
className: "w-full",
|
|
8104
8123
|
placeholder: "Mins",
|
|
@@ -8108,7 +8127,7 @@ function fc(t) {
|
|
|
8108
8127
|
}
|
|
8109
8128
|
) }),
|
|
8110
8129
|
/* @__PURE__ */ c(K, { span: 14, children: /* @__PURE__ */ c(
|
|
8111
|
-
|
|
8130
|
+
Pe,
|
|
8112
8131
|
{
|
|
8113
8132
|
placeholder: "Escalate to",
|
|
8114
8133
|
className: "w-full",
|
|
@@ -8126,7 +8145,7 @@ function fc(t) {
|
|
|
8126
8145
|
] }),
|
|
8127
8146
|
/* @__PURE__ */ f(Ze, { gutter: 8, children: [
|
|
8128
8147
|
/* @__PURE__ */ c(K, { span: 10, children: /* @__PURE__ */ c(
|
|
8129
|
-
|
|
8148
|
+
Pe,
|
|
8130
8149
|
{
|
|
8131
8150
|
className: "w-full",
|
|
8132
8151
|
placeholder: "Mins",
|
|
@@ -8136,7 +8155,7 @@ function fc(t) {
|
|
|
8136
8155
|
}
|
|
8137
8156
|
) }),
|
|
8138
8157
|
/* @__PURE__ */ c(K, { span: 14, children: /* @__PURE__ */ c(
|
|
8139
|
-
|
|
8158
|
+
Pe,
|
|
8140
8159
|
{
|
|
8141
8160
|
placeholder: "Escalate to",
|
|
8142
8161
|
className: "w-full",
|
|
@@ -8147,14 +8166,14 @@ function fc(t) {
|
|
|
8147
8166
|
) })
|
|
8148
8167
|
] })
|
|
8149
8168
|
] }) }),
|
|
8150
|
-
|
|
8169
|
+
ce && /* @__PURE__ */ c(K, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ f("div", { children: [
|
|
8151
8170
|
/* @__PURE__ */ f(Ze, { gutter: 8, children: [
|
|
8152
8171
|
/* @__PURE__ */ c(K, { span: 10, children: /* @__PURE__ */ c(ot, { className: "text-gray-700 font-medium block mb-1", children: "Level 3 (mins)" }) }),
|
|
8153
8172
|
/* @__PURE__ */ c(K, { span: 14, children: /* @__PURE__ */ c(ot, { className: "text-gray-700 font-medium block mb-1", children: "Escalate to" }) })
|
|
8154
8173
|
] }),
|
|
8155
8174
|
/* @__PURE__ */ f(Ze, { gutter: 8, children: [
|
|
8156
8175
|
/* @__PURE__ */ c(K, { span: 10, children: /* @__PURE__ */ c(
|
|
8157
|
-
|
|
8176
|
+
Pe,
|
|
8158
8177
|
{
|
|
8159
8178
|
className: "w-full",
|
|
8160
8179
|
placeholder: "Mins",
|
|
@@ -8164,12 +8183,12 @@ function fc(t) {
|
|
|
8164
8183
|
}
|
|
8165
8184
|
) }),
|
|
8166
8185
|
/* @__PURE__ */ c(K, { span: 14, children: /* @__PURE__ */ c(
|
|
8167
|
-
|
|
8186
|
+
Pe,
|
|
8168
8187
|
{
|
|
8169
8188
|
placeholder: "Escalate to",
|
|
8170
8189
|
className: "w-full",
|
|
8171
8190
|
value: b,
|
|
8172
|
-
onChange:
|
|
8191
|
+
onChange: B,
|
|
8173
8192
|
options: i
|
|
8174
8193
|
}
|
|
8175
8194
|
) })
|
|
@@ -8178,23 +8197,23 @@ function fc(t) {
|
|
|
8178
8197
|
/* @__PURE__ */ c(K, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ f("div", { children: [
|
|
8179
8198
|
/* @__PURE__ */ c(ot, { className: "text-gray-700 font-medium block mb-1", children: "Pick Actions" }),
|
|
8180
8199
|
/* @__PURE__ */ c(
|
|
8181
|
-
|
|
8200
|
+
Pe,
|
|
8182
8201
|
{
|
|
8183
8202
|
mode: "multiple",
|
|
8184
8203
|
placeholder: "Select response actions",
|
|
8185
8204
|
className: "w-full",
|
|
8186
8205
|
value: q,
|
|
8187
8206
|
onChange: Q,
|
|
8188
|
-
options:
|
|
8207
|
+
options: E,
|
|
8189
8208
|
maxTagCount: 1,
|
|
8190
|
-
maxTagPlaceholder:
|
|
8209
|
+
maxTagPlaceholder: nn
|
|
8191
8210
|
}
|
|
8192
8211
|
)
|
|
8193
8212
|
] }) }),
|
|
8194
8213
|
/* @__PURE__ */ c(K, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ f("div", { children: [
|
|
8195
8214
|
/* @__PURE__ */ c(ot, { className: "text-gray-700 font-medium block mb-1", children: "Notify" }),
|
|
8196
8215
|
/* @__PURE__ */ c(
|
|
8197
|
-
|
|
8216
|
+
Pe,
|
|
8198
8217
|
{
|
|
8199
8218
|
mode: "multiple",
|
|
8200
8219
|
placeholder: "Notify",
|
|
@@ -8203,19 +8222,19 @@ function fc(t) {
|
|
|
8203
8222
|
onChange: C,
|
|
8204
8223
|
options: D,
|
|
8205
8224
|
maxCount: 2,
|
|
8206
|
-
maxTagPlaceholder:
|
|
8225
|
+
maxTagPlaceholder: nn
|
|
8207
8226
|
}
|
|
8208
8227
|
)
|
|
8209
8228
|
] }) })
|
|
8210
8229
|
] }),
|
|
8211
8230
|
/* @__PURE__ */ f(Ze, { gutter: [16, 16], align: "bottom", className: "mt-4 items-center", children: [
|
|
8212
8231
|
/* @__PURE__ */ c(K, { xs: 24, sm: 12, md: 8, lg: 7, children: /* @__PURE__ */ f("div", { className: "flex items-center h-full gap-8", children: [
|
|
8213
|
-
!
|
|
8214
|
-
/* @__PURE__ */ c(
|
|
8232
|
+
!A && /* @__PURE__ */ c(Ot, { checked: Z, onChange: (te) => R(te.target.checked), className: "w-full", children: "Human-In-The-Loop" }),
|
|
8233
|
+
/* @__PURE__ */ c(Ot, { checked: G, onChange: (te) => h(te.target.checked), className: "w-full", children: "Auto-expire in 5 minutes" })
|
|
8215
8234
|
] }) }),
|
|
8216
8235
|
/* @__PURE__ */ c(K, { xs: 24, sm: 12, md: 8, children: /* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
|
|
8217
8236
|
/* @__PURE__ */ c(ze, { onClick: g, children: "Clear" }),
|
|
8218
|
-
/* @__PURE__ */ c(ze, { type: "primary", onClick: M, loading: !!ie, disabled: !(!!e &&
|
|
8237
|
+
/* @__PURE__ */ c(ze, { type: "primary", onClick: M, loading: !!ie, disabled: !(!!e && me && !ie), children: "Save" })
|
|
8219
8238
|
] }) })
|
|
8220
8239
|
] })
|
|
8221
8240
|
] });
|
|
@@ -8223,7 +8242,7 @@ function fc(t) {
|
|
|
8223
8242
|
function hc({ entries: t, userRoles: e, onEdit: s, loading: n }) {
|
|
8224
8243
|
const { config: r } = Ge(), i = r.tenant === "schools", a = new Map(e.map((l) => [l.userRoleId, l.userRoleName])), o = (l) => l.map((u) => a.get(u) || String(u)).join(", ");
|
|
8225
8244
|
return /* @__PURE__ */ c(
|
|
8226
|
-
|
|
8245
|
+
an,
|
|
8227
8246
|
{
|
|
8228
8247
|
rowKey: "id",
|
|
8229
8248
|
dataSource: t,
|
|
@@ -8288,7 +8307,7 @@ function hc({ entries: t, userRoles: e, onEdit: s, loading: n }) {
|
|
|
8288
8307
|
}
|
|
8289
8308
|
);
|
|
8290
8309
|
}
|
|
8291
|
-
const { Title: yc, Text:
|
|
8310
|
+
const { Title: yc, Text: Zs } = Jt;
|
|
8292
8311
|
function pc({ userRoles: t, rules: e, rawRules: s }) {
|
|
8293
8312
|
const { rules: n } = Ge(), [r, i] = S(!1), [a, o] = S(!1), [l, u] = S(s), [m, d] = S(), [y, p] = S([]), v = ve(() => t.map((x) => ({ label: x.userRoleName, value: x.userRoleId })), [t]), k = ve(() => (e || []).map((x) => ({ label: x.Name || "-", value: x.RuleId || x.Name || "" })), [e]), b = ve(
|
|
8294
8313
|
() => (e || []).map((x, C) => ({
|
|
@@ -8325,7 +8344,7 @@ function pc({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
8325
8344
|
), C = x?.userRoleIds ?? x?.UserRoleIds;
|
|
8326
8345
|
p(Array.isArray(C) ? C : []);
|
|
8327
8346
|
}, [m, l]);
|
|
8328
|
-
const
|
|
8347
|
+
const B = ve(() => {
|
|
8329
8348
|
if (!Array.isArray(l) || !l.length) return {};
|
|
8330
8349
|
const x = {};
|
|
8331
8350
|
for (const C of b) {
|
|
@@ -8338,11 +8357,11 @@ function pc({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
8338
8357
|
}, [l, b]);
|
|
8339
8358
|
return /* @__PURE__ */ f("div", { className: "w-full", children: [
|
|
8340
8359
|
/* @__PURE__ */ c(yc, { level: 4, className: "!mb-4", children: "Alert Assignment" }),
|
|
8341
|
-
/* @__PURE__ */ c(
|
|
8360
|
+
/* @__PURE__ */ c(Ns, { spinning: a || r, children: /* @__PURE__ */ f(Ze, { gutter: [16, 16], align: "bottom", className: "mb-6", children: [
|
|
8342
8361
|
/* @__PURE__ */ c(K, { xs: 24, sm: 12, md: 8, lg: 6, children: /* @__PURE__ */ f("div", { children: [
|
|
8343
|
-
/* @__PURE__ */ c(
|
|
8362
|
+
/* @__PURE__ */ c(Zs, { className: "text-gray-700 font-medium block mb-1", children: "Rules" }),
|
|
8344
8363
|
/* @__PURE__ */ c(
|
|
8345
|
-
|
|
8364
|
+
Pe,
|
|
8346
8365
|
{
|
|
8347
8366
|
placeholder: "Rules",
|
|
8348
8367
|
value: m,
|
|
@@ -8353,9 +8372,9 @@ function pc({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
8353
8372
|
)
|
|
8354
8373
|
] }) }),
|
|
8355
8374
|
/* @__PURE__ */ c(K, { xs: 24, sm: 12, md: 8, lg: 8, children: /* @__PURE__ */ f("div", { children: [
|
|
8356
|
-
/* @__PURE__ */ c(
|
|
8375
|
+
/* @__PURE__ */ c(Zs, { className: "text-gray-700 font-medium block mb-1", children: "Alert Notification To" }),
|
|
8357
8376
|
/* @__PURE__ */ c(
|
|
8358
|
-
|
|
8377
|
+
Pe,
|
|
8359
8378
|
{
|
|
8360
8379
|
mode: "multiple",
|
|
8361
8380
|
placeholder: "Select roles",
|
|
@@ -8364,7 +8383,7 @@ function pc({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
8364
8383
|
onChange: p,
|
|
8365
8384
|
options: v,
|
|
8366
8385
|
maxTagCount: 1,
|
|
8367
|
-
maxTagPlaceholder:
|
|
8386
|
+
maxTagPlaceholder: nn
|
|
8368
8387
|
}
|
|
8369
8388
|
)
|
|
8370
8389
|
] }) }),
|
|
@@ -8378,7 +8397,7 @@ function pc({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
8378
8397
|
type: "primary",
|
|
8379
8398
|
onClick: async () => {
|
|
8380
8399
|
if (!m) {
|
|
8381
|
-
|
|
8400
|
+
Ee.info("Please select a rule");
|
|
8382
8401
|
return;
|
|
8383
8402
|
}
|
|
8384
8403
|
try {
|
|
@@ -8398,9 +8417,9 @@ function pc({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
8398
8417
|
userRoles: Z
|
|
8399
8418
|
}, G = await n.updateRule(C, R);
|
|
8400
8419
|
if (!G?.responseStatus && !G?.Success && !G?.success)
|
|
8401
|
-
|
|
8420
|
+
Ee.error(G?.errorMessage || G?.Message || "Error saving Alert Assignment");
|
|
8402
8421
|
else {
|
|
8403
|
-
|
|
8422
|
+
Ee.success("Alert assignment saved"), d(void 0), p([]);
|
|
8404
8423
|
try {
|
|
8405
8424
|
const h = await n.getRules();
|
|
8406
8425
|
u(Array.isArray(h) ? h : []);
|
|
@@ -8409,7 +8428,7 @@ function pc({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
8409
8428
|
}
|
|
8410
8429
|
}
|
|
8411
8430
|
} catch (x) {
|
|
8412
|
-
console.error("Failed to save alert assignment", x),
|
|
8431
|
+
console.error("Failed to save alert assignment", x), Ee.error(x instanceof Error ? x.message : "Error saving Alert Assignment");
|
|
8413
8432
|
} finally {
|
|
8414
8433
|
o(!1);
|
|
8415
8434
|
}
|
|
@@ -8422,7 +8441,7 @@ function pc({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
8422
8441
|
] }) })
|
|
8423
8442
|
] }) }),
|
|
8424
8443
|
/* @__PURE__ */ c(
|
|
8425
|
-
|
|
8444
|
+
an,
|
|
8426
8445
|
{
|
|
8427
8446
|
rowKey: "key",
|
|
8428
8447
|
dataSource: b,
|
|
@@ -8439,11 +8458,11 @@ function pc({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
8439
8458
|
title: "Alert Notification To",
|
|
8440
8459
|
key: "assign",
|
|
8441
8460
|
render: (x, C) => {
|
|
8442
|
-
const Z =
|
|
8461
|
+
const Z = B[C.key] ?? [];
|
|
8443
8462
|
return Z.length ? /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-1", children: Z.map((R) => {
|
|
8444
8463
|
const G = t.find((h) => h.userRoleId === R);
|
|
8445
|
-
return /* @__PURE__ */ c(
|
|
8446
|
-
}) }) : /* @__PURE__ */ c(
|
|
8464
|
+
return /* @__PURE__ */ c(wt, { children: G?.userRoleName ?? String(R) }, R);
|
|
8465
|
+
}) }) : /* @__PURE__ */ c(Zs, { type: "secondary", children: "—" });
|
|
8447
8466
|
}
|
|
8448
8467
|
}
|
|
8449
8468
|
]
|
|
@@ -8451,8 +8470,8 @@ function pc({ userRoles: t, rules: e, rawRules: s }) {
|
|
|
8451
8470
|
)
|
|
8452
8471
|
] });
|
|
8453
8472
|
}
|
|
8454
|
-
const { Title: hr } =
|
|
8455
|
-
function
|
|
8473
|
+
const { Title: hr } = Jt;
|
|
8474
|
+
function zs(t) {
|
|
8456
8475
|
return !t || typeof t != "object" ? {} : {
|
|
8457
8476
|
level1UserRoleId: t.level1UserRoleId ?? t.Level1UserRoleId,
|
|
8458
8477
|
level1PostAssistTime: t.level1PostAssistTime ?? t.Level1PostAssistTime,
|
|
@@ -8467,39 +8486,39 @@ function Hs(t) {
|
|
|
8467
8486
|
};
|
|
8468
8487
|
}
|
|
8469
8488
|
function gc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules: r, onSave: i }) {
|
|
8470
|
-
const { rules: a, alerts: o } = Ge(), [l, u] = S("By Severity"), [m, d] = S("By severity"), [y, p] = S("By Severity"), [v, k] = S(!1), [b,
|
|
8489
|
+
const { rules: a, alerts: o } = Ge(), [l, u] = S("By Severity"), [m, d] = S("By severity"), [y, p] = S("By Severity"), [v, k] = S(!1), [b, B] = S(!1), [q, Q] = S(!1), [x, C] = S(null), [Z, R] = S("rules"), [G, h] = S(), [g, M] = S(), [ie, ye] = S(), [O, N] = S(), [A, E] = S(), [T, D] = S(), [L, _] = S(), [Y, j] = S(), [ce, me] = S([]), [Oe, te] = S([]), [Se, ke] = S(!1), [pe, P] = S(!1), [W, ge] = S({}), [ue, Ve] = S({}), [be, Ke] = S(s || []), [Me, Ne] = S([]), [Pt, pt] = S(!1), [Nt, nt] = S(!1), [Be, Tt] = S(n || []);
|
|
8471
8490
|
oe(() => {
|
|
8472
|
-
n && n.length &&
|
|
8491
|
+
n && n.length && Tt(n);
|
|
8473
8492
|
}, [n]), oe(() => {
|
|
8474
|
-
if (!
|
|
8475
|
-
const U = Object.keys(W).length > 0 || Object.keys(
|
|
8493
|
+
if (!Be || !Be.length) return;
|
|
8494
|
+
const U = Object.keys(W).length > 0 || Object.keys(ue).length > 0;
|
|
8476
8495
|
if (Me.length && !U) return;
|
|
8477
|
-
const se =
|
|
8478
|
-
const
|
|
8496
|
+
const se = Be.map((J, V) => {
|
|
8497
|
+
const de = e.find((le) => le.RuleId === (J.ruleId || J.ruleName))?.Name || J.ruleName || J.Name || "-", z = zs(J.escalationSettings), ne = typeof z.level1UserRoleId == "number" && z.level1UserRoleId > 0 ? [z.level1UserRoleId] : [], rt = typeof z.level2UserRoleId == "number" && z.level2UserRoleId > 0 ? [z.level2UserRoleId] : [], ss = typeof z.level3UserRoleId == "number" && z.level3UserRoleId > 0 ? [z.level3UserRoleId] : [], H = (Array.isArray(z.escalationSettingsActionTypeIds) ? z.escalationSettingsActionTypeIds : []).map((le) => W[le] || String(le)), Ie = (Array.isArray(z.thirdPartyId) ? z.thirdPartyId : []).map((le) => ue[le] || String(le)), Re = typeof z.humanLoop == "boolean" ? z.humanLoop : null, fe = typeof z.isAutoExpire == "boolean" ? z.isAutoExpire : null;
|
|
8479
8498
|
return {
|
|
8480
|
-
id: String(J.ruleId || J.ruleName ||
|
|
8481
|
-
ruleOrSeverityLabel:
|
|
8499
|
+
id: String(J.ruleId || J.ruleName || V),
|
|
8500
|
+
ruleOrSeverityLabel: de,
|
|
8482
8501
|
l1: { minutes: z.level1PostAssistTime ?? void 0, roles: ne },
|
|
8483
8502
|
l2: { minutes: z.level2PostAssistTime ?? void 0, roles: rt },
|
|
8484
|
-
l3: { minutes: z.level3PostAssistTime ?? void 0, roles:
|
|
8503
|
+
l3: { minutes: z.level3PostAssistTime ?? void 0, roles: ss },
|
|
8485
8504
|
actions: H,
|
|
8486
8505
|
notify: Ie,
|
|
8487
8506
|
humanLoop: Re,
|
|
8488
|
-
isAutoExpire:
|
|
8507
|
+
isAutoExpire: fe
|
|
8489
8508
|
};
|
|
8490
8509
|
});
|
|
8491
8510
|
Ne(se);
|
|
8492
|
-
}, [
|
|
8493
|
-
const
|
|
8511
|
+
}, [Be, e, W, ue]);
|
|
8512
|
+
const bt = ve(
|
|
8494
8513
|
() => t.map((U) => ({ label: U.DisplayName, value: U.SeverityId })),
|
|
8495
8514
|
[t]
|
|
8496
8515
|
), xe = ve(
|
|
8497
8516
|
() => e.map((U) => ({ label: U.Name, value: U.RuleId })),
|
|
8498
8517
|
[e]
|
|
8499
|
-
),
|
|
8518
|
+
), It = ve(
|
|
8500
8519
|
() => be.map((U) => ({ label: U.userRoleName, value: U.userRoleId })),
|
|
8501
8520
|
[be]
|
|
8502
|
-
),
|
|
8521
|
+
), Os = ve(() => [1, 3, 5, 10, 15, 20, 30, 45, 60].map((U) => ({ label: `${U}`, value: U })), []);
|
|
8503
8522
|
oe(() => {
|
|
8504
8523
|
let U = !1;
|
|
8505
8524
|
async function se() {
|
|
@@ -8507,13 +8526,13 @@ function gc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
|
|
|
8507
8526
|
Q(!0), C(null);
|
|
8508
8527
|
const J = await o.getAdminSettings();
|
|
8509
8528
|
if (!U && J) {
|
|
8510
|
-
const
|
|
8511
|
-
u(
|
|
8529
|
+
const V = vr(J.sortBy);
|
|
8530
|
+
u(V), p(V), k(!1);
|
|
8512
8531
|
}
|
|
8513
8532
|
} catch (J) {
|
|
8514
8533
|
if (!U) {
|
|
8515
|
-
const
|
|
8516
|
-
C(
|
|
8534
|
+
const V = J instanceof Error ? J.message : "Failed to load admin settings";
|
|
8535
|
+
C(V);
|
|
8517
8536
|
}
|
|
8518
8537
|
} finally {
|
|
8519
8538
|
U || Q(!1);
|
|
@@ -8524,37 +8543,37 @@ function gc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
|
|
|
8524
8543
|
};
|
|
8525
8544
|
}, []), oe(() => {
|
|
8526
8545
|
if (!g) return;
|
|
8527
|
-
const U = (
|
|
8528
|
-
const z = Number(
|
|
8546
|
+
const U = (de) => {
|
|
8547
|
+
const z = Number(de);
|
|
8529
8548
|
return !isNaN(z) && z > 0 ? z : void 0;
|
|
8530
|
-
}, se = (
|
|
8531
|
-
const z = Number(
|
|
8549
|
+
}, se = (de) => {
|
|
8550
|
+
const z = Number(de);
|
|
8532
8551
|
return !isNaN(z) && z > 0 ? z : void 0;
|
|
8533
|
-
}, J = (
|
|
8534
|
-
(
|
|
8535
|
-
),
|
|
8536
|
-
if (
|
|
8537
|
-
|
|
8538
|
-
const
|
|
8539
|
-
de
|
|
8552
|
+
}, J = (Be || []).find(
|
|
8553
|
+
(de) => de?.ruleId === g || de?.ruleName === g || de?.RuleId === g
|
|
8554
|
+
), V = zs(J?.escalationSettings);
|
|
8555
|
+
if (V && typeof V == "object") {
|
|
8556
|
+
ye(se(V.level1PostAssistTime)), N(U(V.level1UserRoleId)), E(se(V.level2PostAssistTime)), D(U(V.level2UserRoleId)), _(se(V.level3PostAssistTime)), j(U(V.level3UserRoleId));
|
|
8557
|
+
const de = Array.isArray(V.escalationSettingsActionTypeIds) ? V.escalationSettingsActionTypeIds : [];
|
|
8558
|
+
me(de.map((z) => String(z))), te(Array.isArray(V.thirdPartyId) ? V.thirdPartyId : []), ke(!!V.humanLoop), P(!!V.isAutoExpire);
|
|
8540
8559
|
}
|
|
8541
|
-
}, [Z, g,
|
|
8542
|
-
const
|
|
8560
|
+
}, [Z, g, Be]);
|
|
8561
|
+
const Ms = async () => {
|
|
8543
8562
|
try {
|
|
8544
8563
|
nt(!0);
|
|
8545
8564
|
const U = await a.getRules(), se = Array.isArray(U) ? U : Array.isArray(U?.data) ? U.data : [];
|
|
8546
|
-
|
|
8547
|
-
const J = se.map((
|
|
8548
|
-
const z = e.find((
|
|
8565
|
+
Tt(se);
|
|
8566
|
+
const J = se.map((V, de) => {
|
|
8567
|
+
const z = e.find((le) => le.RuleId === (V.ruleId || V.ruleName))?.Name || V.ruleName || V.Name || "-", ne = zs(V.escalationSettings ?? V.EscalationSettings), rt = typeof ne.level1UserRoleId == "number" && ne.level1UserRoleId > 0 ? [ne.level1UserRoleId] : [], ss = typeof ne.level2UserRoleId == "number" && ne.level2UserRoleId > 0 ? [ne.level2UserRoleId] : [], w = typeof ne.level3UserRoleId == "number" && ne.level3UserRoleId > 0 ? [ne.level3UserRoleId] : [], ae = (Array.isArray(ne.escalationSettingsActionTypeIds) ? ne.escalationSettingsActionTypeIds : []).map((le) => W[le] || String(le)), Re = (Array.isArray(ne.thirdPartyId) ? ne.thirdPartyId : []).map((le) => ue[le] || String(le)), fe = typeof ne.humanLoop == "boolean" ? ne.humanLoop : null;
|
|
8549
8568
|
return {
|
|
8550
|
-
id: String(
|
|
8569
|
+
id: String(V.ruleId || V.ruleName || de),
|
|
8551
8570
|
ruleOrSeverityLabel: z,
|
|
8552
8571
|
l1: { minutes: ne.level1PostAssistTime ?? void 0, roles: rt },
|
|
8553
|
-
l2: { minutes: ne.level2PostAssistTime ?? void 0, roles:
|
|
8554
|
-
l3: { minutes: ne.level3PostAssistTime ?? void 0, roles:
|
|
8572
|
+
l2: { minutes: ne.level2PostAssistTime ?? void 0, roles: ss },
|
|
8573
|
+
l3: { minutes: ne.level3PostAssistTime ?? void 0, roles: w },
|
|
8555
8574
|
actions: ae,
|
|
8556
8575
|
notify: Re,
|
|
8557
|
-
humanLoop:
|
|
8576
|
+
humanLoop: fe
|
|
8558
8577
|
};
|
|
8559
8578
|
});
|
|
8560
8579
|
Ne(J);
|
|
@@ -8572,16 +8591,16 @@ function gc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
|
|
|
8572
8591
|
if (U || !se) return;
|
|
8573
8592
|
const J = {};
|
|
8574
8593
|
if (Array.isArray(se.thirdParties))
|
|
8575
|
-
for (const
|
|
8576
|
-
const z =
|
|
8577
|
-
typeof z == "number" && (J[z] =
|
|
8594
|
+
for (const de of se.thirdParties) {
|
|
8595
|
+
const z = de.thirdPartyIds ?? de.thirdPartyId;
|
|
8596
|
+
typeof z == "number" && (J[z] = de.thirdPartyName);
|
|
8578
8597
|
}
|
|
8579
|
-
|
|
8580
|
-
const
|
|
8581
|
-
userRoleId:
|
|
8582
|
-
userRoleName:
|
|
8598
|
+
Ve(J);
|
|
8599
|
+
const V = Array.isArray(se.userRoles) ? se.userRoles.map((de) => ({
|
|
8600
|
+
userRoleId: de.userRoleId ?? de.id,
|
|
8601
|
+
userRoleName: de.userRoleName ?? de.name
|
|
8583
8602
|
})) : [];
|
|
8584
|
-
U || Ke(
|
|
8603
|
+
U || Ke(V.length ? V : s || []);
|
|
8585
8604
|
} catch (se) {
|
|
8586
8605
|
console.error("Error loading lookups", se);
|
|
8587
8606
|
}
|
|
@@ -8591,7 +8610,7 @@ function gc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
|
|
|
8591
8610
|
}, []), /* @__PURE__ */ f("div", { className: "w-full", children: [
|
|
8592
8611
|
/* @__PURE__ */ f("div", { className: "mb-6", children: [
|
|
8593
8612
|
/* @__PURE__ */ c(hr, { level: 4, className: "!mb-2", children: "Admin Settings" }),
|
|
8594
|
-
/* @__PURE__ */ f(
|
|
8613
|
+
/* @__PURE__ */ f(Ns, { spinning: q, children: [
|
|
8595
8614
|
x ? /* @__PURE__ */ f("div", { className: "text-sm text-red-600 mb-2", children: [
|
|
8596
8615
|
"Failed to load settings: ",
|
|
8597
8616
|
x
|
|
@@ -8606,14 +8625,14 @@ function gc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
|
|
|
8606
8625
|
},
|
|
8607
8626
|
showActions: v,
|
|
8608
8627
|
onSave: async () => {
|
|
8609
|
-
|
|
8628
|
+
B(!0);
|
|
8610
8629
|
try {
|
|
8611
8630
|
const U = await o.setAdminSettings({ sortBy: l, groupBy: "string" });
|
|
8612
|
-
U?.responseStatus && U?.data &&
|
|
8631
|
+
U?.responseStatus && U?.data && Ee.success(U.data), p(l), k(!1);
|
|
8613
8632
|
} catch (U) {
|
|
8614
8633
|
console.error("Error saving admin settings", U);
|
|
8615
8634
|
} finally {
|
|
8616
|
-
|
|
8635
|
+
B(!1);
|
|
8617
8636
|
}
|
|
8618
8637
|
},
|
|
8619
8638
|
onClear: () => {
|
|
@@ -8624,7 +8643,7 @@ function gc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
|
|
|
8624
8643
|
)
|
|
8625
8644
|
] })
|
|
8626
8645
|
] }),
|
|
8627
|
-
/* @__PURE__ */ c(
|
|
8646
|
+
/* @__PURE__ */ c(Zt, { className: "my-6" }),
|
|
8628
8647
|
/* @__PURE__ */ f("div", { children: [
|
|
8629
8648
|
/* @__PURE__ */ c(hr, { level: 4, className: "!mb-4", children: "Escalation Settings" }),
|
|
8630
8649
|
/* @__PURE__ */ c(
|
|
@@ -8636,69 +8655,69 @@ function gc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
|
|
|
8636
8655
|
setSelectedSeverity: h,
|
|
8637
8656
|
selectedRule: g,
|
|
8638
8657
|
setSelectedRule: M,
|
|
8639
|
-
severityOptions:
|
|
8658
|
+
severityOptions: bt,
|
|
8640
8659
|
ruleOptions: xe,
|
|
8641
|
-
minsOptions:
|
|
8642
|
-
roleOptions:
|
|
8660
|
+
minsOptions: Os,
|
|
8661
|
+
roleOptions: It,
|
|
8643
8662
|
l1mins: ie,
|
|
8644
|
-
setL1mins:
|
|
8645
|
-
l1role:
|
|
8663
|
+
setL1mins: ye,
|
|
8664
|
+
l1role: O,
|
|
8646
8665
|
setL1role: N,
|
|
8647
|
-
l2mins:
|
|
8648
|
-
setL2mins:
|
|
8666
|
+
l2mins: A,
|
|
8667
|
+
setL2mins: E,
|
|
8649
8668
|
l2role: T,
|
|
8650
8669
|
setL2role: D,
|
|
8651
8670
|
l3mins: L,
|
|
8652
8671
|
setL3mins: _,
|
|
8653
8672
|
l3role: Y,
|
|
8654
8673
|
setL3role: j,
|
|
8655
|
-
actions:
|
|
8656
|
-
setActions:
|
|
8657
|
-
thirdPartyIds:
|
|
8674
|
+
actions: ce,
|
|
8675
|
+
setActions: me,
|
|
8676
|
+
thirdPartyIds: Oe,
|
|
8658
8677
|
setThirdPartyIds: te,
|
|
8659
8678
|
humanLoop: Se,
|
|
8660
8679
|
setHumanLoop: ke,
|
|
8661
8680
|
onClear: () => {
|
|
8662
|
-
u("By Severity"), d("By severity"), R("rules"), h(void 0), M(void 0),
|
|
8681
|
+
u("By Severity"), d("By severity"), R("rules"), h(void 0), M(void 0), ye(void 0), N(void 0), E(void 0), D(void 0), _(void 0), j(void 0), me([]), te([]), ke(!1), P(!1);
|
|
8663
8682
|
},
|
|
8664
8683
|
onSave: async () => {
|
|
8665
8684
|
pt(!0), i?.({
|
|
8666
8685
|
ruleId: g,
|
|
8667
8686
|
levels: [
|
|
8668
|
-
{ minutes: ie, role:
|
|
8669
|
-
{ minutes:
|
|
8687
|
+
{ minutes: ie, role: O },
|
|
8688
|
+
{ minutes: A, role: T },
|
|
8670
8689
|
{ minutes: L, role: Y }
|
|
8671
8690
|
],
|
|
8672
|
-
actions:
|
|
8673
|
-
thirdPartyIds:
|
|
8691
|
+
actions: ce,
|
|
8692
|
+
thirdPartyIds: Oe,
|
|
8674
8693
|
humanLoop: Se,
|
|
8675
|
-
isAutoExpire:
|
|
8694
|
+
isAutoExpire: pe
|
|
8676
8695
|
});
|
|
8677
8696
|
try {
|
|
8678
8697
|
if (g) {
|
|
8679
|
-
const se = Array.isArray(
|
|
8698
|
+
const se = Array.isArray(ce) ? ce.map((ne) => Number.isNaN(Number(ne)) ? ne : Number(ne)) : [], J = (Be || []).find(
|
|
8680
8699
|
(ne) => ne?.ruleId === g || ne?.ruleName === g || ne?.RuleId === g
|
|
8681
|
-
),
|
|
8682
|
-
if (!J || !
|
|
8683
|
-
|
|
8700
|
+
), V = typeof J?.recordId == "number" ? J.recordId : J?.ruleId || J?.RuleId || void 0;
|
|
8701
|
+
if (!J || !V) {
|
|
8702
|
+
Ee.error("Unable to find rule identifier for update");
|
|
8684
8703
|
return;
|
|
8685
8704
|
}
|
|
8686
|
-
const
|
|
8705
|
+
const de = {
|
|
8687
8706
|
...J,
|
|
8688
8707
|
escalationSettings: {
|
|
8689
|
-
level1UserRoleId:
|
|
8708
|
+
level1UserRoleId: O ?? 0,
|
|
8690
8709
|
level1PostAssistTime: ie ?? 0,
|
|
8691
8710
|
level2UserRoleId: T ?? 0,
|
|
8692
|
-
level2PostAssistTime:
|
|
8711
|
+
level2PostAssistTime: A ?? 0,
|
|
8693
8712
|
level3UserRoleId: Y ?? 0,
|
|
8694
8713
|
level3PostAssistTime: L ?? 0,
|
|
8695
8714
|
escalationSettingsActionTypeIds: se,
|
|
8696
|
-
thirdPartyId: Array.isArray(
|
|
8715
|
+
thirdPartyId: Array.isArray(Oe) ? Oe : [],
|
|
8697
8716
|
humanLoop: Se,
|
|
8698
|
-
isAutoExpire:
|
|
8717
|
+
isAutoExpire: pe
|
|
8699
8718
|
}
|
|
8700
|
-
}, z = await a.updateRule(
|
|
8701
|
-
z?.responseStatus || z?.Success || z?.success ? (
|
|
8719
|
+
}, z = await a.updateRule(V, de);
|
|
8720
|
+
z?.responseStatus || z?.Success || z?.success ? (Ee.success("Escalation settings saved"), await Ms(), M(void 0), ye(void 0), N(void 0), E(void 0), D(void 0), _(void 0), j(void 0), me([]), te([]), ke(!1), P(!1)) : Ee.error(z?.errorMessage || z?.Message || "Error saving Escalation Settings");
|
|
8702
8721
|
}
|
|
8703
8722
|
} catch (se) {
|
|
8704
8723
|
console.error("Error saving escalation settings", se);
|
|
@@ -8706,43 +8725,43 @@ function gc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
|
|
|
8706
8725
|
pt(!1);
|
|
8707
8726
|
}
|
|
8708
8727
|
},
|
|
8709
|
-
saving:
|
|
8728
|
+
saving: Pt,
|
|
8710
8729
|
onActionTypesLoaded: (U) => {
|
|
8711
8730
|
const se = {};
|
|
8712
8731
|
for (const J of U)
|
|
8713
8732
|
typeof J.actionTypeId == "number" && (se[J.actionTypeId] = J.name);
|
|
8714
|
-
|
|
8733
|
+
ge(se);
|
|
8715
8734
|
},
|
|
8716
|
-
isAutoExpire:
|
|
8735
|
+
isAutoExpire: pe,
|
|
8717
8736
|
setAutoExpire: P
|
|
8718
8737
|
}
|
|
8719
8738
|
)
|
|
8720
8739
|
] }),
|
|
8721
|
-
/* @__PURE__ */ c(
|
|
8740
|
+
/* @__PURE__ */ c(Zt, { className: "my-6" }),
|
|
8722
8741
|
/* @__PURE__ */ c(
|
|
8723
8742
|
hc,
|
|
8724
8743
|
{
|
|
8725
8744
|
entries: Me,
|
|
8726
8745
|
userRoles: be,
|
|
8727
|
-
loading:
|
|
8746
|
+
loading: Nt || r,
|
|
8728
8747
|
onEdit: (U) => {
|
|
8729
8748
|
R("rules");
|
|
8730
|
-
const se = Me.find((
|
|
8749
|
+
const se = Me.find((V) => V.id === U), J = e.find((V) => V.RuleId === U) || (se ? e.find((V) => V.Name === se.ruleOrSeverityLabel) : void 0);
|
|
8731
8750
|
M(J ? J.RuleId : U);
|
|
8732
8751
|
}
|
|
8733
8752
|
}
|
|
8734
8753
|
),
|
|
8735
|
-
/* @__PURE__ */ c(
|
|
8754
|
+
/* @__PURE__ */ c(Zt, { className: "my-6" }),
|
|
8736
8755
|
/* @__PURE__ */ c(pc, { userRoles: be, rules: e, rawRules: n }),
|
|
8737
|
-
/* @__PURE__ */ c(
|
|
8756
|
+
/* @__PURE__ */ c(Zt, {})
|
|
8738
8757
|
] });
|
|
8739
8758
|
}
|
|
8740
|
-
const { Title: yr, Text:
|
|
8741
|
-
function
|
|
8759
|
+
const { Title: yr, Text: fs } = Jt;
|
|
8760
|
+
function Bc({ severities: t, rules: e, onSave: s, onCancel: n }) {
|
|
8742
8761
|
const { rules: r, alerts: i } = Ge(), a = [
|
|
8743
8762
|
{ label: "By Severity", value: "By Severity" },
|
|
8744
8763
|
{ label: "By Created Date", value: "By Created Date" }
|
|
8745
|
-
], [o, l] = S("By Severity"), [u, m] = S(/* @__PURE__ */ new Set()), [d, y] = S(null), [p, v] = S(null), [k, b] = S({ inApp: !1, sms: !1, email: !1 }), [
|
|
8764
|
+
], [o, l] = S("By Severity"), [u, m] = S(/* @__PURE__ */ new Set()), [d, y] = S(null), [p, v] = S(null), [k, b] = S({ inApp: !1, sms: !1, email: !1 }), [B, q] = S([]), [Q, x] = S(!0), [C, Z] = S(!1);
|
|
8746
8765
|
oe(() => {
|
|
8747
8766
|
let h = !1;
|
|
8748
8767
|
return (async () => {
|
|
@@ -8798,7 +8817,7 @@ function Vc({ severities: t, rules: e, onSave: s, onCancel: n }) {
|
|
|
8798
8817
|
});
|
|
8799
8818
|
try {
|
|
8800
8819
|
Z(!0);
|
|
8801
|
-
const h = d ? d.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", g = p ? p.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", M = Array.from(u).map((
|
|
8820
|
+
const h = d ? d.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", g = p ? p.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", M = Array.from(u).map((ye) => Number(ye)).filter((ye) => Number.isFinite(ye)), ie = await i.setPreferenceSettings({
|
|
8802
8821
|
anomalyIds: M,
|
|
8803
8822
|
doNotDisturbStart: h,
|
|
8804
8823
|
doNotDisturbEnd: g,
|
|
@@ -8807,7 +8826,7 @@ function Vc({ severities: t, rules: e, onSave: s, onCancel: n }) {
|
|
|
8807
8826
|
email: !!k.email,
|
|
8808
8827
|
sortBy: o
|
|
8809
8828
|
});
|
|
8810
|
-
ie?.responseStatus &&
|
|
8829
|
+
ie?.responseStatus && Ee.success(ie?.data || "Preferences updated successfully.");
|
|
8811
8830
|
} catch (h) {
|
|
8812
8831
|
console.error("Error in saving my preferences: ", h);
|
|
8813
8832
|
} finally {
|
|
@@ -8816,38 +8835,38 @@ function Vc({ severities: t, rules: e, onSave: s, onCancel: n }) {
|
|
|
8816
8835
|
};
|
|
8817
8836
|
return /* @__PURE__ */ f("div", { className: "w-full", children: [
|
|
8818
8837
|
/* @__PURE__ */ c(Ze, { gutter: [16, 16], align: "middle", className: "mb-4", children: /* @__PURE__ */ c(K, { xs: 24, md: 8, children: /* @__PURE__ */ f(st, { direction: "horizontal", size: 12, className: "w-full items-center", children: [
|
|
8819
|
-
/* @__PURE__ */ c(
|
|
8820
|
-
/* @__PURE__ */ c(
|
|
8838
|
+
/* @__PURE__ */ c(fs, { className: "text-gray-600", children: "Sort By:" }),
|
|
8839
|
+
/* @__PURE__ */ c(Pe, { className: "w-[240px]", value: o, options: a, onChange: l })
|
|
8821
8840
|
] }) }) }),
|
|
8822
8841
|
/* @__PURE__ */ f("div", { className: "mb-4", children: [
|
|
8823
8842
|
/* @__PURE__ */ c(yr, { level: 5, className: "!mb-2", children: "Anomalies" }),
|
|
8824
|
-
Q ? /* @__PURE__ */ c("div", { className: "py-4", children: /* @__PURE__ */ c(
|
|
8843
|
+
Q ? /* @__PURE__ */ c("div", { className: "py-4", children: /* @__PURE__ */ c(Ns, {}) }) : /* @__PURE__ */ c(st, { direction: "vertical", size: 10, className: "w-full", children: (Array.isArray(B) ? B : []).map((h) => {
|
|
8825
8844
|
const g = String(h.recordId), M = h.anomalyName;
|
|
8826
|
-
return /* @__PURE__ */ c(
|
|
8845
|
+
return /* @__PURE__ */ c(Ot, { checked: u.has(g), onChange: () => R(g), children: M }, g);
|
|
8827
8846
|
}) })
|
|
8828
8847
|
] }),
|
|
8829
8848
|
/* @__PURE__ */ f("div", { className: "mb-4", children: [
|
|
8830
8849
|
/* @__PURE__ */ c(yr, { level: 5, className: "!mb-2", children: "Notification Timing & Channels" }),
|
|
8831
8850
|
/* @__PURE__ */ c(Ze, { gutter: [16, 16], align: "middle", className: "mb-3", children: /* @__PURE__ */ c(K, { xs: 24, md: 12, children: /* @__PURE__ */ f(st, { direction: "horizontal", size: 12, className: "w-full items-center", children: [
|
|
8832
|
-
/* @__PURE__ */ c(
|
|
8851
|
+
/* @__PURE__ */ c(fs, { children: "Do Not Disturb mode:" }),
|
|
8833
8852
|
/* @__PURE__ */ f(st, { size: 12, className: "w-full", children: [
|
|
8834
8853
|
/* @__PURE__ */ f(st, { direction: "horizontal", size: 8, className: "items-center", children: [
|
|
8835
|
-
/* @__PURE__ */ c(
|
|
8854
|
+
/* @__PURE__ */ c(fs, { children: "From" }),
|
|
8836
8855
|
/* @__PURE__ */ c(kn, { value: d, onChange: (h) => y(h), format: "HH:mm" })
|
|
8837
8856
|
] }),
|
|
8838
8857
|
/* @__PURE__ */ f(st, { direction: "horizontal", size: 8, className: "items-center", children: [
|
|
8839
|
-
/* @__PURE__ */ c(
|
|
8858
|
+
/* @__PURE__ */ c(fs, { children: "To" }),
|
|
8840
8859
|
/* @__PURE__ */ c(kn, { value: p, onChange: (h) => v(h), format: "HH:mm" })
|
|
8841
8860
|
] })
|
|
8842
8861
|
] })
|
|
8843
8862
|
] }) }) }),
|
|
8844
8863
|
/* @__PURE__ */ f(Ze, { gutter: [24, 12], children: [
|
|
8845
|
-
/* @__PURE__ */ c(K, { children: /* @__PURE__ */ c(
|
|
8846
|
-
/* @__PURE__ */ c(K, { children: /* @__PURE__ */ c(
|
|
8847
|
-
/* @__PURE__ */ c(K, { children: /* @__PURE__ */ c(
|
|
8864
|
+
/* @__PURE__ */ c(K, { children: /* @__PURE__ */ c(Ot, { checked: k.inApp, onChange: (h) => b({ ...k, inApp: h.target.checked }), children: "In-app" }) }),
|
|
8865
|
+
/* @__PURE__ */ c(K, { children: /* @__PURE__ */ c(Ot, { checked: k.sms, onChange: (h) => b({ ...k, sms: h.target.checked }), children: "SMS" }) }),
|
|
8866
|
+
/* @__PURE__ */ c(K, { children: /* @__PURE__ */ c(Ot, { checked: k.email, onChange: (h) => b({ ...k, email: h.target.checked }), children: "Email" }) })
|
|
8848
8867
|
] })
|
|
8849
8868
|
] }),
|
|
8850
|
-
/* @__PURE__ */ c(
|
|
8869
|
+
/* @__PURE__ */ c(Zt, {}),
|
|
8851
8870
|
/* @__PURE__ */ f(st, { className: "gap-3", children: [
|
|
8852
8871
|
/* @__PURE__ */ c(ze, { onClick: n, disabled: C, children: "Cancel" }),
|
|
8853
8872
|
/* @__PURE__ */ c(ze, { type: "primary", onClick: G, loading: C, children: "Save" })
|
|
@@ -8858,7 +8877,7 @@ function Sc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
|
|
|
8858
8877
|
return /* @__PURE__ */ c("div", { className: "w-full", children: /* @__PURE__ */ c(gc, { severities: t, rules: e, userRoles: s, rawRules: n, loadingRules: r }) });
|
|
8859
8878
|
}
|
|
8860
8879
|
const vc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIZSURBVHgBnZW/b9NAFMe/z3H6i1ZNJUBFQsL/QQkLCFBtRhhKF1ibhBmpXbtgFlYqsTG0gRGWwgAjMb8EYmjYGN0pCCrVVaX+SBxf37PiqHWcOu5Xsux79+6j77vz3RH66IbdsDTQPCFngmBwqMCPBwVXoe204Fd/2ZfrSWMpHrDshtGCvsY9FlKkFNYD+Es/7EtuX+itp1sLnLrScTWoPMYsfnty/lUPtAOs4syiUgQOoWHJpG9kdBiX11Z+UaZCk1YT+vOzACuzYxgf7hZbyBGvhTi9af+7SkQbyKi7M8N4ZJ5D+eU2dg9UN07KvyNOS8io6UkNFXMMj1/vnACKAuTmNXZpIqME+LF+iIbX7ukjkClODWTQw+ujuGYMYfXzXnICbxSBDrxAUvYDhkrZp6ggUC8+sDI7mpj9YmESb3/uJ5Z9TJ5A3eORvzsBpgs6lufGT2TKPNY3fbxh6Knis0FTSjnx+LP3u5DJicDi/t7MCFadPaRJQTl02/5vKcKnpITluYkwrWjksebs48Pvg3SoUkXtq32hxt+1pITI8Zc/zcGACN59ty/WdWnklV5ukZ+49wU8MUJIF3mBGlqUr3Dv1+wpl20v9UuP75pElyrgc3XK7UJFbLvK4DJiv9ggDmWcjO9G4imWvW00yV/hjvtpOFnpQOVLkcO+0EhyevGrROG1ol1hREFc8ZGxyddIje+v9c4i9+gI5z7MozLxclgAAAAASUVORK5CYII=", wc = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAKeSURBVHgBjVVdbtpAEJ5ZmygPfTBSaVWpUt0bwFuURgJOUG5QeoLACbw+QeAEwA3SGxgJokh9CDeI+xSpTRU/Imw8nbFZx6QQGAl5d2fm229+dkDYI2f6oaUAOwhWExBcPnL4FwFBSLCexpCMf+qPi12++PKgpR/cGOwRa1pwQIjgOoWkf6s/hOVzVd588R+/xWjf5YAY8Y0+ErQrZFfnXg3lK3uGm7A+RISOxfbit5NprqBxxgBoeEIVHehqtI9lSz+5McaaITaA2J17bycFaBayMOS8IaT+zHuv4Ui58P9oAvB4Ga0paUgqbFGswL5idIcIx3P9DCiXrQB7iJawcTiCkMMIUlj7Jo8zr6Yv/EfRXXIqRnzUxnP9u46Id8Q5Sslq3+pqWErHAPKqvxROC/ZMuJwKJ8bkPouUkrYUqgt5IgMDKAxfAYT8nAZnmR2A5J47YSjrFKyOYpZN2SiIJ8YjRqVfASyAFVg9s2F2gXwRsClMXdnYcFpq5PyiQ8KEilaywc79+aEow2i7fdCF46SIpuTvCGi2kWSXjCM4QqS4Zl3yjwQ0UySwrBfGRJNjQKW4ZrmEpL45CxUDTGWdgmoZgxOoDA6zxYgr7ZudhWk3x6Sp4kl0nZmgujQhcH5Cvqy/Hxi5hdL+dgsWxR2rma4FkLeDw+PMM243+t2YB0jDDI9nMBquyWqI3tjmLYguQfqDzxebty/DIcnePr9jfePVfDhSzv2/Hs8LAY3kMmFfTCl+rl3uu1GWF6Jx+X3vkpa+58jeeNyXvY3Pd8N+a0hvgK9ge3hMTmG5CPTnSICWcFpXaDfZUcAck99yOnZM/id3hcmAFV/hgEilU6p0TcH2gpZYS98xc/kXUJ8YImPFzfeLh0cgXbMp8n/yD3ySPZSK0MWKAAAAAElFTkSuQmCC";
|
|
8861
|
-
function
|
|
8880
|
+
function ts() {
|
|
8862
8881
|
const { config: t } = Ge();
|
|
8863
8882
|
return { timeZoneDetails: ve(() => {
|
|
8864
8883
|
const s = t.timeZone || Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
@@ -8880,9 +8899,9 @@ function Ac(t) {
|
|
|
8880
8899
|
};
|
|
8881
8900
|
}
|
|
8882
8901
|
function Nc({ data: t }) {
|
|
8883
|
-
const { timeZoneDetails: e } =
|
|
8902
|
+
const { timeZoneDetails: e } = ts();
|
|
8884
8903
|
return /* @__PURE__ */ c("div", { className: "w-full", children: /* @__PURE__ */ c(
|
|
8885
|
-
|
|
8904
|
+
on,
|
|
8886
8905
|
{
|
|
8887
8906
|
type: "card",
|
|
8888
8907
|
items: [
|
|
@@ -8890,7 +8909,7 @@ function Nc({ data: t }) {
|
|
|
8890
8909
|
key: "action",
|
|
8891
8910
|
label: "Action Taken",
|
|
8892
8911
|
children: /* @__PURE__ */ f("div", { className: "w-full", style: { maxHeight: "50vh", overflowY: "auto" }, children: [
|
|
8893
|
-
/* @__PURE__ */ c(
|
|
8912
|
+
/* @__PURE__ */ c(Ds, { className: "mb-4 rounded-md p-4", bordered: !0, children: /* @__PURE__ */ f("div", { className: "grid grid-cols-4 gap-6 text-xs", children: [
|
|
8894
8913
|
/* @__PURE__ */ f("div", { className: "flex flex-col gap-1", children: [
|
|
8895
8914
|
/* @__PURE__ */ c("span", { className: "text-gray-500", children: "Alert ID" }),
|
|
8896
8915
|
/* @__PURE__ */ c("span", { className: "text-black", children: t.summary.alertNumber })
|
|
@@ -8904,10 +8923,10 @@ function Nc({ data: t }) {
|
|
|
8904
8923
|
/* @__PURE__ */ c("span", { className: "text-black", children: t.summary.location })
|
|
8905
8924
|
] })
|
|
8906
8925
|
] }) }),
|
|
8907
|
-
/* @__PURE__ */ f(
|
|
8926
|
+
/* @__PURE__ */ f(Ds, { className: "rounded-md p-4", bordered: !0, children: [
|
|
8908
8927
|
/* @__PURE__ */ c("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ c("h4", { className: "text-sm text-black font-medium", children: "Response Timeline/ Audit trail/log" }) }),
|
|
8909
8928
|
/* @__PURE__ */ c("div", { className: "mt-2", children: /* @__PURE__ */ c(
|
|
8910
|
-
|
|
8929
|
+
Bi,
|
|
8911
8930
|
{
|
|
8912
8931
|
direction: "vertical",
|
|
8913
8932
|
size: "small",
|
|
@@ -8927,16 +8946,9 @@ function Nc({ data: t }) {
|
|
|
8927
8946
|
className: "grid grid-cols-2 gap-4",
|
|
8928
8947
|
style: { maxHeight: "50vh", overflowY: "auto" },
|
|
8929
8948
|
children: [
|
|
8930
|
-
(t.notifications || []).map((s, n) => /* @__PURE__ */ f(
|
|
8949
|
+
(t.notifications || []).map((s, n) => /* @__PURE__ */ f(Ds, { className: "rounded-md p-4", bordered: !0, children: [
|
|
8931
8950
|
/* @__PURE__ */ f("div", { className: "flex items-start justify-between", children: [
|
|
8932
|
-
/* @__PURE__ */
|
|
8933
|
-
/* @__PURE__ */ c("h4", { className: "text-sm text-black font-medium", children: s.channelLabel }),
|
|
8934
|
-
/* @__PURE__ */ c("span", { className: "text-xs text-gray-500 mt-1", children: Jt(
|
|
8935
|
-
s.sentAt,
|
|
8936
|
-
e?.ianaTimeZoneId,
|
|
8937
|
-
!0
|
|
8938
|
-
) })
|
|
8939
|
-
] }),
|
|
8951
|
+
/* @__PURE__ */ c("div", { className: "flex flex-col", children: /* @__PURE__ */ c("h4", { className: "text-sm text-black font-medium", children: s.channelLabel }) }),
|
|
8940
8952
|
/* @__PURE__ */ f("span", { className: "text-[11px] px-2 py-1 rounded-full bg-green-50 text-green-700 border border-green-200", children: [
|
|
8941
8953
|
s.delivered,
|
|
8942
8954
|
"/",
|
|
@@ -8944,13 +8956,6 @@ function Nc({ data: t }) {
|
|
|
8944
8956
|
" Delivered"
|
|
8945
8957
|
] })
|
|
8946
8958
|
] }),
|
|
8947
|
-
/* @__PURE__ */ f("div", { className: "mt-4 text-xs", children: [
|
|
8948
|
-
/* @__PURE__ */ f("div", { className: "text-black", children: [
|
|
8949
|
-
" ",
|
|
8950
|
-
s.messageTitle
|
|
8951
|
-
] }),
|
|
8952
|
-
s.messageBody ? /* @__PURE__ */ c("div", { className: "text-gray-600", children: s.messageBody }) : null
|
|
8953
|
-
] }),
|
|
8954
8959
|
/* @__PURE__ */ f("div", { className: "mt-4", children: [
|
|
8955
8960
|
/* @__PURE__ */ f("div", { className: "text-xs text-black font-medium", children: [
|
|
8956
8961
|
"Recipients (",
|
|
@@ -8973,11 +8978,12 @@ function Nc({ data: t }) {
|
|
|
8973
8978
|
}
|
|
8974
8979
|
)
|
|
8975
8980
|
] }),
|
|
8976
|
-
/* @__PURE__ */
|
|
8977
|
-
|
|
8978
|
-
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
+
/* @__PURE__ */ c("span", { className: "text-gray-500", children: r.phone }),
|
|
8982
|
+
r.sentAt ? /* @__PURE__ */ c("span", { className: "text-gray-500", children: jt(
|
|
8983
|
+
r.sentAt,
|
|
8984
|
+
e?.ianaTimeZoneId,
|
|
8985
|
+
!0
|
|
8986
|
+
) }) : null
|
|
8981
8987
|
] }),
|
|
8982
8988
|
/* @__PURE__ */ c(
|
|
8983
8989
|
"span",
|
|
@@ -8995,24 +9001,6 @@ function Nc({ data: t }) {
|
|
|
8995
9001
|
}
|
|
8996
9002
|
)
|
|
8997
9003
|
}
|
|
8998
|
-
// {
|
|
8999
|
-
// key: "rapidsos",
|
|
9000
|
-
// label: "RapidSOS",
|
|
9001
|
-
// children: (
|
|
9002
|
-
// <Card className="rounded-md" bordered>
|
|
9003
|
-
// <div className="flex flex-col gap-2 text-xs">
|
|
9004
|
-
// {(data.rapidSOS || []).map((r, idx) => (
|
|
9005
|
-
// <div key={idx} className="flex justify-between gap-2 border-b border-gray-100 pb-2">
|
|
9006
|
-
// <span className="text-black">{r.event}</span>
|
|
9007
|
-
// <span className="text-gray-500">{r.details || ''}</span>
|
|
9008
|
-
// <span className="text-gray-500">{r.timestamp}</span>
|
|
9009
|
-
// </div>
|
|
9010
|
-
// ))}
|
|
9011
|
-
// {!data.rapidSOS?.length ? <span className="text-gray-500">No RapidSOS records.</span> : null}
|
|
9012
|
-
// </div>
|
|
9013
|
-
// </Card>
|
|
9014
|
-
// ),
|
|
9015
|
-
// },
|
|
9016
9004
|
]
|
|
9017
9005
|
}
|
|
9018
9006
|
) });
|
|
@@ -9032,8 +9020,8 @@ const Tc = ({
|
|
|
9032
9020
|
severity: s || "",
|
|
9033
9021
|
location: n || "",
|
|
9034
9022
|
alertNumber: r ?? ""
|
|
9035
|
-
}, { timeZoneDetails: l } =
|
|
9036
|
-
const y = (d?.status || d?.eventStatus || "").toLowerCase() === "completed" ? "Completed" : "Inprogress", p = d?.createdDate ?
|
|
9023
|
+
}, { timeZoneDetails: l } = ts(), u = i?.length ? i.map((d) => {
|
|
9024
|
+
const y = (d?.status || d?.eventStatus || "").toLowerCase() === "completed" ? "Completed" : "Inprogress", p = d?.createdDate ? jt(d.createdDate, l?.ianaTimeZoneId) : d?.timestamp ? jt(d.timestamp, l?.ianaTimeZoneId) : "";
|
|
9037
9025
|
return {
|
|
9038
9026
|
status: y,
|
|
9039
9027
|
title: d?.status || d?.eventStatus || "Status Update",
|
|
@@ -9085,7 +9073,7 @@ const Tc = ({
|
|
|
9085
9073
|
/* @__PURE__ */ c(Tr, { boxes: d, priority: n })
|
|
9086
9074
|
] });
|
|
9087
9075
|
}, Ic = ({ items: t }) => {
|
|
9088
|
-
const { timeZoneDetails: e } =
|
|
9076
|
+
const { timeZoneDetails: e } = ts(), s = (i) => i.replace(/([a-z])([A-Z])/g, "$1 $2"), r = (() => {
|
|
9089
9077
|
if (!t?.length || t.length < 2) return null;
|
|
9090
9078
|
const i = new Date(t[0].timeStamp).getTime(), a = new Date(t[t.length - 1].timeStamp).getTime(), o = Math.floor((a - i) / 1e3), l = a - i, u = Math.floor(o / 3600), m = Math.floor(o % 3600 / 60), d = o % 60, y = l % 1e3;
|
|
9091
9079
|
return [
|
|
@@ -9098,7 +9086,7 @@ const Tc = ({
|
|
|
9098
9086
|
return /* @__PURE__ */ f("div", { className: "bg-[#F7F7F7] rounded-lg p-4", children: [
|
|
9099
9087
|
/* @__PURE__ */ f("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
9100
9088
|
/* @__PURE__ */ c("div", { className: "font-semibold text-base", children: "Alert Timeline" }),
|
|
9101
|
-
r && /* @__PURE__ */ f(
|
|
9089
|
+
r && /* @__PURE__ */ f(wt, { color: "blue", children: [
|
|
9102
9090
|
"Total Duration: ",
|
|
9103
9091
|
r
|
|
9104
9092
|
] })
|
|
@@ -9113,7 +9101,7 @@ const Tc = ({
|
|
|
9113
9101
|
/* @__PURE__ */ f("div", { className: "text-[#6B7280] text-sm", children: [
|
|
9114
9102
|
"Timestamp:",
|
|
9115
9103
|
" ",
|
|
9116
|
-
|
|
9104
|
+
jt(i.timeStamp, e?.ianaTimeZoneId, !0)
|
|
9117
9105
|
] }),
|
|
9118
9106
|
i.timeElapsed && /* @__PURE__ */ f("div", { className: "text-[#6B7280] text-sm", children: [
|
|
9119
9107
|
"Time Elapsed: ",
|
|
@@ -9135,14 +9123,14 @@ const Tc = ({
|
|
|
9135
9123
|
High: "#FF95004D",
|
|
9136
9124
|
Medium: "#FEF9C2",
|
|
9137
9125
|
Low: "#E0EDFF"
|
|
9138
|
-
},
|
|
9126
|
+
}, Ec = {
|
|
9139
9127
|
"elopement attempt": "elopement",
|
|
9140
9128
|
"elopement completed": "elopement",
|
|
9141
9129
|
"watchlist person detected": "watchlist",
|
|
9142
9130
|
"watch list person detected": "watchlist",
|
|
9143
9131
|
"brandished guns & knives": "weapon",
|
|
9144
9132
|
"brandished guns and knives": "weapon"
|
|
9145
|
-
},
|
|
9133
|
+
}, Oc = ({
|
|
9146
9134
|
isModalOpen: t,
|
|
9147
9135
|
handleModalClose: e,
|
|
9148
9136
|
selectedRow: s,
|
|
@@ -9154,78 +9142,79 @@ const Tc = ({
|
|
|
9154
9142
|
onAlertView: l,
|
|
9155
9143
|
showAlertTimeline: u
|
|
9156
9144
|
}) => {
|
|
9157
|
-
const [m, d] = S(), [y, p] = S(""), [v, k] = S(!1), [b,
|
|
9145
|
+
const [m, d] = S(), [y, p] = S(""), [v, k] = S(!1), [b, B] = S([]), q = pr(null), [Q, x] = S("details"), [C, Z] = S(void 0), R = Dr(), { alerts: G, rules: h, config: g } = Ge(), { timeZoneDetails: M } = ts(), [ie, ye] = S(
|
|
9158
9146
|
null
|
|
9159
|
-
), [
|
|
9160
|
-
const Ie =
|
|
9161
|
-
return Y[
|
|
9162
|
-
/* @__PURE__ */ c(
|
|
9147
|
+
), [O, N] = S(!1), [A, E] = S(!1), [T, D] = S(void 0), [L, _] = S(void 0), [Y, j] = S({}), [ce, me] = S({}), Oe = (w, H, ae) => {
|
|
9148
|
+
const Ie = ce[w];
|
|
9149
|
+
return Y[w] === !1 && !Ie ? /* @__PURE__ */ f("div", { className: "w-full flex flex-col items-center justify-center min-h-[200px] bg-gray-100 rounded-lg gap-2 text-gray-400", children: [
|
|
9150
|
+
/* @__PURE__ */ c(Er, { size: 40 }),
|
|
9163
9151
|
/* @__PURE__ */ c("span", { className: "text-sm", children: "Media not available" })
|
|
9164
9152
|
] }) : /* @__PURE__ */ f("div", { className: "relative w-full flex justify-center items-center min-h-[200px]", children: [
|
|
9165
9153
|
Ie && /* @__PURE__ */ c("div", { className: "absolute inset-0 flex items-center justify-center bg-gray-100 rounded-lg z-10", children: /* @__PURE__ */ c(Qa, { size: 32, className: "animate-spin text-gray-400" }) }),
|
|
9166
9154
|
/* @__PURE__ */ c(
|
|
9167
9155
|
bc,
|
|
9168
9156
|
{
|
|
9169
|
-
url:
|
|
9157
|
+
url: w,
|
|
9170
9158
|
alt: H.caption || `media-${ae}`,
|
|
9171
9159
|
isLoading: Ie,
|
|
9172
9160
|
priority: be,
|
|
9173
|
-
detections:
|
|
9174
|
-
onLoadSuccess: () =>
|
|
9175
|
-
onError: () =>
|
|
9161
|
+
detections: Be,
|
|
9162
|
+
onLoadSuccess: () => me((Re) => ({ ...Re, [w]: !1 })),
|
|
9163
|
+
onError: () => me((Re) => ({ ...Re, [w]: !1 }))
|
|
9176
9164
|
}
|
|
9177
9165
|
)
|
|
9178
9166
|
] });
|
|
9179
9167
|
}, te = s?.originalData || {}, {
|
|
9180
9168
|
eventName: Se,
|
|
9181
9169
|
eventDisplayName: ke,
|
|
9182
|
-
anomalyName:
|
|
9170
|
+
anomalyName: pe,
|
|
9183
9171
|
alertId: P,
|
|
9184
9172
|
timestamp: W,
|
|
9185
|
-
description:
|
|
9186
|
-
spaceName:
|
|
9187
|
-
assignTeam:
|
|
9173
|
+
description: ge,
|
|
9174
|
+
spaceName: ue,
|
|
9175
|
+
assignTeam: Ve,
|
|
9188
9176
|
priority: be,
|
|
9189
9177
|
statusType: Ke,
|
|
9190
9178
|
id: Me,
|
|
9191
9179
|
alertDetails: Ne,
|
|
9192
|
-
statusHistory:
|
|
9180
|
+
statusHistory: Pt,
|
|
9193
9181
|
mediaDetails: pt,
|
|
9194
|
-
alertNumber:
|
|
9195
|
-
} = te, nt = te.bbox_xyxy,
|
|
9182
|
+
alertNumber: Nt
|
|
9183
|
+
} = te, nt = te.bbox_xyxy, Be = ve(
|
|
9196
9184
|
() => nt ? [{ bbox_xyxy: nt, personName: te.personName }] : [],
|
|
9197
9185
|
[nt, te.personName]
|
|
9198
|
-
),
|
|
9199
|
-
const H = String(
|
|
9186
|
+
), Tt = g.tenant === "snl" ? ke || Se || "Alert Event" : Se || "Alert Event", bt = (w) => {
|
|
9187
|
+
const H = String(w || "").toLowerCase();
|
|
9200
9188
|
return H === "delivered" || H === "sent" ? "Delivered" : H === "failed" ? "Failed" : "Queued";
|
|
9201
|
-
}, xe = (
|
|
9202
|
-
name:
|
|
9203
|
-
role:
|
|
9204
|
-
phone:
|
|
9205
|
-
status:
|
|
9206
|
-
notificationReceipientType:
|
|
9207
|
-
|
|
9208
|
-
|
|
9189
|
+
}, xe = (w) => ({
|
|
9190
|
+
name: w?.receipientName || w?.recipientName || "-",
|
|
9191
|
+
role: w?.receipientRoleName || "",
|
|
9192
|
+
phone: w?.receipentPhoneNumber || w?.recipientPhoneNumber || w?.receipientEmail || w?.recipientEmail || "",
|
|
9193
|
+
status: bt(w?.messageStatus),
|
|
9194
|
+
notificationReceipientType: w?.notificationReceipientType || "",
|
|
9195
|
+
sentAt: w?.sentAt || ""
|
|
9196
|
+
}), It = (w, H) => {
|
|
9197
|
+
const ae = H.map(xe), Ie = ae.filter((le) => le.status === "Delivered").length, Re = H.map((le) => le?.sentAt).filter(Boolean).sort((le, Tn) => new Date(le).getTime() - new Date(Tn).getTime())[0], fe = `${w} Notification`;
|
|
9209
9198
|
return {
|
|
9210
|
-
channelLabel: `${
|
|
9199
|
+
channelLabel: `${w} Notification`,
|
|
9211
9200
|
sentAt: Re || "",
|
|
9212
|
-
messageTitle:
|
|
9201
|
+
messageTitle: fe,
|
|
9213
9202
|
messageBody: "",
|
|
9214
9203
|
total: ae.length,
|
|
9215
9204
|
delivered: Ie,
|
|
9216
9205
|
recipients: ae
|
|
9217
9206
|
};
|
|
9218
|
-
},
|
|
9207
|
+
}, Os = (w) => {
|
|
9219
9208
|
const H = /* @__PURE__ */ new Map();
|
|
9220
|
-
return (
|
|
9209
|
+
return (w || []).forEach((ae) => {
|
|
9221
9210
|
const Ie = String(ae?.notificationType || "Unknown"), Re = H.get(Ie) || [];
|
|
9222
9211
|
Re.push(ae), H.set(Ie, Re);
|
|
9223
9212
|
}), Array.from(H.entries()).map(
|
|
9224
|
-
([ae, Ie]) =>
|
|
9213
|
+
([ae, Ie]) => It(ae, Ie)
|
|
9225
9214
|
);
|
|
9226
|
-
},
|
|
9215
|
+
}, Ms = async (w) => {
|
|
9227
9216
|
try {
|
|
9228
|
-
const H = await G.getAlertNotifications(
|
|
9217
|
+
const H = await G.getAlertNotifications(w), ae = Os(H);
|
|
9229
9218
|
Z(ae);
|
|
9230
9219
|
} catch {
|
|
9231
9220
|
Z(void 0);
|
|
@@ -9233,23 +9222,23 @@ const Tc = ({
|
|
|
9233
9222
|
};
|
|
9234
9223
|
oe(() => {
|
|
9235
9224
|
if (Q !== "track" || !Me) return;
|
|
9236
|
-
let
|
|
9237
|
-
return
|
|
9238
|
-
|
|
9225
|
+
let w = !1;
|
|
9226
|
+
return Ms(Me).then(() => {
|
|
9227
|
+
w && Z(void 0);
|
|
9239
9228
|
}), () => {
|
|
9240
|
-
|
|
9229
|
+
w = !0;
|
|
9241
9230
|
};
|
|
9242
9231
|
}, [Q, Me]), oe(() => {
|
|
9243
9232
|
if (!P) {
|
|
9244
|
-
|
|
9233
|
+
B([]);
|
|
9245
9234
|
return;
|
|
9246
9235
|
}
|
|
9247
9236
|
(async () => {
|
|
9248
9237
|
try {
|
|
9249
9238
|
const H = await G.getAlertTimeline?.(String(P));
|
|
9250
|
-
|
|
9239
|
+
B(H || []);
|
|
9251
9240
|
} catch {
|
|
9252
|
-
|
|
9241
|
+
B([]);
|
|
9253
9242
|
}
|
|
9254
9243
|
})();
|
|
9255
9244
|
}, [P]), oe(() => {
|
|
@@ -9264,61 +9253,61 @@ const Tc = ({
|
|
|
9264
9253
|
]);
|
|
9265
9254
|
}, [t]), oe(() => {
|
|
9266
9255
|
if (!t || g.tenant !== "snl") return;
|
|
9267
|
-
let
|
|
9256
|
+
let w = !1;
|
|
9268
9257
|
return N(!0), h.getLookups().then((H) => {
|
|
9269
|
-
|
|
9258
|
+
w || (ye(H.alertStatusTypes ?? []), N(!1));
|
|
9270
9259
|
}).catch(() => {
|
|
9271
|
-
|
|
9260
|
+
w || (ye([]), N(!1));
|
|
9272
9261
|
}), () => {
|
|
9273
|
-
|
|
9262
|
+
w = !0;
|
|
9274
9263
|
};
|
|
9275
9264
|
}, [t, g.tenant]);
|
|
9276
|
-
const
|
|
9277
|
-
const H = String(
|
|
9265
|
+
const wn = o === "archived" || ["completed", "false positive"].includes(String(Ke || "").toLowerCase()), An = (w) => {
|
|
9266
|
+
const H = String(w?.value || "").toLowerCase(), ae = String(w?.statusName || "").toLowerCase();
|
|
9278
9267
|
return H.includes("reopen") || ae.includes("reopen");
|
|
9279
|
-
},
|
|
9280
|
-
const H =
|
|
9281
|
-
return typeof o < "u" ? o === "archived" ? H : !H :
|
|
9282
|
-
}).map((
|
|
9268
|
+
}, Nn = String(pe || "").trim().toLowerCase(), U = Ec[Nn] ?? "general", se = r.filter((w) => {
|
|
9269
|
+
const H = An(w);
|
|
9270
|
+
return typeof o < "u" ? o === "archived" ? H : !H : wn ? H : !H;
|
|
9271
|
+
}).map((w) => ({ value: w.value, label: w.statusName })), J = ie ?? [], V = (w) => !!w.isWatchListStatus, de = (w) => !!w.isWeapontStatus, z = J.filter((w) => {
|
|
9283
9272
|
switch (U) {
|
|
9284
9273
|
case "elopement":
|
|
9285
|
-
return
|
|
9274
|
+
return w.isElopementStatus;
|
|
9286
9275
|
case "watchlist":
|
|
9287
|
-
return
|
|
9276
|
+
return V(w);
|
|
9288
9277
|
case "weapon":
|
|
9289
|
-
return
|
|
9278
|
+
return de(w);
|
|
9290
9279
|
default:
|
|
9291
|
-
return !
|
|
9280
|
+
return !w.isElopementStatus && !V(w) && !de(w);
|
|
9292
9281
|
}
|
|
9293
|
-
}).map((
|
|
9282
|
+
}).map((w) => ({ value: w.alertStatusTypeName, label: w.alertStatusTypeName })), ne = g.tenant === "snl" && ie !== null ? z : se, rt = ve(() => Nr(pt), [pt]);
|
|
9294
9283
|
return oe(() => {
|
|
9295
|
-
let
|
|
9296
|
-
const H = new AbortController(), ae = async (
|
|
9297
|
-
if (
|
|
9298
|
-
|
|
9284
|
+
let w = !1;
|
|
9285
|
+
const H = new AbortController(), ae = async (fe) => {
|
|
9286
|
+
if (fe) {
|
|
9287
|
+
w || j((le) => ({ ...le, [fe]: !1 }));
|
|
9299
9288
|
try {
|
|
9300
|
-
const
|
|
9301
|
-
if (
|
|
9302
|
-
|
|
9289
|
+
const le = await fetch(fe, { method: "HEAD", signal: H.signal });
|
|
9290
|
+
if (le.ok) {
|
|
9291
|
+
w || j((Wt) => ({ ...Wt, [fe]: !0 }));
|
|
9303
9292
|
return;
|
|
9304
9293
|
}
|
|
9305
|
-
if (
|
|
9306
|
-
|
|
9294
|
+
if (le.status === 404) {
|
|
9295
|
+
w || j((Wt) => ({ ...Wt, [fe]: !1 }));
|
|
9307
9296
|
return;
|
|
9308
9297
|
}
|
|
9309
|
-
if (!(await fetch(
|
|
9310
|
-
|
|
9298
|
+
if (!(await fetch(fe, { method: "GET", signal: H.signal })).ok) throw new Error("Media not available");
|
|
9299
|
+
w || j((Wt) => ({ ...Wt, [fe]: !0 }));
|
|
9311
9300
|
} catch {
|
|
9312
|
-
|
|
9301
|
+
w || j((le) => ({ ...le, [fe]: !1 }));
|
|
9313
9302
|
}
|
|
9314
9303
|
}
|
|
9315
9304
|
};
|
|
9316
9305
|
j({});
|
|
9317
|
-
const Ie = rt.filter((
|
|
9318
|
-
return Ie.forEach((
|
|
9319
|
-
Re[
|
|
9320
|
-
}),
|
|
9321
|
-
|
|
9306
|
+
const Ie = rt.filter((fe) => !Gs(fe)).map((fe) => fe?.mediaUrl || fe).filter((fe) => typeof fe == "string" && fe.length > 0), Re = {};
|
|
9307
|
+
return Ie.forEach((fe) => {
|
|
9308
|
+
Re[fe] = !0;
|
|
9309
|
+
}), me(Re), Ie.forEach((fe) => ae(fe)), () => {
|
|
9310
|
+
w = !0, H.abort();
|
|
9322
9311
|
};
|
|
9323
9312
|
}, [rt]), /* @__PURE__ */ c(
|
|
9324
9313
|
zi,
|
|
@@ -9338,16 +9327,16 @@ const Tc = ({
|
|
|
9338
9327
|
/* @__PURE__ */ c(ze, { type: "primary", onClick: async () => {
|
|
9339
9328
|
try {
|
|
9340
9329
|
k(!0);
|
|
9341
|
-
const
|
|
9330
|
+
const w = {
|
|
9342
9331
|
alertUniqueId: P,
|
|
9343
9332
|
alertId: Me,
|
|
9344
9333
|
status: m ? String(m) : void 0,
|
|
9345
9334
|
notes: y.trim(),
|
|
9346
9335
|
modifiedBy: 0
|
|
9347
|
-
}, H = await R.mutateAsync(
|
|
9336
|
+
}, H = await R.mutateAsync(w);
|
|
9348
9337
|
if (H?.responseStatus || H?.Success) {
|
|
9349
9338
|
const ae = H?.Message || H?.data || "Alert updated successfully.";
|
|
9350
|
-
|
|
9339
|
+
Ee.success(ae, {
|
|
9351
9340
|
autoClose: 1500,
|
|
9352
9341
|
onClose: () => {
|
|
9353
9342
|
n(), e();
|
|
@@ -9355,20 +9344,20 @@ const Tc = ({
|
|
|
9355
9344
|
}), d(void 0), p("");
|
|
9356
9345
|
} else {
|
|
9357
9346
|
const ae = H?.errorMessage || H?.Message || "Failed to update alert status";
|
|
9358
|
-
|
|
9347
|
+
Ee.error(ae);
|
|
9359
9348
|
}
|
|
9360
|
-
} catch (
|
|
9361
|
-
console.error("Error updating alert status:",
|
|
9349
|
+
} catch (w) {
|
|
9350
|
+
console.error("Error updating alert status:", w), Ee.error("Failed to update alert status. Please try again.");
|
|
9362
9351
|
} finally {
|
|
9363
9352
|
k(!1);
|
|
9364
9353
|
}
|
|
9365
9354
|
}, loading: v, children: v ? "Saving..." : "Save Changes" })
|
|
9366
9355
|
] }) : null,
|
|
9367
9356
|
children: s && /* @__PURE__ */ c(
|
|
9368
|
-
|
|
9357
|
+
on,
|
|
9369
9358
|
{
|
|
9370
9359
|
activeKey: Q,
|
|
9371
|
-
onChange: (
|
|
9360
|
+
onChange: (w) => x(w),
|
|
9372
9361
|
items: [
|
|
9373
9362
|
{
|
|
9374
9363
|
key: "details",
|
|
@@ -9380,7 +9369,7 @@ const Tc = ({
|
|
|
9380
9369
|
style: { maxHeight: "50vh", overflowY: "auto" },
|
|
9381
9370
|
children: [
|
|
9382
9371
|
/* @__PURE__ */ f("div", { className: "flex flex-col gap-2", children: [
|
|
9383
|
-
/* @__PURE__ */ c("div", { className: "text-sm font-bold", children:
|
|
9372
|
+
/* @__PURE__ */ c("div", { className: "text-sm font-bold", children: Tt }),
|
|
9384
9373
|
Ne?.firstName ? /* @__PURE__ */ f("div", { className: "text-sm text-gray-500", children: [
|
|
9385
9374
|
"Resident ID/Name: ",
|
|
9386
9375
|
Ne?.firstName,
|
|
@@ -9393,24 +9382,24 @@ const Tc = ({
|
|
|
9393
9382
|
/* @__PURE__ */ f("div", { className: "text-sm text-gray-500", children: [
|
|
9394
9383
|
"Timestamp:",
|
|
9395
9384
|
" ",
|
|
9396
|
-
|
|
9385
|
+
jt(W, M?.ianaTimeZoneId)
|
|
9397
9386
|
] }),
|
|
9398
9387
|
/* @__PURE__ */ f("div", { className: "font-sm text-gray-500", children: [
|
|
9399
9388
|
/* @__PURE__ */ c("b", { className: "text-black text-sm/6", children: "Description:" }),
|
|
9400
9389
|
" ",
|
|
9401
|
-
|
|
9390
|
+
ge || "No description available"
|
|
9402
9391
|
] }),
|
|
9403
|
-
|
|
9392
|
+
ue && /* @__PURE__ */ f("div", { className: "font-sm text-gray-500", children: [
|
|
9404
9393
|
"Space: ",
|
|
9405
|
-
|
|
9394
|
+
ue
|
|
9406
9395
|
] }),
|
|
9407
|
-
|
|
9396
|
+
Ve && /* @__PURE__ */ f("div", { className: "font-sm text-gray-500", children: [
|
|
9408
9397
|
"Assigned to: ",
|
|
9409
|
-
|
|
9398
|
+
Ve
|
|
9410
9399
|
] }),
|
|
9411
9400
|
/* @__PURE__ */ f("div", { className: "flex gap-2 justify-start mt-3", children: [
|
|
9412
9401
|
/* @__PURE__ */ f(
|
|
9413
|
-
|
|
9402
|
+
wt,
|
|
9414
9403
|
{
|
|
9415
9404
|
className: "font-sm text-gray-500 rounded-[8px] py-2 px-3",
|
|
9416
9405
|
style: {
|
|
@@ -9424,7 +9413,7 @@ const Tc = ({
|
|
|
9424
9413
|
}
|
|
9425
9414
|
),
|
|
9426
9415
|
/* @__PURE__ */ f(
|
|
9427
|
-
|
|
9416
|
+
wt,
|
|
9428
9417
|
{
|
|
9429
9418
|
className: "font-sm text-gray-500 rounded-[8px] py-2 px-3",
|
|
9430
9419
|
style: String(Ke || "").toLowerCase() === "completed" ? {
|
|
@@ -9443,14 +9432,14 @@ const Tc = ({
|
|
|
9443
9432
|
] }),
|
|
9444
9433
|
/* @__PURE__ */ c("div", { className: "w-full flex flex-col justify-start items-start mt-2 font-bold", children: /* @__PURE__ */ f("div", { className: "w-full mt-4", children: [
|
|
9445
9434
|
/* @__PURE__ */ c("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ c(
|
|
9446
|
-
|
|
9435
|
+
Pe,
|
|
9447
9436
|
{
|
|
9448
9437
|
placeholder: "Change Status",
|
|
9449
9438
|
className: "w-full text-gray-500",
|
|
9450
|
-
onChange: (
|
|
9439
|
+
onChange: (w) => d(w),
|
|
9451
9440
|
value: m,
|
|
9452
9441
|
options: ne,
|
|
9453
|
-
loading: g.tenant === "snl" ?
|
|
9442
|
+
loading: g.tenant === "snl" ? O : i
|
|
9454
9443
|
}
|
|
9455
9444
|
) }),
|
|
9456
9445
|
/* @__PURE__ */ f("div", { className: "flex flex-col gap-2 mt-3", children: [
|
|
@@ -9469,7 +9458,7 @@ const Tc = ({
|
|
|
9469
9458
|
placeholder: "Enter details...",
|
|
9470
9459
|
className: "w-full text-gray-500 h-20 border border-grey-500 rounded-md p-2",
|
|
9471
9460
|
value: y,
|
|
9472
|
-
onChange: (
|
|
9461
|
+
onChange: (w) => p(w.target.value)
|
|
9473
9462
|
}
|
|
9474
9463
|
)
|
|
9475
9464
|
] })
|
|
@@ -9502,8 +9491,8 @@ const Tc = ({
|
|
|
9502
9491
|
)
|
|
9503
9492
|
] }) : null
|
|
9504
9493
|
] }),
|
|
9505
|
-
rt.length ? /* @__PURE__ */ c("div", { className: "w-full", children: /* @__PURE__ */ c(Hi, { ref: q, dots: !0, className: "w-full", children: rt.map((
|
|
9506
|
-
const ae =
|
|
9494
|
+
rt.length ? /* @__PURE__ */ c("div", { className: "w-full", children: /* @__PURE__ */ c(Hi, { ref: q, dots: !0, className: "w-full", children: rt.map((w, H) => {
|
|
9495
|
+
const ae = w.mediaUrl || w, Ie = Gs(w);
|
|
9507
9496
|
return /* @__PURE__ */ f(
|
|
9508
9497
|
"div",
|
|
9509
9498
|
{
|
|
@@ -9521,13 +9510,13 @@ const Tc = ({
|
|
|
9521
9510
|
"Your browser does not support the video tag."
|
|
9522
9511
|
]
|
|
9523
9512
|
}
|
|
9524
|
-
) :
|
|
9525
|
-
|
|
9513
|
+
) : Oe(String(ae), w, H),
|
|
9514
|
+
w.caption && /* @__PURE__ */ c("p", { className: "text-xs text-gray-500 mt-1", children: w.caption }),
|
|
9526
9515
|
!Ie && Y[String(ae)] ? /* @__PURE__ */ c(
|
|
9527
9516
|
"button",
|
|
9528
9517
|
{
|
|
9529
9518
|
onClick: () => {
|
|
9530
|
-
|
|
9519
|
+
E(!0), D(ae), _(w.type || "image");
|
|
9531
9520
|
},
|
|
9532
9521
|
className: "absolute bottom-3 right-3 text-white bg-black/50 rounded-full p-2 hover:bg-black/70",
|
|
9533
9522
|
children: /* @__PURE__ */ c(eo, { size: 20 })
|
|
@@ -9544,11 +9533,11 @@ const Tc = ({
|
|
|
9544
9533
|
/* @__PURE__ */ c(
|
|
9545
9534
|
kr,
|
|
9546
9535
|
{
|
|
9547
|
-
isOpen:
|
|
9548
|
-
onClose: () =>
|
|
9536
|
+
isOpen: A,
|
|
9537
|
+
onClose: () => E(!1),
|
|
9549
9538
|
src: T || "",
|
|
9550
9539
|
type: L || "image",
|
|
9551
|
-
detections:
|
|
9540
|
+
detections: Be,
|
|
9552
9541
|
priority: be
|
|
9553
9542
|
}
|
|
9554
9543
|
)
|
|
@@ -9565,9 +9554,9 @@ const Tc = ({
|
|
|
9565
9554
|
alertId: P,
|
|
9566
9555
|
id: Me,
|
|
9567
9556
|
priority: be,
|
|
9568
|
-
spaceName:
|
|
9569
|
-
alertNumber:
|
|
9570
|
-
statusHistory:
|
|
9557
|
+
spaceName: ue,
|
|
9558
|
+
alertNumber: Nt,
|
|
9559
|
+
statusHistory: Pt,
|
|
9571
9560
|
notifGroups: C
|
|
9572
9561
|
}
|
|
9573
9562
|
)
|
|
@@ -9579,7 +9568,7 @@ const Tc = ({
|
|
|
9579
9568
|
);
|
|
9580
9569
|
};
|
|
9581
9570
|
function Mc() {
|
|
9582
|
-
const { alerts: t } = Ge(), e =
|
|
9571
|
+
const { alerts: t } = Ge(), e = ln({
|
|
9583
9572
|
queryKey: ["alerts", "statusList"],
|
|
9584
9573
|
queryFn: () => t.getAlertStatusList(),
|
|
9585
9574
|
staleTime: 5 * 6e4
|
|
@@ -9603,9 +9592,9 @@ function Ri({
|
|
|
9603
9592
|
onAlertView: l,
|
|
9604
9593
|
showAlertTimeline: u
|
|
9605
9594
|
}) {
|
|
9606
|
-
const [m, d] = S(!1), [y, p] = S(null), [v, k] = S("details"), { list: b, loading:
|
|
9607
|
-
function C(ie,
|
|
9608
|
-
p(ie), k(
|
|
9595
|
+
const [m, d] = S(!1), [y, p] = S(null), [v, k] = S("details"), { list: b, loading: B } = Mc(), { timeZoneDetails: q } = ts(), Q = q?.timeZoneName ?? "UTC", x = q?.ianaTimeZoneId ?? "UTC";
|
|
9596
|
+
function C(ie, ye) {
|
|
9597
|
+
p(ie), k(ye?.tab ?? "details"), G(ye?.sourceTab ?? "active"), d(!0);
|
|
9609
9598
|
}
|
|
9610
9599
|
function Z() {
|
|
9611
9600
|
d(!1);
|
|
@@ -9625,14 +9614,14 @@ function Ri({
|
|
|
9625
9614
|
/* @__PURE__ */ c("div", { className: "flex items-center justify-start sm:justify-center", children: /* @__PURE__ */ c(uc, { label: Q, timeZone: x }) })
|
|
9626
9615
|
] }),
|
|
9627
9616
|
/* @__PURE__ */ c(
|
|
9628
|
-
|
|
9617
|
+
on,
|
|
9629
9618
|
{
|
|
9630
9619
|
defaultActiveKey: "active",
|
|
9631
9620
|
className: "w-full",
|
|
9632
9621
|
tabBarStyle: { fontSize: "medium" },
|
|
9633
9622
|
onChange: (ie) => {
|
|
9634
|
-
const
|
|
9635
|
-
g((
|
|
9623
|
+
const ye = ie === "archived";
|
|
9624
|
+
g((O) => O + 1), a?.(1), o?.({ isArchived: ye });
|
|
9636
9625
|
},
|
|
9637
9626
|
items: [
|
|
9638
9627
|
{
|
|
@@ -9690,7 +9679,7 @@ function Ri({
|
|
|
9690
9679
|
}
|
|
9691
9680
|
),
|
|
9692
9681
|
/* @__PURE__ */ c(
|
|
9693
|
-
|
|
9682
|
+
Oc,
|
|
9694
9683
|
{
|
|
9695
9684
|
isModalOpen: m,
|
|
9696
9685
|
handleModalClose: Z,
|
|
@@ -9698,7 +9687,7 @@ function Ri({
|
|
|
9698
9687
|
fetchAlertLogs: () => {
|
|
9699
9688
|
},
|
|
9700
9689
|
alertStatusList: b,
|
|
9701
|
-
alertStatusLoading:
|
|
9690
|
+
alertStatusLoading: B,
|
|
9702
9691
|
initialTab: v,
|
|
9703
9692
|
sourceTab: R,
|
|
9704
9693
|
onAlertView: l,
|
|
@@ -9755,7 +9744,7 @@ function Cc(t) {
|
|
|
9755
9744
|
return Array.isArray(t) ? { items: t } : t;
|
|
9756
9745
|
}
|
|
9757
9746
|
function Rc(t = 1, e) {
|
|
9758
|
-
const { alerts: s, config: n } = Ge(), r = n.tenant === "schools" && !!String(e?.searchText ?? "").trim(), i =
|
|
9747
|
+
const { alerts: s, config: n } = Ge(), r = n.tenant === "schools" && !!String(e?.searchText ?? "").trim(), i = ln({
|
|
9759
9748
|
queryKey: ["alerts", "list", n.tenant, t, e],
|
|
9760
9749
|
queryFn: () => {
|
|
9761
9750
|
const a = { ...e };
|
|
@@ -9858,7 +9847,7 @@ function Zc({
|
|
|
9858
9847
|
) });
|
|
9859
9848
|
}
|
|
9860
9849
|
function zc(t) {
|
|
9861
|
-
const { alerts: e } = Ge(), s =
|
|
9850
|
+
const { alerts: e } = Ge(), s = ln({
|
|
9862
9851
|
queryKey: ["alerts", "report", t],
|
|
9863
9852
|
queryFn: () => e.getAlertsReport(t),
|
|
9864
9853
|
staleTime: 6e4
|
|
@@ -9885,8 +9874,8 @@ export {
|
|
|
9885
9874
|
Da as ApiProvider,
|
|
9886
9875
|
lc as ArchivedTable,
|
|
9887
9876
|
uc as Clock,
|
|
9888
|
-
|
|
9889
|
-
|
|
9877
|
+
Ba as DataTable,
|
|
9878
|
+
Bc as MyPreferencesPanel,
|
|
9890
9879
|
gc as SettingsPanel,
|
|
9891
9880
|
Sc as SettingsTabs,
|
|
9892
9881
|
Hc as exampleAlertColumns,
|