@nice2dev/ui-enterprise 1.2.0 → 1.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 +3 -3
- package/dist/index.d.ts +20 -8
- package/dist/index.mjs +2131 -2059
- package/dist/ui-enterprise.css +1 -1
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
import { jsxs as c, jsx as e, Fragment as
|
|
2
|
-
import { NtdClipboard as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
),
|
|
10
|
-
const h =
|
|
11
|
-
let
|
|
12
|
-
return r.transform && (
|
|
1
|
+
import { jsxs as c, jsx as e, Fragment as ae } from "react/jsx-runtime";
|
|
2
|
+
import { NtdClipboard as Ge, NtdFile as Ke, NtdBrackets as Re, NtdBarChart as We, NtdFileText as xe, NtdList as Xe, NtdGrid as Ze, NtdSearch as ge, NtdDownload as ve, NtdChevronDown as Se, NtdChevronRight as Fe, NtdCircle as De, NtdSettings as $e, NtdKey as fe, NtdLogOut as Me, NtdLogIn as Qe, NtdError as he, NtdCheck as se, NtdUpload as ec, NtdEye as cc, NtdClose as be, NtdEdit as je, NtdPlus as Te, NtdArrowRight as ac, NtdBook as tc, NtdClock as Le, NtdArrowUp as ic, NtdArrowDown as sc, NtdLock as Ue, NtdOctagon as nc, NtdDollar as lc, NtdWarning as Ye, NtdCookieConsent as rc, NtdArrowLeft as oc, NtdTrash as dc, NtdZap as qe, NtdHelp as Ve, NtdFolder as hc, NtdUser as Be, NtdRefresh as ye, NtdMinus as pc, NtdTable as uc, NtdCalendar as mc, NtdMap as Ee, NtdShield as He, NtdSlash as gc, NtdFlag as vc, NtdUnlock as bc, NtdSmartphone as we, NtdMonitor as Nc } from "@nice2dev/icons";
|
|
3
|
+
import { useNiceTranslation as W, NiceAppShell as fc, NiceTutorialButton as yc, resolveTutorial as wc, NiceIcon as _e } from "@nice2dev/ui";
|
|
4
|
+
import kc, { forwardRef as le, useState as k, useCallback as R, useImperativeHandle as re, useEffect as me, useRef as ke, useId as Cc, useMemo as ue } from "react";
|
|
5
|
+
function xc(a, n, s) {
|
|
6
|
+
const i = s.csvDelimiter || ",", t = [];
|
|
7
|
+
return s.includeHeaders !== !1 && t.push(
|
|
8
|
+
n.filter((l) => l.include).map((l) => `"${l.label}"`).join(i)
|
|
9
|
+
), a.forEach((l) => {
|
|
10
|
+
const h = n.filter((r) => r.include).map((r) => {
|
|
11
|
+
let o = l[r.field];
|
|
12
|
+
return r.transform && (o = r.transform(o)), o == null ? "" : typeof o == "string" ? `"${o.replace(/"/g, '""')}"` : String(o);
|
|
13
13
|
});
|
|
14
|
-
|
|
15
|
-
}),
|
|
14
|
+
t.push(h.join(i));
|
|
15
|
+
}), t.join(`
|
|
16
16
|
`);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
const
|
|
18
|
+
function Sc(a, n, s) {
|
|
19
|
+
const i = n.filter((l) => l.include), t = a.map((l) => {
|
|
20
20
|
const h = {};
|
|
21
|
-
return
|
|
22
|
-
let
|
|
23
|
-
r.transform && (
|
|
21
|
+
return i.forEach((r) => {
|
|
22
|
+
let o = l[r.field];
|
|
23
|
+
r.transform && (o = r.transform(o)), h[r.field] = o;
|
|
24
24
|
}), h;
|
|
25
25
|
});
|
|
26
|
-
return JSON.stringify(
|
|
26
|
+
return JSON.stringify(t, null, 2);
|
|
27
27
|
}
|
|
28
|
-
const
|
|
29
|
-
csv: { label: "CSV", icon: /* @__PURE__ */ e(
|
|
30
|
-
xlsx: { label: "Excel", icon: /* @__PURE__ */ e(
|
|
28
|
+
const Ce = {
|
|
29
|
+
csv: { label: "CSV", icon: /* @__PURE__ */ e(xe, { size: 20 }), description: "Comma-separated values" },
|
|
30
|
+
xlsx: { label: "Excel", icon: /* @__PURE__ */ e(We, { size: 20 }), description: "Microsoft Excel" },
|
|
31
31
|
json: {
|
|
32
32
|
label: "JSON",
|
|
33
|
-
icon: /* @__PURE__ */ e(
|
|
33
|
+
icon: /* @__PURE__ */ e(Re, { size: 20 }),
|
|
34
34
|
description: "JavaScript Object Notation"
|
|
35
35
|
},
|
|
36
|
-
pdf: { label: "PDF", icon: /* @__PURE__ */ e(
|
|
36
|
+
pdf: { label: "PDF", icon: /* @__PURE__ */ e(Ke, { size: 20 }), description: "Portable Document Format" },
|
|
37
37
|
xml: {
|
|
38
38
|
label: "XML",
|
|
39
|
-
icon: /* @__PURE__ */ e(
|
|
39
|
+
icon: /* @__PURE__ */ e(Ge, { size: 20 }),
|
|
40
40
|
description: "Extensible Markup Language"
|
|
41
41
|
}
|
|
42
|
-
}, Dc = ({ formats:
|
|
43
|
-
const
|
|
42
|
+
}, Dc = ({ formats: a, selected: n, onChange: s }) => /* @__PURE__ */ e("div", { className: "nice-export-formats", children: a.map((i) => {
|
|
43
|
+
const t = Ce[i];
|
|
44
44
|
return /* @__PURE__ */ c(
|
|
45
45
|
"button",
|
|
46
46
|
{
|
|
47
47
|
type: "button",
|
|
48
|
-
className: `nice-export-format ${
|
|
49
|
-
onClick: () =>
|
|
50
|
-
title:
|
|
48
|
+
className: `nice-export-format ${n === i ? "nice-export-format--selected" : ""}`,
|
|
49
|
+
onClick: () => s(i),
|
|
50
|
+
title: t.description,
|
|
51
51
|
children: [
|
|
52
|
-
/* @__PURE__ */ e("span", { className: "nice-export-format-icon", children:
|
|
53
|
-
/* @__PURE__ */ e("span", { className: "nice-export-format-label", children:
|
|
52
|
+
/* @__PURE__ */ e("span", { className: "nice-export-format-icon", children: t.icon }),
|
|
53
|
+
/* @__PURE__ */ e("span", { className: "nice-export-format-label", children: t.label })
|
|
54
54
|
]
|
|
55
55
|
},
|
|
56
|
-
|
|
56
|
+
i
|
|
57
57
|
);
|
|
58
|
-
}) }),
|
|
59
|
-
const t = (
|
|
60
|
-
const
|
|
61
|
-
h
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
},
|
|
58
|
+
}) }), Tc = ({ fields: a, onChange: n }) => {
|
|
59
|
+
const { t: s } = W(), i = (h) => {
|
|
60
|
+
const r = [...a];
|
|
61
|
+
r[h] = { ...r[h], include: !r[h].include }, n(r);
|
|
62
|
+
}, t = (h) => {
|
|
63
|
+
n(a.map((r) => ({ ...r, include: h })));
|
|
64
|
+
}, l = a.filter((h) => h.include).length;
|
|
65
65
|
return /* @__PURE__ */ c("div", { className: "nice-export-fields", children: [
|
|
66
66
|
/* @__PURE__ */ c("div", { className: "nice-export-fields-header", children: [
|
|
67
67
|
/* @__PURE__ */ c("span", { children: [
|
|
68
68
|
"Fields to export (",
|
|
69
|
-
|
|
69
|
+
l,
|
|
70
70
|
"/",
|
|
71
|
-
|
|
71
|
+
a.length,
|
|
72
72
|
")"
|
|
73
73
|
] }),
|
|
74
74
|
/* @__PURE__ */ c("div", { className: "nice-export-fields-actions", children: [
|
|
75
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: () =>
|
|
76
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: () =>
|
|
75
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => t(!0), children: s("dataExportCenter.selectAll", "Select all") }),
|
|
76
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => t(!1), children: s("dataExportCenter.deselectAll", "Deselect all") })
|
|
77
77
|
] })
|
|
78
78
|
] }),
|
|
79
|
-
/* @__PURE__ */ e("div", { className: "nice-export-fields-list", children:
|
|
80
|
-
/* @__PURE__ */ e("input", { type: "checkbox", checked:
|
|
81
|
-
/* @__PURE__ */ e("span", { className: "nice-export-field-label", children:
|
|
82
|
-
/* @__PURE__ */ e("span", { className: "nice-export-field-name", children:
|
|
83
|
-
] },
|
|
79
|
+
/* @__PURE__ */ e("div", { className: "nice-export-fields-list", children: a.map((h, r) => /* @__PURE__ */ c("label", { className: "nice-export-field", children: [
|
|
80
|
+
/* @__PURE__ */ e("input", { type: "checkbox", checked: h.include, onChange: () => i(r) }),
|
|
81
|
+
/* @__PURE__ */ e("span", { className: "nice-export-field-label", children: h.label }),
|
|
82
|
+
/* @__PURE__ */ e("span", { className: "nice-export-field-name", children: h.field })
|
|
83
|
+
] }, h.field)) })
|
|
84
84
|
] });
|
|
85
|
-
},
|
|
86
|
-
const
|
|
87
|
-
|
|
85
|
+
}, Lc = ({ format: a, options: n, onChange: s }) => {
|
|
86
|
+
const { t: i } = W(), t = (l, h) => {
|
|
87
|
+
s({ ...n, [l]: h });
|
|
88
88
|
};
|
|
89
89
|
return /* @__PURE__ */ c("div", { className: "nice-export-options", children: [
|
|
90
|
-
/* @__PURE__ */ e("h4", { children: "Export Options" }),
|
|
90
|
+
/* @__PURE__ */ e("h4", { children: i("dataExportCenter.exportOptions", "Export Options") }),
|
|
91
91
|
/* @__PURE__ */ c("label", { className: "nice-export-option", children: [
|
|
92
92
|
/* @__PURE__ */ e(
|
|
93
93
|
"input",
|
|
94
94
|
{
|
|
95
95
|
type: "checkbox",
|
|
96
|
-
checked:
|
|
97
|
-
onChange: (
|
|
96
|
+
checked: n.includeHeaders !== !1,
|
|
97
|
+
onChange: (l) => t("includeHeaders", l.target.checked)
|
|
98
98
|
}
|
|
99
99
|
),
|
|
100
|
-
"Include headers"
|
|
100
|
+
i("dataExportCenter.includeHeaders", "Include headers")
|
|
101
101
|
] }),
|
|
102
|
-
|
|
102
|
+
a === "csv" && /* @__PURE__ */ c("label", { className: "nice-export-option", children: [
|
|
103
103
|
/* @__PURE__ */ e("span", { children: "Delimiter:" }),
|
|
104
104
|
/* @__PURE__ */ c(
|
|
105
105
|
"select",
|
|
106
106
|
{
|
|
107
|
-
value:
|
|
108
|
-
onChange: (
|
|
107
|
+
value: n.csvDelimiter || ",",
|
|
108
|
+
onChange: (l) => t("csvDelimiter", l.target.value),
|
|
109
109
|
children: [
|
|
110
110
|
/* @__PURE__ */ e("option", { value: ",", children: "Comma (,)" }),
|
|
111
111
|
/* @__PURE__ */ e("option", { value: ";", children: "Semicolon (;)" }),
|
|
@@ -120,13 +120,13 @@ const ke = {
|
|
|
120
120
|
/* @__PURE__ */ c(
|
|
121
121
|
"select",
|
|
122
122
|
{
|
|
123
|
-
value:
|
|
124
|
-
onChange: (
|
|
123
|
+
value: n.dateFormat || "YYYY-MM-DD",
|
|
124
|
+
onChange: (l) => t("dateFormat", l.target.value),
|
|
125
125
|
children: [
|
|
126
|
-
/* @__PURE__ */ e("option", { value: "YYYY-MM-DD", children: "YYYY-MM-DD" }),
|
|
126
|
+
/* @__PURE__ */ e("option", { value: "YYYY-MM-DD", children: i("dataExportCenter.yyyyMmDd", "YYYY-MM-DD") }),
|
|
127
127
|
/* @__PURE__ */ e("option", { value: "DD/MM/YYYY", children: "DD/MM/YYYY" }),
|
|
128
128
|
/* @__PURE__ */ e("option", { value: "MM/DD/YYYY", children: "MM/DD/YYYY" }),
|
|
129
|
-
/* @__PURE__ */ e("option", { value: "ISO", children: "ISO 8601" })
|
|
129
|
+
/* @__PURE__ */ e("option", { value: "ISO", children: i("dataExportCenter.iso8601", "ISO 8601") })
|
|
130
130
|
]
|
|
131
131
|
}
|
|
132
132
|
)
|
|
@@ -136,364 +136,369 @@ const ke = {
|
|
|
136
136
|
/* @__PURE__ */ c(
|
|
137
137
|
"select",
|
|
138
138
|
{
|
|
139
|
-
value:
|
|
140
|
-
onChange: (
|
|
139
|
+
value: n.encoding || "utf-8",
|
|
140
|
+
onChange: (l) => t("encoding", l.target.value),
|
|
141
141
|
children: [
|
|
142
|
-
/* @__PURE__ */ e("option", { value: "utf-8", children: "UTF-8" }),
|
|
143
|
-
/* @__PURE__ */ e("option", { value: "utf-16", children: "UTF-16" }),
|
|
144
|
-
/* @__PURE__ */ e("option", { value: "iso-8859-1", children: "ISO-8859-1" })
|
|
142
|
+
/* @__PURE__ */ e("option", { value: "utf-8", children: i("dataExportCenter.utf8", "UTF-8") }),
|
|
143
|
+
/* @__PURE__ */ e("option", { value: "utf-16", children: i("dataExportCenter.utf16", "UTF-16") }),
|
|
144
|
+
/* @__PURE__ */ e("option", { value: "iso-8859-1", children: i("dataExportCenter.iso88591", "ISO-8859-1") })
|
|
145
145
|
]
|
|
146
146
|
}
|
|
147
147
|
)
|
|
148
148
|
] }),
|
|
149
|
-
(
|
|
149
|
+
(a === "xlsx" || a === "pdf") && /* @__PURE__ */ c("label", { className: "nice-export-option", children: [
|
|
150
150
|
/* @__PURE__ */ e("span", { children: "Password protect:" }),
|
|
151
151
|
/* @__PURE__ */ e(
|
|
152
152
|
"input",
|
|
153
153
|
{
|
|
154
154
|
type: "password",
|
|
155
|
-
value:
|
|
156
|
-
onChange: (
|
|
157
|
-
placeholder:
|
|
155
|
+
value: n.password || "",
|
|
156
|
+
onChange: (l) => t("password", l.target.value || void 0),
|
|
157
|
+
placeholder: i(
|
|
158
|
+
"dataExportCenter.leaveEmptyForNoPassword",
|
|
159
|
+
"Leave empty for no password"
|
|
160
|
+
)
|
|
158
161
|
}
|
|
159
162
|
)
|
|
160
163
|
] })
|
|
161
164
|
] });
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
}, zc = ({ jobs: a, onDownload: n }) => {
|
|
166
|
+
const { t: s } = W();
|
|
167
|
+
if (a.length === 0)
|
|
168
|
+
return /* @__PURE__ */ e("div", { className: "nice-export-history-empty", children: s("dataExportCenter.noExportHistory", "No export history") });
|
|
169
|
+
const i = (t) => t ? t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : `${(t / 1024 / 1024).toFixed(1)} MB` : "-";
|
|
166
170
|
return /* @__PURE__ */ c("div", { className: "nice-export-history", children: [
|
|
167
|
-
/* @__PURE__ */ e("h4", { children: "Export History" }),
|
|
168
|
-
/* @__PURE__ */ e("div", { className: "nice-export-history-list", children:
|
|
171
|
+
/* @__PURE__ */ e("h4", { children: s("dataExportCenter.exportHistory", "Export History") }),
|
|
172
|
+
/* @__PURE__ */ e("div", { className: "nice-export-history-list", children: a.map((t) => /* @__PURE__ */ c("div", { className: `nice-export-job nice-export-job--${t.status}`, children: [
|
|
169
173
|
/* @__PURE__ */ c("div", { className: "nice-export-job-info", children: [
|
|
170
|
-
/* @__PURE__ */ e("span", { className: "nice-export-job-name", children:
|
|
171
|
-
/* @__PURE__ */ e("span", { className: "nice-export-job-format", children:
|
|
172
|
-
/* @__PURE__ */ e("span", { className: "nice-export-job-date", children: new Date(
|
|
174
|
+
/* @__PURE__ */ e("span", { className: "nice-export-job-name", children: t.name }),
|
|
175
|
+
/* @__PURE__ */ e("span", { className: "nice-export-job-format", children: t.format.toUpperCase() }),
|
|
176
|
+
/* @__PURE__ */ e("span", { className: "nice-export-job-date", children: new Date(t.createdAt).toLocaleString() })
|
|
173
177
|
] }),
|
|
174
178
|
/* @__PURE__ */ c("div", { className: "nice-export-job-meta", children: [
|
|
175
|
-
|
|
176
|
-
|
|
179
|
+
t.rowCount && /* @__PURE__ */ c("span", { children: [
|
|
180
|
+
t.rowCount,
|
|
177
181
|
" rows"
|
|
178
182
|
] }),
|
|
179
|
-
|
|
183
|
+
t.fileSize && /* @__PURE__ */ e("span", { children: i(t.fileSize) })
|
|
180
184
|
] }),
|
|
181
185
|
/* @__PURE__ */ c("div", { className: "nice-export-job-status", children: [
|
|
182
|
-
|
|
186
|
+
t.status === "processing" && /* @__PURE__ */ e("div", { className: "nice-export-job-progress", children: /* @__PURE__ */ e(
|
|
183
187
|
"div",
|
|
184
188
|
{
|
|
185
189
|
className: "nice-export-job-progress-bar",
|
|
186
|
-
style: { width: `${
|
|
190
|
+
style: { width: `${t.progress}%` }
|
|
187
191
|
}
|
|
188
192
|
) }),
|
|
189
|
-
|
|
193
|
+
t.status === "completed" && t.downloadUrl && /* @__PURE__ */ e(
|
|
190
194
|
"button",
|
|
191
195
|
{
|
|
192
196
|
type: "button",
|
|
193
197
|
className: "nice-export-job-download",
|
|
194
|
-
onClick: () =>
|
|
195
|
-
children: "Download"
|
|
198
|
+
onClick: () => n == null ? void 0 : n(t),
|
|
199
|
+
children: s("dataExportCenter.download", "Download")
|
|
196
200
|
}
|
|
197
201
|
),
|
|
198
|
-
|
|
202
|
+
t.status === "failed" && /* @__PURE__ */ e("span", { className: "nice-export-job-error", title: t.error, children: s("dataExportCenter.failed", "Failed") })
|
|
199
203
|
] })
|
|
200
|
-
] },
|
|
204
|
+
] }, t.id)) })
|
|
201
205
|
] });
|
|
202
|
-
},
|
|
203
|
-
(
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
Y(!0), P(0), l == null || l(v);
|
|
235
|
-
try {
|
|
236
|
-
const x = await i.fetchData({
|
|
237
|
-
fields: U,
|
|
238
|
-
filters: void 0,
|
|
239
|
-
sorting: void 0
|
|
240
|
-
});
|
|
241
|
-
P(50);
|
|
242
|
-
let z;
|
|
243
|
-
if (S)
|
|
244
|
-
z = await S(M, x, m);
|
|
245
|
-
else
|
|
246
|
-
switch (M) {
|
|
247
|
-
case "csv":
|
|
248
|
-
z = kc(x, U, m);
|
|
249
|
-
break;
|
|
250
|
-
case "json":
|
|
251
|
-
z = wc(x, U, m);
|
|
252
|
-
break;
|
|
253
|
-
default:
|
|
254
|
-
throw new Error(`Format ${M} requires a custom export handler`);
|
|
255
|
-
}
|
|
256
|
-
P(100);
|
|
257
|
-
const G = typeof z == "string" ? new Blob([z], { type: "text/plain" }) : z, V = URL.createObjectURL(G), b = document.createElement("a");
|
|
258
|
-
b.href = V, b.download = `export-${Date.now()}.${M}`, document.body.appendChild(b), b.click(), document.body.removeChild(b), URL.revokeObjectURL(V);
|
|
259
|
-
const L = {
|
|
260
|
-
...v,
|
|
261
|
-
status: "completed",
|
|
262
|
-
progress: 100,
|
|
263
|
-
completedAt: /* @__PURE__ */ new Date(),
|
|
264
|
-
rowCount: x.length,
|
|
265
|
-
fileSize: G.size
|
|
206
|
+
}, ta = /* @__PURE__ */ Object.assign(
|
|
207
|
+
/* @__PURE__ */ le(
|
|
208
|
+
({
|
|
209
|
+
dataSource: a,
|
|
210
|
+
formats: n = ["csv", "xlsx", "json", "pdf"],
|
|
211
|
+
templates: s = [],
|
|
212
|
+
enableScheduling: i = !1,
|
|
213
|
+
exportHistory: t = [],
|
|
214
|
+
onExportStart: l,
|
|
215
|
+
onExportComplete: h,
|
|
216
|
+
onExportError: r,
|
|
217
|
+
onSaveTemplate: o,
|
|
218
|
+
onDeleteTemplate: w,
|
|
219
|
+
onSchedule: _,
|
|
220
|
+
customExportHandler: I,
|
|
221
|
+
title: C,
|
|
222
|
+
description: z,
|
|
223
|
+
className: F = "",
|
|
224
|
+
style: U
|
|
225
|
+
}, L) => {
|
|
226
|
+
const { t: Y } = W(), ce = C ?? Y("dataExportCenter.title", "Data Export"), [$, q] = k(n[0]), [E, m] = k(a.getFields()), [N, g] = k({
|
|
227
|
+
includeHeaders: !0,
|
|
228
|
+
dateFormat: "YYYY-MM-DD",
|
|
229
|
+
encoding: "utf-8"
|
|
230
|
+
}), [V, u] = k(!1), [B, O] = k(0), [P, x] = k("export"), H = R(async () => {
|
|
231
|
+
const b = {
|
|
232
|
+
id: Date.now().toString(),
|
|
233
|
+
name: `Export ${(/* @__PURE__ */ new Date()).toISOString()}`,
|
|
234
|
+
format: $,
|
|
235
|
+
status: "processing",
|
|
236
|
+
progress: 0,
|
|
237
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
266
238
|
};
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
"
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
A === "export" && /* @__PURE__ */ c(ee, { children: [
|
|
239
|
+
u(!0), O(0), l == null || l(b);
|
|
240
|
+
try {
|
|
241
|
+
const S = await a.fetchData({
|
|
242
|
+
fields: E,
|
|
243
|
+
filters: void 0,
|
|
244
|
+
sorting: void 0
|
|
245
|
+
});
|
|
246
|
+
O(50);
|
|
247
|
+
let A;
|
|
248
|
+
if (I)
|
|
249
|
+
A = await I($, S, N);
|
|
250
|
+
else
|
|
251
|
+
switch ($) {
|
|
252
|
+
case "csv":
|
|
253
|
+
A = xc(S, E, N);
|
|
254
|
+
break;
|
|
255
|
+
case "json":
|
|
256
|
+
A = Sc(S, E, N);
|
|
257
|
+
break;
|
|
258
|
+
default:
|
|
259
|
+
throw new Error(`Format ${$} requires a custom export handler`);
|
|
260
|
+
}
|
|
261
|
+
O(100);
|
|
262
|
+
const J = typeof A == "string" ? new Blob([A], { type: "text/plain" }) : A, f = URL.createObjectURL(J), T = document.createElement("a");
|
|
263
|
+
T.href = f, T.download = `export-${Date.now()}.${$}`, document.body.appendChild(T), T.click(), document.body.removeChild(T), URL.revokeObjectURL(f);
|
|
264
|
+
const X = {
|
|
265
|
+
...b,
|
|
266
|
+
status: "completed",
|
|
267
|
+
progress: 100,
|
|
268
|
+
completedAt: /* @__PURE__ */ new Date(),
|
|
269
|
+
rowCount: S.length,
|
|
270
|
+
fileSize: J.size
|
|
271
|
+
};
|
|
272
|
+
h == null || h(X);
|
|
273
|
+
} catch (S) {
|
|
274
|
+
const A = {
|
|
275
|
+
...b,
|
|
276
|
+
status: "failed",
|
|
277
|
+
error: S instanceof Error ? S.message : "Unknown error"
|
|
278
|
+
};
|
|
279
|
+
r == null || r(A, S instanceof Error ? S : new Error("Export failed"));
|
|
280
|
+
} finally {
|
|
281
|
+
u(!1), O(0);
|
|
282
|
+
}
|
|
283
|
+
}, [
|
|
284
|
+
$,
|
|
285
|
+
E,
|
|
286
|
+
N,
|
|
287
|
+
a,
|
|
288
|
+
I,
|
|
289
|
+
l,
|
|
290
|
+
h,
|
|
291
|
+
r
|
|
292
|
+
]), j = R(
|
|
293
|
+
(b) => {
|
|
294
|
+
const S = s.find((A) => A.id === b);
|
|
295
|
+
S && (q(S.format), m(S.fields), S.options && g(S.options));
|
|
296
|
+
},
|
|
297
|
+
[s]
|
|
298
|
+
);
|
|
299
|
+
return re(L, () => ({
|
|
300
|
+
exportNow: async (b) => {
|
|
301
|
+
q(b), await H();
|
|
302
|
+
},
|
|
303
|
+
getSelectedFields: () => E,
|
|
304
|
+
loadTemplate: j
|
|
305
|
+
})), /* @__PURE__ */ c("div", { className: `nice-export-center ${F}`, style: U, children: [
|
|
306
|
+
/* @__PURE__ */ e("div", { className: "nice-export-header", children: /* @__PURE__ */ c("div", { className: "nice-export-title-area", children: [
|
|
307
|
+
/* @__PURE__ */ e("h3", { className: "nice-export-title", children: ce }),
|
|
308
|
+
z && /* @__PURE__ */ e("p", { className: "nice-export-description", children: z })
|
|
309
|
+
] }) }),
|
|
310
|
+
/* @__PURE__ */ c("div", { className: "nice-export-tabs", children: [
|
|
340
311
|
/* @__PURE__ */ e(
|
|
341
|
-
|
|
312
|
+
"button",
|
|
313
|
+
{
|
|
314
|
+
type: "button",
|
|
315
|
+
className: `nice-export-tab ${P === "export" ? "nice-export-tab--active" : ""}`,
|
|
316
|
+
onClick: () => x("export"),
|
|
317
|
+
children: Y("dataExportCenter.export", "Export")
|
|
318
|
+
}
|
|
319
|
+
),
|
|
320
|
+
s.length > 0 && /* @__PURE__ */ c(
|
|
321
|
+
"button",
|
|
342
322
|
{
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
323
|
+
type: "button",
|
|
324
|
+
className: `nice-export-tab ${P === "templates" ? "nice-export-tab--active" : ""}`,
|
|
325
|
+
onClick: () => x("templates"),
|
|
326
|
+
children: [
|
|
327
|
+
"Templates (",
|
|
328
|
+
s.length,
|
|
329
|
+
")"
|
|
330
|
+
]
|
|
346
331
|
}
|
|
347
332
|
),
|
|
348
|
-
/* @__PURE__ */ e(
|
|
349
|
-
|
|
350
|
-
|
|
333
|
+
t.length > 0 && /* @__PURE__ */ e(
|
|
334
|
+
"button",
|
|
335
|
+
{
|
|
336
|
+
type: "button",
|
|
337
|
+
className: `nice-export-tab ${P === "history" ? "nice-export-tab--active" : ""}`,
|
|
338
|
+
onClick: () => x("history"),
|
|
339
|
+
children: Y("dataExportCenter.history", "History")
|
|
340
|
+
}
|
|
341
|
+
)
|
|
342
|
+
] }),
|
|
343
|
+
/* @__PURE__ */ c("div", { className: "nice-export-content", children: [
|
|
344
|
+
P === "export" && /* @__PURE__ */ c(ae, { children: [
|
|
351
345
|
/* @__PURE__ */ e(
|
|
352
|
-
|
|
346
|
+
Dc,
|
|
353
347
|
{
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
disabled: g || U.filter((v) => v.include).length === 0,
|
|
358
|
-
children: g ? `Exporting... ${p}%` : "Export Now"
|
|
348
|
+
formats: n,
|
|
349
|
+
selected: $,
|
|
350
|
+
onChange: q
|
|
359
351
|
}
|
|
360
352
|
),
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
353
|
+
/* @__PURE__ */ e(Tc, { fields: E, onChange: m }),
|
|
354
|
+
/* @__PURE__ */ e(Lc, { format: $, options: N, onChange: g }),
|
|
355
|
+
/* @__PURE__ */ c("div", { className: "nice-export-actions", children: [
|
|
356
|
+
/* @__PURE__ */ e(
|
|
357
|
+
"button",
|
|
358
|
+
{
|
|
359
|
+
type: "button",
|
|
360
|
+
className: "nice-export-btn nice-export-btn--primary",
|
|
361
|
+
onClick: H,
|
|
362
|
+
disabled: V || E.filter((b) => b.include).length === 0,
|
|
363
|
+
children: V ? `Exporting... ${B}%` : "Export Now"
|
|
364
|
+
}
|
|
365
|
+
),
|
|
366
|
+
o && /* @__PURE__ */ e(
|
|
367
|
+
"button",
|
|
368
|
+
{
|
|
369
|
+
type: "button",
|
|
370
|
+
className: "nice-export-btn nice-export-btn--secondary",
|
|
371
|
+
onClick: () => o({
|
|
372
|
+
id: Date.now().toString(),
|
|
373
|
+
name: `Template ${s.length + 1}`,
|
|
374
|
+
format: $,
|
|
375
|
+
fields: E,
|
|
376
|
+
options: N
|
|
377
|
+
}),
|
|
378
|
+
children: Y("dataExportCenter.saveAsTemplate", "Save as Template")
|
|
379
|
+
}
|
|
380
|
+
)
|
|
381
|
+
] })
|
|
387
382
|
] }),
|
|
388
|
-
/* @__PURE__ */ c("div", { className: "nice-export-template
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
-
"
|
|
391
|
-
{
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
383
|
+
P === "templates" && /* @__PURE__ */ e("div", { className: "nice-export-templates", children: s.map((b) => /* @__PURE__ */ c("div", { className: "nice-export-template", children: [
|
|
384
|
+
/* @__PURE__ */ c("div", { className: "nice-export-template-info", children: [
|
|
385
|
+
/* @__PURE__ */ e("span", { className: "nice-export-template-name", children: b.name }),
|
|
386
|
+
/* @__PURE__ */ c("span", { className: "nice-export-template-format", children: [
|
|
387
|
+
Ce[b.format].icon,
|
|
388
|
+
" ",
|
|
389
|
+
Ce[b.format].label
|
|
390
|
+
] }),
|
|
391
|
+
b.description && /* @__PURE__ */ e("span", { className: "nice-export-template-desc", children: b.description })
|
|
392
|
+
] }),
|
|
393
|
+
/* @__PURE__ */ c("div", { className: "nice-export-template-actions", children: [
|
|
394
|
+
/* @__PURE__ */ e(
|
|
395
|
+
"button",
|
|
396
|
+
{
|
|
397
|
+
type: "button",
|
|
398
|
+
onClick: () => {
|
|
399
|
+
j(b.id), x("export");
|
|
400
|
+
},
|
|
401
|
+
children: "Use"
|
|
402
|
+
}
|
|
403
|
+
),
|
|
404
|
+
w && /* @__PURE__ */ e("button", { type: "button", onClick: () => w(b.id), children: Y("dataExportCenter.delete", "Delete") })
|
|
405
|
+
] })
|
|
406
|
+
] }, b.id)) }),
|
|
407
|
+
P === "history" && /* @__PURE__ */ e(
|
|
408
|
+
zc,
|
|
409
|
+
{
|
|
410
|
+
jobs: t,
|
|
411
|
+
onDownload: (b) => {
|
|
412
|
+
b.downloadUrl && window.open(b.downloadUrl, "_blank");
|
|
397
413
|
}
|
|
398
|
-
),
|
|
399
|
-
T && /* @__PURE__ */ e("button", { type: "button", onClick: () => T(v.id), children: "Delete" })
|
|
400
|
-
] })
|
|
401
|
-
] }, v.id)) }),
|
|
402
|
-
A === "history" && /* @__PURE__ */ e(
|
|
403
|
-
xc,
|
|
404
|
-
{
|
|
405
|
-
jobs: n,
|
|
406
|
-
onDownload: (v) => {
|
|
407
|
-
v.downloadUrl && window.open(v.downloadUrl, "_blank");
|
|
408
414
|
}
|
|
409
|
-
|
|
410
|
-
)
|
|
411
|
-
] })
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
const se = {
|
|
415
|
+
)
|
|
416
|
+
] })
|
|
417
|
+
] });
|
|
418
|
+
}
|
|
419
|
+
),
|
|
420
|
+
{ displayName: "NiceDataExportCenter" }
|
|
421
|
+
), ne = {
|
|
417
422
|
create: {
|
|
418
|
-
icon: /* @__PURE__ */ e(
|
|
423
|
+
icon: /* @__PURE__ */ e(Te, { size: 16 }),
|
|
419
424
|
label: "Created",
|
|
420
425
|
color: "var(--nice-color-success, #10b981)"
|
|
421
426
|
},
|
|
422
427
|
update: {
|
|
423
|
-
icon: /* @__PURE__ */ e(
|
|
428
|
+
icon: /* @__PURE__ */ e(je, { size: 16 }),
|
|
424
429
|
label: "Updated",
|
|
425
430
|
color: "var(--nice-color-primary, #3b82f6)"
|
|
426
431
|
},
|
|
427
432
|
delete: {
|
|
428
|
-
icon: /* @__PURE__ */ e(
|
|
433
|
+
icon: /* @__PURE__ */ e(be, { size: 16 }),
|
|
429
434
|
label: "Deleted",
|
|
430
435
|
color: "var(--nice-color-error, #ef4444)"
|
|
431
436
|
},
|
|
432
|
-
view: { icon: /* @__PURE__ */ e(
|
|
437
|
+
view: { icon: /* @__PURE__ */ e(cc, { size: 16 }), label: "Viewed", color: "var(--nice-text-muted, #6b7280)" },
|
|
433
438
|
export: {
|
|
434
|
-
icon: /* @__PURE__ */ e(
|
|
439
|
+
icon: /* @__PURE__ */ e(ve, { size: 16 }),
|
|
435
440
|
label: "Exported",
|
|
436
441
|
color: "var(--nice-color-accent, #8b5cf6)"
|
|
437
442
|
},
|
|
438
443
|
import: {
|
|
439
|
-
icon: /* @__PURE__ */ e(
|
|
444
|
+
icon: /* @__PURE__ */ e(ec, { size: 16 }),
|
|
440
445
|
label: "Imported",
|
|
441
446
|
color: "var(--nice-color-accent, #8b5cf6)"
|
|
442
447
|
},
|
|
443
448
|
approve: {
|
|
444
|
-
icon: /* @__PURE__ */ e(
|
|
449
|
+
icon: /* @__PURE__ */ e(se, { size: 16 }),
|
|
445
450
|
label: "Approved",
|
|
446
451
|
color: "var(--nice-color-success, #10b981)"
|
|
447
452
|
},
|
|
448
453
|
reject: {
|
|
449
|
-
icon: /* @__PURE__ */ e(
|
|
454
|
+
icon: /* @__PURE__ */ e(he, { size: 16 }),
|
|
450
455
|
label: "Rejected",
|
|
451
456
|
color: "var(--nice-color-error, #ef4444)"
|
|
452
457
|
},
|
|
453
458
|
login: {
|
|
454
|
-
icon: /* @__PURE__ */ e(
|
|
459
|
+
icon: /* @__PURE__ */ e(Qe, { size: 16 }),
|
|
455
460
|
label: "Login",
|
|
456
461
|
color: "var(--nice-color-success, #10b981)"
|
|
457
462
|
},
|
|
458
463
|
logout: {
|
|
459
|
-
icon: /* @__PURE__ */ e(
|
|
464
|
+
icon: /* @__PURE__ */ e(Me, { size: 16 }),
|
|
460
465
|
label: "Logout",
|
|
461
466
|
color: "var(--nice-text-muted, #6b7280)"
|
|
462
467
|
},
|
|
463
468
|
permission_change: {
|
|
464
|
-
icon: /* @__PURE__ */ e(
|
|
469
|
+
icon: /* @__PURE__ */ e(fe, { size: 16 }),
|
|
465
470
|
label: "Permissions",
|
|
466
471
|
color: "var(--nice-color-warning, #f59e0b)"
|
|
467
472
|
},
|
|
468
473
|
config_change: {
|
|
469
|
-
icon: /* @__PURE__ */ e(
|
|
474
|
+
icon: /* @__PURE__ */ e($e, { size: 16 }),
|
|
470
475
|
label: "Config",
|
|
471
476
|
color: "var(--nice-color-warning, #f59e0b)"
|
|
472
477
|
},
|
|
473
478
|
custom: {
|
|
474
|
-
icon: /* @__PURE__ */ e(
|
|
479
|
+
icon: /* @__PURE__ */ e(De, { size: 16 }),
|
|
475
480
|
label: "Action",
|
|
476
481
|
color: "var(--nice-text-muted, #6b7280)"
|
|
477
482
|
}
|
|
478
|
-
},
|
|
479
|
-
filter:
|
|
480
|
-
onChange:
|
|
481
|
-
availableFilters:
|
|
483
|
+
}, Ec = ({
|
|
484
|
+
filter: a,
|
|
485
|
+
onChange: n,
|
|
486
|
+
availableFilters: s
|
|
482
487
|
}) => {
|
|
483
|
-
var
|
|
484
|
-
const
|
|
485
|
-
|
|
488
|
+
var l, h;
|
|
489
|
+
const { t: i } = W(), t = (r, o) => {
|
|
490
|
+
n({ ...a, [r]: o });
|
|
486
491
|
};
|
|
487
492
|
return /* @__PURE__ */ c("div", { className: "nice-audit-filters", children: [
|
|
488
493
|
/* @__PURE__ */ c("div", { className: "nice-audit-filter-group", children: [
|
|
489
|
-
/* @__PURE__ */ e("label", { children: "Date Range" }),
|
|
494
|
+
/* @__PURE__ */ e("label", { children: i("auditTrail.dateRange", "Date Range") }),
|
|
490
495
|
/* @__PURE__ */ c("div", { className: "nice-audit-date-range", children: [
|
|
491
496
|
/* @__PURE__ */ e(
|
|
492
497
|
"input",
|
|
493
498
|
{
|
|
494
499
|
type: "date",
|
|
495
|
-
value: ((
|
|
496
|
-
onChange: (
|
|
500
|
+
value: ((l = a.startDate) == null ? void 0 : l.toISOString().split("T")[0]) || "",
|
|
501
|
+
onChange: (r) => t("startDate", r.target.value ? new Date(r.target.value) : void 0)
|
|
497
502
|
}
|
|
498
503
|
),
|
|
499
504
|
/* @__PURE__ */ e("span", { children: "to" }),
|
|
@@ -501,357 +506,366 @@ const se = {
|
|
|
501
506
|
"input",
|
|
502
507
|
{
|
|
503
508
|
type: "date",
|
|
504
|
-
value: ((
|
|
505
|
-
onChange: (
|
|
509
|
+
value: ((h = a.endDate) == null ? void 0 : h.toISOString().split("T")[0]) || "",
|
|
510
|
+
onChange: (r) => t("endDate", r.target.value ? new Date(r.target.value) : void 0)
|
|
506
511
|
}
|
|
507
512
|
)
|
|
508
513
|
] })
|
|
509
514
|
] }),
|
|
510
515
|
/* @__PURE__ */ c("div", { className: "nice-audit-filter-group", children: [
|
|
511
|
-
/* @__PURE__ */ e("label", { children: "Actions" }),
|
|
512
|
-
/* @__PURE__ */ e("div", { className: "nice-audit-action-chips", children: Object.keys(
|
|
513
|
-
var
|
|
514
|
-
const
|
|
516
|
+
/* @__PURE__ */ e("label", { children: i("auditTrail.actions", "Actions") }),
|
|
517
|
+
/* @__PURE__ */ e("div", { className: "nice-audit-action-chips", children: Object.keys(ne).slice(0, 8).map((r) => {
|
|
518
|
+
var _;
|
|
519
|
+
const o = ne[r], w = (_ = a.actions) == null ? void 0 : _.includes(r);
|
|
515
520
|
return /* @__PURE__ */ c(
|
|
516
521
|
"button",
|
|
517
522
|
{
|
|
518
523
|
type: "button",
|
|
519
|
-
className: `nice-audit-chip ${
|
|
520
|
-
style: { "--chip-color":
|
|
524
|
+
className: `nice-audit-chip ${w ? "nice-audit-chip--selected" : ""}`,
|
|
525
|
+
style: { "--chip-color": o.color },
|
|
521
526
|
onClick: () => {
|
|
522
|
-
const
|
|
523
|
-
|
|
527
|
+
const I = a.actions || [];
|
|
528
|
+
t(
|
|
524
529
|
"actions",
|
|
525
|
-
|
|
530
|
+
w ? I.filter((C) => C !== r) : [...I, r]
|
|
526
531
|
);
|
|
527
532
|
},
|
|
528
533
|
children: [
|
|
529
|
-
/* @__PURE__ */ e("span", { className: "nice-audit-chip-icon", children:
|
|
530
|
-
|
|
534
|
+
/* @__PURE__ */ e("span", { className: "nice-audit-chip-icon", children: o.icon }),
|
|
535
|
+
o.label
|
|
531
536
|
]
|
|
532
537
|
},
|
|
533
|
-
|
|
538
|
+
r
|
|
534
539
|
);
|
|
535
540
|
}) })
|
|
536
541
|
] }),
|
|
537
542
|
/* @__PURE__ */ c("div", { className: "nice-audit-filter-group", children: [
|
|
538
|
-
/* @__PURE__ */ e("label", { children: "Search" }),
|
|
543
|
+
/* @__PURE__ */ e("label", { children: i("auditTrail.search", "Search") }),
|
|
539
544
|
/* @__PURE__ */ e(
|
|
540
545
|
"input",
|
|
541
546
|
{
|
|
542
547
|
type: "text",
|
|
543
548
|
className: "nice-audit-search",
|
|
544
|
-
placeholder: "Search entries...",
|
|
545
|
-
value:
|
|
546
|
-
onChange: (
|
|
549
|
+
placeholder: i("auditTrail.searchEntries", "Search entries..."),
|
|
550
|
+
value: a.searchQuery || "",
|
|
551
|
+
onChange: (r) => t("searchQuery", r.target.value || void 0)
|
|
547
552
|
}
|
|
548
553
|
)
|
|
549
554
|
] })
|
|
550
555
|
] });
|
|
551
|
-
}, _c = ({ changes:
|
|
552
|
-
if (!
|
|
556
|
+
}, _c = ({ changes: a }) => {
|
|
557
|
+
if (!a.length)
|
|
553
558
|
return null;
|
|
554
|
-
const
|
|
555
|
-
return /* @__PURE__ */ e("div", { className: "nice-audit-diff", children:
|
|
556
|
-
/* @__PURE__ */ e("span", { className: "nice-audit-diff-field", children:
|
|
559
|
+
const n = (s, i) => i || (s == null ? "(empty)" : typeof s == "object" ? JSON.stringify(s, null, 2) : String(s));
|
|
560
|
+
return /* @__PURE__ */ e("div", { className: "nice-audit-diff", children: a.map((s, i) => /* @__PURE__ */ c("div", { className: "nice-audit-diff-row", children: [
|
|
561
|
+
/* @__PURE__ */ e("span", { className: "nice-audit-diff-field", children: s.field }),
|
|
557
562
|
/* @__PURE__ */ c("div", { className: "nice-audit-diff-values", children: [
|
|
558
|
-
/* @__PURE__ */ e("span", { className: "nice-audit-diff-old", children: s
|
|
559
|
-
/* @__PURE__ */ e("span", { className: "nice-audit-diff-arrow", children: /* @__PURE__ */ e(
|
|
560
|
-
/* @__PURE__ */ e("span", { className: "nice-audit-diff-new", children: s
|
|
563
|
+
/* @__PURE__ */ e("span", { className: "nice-audit-diff-old", children: n(s.oldValue, s.displayOldValue) }),
|
|
564
|
+
/* @__PURE__ */ e("span", { className: "nice-audit-diff-arrow", children: /* @__PURE__ */ e(ac, { size: 14 }) }),
|
|
565
|
+
/* @__PURE__ */ e("span", { className: "nice-audit-diff-new", children: n(s.newValue, s.displayNewValue) })
|
|
561
566
|
] })
|
|
562
|
-
] },
|
|
563
|
-
},
|
|
564
|
-
entry:
|
|
565
|
-
showDiff:
|
|
566
|
-
renderActionIcon:
|
|
567
|
-
renderUser:
|
|
568
|
-
onClick:
|
|
567
|
+
] }, i)) });
|
|
568
|
+
}, Ac = ({
|
|
569
|
+
entry: a,
|
|
570
|
+
showDiff: n,
|
|
571
|
+
renderActionIcon: s,
|
|
572
|
+
renderUser: i,
|
|
573
|
+
onClick: t
|
|
569
574
|
}) => {
|
|
570
|
-
const
|
|
575
|
+
const { t: l } = W(), [h, r] = k(!1), o = ne[a.action] || ne.custom;
|
|
571
576
|
return /* @__PURE__ */ c(
|
|
572
577
|
"div",
|
|
573
578
|
{
|
|
574
|
-
className: `nice-audit-timeline-entry nice-audit-timeline-entry--${
|
|
575
|
-
onClick:
|
|
576
|
-
role:
|
|
577
|
-
tabIndex:
|
|
579
|
+
className: `nice-audit-timeline-entry nice-audit-timeline-entry--${a.severity || "info"}`,
|
|
580
|
+
onClick: t,
|
|
581
|
+
role: t ? "button" : void 0,
|
|
582
|
+
tabIndex: t ? 0 : void 0,
|
|
578
583
|
children: [
|
|
579
584
|
/* @__PURE__ */ e(
|
|
580
585
|
"div",
|
|
581
586
|
{
|
|
582
587
|
className: "nice-audit-timeline-marker",
|
|
583
|
-
style: { "--marker-color":
|
|
584
|
-
children:
|
|
588
|
+
style: { "--marker-color": o.color },
|
|
589
|
+
children: s ? s(a.action) : o.icon
|
|
585
590
|
}
|
|
586
591
|
),
|
|
587
592
|
/* @__PURE__ */ c("div", { className: "nice-audit-timeline-content", children: [
|
|
588
593
|
/* @__PURE__ */ c("div", { className: "nice-audit-timeline-header", children: [
|
|
589
|
-
/* @__PURE__ */ e("span", { className: "nice-audit-timeline-action", children:
|
|
594
|
+
/* @__PURE__ */ e("span", { className: "nice-audit-timeline-action", children: a.actionLabel || o.label }),
|
|
590
595
|
/* @__PURE__ */ c("span", { className: "nice-audit-timeline-entity", children: [
|
|
591
|
-
|
|
596
|
+
a.entityType,
|
|
592
597
|
" ",
|
|
593
|
-
|
|
598
|
+
a.entityName && `"${a.entityName}"`
|
|
594
599
|
] }),
|
|
595
|
-
/* @__PURE__ */ e("span", { className: "nice-audit-timeline-time", children: new Date(
|
|
600
|
+
/* @__PURE__ */ e("span", { className: "nice-audit-timeline-time", children: new Date(a.timestamp).toLocaleString() })
|
|
596
601
|
] }),
|
|
597
|
-
/* @__PURE__ */ e("div", { className: "nice-audit-timeline-user", children:
|
|
598
|
-
|
|
599
|
-
/* @__PURE__ */ e("span", { className: "nice-audit-username", children:
|
|
600
|
-
|
|
602
|
+
/* @__PURE__ */ e("div", { className: "nice-audit-timeline-user", children: i ? i(a) : /* @__PURE__ */ c(ae, { children: [
|
|
603
|
+
a.userAvatar && /* @__PURE__ */ e("img", { src: a.userAvatar, alt: "", className: "nice-audit-avatar" }),
|
|
604
|
+
/* @__PURE__ */ e("span", { className: "nice-audit-username", children: a.userName }),
|
|
605
|
+
a.userRole && /* @__PURE__ */ e("span", { className: "nice-audit-role", children: a.userRole })
|
|
601
606
|
] }) }),
|
|
602
|
-
|
|
603
|
-
|
|
607
|
+
a.notes && /* @__PURE__ */ e("div", { className: "nice-audit-timeline-notes", children: a.notes }),
|
|
608
|
+
n && a.changes && a.changes.length > 0 && /* @__PURE__ */ c(ae, { children: [
|
|
604
609
|
/* @__PURE__ */ e(
|
|
605
610
|
"button",
|
|
606
611
|
{
|
|
607
612
|
type: "button",
|
|
608
613
|
className: "nice-audit-expand-btn",
|
|
609
|
-
onClick: (
|
|
610
|
-
|
|
614
|
+
onClick: (w) => {
|
|
615
|
+
w.stopPropagation(), r(!h);
|
|
611
616
|
},
|
|
612
|
-
children:
|
|
613
|
-
/* @__PURE__ */ e(
|
|
614
|
-
"
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
" changes"
|
|
617
|
+
children: h ? /* @__PURE__ */ c(ae, { children: [
|
|
618
|
+
/* @__PURE__ */ e(Se, { size: 14 }),
|
|
619
|
+
" ",
|
|
620
|
+
l("auditTrail.hideChanges", "Hide changes")
|
|
621
|
+
] }) : /* @__PURE__ */ c(ae, { children: [
|
|
622
|
+
/* @__PURE__ */ e(Fe, { size: 14 }),
|
|
623
|
+
" ",
|
|
624
|
+
l("auditTrail.showChanges", "Show {changes} changes").replace(
|
|
625
|
+
"{changes}",
|
|
626
|
+
String(a.changes.length)
|
|
627
|
+
)
|
|
620
628
|
] })
|
|
621
629
|
}
|
|
622
630
|
),
|
|
623
|
-
|
|
631
|
+
h && /* @__PURE__ */ e(_c, { changes: a.changes })
|
|
624
632
|
] }),
|
|
625
|
-
|
|
633
|
+
a.ipAddress && /* @__PURE__ */ c("div", { className: "nice-audit-timeline-meta", children: [
|
|
626
634
|
/* @__PURE__ */ c("span", { children: [
|
|
627
635
|
"IP: ",
|
|
628
|
-
|
|
636
|
+
a.ipAddress
|
|
629
637
|
] }),
|
|
630
|
-
|
|
638
|
+
a.location && /* @__PURE__ */ c("span", { children: [
|
|
631
639
|
"• ",
|
|
632
|
-
|
|
640
|
+
a.location
|
|
633
641
|
] })
|
|
634
642
|
] })
|
|
635
643
|
] })
|
|
636
644
|
]
|
|
637
645
|
}
|
|
638
646
|
);
|
|
639
|
-
},
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
/* @__PURE__ */ e("
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
"
|
|
660
|
-
{
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
"
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
(
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
if (
|
|
723
|
-
|
|
647
|
+
}, Ic = ({ entries: a, showDiff: n, onEntryClick: s }) => {
|
|
648
|
+
const { t: i } = W();
|
|
649
|
+
return /* @__PURE__ */ c("table", { className: "nice-audit-table", children: [
|
|
650
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ c("tr", { children: [
|
|
651
|
+
/* @__PURE__ */ e("th", { children: i("auditTrail.timestamp", "Timestamp") }),
|
|
652
|
+
/* @__PURE__ */ e("th", { children: i("auditTrail.action", "Action") }),
|
|
653
|
+
/* @__PURE__ */ e("th", { children: i("auditTrail.user", "User") }),
|
|
654
|
+
/* @__PURE__ */ e("th", { children: i("auditTrail.entity", "Entity") }),
|
|
655
|
+
/* @__PURE__ */ e("th", { children: i("auditTrail.changes", "Changes") }),
|
|
656
|
+
/* @__PURE__ */ e("th", { children: i("auditTrail.ipAddress", "IP Address") })
|
|
657
|
+
] }) }),
|
|
658
|
+
/* @__PURE__ */ e("tbody", { children: a.map((t) => {
|
|
659
|
+
const l = ne[t.action] || ne.custom;
|
|
660
|
+
return /* @__PURE__ */ c(
|
|
661
|
+
"tr",
|
|
662
|
+
{
|
|
663
|
+
className: `nice-audit-row nice-audit-row--${t.severity || "info"}`,
|
|
664
|
+
onClick: () => s == null ? void 0 : s(t),
|
|
665
|
+
role: s ? "button" : void 0,
|
|
666
|
+
children: [
|
|
667
|
+
/* @__PURE__ */ e("td", { className: "nice-audit-cell-time", children: new Date(t.timestamp).toLocaleString() }),
|
|
668
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ c(
|
|
669
|
+
"span",
|
|
670
|
+
{
|
|
671
|
+
className: "nice-audit-action-badge",
|
|
672
|
+
style: { "--badge-color": l.color },
|
|
673
|
+
children: [
|
|
674
|
+
l.icon,
|
|
675
|
+
" ",
|
|
676
|
+
t.actionLabel || l.label
|
|
677
|
+
]
|
|
678
|
+
}
|
|
679
|
+
) }),
|
|
680
|
+
/* @__PURE__ */ c("td", { className: "nice-audit-cell-user", children: [
|
|
681
|
+
t.userAvatar && /* @__PURE__ */ e("img", { src: t.userAvatar, alt: "", className: "nice-audit-avatar-sm" }),
|
|
682
|
+
t.userName
|
|
683
|
+
] }),
|
|
684
|
+
/* @__PURE__ */ c("td", { children: [
|
|
685
|
+
t.entityType,
|
|
686
|
+
t.entityName && `: ${t.entityName}`
|
|
687
|
+
] }),
|
|
688
|
+
/* @__PURE__ */ e("td", { children: t.changes && t.changes.length > 0 ? /* @__PURE__ */ c("span", { className: "nice-audit-changes-count", children: [
|
|
689
|
+
t.changes.length,
|
|
690
|
+
" field(s)"
|
|
691
|
+
] }) : "-" }),
|
|
692
|
+
/* @__PURE__ */ e("td", { className: "nice-audit-cell-ip", children: t.ipAddress || "-" })
|
|
693
|
+
]
|
|
694
|
+
},
|
|
695
|
+
t.id
|
|
696
|
+
);
|
|
697
|
+
}) })
|
|
698
|
+
] });
|
|
699
|
+
}, ia = /* @__PURE__ */ Object.assign(
|
|
700
|
+
/* @__PURE__ */ le(
|
|
701
|
+
({
|
|
702
|
+
dataSource: a,
|
|
703
|
+
initialFilter: n = {},
|
|
704
|
+
pageSize: s = 50,
|
|
705
|
+
viewMode: i = "timeline",
|
|
706
|
+
enableExport: t = !0,
|
|
707
|
+
showDiffs: l = !0,
|
|
708
|
+
renderActionIcon: h,
|
|
709
|
+
renderUser: r,
|
|
710
|
+
onEntryClick: o,
|
|
711
|
+
onExport: w,
|
|
712
|
+
title: _,
|
|
713
|
+
className: I = "",
|
|
714
|
+
style: C
|
|
715
|
+
}, z) => {
|
|
716
|
+
const { t: F } = W(), U = _ ?? F("auditTrail.title", "Audit Trail"), [L, Y] = k([]), [ce, $] = k(0), [q, E] = k(n), [m, N] = k(1), [g, V] = k(!1), [u, B] = k(i), [O, P] = k(!1), x = R(async () => {
|
|
717
|
+
V(!0);
|
|
718
|
+
try {
|
|
719
|
+
const b = await a.fetchEntries(q, { page: m, pageSize: s });
|
|
720
|
+
Y(b.entries), $(b.totalCount);
|
|
721
|
+
} finally {
|
|
722
|
+
V(!1);
|
|
723
|
+
}
|
|
724
|
+
}, [a, q, m, s]);
|
|
725
|
+
kc.useEffect(() => {
|
|
726
|
+
x();
|
|
727
|
+
}, [x]);
|
|
728
|
+
const H = R(
|
|
729
|
+
(b) => {
|
|
730
|
+
if (w)
|
|
731
|
+
w(L, b);
|
|
724
732
|
else {
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
"
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
733
|
+
let S, A;
|
|
734
|
+
if (b === "json")
|
|
735
|
+
S = JSON.stringify(L, null, 2), A = "application/json";
|
|
736
|
+
else {
|
|
737
|
+
const X = [
|
|
738
|
+
"Timestamp",
|
|
739
|
+
"Action",
|
|
740
|
+
"User",
|
|
741
|
+
"Entity Type",
|
|
742
|
+
"Entity",
|
|
743
|
+
"IP",
|
|
744
|
+
"Changes"
|
|
745
|
+
], Z = L.map((G) => {
|
|
746
|
+
var v;
|
|
747
|
+
return [
|
|
748
|
+
new Date(G.timestamp).toISOString(),
|
|
749
|
+
G.action,
|
|
750
|
+
G.userName,
|
|
751
|
+
G.entityType,
|
|
752
|
+
G.entityName || G.entityId,
|
|
753
|
+
G.ipAddress || "",
|
|
754
|
+
((v = G.changes) == null ? void 0 : v.length) || 0
|
|
755
|
+
];
|
|
756
|
+
});
|
|
757
|
+
S = [X.join(","), ...Z.map((G) => G.join(","))].join(`
|
|
758
|
+
`), A = "text/csv";
|
|
759
|
+
}
|
|
760
|
+
const J = new Blob([S], { type: A }), f = URL.createObjectURL(J), T = document.createElement("a");
|
|
761
|
+
T.href = f, T.download = `audit-trail-${Date.now()}.${b}`, T.click(), URL.revokeObjectURL(f);
|
|
747
762
|
}
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
763
|
+
},
|
|
764
|
+
[L, w]
|
|
765
|
+
);
|
|
766
|
+
re(z, () => ({
|
|
767
|
+
refresh: x,
|
|
768
|
+
setFilter: (b) => {
|
|
769
|
+
E(b), N(1);
|
|
770
|
+
},
|
|
771
|
+
getEntries: () => L
|
|
772
|
+
}));
|
|
773
|
+
const j = Math.ceil(ce / s);
|
|
774
|
+
return /* @__PURE__ */ c("div", { className: `nice-audit-trail ${I}`, style: C, children: [
|
|
775
|
+
/* @__PURE__ */ c("div", { className: "nice-audit-header", children: [
|
|
776
|
+
/* @__PURE__ */ e("h3", { className: "nice-audit-title", children: U }),
|
|
777
|
+
/* @__PURE__ */ c("div", { className: "nice-audit-header-actions", children: [
|
|
778
|
+
/* @__PURE__ */ e(
|
|
779
|
+
"button",
|
|
780
|
+
{
|
|
781
|
+
type: "button",
|
|
782
|
+
className: `nice-audit-view-btn ${u === "timeline" ? "nice-audit-view-btn--active" : ""}`,
|
|
783
|
+
onClick: () => B("timeline"),
|
|
784
|
+
title: F("auditTrail.timelineView", "Timeline view"),
|
|
785
|
+
children: /* @__PURE__ */ e(Xe, { size: 16 })
|
|
786
|
+
}
|
|
787
|
+
),
|
|
788
|
+
/* @__PURE__ */ e(
|
|
789
|
+
"button",
|
|
790
|
+
{
|
|
791
|
+
type: "button",
|
|
792
|
+
className: `nice-audit-view-btn ${u === "table" ? "nice-audit-view-btn--active" : ""}`,
|
|
793
|
+
onClick: () => B("table"),
|
|
794
|
+
title: F("auditTrail.tableView", "Table view"),
|
|
795
|
+
children: /* @__PURE__ */ e(Ze, { size: 16 })
|
|
796
|
+
}
|
|
797
|
+
),
|
|
798
|
+
/* @__PURE__ */ c(
|
|
799
|
+
"button",
|
|
800
|
+
{
|
|
801
|
+
type: "button",
|
|
802
|
+
className: `nice-audit-filter-btn ${O ? "nice-audit-filter-btn--active" : ""}`,
|
|
803
|
+
onClick: () => P(!O),
|
|
804
|
+
children: [
|
|
805
|
+
/* @__PURE__ */ e(ge, { size: 16 }),
|
|
806
|
+
" ",
|
|
807
|
+
F("auditTrail.filter", "Filter")
|
|
808
|
+
]
|
|
809
|
+
}
|
|
810
|
+
),
|
|
811
|
+
t && /* @__PURE__ */ c("div", { className: "nice-audit-export-dropdown", children: [
|
|
812
|
+
/* @__PURE__ */ c("button", { type: "button", className: "nice-audit-export-btn", children: [
|
|
813
|
+
/* @__PURE__ */ e(ve, { size: 16 }),
|
|
814
|
+
" ",
|
|
815
|
+
F("auditTrail.export", "Export")
|
|
816
|
+
] }),
|
|
817
|
+
/* @__PURE__ */ c("div", { className: "nice-audit-export-menu", children: [
|
|
818
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => H("csv"), children: F("auditTrail.exportAsCsv", "Export as CSV") }),
|
|
819
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => H("json"), children: F("auditTrail.exportAsJson", "Export as JSON") })
|
|
820
|
+
] })
|
|
821
|
+
] })
|
|
822
|
+
] })
|
|
823
|
+
] }),
|
|
824
|
+
O && /* @__PURE__ */ e(Ec, { filter: q, onChange: E }),
|
|
825
|
+
/* @__PURE__ */ c("div", { className: "nice-audit-stats", children: [
|
|
826
|
+
/* @__PURE__ */ e("span", { children: F("auditTrail.showingOfEntries", "Showing {entries} of {totalCount} entries").replace("{entries}", String(L.length)).replace("{totalCount}", String(ce)) }),
|
|
827
|
+
q.startDate && q.endDate && /* @__PURE__ */ c("span", { className: "nice-audit-date-indicator", children: [
|
|
828
|
+
q.startDate.toLocaleDateString(),
|
|
829
|
+
" - ",
|
|
830
|
+
q.endDate.toLocaleDateString()
|
|
831
|
+
] })
|
|
832
|
+
] }),
|
|
833
|
+
/* @__PURE__ */ c("div", { className: `nice-audit-content ${g ? "nice-audit-content--loading" : ""}`, children: [
|
|
834
|
+
g && /* @__PURE__ */ e("div", { className: "nice-audit-loader", children: /* @__PURE__ */ e("div", { className: "nice-audit-spinner" }) }),
|
|
835
|
+
u === "timeline" ? /* @__PURE__ */ e("div", { className: "nice-audit-timeline", children: L.map((b) => /* @__PURE__ */ e(
|
|
836
|
+
Ac,
|
|
768
837
|
{
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
}
|
|
775
|
-
|
|
838
|
+
entry: b,
|
|
839
|
+
showDiff: l,
|
|
840
|
+
renderActionIcon: h,
|
|
841
|
+
renderUser: r,
|
|
842
|
+
onClick: o ? () => o(b) : void 0
|
|
843
|
+
},
|
|
844
|
+
b.id
|
|
845
|
+
)) }) : /* @__PURE__ */ e(Ic, { entries: L, showDiff: l, onEntryClick: o }),
|
|
846
|
+
L.length === 0 && !g && /* @__PURE__ */ e("div", { className: "nice-audit-empty", children: F(
|
|
847
|
+
"auditTrail.noAuditEntriesFoundMatching",
|
|
848
|
+
"No audit entries found matching the current filters."
|
|
849
|
+
) })
|
|
850
|
+
] }),
|
|
851
|
+
j > 1 && /* @__PURE__ */ c("div", { className: "nice-audit-pagination", children: [
|
|
852
|
+
/* @__PURE__ */ e("button", { type: "button", disabled: m === 1, onClick: () => N(m - 1), children: F("auditTrail.previous", "Previous") }),
|
|
853
|
+
/* @__PURE__ */ e("span", { children: F("auditTrail.pageOf", "Page {page} of {totalPages}").replace("{page}", String(m)).replace("{totalPages}", String(j)) }),
|
|
776
854
|
/* @__PURE__ */ e(
|
|
777
855
|
"button",
|
|
778
856
|
{
|
|
779
857
|
type: "button",
|
|
780
|
-
|
|
781
|
-
onClick: () =>
|
|
782
|
-
|
|
783
|
-
children: /* @__PURE__ */ e(Ke, { size: 16 })
|
|
784
|
-
}
|
|
785
|
-
),
|
|
786
|
-
/* @__PURE__ */ c(
|
|
787
|
-
"button",
|
|
788
|
-
{
|
|
789
|
-
type: "button",
|
|
790
|
-
className: `nice-audit-filter-btn ${P ? "nice-audit-filter-btn--active" : ""}`,
|
|
791
|
-
onClick: () => A(!P),
|
|
792
|
-
children: [
|
|
793
|
-
/* @__PURE__ */ e(pe, { size: 16 }),
|
|
794
|
-
" Filter"
|
|
795
|
-
]
|
|
858
|
+
disabled: m === j,
|
|
859
|
+
onClick: () => N(m + 1),
|
|
860
|
+
children: F("auditTrail.next", "Next")
|
|
796
861
|
}
|
|
797
|
-
)
|
|
798
|
-
n && /* @__PURE__ */ c("div", { className: "nice-audit-export-dropdown", children: [
|
|
799
|
-
/* @__PURE__ */ c("button", { type: "button", className: "nice-audit-export-btn", children: [
|
|
800
|
-
/* @__PURE__ */ e(me, { size: 16 }),
|
|
801
|
-
" Export"
|
|
802
|
-
] }),
|
|
803
|
-
/* @__PURE__ */ c("div", { className: "nice-audit-export-menu", children: [
|
|
804
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: () => C("csv"), children: "Export as CSV" }),
|
|
805
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: () => C("json"), children: "Export as JSON" })
|
|
806
|
-
] })
|
|
807
|
-
] })
|
|
808
|
-
] })
|
|
809
|
-
] }),
|
|
810
|
-
P && /* @__PURE__ */ e(Tc, { filter: j, onChange: U }),
|
|
811
|
-
/* @__PURE__ */ c("div", { className: "nice-audit-stats", children: [
|
|
812
|
-
/* @__PURE__ */ c("span", { children: [
|
|
813
|
-
"Showing ",
|
|
814
|
-
_.length,
|
|
815
|
-
" of ",
|
|
816
|
-
O,
|
|
817
|
-
" entries"
|
|
818
|
-
] }),
|
|
819
|
-
j.startDate && j.endDate && /* @__PURE__ */ c("span", { className: "nice-audit-date-indicator", children: [
|
|
820
|
-
j.startDate.toLocaleDateString(),
|
|
821
|
-
" - ",
|
|
822
|
-
j.endDate.toLocaleDateString()
|
|
862
|
+
)
|
|
823
863
|
] })
|
|
824
|
-
] })
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
{
|
|
830
|
-
entry: v,
|
|
831
|
-
showDiff: l,
|
|
832
|
-
renderActionIcon: h,
|
|
833
|
-
renderUser: r,
|
|
834
|
-
onClick: u ? () => u(v) : void 0
|
|
835
|
-
},
|
|
836
|
-
v.id
|
|
837
|
-
)) }) : /* @__PURE__ */ e(Ac, { entries: _, showDiff: l, onEntryClick: u }),
|
|
838
|
-
_.length === 0 && !k && /* @__PURE__ */ e("div", { className: "nice-audit-empty", children: "No audit entries found matching the current filters." })
|
|
839
|
-
] }),
|
|
840
|
-
q > 1 && /* @__PURE__ */ c("div", { className: "nice-audit-pagination", children: [
|
|
841
|
-
/* @__PURE__ */ e("button", { type: "button", disabled: B === 1, onClick: () => m(B - 1), children: "Previous" }),
|
|
842
|
-
/* @__PURE__ */ c("span", { children: [
|
|
843
|
-
"Page ",
|
|
844
|
-
B,
|
|
845
|
-
" of ",
|
|
846
|
-
q
|
|
847
|
-
] }),
|
|
848
|
-
/* @__PURE__ */ e("button", { type: "button", disabled: B === q, onClick: () => m(B + 1), children: "Next" })
|
|
849
|
-
] })
|
|
850
|
-
] });
|
|
851
|
-
}
|
|
852
|
-
);
|
|
853
|
-
Ic.displayName = "NiceAuditTrail";
|
|
854
|
-
const Fc = [
|
|
864
|
+
] });
|
|
865
|
+
}
|
|
866
|
+
),
|
|
867
|
+
{ displayName: "NiceAuditTrail" }
|
|
868
|
+
), Oc = [
|
|
855
869
|
{
|
|
856
870
|
target: ".nice-contract-editor",
|
|
857
871
|
titleKey: "tutorial.contractEditor.intro.title",
|
|
@@ -864,59 +878,59 @@ const Fc = [
|
|
|
864
878
|
general: {
|
|
865
879
|
label: "General",
|
|
866
880
|
color: "var(--nice-text-muted, #6b7280)",
|
|
867
|
-
icon: /* @__PURE__ */ e(
|
|
881
|
+
icon: /* @__PURE__ */ e(xe, { size: 16 })
|
|
868
882
|
},
|
|
869
883
|
liability: {
|
|
870
884
|
label: "Liability",
|
|
871
885
|
color: "var(--nice-color-error, #ef4444)",
|
|
872
|
-
icon: /* @__PURE__ */ e(
|
|
886
|
+
icon: /* @__PURE__ */ e(Ye, { size: 16 })
|
|
873
887
|
},
|
|
874
888
|
payment: {
|
|
875
889
|
label: "Payment",
|
|
876
890
|
color: "var(--nice-color-success, #10b981)",
|
|
877
|
-
icon: /* @__PURE__ */ e(
|
|
891
|
+
icon: /* @__PURE__ */ e(lc, { size: 16 })
|
|
878
892
|
},
|
|
879
893
|
termination: {
|
|
880
894
|
label: "Termination",
|
|
881
895
|
color: "var(--nice-color-warning, #f59e0b)",
|
|
882
|
-
icon: /* @__PURE__ */ e(
|
|
896
|
+
icon: /* @__PURE__ */ e(nc, { size: 16 })
|
|
883
897
|
},
|
|
884
898
|
confidentiality: {
|
|
885
899
|
label: "Confidentiality",
|
|
886
900
|
color: "var(--nice-color-accent, #8b5cf6)",
|
|
887
|
-
icon: /* @__PURE__ */ e(
|
|
901
|
+
icon: /* @__PURE__ */ e(Ue, { size: 16 })
|
|
888
902
|
},
|
|
889
903
|
compliance: {
|
|
890
904
|
label: "Compliance",
|
|
891
905
|
color: "var(--nice-color-primary, #3b82f6)",
|
|
892
|
-
icon: /* @__PURE__ */ e(
|
|
906
|
+
icon: /* @__PURE__ */ e(se, { size: 16 })
|
|
893
907
|
},
|
|
894
908
|
custom: {
|
|
895
909
|
label: "Custom",
|
|
896
910
|
color: "var(--nice-text-muted, #64748b)",
|
|
897
|
-
icon: /* @__PURE__ */ e(
|
|
911
|
+
icon: /* @__PURE__ */ e(je, { size: 16 })
|
|
898
912
|
}
|
|
899
|
-
},
|
|
913
|
+
}, Pc = {
|
|
900
914
|
draft: { label: "Draft", color: "var(--nice-text-muted, #6b7280)" },
|
|
901
915
|
pending_review: { label: "Pending Review", color: "var(--nice-color-warning, #f59e0b)" },
|
|
902
916
|
approved: { label: "Approved", color: "var(--nice-color-success, #10b981)" },
|
|
903
917
|
rejected: { label: "Rejected", color: "var(--nice-color-error, #ef4444)" },
|
|
904
918
|
signed: { label: "Signed", color: "var(--nice-color-accent, #8b5cf6)" }
|
|
905
|
-
},
|
|
906
|
-
const
|
|
907
|
-
const
|
|
908
|
-
return
|
|
919
|
+
}, Rc = ({ clauses: a, onInsert: n }) => {
|
|
920
|
+
const { t: s } = W(), [i, t] = k(""), [l, h] = k("all"), r = a.filter((o) => {
|
|
921
|
+
const w = i === "" || o.name.toLowerCase().includes(i.toLowerCase()) || o.content.toLowerCase().includes(i.toLowerCase()), _ = l === "all" || o.category === l;
|
|
922
|
+
return w && _;
|
|
909
923
|
});
|
|
910
924
|
return /* @__PURE__ */ c("div", { className: "nice-contract-library", children: [
|
|
911
925
|
/* @__PURE__ */ c("div", { className: "nice-contract-library-header", children: [
|
|
912
|
-
/* @__PURE__ */ e("h4", { children: "Clause Library" }),
|
|
926
|
+
/* @__PURE__ */ e("h4", { children: s("contractEditor.clauseLibrary", "Clause Library") }),
|
|
913
927
|
/* @__PURE__ */ e(
|
|
914
928
|
"input",
|
|
915
929
|
{
|
|
916
930
|
type: "text",
|
|
917
|
-
placeholder: "Search clauses...",
|
|
918
|
-
value:
|
|
919
|
-
onChange: (
|
|
931
|
+
placeholder: s("contractEditor.searchClauses", "Search clauses..."),
|
|
932
|
+
value: i,
|
|
933
|
+
onChange: (o) => t(o.target.value),
|
|
920
934
|
className: "nice-contract-library-search"
|
|
921
935
|
}
|
|
922
936
|
)
|
|
@@ -926,193 +940,200 @@ const Fc = [
|
|
|
926
940
|
"button",
|
|
927
941
|
{
|
|
928
942
|
type: "button",
|
|
929
|
-
className: `nice-contract-category-btn ${
|
|
930
|
-
onClick: () =>
|
|
943
|
+
className: `nice-contract-category-btn ${l === "all" ? "nice-contract-category-btn--active" : ""}`,
|
|
944
|
+
onClick: () => h("all"),
|
|
931
945
|
children: "All"
|
|
932
946
|
}
|
|
933
947
|
),
|
|
934
|
-
Object.keys(ie).map((
|
|
948
|
+
Object.keys(ie).map((o) => /* @__PURE__ */ c(
|
|
935
949
|
"button",
|
|
936
950
|
{
|
|
937
951
|
type: "button",
|
|
938
|
-
className: `nice-contract-category-btn ${
|
|
939
|
-
onClick: () =>
|
|
940
|
-
style: { "--cat-color": ie[
|
|
952
|
+
className: `nice-contract-category-btn ${l === o ? "nice-contract-category-btn--active" : ""}`,
|
|
953
|
+
onClick: () => h(o),
|
|
954
|
+
style: { "--cat-color": ie[o].color },
|
|
941
955
|
children: [
|
|
942
|
-
ie[
|
|
956
|
+
ie[o].icon,
|
|
943
957
|
" ",
|
|
944
|
-
ie[
|
|
958
|
+
ie[o].label
|
|
945
959
|
]
|
|
946
960
|
},
|
|
947
|
-
|
|
961
|
+
o
|
|
948
962
|
))
|
|
949
963
|
] }),
|
|
950
964
|
/* @__PURE__ */ c("div", { className: "nice-contract-library-list", children: [
|
|
951
|
-
|
|
965
|
+
r.map((o) => /* @__PURE__ */ c("div", { className: "nice-contract-library-item", children: [
|
|
952
966
|
/* @__PURE__ */ c("div", { className: "nice-contract-library-item-header", children: [
|
|
953
|
-
/* @__PURE__ */ e("span", { className: "nice-contract-library-item-name", children:
|
|
967
|
+
/* @__PURE__ */ e("span", { className: "nice-contract-library-item-name", children: o.name }),
|
|
954
968
|
/* @__PURE__ */ e(
|
|
955
969
|
"span",
|
|
956
970
|
{
|
|
957
971
|
className: "nice-contract-library-item-cat",
|
|
958
|
-
style: { "--cat-color": ie[
|
|
959
|
-
children: ie[
|
|
972
|
+
style: { "--cat-color": ie[o.category].color },
|
|
973
|
+
children: ie[o.category].icon
|
|
960
974
|
}
|
|
961
975
|
)
|
|
962
976
|
] }),
|
|
963
|
-
|
|
977
|
+
o.description && /* @__PURE__ */ e("p", { className: "nice-contract-library-item-desc", children: o.description }),
|
|
964
978
|
/* @__PURE__ */ c(
|
|
965
979
|
"button",
|
|
966
980
|
{
|
|
967
981
|
type: "button",
|
|
968
982
|
className: "nice-contract-library-insert",
|
|
969
|
-
onClick: () =>
|
|
983
|
+
onClick: () => n(o),
|
|
970
984
|
children: [
|
|
971
|
-
/* @__PURE__ */ e(
|
|
972
|
-
"
|
|
985
|
+
/* @__PURE__ */ e(Te, { size: 14 }),
|
|
986
|
+
" ",
|
|
987
|
+
s("contractEditor.insert", "Insert")
|
|
973
988
|
]
|
|
974
989
|
}
|
|
975
990
|
)
|
|
976
|
-
] },
|
|
977
|
-
|
|
991
|
+
] }, o.id)),
|
|
992
|
+
r.length === 0 && /* @__PURE__ */ e("div", { className: "nice-contract-library-empty", children: s("contractEditor.noMatchingClauses", "No matching clauses") })
|
|
978
993
|
] })
|
|
979
994
|
] });
|
|
980
|
-
},
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
/* @__PURE__ */
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
995
|
+
}, Fc = ({ variables: a, definitions: n, onChange: s }) => {
|
|
996
|
+
const { t: i } = W();
|
|
997
|
+
return /* @__PURE__ */ c("div", { className: "nice-contract-variables", children: [
|
|
998
|
+
/* @__PURE__ */ e("h4", { children: i("contractEditor.variables", "Variables") }),
|
|
999
|
+
/* @__PURE__ */ e("div", { className: "nice-contract-variables-list", children: n.map((t) => /* @__PURE__ */ c("div", { className: "nice-contract-variable", children: [
|
|
1000
|
+
/* @__PURE__ */ c("label", { children: [
|
|
1001
|
+
t.name,
|
|
1002
|
+
t.required && /* @__PURE__ */ e("span", { className: "nice-contract-required", children: "*" })
|
|
1003
|
+
] }),
|
|
1004
|
+
t.type === "select" && t.options ? /* @__PURE__ */ c(
|
|
1005
|
+
"select",
|
|
1006
|
+
{
|
|
1007
|
+
value: a[t.name] || t.defaultValue || "",
|
|
1008
|
+
onChange: (l) => s(t.name, l.target.value),
|
|
1009
|
+
children: [
|
|
1010
|
+
/* @__PURE__ */ e("option", { value: "", children: i("contractEditor.select", "Select...") }),
|
|
1011
|
+
t.options.map((l) => /* @__PURE__ */ e("option", { value: l, children: l }, l))
|
|
1012
|
+
]
|
|
1013
|
+
}
|
|
1014
|
+
) : t.type === "date" ? /* @__PURE__ */ e(
|
|
1015
|
+
"input",
|
|
1016
|
+
{
|
|
1017
|
+
type: "date",
|
|
1018
|
+
value: a[t.name] || t.defaultValue || "",
|
|
1019
|
+
onChange: (l) => s(t.name, l.target.value)
|
|
1020
|
+
}
|
|
1021
|
+
) : /* @__PURE__ */ e(
|
|
1022
|
+
"input",
|
|
1023
|
+
{
|
|
1024
|
+
type: t.type === "number" || t.type === "currency" ? "number" : "text",
|
|
1025
|
+
value: a[t.name] || t.defaultValue || "",
|
|
1026
|
+
placeholder: t.placeholder,
|
|
1027
|
+
onChange: (l) => s(t.name, l.target.value)
|
|
1028
|
+
}
|
|
1029
|
+
)
|
|
1030
|
+
] }, t.name)) })
|
|
1031
|
+
] });
|
|
1032
|
+
}, $c = ({
|
|
1033
|
+
section: a,
|
|
1034
|
+
variables: n,
|
|
1035
|
+
readOnly: s,
|
|
1036
|
+
onToggle: i,
|
|
1037
|
+
onRemoveClause: t,
|
|
1020
1038
|
onMoveClause: l
|
|
1021
1039
|
}) => {
|
|
1022
|
-
const h = (r) =>
|
|
1040
|
+
const { t: h } = W(), r = (o) => o.replace(/\{\{(\w+)\}\}/g, (w, _) => n[_] || `[${_}]`);
|
|
1023
1041
|
return /* @__PURE__ */ c(
|
|
1024
1042
|
"div",
|
|
1025
1043
|
{
|
|
1026
|
-
className: `nice-contract-section ${
|
|
1044
|
+
className: `nice-contract-section ${a.collapsed ? "nice-contract-section--collapsed" : ""}`,
|
|
1027
1045
|
children: [
|
|
1028
|
-
/* @__PURE__ */ c("div", { className: "nice-contract-section-header", onClick:
|
|
1029
|
-
/* @__PURE__ */ e("span", { className: "nice-contract-section-toggle", children:
|
|
1030
|
-
/* @__PURE__ */ e("h3", { children:
|
|
1046
|
+
/* @__PURE__ */ c("div", { className: "nice-contract-section-header", onClick: i, children: [
|
|
1047
|
+
/* @__PURE__ */ e("span", { className: "nice-contract-section-toggle", children: a.collapsed ? /* @__PURE__ */ e(Fe, { size: 14 }) : /* @__PURE__ */ e(Se, { size: 14 }) }),
|
|
1048
|
+
/* @__PURE__ */ e("h3", { children: a.title }),
|
|
1031
1049
|
/* @__PURE__ */ c("span", { className: "nice-contract-section-count", children: [
|
|
1032
|
-
|
|
1050
|
+
a.clauses.length,
|
|
1033
1051
|
" clause(s)"
|
|
1034
1052
|
] })
|
|
1035
1053
|
] }),
|
|
1036
|
-
!
|
|
1037
|
-
|
|
1054
|
+
!a.collapsed && /* @__PURE__ */ c("div", { className: "nice-contract-section-content", children: [
|
|
1055
|
+
a.clauses.map((o, w) => /* @__PURE__ */ c("div", { className: "nice-contract-clause", children: [
|
|
1038
1056
|
/* @__PURE__ */ c("div", { className: "nice-contract-clause-header", children: [
|
|
1039
1057
|
/* @__PURE__ */ e(
|
|
1040
1058
|
"span",
|
|
1041
1059
|
{
|
|
1042
1060
|
className: "nice-contract-clause-cat",
|
|
1043
|
-
style: { "--cat-color": ie[
|
|
1044
|
-
children: ie[
|
|
1061
|
+
style: { "--cat-color": ie[o.category].color },
|
|
1062
|
+
children: ie[o.category].icon
|
|
1045
1063
|
}
|
|
1046
1064
|
),
|
|
1047
|
-
/* @__PURE__ */ e("span", { className: "nice-contract-clause-name", children:
|
|
1048
|
-
|
|
1049
|
-
!
|
|
1065
|
+
/* @__PURE__ */ e("span", { className: "nice-contract-clause-name", children: o.name }),
|
|
1066
|
+
o.isRequired && /* @__PURE__ */ e("span", { className: "nice-contract-clause-required", children: h("contractEditor.required", "Required") }),
|
|
1067
|
+
!s && /* @__PURE__ */ c("div", { className: "nice-contract-clause-actions", children: [
|
|
1050
1068
|
/* @__PURE__ */ e(
|
|
1051
1069
|
"button",
|
|
1052
1070
|
{
|
|
1053
1071
|
type: "button",
|
|
1054
|
-
onClick: () => l(
|
|
1055
|
-
disabled:
|
|
1056
|
-
children: /* @__PURE__ */ e(
|
|
1072
|
+
onClick: () => l(o.id, "up"),
|
|
1073
|
+
disabled: w === 0,
|
|
1074
|
+
children: /* @__PURE__ */ e(ic, { size: 14 })
|
|
1057
1075
|
}
|
|
1058
1076
|
),
|
|
1059
1077
|
/* @__PURE__ */ e(
|
|
1060
1078
|
"button",
|
|
1061
1079
|
{
|
|
1062
1080
|
type: "button",
|
|
1063
|
-
onClick: () => l(
|
|
1064
|
-
disabled:
|
|
1065
|
-
children: /* @__PURE__ */ e(
|
|
1081
|
+
onClick: () => l(o.id, "down"),
|
|
1082
|
+
disabled: w === a.clauses.length - 1,
|
|
1083
|
+
children: /* @__PURE__ */ e(sc, { size: 14 })
|
|
1066
1084
|
}
|
|
1067
1085
|
),
|
|
1068
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: () =>
|
|
1086
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => t(o.id), children: /* @__PURE__ */ e(be, { size: 14 }) })
|
|
1069
1087
|
] })
|
|
1070
1088
|
] }),
|
|
1071
1089
|
/* @__PURE__ */ e(
|
|
1072
1090
|
"div",
|
|
1073
1091
|
{
|
|
1074
1092
|
className: "nice-contract-clause-content",
|
|
1075
|
-
dangerouslySetInnerHTML: { __html:
|
|
1093
|
+
dangerouslySetInnerHTML: { __html: r(o.content) }
|
|
1076
1094
|
}
|
|
1077
1095
|
)
|
|
1078
|
-
] },
|
|
1079
|
-
|
|
1096
|
+
] }, o.id)),
|
|
1097
|
+
a.clauses.length === 0 && /* @__PURE__ */ e("div", { className: "nice-contract-section-empty", children: h(
|
|
1098
|
+
"contractEditor.noClausesInThisSection",
|
|
1099
|
+
"No clauses in this section. Drag clauses here or use the library."
|
|
1100
|
+
) })
|
|
1080
1101
|
] })
|
|
1081
1102
|
]
|
|
1082
1103
|
}
|
|
1083
1104
|
);
|
|
1084
|
-
},
|
|
1085
|
-
const
|
|
1105
|
+
}, Mc = ({ workflow: a, onAction: n }) => {
|
|
1106
|
+
const { t: s } = W(), [i, t] = k(null), [l, h] = k("");
|
|
1086
1107
|
return /* @__PURE__ */ c("div", { className: "nice-contract-workflow", children: [
|
|
1087
|
-
/* @__PURE__ */ e("h4", { children: "Approval Workflow" }),
|
|
1088
|
-
/* @__PURE__ */ e("div", { className: "nice-contract-workflow-steps", children:
|
|
1108
|
+
/* @__PURE__ */ e("h4", { children: s("contractEditor.approvalWorkflow", "Approval Workflow") }),
|
|
1109
|
+
/* @__PURE__ */ e("div", { className: "nice-contract-workflow-steps", children: a.steps.map((r, o) => /* @__PURE__ */ c(
|
|
1089
1110
|
"div",
|
|
1090
1111
|
{
|
|
1091
|
-
className: `nice-contract-workflow-step nice-contract-workflow-step--${
|
|
1112
|
+
className: `nice-contract-workflow-step nice-contract-workflow-step--${r.status}`,
|
|
1092
1113
|
children: [
|
|
1093
1114
|
/* @__PURE__ */ c("div", { className: "nice-contract-workflow-step-header", children: [
|
|
1094
|
-
/* @__PURE__ */ e("span", { className: "nice-contract-workflow-step-num", children:
|
|
1095
|
-
/* @__PURE__ */ e("span", { className: "nice-contract-workflow-step-name", children:
|
|
1115
|
+
/* @__PURE__ */ e("span", { className: "nice-contract-workflow-step-num", children: o + 1 }),
|
|
1116
|
+
/* @__PURE__ */ e("span", { className: "nice-contract-workflow-step-name", children: r.name }),
|
|
1096
1117
|
/* @__PURE__ */ e(
|
|
1097
1118
|
"span",
|
|
1098
1119
|
{
|
|
1099
|
-
className: `nice-contract-workflow-step-status nice-contract-workflow-step-status--${
|
|
1100
|
-
children:
|
|
1120
|
+
className: `nice-contract-workflow-step-status nice-contract-workflow-step-status--${r.status}`,
|
|
1121
|
+
children: r.status
|
|
1101
1122
|
}
|
|
1102
1123
|
)
|
|
1103
1124
|
] }),
|
|
1104
|
-
/* @__PURE__ */ e("div", { className: "nice-contract-workflow-approvers", children:
|
|
1105
|
-
|
|
1106
|
-
/* @__PURE__ */ e("span", { children:
|
|
1107
|
-
/* @__PURE__ */ e("span", { className: "nice-contract-approver-role", children:
|
|
1108
|
-
] },
|
|
1109
|
-
|
|
1125
|
+
/* @__PURE__ */ e("div", { className: "nice-contract-workflow-approvers", children: r.approvers.map((w) => /* @__PURE__ */ c("div", { className: "nice-contract-approver", children: [
|
|
1126
|
+
w.avatar && /* @__PURE__ */ e("img", { src: w.avatar, alt: "", className: "nice-contract-approver-avatar" }),
|
|
1127
|
+
/* @__PURE__ */ e("span", { children: w.name }),
|
|
1128
|
+
/* @__PURE__ */ e("span", { className: "nice-contract-approver-role", children: w.role })
|
|
1129
|
+
] }, w.id)) }),
|
|
1130
|
+
r.status === "pending" && a.currentStep === o && /* @__PURE__ */ e("div", { className: "nice-contract-workflow-actions", children: i === r.id ? /* @__PURE__ */ c(ae, { children: [
|
|
1110
1131
|
/* @__PURE__ */ e(
|
|
1111
1132
|
"textarea",
|
|
1112
1133
|
{
|
|
1113
|
-
placeholder: "Comments (optional)",
|
|
1114
|
-
value:
|
|
1115
|
-
onChange: (
|
|
1134
|
+
placeholder: s("contractEditor.commentsOptional", "Comments (optional)"),
|
|
1135
|
+
value: l,
|
|
1136
|
+
onChange: (w) => h(w.target.value)
|
|
1116
1137
|
}
|
|
1117
1138
|
),
|
|
1118
1139
|
/* @__PURE__ */ c("div", { className: "nice-contract-workflow-btns", children: [
|
|
@@ -1122,11 +1143,12 @@ const Fc = [
|
|
|
1122
1143
|
type: "button",
|
|
1123
1144
|
className: "nice-contract-btn nice-contract-btn--approve",
|
|
1124
1145
|
onClick: () => {
|
|
1125
|
-
|
|
1146
|
+
n(r.id, "approve", l), t(null), h("");
|
|
1126
1147
|
},
|
|
1127
1148
|
children: [
|
|
1128
|
-
/* @__PURE__ */ e(
|
|
1129
|
-
"
|
|
1149
|
+
/* @__PURE__ */ e(se, { size: 14 }),
|
|
1150
|
+
" ",
|
|
1151
|
+
s("contractEditor.approve", "Approve")
|
|
1130
1152
|
]
|
|
1131
1153
|
}
|
|
1132
1154
|
),
|
|
@@ -1136,266 +1158,273 @@ const Fc = [
|
|
|
1136
1158
|
type: "button",
|
|
1137
1159
|
className: "nice-contract-btn nice-contract-btn--reject",
|
|
1138
1160
|
onClick: () => {
|
|
1139
|
-
|
|
1161
|
+
n(r.id, "reject", l), t(null), h("");
|
|
1140
1162
|
},
|
|
1141
1163
|
children: [
|
|
1142
|
-
/* @__PURE__ */ e(
|
|
1143
|
-
"
|
|
1164
|
+
/* @__PURE__ */ e(he, { size: 14 }),
|
|
1165
|
+
" ",
|
|
1166
|
+
s("contractEditor.reject", "Reject")
|
|
1144
1167
|
]
|
|
1145
1168
|
}
|
|
1146
1169
|
),
|
|
1147
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: () =>
|
|
1170
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => t(null), children: s("contractEditor.cancel", "Cancel") })
|
|
1148
1171
|
] })
|
|
1149
1172
|
] }) : /* @__PURE__ */ e(
|
|
1150
1173
|
"button",
|
|
1151
1174
|
{
|
|
1152
1175
|
type: "button",
|
|
1153
1176
|
className: "nice-contract-btn",
|
|
1154
|
-
onClick: () =>
|
|
1155
|
-
children: "Review"
|
|
1177
|
+
onClick: () => t(r.id),
|
|
1178
|
+
children: s("contractEditor.review", "Review")
|
|
1156
1179
|
}
|
|
1157
1180
|
) })
|
|
1158
1181
|
]
|
|
1159
1182
|
},
|
|
1160
|
-
|
|
1183
|
+
r.id
|
|
1161
1184
|
)) })
|
|
1162
1185
|
] });
|
|
1163
|
-
},
|
|
1164
|
-
(
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
/* @__PURE__ */ c("div", { className: "nice-contract-header
|
|
1264
|
-
/* @__PURE__ */
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1186
|
+
}, sa = /* @__PURE__ */ Object.assign(
|
|
1187
|
+
/* @__PURE__ */ le(
|
|
1188
|
+
({
|
|
1189
|
+
document: a,
|
|
1190
|
+
clauseLibrary: n = [],
|
|
1191
|
+
readOnly: s = !1,
|
|
1192
|
+
showClauseLibrary: i = !0,
|
|
1193
|
+
showVersionHistory: t = !1,
|
|
1194
|
+
showComments: l = !1,
|
|
1195
|
+
showWorkflow: h = !0,
|
|
1196
|
+
currentUser: r,
|
|
1197
|
+
onChange: o,
|
|
1198
|
+
onAddClause: w,
|
|
1199
|
+
onRemoveClause: _,
|
|
1200
|
+
onVariableChange: I,
|
|
1201
|
+
onAddComment: C,
|
|
1202
|
+
onApprovalAction: z,
|
|
1203
|
+
onRestoreVersion: F,
|
|
1204
|
+
onSave: U,
|
|
1205
|
+
onExport: L,
|
|
1206
|
+
className: Y = "",
|
|
1207
|
+
style: ce,
|
|
1208
|
+
tutorial: $
|
|
1209
|
+
}, q) => {
|
|
1210
|
+
var G;
|
|
1211
|
+
const { t: E } = W(), [m, N] = k(a), [g, V] = k(i ? "library" : null), [u, B] = k(
|
|
1212
|
+
((G = m.sections[0]) == null ? void 0 : G.id) || null
|
|
1213
|
+
), P = m.sections.flatMap(
|
|
1214
|
+
(v) => v.clauses.flatMap((D) => D.variables || [])
|
|
1215
|
+
).filter(
|
|
1216
|
+
(v, D, M) => M.findIndex((K) => K.name === v.name) === D
|
|
1217
|
+
), x = R(
|
|
1218
|
+
(v) => {
|
|
1219
|
+
const D = { ...m, ...v, updatedAt: /* @__PURE__ */ new Date() };
|
|
1220
|
+
N(D), o == null || o(D);
|
|
1221
|
+
},
|
|
1222
|
+
[m, o]
|
|
1223
|
+
), H = R(
|
|
1224
|
+
(v, D) => {
|
|
1225
|
+
const M = m.sections.map(
|
|
1226
|
+
(K) => K.id === D ? { ...K, clauses: [...K.clauses, { ...v, id: `${v.id}-${Date.now()}` }] } : K
|
|
1227
|
+
);
|
|
1228
|
+
x({ sections: M }), w == null || w(v, D);
|
|
1229
|
+
},
|
|
1230
|
+
[m, x, w]
|
|
1231
|
+
), j = R(
|
|
1232
|
+
(v, D) => {
|
|
1233
|
+
const M = m.sections.map(
|
|
1234
|
+
(K) => K.id === D ? { ...K, clauses: K.clauses.filter((Q) => Q.id !== v) } : K
|
|
1235
|
+
);
|
|
1236
|
+
x({ sections: M }), _ == null || _(v, D);
|
|
1237
|
+
},
|
|
1238
|
+
[m, x, _]
|
|
1239
|
+
), b = R(
|
|
1240
|
+
(v, D, M) => {
|
|
1241
|
+
const K = m.sections.map((Q) => {
|
|
1242
|
+
if (Q.id !== v)
|
|
1243
|
+
return Q;
|
|
1244
|
+
const d = Q.clauses.findIndex((ee) => ee.id === D);
|
|
1245
|
+
if (d === -1)
|
|
1246
|
+
return Q;
|
|
1247
|
+
const p = M === "up" ? d - 1 : d + 1;
|
|
1248
|
+
if (p < 0 || p >= Q.clauses.length)
|
|
1249
|
+
return Q;
|
|
1250
|
+
const y = [...Q.clauses];
|
|
1251
|
+
return [y[d], y[p]] = [y[p], y[d]], { ...Q, clauses: y };
|
|
1252
|
+
});
|
|
1253
|
+
x({ sections: K });
|
|
1254
|
+
},
|
|
1255
|
+
[m, x]
|
|
1256
|
+
), S = R(
|
|
1257
|
+
(v) => {
|
|
1258
|
+
const D = m.sections.map(
|
|
1259
|
+
(M) => M.id === v ? { ...M, collapsed: !M.collapsed } : M
|
|
1260
|
+
);
|
|
1261
|
+
x({ sections: D });
|
|
1262
|
+
},
|
|
1263
|
+
[m, x]
|
|
1264
|
+
), A = R(
|
|
1265
|
+
(v, D) => {
|
|
1266
|
+
x({ variables: { ...m.variables, [v]: D } }), I == null || I(v, D);
|
|
1267
|
+
},
|
|
1268
|
+
[m, x, I]
|
|
1269
|
+
), J = R(() => {
|
|
1270
|
+
const v = [];
|
|
1271
|
+
return P.forEach((D) => {
|
|
1272
|
+
D.required && !m.variables[D.name] && v.push(`Missing required variable: ${D.name}`);
|
|
1273
|
+
}), m.sections.forEach((D) => {
|
|
1274
|
+
D.clauses.forEach((M) => {
|
|
1275
|
+
M.isRequired && !M.content && v.push(`Required clause "${M.name}" is empty`);
|
|
1276
|
+
});
|
|
1277
|
+
}), { valid: v.length === 0, errors: v };
|
|
1278
|
+
}, [m, P]);
|
|
1279
|
+
re(q, () => ({
|
|
1280
|
+
getDocument: () => m,
|
|
1281
|
+
insertClause: H,
|
|
1282
|
+
setVariable: A,
|
|
1283
|
+
exportDocument: (v) => L == null ? void 0 : L(v),
|
|
1284
|
+
validate: J
|
|
1285
|
+
}));
|
|
1286
|
+
const f = Pc[m.status], T = /* @__PURE__ */ c("div", { className: "nice-contract-header", children: [
|
|
1287
|
+
/* @__PURE__ */ c("div", { className: "nice-contract-header-info", children: [
|
|
1288
|
+
/* @__PURE__ */ e("h2", { className: "nice-contract-title", children: m.title }),
|
|
1289
|
+
/* @__PURE__ */ e(
|
|
1290
|
+
"span",
|
|
1291
|
+
{
|
|
1292
|
+
className: "nice-contract-status",
|
|
1293
|
+
style: { "--status-color": f.color },
|
|
1294
|
+
children: f.label
|
|
1295
|
+
}
|
|
1296
|
+
)
|
|
1297
|
+
] }),
|
|
1298
|
+
/* @__PURE__ */ c("div", { className: "nice-contract-header-actions", children: [
|
|
1299
|
+
U && !s && /* @__PURE__ */ e(
|
|
1300
|
+
"button",
|
|
1301
|
+
{
|
|
1302
|
+
type: "button",
|
|
1303
|
+
className: "nice-contract-btn nice-contract-btn--primary",
|
|
1304
|
+
onClick: () => U(m),
|
|
1305
|
+
children: E("contractEditor.save", "Save")
|
|
1306
|
+
}
|
|
1307
|
+
),
|
|
1308
|
+
L && /* @__PURE__ */ c("div", { className: "nice-contract-export-dropdown", children: [
|
|
1309
|
+
/* @__PURE__ */ c("button", { type: "button", className: "nice-contract-btn", children: [
|
|
1310
|
+
E("contractEditor.export", "Export"),
|
|
1311
|
+
" ",
|
|
1312
|
+
/* @__PURE__ */ e(Se, { size: 14 })
|
|
1313
|
+
] }),
|
|
1314
|
+
/* @__PURE__ */ c("div", { className: "nice-contract-export-menu", children: [
|
|
1315
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => L("pdf"), children: "PDF" }),
|
|
1316
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => L("docx"), children: "Word (.docx)" }),
|
|
1317
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => L("html"), children: E("contractEditor.html", "HTML") })
|
|
1318
|
+
] })
|
|
1319
|
+
] })
|
|
1320
|
+
] })
|
|
1321
|
+
] }), X = /* @__PURE__ */ c("div", { className: "nice-contract-toolbar", children: [
|
|
1322
|
+
i && /* @__PURE__ */ c(
|
|
1323
|
+
"button",
|
|
1277
1324
|
{
|
|
1278
1325
|
type: "button",
|
|
1279
|
-
className:
|
|
1280
|
-
onClick: () =>
|
|
1281
|
-
children:
|
|
1326
|
+
className: `nice-contract-toolbar-btn ${g === "library" ? "nice-contract-toolbar-btn--active" : ""}`,
|
|
1327
|
+
onClick: () => V(g === "library" ? null : "library"),
|
|
1328
|
+
children: [
|
|
1329
|
+
/* @__PURE__ */ e(tc, { size: 16 }),
|
|
1330
|
+
" ",
|
|
1331
|
+
E("contractEditor.library", "Library")
|
|
1332
|
+
]
|
|
1282
1333
|
}
|
|
1283
1334
|
),
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
clauses: s,
|
|
1350
|
-
onInsert: (N) => p && q(N, p)
|
|
1351
|
-
}
|
|
1352
|
-
),
|
|
1353
|
-
g === "variables" && /* @__PURE__ */ e(
|
|
1354
|
-
Rc,
|
|
1355
|
-
{
|
|
1356
|
-
variables: m.variables,
|
|
1357
|
-
definitions: I,
|
|
1358
|
-
onChange: G
|
|
1359
|
-
}
|
|
1360
|
-
),
|
|
1361
|
-
g === "workflow" && m.workflow && /* @__PURE__ */ e(
|
|
1362
|
-
Ec,
|
|
1335
|
+
/* @__PURE__ */ c(
|
|
1336
|
+
"button",
|
|
1337
|
+
{
|
|
1338
|
+
type: "button",
|
|
1339
|
+
className: `nice-contract-toolbar-btn ${g === "variables" ? "nice-contract-toolbar-btn--active" : ""}`,
|
|
1340
|
+
onClick: () => V(g === "variables" ? null : "variables"),
|
|
1341
|
+
children: [
|
|
1342
|
+
/* @__PURE__ */ e(Re, { size: 16 }),
|
|
1343
|
+
" ",
|
|
1344
|
+
E("contractEditor.variables", "Variables")
|
|
1345
|
+
]
|
|
1346
|
+
}
|
|
1347
|
+
),
|
|
1348
|
+
h && m.workflow && /* @__PURE__ */ c(
|
|
1349
|
+
"button",
|
|
1350
|
+
{
|
|
1351
|
+
type: "button",
|
|
1352
|
+
className: `nice-contract-toolbar-btn ${g === "workflow" ? "nice-contract-toolbar-btn--active" : ""}`,
|
|
1353
|
+
onClick: () => V(g === "workflow" ? null : "workflow"),
|
|
1354
|
+
children: [
|
|
1355
|
+
/* @__PURE__ */ e(se, { size: 16 }),
|
|
1356
|
+
" ",
|
|
1357
|
+
E("contractEditor.workflow", "Workflow")
|
|
1358
|
+
]
|
|
1359
|
+
}
|
|
1360
|
+
),
|
|
1361
|
+
t && /* @__PURE__ */ c(
|
|
1362
|
+
"button",
|
|
1363
|
+
{
|
|
1364
|
+
type: "button",
|
|
1365
|
+
className: `nice-contract-toolbar-btn ${g === "history" ? "nice-contract-toolbar-btn--active" : ""}`,
|
|
1366
|
+
onClick: () => V(g === "history" ? null : "history"),
|
|
1367
|
+
children: [
|
|
1368
|
+
/* @__PURE__ */ e(Le, { size: 16 }),
|
|
1369
|
+
" ",
|
|
1370
|
+
E("contractEditor.history", "History")
|
|
1371
|
+
]
|
|
1372
|
+
}
|
|
1373
|
+
)
|
|
1374
|
+
] }), Z = g ? /* @__PURE__ */ c("div", { className: "nice-contract-panel", children: [
|
|
1375
|
+
g === "library" && /* @__PURE__ */ e(
|
|
1376
|
+
Rc,
|
|
1377
|
+
{
|
|
1378
|
+
clauses: n,
|
|
1379
|
+
onInsert: (v) => u && H(v, u)
|
|
1380
|
+
}
|
|
1381
|
+
),
|
|
1382
|
+
g === "variables" && /* @__PURE__ */ e(
|
|
1383
|
+
Fc,
|
|
1384
|
+
{
|
|
1385
|
+
variables: m.variables,
|
|
1386
|
+
definitions: P,
|
|
1387
|
+
onChange: A
|
|
1388
|
+
}
|
|
1389
|
+
),
|
|
1390
|
+
g === "workflow" && m.workflow && /* @__PURE__ */ e(
|
|
1391
|
+
Mc,
|
|
1392
|
+
{
|
|
1393
|
+
workflow: m.workflow,
|
|
1394
|
+
onAction: (v, D, M) => z == null ? void 0 : z(v, D, M)
|
|
1395
|
+
}
|
|
1396
|
+
)
|
|
1397
|
+
] }) : void 0;
|
|
1398
|
+
return /* @__PURE__ */ e(
|
|
1399
|
+
fc,
|
|
1363
1400
|
{
|
|
1364
|
-
|
|
1365
|
-
|
|
1401
|
+
flush: !0,
|
|
1402
|
+
className: `nice-contract-editor ${Y}`,
|
|
1403
|
+
style: ce,
|
|
1404
|
+
menubar: T,
|
|
1405
|
+
toolbar: X,
|
|
1406
|
+
sidebar: Z,
|
|
1407
|
+
children: /* @__PURE__ */ c("div", { className: "nice-contract-document", children: [
|
|
1408
|
+
/* @__PURE__ */ e("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 30 }, children: /* @__PURE__ */ e(yc, { steps: wc($, Oc) }) }),
|
|
1409
|
+
m.sections.map((v) => /* @__PURE__ */ e(
|
|
1410
|
+
$c,
|
|
1411
|
+
{
|
|
1412
|
+
section: v,
|
|
1413
|
+
variables: m.variables,
|
|
1414
|
+
readOnly: s,
|
|
1415
|
+
onToggle: () => S(v.id),
|
|
1416
|
+
onRemoveClause: (D) => j(D, v.id),
|
|
1417
|
+
onMoveClause: (D, M) => b(v.id, D, M)
|
|
1418
|
+
},
|
|
1419
|
+
v.id
|
|
1420
|
+
))
|
|
1421
|
+
] })
|
|
1366
1422
|
}
|
|
1367
|
-
)
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
flush: !0,
|
|
1373
|
-
className: `nice-contract-editor ${M}`,
|
|
1374
|
-
style: j,
|
|
1375
|
-
menubar: L,
|
|
1376
|
-
toolbar: W,
|
|
1377
|
-
sidebar: F,
|
|
1378
|
-
children: /* @__PURE__ */ c("div", { className: "nice-contract-document", children: [
|
|
1379
|
-
/* @__PURE__ */ e("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 30 }, children: /* @__PURE__ */ e(fc, { steps: yc(U, Fc) }) }),
|
|
1380
|
-
m.sections.map((N) => /* @__PURE__ */ e(
|
|
1381
|
-
Oc,
|
|
1382
|
-
{
|
|
1383
|
-
section: N,
|
|
1384
|
-
variables: m.variables,
|
|
1385
|
-
readOnly: t,
|
|
1386
|
-
onToggle: () => z(N.id),
|
|
1387
|
-
onRemoveClause: (D) => v(D, N.id),
|
|
1388
|
-
onMoveClause: (D, R) => x(N.id, D, R)
|
|
1389
|
-
},
|
|
1390
|
-
N.id
|
|
1391
|
-
))
|
|
1392
|
-
] })
|
|
1393
|
-
}
|
|
1394
|
-
);
|
|
1395
|
-
}
|
|
1396
|
-
);
|
|
1397
|
-
Mc.displayName = "NiceContractEditor";
|
|
1398
|
-
const jc = [
|
|
1423
|
+
);
|
|
1424
|
+
}
|
|
1425
|
+
),
|
|
1426
|
+
{ displayName: "NiceContractEditor" }
|
|
1427
|
+
), jc = [
|
|
1399
1428
|
{
|
|
1400
1429
|
id: "necessary",
|
|
1401
1430
|
label: "Necessary",
|
|
@@ -1454,246 +1483,223 @@ const jc = [
|
|
|
1454
1483
|
processing: "Processing",
|
|
1455
1484
|
completed: "Completed",
|
|
1456
1485
|
close: "Close"
|
|
1457
|
-
}, Yc = ({ option:
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1486
|
+
}, Yc = ({ option: a, enabled: n, onChange: s }) => {
|
|
1487
|
+
const { t: i } = W();
|
|
1488
|
+
return /* @__PURE__ */ c("div", { className: "nice-gdpr-option", children: [
|
|
1489
|
+
/* @__PURE__ */ c("div", { className: "nice-gdpr-option-header", children: [
|
|
1490
|
+
/* @__PURE__ */ c("label", { className: "nice-gdpr-option-toggle", children: [
|
|
1491
|
+
/* @__PURE__ */ e(
|
|
1492
|
+
"input",
|
|
1493
|
+
{
|
|
1494
|
+
type: "checkbox",
|
|
1495
|
+
checked: n,
|
|
1496
|
+
onChange: (t) => s(t.target.checked),
|
|
1497
|
+
disabled: a.required
|
|
1498
|
+
}
|
|
1499
|
+
),
|
|
1500
|
+
/* @__PURE__ */ e("span", { className: "nice-gdpr-toggle-slider" })
|
|
1501
|
+
] }),
|
|
1502
|
+
/* @__PURE__ */ c("div", { className: "nice-gdpr-option-info", children: [
|
|
1503
|
+
/* @__PURE__ */ c("span", { className: "nice-gdpr-option-label", children: [
|
|
1504
|
+
a.label,
|
|
1505
|
+
a.required && /* @__PURE__ */ e("span", { className: "nice-gdpr-required", children: i("gdprConsent.required", "Required") })
|
|
1506
|
+
] }),
|
|
1507
|
+
/* @__PURE__ */ e("span", { className: "nice-gdpr-option-desc", children: a.description })
|
|
1508
|
+
] })
|
|
1509
|
+
] }),
|
|
1510
|
+
a.partners && a.partners.length > 0 && /* @__PURE__ */ c("div", { className: "nice-gdpr-option-partners", children: [
|
|
1511
|
+
/* @__PURE__ */ e("span", { children: "Partners: " }),
|
|
1512
|
+
a.partners.join(", ")
|
|
1513
|
+
] })
|
|
1514
|
+
] });
|
|
1515
|
+
}, qc = ({
|
|
1516
|
+
requests: a,
|
|
1517
|
+
policies: n,
|
|
1518
|
+
onRequest: s,
|
|
1519
|
+
onDownload: i,
|
|
1520
|
+
labels: t
|
|
1521
|
+
}) => {
|
|
1522
|
+
const { t: l } = W();
|
|
1523
|
+
return /* @__PURE__ */ c("div", { className: "nice-gdpr-rights", children: [
|
|
1524
|
+
/* @__PURE__ */ e("h4", { children: t.dataRights }),
|
|
1525
|
+
/* @__PURE__ */ c("div", { className: "nice-gdpr-rights-actions", children: [
|
|
1526
|
+
/* @__PURE__ */ c(
|
|
1527
|
+
"button",
|
|
1462
1528
|
{
|
|
1463
|
-
type: "
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1529
|
+
type: "button",
|
|
1530
|
+
className: "nice-gdpr-btn nice-gdpr-btn--secondary",
|
|
1531
|
+
onClick: () => s("export"),
|
|
1532
|
+
children: [
|
|
1533
|
+
/* @__PURE__ */ e(ve, { size: 16 }),
|
|
1534
|
+
" ",
|
|
1535
|
+
t.exportData
|
|
1536
|
+
]
|
|
1467
1537
|
}
|
|
1468
1538
|
),
|
|
1469
|
-
/* @__PURE__ */
|
|
1470
|
-
] }),
|
|
1471
|
-
/* @__PURE__ */ c("div", { className: "nice-gdpr-option-info", children: [
|
|
1472
|
-
/* @__PURE__ */ c("span", { className: "nice-gdpr-option-label", children: [
|
|
1473
|
-
i.label,
|
|
1474
|
-
i.required && /* @__PURE__ */ e("span", { className: "nice-gdpr-required", children: "Required" })
|
|
1475
|
-
] }),
|
|
1476
|
-
/* @__PURE__ */ e("span", { className: "nice-gdpr-option-desc", children: i.description })
|
|
1477
|
-
] })
|
|
1478
|
-
] }),
|
|
1479
|
-
i.partners && i.partners.length > 0 && /* @__PURE__ */ c("div", { className: "nice-gdpr-option-partners", children: [
|
|
1480
|
-
/* @__PURE__ */ e("span", { children: "Partners: " }),
|
|
1481
|
-
i.partners.join(", ")
|
|
1482
|
-
] })
|
|
1483
|
-
] }), qc = ({
|
|
1484
|
-
requests: i,
|
|
1485
|
-
policies: s,
|
|
1486
|
-
onRequest: t,
|
|
1487
|
-
onDownload: a,
|
|
1488
|
-
labels: n
|
|
1489
|
-
}) => /* @__PURE__ */ c("div", { className: "nice-gdpr-rights", children: [
|
|
1490
|
-
/* @__PURE__ */ e("h4", { children: n.dataRights }),
|
|
1491
|
-
/* @__PURE__ */ c("div", { className: "nice-gdpr-rights-actions", children: [
|
|
1492
|
-
/* @__PURE__ */ c(
|
|
1493
|
-
"button",
|
|
1494
|
-
{
|
|
1495
|
-
type: "button",
|
|
1496
|
-
className: "nice-gdpr-btn nice-gdpr-btn--secondary",
|
|
1497
|
-
onClick: () => t("export"),
|
|
1498
|
-
children: [
|
|
1499
|
-
/* @__PURE__ */ e(me, { size: 16 }),
|
|
1500
|
-
" ",
|
|
1501
|
-
n.exportData
|
|
1502
|
-
]
|
|
1503
|
-
}
|
|
1504
|
-
),
|
|
1505
|
-
/* @__PURE__ */ c(
|
|
1506
|
-
"button",
|
|
1507
|
-
{
|
|
1508
|
-
type: "button",
|
|
1509
|
-
className: "nice-gdpr-btn nice-gdpr-btn--danger",
|
|
1510
|
-
onClick: () => t("delete"),
|
|
1511
|
-
children: [
|
|
1512
|
-
/* @__PURE__ */ e(lc, { size: 16 }),
|
|
1513
|
-
" ",
|
|
1514
|
-
n.deleteData
|
|
1515
|
-
]
|
|
1516
|
-
}
|
|
1517
|
-
)
|
|
1518
|
-
] }),
|
|
1519
|
-
i.length > 0 && /* @__PURE__ */ c("div", { className: "nice-gdpr-requests", children: [
|
|
1520
|
-
/* @__PURE__ */ e("h5", { children: "Previous Requests" }),
|
|
1521
|
-
i.map((l) => /* @__PURE__ */ c("div", { className: `nice-gdpr-request nice-gdpr-request--${l.status}`, children: [
|
|
1522
|
-
/* @__PURE__ */ e("span", { className: "nice-gdpr-request-type", children: l.type }),
|
|
1523
|
-
/* @__PURE__ */ e("span", { className: "nice-gdpr-request-date", children: new Date(l.requestedAt).toLocaleDateString() }),
|
|
1524
|
-
/* @__PURE__ */ e("span", { className: "nice-gdpr-request-status", children: l.status }),
|
|
1525
|
-
l.status === "completed" && l.downloadUrl && /* @__PURE__ */ e(
|
|
1539
|
+
/* @__PURE__ */ c(
|
|
1526
1540
|
"button",
|
|
1527
1541
|
{
|
|
1528
1542
|
type: "button",
|
|
1529
|
-
className: "nice-gdpr-
|
|
1530
|
-
onClick: () =>
|
|
1531
|
-
children:
|
|
1543
|
+
className: "nice-gdpr-btn nice-gdpr-btn--danger",
|
|
1544
|
+
onClick: () => s("delete"),
|
|
1545
|
+
children: [
|
|
1546
|
+
/* @__PURE__ */ e(dc, { size: 16 }),
|
|
1547
|
+
" ",
|
|
1548
|
+
t.deleteData
|
|
1549
|
+
]
|
|
1532
1550
|
}
|
|
1533
1551
|
)
|
|
1534
|
-
] },
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
/* @__PURE__ */ e("
|
|
1541
|
-
/* @__PURE__ */ e(
|
|
1542
|
-
/* @__PURE__ */ e("th", { children: "Legal Basis" })
|
|
1543
|
-
] }) }),
|
|
1544
|
-
/* @__PURE__ */ e("tbody", { children: s.map((l, h) => /* @__PURE__ */ c("tr", { children: [
|
|
1545
|
-
/* @__PURE__ */ e("td", { children: l.category }),
|
|
1546
|
-
/* @__PURE__ */ c("td", { children: [
|
|
1547
|
-
l.retentionDays,
|
|
1548
|
-
" days"
|
|
1549
|
-
] }),
|
|
1550
|
-
/* @__PURE__ */ e("td", { children: l.legalBasis })
|
|
1551
|
-
] }, h)) })
|
|
1552
|
-
] })
|
|
1553
|
-
] })
|
|
1554
|
-
] }), Vc = te(
|
|
1555
|
-
({
|
|
1556
|
-
appName: i,
|
|
1557
|
-
companyName: s,
|
|
1558
|
-
options: t = jc,
|
|
1559
|
-
currentConsent: a = null,
|
|
1560
|
-
retentionPolicies: n = [],
|
|
1561
|
-
dataRequests: l = [],
|
|
1562
|
-
privacyPolicy: h = [],
|
|
1563
|
-
storageKey: r = "nice_gdpr_consent",
|
|
1564
|
-
consentVersion: u = "1.0",
|
|
1565
|
-
variant: T = "banner",
|
|
1566
|
-
position: E = "bottom",
|
|
1567
|
-
onConsentChange: S,
|
|
1568
|
-
onDataRequest: y,
|
|
1569
|
-
onDownloadExport: J,
|
|
1570
|
-
privacyPolicyUrl: _,
|
|
1571
|
-
cookiePolicyUrl: K,
|
|
1572
|
-
termsUrl: O,
|
|
1573
|
-
labels: M,
|
|
1574
|
-
className: j = "",
|
|
1575
|
-
style: U
|
|
1576
|
-
}, B) => {
|
|
1577
|
-
const m = { ...Uc, ...M }, [k, g] = w(!1), [Y, p] = w(!1), [P, A] = w(!1), [I, C] = w(() => {
|
|
1578
|
-
const b = {};
|
|
1579
|
-
return t.forEach((L) => {
|
|
1580
|
-
b[L.id] = (a == null ? void 0 : a.categories[L.id]) ?? L.enabled;
|
|
1581
|
-
}), b;
|
|
1582
|
-
});
|
|
1583
|
-
ue(() => {
|
|
1584
|
-
(!a || a.version !== u) && g(!0);
|
|
1585
|
-
}, [a, u]);
|
|
1586
|
-
const q = $(
|
|
1587
|
-
(b, L) => {
|
|
1588
|
-
const W = L || I;
|
|
1589
|
-
W.necessary = !0;
|
|
1590
|
-
const F = {
|
|
1591
|
-
version: u,
|
|
1592
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
1593
|
-
categories: W,
|
|
1594
|
-
action: b
|
|
1595
|
-
};
|
|
1596
|
-
try {
|
|
1597
|
-
localStorage.setItem(r, JSON.stringify(F));
|
|
1598
|
-
} catch {
|
|
1599
|
-
}
|
|
1600
|
-
C(W), g(!1), p(!1), S == null || S(F);
|
|
1601
|
-
},
|
|
1602
|
-
[I, u, r, S]
|
|
1603
|
-
), v = $(() => {
|
|
1604
|
-
const b = {};
|
|
1605
|
-
t.forEach((L) => {
|
|
1606
|
-
b[L.id] = !0;
|
|
1607
|
-
}), q("accept_all", b);
|
|
1608
|
-
}, [t, q]), x = $(() => {
|
|
1609
|
-
const b = {};
|
|
1610
|
-
t.forEach((L) => {
|
|
1611
|
-
b[L.id] = L.required || !1;
|
|
1612
|
-
}), q("reject_all", b);
|
|
1613
|
-
}, [t, q]), z = $(
|
|
1614
|
-
async (b) => {
|
|
1615
|
-
y && await y(b);
|
|
1616
|
-
},
|
|
1617
|
-
[y]
|
|
1618
|
-
);
|
|
1619
|
-
if (ne(B, () => ({
|
|
1620
|
-
showBanner: () => g(!0),
|
|
1621
|
-
hideBanner: () => g(!1),
|
|
1622
|
-
getConsent: () => {
|
|
1623
|
-
try {
|
|
1624
|
-
const b = localStorage.getItem(r);
|
|
1625
|
-
return b ? JSON.parse(b) : null;
|
|
1626
|
-
} catch {
|
|
1627
|
-
return null;
|
|
1628
|
-
}
|
|
1629
|
-
},
|
|
1630
|
-
revokeConsent: () => {
|
|
1631
|
-
try {
|
|
1632
|
-
localStorage.removeItem(r);
|
|
1633
|
-
} catch {
|
|
1634
|
-
}
|
|
1635
|
-
g(!0);
|
|
1636
|
-
},
|
|
1637
|
-
openPreferences: () => {
|
|
1638
|
-
g(!0), p(!0);
|
|
1639
|
-
}
|
|
1640
|
-
})), !k && T !== "embedded")
|
|
1641
|
-
return null;
|
|
1642
|
-
const G = /* @__PURE__ */ c("div", { className: "nice-gdpr-content", children: [
|
|
1643
|
-
/* @__PURE__ */ c("div", { className: "nice-gdpr-header", children: [
|
|
1644
|
-
/* @__PURE__ */ e("div", { className: "nice-gdpr-icon", children: /* @__PURE__ */ e(tc, { size: 32 }) }),
|
|
1645
|
-
/* @__PURE__ */ c("div", { className: "nice-gdpr-header-text", children: [
|
|
1646
|
-
/* @__PURE__ */ e("h3", { children: m.title }),
|
|
1647
|
-
/* @__PURE__ */ e("p", { children: m.description.replace("{app}", i).replace("{company}", s) })
|
|
1648
|
-
] })
|
|
1649
|
-
] }),
|
|
1650
|
-
!Y && !P && /* @__PURE__ */ c("div", { className: "nice-gdpr-quick-actions", children: [
|
|
1651
|
-
/* @__PURE__ */ e(
|
|
1552
|
+
] }),
|
|
1553
|
+
a.length > 0 && /* @__PURE__ */ c("div", { className: "nice-gdpr-requests", children: [
|
|
1554
|
+
/* @__PURE__ */ e("h5", { children: l("gdprConsent.previousRequests", "Previous Requests") }),
|
|
1555
|
+
a.map((h) => /* @__PURE__ */ c("div", { className: `nice-gdpr-request nice-gdpr-request--${h.status}`, children: [
|
|
1556
|
+
/* @__PURE__ */ e("span", { className: "nice-gdpr-request-type", children: h.type }),
|
|
1557
|
+
/* @__PURE__ */ e("span", { className: "nice-gdpr-request-date", children: new Date(h.requestedAt).toLocaleDateString() }),
|
|
1558
|
+
/* @__PURE__ */ e("span", { className: "nice-gdpr-request-status", children: h.status }),
|
|
1559
|
+
h.status === "completed" && h.downloadUrl && /* @__PURE__ */ e(
|
|
1652
1560
|
"button",
|
|
1653
1561
|
{
|
|
1654
1562
|
type: "button",
|
|
1655
|
-
className: "nice-gdpr-
|
|
1656
|
-
onClick:
|
|
1657
|
-
children:
|
|
1563
|
+
className: "nice-gdpr-download-btn",
|
|
1564
|
+
onClick: () => i(h.id),
|
|
1565
|
+
children: l("gdprConsent.download", "Download")
|
|
1658
1566
|
}
|
|
1659
|
-
)
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1567
|
+
)
|
|
1568
|
+
] }, h.id))
|
|
1569
|
+
] }),
|
|
1570
|
+
n.length > 0 && /* @__PURE__ */ c("div", { className: "nice-gdpr-policies", children: [
|
|
1571
|
+
/* @__PURE__ */ e("h5", { children: l("gdprConsent.dataRetention", "Data Retention") }),
|
|
1572
|
+
/* @__PURE__ */ c("table", { className: "nice-gdpr-policies-table", children: [
|
|
1573
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ c("tr", { children: [
|
|
1574
|
+
/* @__PURE__ */ e("th", { children: l("gdprConsent.category", "Category") }),
|
|
1575
|
+
/* @__PURE__ */ e("th", { children: l("gdprConsent.retention", "Retention") }),
|
|
1576
|
+
/* @__PURE__ */ e("th", { children: l("gdprConsent.legalBasis", "Legal Basis") })
|
|
1577
|
+
] }) }),
|
|
1578
|
+
/* @__PURE__ */ e("tbody", { children: n.map((h, r) => /* @__PURE__ */ c("tr", { children: [
|
|
1579
|
+
/* @__PURE__ */ e("td", { children: h.category }),
|
|
1580
|
+
/* @__PURE__ */ c("td", { children: [
|
|
1581
|
+
h.retentionDays,
|
|
1582
|
+
" days"
|
|
1583
|
+
] }),
|
|
1584
|
+
/* @__PURE__ */ e("td", { children: h.legalBasis })
|
|
1585
|
+
] }, r)) })
|
|
1586
|
+
] })
|
|
1587
|
+
] })
|
|
1588
|
+
] });
|
|
1589
|
+
}, na = /* @__PURE__ */ Object.assign(
|
|
1590
|
+
/* @__PURE__ */ le(
|
|
1591
|
+
({
|
|
1592
|
+
appName: a,
|
|
1593
|
+
companyName: n,
|
|
1594
|
+
options: s = jc,
|
|
1595
|
+
currentConsent: i = null,
|
|
1596
|
+
retentionPolicies: t = [],
|
|
1597
|
+
dataRequests: l = [],
|
|
1598
|
+
privacyPolicy: h = [],
|
|
1599
|
+
storageKey: r = "nice_gdpr_consent",
|
|
1600
|
+
consentVersion: o = "1.0",
|
|
1601
|
+
variant: w = "banner",
|
|
1602
|
+
position: _ = "bottom",
|
|
1603
|
+
onConsentChange: I,
|
|
1604
|
+
onDataRequest: C,
|
|
1605
|
+
onDownloadExport: z,
|
|
1606
|
+
privacyPolicyUrl: F,
|
|
1607
|
+
cookiePolicyUrl: U,
|
|
1608
|
+
termsUrl: L,
|
|
1609
|
+
labels: Y,
|
|
1610
|
+
className: ce = "",
|
|
1611
|
+
style: $
|
|
1612
|
+
}, q) => {
|
|
1613
|
+
const { t: E } = W(), m = { ...Uc, ...Y }, [N, g] = k(!1), [V, u] = k(!1), [B, O] = k(!1), [P, x] = k(() => {
|
|
1614
|
+
const f = {};
|
|
1615
|
+
return s.forEach((T) => {
|
|
1616
|
+
f[T.id] = (i == null ? void 0 : i.categories[T.id]) ?? T.enabled;
|
|
1617
|
+
}), f;
|
|
1618
|
+
});
|
|
1619
|
+
me(() => {
|
|
1620
|
+
(!i || i.version !== o) && g(!0);
|
|
1621
|
+
}, [i, o]);
|
|
1622
|
+
const H = R(
|
|
1623
|
+
(f, T) => {
|
|
1624
|
+
const X = T || P;
|
|
1625
|
+
X.necessary = !0;
|
|
1626
|
+
const Z = {
|
|
1627
|
+
version: o,
|
|
1628
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
1629
|
+
categories: X,
|
|
1630
|
+
action: f
|
|
1631
|
+
};
|
|
1632
|
+
try {
|
|
1633
|
+
localStorage.setItem(r, JSON.stringify(Z));
|
|
1634
|
+
} catch {
|
|
1667
1635
|
}
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1636
|
+
x(X), g(!1), u(!1), I == null || I(Z);
|
|
1637
|
+
},
|
|
1638
|
+
[P, o, r, I]
|
|
1639
|
+
), j = R(() => {
|
|
1640
|
+
const f = {};
|
|
1641
|
+
s.forEach((T) => {
|
|
1642
|
+
f[T.id] = !0;
|
|
1643
|
+
}), H("accept_all", f);
|
|
1644
|
+
}, [s, H]), b = R(() => {
|
|
1645
|
+
const f = {};
|
|
1646
|
+
s.forEach((T) => {
|
|
1647
|
+
f[T.id] = T.required || !1;
|
|
1648
|
+
}), H("reject_all", f);
|
|
1649
|
+
}, [s, H]), S = R(
|
|
1650
|
+
async (f) => {
|
|
1651
|
+
C && await C(f);
|
|
1652
|
+
},
|
|
1653
|
+
[C]
|
|
1654
|
+
);
|
|
1655
|
+
if (re(q, () => ({
|
|
1656
|
+
showBanner: () => g(!0),
|
|
1657
|
+
hideBanner: () => g(!1),
|
|
1658
|
+
getConsent: () => {
|
|
1659
|
+
try {
|
|
1660
|
+
const f = localStorage.getItem(r);
|
|
1661
|
+
return f ? JSON.parse(f) : null;
|
|
1662
|
+
} catch {
|
|
1663
|
+
return null;
|
|
1676
1664
|
}
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1665
|
+
},
|
|
1666
|
+
revokeConsent: () => {
|
|
1667
|
+
try {
|
|
1668
|
+
localStorage.removeItem(r);
|
|
1669
|
+
} catch {
|
|
1670
|
+
}
|
|
1671
|
+
g(!0);
|
|
1672
|
+
},
|
|
1673
|
+
openPreferences: () => {
|
|
1674
|
+
g(!0), u(!0);
|
|
1675
|
+
}
|
|
1676
|
+
})), !N && w !== "embedded")
|
|
1677
|
+
return null;
|
|
1678
|
+
const A = /* @__PURE__ */ c("div", { className: "nice-gdpr-content", children: [
|
|
1679
|
+
/* @__PURE__ */ c("div", { className: "nice-gdpr-header", children: [
|
|
1680
|
+
/* @__PURE__ */ e("div", { className: "nice-gdpr-icon", children: /* @__PURE__ */ e(rc, { size: 32 }) }),
|
|
1681
|
+
/* @__PURE__ */ c("div", { className: "nice-gdpr-header-text", children: [
|
|
1682
|
+
/* @__PURE__ */ e("h3", { children: m.title }),
|
|
1683
|
+
/* @__PURE__ */ e("p", { children: m.description.replace("{app}", a).replace("{company}", n) })
|
|
1684
|
+
] })
|
|
1685
|
+
] }),
|
|
1686
|
+
!V && !B && /* @__PURE__ */ c("div", { className: "nice-gdpr-quick-actions", children: [
|
|
1690
1687
|
/* @__PURE__ */ e(
|
|
1691
1688
|
"button",
|
|
1692
1689
|
{
|
|
1693
1690
|
type: "button",
|
|
1694
1691
|
className: "nice-gdpr-btn nice-gdpr-btn--primary",
|
|
1695
|
-
onClick:
|
|
1696
|
-
children: m.
|
|
1692
|
+
onClick: j,
|
|
1693
|
+
children: m.acceptAll
|
|
1694
|
+
}
|
|
1695
|
+
),
|
|
1696
|
+
/* @__PURE__ */ e(
|
|
1697
|
+
"button",
|
|
1698
|
+
{
|
|
1699
|
+
type: "button",
|
|
1700
|
+
className: "nice-gdpr-btn nice-gdpr-btn--secondary",
|
|
1701
|
+
onClick: b,
|
|
1702
|
+
children: m.rejectAll
|
|
1697
1703
|
}
|
|
1698
1704
|
),
|
|
1699
1705
|
/* @__PURE__ */ e(
|
|
@@ -1701,164 +1707,198 @@ const jc = [
|
|
|
1701
1707
|
{
|
|
1702
1708
|
type: "button",
|
|
1703
1709
|
className: "nice-gdpr-btn nice-gdpr-btn--link",
|
|
1704
|
-
onClick: () =>
|
|
1705
|
-
children: m.
|
|
1710
|
+
onClick: () => u(!0),
|
|
1711
|
+
children: m.customize
|
|
1712
|
+
}
|
|
1713
|
+
)
|
|
1714
|
+
] }),
|
|
1715
|
+
V && !B && /* @__PURE__ */ c("div", { className: "nice-gdpr-preferences", children: [
|
|
1716
|
+
/* @__PURE__ */ e("div", { className: "nice-gdpr-options", children: s.map((f) => /* @__PURE__ */ e(
|
|
1717
|
+
Yc,
|
|
1718
|
+
{
|
|
1719
|
+
option: f,
|
|
1720
|
+
enabled: P[f.id],
|
|
1721
|
+
onChange: (T) => x((X) => ({ ...X, [f.id]: T }))
|
|
1722
|
+
},
|
|
1723
|
+
f.id
|
|
1724
|
+
)) }),
|
|
1725
|
+
/* @__PURE__ */ c("div", { className: "nice-gdpr-pref-actions", children: [
|
|
1726
|
+
/* @__PURE__ */ e(
|
|
1727
|
+
"button",
|
|
1728
|
+
{
|
|
1729
|
+
type: "button",
|
|
1730
|
+
className: "nice-gdpr-btn nice-gdpr-btn--primary",
|
|
1731
|
+
onClick: () => H("custom"),
|
|
1732
|
+
children: m.savePreferences
|
|
1733
|
+
}
|
|
1734
|
+
),
|
|
1735
|
+
/* @__PURE__ */ e(
|
|
1736
|
+
"button",
|
|
1737
|
+
{
|
|
1738
|
+
type: "button",
|
|
1739
|
+
className: "nice-gdpr-btn nice-gdpr-btn--link",
|
|
1740
|
+
onClick: () => O(!0),
|
|
1741
|
+
children: m.dataRights
|
|
1742
|
+
}
|
|
1743
|
+
)
|
|
1744
|
+
] })
|
|
1745
|
+
] }),
|
|
1746
|
+
B && /* @__PURE__ */ c(ae, { children: [
|
|
1747
|
+
/* @__PURE__ */ e(
|
|
1748
|
+
qc,
|
|
1749
|
+
{
|
|
1750
|
+
requests: l,
|
|
1751
|
+
policies: t,
|
|
1752
|
+
onRequest: S,
|
|
1753
|
+
onDownload: (f) => z == null ? void 0 : z(f),
|
|
1754
|
+
labels: m
|
|
1755
|
+
}
|
|
1756
|
+
),
|
|
1757
|
+
/* @__PURE__ */ c(
|
|
1758
|
+
"button",
|
|
1759
|
+
{
|
|
1760
|
+
type: "button",
|
|
1761
|
+
className: "nice-gdpr-btn nice-gdpr-btn--link",
|
|
1762
|
+
onClick: () => O(!1),
|
|
1763
|
+
children: [
|
|
1764
|
+
/* @__PURE__ */ e(oc, { size: 14 }),
|
|
1765
|
+
" ",
|
|
1766
|
+
E("gdprConsent.backToPreferences", "Back to preferences")
|
|
1767
|
+
]
|
|
1706
1768
|
}
|
|
1707
1769
|
)
|
|
1770
|
+
] }),
|
|
1771
|
+
/* @__PURE__ */ c("div", { className: "nice-gdpr-footer", children: [
|
|
1772
|
+
F && /* @__PURE__ */ e("a", { href: F, target: "_blank", rel: "noopener noreferrer", children: E("gdprConsent.privacyPolicy", "Privacy Policy") }),
|
|
1773
|
+
U && /* @__PURE__ */ e("a", { href: U, target: "_blank", rel: "noopener noreferrer", children: E("gdprConsent.cookiePolicy", "Cookie Policy") }),
|
|
1774
|
+
L && /* @__PURE__ */ e("a", { href: L, target: "_blank", rel: "noopener noreferrer", children: E("gdprConsent.termsOfService", "Terms of Service") })
|
|
1708
1775
|
] })
|
|
1709
|
-
] }),
|
|
1710
|
-
|
|
1711
|
-
/* @__PURE__ */ e(
|
|
1712
|
-
qc,
|
|
1713
|
-
{
|
|
1714
|
-
requests: l,
|
|
1715
|
-
policies: n,
|
|
1716
|
-
onRequest: z,
|
|
1717
|
-
onDownload: (b) => J == null ? void 0 : J(b),
|
|
1718
|
-
labels: m
|
|
1719
|
-
}
|
|
1720
|
-
),
|
|
1721
|
-
/* @__PURE__ */ c(
|
|
1722
|
-
"button",
|
|
1723
|
-
{
|
|
1724
|
-
type: "button",
|
|
1725
|
-
className: "nice-gdpr-btn nice-gdpr-btn--link",
|
|
1726
|
-
onClick: () => A(!1),
|
|
1727
|
-
children: [
|
|
1728
|
-
/* @__PURE__ */ e(nc, { size: 14 }),
|
|
1729
|
-
" Back to preferences"
|
|
1730
|
-
]
|
|
1731
|
-
}
|
|
1732
|
-
)
|
|
1733
|
-
] }),
|
|
1734
|
-
/* @__PURE__ */ c("div", { className: "nice-gdpr-footer", children: [
|
|
1735
|
-
_ && /* @__PURE__ */ e("a", { href: _, target: "_blank", rel: "noopener noreferrer", children: "Privacy Policy" }),
|
|
1736
|
-
K && /* @__PURE__ */ e("a", { href: K, target: "_blank", rel: "noopener noreferrer", children: "Cookie Policy" }),
|
|
1737
|
-
O && /* @__PURE__ */ e("a", { href: O, target: "_blank", rel: "noopener noreferrer", children: "Terms of Service" })
|
|
1738
|
-
] })
|
|
1739
|
-
] }), V = `nice-gdpr-consent nice-gdpr-consent--${T} nice-gdpr-consent--${E} ${j}`;
|
|
1740
|
-
return T === "modal" ? /* @__PURE__ */ e("div", { className: "nice-gdpr-overlay", children: /* @__PURE__ */ e("div", { className: V, style: U, role: "dialog", "aria-modal": "true", children: G }) }) : /* @__PURE__ */ e("div", { className: V, style: U, children: G });
|
|
1741
|
-
}
|
|
1742
|
-
);
|
|
1743
|
-
Vc.displayName = "NiceGDPRConsent";
|
|
1744
|
-
const Ve = {
|
|
1745
|
-
document: /* @__PURE__ */ e(we, { size: 16 }),
|
|
1746
|
-
user: /* @__PURE__ */ e(Ye, { size: 16 }),
|
|
1747
|
-
task: /* @__PURE__ */ e(ae, { size: 16 }),
|
|
1748
|
-
project: /* @__PURE__ */ e(rc, { size: 16 }),
|
|
1749
|
-
setting: /* @__PURE__ */ e(Pe, { size: 16 }),
|
|
1750
|
-
help: /* @__PURE__ */ e(Ue, { size: 16 }),
|
|
1751
|
-
action: /* @__PURE__ */ e(je, { size: 16 }),
|
|
1752
|
-
custom: /* @__PURE__ */ e(Ce, { size: 16 })
|
|
1753
|
-
}, Bc = ({
|
|
1754
|
-
value: i,
|
|
1755
|
-
onChange: s,
|
|
1756
|
-
onKeyDown: t,
|
|
1757
|
-
placeholder: a,
|
|
1758
|
-
isLoading: n,
|
|
1759
|
-
inputRef: l
|
|
1760
|
-
}) => /* @__PURE__ */ c("div", { className: "nice-search-input-container", children: [
|
|
1761
|
-
/* @__PURE__ */ e("span", { className: "nice-search-icon", children: /* @__PURE__ */ e(pe, { size: 16 }) }),
|
|
1762
|
-
/* @__PURE__ */ e(
|
|
1763
|
-
"input",
|
|
1764
|
-
{
|
|
1765
|
-
ref: l,
|
|
1766
|
-
type: "text",
|
|
1767
|
-
className: "nice-search-input",
|
|
1768
|
-
placeholder: a,
|
|
1769
|
-
value: i,
|
|
1770
|
-
onChange: (h) => s(h.target.value),
|
|
1771
|
-
onKeyDown: t,
|
|
1772
|
-
"aria-label": "Search"
|
|
1776
|
+
] }), J = `nice-gdpr-consent nice-gdpr-consent--${w} nice-gdpr-consent--${_} ${ce}`;
|
|
1777
|
+
return w === "modal" ? /* @__PURE__ */ e("div", { className: "nice-gdpr-overlay", children: /* @__PURE__ */ e("div", { className: J, style: $, role: "dialog", "aria-modal": "true", children: A }) }) : /* @__PURE__ */ e("div", { className: J, style: $, children: A });
|
|
1773
1778
|
}
|
|
1774
1779
|
),
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1780
|
+
{ displayName: "NiceGDPRConsent" }
|
|
1781
|
+
), Vc = [], Je = {
|
|
1782
|
+
document: /* @__PURE__ */ e(xe, { size: 16 }),
|
|
1783
|
+
user: /* @__PURE__ */ e(Be, { size: 16 }),
|
|
1784
|
+
task: /* @__PURE__ */ e(se, { size: 16 }),
|
|
1785
|
+
project: /* @__PURE__ */ e(hc, { size: 16 }),
|
|
1786
|
+
setting: /* @__PURE__ */ e($e, { size: 16 }),
|
|
1787
|
+
help: /* @__PURE__ */ e(Ve, { size: 16 }),
|
|
1788
|
+
action: /* @__PURE__ */ e(qe, { size: 16 }),
|
|
1789
|
+
custom: /* @__PURE__ */ e(De, { size: 16 })
|
|
1790
|
+
}, Bc = ({
|
|
1791
|
+
value: a,
|
|
1792
|
+
onChange: n,
|
|
1793
|
+
onKeyDown: s,
|
|
1794
|
+
placeholder: i,
|
|
1795
|
+
isLoading: t,
|
|
1796
|
+
inputRef: l
|
|
1797
|
+
}) => {
|
|
1798
|
+
const { t: h } = W();
|
|
1799
|
+
return /* @__PURE__ */ c("div", { className: "nice-search-input-container", children: [
|
|
1800
|
+
/* @__PURE__ */ e("span", { className: "nice-search-icon", children: /* @__PURE__ */ e(ge, { size: 16 }) }),
|
|
1801
|
+
/* @__PURE__ */ e(
|
|
1802
|
+
"input",
|
|
1803
|
+
{
|
|
1804
|
+
ref: l,
|
|
1805
|
+
type: "text",
|
|
1806
|
+
className: "nice-search-input",
|
|
1807
|
+
placeholder: i,
|
|
1808
|
+
value: a,
|
|
1809
|
+
onChange: (r) => n(r.target.value),
|
|
1810
|
+
onKeyDown: s,
|
|
1811
|
+
"aria-label": h("globalSearch.search", "Search")
|
|
1812
|
+
}
|
|
1813
|
+
),
|
|
1814
|
+
t && /* @__PURE__ */ e("span", { className: "nice-search-loader" }),
|
|
1815
|
+
a && !t && /* @__PURE__ */ e(
|
|
1816
|
+
"button",
|
|
1817
|
+
{
|
|
1818
|
+
type: "button",
|
|
1819
|
+
className: "nice-search-clear",
|
|
1820
|
+
onClick: () => n(""),
|
|
1821
|
+
"aria-label": h("globalSearch.clearSearch", "Clear search"),
|
|
1822
|
+
children: /* @__PURE__ */ e(be, { size: 16 })
|
|
1823
|
+
}
|
|
1824
|
+
)
|
|
1825
|
+
] });
|
|
1826
|
+
}, Hc = ({ result: a, isSelected: n, onSelect: s, renderResult: i }) => i ? /* @__PURE__ */ e("div", { onClick: s, children: i(a, n) }) : /* @__PURE__ */ c(
|
|
1787
1827
|
"div",
|
|
1788
1828
|
{
|
|
1789
|
-
className: `nice-search-result ${
|
|
1790
|
-
onClick:
|
|
1829
|
+
className: `nice-search-result ${n ? "nice-search-result--selected" : ""}`,
|
|
1830
|
+
onClick: s,
|
|
1791
1831
|
role: "option",
|
|
1792
|
-
"aria-selected":
|
|
1832
|
+
"aria-selected": n,
|
|
1793
1833
|
children: [
|
|
1794
|
-
/* @__PURE__ */ e("div", { className: "nice-search-result-icon", children:
|
|
1834
|
+
/* @__PURE__ */ e("div", { className: "nice-search-result-icon", children: a.icon || (a.image ? /* @__PURE__ */ e("img", { src: a.image, alt: "" }) : Je[a.type]) }),
|
|
1795
1835
|
/* @__PURE__ */ c("div", { className: "nice-search-result-content", children: [
|
|
1796
|
-
/* @__PURE__ */ e("span", { className: "nice-search-result-title", children:
|
|
1797
|
-
|
|
1798
|
-
|
|
1836
|
+
/* @__PURE__ */ e("span", { className: "nice-search-result-title", children: a.title }),
|
|
1837
|
+
a.subtitle && /* @__PURE__ */ e("span", { className: "nice-search-result-subtitle", children: a.subtitle }),
|
|
1838
|
+
a.description && /* @__PURE__ */ e("span", { className: "nice-search-result-desc", children: a.description })
|
|
1799
1839
|
] }),
|
|
1800
1840
|
/* @__PURE__ */ c("div", { className: "nice-search-result-meta", children: [
|
|
1801
|
-
/* @__PURE__ */ e("span", { className: "nice-search-result-source", children:
|
|
1802
|
-
/* @__PURE__ */ e("span", { className: "nice-search-result-type", children:
|
|
1841
|
+
/* @__PURE__ */ e("span", { className: "nice-search-result-source", children: a.source }),
|
|
1842
|
+
/* @__PURE__ */ e("span", { className: "nice-search-result-type", children: a.type })
|
|
1803
1843
|
] }),
|
|
1804
|
-
|
|
1844
|
+
a.actions && a.actions.length > 0 && /* @__PURE__ */ e("div", { className: "nice-search-result-actions", children: a.actions.map((t) => /* @__PURE__ */ e(
|
|
1805
1845
|
"button",
|
|
1806
1846
|
{
|
|
1807
1847
|
type: "button",
|
|
1808
1848
|
className: "nice-search-action-btn",
|
|
1809
1849
|
onClick: (l) => {
|
|
1810
|
-
l.stopPropagation(),
|
|
1850
|
+
l.stopPropagation(), t.onClick();
|
|
1811
1851
|
},
|
|
1812
|
-
title:
|
|
1813
|
-
children:
|
|
1852
|
+
title: t.label,
|
|
1853
|
+
children: t.icon || t.label
|
|
1814
1854
|
},
|
|
1815
|
-
|
|
1855
|
+
t.id
|
|
1816
1856
|
)) })
|
|
1817
1857
|
]
|
|
1818
1858
|
}
|
|
1819
|
-
), Jc = ({ categories:
|
|
1859
|
+
), Jc = ({ categories: a, selected: n, onSelect: s }) => /* @__PURE__ */ c("div", { className: "nice-search-categories", children: [
|
|
1820
1860
|
/* @__PURE__ */ e(
|
|
1821
1861
|
"button",
|
|
1822
1862
|
{
|
|
1823
1863
|
type: "button",
|
|
1824
|
-
className: `nice-search-category ${
|
|
1825
|
-
onClick: () =>
|
|
1864
|
+
className: `nice-search-category ${n === null ? "nice-search-category--active" : ""}`,
|
|
1865
|
+
onClick: () => s(null),
|
|
1826
1866
|
children: "All"
|
|
1827
1867
|
}
|
|
1828
1868
|
),
|
|
1829
|
-
|
|
1869
|
+
a.map((i) => /* @__PURE__ */ c(
|
|
1830
1870
|
"button",
|
|
1831
1871
|
{
|
|
1832
1872
|
type: "button",
|
|
1833
|
-
className: `nice-search-category ${
|
|
1834
|
-
onClick: () =>
|
|
1873
|
+
className: `nice-search-category ${n === i.id ? "nice-search-category--active" : ""}`,
|
|
1874
|
+
onClick: () => s(i.id),
|
|
1835
1875
|
children: [
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1876
|
+
i.icon && /* @__PURE__ */ e("span", { className: "nice-search-category-icon", children: i.icon }),
|
|
1877
|
+
i.label,
|
|
1878
|
+
i.count !== void 0 && /* @__PURE__ */ e("span", { className: "nice-search-category-count", children: i.count })
|
|
1839
1879
|
]
|
|
1840
1880
|
},
|
|
1841
|
-
|
|
1881
|
+
i.id
|
|
1842
1882
|
))
|
|
1843
1883
|
] }), Gc = ({
|
|
1844
|
-
searches:
|
|
1845
|
-
onSelect:
|
|
1846
|
-
onClear:
|
|
1847
|
-
label:
|
|
1848
|
-
clearLabel:
|
|
1884
|
+
searches: a,
|
|
1885
|
+
onSelect: n,
|
|
1886
|
+
onClear: s,
|
|
1887
|
+
label: i,
|
|
1888
|
+
clearLabel: t
|
|
1849
1889
|
}) => /* @__PURE__ */ c("div", { className: "nice-search-recent", children: [
|
|
1850
1890
|
/* @__PURE__ */ c("div", { className: "nice-search-recent-header", children: [
|
|
1851
|
-
/* @__PURE__ */ e("span", { children:
|
|
1852
|
-
/* @__PURE__ */ e("button", { type: "button", onClick:
|
|
1891
|
+
/* @__PURE__ */ e("span", { children: i }),
|
|
1892
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: s, children: t })
|
|
1853
1893
|
] }),
|
|
1854
|
-
/* @__PURE__ */ e("div", { className: "nice-search-recent-list", children:
|
|
1894
|
+
/* @__PURE__ */ e("div", { className: "nice-search-recent-list", children: a.map((l, h) => /* @__PURE__ */ c(
|
|
1855
1895
|
"button",
|
|
1856
1896
|
{
|
|
1857
1897
|
type: "button",
|
|
1858
1898
|
className: "nice-search-recent-item",
|
|
1859
|
-
onClick: () =>
|
|
1899
|
+
onClick: () => n(l.query),
|
|
1860
1900
|
children: [
|
|
1861
|
-
/* @__PURE__ */ e("span", { className: "nice-search-recent-icon", children: /* @__PURE__ */ e(
|
|
1901
|
+
/* @__PURE__ */ e("span", { className: "nice-search-recent-icon", children: /* @__PURE__ */ e(Le, { size: 14 }) }),
|
|
1862
1902
|
/* @__PURE__ */ e("span", { className: "nice-search-recent-query", children: l.query })
|
|
1863
1903
|
]
|
|
1864
1904
|
},
|
|
@@ -1872,250 +1912,254 @@ const Ve = {
|
|
|
1872
1912
|
clearRecent: "Clear",
|
|
1873
1913
|
categories: "Categories",
|
|
1874
1914
|
filters: "Filters"
|
|
1875
|
-
},
|
|
1876
|
-
(
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
const d = localStorage.getItem("nice_recent_searches");
|
|
1903
|
-
d && W(JSON.parse(d));
|
|
1904
|
-
} catch {
|
|
1905
|
-
}
|
|
1906
|
-
}, []);
|
|
1907
|
-
const Q = $(
|
|
1908
|
-
(d, f) => {
|
|
1909
|
-
const ce = [{
|
|
1910
|
-
query: d,
|
|
1911
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
1912
|
-
resultCount: f
|
|
1913
|
-
}, ...L.filter((de) => de.query !== d)].slice(
|
|
1914
|
-
0,
|
|
1915
|
-
r
|
|
1916
|
-
);
|
|
1917
|
-
W(ce);
|
|
1915
|
+
}, la = /* @__PURE__ */ Object.assign(
|
|
1916
|
+
/* @__PURE__ */ le(
|
|
1917
|
+
({
|
|
1918
|
+
sources: a = Vc,
|
|
1919
|
+
placeholder: n,
|
|
1920
|
+
minQueryLength: s = 2,
|
|
1921
|
+
debounceMs: i = 300,
|
|
1922
|
+
showCategories: t = !0,
|
|
1923
|
+
filters: l = [],
|
|
1924
|
+
showRecent: h = !0,
|
|
1925
|
+
maxRecent: r = 5,
|
|
1926
|
+
showShortcuts: o = !0,
|
|
1927
|
+
hotkey: w = "k",
|
|
1928
|
+
onResultSelect: _,
|
|
1929
|
+
onSearch: I,
|
|
1930
|
+
onClose: C,
|
|
1931
|
+
renderResult: z,
|
|
1932
|
+
renderEmpty: F,
|
|
1933
|
+
defaultOpen: U = !1,
|
|
1934
|
+
open: L,
|
|
1935
|
+
variant: Y = "modal",
|
|
1936
|
+
labels: ce,
|
|
1937
|
+
className: $ = "",
|
|
1938
|
+
style: q
|
|
1939
|
+
}, E) => {
|
|
1940
|
+
const { t: m } = W(), N = { ...Kc, ...ce }, g = ke(null), V = ke(void 0), [u, B] = k(U), [O, P] = k(""), [x, H] = k([]), [j, b] = k(!1), [S, A] = k(0), [J, f] = k(null), [T, X] = k([]), Z = L !== void 0 ? L : u;
|
|
1941
|
+
me(() => {
|
|
1918
1942
|
try {
|
|
1919
|
-
localStorage.
|
|
1943
|
+
const p = localStorage.getItem("nice_recent_searches");
|
|
1944
|
+
p && X(JSON.parse(p));
|
|
1920
1945
|
} catch {
|
|
1921
1946
|
}
|
|
1922
|
-
},
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
}
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
Jc,
|
|
2028
|
-
{
|
|
2029
|
-
categories: X,
|
|
2030
|
-
selected: V,
|
|
2031
|
-
onSelect: b
|
|
1947
|
+
}, []);
|
|
1948
|
+
const G = R(
|
|
1949
|
+
(p, y) => {
|
|
1950
|
+
const te = [
|
|
1951
|
+
{
|
|
1952
|
+
query: p,
|
|
1953
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
1954
|
+
resultCount: y
|
|
1955
|
+
},
|
|
1956
|
+
...T.filter((pe) => pe.query !== p)
|
|
1957
|
+
].slice(0, r);
|
|
1958
|
+
X(te);
|
|
1959
|
+
try {
|
|
1960
|
+
localStorage.setItem("nice_recent_searches", JSON.stringify(te));
|
|
1961
|
+
} catch {
|
|
1962
|
+
}
|
|
1963
|
+
},
|
|
1964
|
+
[T, r]
|
|
1965
|
+
), v = R(
|
|
1966
|
+
async (p) => {
|
|
1967
|
+
if (p.length < s) {
|
|
1968
|
+
H([]);
|
|
1969
|
+
return;
|
|
1970
|
+
}
|
|
1971
|
+
b(!0);
|
|
1972
|
+
try {
|
|
1973
|
+
const y = a.map(async (te) => {
|
|
1974
|
+
try {
|
|
1975
|
+
return (await te.search(p)).map((ze) => ({
|
|
1976
|
+
...ze,
|
|
1977
|
+
source: te.name,
|
|
1978
|
+
relevanceScore: ze.relevanceScore * (te.priority || 1)
|
|
1979
|
+
}));
|
|
1980
|
+
} catch {
|
|
1981
|
+
return [];
|
|
1982
|
+
}
|
|
1983
|
+
}), ee = (await Promise.all(y)).flat();
|
|
1984
|
+
ee.sort((te, pe) => pe.relevanceScore - te.relevanceScore), H(ee), A(0), I == null || I(p, ee), ee.length > 0 && G(p, ee.length);
|
|
1985
|
+
} finally {
|
|
1986
|
+
b(!1);
|
|
1987
|
+
}
|
|
1988
|
+
},
|
|
1989
|
+
[a, s, I, G]
|
|
1990
|
+
), D = R(
|
|
1991
|
+
(p) => {
|
|
1992
|
+
P(p), V.current && clearTimeout(V.current), V.current = setTimeout(() => {
|
|
1993
|
+
v(p);
|
|
1994
|
+
}, i);
|
|
1995
|
+
},
|
|
1996
|
+
[v, i]
|
|
1997
|
+
), M = R(
|
|
1998
|
+
(p) => {
|
|
1999
|
+
switch (p.key) {
|
|
2000
|
+
case "ArrowDown":
|
|
2001
|
+
p.preventDefault(), A((y) => Math.min(y + 1, x.length - 1));
|
|
2002
|
+
break;
|
|
2003
|
+
case "ArrowUp":
|
|
2004
|
+
p.preventDefault(), A((y) => Math.max(y - 1, 0));
|
|
2005
|
+
break;
|
|
2006
|
+
case "Enter":
|
|
2007
|
+
p.preventDefault(), x[S] && (_ == null || _(x[S]), B(!1), C == null || C());
|
|
2008
|
+
break;
|
|
2009
|
+
case "Escape":
|
|
2010
|
+
p.preventDefault(), B(!1), C == null || C();
|
|
2011
|
+
break;
|
|
2012
|
+
}
|
|
2013
|
+
},
|
|
2014
|
+
[x, S, _, C]
|
|
2015
|
+
);
|
|
2016
|
+
me(() => {
|
|
2017
|
+
const p = (y) => {
|
|
2018
|
+
(y.metaKey || y.ctrlKey) && y.key === w && (y.preventDefault(), B(!0), setTimeout(() => {
|
|
2019
|
+
var ee;
|
|
2020
|
+
return (ee = g.current) == null ? void 0 : ee.focus();
|
|
2021
|
+
}, 0));
|
|
2022
|
+
};
|
|
2023
|
+
return document.addEventListener("keydown", p), () => document.removeEventListener("keydown", p);
|
|
2024
|
+
}, [w]), me(() => {
|
|
2025
|
+
Z && setTimeout(() => {
|
|
2026
|
+
var p;
|
|
2027
|
+
return (p = g.current) == null ? void 0 : p.focus();
|
|
2028
|
+
}, 0);
|
|
2029
|
+
}, [Z]);
|
|
2030
|
+
const K = J ? x.filter((p) => p.type === J) : x, Q = Array.from(new Set(x.map((p) => p.type))).map(
|
|
2031
|
+
(p) => ({
|
|
2032
|
+
id: p,
|
|
2033
|
+
label: p.charAt(0).toUpperCase() + p.slice(1),
|
|
2034
|
+
icon: Je[p],
|
|
2035
|
+
count: x.filter((y) => y.type === p).length
|
|
2036
|
+
})
|
|
2037
|
+
);
|
|
2038
|
+
if (re(E, () => ({
|
|
2039
|
+
open: () => B(!0),
|
|
2040
|
+
close: () => {
|
|
2041
|
+
B(!1), C == null || C();
|
|
2042
|
+
},
|
|
2043
|
+
focus: () => {
|
|
2044
|
+
var p;
|
|
2045
|
+
return (p = g.current) == null ? void 0 : p.focus();
|
|
2046
|
+
},
|
|
2047
|
+
clear: () => {
|
|
2048
|
+
P(""), H([]);
|
|
2049
|
+
},
|
|
2050
|
+
search: async (p) => {
|
|
2051
|
+
P(p), await v(p);
|
|
2032
2052
|
}
|
|
2033
|
-
),
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2053
|
+
})), !Z && Y !== "inline")
|
|
2054
|
+
return null;
|
|
2055
|
+
const d = /* @__PURE__ */ c("div", { className: "nice-search-content", children: [
|
|
2056
|
+
/* @__PURE__ */ e(
|
|
2057
|
+
Bc,
|
|
2058
|
+
{
|
|
2059
|
+
value: O,
|
|
2060
|
+
onChange: D,
|
|
2061
|
+
onKeyDown: M,
|
|
2062
|
+
placeholder: n || N.placeholder,
|
|
2063
|
+
isLoading: j,
|
|
2064
|
+
inputRef: g
|
|
2065
|
+
}
|
|
2066
|
+
),
|
|
2067
|
+
t && Q.length > 1 && O.length >= s && /* @__PURE__ */ e(
|
|
2068
|
+
Jc,
|
|
2047
2069
|
{
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
onSelect:
|
|
2051
|
-
|
|
2070
|
+
categories: Q,
|
|
2071
|
+
selected: J,
|
|
2072
|
+
onSelect: f
|
|
2073
|
+
}
|
|
2074
|
+
),
|
|
2075
|
+
/* @__PURE__ */ c("div", { className: "nice-search-results", role: "listbox", children: [
|
|
2076
|
+
j && O.length >= s && /* @__PURE__ */ e("div", { className: "nice-search-loading", children: N.searching }),
|
|
2077
|
+
!j && O.length >= s && K.length === 0 && /* @__PURE__ */ e("div", { className: "nice-search-empty", children: F ? F(O) : /* @__PURE__ */ c(ae, { children: [
|
|
2078
|
+
/* @__PURE__ */ e("span", { className: "nice-search-empty-icon", children: /* @__PURE__ */ e(ge, { size: 32 }) }),
|
|
2079
|
+
/* @__PURE__ */ c("span", { children: [
|
|
2080
|
+
N.noResults,
|
|
2081
|
+
' "',
|
|
2082
|
+
O,
|
|
2083
|
+
'"'
|
|
2084
|
+
] })
|
|
2085
|
+
] }) }),
|
|
2086
|
+
K.map((p, y) => /* @__PURE__ */ e(
|
|
2087
|
+
Hc,
|
|
2088
|
+
{
|
|
2089
|
+
result: p,
|
|
2090
|
+
isSelected: y === S,
|
|
2091
|
+
onSelect: () => {
|
|
2092
|
+
_ == null || _(p), B(!1), C == null || C();
|
|
2093
|
+
},
|
|
2094
|
+
renderResult: z
|
|
2052
2095
|
},
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
d.id
|
|
2056
|
-
))
|
|
2057
|
-
] }),
|
|
2058
|
-
h && A.length < t && L.length > 0 && /* @__PURE__ */ e(
|
|
2059
|
-
Gc,
|
|
2060
|
-
{
|
|
2061
|
-
searches: L,
|
|
2062
|
-
onSelect: (d) => {
|
|
2063
|
-
I(d), N(d);
|
|
2064
|
-
},
|
|
2065
|
-
onClear: () => {
|
|
2066
|
-
W([]), localStorage.removeItem("nice_recent_searches");
|
|
2067
|
-
},
|
|
2068
|
-
label: k.recent,
|
|
2069
|
-
clearLabel: k.clearRecent
|
|
2070
|
-
}
|
|
2071
|
-
),
|
|
2072
|
-
u && /* @__PURE__ */ c("div", { className: "nice-search-shortcuts", children: [
|
|
2073
|
-
/* @__PURE__ */ c("span", { children: [
|
|
2074
|
-
/* @__PURE__ */ e("kbd", { children: "↑" }),
|
|
2075
|
-
/* @__PURE__ */ e("kbd", { children: "↓" }),
|
|
2076
|
-
" Navigate"
|
|
2077
|
-
] }),
|
|
2078
|
-
/* @__PURE__ */ c("span", { children: [
|
|
2079
|
-
/* @__PURE__ */ e("kbd", { children: "↵" }),
|
|
2080
|
-
" Select"
|
|
2096
|
+
p.id
|
|
2097
|
+
))
|
|
2081
2098
|
] }),
|
|
2082
|
-
/* @__PURE__ */
|
|
2083
|
-
|
|
2084
|
-
" Close"
|
|
2085
|
-
] })
|
|
2086
|
-
] })
|
|
2087
|
-
] });
|
|
2088
|
-
return M === "modal" ? /* @__PURE__ */ e(
|
|
2089
|
-
"div",
|
|
2090
|
-
{
|
|
2091
|
-
className: "nice-search-overlay",
|
|
2092
|
-
onClick: () => {
|
|
2093
|
-
P(!1), y == null || y();
|
|
2094
|
-
},
|
|
2095
|
-
children: /* @__PURE__ */ e(
|
|
2096
|
-
"div",
|
|
2099
|
+
h && O.length < s && T.length > 0 && /* @__PURE__ */ e(
|
|
2100
|
+
Gc,
|
|
2097
2101
|
{
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2102
|
+
searches: T,
|
|
2103
|
+
onSelect: (p) => {
|
|
2104
|
+
P(p), v(p);
|
|
2105
|
+
},
|
|
2106
|
+
onClear: () => {
|
|
2107
|
+
X([]), localStorage.removeItem("nice_recent_searches");
|
|
2108
|
+
},
|
|
2109
|
+
label: N.recent,
|
|
2110
|
+
clearLabel: N.clearRecent
|
|
2104
2111
|
}
|
|
2105
|
-
)
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
)
|
|
2117
|
-
|
|
2118
|
-
|
|
2112
|
+
),
|
|
2113
|
+
o && /* @__PURE__ */ c("div", { className: "nice-search-shortcuts", children: [
|
|
2114
|
+
/* @__PURE__ */ c("span", { children: [
|
|
2115
|
+
/* @__PURE__ */ e("kbd", { children: /* @__PURE__ */ e(_e, { name: "arrow-up", size: 12 }) }),
|
|
2116
|
+
/* @__PURE__ */ e("kbd", { children: /* @__PURE__ */ e(_e, { name: "arrow-down", size: 12 }) }),
|
|
2117
|
+
" ",
|
|
2118
|
+
m("globalSearch.navigate", "Navigate")
|
|
2119
|
+
] }),
|
|
2120
|
+
/* @__PURE__ */ c("span", { children: [
|
|
2121
|
+
/* @__PURE__ */ e("kbd", { children: "↵" }),
|
|
2122
|
+
" ",
|
|
2123
|
+
m("globalSearch.select", "Select")
|
|
2124
|
+
] }),
|
|
2125
|
+
/* @__PURE__ */ c("span", { children: [
|
|
2126
|
+
/* @__PURE__ */ e("kbd", { children: "Esc" }),
|
|
2127
|
+
" ",
|
|
2128
|
+
m("globalSearch.close", "Close")
|
|
2129
|
+
] })
|
|
2130
|
+
] })
|
|
2131
|
+
] });
|
|
2132
|
+
return Y === "modal" ? /* @__PURE__ */ e(
|
|
2133
|
+
"div",
|
|
2134
|
+
{
|
|
2135
|
+
className: "nice-search-overlay",
|
|
2136
|
+
onClick: () => {
|
|
2137
|
+
B(!1), C == null || C();
|
|
2138
|
+
},
|
|
2139
|
+
children: /* @__PURE__ */ e(
|
|
2140
|
+
"div",
|
|
2141
|
+
{
|
|
2142
|
+
className: `nice-global-search nice-global-search--modal ${$}`,
|
|
2143
|
+
style: q,
|
|
2144
|
+
onClick: (p) => p.stopPropagation(),
|
|
2145
|
+
role: "dialog",
|
|
2146
|
+
"aria-modal": "true",
|
|
2147
|
+
children: d
|
|
2148
|
+
}
|
|
2149
|
+
)
|
|
2150
|
+
}
|
|
2151
|
+
) : /* @__PURE__ */ e(
|
|
2152
|
+
"div",
|
|
2153
|
+
{
|
|
2154
|
+
className: `nice-global-search nice-global-search--${Y} ${$}`,
|
|
2155
|
+
style: q,
|
|
2156
|
+
children: d
|
|
2157
|
+
}
|
|
2158
|
+
);
|
|
2159
|
+
}
|
|
2160
|
+
),
|
|
2161
|
+
{ displayName: "NiceGlobalSearch" }
|
|
2162
|
+
), Wc = [], oe = {
|
|
2119
2163
|
title: "Access Log",
|
|
2120
2164
|
filters: "Filters",
|
|
2121
2165
|
search: "Search users, IPs...",
|
|
@@ -2167,619 +2211,647 @@ const le = {
|
|
|
2167
2211
|
risk: "Risk",
|
|
2168
2212
|
status: "Status"
|
|
2169
2213
|
}
|
|
2170
|
-
},
|
|
2171
|
-
login_success: /* @__PURE__ */ e(
|
|
2172
|
-
login_failed: /* @__PURE__ */ e(
|
|
2173
|
-
logout: /* @__PURE__ */ e(
|
|
2174
|
-
password_change: /* @__PURE__ */ e(
|
|
2175
|
-
password_reset: /* @__PURE__ */ e(
|
|
2176
|
-
mfa_enabled: /* @__PURE__ */ e(
|
|
2177
|
-
mfa_disabled: /* @__PURE__ */ e(
|
|
2178
|
-
mfa_challenged: /* @__PURE__ */ e(
|
|
2179
|
-
permission_change: /* @__PURE__ */ e(
|
|
2180
|
-
session_expired: /* @__PURE__ */ e(
|
|
2181
|
-
account_locked: /* @__PURE__ */ e(
|
|
2182
|
-
account_unlocked: /* @__PURE__ */ e(
|
|
2183
|
-
api_key_created: /* @__PURE__ */ e(
|
|
2184
|
-
api_key_revoked: /* @__PURE__ */ e(
|
|
2185
|
-
token_refresh: /* @__PURE__ */ e(
|
|
2186
|
-
suspicious_activity: /* @__PURE__ */ e(
|
|
2187
|
-
},
|
|
2214
|
+
}, Ne = {
|
|
2215
|
+
login_success: /* @__PURE__ */ e(se, { size: 16 }),
|
|
2216
|
+
login_failed: /* @__PURE__ */ e(he, { size: 16 }),
|
|
2217
|
+
logout: /* @__PURE__ */ e(Me, { size: 16 }),
|
|
2218
|
+
password_change: /* @__PURE__ */ e(fe, { size: 16 }),
|
|
2219
|
+
password_reset: /* @__PURE__ */ e(ye, { size: 16 }),
|
|
2220
|
+
mfa_enabled: /* @__PURE__ */ e(He, { size: 16 }),
|
|
2221
|
+
mfa_disabled: /* @__PURE__ */ e(Ye, { size: 16 }),
|
|
2222
|
+
mfa_challenged: /* @__PURE__ */ e(we, { size: 16 }),
|
|
2223
|
+
permission_change: /* @__PURE__ */ e(Be, { size: 16 }),
|
|
2224
|
+
session_expired: /* @__PURE__ */ e(Le, { size: 16 }),
|
|
2225
|
+
account_locked: /* @__PURE__ */ e(Ue, { size: 16 }),
|
|
2226
|
+
account_unlocked: /* @__PURE__ */ e(bc, { size: 16 }),
|
|
2227
|
+
api_key_created: /* @__PURE__ */ e(fe, { size: 16 }),
|
|
2228
|
+
api_key_revoked: /* @__PURE__ */ e(he, { size: 16 }),
|
|
2229
|
+
token_refresh: /* @__PURE__ */ e(ye, { size: 16 }),
|
|
2230
|
+
suspicious_activity: /* @__PURE__ */ e(qe, { size: 16 })
|
|
2231
|
+
}, de = {
|
|
2188
2232
|
low: "var(--nice-color-success, #22c55e)",
|
|
2189
2233
|
medium: "var(--nice-color-warning, #f59e0b)",
|
|
2190
2234
|
high: "var(--nice-color-error, #ef4444)",
|
|
2191
2235
|
critical: "var(--nice-color-accent-hover, #7c3aed)"
|
|
2192
|
-
},
|
|
2193
|
-
desktop: /* @__PURE__ */ e(
|
|
2194
|
-
mobile: /* @__PURE__ */ e(
|
|
2195
|
-
tablet: /* @__PURE__ */ e(
|
|
2196
|
-
unknown: /* @__PURE__ */ e(
|
|
2197
|
-
},
|
|
2236
|
+
}, Ae = {
|
|
2237
|
+
desktop: /* @__PURE__ */ e(Nc, { size: 16 }),
|
|
2238
|
+
mobile: /* @__PURE__ */ e(we, { size: 16 }),
|
|
2239
|
+
tablet: /* @__PURE__ */ e(we, { size: 16 }),
|
|
2240
|
+
unknown: /* @__PURE__ */ e(Ve, { size: 16 })
|
|
2241
|
+
}, Ie = (a) => (typeof a == "string" ? new Date(a) : a).toLocaleString("en-US", {
|
|
2198
2242
|
month: "short",
|
|
2199
2243
|
day: "numeric",
|
|
2200
2244
|
hour: "2-digit",
|
|
2201
2245
|
minute: "2-digit",
|
|
2202
2246
|
second: "2-digit"
|
|
2203
|
-
}),
|
|
2204
|
-
if (!
|
|
2247
|
+
}), Oe = (a) => {
|
|
2248
|
+
if (!a)
|
|
2205
2249
|
return "Unknown";
|
|
2206
|
-
const
|
|
2207
|
-
return
|
|
2208
|
-
}, Xc = (
|
|
2209
|
-
if (!
|
|
2250
|
+
const n = [];
|
|
2251
|
+
return a.city && n.push(a.city), a.country && n.push(a.country), n.length > 0 ? n.join(", ") : "Unknown";
|
|
2252
|
+
}, Xc = (a) => {
|
|
2253
|
+
if (!a)
|
|
2210
2254
|
return "Unknown";
|
|
2211
|
-
const
|
|
2212
|
-
return
|
|
2213
|
-
},
|
|
2214
|
-
var
|
|
2215
|
-
if (
|
|
2216
|
-
const r = typeof
|
|
2217
|
-
if ((typeof
|
|
2255
|
+
const n = [];
|
|
2256
|
+
return a.browser && n.push(a.browser), a.os && n.push(a.os), n.length > 0 ? n.join(" / ") : a.type;
|
|
2257
|
+
}, Pe = (a) => a >= 80 ? de.critical : a >= 60 ? de.high : a >= 40 ? de.medium : de.low, Zc = (a, n) => {
|
|
2258
|
+
var s, i, t, l, h;
|
|
2259
|
+
if (n.startDate) {
|
|
2260
|
+
const r = typeof n.startDate == "string" ? new Date(n.startDate) : n.startDate;
|
|
2261
|
+
if ((typeof a.timestamp == "string" ? new Date(a.timestamp) : a.timestamp) < r)
|
|
2218
2262
|
return !1;
|
|
2219
2263
|
}
|
|
2220
|
-
if (
|
|
2221
|
-
const r = typeof
|
|
2222
|
-
if ((typeof
|
|
2264
|
+
if (n.endDate) {
|
|
2265
|
+
const r = typeof n.endDate == "string" ? new Date(n.endDate) : n.endDate;
|
|
2266
|
+
if ((typeof a.timestamp == "string" ? new Date(a.timestamp) : a.timestamp) > r)
|
|
2223
2267
|
return !1;
|
|
2224
2268
|
}
|
|
2225
|
-
if ((
|
|
2269
|
+
if ((s = n.eventTypes) != null && s.length && !n.eventTypes.includes(a.eventType) || (i = n.riskLevels) != null && i.length && !n.riskLevels.includes(a.riskLevel) || n.userId && a.userId !== n.userId || n.ipAddress && !a.ipAddress.includes(n.ipAddress) || n.country && ((t = a.location) == null ? void 0 : t.country) !== n.country || n.successOnly && !a.success || n.failedOnly && a.success)
|
|
2226
2270
|
return !1;
|
|
2227
|
-
if (
|
|
2228
|
-
const r =
|
|
2271
|
+
if (n.searchQuery) {
|
|
2272
|
+
const r = n.searchQuery.toLowerCase();
|
|
2229
2273
|
if (![
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
(l =
|
|
2235
|
-
(h =
|
|
2274
|
+
a.userName,
|
|
2275
|
+
a.userEmail,
|
|
2276
|
+
a.userId,
|
|
2277
|
+
a.ipAddress,
|
|
2278
|
+
(l = a.location) == null ? void 0 : l.city,
|
|
2279
|
+
(h = a.location) == null ? void 0 : h.country
|
|
2236
2280
|
].filter(Boolean).join(" ").toLowerCase().includes(r))
|
|
2237
2281
|
return !1;
|
|
2238
2282
|
}
|
|
2239
2283
|
return !0;
|
|
2240
|
-
},
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
(
|
|
2300
|
-
P(
|
|
2301
|
-
},
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2284
|
+
}, ra = /* @__PURE__ */ Object.assign(
|
|
2285
|
+
/* @__PURE__ */ le(
|
|
2286
|
+
function(n, s) {
|
|
2287
|
+
var K, Q;
|
|
2288
|
+
const { t: i } = W(), {
|
|
2289
|
+
entries: t = Wc,
|
|
2290
|
+
filter: l = {},
|
|
2291
|
+
stats: h,
|
|
2292
|
+
realtime: r = !1,
|
|
2293
|
+
pollingInterval: o = 3e4,
|
|
2294
|
+
showMap: w = !1,
|
|
2295
|
+
showStats: _ = !0,
|
|
2296
|
+
showDetails: I = !0,
|
|
2297
|
+
pageSize: C = 50,
|
|
2298
|
+
labels: z,
|
|
2299
|
+
loading: F = !1,
|
|
2300
|
+
onFilterChange: U,
|
|
2301
|
+
onExport: L,
|
|
2302
|
+
onEntrySelect: Y,
|
|
2303
|
+
onBlockIP: ce,
|
|
2304
|
+
onRefresh: $,
|
|
2305
|
+
className: q = "",
|
|
2306
|
+
...E
|
|
2307
|
+
} = n, m = ke(null);
|
|
2308
|
+
Cc();
|
|
2309
|
+
const N = ue(
|
|
2310
|
+
() => ({
|
|
2311
|
+
...oe,
|
|
2312
|
+
...z,
|
|
2313
|
+
eventTypes: { ...oe.eventTypes, ...z == null ? void 0 : z.eventTypes },
|
|
2314
|
+
riskLevels: { ...oe.riskLevels, ...z == null ? void 0 : z.riskLevels },
|
|
2315
|
+
deviceTypes: { ...oe.deviceTypes, ...z == null ? void 0 : z.deviceTypes },
|
|
2316
|
+
columns: { ...oe.columns, ...z == null ? void 0 : z.columns }
|
|
2317
|
+
}),
|
|
2318
|
+
[z]
|
|
2319
|
+
), [g, V] = k(l), [u, B] = k(null), [O, P] = k(C), [x, H] = k(!1), [j, b] = k("table"), S = ue(() => t.filter((d) => Zc(d, g)), [t, g]), A = ue(() => S.slice(0, O), [S, O]), J = ue(() => {
|
|
2320
|
+
if (h)
|
|
2321
|
+
return h;
|
|
2322
|
+
const d = new Set(t.map((y) => y.ipAddress)), p = new Set(t.map((y) => {
|
|
2323
|
+
var ee;
|
|
2324
|
+
return (ee = y.location) == null ? void 0 : ee.country;
|
|
2325
|
+
}).filter(Boolean));
|
|
2326
|
+
return {
|
|
2327
|
+
totalEvents: t.length,
|
|
2328
|
+
successfulLogins: t.filter((y) => y.eventType === "login_success").length,
|
|
2329
|
+
failedLogins: t.filter((y) => y.eventType === "login_failed").length,
|
|
2330
|
+
uniqueIPs: d.size,
|
|
2331
|
+
uniqueCountries: p.size,
|
|
2332
|
+
highRiskEvents: t.filter(
|
|
2333
|
+
(y) => y.riskLevel === "high" || y.riskLevel === "critical"
|
|
2334
|
+
).length,
|
|
2335
|
+
suspiciousActivities: t.filter((y) => y.eventType === "suspicious_activity").length
|
|
2336
|
+
};
|
|
2337
|
+
}, [t, h]), f = R(
|
|
2338
|
+
(d) => {
|
|
2339
|
+
const p = { ...g, ...d };
|
|
2340
|
+
V(p), P(C), U == null || U(p);
|
|
2341
|
+
},
|
|
2342
|
+
[g, U, C]
|
|
2343
|
+
), T = R(() => {
|
|
2344
|
+
V({}), P(C), U == null || U({});
|
|
2345
|
+
}, [U, C]), X = R(
|
|
2346
|
+
(d) => {
|
|
2347
|
+
B(d), Y == null || Y(d);
|
|
2348
|
+
},
|
|
2349
|
+
[Y]
|
|
2350
|
+
), Z = R(
|
|
2351
|
+
(d) => {
|
|
2352
|
+
L == null || L(d);
|
|
2353
|
+
},
|
|
2354
|
+
[L]
|
|
2355
|
+
), G = R(() => {
|
|
2356
|
+
$ == null || $();
|
|
2357
|
+
}, [$]), v = R(() => {
|
|
2358
|
+
P((d) => d + C);
|
|
2359
|
+
}, [C]);
|
|
2360
|
+
re(
|
|
2361
|
+
s,
|
|
2362
|
+
() => ({
|
|
2363
|
+
getFilter: () => g,
|
|
2364
|
+
applyFilter: f,
|
|
2365
|
+
clearFilters: T,
|
|
2366
|
+
export: Z,
|
|
2367
|
+
refresh: G,
|
|
2368
|
+
getSelectedEntry: () => u,
|
|
2369
|
+
getElement: () => m.current
|
|
2370
|
+
}),
|
|
2371
|
+
[g, f, T, Z, G, u]
|
|
2372
|
+
);
|
|
2373
|
+
const D = (d) => {
|
|
2374
|
+
var p, y;
|
|
2375
|
+
return /* @__PURE__ */ c(
|
|
2376
|
+
"tr",
|
|
2377
|
+
{
|
|
2378
|
+
className: `nice-accesslog-row ${(u == null ? void 0 : u.id) === d.id ? "nice-accesslog-row--selected" : ""} ${d.success ? "" : "nice-accesslog-row--failed"}`,
|
|
2379
|
+
onClick: () => X(d),
|
|
2380
|
+
children: [
|
|
2381
|
+
/* @__PURE__ */ e("td", { className: "nice-accesslog-cell nice-accesslog-cell--timestamp", children: Ie(d.timestamp) }),
|
|
2382
|
+
/* @__PURE__ */ e("td", { className: "nice-accesslog-cell nice-accesslog-cell--user", children: /* @__PURE__ */ c("div", { className: "nice-accesslog-user", children: [
|
|
2383
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-username", children: d.userName || d.userId }),
|
|
2384
|
+
d.userEmail && /* @__PURE__ */ e("span", { className: "nice-accesslog-email", children: d.userEmail })
|
|
2385
|
+
] }) }),
|
|
2386
|
+
/* @__PURE__ */ e("td", { className: "nice-accesslog-cell nice-accesslog-cell--event", children: /* @__PURE__ */ c("span", { className: `nice-accesslog-event nice-accesslog-event--${d.eventType}`, children: [
|
|
2387
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-event-icon", children: Ne[d.eventType] }),
|
|
2388
|
+
N.eventTypes[d.eventType]
|
|
2389
|
+
] }) }),
|
|
2390
|
+
/* @__PURE__ */ c("td", { className: "nice-accesslog-cell nice-accesslog-cell--ip", children: [
|
|
2391
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-ip", children: d.ipAddress }),
|
|
2392
|
+
ce && /* @__PURE__ */ e(
|
|
2393
|
+
"button",
|
|
2394
|
+
{
|
|
2395
|
+
type: "button",
|
|
2396
|
+
className: "nice-accesslog-block-btn",
|
|
2397
|
+
onClick: (ee) => {
|
|
2398
|
+
ee.stopPropagation(), ce(d.ipAddress);
|
|
2399
|
+
},
|
|
2400
|
+
title: i("accessLog.blockIp", "Block IP"),
|
|
2401
|
+
children: /* @__PURE__ */ e(gc, { size: 14 })
|
|
2402
|
+
}
|
|
2403
|
+
)
|
|
2404
|
+
] }),
|
|
2405
|
+
/* @__PURE__ */ c("td", { className: "nice-accesslog-cell nice-accesslog-cell--location", children: [
|
|
2406
|
+
((p = d.location) == null ? void 0 : p.countryCode) && /* @__PURE__ */ e("span", { className: "nice-accesslog-flag", children: /* @__PURE__ */ e(vc, { size: 14 }) }),
|
|
2407
|
+
Oe(d.location)
|
|
2408
|
+
] }),
|
|
2409
|
+
/* @__PURE__ */ e("td", { className: "nice-accesslog-cell nice-accesslog-cell--device", children: /* @__PURE__ */ c("span", { className: "nice-accesslog-device", children: [
|
|
2410
|
+
Ae[((y = d.device) == null ? void 0 : y.type) || "unknown"],
|
|
2411
|
+
Xc(d.device)
|
|
2412
|
+
] }) }),
|
|
2413
|
+
/* @__PURE__ */ e("td", { className: "nice-accesslog-cell nice-accesslog-cell--risk", children: /* @__PURE__ */ c(
|
|
2414
|
+
"span",
|
|
2347
2415
|
{
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
children: /* @__PURE__ */ e(uc, { size: 14 })
|
|
2416
|
+
className: `nice-accesslog-risk nice-accesslog-risk--${d.riskLevel}`,
|
|
2417
|
+
style: { "--risk-color": Pe(d.riskScore) },
|
|
2418
|
+
children: [
|
|
2419
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-risk-score", children: d.riskScore }),
|
|
2420
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-risk-label", children: N.riskLevels[d.riskLevel] })
|
|
2421
|
+
]
|
|
2355
2422
|
}
|
|
2356
|
-
)
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
) }),
|
|
2377
|
-
/* @__PURE__ */ e("td", { className: "nice-accesslog-cell nice-accesslog-cell--status", children: /* @__PURE__ */ e(
|
|
2378
|
-
"span",
|
|
2423
|
+
) }),
|
|
2424
|
+
/* @__PURE__ */ e("td", { className: "nice-accesslog-cell nice-accesslog-cell--status", children: /* @__PURE__ */ e(
|
|
2425
|
+
"span",
|
|
2426
|
+
{
|
|
2427
|
+
className: `nice-accesslog-status ${d.success ? "nice-accesslog-status--success" : "nice-accesslog-status--failed"}`,
|
|
2428
|
+
children: d.success ? /* @__PURE__ */ e(se, { size: 14 }) : /* @__PURE__ */ e(he, { size: 14 })
|
|
2429
|
+
}
|
|
2430
|
+
) })
|
|
2431
|
+
]
|
|
2432
|
+
},
|
|
2433
|
+
d.id
|
|
2434
|
+
);
|
|
2435
|
+
}, M = (d) => /* @__PURE__ */ c(
|
|
2436
|
+
"div",
|
|
2437
|
+
{
|
|
2438
|
+
className: `nice-accesslog-timeline-item nice-accesslog-timeline-item--${d.riskLevel}`,
|
|
2439
|
+
onClick: () => X(d),
|
|
2440
|
+
children: [
|
|
2441
|
+
/* @__PURE__ */ e(
|
|
2442
|
+
"div",
|
|
2379
2443
|
{
|
|
2380
|
-
className:
|
|
2381
|
-
|
|
2444
|
+
className: "nice-accesslog-timeline-marker",
|
|
2445
|
+
style: { background: de[d.riskLevel] }
|
|
2382
2446
|
}
|
|
2383
|
-
)
|
|
2447
|
+
),
|
|
2448
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-timeline-content", children: [
|
|
2449
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-timeline-header", children: [
|
|
2450
|
+
/* @__PURE__ */ c("span", { className: "nice-accesslog-timeline-event", children: [
|
|
2451
|
+
Ne[d.eventType],
|
|
2452
|
+
" ",
|
|
2453
|
+
N.eventTypes[d.eventType]
|
|
2454
|
+
] }),
|
|
2455
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-timeline-time", children: Ie(d.timestamp) })
|
|
2456
|
+
] }),
|
|
2457
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-timeline-details", children: [
|
|
2458
|
+
/* @__PURE__ */ e("span", { children: d.userName || d.userId }),
|
|
2459
|
+
/* @__PURE__ */ e("span", { children: "•" }),
|
|
2460
|
+
/* @__PURE__ */ e("span", { children: d.ipAddress }),
|
|
2461
|
+
/* @__PURE__ */ e("span", { children: "•" }),
|
|
2462
|
+
/* @__PURE__ */ e("span", { children: Oe(d.location) })
|
|
2463
|
+
] }),
|
|
2464
|
+
d.flags && d.flags.length > 0 && /* @__PURE__ */ e("div", { className: "nice-accesslog-timeline-flags", children: d.flags.map((p, y) => /* @__PURE__ */ e("span", { className: "nice-accesslog-flag-badge", children: p }, y)) })
|
|
2465
|
+
] })
|
|
2384
2466
|
]
|
|
2385
2467
|
},
|
|
2386
|
-
|
|
2468
|
+
d.id
|
|
2387
2469
|
);
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
/* @__PURE__ */ e(
|
|
2395
|
-
"div",
|
|
2396
|
-
{
|
|
2397
|
-
className: "nice-accesslog-timeline-marker",
|
|
2398
|
-
style: { background: re[o.riskLevel] }
|
|
2399
|
-
}
|
|
2400
|
-
),
|
|
2401
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-timeline-content", children: [
|
|
2402
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-timeline-header", children: [
|
|
2403
|
-
/* @__PURE__ */ c("span", { className: "nice-accesslog-timeline-event", children: [
|
|
2404
|
-
ve[o.eventType],
|
|
2405
|
-
" ",
|
|
2406
|
-
k.eventTypes[o.eventType]
|
|
2407
|
-
] }),
|
|
2408
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-timeline-time", children: Le(o.timestamp) })
|
|
2409
|
-
] }),
|
|
2410
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-timeline-details", children: [
|
|
2411
|
-
/* @__PURE__ */ e("span", { children: o.userName || o.userId }),
|
|
2412
|
-
/* @__PURE__ */ e("span", { children: "•" }),
|
|
2413
|
-
/* @__PURE__ */ e("span", { children: o.ipAddress }),
|
|
2414
|
-
/* @__PURE__ */ e("span", { children: "•" }),
|
|
2415
|
-
/* @__PURE__ */ e("span", { children: Ae(o.location) })
|
|
2416
|
-
] }),
|
|
2417
|
-
o.flags && o.flags.length > 0 && /* @__PURE__ */ e("div", { className: "nice-accesslog-timeline-flags", children: o.flags.map((d, f) => /* @__PURE__ */ e("span", { className: "nice-accesslog-flag-badge", children: d }, f)) })
|
|
2418
|
-
] })
|
|
2419
|
-
]
|
|
2420
|
-
},
|
|
2421
|
-
o.id
|
|
2422
|
-
);
|
|
2423
|
-
return /* @__PURE__ */ c("div", { ref: m, className: `nice-accesslog ${U}`, ...B, children: [
|
|
2424
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-header", children: [
|
|
2425
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-header-left", children: [
|
|
2426
|
-
/* @__PURE__ */ e("h2", { className: "nice-accesslog-title", children: k.title }),
|
|
2427
|
-
h && /* @__PURE__ */ c("span", { className: "nice-accesslog-realtime-badge", children: [
|
|
2428
|
-
/* @__PURE__ */ e(Ce, { size: 10 }),
|
|
2429
|
-
" Live"
|
|
2430
|
-
] })
|
|
2431
|
-
] }),
|
|
2432
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-header-actions", children: [
|
|
2433
|
-
/* @__PURE__ */ c(
|
|
2434
|
-
"button",
|
|
2435
|
-
{
|
|
2436
|
-
type: "button",
|
|
2437
|
-
className: "nice-accesslog-btn",
|
|
2438
|
-
onClick: Q,
|
|
2439
|
-
disabled: J,
|
|
2440
|
-
children: [
|
|
2441
|
-
/* @__PURE__ */ e(Ne, { size: 16 }),
|
|
2442
|
-
" ",
|
|
2443
|
-
k.refresh
|
|
2444
|
-
]
|
|
2445
|
-
}
|
|
2446
|
-
),
|
|
2447
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-export-dropdown", children: [
|
|
2448
|
-
/* @__PURE__ */ c("button", { type: "button", className: "nice-accesslog-btn", children: [
|
|
2449
|
-
/* @__PURE__ */ e(me, { size: 16 }),
|
|
2470
|
+
return /* @__PURE__ */ c("div", { ref: m, className: `nice-accesslog ${q}`, ...E, children: [
|
|
2471
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-header", children: [
|
|
2472
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-header-left", children: [
|
|
2473
|
+
/* @__PURE__ */ e("h2", { className: "nice-accesslog-title", children: N.title }),
|
|
2474
|
+
r && /* @__PURE__ */ c("span", { className: "nice-accesslog-realtime-badge", children: [
|
|
2475
|
+
/* @__PURE__ */ e(De, { size: 10 }),
|
|
2450
2476
|
" ",
|
|
2451
|
-
|
|
2452
|
-
] }),
|
|
2453
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-export-menu", children: [
|
|
2454
|
-
/* @__PURE__ */ e("button", { onClick: () => F("csv"), children: "CSV" }),
|
|
2455
|
-
/* @__PURE__ */ e("button", { onClick: () => F("json"), children: "JSON" }),
|
|
2456
|
-
/* @__PURE__ */ e("button", { onClick: () => F("pdf"), children: "PDF" })
|
|
2477
|
+
i("accessLog.live", "Live")
|
|
2457
2478
|
] })
|
|
2458
|
-
] })
|
|
2459
|
-
] })
|
|
2460
|
-
] }),
|
|
2461
|
-
T && /* @__PURE__ */ c("div", { className: "nice-accesslog-stats", children: [
|
|
2462
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-stat", children: [
|
|
2463
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: V.totalEvents }),
|
|
2464
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: "Total Events" })
|
|
2465
|
-
] }),
|
|
2466
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-stat nice-accesslog-stat--success", children: [
|
|
2467
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: V.successfulLogins }),
|
|
2468
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: "Successful" })
|
|
2469
|
-
] }),
|
|
2470
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-stat nice-accesslog-stat--failed", children: [
|
|
2471
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: V.failedLogins }),
|
|
2472
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: "Failed" })
|
|
2473
|
-
] }),
|
|
2474
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-stat", children: [
|
|
2475
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: V.uniqueIPs }),
|
|
2476
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: "Unique IPs" })
|
|
2477
|
-
] }),
|
|
2478
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-stat", children: [
|
|
2479
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: V.uniqueCountries }),
|
|
2480
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: "Countries" })
|
|
2481
|
-
] }),
|
|
2482
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-stat nice-accesslog-stat--warning", children: [
|
|
2483
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: V.highRiskEvents }),
|
|
2484
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: "High Risk" })
|
|
2485
|
-
] })
|
|
2486
|
-
] }),
|
|
2487
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-filters", children: [
|
|
2488
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-filters-row", children: [
|
|
2489
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-search", children: [
|
|
2490
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-search-icon", children: /* @__PURE__ */ e(pe, { size: 16 }) }),
|
|
2491
|
-
/* @__PURE__ */ e(
|
|
2492
|
-
"input",
|
|
2493
|
-
{
|
|
2494
|
-
type: "text",
|
|
2495
|
-
placeholder: k.search,
|
|
2496
|
-
value: g.searchQuery || "",
|
|
2497
|
-
onChange: (o) => b({ searchQuery: o.target.value })
|
|
2498
|
-
}
|
|
2499
|
-
)
|
|
2500
2479
|
] }),
|
|
2501
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-
|
|
2502
|
-
/* @__PURE__ */
|
|
2480
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-header-actions", children: [
|
|
2481
|
+
/* @__PURE__ */ c(
|
|
2503
2482
|
"button",
|
|
2504
2483
|
{
|
|
2505
2484
|
type: "button",
|
|
2506
|
-
className:
|
|
2507
|
-
onClick:
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
type: "button",
|
|
2515
|
-
className: `nice-accesslog-filter-chip ${(H = g.riskLevels) != null && H.includes("high") || (X = g.riskLevels) != null && X.includes("critical") ? "nice-accesslog-filter-chip--active" : ""}`,
|
|
2516
|
-
onClick: () => {
|
|
2517
|
-
var o;
|
|
2518
|
-
return b({
|
|
2519
|
-
riskLevels: (o = g.riskLevels) != null && o.includes("high") ? [] : ["high", "critical"]
|
|
2520
|
-
});
|
|
2521
|
-
},
|
|
2522
|
-
children: "High Risk"
|
|
2485
|
+
className: "nice-accesslog-btn",
|
|
2486
|
+
onClick: G,
|
|
2487
|
+
disabled: F,
|
|
2488
|
+
children: [
|
|
2489
|
+
/* @__PURE__ */ e(ye, { size: 16 }),
|
|
2490
|
+
" ",
|
|
2491
|
+
N.refresh
|
|
2492
|
+
]
|
|
2523
2493
|
}
|
|
2524
2494
|
),
|
|
2525
|
-
/* @__PURE__ */
|
|
2526
|
-
"button",
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
] })
|
|
2538
|
-
}
|
|
2539
|
-
)
|
|
2495
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-export-dropdown", children: [
|
|
2496
|
+
/* @__PURE__ */ c("button", { type: "button", className: "nice-accesslog-btn", children: [
|
|
2497
|
+
/* @__PURE__ */ e(ve, { size: 16 }),
|
|
2498
|
+
" ",
|
|
2499
|
+
N.export
|
|
2500
|
+
] }),
|
|
2501
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-export-menu", children: [
|
|
2502
|
+
/* @__PURE__ */ e("button", { onClick: () => Z("csv"), children: "CSV" }),
|
|
2503
|
+
/* @__PURE__ */ e("button", { onClick: () => Z("json"), children: i("accessLog.json", "JSON") }),
|
|
2504
|
+
/* @__PURE__ */ e("button", { onClick: () => Z("pdf"), children: "PDF" })
|
|
2505
|
+
] })
|
|
2506
|
+
] })
|
|
2540
2507
|
] })
|
|
2541
2508
|
] }),
|
|
2542
|
-
|
|
2543
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-
|
|
2544
|
-
/* @__PURE__ */ e("
|
|
2545
|
-
/* @__PURE__ */ e(
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2509
|
+
_ && /* @__PURE__ */ c("div", { className: "nice-accesslog-stats", children: [
|
|
2510
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-stat", children: [
|
|
2511
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: J.totalEvents }),
|
|
2512
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: i("accessLog.totalEvents", "Total Events") })
|
|
2513
|
+
] }),
|
|
2514
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-stat nice-accesslog-stat--success", children: [
|
|
2515
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: J.successfulLogins }),
|
|
2516
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: i("accessLog.successful", "Successful") })
|
|
2517
|
+
] }),
|
|
2518
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-stat nice-accesslog-stat--failed", children: [
|
|
2519
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: J.failedLogins }),
|
|
2520
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: i("accessLog.failed", "Failed") })
|
|
2521
|
+
] }),
|
|
2522
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-stat", children: [
|
|
2523
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: J.uniqueIPs }),
|
|
2524
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: i("accessLog.uniqueIps", "Unique IPs") })
|
|
2525
|
+
] }),
|
|
2526
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-stat", children: [
|
|
2527
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: J.uniqueCountries }),
|
|
2528
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: i("accessLog.countries", "Countries") })
|
|
2560
2529
|
] }),
|
|
2561
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-
|
|
2562
|
-
/* @__PURE__ */ e("
|
|
2563
|
-
/* @__PURE__ */
|
|
2530
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-stat nice-accesslog-stat--warning", children: [
|
|
2531
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-value", children: J.highRiskEvents }),
|
|
2532
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-stat-label", children: i("accessLog.highRisk", "High Risk") })
|
|
2533
|
+
] })
|
|
2534
|
+
] }),
|
|
2535
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-filters", children: [
|
|
2536
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-filters-row", children: [
|
|
2537
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-search", children: [
|
|
2538
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-search-icon", children: /* @__PURE__ */ e(ge, { size: 16 }) }),
|
|
2564
2539
|
/* @__PURE__ */ e(
|
|
2565
2540
|
"input",
|
|
2566
2541
|
{
|
|
2567
|
-
type: "
|
|
2568
|
-
|
|
2569
|
-
|
|
2542
|
+
type: "text",
|
|
2543
|
+
placeholder: N.search,
|
|
2544
|
+
value: g.searchQuery || "",
|
|
2545
|
+
onChange: (d) => f({ searchQuery: d.target.value })
|
|
2546
|
+
}
|
|
2547
|
+
)
|
|
2548
|
+
] }),
|
|
2549
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-filter-quick", children: [
|
|
2550
|
+
/* @__PURE__ */ e(
|
|
2551
|
+
"button",
|
|
2552
|
+
{
|
|
2553
|
+
type: "button",
|
|
2554
|
+
className: `nice-accesslog-filter-chip ${g.failedOnly ? "nice-accesslog-filter-chip--active" : ""}`,
|
|
2555
|
+
onClick: () => f({ failedOnly: !g.failedOnly, successOnly: !1 }),
|
|
2556
|
+
children: i("accessLog.failedOnly", "Failed Only")
|
|
2570
2557
|
}
|
|
2571
2558
|
),
|
|
2572
|
-
/* @__PURE__ */ e("span", { children: "to" }),
|
|
2573
2559
|
/* @__PURE__ */ e(
|
|
2574
|
-
"
|
|
2560
|
+
"button",
|
|
2575
2561
|
{
|
|
2576
|
-
type: "
|
|
2577
|
-
|
|
2578
|
-
|
|
2562
|
+
type: "button",
|
|
2563
|
+
className: `nice-accesslog-filter-chip ${(K = g.riskLevels) != null && K.includes("high") || (Q = g.riskLevels) != null && Q.includes("critical") ? "nice-accesslog-filter-chip--active" : ""}`,
|
|
2564
|
+
onClick: () => {
|
|
2565
|
+
var d;
|
|
2566
|
+
return f({
|
|
2567
|
+
riskLevels: (d = g.riskLevels) != null && d.includes("high") ? [] : ["high", "critical"]
|
|
2568
|
+
});
|
|
2569
|
+
},
|
|
2570
|
+
children: i("accessLog.highRisk", "High Risk")
|
|
2571
|
+
}
|
|
2572
|
+
),
|
|
2573
|
+
/* @__PURE__ */ e(
|
|
2574
|
+
"button",
|
|
2575
|
+
{
|
|
2576
|
+
type: "button",
|
|
2577
|
+
className: "nice-accesslog-filter-toggle",
|
|
2578
|
+
onClick: () => H(!x),
|
|
2579
|
+
children: x ? /* @__PURE__ */ c(ae, { children: [
|
|
2580
|
+
/* @__PURE__ */ e(pc, { size: 14 }),
|
|
2581
|
+
" ",
|
|
2582
|
+
i("accessLog.less", "Less")
|
|
2583
|
+
] }) : /* @__PURE__ */ c(ae, { children: [
|
|
2584
|
+
/* @__PURE__ */ e(Te, { size: 14 }),
|
|
2585
|
+
" ",
|
|
2586
|
+
i("accessLog.more", "More")
|
|
2587
|
+
] })
|
|
2579
2588
|
}
|
|
2580
2589
|
)
|
|
2581
2590
|
] })
|
|
2582
2591
|
] }),
|
|
2583
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-
|
|
2584
|
-
/* @__PURE__ */
|
|
2592
|
+
x && /* @__PURE__ */ c("div", { className: "nice-accesslog-filters-expanded", children: [
|
|
2593
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-filter-group", children: [
|
|
2594
|
+
/* @__PURE__ */ e("label", { children: i("accessLog.eventType", "Event Type") }),
|
|
2595
|
+
/* @__PURE__ */ e(
|
|
2596
|
+
"select",
|
|
2597
|
+
{
|
|
2598
|
+
multiple: !0,
|
|
2599
|
+
value: g.eventTypes || [],
|
|
2600
|
+
onChange: (d) => {
|
|
2601
|
+
const p = Array.from(
|
|
2602
|
+
d.target.selectedOptions,
|
|
2603
|
+
(y) => y.value
|
|
2604
|
+
);
|
|
2605
|
+
f({ eventTypes: p.length ? p : void 0 });
|
|
2606
|
+
},
|
|
2607
|
+
children: Object.entries(N.eventTypes).map(([d, p]) => /* @__PURE__ */ e("option", { value: d, children: p }, d))
|
|
2608
|
+
}
|
|
2609
|
+
)
|
|
2610
|
+
] }),
|
|
2611
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-filter-group", children: [
|
|
2612
|
+
/* @__PURE__ */ e("label", { children: i("accessLog.dateRange", "Date Range") }),
|
|
2613
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-date-range", children: [
|
|
2614
|
+
/* @__PURE__ */ e(
|
|
2615
|
+
"input",
|
|
2616
|
+
{
|
|
2617
|
+
type: "date",
|
|
2618
|
+
value: g.startDate ? new Date(g.startDate).toISOString().split("T")[0] : "",
|
|
2619
|
+
onChange: (d) => f({ startDate: d.target.value || void 0 })
|
|
2620
|
+
}
|
|
2621
|
+
),
|
|
2622
|
+
/* @__PURE__ */ e("span", { children: "to" }),
|
|
2623
|
+
/* @__PURE__ */ e(
|
|
2624
|
+
"input",
|
|
2625
|
+
{
|
|
2626
|
+
type: "date",
|
|
2627
|
+
value: g.endDate ? new Date(g.endDate).toISOString().split("T")[0] : "",
|
|
2628
|
+
onChange: (d) => f({ endDate: d.target.value || void 0 })
|
|
2629
|
+
}
|
|
2630
|
+
)
|
|
2631
|
+
] })
|
|
2632
|
+
] }),
|
|
2633
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-filter-group", children: [
|
|
2634
|
+
/* @__PURE__ */ e("label", { children: i("accessLog.ipAddress", "IP Address") }),
|
|
2635
|
+
/* @__PURE__ */ e(
|
|
2636
|
+
"input",
|
|
2637
|
+
{
|
|
2638
|
+
type: "text",
|
|
2639
|
+
placeholder: "e.g., 192.168",
|
|
2640
|
+
value: g.ipAddress || "",
|
|
2641
|
+
onChange: (d) => f({ ipAddress: d.target.value || void 0 })
|
|
2642
|
+
}
|
|
2643
|
+
)
|
|
2644
|
+
] }),
|
|
2585
2645
|
/* @__PURE__ */ e(
|
|
2586
|
-
"
|
|
2646
|
+
"button",
|
|
2587
2647
|
{
|
|
2588
|
-
type: "
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2648
|
+
type: "button",
|
|
2649
|
+
className: "nice-accesslog-clear-filters",
|
|
2650
|
+
onClick: T,
|
|
2651
|
+
children: i("accessLog.clearAllFilters", "Clear All Filters")
|
|
2592
2652
|
}
|
|
2593
2653
|
)
|
|
2594
|
-
] })
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
] })
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
"
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
/* @__PURE__ */
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2654
|
+
] })
|
|
2655
|
+
] }),
|
|
2656
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-tabs", children: [
|
|
2657
|
+
/* @__PURE__ */ c(
|
|
2658
|
+
"button",
|
|
2659
|
+
{
|
|
2660
|
+
type: "button",
|
|
2661
|
+
className: `nice-accesslog-tab ${j === "table" ? "nice-accesslog-tab--active" : ""}`,
|
|
2662
|
+
onClick: () => b("table"),
|
|
2663
|
+
children: [
|
|
2664
|
+
/* @__PURE__ */ e(uc, { size: 16 }),
|
|
2665
|
+
" ",
|
|
2666
|
+
i("accessLog.table", "Table")
|
|
2667
|
+
]
|
|
2668
|
+
}
|
|
2669
|
+
),
|
|
2670
|
+
/* @__PURE__ */ c(
|
|
2671
|
+
"button",
|
|
2672
|
+
{
|
|
2673
|
+
type: "button",
|
|
2674
|
+
className: `nice-accesslog-tab ${j === "timeline" ? "nice-accesslog-tab--active" : ""}`,
|
|
2675
|
+
onClick: () => b("timeline"),
|
|
2676
|
+
children: [
|
|
2677
|
+
/* @__PURE__ */ e(mc, { size: 16 }),
|
|
2678
|
+
" ",
|
|
2679
|
+
N.timeline
|
|
2680
|
+
]
|
|
2681
|
+
}
|
|
2682
|
+
),
|
|
2683
|
+
w && /* @__PURE__ */ c(
|
|
2684
|
+
"button",
|
|
2685
|
+
{
|
|
2686
|
+
type: "button",
|
|
2687
|
+
className: `nice-accesslog-tab ${j === "map" ? "nice-accesslog-tab--active" : ""}`,
|
|
2688
|
+
onClick: () => b("map"),
|
|
2689
|
+
children: [
|
|
2690
|
+
/* @__PURE__ */ e(Ee, { size: 16 }),
|
|
2691
|
+
" ",
|
|
2692
|
+
N.map
|
|
2693
|
+
]
|
|
2694
|
+
}
|
|
2695
|
+
),
|
|
2696
|
+
/* @__PURE__ */ c("span", { className: "nice-accesslog-count", children: [
|
|
2697
|
+
S.length,
|
|
2698
|
+
" entries"
|
|
2699
|
+
] })
|
|
2700
|
+
] }),
|
|
2701
|
+
/* @__PURE__ */ e("div", { className: "nice-accesslog-content", children: F ? /* @__PURE__ */ c("div", { className: "nice-accesslog-loading", children: [
|
|
2702
|
+
/* @__PURE__ */ e("div", { className: "nice-accesslog-spinner" }),
|
|
2703
|
+
i("accessLog.loadingAccessLogs", "Loading access logs...")
|
|
2704
|
+
] }) : S.length === 0 ? /* @__PURE__ */ c("div", { className: "nice-accesslog-empty", children: [
|
|
2705
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-empty-icon", children: /* @__PURE__ */ e(He, { size: 32 }) }),
|
|
2706
|
+
/* @__PURE__ */ e("span", { children: N.noResults })
|
|
2707
|
+
] }) : /* @__PURE__ */ c(ae, { children: [
|
|
2708
|
+
j === "table" && /* @__PURE__ */ e("div", { className: "nice-accesslog-table-wrapper", children: /* @__PURE__ */ c("table", { className: "nice-accesslog-table", children: [
|
|
2709
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ c("tr", { children: [
|
|
2710
|
+
/* @__PURE__ */ e("th", { children: N.columns.timestamp }),
|
|
2711
|
+
/* @__PURE__ */ e("th", { children: N.columns.user }),
|
|
2712
|
+
/* @__PURE__ */ e("th", { children: N.columns.event }),
|
|
2713
|
+
/* @__PURE__ */ e("th", { children: N.columns.ip }),
|
|
2714
|
+
/* @__PURE__ */ e("th", { children: N.columns.location }),
|
|
2715
|
+
/* @__PURE__ */ e("th", { children: N.columns.device }),
|
|
2716
|
+
/* @__PURE__ */ e("th", { children: N.columns.risk }),
|
|
2717
|
+
/* @__PURE__ */ e("th", { children: N.columns.status })
|
|
2718
|
+
] }) }),
|
|
2719
|
+
/* @__PURE__ */ e("tbody", { children: A.map(D) })
|
|
2659
2720
|
] }) }),
|
|
2660
|
-
/* @__PURE__ */ e("
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
z.length - A,
|
|
2671
|
-
" remaining)"
|
|
2672
|
-
] })
|
|
2673
|
-
] }) }),
|
|
2674
|
-
E && p && /* @__PURE__ */ c("div", { className: "nice-accesslog-detail", children: [
|
|
2675
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-detail-header", children: [
|
|
2676
|
-
/* @__PURE__ */ e("h3", { children: k.details }),
|
|
2677
|
-
/* @__PURE__ */ e(
|
|
2721
|
+
j === "timeline" && /* @__PURE__ */ e("div", { className: "nice-accesslog-timeline", children: A.map(M) }),
|
|
2722
|
+
j === "map" && /* @__PURE__ */ e("div", { className: "nice-accesslog-map", children: /* @__PURE__ */ c("div", { className: "nice-accesslog-map-placeholder", children: [
|
|
2723
|
+
/* @__PURE__ */ e(Ee, { size: 16 }),
|
|
2724
|
+
" ",
|
|
2725
|
+
i(
|
|
2726
|
+
"accessLog.geographicVisualizationWouldRenderHere",
|
|
2727
|
+
"Geographic visualization would render here"
|
|
2728
|
+
)
|
|
2729
|
+
] }) }),
|
|
2730
|
+
O < S.length && /* @__PURE__ */ c(
|
|
2678
2731
|
"button",
|
|
2679
2732
|
{
|
|
2680
2733
|
type: "button",
|
|
2681
|
-
className: "nice-accesslog-
|
|
2682
|
-
onClick:
|
|
2683
|
-
children:
|
|
2734
|
+
className: "nice-accesslog-show-more",
|
|
2735
|
+
onClick: v,
|
|
2736
|
+
children: [
|
|
2737
|
+
N.showMore,
|
|
2738
|
+
" (",
|
|
2739
|
+
S.length - O,
|
|
2740
|
+
" remaining)"
|
|
2741
|
+
]
|
|
2684
2742
|
}
|
|
2685
2743
|
)
|
|
2686
|
-
] }),
|
|
2687
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-detail
|
|
2688
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-detail-
|
|
2689
|
-
/* @__PURE__ */ e("
|
|
2690
|
-
/* @__PURE__ */ e(
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
p.userName,
|
|
2700
|
-
" (",
|
|
2701
|
-
p.userId,
|
|
2702
|
-
")",
|
|
2703
|
-
p.userEmail && /* @__PURE__ */ e("div", { children: p.userEmail })
|
|
2704
|
-
] })
|
|
2705
|
-
] }),
|
|
2706
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
|
|
2707
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: "Event Type" }),
|
|
2708
|
-
/* @__PURE__ */ c("span", { className: "nice-accesslog-detail-value", children: [
|
|
2709
|
-
ve[p.eventType],
|
|
2710
|
-
" ",
|
|
2711
|
-
k.eventTypes[p.eventType]
|
|
2712
|
-
] })
|
|
2713
|
-
] }),
|
|
2714
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
|
|
2715
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: "IP Address" }),
|
|
2716
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-value", children: p.ipAddress })
|
|
2744
|
+
] }) }),
|
|
2745
|
+
I && u && /* @__PURE__ */ c("div", { className: "nice-accesslog-detail", children: [
|
|
2746
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-detail-header", children: [
|
|
2747
|
+
/* @__PURE__ */ e("h3", { children: N.details }),
|
|
2748
|
+
/* @__PURE__ */ e(
|
|
2749
|
+
"button",
|
|
2750
|
+
{
|
|
2751
|
+
type: "button",
|
|
2752
|
+
className: "nice-accesslog-detail-close",
|
|
2753
|
+
onClick: () => B(null),
|
|
2754
|
+
children: /* @__PURE__ */ e(be, { size: 16 })
|
|
2755
|
+
}
|
|
2756
|
+
)
|
|
2717
2757
|
] }),
|
|
2718
|
-
|
|
2719
|
-
/* @__PURE__ */
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
",",
|
|
2725
|
-
" ",
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2758
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-detail-content", children: [
|
|
2759
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
|
|
2760
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.eventId", "Event ID") }),
|
|
2761
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-value", children: u.id })
|
|
2762
|
+
] }),
|
|
2763
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
|
|
2764
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.timestamp", "Timestamp") }),
|
|
2765
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-value", children: new Date(u.timestamp).toISOString() })
|
|
2766
|
+
] }),
|
|
2767
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
|
|
2768
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.user", "User") }),
|
|
2769
|
+
/* @__PURE__ */ c("span", { className: "nice-accesslog-detail-value", children: [
|
|
2770
|
+
u.userName,
|
|
2771
|
+
" (",
|
|
2772
|
+
u.userId,
|
|
2773
|
+
")",
|
|
2774
|
+
u.userEmail && /* @__PURE__ */ e("div", { children: u.userEmail })
|
|
2775
|
+
] })
|
|
2776
|
+
] }),
|
|
2777
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
|
|
2778
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.eventType", "Event Type") }),
|
|
2779
|
+
/* @__PURE__ */ c("span", { className: "nice-accesslog-detail-value", children: [
|
|
2780
|
+
Ne[u.eventType],
|
|
2781
|
+
" ",
|
|
2782
|
+
N.eventTypes[u.eventType]
|
|
2783
|
+
] })
|
|
2784
|
+
] }),
|
|
2785
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
|
|
2786
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.ipAddress", "IP Address") }),
|
|
2787
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-value", children: u.ipAddress })
|
|
2788
|
+
] }),
|
|
2789
|
+
u.location && /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
|
|
2790
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.location", "Location") }),
|
|
2791
|
+
/* @__PURE__ */ c("span", { className: "nice-accesslog-detail-value", children: [
|
|
2792
|
+
u.location.city,
|
|
2730
2793
|
", ",
|
|
2731
|
-
|
|
2732
|
-
"
|
|
2794
|
+
u.location.region,
|
|
2795
|
+
",",
|
|
2796
|
+
" ",
|
|
2797
|
+
u.location.country,
|
|
2798
|
+
u.location.latitude && u.location.longitude && /* @__PURE__ */ c("div", { className: "nice-accesslog-coords", children: [
|
|
2799
|
+
"(",
|
|
2800
|
+
u.location.latitude,
|
|
2801
|
+
", ",
|
|
2802
|
+
u.location.longitude,
|
|
2803
|
+
")"
|
|
2804
|
+
] })
|
|
2733
2805
|
] })
|
|
2734
|
-
] })
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
_e[p.device.type],
|
|
2740
|
-
" ",
|
|
2741
|
-
p.device.os,
|
|
2742
|
-
" ",
|
|
2743
|
-
p.device.osVersion,
|
|
2744
|
-
/* @__PURE__ */ c("div", { children: [
|
|
2745
|
-
p.device.browser,
|
|
2806
|
+
] }),
|
|
2807
|
+
u.device && /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
|
|
2808
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.device", "Device") }),
|
|
2809
|
+
/* @__PURE__ */ c("span", { className: "nice-accesslog-detail-value", children: [
|
|
2810
|
+
Ae[u.device.type],
|
|
2746
2811
|
" ",
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
"
|
|
2751
|
-
|
|
2812
|
+
u.device.os,
|
|
2813
|
+
" ",
|
|
2814
|
+
u.device.osVersion,
|
|
2815
|
+
/* @__PURE__ */ c("div", { children: [
|
|
2816
|
+
u.device.browser,
|
|
2817
|
+
" ",
|
|
2818
|
+
u.device.browserVersion
|
|
2819
|
+
] }),
|
|
2820
|
+
u.device.fingerprint && /* @__PURE__ */ c("div", { className: "nice-accesslog-fingerprint", children: [
|
|
2821
|
+
"Fingerprint: ",
|
|
2822
|
+
u.device.fingerprint
|
|
2823
|
+
] })
|
|
2752
2824
|
] })
|
|
2825
|
+
] }),
|
|
2826
|
+
/* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
|
|
2827
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.riskScore", "Risk Score") }),
|
|
2828
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-value", children: /* @__PURE__ */ c("span", { style: { color: Pe(u.riskScore) }, children: [
|
|
2829
|
+
u.riskScore,
|
|
2830
|
+
"/100 (",
|
|
2831
|
+
N.riskLevels[u.riskLevel],
|
|
2832
|
+
")"
|
|
2833
|
+
] }) })
|
|
2834
|
+
] }),
|
|
2835
|
+
u.flags && u.flags.length > 0 && /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
|
|
2836
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.flags", "Flags") }),
|
|
2837
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-value", children: u.flags.map((d, p) => /* @__PURE__ */ e("span", { className: "nice-accesslog-flag-badge", children: d }, p)) })
|
|
2838
|
+
] }),
|
|
2839
|
+
u.details && Object.keys(u.details).length > 0 && /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
|
|
2840
|
+
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: i("accessLog.additionalDetails", "Additional Details") }),
|
|
2841
|
+
/* @__PURE__ */ e("pre", { className: "nice-accesslog-detail-json", children: JSON.stringify(u.details, null, 2) })
|
|
2753
2842
|
] })
|
|
2754
|
-
] }),
|
|
2755
|
-
/* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
|
|
2756
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: "Risk Score" }),
|
|
2757
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-value", children: /* @__PURE__ */ c("span", { style: { color: Ie(p.riskScore) }, children: [
|
|
2758
|
-
p.riskScore,
|
|
2759
|
-
"/100 (",
|
|
2760
|
-
k.riskLevels[p.riskLevel],
|
|
2761
|
-
")"
|
|
2762
|
-
] }) })
|
|
2763
|
-
] }),
|
|
2764
|
-
p.flags && p.flags.length > 0 && /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
|
|
2765
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: "Flags" }),
|
|
2766
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-value", children: p.flags.map((o, d) => /* @__PURE__ */ e("span", { className: "nice-accesslog-flag-badge", children: o }, d)) })
|
|
2767
|
-
] }),
|
|
2768
|
-
p.details && Object.keys(p.details).length > 0 && /* @__PURE__ */ c("div", { className: "nice-accesslog-detail-row", children: [
|
|
2769
|
-
/* @__PURE__ */ e("span", { className: "nice-accesslog-detail-label", children: "Additional Details" }),
|
|
2770
|
-
/* @__PURE__ */ e("pre", { className: "nice-accesslog-detail-json", children: JSON.stringify(p.details, null, 2) })
|
|
2771
2843
|
] })
|
|
2772
2844
|
] })
|
|
2773
|
-
] })
|
|
2774
|
-
|
|
2775
|
-
|
|
2845
|
+
] });
|
|
2846
|
+
}
|
|
2847
|
+
),
|
|
2848
|
+
{ displayName: "NiceAccessLog" }
|
|
2776
2849
|
);
|
|
2777
|
-
Qc.displayName = "NiceAccessLog";
|
|
2778
2850
|
export {
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2851
|
+
ra as NiceAccessLog,
|
|
2852
|
+
ia as NiceAuditTrail,
|
|
2853
|
+
sa as NiceContractEditor,
|
|
2854
|
+
ta as NiceDataExportCenter,
|
|
2855
|
+
na as NiceGDPRConsent,
|
|
2856
|
+
la as NiceGlobalSearch
|
|
2785
2857
|
};
|