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