@ssgc/alert-console 2.2.0 → 2.2.1
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 +131 -131
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as i, jsxs as d, Fragment as ws } from "react/jsx-runtime";
|
|
2
2
|
import * as ce from "react";
|
|
3
3
|
import { useMemo as ue, createContext as xs, useContext as Is, useState as I, useEffect as fe, useRef as Cs } from "react";
|
|
4
|
-
import { Select as pe, Table as gt, Row as ge, Col as _, Input as Ts, Tag as
|
|
4
|
+
import { Select as pe, Table as gt, Row as ge, Col as _, Input as Ts, Tag as Je, Space as Ae, Tooltip as Rs, Button as ye, Progress as ks, Dropdown as Os, Typography as _e, Spin as vt, Checkbox as je, Divider as Qe, TimePicker as Dt, Tabs as bt, Card as at, Steps as Ps, Modal as Es, Carousel as Ds } from "antd";
|
|
5
5
|
import { MessageOutlined as Ms, MailOutlined as Fs, MoreOutlined as Us, EditOutlined as Ls, LeftOutlined as $s, RightOutlined as Bs } from "@ant-design/icons";
|
|
6
6
|
import { toast as ie } from "react-toastify";
|
|
7
|
-
const js = "#FF3B30", Qs = "#FF9500", qs = "#FFCC00", _s = "#34C759",
|
|
7
|
+
const js = "#FF3B30", Qs = "#FF9500", qs = "#FFCC00", _s = "#34C759", Ge = {
|
|
8
8
|
critical: js,
|
|
9
9
|
high: Qs,
|
|
10
10
|
medium: qs,
|
|
11
11
|
low: _s
|
|
12
12
|
}, Mt = {
|
|
13
|
-
Critical:
|
|
14
|
-
High:
|
|
15
|
-
Medium:
|
|
16
|
-
Low:
|
|
13
|
+
Critical: Ge.critical,
|
|
14
|
+
High: Ge.high,
|
|
15
|
+
Medium: Ge.medium,
|
|
16
|
+
Low: Ge.low
|
|
17
17
|
};
|
|
18
18
|
function Hs(e) {
|
|
19
19
|
return Mt[e] || Mt.Low;
|
|
@@ -55,7 +55,7 @@ function Ys() {
|
|
|
55
55
|
return {};
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function We(e, t) {
|
|
59
59
|
if (!t) return e;
|
|
60
60
|
const s = new URL(e);
|
|
61
61
|
return Object.entries(t).forEach(([r, n]) => {
|
|
@@ -106,7 +106,7 @@ function zs(e) {
|
|
|
106
106
|
return Array.isArray(r) ? r : r && typeof r == "object" && Array.isArray(r.data) ? r.data : [];
|
|
107
107
|
},
|
|
108
108
|
async getAlertsReport(s) {
|
|
109
|
-
const r = be(e.baseUrl, "/Alerts/GetAlertsReport"), n =
|
|
109
|
+
const r = be(e.baseUrl, "/Alerts/GetAlertsReport"), n = We(r, s), a = await Se(n, {
|
|
110
110
|
method: "GET",
|
|
111
111
|
headers: t
|
|
112
112
|
});
|
|
@@ -169,21 +169,21 @@ function zs(e) {
|
|
|
169
169
|
};
|
|
170
170
|
},
|
|
171
171
|
async getAlertNotifications(s) {
|
|
172
|
-
const r = be(e.baseUrl, "/api/Alert/GetNotifications"), n =
|
|
172
|
+
const r = be(e.baseUrl, "/api/Alert/GetNotifications"), n = We(r, { alertId: s }), a = await Se(n, {
|
|
173
173
|
method: "GET",
|
|
174
174
|
headers: t
|
|
175
175
|
});
|
|
176
176
|
return Array.isArray(a) ? a : a && typeof a == "object" && Array.isArray(a.data) ? a.data : [];
|
|
177
177
|
},
|
|
178
178
|
async notifyFamilyMembers(s) {
|
|
179
|
-
const r = be(e.baseUrl, "/api/Alert/NotificationToFamilyMembers"), n =
|
|
179
|
+
const r = be(e.baseUrl, "/api/Alert/NotificationToFamilyMembers"), n = We(r, { alertId: s });
|
|
180
180
|
return Se(n, {
|
|
181
181
|
method: "POST",
|
|
182
182
|
headers: t
|
|
183
183
|
});
|
|
184
184
|
},
|
|
185
185
|
async sendSMSorEmailNotifications(s, r, n) {
|
|
186
|
-
const a = be(e.baseUrl, "/api/Alert/SendSMSorEmailNotifications"), o =
|
|
186
|
+
const a = be(e.baseUrl, "/api/Alert/SendSMSorEmailNotifications"), o = We(a, { alertId: s, isEmail: r, isSMS: n });
|
|
187
187
|
return Se(o, {
|
|
188
188
|
method: "POST",
|
|
189
189
|
headers: t
|
|
@@ -203,7 +203,7 @@ function Vs() {
|
|
|
203
203
|
return {};
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
async function
|
|
206
|
+
async function Ke(e, t) {
|
|
207
207
|
const s = {
|
|
208
208
|
...t.headers,
|
|
209
209
|
...Vs()
|
|
@@ -232,22 +232,22 @@ function Js(e) {
|
|
|
232
232
|
}, s = Lt(e.baseUrl, "/api/Rules"), r = Lt(e.baseUrl, "/api/Rules/lookups");
|
|
233
233
|
return {
|
|
234
234
|
async getRules() {
|
|
235
|
-
const n = await
|
|
235
|
+
const n = await Ke(s, { method: "GET", headers: t });
|
|
236
236
|
return Array.isArray(n) ? n : [];
|
|
237
237
|
},
|
|
238
238
|
async setEscalationSettings(n) {
|
|
239
|
-
return
|
|
239
|
+
return Ke(s, {
|
|
240
240
|
method: "POST",
|
|
241
241
|
headers: t,
|
|
242
242
|
body: JSON.stringify(n ?? {})
|
|
243
243
|
});
|
|
244
244
|
},
|
|
245
245
|
async getLookups() {
|
|
246
|
-
return
|
|
246
|
+
return Ke(r, { method: "GET", headers: t });
|
|
247
247
|
},
|
|
248
248
|
async updateRule(n, a) {
|
|
249
249
|
const o = `${s}/${n}`;
|
|
250
|
-
return
|
|
250
|
+
return Ke(o, {
|
|
251
251
|
method: "PUT",
|
|
252
252
|
headers: t,
|
|
253
253
|
body: JSON.stringify(a ?? {})
|
|
@@ -258,7 +258,7 @@ function Js(e) {
|
|
|
258
258
|
function Xs(e) {
|
|
259
259
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
260
260
|
}
|
|
261
|
-
var
|
|
261
|
+
var Ve = { exports: {} }, Zs = Ve.exports, $t;
|
|
262
262
|
function er() {
|
|
263
263
|
return $t || ($t = 1, (function(e, t) {
|
|
264
264
|
(function(s, r) {
|
|
@@ -534,7 +534,7 @@ function er() {
|
|
|
534
534
|
return N(1e3 * O);
|
|
535
535
|
}, N.en = V[z], N.Ls = V, N.p = {}, N;
|
|
536
536
|
}));
|
|
537
|
-
})(
|
|
537
|
+
})(Ve)), Ve.exports;
|
|
538
538
|
}
|
|
539
539
|
var tr = er();
|
|
540
540
|
const sr = /* @__PURE__ */ Xs(tr);
|
|
@@ -879,7 +879,7 @@ function Qt(e, t) {
|
|
|
879
879
|
function qt(e) {
|
|
880
880
|
return e === St || e === At;
|
|
881
881
|
}
|
|
882
|
-
function
|
|
882
|
+
function tt({ value: e, onChange: t, options: s, className: r, dropdownWidth: n }) {
|
|
883
883
|
return /* @__PURE__ */ i(
|
|
884
884
|
pe,
|
|
885
885
|
{
|
|
@@ -899,7 +899,7 @@ const mr = [
|
|
|
899
899
|
{ label: "Low", value: "Low" }
|
|
900
900
|
];
|
|
901
901
|
function pr({ value: e, onChange: t, options: s }) {
|
|
902
|
-
return /* @__PURE__ */ i(
|
|
902
|
+
return /* @__PURE__ */ i(tt, { className: "w-[140px]", value: e, onChange: t, options: s || mr });
|
|
903
903
|
}
|
|
904
904
|
const yr = [
|
|
905
905
|
{ label: "All Types", value: "All" },
|
|
@@ -908,10 +908,10 @@ const yr = [
|
|
|
908
908
|
{ label: "Aggressive Behavior", value: "Aggressive" }
|
|
909
909
|
];
|
|
910
910
|
function gr({ value: e, onChange: t, options: s }) {
|
|
911
|
-
return /* @__PURE__ */ i(
|
|
911
|
+
return /* @__PURE__ */ i(tt, { className: "w-[220px]", dropdownWidth: 280, value: e, onChange: t, options: s || yr });
|
|
912
912
|
}
|
|
913
913
|
function vr({ value: e, onChange: t, options: s }) {
|
|
914
|
-
return /* @__PURE__ */ i(
|
|
914
|
+
return /* @__PURE__ */ i(tt, { className: "w-[100px]", value: e, onChange: t, options: s || [] });
|
|
915
915
|
}
|
|
916
916
|
const br = [
|
|
917
917
|
{ label: "All", value: "All" },
|
|
@@ -922,7 +922,7 @@ const br = [
|
|
|
922
922
|
{ label: "Skydio", value: "Skydio" }
|
|
923
923
|
];
|
|
924
924
|
function Sr({ value: e, onChange: t, options: s }) {
|
|
925
|
-
return /* @__PURE__ */ i(
|
|
925
|
+
return /* @__PURE__ */ i(tt, { className: "w-[130px]", value: e, onChange: t, options: s || br });
|
|
926
926
|
}
|
|
927
927
|
function Ar({
|
|
928
928
|
columns: e,
|
|
@@ -986,7 +986,7 @@ function as({ data: e, loading: t = !1, pageSize: s = 10, columns: r, severityOp
|
|
|
986
986
|
dataIndex: "priority",
|
|
987
987
|
key: "priority",
|
|
988
988
|
width: 120,
|
|
989
|
-
render: (c) => /* @__PURE__ */ i(
|
|
989
|
+
render: (c) => /* @__PURE__ */ i(Je, { className: "px-[10px] py-[2px]", style: { border: `2px solid ${ur[c]}`, backgroundColor: cr[c] }, children: c })
|
|
990
990
|
},
|
|
991
991
|
{
|
|
992
992
|
title: "Tracker",
|
|
@@ -1134,7 +1134,7 @@ function as({ data: e, loading: t = !1, pageSize: s = 10, columns: r, severityOp
|
|
|
1134
1134
|
}
|
|
1135
1135
|
) });
|
|
1136
1136
|
}
|
|
1137
|
-
var
|
|
1137
|
+
var $e = class {
|
|
1138
1138
|
constructor() {
|
|
1139
1139
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
1140
1140
|
}
|
|
@@ -1192,11 +1192,11 @@ var Le = class {
|
|
|
1192
1192
|
clearInterval(e) {
|
|
1193
1193
|
this.#e.clearInterval(e);
|
|
1194
1194
|
}
|
|
1195
|
-
},
|
|
1195
|
+
}, Ee = new wr();
|
|
1196
1196
|
function xr(e) {
|
|
1197
1197
|
setTimeout(e, 0);
|
|
1198
1198
|
}
|
|
1199
|
-
var
|
|
1199
|
+
var De = typeof window > "u" || "Deno" in globalThis;
|
|
1200
1200
|
function he() {
|
|
1201
1201
|
}
|
|
1202
1202
|
function Ir(e, t) {
|
|
@@ -1227,7 +1227,7 @@ function _t(e, t) {
|
|
|
1227
1227
|
if (r) {
|
|
1228
1228
|
if (t.queryHash !== Nt(o, t.options))
|
|
1229
1229
|
return !1;
|
|
1230
|
-
} else if (!
|
|
1230
|
+
} else if (!qe(t.queryKey, o))
|
|
1231
1231
|
return !1;
|
|
1232
1232
|
}
|
|
1233
1233
|
if (s !== "all") {
|
|
@@ -1243,24 +1243,24 @@ function Ht(e, t) {
|
|
|
1243
1243
|
if (!t.options.mutationKey)
|
|
1244
1244
|
return !1;
|
|
1245
1245
|
if (s) {
|
|
1246
|
-
if (
|
|
1246
|
+
if (Me(t.options.mutationKey) !== Me(a))
|
|
1247
1247
|
return !1;
|
|
1248
|
-
} else if (!
|
|
1248
|
+
} else if (!qe(t.options.mutationKey, a))
|
|
1249
1249
|
return !1;
|
|
1250
1250
|
}
|
|
1251
1251
|
return !(r && t.state.status !== r || n && !n(t));
|
|
1252
1252
|
}
|
|
1253
1253
|
function Nt(e, t) {
|
|
1254
|
-
return (t?.queryKeyHashFn ||
|
|
1254
|
+
return (t?.queryKeyHashFn || Me)(e);
|
|
1255
1255
|
}
|
|
1256
|
-
function
|
|
1256
|
+
function Me(e) {
|
|
1257
1257
|
return JSON.stringify(
|
|
1258
1258
|
e,
|
|
1259
1259
|
(t, s) => ht(s) ? Object.keys(s).sort().reduce((r, n) => (r[n] = s[n], r), {}) : s
|
|
1260
1260
|
);
|
|
1261
1261
|
}
|
|
1262
|
-
function
|
|
1263
|
-
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((s) =>
|
|
1262
|
+
function qe(e, t) {
|
|
1263
|
+
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((s) => qe(e[s], t[s])) : !1;
|
|
1264
1264
|
}
|
|
1265
1265
|
var Cr = Object.prototype.hasOwnProperty;
|
|
1266
1266
|
function dt(e, t) {
|
|
@@ -1285,7 +1285,7 @@ function dt(e, t) {
|
|
|
1285
1285
|
}
|
|
1286
1286
|
return n === o && h === n ? e : l;
|
|
1287
1287
|
}
|
|
1288
|
-
function
|
|
1288
|
+
function Xe(e, t) {
|
|
1289
1289
|
if (!t || Object.keys(e).length !== Object.keys(t).length)
|
|
1290
1290
|
return !1;
|
|
1291
1291
|
for (const s in e)
|
|
@@ -1310,7 +1310,7 @@ function Wt(e) {
|
|
|
1310
1310
|
}
|
|
1311
1311
|
function Tr(e) {
|
|
1312
1312
|
return new Promise((t) => {
|
|
1313
|
-
|
|
1313
|
+
Ee.setTimeout(t, e);
|
|
1314
1314
|
});
|
|
1315
1315
|
}
|
|
1316
1316
|
function ft(e, t, s) {
|
|
@@ -1337,11 +1337,11 @@ function kr(e, t, s = 0) {
|
|
|
1337
1337
|
const r = [t, ...e];
|
|
1338
1338
|
return s && r.length > s ? r.slice(0, -1) : r;
|
|
1339
1339
|
}
|
|
1340
|
-
var
|
|
1340
|
+
var Ze = /* @__PURE__ */ Symbol();
|
|
1341
1341
|
function ls(e, t) {
|
|
1342
|
-
return process.env.NODE_ENV !== "production" && e.queryFn ===
|
|
1342
|
+
return process.env.NODE_ENV !== "production" && e.queryFn === Ze && console.error(
|
|
1343
1343
|
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`
|
|
1344
|
-
), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn ===
|
|
1344
|
+
), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn === Ze ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
|
|
1345
1345
|
}
|
|
1346
1346
|
function wt(e, t) {
|
|
1347
1347
|
return typeof e == "function" ? e(...t) : !!e;
|
|
@@ -1353,13 +1353,13 @@ function Or(e, t, s) {
|
|
|
1353
1353
|
get: () => (n ??= t(), r || (r = !0, n.aborted ? s() : n.addEventListener("abort", s, { once: !0 })), n)
|
|
1354
1354
|
}), e;
|
|
1355
1355
|
}
|
|
1356
|
-
var Pr = class extends
|
|
1356
|
+
var Pr = class extends $e {
|
|
1357
1357
|
#e;
|
|
1358
1358
|
#t;
|
|
1359
1359
|
#s;
|
|
1360
1360
|
constructor() {
|
|
1361
1361
|
super(), this.#s = (e) => {
|
|
1362
|
-
if (!
|
|
1362
|
+
if (!De && window.addEventListener) {
|
|
1363
1363
|
const t = () => e();
|
|
1364
1364
|
return window.addEventListener("visibilitychange", t, !1), () => {
|
|
1365
1365
|
window.removeEventListener("visibilitychange", t);
|
|
@@ -1473,13 +1473,13 @@ function Dr() {
|
|
|
1473
1473
|
}
|
|
1474
1474
|
};
|
|
1475
1475
|
}
|
|
1476
|
-
var ae = Dr(), Mr = class extends
|
|
1476
|
+
var ae = Dr(), Mr = class extends $e {
|
|
1477
1477
|
#e = !0;
|
|
1478
1478
|
#t;
|
|
1479
1479
|
#s;
|
|
1480
1480
|
constructor() {
|
|
1481
1481
|
super(), this.#s = (e) => {
|
|
1482
|
-
if (!
|
|
1482
|
+
if (!De && window.addEventListener) {
|
|
1483
1483
|
const t = () => e(!0), s = () => e(!1);
|
|
1484
1484
|
return window.addEventListener("online", t, !1), window.addEventListener("offline", s, !1), () => {
|
|
1485
1485
|
window.removeEventListener("online", t), window.removeEventListener("offline", s);
|
|
@@ -1504,12 +1504,12 @@ var ae = Dr(), Mr = class extends Le {
|
|
|
1504
1504
|
isOnline() {
|
|
1505
1505
|
return this.#e;
|
|
1506
1506
|
}
|
|
1507
|
-
},
|
|
1507
|
+
}, et = new Mr();
|
|
1508
1508
|
function Fr(e) {
|
|
1509
1509
|
return Math.min(1e3 * 2 ** e, 3e4);
|
|
1510
1510
|
}
|
|
1511
1511
|
function cs(e) {
|
|
1512
|
-
return (e ?? "online") === "online" ?
|
|
1512
|
+
return (e ?? "online") === "online" ? et.isOnline() : !0;
|
|
1513
1513
|
}
|
|
1514
1514
|
var pt = class extends Error {
|
|
1515
1515
|
constructor(e) {
|
|
@@ -1527,7 +1527,7 @@ function us(e) {
|
|
|
1527
1527
|
t = !0;
|
|
1528
1528
|
}, h = () => {
|
|
1529
1529
|
t = !1;
|
|
1530
|
-
}, u = () => xt.isFocused() && (e.networkMode === "always" ||
|
|
1530
|
+
}, u = () => xt.isFocused() && (e.networkMode === "always" || et.isOnline()) && e.canRun(), f = () => cs(e.networkMode) && e.canRun(), b = (m) => {
|
|
1531
1531
|
a() || (r?.(), n.resolve(m));
|
|
1532
1532
|
}, p = (m) => {
|
|
1533
1533
|
a() || (r?.(), n.reject(m));
|
|
@@ -1550,7 +1550,7 @@ function us(e) {
|
|
|
1550
1550
|
Promise.resolve(m).then(b).catch((L) => {
|
|
1551
1551
|
if (a())
|
|
1552
1552
|
return;
|
|
1553
|
-
const $ = e.retry ?? (
|
|
1553
|
+
const $ = e.retry ?? (De ? 0 : 3), B = e.retryDelay ?? Fr, F = typeof B == "function" ? B(s, L) : B, z = $ === !0 || typeof $ == "number" && s < $ || typeof $ == "function" && $(s, L);
|
|
1554
1554
|
if (t || !z) {
|
|
1555
1555
|
p(L);
|
|
1556
1556
|
return;
|
|
@@ -1577,18 +1577,18 @@ var ds = class {
|
|
|
1577
1577
|
this.clearGcTimeout();
|
|
1578
1578
|
}
|
|
1579
1579
|
scheduleGc() {
|
|
1580
|
-
this.clearGcTimeout(), ut(this.gcTime) && (this.#e =
|
|
1580
|
+
this.clearGcTimeout(), ut(this.gcTime) && (this.#e = Ee.setTimeout(() => {
|
|
1581
1581
|
this.optionalRemove();
|
|
1582
1582
|
}, this.gcTime));
|
|
1583
1583
|
}
|
|
1584
1584
|
updateGcTime(e) {
|
|
1585
1585
|
this.gcTime = Math.max(
|
|
1586
1586
|
this.gcTime || 0,
|
|
1587
|
-
e ?? (
|
|
1587
|
+
e ?? (De ? 1 / 0 : 300 * 1e3)
|
|
1588
1588
|
);
|
|
1589
1589
|
}
|
|
1590
1590
|
clearGcTimeout() {
|
|
1591
|
-
this.#e && (
|
|
1591
|
+
this.#e && (Ee.clearTimeout(this.#e), this.#e = void 0);
|
|
1592
1592
|
}
|
|
1593
1593
|
}, Ur = class extends ds {
|
|
1594
1594
|
#e;
|
|
@@ -1646,7 +1646,7 @@ var ds = class {
|
|
|
1646
1646
|
);
|
|
1647
1647
|
}
|
|
1648
1648
|
isDisabled() {
|
|
1649
|
-
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn ===
|
|
1649
|
+
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === Ze || this.state.dataUpdateCount + this.state.errorUpdateCount === 0;
|
|
1650
1650
|
}
|
|
1651
1651
|
isStatic() {
|
|
1652
1652
|
return this.getObserversCount() > 0 ? this.observers.some(
|
|
@@ -1893,7 +1893,7 @@ function Yt(e) {
|
|
|
1893
1893
|
fetchStatus: "idle"
|
|
1894
1894
|
};
|
|
1895
1895
|
}
|
|
1896
|
-
var Lr = class extends
|
|
1896
|
+
var Lr = class extends $e {
|
|
1897
1897
|
constructor(e, t) {
|
|
1898
1898
|
super(), this.options = t, this.#e = e, this.#i = null, this.#o = mt(), this.bindMethods(), this.setOptions(t);
|
|
1899
1899
|
}
|
|
@@ -1946,7 +1946,7 @@ var Lr = class extends Le {
|
|
|
1946
1946
|
throw new Error(
|
|
1947
1947
|
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
1948
1948
|
);
|
|
1949
|
-
this.#N(), this.#t.setOptions(this.options), t._defaulted && !
|
|
1949
|
+
this.#N(), this.#t.setOptions(this.options), t._defaulted && !Xe(this.options, t) && this.#e.getQueryCache().notify({
|
|
1950
1950
|
type: "observerOptionsUpdated",
|
|
1951
1951
|
query: this.#t,
|
|
1952
1952
|
observer: this
|
|
@@ -2012,10 +2012,10 @@ var Lr = class extends Le {
|
|
|
2012
2012
|
this.options.staleTime,
|
|
2013
2013
|
this.#t
|
|
2014
2014
|
);
|
|
2015
|
-
if (
|
|
2015
|
+
if (De || this.#n.isStale || !ut(e))
|
|
2016
2016
|
return;
|
|
2017
2017
|
const s = os(this.#n.dataUpdatedAt, e) + 1;
|
|
2018
|
-
this.#c =
|
|
2018
|
+
this.#c = Ee.setTimeout(() => {
|
|
2019
2019
|
this.#n.isStale || this.updateResult();
|
|
2020
2020
|
}, s);
|
|
2021
2021
|
}
|
|
@@ -2023,7 +2023,7 @@ var Lr = class extends Le {
|
|
|
2023
2023
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
|
|
2024
2024
|
}
|
|
2025
2025
|
#v(e) {
|
|
2026
|
-
this.#A(), this.#l = e, !(
|
|
2026
|
+
this.#A(), this.#l = e, !(De || ve(this.options.enabled, this.#t) === !1 || !ut(this.#l) || this.#l === 0) && (this.#u = Ee.setInterval(() => {
|
|
2027
2027
|
(this.options.refetchIntervalInBackground || xt.isFocused()) && this.#d();
|
|
2028
2028
|
}, this.#l));
|
|
2029
2029
|
}
|
|
@@ -2031,10 +2031,10 @@ var Lr = class extends Le {
|
|
|
2031
2031
|
this.#y(), this.#v(this.#g());
|
|
2032
2032
|
}
|
|
2033
2033
|
#S() {
|
|
2034
|
-
this.#c && (
|
|
2034
|
+
this.#c && (Ee.clearTimeout(this.#c), this.#c = void 0);
|
|
2035
2035
|
}
|
|
2036
2036
|
#A() {
|
|
2037
|
-
this.#u && (
|
|
2037
|
+
this.#u && (Ee.clearInterval(this.#u), this.#u = void 0);
|
|
2038
2038
|
}
|
|
2039
2039
|
createResult(e, t) {
|
|
2040
2040
|
const s = this.#t, r = this.options, n = this.#n, a = this.#r, o = this.#a, h = e !== s ? e.state : this.#s, { state: u } = e;
|
|
@@ -2121,7 +2121,7 @@ var Lr = class extends Le {
|
|
|
2121
2121
|
}
|
|
2122
2122
|
updateResult() {
|
|
2123
2123
|
const e = this.#n, t = this.createResult(this.#t, this.options);
|
|
2124
|
-
if (this.#r = this.#t.state, this.#a = this.options, this.#r.data !== void 0 && (this.#f = this.#t),
|
|
2124
|
+
if (this.#r = this.#t.state, this.#a = this.options, this.#r.data !== void 0 && (this.#f = this.#t), Xe(t, e))
|
|
2125
2125
|
return;
|
|
2126
2126
|
this.#n = t;
|
|
2127
2127
|
const s = () => {
|
|
@@ -2181,7 +2181,7 @@ function It(e, t) {
|
|
|
2181
2181
|
return ve(t.enabled, e) !== !1 && e.isStaleByTime(ke(t.staleTime, e));
|
|
2182
2182
|
}
|
|
2183
2183
|
function Br(e, t) {
|
|
2184
|
-
return !
|
|
2184
|
+
return !Xe(e.getCurrentResult(), t);
|
|
2185
2185
|
}
|
|
2186
2186
|
function Jt(e) {
|
|
2187
2187
|
return {
|
|
@@ -2490,7 +2490,7 @@ function fs() {
|
|
|
2490
2490
|
submittedAt: 0
|
|
2491
2491
|
};
|
|
2492
2492
|
}
|
|
2493
|
-
var qr = class extends
|
|
2493
|
+
var qr = class extends $e {
|
|
2494
2494
|
constructor(e = {}) {
|
|
2495
2495
|
super(), this.config = e, this.#e = /* @__PURE__ */ new Set(), this.#t = /* @__PURE__ */ new Map(), this.#s = 0;
|
|
2496
2496
|
}
|
|
@@ -2509,7 +2509,7 @@ var qr = class extends Le {
|
|
|
2509
2509
|
}
|
|
2510
2510
|
add(e) {
|
|
2511
2511
|
this.#e.add(e);
|
|
2512
|
-
const t =
|
|
2512
|
+
const t = Ye(e);
|
|
2513
2513
|
if (typeof t == "string") {
|
|
2514
2514
|
const s = this.#t.get(t);
|
|
2515
2515
|
s ? s.push(e) : this.#t.set(t, [e]);
|
|
@@ -2518,7 +2518,7 @@ var qr = class extends Le {
|
|
|
2518
2518
|
}
|
|
2519
2519
|
remove(e) {
|
|
2520
2520
|
if (this.#e.delete(e)) {
|
|
2521
|
-
const t =
|
|
2521
|
+
const t = Ye(e);
|
|
2522
2522
|
if (typeof t == "string") {
|
|
2523
2523
|
const s = this.#t.get(t);
|
|
2524
2524
|
if (s)
|
|
@@ -2531,7 +2531,7 @@ var qr = class extends Le {
|
|
|
2531
2531
|
this.notify({ type: "removed", mutation: e });
|
|
2532
2532
|
}
|
|
2533
2533
|
canRun(e) {
|
|
2534
|
-
const t =
|
|
2534
|
+
const t = Ye(e);
|
|
2535
2535
|
if (typeof t == "string") {
|
|
2536
2536
|
const r = this.#t.get(t)?.find(
|
|
2537
2537
|
(n) => n.state.status === "pending"
|
|
@@ -2541,7 +2541,7 @@ var qr = class extends Le {
|
|
|
2541
2541
|
return !0;
|
|
2542
2542
|
}
|
|
2543
2543
|
runNext(e) {
|
|
2544
|
-
const t =
|
|
2544
|
+
const t = Ye(e);
|
|
2545
2545
|
return typeof t == "string" ? this.#t.get(t)?.find((r) => r !== e && r.state.isPaused)?.continue() ?? Promise.resolve() : Promise.resolve();
|
|
2546
2546
|
}
|
|
2547
2547
|
clear() {
|
|
@@ -2579,10 +2579,10 @@ var qr = class extends Le {
|
|
|
2579
2579
|
);
|
|
2580
2580
|
}
|
|
2581
2581
|
};
|
|
2582
|
-
function
|
|
2582
|
+
function Ye(e) {
|
|
2583
2583
|
return e.options.scope?.id;
|
|
2584
2584
|
}
|
|
2585
|
-
var _r = class extends
|
|
2585
|
+
var _r = class extends $e {
|
|
2586
2586
|
#e;
|
|
2587
2587
|
#t = void 0;
|
|
2588
2588
|
#s;
|
|
@@ -2595,11 +2595,11 @@ var _r = class extends Le {
|
|
|
2595
2595
|
}
|
|
2596
2596
|
setOptions(e) {
|
|
2597
2597
|
const t = this.options;
|
|
2598
|
-
this.options = this.#e.defaultMutationOptions(e),
|
|
2598
|
+
this.options = this.#e.defaultMutationOptions(e), Xe(this.options, t) || this.#e.getMutationCache().notify({
|
|
2599
2599
|
type: "observerOptionsUpdated",
|
|
2600
2600
|
mutation: this.#s,
|
|
2601
2601
|
observer: this
|
|
2602
|
-
}), t?.mutationKey && this.options.mutationKey &&
|
|
2602
|
+
}), t?.mutationKey && this.options.mutationKey && Me(t.mutationKey) !== Me(this.options.mutationKey) ? this.reset() : this.#s?.state.status === "pending" && this.#s.setOptions(this.options);
|
|
2603
2603
|
}
|
|
2604
2604
|
onUnsubscribe() {
|
|
2605
2605
|
this.hasListeners() || this.#s?.removeObserver(this);
|
|
@@ -2687,7 +2687,7 @@ var _r = class extends Le {
|
|
|
2687
2687
|
});
|
|
2688
2688
|
});
|
|
2689
2689
|
}
|
|
2690
|
-
}, Hr = class extends
|
|
2690
|
+
}, Hr = class extends $e {
|
|
2691
2691
|
constructor(e = {}) {
|
|
2692
2692
|
super(), this.config = e, this.#e = /* @__PURE__ */ new Map();
|
|
2693
2693
|
}
|
|
@@ -2773,7 +2773,7 @@ var _r = class extends Le {
|
|
|
2773
2773
|
mount() {
|
|
2774
2774
|
this.#a++, this.#a === 1 && (this.#o = xt.subscribe(async (e) => {
|
|
2775
2775
|
e && (await this.resumePausedMutations(), this.#e.onFocus());
|
|
2776
|
-
}), this.#i =
|
|
2776
|
+
}), this.#i = et.subscribe(async (e) => {
|
|
2777
2777
|
e && (await this.resumePausedMutations(), this.#e.onOnline());
|
|
2778
2778
|
}));
|
|
2779
2779
|
}
|
|
@@ -2898,7 +2898,7 @@ var _r = class extends Le {
|
|
|
2898
2898
|
return e.behavior = Jt(e.pages), this.ensureQueryData(e);
|
|
2899
2899
|
}
|
|
2900
2900
|
resumePausedMutations() {
|
|
2901
|
-
return
|
|
2901
|
+
return et.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
|
|
2902
2902
|
}
|
|
2903
2903
|
getQueryCache() {
|
|
2904
2904
|
return this.#e;
|
|
@@ -2913,7 +2913,7 @@ var _r = class extends Le {
|
|
|
2913
2913
|
this.#s = e;
|
|
2914
2914
|
}
|
|
2915
2915
|
setQueryDefaults(e, t) {
|
|
2916
|
-
this.#n.set(
|
|
2916
|
+
this.#n.set(Me(e), {
|
|
2917
2917
|
queryKey: e,
|
|
2918
2918
|
defaultOptions: t
|
|
2919
2919
|
});
|
|
@@ -2921,11 +2921,11 @@ var _r = class extends Le {
|
|
|
2921
2921
|
getQueryDefaults(e) {
|
|
2922
2922
|
const t = [...this.#n.values()], s = {};
|
|
2923
2923
|
return t.forEach((r) => {
|
|
2924
|
-
|
|
2924
|
+
qe(e, r.queryKey) && Object.assign(s, r.defaultOptions);
|
|
2925
2925
|
}), s;
|
|
2926
2926
|
}
|
|
2927
2927
|
setMutationDefaults(e, t) {
|
|
2928
|
-
this.#r.set(
|
|
2928
|
+
this.#r.set(Me(e), {
|
|
2929
2929
|
mutationKey: e,
|
|
2930
2930
|
defaultOptions: t
|
|
2931
2931
|
});
|
|
@@ -2933,7 +2933,7 @@ var _r = class extends Le {
|
|
|
2933
2933
|
getMutationDefaults(e) {
|
|
2934
2934
|
const t = [...this.#r.values()], s = {};
|
|
2935
2935
|
return t.forEach((r) => {
|
|
2936
|
-
|
|
2936
|
+
qe(e, r.mutationKey) && Object.assign(s, r.defaultOptions);
|
|
2937
2937
|
}), s;
|
|
2938
2938
|
}
|
|
2939
2939
|
defaultQueryOptions(e) {
|
|
@@ -2948,7 +2948,7 @@ var _r = class extends Le {
|
|
|
2948
2948
|
return t.queryHash || (t.queryHash = Nt(
|
|
2949
2949
|
t.queryKey,
|
|
2950
2950
|
t
|
|
2951
|
-
)), t.refetchOnReconnect === void 0 && (t.refetchOnReconnect = t.networkMode !== "always"), t.throwOnError === void 0 && (t.throwOnError = !!t.suspense), !t.networkMode && t.persister && (t.networkMode = "offlineFirst"), t.queryFn ===
|
|
2951
|
+
)), t.refetchOnReconnect === void 0 && (t.refetchOnReconnect = t.networkMode !== "always"), t.throwOnError === void 0 && (t.throwOnError = !!t.suspense), !t.networkMode && t.persister && (t.networkMode = "offlineFirst"), t.queryFn === Ze && (t.enabled = !1), t;
|
|
2952
2952
|
}
|
|
2953
2953
|
defaultMutationOptions(e) {
|
|
2954
2954
|
return e?._defaulted ? e : {
|
|
@@ -3055,7 +3055,7 @@ function rn(e, t, s) {
|
|
|
3055
3055
|
return a.getDefaultOptions().queries?._experimental_afterQuery?.(
|
|
3056
3056
|
o,
|
|
3057
3057
|
f
|
|
3058
|
-
), o.experimental_prefetchInRender && !
|
|
3058
|
+
), o.experimental_prefetchInRender && !De && tn(f, r) && (h ? (
|
|
3059
3059
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
3060
3060
|
Zt(o, u, n)
|
|
3061
3061
|
) : (
|
|
@@ -3198,7 +3198,7 @@ function dn({
|
|
|
3198
3198
|
key: "priority",
|
|
3199
3199
|
width: 120,
|
|
3200
3200
|
render: (p) => /* @__PURE__ */ i(
|
|
3201
|
-
|
|
3201
|
+
Je,
|
|
3202
3202
|
{
|
|
3203
3203
|
className: "px-[10px] py-[2px]",
|
|
3204
3204
|
style: {
|
|
@@ -3428,11 +3428,11 @@ function fn({ label: e = "USA", timeZone: t = "America/New_York", updateInterval
|
|
|
3428
3428
|
] })
|
|
3429
3429
|
] });
|
|
3430
3430
|
}
|
|
3431
|
-
const mn = [{ SeverityId: 1, Code: "LOW", DisplayName: "Low", SortOrder: 10, IsActive: !0 }, { SeverityId: 2, Code: "MEDIUM", DisplayName: "Medium", SortOrder: 20, IsActive: !0 }, { SeverityId: 3, Code: "HIGH", DisplayName: "High", SortOrder: 30, IsActive: !0 }, { SeverityId: 4, Code: "CRITICAL", DisplayName: "Critical", SortOrder: 40, IsActive: !0 }], pn = [{ RuleId: "0938aa00-dfa7-4258-805a-67396366c776", RuleVersionId: "36d2d581-57c3-45c3-8705-8235935fdf96", Name: "License Plate Recognition", Description: "License Plate Recognition", VersionCount: 1, ActionCount: 0, ApplicabilityPeriodCount: 0, SuppressionCount: 0, AssignmentCount: 0, ExclusionCount: 0, IsDeleted: !1, SeverityId: 3, AnomalyId: "915976ef-4eb6-4f7b-bbe6-e53862517fc9", Level: "global" }, { RuleId: "2437286a-db6a-4d35-814e-9ac49f158dde", RuleVersionId: "00000000-0000-0000-0000-000000000000", Name: "Monitor And Track Onsite Vehicle timelog", Description: "Monitor And Track Onsite Vehicle timelog", VersionCount: 0, ActionCount: 0, ApplicabilityPeriodCount: 0, SuppressionCount: 0, AssignmentCount: 0, ExclusionCount: 0, IsDeleted: !1, SeverityId: 3, AnomalyId: "9fd651ab-4312-4826-84b6-94d735894477", Level: "global" }, { RuleId: "b99120ba-7a83-4ade-b5d9-a420550fe351", RuleVersionId: "d7b14dae-a7b1-474e-a357-199182c02ac3", Name: "Watchlist person detected", Description: "Watchlist person detected", VersionCount: 1, ActionCount: 0, ApplicabilityPeriodCount: 0, SuppressionCount: 0, AssignmentCount: 0, ExclusionCount: 0, IsDeleted: !1, SeverityId: 4, AnomalyId: "bb3a3d3a-73a3-4f5a-8804-1baadbd0d412", Level: "global" }, { RuleId: "ffc2c24f-adb7-4aba-ace7-f19c54e21530", RuleVersionId: "6ab3178f-bf77-4a1e-898d-1d5dbef749c5", Name: "Weapon Detection", Description: "Weapon Detection", VersionCount: 1, ActionCount: 0, ApplicabilityPeriodCount: 0, SuppressionCount: 0, AssignmentCount: 0, ExclusionCount: 0, IsDeleted: !1, SeverityId: 4, AnomalyId: "ac82c3a2-72e6-4f9c-88fb-851a3ca3c4de", Level: "global" }], yn = [{ userRoleId: 1, userRoleName: "Super Admin" }, { userRoleId: 2, userRoleName: "Security Officer" }, { userRoleId: 3, userRoleName: "Security Admin" }, { userRoleId: 4, userRoleName: "Regulatory Officer/First Responder" }, { userRoleId: 5, userRoleName: "User" }],
|
|
3431
|
+
const mn = [{ SeverityId: 1, Code: "LOW", DisplayName: "Low", SortOrder: 10, IsActive: !0 }, { SeverityId: 2, Code: "MEDIUM", DisplayName: "Medium", SortOrder: 20, IsActive: !0 }, { SeverityId: 3, Code: "HIGH", DisplayName: "High", SortOrder: 30, IsActive: !0 }, { SeverityId: 4, Code: "CRITICAL", DisplayName: "Critical", SortOrder: 40, IsActive: !0 }], pn = [{ RuleId: "0938aa00-dfa7-4258-805a-67396366c776", RuleVersionId: "36d2d581-57c3-45c3-8705-8235935fdf96", Name: "License Plate Recognition", Description: "License Plate Recognition", VersionCount: 1, ActionCount: 0, ApplicabilityPeriodCount: 0, SuppressionCount: 0, AssignmentCount: 0, ExclusionCount: 0, IsDeleted: !1, SeverityId: 3, AnomalyId: "915976ef-4eb6-4f7b-bbe6-e53862517fc9", Level: "global" }, { RuleId: "2437286a-db6a-4d35-814e-9ac49f158dde", RuleVersionId: "00000000-0000-0000-0000-000000000000", Name: "Monitor And Track Onsite Vehicle timelog", Description: "Monitor And Track Onsite Vehicle timelog", VersionCount: 0, ActionCount: 0, ApplicabilityPeriodCount: 0, SuppressionCount: 0, AssignmentCount: 0, ExclusionCount: 0, IsDeleted: !1, SeverityId: 3, AnomalyId: "9fd651ab-4312-4826-84b6-94d735894477", Level: "global" }, { RuleId: "b99120ba-7a83-4ade-b5d9-a420550fe351", RuleVersionId: "d7b14dae-a7b1-474e-a357-199182c02ac3", Name: "Watchlist person detected", Description: "Watchlist person detected", VersionCount: 1, ActionCount: 0, ApplicabilityPeriodCount: 0, SuppressionCount: 0, AssignmentCount: 0, ExclusionCount: 0, IsDeleted: !1, SeverityId: 4, AnomalyId: "bb3a3d3a-73a3-4f5a-8804-1baadbd0d412", Level: "global" }, { RuleId: "ffc2c24f-adb7-4aba-ace7-f19c54e21530", RuleVersionId: "6ab3178f-bf77-4a1e-898d-1d5dbef749c5", Name: "Weapon Detection", Description: "Weapon Detection", VersionCount: 1, ActionCount: 0, ApplicabilityPeriodCount: 0, SuppressionCount: 0, AssignmentCount: 0, ExclusionCount: 0, IsDeleted: !1, SeverityId: 4, AnomalyId: "ac82c3a2-72e6-4f9c-88fb-851a3ca3c4de", Level: "global" }], yn = [{ userRoleId: 1, userRoleName: "Super Admin" }, { userRoleId: 2, userRoleName: "Security Officer" }, { userRoleId: 3, userRoleName: "Security Admin" }, { userRoleId: 4, userRoleName: "Regulatory Officer/First Responder" }, { userRoleId: 5, userRoleName: "User" }], Le = {
|
|
3432
3432
|
severities: mn,
|
|
3433
3433
|
rules: pn,
|
|
3434
3434
|
userRoles: yn
|
|
3435
|
-
}, { Text: gn } =
|
|
3435
|
+
}, { Text: gn } = _e;
|
|
3436
3436
|
function vn({ sortBy: e, onChange: t, showActions: s, onSave: r, onClear: n, saving: a }) {
|
|
3437
3437
|
return /* @__PURE__ */ d(ge, { gutter: [16, 16], align: "middle", children: [
|
|
3438
3438
|
/* @__PURE__ */ i(_, { xs: 24, md: 8, lg: 5, children: /* @__PURE__ */ d(Ae, { className: "w-full items-center", direction: "horizontal", size: 12, children: [
|
|
@@ -3458,7 +3458,7 @@ function vn({ sortBy: e, onChange: t, showActions: s, onSave: r, onClear: n, sav
|
|
|
3458
3458
|
] }) : null })
|
|
3459
3459
|
] });
|
|
3460
3460
|
}
|
|
3461
|
-
const { Text: Te } =
|
|
3461
|
+
const { Text: Te } = _e;
|
|
3462
3462
|
function bn(e) {
|
|
3463
3463
|
const {
|
|
3464
3464
|
// escBasis, setEscBasis,
|
|
@@ -3625,7 +3625,7 @@ function bn(e) {
|
|
|
3625
3625
|
}
|
|
3626
3626
|
)
|
|
3627
3627
|
] }) }),
|
|
3628
|
-
/* @__PURE__ */ i(_, { xs: 24, sm: 12, md: 8, lg: 3, children: /* @__PURE__ */ i("div", { className: "flex items-end h-full", children: /* @__PURE__ */ i(
|
|
3628
|
+
/* @__PURE__ */ i(_, { xs: 24, sm: 12, md: 8, lg: 3, children: /* @__PURE__ */ i("div", { className: "flex items-end h-full", children: /* @__PURE__ */ i(je, { checked: V, onChange: (E) => H(E.target.checked), children: "Human-In-The-Loop" }) }) })
|
|
3629
3629
|
] }),
|
|
3630
3630
|
/* @__PURE__ */ d(ge, { gutter: [16, 16], align: "bottom", className: "mt-4", children: [
|
|
3631
3631
|
/* @__PURE__ */ i(_, { xs: 24, sm: 12, md: 8, lg: 5, children: /* @__PURE__ */ d("div", { children: [
|
|
@@ -3708,7 +3708,7 @@ function Sn({ entries: e, userRoles: t, onEdit: s, loading: r }) {
|
|
|
3708
3708
|
}
|
|
3709
3709
|
);
|
|
3710
3710
|
}
|
|
3711
|
-
const { Title: An } =
|
|
3711
|
+
const { Title: An } = _e;
|
|
3712
3712
|
function Nn({ userRoles: e, rules: t, rawRules: s }) {
|
|
3713
3713
|
const { rules: r } = Ne(), [n, a] = I(!1), [o, l] = I(s), [h, u] = I({}), f = ue(() => e.map((m) => ({ label: m.userRoleName, value: m.userRoleId })), [e]), b = ue(
|
|
3714
3714
|
() => (t || []).map((m, A) => ({
|
|
@@ -3848,18 +3848,18 @@ function Nn({ userRoles: e, rules: t, rawRules: s }) {
|
|
|
3848
3848
|
] })
|
|
3849
3849
|
] });
|
|
3850
3850
|
}
|
|
3851
|
-
const { Title: es } =
|
|
3851
|
+
const { Title: es } = _e;
|
|
3852
3852
|
function wn({ severities: e, rules: t, userRoles: s, rawRules: r, onSave: n }) {
|
|
3853
3853
|
const { rules: a, alerts: o } = Ne(), [l, h] = I("By Severity"), [u, f] = I("By severity"), [b, p] = I("By Severity"), [R, x] = I(!1), [m, A] = I(!1), [L, $] = I(!1), [B, F] = I(null), [z, V] = I("rules"), [H, W] = I(), [C, N] = I();
|
|
3854
3854
|
console.log("usr", s);
|
|
3855
|
-
const [T, te] = I(), [ne, O] = I(), [g, y] = I(), [S, c] = I(), [v, w] = I(), [E, k] = I(), [U, Q] = I([]), [j, M] = I([]), [K, ee] = I(!1), [Y, se] = I({}), [re, me] = I({}), [de,
|
|
3855
|
+
const [T, te] = I(), [ne, O] = I(), [g, y] = I(), [S, c] = I(), [v, w] = I(), [E, k] = I(), [U, Q] = I([]), [j, M] = I([]), [K, ee] = I(!1), [Y, se] = I({}), [re, me] = I({}), [de, st] = I(s || []), [Be, Fe] = I([]), [rt, le] = I(!1), [Ue, He] = I(!1), [Oe, Rt] = I(r || []);
|
|
3856
3856
|
fe(() => {
|
|
3857
3857
|
r && r.length && Rt(r);
|
|
3858
3858
|
}, [r]), fe(() => {
|
|
3859
|
-
if (!
|
|
3859
|
+
if (!Oe || !Oe.length) return;
|
|
3860
3860
|
const P = Object.keys(Y).length > 0 || Object.keys(re).length > 0;
|
|
3861
|
-
if (
|
|
3862
|
-
const X =
|
|
3861
|
+
if (Be.length && !P) return;
|
|
3862
|
+
const X = Oe.map((q, D) => {
|
|
3863
3863
|
const J = t.find((xe) => xe.RuleId === (q.ruleId || q.ruleName))?.Name || q.ruleName || q.Name || "-", G = q.escalationSettings || {}, Z = typeof G.level1UserRoleId == "number" && G.level1UserRoleId > 0 ? [G.level1UserRoleId] : [], we = typeof G.level2UserRoleId == "number" && G.level2UserRoleId > 0 ? [G.level2UserRoleId] : [], nt = typeof G.level3UserRoleId == "number" && G.level3UserRoleId > 0 ? [G.level3UserRoleId] : [], Ot = (Array.isArray(G.escalationSettingsActionTypeIds) ? G.escalationSettingsActionTypeIds : []).map((xe) => Y[xe] || String(xe)), Et = (Array.isArray(G.thirdPartyId) ? G.thirdPartyId : []).map((xe) => re[xe] || String(xe)), it = typeof G.humanLoop == "boolean" ? G.humanLoop : null;
|
|
3864
3864
|
return {
|
|
3865
3865
|
id: String(q.ruleId || q.ruleName || D),
|
|
@@ -3872,8 +3872,8 @@ function wn({ severities: e, rules: t, userRoles: s, rawRules: r, onSave: n }) {
|
|
|
3872
3872
|
humanLoop: it
|
|
3873
3873
|
};
|
|
3874
3874
|
});
|
|
3875
|
-
|
|
3876
|
-
}, [
|
|
3875
|
+
Fe(X);
|
|
3876
|
+
}, [Oe, t, Y, re]);
|
|
3877
3877
|
const vs = ue(
|
|
3878
3878
|
() => e.map((P) => ({ label: P.DisplayName, value: P.SeverityId })),
|
|
3879
3879
|
[e]
|
|
@@ -3914,7 +3914,7 @@ function wn({ severities: e, rules: t, userRoles: s, rawRules: r, onSave: n }) {
|
|
|
3914
3914
|
}, X = (J) => {
|
|
3915
3915
|
const G = Number(J);
|
|
3916
3916
|
return !isNaN(G) && G > 0 ? G : void 0;
|
|
3917
|
-
}, D = (
|
|
3917
|
+
}, D = (Oe || []).find(
|
|
3918
3918
|
(J) => J?.ruleId === C || J?.ruleName === C || J?.RuleId === C
|
|
3919
3919
|
)?.escalationSettings;
|
|
3920
3920
|
if (D && typeof D == "object") {
|
|
@@ -3922,14 +3922,14 @@ function wn({ severities: e, rules: t, userRoles: s, rawRules: r, onSave: n }) {
|
|
|
3922
3922
|
const J = Array.isArray(D.escalationSettingsActionTypeIds) ? D.escalationSettingsActionTypeIds : [];
|
|
3923
3923
|
Q(J.map((G) => String(G))), M(Array.isArray(D.thirdPartyId) ? D.thirdPartyId : []), ee(!!D.humanLoop);
|
|
3924
3924
|
}
|
|
3925
|
-
}, [z, C,
|
|
3925
|
+
}, [z, C, Oe]);
|
|
3926
3926
|
const Ns = async () => {
|
|
3927
3927
|
try {
|
|
3928
|
-
|
|
3928
|
+
He(!0);
|
|
3929
3929
|
const P = await a.getRules(), X = Array.isArray(P) ? P : Array.isArray(P?.data) ? P.data : [];
|
|
3930
3930
|
Rt(X);
|
|
3931
3931
|
const q = X.map((D, J) => {
|
|
3932
|
-
const G = t.find((
|
|
3932
|
+
const G = t.find((Pe) => Pe.RuleId === (D.ruleId || D.ruleName))?.Name || D.ruleName || D.Name || "-", Z = D.escalationSettings || {}, we = typeof Z.level1UserRoleId == "number" && Z.level1UserRoleId > 0 ? [Z.level1UserRoleId] : [], nt = typeof Z.level2UserRoleId == "number" && Z.level2UserRoleId > 0 ? [Z.level2UserRoleId] : [], kt = typeof Z.level3UserRoleId == "number" && Z.level3UserRoleId > 0 ? [Z.level3UserRoleId] : [], Pt = (Array.isArray(Z.escalationSettingsActionTypeIds) ? Z.escalationSettingsActionTypeIds : []).map((Pe) => Y[Pe] || String(Pe)), it = (Array.isArray(Z.thirdPartyId) ? Z.thirdPartyId : []).map((Pe) => re[Pe] || String(Pe)), xe = typeof Z.humanLoop == "boolean" ? Z.humanLoop : null;
|
|
3933
3933
|
return {
|
|
3934
3934
|
id: String(D.ruleId || D.ruleName || J),
|
|
3935
3935
|
ruleOrSeverityLabel: G,
|
|
@@ -3941,11 +3941,11 @@ function wn({ severities: e, rules: t, userRoles: s, rawRules: r, onSave: n }) {
|
|
|
3941
3941
|
humanLoop: xe
|
|
3942
3942
|
};
|
|
3943
3943
|
});
|
|
3944
|
-
|
|
3944
|
+
Fe(q);
|
|
3945
3945
|
} catch (P) {
|
|
3946
3946
|
console.error("Failed to refetch entries", P);
|
|
3947
3947
|
} finally {
|
|
3948
|
-
|
|
3948
|
+
He(!1);
|
|
3949
3949
|
}
|
|
3950
3950
|
};
|
|
3951
3951
|
return fe(() => {
|
|
@@ -3963,7 +3963,7 @@ function wn({ severities: e, rules: t, userRoles: s, rawRules: r, onSave: n }) {
|
|
|
3963
3963
|
userRoleId: J.userRoleId ?? J.id,
|
|
3964
3964
|
userRoleName: J.userRoleName ?? J.name
|
|
3965
3965
|
})) : [];
|
|
3966
|
-
P ||
|
|
3966
|
+
P || st(D.length ? D : s || []);
|
|
3967
3967
|
} catch (X) {
|
|
3968
3968
|
console.error("Error loading lookups", X);
|
|
3969
3969
|
}
|
|
@@ -4006,7 +4006,7 @@ function wn({ severities: e, rules: t, userRoles: s, rawRules: r, onSave: n }) {
|
|
|
4006
4006
|
)
|
|
4007
4007
|
] })
|
|
4008
4008
|
] }),
|
|
4009
|
-
/* @__PURE__ */ i(
|
|
4009
|
+
/* @__PURE__ */ i(Qe, { className: "my-6" }),
|
|
4010
4010
|
/* @__PURE__ */ d("div", { children: [
|
|
4011
4011
|
/* @__PURE__ */ i(es, { level: 4, className: "!mb-4", children: "Escalation Settings" }),
|
|
4012
4012
|
/* @__PURE__ */ i(
|
|
@@ -4057,7 +4057,7 @@ function wn({ severities: e, rules: t, userRoles: s, rawRules: r, onSave: n }) {
|
|
|
4057
4057
|
});
|
|
4058
4058
|
try {
|
|
4059
4059
|
if (C) {
|
|
4060
|
-
const q = Array.isArray(U) ? U.map((we) => Number(we)) : [], D = (
|
|
4060
|
+
const q = Array.isArray(U) ? U.map((we) => Number(we)) : [], D = (Oe || []).find(
|
|
4061
4061
|
(we) => we?.ruleId === C || we?.ruleName === C || we?.RuleId === C
|
|
4062
4062
|
), J = typeof D?.recordId == "number" ? D.recordId : void 0;
|
|
4063
4063
|
if (!D || typeof J != "number") {
|
|
@@ -4103,7 +4103,7 @@ function wn({ severities: e, rules: t, userRoles: s, rawRules: r, onSave: n }) {
|
|
|
4103
4103
|
le(!1);
|
|
4104
4104
|
}
|
|
4105
4105
|
const X = t.find((q) => q.RuleId === C)?.Name || "-";
|
|
4106
|
-
|
|
4106
|
+
Fe((q) => [
|
|
4107
4107
|
...q,
|
|
4108
4108
|
{
|
|
4109
4109
|
id: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
|
@@ -4120,7 +4120,7 @@ function wn({ severities: e, rules: t, userRoles: s, rawRules: r, onSave: n }) {
|
|
|
4120
4120
|
}
|
|
4121
4121
|
]);
|
|
4122
4122
|
},
|
|
4123
|
-
saving:
|
|
4123
|
+
saving: rt,
|
|
4124
4124
|
onActionTypesLoaded: (P) => {
|
|
4125
4125
|
const X = {};
|
|
4126
4126
|
for (const q of P)
|
|
@@ -4130,26 +4130,26 @@ function wn({ severities: e, rules: t, userRoles: s, rawRules: r, onSave: n }) {
|
|
|
4130
4130
|
}
|
|
4131
4131
|
)
|
|
4132
4132
|
] }),
|
|
4133
|
-
/* @__PURE__ */ i(
|
|
4133
|
+
/* @__PURE__ */ i(Qe, { className: "my-6" }),
|
|
4134
4134
|
/* @__PURE__ */ i(
|
|
4135
4135
|
Sn,
|
|
4136
4136
|
{
|
|
4137
|
-
entries:
|
|
4137
|
+
entries: Be,
|
|
4138
4138
|
userRoles: de,
|
|
4139
|
-
loading:
|
|
4139
|
+
loading: Ue,
|
|
4140
4140
|
onEdit: (P) => {
|
|
4141
4141
|
V("rules");
|
|
4142
|
-
const X =
|
|
4142
|
+
const X = Be.find((D) => D.id === P), q = t.find((D) => D.RuleId === P) || (X ? t.find((D) => D.Name === X.ruleOrSeverityLabel) : void 0);
|
|
4143
4143
|
N(q ? q.RuleId : P);
|
|
4144
4144
|
}
|
|
4145
4145
|
}
|
|
4146
4146
|
),
|
|
4147
|
-
/* @__PURE__ */ i(
|
|
4147
|
+
/* @__PURE__ */ i(Qe, { className: "my-6" }),
|
|
4148
4148
|
/* @__PURE__ */ i(Nn, { userRoles: de, rules: t, rawRules: r }),
|
|
4149
|
-
/* @__PURE__ */ i(
|
|
4149
|
+
/* @__PURE__ */ i(Qe, {})
|
|
4150
4150
|
] });
|
|
4151
4151
|
}
|
|
4152
|
-
const { Title: ts, Text:
|
|
4152
|
+
const { Title: ts, Text: ze } = _e;
|
|
4153
4153
|
function xn({ severities: e, rules: t, onSave: s, onCancel: r }) {
|
|
4154
4154
|
const { rules: n, alerts: a } = Ne(), o = [
|
|
4155
4155
|
{ label: "By Severity", value: "By Severity" },
|
|
@@ -4228,38 +4228,38 @@ function xn({ severities: e, rules: t, onSave: s, onCancel: r }) {
|
|
|
4228
4228
|
};
|
|
4229
4229
|
return /* @__PURE__ */ d("div", { className: "w-full", children: [
|
|
4230
4230
|
/* @__PURE__ */ i(ge, { gutter: [16, 16], align: "middle", className: "mb-4", children: /* @__PURE__ */ i(_, { xs: 24, md: 8, children: /* @__PURE__ */ d(Ae, { direction: "horizontal", size: 12, className: "w-full items-center", children: [
|
|
4231
|
-
/* @__PURE__ */ i(
|
|
4231
|
+
/* @__PURE__ */ i(ze, { className: "text-gray-600", children: "Sort By:" }),
|
|
4232
4232
|
/* @__PURE__ */ i(pe, { className: "w-[240px]", value: l, options: o, onChange: h })
|
|
4233
4233
|
] }) }) }),
|
|
4234
4234
|
/* @__PURE__ */ d("div", { className: "mb-4", children: [
|
|
4235
4235
|
/* @__PURE__ */ i(ts, { level: 5, className: "!mb-2", children: "Anomalies" }),
|
|
4236
4236
|
B ? /* @__PURE__ */ i("div", { className: "py-4", children: /* @__PURE__ */ i(vt, {}) }) : /* @__PURE__ */ i(Ae, { direction: "vertical", size: 10, className: "w-full", children: (Array.isArray(L) ? L : []).map((C) => {
|
|
4237
4237
|
const N = String(C.recordId), T = C.anomalyName;
|
|
4238
|
-
return /* @__PURE__ */ i(
|
|
4238
|
+
return /* @__PURE__ */ i(je, { checked: u.has(N), onChange: () => H(N), children: T }, N);
|
|
4239
4239
|
}) })
|
|
4240
4240
|
] }),
|
|
4241
4241
|
/* @__PURE__ */ d("div", { className: "mb-4", children: [
|
|
4242
4242
|
/* @__PURE__ */ i(ts, { level: 5, className: "!mb-2", children: "Notification Timing & Channels" }),
|
|
4243
4243
|
/* @__PURE__ */ i(ge, { gutter: [16, 16], align: "middle", className: "mb-3", children: /* @__PURE__ */ i(_, { xs: 24, md: 12, children: /* @__PURE__ */ d(Ae, { direction: "horizontal", size: 12, className: "w-full items-center", children: [
|
|
4244
|
-
/* @__PURE__ */ i(
|
|
4244
|
+
/* @__PURE__ */ i(ze, { children: "Do Not Disturb mode:" }),
|
|
4245
4245
|
/* @__PURE__ */ d(Ae, { size: 12, className: "w-full", children: [
|
|
4246
4246
|
/* @__PURE__ */ d(Ae, { direction: "horizontal", size: 8, className: "items-center", children: [
|
|
4247
|
-
/* @__PURE__ */ i(
|
|
4247
|
+
/* @__PURE__ */ i(ze, { children: "From" }),
|
|
4248
4248
|
/* @__PURE__ */ i(Dt, { value: b, onChange: (C) => p(C), format: "HH:mm" })
|
|
4249
4249
|
] }),
|
|
4250
4250
|
/* @__PURE__ */ d(Ae, { direction: "horizontal", size: 8, className: "items-center", children: [
|
|
4251
|
-
/* @__PURE__ */ i(
|
|
4251
|
+
/* @__PURE__ */ i(ze, { children: "To" }),
|
|
4252
4252
|
/* @__PURE__ */ i(Dt, { value: R, onChange: (C) => x(C), format: "HH:mm" })
|
|
4253
4253
|
] })
|
|
4254
4254
|
] })
|
|
4255
4255
|
] }) }) }),
|
|
4256
4256
|
/* @__PURE__ */ d(ge, { gutter: [24, 12], children: [
|
|
4257
|
-
/* @__PURE__ */ i(_, { children: /* @__PURE__ */ i(
|
|
4258
|
-
/* @__PURE__ */ i(_, { children: /* @__PURE__ */ i(
|
|
4259
|
-
/* @__PURE__ */ i(_, { children: /* @__PURE__ */ i(
|
|
4257
|
+
/* @__PURE__ */ i(_, { children: /* @__PURE__ */ i(je, { checked: m.inApp, onChange: (C) => A({ ...m, inApp: C.target.checked }), children: "In-app" }) }),
|
|
4258
|
+
/* @__PURE__ */ i(_, { children: /* @__PURE__ */ i(je, { checked: m.sms, onChange: (C) => A({ ...m, sms: C.target.checked }), children: "SMS" }) }),
|
|
4259
|
+
/* @__PURE__ */ i(_, { children: /* @__PURE__ */ i(je, { checked: m.email, onChange: (C) => A({ ...m, email: C.target.checked }), children: "Email" }) })
|
|
4260
4260
|
] })
|
|
4261
4261
|
] }),
|
|
4262
|
-
/* @__PURE__ */ i(
|
|
4262
|
+
/* @__PURE__ */ i(Qe, {}),
|
|
4263
4263
|
/* @__PURE__ */ d(Ae, { className: "gap-3", children: [
|
|
4264
4264
|
/* @__PURE__ */ i(ye, { onClick: r, disabled: z, children: "Cancel" }),
|
|
4265
4265
|
/* @__PURE__ */ i(ye, { type: "primary", onClick: W, loading: z, children: "Save" })
|
|
@@ -4470,21 +4470,21 @@ const En = {
|
|
|
4470
4470
|
});
|
|
4471
4471
|
const se = Array.from(Y.entries()).map(([re, me]) => {
|
|
4472
4472
|
const de = me.map((le) => {
|
|
4473
|
-
const
|
|
4473
|
+
const Ue = String(le?.messageStatus || "").toLowerCase(), He = Ue === "delivered" ? "Delivered" : Ue === "failed" ? "Failed" : "Queued";
|
|
4474
4474
|
return {
|
|
4475
4475
|
name: le?.receipientName || le?.recipientName || "-",
|
|
4476
4476
|
role: le?.receipientRoleName || "",
|
|
4477
4477
|
phone: le?.receipentPhoneNumber || le?.recipientPhoneNumber || le?.receipientEmail || le?.recipientEmail || "",
|
|
4478
|
-
status:
|
|
4478
|
+
status: He
|
|
4479
4479
|
};
|
|
4480
|
-
}),
|
|
4480
|
+
}), st = de.filter((le) => le.status === "Delivered").length, Be = me.map((le) => le?.sentAt).filter(Boolean).sort((le, Ue) => new Date(Ue).getTime() - new Date(le).getTime())[0], Fe = me[0] || {}, rt = [Fe?.severityName, Fe?.anomalyName].filter(Boolean).join(" - ") || `${re} Notification`;
|
|
4481
4481
|
return {
|
|
4482
4482
|
channelLabel: `${re} Notification`,
|
|
4483
|
-
sentAt:
|
|
4484
|
-
messageTitle:
|
|
4483
|
+
sentAt: Be || "",
|
|
4484
|
+
messageTitle: rt,
|
|
4485
4485
|
messageBody: "",
|
|
4486
4486
|
total: de.length,
|
|
4487
|
-
delivered:
|
|
4487
|
+
delivered: st,
|
|
4488
4488
|
recipients: de
|
|
4489
4489
|
};
|
|
4490
4490
|
});
|
|
@@ -4611,7 +4611,7 @@ const En = {
|
|
|
4611
4611
|
] }),
|
|
4612
4612
|
/* @__PURE__ */ d("div", { className: "flex gap-2 justify-start mt-3", children: [
|
|
4613
4613
|
/* @__PURE__ */ d(
|
|
4614
|
-
|
|
4614
|
+
Je,
|
|
4615
4615
|
{
|
|
4616
4616
|
className: "font-sm text-gray-500 rounded-[8px] py-2 px-3",
|
|
4617
4617
|
style: {
|
|
@@ -4625,7 +4625,7 @@ const En = {
|
|
|
4625
4625
|
}
|
|
4626
4626
|
),
|
|
4627
4627
|
/* @__PURE__ */ d(
|
|
4628
|
-
|
|
4628
|
+
Je,
|
|
4629
4629
|
{
|
|
4630
4630
|
className: "font-sm text-gray-500 rounded-[8px] py-2 px-3",
|
|
4631
4631
|
style: String(y || "").toLowerCase() === "completed" ? { background: "#E7F6EC", border: "0.68px solid var(--Green, #34C759)" } : { background: "#E0EDFF", border: "1px solid var(--Grays-Gray-4, #D1D1D6)" },
|
|
@@ -4855,18 +4855,18 @@ function Un() {
|
|
|
4855
4855
|
Description: f.ruleDesc || f.Description || "",
|
|
4856
4856
|
SeverityId: 0
|
|
4857
4857
|
}));
|
|
4858
|
-
t(u.length ? u :
|
|
4858
|
+
t(u.length ? u : Le.rules);
|
|
4859
4859
|
try {
|
|
4860
4860
|
const f = await o.getLookups(), b = Array.isArray(f?.userRoles) ? f.userRoles.map((p) => ({
|
|
4861
4861
|
userRoleId: p.userRoleId ?? p.id,
|
|
4862
4862
|
userRoleName: p.userRoleName ?? p.name
|
|
4863
4863
|
})) : [];
|
|
4864
|
-
r(b.length ? b :
|
|
4864
|
+
r(b.length ? b : Le.userRoles);
|
|
4865
4865
|
} catch {
|
|
4866
|
-
r(
|
|
4866
|
+
r(Le.userRoles);
|
|
4867
4867
|
}
|
|
4868
4868
|
} catch {
|
|
4869
|
-
t(
|
|
4869
|
+
t(Le.rules), r(Le.userRoles);
|
|
4870
4870
|
}
|
|
4871
4871
|
})(), () => {
|
|
4872
4872
|
l = !1;
|
|
@@ -4874,7 +4874,7 @@ function Un() {
|
|
|
4874
4874
|
}, []), /* @__PURE__ */ i(
|
|
4875
4875
|
In,
|
|
4876
4876
|
{
|
|
4877
|
-
severities:
|
|
4877
|
+
severities: Le.severities,
|
|
4878
4878
|
rules: e,
|
|
4879
4879
|
userRoles: s,
|
|
4880
4880
|
rawRules: n
|