@sito/dashboard-app 0.0.50 → 0.0.52

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.
@@ -1,53 +1,53 @@
1
- var ze = Object.defineProperty;
2
- var Je = (n, e, t) => e in n ? ze(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var x = (n, e, t) => Je(n, typeof e != "symbol" ? e + "" : e, t);
1
+ var et = Object.defineProperty;
2
+ var tt = (n, e, t) => e in n ? et(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var L = (n, e, t) => tt(n, typeof e != "symbol" ? e + "" : e, t);
4
4
  import "./main.css";
5
- import { State as Ye, inputStateClassName as Xe, labelStateClassName as Ze, helperTextStateClassName as et, useTranslation as v, Button as K, Loading as ee, TextInput as tt, FileInput as st, IconButton as nt, Actions as rt, ActionsDropdown as ot, useTableOptions as it, Badge as at, Action as ct } from "@sito/dashboard";
5
+ import { State as st, inputStateClassName as nt, labelStateClassName as rt, helperTextStateClassName as it, useTranslation as N, Button as U, Loading as ne, TextInput as ot, FileInput as at, IconButton as ct, Actions as lt, ActionsDropdown as ut, useTableOptions as dt, Badge as mt, Action as ht } from "@sito/dashboard";
6
6
  export * from "@sito/dashboard";
7
- import { Action as en, Actions as tn, ActionsDropdown as sn, Button as nn } from "@sito/dashboard";
8
- import { jsxs as k, jsx as h, Fragment as oe } from "react/jsx-runtime";
9
- import { FontAwesomeIcon as F } from "@fortawesome/react-fontawesome";
10
- import { forwardRef as xe, useState as A, useCallback as w, useEffect as O, useReducer as Ae, useRef as H, useMemo as Q, createContext as te, useContext as se, useLayoutEffect as lt } from "react";
11
- import { faEyeSlash as ut, faEye as dt, faClose as Le, faTrash as mt, faRotateLeft as _e, faPencil as ht, faCircleNotch as Re, faCloudArrowDown as ft, faCloudUpload as pt, faArrowUp as gt, faArrowLeft as yt, faAdd as Te, faFilter as bt, faBars as wt, faSearch as kt, faCircleCheck as St, faWarning as vt } from "@fortawesome/free-solid-svg-icons";
12
- import { createPortal as Ie } from "react-dom";
13
- import { QueryClient as Ct, QueryClientProvider as Tt, useMutation as ie, useQueryClient as ne, useQuery as Nt } from "@tanstack/react-query";
14
- import { faSadTear as Et } from "@fortawesome/free-regular-svg-icons";
15
- import { useForm as Pe } from "react-hook-form";
16
- const Ne = (n) => n == null ? !1 : `${n}`.length > 0, hs = xe(function(n, e) {
7
+ import { Action as ln, Actions as un, ActionsDropdown as dn, Button as mn } from "@sito/dashboard";
8
+ import { jsxs as k, jsx as f, Fragment as ae } from "react/jsx-runtime";
9
+ import { FontAwesomeIcon as K } from "@fortawesome/react-fontawesome";
10
+ import { forwardRef as Ae, useState as _, useCallback as w, useEffect as O, useReducer as Le, useRef as M, useMemo as Q, createContext as re, useContext as ie, useLayoutEffect as ft } from "react";
11
+ import { faEyeSlash as pt, faEye as gt, faClose as _e, faTrash as yt, faRotateLeft as Re, faPencil as bt, faCircleNotch as Ie, faCloudArrowDown as wt, faCloudUpload as St, faArrowUp as kt, faArrowLeft as vt, faAdd as Ne, faFilter as Ct, faBars as Tt, faSearch as Nt, faCircleCheck as Et, faWarning as $t } from "@fortawesome/free-solid-svg-icons";
12
+ import { createPortal as Fe } from "react-dom";
13
+ import { QueryClient as xt, QueryClientProvider as At, useMutation as Z, useQueryClient as J, useQuery as Oe } from "@tanstack/react-query";
14
+ import { faSadTear as Lt } from "@fortawesome/free-regular-svg-icons";
15
+ import { useForm as Me } from "react-hook-form";
16
+ const Ee = (n) => n == null ? !1 : `${n}`.length > 0, bs = Ae(function(n, e) {
17
17
  const {
18
18
  value: t,
19
19
  defaultValue: s,
20
20
  onChange: r,
21
- state: o = Ye.default,
22
- name: i = "",
21
+ state: i = st.default,
22
+ name: o = "",
23
23
  id: c = "",
24
24
  label: a = "",
25
- disabled: l = !1,
26
- required: d = !1,
27
- containerClassName: u = "",
25
+ disabled: u = !1,
26
+ required: l = !1,
27
+ containerClassName: d = "",
28
28
  inputClassName: m = "",
29
- labelClassName: f = "",
29
+ labelClassName: h = "",
30
30
  helperText: p = "",
31
31
  helperTextClassName: y = "",
32
32
  ...g
33
- } = n, b = t !== void 0, [T, N] = A(
34
- () => Ne(s)
35
- ), C = b ? Ne(t) : T, D = (q) => {
36
- b || N(q.currentTarget.value.length > 0), r == null || r(q);
33
+ } = n, b = t !== void 0, [S, E] = _(
34
+ () => Ee(s)
35
+ ), v = b ? Ee(t) : S, $ = (j) => {
36
+ b || E(j.currentTarget.value.length > 0), r == null || r(j);
37
37
  };
38
- return /* @__PURE__ */ k("div", { className: `form-paragraph-container group ${u}`, children: [
39
- /* @__PURE__ */ h(
38
+ return /* @__PURE__ */ k("div", { className: `form-paragraph-container group ${d}`, children: [
39
+ /* @__PURE__ */ f(
40
40
  "textarea",
41
41
  {
42
42
  ref: e,
43
- name: i,
43
+ name: o,
44
44
  id: c,
45
- className: `text-input text-area form-paragraph-textarea peer ${Xe(o)} ${C ? "has-value" : ""} ${g.placeholder ? "has-placeholder" : ""} ${m}`,
46
- required: d,
45
+ className: `text-input text-area form-paragraph-textarea peer ${nt(i)} ${v ? "has-value" : ""} ${g.placeholder ? "has-placeholder" : ""} ${m}`,
46
+ required: l,
47
47
  defaultValue: s,
48
48
  ...b ? { value: t } : {},
49
- onChange: D,
50
- disabled: l,
49
+ onChange: $,
50
+ disabled: u,
51
51
  ...g
52
52
  }
53
53
  ),
@@ -55,45 +55,45 @@ const Ne = (n) => n == null ? !1 : `${n}`.length > 0, hs = xe(function(n, e) {
55
55
  "label",
56
56
  {
57
57
  htmlFor: c,
58
- className: `text-input-label ${Ze(o)} ${f}`,
58
+ className: `text-input-label ${rt(i)} ${h}`,
59
59
  children: [
60
60
  a,
61
- d ? " *" : ""
61
+ l ? " *" : ""
62
62
  ]
63
63
  }
64
64
  ),
65
- !!p && /* @__PURE__ */ h(
65
+ !!p && /* @__PURE__ */ f(
66
66
  "p",
67
67
  {
68
- className: `text-input-helper-text ${et(o)} ${y}`,
68
+ className: `text-input-helper-text ${it(i)} ${y}`,
69
69
  children: p
70
70
  }
71
71
  )
72
72
  ] });
73
- }), fs = (n) => {
74
- const { t: e } = v(), {
73
+ }), ws = (n) => {
74
+ const { t: e } = N(), {
75
75
  children: t,
76
76
  handleSubmit: s,
77
77
  onSubmit: r,
78
- isLoading: o = !1,
79
- buttonEnd: i = !0,
78
+ isLoading: i = !1,
79
+ buttonEnd: o = !0,
80
80
  reset: c
81
81
  } = n;
82
82
  return /* @__PURE__ */ k("form", { className: "form-container", onSubmit: s(r), children: [
83
83
  t,
84
- /* @__PURE__ */ k("div", { className: `form-actions ${i ? "end" : ""}`, children: [
84
+ /* @__PURE__ */ k("div", { className: `form-actions ${o ? "end" : ""}`, children: [
85
85
  /* @__PURE__ */ k(
86
- K,
86
+ U,
87
87
  {
88
88
  type: "submit",
89
89
  color: "primary",
90
90
  variant: "submit",
91
- disabled: o,
91
+ disabled: i,
92
92
  name: e("_accessibility:buttons.submit"),
93
93
  "aria-label": e("_accessibility:ariaLabels.submit"),
94
94
  children: [
95
- o ? /* @__PURE__ */ h(
96
- ee,
95
+ i ? /* @__PURE__ */ f(
96
+ ne,
97
97
  {
98
98
  color: "stroke-base",
99
99
  loaderClass: "!w-6 mt-1",
@@ -104,8 +104,8 @@ const Ne = (n) => n == null ? !1 : `${n}`.length > 0, hs = xe(function(n, e) {
104
104
  ]
105
105
  }
106
106
  ),
107
- /* @__PURE__ */ h(
108
- K,
107
+ /* @__PURE__ */ f(
108
+ U,
109
109
  {
110
110
  type: "button",
111
111
  variant: "outlined",
@@ -117,10 +117,10 @@ const Ne = (n) => n == null ? !1 : `${n}`.length > 0, hs = xe(function(n, e) {
117
117
  )
118
118
  ] })
119
119
  ] });
120
- }, ps = xe(function(n, e) {
121
- const { t } = v(), [s, r] = A(!1);
122
- return /* @__PURE__ */ h(tt, { ...n, type: s ? "text" : "password", ref: e, children: /* @__PURE__ */ h(
123
- V,
120
+ }, Ss = Ae(function(n, e) {
121
+ const { t } = N(), [s, r] = _(!1);
122
+ return /* @__PURE__ */ f(ot, { ...n, type: s ? "text" : "password", ref: e, children: /* @__PURE__ */ f(
123
+ G,
124
124
  {
125
125
  type: "button",
126
126
  tabIndex: -1,
@@ -129,61 +129,61 @@ const Ne = (n) => n == null ? !1 : `${n}`.length > 0, hs = xe(function(n, e) {
129
129
  ),
130
130
  className: "password-icon",
131
131
  onClick: () => r(!s),
132
- icon: s ? ut : dt
132
+ icon: s ? pt : gt
133
133
  }
134
134
  ) });
135
- }), ye = (n) => {
136
- const { t: e } = v(), {
135
+ }), ke = (n) => {
136
+ const { t: e } = N(), {
137
137
  title: t,
138
138
  children: s,
139
139
  handleClose: r,
140
- open: o = !1,
141
- containerClassName: i = "",
140
+ open: i = !1,
141
+ containerClassName: o = "",
142
142
  className: c = "",
143
143
  animationClass: a = "appear"
144
- } = n, l = w(
145
- (u) => {
146
- u.key === "Escape" && o && r();
144
+ } = n, u = w(
145
+ (d) => {
146
+ d.key === "Escape" && i && r();
147
147
  },
148
- [o, r]
148
+ [i, r]
149
149
  );
150
- O(() => (window.addEventListener("keydown", l), () => {
151
- window.removeEventListener("keydown", l);
152
- }), [l]);
153
- const d = w(
154
- (u) => {
155
- u.target === u.currentTarget && r();
150
+ O(() => (window.addEventListener("keydown", u), () => {
151
+ window.removeEventListener("keydown", u);
152
+ }), [u]);
153
+ const l = w(
154
+ (d) => {
155
+ d.target === d.currentTarget && r();
156
156
  },
157
157
  [r]
158
158
  );
159
159
  return O(() => {
160
- const u = (m) => {
160
+ const d = (m) => {
161
161
  m ? document.body.style.overflow = "hidden" : document.body.style.overflow = "auto";
162
162
  };
163
- return u(o), () => {
164
- u(!1);
163
+ return d(i), () => {
164
+ d(!1);
165
165
  };
166
- }, [o]), Ie(
167
- /* @__PURE__ */ h(
166
+ }, [i]), Fe(
167
+ /* @__PURE__ */ f(
168
168
  "div",
169
169
  {
170
170
  "aria-label": e("_accessibility:ariaLabels.closeDialog"),
171
- "aria-hidden": !o,
172
- onClick: d,
173
- className: `dialog-backdrop animated ${o ? `opened ${a}` : "closed"} ${i}`,
171
+ "aria-hidden": !i,
172
+ onClick: l,
173
+ className: `dialog-backdrop animated ${i ? `opened ${a}` : "closed"} ${o}`,
174
174
  children: /* @__PURE__ */ k(
175
175
  "div",
176
176
  {
177
- className: `dialog elevated animated ${o ? `opened ${a}` : "closed"} ${c}`,
177
+ className: `dialog elevated animated ${i ? `opened ${a}` : "closed"} ${c}`,
178
178
  children: [
179
179
  /* @__PURE__ */ k("div", { className: "dialog-header", children: [
180
- /* @__PURE__ */ h("h3", { className: "dialog-title", children: t }),
181
- /* @__PURE__ */ h(
182
- V,
180
+ /* @__PURE__ */ f("h3", { className: "dialog-title", children: t }),
181
+ /* @__PURE__ */ f(
182
+ G,
183
183
  {
184
- icon: Le,
185
- disabled: !o,
186
- "aria-disabled": !o,
184
+ icon: _e,
185
+ disabled: !i,
186
+ "aria-disabled": !i,
187
187
  onClick: r,
188
188
  variant: "text",
189
189
  color: "error",
@@ -201,42 +201,42 @@ const Ne = (n) => n == null ? !1 : `${n}`.length > 0, hs = xe(function(n, e) {
201
201
  ),
202
202
  document.body
203
203
  );
204
- }, be = (n) => {
204
+ }, ve = (n) => {
205
205
  const {
206
206
  primaryText: e,
207
207
  cancelText: t,
208
208
  onPrimaryClick: s,
209
209
  onCancel: r,
210
- isLoading: o = !1,
211
- disabled: i = !1,
210
+ isLoading: i = !1,
211
+ disabled: o = !1,
212
212
  primaryType: c = "submit",
213
213
  containerClassName: a = "",
214
- primaryClassName: l = "",
215
- alignEnd: d = !1,
216
- primaryName: u,
214
+ primaryClassName: u = "",
215
+ alignEnd: l = !1,
216
+ primaryName: d,
217
217
  primaryAriaLabel: m,
218
- cancelName: f,
218
+ cancelName: h,
219
219
  cancelAriaLabel: p
220
220
  } = n;
221
221
  return /* @__PURE__ */ k(
222
222
  "div",
223
223
  {
224
- className: `dialog-actions ${d ? "end" : ""} ${a}`,
224
+ className: `dialog-actions ${l ? "end" : ""} ${a}`,
225
225
  children: [
226
226
  /* @__PURE__ */ k(
227
- K,
227
+ U,
228
228
  {
229
229
  type: c,
230
230
  color: "primary",
231
231
  variant: "submit",
232
- className: l,
233
- disabled: i,
232
+ className: u,
233
+ disabled: o,
234
234
  onClick: s,
235
- name: u,
235
+ name: d,
236
236
  "aria-label": m,
237
237
  children: [
238
- o ? /* @__PURE__ */ h(
239
- ee,
238
+ i ? /* @__PURE__ */ f(
239
+ ne,
240
240
  {
241
241
  color: "stroke-base",
242
242
  loaderClass: "!w-6 mt-1",
@@ -247,14 +247,14 @@ const Ne = (n) => n == null ? !1 : `${n}`.length > 0, hs = xe(function(n, e) {
247
247
  ]
248
248
  }
249
249
  ),
250
- /* @__PURE__ */ h(
251
- K,
250
+ /* @__PURE__ */ f(
251
+ U,
252
252
  {
253
253
  type: "button",
254
254
  variant: "outlined",
255
- disabled: i,
255
+ disabled: o,
256
256
  onClick: r,
257
- name: f,
257
+ name: h,
258
258
  "aria-label": p,
259
259
  children: t
260
260
  }
@@ -262,27 +262,27 @@ const Ne = (n) => n == null ? !1 : `${n}`.length > 0, hs = xe(function(n, e) {
262
262
  ]
263
263
  }
264
264
  );
265
- }, gs = (n) => {
266
- const { t: e } = v(), {
265
+ }, ks = (n) => {
266
+ const { t: e } = N(), {
267
267
  children: t,
268
268
  handleSubmit: s,
269
269
  onSubmit: r,
270
- handleClose: o,
271
- isLoading: i = !1,
270
+ handleClose: i,
271
+ isLoading: o = !1,
272
272
  buttonEnd: c = !0,
273
273
  ...a
274
274
  } = n;
275
- return /* @__PURE__ */ h(ye, { ...a, handleClose: o, children: /* @__PURE__ */ k("form", { onSubmit: s(r), children: [
276
- /* @__PURE__ */ h("div", { className: "form-container", children: t }),
277
- /* @__PURE__ */ h(
278
- be,
275
+ return /* @__PURE__ */ f(ke, { ...a, handleClose: i, children: /* @__PURE__ */ k("form", { onSubmit: s(r), children: [
276
+ /* @__PURE__ */ f("div", { className: "form-container", children: t }),
277
+ /* @__PURE__ */ f(
278
+ ve,
279
279
  {
280
280
  primaryType: "submit",
281
281
  primaryText: e("_accessibility:buttons.submit"),
282
282
  cancelText: e("_accessibility:buttons.cancel"),
283
- onCancel: o,
284
- isLoading: i,
285
- disabled: i,
283
+ onCancel: i,
284
+ isLoading: o,
285
+ disabled: o,
286
286
  primaryClassName: "dialog-form-primary",
287
287
  alignEnd: c,
288
288
  primaryName: e("_accessibility:buttons.submit"),
@@ -292,25 +292,25 @@ const Ne = (n) => n == null ? !1 : `${n}`.length > 0, hs = xe(function(n, e) {
292
292
  }
293
293
  )
294
294
  ] }) });
295
- }, ys = (n) => {
296
- const { t: e } = v(), {
295
+ }, vs = (n) => {
296
+ const { t: e } = N(), {
297
297
  children: t,
298
298
  handleSubmit: s,
299
299
  handleClose: r,
300
- isLoading: o = !1,
301
- ...i
300
+ isLoading: i = !1,
301
+ ...o
302
302
  } = n;
303
- return /* @__PURE__ */ k(ye, { ...i, handleClose: r, children: [
303
+ return /* @__PURE__ */ k(ke, { ...o, handleClose: r, children: [
304
304
  t,
305
- /* @__PURE__ */ h(
306
- be,
305
+ /* @__PURE__ */ f(
306
+ ve,
307
307
  {
308
308
  primaryText: e("_accessibility:buttons.ok"),
309
309
  cancelText: e("_accessibility:buttons.cancel"),
310
310
  onPrimaryClick: s,
311
311
  onCancel: r,
312
- isLoading: o,
313
- disabled: o,
312
+ isLoading: i,
313
+ disabled: i,
314
314
  primaryType: "button",
315
315
  containerClassName: "mt-5",
316
316
  primaryName: e("_accessibility:buttons.ok"),
@@ -321,34 +321,34 @@ const Ne = (n) => n == null ? !1 : `${n}`.length > 0, hs = xe(function(n, e) {
321
321
  )
322
322
  ] });
323
323
  };
324
- function $t(n) {
325
- const { message: e, className: t = "" } = n, { t: s } = v();
326
- return /* @__PURE__ */ h("p", { className: `import-error-message ${t}`, children: e ?? s("_messages:errors.parseFile", {
324
+ function _t(n) {
325
+ const { message: e, className: t = "" } = n, { t: s } = N();
326
+ return /* @__PURE__ */ f("p", { className: `import-error-message ${t}`, children: e ?? s("_messages:errors.parseFile", {
327
327
  defaultValue: "Failed to process file"
328
328
  }) });
329
329
  }
330
- function xt(n) {
331
- const { message: e, className: t = "" } = n, { t: s } = v();
330
+ function Rt(n) {
331
+ const { message: e, className: t = "" } = n, { t: s } = N();
332
332
  return /* @__PURE__ */ k("div", { className: `import-loading ${t}`, children: [
333
- /* @__PURE__ */ h(ee, { loaderClass: "w-5 h-5", className: "!w-auto" }),
334
- /* @__PURE__ */ h("span", { children: e ?? s("_messages:loading.processingFile", {
333
+ /* @__PURE__ */ f(ne, { loaderClass: "w-5 h-5", className: "!w-auto" }),
334
+ /* @__PURE__ */ f("span", { children: e ?? s("_messages:loading.processingFile", {
335
335
  defaultValue: "Processing file..."
336
336
  }) })
337
337
  ] });
338
338
  }
339
- function At(n) {
340
- const { items: e, max: t = 5, className: s = "" } = n, { t: r } = v();
339
+ function It(n) {
340
+ const { items: e, max: t = 5, className: s = "" } = n, { t: r } = N();
341
341
  if (!e || e.length === 0) return null;
342
- const o = e.slice(0, t);
342
+ const i = e.slice(0, t);
343
343
  return /* @__PURE__ */ k("div", { className: `import-preview ${s}`, children: [
344
- /* @__PURE__ */ h("p", { className: "import-preview-count", children: r("_pages:common.actions.import.previewCount", {
344
+ /* @__PURE__ */ f("p", { className: "import-preview-count", children: r("_pages:common.actions.import.previewCount", {
345
345
  count: e.length,
346
346
  defaultValue: `Preview: ${e.length} items`
347
347
  }) }),
348
- /* @__PURE__ */ h("pre", { className: "import-preview-content", children: JSON.stringify(o, null, 2) })
348
+ /* @__PURE__ */ f("pre", { className: "import-preview-content", children: JSON.stringify(i, null, 2) })
349
349
  ] });
350
350
  }
351
- const Me = () => ({
351
+ const De = () => ({
352
352
  file: null,
353
353
  previewItems: null,
354
354
  parseError: null,
@@ -356,7 +356,7 @@ const Me = () => ({
356
356
  overrideExisting: !1,
357
357
  inputKey: 0
358
358
  });
359
- function Lt(n, e) {
359
+ function Ft(n, e) {
360
360
  switch (e.type) {
361
361
  case "SET_FILE":
362
362
  return {
@@ -385,107 +385,107 @@ function Lt(n, e) {
385
385
  case "SET_OVERRIDE":
386
386
  return { ...n, overrideExisting: e.value };
387
387
  case "RESET":
388
- return { ...Me(), inputKey: n.inputKey + 1 };
388
+ return { ...De(), inputKey: n.inputKey + 1 };
389
389
  }
390
390
  }
391
- const bs = (n) => {
392
- const { t: e } = v(), {
391
+ const Cs = (n) => {
392
+ const { t: e } = N(), {
393
393
  children: t,
394
394
  handleSubmit: s,
395
395
  handleClose: r,
396
- isLoading: o = !1,
397
- fileProcessor: i,
396
+ isLoading: i = !1,
397
+ fileProcessor: o,
398
398
  onFileProcessed: c,
399
399
  renderCustomPreview: a,
400
- onOverrideChange: l,
401
- open: d,
402
- ...u
403
- } = n, [m, f] = Ae(
404
- Lt,
405
- Me()
400
+ onOverrideChange: u,
401
+ open: l,
402
+ ...d
403
+ } = n, [m, h] = Le(
404
+ Ft,
405
+ De()
406
406
  ), {
407
407
  file: p,
408
408
  previewItems: y,
409
409
  parseError: g,
410
410
  processing: b,
411
- overrideExisting: T,
412
- inputKey: N
413
- } = m, C = H(c), D = H(i);
411
+ overrideExisting: S,
412
+ inputKey: E
413
+ } = m, v = M(c), $ = M(o);
414
414
  O(() => {
415
- C.current = c;
415
+ v.current = c;
416
416
  }, [c]), O(() => {
417
- D.current = i;
418
- }, [i]), O(() => {
419
- d || f({ type: "RESET" });
420
- }, [d]);
421
- const q = w(
422
- async (L, S) => {
423
- var _;
424
- if (D.current) {
425
- f({ type: "START_PROCESSING" });
417
+ $.current = o;
418
+ }, [o]), O(() => {
419
+ l || h({ type: "RESET" });
420
+ }, [l]);
421
+ const j = w(
422
+ async (I, C) => {
423
+ var A;
424
+ if ($.current) {
425
+ h({ type: "START_PROCESSING" });
426
426
  try {
427
- const E = await D.current(L, { override: S });
428
- f({ type: "SET_PREVIEW", items: E ?? [] }), (_ = C.current) == null || _.call(C, E ?? []);
429
- } catch (E) {
430
- console.error(E);
431
- const P = E instanceof Error ? E.message : "Failed to parse file";
432
- f({ type: "SET_ERROR", message: P });
427
+ const x = await $.current(I, { override: C });
428
+ h({ type: "SET_PREVIEW", items: x ?? [] }), (A = v.current) == null || A.call(v, x ?? []);
429
+ } catch (x) {
430
+ console.error(x);
431
+ const q = x instanceof Error ? x.message : "Failed to parse file";
432
+ h({ type: "SET_ERROR", message: q });
433
433
  }
434
434
  }
435
435
  },
436
436
  []
437
437
  );
438
- return /* @__PURE__ */ k(ye, { ...u, open: d, handleClose: r, children: [
439
- /* @__PURE__ */ h(
440
- st,
438
+ return /* @__PURE__ */ k(ke, { ...d, open: l, handleClose: r, children: [
439
+ /* @__PURE__ */ f(
440
+ at,
441
441
  {
442
442
  onClear: () => {
443
- var L;
444
- f({ type: "SET_FILE", file: null }), (L = C.current) == null || L.call(C, []);
443
+ var I;
444
+ h({ type: "SET_FILE", file: null }), (I = v.current) == null || I.call(v, []);
445
445
  },
446
- onChange: (L) => {
447
- var _, E;
448
- const S = (_ = L.target.files) == null ? void 0 : _[0];
449
- if (!S) {
450
- f({ type: "SET_FILE", file: null }), (E = C.current) == null || E.call(C, []);
446
+ onChange: (I) => {
447
+ var A, x;
448
+ const C = (A = I.target.files) == null ? void 0 : A[0];
449
+ if (!C) {
450
+ h({ type: "SET_FILE", file: null }), (x = v.current) == null || x.call(v, []);
451
451
  return;
452
452
  }
453
- f({ type: "SET_FILE", file: S }), q(S, T);
453
+ h({ type: "SET_FILE", file: C }), j(C, S);
454
454
  },
455
455
  label: e("_accessibility:labels.file")
456
456
  },
457
- N
457
+ E
458
458
  ),
459
459
  /* @__PURE__ */ k("label", { className: "import-override-label", children: [
460
- /* @__PURE__ */ h(
460
+ /* @__PURE__ */ f(
461
461
  "input",
462
462
  {
463
463
  type: "checkbox",
464
- checked: T,
465
- onChange: (L) => {
466
- const S = L.target.checked;
467
- f({ type: "SET_OVERRIDE", value: S }), l == null || l(S), p && q(p, S);
464
+ checked: S,
465
+ onChange: (I) => {
466
+ const C = I.target.checked;
467
+ h({ type: "SET_OVERRIDE", value: C }), u == null || u(C), p && j(p, C);
468
468
  }
469
469
  }
470
470
  ),
471
- /* @__PURE__ */ h("span", { children: e("_pages:common.actions.import.override", {
471
+ /* @__PURE__ */ f("span", { children: e("_pages:common.actions.import.override", {
472
472
  defaultValue: "Override existing items"
473
473
  }) })
474
474
  ] }),
475
- /* @__PURE__ */ h($t, { message: g }),
476
- b && /* @__PURE__ */ h(xt, {}),
477
- a ? a(y) : !!y && y.length > 0 && /* @__PURE__ */ h(At, { items: y }),
475
+ /* @__PURE__ */ f(_t, { message: g }),
476
+ b && /* @__PURE__ */ f(Rt, {}),
477
+ a ? a(y) : !!y && y.length > 0 && /* @__PURE__ */ f(It, { items: y }),
478
478
  t,
479
- /* @__PURE__ */ h(
480
- be,
479
+ /* @__PURE__ */ f(
480
+ ve,
481
481
  {
482
482
  primaryText: e("_accessibility:buttons.ok"),
483
483
  cancelText: e("_accessibility:buttons.cancel"),
484
484
  onPrimaryClick: () => {
485
- (!i || !!y && y.length > 0) && s();
485
+ (!o || !!y && y.length > 0) && s();
486
486
  },
487
487
  onCancel: r,
488
- isLoading: o,
488
+ isLoading: i,
489
489
  primaryType: "button",
490
490
  containerClassName: "import-dialog-actions",
491
491
  primaryName: e("_accessibility:buttons.ok"),
@@ -496,49 +496,49 @@ const bs = (n) => {
496
496
  )
497
497
  ] });
498
498
  };
499
- var R = /* @__PURE__ */ ((n) => (n[n.success = 0] = "success", n[n.error = 1] = "error", n[n.warning = 2] = "warning", n[n.info = 3] = "info", n))(R || {}), I = /* @__PURE__ */ ((n) => (n.GET = "GET", n.POST = "POST", n.PUT = "PUT", n.PATCH = "PATCH", n.DELETE = "DELETE", n))(I || {});
500
- const _t = (n) => Array.isArray(n) || n instanceof Headers ? !1 : typeof n == "object" && n !== null && ("headers" in n || "credentials" in n), Rt = (n) => n ? _t(n) ? n : { headers: n } : {}, It = (n) => n ? n instanceof Headers ? Object.fromEntries(n.entries()) : Array.isArray(n) ? Object.fromEntries(n) : n : {};
501
- async function fe(n, e = "GET", t, s) {
502
- const r = Rt(s), o = {
499
+ var R = /* @__PURE__ */ ((n) => (n[n.success = 0] = "success", n[n.error = 1] = "error", n[n.warning = 2] = "warning", n[n.info = 3] = "info", n))(R || {}), F = /* @__PURE__ */ ((n) => (n.GET = "GET", n.POST = "POST", n.PUT = "PUT", n.PATCH = "PATCH", n.DELETE = "DELETE", n))(F || {});
500
+ const Ot = (n) => Array.isArray(n) || n instanceof Headers ? !1 : typeof n == "object" && n !== null && ("headers" in n || "credentials" in n), Mt = (n) => n ? Ot(n) ? n : { headers: n } : {}, Dt = (n) => n ? n instanceof Headers ? Object.fromEntries(n.entries()) : Array.isArray(n) ? Object.fromEntries(n) : n : {};
501
+ async function be(n, e = "GET", t, s) {
502
+ const r = Mt(s), i = {
503
503
  ...t !== void 0 ? { "Content-Type": "application/json" } : {},
504
- ...It(r.headers)
504
+ ...Dt(r.headers)
505
505
  };
506
506
  try {
507
- const i = await fetch(n, {
507
+ const o = await fetch(n, {
508
508
  method: e,
509
- headers: o,
509
+ headers: i,
510
510
  ...r.credentials ? { credentials: r.credentials } : {},
511
511
  ...t !== void 0 ? { body: JSON.stringify(t) } : {}
512
- }), c = await i.text();
512
+ }), c = await o.text();
513
513
  let a = null;
514
514
  try {
515
515
  a = c ? JSON.parse(c) : null;
516
516
  } catch {
517
517
  a = null;
518
518
  }
519
- if (!i.ok) {
520
- const l = typeof a == "object" && a !== null ? a.message ?? a.error ?? c : c || i.statusText;
519
+ if (!o.ok) {
520
+ const u = typeof a == "object" && a !== null ? a.message ?? a.error ?? c : c || o.statusText;
521
521
  return {
522
522
  data: null,
523
- status: i.status,
523
+ status: o.status,
524
524
  error: {
525
- status: i.status,
526
- message: l || "Unknown error occurred"
525
+ status: o.status,
526
+ message: u || "Unknown error occurred"
527
527
  }
528
528
  };
529
529
  }
530
530
  return {
531
- data: i.status !== 204 && a !== null ? a : null,
532
- status: i.status,
531
+ data: o.status !== 204 && a !== null ? a : null,
532
+ status: o.status,
533
533
  error: null
534
534
  };
535
- } catch (i) {
535
+ } catch (o) {
536
536
  return {
537
537
  data: null,
538
538
  status: 500,
539
539
  error: {
540
540
  status: 500,
541
- message: i instanceof Error ? i.message : "Unknown error occurred"
541
+ message: o instanceof Error ? o.message : "Unknown error occurred"
542
542
  }
543
543
  };
544
544
  }
@@ -552,49 +552,49 @@ function Pt(n, e) {
552
552
  }
553
553
  return n;
554
554
  }
555
- const De = (n, e, t) => {
555
+ const Pe = (n, e, t) => {
556
556
  const s = [];
557
557
  if (e) {
558
- const { sortingBy: r, sortingOrder: o, currentPage: i, pageSize: c } = e;
559
- r !== void 0 && s.push(`sort=${String(r)}`), o !== void 0 && s.push(`order=${o}`), i !== void 0 && s.push(`page=${i}`), c !== void 0 && s.push(`pageSize=${c}`);
558
+ const { sortingBy: r, sortingOrder: i, currentPage: o, pageSize: c } = e;
559
+ r !== void 0 && s.push(`sort=${String(r)}`), i !== void 0 && s.push(`order=${i}`), o !== void 0 && s.push(`page=${o}`), c !== void 0 && s.push(`pageSize=${c}`);
560
560
  }
561
561
  if (t) {
562
562
  const r = Object.entries(t).filter(
563
- ([, o]) => o != null && o !== ""
564
- ).flatMap(([o, i]) => {
565
- if (Array.isArray(i))
566
- return i.map((c) => `${o}==${encodeURIComponent((c == null ? void 0 : c.id) ?? c)}`);
567
- if (typeof i == "object" && i !== null && "start" in i && "end" in i) {
563
+ ([, i]) => i != null && i !== ""
564
+ ).flatMap(([i, o]) => {
565
+ if (Array.isArray(o))
566
+ return o.map((c) => `${i}==${encodeURIComponent((c == null ? void 0 : c.id) ?? c)}`);
567
+ if (typeof o == "object" && o !== null && "start" in o && "end" in o) {
568
568
  const c = [];
569
- return i.start != null && i.start !== "" && c.push(`${o}>=${encodeURIComponent(i.start)}`), i.end != null && i.end !== "" && c.push(`${o}<=${encodeURIComponent(i.end)}`), c;
569
+ return o.start != null && o.start !== "" && c.push(`${i}>=${encodeURIComponent(o.start)}`), o.end != null && o.end !== "" && c.push(`${i}<=${encodeURIComponent(o.end)}`), c;
570
570
  }
571
- return typeof i == "object" && i !== null ? `${o}==${encodeURIComponent(i.id ?? "")}` : `${o}==${encodeURIComponent(i)}`;
571
+ return typeof o == "object" && o !== null ? `${i}==${encodeURIComponent(o.id ?? "")}` : `${i}==${encodeURIComponent(o)}`;
572
572
  });
573
573
  r.length > 0 && s.push(`filters=${r.join(",")}`);
574
574
  }
575
575
  return s.length ? `${n}?${s.join("&")}` : n;
576
- }, Z = class Z {
576
+ }, se = class se {
577
577
  /**
578
578
  * @param baseUrl the base url of the server
579
579
  * @param userKey the local storage user key
580
580
  * @param secured if the api client requires token
581
581
  * @param tokenAcquirer custom token acquirer
582
582
  */
583
- constructor(e, t = "user", s = !0, r, o = {}) {
584
- x(this, "baseUrl");
585
- x(this, "userKey");
586
- x(this, "rememberKey");
587
- x(this, "refreshTokenKey");
588
- x(this, "accessTokenExpiresAtKey");
589
- x(this, "refreshEndpoint");
590
- x(this, "refreshExpirySkewMs");
591
- x(this, "secured");
592
- x(this, "tokenAcquirer");
593
- this.baseUrl = e, this.secured = s, this.userKey = t, this.rememberKey = o.rememberKey ?? "remember", this.refreshTokenKey = o.refreshTokenKey ?? "refreshToken", this.accessTokenExpiresAtKey = o.accessTokenExpiresAtKey ?? "accessTokenExpiresAt", this.refreshEndpoint = o.refreshEndpoint ?? "auth/refresh", this.refreshExpirySkewMs = o.refreshExpirySkewMs ?? 5e3, this.tokenAcquirer = r ?? this.defaultTokenAcquirer;
583
+ constructor(e, t = "user", s = !0, r, i = {}) {
584
+ L(this, "baseUrl");
585
+ L(this, "userKey");
586
+ L(this, "rememberKey");
587
+ L(this, "refreshTokenKey");
588
+ L(this, "accessTokenExpiresAtKey");
589
+ L(this, "refreshEndpoint");
590
+ L(this, "refreshExpirySkewMs");
591
+ L(this, "secured");
592
+ L(this, "tokenAcquirer");
593
+ this.baseUrl = e, this.secured = s, this.userKey = t, this.rememberKey = i.rememberKey ?? "remember", this.refreshTokenKey = i.refreshTokenKey ?? "refreshToken", this.accessTokenExpiresAtKey = i.accessTokenExpiresAtKey ?? "accessTokenExpiresAt", this.refreshEndpoint = i.refreshEndpoint ?? "auth/refresh", this.refreshExpirySkewMs = i.refreshExpirySkewMs ?? 5e3, this.tokenAcquirer = r ?? this.defaultTokenAcquirer;
594
594
  }
595
595
  defaultTokenAcquirer(e) {
596
596
  if (e) return { credentials: "include" };
597
- const t = z(this.userKey);
597
+ const t = X(this.userKey);
598
598
  if (t && t.length) return { Authorization: `Bearer ${t}` };
599
599
  }
600
600
  getRefreshLockKey() {
@@ -605,12 +605,12 @@ const De = (n, e, t) => {
605
605
  return `${t}${s}`;
606
606
  }
607
607
  getRefreshToken() {
608
- const e = z(this.refreshTokenKey);
608
+ const e = X(this.refreshTokenKey);
609
609
  if (typeof e == "string" && e.length)
610
610
  return e;
611
611
  }
612
612
  getAccessTokenExpiresAt() {
613
- const e = z(this.accessTokenExpiresAtKey);
613
+ const e = X(this.accessTokenExpiresAtKey);
614
614
  if (typeof e == "string" && e.length)
615
615
  return e;
616
616
  }
@@ -624,12 +624,12 @@ const De = (n, e, t) => {
624
624
  return Number.isNaN(s) ? !1 : Date.now() >= s - this.refreshExpirySkewMs;
625
625
  }
626
626
  clearStoredSession() {
627
- M(this.userKey), M(this.rememberKey), M(this.refreshTokenKey), M(this.accessTokenExpiresAtKey);
627
+ P(this.userKey), P(this.rememberKey), P(this.refreshTokenKey), P(this.accessTokenExpiresAtKey);
628
628
  }
629
629
  storeSession(e, t) {
630
- B(this.userKey, e.token);
630
+ W(this.userKey, e.token);
631
631
  const s = e.refreshToken === void 0 ? t : e.refreshToken;
632
- typeof s == "string" && s.length ? B(this.refreshTokenKey, s) : M(this.refreshTokenKey), typeof e.accessTokenExpiresAt == "string" && e.accessTokenExpiresAt.length ? B(this.accessTokenExpiresAtKey, e.accessTokenExpiresAt) : M(this.accessTokenExpiresAtKey);
632
+ typeof s == "string" && s.length ? W(this.refreshTokenKey, s) : P(this.refreshTokenKey), typeof e.accessTokenExpiresAt == "string" && e.accessTokenExpiresAt.length ? W(this.accessTokenExpiresAtKey, e.accessTokenExpiresAt) : P(this.accessTokenExpiresAtKey);
633
633
  }
634
634
  async refreshAccessTokenWithMutex() {
635
635
  const e = this.getRefreshToken();
@@ -638,29 +638,29 @@ const De = (n, e, t) => {
638
638
  status: 401,
639
639
  message: "Missing refresh token"
640
640
  };
641
- const t = this.getRefreshLockKey(), s = Z.refreshInFlight.get(t);
641
+ const t = this.getRefreshLockKey(), s = se.refreshInFlight.get(t);
642
642
  if (s) {
643
643
  await s;
644
644
  return;
645
645
  }
646
646
  const r = (async () => {
647
- const { data: o, status: i, error: c } = await fe(
647
+ const { data: i, status: o, error: c } = await be(
648
648
  this.buildUrl(this.refreshEndpoint),
649
- I.POST,
649
+ F.POST,
650
650
  { refreshToken: e }
651
651
  );
652
- if (c || !(o != null && o.token))
652
+ if (c || !(i != null && i.token))
653
653
  throw this.clearStoredSession(), c ?? {
654
- status: i,
654
+ status: o,
655
655
  message: "Unable to refresh session"
656
656
  };
657
- this.storeSession(o, e);
657
+ this.storeSession(i, e);
658
658
  })();
659
- Z.refreshInFlight.set(t, r);
659
+ se.refreshInFlight.set(t, r);
660
660
  try {
661
661
  await r;
662
662
  } finally {
663
- Z.refreshInFlight.delete(t);
663
+ se.refreshInFlight.delete(t);
664
664
  }
665
665
  }
666
666
  isRequestOptions(e) {
@@ -673,33 +673,33 @@ const De = (n, e, t) => {
673
673
  return e ? e instanceof Headers ? Object.fromEntries(e.entries()) : Array.isArray(e) ? Object.fromEntries(e) : e : {};
674
674
  }
675
675
  mergeRequestConfig(e) {
676
- const t = this.secured ? this.tokenAcquirer() : void 0, s = this.toRequestOptions(t), r = this.toRequestOptions(e), o = {
676
+ const t = this.secured ? this.tokenAcquirer() : void 0, s = this.toRequestOptions(t), r = this.toRequestOptions(e), i = {
677
677
  ...this.toHeaderRecord(s.headers),
678
678
  ...this.toHeaderRecord(r.headers)
679
- }, i = r.credentials ?? s.credentials, c = Object.keys(o).length > 0;
680
- if (i)
681
- return c ? { headers: o, credentials: i } : { credentials: i };
682
- if (c) return o;
679
+ }, o = r.credentials ?? s.credentials, c = Object.keys(i).length > 0;
680
+ if (o)
681
+ return c ? { headers: i, credentials: o } : { credentials: o };
682
+ if (c) return i;
683
683
  }
684
684
  async makeRequestWithRefresh(e, t, s, r) {
685
685
  this.secured && this.shouldRefreshBeforeRequest() && await this.refreshAccessTokenWithMutex();
686
- let o = await fe(
686
+ let i = await be(
687
687
  this.buildUrl(e),
688
688
  t,
689
689
  s,
690
690
  this.mergeRequestConfig(r)
691
691
  );
692
- return this.secured && o.status === 401 && this.canRefresh() && (await this.refreshAccessTokenWithMutex(), o = await fe(
692
+ return this.secured && i.status === 401 && this.canRefresh() && (await this.refreshAccessTokenWithMutex(), i = await be(
693
693
  this.buildUrl(e),
694
694
  t,
695
695
  s,
696
696
  this.mergeRequestConfig(r)
697
- )), o;
697
+ )), i;
698
698
  }
699
- async doQuery(e, t = I.GET, s, r) {
699
+ async doQuery(e, t = F.GET, s, r) {
700
700
  const {
701
- data: o,
702
- status: i,
701
+ data: i,
702
+ status: o,
703
703
  error: c
704
704
  } = await this.makeRequestWithRefresh(
705
705
  e,
@@ -707,12 +707,12 @@ const De = (n, e, t) => {
707
707
  s,
708
708
  r
709
709
  );
710
- if (c || i < 200 || i >= 300)
710
+ if (c || o < 200 || o >= 300)
711
711
  throw c ?? {
712
- status: i,
713
- message: String(i)
712
+ status: o,
713
+ message: String(o)
714
714
  };
715
- return o;
715
+ return i;
716
716
  }
717
717
  /**
718
718
  * @description Get all objects
@@ -721,20 +721,20 @@ const De = (n, e, t) => {
721
721
  * @returns Result list
722
722
  */
723
723
  async get(e, t, s) {
724
- const r = De(e, t, s), {
725
- data: o,
726
- error: i,
724
+ const r = Pe(e, t, s), {
725
+ data: i,
726
+ error: o,
727
727
  status: c
728
728
  } = await this.makeRequestWithRefresh(
729
729
  r,
730
- I.GET
730
+ F.GET
731
731
  );
732
- if (i || c < 200 || c >= 300 || !o)
733
- throw i ?? {
732
+ if (o || c < 200 || c >= 300 || !i)
733
+ throw o ?? {
734
734
  status: c,
735
735
  message: String(c)
736
736
  };
737
- return o;
737
+ return i;
738
738
  }
739
739
  /**
740
740
  * @description Get entity by id
@@ -746,15 +746,15 @@ const De = (n, e, t) => {
746
746
  const {
747
747
  error: s,
748
748
  data: r,
749
- status: o
749
+ status: i
750
750
  } = await this.makeRequestWithRefresh(
751
751
  e,
752
- I.PATCH,
752
+ F.PATCH,
753
753
  t
754
754
  );
755
755
  if (s || r === null || r === void 0)
756
756
  throw s ?? {
757
- status: o,
757
+ status: i,
758
758
  message: "Unknown error"
759
759
  };
760
760
  return r;
@@ -768,15 +768,15 @@ const De = (n, e, t) => {
768
768
  const {
769
769
  error: s,
770
770
  data: r,
771
- status: o
771
+ status: i
772
772
  } = await this.makeRequestWithRefresh(
773
773
  e,
774
- I.DELETE,
774
+ F.DELETE,
775
775
  t
776
776
  );
777
777
  if (s || r === null || r === void 0)
778
778
  throw s ?? {
779
- status: o,
779
+ status: i,
780
780
  message: "Unknown error"
781
781
  };
782
782
  return r;
@@ -791,39 +791,39 @@ const De = (n, e, t) => {
791
791
  const {
792
792
  error: s,
793
793
  data: r,
794
- status: o
794
+ status: i
795
795
  } = await this.makeRequestWithRefresh(
796
796
  e,
797
- I.POST,
797
+ F.POST,
798
798
  t
799
799
  );
800
800
  if (s || r === null || r === void 0)
801
801
  throw s ?? {
802
- status: o,
802
+ status: i,
803
803
  message: "Unknown error"
804
804
  };
805
805
  return r;
806
806
  }
807
807
  };
808
- x(Z, "refreshInFlight", /* @__PURE__ */ new Map());
809
- let ue = Z;
810
- class Mt {
808
+ L(se, "refreshInFlight", /* @__PURE__ */ new Map());
809
+ let me = se;
810
+ class Kt {
811
811
  constructor(e, t = "user", s = {}) {
812
- x(this, "api");
813
- this.api = new ue(e, t, !1, void 0, s);
812
+ L(this, "api");
813
+ this.api = new me(e, t, !1, void 0, s);
814
814
  }
815
815
  async login(e) {
816
816
  const t = "auth/sign-in", s = e;
817
817
  return await this.api.doQuery(
818
818
  t,
819
- I.POST,
819
+ F.POST,
820
820
  s
821
821
  );
822
822
  }
823
823
  async refresh(e) {
824
824
  return await this.api.doQuery(
825
825
  "auth/refresh",
826
- I.POST,
826
+ F.POST,
827
827
  e
828
828
  );
829
829
  }
@@ -833,7 +833,7 @@ class Mt {
833
833
  } : void 0, r = e != null && e.refreshToken ? { refreshToken: e.refreshToken } : void 0;
834
834
  return await this.api.doQuery(
835
835
  t,
836
- I.POST,
836
+ F.POST,
837
837
  r,
838
838
  s
839
839
  );
@@ -841,23 +841,23 @@ class Mt {
841
841
  async register(e) {
842
842
  return await this.api.doQuery(
843
843
  "auth/sign-up",
844
- I.POST,
844
+ F.POST,
845
845
  e
846
846
  );
847
847
  }
848
848
  async getSession() {
849
849
  return await this.api.doQuery(
850
850
  "auth/session",
851
- I.GET,
851
+ F.GET,
852
852
  void 0,
853
853
  this.api.defaultTokenAcquirer()
854
854
  );
855
855
  }
856
856
  }
857
- class ws {
857
+ class Ts {
858
858
  constructor(e, t, s = {}) {
859
- x(this, "auth");
860
- this.auth = new Mt(e, t, s);
859
+ L(this, "auth");
860
+ this.auth = new Kt(e, t, s);
861
861
  }
862
862
  /**
863
863
  * @returns auth
@@ -866,17 +866,17 @@ class ws {
866
866
  return this.auth;
867
867
  }
868
868
  }
869
- class ks {
869
+ class Ns {
870
870
  /**
871
871
  *
872
872
  * @param table
873
873
  * @param secured to see if the api client requires jwt protection
874
874
  */
875
- constructor(e, t, s = "user", r = !0, o = {}) {
876
- x(this, "table");
877
- x(this, "secured");
878
- x(this, "api");
879
- this.table = e, this.secured = r, this.api = new ue(t, s, r, void 0, o);
875
+ constructor(e, t, s = "user", r = !0, i = {}) {
876
+ L(this, "table");
877
+ L(this, "secured");
878
+ L(this, "api");
879
+ this.table = e, this.secured = r, this.api = new me(t, s, r, void 0, i);
880
880
  }
881
881
  /**
882
882
  *
@@ -894,7 +894,7 @@ class ks {
894
894
  async insertMany(e) {
895
895
  return await this.api.doQuery(
896
896
  `${this.table}/batch`,
897
- I.POST,
897
+ F.POST,
898
898
  e
899
899
  );
900
900
  }
@@ -924,12 +924,12 @@ class ks {
924
924
  * @returns - List of elements
925
925
  */
926
926
  async export(e) {
927
- const t = De(
927
+ const t = Pe(
928
928
  `${this.table}/export`,
929
929
  void 0,
930
930
  e
931
931
  );
932
- return await this.api.doQuery(t, I.GET, void 0);
932
+ return await this.api.doQuery(t, F.GET, void 0);
933
933
  }
934
934
  /**
935
935
  *
@@ -939,7 +939,7 @@ class ks {
939
939
  async import(e) {
940
940
  return await this.api.doQuery(
941
941
  `${this.table}/import`,
942
- I.POST,
942
+ F.POST,
943
943
  e
944
944
  );
945
945
  }
@@ -951,7 +951,7 @@ class ks {
951
951
  async commonGet(e) {
952
952
  return await this.api.doQuery(
953
953
  Pt(`${this.table}/common`, e),
954
- I.GET
954
+ F.GET
955
955
  );
956
956
  }
957
957
  /**
@@ -969,12 +969,12 @@ class ks {
969
969
  return await this.api.patch(`${this.table}/restore`, e);
970
970
  }
971
971
  }
972
- class Ss {
972
+ class Es {
973
973
  constructor(e, t, s = 1) {
974
- x(this, "table");
975
- x(this, "dbName");
976
- x(this, "version");
977
- x(this, "db", null);
974
+ L(this, "table");
975
+ L(this, "dbName");
976
+ L(this, "version");
977
+ L(this, "db", null);
978
978
  this.table = e, this.dbName = t, this.version = s;
979
979
  }
980
980
  close() {
@@ -984,8 +984,8 @@ class Ss {
984
984
  return this.db ? Promise.resolve(this.db) : new Promise((e, t) => {
985
985
  const s = indexedDB.open(this.dbName, this.version);
986
986
  s.onupgradeneeded = (r) => {
987
- const o = r.target.result;
988
- o.objectStoreNames.contains(this.table) || o.createObjectStore(this.table, {
987
+ const i = r.target.result;
988
+ i.objectStoreNames.contains(this.table) || i.createObjectStore(this.table, {
989
989
  keyPath: "id",
990
990
  autoIncrement: !0
991
991
  });
@@ -1021,27 +1021,27 @@ class Ss {
1021
1021
  const s = typeof e == "number" ? t : e;
1022
1022
  if (!s)
1023
1023
  throw new Error("IndexedDBClient.update requires a value payload");
1024
- const r = typeof e == "number" ? { ...s, id: s.id ?? e } : s, o = await this.transaction("readwrite");
1025
- return await this.request(o.put(r)), r;
1024
+ const r = typeof e == "number" ? { ...s, id: s.id ?? e } : s, i = await this.transaction("readwrite");
1025
+ return await this.request(i.put(r)), r;
1026
1026
  }
1027
1027
  async get(e, t) {
1028
- var f;
1029
- const s = await this.transaction("readonly"), r = await this.request(s.getAll()), o = this.applyFilter(r, t), i = (e == null ? void 0 : e.sortingBy) ?? "id", c = ((f = e == null ? void 0 : e.sortingOrder) == null ? void 0 : f.toLowerCase()) ?? "asc";
1030
- o.sort((p, y) => {
1031
- const g = p[i], b = y[i];
1028
+ var h;
1029
+ const s = await this.transaction("readonly"), r = await this.request(s.getAll()), i = this.applyFilter(r, t), o = (e == null ? void 0 : e.sortingBy) ?? "id", c = ((h = e == null ? void 0 : e.sortingOrder) == null ? void 0 : h.toLowerCase()) ?? "asc";
1030
+ i.sort((p, y) => {
1031
+ const g = p[o], b = y[o];
1032
1032
  return g < b ? c === "asc" ? -1 : 1 : g > b ? c === "asc" ? 1 : -1 : 0;
1033
1033
  });
1034
- const a = (e == null ? void 0 : e.pageSize) ?? 10, l = (e == null ? void 0 : e.currentPage) ?? 0, d = o.length, u = Math.ceil(d / a), m = o.slice(
1035
- l * a,
1036
- l * a + a
1034
+ const a = (e == null ? void 0 : e.pageSize) ?? 10, u = (e == null ? void 0 : e.currentPage) ?? 0, l = i.length, d = Math.ceil(l / a), m = i.slice(
1035
+ u * a,
1036
+ u * a + a
1037
1037
  );
1038
1038
  return {
1039
- sort: i,
1039
+ sort: o,
1040
1040
  order: c,
1041
- currentPage: l,
1041
+ currentPage: u,
1042
1042
  pageSize: a,
1043
- totalElements: d,
1044
- totalPages: u,
1043
+ totalElements: l,
1044
+ totalPages: d,
1045
1045
  items: m
1046
1046
  };
1047
1047
  }
@@ -1069,8 +1069,8 @@ class Ss {
1069
1069
  const t = await this.transaction("readwrite");
1070
1070
  let s = 0;
1071
1071
  for (const r of e) {
1072
- const o = await this.request(t.get(r));
1073
- o && (await this.request(t.put({ ...o, deletedAt: /* @__PURE__ */ new Date() })), s++);
1072
+ const i = await this.request(t.get(r));
1073
+ i && (await this.request(t.put({ ...i, deletedAt: /* @__PURE__ */ new Date() })), s++);
1074
1074
  }
1075
1075
  return s;
1076
1076
  }
@@ -1078,17 +1078,17 @@ class Ss {
1078
1078
  const t = await this.transaction("readwrite");
1079
1079
  let s = 0;
1080
1080
  for (const r of e) {
1081
- const o = await this.request(t.get(r));
1082
- o && (await this.request(t.put({ ...o, deletedAt: null })), s++);
1081
+ const i = await this.request(t.get(r));
1082
+ i && (await this.request(t.put({ ...i, deletedAt: null })), s++);
1083
1083
  }
1084
1084
  return s;
1085
1085
  }
1086
1086
  applyFilter(e, t) {
1087
1087
  return t ? e.filter(
1088
1088
  (s) => Object.entries(t).every(
1089
- ([r, o]) => this.matchesFilterValue(
1089
+ ([r, i]) => this.matchesFilterValue(
1090
1090
  r,
1091
- o,
1091
+ i,
1092
1092
  s[r]
1093
1093
  )
1094
1094
  )
@@ -1103,13 +1103,13 @@ class Ss {
1103
1103
  return s === t;
1104
1104
  }
1105
1105
  }
1106
- function vs(n) {
1106
+ function $s(n) {
1107
1107
  return Object.keys(n).filter((e) => isNaN(Number(e))).map((e) => ({
1108
1108
  key: e,
1109
1109
  value: n[e]
1110
1110
  }));
1111
1111
  }
1112
- const z = (n, e = "") => {
1112
+ const X = (n, e = "") => {
1113
1113
  const t = localStorage.getItem(n) ?? void 0;
1114
1114
  if (t && e.length)
1115
1115
  switch (e) {
@@ -1123,11 +1123,11 @@ const z = (n, e = "") => {
1123
1123
  return t;
1124
1124
  }
1125
1125
  return t;
1126
- }, B = (n, e) => localStorage.setItem(
1126
+ }, W = (n, e) => localStorage.setItem(
1127
1127
  n,
1128
1128
  typeof e == "object" ? JSON.stringify(e) : e
1129
- ), M = (n) => localStorage.removeItem(n);
1130
- function Cs(n) {
1129
+ ), P = (n) => localStorage.removeItem(n);
1130
+ function xs(n) {
1131
1131
  const e = n ? new Date(n) : /* @__PURE__ */ new Date(), t = {
1132
1132
  weekday: "long",
1133
1133
  // martes
@@ -1149,41 +1149,41 @@ function Cs(n) {
1149
1149
  t
1150
1150
  );
1151
1151
  }
1152
- function Ts(n) {
1153
- const e = n ? new Date(n) : /* @__PURE__ */ new Date(), t = String(e.getDate()).padStart(2, "0"), s = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getFullYear()).slice(-2), o = String(e.getHours()).padStart(2, "0"), i = String(e.getMinutes()).padStart(2, "0");
1154
- return `${t}/${s}/${r} ${o}:${i}`;
1152
+ function As(n) {
1153
+ const e = n ? new Date(n) : /* @__PURE__ */ new Date(), t = String(e.getDate()).padStart(2, "0"), s = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getFullYear()).slice(-2), i = String(e.getHours()).padStart(2, "0"), o = String(e.getMinutes()).padStart(2, "0");
1154
+ return `${t}/${s}/${r} ${i}:${o}`;
1155
1155
  }
1156
- function Ns(n) {
1157
- const e = n ? new Date(n) : /* @__PURE__ */ new Date(), t = e.getFullYear(), s = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0"), o = String(e.getHours()).padStart(2, "0"), i = String(e.getMinutes()).padStart(2, "0");
1158
- return `${t}-${s}-${r}T${o}:${i}`;
1156
+ function Ls(n) {
1157
+ const e = n ? new Date(n) : /* @__PURE__ */ new Date(), t = e.getFullYear(), s = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0"), i = String(e.getHours()).padStart(2, "0"), o = String(e.getMinutes()).padStart(2, "0");
1158
+ return `${t}-${s}-${r}T${i}:${o}`;
1159
1159
  }
1160
- const Dt = () => {
1160
+ const qt = () => {
1161
1161
  var t;
1162
1162
  const n = navigator, e = ((t = n == null ? void 0 : n.userAgentData) == null ? void 0 : t.platform) || (n == null ? void 0 : n.platform) || "";
1163
1163
  return /Mac|iPhone|iPod|iPad/i.test(e);
1164
1164
  };
1165
- function de(n) {
1165
+ function he(n) {
1166
1166
  if (!n || typeof n != "object") return !1;
1167
1167
  const e = n;
1168
1168
  return Array.isArray(e.errors) && e.errors.every(
1169
1169
  (t) => Array.isArray(t) && t.length === 2 && typeof t[0] == "string"
1170
1170
  );
1171
1171
  }
1172
- function me(n) {
1172
+ function fe(n) {
1173
1173
  if (!n || typeof n != "object") return !1;
1174
1174
  const e = n;
1175
1175
  return typeof (e == null ? void 0 : e.status) == "number" && typeof (e == null ? void 0 : e.message) == "string";
1176
1176
  }
1177
- function Es(n, e) {
1177
+ function _s(n, e) {
1178
1178
  return n != null && n.errors ? n.errors.map(([t, s]) => e(t, s)) : [];
1179
1179
  }
1180
- const Fe = te(
1180
+ const Ke = re(
1181
1181
  void 0
1182
1182
  );
1183
- function $s(n) {
1184
- const { children: e } = n, t = H(0), [s, r] = Ae(
1185
- (m, f) => {
1186
- const { type: p, items: y, id: g } = f;
1183
+ function Rs(n) {
1184
+ const { children: e } = n, t = M(0), [s, r] = Le(
1185
+ (m, h) => {
1186
+ const { type: p, items: y, id: g } = h;
1187
1187
  switch (p) {
1188
1188
  case "set":
1189
1189
  return y ?? [];
@@ -1194,46 +1194,46 @@ function $s(n) {
1194
1194
  },
1195
1195
  [],
1196
1196
  () => []
1197
- ), o = (m) => m.map((f) => ({ ...f, id: t.current++ })), i = w(
1197
+ ), i = (m) => m.map((h) => ({ ...h, id: t.current++ })), o = w(
1198
1198
  (m) => r({
1199
1199
  type: "set",
1200
- items: o([{ ...m, type: R.error }])
1200
+ items: i([{ ...m, type: R.error }])
1201
1201
  }),
1202
1202
  []
1203
1203
  ), c = w(
1204
- (m) => r({ type: "set", items: o([{ ...m }]) }),
1204
+ (m) => r({ type: "set", items: i([{ ...m }]) }),
1205
1205
  []
1206
1206
  ), a = w(
1207
- (m) => r({ type: "set", items: o(m) }),
1207
+ (m) => r({ type: "set", items: i(m) }),
1208
1208
  []
1209
- ), l = w(
1209
+ ), u = w(
1210
1210
  (m) => r({
1211
1211
  type: "set",
1212
- items: o([{ ...m, type: R.success }])
1212
+ items: i([{ ...m, type: R.success }])
1213
1213
  }),
1214
1214
  []
1215
- ), d = (m) => r({ type: "remove", id: m }), u = Q(() => ({
1215
+ ), l = (m) => r({ type: "remove", id: m }), d = Q(() => ({
1216
1216
  notification: s,
1217
- removeNotification: d,
1218
- showErrorNotification: i,
1217
+ removeNotification: l,
1218
+ showErrorNotification: o,
1219
1219
  showNotification: c,
1220
- showSuccessNotification: l,
1220
+ showSuccessNotification: u,
1221
1221
  showStackNotifications: a
1222
1222
  }), [
1223
1223
  s,
1224
- i,
1224
+ o,
1225
1225
  c,
1226
1226
  a,
1227
- l
1227
+ u
1228
1228
  ]);
1229
- return /* @__PURE__ */ h(Fe.Provider, { value: u, children: e });
1229
+ return /* @__PURE__ */ f(Ke.Provider, { value: d, children: e });
1230
1230
  }
1231
- const J = () => {
1232
- const n = se(Fe);
1231
+ const ee = () => {
1232
+ const n = ie(Ke);
1233
1233
  if (!n)
1234
1234
  throw new Error("NotificationContext must be used within a Provider");
1235
1235
  return n;
1236
- }, Oe = () => new Ct({
1236
+ }, qe = () => new xt({
1237
1237
  defaultOptions: {
1238
1238
  queries: {
1239
1239
  refetchInterval: !1,
@@ -1245,102 +1245,102 @@ const J = () => {
1245
1245
  // default: true
1246
1246
  }
1247
1247
  }
1248
- }), xs = Oe(), Ke = te(
1248
+ }), Is = qe(), Ue = re(
1249
1249
  void 0
1250
- ), As = (n) => {
1251
- const { children: e, manager: t, queryClient: s } = n, [r] = A(Oe), o = s ?? r;
1252
- return /* @__PURE__ */ h(Ke.Provider, { value: { client: t }, children: /* @__PURE__ */ h(Tt, { client: o, children: e }) });
1253
- }, Ft = () => {
1254
- const n = se(Ke);
1250
+ ), Fs = (n) => {
1251
+ const { children: e, manager: t, queryClient: s } = n, [r] = _(qe), i = s ?? r;
1252
+ return /* @__PURE__ */ f(Ue.Provider, { value: { client: t }, children: /* @__PURE__ */ f(At, { client: i, children: e }) });
1253
+ }, Ut = () => {
1254
+ const n = ie(Ue);
1255
1255
  if (!n)
1256
1256
  throw new Error("managerContext must be used within a Provider");
1257
1257
  return n.client;
1258
- }, qe = te(
1258
+ }, je = re(
1259
1259
  void 0
1260
- ), Ls = (n) => {
1260
+ ), Os = (n) => {
1261
1261
  const {
1262
1262
  children: e,
1263
1263
  guestMode: t = "guest_mode",
1264
1264
  user: s = "user",
1265
1265
  remember: r = "remember",
1266
- refreshTokenKey: o = "refreshToken",
1267
- accessTokenExpiresAtKey: i = "accessTokenExpiresAt"
1268
- } = n, c = Ft(), [a, l] = A({}), d = w(() => {
1269
- M(s), M(r), M(o), M(i);
1270
- }, [i, o, r, s]), u = w(() => !!z(t, "boolean") && a.token === void 0, [a.token, t]), m = w(
1266
+ refreshTokenKey: i = "refreshToken",
1267
+ accessTokenExpiresAtKey: o = "accessTokenExpiresAt"
1268
+ } = n, c = Ut(), [a, u] = _({}), l = w(() => {
1269
+ P(s), P(r), P(i), P(o);
1270
+ }, [o, i, r, s]), d = w(() => !!X(t, "boolean") && a.token === void 0, [a.token, t]), m = w(
1271
1271
  (b) => {
1272
- B(t, b);
1272
+ W(t, b);
1273
1273
  },
1274
1274
  [t]
1275
- ), f = w(
1276
- (b, T) => {
1275
+ ), h = w(
1276
+ (b, S) => {
1277
1277
  if (!b) return;
1278
- const N = z(r, "boolean"), C = T ?? (typeof N == "boolean" ? N : !1);
1279
- l(b), M(t), B(s, b.token), B(r, C), typeof b.refreshToken == "string" && b.refreshToken.length ? B(o, b.refreshToken) : M(o), typeof b.accessTokenExpiresAt == "string" && b.accessTokenExpiresAt.length ? B(i, b.accessTokenExpiresAt) : M(i);
1278
+ const E = X(r, "boolean"), v = S ?? (typeof E == "boolean" ? E : !1);
1279
+ u(b), P(t), W(s, b.token), W(r, v), typeof b.refreshToken == "string" && b.refreshToken.length ? W(i, b.refreshToken) : P(i), typeof b.accessTokenExpiresAt == "string" && b.accessTokenExpiresAt.length ? W(o, b.accessTokenExpiresAt) : P(o);
1280
1280
  },
1281
- [i, t, o, r, s]
1281
+ [o, t, i, r, s]
1282
1282
  ), p = w(async () => {
1283
- const b = z(s) ?? a.token, T = z(o) ?? (typeof a.refreshToken == "string" ? a.refreshToken : void 0);
1283
+ const b = X(s) ?? a.token, S = X(i) ?? (typeof a.refreshToken == "string" ? a.refreshToken : void 0);
1284
1284
  try {
1285
1285
  await c.Auth.logout({
1286
1286
  accessToken: b,
1287
- refreshToken: T
1287
+ refreshToken: S
1288
1288
  });
1289
- } catch (N) {
1290
- console.error(N);
1289
+ } catch (E) {
1290
+ console.error(E);
1291
1291
  }
1292
- l({}), d();
1292
+ u({}), l();
1293
1293
  }, [
1294
1294
  a.refreshToken,
1295
1295
  a.token,
1296
- d,
1296
+ l,
1297
1297
  c.Auth,
1298
- o,
1298
+ i,
1299
1299
  s
1300
1300
  ]), y = w(async () => {
1301
1301
  try {
1302
1302
  const b = await c.Auth.getSession();
1303
- f(b);
1303
+ h(b);
1304
1304
  } catch (b) {
1305
1305
  console.error(b), p();
1306
1306
  }
1307
- }, [f, p, c.Auth]), g = Q(() => ({
1307
+ }, [h, p, c.Auth]), g = Q(() => ({
1308
1308
  account: a,
1309
- logUser: f,
1309
+ logUser: h,
1310
1310
  logoutUser: p,
1311
1311
  logUserFromLocal: y,
1312
- isInGuestMode: u,
1312
+ isInGuestMode: d,
1313
1313
  setGuestMode: m
1314
1314
  }), [
1315
1315
  a,
1316
- f,
1316
+ h,
1317
1317
  p,
1318
1318
  y,
1319
- u,
1319
+ d,
1320
1320
  m
1321
1321
  ]);
1322
- return /* @__PURE__ */ h(qe.Provider, { value: g, children: e });
1323
- }, Ue = () => {
1324
- const n = se(qe);
1322
+ return /* @__PURE__ */ f(je.Provider, { value: g, children: e });
1323
+ }, He = () => {
1324
+ const n = ie(je);
1325
1325
  if (!n) throw new Error("authContext must be used within a Provider");
1326
1326
  return n;
1327
- }, je = te({}), _s = (n) => {
1328
- const { children: e, location: t, navigate: s, linkComponent: r, searchComponent: o } = n;
1329
- return /* @__PURE__ */ h(
1330
- je.Provider,
1327
+ }, Qe = re({}), Ms = (n) => {
1328
+ const { children: e, location: t, navigate: s, linkComponent: r, searchComponent: i } = n;
1329
+ return /* @__PURE__ */ f(
1330
+ Qe.Provider,
1331
1331
  {
1332
- value: { location: t, navigate: s, linkComponent: r, searchComponent: o },
1332
+ value: { location: t, navigate: s, linkComponent: r, searchComponent: i },
1333
1333
  children: e
1334
1334
  }
1335
1335
  );
1336
- }, ae = () => {
1337
- const n = se(je);
1336
+ }, ce = () => {
1337
+ const n = ie(Qe);
1338
1338
  if (n === void 0 || Object.keys(n).length === 0)
1339
1339
  throw new Error(
1340
1340
  "Config provider has not been set. This step is required and cannot be skipped."
1341
1341
  );
1342
1342
  return n;
1343
- }, Ot = {
1343
+ }, jt = {
1344
1344
  addChildItem: () => {
1345
1345
  },
1346
1346
  removeChildItem: () => {
@@ -1348,48 +1348,48 @@ const J = () => {
1348
1348
  clearDynamicItems: () => {
1349
1349
  },
1350
1350
  dynamicItems: {}
1351
- }, He = te(
1352
- Ot
1353
- ), Rs = (n) => {
1354
- const { children: e } = n, [t, s] = A({}), r = w(
1355
- (a, l) => s((d) => ({
1356
- ...d,
1357
- [a]: [...d[a] ?? [], l]
1351
+ }, Ve = re(
1352
+ jt
1353
+ ), Ds = (n) => {
1354
+ const { children: e } = n, [t, s] = _({}), r = w(
1355
+ (a, u) => s((l) => ({
1356
+ ...l,
1357
+ [a]: [...l[a] ?? [], u]
1358
1358
  })),
1359
1359
  []
1360
- ), o = w(
1361
- (a, l) => s((d) => ({
1362
- ...d,
1363
- [a]: (d[a] ?? []).filter((u, m) => m !== l)
1360
+ ), i = w(
1361
+ (a, u) => s((l) => ({
1362
+ ...l,
1363
+ [a]: (l[a] ?? []).filter((d, m) => m !== u)
1364
1364
  })),
1365
1365
  []
1366
- ), i = w((a) => {
1367
- s(a ? (l) => ({
1368
- ...l,
1366
+ ), o = w((a) => {
1367
+ s(a ? (u) => ({
1368
+ ...u,
1369
1369
  [a]: []
1370
1370
  }) : {});
1371
1371
  }, []), c = Q(
1372
1372
  () => ({
1373
1373
  dynamicItems: t,
1374
1374
  addChildItem: r,
1375
- removeChildItem: o,
1376
- clearDynamicItems: i
1375
+ removeChildItem: i,
1376
+ clearDynamicItems: o
1377
1377
  }),
1378
- [t, i, o, r]
1378
+ [t, o, i, r]
1379
1379
  );
1380
- return /* @__PURE__ */ h(
1381
- He.Provider,
1380
+ return /* @__PURE__ */ f(
1381
+ Ve.Provider,
1382
1382
  {
1383
1383
  value: c,
1384
1384
  children: e
1385
1385
  }
1386
1386
  );
1387
- }, Kt = () => se(He);
1388
- function Is(n) {
1389
- const { t: e } = v(), { open: t, onClose: s, menuMap: r, logo: o } = n, { account: i } = Ue(), { dynamicItems: c } = Kt(), { linkComponent: a, location: l } = ae(), d = a, u = Q(() => r.filter((g) => {
1390
- const b = g.auth, T = !!(i != null && i.email);
1391
- return b == null || b && T || !b && !T;
1392
- }), [i == null ? void 0 : i.email, r]), m = w(
1387
+ }, Ht = () => ie(Ve);
1388
+ function Ps(n) {
1389
+ const { t: e } = N(), { open: t, onClose: s, menuMap: r, logo: i } = n, { account: o } = He(), { dynamicItems: c } = Ht(), { linkComponent: a, location: u } = ce(), l = a, d = Q(() => r.filter((g) => {
1390
+ const b = g.auth, S = !!(o != null && o.email);
1391
+ return b == null || b && S || !b && !S;
1392
+ }), [o == null ? void 0 : o.email, r]), m = w(
1393
1393
  (g) => {
1394
1394
  g.key === "Escape" && t && s();
1395
1395
  },
@@ -1398,16 +1398,16 @@ function Is(n) {
1398
1398
  O(() => (document.addEventListener("keydown", m), () => {
1399
1399
  document.removeEventListener("keydown", m);
1400
1400
  }), [m]);
1401
- const f = w(
1402
- (g, b) => b ? g === `${l.pathname}${l.search}` : g === l.pathname,
1403
- [l.pathname, l.search]
1401
+ const h = w(
1402
+ (g, b) => b ? g === `${u.pathname}${u.search}` : g === u.pathname,
1403
+ [u.pathname, u.search]
1404
1404
  ), p = w(
1405
- (g) => /* @__PURE__ */ h(
1405
+ (g) => /* @__PURE__ */ f(
1406
1406
  "li",
1407
1407
  {
1408
- className: `drawer-list-item-child ${f(g.path, !0) ? "active" : ""} animated`,
1409
- children: g.path ? /* @__PURE__ */ h(
1410
- d,
1408
+ className: `drawer-list-item-child ${h(g.path, !0) ? "active" : ""} animated`,
1409
+ children: g.path ? /* @__PURE__ */ f(
1410
+ l,
1411
1411
  {
1412
1412
  tabIndex: t ? 0 : -1,
1413
1413
  to: g.path ?? "/",
@@ -1421,15 +1421,15 @@ function Is(n) {
1421
1421
  },
1422
1422
  g.id
1423
1423
  ),
1424
- [d, t, e, f]
1425
- ), y = Q(() => u.map((g, b) => {
1426
- const T = g.page ?? String(b), N = `drawer-list-item ${f(g.path) ? "active" : ""} animated`;
1424
+ [l, t, e, h]
1425
+ ), y = Q(() => d.map((g, b) => {
1426
+ const S = g.page ?? String(b), E = `drawer-list-item ${h(g.path) ? "active" : ""} animated`;
1427
1427
  if (g.type === "divider")
1428
- return /* @__PURE__ */ h("li", { className: N, children: /* @__PURE__ */ h("hr", { className: "drawer-divider" }) }, T);
1429
- const C = g.children ?? (g.page && c ? c[g.page] : null);
1430
- return /* @__PURE__ */ k("li", { className: N, children: [
1428
+ return /* @__PURE__ */ f("li", { className: E, children: /* @__PURE__ */ f("hr", { className: "drawer-divider" }) }, S);
1429
+ const v = g.children ?? (g.page && c ? c[g.page] : null);
1430
+ return /* @__PURE__ */ k("li", { className: E, children: [
1431
1431
  /* @__PURE__ */ k(
1432
- d,
1432
+ l,
1433
1433
  {
1434
1434
  tabIndex: t ? 0 : -1,
1435
1435
  to: g.path ?? "/",
@@ -1443,10 +1443,10 @@ function Is(n) {
1443
1443
  ]
1444
1444
  }
1445
1445
  ),
1446
- C && /* @__PURE__ */ h("ul", { className: "drawer-children-list", children: C.map(p) })
1447
- ] }, T);
1448
- }), [d, c, f, t, u, p, e]);
1449
- return /* @__PURE__ */ h(
1446
+ v && /* @__PURE__ */ f("ul", { className: "drawer-children-list", children: v.map(p) })
1447
+ ] }, S);
1448
+ }), [l, c, h, t, d, p, e]);
1449
+ return /* @__PURE__ */ f(
1450
1450
  "div",
1451
1451
  {
1452
1452
  "aria-label": e("_accessibility:ariaLabels.closeMenu"),
@@ -1455,53 +1455,53 @@ function Is(n) {
1455
1455
  onClick: () => s(),
1456
1456
  children: /* @__PURE__ */ k("aside", { className: `${t ? "opened" : "closed"} drawer animated`, children: [
1457
1457
  /* @__PURE__ */ k("div", { className: "drawer-header-container", children: [
1458
- o,
1459
- /* @__PURE__ */ h("h2", { className: "drawer-header poppins", children: e("_pages:home.appName") })
1458
+ i,
1459
+ /* @__PURE__ */ f("h2", { className: "drawer-header poppins", children: e("_pages:home.appName") })
1460
1460
  ] }),
1461
- /* @__PURE__ */ h("ul", { className: "drawer-menu-list", children: y })
1461
+ /* @__PURE__ */ f("ul", { className: "drawer-menu-list", children: y })
1462
1462
  ] })
1463
1463
  }
1464
1464
  );
1465
1465
  }
1466
- const V = ({ icon: n, ...e }) => /* @__PURE__ */ h(nt, { icon: /* @__PURE__ */ h(F, { icon: n }), ...e });
1467
- var pe, Ee;
1468
- function qt() {
1469
- if (Ee) return pe;
1470
- Ee = 1;
1471
- const n = (c, a = "local", l = void 0) => {
1466
+ const G = ({ icon: n, ...e }) => /* @__PURE__ */ f(ct, { icon: /* @__PURE__ */ f(K, { icon: n }), ...e });
1467
+ var we, $e;
1468
+ function Qt() {
1469
+ if ($e) return we;
1470
+ $e = 1;
1471
+ const n = (c, a = "local", u = void 0) => {
1472
1472
  if (a === "local") {
1473
1473
  if (localStorage.getItem(c) !== void 0 && localStorage.getItem(c) !== "undefined" && localStorage.getItem(c) !== null)
1474
- return l === void 0 || l !== void 0 && localStorage.getItem(c) === l;
1474
+ return u === void 0 || u !== void 0 && localStorage.getItem(c) === u;
1475
1475
  } else if (a === "session" && sessionStorage.getItem(c) !== void 0 && sessionStorage.getItem(c) !== "undefined" && sessionStorage.getItem(c) !== null)
1476
- return l === void 0 || l !== void 0 && sessionStorage.getItem(c) === l;
1476
+ return u === void 0 || u !== void 0 && sessionStorage.getItem(c) === u;
1477
1477
  return !1;
1478
1478
  }, e = (c) => {
1479
1479
  const a = {};
1480
- return c.substring(1).split("&").forEach((d) => {
1481
- const [u, m] = d.split("=");
1482
- a[u] = m;
1480
+ return c.substring(1).split("&").forEach((l) => {
1481
+ const [d, m] = l.split("=");
1482
+ a[d] = m;
1483
1483
  }), a;
1484
1484
  }, t = (c = "") => {
1485
- if (o(c) && c.length) return o(c);
1485
+ if (i(c) && c.length) return i(c);
1486
1486
  {
1487
1487
  let a = navigator.language || navigator.userLanguage;
1488
1488
  if (a.indexOf("en") < 0 && a.indexOf("es") < 0 && (a = "en-US"), a = a.split("-")[0], a)
1489
1489
  return c.length && r(c, 730, a), a;
1490
1490
  }
1491
1491
  return "en";
1492
- }, s = (c = 0, a = 0, l = window, d = "smooth") => l.scroll({
1492
+ }, s = (c = 0, a = 0, u = window, l = "smooth") => u.scroll({
1493
1493
  top: c,
1494
1494
  left: a,
1495
- behavior: d
1496
- }), r = (c, a, l, d = "/", u = "Lax") => {
1495
+ behavior: l
1496
+ }), r = (c, a, u, l = "/", d = "Lax") => {
1497
1497
  var m = /* @__PURE__ */ new Date();
1498
1498
  m.setTime(m.getTime() + a * 24 * 60 * 60 * 1e3);
1499
- const f = "; expires=" + m.toUTCString();
1500
- document.cookie = `${c}=${l || ""}${f};path=${d};SameSite=${u}`;
1501
- }, o = (c) => {
1502
- const a = `${c}=`, d = decodeURIComponent(document.cookie).split(";");
1503
- for (let u = 0; u < d.length; u += 1) {
1504
- let m = d[u];
1499
+ const h = "; expires=" + m.toUTCString();
1500
+ document.cookie = `${c}=${u || ""}${h};path=${l};SameSite=${d}`;
1501
+ }, i = (c) => {
1502
+ const a = `${c}=`, l = decodeURIComponent(document.cookie).split(";");
1503
+ for (let d = 0; d < l.length; d += 1) {
1504
+ let m = l[d];
1505
1505
  for (; m.charAt(0) === " "; )
1506
1506
  m = m.substring(1);
1507
1507
  if (m.indexOf(a) === 0)
@@ -1509,23 +1509,23 @@ function qt() {
1509
1509
  }
1510
1510
  return "";
1511
1511
  };
1512
- return pe = {
1513
- getCookie: o,
1512
+ return we = {
1513
+ getCookie: i,
1514
1514
  createCookie: r,
1515
1515
  deleteCookie: (c) => document.cookie = `${c}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`,
1516
1516
  getUserLanguage: t,
1517
1517
  scrollTo: s,
1518
1518
  parseQueries: e,
1519
1519
  validation: n
1520
- }, pe;
1520
+ }, we;
1521
1521
  }
1522
- var Ut = qt();
1523
- function Ps() {
1524
- const { t: n, language: e } = v();
1522
+ var Vt = Qt();
1523
+ function Ks() {
1524
+ const { t: n, language: e } = N();
1525
1525
  return { timeAge: w(
1526
1526
  (s) => {
1527
- const o = /* @__PURE__ */ new Date() - s, i = Math.floor(o / (1e3 * 60)), c = Math.floor(i / 60), a = e === "es", l = n("_accessibility:labels.ago"), d = n("_accessibility:labels.minute"), u = n("_accessibility:labels.minutes"), m = n("_accessibility:labels.hour"), f = n("_accessibility:labels.hours"), p = n("_accessibility:labels.yesterday"), y = n("_accessibility:labels.justNow");
1528
- return o < 1e3 * 60 ? y : i < 60 ? `${a ? l : ""} ${i} ${i === 1 ? d : u} ${a ? "" : l}` : c < 24 ? `${a ? l : ""} ${c} ${c === 1 ? m : f} ${a ? "" : l}` : c < 48 ? p : s.toLocaleDateString(navigator.language || "es-ES", {
1527
+ const i = /* @__PURE__ */ new Date() - s, o = Math.floor(i / (1e3 * 60)), c = Math.floor(o / 60), a = e === "es", u = n("_accessibility:labels.ago"), l = n("_accessibility:labels.minute"), d = n("_accessibility:labels.minutes"), m = n("_accessibility:labels.hour"), h = n("_accessibility:labels.hours"), p = n("_accessibility:labels.yesterday"), y = n("_accessibility:labels.justNow");
1528
+ return i < 1e3 * 60 ? y : o < 60 ? `${a ? u : ""} ${o} ${o === 1 ? l : d} ${a ? "" : u}` : c < 24 ? `${a ? u : ""} ${c} ${c === 1 ? m : h} ${a ? "" : u}` : c < 48 ? p : s.toLocaleDateString(navigator.language || "es-ES", {
1529
1529
  day: "2-digit",
1530
1530
  month: "2-digit",
1531
1531
  year: "numeric"
@@ -1534,257 +1534,257 @@ function Ps() {
1534
1534
  [n, e]
1535
1535
  ) };
1536
1536
  }
1537
- const Qe = (n) => {
1538
- const { showSuccessNotification: e } = J(), { mutationFn: t, onError: s, onSuccess: r, onSuccessMessage: o } = n, [i, c] = A([]), { open: a, handleClose: l, handleOpen: d } = Be(), u = () => {
1539
- l(), c([]);
1537
+ const Be = (n) => {
1538
+ const { showSuccessNotification: e } = ee(), { mutationFn: t, onError: s, onSuccess: r, onSuccessMessage: i } = n, [o, c] = _([]), { open: a, handleClose: u, handleOpen: l } = We(), d = () => {
1539
+ u(), c([]);
1540
1540
  }, m = async (p) => {
1541
- c(p), d();
1542
- }, f = ie({
1541
+ c(p), l();
1542
+ }, h = Z({
1543
1543
  mutationFn: () => t(
1544
- Array.isArray(i) ? i : [i]
1544
+ Array.isArray(o) ? o : [o]
1545
1545
  ),
1546
1546
  onError: (p) => {
1547
- console.error(p), s && s(p), u();
1547
+ console.error(p), s && s(p), d();
1548
1548
  },
1549
1549
  onSuccess: async (p) => {
1550
1550
  r && r(p), e({
1551
- message: o
1552
- }), u();
1551
+ message: i
1552
+ }), d();
1553
1553
  }
1554
1554
  });
1555
- return { open: a, onClick: m, close: u, dialogFn: f, isLoading: f.isPending };
1556
- }, Ms = (n) => {
1557
- const { t: e } = v(), {
1555
+ return { open: a, onClick: m, close: d, dialogFn: h, isLoading: h.isPending };
1556
+ }, qs = (n) => {
1557
+ const { t: e } = N(), {
1558
1558
  showStackNotifications: t,
1559
1559
  showSuccessNotification: s,
1560
1560
  showErrorNotification: r
1561
- } = J(), o = ne(), {
1562
- defaultValues: i,
1561
+ } = ee(), i = J(), {
1562
+ defaultValues: o,
1563
1563
  mutationFn: c,
1564
1564
  formToDto: a,
1565
- onError: l,
1566
- onSuccess: d,
1567
- queryKey: u,
1565
+ onError: u,
1566
+ onSuccess: l,
1567
+ queryKey: d,
1568
1568
  onSuccessMessage: m
1569
- } = n, { control: f, handleSubmit: p, reset: y, setError: g, getValues: b, setValue: T } = Pe({
1570
- defaultValues: i
1571
- }), N = H(null), C = w(() => {
1572
- const S = document.activeElement;
1573
- if (!(S instanceof HTMLElement)) {
1574
- N.current = null;
1569
+ } = n, { control: h, handleSubmit: p, reset: y, setError: g, getValues: b, setValue: S } = Me({
1570
+ defaultValues: o
1571
+ }), E = M(null), v = w(() => {
1572
+ const C = document.activeElement;
1573
+ if (!(C instanceof HTMLElement)) {
1574
+ E.current = null;
1575
1575
  return;
1576
1576
  }
1577
- N.current = S.closest("form");
1578
- }, []), D = w(
1579
- (S) => {
1580
- const _ = S == null ? void 0 : S.errors, E = [], P = N.current;
1581
- if (!P) return E;
1582
- let ce = !1;
1583
- return _ && _.forEach(([Y, he]) => {
1584
- const G = P.querySelector(`[name="${Y}"]`);
1585
- (G instanceof HTMLInputElement || G instanceof HTMLTextAreaElement || G instanceof HTMLSelectElement) && (ce || (G.focus(), ce = !0), G.classList.add("error"), E.push(e(`_entities:${u}.${Y}.${he}`)));
1586
- }), E;
1577
+ E.current = C.closest("form");
1578
+ }, []), $ = w(
1579
+ (C) => {
1580
+ const A = C == null ? void 0 : C.errors, x = [], q = E.current;
1581
+ if (!q) return x;
1582
+ let V = !1;
1583
+ return A && A.forEach(([le, ge]) => {
1584
+ const B = q.querySelector(`[name="${le}"]`);
1585
+ (B instanceof HTMLInputElement || B instanceof HTMLTextAreaElement || B instanceof HTMLSelectElement) && (V || (B.focus(), V = !0), B.classList.add("error"), x.push(e(`_entities:${d}.${le}.${ge}`)));
1586
+ }), x;
1587
1587
  },
1588
- [e, u]
1589
- ), q = w(() => {
1590
- const S = N.current;
1591
- if (!S) return;
1592
- S.querySelectorAll("input, textarea, select").forEach((E) => {
1593
- E.classList.remove("error");
1588
+ [e, d]
1589
+ ), j = w(() => {
1590
+ const C = E.current;
1591
+ if (!C) return;
1592
+ C.querySelectorAll("input, textarea, select").forEach((x) => {
1593
+ x.classList.remove("error");
1594
1594
  });
1595
- }, []), L = ie(
1595
+ }, []), I = Z(
1596
1596
  {
1597
1597
  mutationFn: c,
1598
- onError: (S) => {
1599
- console.error(S);
1600
- const _ = S;
1601
- if (l) l(S);
1602
- else if (de(_)) {
1603
- const E = D(_);
1598
+ onError: (C) => {
1599
+ console.error(C);
1600
+ const A = C;
1601
+ if (u) u(C);
1602
+ else if (he(A)) {
1603
+ const x = $(A);
1604
1604
  t(
1605
- E.map(
1606
- (P) => ({
1607
- message: P,
1605
+ x.map(
1606
+ (q) => ({
1607
+ message: q,
1608
1608
  type: R.error
1609
1609
  })
1610
1610
  )
1611
1611
  );
1612
- } else if (me(_)) {
1613
- const E = _.message || e("_accessibility:errors.500"), P = e(`_accessibility:errors.${_.status}`);
1614
- r({ message: P || E });
1612
+ } else if (fe(A)) {
1613
+ const x = A.message || e("_accessibility:errors.500"), q = e(`_accessibility:errors.${A.status}`);
1614
+ r({ message: q || x });
1615
1615
  } else
1616
1616
  r({ message: e("_accessibility:errors.500") });
1617
1617
  },
1618
- onSuccess: async (S) => {
1619
- await o.invalidateQueries({ queryKey: u }), d && d(S), m && s({
1618
+ onSuccess: async (C) => {
1619
+ await i.invalidateQueries({ queryKey: d }), l && l(C), m && s({
1620
1620
  message: m
1621
1621
  });
1622
1622
  }
1623
1623
  }
1624
1624
  );
1625
1625
  return {
1626
- control: f,
1626
+ control: h,
1627
1627
  getValues: b,
1628
- setValue: T,
1628
+ setValue: S,
1629
1629
  handleSubmit: p,
1630
- onSubmit: (S) => {
1631
- C(), q(), L.mutate(
1632
- a ? a(S) : S
1630
+ onSubmit: (C) => {
1631
+ v(), j(), I.mutate(
1632
+ a ? a(C) : C
1633
1633
  );
1634
1634
  },
1635
1635
  reset: y,
1636
1636
  setError: g,
1637
- isLoading: L.isPending
1637
+ isLoading: I.isPending
1638
1638
  };
1639
- }, jt = (n) => {
1640
- const { t: e } = v(), {
1639
+ }, Bt = (n) => {
1640
+ const { t: e } = N(), {
1641
1641
  onClick: t,
1642
- icon: s = mt,
1642
+ icon: s = yt,
1643
1643
  sticky: r = !0,
1644
- hidden: o = !1,
1645
- multiple: i = !0,
1644
+ hidden: i = !1,
1645
+ multiple: o = !0,
1646
1646
  disabled: c = !1,
1647
- id: a = W.Delete,
1648
- tooltip: l = e("_pages:common.actions.delete.text")
1647
+ id: a = z.Delete,
1648
+ tooltip: u = e("_pages:common.actions.delete.text")
1649
1649
  } = n;
1650
1650
  return {
1651
1651
  action: w(
1652
- (u) => ({
1652
+ (d) => ({
1653
1653
  id: a,
1654
1654
  sticky: r,
1655
- tooltip: l,
1656
- multiple: i,
1657
- onClick: () => t([u == null ? void 0 : u.id]),
1658
- hidden: !!u.deletedAt || o,
1659
- disabled: !!u.deletedAt || c,
1660
- icon: /* @__PURE__ */ h(F, { className: "text-bg-error", icon: s }),
1661
- onMultipleClick: (m) => t(m.map((f) => f.id))
1655
+ tooltip: u,
1656
+ multiple: o,
1657
+ onClick: () => t([d == null ? void 0 : d.id]),
1658
+ hidden: !!d.deletedAt || i,
1659
+ disabled: !!d.deletedAt || c,
1660
+ icon: /* @__PURE__ */ f(K, { className: "text-bg-error", icon: s }),
1661
+ onMultipleClick: (m) => t(m.map((h) => h.id))
1662
1662
  }),
1663
- [c, o, s, a, i, t, r, l]
1663
+ [c, i, s, a, o, t, r, u]
1664
1664
  )
1665
1665
  };
1666
- }, Ht = (n) => {
1667
- const { t: e } = v(), {
1666
+ }, Wt = (n) => {
1667
+ const { t: e } = N(), {
1668
1668
  onClick: t,
1669
1669
  sticky: s = !0,
1670
1670
  hidden: r = !1,
1671
- disabled: o = !1,
1672
- multiple: i = !1,
1673
- icon: c = _e,
1674
- id: a = W.Restore,
1675
- tooltip: l = e("_pages:common.actions.restore.text")
1671
+ disabled: i = !1,
1672
+ multiple: o = !1,
1673
+ icon: c = Re,
1674
+ id: a = z.Restore,
1675
+ tooltip: u = e("_pages:common.actions.restore.text")
1676
1676
  } = n;
1677
1677
  return {
1678
1678
  action: w(
1679
- (u) => ({
1679
+ (d) => ({
1680
1680
  id: a,
1681
1681
  sticky: s,
1682
- tooltip: l,
1683
- multiple: i,
1684
- onClick: () => t([u == null ? void 0 : u.id]),
1685
- hidden: !u.deletedAt || r,
1686
- disabled: !u.deletedAt || o,
1687
- icon: /* @__PURE__ */ h(F, { className: "text-bg-error", icon: c }),
1688
- onMultipleClick: (m) => t(m.map((f) => f.id))
1682
+ tooltip: u,
1683
+ multiple: o,
1684
+ onClick: () => t([d == null ? void 0 : d.id]),
1685
+ hidden: !d.deletedAt || r,
1686
+ disabled: !d.deletedAt || i,
1687
+ icon: /* @__PURE__ */ f(K, { className: "text-bg-error", icon: c }),
1688
+ onMultipleClick: (m) => t(m.map((h) => h.id))
1689
1689
  }),
1690
- [o, r, c, a, i, t, s, l]
1690
+ [i, r, c, a, o, t, s, u]
1691
1691
  )
1692
1692
  };
1693
- }, Ds = (n) => {
1694
- const { t: e } = v(), {
1693
+ }, Us = (n) => {
1694
+ const { t: e } = N(), {
1695
1695
  onClick: t,
1696
1696
  hidden: s = !1,
1697
1697
  sticky: r = !0,
1698
- disabled: o = !1,
1699
- id: i = W.Edit,
1700
- icon: c = ht,
1698
+ disabled: i = !1,
1699
+ id: o = z.Edit,
1700
+ icon: c = bt,
1701
1701
  tooltip: a = e("_pages:common.actions.edit.text")
1702
1702
  } = n;
1703
1703
  return {
1704
1704
  action: w(
1705
- (d) => ({
1706
- id: i,
1705
+ (l) => ({
1706
+ id: o,
1707
1707
  sticky: r,
1708
1708
  tooltip: a,
1709
- onClick: () => t(d == null ? void 0 : d.id),
1710
- hidden: !!d.deletedAt || s,
1711
- disabled: !!d.deletedAt || o,
1712
- icon: /* @__PURE__ */ h(F, { className: "primary", icon: c })
1709
+ onClick: () => t(l == null ? void 0 : l.id),
1710
+ hidden: !!l.deletedAt || s,
1711
+ disabled: !!l.deletedAt || i,
1712
+ icon: /* @__PURE__ */ f(K, { className: "primary", icon: c })
1713
1713
  }),
1714
- [o, s, c, i, t, r, a]
1714
+ [i, s, c, o, t, r, a]
1715
1715
  )
1716
1716
  };
1717
1717
  };
1718
- var W = /* @__PURE__ */ ((n) => (n.Add = "add", n.Edit = "edit", n.Delete = "delete", n.Restore = "restore", n.Refresh = "refresh", n.Export = "export", n.Import = "import", n))(W || {});
1719
- const Qt = (n) => {
1720
- const { t: e } = v(), {
1718
+ var z = /* @__PURE__ */ ((n) => (n.Add = "add", n.Edit = "edit", n.Delete = "delete", n.Restore = "restore", n.Refresh = "refresh", n.Export = "export", n.Import = "import", n))(z || {});
1719
+ const Gt = (n) => {
1720
+ const { t: e } = N(), {
1721
1721
  onClick: t,
1722
1722
  hidden: s = !1,
1723
1723
  disabled: r = !1,
1724
- isLoading: o = !1
1724
+ isLoading: i = !1
1725
1725
  } = n;
1726
1726
  return {
1727
1727
  action: w(
1728
1728
  () => ({
1729
- id: W.Export,
1729
+ id: z.Export,
1730
1730
  hidden: s,
1731
1731
  disabled: r,
1732
- icon: /* @__PURE__ */ h(
1733
- F,
1732
+ icon: /* @__PURE__ */ f(
1733
+ K,
1734
1734
  {
1735
- className: `${o ? "rotate" : ""}`,
1736
- icon: o ? Re : ft
1735
+ className: `${i ? "rotate" : ""}`,
1736
+ icon: i ? Ie : wt
1737
1737
  }
1738
1738
  ),
1739
1739
  tooltip: e("_pages:common.actions.export.text"),
1740
1740
  onClick: t
1741
1741
  }),
1742
- [r, s, o, t, e]
1742
+ [r, s, i, t, e]
1743
1743
  )
1744
1744
  };
1745
- }, Bt = (n) => {
1746
- const { t: e } = v(), {
1745
+ }, zt = (n) => {
1746
+ const { t: e } = N(), {
1747
1747
  onClick: t,
1748
1748
  hidden: s = !1,
1749
1749
  disabled: r = !1,
1750
- isLoading: o = !1
1750
+ isLoading: i = !1
1751
1751
  } = n;
1752
1752
  return {
1753
1753
  action: w(
1754
1754
  () => ({
1755
- id: W.Import,
1755
+ id: z.Import,
1756
1756
  hidden: s,
1757
1757
  disabled: r,
1758
- icon: /* @__PURE__ */ h(
1759
- F,
1758
+ icon: /* @__PURE__ */ f(
1759
+ K,
1760
1760
  {
1761
- className: `${o ? "rotate" : ""}`,
1762
- icon: o ? Re : pt
1761
+ className: `${i ? "rotate" : ""}`,
1762
+ icon: i ? Ie : St
1763
1763
  }
1764
1764
  ),
1765
1765
  tooltip: e("_pages:common.actions.import.text"),
1766
1766
  onClick: t
1767
1767
  }),
1768
- [r, s, o, t, e]
1768
+ [r, s, i, t, e]
1769
1769
  )
1770
1770
  };
1771
- }, Fs = (n) => {
1772
- const { queryKey: e, onSuccess: t, ...s } = n, r = ne(), { showStackNotifications: o } = J(), { t: i } = v(), { open: c, onClick: a, close: l, dialogFn: d, isLoading: u } = Qe({
1773
- onSuccessMessage: i("_pages:common.actions.delete.successMessage"),
1774
- onError: (f) => {
1775
- const p = f;
1776
- if (de(p))
1777
- o(
1771
+ }, js = (n) => {
1772
+ const { queryKey: e, onSuccess: t, ...s } = n, r = J(), { showStackNotifications: i } = ee(), { t: o } = N(), { open: c, onClick: a, close: u, dialogFn: l, isLoading: d } = Be({
1773
+ onSuccessMessage: o("_pages:common.actions.delete.successMessage"),
1774
+ onError: (h) => {
1775
+ const p = h;
1776
+ if (he(p))
1777
+ i(
1778
1778
  p.errors.map(
1779
1779
  ([y, g]) => ({
1780
- message: i(`_pages:${y}.errors.${g}`),
1780
+ message: o(`_pages:${y}.errors.${g}`),
1781
1781
  type: R.error
1782
1782
  })
1783
1783
  )
1784
1784
  );
1785
- else if (me(p)) {
1786
- const y = p.message || i("_accessibility:errors.500"), g = i(`_accessibility:errors.${p.status}`);
1787
- o([
1785
+ else if (fe(p)) {
1786
+ const y = p.message || o("_accessibility:errors.500"), g = o(`_accessibility:errors.${p.status}`);
1787
+ i([
1788
1788
  {
1789
1789
  message: g || y,
1790
1790
  type: R.error
@@ -1792,144 +1792,282 @@ const Qt = (n) => {
1792
1792
  ]);
1793
1793
  }
1794
1794
  },
1795
- onSuccess: async (f) => {
1796
- await r.invalidateQueries({ queryKey: e }), t && t(f);
1795
+ onSuccess: async (h) => {
1796
+ await r.invalidateQueries({ queryKey: e }), t && t(h);
1797
1797
  },
1798
1798
  ...s
1799
- }), { action: m } = jt({ onClick: a });
1799
+ }), { action: m } = Bt({ onClick: a });
1800
1800
  return {
1801
1801
  onClick: a,
1802
- title: i("_pages:common.actions.delete.dialog.title"),
1802
+ title: o("_pages:common.actions.delete.dialog.title"),
1803
1803
  open: c,
1804
- isLoading: u,
1805
- handleSubmit: () => d.mutate(),
1806
- handleClose: l,
1804
+ isLoading: d,
1805
+ handleSubmit: () => l.mutate(),
1806
+ handleClose: u,
1807
1807
  action: m
1808
1808
  };
1809
- }, Be = () => {
1810
- const [n, e] = A(!1);
1809
+ }, We = () => {
1810
+ const [n, e] = _(!1);
1811
1811
  return { open: n, setOpen: e, handleClose: () => e(!1), handleOpen: () => e(!0) };
1812
- }, Os = (n) => {
1813
- const { t: e } = v(), t = ne(), {
1814
- showErrorNotification: s,
1815
- showStackNotifications: r,
1816
- showSuccessNotification: o
1817
- } = J(), {
1818
- defaultValues: i,
1819
- getFunction: c,
1820
- mutationFn: a,
1821
- formToDto: l,
1822
- dtoToForm: d,
1823
- onError: u,
1824
- onSuccess: m,
1825
- queryKey: f,
1826
- onSuccessMessage: p,
1827
- title: y
1828
- } = n, [g, b] = A(0), { open: T, handleClose: N, handleOpen: C } = Be(), { control: D, handleSubmit: q, reset: L, setError: S, getValues: _, setValue: E } = Pe({
1829
- defaultValues: i
1830
- }), P = H(null), ce = w(() => {
1831
- const $ = document.activeElement;
1832
- if (!($ instanceof HTMLElement)) {
1833
- P.current = null;
1812
+ }, Jt = (n) => "mutationFn" in n && "queryKey" in n, pe = (n) => {
1813
+ const e = Jt(n), t = e ? n : void 0, s = e ? void 0 : n, r = e ? "entity" : (s == null ? void 0 : s.mode) ?? "state", { t: i } = N(), o = J(), {
1814
+ showErrorNotification: c,
1815
+ showStackNotifications: a,
1816
+ showSuccessNotification: u
1817
+ } = ee(), [l, d] = _(), [m, h] = _(!1), p = M(!1), y = M(), { open: g, handleClose: b, handleOpen: S } = We(), { control: E, handleSubmit: v, reset: $, setError: j, getValues: I, setValue: C } = Me({
1818
+ defaultValues: (t == null ? void 0 : t.defaultValues) || (s == null ? void 0 : s.defaultValues) || {}
1819
+ }), A = M(null), x = w(() => {
1820
+ const T = document.activeElement;
1821
+ if (!(T instanceof HTMLElement)) {
1822
+ A.current = null;
1834
1823
  return;
1835
1824
  }
1836
- P.current = $.closest("form");
1837
- }, []), { data: Y, isLoading: he } = Nt({
1838
- queryFn: () => c == null ? void 0 : c(g),
1839
- queryKey: [...f, g],
1840
- enabled: !!c && !!f && !!g
1825
+ A.current = T.closest("form");
1826
+ }, []), q = t ? [...t.queryKey, l ?? 0] : ["__legacy-form-dialog-disabled__", l ?? 0], { data: V, isLoading: le } = Oe({
1827
+ queryFn: async () => {
1828
+ if (!(!(t != null && t.getFunction) || !l))
1829
+ return t.getFunction(l);
1830
+ },
1831
+ queryKey: q,
1832
+ enabled: !!(t != null && t.getFunction) && !!l
1841
1833
  });
1842
1834
  O(() => {
1843
- Y && d && L({ ...d(Y) });
1844
- }, [Y]);
1845
- const G = w(
1846
- ($) => {
1847
- const U = $ == null ? void 0 : $.errors, j = [], X = P.current;
1848
- if (!X) return j;
1849
- let ve = !1;
1850
- return U && U.forEach(([Ce, Ge]) => {
1851
- const re = X.querySelector(`[name="${Ce}"]`);
1852
- (re instanceof HTMLInputElement || re instanceof HTMLTextAreaElement || re instanceof HTMLSelectElement) && (ve || (re.focus(), ve = !0), re.classList.add("error"), j.push(e(`_entities:${f}.${Ce}.${Ge}`)));
1853
- }), j;
1835
+ !t || !V || !t.dtoToForm || y.current !== V && ($({ ...t.dtoToForm(V) }), y.current = V);
1836
+ }, [V, t, $]), O(() => {
1837
+ if (s) {
1838
+ if (!g) {
1839
+ p.current = !1;
1840
+ return;
1841
+ }
1842
+ if (!p.current) {
1843
+ if (p.current = !0, s.reinitializeOnOpen && s.mapIn) {
1844
+ $(s.mapIn());
1845
+ return;
1846
+ }
1847
+ if (s.reinitializeOnOpen && s.defaultValues) {
1848
+ $(s.defaultValues);
1849
+ return;
1850
+ }
1851
+ s.resetOnOpen && $(s.defaultValues || {});
1852
+ }
1853
+ }
1854
+ }, [s, g, $]);
1855
+ const ge = w(
1856
+ (T) => {
1857
+ const D = T == null ? void 0 : T.errors, H = [], te = A.current;
1858
+ if (!te || !t) return H;
1859
+ let Ce = !1;
1860
+ return D && D.forEach(([Te, Ze]) => {
1861
+ const oe = te.querySelector(`[name="${Te}"]`);
1862
+ (oe instanceof HTMLInputElement || oe instanceof HTMLTextAreaElement || oe instanceof HTMLSelectElement) && (Ce || (oe.focus(), Ce = !0), oe.classList.add("error"), H.push(
1863
+ i(`_entities:${t.queryKey}.${Te}.${Ze}`)
1864
+ ));
1865
+ }), H;
1854
1866
  },
1855
- [e, f]
1856
- ), we = w(() => {
1857
- const $ = P.current;
1858
- if (!$) return;
1859
- $.querySelectorAll("input, textarea, select").forEach((j) => {
1860
- j.classList.remove("error");
1867
+ [t, i]
1868
+ ), B = w(() => {
1869
+ const T = A.current;
1870
+ if (!T) return;
1871
+ T.querySelectorAll("input, textarea, select").forEach((H) => {
1872
+ H.classList.remove("error");
1861
1873
  });
1862
- }, []), We = w(
1863
- ($) => {
1864
- b($ ?? 0), C();
1874
+ }, []), Y = w(() => {
1875
+ B(), A.current = null, b(), $();
1876
+ }, [b, B, $]), ze = w(
1877
+ (T) => {
1878
+ d(T), S();
1865
1879
  },
1866
- [C]
1867
- ), ke = w(() => {
1868
- we(), P.current = null, N(), L();
1869
- }, [L, we, N]), Se = ie({
1870
- mutationFn: a,
1871
- onError: ($) => {
1872
- if (console.error($), u) u($);
1873
- else {
1874
- const U = $;
1875
- if (de(U)) {
1876
- const j = G(U);
1877
- r(
1878
- j.map(
1879
- (X) => ({
1880
- message: X,
1881
- type: R.error
1882
- })
1883
- )
1884
- );
1885
- } else if (me(U)) {
1886
- const j = U.message || e("_accessibility:errors.500"), X = e(`_accessibility:errors.${U.status}`);
1887
- s({ message: X || j });
1888
- } else
1889
- s({ message: e("_accessibility:errors.500") });
1880
+ [S]
1881
+ ), ye = Z({
1882
+ mutationFn: async (T) => {
1883
+ if (t)
1884
+ return t.mutationFn(T);
1885
+ },
1886
+ onError: (T) => {
1887
+ if (t)
1888
+ if (t.onError) t.onError(T);
1889
+ else {
1890
+ const D = T;
1891
+ if (he(D)) {
1892
+ const H = ge(D);
1893
+ a(
1894
+ H.map(
1895
+ (te) => ({
1896
+ message: te,
1897
+ type: R.error
1898
+ })
1899
+ )
1900
+ );
1901
+ } else if (fe(D)) {
1902
+ const H = D.message || i("_accessibility:errors.500"), te = i(`_accessibility:errors.${D.status}`);
1903
+ c({ message: te || H });
1904
+ } else
1905
+ c({ message: i("_accessibility:errors.500") });
1906
+ }
1907
+ },
1908
+ onSuccess: async (T) => {
1909
+ t && (await o.invalidateQueries({ queryKey: t.queryKey }), t.onSuccess && await t.onSuccess(T), u({
1910
+ message: t.onSuccessMessage
1911
+ }), Y());
1912
+ }
1913
+ }), ue = w(
1914
+ (T) => t ? T : s != null && s.mapOut ? s.mapOut(T, { id: l }) : T,
1915
+ [s, l, t]
1916
+ ), Je = w(async () => {
1917
+ if (!(s != null && s.onApply)) return;
1918
+ const T = I(), D = ue(T);
1919
+ h(!0);
1920
+ try {
1921
+ await s.onApply(D, {
1922
+ close: Y,
1923
+ id: l,
1924
+ values: T
1925
+ });
1926
+ } finally {
1927
+ h(!1);
1928
+ }
1929
+ }, [Y, s, I, l, ue]), Ye = w(async () => {
1930
+ if (s) {
1931
+ if (s.onClear) {
1932
+ h(!0);
1933
+ try {
1934
+ await s.onClear();
1935
+ } finally {
1936
+ h(!1);
1937
+ }
1938
+ }
1939
+ $(s.defaultValues || {});
1940
+ }
1941
+ }, [s, $]), Xe = w(
1942
+ async (T) => {
1943
+ if (t) {
1944
+ x(), ye.mutate(
1945
+ t.formToDto ? t.formToDto(T) : T
1946
+ );
1947
+ return;
1948
+ }
1949
+ const D = ue(T);
1950
+ h(!0);
1951
+ try {
1952
+ s != null && s.onSubmit && await s.onSubmit(D, {
1953
+ close: Y,
1954
+ id: l,
1955
+ values: T
1956
+ }), ((s == null ? void 0 : s.closeOnSubmit) ?? !0) && Y();
1957
+ } finally {
1958
+ h(!1);
1890
1959
  }
1891
1960
  },
1892
- onSuccess: async ($) => {
1893
- await t.invalidateQueries({ queryKey: f }), m && m($), o({
1894
- message: p
1895
- }), ke();
1961
+ [
1962
+ x,
1963
+ Y,
1964
+ s,
1965
+ l,
1966
+ ye,
1967
+ t,
1968
+ ue
1969
+ ]
1970
+ );
1971
+ return {
1972
+ open: g,
1973
+ mode: r,
1974
+ id: l,
1975
+ openDialog: ze,
1976
+ handleClose: Y,
1977
+ control: E,
1978
+ getValues: I,
1979
+ setValue: C,
1980
+ handleSubmit: v,
1981
+ onSubmit: Xe,
1982
+ reset: $,
1983
+ setError: j,
1984
+ title: n.title,
1985
+ isSubmitting: m,
1986
+ onApply: Je,
1987
+ onClear: Ye,
1988
+ isLoading: le || ye.isPending || m
1989
+ };
1990
+ }, Hs = pe, Qs = (n) => pe(n), Vs = (n) => {
1991
+ const e = J(), { mutationFn: t, queryKey: s, onSuccess: r, onError: i, mapOut: o, ...c } = n, a = Z({
1992
+ mutationFn: t
1993
+ });
1994
+ return pe({
1995
+ ...c,
1996
+ mode: "entity",
1997
+ mapOut: o,
1998
+ onSubmit: async (u) => {
1999
+ try {
2000
+ const l = await a.mutateAsync(u);
2001
+ s && await e.invalidateQueries({ queryKey: s }), r && await r(l);
2002
+ } catch (l) {
2003
+ throw i && i(l), l;
2004
+ }
1896
2005
  }
1897
2006
  });
1898
- return {
1899
- open: T,
1900
- openDialog: We,
1901
- handleClose: ke,
1902
- control: D,
1903
- getValues: _,
1904
- setValue: E,
1905
- handleSubmit: q,
1906
- onSubmit: ($) => {
1907
- ce(), Se.mutate(
1908
- l ? l($) : $
1909
- );
2007
+ }, Bs = (n) => {
2008
+ const e = J(), t = M(), s = M(), {
2009
+ mutationFn: r,
2010
+ queryKey: i,
2011
+ onSuccess: o,
2012
+ onError: c,
2013
+ mapOut: a,
2014
+ getFunction: u,
2015
+ dtoToForm: l,
2016
+ title: d,
2017
+ ...m
2018
+ } = n, h = M(l);
2019
+ O(() => {
2020
+ h.current = l;
2021
+ }, [l]);
2022
+ const p = Z({
2023
+ mutationFn: r
2024
+ }), y = pe({
2025
+ ...m,
2026
+ mode: "entity",
2027
+ title: d,
2028
+ onSubmit: async (E) => {
2029
+ try {
2030
+ const v = await p.mutateAsync(E);
2031
+ i && await e.invalidateQueries({ queryKey: i }), o && await o(v);
2032
+ } catch (v) {
2033
+ throw c && c(v), v;
2034
+ }
1910
2035
  },
1911
- reset: L,
1912
- setError: S,
1913
- title: y,
1914
- isLoading: he || Se.isPending
2036
+ mapOut: (E) => a ? a(E, t.current) : E
2037
+ }), { reset: g } = y, S = Oe({
2038
+ queryFn: () => u(y.id),
2039
+ queryKey: [...i || ["put-dialog", d], y.id],
2040
+ enabled: y.open && !!y.id
2041
+ });
2042
+ return O(() => {
2043
+ if (S.data && s.current !== S.data) {
2044
+ if (t.current = S.data, s.current = S.data, h.current && g) {
2045
+ g(h.current(S.data));
2046
+ return;
2047
+ }
2048
+ g == null || g(S.data);
2049
+ }
2050
+ }, [S.data, g]), {
2051
+ ...y,
2052
+ isLoading: y.isLoading || p.isPending || S.isFetching || S.isLoading
1915
2053
  };
1916
- }, Ks = (n) => {
1917
- const { queryKey: e, onSuccess: t, ...s } = n, r = ne(), { showStackNotifications: o } = J(), { t: i } = v(), { open: c, onClick: a, close: l, dialogFn: d, isLoading: u } = Qe({
1918
- onSuccessMessage: i("_pages:common.actions.restore.successMessage"),
1919
- onError: (f) => {
1920
- const p = f;
1921
- if (de(p))
1922
- o(
2054
+ }, Ws = (n) => {
2055
+ const { queryKey: e, onSuccess: t, ...s } = n, r = J(), { showStackNotifications: i } = ee(), { t: o } = N(), { open: c, onClick: a, close: u, dialogFn: l, isLoading: d } = Be({
2056
+ onSuccessMessage: o("_pages:common.actions.restore.successMessage"),
2057
+ onError: (h) => {
2058
+ const p = h;
2059
+ if (he(p))
2060
+ i(
1923
2061
  p.errors.map(
1924
2062
  ([y, g]) => ({
1925
- message: i(`_pages:${y}.errors.${g}`),
2063
+ message: o(`_pages:${y}.errors.${g}`),
1926
2064
  type: R.error
1927
2065
  })
1928
2066
  )
1929
2067
  );
1930
- else if (me(p)) {
1931
- const y = p.message || i("_accessibility:errors.500"), g = i(`_accessibility:errors.${p.status}`);
1932
- o([
2068
+ else if (fe(p)) {
2069
+ const y = p.message || o("_accessibility:errors.500"), g = o(`_accessibility:errors.${p.status}`);
2070
+ i([
1933
2071
  {
1934
2072
  message: g || y,
1935
2073
  type: R.error
@@ -1937,30 +2075,30 @@ const Qt = (n) => {
1937
2075
  ]);
1938
2076
  }
1939
2077
  },
1940
- onSuccess: async (f) => {
1941
- await r.invalidateQueries({ queryKey: e }), t && t(f);
2078
+ onSuccess: async (h) => {
2079
+ await r.invalidateQueries({ queryKey: e }), t && t(h);
1942
2080
  },
1943
2081
  ...s
1944
- }), { action: m } = Ht({ onClick: a });
2082
+ }), { action: m } = Wt({ onClick: a });
1945
2083
  return {
1946
2084
  onClick: a,
1947
- title: i("_pages:common.actions.restore.dialog.title"),
2085
+ title: o("_pages:common.actions.restore.dialog.title"),
1948
2086
  open: c,
1949
- isLoading: u,
1950
- handleSubmit: () => d.mutate(),
1951
- handleClose: l,
2087
+ isLoading: d,
2088
+ handleSubmit: () => l.mutate(),
2089
+ handleClose: u,
1952
2090
  action: m
1953
2091
  };
1954
2092
  };
1955
- function qs(n) {
1956
- const { t: e } = v(), t = ne(), {
2093
+ function Gs(n) {
2094
+ const { t: e } = N(), t = J(), {
1957
2095
  queryKey: s,
1958
2096
  mutationFn: r,
1959
- entity: o,
1960
- fileProcessor: i,
2097
+ entity: i,
2098
+ fileProcessor: o,
1961
2099
  renderCustomPreview: c,
1962
2100
  onError: a
1963
- } = n, [l, d] = A(!1), [u, m] = A(null), [f, p] = A(!1), y = ie({
2101
+ } = n, [u, l] = _(!1), [d, m] = _(null), [h, p] = _(!1), y = Z({
1964
2102
  mutationFn: r,
1965
2103
  onError: (b) => {
1966
2104
  console.error(b), a == null || a(b);
@@ -1968,184 +2106,184 @@ function qs(n) {
1968
2106
  onSuccess: async () => {
1969
2107
  await t.invalidateQueries({ queryKey: s });
1970
2108
  }
1971
- }), { action: g } = Bt({
1972
- onClick: () => d(!0)
2109
+ }), { action: g } = zt({
2110
+ onClick: () => l(!0)
1973
2111
  });
1974
2112
  return {
1975
2113
  handleSubmit: async () => {
1976
- if (!(!u || u.length === 0))
2114
+ if (!(!d || d.length === 0))
1977
2115
  try {
1978
2116
  await y.mutateAsync({
1979
- items: u,
1980
- override: f
1981
- }), d(!1), m(null), p(!1);
2117
+ items: d,
2118
+ override: h
2119
+ }), l(!1), m(null), p(!1);
1982
2120
  } catch (b) {
1983
2121
  console.error(b);
1984
2122
  }
1985
2123
  },
1986
2124
  isLoading: y.isPending,
1987
- fileProcessor: i,
2125
+ fileProcessor: o,
1988
2126
  onFileProcessed: (b) => m(b),
1989
2127
  renderCustomPreview: c,
1990
2128
  onOverrideChange: (b) => p(b),
1991
- open: l,
2129
+ open: u,
1992
2130
  title: e("_pages:common.actions.import.dialog.title", {
1993
- entity: e(`_pages:${o}.title`)
2131
+ entity: e(`_pages:${i}.title`)
1994
2132
  }),
1995
2133
  handleClose: () => {
1996
- d(!1), m(null), p(!1);
2134
+ l(!1), m(null), p(!1);
1997
2135
  },
1998
2136
  action: g
1999
2137
  };
2000
2138
  }
2001
- const Us = (n) => {
2002
- const { showSuccessNotification: e } = J(), { t } = v(), {
2139
+ const zs = (n) => {
2140
+ const { showSuccessNotification: e } = ee(), { t } = N(), {
2003
2141
  entity: s,
2004
2142
  mutationFn: r,
2005
- onError: o,
2006
- onSuccess: i,
2143
+ onError: i,
2144
+ onSuccess: o,
2007
2145
  onSuccessMessage: c = t("_pages:common.actions.export.successMessage")
2008
- } = n, a = ie({
2146
+ } = n, a = Z({
2009
2147
  mutationFn: () => r(),
2010
- onError: (u) => {
2011
- console.error(u), o && o(u);
2148
+ onError: (d) => {
2149
+ console.error(d), i && i(d);
2012
2150
  },
2013
- onSuccess: async (u) => {
2014
- const m = JSON.stringify(u, null, 2), f = new Blob([m], { type: "application/json" }), p = URL.createObjectURL(f), y = document.createElement("a");
2015
- y.href = p, y.download = `${s}.json`, y.click(), URL.revokeObjectURL(p), i && i(u), e({
2151
+ onSuccess: async (d) => {
2152
+ const m = JSON.stringify(d, null, 2), h = new Blob([m], { type: "application/json" }), p = URL.createObjectURL(h), y = document.createElement("a");
2153
+ y.href = p, y.download = `${s}.json`, y.click(), URL.revokeObjectURL(p), o && o(d), e({
2016
2154
  message: c
2017
2155
  });
2018
2156
  }
2019
- }), l = w(() => {
2157
+ }), u = w(() => {
2020
2158
  a.mutate();
2021
- }, [a]), { action: d } = Qt({
2022
- onClick: l,
2159
+ }, [a]), { action: l } = Gt({
2160
+ onClick: u,
2023
2161
  isLoading: a.isPending
2024
2162
  });
2025
2163
  return {
2026
- action: d
2164
+ action: l
2027
2165
  };
2028
- }, $e = () => typeof window < "u" ? window.scrollY : 0;
2029
- function Vt(n) {
2030
- const [e, t] = A($e), s = w(() => {
2031
- t($e());
2166
+ }, xe = () => typeof window < "u" ? window.scrollY : 0;
2167
+ function Yt(n) {
2168
+ const [e, t] = _(xe), s = w(() => {
2169
+ t(xe());
2032
2170
  }, []);
2033
2171
  return O(() => (window.addEventListener("scroll", s), () => {
2034
2172
  window.removeEventListener("scroll", s);
2035
2173
  }), [s]), e > n;
2036
2174
  }
2037
- const js = (n) => {
2038
- const { t: e } = v(), {
2039
- icon: t = gt,
2175
+ const Js = (n) => {
2176
+ const { t: e } = N(), {
2177
+ icon: t = kt,
2040
2178
  threshold: s = 200,
2041
2179
  scrollTop: r = 0,
2042
- scrollLeft: o = 0,
2043
- tooltip: i = e("_accessibility:buttons.toTop"),
2180
+ scrollLeft: i = 0,
2181
+ tooltip: o = e("_accessibility:buttons.toTop"),
2044
2182
  scrollOnClick: c = !0,
2045
2183
  onClick: a,
2046
- className: l = "",
2047
- variant: d = "submit",
2048
- color: u = "primary",
2184
+ className: u = "",
2185
+ variant: l = "submit",
2186
+ color: d = "primary",
2049
2187
  ...m
2050
- } = n, f = Vt(s);
2051
- return /* @__PURE__ */ h(
2052
- V,
2188
+ } = n, h = Yt(s);
2189
+ return /* @__PURE__ */ f(
2190
+ G,
2053
2191
  {
2054
- variant: d,
2055
- color: u,
2192
+ variant: l,
2193
+ color: d,
2056
2194
  icon: t,
2057
2195
  "data-tooltip-id": "tooltip",
2058
2196
  onClick: () => {
2059
- a == null || a(), c && Ut.scrollTo(o, r);
2197
+ a == null || a(), c && Vt.scrollTo(i, r);
2060
2198
  },
2061
- className: `to-top ${f ? "show" : "hide"} ${l}`.trim(),
2062
- "data-tooltip-content": i,
2199
+ className: `to-top ${h ? "show" : "hide"} ${u}`.trim(),
2200
+ "data-tooltip-content": o,
2063
2201
  ...m
2064
2202
  }
2065
2203
  );
2066
2204
  };
2067
- function Hs(n) {
2068
- const { t: e } = v();
2205
+ function Ys(n) {
2206
+ const { t: e } = N();
2069
2207
  if ("children" in n) {
2070
- const { children: C, className: D } = n;
2071
- return /* @__PURE__ */ h("div", { className: `error-container${D ? ` ${D}` : ""}`, children: C });
2208
+ const { children: v, className: $ } = n;
2209
+ return /* @__PURE__ */ f("div", { className: `error-container${$ ? ` ${$}` : ""}`, children: v });
2072
2210
  }
2073
2211
  const {
2074
2212
  error: s,
2075
2213
  message: r,
2076
- iconProps: o,
2077
- onRetry: i,
2214
+ iconProps: i,
2215
+ onRetry: o,
2078
2216
  retryLabel: c,
2079
2217
  retryButtonProps: a,
2080
- messageProps: l,
2081
- className: d,
2082
- resetErrorBoundary: u
2083
- } = n, m = i ?? u, {
2084
- className: f,
2218
+ messageProps: u,
2219
+ className: l,
2220
+ resetErrorBoundary: d
2221
+ } = n, m = o ?? d, {
2222
+ className: h,
2085
2223
  children: p,
2086
2224
  onClick: y,
2087
2225
  ...g
2088
- } = a ?? {}, { className: b, ...T } = l ?? {}, N = o !== null;
2089
- return /* @__PURE__ */ k("div", { className: `error-container${d ? ` ${d}` : ""}`, children: [
2090
- N && /* @__PURE__ */ h(
2091
- F,
2226
+ } = a ?? {}, { className: b, ...S } = u ?? {}, E = i !== null;
2227
+ return /* @__PURE__ */ k("div", { className: `error-container${l ? ` ${l}` : ""}`, children: [
2228
+ E && /* @__PURE__ */ f(
2229
+ K,
2092
2230
  {
2093
- ...o,
2094
- icon: (o == null ? void 0 : o.icon) ?? Et,
2095
- className: `error-icon${o != null && o.className ? ` ${o.className}` : ""}`
2231
+ ...i,
2232
+ icon: (i == null ? void 0 : i.icon) ?? Lt,
2233
+ className: `error-icon${i != null && i.className ? ` ${i.className}` : ""}`
2096
2234
  }
2097
2235
  ),
2098
- /* @__PURE__ */ h(
2236
+ /* @__PURE__ */ f(
2099
2237
  "p",
2100
2238
  {
2101
- ...T,
2239
+ ...S,
2102
2240
  className: `error-message${b ? ` ${b}` : ""}`,
2103
2241
  children: r ?? (s == null ? void 0 : s.message) ?? e("_accessibility:errors.unknownError")
2104
2242
  }
2105
2243
  ),
2106
- m && /* @__PURE__ */ h(
2107
- K,
2244
+ m && /* @__PURE__ */ f(
2245
+ U,
2108
2246
  {
2109
2247
  type: "button",
2110
2248
  variant: "submit",
2111
2249
  color: "primary",
2112
2250
  ...g,
2113
- className: `error-retry ${f ? ` ${f}` : ""}`,
2114
- onClick: (C) => {
2115
- y == null || y(C), C.defaultPrevented || m();
2251
+ className: `error-retry ${h ? ` ${h}` : ""}`,
2252
+ onClick: (v) => {
2253
+ y == null || y(v), v.defaultPrevented || m();
2116
2254
  },
2117
2255
  children: p ?? c ?? e("_accessibility:actions.retry", { defaultValue: "Retry" })
2118
2256
  }
2119
2257
  )
2120
2258
  ] });
2121
2259
  }
2122
- const Wt = (n) => {
2123
- const { showBackButton: e, title: t, actions: s } = n, { t: r } = v(), { navigate: o } = ae();
2260
+ const Xt = (n) => {
2261
+ const { showBackButton: e, title: t, actions: s } = n, { t: r } = N(), { navigate: i } = ce();
2124
2262
  return /* @__PURE__ */ k("div", { className: "page-header", children: [
2125
2263
  /* @__PURE__ */ k("div", { className: "page-header-left", children: [
2126
- e && /* @__PURE__ */ h(
2127
- V,
2264
+ e && /* @__PURE__ */ f(
2265
+ G,
2128
2266
  {
2129
- icon: yt,
2130
- onClick: () => o(-1),
2267
+ icon: vt,
2268
+ onClick: () => i(-1),
2131
2269
  className: "page-header-back",
2132
2270
  name: r("_accessibility:buttons.back"),
2133
2271
  "data-tooltip-id": "tooltip",
2134
2272
  "data-tooltip-content": r("_accessibility:buttons.back")
2135
2273
  }
2136
2274
  ),
2137
- /* @__PURE__ */ h("h2", { className: "page-header-title", children: t })
2275
+ /* @__PURE__ */ f("h2", { className: "page-header-title", children: t })
2138
2276
  ] }),
2139
2277
  /* @__PURE__ */ k("div", { children: [
2140
- /* @__PURE__ */ h(
2141
- rt,
2278
+ /* @__PURE__ */ f(
2279
+ lt,
2142
2280
  {
2143
2281
  className: "page-header-actions-desktop",
2144
2282
  actions: s ?? []
2145
2283
  }
2146
2284
  ),
2147
- /* @__PURE__ */ h(
2148
- ot,
2285
+ /* @__PURE__ */ f(
2286
+ ut,
2149
2287
  {
2150
2288
  className: "page-header-actions-mobile",
2151
2289
  actions: s ?? []
@@ -2153,33 +2291,33 @@ const Wt = (n) => {
2153
2291
  )
2154
2292
  ] })
2155
2293
  ] });
2156
- }, Qs = (n) => {
2294
+ }, Xs = (n) => {
2157
2295
  const {
2158
2296
  title: e,
2159
2297
  children: t,
2160
2298
  addOptions: s,
2161
2299
  filterOptions: r,
2162
- actions: o,
2163
- queryKey: i,
2300
+ actions: i,
2301
+ queryKey: o,
2164
2302
  isLoading: c = !1,
2165
2303
  isAnimated: a = !0,
2166
- showBackButton: l = !1
2167
- } = n, { t: d } = v(), u = ne(), { countOfFilters: m } = it(), f = Q(() => {
2168
- const p = Array.isArray(o) ? [...o] : [];
2169
- if (i) {
2304
+ showBackButton: u = !1
2305
+ } = n, { t: l } = N(), d = J(), { countOfFilters: m } = dt(), h = Q(() => {
2306
+ const p = Array.isArray(i) ? [...i] : [];
2307
+ if (o) {
2170
2308
  const y = {
2171
- id: W.Refresh,
2172
- onClick: () => u.invalidateQueries({ queryKey: i }),
2173
- icon: /* @__PURE__ */ h(F, { icon: _e }),
2174
- tooltip: d("_pages:common.actions.refresh.text")
2309
+ id: z.Refresh,
2310
+ onClick: () => d.invalidateQueries({ queryKey: o }),
2311
+ icon: /* @__PURE__ */ f(K, { icon: Re }),
2312
+ tooltip: l("_pages:common.actions.refresh.text")
2175
2313
  };
2176
2314
  p.unshift(y);
2177
2315
  }
2178
2316
  if (s) {
2179
2317
  const y = {
2180
2318
  ...s,
2181
- id: W.Add,
2182
- icon: /* @__PURE__ */ h(F, { icon: Te })
2319
+ id: z.Add,
2320
+ icon: /* @__PURE__ */ f(K, { icon: Ne })
2183
2321
  };
2184
2322
  p.unshift(y);
2185
2323
  }
@@ -2187,9 +2325,9 @@ const Wt = (n) => {
2187
2325
  const y = {
2188
2326
  ...r,
2189
2327
  id: "filter",
2190
- icon: /* @__PURE__ */ h(F, { icon: bt }),
2191
- children: /* @__PURE__ */ h(
2192
- at,
2328
+ icon: /* @__PURE__ */ f(K, { icon: Ct }),
2329
+ children: /* @__PURE__ */ f(
2330
+ mt,
2193
2331
  {
2194
2332
  className: `${m > 0 ? "show" : "hide"} `,
2195
2333
  count: m
@@ -2200,126 +2338,126 @@ const Wt = (n) => {
2200
2338
  }
2201
2339
  return p;
2202
2340
  }, [
2203
- o,
2341
+ i,
2204
2342
  s,
2205
2343
  m,
2206
2344
  r,
2207
- u,
2208
- i,
2209
- d
2345
+ d,
2346
+ o,
2347
+ l
2210
2348
  ]);
2211
2349
  return /* @__PURE__ */ k("main", { className: "page-main", children: [
2212
- /* @__PURE__ */ h(
2213
- Wt,
2350
+ /* @__PURE__ */ f(
2351
+ Xt,
2214
2352
  {
2215
- showBackButton: l,
2216
- actions: f,
2353
+ showBackButton: u,
2354
+ actions: h,
2217
2355
  title: e
2218
2356
  }
2219
2357
  ),
2220
- /* @__PURE__ */ h("div", { className: `page-main-content ${a ? "appear" : ""}`, children: c ? /* @__PURE__ */ h(ee, { className: "page-loading" }) : t }),
2221
- s && /* @__PURE__ */ h(
2222
- V,
2358
+ /* @__PURE__ */ f("div", { className: `page-main-content ${a ? "appear" : ""}`, children: c ? /* @__PURE__ */ f(ne, { className: "page-loading" }) : t }),
2359
+ s && /* @__PURE__ */ f(
2360
+ G,
2223
2361
  {
2224
- icon: s.icon ?? Te,
2362
+ icon: s.icon ?? Ne,
2225
2363
  color: s.color ?? "primary",
2226
2364
  variant: s.variant ?? "submit",
2227
2365
  onClick: () => {
2228
2366
  var p;
2229
2367
  return (p = s.onClick) == null ? void 0 : p.call(s);
2230
2368
  },
2231
- className: `button fab ${s.className ?? ""}`
2369
+ className: `button page-fab ${s.className ?? ""}`
2232
2370
  }
2233
2371
  )
2234
2372
  ] });
2235
- }, Bs = (n) => {
2236
- const { t: e } = v(), {
2373
+ }, Zs = (n) => {
2374
+ const { t: e } = N(), {
2237
2375
  className: t = "",
2238
2376
  itemClassName: s = "",
2239
2377
  loading: r = !1,
2240
- emptyComponent: o = null,
2241
- emptyMessage: i = e("_accessibility:messages.empty"),
2378
+ emptyComponent: i = null,
2379
+ emptyMessage: o = e("_accessibility:messages.empty"),
2242
2380
  renderComponent: c,
2243
2381
  data: a = [],
2244
- hasMore: l = !1,
2245
- loadingMore: d = !1,
2246
- onLoadMore: u,
2382
+ hasMore: u = !1,
2383
+ loadingMore: l = !1,
2384
+ onLoadMore: d,
2247
2385
  loadMoreComponent: m = null,
2248
- observerRootMargin: f = "0px 0px 200px 0px",
2386
+ observerRootMargin: h = "0px 0px 200px 0px",
2249
2387
  observerThreshold: p = 0
2250
- } = n, y = H(!1), g = H(null), b = w(async () => {
2251
- if (!(!l || !u) && !(d || y.current)) {
2388
+ } = n, y = M(!1), g = M(null), b = w(async () => {
2389
+ if (!(!u || !d) && !(l || y.current)) {
2252
2390
  y.current = !0;
2253
2391
  try {
2254
- await u();
2392
+ await d();
2255
2393
  } finally {
2256
2394
  y.current = !1;
2257
2395
  }
2258
2396
  }
2259
- }, [l, d, u]);
2397
+ }, [u, l, d]);
2260
2398
  return O(() => {
2261
- if (!l || !u || !g.current || typeof IntersectionObserver > "u") return;
2262
- const T = new IntersectionObserver(
2263
- (N) => {
2264
- N.some((C) => C.isIntersecting) && b();
2399
+ if (!u || !d || !g.current || typeof IntersectionObserver > "u") return;
2400
+ const S = new IntersectionObserver(
2401
+ (E) => {
2402
+ E.some((v) => v.isIntersecting) && b();
2265
2403
  },
2266
2404
  {
2267
- rootMargin: f,
2405
+ rootMargin: h,
2268
2406
  threshold: p
2269
2407
  }
2270
2408
  );
2271
- return T.observe(g.current), () => T.disconnect();
2409
+ return S.observe(g.current), () => S.disconnect();
2272
2410
  }, [
2273
- l,
2274
2411
  u,
2275
- f,
2412
+ d,
2413
+ h,
2276
2414
  p,
2277
2415
  b
2278
- ]), r ? /* @__PURE__ */ h(ee, {}) : /* @__PURE__ */ h(oe, { children: a != null && a.length ? /* @__PURE__ */ k("ul", { className: `pretty-grid-main ${t}`, children: [
2279
- a == null ? void 0 : a.map((T) => /* @__PURE__ */ h("li", { className: `pretty-grid-item ${s}`, children: c(T) }, T.id)),
2280
- l && u && /* @__PURE__ */ h("li", { className: "pretty-grid-load-more", ref: g, children: m })
2281
- ] }) : /* @__PURE__ */ h(oe, { children: o || /* @__PURE__ */ h(ts, { message: i }) }) });
2282
- }, Ve = te({
2416
+ ]), r ? /* @__PURE__ */ f(ne, {}) : /* @__PURE__ */ f(ae, { children: a != null && a.length ? /* @__PURE__ */ k("ul", { className: `pretty-grid-main ${t}`, children: [
2417
+ a == null ? void 0 : a.map((S) => /* @__PURE__ */ f("li", { className: `pretty-grid-item ${s}`, children: c(S) }, S.id)),
2418
+ u && d && /* @__PURE__ */ f("li", { className: "pretty-grid-load-more", ref: g, children: m })
2419
+ ] }) : /* @__PURE__ */ f(ae, { children: i || /* @__PURE__ */ f(os, { message: o }) }) });
2420
+ }, Ge = re({
2283
2421
  title: "",
2284
2422
  setTitle: () => {
2285
2423
  },
2286
2424
  rightContent: null,
2287
2425
  setRightContent: () => {
2288
2426
  }
2289
- }), Vs = (n) => {
2290
- const { children: e } = n, [t, s] = A(""), [r, o] = A(null), i = w((l) => {
2291
- s(l);
2292
- }, []), c = w((l) => {
2293
- o(l);
2427
+ }), en = (n) => {
2428
+ const { children: e } = n, [t, s] = _(""), [r, i] = _(null), o = w((u) => {
2429
+ s(u);
2430
+ }, []), c = w((u) => {
2431
+ i(u);
2294
2432
  }, []), a = Q(
2295
2433
  () => ({
2296
2434
  title: t,
2297
- setTitle: i,
2435
+ setTitle: o,
2298
2436
  rightContent: r,
2299
2437
  setRightContent: c
2300
2438
  }),
2301
- [t, i, r, c]
2439
+ [t, o, r, c]
2302
2440
  );
2303
- return /* @__PURE__ */ h(Ve.Provider, { value: a, children: e });
2304
- }, Gt = () => se(Ve);
2305
- function Ws(n) {
2306
- const { t: e } = v(), { openDrawer: t, showSearch: s = !0, menuButtonProps: r } = n, { searchComponent: o, location: i } = ae(), { title: c, rightContent: a } = Gt(), [l, d] = A(!1), u = w((p) => {
2307
- (Dt() ? p.metaKey : p.ctrlKey) && p.shiftKey && p.key.toLowerCase() === "f" && (d(!0), p.preventDefault());
2441
+ return /* @__PURE__ */ f(Ge.Provider, { value: a, children: e });
2442
+ }, Zt = () => ie(Ge);
2443
+ function tn(n) {
2444
+ const { t: e } = N(), { openDrawer: t, showSearch: s = !0, menuButtonProps: r } = n, { searchComponent: i, location: o } = ce(), { title: c, rightContent: a } = Zt(), [u, l] = _(!1), d = w((p) => {
2445
+ (qt() ? p.metaKey : p.ctrlKey) && p.shiftKey && p.key.toLowerCase() === "f" && (l(!0), p.preventDefault());
2308
2446
  }, []);
2309
- O(() => (window.addEventListener("keydown", u), () => {
2310
- window.removeEventListener("keydown", u);
2311
- }), [u]);
2312
- const m = o, f = s && !!m;
2313
- return /* @__PURE__ */ k(oe, { children: [
2314
- i.pathname !== "/" && !!m && /* @__PURE__ */ h(m, { open: l, onClose: () => d(!1) }),
2447
+ O(() => (window.addEventListener("keydown", d), () => {
2448
+ window.removeEventListener("keydown", d);
2449
+ }), [d]);
2450
+ const m = i, h = s && !!m;
2451
+ return /* @__PURE__ */ k(ae, { children: [
2452
+ o.pathname !== "/" && !!m && /* @__PURE__ */ f(m, { open: u, onClose: () => l(!1) }),
2315
2453
  /* @__PURE__ */ k("header", { id: "header", className: "header", children: [
2316
2454
  /* @__PURE__ */ k("div", { className: "navbar-left", children: [
2317
- /* @__PURE__ */ h(
2318
- V,
2455
+ /* @__PURE__ */ f(
2456
+ G,
2319
2457
  {
2320
2458
  ...r,
2321
2459
  type: (r == null ? void 0 : r.type) ?? "button",
2322
- icon: (r == null ? void 0 : r.icon) ?? wt,
2460
+ icon: (r == null ? void 0 : r.icon) ?? Tt,
2323
2461
  onClick: (p) => {
2324
2462
  var y;
2325
2463
  (y = r == null ? void 0 : r.onClick) == null || y.call(r, p), t();
@@ -2329,30 +2467,30 @@ function Ws(n) {
2329
2467
  className: `navbar-menu animated ${(r == null ? void 0 : r.className) ?? ""}`
2330
2468
  }
2331
2469
  ),
2332
- /* @__PURE__ */ h("h1", { className: "poppins navbar-title", children: c || e("_pages:home.appName") })
2470
+ /* @__PURE__ */ f("h1", { className: "poppins navbar-title", children: c || e("_pages:home.appName") })
2333
2471
  ] }),
2334
2472
  /* @__PURE__ */ k("div", { className: "navbar-right", children: [
2335
2473
  a,
2336
- f && /* @__PURE__ */ h(
2337
- V,
2474
+ h && /* @__PURE__ */ f(
2475
+ G,
2338
2476
  {
2339
- icon: kt,
2477
+ icon: Nt,
2340
2478
  className: "navbar-search-btn",
2341
- onClick: () => d(!0)
2479
+ onClick: () => l(!0)
2342
2480
  }
2343
2481
  )
2344
2482
  ] })
2345
2483
  ] })
2346
2484
  ] });
2347
2485
  }
2348
- const le = 300, zt = (n) => n ?? R.error, Jt = (n) => {
2486
+ const de = 300, es = (n) => n ?? R.error, ts = (n) => {
2349
2487
  switch (n) {
2350
2488
  case R.error:
2351
- return vt;
2489
+ return $t;
2352
2490
  default:
2353
- return St;
2491
+ return Et;
2354
2492
  }
2355
- }, ge = (n) => {
2493
+ }, Se = (n) => {
2356
2494
  switch (n) {
2357
2495
  case R.success:
2358
2496
  return "!text-success";
@@ -2363,7 +2501,7 @@ const le = 300, zt = (n) => n ?? R.error, Jt = (n) => {
2363
2501
  default:
2364
2502
  return "!text-info";
2365
2503
  }
2366
- }, Yt = (n) => {
2504
+ }, ss = (n) => {
2367
2505
  switch (n) {
2368
2506
  case R.success:
2369
2507
  return "bg-bg-success";
@@ -2375,96 +2513,96 @@ const le = 300, zt = (n) => n ?? R.error, Jt = (n) => {
2375
2513
  return "bg-bg-info";
2376
2514
  }
2377
2515
  };
2378
- function Gs() {
2379
- const { t: n } = v(), { notification: e, removeNotification: t } = J(), [s, r] = A([]), o = H(s);
2380
- lt(() => {
2381
- o.current = s;
2516
+ function sn() {
2517
+ const { t: n } = N(), { notification: e, removeNotification: t } = ee(), [s, r] = _([]), i = M(s);
2518
+ ft(() => {
2519
+ i.current = s;
2382
2520
  });
2383
- const i = H(null), c = w(
2521
+ const o = M(null), c = w(
2384
2522
  (a) => {
2385
2523
  r(
2386
- (l) => a !== void 0 ? l.map((d) => d.id === a ? { ...d, closing: !0 } : d) : l.map((d) => ({ ...d, closing: !0 }))
2524
+ (u) => a !== void 0 ? u.map((l) => l.id === a ? { ...l, closing: !0 } : l) : u.map((l) => ({ ...l, closing: !0 }))
2387
2525
  ), a !== void 0 ? setTimeout(() => {
2388
- t(a), r((l) => l.filter((d) => d.id !== a));
2389
- }, le) : (i.current && clearTimeout(i.current), i.current = setTimeout(() => {
2390
- t(), r([]), i.current = null;
2391
- }, le));
2526
+ t(a), r((u) => u.filter((l) => l.id !== a));
2527
+ }, de) : (o.current && clearTimeout(o.current), o.current = setTimeout(() => {
2528
+ t(), r([]), o.current = null;
2529
+ }, de));
2392
2530
  },
2393
2531
  [t]
2394
2532
  );
2395
2533
  return O(() => {
2396
2534
  let a = null;
2397
- const l = () => {
2398
- a && clearTimeout(a), i.current && (clearTimeout(i.current), i.current = null);
2535
+ const u = () => {
2536
+ a && clearTimeout(a), o.current && (clearTimeout(o.current), o.current = null);
2399
2537
  };
2400
2538
  if (e.length === 0)
2401
- return o.current.length === 0 ? void 0 : (i.current && clearTimeout(i.current), a = setTimeout(() => {
2402
- r((f) => f.map((p) => ({ ...p, closing: !0 }))), a = null;
2403
- }, 0), i.current = setTimeout(() => {
2404
- r([]), i.current = null;
2405
- }, le), l);
2406
- const d = new Set(o.current.map((f) => f.id));
2539
+ return i.current.length === 0 ? void 0 : (o.current && clearTimeout(o.current), a = setTimeout(() => {
2540
+ r((h) => h.map((p) => ({ ...p, closing: !0 }))), a = null;
2541
+ }, 0), o.current = setTimeout(() => {
2542
+ r([]), o.current = null;
2543
+ }, de), u);
2544
+ const l = new Set(i.current.map((h) => h.id));
2407
2545
  if (!e.some(
2408
- (f) => f.id !== void 0 && !d.has(f.id)
2546
+ (h) => h.id !== void 0 && !l.has(h.id)
2409
2547
  )) return;
2410
- if (o.current.length === 0) {
2411
- const f = [...e];
2548
+ if (i.current.length === 0) {
2549
+ const h = [...e];
2412
2550
  return a = setTimeout(() => {
2413
- r(f.map((p) => ({ ...p, closing: !1 }))), a = null;
2551
+ r(h.map((p) => ({ ...p, closing: !1 }))), a = null;
2414
2552
  }, 0), () => {
2415
2553
  a && clearTimeout(a);
2416
2554
  };
2417
2555
  }
2418
- i.current && clearTimeout(i.current), a = setTimeout(() => {
2556
+ o.current && clearTimeout(o.current), a = setTimeout(() => {
2419
2557
  r(
2420
- (f) => f.every((p) => p.closing) ? f : f.map((p) => ({ ...p, closing: !0 }))
2558
+ (h) => h.every((p) => p.closing) ? h : h.map((p) => ({ ...p, closing: !0 }))
2421
2559
  ), a = null;
2422
2560
  }, 0);
2423
2561
  const m = [...e];
2424
- return i.current = setTimeout(() => {
2425
- r(m.map((f) => ({ ...f, closing: !1 }))), i.current = null;
2426
- }, le), l;
2562
+ return o.current = setTimeout(() => {
2563
+ r(m.map((h) => ({ ...h, closing: !1 }))), o.current = null;
2564
+ }, de), u;
2427
2565
  }, [e]), O(() => {
2428
2566
  if (!s.length) return;
2429
2567
  let a;
2430
- const l = window.setTimeout(() => {
2568
+ const u = window.setTimeout(() => {
2431
2569
  a = () => c(), window.addEventListener("click", a);
2432
- }, 0), d = (u) => {
2433
- u.key === "Escape" && c();
2570
+ }, 0), l = (d) => {
2571
+ d.key === "Escape" && c();
2434
2572
  };
2435
- return window.addEventListener("keydown", d), () => {
2436
- window.clearTimeout(l), a && window.removeEventListener("click", a), window.removeEventListener("keydown", d);
2573
+ return window.addEventListener("keydown", l), () => {
2574
+ window.clearTimeout(u), a && window.removeEventListener("click", a), window.removeEventListener("keydown", l);
2437
2575
  };
2438
- }, [s.length, c]), Ie(
2439
- /* @__PURE__ */ h("div", { className: `notification-portal ${s.length ? "active" : ""}`, children: s.map(({ id: a, type: l, message: d, closing: u }) => {
2440
- const m = zt(l);
2576
+ }, [s.length, c]), Fe(
2577
+ /* @__PURE__ */ f("div", { className: `notification-portal ${s.length ? "active" : ""}`, children: s.map(({ id: a, type: u, message: l, closing: d }) => {
2578
+ const m = es(u);
2441
2579
  return /* @__PURE__ */ k(
2442
2580
  "div",
2443
2581
  {
2444
- className: `notification ${u ? "closing" : ""} ${Yt(m)}`,
2445
- onClick: (f) => f.stopPropagation(),
2582
+ className: `notification ${d ? "closing" : ""} ${ss(m)}`,
2583
+ onClick: (h) => h.stopPropagation(),
2446
2584
  children: [
2447
2585
  /* @__PURE__ */ k("div", { className: "notification-body", children: [
2448
- /* @__PURE__ */ h(
2449
- F,
2586
+ /* @__PURE__ */ f(
2587
+ K,
2450
2588
  {
2451
- icon: Jt(m),
2452
- className: `notification-icon ${ge(m)}`
2589
+ icon: ts(m),
2590
+ className: `notification-icon ${Se(m)}`
2453
2591
  }
2454
2592
  ),
2455
- /* @__PURE__ */ h("p", { className: `notification-text ${ge(m)}`, children: d })
2593
+ /* @__PURE__ */ f("p", { className: `notification-text ${Se(m)}`, children: l })
2456
2594
  ] }),
2457
- /* @__PURE__ */ h(
2458
- V,
2595
+ /* @__PURE__ */ f(
2596
+ G,
2459
2597
  {
2460
2598
  type: "button",
2461
- icon: Le,
2599
+ icon: _e,
2462
2600
  color: "error",
2463
2601
  className: "notification-close group",
2464
- onClick: (f) => {
2465
- f.stopPropagation(), a !== void 0 && c(a);
2602
+ onClick: (h) => {
2603
+ h.stopPropagation(), a !== void 0 && c(a);
2466
2604
  },
2467
- iconClassName: `${ge(m)} notification-close-icon`,
2605
+ iconClassName: `${Se(m)} notification-close-icon`,
2468
2606
  name: n("_accessibility:buttons.closeNotification"),
2469
2607
  "aria-label": n("_accessibility:ariaLabels.closeNotification")
2470
2608
  }
@@ -2477,83 +2615,83 @@ function Gs() {
2477
2615
  document.body
2478
2616
  );
2479
2617
  }
2480
- function zs(n) {
2618
+ function nn(n) {
2481
2619
  const { className: e, ...t } = n;
2482
- return /* @__PURE__ */ h("div", { className: "splash-screen", children: /* @__PURE__ */ h(
2483
- ee,
2620
+ return /* @__PURE__ */ f("div", { className: "splash-screen", children: /* @__PURE__ */ f(
2621
+ ne,
2484
2622
  {
2485
2623
  className: `blur-appear ${e ? ` ${e}` : ""}`,
2486
2624
  ...t
2487
2625
  }
2488
2626
  ) });
2489
2627
  }
2490
- const Xt = (n) => {
2628
+ const ns = (n) => {
2491
2629
  const {
2492
2630
  id: e,
2493
2631
  active: t,
2494
2632
  onClick: s,
2495
2633
  children: r,
2496
- to: o,
2497
- useLinks: i = !0,
2634
+ to: i,
2635
+ useLinks: o = !0,
2498
2636
  tabButtonProps: c
2499
- } = n, { linkComponent: a } = ae(), l = a;
2500
- if (!i) {
2637
+ } = n, { linkComponent: a } = ce(), u = a;
2638
+ if (!o) {
2501
2639
  const {
2502
- className: u = "",
2640
+ className: d = "",
2503
2641
  variant: m = t ? "submit" : "outlined",
2504
- color: f = t ? "primary" : "default",
2642
+ color: h = t ? "primary" : "default",
2505
2643
  ...p
2506
2644
  } = c ?? {};
2507
- return /* @__PURE__ */ h(
2508
- K,
2645
+ return /* @__PURE__ */ f(
2646
+ U,
2509
2647
  {
2510
2648
  type: "button",
2511
2649
  variant: m,
2512
- color: f,
2513
- className: `tab ${u}`,
2650
+ color: h,
2651
+ className: `tab ${d}`,
2514
2652
  onClick: s,
2515
2653
  ...p,
2516
2654
  children: r
2517
2655
  }
2518
2656
  );
2519
2657
  }
2520
- const d = `button submit tab ${t ? "primary" : "outlined"} ${(c == null ? void 0 : c.className) ?? ""}`.trim();
2521
- return /* @__PURE__ */ h(
2522
- l,
2658
+ const l = `button submit tab ${t ? "primary" : "outlined"} ${(c == null ? void 0 : c.className) ?? ""}`.trim();
2659
+ return /* @__PURE__ */ f(
2660
+ u,
2523
2661
  {
2524
- to: o ?? `#${e}`,
2662
+ to: i ?? `#${e}`,
2525
2663
  onClick: () => s(),
2526
- className: d,
2664
+ className: l,
2527
2665
  children: r
2528
2666
  }
2529
2667
  );
2530
- }, Zt = (n) => {
2531
- var f;
2668
+ }, rs = (n) => {
2669
+ var h;
2532
2670
  const {
2533
2671
  tabs: e = [],
2534
2672
  defaultTab: t,
2535
2673
  currentTab: s,
2536
2674
  onTabChange: r,
2537
- className: o = "",
2538
- tabsContainerClassName: i = "",
2675
+ className: i = "",
2676
+ tabsContainerClassName: o = "",
2539
2677
  useLinks: c = !0,
2540
2678
  tabButtonProps: a
2541
- } = n, [l, d] = A(t ?? ((f = e[0]) == null ? void 0 : f.id)), u = s ?? l, m = Q(() => e.find((p) => p.id === u), [e, u]);
2542
- return /* @__PURE__ */ k("div", { className: `tabs-layout-main ${o}`, children: [
2543
- /* @__PURE__ */ h(
2679
+ } = n, [u, l] = _(t ?? ((h = e[0]) == null ? void 0 : h.id)), d = s ?? u, m = Q(() => e.find((p) => p.id === d), [e, d]);
2680
+ return /* @__PURE__ */ k("div", { className: `tabs-layout-main ${i}`, children: [
2681
+ /* @__PURE__ */ f(
2544
2682
  "ul",
2545
2683
  {
2546
- className: `horizontal tabs tabs-container ${i}`,
2547
- children: e.map(({ id: p, to: y, label: g }) => /* @__PURE__ */ h("li", { children: /* @__PURE__ */ h(
2548
- Xt,
2684
+ className: `horizontal tabs tabs-container ${o}`,
2685
+ children: e.map(({ id: p, to: y, label: g }) => /* @__PURE__ */ f("li", { children: /* @__PURE__ */ f(
2686
+ ns,
2549
2687
  {
2550
2688
  onClick: () => {
2551
- s === void 0 && d(p), r == null || r(p);
2689
+ s === void 0 && l(p), r == null || r(p);
2552
2690
  },
2553
2691
  id: p,
2554
2692
  to: y,
2555
2693
  siblings: e.length > 1,
2556
- active: u === p,
2694
+ active: d === p,
2557
2695
  useLinks: c,
2558
2696
  tabButtonProps: a,
2559
2697
  children: g
@@ -2563,123 +2701,123 @@ const Xt = (n) => {
2563
2701
  ),
2564
2702
  m == null ? void 0 : m.content
2565
2703
  ] });
2566
- }, es = (n) => {
2704
+ }, is = (n) => {
2567
2705
  const {
2568
2706
  title: e,
2569
2707
  body: t,
2570
2708
  content: s,
2571
2709
  onClickNext: r,
2572
- onSkip: o,
2573
- onStartAsGuest: i,
2710
+ onSkip: i,
2711
+ onStartAsGuest: o,
2574
2712
  onSignIn: c,
2575
2713
  image: a = "",
2576
- alt: l = "",
2577
- final: d = !1
2578
- } = n, { t: u } = v();
2714
+ alt: u = "",
2715
+ final: l = !1
2716
+ } = n, { t: d } = N();
2579
2717
  return /* @__PURE__ */ k("div", { className: "big-appear step-container", children: [
2580
- a && /* @__PURE__ */ h("img", { src: a, alt: l }),
2581
- e != null && /* @__PURE__ */ h("h2", { className: "step-title", children: e }),
2582
- t != null && /* @__PURE__ */ h("div", { className: "step-body", children: t }),
2583
- s != null && /* @__PURE__ */ h("div", { className: "step-content", children: s }),
2584
- /* @__PURE__ */ h("div", { className: "step-actions", children: d ? /* @__PURE__ */ k(oe, { children: [
2585
- /* @__PURE__ */ h(
2586
- K,
2718
+ a && /* @__PURE__ */ f("img", { src: a, alt: u }),
2719
+ e != null && /* @__PURE__ */ f("h2", { className: "step-title", children: e }),
2720
+ t != null && /* @__PURE__ */ f("div", { className: "step-body", children: t }),
2721
+ s != null && /* @__PURE__ */ f("div", { className: "step-content", children: s }),
2722
+ /* @__PURE__ */ f("div", { className: "step-actions", children: l ? /* @__PURE__ */ k(ae, { children: [
2723
+ /* @__PURE__ */ f(
2724
+ U,
2587
2725
  {
2588
2726
  color: "primary",
2589
2727
  className: "step-button",
2590
2728
  variant: "outlined",
2591
- onClick: i,
2592
- "aria-label": u("_accessibility:ariaLabels.start"),
2593
- children: u("_accessibility:buttons.startAsGuest")
2729
+ onClick: o,
2730
+ "aria-label": d("_accessibility:ariaLabels.start"),
2731
+ children: d("_accessibility:buttons.startAsGuest")
2594
2732
  }
2595
2733
  ),
2596
- /* @__PURE__ */ h(
2597
- K,
2734
+ /* @__PURE__ */ f(
2735
+ U,
2598
2736
  {
2599
2737
  color: "primary",
2600
2738
  variant: "submit",
2601
2739
  className: "step-button",
2602
- "aria-label": u("_accessibility:ariaLabels.start"),
2740
+ "aria-label": d("_accessibility:ariaLabels.start"),
2603
2741
  onClick: c,
2604
- children: u("_accessibility:buttons.signIn")
2742
+ children: d("_accessibility:buttons.signIn")
2605
2743
  }
2606
2744
  )
2607
- ] }) : /* @__PURE__ */ k(oe, { children: [
2608
- /* @__PURE__ */ h(
2609
- K,
2745
+ ] }) : /* @__PURE__ */ k(ae, { children: [
2746
+ /* @__PURE__ */ f(
2747
+ U,
2610
2748
  {
2611
2749
  color: "primary",
2612
2750
  className: "step-button",
2613
2751
  variant: "outlined",
2614
- onClick: o,
2615
- "aria-label": u("_accessibility:ariaLabels.skip"),
2616
- children: u("_accessibility:buttons.skip")
2752
+ onClick: i,
2753
+ "aria-label": d("_accessibility:ariaLabels.skip"),
2754
+ children: d("_accessibility:buttons.skip")
2617
2755
  }
2618
2756
  ),
2619
- /* @__PURE__ */ h(
2620
- K,
2757
+ /* @__PURE__ */ f(
2758
+ U,
2621
2759
  {
2622
2760
  color: "primary",
2623
2761
  className: "step-button",
2624
2762
  variant: "outlined",
2625
2763
  onClick: () => r(),
2626
- "aria-label": u("_accessibility:ariaLabels.next"),
2627
- children: u("_accessibility:buttons.next")
2764
+ "aria-label": d("_accessibility:ariaLabels.next"),
2765
+ children: d("_accessibility:buttons.next")
2628
2766
  }
2629
2767
  )
2630
2768
  ] }) })
2631
2769
  ] });
2632
- }, Js = (n) => {
2770
+ }, rn = (n) => {
2633
2771
  const {
2634
2772
  steps: e,
2635
2773
  signInPath: t = "/auth/sign-in",
2636
2774
  guestPath: s = "/",
2637
2775
  onSkip: r,
2638
- onSignIn: o,
2639
- onStartAsGuest: i
2640
- } = n, { setGuestMode: c } = Ue(), { navigate: a } = ae(), [l, d] = A(1), u = w(() => {
2776
+ onSignIn: i,
2777
+ onStartAsGuest: o
2778
+ } = n, { setGuestMode: c } = He(), { navigate: a } = ce(), [u, l] = _(1), d = w(() => {
2641
2779
  if (r) {
2642
2780
  r();
2643
2781
  return;
2644
2782
  }
2645
2783
  a(t);
2646
2784
  }, [a, r, t]), m = w(() => {
2647
- if (o) {
2648
- o();
2785
+ if (i) {
2786
+ i();
2649
2787
  return;
2650
2788
  }
2651
2789
  a(t);
2652
- }, [a, o, t]), f = w(() => {
2653
- if (i) {
2654
- i();
2790
+ }, [a, i, t]), h = w(() => {
2791
+ if (o) {
2792
+ o();
2655
2793
  return;
2656
2794
  }
2657
2795
  c(!0), a(s);
2658
- }, [s, a, i, c]), p = Q(() => e.map((y, g) => ({
2796
+ }, [s, a, o, c]), p = Q(() => e.map((y, g) => ({
2659
2797
  id: g + 1,
2660
2798
  label: "",
2661
- content: /* @__PURE__ */ h(
2662
- es,
2799
+ content: /* @__PURE__ */ f(
2800
+ is,
2663
2801
  {
2664
2802
  ...y,
2665
2803
  final: g === e.length - 1,
2666
- onClickNext: () => d((b) => b + 1),
2667
- onSkip: u,
2668
- onStartAsGuest: f,
2804
+ onClickNext: () => l((b) => b + 1),
2805
+ onSkip: d,
2806
+ onStartAsGuest: h,
2669
2807
  onSignIn: m
2670
2808
  }
2671
2809
  )
2672
- })), [m, u, f, e]);
2673
- return /* @__PURE__ */ h("div", { className: "onboarding-main", children: /* @__PURE__ */ h(
2674
- Zt,
2810
+ })), [m, d, h, e]);
2811
+ return /* @__PURE__ */ f("div", { className: "onboarding-main", children: /* @__PURE__ */ f(
2812
+ rs,
2675
2813
  {
2676
- currentTab: l,
2677
- onTabChange: (y) => d(Number(y)),
2814
+ currentTab: u,
2815
+ onTabChange: (y) => l(Number(y)),
2678
2816
  tabs: p,
2679
2817
  useLinks: !1
2680
2818
  }
2681
2819
  ) });
2682
- }, ts = (n) => {
2820
+ }, os = (n) => {
2683
2821
  const {
2684
2822
  message: e,
2685
2823
  messageProps: t = { className: "empty-message" },
@@ -2687,90 +2825,94 @@ const Xt = (n) => {
2687
2825
  iconProps: r
2688
2826
  } = n;
2689
2827
  return /* @__PURE__ */ k("div", { className: "empty-container", children: [
2690
- r && /* @__PURE__ */ h(F, { ...r }),
2691
- /* @__PURE__ */ h("p", { ...t, children: e }),
2692
- s && /* @__PURE__ */ h(ct, { showTooltips: !1, showText: !0, ...s })
2828
+ r && /* @__PURE__ */ f(K, { ...r }),
2829
+ /* @__PURE__ */ f("p", { ...t, children: e }),
2830
+ s && /* @__PURE__ */ f(ht, { showTooltips: !1, showText: !0, ...s })
2693
2831
  ] });
2694
2832
  };
2695
2833
  export {
2696
- ue as APIClient,
2697
- en as Action,
2698
- tn as Actions,
2699
- sn as ActionsDropdown,
2700
- V as AppIconButton,
2701
- Mt as AuthClient,
2702
- Ls as AuthProvider,
2703
- ks as BaseClient,
2704
- nn as Button,
2705
- _s as ConfigProvider,
2706
- ys as ConfirmationDialog,
2707
- ye as Dialog,
2708
- be as DialogActions,
2709
- Is as Drawer,
2710
- He as DrawerMenuContext,
2711
- Rs as DrawerMenuProvider,
2712
- ts as Empty,
2713
- Hs as Error,
2714
- fs as FormContainer,
2715
- gs as FormDialog,
2716
- W as GlobalActions,
2717
- ws as IManager,
2718
- V as IconButton,
2719
- bs as ImportDialog,
2720
- Ss as IndexedDBClient,
2721
- As as ManagerProvider,
2722
- I as Methods,
2723
- Ws as Navbar,
2724
- Ve as NavbarContext,
2725
- Vs as NavbarProvider,
2726
- Gs as Notification,
2834
+ me as APIClient,
2835
+ ln as Action,
2836
+ un as Actions,
2837
+ dn as ActionsDropdown,
2838
+ G as AppIconButton,
2839
+ Kt as AuthClient,
2840
+ Os as AuthProvider,
2841
+ Ns as BaseClient,
2842
+ mn as Button,
2843
+ Ms as ConfigProvider,
2844
+ vs as ConfirmationDialog,
2845
+ ke as Dialog,
2846
+ ve as DialogActions,
2847
+ Ps as Drawer,
2848
+ Ve as DrawerMenuContext,
2849
+ Ds as DrawerMenuProvider,
2850
+ os as Empty,
2851
+ Ys as Error,
2852
+ ws as FormContainer,
2853
+ ks as FormDialog,
2854
+ z as GlobalActions,
2855
+ Ts as IManager,
2856
+ G as IconButton,
2857
+ Cs as ImportDialog,
2858
+ Es as IndexedDBClient,
2859
+ Fs as ManagerProvider,
2860
+ F as Methods,
2861
+ tn as Navbar,
2862
+ Ge as NavbarContext,
2863
+ en as NavbarProvider,
2864
+ sn as Notification,
2727
2865
  R as NotificationEnumType,
2728
- $s as NotificationProvider,
2729
- Js as Onboarding,
2730
- Qs as Page,
2731
- hs as ParagraphInput,
2732
- ps as PasswordInput,
2733
- Bs as PrettyGrid,
2734
- zs as SplashScreen,
2735
- es as Step,
2736
- Xt as Tab,
2737
- Zt as TabsLayout,
2738
- js as ToTop,
2866
+ Rs as NotificationProvider,
2867
+ rn as Onboarding,
2868
+ Xs as Page,
2869
+ bs as ParagraphInput,
2870
+ Ss as PasswordInput,
2871
+ Zs as PrettyGrid,
2872
+ nn as SplashScreen,
2873
+ is as Step,
2874
+ ns as Tab,
2875
+ rs as TabsLayout,
2876
+ Js as ToTop,
2739
2877
  Pt as buildQueryUrl,
2740
- Oe as createQueryClient,
2741
- vs as enumToKeyValueArray,
2742
- Ns as formatForDatetimeLocal,
2743
- z as fromLocal,
2744
- Cs as getFormattedDateTime,
2745
- Ts as getShortFormattedDateTime,
2746
- me as isHttpError,
2747
- Dt as isMac,
2748
- de as isValidationError,
2749
- fe as makeRequest,
2750
- Es as mapValidationErrors,
2751
- De as parseQueries,
2752
- xs as queryClient,
2753
- M as removeFromLocal,
2754
- B as toLocal,
2755
- Ue as useAuth,
2756
- ae as useConfig,
2757
- Qe as useConfirmationForm,
2758
- jt as useDeleteAction,
2759
- Fs as useDeleteDialog,
2760
- Be as useDialog,
2761
- Kt as useDrawerMenu,
2762
- Ds as useEditAction,
2763
- Qt as useExportAction,
2764
- Us as useExportActionMutate,
2765
- Os as useFormDialog,
2766
- Bt as useImportAction,
2767
- qs as useImportDialog,
2768
- Ft as useManager,
2769
- Gt as useNavbar,
2770
- J as useNotification,
2771
- Ms as usePostForm,
2772
- Ht as useRestoreAction,
2773
- Ks as useRestoreDialog,
2774
- Vt as useScrollTrigger,
2775
- Ps as useTimeAge
2878
+ qe as createQueryClient,
2879
+ $s as enumToKeyValueArray,
2880
+ Ls as formatForDatetimeLocal,
2881
+ X as fromLocal,
2882
+ xs as getFormattedDateTime,
2883
+ As as getShortFormattedDateTime,
2884
+ fe as isHttpError,
2885
+ qt as isMac,
2886
+ he as isValidationError,
2887
+ be as makeRequest,
2888
+ _s as mapValidationErrors,
2889
+ Pe as parseQueries,
2890
+ Is as queryClient,
2891
+ P as removeFromLocal,
2892
+ W as toLocal,
2893
+ He as useAuth,
2894
+ ce as useConfig,
2895
+ Be as useConfirmationForm,
2896
+ Bt as useDeleteAction,
2897
+ js as useDeleteDialog,
2898
+ We as useDialog,
2899
+ Ht as useDrawerMenu,
2900
+ Us as useEditAction,
2901
+ Qs as useEntityFormDialog,
2902
+ Gt as useExportAction,
2903
+ zs as useExportActionMutate,
2904
+ pe as useFormDialog,
2905
+ Hs as useFormDialogLegacy,
2906
+ zt as useImportAction,
2907
+ Gs as useImportDialog,
2908
+ Ut as useManager,
2909
+ Zt as useNavbar,
2910
+ ee as useNotification,
2911
+ Vs as usePostDialog,
2912
+ qs as usePostForm,
2913
+ Bs as usePutDialog,
2914
+ Wt as useRestoreAction,
2915
+ Ws as useRestoreDialog,
2916
+ Yt as useScrollTrigger,
2917
+ Ks as useTimeAge
2776
2918
  };