@nice2dev/ui-enterprise 1.2.2 → 1.3.0

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