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