@ssgc/alert-console 2.9.3 → 2.9.4

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.es.js CHANGED
@@ -310,7 +310,7 @@ function ci() {
310
310
  } }, E = "en", V = {};
311
311
  V[E] = F;
312
312
  var R = "$isDayjsObject", G = function(L) {
313
- return L instanceof oe || !(!L || !L[R]);
313
+ return L instanceof ie || !(!L || !L[R]);
314
314
  }, h = function L(A, w, x) {
315
315
  var N;
316
316
  if (!A) return E;
@@ -327,12 +327,12 @@ function ci() {
327
327
  }, v = function(L, A) {
328
328
  if (G(L)) return L.clone();
329
329
  var w = typeof A == "object" ? A : {};
330
- return w.date = L, w.args = arguments, new oe(w);
330
+ return w.date = L, w.args = arguments, new ie(w);
331
331
  }, M = T;
332
332
  M.l = h, M.i = G, M.w = function(L, A) {
333
333
  return v(L, { locale: A.$L, utc: A.$u, x: A.$x, $offset: A.$offset });
334
334
  };
335
- var oe = (function() {
335
+ var ie = (function() {
336
336
  function L(w) {
337
337
  this.$L = h(w.locale, null, !0), this.parse(w), this.$x = this.$x || w.x || {}, this[R] = !0;
338
338
  }
@@ -373,11 +373,11 @@ function ci() {
373
373
  }, A.valueOf = function() {
374
374
  return this.$d.getTime();
375
375
  }, A.startOf = function(w, x) {
376
- var N = this, U = !!M.u(x) || x, P = M.p(w), Y = function(we, ie) {
377
- var ce = M.w(N.$u ? Date.UTC(N.$y, ie, we) : new Date(N.$y, ie, we), N);
378
- return U ? ce : ce.endOf(u);
379
- }, J = function(we, ie) {
380
- return M.w(N.toDate()[we].apply(N.toDate("s"), (U ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(ie)), N);
376
+ var N = this, U = !!M.u(x) || x, P = M.p(w), Y = function(we, ae) {
377
+ var le = M.w(N.$u ? Date.UTC(N.$y, ae, we) : new Date(N.$y, ae, we), N);
378
+ return U ? le : le.endOf(u);
379
+ }, J = function(we, ae) {
380
+ return M.w(N.toDate()[we].apply(N.toDate("s"), (U ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(ae)), N);
381
381
  }, ne = this.$W, j = this.$M, de = this.$D, Ie = "set" + (this.$u ? "UTC" : "");
382
382
  switch (P) {
383
383
  case p:
@@ -385,7 +385,7 @@ function ci() {
385
385
  case m:
386
386
  return U ? Y(1, j) : Y(0, j + 1);
387
387
  case d:
388
- var le = this.$locale().weekStart || 0, he = (ne < le ? ne + 7 : ne) - le;
388
+ var oe = this.$locale().weekStart || 0, he = (ne < oe ? ne + 7 : ne) - oe;
389
389
  return Y(U ? de - he : de + (6 - he), j);
390
390
  case u:
391
391
  case k:
@@ -430,16 +430,16 @@ function ci() {
430
430
  }, A.format = function(w) {
431
431
  var x = this, N = this.$locale();
432
432
  if (!this.isValid()) return N.invalidDate || D;
433
- var U = w || "YYYY-MM-DDTHH:mm:ssZ", P = M.z(this), Y = this.$H, J = this.$m, ne = this.$M, j = N.weekdays, de = N.months, Ie = N.meridiem, le = function(ie, ce, ke, ze) {
434
- return ie && (ie[ce] || ie(x, U)) || ke[ce].slice(0, ze);
435
- }, he = function(ie) {
436
- return M.s(Y % 12 || 12, ie, "0");
437
- }, we = Ie || function(ie, ce, ke) {
438
- var ze = ie < 12 ? "AM" : "PM";
433
+ var U = w || "YYYY-MM-DDTHH:mm:ssZ", P = M.z(this), Y = this.$H, J = this.$m, ne = this.$M, j = N.weekdays, de = N.months, Ie = N.meridiem, oe = function(ae, le, ke, ze) {
434
+ return ae && (ae[le] || ae(x, U)) || ke[le].slice(0, ze);
435
+ }, he = function(ae) {
436
+ return M.s(Y % 12 || 12, ae, "0");
437
+ }, we = Ie || function(ae, le, ke) {
438
+ var ze = ae < 12 ? "AM" : "PM";
439
439
  return ke ? ze.toLowerCase() : ze;
440
440
  };
441
- return U.replace(q, (function(ie, ce) {
442
- return ce || (function(ke) {
441
+ return U.replace(q, (function(ae, le) {
442
+ return le || (function(ke) {
443
443
  switch (ke) {
444
444
  case "YY":
445
445
  return String(x.$y).slice(-2);
@@ -450,9 +450,9 @@ function ci() {
450
450
  case "MM":
451
451
  return M.s(ne + 1, 2, "0");
452
452
  case "MMM":
453
- return le(N.monthsShort, ne, de, 3);
453
+ return oe(N.monthsShort, ne, de, 3);
454
454
  case "MMMM":
455
- return le(de, ne);
455
+ return oe(de, ne);
456
456
  case "D":
457
457
  return x.$D;
458
458
  case "DD":
@@ -460,9 +460,9 @@ function ci() {
460
460
  case "d":
461
461
  return String(x.$W);
462
462
  case "dd":
463
- return le(N.weekdaysMin, x.$W, j, 2);
463
+ return oe(N.weekdaysMin, x.$W, j, 2);
464
464
  case "ddd":
465
- return le(N.weekdaysShort, x.$W, j, 3);
465
+ return oe(N.weekdaysShort, x.$W, j, 3);
466
466
  case "dddd":
467
467
  return j[x.$W];
468
468
  case "H":
@@ -491,7 +491,7 @@ function ci() {
491
491
  return P;
492
492
  }
493
493
  return null;
494
- })(ie) || P.replace(":", "");
494
+ })(ae) || P.replace(":", "");
495
495
  }));
496
496
  }, A.utcOffset = function() {
497
497
  return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
@@ -547,13 +547,13 @@ function ci() {
547
547
  }, A.toString = function() {
548
548
  return this.$d.toUTCString();
549
549
  }, L;
550
- })(), re = oe.prototype;
550
+ })(), re = ie.prototype;
551
551
  return v.prototype = re, [["$ms", a], ["$s", i], ["$m", l], ["$H", o], ["$W", u], ["$M", m], ["$y", p], ["$D", k]].forEach((function(L) {
552
552
  re[L[1]] = function(A) {
553
553
  return this.$g(A, L[0], L[1]);
554
554
  };
555
555
  })), v.extend = function(L, A) {
556
- return L.$i || (L(A, oe, v), L.$i = !0), v;
556
+ return L.$i || (L(A, ie, v), L.$i = !0), v;
557
557
  }, v.locale = h, v.isDayjs = G, v.unix = function(L) {
558
558
  return v(1e3 * L);
559
559
  }, v.en = V[E], v.Ls = V, v.p = {}, v;
@@ -1694,10 +1694,10 @@ function Tr({ data: t, loading: e = !1, pageSize: s = 10, total: n, currentPage:
1694
1694
  fe(() => {
1695
1695
  D !== void 0 && (F("All"), T("All"), V("All"), G("All"), v(""));
1696
1696
  }, [D]);
1697
- const [M, oe] = g([{ label: "All", value: "All" }]), [re, L] = g([]), [A, w] = g([]), [x, N] = g([]), [U, P] = g(/* @__PURE__ */ new Set()), { rules: Y, alerts: J, config: ne } = Pe(), j = ne.tenant === "transit", de = {
1697
+ const [M, ie] = g([{ label: "All", value: "All" }]), [re, L] = g([]), [A, w] = g([]), [x, N] = g([]), [U, P] = g(/* @__PURE__ */ new Set()), { rules: Y, alerts: J, config: ne } = Pe(), j = ne.tenant === "transit", de = {
1698
1698
  6: { title: "Email", kind: "icon", icon: /* @__PURE__ */ c($a, {}) },
1699
1699
  7: { title: "SMS", kind: "icon", icon: /* @__PURE__ */ c(Fa, {}) }
1700
- }, Ie = ge(() => ki(t), [t]), le = ge(() => Ii(t, j), [t, j]);
1700
+ }, Ie = ge(() => ki(t), [t]), oe = ge(() => Ii(t, j), [t, j]);
1701
1701
  fe(() => {
1702
1702
  if (!J.getAllSpaces) return;
1703
1703
  let ee = !0;
@@ -1731,7 +1731,7 @@ function Tr({ data: t, loading: e = !1, pageSize: s = 10, total: n, currentPage:
1731
1731
  label: Ne.severityName,
1732
1732
  value: String(Ne.severityId)
1733
1733
  }));
1734
- ee && (oe([{ label: "All", value: "All" }, ...me]), We.length && w([{ label: "All Types", value: "All" }, ...We]), Ae.length && N([{ label: "All levels", value: "All" }, ...Ae]));
1734
+ ee && (ie([{ label: "All", value: "All" }, ...me]), We.length && w([{ label: "All Types", value: "All" }, ...We]), Ae.length && N([{ label: "All levels", value: "All" }, ...Ae]));
1735
1735
  } catch (Z) {
1736
1736
  console.error("Error loading filter options", Z);
1737
1737
  }
@@ -1760,7 +1760,7 @@ function Tr({ data: t, loading: e = !1, pageSize: s = 10, total: n, currentPage:
1760
1760
  const Se = ee || q === "All" || Z.priority === q, me = `${Z.id} ${Z.alertNumber} ${Z.description} ${Z.statusType}`.toLowerCase(), xe = !h || me.includes(h.toLowerCase()), We = ee || W === "All" || (Z.anomalyName || "").toLowerCase() === W.toLowerCase(), Ge = ee || E === "All" || (Z.spaceName || "").toLowerCase() === E.toLowerCase(), Ae = ee || !he || R === "All" || kn(Z).includes(Number(R)), Ne = ps(String(Z.statusType || "")), pt = !k || !Nr.some((gt) => Ne.includes(ps(gt)));
1761
1761
  return Se && xe && We && Ge && Ae && pt;
1762
1762
  });
1763
- }, [t, q, h, W, E, R, he, k, C]), ie = l?.length ? l : Ie, ce = C && A.length > 1 ? A : ie, ke = o?.length ? o : le, ze = C && re.length > 1 ? re : ke, He = C && x.length > 1 ? x : i, ct = [
1763
+ }, [t, q, h, W, E, R, he, k, C]), ae = l?.length ? l : Ie, le = C && A.length > 1 ? A : ae, ke = o?.length ? o : oe, ze = C && re.length > 1 ? re : ke, He = C && x.length > 1 ? x : i, ct = [
1764
1764
  {
1765
1765
  title: "Severity",
1766
1766
  dataIndex: "priority",
@@ -1904,7 +1904,7 @@ function Tr({ data: t, loading: e = !1, pageSize: s = 10, total: n, currentPage:
1904
1904
  ] }) }),
1905
1905
  /* @__PURE__ */ c(_, { flex: "none", children: /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
1906
1906
  /* @__PURE__ */ c("span", { children: "Anomaly type" }),
1907
- /* @__PURE__ */ c(Mi, { value: W, onChange: T, options: ce })
1907
+ /* @__PURE__ */ c(Mi, { value: W, onChange: T, options: le })
1908
1908
  ] }) }),
1909
1909
  /* @__PURE__ */ c(_, { flex: "none", children: /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
1910
1910
  /* @__PURE__ */ c("span", { children: j ? "Bus Number" : "Space" }),
@@ -7849,31 +7849,31 @@ function rc(t) {
7849
7849
  setAutoExpire: h,
7850
7850
  onClear: v,
7851
7851
  onSave: M,
7852
- saving: oe,
7852
+ saving: ie,
7853
7853
  onActionTypesLoaded: re
7854
7854
  } = t, { rules: L, config: A } = Pe(), w = A.tenant === "schools", [x, N] = g([]), [U, P] = g([]), [Y, J] = g(!1);
7855
7855
  fe(() => {
7856
- let le = !1;
7856
+ let oe = !1;
7857
7857
  return (async () => {
7858
7858
  try {
7859
7859
  J(!0);
7860
7860
  const he = await L.getLookups();
7861
- if (le || !he || !Array.isArray(he.actionTypes)) return;
7862
- const we = he.actionTypes.map((ce) => ({ label: ce.name, value: String(ce.actionTypeId) }));
7861
+ if (oe || !he || !Array.isArray(he.actionTypes)) return;
7862
+ const we = he.actionTypes.map((le) => ({ label: le.name, value: String(le.actionTypeId) }));
7863
7863
  N(we), re && re(he.actionTypes);
7864
- const ie = Array.isArray(he.thirdParties) ? he.thirdParties.map((ce) => ({ label: ce.thirdPartyName, value: ce.thirdPartyIds ?? ce.thirdPartyId })) : [];
7865
- P(ie);
7864
+ const ae = Array.isArray(he.thirdParties) ? he.thirdParties.map((le) => ({ label: le.thirdPartyName, value: le.thirdPartyIds ?? le.thirdPartyId })) : [];
7865
+ P(ae);
7866
7866
  } catch (he) {
7867
7867
  console.error("Error loading lookups", he);
7868
7868
  } finally {
7869
- le || J(!1);
7869
+ oe || J(!1);
7870
7870
  }
7871
7871
  })(), () => {
7872
- le = !0;
7872
+ oe = !0;
7873
7873
  };
7874
7874
  }, []);
7875
7875
  const ne = typeof i == "number" || typeof o == "number", j = typeof d == "number" || typeof S == "number", de = typeof i == "number" || typeof o == "number" || typeof d == "number" || typeof S == "number" || typeof k == "number" || typeof C == "number" || Array.isArray(F) && F.length > 0 || Array.isArray(T) && T.length > 0 || !!V || !!G;
7876
- return /* @__PURE__ */ y(Ns, { spinning: !!oe || Y, children: [
7876
+ return /* @__PURE__ */ y(Ns, { spinning: !!ie || Y, children: [
7877
7877
  /* @__PURE__ */ y(Fe, { gutter: [16, 16], align: "bottom", children: [
7878
7878
  /* @__PURE__ */ c(_, { xs: 24, sm: 12, md: 8, lg: 4, children: /* @__PURE__ */ y("div", { children: [
7879
7879
  /* @__PURE__ */ c(ot, { className: "text-gray-700 font-medium block mb-1", children: "Rules" }),
@@ -8007,12 +8007,12 @@ function rc(t) {
8007
8007
  ] }),
8008
8008
  /* @__PURE__ */ y(Fe, { gutter: [16, 16], align: "bottom", className: "mt-4 items-center", children: [
8009
8009
  /* @__PURE__ */ c(_, { xs: 24, sm: 12, md: 8, lg: 7, children: /* @__PURE__ */ y("div", { className: "flex items-center h-full gap-8", children: [
8010
- !w && /* @__PURE__ */ c(Et, { checked: V, onChange: (le) => R(le.target.checked), className: "w-full", children: "Human-In-The-Loop" }),
8011
- /* @__PURE__ */ c(Et, { checked: G, onChange: (le) => h(le.target.checked), className: "w-full", children: "Auto-expire in 5 minutes" })
8010
+ !w && /* @__PURE__ */ c(Et, { checked: V, onChange: (oe) => R(oe.target.checked), className: "w-full", children: "Human-In-The-Loop" }),
8011
+ /* @__PURE__ */ c(Et, { checked: G, onChange: (oe) => h(oe.target.checked), className: "w-full", children: "Auto-expire in 5 minutes" })
8012
8012
  ] }) }),
8013
8013
  /* @__PURE__ */ c(_, { xs: 24, sm: 12, md: 8, children: /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
8014
8014
  /* @__PURE__ */ c($e, { onClick: v, children: "Clear" }),
8015
- /* @__PURE__ */ c($e, { type: "primary", onClick: M, loading: !!oe, disabled: !(!!e && de && !oe), children: "Save" })
8015
+ /* @__PURE__ */ c($e, { type: "primary", onClick: M, loading: !!ie, disabled: !(!!e && de && !ie), children: "Save" })
8016
8016
  ] }) })
8017
8017
  ] })
8018
8018
  ] });
@@ -8264,7 +8264,7 @@ function Gs(t) {
8264
8264
  };
8265
8265
  }
8266
8266
  function lc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules: r, onSave: a }) {
8267
- const { rules: i, alerts: l } = Pe(), [o, u] = g("By Severity"), [d, m] = g("By severity"), [S, p] = g("By Severity"), [k, D] = g(!1), [C, q] = g(!1), [F, W] = g(!1), [T, E] = g(null), [V, R] = g("rules"), [G, h] = g(), [v, M] = g(), [oe, re] = g(), [L, A] = g(), [w, x] = g(), [N, U] = g(), [P, Y] = g(), [J, ne] = g(), [j, de] = g([]), [Ie, le] = g([]), [he, we] = g(!1), [ie, ce] = g(!1), [ke, ze] = g({}), [He, ct] = g({}), [ut, ee] = g(s || []), [Z, Se] = g([]), [me, xe] = g(!1), [We, Ge] = g(!1), [Ae, Ne] = g(n || []);
8267
+ const { rules: i, alerts: l } = Pe(), [o, u] = g("By Severity"), [d, m] = g("By severity"), [S, p] = g("By Severity"), [k, D] = g(!1), [C, q] = g(!1), [F, W] = g(!1), [T, E] = g(null), [V, R] = g("rules"), [G, h] = g(), [v, M] = g(), [ie, re] = g(), [L, A] = g(), [w, x] = g(), [N, U] = g(), [P, Y] = g(), [J, ne] = g(), [j, de] = g([]), [Ie, oe] = g([]), [he, we] = g(!1), [ae, le] = g(!1), [ke, ze] = g({}), [He, ct] = g({}), [ut, ee] = g(s || []), [Z, Se] = g([]), [me, xe] = g(!1), [We, Ge] = g(!1), [Ae, Ne] = g(n || []);
8268
8268
  fe(() => {
8269
8269
  n && n.length && Ne(n);
8270
8270
  }, [n]), fe(() => {
@@ -8272,13 +8272,13 @@ function lc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
8272
8272
  const $ = Object.keys(ke).length > 0 || Object.keys(He).length > 0;
8273
8273
  if (Z.length && !$) return;
8274
8274
  const Q = Ae.map((K, f) => {
8275
- const O = e.find((De) => De.RuleId === (K.ruleId || K.ruleName))?.Name || K.ruleName || K.Name || "-", I = Gs(K.escalationSettings), H = typeof I.level1UserRoleId == "number" && I.level1UserRoleId > 0 ? [I.level1UserRoleId] : [], Me = typeof I.level2UserRoleId == "number" && I.level2UserRoleId > 0 ? [I.level2UserRoleId] : [], ae = typeof I.level3UserRoleId == "number" && I.level3UserRoleId > 0 ? [I.level3UserRoleId] : [], rt = (Array.isArray(I.escalationSettingsActionTypeIds) ? I.escalationSettingsActionTypeIds : []).map((De) => ke[De] || String(De)), wn = (Array.isArray(I.thirdPartyId) ? I.thirdPartyId : []).map((De) => He[De] || String(De)), Ds = typeof I.humanLoop == "boolean" ? I.humanLoop : null, Cs = typeof I.isAutoExpire == "boolean" ? I.isAutoExpire : null;
8275
+ const O = e.find((De) => De.RuleId === (K.ruleId || K.ruleName))?.Name || K.ruleName || K.Name || "-", I = Gs(K.escalationSettings), H = typeof I.level1UserRoleId == "number" && I.level1UserRoleId > 0 ? [I.level1UserRoleId] : [], Me = typeof I.level2UserRoleId == "number" && I.level2UserRoleId > 0 ? [I.level2UserRoleId] : [], ce = typeof I.level3UserRoleId == "number" && I.level3UserRoleId > 0 ? [I.level3UserRoleId] : [], rt = (Array.isArray(I.escalationSettingsActionTypeIds) ? I.escalationSettingsActionTypeIds : []).map((De) => ke[De] || String(De)), wn = (Array.isArray(I.thirdPartyId) ? I.thirdPartyId : []).map((De) => He[De] || String(De)), Ds = typeof I.humanLoop == "boolean" ? I.humanLoop : null, Cs = typeof I.isAutoExpire == "boolean" ? I.isAutoExpire : null;
8276
8276
  return {
8277
8277
  id: String(K.ruleId || K.ruleName || f),
8278
8278
  ruleOrSeverityLabel: O,
8279
8279
  l1: { minutes: I.level1PostAssistTime ?? void 0, roles: H },
8280
8280
  l2: { minutes: I.level2PostAssistTime ?? void 0, roles: Me },
8281
- l3: { minutes: I.level3PostAssistTime ?? void 0, roles: ae },
8281
+ l3: { minutes: I.level3PostAssistTime ?? void 0, roles: ce },
8282
8282
  actions: rt,
8283
8283
  notify: wn,
8284
8284
  humanLoop: Ds,
@@ -8333,7 +8333,7 @@ function lc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
8333
8333
  if (f && typeof f == "object") {
8334
8334
  re(Q(f.level1PostAssistTime)), A($(f.level1UserRoleId)), x(Q(f.level2PostAssistTime)), U($(f.level2UserRoleId)), Y(Q(f.level3PostAssistTime)), ne($(f.level3UserRoleId));
8335
8335
  const O = Array.isArray(f.escalationSettingsActionTypeIds) ? f.escalationSettingsActionTypeIds : [];
8336
- de(O.map((I) => String(I))), le(Array.isArray(f.thirdPartyId) ? f.thirdPartyId : []), we(!!f.humanLoop), ce(!!f.isAutoExpire);
8336
+ de(O.map((I) => String(I))), oe(Array.isArray(f.thirdPartyId) ? f.thirdPartyId : []), we(!!f.humanLoop), le(!!f.isAutoExpire);
8337
8337
  }
8338
8338
  }, [V, v, Ae]);
8339
8339
  const St = async () => {
@@ -8342,12 +8342,12 @@ function lc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
8342
8342
  const $ = await i.getRules(), Q = Array.isArray($) ? $ : Array.isArray($?.data) ? $.data : [];
8343
8343
  Ne(Q);
8344
8344
  const K = Q.map((f, O) => {
8345
- const I = e.find((De) => De.RuleId === (f.ruleId || f.ruleName))?.Name || f.ruleName || f.Name || "-", H = Gs(f.escalationSettings ?? f.EscalationSettings), Me = typeof H.level1UserRoleId == "number" && H.level1UserRoleId > 0 ? [H.level1UserRoleId] : [], ae = typeof H.level2UserRoleId == "number" && H.level2UserRoleId > 0 ? [H.level2UserRoleId] : [], Ke = typeof H.level3UserRoleId == "number" && H.level3UserRoleId > 0 ? [H.level3UserRoleId] : [], st = (Array.isArray(H.escalationSettingsActionTypeIds) ? H.escalationSettingsActionTypeIds : []).map((De) => ke[De] || String(De)), Ds = (Array.isArray(H.thirdPartyId) ? H.thirdPartyId : []).map((De) => He[De] || String(De)), Cs = typeof H.humanLoop == "boolean" ? H.humanLoop : null;
8345
+ const I = e.find((De) => De.RuleId === (f.ruleId || f.ruleName))?.Name || f.ruleName || f.Name || "-", H = Gs(f.escalationSettings ?? f.EscalationSettings), Me = typeof H.level1UserRoleId == "number" && H.level1UserRoleId > 0 ? [H.level1UserRoleId] : [], ce = typeof H.level2UserRoleId == "number" && H.level2UserRoleId > 0 ? [H.level2UserRoleId] : [], Ke = typeof H.level3UserRoleId == "number" && H.level3UserRoleId > 0 ? [H.level3UserRoleId] : [], st = (Array.isArray(H.escalationSettingsActionTypeIds) ? H.escalationSettingsActionTypeIds : []).map((De) => ke[De] || String(De)), Ds = (Array.isArray(H.thirdPartyId) ? H.thirdPartyId : []).map((De) => He[De] || String(De)), Cs = typeof H.humanLoop == "boolean" ? H.humanLoop : null;
8346
8346
  return {
8347
8347
  id: String(f.ruleId || f.ruleName || O),
8348
8348
  ruleOrSeverityLabel: I,
8349
8349
  l1: { minutes: H.level1PostAssistTime ?? void 0, roles: Me },
8350
- l2: { minutes: H.level2PostAssistTime ?? void 0, roles: ae },
8350
+ l2: { minutes: H.level2PostAssistTime ?? void 0, roles: ce },
8351
8351
  l3: { minutes: H.level3PostAssistTime ?? void 0, roles: Ke },
8352
8352
  actions: st,
8353
8353
  notify: Ds,
@@ -8437,7 +8437,7 @@ function lc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
8437
8437
  ruleOptions: gt,
8438
8438
  minsOptions: bt,
8439
8439
  roleOptions: Tt,
8440
- l1mins: oe,
8440
+ l1mins: ie,
8441
8441
  setL1mins: re,
8442
8442
  l1role: L,
8443
8443
  setL1role: A,
@@ -8452,24 +8452,24 @@ function lc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
8452
8452
  actions: j,
8453
8453
  setActions: de,
8454
8454
  thirdPartyIds: Ie,
8455
- setThirdPartyIds: le,
8455
+ setThirdPartyIds: oe,
8456
8456
  humanLoop: he,
8457
8457
  setHumanLoop: we,
8458
8458
  onClear: () => {
8459
- u("By Severity"), m("By severity"), R("rules"), h(void 0), M(void 0), re(void 0), A(void 0), x(void 0), U(void 0), Y(void 0), ne(void 0), de([]), le([]), we(!1), ce(!1);
8459
+ u("By Severity"), m("By severity"), R("rules"), h(void 0), M(void 0), re(void 0), A(void 0), x(void 0), U(void 0), Y(void 0), ne(void 0), de([]), oe([]), we(!1), le(!1);
8460
8460
  },
8461
8461
  onSave: async () => {
8462
8462
  xe(!0), a?.({
8463
8463
  ruleId: v,
8464
8464
  levels: [
8465
- { minutes: oe, role: L },
8465
+ { minutes: ie, role: L },
8466
8466
  { minutes: w, role: N },
8467
8467
  { minutes: P, role: J }
8468
8468
  ],
8469
8469
  actions: j,
8470
8470
  thirdPartyIds: Ie,
8471
8471
  humanLoop: he,
8472
- isAutoExpire: ie
8472
+ isAutoExpire: ae
8473
8473
  });
8474
8474
  try {
8475
8475
  if (v) {
@@ -8484,7 +8484,7 @@ function lc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
8484
8484
  ...K,
8485
8485
  escalationSettings: {
8486
8486
  level1UserRoleId: L ?? 0,
8487
- level1PostAssistTime: oe ?? 0,
8487
+ level1PostAssistTime: ie ?? 0,
8488
8488
  level2UserRoleId: N ?? 0,
8489
8489
  level2PostAssistTime: w ?? 0,
8490
8490
  level3UserRoleId: J ?? 0,
@@ -8492,10 +8492,10 @@ function lc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
8492
8492
  escalationSettingsActionTypeIds: Q,
8493
8493
  thirdPartyId: Array.isArray(Ie) ? Ie : [],
8494
8494
  humanLoop: he,
8495
- isAutoExpire: ie
8495
+ isAutoExpire: ae
8496
8496
  }
8497
8497
  }, I = await i.updateRule(f, O);
8498
- I?.responseStatus || I?.Success || I?.success ? (be.success("Escalation settings saved"), await St(), M(void 0), re(void 0), A(void 0), x(void 0), U(void 0), Y(void 0), ne(void 0), de([]), le([]), we(!1), ce(!1)) : be.error(I?.errorMessage || I?.Message || "Error saving Escalation Settings");
8498
+ I?.responseStatus || I?.Success || I?.success ? (be.success("Escalation settings saved"), await St(), M(void 0), re(void 0), A(void 0), x(void 0), U(void 0), Y(void 0), ne(void 0), de([]), oe([]), we(!1), le(!1)) : be.error(I?.errorMessage || I?.Message || "Error saving Escalation Settings");
8499
8499
  }
8500
8500
  } catch (Q) {
8501
8501
  console.error("Error saving escalation settings", Q);
@@ -8510,8 +8510,8 @@ function lc({ severities: t, rules: e, userRoles: s, rawRules: n, loadingRules:
8510
8510
  typeof K.actionTypeId == "number" && (Q[K.actionTypeId] = K.name);
8511
8511
  ze(Q);
8512
8512
  },
8513
- isAutoExpire: ie,
8514
- setAutoExpire: ce
8513
+ isAutoExpire: ae,
8514
+ setAutoExpire: le
8515
8515
  }
8516
8516
  )
8517
8517
  ] }),
@@ -8553,7 +8553,7 @@ function Mc({ severities: t, rules: e, onSave: s, onCancel: n }) {
8553
8553
  email: !!v.email
8554
8554
  });
8555
8555
  const M = fr(v.sortBy);
8556
- o(M === "By Created Date" ? "By Created Date" : "By Severity"), S(En(v.doNotDisturbStart)), k(En(v.doNotDisturbEnd)), Array.isArray(v.anomalyIds) && d(new Set(v.anomalyIds.map((oe) => String(oe))));
8556
+ o(M === "By Created Date" ? "By Created Date" : "By Severity"), S(En(v.doNotDisturbStart)), k(En(v.doNotDisturbEnd)), Array.isArray(v.anomalyIds) && d(new Set(v.anomalyIds.map((ie) => String(ie))));
8557
8557
  } catch (v) {
8558
8558
  console.error("Error in loading my preferences: ", v);
8559
8559
  }
@@ -8595,7 +8595,7 @@ function Mc({ severities: t, rules: e, onSave: s, onCancel: n }) {
8595
8595
  });
8596
8596
  try {
8597
8597
  V(!0);
8598
- const h = m ? m.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", v = p ? p.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", M = Array.from(u).map((re) => Number(re)).filter((re) => Number.isFinite(re)), oe = await a.setPreferenceSettings({
8598
+ const h = m ? m.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", v = p ? p.format?.("HH:mm:ss") ?? "00:00:00" : "00:00:00", M = Array.from(u).map((re) => Number(re)).filter((re) => Number.isFinite(re)), ie = await a.setPreferenceSettings({
8599
8599
  anomalyIds: M,
8600
8600
  doNotDisturbStart: h,
8601
8601
  doNotDisturbEnd: v,
@@ -8604,7 +8604,7 @@ function Mc({ severities: t, rules: e, onSave: s, onCancel: n }) {
8604
8604
  email: !!D.email,
8605
8605
  sortBy: l
8606
8606
  });
8607
- oe?.responseStatus && be.success(oe?.data || "Preferences updated successfully.");
8607
+ ie?.responseStatus && be.success(ie?.data || "Preferences updated successfully.");
8608
8608
  } catch (h) {
8609
8609
  console.error("Error in saving my preferences: ", h);
8610
8610
  } finally {
@@ -8837,7 +8837,7 @@ const hc = ({
8837
8837
  "brandished guns & knives": "weapon",
8838
8838
  "brandished guns and knives": "weapon"
8839
8839
  }, Sc = ({ isModalOpen: t, handleModalClose: e, selectedRow: s, fetchAlertLogs: n, alertStatusList: r = [], alertStatusLoading: a = !1, initialTab: i = "details", sourceTab: l }) => {
8840
- const [o, u] = g(), [d, m] = g(""), [S, p] = g(!1), k = Ea(null), [D, C] = g("details"), [q, F] = g(void 0), W = br(), { alerts: T, rules: E, config: V } = Pe(), { timeZoneDetails: R } = Ms(), [G, h] = g(null), [v, M] = g(!1), [oe, re] = g(!1), [L, A] = g(void 0), [w, x] = g(void 0), [N, U] = g({}), [P, Y] = g({}), J = (f, O, I) => {
8840
+ const [o, u] = g(), [d, m] = g(""), [S, p] = g(!1), k = Ea(null), [D, C] = g("details"), [q, F] = g(void 0), W = br(), { alerts: T, rules: E, config: V } = Pe(), { timeZoneDetails: R } = Ms(), [G, h] = g(null), [v, M] = g(!1), [ie, re] = g(!1), [L, A] = g(void 0), [w, x] = g(void 0), [N, U] = g({}), [P, Y] = g({}), J = (f, O, I) => {
8841
8841
  const H = P[f];
8842
8842
  return N[f] === !1 && !H ? /* @__PURE__ */ y("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: [
8843
8843
  /* @__PURE__ */ c(Sr, { size: 40 }),
@@ -8860,11 +8860,11 @@ const hc = ({
8860
8860
  eventName: j,
8861
8861
  eventDisplayName: de,
8862
8862
  anomalyName: Ie,
8863
- alertId: le,
8863
+ alertId: oe,
8864
8864
  timestamp: he,
8865
8865
  description: we,
8866
- spaceName: ie,
8867
- assignTeam: ce,
8866
+ spaceName: ae,
8867
+ assignTeam: le,
8868
8868
  priority: ke,
8869
8869
  statusType: ze,
8870
8870
  id: He,
@@ -8882,7 +8882,7 @@ const hc = ({
8882
8882
  status: me(f?.messageStatus),
8883
8883
  notificationReceipientType: f?.notificationReceipientType || ""
8884
8884
  }), We = (f, O) => {
8885
- const I = O.map(xe), H = I.filter((rt) => rt.status === "Delivered").length, Me = O.map((rt) => rt?.sentAt).filter(Boolean).sort((rt, st) => new Date(st).getTime() - new Date(rt).getTime())[0], ae = O[0] || {}, Ke = [ae?.severityName, ae?.anomalyName].filter(Boolean).join(" - ") || `${f} Notification`;
8885
+ const I = O.map(xe), H = I.filter((rt) => rt.status === "Delivered").length, Me = O.map((rt) => rt?.sentAt).filter(Boolean).sort((rt, st) => new Date(st).getTime() - new Date(rt).getTime())[0], Ke = (O[0] || {})?.severityName || `${f} Notification`;
8886
8886
  return {
8887
8887
  channelLabel: `${f} Notification`,
8888
8888
  sentAt: Me || "",
@@ -8947,31 +8947,31 @@ const hc = ({
8947
8947
  }).map((f) => ({ value: f.alertStatusTypeName, label: f.alertStatusTypeName })), $ = V.tenant === "snl" && G !== null ? Wt : St, Q = ge(() => pr(ee), [ee]);
8948
8948
  return fe(() => {
8949
8949
  let f = !1;
8950
- const O = new AbortController(), I = async (ae) => {
8951
- if (ae) {
8952
- f || U((Ke) => ({ ...Ke, [ae]: !1 }));
8950
+ const O = new AbortController(), I = async (ce) => {
8951
+ if (ce) {
8952
+ f || U((Ke) => ({ ...Ke, [ce]: !1 }));
8953
8953
  try {
8954
- const Ke = await fetch(ae, { method: "HEAD", signal: O.signal });
8954
+ const Ke = await fetch(ce, { method: "HEAD", signal: O.signal });
8955
8955
  if (Ke.ok) {
8956
- f || U((st) => ({ ...st, [ae]: !0 }));
8956
+ f || U((st) => ({ ...st, [ce]: !0 }));
8957
8957
  return;
8958
8958
  }
8959
8959
  if (Ke.status === 404) {
8960
- f || U((st) => ({ ...st, [ae]: !1 }));
8960
+ f || U((st) => ({ ...st, [ce]: !1 }));
8961
8961
  return;
8962
8962
  }
8963
- if (!(await fetch(ae, { method: "GET", signal: O.signal })).ok) throw new Error("Media not available");
8964
- f || U((st) => ({ ...st, [ae]: !0 }));
8963
+ if (!(await fetch(ce, { method: "GET", signal: O.signal })).ok) throw new Error("Media not available");
8964
+ f || U((st) => ({ ...st, [ce]: !0 }));
8965
8965
  } catch {
8966
- f || U((Ke) => ({ ...Ke, [ae]: !1 }));
8966
+ f || U((Ke) => ({ ...Ke, [ce]: !1 }));
8967
8967
  }
8968
8968
  }
8969
8969
  };
8970
8970
  U({});
8971
- const H = Q.filter((ae) => !Ys(ae)).map((ae) => ae?.mediaUrl || ae).filter((ae) => typeof ae == "string" && ae.length > 0), Me = {};
8972
- return H.forEach((ae) => {
8973
- Me[ae] = !0;
8974
- }), Y(Me), H.forEach((ae) => I(ae)), () => {
8971
+ const H = Q.filter((ce) => !Ys(ce)).map((ce) => ce?.mediaUrl || ce).filter((ce) => typeof ce == "string" && ce.length > 0), Me = {};
8972
+ return H.forEach((ce) => {
8973
+ Me[ce] = !0;
8974
+ }), Y(Me), H.forEach((ce) => I(ce)), () => {
8975
8975
  f = !0, O.abort();
8976
8976
  };
8977
8977
  }, [Q]), /* @__PURE__ */ c(
@@ -8990,7 +8990,7 @@ const hc = ({
8990
8990
  try {
8991
8991
  p(!0);
8992
8992
  const f = {
8993
- alertUniqueId: le,
8993
+ alertUniqueId: oe,
8994
8994
  alertId: He,
8995
8995
  status: o ? String(o) : void 0,
8996
8996
  notes: d.trim(),
@@ -9048,13 +9048,13 @@ const hc = ({
9048
9048
  " ",
9049
9049
  we || "No description available"
9050
9050
  ] }),
9051
- ie && /* @__PURE__ */ y("div", { className: "font-sm text-gray-500", children: [
9051
+ ae && /* @__PURE__ */ y("div", { className: "font-sm text-gray-500", children: [
9052
9052
  "Space: ",
9053
- ie
9053
+ ae
9054
9054
  ] }),
9055
- ce && /* @__PURE__ */ y("div", { className: "font-sm text-gray-500", children: [
9055
+ le && /* @__PURE__ */ y("div", { className: "font-sm text-gray-500", children: [
9056
9056
  "Assigned to: ",
9057
- ce
9057
+ le
9058
9058
  ] }),
9059
9059
  /* @__PURE__ */ y("div", { className: "flex gap-2 justify-start mt-3", children: [
9060
9060
  /* @__PURE__ */ y(
@@ -9169,7 +9169,7 @@ const hc = ({
9169
9169
  /* @__PURE__ */ c(
9170
9170
  wr,
9171
9171
  {
9172
- isOpen: oe,
9172
+ isOpen: ie,
9173
9173
  onClose: () => re(!1),
9174
9174
  src: L || "",
9175
9175
  type: w || "image"
@@ -9183,10 +9183,10 @@ const hc = ({
9183
9183
  children: /* @__PURE__ */ c(
9184
9184
  hc,
9185
9185
  {
9186
- alertId: le,
9186
+ alertId: oe,
9187
9187
  id: He,
9188
9188
  priority: ke,
9189
- spaceName: ie,
9189
+ spaceName: ae,
9190
9190
  alertNumber: Z,
9191
9191
  statusHistory: ut,
9192
9192
  notifGroups: q
@@ -9214,8 +9214,8 @@ function vc() {
9214
9214
  }
9215
9215
  function Ia({ alerts: t, loading: e = !1, columns: s, total: n, currentPage: r, onRefetch: a, onPageChange: i, onFilterChange: l }) {
9216
9216
  const [o, u] = g(!1), [d, m] = g(null), [S, p] = g("details"), { list: k, loading: D } = vc(), { config: C } = Pe(), q = C.tenant === "schools", { timeZoneDetails: F } = Ms(), W = F?.timeZoneName ?? "UTC", T = F?.ianaTimeZoneId ?? "UTC";
9217
- function E(oe, re) {
9218
- m(oe), p(re?.tab ?? "details"), G(re?.sourceTab ?? "active"), u(!0);
9217
+ function E(ie, re) {
9218
+ m(ie), p(re?.tab ?? "details"), G(re?.sourceTab ?? "active"), u(!0);
9219
9219
  }
9220
9220
  function V() {
9221
9221
  u(!1);
@@ -9240,8 +9240,8 @@ function Ia({ alerts: t, loading: e = !1, columns: s, total: n, currentPage: r,
9240
9240
  defaultActiveKey: "active",
9241
9241
  className: "w-full",
9242
9242
  tabBarStyle: { fontSize: "medium" },
9243
- onChange: (oe) => {
9244
- const re = oe === "archived";
9243
+ onChange: (ie) => {
9244
+ const re = ie === "archived";
9245
9245
  v((L) => L + 1), i?.(1), l?.({ isArchived: re });
9246
9246
  },
9247
9247
  items: [