@sito/dashboard-app 0.0.57 → 0.0.59
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 +58 -2
- package/dist/components/BottomNavigation/BottomNavigation.d.ts +8 -0
- package/dist/components/BottomNavigation/NavLink.d.ts +13 -0
- package/dist/components/BottomNavigation/index.d.ts +2 -0
- package/dist/components/BottomNavigation/testmap.d.ts +2 -0
- package/dist/components/BottomNavigation/types.d.ts +26 -0
- package/dist/components/BottomNavigation/utils.d.ts +17 -0
- package/dist/components/Buttons/IconButton.d.ts +5 -0
- package/dist/components/Buttons/ToTop.d.ts +5 -0
- package/dist/components/Dialog/ConfirmationDialog.d.ts +5 -0
- package/dist/components/Dialog/Dialog.d.ts +5 -0
- package/dist/components/Dialog/DialogActions.d.ts +5 -0
- package/dist/components/Dialog/FormDialog.d.ts +5 -0
- package/dist/components/Dialog/ImportDialog/Error.d.ts +6 -5
- package/dist/components/Dialog/ImportDialog/ImportDialog.d.ts +5 -0
- package/dist/components/Dialog/ImportDialog/Loading.d.ts +6 -5
- package/dist/components/Dialog/ImportDialog/Preview.d.ts +5 -0
- package/dist/components/Dialog/ImportDialog/types.d.ts +33 -0
- package/dist/components/Drawer/Drawer.d.ts +5 -0
- package/dist/components/Empty/Empty.d.ts +5 -0
- package/dist/components/Error/Error.d.ts +5 -0
- package/dist/components/Form/FormContainer.d.ts +5 -0
- package/dist/components/Form/PasswordInput.d.ts +6 -0
- package/dist/components/Loading/SplashScreen.d.ts +5 -0
- package/dist/components/Navbar/Navbar.d.ts +5 -0
- package/dist/components/Notification/Notification.d.ts +4 -0
- package/dist/components/Onboarding/Onboarding.d.ts +5 -0
- package/dist/components/Onboarding/Step.d.ts +5 -0
- package/dist/components/Page/Page.d.ts +5 -0
- package/dist/components/Page/PageHeader.d.ts +5 -0
- package/dist/components/PrettyGrid/PrettyGrid.d.ts +5 -0
- package/dist/components/TabsLayout/Tab.d.ts +5 -0
- package/dist/components/TabsLayout/TabsLayout.d.ts +5 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/dashboard-app.cjs +1 -1
- package/dist/dashboard-app.js +1247 -1138
- package/dist/hooks/actions/types.d.ts +1 -0
- package/dist/hooks/actions/useDeleteAction.d.ts +5 -0
- package/dist/hooks/actions/useEditAction.d.ts +5 -0
- package/dist/hooks/actions/useExportAction.d.ts +5 -0
- package/dist/hooks/actions/useImportAction.d.ts +5 -0
- package/dist/hooks/actions/useRestoreAction.d.ts +5 -0
- package/dist/hooks/dialogs/useDeleteDialog.d.ts +5 -0
- package/dist/hooks/dialogs/useDialog.d.ts +4 -0
- package/dist/hooks/dialogs/useFormDialog.d.ts +5 -0
- package/dist/hooks/dialogs/useImportDialog.d.ts +5 -0
- package/dist/hooks/dialogs/usePostDialog.d.ts +5 -0
- package/dist/hooks/dialogs/usePutDialog.d.ts +5 -0
- package/dist/hooks/dialogs/useRestoreDialog.d.ts +5 -0
- package/dist/hooks/forms/useConfirmationForm.d.ts +5 -0
- package/dist/hooks/forms/usePostForm.d.ts +5 -0
- package/dist/hooks/mutate/useExportActionMutate.d.ts +5 -0
- package/dist/hooks/useScrollTrigger.d.ts +5 -0
- package/dist/hooks/useTimeAge.d.ts +4 -0
- package/dist/lib/Notification.d.ts +1 -0
- package/dist/lib/api/AuthClient.d.ts +6 -0
- package/dist/lib/api/BaseClient.d.ts +6 -3
- package/dist/lib/api/IManager.d.ts +6 -0
- package/dist/lib/api/IndexedDBClient.d.ts +6 -0
- package/dist/lib/api/SupabaseDataClient.d.ts +6 -0
- package/dist/lib/api/supabaseAuth.d.ts +6 -0
- package/dist/lib/api/utils/services.d.ts +7 -0
- package/dist/lib/errors.d.ts +16 -0
- package/dist/lib/utils/enums.d.ts +5 -0
- package/dist/lib/utils/os.d.ts +4 -0
- package/dist/main.css +1 -1
- package/dist/providers/Auth/authContext.d.ts +10 -0
- package/dist/providers/NotificationProvider.d.ts +5 -0
- package/dist/providers/Supbase/SupabaseContext.d.ts +5 -0
- package/package.json +1 -1
package/dist/dashboard-app.js
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var Xe = Object.defineProperty;
|
|
2
|
+
var Ze = (n, e, s) => e in n ? Xe(n, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[e] = s;
|
|
3
|
+
var A = (n, e, s) => Ze(n, typeof e != "symbol" ? e + "" : e, s);
|
|
4
4
|
import "./main.css";
|
|
5
|
-
import { State as
|
|
5
|
+
import { State as et, inputStateClassName as tt, labelStateClassName as st, helperTextStateClassName as nt, useTranslation as N, Button as q, Loading as ne, TextInput as rt, FileInput as ot, IconButton as it, Actions as at, ActionsDropdown as ct, useTableOptions as lt, Badge as ut, Action as dt } 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 $e, useState as R, useCallback as S, useEffect as M, useReducer as
|
|
11
|
-
import { faEyeSlash as
|
|
12
|
-
import { createPortal as
|
|
13
|
-
import { QueryClient as kt, QueryClientProvider as _e, useMutation as ne, useQueryClient as Z, useQuery as Nt } from "@tanstack/react-query";
|
|
7
|
+
import { Action as Cn, Actions as vn, ActionsDropdown as Tn, Button as kn } from "@sito/dashboard";
|
|
8
|
+
import { jsxs as E, jsx as m, Fragment as ce } from "react/jsx-runtime";
|
|
9
|
+
import { FontAwesomeIcon as F } from "@fortawesome/react-fontawesome";
|
|
10
|
+
import { forwardRef as $e, useState as R, useCallback as S, useEffect as M, useReducer as De, useRef as U, useMemo as B, createContext as X, useContext as Y, useLayoutEffect as mt } from "react";
|
|
11
|
+
import { faEyeSlash as ht, faEye as ft, faClose as Le, faTrash as pt, faRotateLeft as Re, faPencil as gt, faCircleNotch as Ie, faCloudArrowDown as bt, faCloudUpload as yt, faArrowUp as wt, faArrowLeft as St, faAdd as Te, faFilter as Ct, faBars as vt, faSearch as Tt, faCircleCheck as kt, faWarning as Et, faPlus as Nt } from "@fortawesome/free-solid-svg-icons";
|
|
12
|
+
import { createPortal as _e } from "react-dom";
|
|
14
13
|
import { faSadTear as At } from "@fortawesome/free-regular-svg-icons";
|
|
15
|
-
import {
|
|
16
|
-
|
|
14
|
+
import { QueryClient as xt, QueryClientProvider as Pe, useMutation as re, useQueryClient as Z, useQuery as $t } from "@tanstack/react-query";
|
|
15
|
+
import { useForm as Me } from "react-hook-form";
|
|
16
|
+
const ke = (n) => n == null ? !1 : `${n}`.length > 0, As = $e(function(n, e) {
|
|
17
17
|
const {
|
|
18
18
|
value: s,
|
|
19
19
|
defaultValue: t,
|
|
20
|
-
onChange:
|
|
21
|
-
state: o =
|
|
20
|
+
onChange: r,
|
|
21
|
+
state: o = et.default,
|
|
22
22
|
name: i = "",
|
|
23
23
|
id: c = "",
|
|
24
24
|
label: a = "",
|
|
25
25
|
disabled: l = !1,
|
|
26
26
|
required: u = !1,
|
|
27
27
|
containerClassName: d = "",
|
|
28
|
-
inputClassName:
|
|
29
|
-
labelClassName:
|
|
30
|
-
helperText:
|
|
28
|
+
inputClassName: h = "",
|
|
29
|
+
labelClassName: p = "",
|
|
30
|
+
helperText: f = "",
|
|
31
31
|
helperTextClassName: b = "",
|
|
32
|
-
...
|
|
33
|
-
} =
|
|
34
|
-
() =>
|
|
35
|
-
),
|
|
36
|
-
|
|
32
|
+
...y
|
|
33
|
+
} = n, g = s !== void 0, [C, w] = R(
|
|
34
|
+
() => ke(t)
|
|
35
|
+
), k = g ? ke(s) : C, v = (K) => {
|
|
36
|
+
g || w(K.currentTarget.value.length > 0), r == null || r(K);
|
|
37
37
|
};
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ E("div", { className: `form-paragraph-container group ${d}`, children: [
|
|
39
|
+
/* @__PURE__ */ m(
|
|
40
40
|
"textarea",
|
|
41
41
|
{
|
|
42
42
|
ref: e,
|
|
43
43
|
name: i,
|
|
44
44
|
id: c,
|
|
45
|
-
className: `text-input text-area form-paragraph-textarea peer ${
|
|
45
|
+
className: `text-input text-area form-paragraph-textarea peer ${tt(o)} ${k ? "has-value" : ""} ${y.placeholder ? "has-placeholder" : ""} ${h}`,
|
|
46
46
|
required: u,
|
|
47
47
|
defaultValue: t,
|
|
48
|
-
...
|
|
49
|
-
onChange:
|
|
48
|
+
...g ? { value: s } : {},
|
|
49
|
+
onChange: v,
|
|
50
50
|
disabled: l,
|
|
51
|
-
...
|
|
51
|
+
...y
|
|
52
52
|
}
|
|
53
53
|
),
|
|
54
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ E(
|
|
55
55
|
"label",
|
|
56
56
|
{
|
|
57
57
|
htmlFor: c,
|
|
58
|
-
className: `text-input-label ${
|
|
58
|
+
className: `text-input-label ${st(o)} ${p}`,
|
|
59
59
|
children: [
|
|
60
60
|
a,
|
|
61
61
|
u ? " *" : ""
|
|
62
62
|
]
|
|
63
63
|
}
|
|
64
64
|
),
|
|
65
|
-
!!
|
|
65
|
+
!!f && /* @__PURE__ */ m(
|
|
66
66
|
"p",
|
|
67
67
|
{
|
|
68
|
-
className: `text-input-helper-text ${
|
|
69
|
-
children:
|
|
68
|
+
className: `text-input-helper-text ${nt(o)} ${b}`,
|
|
69
|
+
children: f
|
|
70
70
|
}
|
|
71
71
|
)
|
|
72
72
|
] });
|
|
73
|
-
}),
|
|
74
|
-
const { t: e } =
|
|
73
|
+
}), xs = (n) => {
|
|
74
|
+
const { t: e } = N(), {
|
|
75
75
|
children: s,
|
|
76
76
|
handleSubmit: t,
|
|
77
|
-
onSubmit:
|
|
77
|
+
onSubmit: r,
|
|
78
78
|
isLoading: o = !1,
|
|
79
79
|
buttonEnd: i = !0,
|
|
80
80
|
reset: c
|
|
81
|
-
} =
|
|
82
|
-
return /* @__PURE__ */
|
|
81
|
+
} = n;
|
|
82
|
+
return /* @__PURE__ */ E("form", { className: "form-container", onSubmit: t(r), children: [
|
|
83
83
|
s,
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
|
|
84
|
+
/* @__PURE__ */ E("div", { className: `form-actions ${i ? "end" : ""}`, children: [
|
|
85
|
+
/* @__PURE__ */ E(
|
|
86
|
+
q,
|
|
87
87
|
{
|
|
88
88
|
type: "submit",
|
|
89
89
|
color: "primary",
|
|
@@ -92,8 +92,8 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
92
92
|
name: e("_accessibility:buttons.submit"),
|
|
93
93
|
"aria-label": e("_accessibility:ariaLabels.submit"),
|
|
94
94
|
children: [
|
|
95
|
-
o ? /* @__PURE__ */
|
|
96
|
-
|
|
95
|
+
o ? /* @__PURE__ */ m(
|
|
96
|
+
ne,
|
|
97
97
|
{
|
|
98
98
|
color: "stroke-base",
|
|
99
99
|
loaderClass: "!w-6 mt-1",
|
|
@@ -104,8 +104,8 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
104
104
|
]
|
|
105
105
|
}
|
|
106
106
|
),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
|
|
107
|
+
/* @__PURE__ */ m(
|
|
108
|
+
q,
|
|
109
109
|
{
|
|
110
110
|
type: "button",
|
|
111
111
|
variant: "outlined",
|
|
@@ -117,9 +117,9 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
117
117
|
)
|
|
118
118
|
] })
|
|
119
119
|
] });
|
|
120
|
-
},
|
|
121
|
-
const { t: s } =
|
|
122
|
-
return /* @__PURE__ */
|
|
120
|
+
}, $s = $e(function(n, e) {
|
|
121
|
+
const { t: s } = N(), [t, r] = R(!1);
|
|
122
|
+
return /* @__PURE__ */ m(rt, { ...n, type: t ? "text" : "password", ref: e, children: /* @__PURE__ */ m(
|
|
123
123
|
z,
|
|
124
124
|
{
|
|
125
125
|
type: "button",
|
|
@@ -128,63 +128,63 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
128
128
|
t ? "_accessibility:ariaLabels.hidePassword" : "_accessibility:ariaLabels.showPassword"
|
|
129
129
|
),
|
|
130
130
|
className: "password-icon",
|
|
131
|
-
onClick: () =>
|
|
132
|
-
icon: t ?
|
|
131
|
+
onClick: () => r(!t),
|
|
132
|
+
icon: t ? ht : ft
|
|
133
133
|
}
|
|
134
134
|
) });
|
|
135
|
-
}),
|
|
136
|
-
const { t: e } =
|
|
135
|
+
}), ye = (n) => {
|
|
136
|
+
const { t: e } = N(), {
|
|
137
137
|
title: s,
|
|
138
138
|
children: t,
|
|
139
|
-
handleClose:
|
|
139
|
+
handleClose: r,
|
|
140
140
|
open: o = !1,
|
|
141
141
|
containerClassName: i = "",
|
|
142
142
|
className: c = "",
|
|
143
143
|
animationClass: a = "appear"
|
|
144
|
-
} =
|
|
144
|
+
} = n, l = S(
|
|
145
145
|
(d) => {
|
|
146
|
-
d.key === "Escape" && o &&
|
|
146
|
+
d.key === "Escape" && o && r();
|
|
147
147
|
},
|
|
148
|
-
[o,
|
|
148
|
+
[o, r]
|
|
149
149
|
);
|
|
150
150
|
M(() => (window.addEventListener("keydown", l), () => {
|
|
151
151
|
window.removeEventListener("keydown", l);
|
|
152
152
|
}), [l]);
|
|
153
153
|
const u = S(
|
|
154
154
|
(d) => {
|
|
155
|
-
d.target === d.currentTarget &&
|
|
155
|
+
d.target === d.currentTarget && r();
|
|
156
156
|
},
|
|
157
|
-
[
|
|
157
|
+
[r]
|
|
158
158
|
);
|
|
159
159
|
return M(() => {
|
|
160
|
-
const d = (
|
|
161
|
-
|
|
160
|
+
const d = (h) => {
|
|
161
|
+
h ? document.body.style.overflow = "hidden" : document.body.style.overflow = "auto";
|
|
162
162
|
};
|
|
163
163
|
return d(o), () => {
|
|
164
164
|
d(!1);
|
|
165
165
|
};
|
|
166
|
-
}, [o]),
|
|
167
|
-
/* @__PURE__ */
|
|
166
|
+
}, [o]), _e(
|
|
167
|
+
/* @__PURE__ */ m(
|
|
168
168
|
"div",
|
|
169
169
|
{
|
|
170
170
|
"aria-label": e("_accessibility:ariaLabels.closeDialog"),
|
|
171
171
|
"aria-hidden": !o,
|
|
172
172
|
onClick: u,
|
|
173
173
|
className: `dialog-backdrop animated ${o ? `opened ${a}` : "closed"} ${i}`,
|
|
174
|
-
children: /* @__PURE__ */
|
|
174
|
+
children: /* @__PURE__ */ E(
|
|
175
175
|
"div",
|
|
176
176
|
{
|
|
177
177
|
className: `dialog elevated animated ${o ? `opened ${a}` : "closed"} ${c}`,
|
|
178
178
|
children: [
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ E("div", { className: "dialog-header", children: [
|
|
180
|
+
/* @__PURE__ */ m("h3", { className: "dialog-title", children: s }),
|
|
181
|
+
/* @__PURE__ */ m(
|
|
182
182
|
z,
|
|
183
183
|
{
|
|
184
|
-
icon:
|
|
184
|
+
icon: Le,
|
|
185
185
|
disabled: !o,
|
|
186
186
|
"aria-disabled": !o,
|
|
187
|
-
onClick:
|
|
187
|
+
onClick: r,
|
|
188
188
|
variant: "text",
|
|
189
189
|
color: "error",
|
|
190
190
|
className: "icon-button dialog-close-btn",
|
|
@@ -201,12 +201,12 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
201
201
|
),
|
|
202
202
|
document.body
|
|
203
203
|
);
|
|
204
|
-
},
|
|
204
|
+
}, we = (n) => {
|
|
205
205
|
const {
|
|
206
206
|
primaryText: e,
|
|
207
207
|
cancelText: s,
|
|
208
208
|
onPrimaryClick: t,
|
|
209
|
-
onCancel:
|
|
209
|
+
onCancel: r,
|
|
210
210
|
isLoading: o = !1,
|
|
211
211
|
disabled: i = !1,
|
|
212
212
|
primaryType: c = "submit",
|
|
@@ -214,18 +214,18 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
214
214
|
primaryClassName: l = "",
|
|
215
215
|
alignEnd: u = !1,
|
|
216
216
|
primaryName: d,
|
|
217
|
-
primaryAriaLabel:
|
|
218
|
-
cancelName:
|
|
219
|
-
cancelAriaLabel:
|
|
217
|
+
primaryAriaLabel: h,
|
|
218
|
+
cancelName: p,
|
|
219
|
+
cancelAriaLabel: f,
|
|
220
220
|
extraActions: b = []
|
|
221
|
-
} =
|
|
222
|
-
return /* @__PURE__ */
|
|
221
|
+
} = n;
|
|
222
|
+
return /* @__PURE__ */ E(
|
|
223
223
|
"div",
|
|
224
224
|
{
|
|
225
225
|
className: `dialog-actions ${u ? "end" : ""} ${a}`,
|
|
226
226
|
children: [
|
|
227
|
-
/* @__PURE__ */
|
|
228
|
-
|
|
227
|
+
/* @__PURE__ */ E(
|
|
228
|
+
q,
|
|
229
229
|
{
|
|
230
230
|
type: c,
|
|
231
231
|
color: "primary",
|
|
@@ -234,10 +234,10 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
234
234
|
disabled: i,
|
|
235
235
|
onClick: t,
|
|
236
236
|
name: d,
|
|
237
|
-
"aria-label":
|
|
237
|
+
"aria-label": h,
|
|
238
238
|
children: [
|
|
239
|
-
o ? /* @__PURE__ */
|
|
240
|
-
|
|
239
|
+
o ? /* @__PURE__ */ m(
|
|
240
|
+
ne,
|
|
241
241
|
{
|
|
242
242
|
color: "stroke-base",
|
|
243
243
|
loaderClass: "!w-6 mt-1",
|
|
@@ -248,37 +248,37 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
248
248
|
]
|
|
249
249
|
}
|
|
250
250
|
),
|
|
251
|
-
b == null ? void 0 : b.map((
|
|
252
|
-
/* @__PURE__ */
|
|
253
|
-
|
|
251
|
+
b == null ? void 0 : b.map((y) => /* @__PURE__ */ m(q, { ...y }, y.id)),
|
|
252
|
+
/* @__PURE__ */ m(
|
|
253
|
+
q,
|
|
254
254
|
{
|
|
255
255
|
type: "button",
|
|
256
256
|
variant: "outlined",
|
|
257
257
|
disabled: i,
|
|
258
|
-
onClick:
|
|
259
|
-
name:
|
|
260
|
-
"aria-label":
|
|
258
|
+
onClick: r,
|
|
259
|
+
name: p,
|
|
260
|
+
"aria-label": f,
|
|
261
261
|
children: s
|
|
262
262
|
}
|
|
263
263
|
)
|
|
264
264
|
]
|
|
265
265
|
}
|
|
266
266
|
);
|
|
267
|
-
},
|
|
268
|
-
const { t: e } =
|
|
267
|
+
}, Ds = (n) => {
|
|
268
|
+
const { t: e } = N(), {
|
|
269
269
|
children: s,
|
|
270
270
|
handleSubmit: t,
|
|
271
|
-
onSubmit:
|
|
271
|
+
onSubmit: r,
|
|
272
272
|
handleClose: o,
|
|
273
273
|
isLoading: i = !1,
|
|
274
274
|
buttonEnd: c = !0,
|
|
275
275
|
extraActions: a = [],
|
|
276
276
|
...l
|
|
277
|
-
} =
|
|
278
|
-
return /* @__PURE__ */
|
|
279
|
-
/* @__PURE__ */
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
|
|
277
|
+
} = n;
|
|
278
|
+
return /* @__PURE__ */ m(ye, { ...l, handleClose: o, children: /* @__PURE__ */ E("form", { onSubmit: t(r), children: [
|
|
279
|
+
/* @__PURE__ */ m("div", { className: "form-container", children: s }),
|
|
280
|
+
/* @__PURE__ */ m(
|
|
281
|
+
we,
|
|
282
282
|
{
|
|
283
283
|
primaryType: "submit",
|
|
284
284
|
primaryText: e("_accessibility:buttons.submit"),
|
|
@@ -296,24 +296,24 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
296
296
|
}
|
|
297
297
|
)
|
|
298
298
|
] }) });
|
|
299
|
-
},
|
|
300
|
-
const { t: e } =
|
|
299
|
+
}, Ls = (n) => {
|
|
300
|
+
const { t: e } = N(), {
|
|
301
301
|
children: s,
|
|
302
302
|
handleSubmit: t,
|
|
303
|
-
handleClose:
|
|
303
|
+
handleClose: r,
|
|
304
304
|
isLoading: o = !1,
|
|
305
305
|
extraActions: i = [],
|
|
306
306
|
...c
|
|
307
|
-
} =
|
|
308
|
-
return /* @__PURE__ */
|
|
307
|
+
} = n;
|
|
308
|
+
return /* @__PURE__ */ E(ye, { ...c, handleClose: r, children: [
|
|
309
309
|
s,
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
|
|
310
|
+
/* @__PURE__ */ m(
|
|
311
|
+
we,
|
|
312
312
|
{
|
|
313
313
|
primaryText: e("_accessibility:buttons.ok"),
|
|
314
314
|
cancelText: e("_accessibility:buttons.cancel"),
|
|
315
315
|
onPrimaryClick: t,
|
|
316
|
-
onCancel:
|
|
316
|
+
onCancel: r,
|
|
317
317
|
isLoading: o,
|
|
318
318
|
disabled: o,
|
|
319
319
|
primaryType: "button",
|
|
@@ -327,34 +327,34 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
327
327
|
)
|
|
328
328
|
] });
|
|
329
329
|
};
|
|
330
|
-
function
|
|
331
|
-
const { message: e, className: s = "" } =
|
|
332
|
-
return /* @__PURE__ */
|
|
330
|
+
function Dt(n) {
|
|
331
|
+
const { message: e, className: s = "" } = n, { t } = N();
|
|
332
|
+
return /* @__PURE__ */ m("p", { className: `import-error-message ${s}`, children: e ?? t("_messages:errors.parseFile", {
|
|
333
333
|
defaultValue: "Failed to process file"
|
|
334
334
|
}) });
|
|
335
335
|
}
|
|
336
|
-
function
|
|
337
|
-
const { message: e, className: s = "" } =
|
|
338
|
-
return /* @__PURE__ */
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
-
/* @__PURE__ */
|
|
336
|
+
function Lt(n) {
|
|
337
|
+
const { message: e, className: s = "" } = n, { t } = N();
|
|
338
|
+
return /* @__PURE__ */ E("div", { className: `import-loading ${s}`, children: [
|
|
339
|
+
/* @__PURE__ */ m(ne, { loaderClass: "w-5 h-5", className: "!w-auto" }),
|
|
340
|
+
/* @__PURE__ */ m("span", { children: e ?? t("_messages:loading.processingFile", {
|
|
341
341
|
defaultValue: "Processing file..."
|
|
342
342
|
}) })
|
|
343
343
|
] });
|
|
344
344
|
}
|
|
345
|
-
function
|
|
346
|
-
const { items: e, max: s = 5, className: t = "" } =
|
|
345
|
+
function Rt(n) {
|
|
346
|
+
const { items: e, max: s = 5, className: t = "" } = n, { t: r } = N();
|
|
347
347
|
if (!e || e.length === 0) return null;
|
|
348
348
|
const o = e.slice(0, s);
|
|
349
|
-
return /* @__PURE__ */
|
|
350
|
-
/* @__PURE__ */
|
|
349
|
+
return /* @__PURE__ */ E("div", { className: `import-preview ${t}`, children: [
|
|
350
|
+
/* @__PURE__ */ m("p", { className: "import-preview-count", children: r("_pages:common.actions.import.previewCount", {
|
|
351
351
|
count: e.length,
|
|
352
352
|
defaultValue: `Preview: ${e.length} items`
|
|
353
353
|
}) }),
|
|
354
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ m("pre", { className: "import-preview-content", children: JSON.stringify(o, null, 2) })
|
|
355
355
|
] });
|
|
356
356
|
}
|
|
357
|
-
const
|
|
357
|
+
const Oe = () => ({
|
|
358
358
|
file: null,
|
|
359
359
|
previewItems: null,
|
|
360
360
|
parseError: null,
|
|
@@ -362,43 +362,43 @@ const Me = () => ({
|
|
|
362
362
|
overrideExisting: !1,
|
|
363
363
|
inputKey: 0
|
|
364
364
|
});
|
|
365
|
-
function
|
|
365
|
+
function It(n, e) {
|
|
366
366
|
switch (e.type) {
|
|
367
367
|
case "SET_FILE":
|
|
368
368
|
return {
|
|
369
|
-
...
|
|
369
|
+
...n,
|
|
370
370
|
file: e.file,
|
|
371
371
|
previewItems: null,
|
|
372
372
|
parseError: null,
|
|
373
373
|
processing: !1
|
|
374
374
|
};
|
|
375
375
|
case "START_PROCESSING":
|
|
376
|
-
return { ...
|
|
376
|
+
return { ...n, processing: !0 };
|
|
377
377
|
case "SET_PREVIEW":
|
|
378
378
|
return {
|
|
379
|
-
...
|
|
379
|
+
...n,
|
|
380
380
|
previewItems: e.items,
|
|
381
381
|
parseError: null,
|
|
382
382
|
processing: !1
|
|
383
383
|
};
|
|
384
384
|
case "SET_ERROR":
|
|
385
385
|
return {
|
|
386
|
-
...
|
|
386
|
+
...n,
|
|
387
387
|
previewItems: null,
|
|
388
388
|
parseError: e.message,
|
|
389
389
|
processing: !1
|
|
390
390
|
};
|
|
391
391
|
case "SET_OVERRIDE":
|
|
392
|
-
return { ...
|
|
392
|
+
return { ...n, overrideExisting: e.value };
|
|
393
393
|
case "RESET":
|
|
394
|
-
return { ...
|
|
394
|
+
return { ...Oe(), inputKey: n.inputKey + 1 };
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
const
|
|
398
|
-
const { t: e } =
|
|
397
|
+
const Rs = (n) => {
|
|
398
|
+
const { t: e } = N(), {
|
|
399
399
|
children: s,
|
|
400
400
|
handleSubmit: t,
|
|
401
|
-
handleClose:
|
|
401
|
+
handleClose: r,
|
|
402
402
|
isLoading: o = !1,
|
|
403
403
|
fileProcessor: i,
|
|
404
404
|
onFileProcessed: c,
|
|
@@ -406,92 +406,92 @@ const $s = (r) => {
|
|
|
406
406
|
onOverrideChange: l,
|
|
407
407
|
open: u,
|
|
408
408
|
extraActions: d = [],
|
|
409
|
-
...
|
|
410
|
-
} =
|
|
411
|
-
|
|
412
|
-
|
|
409
|
+
...h
|
|
410
|
+
} = n, [p, f] = De(
|
|
411
|
+
It,
|
|
412
|
+
Oe()
|
|
413
413
|
), {
|
|
414
414
|
file: b,
|
|
415
|
-
previewItems:
|
|
416
|
-
parseError:
|
|
417
|
-
processing:
|
|
415
|
+
previewItems: y,
|
|
416
|
+
parseError: g,
|
|
417
|
+
processing: C,
|
|
418
418
|
overrideExisting: w,
|
|
419
|
-
inputKey:
|
|
420
|
-
} =
|
|
419
|
+
inputKey: k
|
|
420
|
+
} = p, v = U(c), K = U(i);
|
|
421
421
|
M(() => {
|
|
422
|
-
|
|
422
|
+
v.current = c;
|
|
423
423
|
}, [c]), M(() => {
|
|
424
|
-
|
|
424
|
+
K.current = i;
|
|
425
425
|
}, [i]), M(() => {
|
|
426
|
-
u ||
|
|
426
|
+
u || f({ type: "RESET" });
|
|
427
427
|
}, [u]);
|
|
428
|
-
const
|
|
429
|
-
async (
|
|
428
|
+
const V = S(
|
|
429
|
+
async (T, D) => {
|
|
430
430
|
var L;
|
|
431
|
-
if (
|
|
432
|
-
|
|
431
|
+
if (K.current) {
|
|
432
|
+
f({ type: "START_PROCESSING" });
|
|
433
433
|
try {
|
|
434
|
-
const _ = await
|
|
435
|
-
|
|
434
|
+
const _ = await K.current(T, { override: D });
|
|
435
|
+
f({ type: "SET_PREVIEW", items: _ ?? [] }), (L = v.current) == null || L.call(v, _ ?? []);
|
|
436
436
|
} catch (_) {
|
|
437
437
|
console.error(_);
|
|
438
|
-
const
|
|
439
|
-
|
|
438
|
+
const j = _ instanceof Error ? _.message : "Failed to parse file";
|
|
439
|
+
f({ type: "SET_ERROR", message: j });
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
442
|
},
|
|
443
443
|
[]
|
|
444
444
|
);
|
|
445
|
-
return /* @__PURE__ */
|
|
446
|
-
/* @__PURE__ */
|
|
447
|
-
|
|
445
|
+
return /* @__PURE__ */ E(ye, { ...h, open: u, handleClose: r, children: [
|
|
446
|
+
/* @__PURE__ */ m(
|
|
447
|
+
ot,
|
|
448
448
|
{
|
|
449
449
|
onClear: () => {
|
|
450
|
-
var
|
|
451
|
-
|
|
450
|
+
var T;
|
|
451
|
+
f({ type: "SET_FILE", file: null }), (T = v.current) == null || T.call(v, []);
|
|
452
452
|
},
|
|
453
|
-
onChange: (
|
|
453
|
+
onChange: (T) => {
|
|
454
454
|
var L, _;
|
|
455
|
-
const D = (L =
|
|
455
|
+
const D = (L = T.target.files) == null ? void 0 : L[0];
|
|
456
456
|
if (!D) {
|
|
457
|
-
|
|
457
|
+
f({ type: "SET_FILE", file: null }), (_ = v.current) == null || _.call(v, []);
|
|
458
458
|
return;
|
|
459
459
|
}
|
|
460
|
-
|
|
460
|
+
f({ type: "SET_FILE", file: D }), V(D, w);
|
|
461
461
|
},
|
|
462
462
|
label: e("_accessibility:labels.file")
|
|
463
463
|
},
|
|
464
|
-
|
|
464
|
+
k
|
|
465
465
|
),
|
|
466
|
-
/* @__PURE__ */
|
|
467
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ E("label", { className: "import-override-label", children: [
|
|
467
|
+
/* @__PURE__ */ m(
|
|
468
468
|
"input",
|
|
469
469
|
{
|
|
470
470
|
type: "checkbox",
|
|
471
471
|
checked: w,
|
|
472
|
-
onChange: (
|
|
473
|
-
const D =
|
|
474
|
-
|
|
472
|
+
onChange: (T) => {
|
|
473
|
+
const D = T.target.checked;
|
|
474
|
+
f({ type: "SET_OVERRIDE", value: D }), l == null || l(D), b && V(b, D);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
477
|
),
|
|
478
|
-
/* @__PURE__ */
|
|
478
|
+
/* @__PURE__ */ m("span", { children: e("_pages:common.actions.import.override", {
|
|
479
479
|
defaultValue: "Override existing items"
|
|
480
480
|
}) })
|
|
481
481
|
] }),
|
|
482
|
-
/* @__PURE__ */
|
|
483
|
-
|
|
484
|
-
a ? a(
|
|
482
|
+
/* @__PURE__ */ m(Dt, { message: g }),
|
|
483
|
+
C && /* @__PURE__ */ m(Lt, {}),
|
|
484
|
+
a ? a(y) : !!y && y.length > 0 && /* @__PURE__ */ m(Rt, { items: y }),
|
|
485
485
|
s,
|
|
486
|
-
/* @__PURE__ */
|
|
487
|
-
|
|
486
|
+
/* @__PURE__ */ m(
|
|
487
|
+
we,
|
|
488
488
|
{
|
|
489
489
|
primaryText: e("_accessibility:buttons.ok"),
|
|
490
490
|
cancelText: e("_accessibility:buttons.cancel"),
|
|
491
491
|
onPrimaryClick: () => {
|
|
492
|
-
(!i || !!
|
|
492
|
+
(!i || !!y && y.length > 0) && t();
|
|
493
493
|
},
|
|
494
|
-
onCancel:
|
|
494
|
+
onCancel: r,
|
|
495
495
|
isLoading: o,
|
|
496
496
|
primaryType: "button",
|
|
497
497
|
containerClassName: "import-dialog-actions",
|
|
@@ -504,18 +504,18 @@ const $s = (r) => {
|
|
|
504
504
|
)
|
|
505
505
|
] });
|
|
506
506
|
};
|
|
507
|
-
var O = /* @__PURE__ */ ((
|
|
508
|
-
const
|
|
509
|
-
async function
|
|
510
|
-
const
|
|
507
|
+
var O = /* @__PURE__ */ ((n) => (n[n.success = 0] = "success", n[n.error = 1] = "error", n[n.warning = 2] = "warning", n[n.info = 3] = "info", n))(O || {}), P = /* @__PURE__ */ ((n) => (n.GET = "GET", n.POST = "POST", n.PUT = "PUT", n.PATCH = "PATCH", n.DELETE = "DELETE", n))(P || {});
|
|
508
|
+
const _t = (n) => Array.isArray(n) || n instanceof Headers ? !1 : typeof n == "object" && n !== null && ("headers" in n || "credentials" in n), Pt = (n) => n ? _t(n) ? n : { headers: n } : {}, Mt = (n) => n ? n instanceof Headers ? Object.fromEntries(n.entries()) : Array.isArray(n) ? Object.fromEntries(n) : n : {};
|
|
509
|
+
async function he(n, e = "GET", s, t) {
|
|
510
|
+
const r = Pt(t), o = {
|
|
511
511
|
...s !== void 0 ? { "Content-Type": "application/json" } : {},
|
|
512
|
-
...
|
|
512
|
+
...Mt(r.headers)
|
|
513
513
|
};
|
|
514
514
|
try {
|
|
515
|
-
const i = await fetch(
|
|
515
|
+
const i = await fetch(n, {
|
|
516
516
|
method: e,
|
|
517
517
|
headers: o,
|
|
518
|
-
...
|
|
518
|
+
...r.credentials ? { credentials: r.credentials } : {},
|
|
519
519
|
...s !== void 0 ? { body: JSON.stringify(s) } : {}
|
|
520
520
|
}), c = await i.text();
|
|
521
521
|
let a = null;
|
|
@@ -551,44 +551,44 @@ async function me(r, e = "GET", s, t) {
|
|
|
551
551
|
};
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function Ot(n, e) {
|
|
555
555
|
const s = (t) => t instanceof Date ? t.toISOString() : String(t);
|
|
556
556
|
if (e) {
|
|
557
|
-
const t = Object.entries(e).filter(([,
|
|
558
|
-
([
|
|
557
|
+
const t = Object.entries(e).filter(([, r]) => r != null).map(
|
|
558
|
+
([r, o]) => `${encodeURIComponent(r)}=${encodeURIComponent(s(o))}`
|
|
559
559
|
).join("&");
|
|
560
|
-
return t ? `${
|
|
560
|
+
return t ? `${n}?${t}` : n;
|
|
561
561
|
}
|
|
562
|
-
return
|
|
562
|
+
return n;
|
|
563
563
|
}
|
|
564
|
-
const
|
|
565
|
-
if (typeof
|
|
566
|
-
const e =
|
|
564
|
+
const fe = (n) => typeof n == "object" && n !== null, G = (n) => n instanceof Date ? encodeURIComponent(n.toISOString()) : encodeURIComponent(String(n)), Ft = (n) => {
|
|
565
|
+
if (typeof n != "string") return;
|
|
566
|
+
const e = n.trim().toUpperCase();
|
|
567
567
|
if (e === "ACTIVE" || e === "DELETED" || e === "ALL")
|
|
568
568
|
return e;
|
|
569
|
-
},
|
|
569
|
+
}, Fe = (n, e, s) => {
|
|
570
570
|
const t = [];
|
|
571
571
|
if (e) {
|
|
572
|
-
const { sortingBy:
|
|
573
|
-
|
|
572
|
+
const { sortingBy: r, sortingOrder: o, currentPage: i, pageSize: c } = e;
|
|
573
|
+
r !== void 0 && t.push(`sort=${String(r)}`), o !== void 0 && t.push(`order=${o}`), i !== void 0 && t.push(`page=${i}`), c !== void 0 && t.push(`pageSize=${c}`);
|
|
574
574
|
}
|
|
575
575
|
if (s) {
|
|
576
|
-
const
|
|
577
|
-
|
|
576
|
+
const r = Ft(s.softDeleteScope);
|
|
577
|
+
r && t.push(`softDeleteScope=${encodeURIComponent(r)}`);
|
|
578
578
|
const o = Object.entries(s).filter(
|
|
579
579
|
([i, c]) => i !== "softDeleteScope" && c !== null && c !== void 0 && c !== ""
|
|
580
580
|
).flatMap(([i, c]) => {
|
|
581
581
|
if (Array.isArray(c))
|
|
582
|
-
return c.map((a) => a instanceof Date ? `${i}==${
|
|
583
|
-
if (
|
|
582
|
+
return c.map((a) => a instanceof Date ? `${i}==${G(a)}` : fe(a) ? `${i}==${G(a.id ?? "")}` : `${i}==${G(a)}`);
|
|
583
|
+
if (fe(c) && "start" in c && "end" in c) {
|
|
584
584
|
const a = [];
|
|
585
|
-
return c.start != null && c.start !== "" && a.push(`${i}>=${
|
|
585
|
+
return c.start != null && c.start !== "" && a.push(`${i}>=${G(c.start)}`), c.end != null && c.end !== "" && a.push(`${i}<=${G(c.end)}`), a;
|
|
586
586
|
}
|
|
587
|
-
return c instanceof Date ? `${i}==${
|
|
587
|
+
return c instanceof Date ? `${i}==${G(c)}` : fe(c) ? `${i}==${G(c.id ?? "")}` : `${i}==${G(c)}`;
|
|
588
588
|
});
|
|
589
589
|
o.length > 0 && t.push(`filters=${o.join(",")}`);
|
|
590
590
|
}
|
|
591
|
-
return t.length ? `${
|
|
591
|
+
return t.length ? `${n}?${t.join("&")}` : n;
|
|
592
592
|
}, se = class se {
|
|
593
593
|
/**
|
|
594
594
|
* @param baseUrl the base url of the server
|
|
@@ -596,21 +596,21 @@ const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
|
|
|
596
596
|
* @param secured if the api client requires token
|
|
597
597
|
* @param tokenAcquirer custom token acquirer
|
|
598
598
|
*/
|
|
599
|
-
constructor(e, s = "user", t = !0,
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
this.baseUrl = e, this.secured = t, this.userKey = s, this.rememberKey = o.rememberKey ?? "remember", this.refreshTokenKey = o.refreshTokenKey ?? "refreshToken", this.accessTokenExpiresAtKey = o.accessTokenExpiresAtKey ?? "accessTokenExpiresAt", this.refreshEndpoint = o.refreshEndpoint ?? "auth/refresh", this.refreshExpirySkewMs = o.refreshExpirySkewMs ?? 5e3, this.tokenAcquirer =
|
|
599
|
+
constructor(e, s = "user", t = !0, r, o = {}) {
|
|
600
|
+
A(this, "baseUrl");
|
|
601
|
+
A(this, "userKey");
|
|
602
|
+
A(this, "rememberKey");
|
|
603
|
+
A(this, "refreshTokenKey");
|
|
604
|
+
A(this, "accessTokenExpiresAtKey");
|
|
605
|
+
A(this, "refreshEndpoint");
|
|
606
|
+
A(this, "refreshExpirySkewMs");
|
|
607
|
+
A(this, "secured");
|
|
608
|
+
A(this, "tokenAcquirer");
|
|
609
|
+
this.baseUrl = e, this.secured = t, this.userKey = s, this.rememberKey = o.rememberKey ?? "remember", this.refreshTokenKey = o.refreshTokenKey ?? "refreshToken", this.accessTokenExpiresAtKey = o.accessTokenExpiresAtKey ?? "accessTokenExpiresAt", this.refreshEndpoint = o.refreshEndpoint ?? "auth/refresh", this.refreshExpirySkewMs = o.refreshExpirySkewMs ?? 5e3, this.tokenAcquirer = r ?? this.defaultTokenAcquirer;
|
|
610
610
|
}
|
|
611
611
|
defaultTokenAcquirer(e) {
|
|
612
612
|
if (e) return { credentials: "include" };
|
|
613
|
-
const s =
|
|
613
|
+
const s = W(this.userKey);
|
|
614
614
|
if (s && s.length) return { Authorization: `Bearer ${s}` };
|
|
615
615
|
}
|
|
616
616
|
getRefreshLockKey() {
|
|
@@ -621,12 +621,12 @@ const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
|
|
|
621
621
|
return `${s}${t}`;
|
|
622
622
|
}
|
|
623
623
|
getRefreshToken() {
|
|
624
|
-
const e =
|
|
624
|
+
const e = W(this.refreshTokenKey);
|
|
625
625
|
if (typeof e == "string" && e.length)
|
|
626
626
|
return e;
|
|
627
627
|
}
|
|
628
628
|
getAccessTokenExpiresAt() {
|
|
629
|
-
const e =
|
|
629
|
+
const e = W(this.accessTokenExpiresAtKey);
|
|
630
630
|
if (typeof e == "string" && e.length)
|
|
631
631
|
return e;
|
|
632
632
|
}
|
|
@@ -643,9 +643,9 @@ const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
|
|
|
643
643
|
I(this.userKey), I(this.rememberKey), I(this.refreshTokenKey), I(this.accessTokenExpiresAtKey);
|
|
644
644
|
}
|
|
645
645
|
storeSession(e, s) {
|
|
646
|
-
|
|
646
|
+
H(this.userKey, e.token);
|
|
647
647
|
const t = e.refreshToken === void 0 ? s : e.refreshToken;
|
|
648
|
-
typeof t == "string" && t.length ?
|
|
648
|
+
typeof t == "string" && t.length ? H(this.refreshTokenKey, t) : I(this.refreshTokenKey), typeof e.accessTokenExpiresAt == "string" && e.accessTokenExpiresAt.length ? H(this.accessTokenExpiresAtKey, e.accessTokenExpiresAt) : I(this.accessTokenExpiresAtKey);
|
|
649
649
|
}
|
|
650
650
|
async refreshAccessTokenWithMutex() {
|
|
651
651
|
const e = this.getRefreshToken();
|
|
@@ -659,8 +659,8 @@ const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
|
|
|
659
659
|
await t;
|
|
660
660
|
return;
|
|
661
661
|
}
|
|
662
|
-
const
|
|
663
|
-
const { data: o, status: i, error: c } = await
|
|
662
|
+
const r = (async () => {
|
|
663
|
+
const { data: o, status: i, error: c } = await he(
|
|
664
664
|
this.buildUrl(this.refreshEndpoint),
|
|
665
665
|
P.POST,
|
|
666
666
|
{ refreshToken: e }
|
|
@@ -672,9 +672,9 @@ const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
|
|
|
672
672
|
};
|
|
673
673
|
this.storeSession(o, e);
|
|
674
674
|
})();
|
|
675
|
-
se.refreshInFlight.set(s,
|
|
675
|
+
se.refreshInFlight.set(s, r);
|
|
676
676
|
try {
|
|
677
|
-
await
|
|
677
|
+
await r;
|
|
678
678
|
} finally {
|
|
679
679
|
se.refreshInFlight.delete(s);
|
|
680
680
|
}
|
|
@@ -689,30 +689,30 @@ const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
|
|
|
689
689
|
return e ? e instanceof Headers ? Object.fromEntries(e.entries()) : Array.isArray(e) ? Object.fromEntries(e) : e : {};
|
|
690
690
|
}
|
|
691
691
|
mergeRequestConfig(e) {
|
|
692
|
-
const s = this.secured ? this.tokenAcquirer() : void 0, t = this.toRequestOptions(s),
|
|
692
|
+
const s = this.secured ? this.tokenAcquirer() : void 0, t = this.toRequestOptions(s), r = this.toRequestOptions(e), o = {
|
|
693
693
|
...this.toHeaderRecord(t.headers),
|
|
694
|
-
...this.toHeaderRecord(
|
|
695
|
-
}, i =
|
|
694
|
+
...this.toHeaderRecord(r.headers)
|
|
695
|
+
}, i = r.credentials ?? t.credentials, c = Object.keys(o).length > 0;
|
|
696
696
|
if (i)
|
|
697
697
|
return c ? { headers: o, credentials: i } : { credentials: i };
|
|
698
698
|
if (c) return o;
|
|
699
699
|
}
|
|
700
|
-
async makeRequestWithRefresh(e, s, t,
|
|
700
|
+
async makeRequestWithRefresh(e, s, t, r) {
|
|
701
701
|
this.secured && this.shouldRefreshBeforeRequest() && await this.refreshAccessTokenWithMutex();
|
|
702
|
-
let o = await
|
|
702
|
+
let o = await he(
|
|
703
703
|
this.buildUrl(e),
|
|
704
704
|
s,
|
|
705
705
|
t,
|
|
706
|
-
this.mergeRequestConfig(
|
|
706
|
+
this.mergeRequestConfig(r)
|
|
707
707
|
);
|
|
708
|
-
return this.secured && o.status === 401 && this.canRefresh() && (await this.refreshAccessTokenWithMutex(), o = await
|
|
708
|
+
return this.secured && o.status === 401 && this.canRefresh() && (await this.refreshAccessTokenWithMutex(), o = await he(
|
|
709
709
|
this.buildUrl(e),
|
|
710
710
|
s,
|
|
711
711
|
t,
|
|
712
|
-
this.mergeRequestConfig(
|
|
712
|
+
this.mergeRequestConfig(r)
|
|
713
713
|
)), o;
|
|
714
714
|
}
|
|
715
|
-
async doQuery(e, s = P.GET, t,
|
|
715
|
+
async doQuery(e, s = P.GET, t, r) {
|
|
716
716
|
const {
|
|
717
717
|
data: o,
|
|
718
718
|
status: i,
|
|
@@ -721,7 +721,7 @@ const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
|
|
|
721
721
|
e,
|
|
722
722
|
s,
|
|
723
723
|
t,
|
|
724
|
-
|
|
724
|
+
r
|
|
725
725
|
);
|
|
726
726
|
if (c || i < 200 || i >= 300)
|
|
727
727
|
throw c ?? {
|
|
@@ -737,12 +737,12 @@ const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
|
|
|
737
737
|
* @returns Result list
|
|
738
738
|
*/
|
|
739
739
|
async get(e, s, t) {
|
|
740
|
-
const
|
|
740
|
+
const r = Fe(e, s, t), {
|
|
741
741
|
data: o,
|
|
742
742
|
error: i,
|
|
743
743
|
status: c
|
|
744
744
|
} = await this.makeRequestWithRefresh(
|
|
745
|
-
|
|
745
|
+
r,
|
|
746
746
|
P.GET
|
|
747
747
|
);
|
|
748
748
|
if (i || c < 200 || c >= 300 || !o)
|
|
@@ -761,19 +761,19 @@ const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
|
|
|
761
761
|
async patch(e, s) {
|
|
762
762
|
const {
|
|
763
763
|
error: t,
|
|
764
|
-
data:
|
|
764
|
+
data: r,
|
|
765
765
|
status: o
|
|
766
766
|
} = await this.makeRequestWithRefresh(
|
|
767
767
|
e,
|
|
768
768
|
P.PATCH,
|
|
769
769
|
s
|
|
770
770
|
);
|
|
771
|
-
if (t ||
|
|
771
|
+
if (t || r === null || r === void 0)
|
|
772
772
|
throw t ?? {
|
|
773
773
|
status: o,
|
|
774
774
|
message: "Unknown error"
|
|
775
775
|
};
|
|
776
|
-
return
|
|
776
|
+
return r;
|
|
777
777
|
}
|
|
778
778
|
/**
|
|
779
779
|
* @param endpoint - backend endpoint
|
|
@@ -783,19 +783,19 @@ const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
|
|
|
783
783
|
async delete(e, s) {
|
|
784
784
|
const {
|
|
785
785
|
error: t,
|
|
786
|
-
data:
|
|
786
|
+
data: r,
|
|
787
787
|
status: o
|
|
788
788
|
} = await this.makeRequestWithRefresh(
|
|
789
789
|
e,
|
|
790
790
|
P.DELETE,
|
|
791
791
|
s
|
|
792
792
|
);
|
|
793
|
-
if (t ||
|
|
793
|
+
if (t || r === null || r === void 0)
|
|
794
794
|
throw t ?? {
|
|
795
795
|
status: o,
|
|
796
796
|
message: "Unknown error"
|
|
797
797
|
};
|
|
798
|
-
return
|
|
798
|
+
return r;
|
|
799
799
|
}
|
|
800
800
|
/**
|
|
801
801
|
*
|
|
@@ -806,26 +806,31 @@ const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
|
|
|
806
806
|
async post(e, s) {
|
|
807
807
|
const {
|
|
808
808
|
error: t,
|
|
809
|
-
data:
|
|
809
|
+
data: r,
|
|
810
810
|
status: o
|
|
811
811
|
} = await this.makeRequestWithRefresh(
|
|
812
812
|
e,
|
|
813
813
|
P.POST,
|
|
814
814
|
s
|
|
815
815
|
);
|
|
816
|
-
if (t ||
|
|
816
|
+
if (t || r === null || r === void 0)
|
|
817
817
|
throw t ?? {
|
|
818
818
|
status: o,
|
|
819
819
|
message: "Unknown error"
|
|
820
820
|
};
|
|
821
|
-
return
|
|
821
|
+
return r;
|
|
822
822
|
}
|
|
823
823
|
};
|
|
824
|
-
|
|
824
|
+
A(se, "refreshInFlight", /* @__PURE__ */ new Map());
|
|
825
825
|
let de = se;
|
|
826
|
-
class
|
|
826
|
+
class Ut {
|
|
827
|
+
/**
|
|
828
|
+
* @param baseUrl - API base URL.
|
|
829
|
+
* @param userKey - Storage key for user session data.
|
|
830
|
+
* @param authConfig - Custom auth storage key configuration.
|
|
831
|
+
*/
|
|
827
832
|
constructor(e, s = "user", t = {}) {
|
|
828
|
-
|
|
833
|
+
A(this, "api");
|
|
829
834
|
this.api = new de(e, s, !1, void 0, t);
|
|
830
835
|
}
|
|
831
836
|
async login(e) {
|
|
@@ -846,11 +851,11 @@ class Ot {
|
|
|
846
851
|
async logout(e) {
|
|
847
852
|
const s = "auth/sign-out", t = e != null && e.accessToken ? {
|
|
848
853
|
Authorization: `Bearer ${e.accessToken}`
|
|
849
|
-
} : void 0,
|
|
854
|
+
} : void 0, r = e != null && e.refreshToken ? { refreshToken: e.refreshToken } : void 0;
|
|
850
855
|
return await this.api.doQuery(
|
|
851
856
|
s,
|
|
852
857
|
P.POST,
|
|
853
|
-
|
|
858
|
+
r,
|
|
854
859
|
t
|
|
855
860
|
);
|
|
856
861
|
}
|
|
@@ -870,10 +875,15 @@ class Ot {
|
|
|
870
875
|
);
|
|
871
876
|
}
|
|
872
877
|
}
|
|
873
|
-
class
|
|
878
|
+
class Is {
|
|
879
|
+
/**
|
|
880
|
+
* @param baseUrl - API base URL.
|
|
881
|
+
* @param userKey - Storage key for user session data.
|
|
882
|
+
* @param authConfig - Custom auth storage key configuration.
|
|
883
|
+
*/
|
|
874
884
|
constructor(e, s, t = {}) {
|
|
875
|
-
|
|
876
|
-
this.auth = new
|
|
885
|
+
A(this, "auth");
|
|
886
|
+
this.auth = new Ut(e, s, t);
|
|
877
887
|
}
|
|
878
888
|
/**
|
|
879
889
|
* @returns auth
|
|
@@ -882,17 +892,19 @@ class xs {
|
|
|
882
892
|
return this.auth;
|
|
883
893
|
}
|
|
884
894
|
}
|
|
885
|
-
class
|
|
895
|
+
class _s {
|
|
886
896
|
/**
|
|
887
|
-
*
|
|
888
|
-
* @param
|
|
889
|
-
* @param
|
|
897
|
+
* @param table - Resource table/endpoint name.
|
|
898
|
+
* @param baseUrl - API base URL.
|
|
899
|
+
* @param userKey - Storage key for user session data.
|
|
900
|
+
* @param secured - Whether this client requires auth headers.
|
|
901
|
+
* @param authConfig - Custom auth storage key configuration.
|
|
890
902
|
*/
|
|
891
|
-
constructor(e, s, t = "user",
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
this.table = e, this.secured =
|
|
903
|
+
constructor(e, s, t = "user", r = !0, o = {}) {
|
|
904
|
+
A(this, "table");
|
|
905
|
+
A(this, "secured");
|
|
906
|
+
A(this, "api");
|
|
907
|
+
this.table = e, this.secured = r, this.api = new de(s, t, r, void 0, o);
|
|
896
908
|
}
|
|
897
909
|
/**
|
|
898
910
|
*
|
|
@@ -940,7 +952,7 @@ class Ds {
|
|
|
940
952
|
* @returns - List of elements
|
|
941
953
|
*/
|
|
942
954
|
async export(e) {
|
|
943
|
-
const s =
|
|
955
|
+
const s = Fe(
|
|
944
956
|
`${this.table}/export`,
|
|
945
957
|
void 0,
|
|
946
958
|
e
|
|
@@ -966,7 +978,7 @@ class Ds {
|
|
|
966
978
|
*/
|
|
967
979
|
async commonGet(e) {
|
|
968
980
|
return await this.api.doQuery(
|
|
969
|
-
|
|
981
|
+
Ot(`${this.table}/common`, e),
|
|
970
982
|
P.GET
|
|
971
983
|
);
|
|
972
984
|
}
|
|
@@ -985,12 +997,17 @@ class Ds {
|
|
|
985
997
|
return await this.api.patch(`${this.table}/restore`, e);
|
|
986
998
|
}
|
|
987
999
|
}
|
|
988
|
-
class
|
|
1000
|
+
class Ps {
|
|
1001
|
+
/**
|
|
1002
|
+
* @param table - Object store name.
|
|
1003
|
+
* @param dbName - IndexedDB database name.
|
|
1004
|
+
* @param version - IndexedDB schema version.
|
|
1005
|
+
*/
|
|
989
1006
|
constructor(e, s, t = 1) {
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
1007
|
+
A(this, "table");
|
|
1008
|
+
A(this, "dbName");
|
|
1009
|
+
A(this, "version");
|
|
1010
|
+
A(this, "db", null);
|
|
994
1011
|
this.table = e, this.dbName = s, this.version = t;
|
|
995
1012
|
}
|
|
996
1013
|
close() {
|
|
@@ -999,18 +1016,18 @@ class Ls {
|
|
|
999
1016
|
open() {
|
|
1000
1017
|
return this.db ? Promise.resolve(this.db) : new Promise((e, s) => {
|
|
1001
1018
|
const t = indexedDB.open(this.dbName, this.version);
|
|
1002
|
-
t.onupgradeneeded = (
|
|
1003
|
-
const o =
|
|
1019
|
+
t.onupgradeneeded = (r) => {
|
|
1020
|
+
const o = r.target.result;
|
|
1004
1021
|
o.objectStoreNames.contains(this.table) || o.createObjectStore(this.table, {
|
|
1005
1022
|
keyPath: "id",
|
|
1006
1023
|
autoIncrement: !0
|
|
1007
1024
|
});
|
|
1008
|
-
}, t.onsuccess = (
|
|
1009
|
-
this.db =
|
|
1025
|
+
}, t.onsuccess = (r) => {
|
|
1026
|
+
this.db = r.target.result, this.db.onversionchange = () => {
|
|
1010
1027
|
this.close();
|
|
1011
1028
|
}, e(this.db);
|
|
1012
|
-
}, t.onerror = (
|
|
1013
|
-
s(
|
|
1029
|
+
}, t.onerror = (r) => {
|
|
1030
|
+
s(r.target.error);
|
|
1014
1031
|
};
|
|
1015
1032
|
});
|
|
1016
1033
|
}
|
|
@@ -1029,25 +1046,25 @@ class Ls {
|
|
|
1029
1046
|
async insertMany(e) {
|
|
1030
1047
|
const s = await this.transaction("readwrite");
|
|
1031
1048
|
let t = 0;
|
|
1032
|
-
for (const
|
|
1033
|
-
t = await this.request(s.add(
|
|
1049
|
+
for (const r of e)
|
|
1050
|
+
t = await this.request(s.add(r));
|
|
1034
1051
|
return { ...e[e.length - 1], id: t };
|
|
1035
1052
|
}
|
|
1036
1053
|
async update(e, s) {
|
|
1037
1054
|
const t = typeof e == "number" ? s : e;
|
|
1038
1055
|
if (!t)
|
|
1039
1056
|
throw new Error("IndexedDBClient.update requires a value payload");
|
|
1040
|
-
const
|
|
1041
|
-
return await this.request(o.put(
|
|
1057
|
+
const r = typeof e == "number" ? { ...t, id: t.id ?? e } : t, o = await this.transaction("readwrite");
|
|
1058
|
+
return await this.request(o.put(r)), r;
|
|
1042
1059
|
}
|
|
1043
1060
|
async get(e, s) {
|
|
1044
|
-
var
|
|
1045
|
-
const t = await this.transaction("readonly"),
|
|
1046
|
-
o.sort((
|
|
1047
|
-
const
|
|
1048
|
-
return
|
|
1061
|
+
var p;
|
|
1062
|
+
const t = await this.transaction("readonly"), r = await this.request(t.getAll()), o = this.applyFilter(r, s), i = (e == null ? void 0 : e.sortingBy) ?? "id", c = ((p = e == null ? void 0 : e.sortingOrder) == null ? void 0 : p.toLowerCase()) ?? "asc";
|
|
1063
|
+
o.sort((f, b) => {
|
|
1064
|
+
const y = f[i], g = b[i];
|
|
1065
|
+
return y < g ? c === "asc" ? -1 : 1 : y > g ? c === "asc" ? 1 : -1 : 0;
|
|
1049
1066
|
});
|
|
1050
|
-
const a = (e == null ? void 0 : e.pageSize) ?? 10, l = (e == null ? void 0 : e.currentPage) ?? 0, u = o.length, d = Math.ceil(u / a),
|
|
1067
|
+
const a = (e == null ? void 0 : e.pageSize) ?? 10, l = (e == null ? void 0 : e.currentPage) ?? 0, u = o.length, d = Math.ceil(u / a), h = o.slice(
|
|
1051
1068
|
l * a,
|
|
1052
1069
|
l * a + a
|
|
1053
1070
|
);
|
|
@@ -1058,7 +1075,7 @@ class Ls {
|
|
|
1058
1075
|
pageSize: a,
|
|
1059
1076
|
totalElements: u,
|
|
1060
1077
|
totalPages: d,
|
|
1061
|
-
items:
|
|
1078
|
+
items: h
|
|
1062
1079
|
};
|
|
1063
1080
|
}
|
|
1064
1081
|
async export(e) {
|
|
@@ -1068,8 +1085,8 @@ class Ls {
|
|
|
1068
1085
|
async import(e) {
|
|
1069
1086
|
const s = await this.transaction("readwrite");
|
|
1070
1087
|
let t = 0;
|
|
1071
|
-
for (const
|
|
1072
|
-
e.override ? await this.request(s.put(
|
|
1088
|
+
for (const r of e.items)
|
|
1089
|
+
e.override ? await this.request(s.put(r)) : await this.request(s.add(r)), t++;
|
|
1073
1090
|
return t;
|
|
1074
1091
|
}
|
|
1075
1092
|
async commonGet(e) {
|
|
@@ -1084,8 +1101,8 @@ class Ls {
|
|
|
1084
1101
|
async softDelete(e) {
|
|
1085
1102
|
const s = await this.transaction("readwrite");
|
|
1086
1103
|
let t = 0;
|
|
1087
|
-
for (const
|
|
1088
|
-
const o = await this.request(s.get(
|
|
1104
|
+
for (const r of e) {
|
|
1105
|
+
const o = await this.request(s.get(r));
|
|
1089
1106
|
o && (await this.request(s.put({ ...o, deletedAt: /* @__PURE__ */ new Date() })), t++);
|
|
1090
1107
|
}
|
|
1091
1108
|
return t;
|
|
@@ -1093,15 +1110,15 @@ class Ls {
|
|
|
1093
1110
|
async restore(e) {
|
|
1094
1111
|
const s = await this.transaction("readwrite");
|
|
1095
1112
|
let t = 0;
|
|
1096
|
-
for (const
|
|
1097
|
-
const o = await this.request(s.get(
|
|
1113
|
+
for (const r of e) {
|
|
1114
|
+
const o = await this.request(s.get(r));
|
|
1098
1115
|
o && (await this.request(s.put({ ...o, deletedAt: null })), t++);
|
|
1099
1116
|
}
|
|
1100
1117
|
return t;
|
|
1101
1118
|
}
|
|
1102
1119
|
applyFilter(e, s) {
|
|
1103
1120
|
if (!s) return e;
|
|
1104
|
-
const t = this.resolveSoftDeleteScope(s.softDeleteScope),
|
|
1121
|
+
const t = this.resolveSoftDeleteScope(s.softDeleteScope), r = t === void 0 ? e : e.filter(
|
|
1105
1122
|
(i) => this.matchesSoftDeleteScope(
|
|
1106
1123
|
t,
|
|
1107
1124
|
i.deletedAt
|
|
@@ -1109,7 +1126,7 @@ class Ls {
|
|
|
1109
1126
|
), o = Object.entries(s).filter(
|
|
1110
1127
|
([i, c]) => i !== "softDeleteScope" && c !== void 0
|
|
1111
1128
|
);
|
|
1112
|
-
return o.length === 0 ?
|
|
1129
|
+
return o.length === 0 ? r : r.filter(
|
|
1113
1130
|
(i) => o.every(
|
|
1114
1131
|
([c, a]) => this.matchesFilterValue(
|
|
1115
1132
|
a,
|
|
@@ -1143,34 +1160,39 @@ class Ls {
|
|
|
1143
1160
|
return e === "DELETED" ? t : !t;
|
|
1144
1161
|
}
|
|
1145
1162
|
}
|
|
1146
|
-
const
|
|
1147
|
-
if (typeof
|
|
1148
|
-
const e =
|
|
1163
|
+
const be = (n) => typeof n == "object" && n !== null, Kt = (n) => be(n) ? "start" in n || "end" in n : !1, jt = (n) => n !== void 0, ae = (n) => n instanceof Date ? n.toISOString() : n, Qt = (n) => {
|
|
1164
|
+
if (typeof n != "string") return;
|
|
1165
|
+
const e = n.trim().toUpperCase();
|
|
1149
1166
|
if (e === "ACTIVE") return "ACTIVE";
|
|
1150
1167
|
if (e === "DELETED") return "DELETED";
|
|
1151
1168
|
if (e === "ALL") return "ALL";
|
|
1152
1169
|
};
|
|
1153
|
-
class
|
|
1170
|
+
class Ms {
|
|
1171
|
+
/**
|
|
1172
|
+
* @param table - Resource table name.
|
|
1173
|
+
* @param supabase - Supabase client with `from` capability.
|
|
1174
|
+
* @param options - Mapping and column configuration options.
|
|
1175
|
+
*/
|
|
1154
1176
|
constructor(e, s, t = {}) {
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1177
|
+
A(this, "table");
|
|
1178
|
+
A(this, "supabase");
|
|
1179
|
+
A(this, "idColumn");
|
|
1180
|
+
A(this, "deletedAtColumn");
|
|
1181
|
+
A(this, "defaultSortColumn");
|
|
1182
|
+
A(this, "options");
|
|
1161
1183
|
this.table = e, this.supabase = s, this.options = t, this.idColumn = t.idColumn ?? "id", this.deletedAtColumn = t.deletedAtColumn ?? "deletedAt", this.defaultSortColumn = t.defaultSortColumn ?? this.idColumn;
|
|
1162
1184
|
}
|
|
1163
1185
|
resolveStatus(e) {
|
|
1164
1186
|
return typeof e == "number" && Number.isFinite(e) ? e : 500;
|
|
1165
1187
|
}
|
|
1166
|
-
throwHttpError(e, s, t,
|
|
1188
|
+
throwHttpError(e, s, t, r = "Unknown error") {
|
|
1167
1189
|
throw {
|
|
1168
1190
|
status: this.resolveStatus(s),
|
|
1169
|
-
message: (e == null ? void 0 : e.message) || t ||
|
|
1191
|
+
message: (e == null ? void 0 : e.message) || t || r
|
|
1170
1192
|
};
|
|
1171
1193
|
}
|
|
1172
|
-
assertNoError(e, s, t,
|
|
1173
|
-
e && this.throwHttpError(e, s, t,
|
|
1194
|
+
assertNoError(e, s, t, r) {
|
|
1195
|
+
e && this.throwHttpError(e, s, t, r);
|
|
1174
1196
|
}
|
|
1175
1197
|
toDto(e) {
|
|
1176
1198
|
return this.options.mapRowToDto ? this.options.mapRowToDto(e) : e;
|
|
@@ -1188,28 +1210,28 @@ class Rs {
|
|
|
1188
1210
|
return this.options.mapImportPreviewToRow ? this.options.mapImportPreviewToRow(e) : e;
|
|
1189
1211
|
}
|
|
1190
1212
|
resolveObjectFilterValue(e) {
|
|
1191
|
-
return "id" in e ?
|
|
1213
|
+
return "id" in e ? ae(e.id) : "";
|
|
1192
1214
|
}
|
|
1193
1215
|
applyFilters(e, s) {
|
|
1194
1216
|
if (!s) return e;
|
|
1195
1217
|
let t = e;
|
|
1196
|
-
const
|
|
1197
|
-
return
|
|
1218
|
+
const r = Qt(s.softDeleteScope);
|
|
1219
|
+
return r === "ACTIVE" ? t = t.is(this.deletedAtColumn, null) : r === "DELETED" && (t = t.not(this.deletedAtColumn, "is", null)), Object.entries(s).forEach(([o, i]) => {
|
|
1198
1220
|
if (o === "softDeleteScope" || i === void 0 || i === null || i === "")
|
|
1199
1221
|
return;
|
|
1200
1222
|
const c = o === "deletedAt" ? this.deletedAtColumn : o;
|
|
1201
1223
|
if (Array.isArray(i)) {
|
|
1202
|
-
const a = i.map((l) => l instanceof Date ? l.toISOString() :
|
|
1224
|
+
const a = i.map((l) => l instanceof Date ? l.toISOString() : be(l) ? this.resolveObjectFilterValue(l) : ae(l)).filter(jt);
|
|
1203
1225
|
a.length > 0 && (t = t.in(c, a));
|
|
1204
1226
|
return;
|
|
1205
1227
|
}
|
|
1206
|
-
if (
|
|
1228
|
+
if (Kt(i)) {
|
|
1207
1229
|
i.start !== void 0 && i.start !== "" && (t = t.gte(
|
|
1208
1230
|
c,
|
|
1209
|
-
|
|
1231
|
+
ae(i.start)
|
|
1210
1232
|
)), i.end !== void 0 && i.end !== "" && (t = t.lte(
|
|
1211
1233
|
c,
|
|
1212
|
-
|
|
1234
|
+
ae(i.end)
|
|
1213
1235
|
));
|
|
1214
1236
|
return;
|
|
1215
1237
|
}
|
|
@@ -1217,7 +1239,7 @@ class Rs {
|
|
|
1217
1239
|
t = t.eq(c, i.toISOString());
|
|
1218
1240
|
return;
|
|
1219
1241
|
}
|
|
1220
|
-
if (
|
|
1242
|
+
if (be(i)) {
|
|
1221
1243
|
t = t.eq(
|
|
1222
1244
|
c,
|
|
1223
1245
|
this.resolveObjectFilterValue(i)
|
|
@@ -1226,7 +1248,7 @@ class Rs {
|
|
|
1226
1248
|
}
|
|
1227
1249
|
t = t.eq(
|
|
1228
1250
|
c,
|
|
1229
|
-
|
|
1251
|
+
ae(i)
|
|
1230
1252
|
);
|
|
1231
1253
|
}), t;
|
|
1232
1254
|
}
|
|
@@ -1254,13 +1276,13 @@ class Rs {
|
|
|
1254
1276
|
t.statusText,
|
|
1255
1277
|
"Unable to insert many rows"
|
|
1256
1278
|
);
|
|
1257
|
-
const
|
|
1258
|
-
return
|
|
1279
|
+
const r = (o = t.data) == null ? void 0 : o.at(-1);
|
|
1280
|
+
return r || this.throwHttpError(
|
|
1259
1281
|
null,
|
|
1260
1282
|
t.status,
|
|
1261
1283
|
t.statusText,
|
|
1262
1284
|
"Unable to insert many rows"
|
|
1263
|
-
), this.toDto(
|
|
1285
|
+
), this.toDto(r);
|
|
1264
1286
|
}
|
|
1265
1287
|
async update(e) {
|
|
1266
1288
|
const s = {
|
|
@@ -1279,7 +1301,7 @@ class Rs {
|
|
|
1279
1301
|
), this.toDto(t.data);
|
|
1280
1302
|
}
|
|
1281
1303
|
async get(e, s) {
|
|
1282
|
-
const t = (e == null ? void 0 : e.pageSize) ?? 10,
|
|
1304
|
+
const t = (e == null ? void 0 : e.pageSize) ?? 10, r = (e == null ? void 0 : e.currentPage) ?? 0, o = String((e == null ? void 0 : e.sortingBy) ?? this.defaultSortColumn), i = String((e == null ? void 0 : e.sortingOrder) ?? "asc").toLowerCase() === "desc" ? "desc" : "asc", c = r * t, a = c + t - 1;
|
|
1283
1305
|
let l = this.supabase.from(this.table).select("*", {
|
|
1284
1306
|
count: "exact"
|
|
1285
1307
|
});
|
|
@@ -1291,14 +1313,14 @@ class Rs {
|
|
|
1291
1313
|
u.statusText,
|
|
1292
1314
|
"Unable to load list"
|
|
1293
1315
|
);
|
|
1294
|
-
const d = (u.data ?? []).map((
|
|
1316
|
+
const d = (u.data ?? []).map((p) => this.toDto(p)), h = u.count ?? d.length;
|
|
1295
1317
|
return {
|
|
1296
1318
|
sort: o,
|
|
1297
1319
|
order: i,
|
|
1298
|
-
currentPage:
|
|
1320
|
+
currentPage: r,
|
|
1299
1321
|
pageSize: t,
|
|
1300
|
-
totalElements:
|
|
1301
|
-
totalPages: t > 0 ? Math.ceil(
|
|
1322
|
+
totalElements: h,
|
|
1323
|
+
totalPages: t > 0 ? Math.ceil(h / t) : 0,
|
|
1302
1324
|
items: d
|
|
1303
1325
|
};
|
|
1304
1326
|
}
|
|
@@ -1311,18 +1333,18 @@ class Rs {
|
|
|
1311
1333
|
t.status,
|
|
1312
1334
|
t.statusText,
|
|
1313
1335
|
"Unable to export"
|
|
1314
|
-
), (t.data ?? []).map((
|
|
1336
|
+
), (t.data ?? []).map((r) => this.toDto(r));
|
|
1315
1337
|
}
|
|
1316
1338
|
async import(e) {
|
|
1317
1339
|
var o;
|
|
1318
1340
|
if (e.items.length === 0) return 0;
|
|
1319
|
-
const s = e.items.map((i) => this.toImportRow(i)),
|
|
1341
|
+
const s = e.items.map((i) => this.toImportRow(i)), r = await (e.override ? this.supabase.from(this.table).upsert(s, { onConflict: this.idColumn }).select(this.idColumn) : this.supabase.from(this.table).insert(s).select(this.idColumn));
|
|
1320
1342
|
return this.assertNoError(
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1343
|
+
r.error,
|
|
1344
|
+
r.status,
|
|
1345
|
+
r.statusText,
|
|
1324
1346
|
"Unable to import rows"
|
|
1325
|
-
), ((o =
|
|
1347
|
+
), ((o = r.data) == null ? void 0 : o.length) ?? 0;
|
|
1326
1348
|
}
|
|
1327
1349
|
async commonGet(e) {
|
|
1328
1350
|
let s = this.supabase.from(this.table).select("*");
|
|
@@ -1333,7 +1355,7 @@ class Rs {
|
|
|
1333
1355
|
t.status,
|
|
1334
1356
|
t.statusText,
|
|
1335
1357
|
"Unable to load common data"
|
|
1336
|
-
), (t.data ?? []).map((
|
|
1358
|
+
), (t.data ?? []).map((r) => this.toCommonDto(r));
|
|
1337
1359
|
}
|
|
1338
1360
|
async getById(e) {
|
|
1339
1361
|
const s = {
|
|
@@ -1356,7 +1378,7 @@ class Rs {
|
|
|
1356
1378
|
if (e.length === 0) return 0;
|
|
1357
1379
|
const s = ((c = (i = this.options).nowFactory) == null ? void 0 : c.call(i).toISOString()) ?? (/* @__PURE__ */ new Date()).toISOString(), t = this.supabase.from(this.table).update({
|
|
1358
1380
|
[this.deletedAtColumn]: s
|
|
1359
|
-
}),
|
|
1381
|
+
}), r = `(${e.join(",")})`, o = await t.filter(this.idColumn, "in", r).select(this.idColumn);
|
|
1360
1382
|
return this.assertNoError(
|
|
1361
1383
|
o.error,
|
|
1362
1384
|
o.status,
|
|
@@ -1367,53 +1389,53 @@ class Rs {
|
|
|
1367
1389
|
async restore(e) {
|
|
1368
1390
|
var o;
|
|
1369
1391
|
if (e.length === 0) return 0;
|
|
1370
|
-
const s = this.supabase.from(this.table).update({ [this.deletedAtColumn]: null }), t = `(${e.join(",")})`,
|
|
1392
|
+
const s = this.supabase.from(this.table).update({ [this.deletedAtColumn]: null }), t = `(${e.join(",")})`, r = await s.filter(this.idColumn, "in", t).select(this.idColumn);
|
|
1371
1393
|
return this.assertNoError(
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1394
|
+
r.error,
|
|
1395
|
+
r.status,
|
|
1396
|
+
r.statusText,
|
|
1375
1397
|
"Unable to restore"
|
|
1376
|
-
), ((o =
|
|
1398
|
+
), ((o = r.data) == null ? void 0 : o.length) ?? 0;
|
|
1377
1399
|
}
|
|
1378
1400
|
}
|
|
1379
|
-
const
|
|
1380
|
-
if (
|
|
1401
|
+
const Ht = (n) => typeof n == "object" && n !== null, qt = (n, e) => {
|
|
1402
|
+
if (Ht(n))
|
|
1381
1403
|
for (const s of e) {
|
|
1382
|
-
const t =
|
|
1404
|
+
const t = n[s];
|
|
1383
1405
|
if (typeof t == "string" && t.trim().length > 0)
|
|
1384
1406
|
return t.trim();
|
|
1385
1407
|
}
|
|
1386
|
-
},
|
|
1387
|
-
if (!
|
|
1388
|
-
const s = Number(
|
|
1408
|
+
}, Bt = (n, e) => {
|
|
1409
|
+
if (!n) return e;
|
|
1410
|
+
const s = Number(n);
|
|
1389
1411
|
return Number.isFinite(s) ? s : e;
|
|
1390
|
-
},
|
|
1412
|
+
}, Ee = (n, e) => {
|
|
1391
1413
|
const {
|
|
1392
1414
|
defaultId: s = 0,
|
|
1393
1415
|
defaultUsername: t = "",
|
|
1394
|
-
defaultEmail:
|
|
1416
|
+
defaultEmail: r = "",
|
|
1395
1417
|
usernameMetadataKeys: o = ["username", "name", "full_name"]
|
|
1396
|
-
} = e ?? {}, i =
|
|
1397
|
-
|
|
1418
|
+
} = e ?? {}, i = qt(
|
|
1419
|
+
n.user.user_metadata,
|
|
1398
1420
|
o
|
|
1399
1421
|
);
|
|
1400
1422
|
return {
|
|
1401
|
-
id:
|
|
1423
|
+
id: Bt(n.user.id, s),
|
|
1402
1424
|
username: i ?? t,
|
|
1403
|
-
email:
|
|
1404
|
-
token:
|
|
1405
|
-
refreshToken:
|
|
1406
|
-
accessTokenExpiresAt: typeof
|
|
1425
|
+
email: n.user.email ?? r,
|
|
1426
|
+
token: n.access_token,
|
|
1427
|
+
refreshToken: n.refresh_token ?? null,
|
|
1428
|
+
accessTokenExpiresAt: typeof n.expires_at == "number" ? new Date(n.expires_at * 1e3).toISOString() : null
|
|
1407
1429
|
};
|
|
1408
1430
|
};
|
|
1409
|
-
function
|
|
1410
|
-
return Object.keys(
|
|
1431
|
+
function Os(n) {
|
|
1432
|
+
return Object.keys(n).filter((e) => isNaN(Number(e))).map((e) => ({
|
|
1411
1433
|
key: e,
|
|
1412
|
-
value:
|
|
1434
|
+
value: n[e]
|
|
1413
1435
|
}));
|
|
1414
1436
|
}
|
|
1415
|
-
const
|
|
1416
|
-
const s = localStorage.getItem(
|
|
1437
|
+
const W = (n, e = "") => {
|
|
1438
|
+
const s = localStorage.getItem(n) ?? void 0;
|
|
1417
1439
|
if (s && e.length)
|
|
1418
1440
|
switch (e) {
|
|
1419
1441
|
case "object":
|
|
@@ -1426,12 +1448,12 @@ const G = (r, e = "") => {
|
|
|
1426
1448
|
return s;
|
|
1427
1449
|
}
|
|
1428
1450
|
return s;
|
|
1429
|
-
},
|
|
1430
|
-
|
|
1451
|
+
}, H = (n, e) => localStorage.setItem(
|
|
1452
|
+
n,
|
|
1431
1453
|
typeof e == "object" ? JSON.stringify(e) : e
|
|
1432
|
-
), I = (
|
|
1433
|
-
function
|
|
1434
|
-
const e =
|
|
1454
|
+
), I = (n) => localStorage.removeItem(n);
|
|
1455
|
+
function Fs(n) {
|
|
1456
|
+
const e = n ? new Date(n) : /* @__PURE__ */ new Date(), s = {
|
|
1435
1457
|
weekday: "long",
|
|
1436
1458
|
// martes
|
|
1437
1459
|
day: "numeric",
|
|
@@ -1452,70 +1474,70 @@ function _s(r) {
|
|
|
1452
1474
|
s
|
|
1453
1475
|
);
|
|
1454
1476
|
}
|
|
1455
|
-
function
|
|
1456
|
-
const e =
|
|
1457
|
-
return `${s}/${t}/${
|
|
1477
|
+
function Us(n) {
|
|
1478
|
+
const e = n ? new Date(n) : /* @__PURE__ */ new Date(), s = String(e.getDate()).padStart(2, "0"), t = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getFullYear()).slice(-2), o = String(e.getHours()).padStart(2, "0"), i = String(e.getMinutes()).padStart(2, "0");
|
|
1479
|
+
return `${s}/${t}/${r} ${o}:${i}`;
|
|
1458
1480
|
}
|
|
1459
|
-
function
|
|
1460
|
-
const e =
|
|
1461
|
-
return `${s}-${t}-${
|
|
1481
|
+
function Ks(n) {
|
|
1482
|
+
const e = n ? new Date(n) : /* @__PURE__ */ new Date(), s = e.getFullYear(), t = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0"), o = String(e.getHours()).padStart(2, "0"), i = String(e.getMinutes()).padStart(2, "0");
|
|
1483
|
+
return `${s}-${t}-${r}T${o}:${i}`;
|
|
1462
1484
|
}
|
|
1463
|
-
const
|
|
1485
|
+
const Vt = () => {
|
|
1464
1486
|
var s;
|
|
1465
|
-
const
|
|
1487
|
+
const n = navigator, e = ((s = n == null ? void 0 : n.userAgentData) == null ? void 0 : s.platform) || (n == null ? void 0 : n.platform) || "";
|
|
1466
1488
|
return /Mac|iPhone|iPod|iPad/i.test(e);
|
|
1467
1489
|
};
|
|
1468
|
-
function
|
|
1469
|
-
if (!
|
|
1470
|
-
const e =
|
|
1490
|
+
function Se(n) {
|
|
1491
|
+
if (!n || typeof n != "object") return !1;
|
|
1492
|
+
const e = n;
|
|
1471
1493
|
return Array.isArray(e.errors) && e.errors.every(
|
|
1472
1494
|
(s) => Array.isArray(s) && s.length === 2 && typeof s[0] == "string"
|
|
1473
1495
|
);
|
|
1474
1496
|
}
|
|
1475
|
-
function
|
|
1476
|
-
if (!
|
|
1477
|
-
const e =
|
|
1497
|
+
function Ce(n) {
|
|
1498
|
+
if (!n || typeof n != "object") return !1;
|
|
1499
|
+
const e = n;
|
|
1478
1500
|
return typeof (e == null ? void 0 : e.status) == "number" && typeof (e == null ? void 0 : e.message) == "string";
|
|
1479
1501
|
}
|
|
1480
|
-
function
|
|
1481
|
-
return
|
|
1502
|
+
function js(n, e) {
|
|
1503
|
+
return n != null && n.errors ? n.errors.map(([s, t]) => e(s, t)) : [];
|
|
1482
1504
|
}
|
|
1483
|
-
const
|
|
1505
|
+
const Ue = X(
|
|
1484
1506
|
void 0
|
|
1485
1507
|
);
|
|
1486
|
-
function
|
|
1487
|
-
const { children: e } =
|
|
1488
|
-
(
|
|
1489
|
-
const { type:
|
|
1490
|
-
switch (
|
|
1508
|
+
function Qs(n) {
|
|
1509
|
+
const { children: e } = n, s = U(0), [t, r] = De(
|
|
1510
|
+
(h, p) => {
|
|
1511
|
+
const { type: f, items: b, id: y } = p;
|
|
1512
|
+
switch (f) {
|
|
1491
1513
|
case "set":
|
|
1492
1514
|
return b ?? [];
|
|
1493
1515
|
case "remove":
|
|
1494
|
-
return
|
|
1516
|
+
return y !== void 0 ? h.filter((g) => g.id !== y) : [];
|
|
1495
1517
|
}
|
|
1496
|
-
return
|
|
1518
|
+
return h;
|
|
1497
1519
|
},
|
|
1498
1520
|
[],
|
|
1499
1521
|
() => []
|
|
1500
|
-
), o = (
|
|
1501
|
-
(
|
|
1522
|
+
), o = (h) => h.map((p) => ({ ...p, id: s.current++ })), i = S(
|
|
1523
|
+
(h) => r({
|
|
1502
1524
|
type: "set",
|
|
1503
|
-
items: o([{ ...
|
|
1525
|
+
items: o([{ ...h, type: O.error }])
|
|
1504
1526
|
}),
|
|
1505
1527
|
[]
|
|
1506
1528
|
), c = S(
|
|
1507
|
-
(
|
|
1529
|
+
(h) => r({ type: "set", items: o([{ ...h }]) }),
|
|
1508
1530
|
[]
|
|
1509
1531
|
), a = S(
|
|
1510
|
-
(
|
|
1532
|
+
(h) => r({ type: "set", items: o(h) }),
|
|
1511
1533
|
[]
|
|
1512
1534
|
), l = S(
|
|
1513
|
-
(
|
|
1535
|
+
(h) => r({
|
|
1514
1536
|
type: "set",
|
|
1515
|
-
items: o([{ ...
|
|
1537
|
+
items: o([{ ...h, type: O.success }])
|
|
1516
1538
|
}),
|
|
1517
1539
|
[]
|
|
1518
|
-
), u = (
|
|
1540
|
+
), u = (h) => r({ type: "remove", id: h }), d = B(() => ({
|
|
1519
1541
|
notification: t,
|
|
1520
1542
|
removeNotification: u,
|
|
1521
1543
|
showErrorNotification: i,
|
|
@@ -1529,14 +1551,14 @@ function Fs(r) {
|
|
|
1529
1551
|
a,
|
|
1530
1552
|
l
|
|
1531
1553
|
]);
|
|
1532
|
-
return /* @__PURE__ */
|
|
1554
|
+
return /* @__PURE__ */ m(Ue.Provider, { value: d, children: e });
|
|
1533
1555
|
}
|
|
1534
1556
|
const oe = () => {
|
|
1535
|
-
const
|
|
1536
|
-
if (!
|
|
1557
|
+
const n = Y(Ue);
|
|
1558
|
+
if (!n)
|
|
1537
1559
|
throw new Error("NotificationContext must be used within a Provider");
|
|
1538
|
-
return
|
|
1539
|
-
},
|
|
1560
|
+
return n;
|
|
1561
|
+
}, ve = () => new xt({
|
|
1540
1562
|
defaultOptions: {
|
|
1541
1563
|
queries: {
|
|
1542
1564
|
refetchInterval: !1,
|
|
@@ -1548,50 +1570,50 @@ const oe = () => {
|
|
|
1548
1570
|
// default: true
|
|
1549
1571
|
}
|
|
1550
1572
|
}
|
|
1551
|
-
}),
|
|
1573
|
+
}), Hs = ve(), Ke = X(
|
|
1552
1574
|
void 0
|
|
1553
|
-
),
|
|
1554
|
-
const { children: e, manager: s, queryClient: t } =
|
|
1555
|
-
return /* @__PURE__ */
|
|
1556
|
-
},
|
|
1557
|
-
const
|
|
1558
|
-
if (!
|
|
1575
|
+
), qs = (n) => {
|
|
1576
|
+
const { children: e, manager: s, queryClient: t } = n, [r] = R(ve), o = t ?? r;
|
|
1577
|
+
return /* @__PURE__ */ m(Ke.Provider, { value: { client: s }, children: /* @__PURE__ */ m(Pe, { client: o, children: e }) });
|
|
1578
|
+
}, Wt = () => {
|
|
1579
|
+
const n = Y(Ke);
|
|
1580
|
+
if (!n)
|
|
1559
1581
|
throw new Error("managerContext must be used within a Provider");
|
|
1560
|
-
return
|
|
1561
|
-
},
|
|
1582
|
+
return n.client;
|
|
1583
|
+
}, me = X(
|
|
1562
1584
|
void 0
|
|
1563
|
-
),
|
|
1564
|
-
const
|
|
1565
|
-
if (!
|
|
1566
|
-
return
|
|
1567
|
-
},
|
|
1585
|
+
), zt = () => {
|
|
1586
|
+
const n = Y(me);
|
|
1587
|
+
if (!n) throw new Error("authContext must be used within a Provider");
|
|
1588
|
+
return n;
|
|
1589
|
+
}, je = () => Y(me), Bs = (n) => {
|
|
1568
1590
|
const {
|
|
1569
1591
|
children: e,
|
|
1570
1592
|
guestMode: s = "guest_mode",
|
|
1571
1593
|
user: t = "user",
|
|
1572
|
-
remember:
|
|
1594
|
+
remember: r = "remember",
|
|
1573
1595
|
refreshTokenKey: o = "refreshToken",
|
|
1574
1596
|
accessTokenExpiresAtKey: i = "accessTokenExpiresAt"
|
|
1575
|
-
} =
|
|
1576
|
-
I(t), I(
|
|
1577
|
-
}, [i, o,
|
|
1578
|
-
(
|
|
1579
|
-
|
|
1597
|
+
} = n, c = Wt(), [a, l] = R({}), u = S(() => {
|
|
1598
|
+
I(t), I(r), I(o), I(i);
|
|
1599
|
+
}, [i, o, r, t]), d = S(() => !!W(s, "boolean") && a.token === void 0, [a.token, s]), h = S(
|
|
1600
|
+
(g) => {
|
|
1601
|
+
H(s, g);
|
|
1580
1602
|
},
|
|
1581
1603
|
[s]
|
|
1582
|
-
),
|
|
1583
|
-
(
|
|
1584
|
-
if (!
|
|
1585
|
-
const w =
|
|
1586
|
-
l(
|
|
1604
|
+
), p = S(
|
|
1605
|
+
(g, C) => {
|
|
1606
|
+
if (!g) return;
|
|
1607
|
+
const w = W(r, "boolean"), k = C ?? (typeof w == "boolean" ? w : !1);
|
|
1608
|
+
l(g), I(s), H(t, g.token), H(r, k), typeof g.refreshToken == "string" && g.refreshToken.length ? H(o, g.refreshToken) : I(o), typeof g.accessTokenExpiresAt == "string" && g.accessTokenExpiresAt.length ? H(i, g.accessTokenExpiresAt) : I(i);
|
|
1587
1609
|
},
|
|
1588
|
-
[i, s, o,
|
|
1589
|
-
),
|
|
1590
|
-
const
|
|
1610
|
+
[i, s, o, r, t]
|
|
1611
|
+
), f = S(async () => {
|
|
1612
|
+
const g = W(t) ?? a.token, C = W(o) ?? (typeof a.refreshToken == "string" ? a.refreshToken : void 0);
|
|
1591
1613
|
try {
|
|
1592
1614
|
await c.Auth.logout({
|
|
1593
|
-
accessToken:
|
|
1594
|
-
refreshToken:
|
|
1615
|
+
accessToken: g,
|
|
1616
|
+
refreshToken: C
|
|
1595
1617
|
});
|
|
1596
1618
|
} catch (w) {
|
|
1597
1619
|
console.error(w);
|
|
@@ -1606,133 +1628,133 @@ const oe = () => {
|
|
|
1606
1628
|
t
|
|
1607
1629
|
]), b = S(async () => {
|
|
1608
1630
|
try {
|
|
1609
|
-
const
|
|
1610
|
-
|
|
1611
|
-
} catch (
|
|
1612
|
-
console.error(
|
|
1631
|
+
const g = await c.Auth.getSession();
|
|
1632
|
+
p(g);
|
|
1633
|
+
} catch (g) {
|
|
1634
|
+
console.error(g), f();
|
|
1613
1635
|
}
|
|
1614
|
-
}, [
|
|
1636
|
+
}, [p, f, c.Auth]), y = B(() => ({
|
|
1615
1637
|
account: a,
|
|
1616
|
-
logUser:
|
|
1617
|
-
logoutUser:
|
|
1638
|
+
logUser: p,
|
|
1639
|
+
logoutUser: f,
|
|
1618
1640
|
logUserFromLocal: b,
|
|
1619
1641
|
isInGuestMode: d,
|
|
1620
|
-
setGuestMode:
|
|
1642
|
+
setGuestMode: h
|
|
1621
1643
|
}), [
|
|
1622
1644
|
a,
|
|
1623
|
-
f,
|
|
1624
1645
|
p,
|
|
1646
|
+
f,
|
|
1625
1647
|
b,
|
|
1626
1648
|
d,
|
|
1627
|
-
|
|
1649
|
+
h
|
|
1628
1650
|
]);
|
|
1629
|
-
return /* @__PURE__ */
|
|
1630
|
-
},
|
|
1631
|
-
const
|
|
1632
|
-
if (!
|
|
1651
|
+
return /* @__PURE__ */ m(me.Provider, { value: y, children: e });
|
|
1652
|
+
}, Vs = () => zt(), Qe = X(void 0), Gt = () => {
|
|
1653
|
+
const n = Y(Qe);
|
|
1654
|
+
if (!n)
|
|
1633
1655
|
throw new Error("supabaseManagerContext must be used within a Provider");
|
|
1634
|
-
return
|
|
1635
|
-
},
|
|
1656
|
+
return n.client;
|
|
1657
|
+
}, Ws = (n) => {
|
|
1636
1658
|
const {
|
|
1637
1659
|
children: e,
|
|
1638
1660
|
guestMode: s = "guest_mode",
|
|
1639
1661
|
user: t = "user",
|
|
1640
|
-
remember:
|
|
1662
|
+
remember: r = "remember",
|
|
1641
1663
|
refreshTokenKey: o = "refreshToken",
|
|
1642
1664
|
accessTokenExpiresAtKey: i = "accessTokenExpiresAt",
|
|
1643
1665
|
sessionMapper: c
|
|
1644
|
-
} =
|
|
1666
|
+
} = n, a = Gt(), l = U(c ?? Ee);
|
|
1645
1667
|
M(() => {
|
|
1646
|
-
l.current = c ??
|
|
1668
|
+
l.current = c ?? Ee;
|
|
1647
1669
|
}, [c]);
|
|
1648
|
-
const [u, d] = R({}),
|
|
1649
|
-
I(t), I(
|
|
1650
|
-
}, [i, o,
|
|
1670
|
+
const [u, d] = R({}), h = S(() => {
|
|
1671
|
+
I(t), I(r), I(o), I(i);
|
|
1672
|
+
}, [i, o, r, t]), p = S(() => !!W(s, "boolean") && u.token === void 0, [u.token, s]), f = S(
|
|
1651
1673
|
(w) => {
|
|
1652
|
-
|
|
1674
|
+
H(s, w);
|
|
1653
1675
|
},
|
|
1654
1676
|
[s]
|
|
1655
1677
|
), b = S(
|
|
1656
|
-
(w,
|
|
1678
|
+
(w, k) => {
|
|
1657
1679
|
if (!w) return;
|
|
1658
|
-
const
|
|
1659
|
-
d(w), I(s),
|
|
1680
|
+
const v = W(r, "boolean"), K = k ?? (typeof v == "boolean" ? v : !1);
|
|
1681
|
+
d(w), I(s), H(t, w.token), H(r, K), typeof w.refreshToken == "string" && w.refreshToken.length ? H(o, w.refreshToken) : I(o), typeof w.accessTokenExpiresAt == "string" && w.accessTokenExpiresAt.length ? H(i, w.accessTokenExpiresAt) : I(i);
|
|
1660
1682
|
},
|
|
1661
|
-
[i, s, o,
|
|
1662
|
-
),
|
|
1683
|
+
[i, s, o, r, t]
|
|
1684
|
+
), y = S(async () => {
|
|
1663
1685
|
try {
|
|
1664
1686
|
await a.auth.signOut();
|
|
1665
1687
|
} catch (w) {
|
|
1666
1688
|
console.error(w);
|
|
1667
1689
|
}
|
|
1668
|
-
d({}),
|
|
1669
|
-
}, [
|
|
1690
|
+
d({}), h();
|
|
1691
|
+
}, [h, a.auth]), g = S(async () => {
|
|
1670
1692
|
try {
|
|
1671
|
-
const { data: w, error:
|
|
1672
|
-
if (
|
|
1693
|
+
const { data: w, error: k } = await a.auth.getSession();
|
|
1694
|
+
if (k) throw k;
|
|
1673
1695
|
if (!w.session) {
|
|
1674
|
-
d({}),
|
|
1696
|
+
d({}), h();
|
|
1675
1697
|
return;
|
|
1676
1698
|
}
|
|
1677
1699
|
b(l.current(w.session));
|
|
1678
1700
|
} catch (w) {
|
|
1679
|
-
console.error(w), await
|
|
1701
|
+
console.error(w), await y();
|
|
1680
1702
|
}
|
|
1681
|
-
}, [
|
|
1703
|
+
}, [h, b, y, a.auth]);
|
|
1682
1704
|
M(() => {
|
|
1683
1705
|
let w = !0;
|
|
1684
1706
|
(async () => {
|
|
1685
|
-
w && await
|
|
1707
|
+
w && await g();
|
|
1686
1708
|
})();
|
|
1687
|
-
const { data:
|
|
1709
|
+
const { data: v } = a.auth.onAuthStateChange((K, V) => {
|
|
1688
1710
|
if (w) {
|
|
1689
|
-
if (!
|
|
1690
|
-
d({}),
|
|
1711
|
+
if (!V) {
|
|
1712
|
+
d({}), h();
|
|
1691
1713
|
return;
|
|
1692
1714
|
}
|
|
1693
|
-
b(l.current(
|
|
1715
|
+
b(l.current(V));
|
|
1694
1716
|
}
|
|
1695
1717
|
});
|
|
1696
1718
|
return () => {
|
|
1697
|
-
w = !1,
|
|
1719
|
+
w = !1, v.subscription.unsubscribe();
|
|
1698
1720
|
};
|
|
1699
|
-
}, [
|
|
1700
|
-
const
|
|
1721
|
+
}, [h, b, g, a.auth]);
|
|
1722
|
+
const C = B(() => ({
|
|
1701
1723
|
account: u,
|
|
1702
1724
|
logUser: b,
|
|
1703
|
-
logoutUser:
|
|
1704
|
-
logUserFromLocal:
|
|
1705
|
-
isInGuestMode:
|
|
1706
|
-
setGuestMode:
|
|
1725
|
+
logoutUser: y,
|
|
1726
|
+
logUserFromLocal: g,
|
|
1727
|
+
isInGuestMode: p,
|
|
1728
|
+
setGuestMode: f
|
|
1707
1729
|
}), [
|
|
1708
1730
|
u,
|
|
1709
1731
|
b,
|
|
1710
|
-
g,
|
|
1711
1732
|
y,
|
|
1712
|
-
|
|
1713
|
-
p
|
|
1733
|
+
g,
|
|
1734
|
+
p,
|
|
1735
|
+
f
|
|
1714
1736
|
]);
|
|
1715
|
-
return /* @__PURE__ */
|
|
1716
|
-
},
|
|
1717
|
-
const { children: e, supabase: s, queryClient: t } =
|
|
1718
|
-
return /* @__PURE__ */
|
|
1719
|
-
},
|
|
1720
|
-
const { children: e, location: s, navigate: t, linkComponent:
|
|
1721
|
-
return /* @__PURE__ */
|
|
1722
|
-
|
|
1737
|
+
return /* @__PURE__ */ m(me.Provider, { value: C, children: e });
|
|
1738
|
+
}, zs = (n) => {
|
|
1739
|
+
const { children: e, supabase: s, queryClient: t } = n, [r] = R(ve), o = t ?? r;
|
|
1740
|
+
return /* @__PURE__ */ m(Qe.Provider, { value: { client: s }, children: /* @__PURE__ */ m(Pe, { client: o, children: e }) });
|
|
1741
|
+
}, He = X({}), Gs = (n) => {
|
|
1742
|
+
const { children: e, location: s, navigate: t, linkComponent: r, searchComponent: o } = n;
|
|
1743
|
+
return /* @__PURE__ */ m(
|
|
1744
|
+
He.Provider,
|
|
1723
1745
|
{
|
|
1724
|
-
value: { location: s, navigate: t, linkComponent:
|
|
1746
|
+
value: { location: s, navigate: t, linkComponent: r, searchComponent: o },
|
|
1725
1747
|
children: e
|
|
1726
1748
|
}
|
|
1727
1749
|
);
|
|
1728
|
-
},
|
|
1729
|
-
const
|
|
1730
|
-
if (
|
|
1750
|
+
}, ie = () => {
|
|
1751
|
+
const n = Y(He);
|
|
1752
|
+
if (n === void 0 || Object.keys(n).length === 0)
|
|
1731
1753
|
throw new Error(
|
|
1732
1754
|
"Config provider has not been set. This step is required and cannot be skipped."
|
|
1733
1755
|
);
|
|
1734
|
-
return
|
|
1735
|
-
},
|
|
1756
|
+
return n;
|
|
1757
|
+
}, Jt = {
|
|
1736
1758
|
addChildItem: () => {
|
|
1737
1759
|
},
|
|
1738
1760
|
removeChildItem: () => {
|
|
@@ -1740,10 +1762,10 @@ const oe = () => {
|
|
|
1740
1762
|
clearDynamicItems: () => {
|
|
1741
1763
|
},
|
|
1742
1764
|
dynamicItems: {}
|
|
1743
|
-
}, qe =
|
|
1744
|
-
|
|
1745
|
-
),
|
|
1746
|
-
const { children: e } =
|
|
1765
|
+
}, qe = X(
|
|
1766
|
+
Jt
|
|
1767
|
+
), Js = (n) => {
|
|
1768
|
+
const { children: e } = n, [s, t] = R({}), r = S(
|
|
1747
1769
|
(a, l) => t((u) => ({
|
|
1748
1770
|
...u,
|
|
1749
1771
|
[a]: [...u[a] ?? [], l]
|
|
@@ -1752,7 +1774,7 @@ const oe = () => {
|
|
|
1752
1774
|
), o = S(
|
|
1753
1775
|
(a, l) => t((u) => ({
|
|
1754
1776
|
...u,
|
|
1755
|
-
[a]: (u[a] ?? []).filter((d,
|
|
1777
|
+
[a]: (u[a] ?? []).filter((d, h) => h !== l)
|
|
1756
1778
|
})),
|
|
1757
1779
|
[]
|
|
1758
1780
|
), i = S((a) => {
|
|
@@ -1760,45 +1782,47 @@ const oe = () => {
|
|
|
1760
1782
|
...l,
|
|
1761
1783
|
[a]: []
|
|
1762
1784
|
}) : {});
|
|
1763
|
-
}, []), c =
|
|
1785
|
+
}, []), c = B(
|
|
1764
1786
|
() => ({
|
|
1765
1787
|
dynamicItems: s,
|
|
1766
|
-
addChildItem:
|
|
1788
|
+
addChildItem: r,
|
|
1767
1789
|
removeChildItem: o,
|
|
1768
1790
|
clearDynamicItems: i
|
|
1769
1791
|
}),
|
|
1770
|
-
[s, i, o,
|
|
1792
|
+
[s, i, o, r]
|
|
1771
1793
|
);
|
|
1772
|
-
return /* @__PURE__ */
|
|
1794
|
+
return /* @__PURE__ */ m(
|
|
1773
1795
|
qe.Provider,
|
|
1774
1796
|
{
|
|
1775
1797
|
value: c,
|
|
1776
1798
|
children: e
|
|
1777
1799
|
}
|
|
1778
1800
|
);
|
|
1779
|
-
},
|
|
1780
|
-
function
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1801
|
+
}, Yt = () => Y(qe);
|
|
1802
|
+
function Ys(n) {
|
|
1803
|
+
var y;
|
|
1804
|
+
const { t: e } = N(), { open: s, onClose: t, menuMap: r, logo: o } = n, i = je(), { dynamicItems: c } = Yt(), { linkComponent: a, location: l } = ie(), u = a, d = B(() => r.filter((g) => {
|
|
1805
|
+
var k;
|
|
1806
|
+
const C = g.auth, w = !!((k = i == null ? void 0 : i.account) != null && k.email);
|
|
1807
|
+
return C == null || C && w || !C && !w;
|
|
1808
|
+
}), [(y = i == null ? void 0 : i.account) == null ? void 0 : y.email, r]), h = S(
|
|
1785
1809
|
(g) => {
|
|
1786
1810
|
g.key === "Escape" && s && t();
|
|
1787
1811
|
},
|
|
1788
1812
|
[t, s]
|
|
1789
1813
|
);
|
|
1790
|
-
M(() => (document.addEventListener("keydown",
|
|
1791
|
-
document.removeEventListener("keydown",
|
|
1792
|
-
}), [
|
|
1793
|
-
const
|
|
1794
|
-
(g,
|
|
1814
|
+
M(() => (document.addEventListener("keydown", h), () => {
|
|
1815
|
+
document.removeEventListener("keydown", h);
|
|
1816
|
+
}), [h]);
|
|
1817
|
+
const p = S(
|
|
1818
|
+
(g, C) => C ? g === `${l.pathname}${l.search}` : g === l.pathname,
|
|
1795
1819
|
[l.pathname, l.search]
|
|
1796
|
-
),
|
|
1797
|
-
(g) => /* @__PURE__ */
|
|
1820
|
+
), f = S(
|
|
1821
|
+
(g) => /* @__PURE__ */ m(
|
|
1798
1822
|
"li",
|
|
1799
1823
|
{
|
|
1800
|
-
className: `drawer-list-item-child ${
|
|
1801
|
-
children: g.path ? /* @__PURE__ */
|
|
1824
|
+
className: `drawer-list-item-child ${p(g.path, !0) ? "active" : ""} animated`,
|
|
1825
|
+
children: g.path ? /* @__PURE__ */ m(
|
|
1802
1826
|
u,
|
|
1803
1827
|
{
|
|
1804
1828
|
tabIndex: s ? 0 : -1,
|
|
@@ -1813,14 +1837,14 @@ function Vs(r) {
|
|
|
1813
1837
|
},
|
|
1814
1838
|
g.id
|
|
1815
1839
|
),
|
|
1816
|
-
[u, s, e,
|
|
1817
|
-
), b =
|
|
1818
|
-
const
|
|
1840
|
+
[u, s, e, p]
|
|
1841
|
+
), b = B(() => d.map((g, C) => {
|
|
1842
|
+
const w = g.page ?? String(C), k = `drawer-list-item ${p(g.path) ? "active" : ""} animated`;
|
|
1819
1843
|
if (g.type === "divider")
|
|
1820
|
-
return /* @__PURE__ */
|
|
1821
|
-
const
|
|
1822
|
-
return /* @__PURE__ */
|
|
1823
|
-
/* @__PURE__ */
|
|
1844
|
+
return /* @__PURE__ */ m("li", { className: k, children: /* @__PURE__ */ m("hr", { className: "drawer-divider" }) }, w);
|
|
1845
|
+
const v = g.children ?? (g.page && c ? c[g.page] : null);
|
|
1846
|
+
return /* @__PURE__ */ E("li", { className: k, children: [
|
|
1847
|
+
/* @__PURE__ */ E(
|
|
1824
1848
|
u,
|
|
1825
1849
|
{
|
|
1826
1850
|
tabIndex: s ? 0 : -1,
|
|
@@ -1835,32 +1859,32 @@ function Vs(r) {
|
|
|
1835
1859
|
]
|
|
1836
1860
|
}
|
|
1837
1861
|
),
|
|
1838
|
-
|
|
1839
|
-
] },
|
|
1840
|
-
}), [u, c,
|
|
1841
|
-
return /* @__PURE__ */
|
|
1862
|
+
v && /* @__PURE__ */ m("ul", { className: "drawer-children-list", children: v.map(f) })
|
|
1863
|
+
] }, w);
|
|
1864
|
+
}), [u, c, p, s, d, f, e]);
|
|
1865
|
+
return /* @__PURE__ */ m(
|
|
1842
1866
|
"div",
|
|
1843
1867
|
{
|
|
1844
1868
|
"aria-label": e("_accessibility:ariaLabels.closeMenu"),
|
|
1845
1869
|
"aria-disabled": !s,
|
|
1846
1870
|
className: `${s ? "opened" : "closed"} drawer-backdrop`,
|
|
1847
1871
|
onClick: () => t(),
|
|
1848
|
-
children: /* @__PURE__ */
|
|
1849
|
-
/* @__PURE__ */
|
|
1872
|
+
children: /* @__PURE__ */ E("aside", { className: `${s ? "opened" : "closed"} drawer animated`, children: [
|
|
1873
|
+
/* @__PURE__ */ E("div", { className: "drawer-header-container", children: [
|
|
1850
1874
|
o,
|
|
1851
|
-
/* @__PURE__ */
|
|
1875
|
+
/* @__PURE__ */ m("h2", { className: "drawer-header poppins", children: e("_pages:home.appName") })
|
|
1852
1876
|
] }),
|
|
1853
|
-
/* @__PURE__ */
|
|
1877
|
+
/* @__PURE__ */ m("ul", { className: "drawer-menu-list", children: b })
|
|
1854
1878
|
] })
|
|
1855
1879
|
}
|
|
1856
1880
|
);
|
|
1857
1881
|
}
|
|
1858
|
-
const z = ({ icon:
|
|
1859
|
-
var
|
|
1860
|
-
function
|
|
1861
|
-
if (Ne) return
|
|
1882
|
+
const z = ({ icon: n, ...e }) => /* @__PURE__ */ m(it, { icon: /* @__PURE__ */ m(F, { icon: n }), ...e });
|
|
1883
|
+
var pe, Ne;
|
|
1884
|
+
function Xt() {
|
|
1885
|
+
if (Ne) return pe;
|
|
1862
1886
|
Ne = 1;
|
|
1863
|
-
const
|
|
1887
|
+
const n = (c, a = "local", l = void 0) => {
|
|
1864
1888
|
if (a === "local") {
|
|
1865
1889
|
if (localStorage.getItem(c) !== void 0 && localStorage.getItem(c) !== "undefined" && localStorage.getItem(c) !== null)
|
|
1866
1890
|
return l === void 0 || l !== void 0 && localStorage.getItem(c) === l;
|
|
@@ -1870,86 +1894,86 @@ function Jt() {
|
|
|
1870
1894
|
}, e = (c) => {
|
|
1871
1895
|
const a = {};
|
|
1872
1896
|
return c.substring(1).split("&").forEach((u) => {
|
|
1873
|
-
const [d,
|
|
1874
|
-
a[d] =
|
|
1897
|
+
const [d, h] = u.split("=");
|
|
1898
|
+
a[d] = h;
|
|
1875
1899
|
}), a;
|
|
1876
1900
|
}, s = (c = "") => {
|
|
1877
1901
|
if (o(c) && c.length) return o(c);
|
|
1878
1902
|
{
|
|
1879
1903
|
let a = navigator.language || navigator.userLanguage;
|
|
1880
1904
|
if (a.indexOf("en") < 0 && a.indexOf("es") < 0 && (a = "en-US"), a = a.split("-")[0], a)
|
|
1881
|
-
return c.length &&
|
|
1905
|
+
return c.length && r(c, 730, a), a;
|
|
1882
1906
|
}
|
|
1883
1907
|
return "en";
|
|
1884
1908
|
}, t = (c = 0, a = 0, l = window, u = "smooth") => l.scroll({
|
|
1885
1909
|
top: c,
|
|
1886
1910
|
left: a,
|
|
1887
1911
|
behavior: u
|
|
1888
|
-
}),
|
|
1889
|
-
var
|
|
1890
|
-
|
|
1891
|
-
const
|
|
1892
|
-
document.cookie = `${c}=${l || ""}${
|
|
1912
|
+
}), r = (c, a, l, u = "/", d = "Lax") => {
|
|
1913
|
+
var h = /* @__PURE__ */ new Date();
|
|
1914
|
+
h.setTime(h.getTime() + a * 24 * 60 * 60 * 1e3);
|
|
1915
|
+
const p = "; expires=" + h.toUTCString();
|
|
1916
|
+
document.cookie = `${c}=${l || ""}${p};path=${u};SameSite=${d}`;
|
|
1893
1917
|
}, o = (c) => {
|
|
1894
1918
|
const a = `${c}=`, u = decodeURIComponent(document.cookie).split(";");
|
|
1895
1919
|
for (let d = 0; d < u.length; d += 1) {
|
|
1896
|
-
let
|
|
1897
|
-
for (;
|
|
1898
|
-
|
|
1899
|
-
if (
|
|
1900
|
-
return
|
|
1920
|
+
let h = u[d];
|
|
1921
|
+
for (; h.charAt(0) === " "; )
|
|
1922
|
+
h = h.substring(1);
|
|
1923
|
+
if (h.indexOf(a) === 0)
|
|
1924
|
+
return h.substring(a.length, h.length);
|
|
1901
1925
|
}
|
|
1902
1926
|
return "";
|
|
1903
1927
|
};
|
|
1904
|
-
return
|
|
1928
|
+
return pe = {
|
|
1905
1929
|
getCookie: o,
|
|
1906
|
-
createCookie:
|
|
1930
|
+
createCookie: r,
|
|
1907
1931
|
deleteCookie: (c) => document.cookie = `${c}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`,
|
|
1908
1932
|
getUserLanguage: s,
|
|
1909
1933
|
scrollTo: t,
|
|
1910
1934
|
parseQueries: e,
|
|
1911
|
-
validation:
|
|
1912
|
-
},
|
|
1935
|
+
validation: n
|
|
1936
|
+
}, pe;
|
|
1913
1937
|
}
|
|
1914
|
-
var
|
|
1915
|
-
function
|
|
1916
|
-
const { t:
|
|
1938
|
+
var Zt = Xt();
|
|
1939
|
+
function Xs() {
|
|
1940
|
+
const { t: n, language: e } = N();
|
|
1917
1941
|
return { timeAge: S(
|
|
1918
1942
|
(t) => {
|
|
1919
|
-
const o = /* @__PURE__ */ new Date() - t, i = Math.floor(o / (1e3 * 60)), c = Math.floor(i / 60), a = e === "es", l =
|
|
1920
|
-
return o < 1e3 * 60 ? b : i < 60 ? `${a ? l : ""} ${i} ${i === 1 ? u : d} ${a ? "" : l}` : c < 24 ? `${a ? l : ""} ${c} ${c === 1 ?
|
|
1943
|
+
const o = /* @__PURE__ */ new Date() - t, i = Math.floor(o / (1e3 * 60)), c = Math.floor(i / 60), a = e === "es", l = n("_accessibility:labels.ago"), u = n("_accessibility:labels.minute"), d = n("_accessibility:labels.minutes"), h = n("_accessibility:labels.hour"), p = n("_accessibility:labels.hours"), f = n("_accessibility:labels.yesterday"), b = n("_accessibility:labels.justNow");
|
|
1944
|
+
return o < 1e3 * 60 ? b : i < 60 ? `${a ? l : ""} ${i} ${i === 1 ? u : d} ${a ? "" : l}` : c < 24 ? `${a ? l : ""} ${c} ${c === 1 ? h : p} ${a ? "" : l}` : c < 48 ? f : t.toLocaleDateString(navigator.language || "es-ES", {
|
|
1921
1945
|
day: "2-digit",
|
|
1922
1946
|
month: "2-digit",
|
|
1923
1947
|
year: "numeric"
|
|
1924
1948
|
});
|
|
1925
1949
|
},
|
|
1926
|
-
[
|
|
1950
|
+
[n, e]
|
|
1927
1951
|
) };
|
|
1928
1952
|
}
|
|
1929
|
-
const
|
|
1930
|
-
const { showSuccessNotification: e } = oe(), { mutationFn: s, onError: t, onSuccess:
|
|
1953
|
+
const Be = (n) => {
|
|
1954
|
+
const { showSuccessNotification: e } = oe(), { mutationFn: s, onError: t, onSuccess: r, onSuccessMessage: o } = n, [i, c] = R([]), { open: a, handleClose: l, handleOpen: u } = Ve(), d = () => {
|
|
1931
1955
|
l(), c([]);
|
|
1932
|
-
},
|
|
1933
|
-
c(
|
|
1934
|
-
},
|
|
1956
|
+
}, h = async (f) => {
|
|
1957
|
+
c(f), u();
|
|
1958
|
+
}, p = re({
|
|
1935
1959
|
mutationFn: () => s(
|
|
1936
1960
|
Array.isArray(i) ? i : [i]
|
|
1937
1961
|
),
|
|
1938
|
-
onError: (
|
|
1939
|
-
console.error(
|
|
1962
|
+
onError: (f) => {
|
|
1963
|
+
console.error(f), t && t(f), d();
|
|
1940
1964
|
},
|
|
1941
|
-
onSuccess: async (
|
|
1942
|
-
|
|
1965
|
+
onSuccess: async (f) => {
|
|
1966
|
+
r && r(f), e({
|
|
1943
1967
|
message: o
|
|
1944
1968
|
}), d();
|
|
1945
1969
|
}
|
|
1946
1970
|
});
|
|
1947
|
-
return { open: a, onClick:
|
|
1948
|
-
},
|
|
1949
|
-
const { t: e } =
|
|
1971
|
+
return { open: a, onClick: h, close: d, dialogFn: p, isLoading: p.isPending };
|
|
1972
|
+
}, Zs = (n) => {
|
|
1973
|
+
const { t: e } = N(), {
|
|
1950
1974
|
showStackNotifications: s,
|
|
1951
1975
|
showSuccessNotification: t,
|
|
1952
|
-
showErrorNotification:
|
|
1976
|
+
showErrorNotification: r
|
|
1953
1977
|
} = oe(), o = Z(), {
|
|
1954
1978
|
defaultValues: i,
|
|
1955
1979
|
mutationFn: c,
|
|
@@ -1957,42 +1981,42 @@ const He = (r) => {
|
|
|
1957
1981
|
onError: l,
|
|
1958
1982
|
onSuccess: u,
|
|
1959
1983
|
queryKey: d,
|
|
1960
|
-
onSuccessMessage:
|
|
1961
|
-
} =
|
|
1984
|
+
onSuccessMessage: h
|
|
1985
|
+
} = n, { control: p, handleSubmit: f, reset: b, setError: y, getValues: g, setValue: C } = Me({
|
|
1962
1986
|
defaultValues: i
|
|
1963
|
-
}), w =
|
|
1964
|
-
const
|
|
1965
|
-
if (!(
|
|
1987
|
+
}), w = U(null), k = S(() => {
|
|
1988
|
+
const T = document.activeElement;
|
|
1989
|
+
if (!(T instanceof HTMLElement)) {
|
|
1966
1990
|
w.current = null;
|
|
1967
1991
|
return;
|
|
1968
1992
|
}
|
|
1969
|
-
w.current =
|
|
1970
|
-
}, []),
|
|
1971
|
-
(
|
|
1972
|
-
const D =
|
|
1993
|
+
w.current = T.closest("form");
|
|
1994
|
+
}, []), v = S(
|
|
1995
|
+
(T) => {
|
|
1996
|
+
const D = T == null ? void 0 : T.errors, L = [], _ = w.current;
|
|
1973
1997
|
if (!_) return L;
|
|
1974
|
-
let
|
|
1998
|
+
let j = !1;
|
|
1975
1999
|
return D && D.forEach(([le, ee]) => {
|
|
1976
|
-
const
|
|
1977
|
-
(
|
|
2000
|
+
const Q = _.querySelector(`[name="${le}"]`);
|
|
2001
|
+
(Q instanceof HTMLInputElement || Q instanceof HTMLTextAreaElement || Q instanceof HTMLSelectElement) && (j || (Q.focus(), j = !0), Q.classList.add("error"), L.push(e(`_entities:${d}.${le}.${ee}`)));
|
|
1978
2002
|
}), L;
|
|
1979
2003
|
},
|
|
1980
2004
|
[e, d]
|
|
1981
|
-
),
|
|
1982
|
-
const
|
|
1983
|
-
if (!
|
|
1984
|
-
|
|
2005
|
+
), K = S(() => {
|
|
2006
|
+
const T = w.current;
|
|
2007
|
+
if (!T) return;
|
|
2008
|
+
T.querySelectorAll("input, textarea, select").forEach((L) => {
|
|
1985
2009
|
L.classList.remove("error");
|
|
1986
2010
|
});
|
|
1987
|
-
}, []),
|
|
2011
|
+
}, []), V = re(
|
|
1988
2012
|
{
|
|
1989
2013
|
mutationFn: c,
|
|
1990
|
-
onError: (
|
|
1991
|
-
console.error(
|
|
1992
|
-
const D =
|
|
1993
|
-
if (l) l(
|
|
1994
|
-
else if (
|
|
1995
|
-
const L =
|
|
2014
|
+
onError: (T) => {
|
|
2015
|
+
console.error(T);
|
|
2016
|
+
const D = T;
|
|
2017
|
+
if (l) l(T);
|
|
2018
|
+
else if (Se(D)) {
|
|
2019
|
+
const L = v(D);
|
|
1996
2020
|
s(
|
|
1997
2021
|
L.map(
|
|
1998
2022
|
(_) => ({
|
|
@@ -2001,71 +2025,71 @@ const He = (r) => {
|
|
|
2001
2025
|
})
|
|
2002
2026
|
)
|
|
2003
2027
|
);
|
|
2004
|
-
} else if (
|
|
2028
|
+
} else if (Ce(D)) {
|
|
2005
2029
|
const L = D.message || e("_accessibility:errors.500"), _ = e(`_accessibility:errors.${D.status}`);
|
|
2006
|
-
|
|
2030
|
+
r({ message: _ || L });
|
|
2007
2031
|
} else
|
|
2008
|
-
|
|
2032
|
+
r({ message: e("_accessibility:errors.500") });
|
|
2009
2033
|
},
|
|
2010
|
-
onSuccess: async (
|
|
2011
|
-
await o.invalidateQueries({ queryKey: d }), u && u(
|
|
2012
|
-
message:
|
|
2034
|
+
onSuccess: async (T) => {
|
|
2035
|
+
await o.invalidateQueries({ queryKey: d }), u && u(T), h && t({
|
|
2036
|
+
message: h
|
|
2013
2037
|
});
|
|
2014
2038
|
}
|
|
2015
2039
|
}
|
|
2016
2040
|
);
|
|
2017
2041
|
return {
|
|
2018
|
-
control:
|
|
2019
|
-
getValues:
|
|
2020
|
-
setValue:
|
|
2021
|
-
handleSubmit:
|
|
2022
|
-
onSubmit: (
|
|
2023
|
-
|
|
2024
|
-
a ? a(
|
|
2042
|
+
control: p,
|
|
2043
|
+
getValues: g,
|
|
2044
|
+
setValue: C,
|
|
2045
|
+
handleSubmit: f,
|
|
2046
|
+
onSubmit: (T) => {
|
|
2047
|
+
k(), K(), V.mutate(
|
|
2048
|
+
a ? a(T) : T
|
|
2025
2049
|
);
|
|
2026
2050
|
},
|
|
2027
2051
|
reset: b,
|
|
2028
|
-
setError:
|
|
2029
|
-
isLoading:
|
|
2052
|
+
setError: y,
|
|
2053
|
+
isLoading: V.isPending
|
|
2030
2054
|
};
|
|
2031
|
-
},
|
|
2032
|
-
const { t: e } =
|
|
2055
|
+
}, es = (n) => {
|
|
2056
|
+
const { t: e } = N(), {
|
|
2033
2057
|
onClick: s,
|
|
2034
|
-
icon: t =
|
|
2035
|
-
sticky:
|
|
2058
|
+
icon: t = pt,
|
|
2059
|
+
sticky: r = !0,
|
|
2036
2060
|
hidden: o = !1,
|
|
2037
2061
|
multiple: i = !0,
|
|
2038
2062
|
disabled: c = !1,
|
|
2039
2063
|
id: a = J.Delete,
|
|
2040
2064
|
tooltip: l = e("_pages:common.actions.delete.text")
|
|
2041
|
-
} =
|
|
2065
|
+
} = n;
|
|
2042
2066
|
return {
|
|
2043
2067
|
action: S(
|
|
2044
2068
|
(d) => ({
|
|
2045
2069
|
id: a,
|
|
2046
|
-
sticky:
|
|
2070
|
+
sticky: r,
|
|
2047
2071
|
tooltip: l,
|
|
2048
2072
|
multiple: i,
|
|
2049
2073
|
onClick: () => s([d == null ? void 0 : d.id]),
|
|
2050
2074
|
hidden: !!d.deletedAt || o,
|
|
2051
2075
|
disabled: !!d.deletedAt || c,
|
|
2052
|
-
icon: /* @__PURE__ */
|
|
2053
|
-
onMultipleClick: (
|
|
2076
|
+
icon: /* @__PURE__ */ m(F, { className: "text-bg-error", icon: t }),
|
|
2077
|
+
onMultipleClick: (h) => s(h.map((p) => p.id))
|
|
2054
2078
|
}),
|
|
2055
|
-
[c, o, t, a, i, s,
|
|
2079
|
+
[c, o, t, a, i, s, r, l]
|
|
2056
2080
|
)
|
|
2057
2081
|
};
|
|
2058
|
-
},
|
|
2059
|
-
const { t: e } =
|
|
2082
|
+
}, ts = (n) => {
|
|
2083
|
+
const { t: e } = N(), {
|
|
2060
2084
|
onClick: s,
|
|
2061
2085
|
sticky: t = !0,
|
|
2062
|
-
hidden:
|
|
2086
|
+
hidden: r = !1,
|
|
2063
2087
|
disabled: o = !1,
|
|
2064
2088
|
multiple: i = !1,
|
|
2065
|
-
icon: c =
|
|
2089
|
+
icon: c = Re,
|
|
2066
2090
|
id: a = J.Restore,
|
|
2067
2091
|
tooltip: l = e("_pages:common.actions.restore.text")
|
|
2068
|
-
} =
|
|
2092
|
+
} = n;
|
|
2069
2093
|
return {
|
|
2070
2094
|
action: S(
|
|
2071
2095
|
(d) => ({
|
|
@@ -2074,121 +2098,121 @@ const He = (r) => {
|
|
|
2074
2098
|
tooltip: l,
|
|
2075
2099
|
multiple: i,
|
|
2076
2100
|
onClick: () => s([d == null ? void 0 : d.id]),
|
|
2077
|
-
hidden: !d.deletedAt ||
|
|
2101
|
+
hidden: !d.deletedAt || r,
|
|
2078
2102
|
disabled: !d.deletedAt || o,
|
|
2079
|
-
icon: /* @__PURE__ */
|
|
2080
|
-
onMultipleClick: (
|
|
2103
|
+
icon: /* @__PURE__ */ m(F, { className: "text-bg-error", icon: c }),
|
|
2104
|
+
onMultipleClick: (h) => s(h.map((p) => p.id))
|
|
2081
2105
|
}),
|
|
2082
|
-
[o,
|
|
2106
|
+
[o, r, c, a, i, s, t, l]
|
|
2083
2107
|
)
|
|
2084
2108
|
};
|
|
2085
|
-
},
|
|
2086
|
-
const { t: e } =
|
|
2109
|
+
}, en = (n) => {
|
|
2110
|
+
const { t: e } = N(), {
|
|
2087
2111
|
onClick: s,
|
|
2088
2112
|
hidden: t = !1,
|
|
2089
|
-
sticky:
|
|
2113
|
+
sticky: r = !0,
|
|
2090
2114
|
disabled: o = !1,
|
|
2091
2115
|
id: i = J.Edit,
|
|
2092
|
-
icon: c =
|
|
2116
|
+
icon: c = gt,
|
|
2093
2117
|
tooltip: a = e("_pages:common.actions.edit.text")
|
|
2094
|
-
} =
|
|
2118
|
+
} = n;
|
|
2095
2119
|
return {
|
|
2096
2120
|
action: S(
|
|
2097
2121
|
(u) => ({
|
|
2098
2122
|
id: i,
|
|
2099
|
-
sticky:
|
|
2123
|
+
sticky: r,
|
|
2100
2124
|
tooltip: a,
|
|
2101
2125
|
onClick: () => s(u == null ? void 0 : u.id),
|
|
2102
2126
|
hidden: !!u.deletedAt || t,
|
|
2103
2127
|
disabled: !!u.deletedAt || o,
|
|
2104
|
-
icon: /* @__PURE__ */
|
|
2128
|
+
icon: /* @__PURE__ */ m(F, { className: "primary", icon: c })
|
|
2105
2129
|
}),
|
|
2106
|
-
[o, t, c, i, s,
|
|
2130
|
+
[o, t, c, i, s, r, a]
|
|
2107
2131
|
)
|
|
2108
2132
|
};
|
|
2109
2133
|
};
|
|
2110
|
-
var J = /* @__PURE__ */ ((
|
|
2111
|
-
const
|
|
2112
|
-
const { t: e } =
|
|
2134
|
+
var J = /* @__PURE__ */ ((n) => (n.Add = "add", n.Edit = "edit", n.Delete = "delete", n.Restore = "restore", n.Refresh = "refresh", n.Export = "export", n.Import = "import", n))(J || {});
|
|
2135
|
+
const ss = (n) => {
|
|
2136
|
+
const { t: e } = N(), {
|
|
2113
2137
|
onClick: s,
|
|
2114
2138
|
hidden: t = !1,
|
|
2115
|
-
disabled:
|
|
2139
|
+
disabled: r = !1,
|
|
2116
2140
|
isLoading: o = !1
|
|
2117
|
-
} =
|
|
2141
|
+
} = n;
|
|
2118
2142
|
return {
|
|
2119
2143
|
action: S(
|
|
2120
2144
|
() => ({
|
|
2121
2145
|
id: J.Export,
|
|
2122
2146
|
hidden: t,
|
|
2123
|
-
disabled:
|
|
2124
|
-
icon: /* @__PURE__ */
|
|
2125
|
-
|
|
2147
|
+
disabled: r,
|
|
2148
|
+
icon: /* @__PURE__ */ m(
|
|
2149
|
+
F,
|
|
2126
2150
|
{
|
|
2127
2151
|
className: `${o ? "rotate" : ""}`,
|
|
2128
|
-
icon: o ?
|
|
2152
|
+
icon: o ? Ie : bt
|
|
2129
2153
|
}
|
|
2130
2154
|
),
|
|
2131
2155
|
tooltip: e("_pages:common.actions.export.text"),
|
|
2132
2156
|
onClick: s
|
|
2133
2157
|
}),
|
|
2134
|
-
[
|
|
2158
|
+
[r, t, o, s, e]
|
|
2135
2159
|
)
|
|
2136
2160
|
};
|
|
2137
|
-
},
|
|
2138
|
-
const { t: e } =
|
|
2161
|
+
}, ns = (n) => {
|
|
2162
|
+
const { t: e } = N(), {
|
|
2139
2163
|
onClick: s,
|
|
2140
2164
|
hidden: t = !1,
|
|
2141
|
-
disabled:
|
|
2165
|
+
disabled: r = !1,
|
|
2142
2166
|
isLoading: o = !1
|
|
2143
|
-
} =
|
|
2167
|
+
} = n;
|
|
2144
2168
|
return {
|
|
2145
2169
|
action: S(
|
|
2146
2170
|
() => ({
|
|
2147
2171
|
id: J.Import,
|
|
2148
2172
|
hidden: t,
|
|
2149
|
-
disabled:
|
|
2150
|
-
icon: /* @__PURE__ */
|
|
2151
|
-
|
|
2173
|
+
disabled: r,
|
|
2174
|
+
icon: /* @__PURE__ */ m(
|
|
2175
|
+
F,
|
|
2152
2176
|
{
|
|
2153
2177
|
className: `${o ? "rotate" : ""}`,
|
|
2154
|
-
icon: o ?
|
|
2178
|
+
icon: o ? Ie : yt
|
|
2155
2179
|
}
|
|
2156
2180
|
),
|
|
2157
2181
|
tooltip: e("_pages:common.actions.import.text"),
|
|
2158
2182
|
onClick: s
|
|
2159
2183
|
}),
|
|
2160
|
-
[
|
|
2184
|
+
[r, t, o, s, e]
|
|
2161
2185
|
)
|
|
2162
2186
|
};
|
|
2163
|
-
},
|
|
2164
|
-
const { queryKey: e, onSuccess: s, ...t } =
|
|
2187
|
+
}, tn = (n) => {
|
|
2188
|
+
const { queryKey: e, onSuccess: s, ...t } = n, r = Z(), { showStackNotifications: o } = oe(), { t: i } = N(), { open: c, onClick: a, close: l, dialogFn: u, isLoading: d } = Be({
|
|
2165
2189
|
onSuccessMessage: i("_pages:common.actions.delete.successMessage"),
|
|
2166
|
-
onError: (
|
|
2167
|
-
const
|
|
2168
|
-
if (
|
|
2190
|
+
onError: (p) => {
|
|
2191
|
+
const f = p;
|
|
2192
|
+
if (Se(f))
|
|
2169
2193
|
o(
|
|
2170
|
-
|
|
2171
|
-
([b,
|
|
2172
|
-
message: i(`_pages:${b}.errors.${
|
|
2194
|
+
f.errors.map(
|
|
2195
|
+
([b, y]) => ({
|
|
2196
|
+
message: i(`_pages:${b}.errors.${y}`),
|
|
2173
2197
|
type: O.error
|
|
2174
2198
|
})
|
|
2175
2199
|
)
|
|
2176
2200
|
);
|
|
2177
|
-
else if (
|
|
2178
|
-
const b =
|
|
2201
|
+
else if (Ce(f)) {
|
|
2202
|
+
const b = f.message || i("_accessibility:errors.500"), y = i(`_accessibility:errors.${f.status}`);
|
|
2179
2203
|
o([
|
|
2180
2204
|
{
|
|
2181
|
-
message:
|
|
2205
|
+
message: y || b,
|
|
2182
2206
|
type: O.error
|
|
2183
2207
|
}
|
|
2184
2208
|
]);
|
|
2185
2209
|
}
|
|
2186
2210
|
},
|
|
2187
|
-
onSuccess: async (
|
|
2188
|
-
await
|
|
2211
|
+
onSuccess: async (p) => {
|
|
2212
|
+
await r.invalidateQueries({ queryKey: e }), s && s(p);
|
|
2189
2213
|
},
|
|
2190
2214
|
...t
|
|
2191
|
-
}), { action:
|
|
2215
|
+
}), { action: h } = es({ onClick: a });
|
|
2192
2216
|
return {
|
|
2193
2217
|
onClick: a,
|
|
2194
2218
|
title: i("_pages:common.actions.delete.dialog.title"),
|
|
@@ -2196,17 +2220,17 @@ const es = (r) => {
|
|
|
2196
2220
|
isLoading: d,
|
|
2197
2221
|
handleSubmit: () => u.mutate(),
|
|
2198
2222
|
handleClose: l,
|
|
2199
|
-
action:
|
|
2223
|
+
action: h
|
|
2200
2224
|
};
|
|
2201
|
-
},
|
|
2202
|
-
const [
|
|
2203
|
-
return { open:
|
|
2204
|
-
},
|
|
2225
|
+
}, Ve = () => {
|
|
2226
|
+
const [n, e] = R(!1);
|
|
2227
|
+
return { open: n, setOpen: e, handleClose: () => e(!1), handleOpen: () => e(!0) };
|
|
2228
|
+
}, We = (n) => {
|
|
2205
2229
|
const {
|
|
2206
2230
|
closeOnSubmit: e = !0,
|
|
2207
2231
|
defaultValues: s,
|
|
2208
2232
|
dtoToForm: t,
|
|
2209
|
-
formToDto:
|
|
2233
|
+
formToDto: r,
|
|
2210
2234
|
mode: o = "state",
|
|
2211
2235
|
onApply: i,
|
|
2212
2236
|
onClear: c,
|
|
@@ -2214,149 +2238,149 @@ const es = (r) => {
|
|
|
2214
2238
|
onSubmit: l,
|
|
2215
2239
|
reinitializeOnOpen: u,
|
|
2216
2240
|
resetOnOpen: d,
|
|
2217
|
-
title:
|
|
2218
|
-
} =
|
|
2241
|
+
title: h
|
|
2242
|
+
} = n, [p, f] = R(), [b, y] = R(!1), g = U(!1), C = U(null), { open: w, handleClose: k, handleOpen: v } = Ve(), { control: K, handleSubmit: V, reset: T, setError: D, getValues: L, setValue: _ } = Me({
|
|
2219
2243
|
defaultValues: s || {}
|
|
2220
2244
|
});
|
|
2221
2245
|
M(() => {
|
|
2222
2246
|
if (!w) {
|
|
2223
|
-
|
|
2247
|
+
g.current = !1, C.current = null;
|
|
2224
2248
|
return;
|
|
2225
2249
|
}
|
|
2226
|
-
if (
|
|
2227
|
-
if (
|
|
2228
|
-
C
|
|
2250
|
+
if (g.current) return;
|
|
2251
|
+
if (g.current = !0, C.current) {
|
|
2252
|
+
T(C.current), C.current = null;
|
|
2229
2253
|
return;
|
|
2230
2254
|
}
|
|
2231
|
-
const
|
|
2232
|
-
if (u &&
|
|
2233
|
-
|
|
2255
|
+
const $ = t;
|
|
2256
|
+
if (u && $) {
|
|
2257
|
+
T($(s || {}));
|
|
2234
2258
|
return;
|
|
2235
2259
|
}
|
|
2236
2260
|
if (u && s) {
|
|
2237
|
-
|
|
2261
|
+
T(s);
|
|
2238
2262
|
return;
|
|
2239
2263
|
}
|
|
2240
|
-
d &&
|
|
2241
|
-
}, [s, t, w, u,
|
|
2242
|
-
const
|
|
2243
|
-
|
|
2244
|
-
}, [
|
|
2245
|
-
(
|
|
2246
|
-
let
|
|
2247
|
-
typeof
|
|
2264
|
+
d && T(s || {});
|
|
2265
|
+
}, [s, t, w, u, T, d]);
|
|
2266
|
+
const j = S(() => {
|
|
2267
|
+
k(), T();
|
|
2268
|
+
}, [k, T]), le = S(
|
|
2269
|
+
($) => {
|
|
2270
|
+
let x, te;
|
|
2271
|
+
typeof $ == "number" || $ == null ? x = $ : (x = $.id, te = $.values), f(x), te ? w ? T(te) : C.current = te : C.current = null, w || v();
|
|
2248
2272
|
},
|
|
2249
|
-
[
|
|
2273
|
+
[v, w, T]
|
|
2250
2274
|
), ee = S(
|
|
2251
|
-
(
|
|
2252
|
-
const
|
|
2253
|
-
return
|
|
2275
|
+
($) => {
|
|
2276
|
+
const x = r;
|
|
2277
|
+
return x ? x($, { id: p }) : $;
|
|
2254
2278
|
},
|
|
2255
|
-
[
|
|
2256
|
-
),
|
|
2257
|
-
async (x,
|
|
2258
|
-
a && await a(
|
|
2259
|
-
close:
|
|
2260
|
-
id:
|
|
2261
|
-
phase:
|
|
2279
|
+
[r, p]
|
|
2280
|
+
), Q = S(
|
|
2281
|
+
async ($, x, te) => {
|
|
2282
|
+
a && await a($, {
|
|
2283
|
+
close: j,
|
|
2284
|
+
id: p,
|
|
2285
|
+
phase: x,
|
|
2262
2286
|
values: te
|
|
2263
2287
|
});
|
|
2264
2288
|
},
|
|
2265
|
-
[
|
|
2266
|
-
),
|
|
2289
|
+
[j, p, a]
|
|
2290
|
+
), Ge = S(async () => {
|
|
2267
2291
|
if (!i) return;
|
|
2268
|
-
const
|
|
2269
|
-
|
|
2292
|
+
const $ = L();
|
|
2293
|
+
y(!0);
|
|
2270
2294
|
try {
|
|
2271
|
-
const
|
|
2272
|
-
await i(
|
|
2273
|
-
close:
|
|
2274
|
-
id:
|
|
2275
|
-
values:
|
|
2295
|
+
const x = ee($);
|
|
2296
|
+
await i(x, {
|
|
2297
|
+
close: j,
|
|
2298
|
+
id: p,
|
|
2299
|
+
values: $
|
|
2276
2300
|
});
|
|
2277
|
-
} catch (
|
|
2278
|
-
throw await
|
|
2279
|
-
}),
|
|
2301
|
+
} catch (x) {
|
|
2302
|
+
throw await Q(x, "apply", $).catch(() => {
|
|
2303
|
+
}), x;
|
|
2280
2304
|
} finally {
|
|
2281
|
-
|
|
2305
|
+
y(!1);
|
|
2282
2306
|
}
|
|
2283
|
-
}, [
|
|
2284
|
-
const
|
|
2307
|
+
}, [j, L, Q, p, ee, i]), Je = S(async () => {
|
|
2308
|
+
const $ = L();
|
|
2285
2309
|
if (c) {
|
|
2286
|
-
|
|
2310
|
+
y(!0);
|
|
2287
2311
|
try {
|
|
2288
2312
|
await c();
|
|
2289
|
-
} catch (
|
|
2290
|
-
throw await
|
|
2291
|
-
}),
|
|
2313
|
+
} catch (x) {
|
|
2314
|
+
throw await Q(x, "clear", $).catch(() => {
|
|
2315
|
+
}), x;
|
|
2292
2316
|
} finally {
|
|
2293
|
-
|
|
2317
|
+
y(!1);
|
|
2294
2318
|
}
|
|
2295
2319
|
}
|
|
2296
2320
|
try {
|
|
2297
|
-
|
|
2298
|
-
} catch (
|
|
2299
|
-
throw await
|
|
2300
|
-
}),
|
|
2321
|
+
T(s || {});
|
|
2322
|
+
} catch (x) {
|
|
2323
|
+
throw await Q(x, "clear", $).catch(() => {
|
|
2324
|
+
}), x;
|
|
2301
2325
|
}
|
|
2302
|
-
}, [s, L,
|
|
2303
|
-
async (
|
|
2304
|
-
|
|
2326
|
+
}, [s, L, Q, c, T]), Ye = S(
|
|
2327
|
+
async ($) => {
|
|
2328
|
+
y(!0);
|
|
2305
2329
|
try {
|
|
2306
|
-
const
|
|
2307
|
-
l && await l(
|
|
2308
|
-
close:
|
|
2309
|
-
id:
|
|
2310
|
-
values:
|
|
2311
|
-
}), e &&
|
|
2312
|
-
} catch (
|
|
2313
|
-
throw await
|
|
2314
|
-
}),
|
|
2330
|
+
const x = ee($);
|
|
2331
|
+
l && await l(x, {
|
|
2332
|
+
close: j,
|
|
2333
|
+
id: p,
|
|
2334
|
+
values: $
|
|
2335
|
+
}), e && j();
|
|
2336
|
+
} catch (x) {
|
|
2337
|
+
throw await Q(x, "submit", $).catch(() => {
|
|
2338
|
+
}), x;
|
|
2315
2339
|
} finally {
|
|
2316
|
-
|
|
2340
|
+
y(!1);
|
|
2317
2341
|
}
|
|
2318
2342
|
},
|
|
2319
|
-
[
|
|
2343
|
+
[j, e, Q, p, ee, l]
|
|
2320
2344
|
);
|
|
2321
2345
|
return {
|
|
2322
2346
|
open: w,
|
|
2323
2347
|
mode: o,
|
|
2324
|
-
id:
|
|
2348
|
+
id: p,
|
|
2325
2349
|
openDialog: le,
|
|
2326
|
-
handleClose:
|
|
2327
|
-
control:
|
|
2350
|
+
handleClose: j,
|
|
2351
|
+
control: K,
|
|
2328
2352
|
getValues: L,
|
|
2329
2353
|
setValue: _,
|
|
2330
|
-
handleSubmit:
|
|
2331
|
-
onSubmit:
|
|
2332
|
-
reset:
|
|
2354
|
+
handleSubmit: V,
|
|
2355
|
+
onSubmit: Ye,
|
|
2356
|
+
reset: T,
|
|
2333
2357
|
setError: D,
|
|
2334
|
-
title:
|
|
2358
|
+
title: h,
|
|
2335
2359
|
isSubmitting: b,
|
|
2336
|
-
onApply:
|
|
2337
|
-
onClear:
|
|
2360
|
+
onApply: Ge,
|
|
2361
|
+
onClear: Je,
|
|
2338
2362
|
isLoading: b
|
|
2339
2363
|
};
|
|
2340
|
-
},
|
|
2341
|
-
const e = Z(), { mutationFn: s, queryKey: t, onSuccess:
|
|
2364
|
+
}, sn = (n) => {
|
|
2365
|
+
const e = Z(), { mutationFn: s, queryKey: t, onSuccess: r, onError: o, formToDto: i, ...c } = n, a = re({
|
|
2342
2366
|
mutationFn: s
|
|
2343
2367
|
});
|
|
2344
|
-
return
|
|
2368
|
+
return We({
|
|
2345
2369
|
...c,
|
|
2346
2370
|
mode: "entity",
|
|
2347
2371
|
formToDto: i,
|
|
2348
2372
|
onSubmit: async (l) => {
|
|
2349
2373
|
try {
|
|
2350
2374
|
const u = await a.mutateAsync(l);
|
|
2351
|
-
t && await e.invalidateQueries({ queryKey: t }),
|
|
2375
|
+
t && await e.invalidateQueries({ queryKey: t }), r && await r(u);
|
|
2352
2376
|
} catch (u) {
|
|
2353
2377
|
throw o && o(u), u;
|
|
2354
2378
|
}
|
|
2355
2379
|
}
|
|
2356
2380
|
});
|
|
2357
|
-
},
|
|
2358
|
-
const e = Z(), s =
|
|
2359
|
-
mutationFn:
|
|
2381
|
+
}, nn = (n) => {
|
|
2382
|
+
const e = Z(), s = U(), t = U(), {
|
|
2383
|
+
mutationFn: r,
|
|
2360
2384
|
queryKey: o,
|
|
2361
2385
|
onSuccess: i,
|
|
2362
2386
|
onError: c,
|
|
@@ -2364,75 +2388,75 @@ const es = (r) => {
|
|
|
2364
2388
|
getFunction: l,
|
|
2365
2389
|
dtoToForm: u,
|
|
2366
2390
|
title: d,
|
|
2367
|
-
...
|
|
2368
|
-
} =
|
|
2391
|
+
...h
|
|
2392
|
+
} = n, p = U(u);
|
|
2369
2393
|
M(() => {
|
|
2370
|
-
|
|
2394
|
+
p.current = u;
|
|
2371
2395
|
}, [u]);
|
|
2372
|
-
const
|
|
2373
|
-
mutationFn:
|
|
2374
|
-
}), b =
|
|
2375
|
-
...
|
|
2396
|
+
const f = re({
|
|
2397
|
+
mutationFn: r
|
|
2398
|
+
}), b = We({
|
|
2399
|
+
...h,
|
|
2376
2400
|
mode: "entity",
|
|
2377
2401
|
title: d,
|
|
2378
2402
|
onSubmit: async (w) => {
|
|
2379
2403
|
try {
|
|
2380
|
-
const
|
|
2381
|
-
o && await e.invalidateQueries({ queryKey: o }), i && await i(
|
|
2382
|
-
} catch (
|
|
2383
|
-
throw c && c(
|
|
2404
|
+
const k = await f.mutateAsync(w);
|
|
2405
|
+
o && await e.invalidateQueries({ queryKey: o }), i && await i(k);
|
|
2406
|
+
} catch (k) {
|
|
2407
|
+
throw c && c(k), k;
|
|
2384
2408
|
}
|
|
2385
2409
|
},
|
|
2386
2410
|
formToDto: (w) => {
|
|
2387
|
-
const
|
|
2388
|
-
return
|
|
2411
|
+
const k = a;
|
|
2412
|
+
return k ? k(w, s.current) : w;
|
|
2389
2413
|
}
|
|
2390
|
-
}), { reset:
|
|
2414
|
+
}), { reset: y } = b, C = $t({
|
|
2391
2415
|
queryFn: () => l(b.id),
|
|
2392
2416
|
queryKey: [...o || ["put-dialog", d], b.id],
|
|
2393
2417
|
enabled: b.open && !!b.id
|
|
2394
2418
|
});
|
|
2395
2419
|
return M(() => {
|
|
2396
|
-
if (
|
|
2397
|
-
if (s.current =
|
|
2398
|
-
|
|
2420
|
+
if (C.data && t.current !== C.data) {
|
|
2421
|
+
if (s.current = C.data, t.current = C.data, p.current && y) {
|
|
2422
|
+
y(p.current(C.data));
|
|
2399
2423
|
return;
|
|
2400
2424
|
}
|
|
2401
|
-
|
|
2425
|
+
y == null || y(C.data);
|
|
2402
2426
|
}
|
|
2403
|
-
}, [
|
|
2427
|
+
}, [C.data, y]), {
|
|
2404
2428
|
...b,
|
|
2405
|
-
isLoading: b.isLoading ||
|
|
2429
|
+
isLoading: b.isLoading || f.isPending || C.isFetching || C.isLoading
|
|
2406
2430
|
};
|
|
2407
|
-
},
|
|
2408
|
-
const { queryKey: e, onSuccess: s, ...t } =
|
|
2431
|
+
}, rn = (n) => {
|
|
2432
|
+
const { queryKey: e, onSuccess: s, ...t } = n, r = Z(), { showStackNotifications: o } = oe(), { t: i } = N(), { open: c, onClick: a, close: l, dialogFn: u, isLoading: d } = Be({
|
|
2409
2433
|
onSuccessMessage: i("_pages:common.actions.restore.successMessage"),
|
|
2410
|
-
onError: (
|
|
2411
|
-
const
|
|
2412
|
-
if (
|
|
2434
|
+
onError: (p) => {
|
|
2435
|
+
const f = p;
|
|
2436
|
+
if (Se(f))
|
|
2413
2437
|
o(
|
|
2414
|
-
|
|
2415
|
-
([b,
|
|
2416
|
-
message: i(`_pages:${b}.errors.${
|
|
2438
|
+
f.errors.map(
|
|
2439
|
+
([b, y]) => ({
|
|
2440
|
+
message: i(`_pages:${b}.errors.${y}`),
|
|
2417
2441
|
type: O.error
|
|
2418
2442
|
})
|
|
2419
2443
|
)
|
|
2420
2444
|
);
|
|
2421
|
-
else if (
|
|
2422
|
-
const b =
|
|
2445
|
+
else if (Ce(f)) {
|
|
2446
|
+
const b = f.message || i("_accessibility:errors.500"), y = i(`_accessibility:errors.${f.status}`);
|
|
2423
2447
|
o([
|
|
2424
2448
|
{
|
|
2425
|
-
message:
|
|
2449
|
+
message: y || b,
|
|
2426
2450
|
type: O.error
|
|
2427
2451
|
}
|
|
2428
2452
|
]);
|
|
2429
2453
|
}
|
|
2430
2454
|
},
|
|
2431
|
-
onSuccess: async (
|
|
2432
|
-
await
|
|
2455
|
+
onSuccess: async (p) => {
|
|
2456
|
+
await r.invalidateQueries({ queryKey: e }), s && s(p);
|
|
2433
2457
|
},
|
|
2434
2458
|
...t
|
|
2435
|
-
}), { action:
|
|
2459
|
+
}), { action: h } = ts({ onClick: a });
|
|
2436
2460
|
return {
|
|
2437
2461
|
onClick: a,
|
|
2438
2462
|
title: i("_pages:common.actions.restore.dialog.title"),
|
|
@@ -2440,26 +2464,26 @@ const es = (r) => {
|
|
|
2440
2464
|
isLoading: d,
|
|
2441
2465
|
handleSubmit: () => u.mutate(),
|
|
2442
2466
|
handleClose: l,
|
|
2443
|
-
action:
|
|
2467
|
+
action: h
|
|
2444
2468
|
};
|
|
2445
2469
|
};
|
|
2446
|
-
function
|
|
2447
|
-
const { t: e } =
|
|
2470
|
+
function on(n) {
|
|
2471
|
+
const { t: e } = N(), s = Z(), {
|
|
2448
2472
|
queryKey: t,
|
|
2449
|
-
mutationFn:
|
|
2473
|
+
mutationFn: r,
|
|
2450
2474
|
entity: o,
|
|
2451
2475
|
fileProcessor: i,
|
|
2452
2476
|
renderCustomPreview: c,
|
|
2453
2477
|
onError: a
|
|
2454
|
-
} =
|
|
2455
|
-
mutationFn:
|
|
2456
|
-
onError: (
|
|
2457
|
-
console.error(
|
|
2478
|
+
} = n, [l, u] = R(!1), [d, h] = R(null), [p, f] = R(!1), b = re({
|
|
2479
|
+
mutationFn: r,
|
|
2480
|
+
onError: (g) => {
|
|
2481
|
+
console.error(g), a == null || a(g);
|
|
2458
2482
|
},
|
|
2459
2483
|
onSuccess: async () => {
|
|
2460
2484
|
await s.invalidateQueries({ queryKey: t });
|
|
2461
2485
|
}
|
|
2462
|
-
}), { action:
|
|
2486
|
+
}), { action: y } = ns({
|
|
2463
2487
|
onClick: () => u(!0)
|
|
2464
2488
|
});
|
|
2465
2489
|
return {
|
|
@@ -2468,48 +2492,48 @@ function er(r) {
|
|
|
2468
2492
|
try {
|
|
2469
2493
|
await b.mutateAsync({
|
|
2470
2494
|
items: d,
|
|
2471
|
-
override:
|
|
2472
|
-
}), u(!1),
|
|
2473
|
-
} catch (
|
|
2474
|
-
console.error(
|
|
2495
|
+
override: p
|
|
2496
|
+
}), u(!1), h(null), f(!1);
|
|
2497
|
+
} catch (g) {
|
|
2498
|
+
console.error(g);
|
|
2475
2499
|
}
|
|
2476
2500
|
},
|
|
2477
2501
|
isLoading: b.isPending,
|
|
2478
2502
|
fileProcessor: i,
|
|
2479
|
-
onFileProcessed: (
|
|
2503
|
+
onFileProcessed: (g) => h(g),
|
|
2480
2504
|
renderCustomPreview: c,
|
|
2481
|
-
onOverrideChange: (
|
|
2505
|
+
onOverrideChange: (g) => f(g),
|
|
2482
2506
|
open: l,
|
|
2483
2507
|
title: e("_pages:common.actions.import.dialog.title", {
|
|
2484
2508
|
entity: e(`_pages:${o}.title`)
|
|
2485
2509
|
}),
|
|
2486
2510
|
handleClose: () => {
|
|
2487
|
-
u(!1),
|
|
2511
|
+
u(!1), h(null), f(!1);
|
|
2488
2512
|
},
|
|
2489
|
-
action:
|
|
2513
|
+
action: y
|
|
2490
2514
|
};
|
|
2491
2515
|
}
|
|
2492
|
-
const
|
|
2493
|
-
const { showSuccessNotification: e } = oe(), { t: s } =
|
|
2516
|
+
const an = (n) => {
|
|
2517
|
+
const { showSuccessNotification: e } = oe(), { t: s } = N(), {
|
|
2494
2518
|
entity: t,
|
|
2495
|
-
mutationFn:
|
|
2519
|
+
mutationFn: r,
|
|
2496
2520
|
onError: o,
|
|
2497
2521
|
onSuccess: i,
|
|
2498
2522
|
onSuccessMessage: c = s("_pages:common.actions.export.successMessage")
|
|
2499
|
-
} =
|
|
2500
|
-
mutationFn: () =>
|
|
2523
|
+
} = n, a = re({
|
|
2524
|
+
mutationFn: () => r(),
|
|
2501
2525
|
onError: (d) => {
|
|
2502
2526
|
console.error(d), o && o(d);
|
|
2503
2527
|
},
|
|
2504
2528
|
onSuccess: async (d) => {
|
|
2505
|
-
const
|
|
2506
|
-
b.href =
|
|
2529
|
+
const h = JSON.stringify(d, null, 2), p = new Blob([h], { type: "application/json" }), f = URL.createObjectURL(p), b = document.createElement("a");
|
|
2530
|
+
b.href = f, b.download = `${t}.json`, b.click(), URL.revokeObjectURL(f), i && i(d), e({
|
|
2507
2531
|
message: c
|
|
2508
2532
|
});
|
|
2509
2533
|
}
|
|
2510
2534
|
}), l = S(() => {
|
|
2511
2535
|
a.mutate();
|
|
2512
|
-
}, [a]), { action: u } =
|
|
2536
|
+
}, [a]), { action: u } = ss({
|
|
2513
2537
|
onClick: l,
|
|
2514
2538
|
isLoading: a.isPending
|
|
2515
2539
|
});
|
|
@@ -2517,19 +2541,19 @@ const tr = (r) => {
|
|
|
2517
2541
|
action: u
|
|
2518
2542
|
};
|
|
2519
2543
|
}, Ae = () => typeof window < "u" ? window.scrollY : 0;
|
|
2520
|
-
function
|
|
2544
|
+
function rs(n) {
|
|
2521
2545
|
const [e, s] = R(Ae), t = S(() => {
|
|
2522
2546
|
s(Ae());
|
|
2523
2547
|
}, []);
|
|
2524
2548
|
return M(() => (window.addEventListener("scroll", t), () => {
|
|
2525
2549
|
window.removeEventListener("scroll", t);
|
|
2526
|
-
}), [t]), e >
|
|
2550
|
+
}), [t]), e > n;
|
|
2527
2551
|
}
|
|
2528
|
-
const
|
|
2529
|
-
const { t: e } =
|
|
2530
|
-
icon: s =
|
|
2552
|
+
const cn = (n) => {
|
|
2553
|
+
const { t: e } = N(), {
|
|
2554
|
+
icon: s = wt,
|
|
2531
2555
|
threshold: t = 200,
|
|
2532
|
-
scrollTop:
|
|
2556
|
+
scrollTop: r = 0,
|
|
2533
2557
|
scrollLeft: o = 0,
|
|
2534
2558
|
tooltip: i = e("_accessibility:buttons.toTop"),
|
|
2535
2559
|
scrollOnClick: c = !0,
|
|
@@ -2537,9 +2561,9 @@ const sr = (r) => {
|
|
|
2537
2561
|
className: l = "",
|
|
2538
2562
|
variant: u = "submit",
|
|
2539
2563
|
color: d = "primary",
|
|
2540
|
-
...
|
|
2541
|
-
} =
|
|
2542
|
-
return /* @__PURE__ */
|
|
2564
|
+
...h
|
|
2565
|
+
} = n, p = rs(t);
|
|
2566
|
+
return /* @__PURE__ */ m(
|
|
2543
2567
|
z,
|
|
2544
2568
|
{
|
|
2545
2569
|
variant: u,
|
|
@@ -2547,23 +2571,23 @@ const sr = (r) => {
|
|
|
2547
2571
|
icon: s,
|
|
2548
2572
|
"data-tooltip-id": "tooltip",
|
|
2549
2573
|
onClick: () => {
|
|
2550
|
-
a == null || a(), c &&
|
|
2574
|
+
a == null || a(), c && Zt.scrollTo(o, r);
|
|
2551
2575
|
},
|
|
2552
|
-
className: `to-top ${
|
|
2576
|
+
className: `to-top ${p ? "show" : "hide"} ${l}`.trim(),
|
|
2553
2577
|
"data-tooltip-content": i,
|
|
2554
|
-
...
|
|
2578
|
+
...h
|
|
2555
2579
|
}
|
|
2556
2580
|
);
|
|
2557
2581
|
};
|
|
2558
|
-
function
|
|
2559
|
-
const { t: e } =
|
|
2560
|
-
if ("children" in
|
|
2561
|
-
const { children:
|
|
2562
|
-
return /* @__PURE__ */
|
|
2582
|
+
function ln(n) {
|
|
2583
|
+
const { t: e } = N();
|
|
2584
|
+
if ("children" in n) {
|
|
2585
|
+
const { children: k, className: v } = n;
|
|
2586
|
+
return /* @__PURE__ */ m("div", { className: `error-container${v ? ` ${v}` : ""}`, children: k });
|
|
2563
2587
|
}
|
|
2564
2588
|
const {
|
|
2565
2589
|
error: t,
|
|
2566
|
-
message:
|
|
2590
|
+
message: r,
|
|
2567
2591
|
iconProps: o,
|
|
2568
2592
|
onRetry: i,
|
|
2569
2593
|
retryLabel: c,
|
|
@@ -2571,72 +2595,72 @@ function rr(r) {
|
|
|
2571
2595
|
messageProps: l,
|
|
2572
2596
|
className: u,
|
|
2573
2597
|
resetErrorBoundary: d
|
|
2574
|
-
} =
|
|
2575
|
-
className:
|
|
2576
|
-
children:
|
|
2598
|
+
} = n, h = i ?? d, {
|
|
2599
|
+
className: p,
|
|
2600
|
+
children: f,
|
|
2577
2601
|
onClick: b,
|
|
2578
|
-
...
|
|
2579
|
-
} = a ?? {}, { className:
|
|
2580
|
-
return /* @__PURE__ */
|
|
2581
|
-
w && /* @__PURE__ */
|
|
2582
|
-
|
|
2602
|
+
...y
|
|
2603
|
+
} = a ?? {}, { className: g, ...C } = l ?? {}, w = o !== null;
|
|
2604
|
+
return /* @__PURE__ */ E("div", { className: `error-container${u ? ` ${u}` : ""}`, children: [
|
|
2605
|
+
w && /* @__PURE__ */ m(
|
|
2606
|
+
F,
|
|
2583
2607
|
{
|
|
2584
2608
|
...o,
|
|
2585
2609
|
icon: (o == null ? void 0 : o.icon) ?? At,
|
|
2586
2610
|
className: `error-icon${o != null && o.className ? ` ${o.className}` : ""}`
|
|
2587
2611
|
}
|
|
2588
2612
|
),
|
|
2589
|
-
/* @__PURE__ */
|
|
2613
|
+
/* @__PURE__ */ m(
|
|
2590
2614
|
"p",
|
|
2591
2615
|
{
|
|
2592
|
-
...
|
|
2593
|
-
className: `error-message${
|
|
2594
|
-
children:
|
|
2616
|
+
...C,
|
|
2617
|
+
className: `error-message${g ? ` ${g}` : ""}`,
|
|
2618
|
+
children: r ?? (t == null ? void 0 : t.message) ?? e("_accessibility:errors.unknownError")
|
|
2595
2619
|
}
|
|
2596
2620
|
),
|
|
2597
|
-
|
|
2598
|
-
|
|
2621
|
+
h && /* @__PURE__ */ m(
|
|
2622
|
+
q,
|
|
2599
2623
|
{
|
|
2600
2624
|
type: "button",
|
|
2601
2625
|
variant: "submit",
|
|
2602
2626
|
color: "primary",
|
|
2603
|
-
...
|
|
2604
|
-
className: `error-retry ${
|
|
2605
|
-
onClick: (
|
|
2606
|
-
b == null || b(
|
|
2627
|
+
...y,
|
|
2628
|
+
className: `error-retry ${p ? ` ${p}` : ""}`,
|
|
2629
|
+
onClick: (k) => {
|
|
2630
|
+
b == null || b(k), k.defaultPrevented || h();
|
|
2607
2631
|
},
|
|
2608
|
-
children:
|
|
2632
|
+
children: f ?? c ?? e("_accessibility:actions.retry", { defaultValue: "Retry" })
|
|
2609
2633
|
}
|
|
2610
2634
|
)
|
|
2611
2635
|
] });
|
|
2612
2636
|
}
|
|
2613
|
-
const
|
|
2614
|
-
const { showBackButton: e, title: s, actions: t } =
|
|
2615
|
-
return /* @__PURE__ */
|
|
2616
|
-
/* @__PURE__ */
|
|
2617
|
-
e && /* @__PURE__ */
|
|
2637
|
+
const os = (n) => {
|
|
2638
|
+
const { showBackButton: e, title: s, actions: t } = n, { t: r } = N(), { navigate: o } = ie();
|
|
2639
|
+
return /* @__PURE__ */ E("div", { className: "page-header", children: [
|
|
2640
|
+
/* @__PURE__ */ E("div", { className: "page-header-left", children: [
|
|
2641
|
+
e && /* @__PURE__ */ m(
|
|
2618
2642
|
z,
|
|
2619
2643
|
{
|
|
2620
|
-
icon:
|
|
2644
|
+
icon: St,
|
|
2621
2645
|
onClick: () => o(-1),
|
|
2622
2646
|
className: "page-header-back",
|
|
2623
|
-
name:
|
|
2647
|
+
name: r("_accessibility:buttons.back"),
|
|
2624
2648
|
"data-tooltip-id": "tooltip",
|
|
2625
|
-
"data-tooltip-content":
|
|
2649
|
+
"data-tooltip-content": r("_accessibility:buttons.back")
|
|
2626
2650
|
}
|
|
2627
2651
|
),
|
|
2628
|
-
/* @__PURE__ */
|
|
2652
|
+
/* @__PURE__ */ m("h2", { className: "page-header-title", children: s })
|
|
2629
2653
|
] }),
|
|
2630
|
-
/* @__PURE__ */
|
|
2631
|
-
/* @__PURE__ */
|
|
2632
|
-
|
|
2654
|
+
/* @__PURE__ */ E("div", { children: [
|
|
2655
|
+
/* @__PURE__ */ m(
|
|
2656
|
+
at,
|
|
2633
2657
|
{
|
|
2634
2658
|
className: "page-header-actions-desktop",
|
|
2635
2659
|
actions: t ?? []
|
|
2636
2660
|
}
|
|
2637
2661
|
),
|
|
2638
|
-
/* @__PURE__ */
|
|
2639
|
-
|
|
2662
|
+
/* @__PURE__ */ m(
|
|
2663
|
+
ct,
|
|
2640
2664
|
{
|
|
2641
2665
|
className: "page-header-actions-mobile",
|
|
2642
2666
|
actions: t ?? []
|
|
@@ -2644,90 +2668,90 @@ const rs = (r) => {
|
|
|
2644
2668
|
)
|
|
2645
2669
|
] })
|
|
2646
2670
|
] });
|
|
2647
|
-
},
|
|
2671
|
+
}, un = (n) => {
|
|
2648
2672
|
const {
|
|
2649
2673
|
title: e,
|
|
2650
2674
|
children: s,
|
|
2651
2675
|
addOptions: t,
|
|
2652
|
-
filterOptions:
|
|
2676
|
+
filterOptions: r,
|
|
2653
2677
|
actions: o,
|
|
2654
2678
|
queryKey: i,
|
|
2655
2679
|
isLoading: c = !1,
|
|
2656
2680
|
isAnimated: a = !0,
|
|
2657
2681
|
showBackButton: l = !1
|
|
2658
|
-
} =
|
|
2659
|
-
const
|
|
2682
|
+
} = n, { t: u } = N(), d = Z(), { countOfFilters: h } = lt(), p = B(() => {
|
|
2683
|
+
const f = Array.isArray(o) ? [...o] : [];
|
|
2660
2684
|
if (i) {
|
|
2661
2685
|
const b = {
|
|
2662
2686
|
id: J.Refresh,
|
|
2663
2687
|
onClick: () => d.invalidateQueries({ queryKey: i }),
|
|
2664
|
-
icon: /* @__PURE__ */
|
|
2688
|
+
icon: /* @__PURE__ */ m(F, { icon: Re }),
|
|
2665
2689
|
tooltip: u("_pages:common.actions.refresh.text")
|
|
2666
2690
|
};
|
|
2667
|
-
|
|
2691
|
+
f.unshift(b);
|
|
2668
2692
|
}
|
|
2669
2693
|
if (t) {
|
|
2670
2694
|
const b = {
|
|
2671
2695
|
...t,
|
|
2672
2696
|
id: J.Add,
|
|
2673
|
-
icon: /* @__PURE__ */
|
|
2697
|
+
icon: /* @__PURE__ */ m(F, { icon: Te })
|
|
2674
2698
|
};
|
|
2675
|
-
|
|
2699
|
+
f.unshift(b);
|
|
2676
2700
|
}
|
|
2677
|
-
if (
|
|
2701
|
+
if (r) {
|
|
2678
2702
|
const b = {
|
|
2679
|
-
...
|
|
2703
|
+
...r,
|
|
2680
2704
|
id: "filter",
|
|
2681
|
-
icon: /* @__PURE__ */
|
|
2682
|
-
children: /* @__PURE__ */
|
|
2683
|
-
|
|
2705
|
+
icon: /* @__PURE__ */ m(F, { icon: Ct }),
|
|
2706
|
+
children: /* @__PURE__ */ m(
|
|
2707
|
+
ut,
|
|
2684
2708
|
{
|
|
2685
|
-
className: `${
|
|
2686
|
-
count:
|
|
2709
|
+
className: `${h > 0 ? "show" : "hide"} `,
|
|
2710
|
+
count: h
|
|
2687
2711
|
}
|
|
2688
2712
|
)
|
|
2689
2713
|
};
|
|
2690
|
-
|
|
2714
|
+
f.push(b);
|
|
2691
2715
|
}
|
|
2692
|
-
return
|
|
2716
|
+
return f;
|
|
2693
2717
|
}, [
|
|
2694
2718
|
o,
|
|
2695
2719
|
t,
|
|
2696
|
-
|
|
2697
|
-
|
|
2720
|
+
h,
|
|
2721
|
+
r,
|
|
2698
2722
|
d,
|
|
2699
2723
|
i,
|
|
2700
2724
|
u
|
|
2701
2725
|
]);
|
|
2702
|
-
return /* @__PURE__ */
|
|
2703
|
-
/* @__PURE__ */
|
|
2704
|
-
|
|
2726
|
+
return /* @__PURE__ */ E("main", { className: "page-main", children: [
|
|
2727
|
+
/* @__PURE__ */ m(
|
|
2728
|
+
os,
|
|
2705
2729
|
{
|
|
2706
2730
|
showBackButton: l,
|
|
2707
|
-
actions:
|
|
2731
|
+
actions: p,
|
|
2708
2732
|
title: e
|
|
2709
2733
|
}
|
|
2710
2734
|
),
|
|
2711
|
-
/* @__PURE__ */
|
|
2712
|
-
t && /* @__PURE__ */
|
|
2735
|
+
/* @__PURE__ */ m("div", { className: `page-main-content ${a ? "appear" : ""}`, children: c ? /* @__PURE__ */ m(ne, { className: "page-loading" }) : s }),
|
|
2736
|
+
t && /* @__PURE__ */ m(
|
|
2713
2737
|
z,
|
|
2714
2738
|
{
|
|
2715
|
-
icon: t.icon ??
|
|
2739
|
+
icon: t.icon ?? Te,
|
|
2716
2740
|
color: t.color ?? "primary",
|
|
2717
2741
|
variant: t.variant ?? "submit",
|
|
2718
2742
|
onClick: () => {
|
|
2719
|
-
var
|
|
2720
|
-
return (
|
|
2743
|
+
var f;
|
|
2744
|
+
return (f = t.onClick) == null ? void 0 : f.call(t);
|
|
2721
2745
|
},
|
|
2722
2746
|
className: `button page-fab ${t.className ?? ""}`
|
|
2723
2747
|
}
|
|
2724
2748
|
)
|
|
2725
2749
|
] });
|
|
2726
|
-
},
|
|
2727
|
-
const { t: e } =
|
|
2750
|
+
}, dn = (n) => {
|
|
2751
|
+
const { t: e } = N(), {
|
|
2728
2752
|
className: s = "",
|
|
2729
2753
|
itemClassName: t = "",
|
|
2730
|
-
loading:
|
|
2754
|
+
loading: r = !1,
|
|
2731
2755
|
emptyComponent: o = null,
|
|
2732
2756
|
emptyMessage: i = e("_accessibility:messages.empty"),
|
|
2733
2757
|
renderComponent: c,
|
|
@@ -2735,10 +2759,10 @@ const rs = (r) => {
|
|
|
2735
2759
|
hasMore: l = !1,
|
|
2736
2760
|
loadingMore: u = !1,
|
|
2737
2761
|
onLoadMore: d,
|
|
2738
|
-
loadMoreComponent:
|
|
2739
|
-
observerRootMargin:
|
|
2740
|
-
observerThreshold:
|
|
2741
|
-
} =
|
|
2762
|
+
loadMoreComponent: h = null,
|
|
2763
|
+
observerRootMargin: p = "0px 0px 200px 0px",
|
|
2764
|
+
observerThreshold: f = 0
|
|
2765
|
+
} = n, b = U(!1), y = U(null), g = S(async () => {
|
|
2742
2766
|
if (!(!l || !d) && !(u || b.current)) {
|
|
2743
2767
|
b.current = !0;
|
|
2744
2768
|
try {
|
|
@@ -2749,85 +2773,85 @@ const rs = (r) => {
|
|
|
2749
2773
|
}
|
|
2750
2774
|
}, [l, u, d]);
|
|
2751
2775
|
return M(() => {
|
|
2752
|
-
if (!l || !d || !
|
|
2753
|
-
const
|
|
2776
|
+
if (!l || !d || !y.current || typeof IntersectionObserver > "u") return;
|
|
2777
|
+
const C = new IntersectionObserver(
|
|
2754
2778
|
(w) => {
|
|
2755
|
-
w.some((
|
|
2779
|
+
w.some((k) => k.isIntersecting) && g();
|
|
2756
2780
|
},
|
|
2757
2781
|
{
|
|
2758
|
-
rootMargin:
|
|
2759
|
-
threshold:
|
|
2782
|
+
rootMargin: p,
|
|
2783
|
+
threshold: f
|
|
2760
2784
|
}
|
|
2761
2785
|
);
|
|
2762
|
-
return
|
|
2786
|
+
return C.observe(y.current), () => C.disconnect();
|
|
2763
2787
|
}, [
|
|
2764
2788
|
l,
|
|
2765
2789
|
d,
|
|
2766
|
-
f,
|
|
2767
2790
|
p,
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
},
|
|
2791
|
+
f,
|
|
2792
|
+
g
|
|
2793
|
+
]), r ? /* @__PURE__ */ m(ne, {}) : /* @__PURE__ */ m(ce, { children: a != null && a.length ? /* @__PURE__ */ E("ul", { className: `pretty-grid-main ${s}`, children: [
|
|
2794
|
+
a == null ? void 0 : a.map((C) => /* @__PURE__ */ m("li", { className: `pretty-grid-item ${t}`, children: c(C) }, C.id)),
|
|
2795
|
+
l && d && /* @__PURE__ */ m("li", { className: "pretty-grid-load-more", ref: y, children: h })
|
|
2796
|
+
] }) : /* @__PURE__ */ m(ce, { children: o || /* @__PURE__ */ m(ps, { message: i }) }) });
|
|
2797
|
+
}, ze = X({
|
|
2774
2798
|
title: "",
|
|
2775
2799
|
setTitle: () => {
|
|
2776
2800
|
},
|
|
2777
2801
|
rightContent: null,
|
|
2778
2802
|
setRightContent: () => {
|
|
2779
2803
|
}
|
|
2780
|
-
}),
|
|
2781
|
-
const { children: e } =
|
|
2804
|
+
}), mn = (n) => {
|
|
2805
|
+
const { children: e } = n, [s, t] = R(""), [r, o] = R(null), i = S((l) => {
|
|
2782
2806
|
t(l);
|
|
2783
2807
|
}, []), c = S((l) => {
|
|
2784
2808
|
o(l);
|
|
2785
|
-
}, []), a =
|
|
2809
|
+
}, []), a = B(
|
|
2786
2810
|
() => ({
|
|
2787
2811
|
title: s,
|
|
2788
2812
|
setTitle: i,
|
|
2789
|
-
rightContent:
|
|
2813
|
+
rightContent: r,
|
|
2790
2814
|
setRightContent: c
|
|
2791
2815
|
}),
|
|
2792
|
-
[s, i,
|
|
2816
|
+
[s, i, r, c]
|
|
2793
2817
|
);
|
|
2794
|
-
return /* @__PURE__ */
|
|
2795
|
-
},
|
|
2796
|
-
function
|
|
2797
|
-
const { t: e } =
|
|
2798
|
-
(
|
|
2818
|
+
return /* @__PURE__ */ m(ze.Provider, { value: a, children: e });
|
|
2819
|
+
}, is = () => Y(ze);
|
|
2820
|
+
function hn(n) {
|
|
2821
|
+
const { t: e } = N(), { openDrawer: s, showSearch: t = !0, menuButtonProps: r } = n, { searchComponent: o, location: i } = ie(), { title: c, rightContent: a } = is(), [l, u] = R(!1), d = S((f) => {
|
|
2822
|
+
(Vt() ? f.metaKey : f.ctrlKey) && f.shiftKey && f.key.toLowerCase() === "f" && (u(!0), f.preventDefault());
|
|
2799
2823
|
}, []);
|
|
2800
2824
|
M(() => (window.addEventListener("keydown", d), () => {
|
|
2801
2825
|
window.removeEventListener("keydown", d);
|
|
2802
2826
|
}), [d]);
|
|
2803
|
-
const
|
|
2804
|
-
return /* @__PURE__ */
|
|
2805
|
-
i.pathname !== "/" && !!
|
|
2806
|
-
/* @__PURE__ */
|
|
2807
|
-
/* @__PURE__ */
|
|
2808
|
-
/* @__PURE__ */
|
|
2827
|
+
const h = o, p = t && !!h;
|
|
2828
|
+
return /* @__PURE__ */ E(ce, { children: [
|
|
2829
|
+
i.pathname !== "/" && !!h && /* @__PURE__ */ m(h, { open: l, onClose: () => u(!1) }),
|
|
2830
|
+
/* @__PURE__ */ E("header", { id: "header", className: "header", children: [
|
|
2831
|
+
/* @__PURE__ */ E("div", { className: "navbar-left", children: [
|
|
2832
|
+
/* @__PURE__ */ m(
|
|
2809
2833
|
z,
|
|
2810
2834
|
{
|
|
2811
|
-
...
|
|
2812
|
-
type: (
|
|
2813
|
-
icon: (
|
|
2814
|
-
onClick: (
|
|
2835
|
+
...r,
|
|
2836
|
+
type: (r == null ? void 0 : r.type) ?? "button",
|
|
2837
|
+
icon: (r == null ? void 0 : r.icon) ?? vt,
|
|
2838
|
+
onClick: (f) => {
|
|
2815
2839
|
var b;
|
|
2816
|
-
(b =
|
|
2840
|
+
(b = r == null ? void 0 : r.onClick) == null || b.call(r, f), s();
|
|
2817
2841
|
},
|
|
2818
|
-
name: (
|
|
2819
|
-
"aria-label": (
|
|
2820
|
-
className: `navbar-menu animated ${(
|
|
2842
|
+
name: (r == null ? void 0 : r.name) ?? e("_accessibility:buttons.openMenu"),
|
|
2843
|
+
"aria-label": (r == null ? void 0 : r["aria-label"]) ?? e("_accessibility:ariaLabels.openMenu"),
|
|
2844
|
+
className: `navbar-menu animated ${(r == null ? void 0 : r.className) ?? ""}`
|
|
2821
2845
|
}
|
|
2822
2846
|
),
|
|
2823
|
-
/* @__PURE__ */
|
|
2847
|
+
/* @__PURE__ */ m("h1", { className: "poppins navbar-title", children: c || e("_pages:home.appName") })
|
|
2824
2848
|
] }),
|
|
2825
|
-
/* @__PURE__ */
|
|
2849
|
+
/* @__PURE__ */ E("div", { className: "navbar-right", children: [
|
|
2826
2850
|
a,
|
|
2827
|
-
|
|
2851
|
+
p && /* @__PURE__ */ m(
|
|
2828
2852
|
z,
|
|
2829
2853
|
{
|
|
2830
|
-
icon:
|
|
2854
|
+
icon: Tt,
|
|
2831
2855
|
className: "navbar-search-btn",
|
|
2832
2856
|
onClick: () => u(!0)
|
|
2833
2857
|
}
|
|
@@ -2836,15 +2860,15 @@ function ar(r) {
|
|
|
2836
2860
|
] })
|
|
2837
2861
|
] });
|
|
2838
2862
|
}
|
|
2839
|
-
const ue = 300,
|
|
2840
|
-
switch (
|
|
2863
|
+
const ue = 300, as = (n) => n ?? O.error, cs = (n) => {
|
|
2864
|
+
switch (n) {
|
|
2841
2865
|
case O.error:
|
|
2842
2866
|
return Et;
|
|
2843
2867
|
default:
|
|
2844
|
-
return
|
|
2868
|
+
return kt;
|
|
2845
2869
|
}
|
|
2846
|
-
},
|
|
2847
|
-
switch (
|
|
2870
|
+
}, ge = (n) => {
|
|
2871
|
+
switch (n) {
|
|
2848
2872
|
case O.success:
|
|
2849
2873
|
return "!text-success";
|
|
2850
2874
|
case O.error:
|
|
@@ -2854,8 +2878,8 @@ const ue = 300, os = (r) => r ?? O.error, is = (r) => {
|
|
|
2854
2878
|
default:
|
|
2855
2879
|
return "!text-info";
|
|
2856
2880
|
}
|
|
2857
|
-
},
|
|
2858
|
-
switch (
|
|
2881
|
+
}, ls = (n) => {
|
|
2882
|
+
switch (n) {
|
|
2859
2883
|
case O.success:
|
|
2860
2884
|
return "bg-bg-success";
|
|
2861
2885
|
case O.error:
|
|
@@ -2866,19 +2890,19 @@ const ue = 300, os = (r) => r ?? O.error, is = (r) => {
|
|
|
2866
2890
|
return "bg-bg-info";
|
|
2867
2891
|
}
|
|
2868
2892
|
};
|
|
2869
|
-
function
|
|
2870
|
-
const { t:
|
|
2871
|
-
|
|
2893
|
+
function fn() {
|
|
2894
|
+
const { t: n } = N(), { notification: e, removeNotification: s } = oe(), [t, r] = R([]), o = U(t);
|
|
2895
|
+
mt(() => {
|
|
2872
2896
|
o.current = t;
|
|
2873
2897
|
});
|
|
2874
|
-
const i =
|
|
2898
|
+
const i = U(null), c = S(
|
|
2875
2899
|
(a) => {
|
|
2876
|
-
|
|
2900
|
+
r(
|
|
2877
2901
|
(l) => a !== void 0 ? l.map((u) => u.id === a ? { ...u, closing: !0 } : u) : l.map((u) => ({ ...u, closing: !0 }))
|
|
2878
2902
|
), a !== void 0 ? setTimeout(() => {
|
|
2879
|
-
s(a),
|
|
2903
|
+
s(a), r((l) => l.filter((u) => u.id !== a));
|
|
2880
2904
|
}, ue) : (i.current && clearTimeout(i.current), i.current = setTimeout(() => {
|
|
2881
|
-
s(),
|
|
2905
|
+
s(), r([]), i.current = null;
|
|
2882
2906
|
}, ue));
|
|
2883
2907
|
},
|
|
2884
2908
|
[s]
|
|
@@ -2890,30 +2914,30 @@ function cr() {
|
|
|
2890
2914
|
};
|
|
2891
2915
|
if (e.length === 0)
|
|
2892
2916
|
return o.current.length === 0 ? void 0 : (i.current && clearTimeout(i.current), a = setTimeout(() => {
|
|
2893
|
-
|
|
2917
|
+
r((p) => p.map((f) => ({ ...f, closing: !0 }))), a = null;
|
|
2894
2918
|
}, 0), i.current = setTimeout(() => {
|
|
2895
|
-
|
|
2919
|
+
r([]), i.current = null;
|
|
2896
2920
|
}, ue), l);
|
|
2897
|
-
const u = new Set(o.current.map((
|
|
2921
|
+
const u = new Set(o.current.map((p) => p.id));
|
|
2898
2922
|
if (!e.some(
|
|
2899
|
-
(
|
|
2923
|
+
(p) => p.id !== void 0 && !u.has(p.id)
|
|
2900
2924
|
)) return;
|
|
2901
2925
|
if (o.current.length === 0) {
|
|
2902
|
-
const
|
|
2926
|
+
const p = [...e];
|
|
2903
2927
|
return a = setTimeout(() => {
|
|
2904
|
-
|
|
2928
|
+
r(p.map((f) => ({ ...f, closing: !1 }))), a = null;
|
|
2905
2929
|
}, 0), () => {
|
|
2906
2930
|
a && clearTimeout(a);
|
|
2907
2931
|
};
|
|
2908
2932
|
}
|
|
2909
2933
|
i.current && clearTimeout(i.current), a = setTimeout(() => {
|
|
2910
|
-
|
|
2911
|
-
(
|
|
2934
|
+
r(
|
|
2935
|
+
(p) => p.every((f) => f.closing) ? p : p.map((f) => ({ ...f, closing: !0 }))
|
|
2912
2936
|
), a = null;
|
|
2913
2937
|
}, 0);
|
|
2914
|
-
const
|
|
2938
|
+
const h = [...e];
|
|
2915
2939
|
return i.current = setTimeout(() => {
|
|
2916
|
-
|
|
2940
|
+
r(h.map((p) => ({ ...p, closing: !1 }))), i.current = null;
|
|
2917
2941
|
}, ue), l;
|
|
2918
2942
|
}, [e]), M(() => {
|
|
2919
2943
|
if (!t.length) return;
|
|
@@ -2926,38 +2950,38 @@ function cr() {
|
|
|
2926
2950
|
return window.addEventListener("keydown", u), () => {
|
|
2927
2951
|
window.clearTimeout(l), a && window.removeEventListener("click", a), window.removeEventListener("keydown", u);
|
|
2928
2952
|
};
|
|
2929
|
-
}, [t.length, c]),
|
|
2930
|
-
/* @__PURE__ */
|
|
2931
|
-
const
|
|
2932
|
-
return /* @__PURE__ */
|
|
2953
|
+
}, [t.length, c]), _e(
|
|
2954
|
+
/* @__PURE__ */ m("div", { className: `notification-portal ${t.length ? "active" : ""}`, children: t.map(({ id: a, type: l, message: u, closing: d }) => {
|
|
2955
|
+
const h = as(l);
|
|
2956
|
+
return /* @__PURE__ */ E(
|
|
2933
2957
|
"div",
|
|
2934
2958
|
{
|
|
2935
|
-
className: `notification ${d ? "closing" : ""} ${
|
|
2936
|
-
onClick: (
|
|
2959
|
+
className: `notification ${d ? "closing" : ""} ${ls(h)}`,
|
|
2960
|
+
onClick: (p) => p.stopPropagation(),
|
|
2937
2961
|
children: [
|
|
2938
|
-
/* @__PURE__ */
|
|
2939
|
-
/* @__PURE__ */
|
|
2940
|
-
|
|
2962
|
+
/* @__PURE__ */ E("div", { className: "notification-body", children: [
|
|
2963
|
+
/* @__PURE__ */ m(
|
|
2964
|
+
F,
|
|
2941
2965
|
{
|
|
2942
|
-
icon:
|
|
2943
|
-
className: `notification-icon ${
|
|
2966
|
+
icon: cs(h),
|
|
2967
|
+
className: `notification-icon ${ge(h)}`
|
|
2944
2968
|
}
|
|
2945
2969
|
),
|
|
2946
|
-
/* @__PURE__ */
|
|
2970
|
+
/* @__PURE__ */ m("p", { className: `notification-text ${ge(h)}`, children: u })
|
|
2947
2971
|
] }),
|
|
2948
|
-
/* @__PURE__ */
|
|
2972
|
+
/* @__PURE__ */ m(
|
|
2949
2973
|
z,
|
|
2950
2974
|
{
|
|
2951
2975
|
type: "button",
|
|
2952
|
-
icon:
|
|
2976
|
+
icon: Le,
|
|
2953
2977
|
color: "error",
|
|
2954
2978
|
className: "notification-close group",
|
|
2955
|
-
onClick: (
|
|
2956
|
-
|
|
2979
|
+
onClick: (p) => {
|
|
2980
|
+
p.stopPropagation(), a !== void 0 && c(a);
|
|
2957
2981
|
},
|
|
2958
|
-
iconClassName: `${
|
|
2959
|
-
name:
|
|
2960
|
-
"aria-label":
|
|
2982
|
+
iconClassName: `${ge(h)} notification-close-icon`,
|
|
2983
|
+
name: n("_accessibility:buttons.closeNotification"),
|
|
2984
|
+
"aria-label": n("_accessibility:ariaLabels.closeNotification")
|
|
2961
2985
|
}
|
|
2962
2986
|
)
|
|
2963
2987
|
]
|
|
@@ -2968,113 +2992,113 @@ function cr() {
|
|
|
2968
2992
|
document.body
|
|
2969
2993
|
);
|
|
2970
2994
|
}
|
|
2971
|
-
function
|
|
2972
|
-
const { className: e, ...s } =
|
|
2973
|
-
return /* @__PURE__ */
|
|
2974
|
-
|
|
2995
|
+
function pn(n) {
|
|
2996
|
+
const { className: e, ...s } = n;
|
|
2997
|
+
return /* @__PURE__ */ m("div", { className: "splash-screen", children: /* @__PURE__ */ m(
|
|
2998
|
+
ne,
|
|
2975
2999
|
{
|
|
2976
3000
|
className: `blur-appear ${e ? ` ${e}` : ""}`,
|
|
2977
3001
|
...s
|
|
2978
3002
|
}
|
|
2979
3003
|
) });
|
|
2980
3004
|
}
|
|
2981
|
-
const
|
|
3005
|
+
const us = (n) => {
|
|
2982
3006
|
const {
|
|
2983
3007
|
id: e,
|
|
2984
3008
|
active: s,
|
|
2985
3009
|
onClick: t,
|
|
2986
|
-
children:
|
|
3010
|
+
children: r,
|
|
2987
3011
|
to: o,
|
|
2988
3012
|
useLinks: i = !0,
|
|
2989
3013
|
tabButtonProps: c
|
|
2990
|
-
} =
|
|
3014
|
+
} = n, { linkComponent: a } = ie(), l = a;
|
|
2991
3015
|
if (!i) {
|
|
2992
3016
|
const {
|
|
2993
3017
|
className: d = "",
|
|
2994
|
-
variant:
|
|
2995
|
-
color:
|
|
2996
|
-
...
|
|
3018
|
+
variant: h = s ? "submit" : "outlined",
|
|
3019
|
+
color: p = s ? "primary" : "default",
|
|
3020
|
+
...f
|
|
2997
3021
|
} = c ?? {};
|
|
2998
|
-
return /* @__PURE__ */
|
|
2999
|
-
|
|
3022
|
+
return /* @__PURE__ */ m(
|
|
3023
|
+
q,
|
|
3000
3024
|
{
|
|
3001
3025
|
type: "button",
|
|
3002
|
-
variant:
|
|
3003
|
-
color:
|
|
3026
|
+
variant: h,
|
|
3027
|
+
color: p,
|
|
3004
3028
|
className: `tab ${d}`,
|
|
3005
3029
|
onClick: t,
|
|
3006
|
-
...
|
|
3007
|
-
children:
|
|
3030
|
+
...f,
|
|
3031
|
+
children: r
|
|
3008
3032
|
}
|
|
3009
3033
|
);
|
|
3010
3034
|
}
|
|
3011
3035
|
const u = `button submit tab ${s ? "primary" : "outlined"} ${(c == null ? void 0 : c.className) ?? ""}`.trim();
|
|
3012
|
-
return /* @__PURE__ */
|
|
3036
|
+
return /* @__PURE__ */ m(
|
|
3013
3037
|
l,
|
|
3014
3038
|
{
|
|
3015
3039
|
to: o ?? `#${e}`,
|
|
3016
3040
|
onClick: () => t(),
|
|
3017
3041
|
className: u,
|
|
3018
|
-
children:
|
|
3042
|
+
children: r
|
|
3019
3043
|
}
|
|
3020
3044
|
);
|
|
3021
|
-
},
|
|
3022
|
-
var
|
|
3045
|
+
}, ds = (n) => {
|
|
3046
|
+
var p;
|
|
3023
3047
|
const {
|
|
3024
3048
|
tabs: e = [],
|
|
3025
3049
|
defaultTab: s,
|
|
3026
3050
|
currentTab: t,
|
|
3027
|
-
onTabChange:
|
|
3051
|
+
onTabChange: r,
|
|
3028
3052
|
className: o = "",
|
|
3029
3053
|
tabsContainerClassName: i = "",
|
|
3030
3054
|
useLinks: c = !0,
|
|
3031
3055
|
tabButtonProps: a
|
|
3032
|
-
} =
|
|
3033
|
-
return /* @__PURE__ */
|
|
3034
|
-
/* @__PURE__ */
|
|
3056
|
+
} = n, [l, u] = R(s ?? ((p = e[0]) == null ? void 0 : p.id)), d = t ?? l, h = B(() => e.find((f) => f.id === d), [e, d]);
|
|
3057
|
+
return /* @__PURE__ */ E("div", { className: `tabs-layout-main ${o}`, children: [
|
|
3058
|
+
/* @__PURE__ */ m(
|
|
3035
3059
|
"ul",
|
|
3036
3060
|
{
|
|
3037
3061
|
className: `horizontal tabs tabs-container ${i}`,
|
|
3038
|
-
children: e.map(({ id:
|
|
3039
|
-
|
|
3062
|
+
children: e.map(({ id: f, to: b, label: y }) => /* @__PURE__ */ m("li", { children: /* @__PURE__ */ m(
|
|
3063
|
+
us,
|
|
3040
3064
|
{
|
|
3041
3065
|
onClick: () => {
|
|
3042
|
-
t === void 0 && u(
|
|
3066
|
+
t === void 0 && u(f), r == null || r(f);
|
|
3043
3067
|
},
|
|
3044
|
-
id:
|
|
3068
|
+
id: f,
|
|
3045
3069
|
to: b,
|
|
3046
3070
|
siblings: e.length > 1,
|
|
3047
|
-
active: d ===
|
|
3071
|
+
active: d === f,
|
|
3048
3072
|
useLinks: c,
|
|
3049
3073
|
tabButtonProps: a,
|
|
3050
|
-
children:
|
|
3074
|
+
children: y
|
|
3051
3075
|
}
|
|
3052
|
-
) },
|
|
3076
|
+
) }, f))
|
|
3053
3077
|
}
|
|
3054
3078
|
),
|
|
3055
|
-
|
|
3079
|
+
h == null ? void 0 : h.content
|
|
3056
3080
|
] });
|
|
3057
|
-
},
|
|
3081
|
+
}, ms = (n) => {
|
|
3058
3082
|
const {
|
|
3059
3083
|
title: e,
|
|
3060
3084
|
body: s,
|
|
3061
3085
|
content: t,
|
|
3062
|
-
onClickNext:
|
|
3086
|
+
onClickNext: r,
|
|
3063
3087
|
onSkip: o,
|
|
3064
3088
|
onStartAsGuest: i,
|
|
3065
3089
|
onSignIn: c,
|
|
3066
3090
|
image: a = "",
|
|
3067
3091
|
alt: l = "",
|
|
3068
3092
|
final: u = !1
|
|
3069
|
-
} =
|
|
3070
|
-
return /* @__PURE__ */
|
|
3071
|
-
a && /* @__PURE__ */
|
|
3072
|
-
e != null && /* @__PURE__ */
|
|
3073
|
-
s != null && /* @__PURE__ */
|
|
3074
|
-
t != null && /* @__PURE__ */
|
|
3075
|
-
/* @__PURE__ */
|
|
3076
|
-
/* @__PURE__ */
|
|
3077
|
-
|
|
3093
|
+
} = n, { t: d } = N();
|
|
3094
|
+
return /* @__PURE__ */ E("div", { className: "big-appear step-container", children: [
|
|
3095
|
+
a && /* @__PURE__ */ m("img", { src: a, alt: l }),
|
|
3096
|
+
e != null && /* @__PURE__ */ m("h2", { className: "step-title", children: e }),
|
|
3097
|
+
s != null && /* @__PURE__ */ m("div", { className: "step-body", children: s }),
|
|
3098
|
+
t != null && /* @__PURE__ */ m("div", { className: "step-content", children: t }),
|
|
3099
|
+
/* @__PURE__ */ m("div", { className: "step-actions", children: u ? /* @__PURE__ */ E(ce, { children: [
|
|
3100
|
+
/* @__PURE__ */ m(
|
|
3101
|
+
q,
|
|
3078
3102
|
{
|
|
3079
3103
|
color: "primary",
|
|
3080
3104
|
className: "step-button",
|
|
@@ -3084,8 +3108,8 @@ const cs = (r) => {
|
|
|
3084
3108
|
children: d("_accessibility:buttons.startAsGuest")
|
|
3085
3109
|
}
|
|
3086
3110
|
),
|
|
3087
|
-
/* @__PURE__ */
|
|
3088
|
-
|
|
3111
|
+
/* @__PURE__ */ m(
|
|
3112
|
+
q,
|
|
3089
3113
|
{
|
|
3090
3114
|
color: "primary",
|
|
3091
3115
|
variant: "submit",
|
|
@@ -3095,9 +3119,9 @@ const cs = (r) => {
|
|
|
3095
3119
|
children: d("_accessibility:buttons.signIn")
|
|
3096
3120
|
}
|
|
3097
3121
|
)
|
|
3098
|
-
] }) : /* @__PURE__ */
|
|
3099
|
-
/* @__PURE__ */
|
|
3100
|
-
|
|
3122
|
+
] }) : /* @__PURE__ */ E(ce, { children: [
|
|
3123
|
+
/* @__PURE__ */ m(
|
|
3124
|
+
q,
|
|
3101
3125
|
{
|
|
3102
3126
|
color: "primary",
|
|
3103
3127
|
className: "step-button",
|
|
@@ -3107,171 +3131,256 @@ const cs = (r) => {
|
|
|
3107
3131
|
children: d("_accessibility:buttons.skip")
|
|
3108
3132
|
}
|
|
3109
3133
|
),
|
|
3110
|
-
/* @__PURE__ */
|
|
3111
|
-
|
|
3134
|
+
/* @__PURE__ */ m(
|
|
3135
|
+
q,
|
|
3112
3136
|
{
|
|
3113
3137
|
color: "primary",
|
|
3114
3138
|
className: "step-button",
|
|
3115
3139
|
variant: "outlined",
|
|
3116
|
-
onClick: () =>
|
|
3140
|
+
onClick: () => r(),
|
|
3117
3141
|
"aria-label": d("_accessibility:ariaLabels.next"),
|
|
3118
3142
|
children: d("_accessibility:buttons.next")
|
|
3119
3143
|
}
|
|
3120
3144
|
)
|
|
3121
3145
|
] }) })
|
|
3122
3146
|
] });
|
|
3123
|
-
},
|
|
3147
|
+
}, gn = (n) => {
|
|
3124
3148
|
const {
|
|
3125
3149
|
steps: e,
|
|
3126
3150
|
signInPath: s = "/auth/sign-in",
|
|
3127
3151
|
guestPath: t = "/",
|
|
3128
|
-
onSkip:
|
|
3152
|
+
onSkip: r,
|
|
3129
3153
|
onSignIn: o,
|
|
3130
3154
|
onStartAsGuest: i
|
|
3131
|
-
} =
|
|
3132
|
-
if (
|
|
3133
|
-
|
|
3155
|
+
} = n, c = je(), { navigate: a } = ie(), [l, u] = R(1), d = S(() => {
|
|
3156
|
+
if (r) {
|
|
3157
|
+
r();
|
|
3134
3158
|
return;
|
|
3135
3159
|
}
|
|
3136
3160
|
a(s);
|
|
3137
|
-
}, [a,
|
|
3161
|
+
}, [a, r, s]), h = S(() => {
|
|
3138
3162
|
if (o) {
|
|
3139
3163
|
o();
|
|
3140
3164
|
return;
|
|
3141
3165
|
}
|
|
3142
3166
|
a(s);
|
|
3143
|
-
}, [a, o, s]),
|
|
3167
|
+
}, [a, o, s]), p = S(() => {
|
|
3144
3168
|
if (i) {
|
|
3145
3169
|
i();
|
|
3146
3170
|
return;
|
|
3147
3171
|
}
|
|
3148
|
-
c(!0), a(t);
|
|
3149
|
-
}, [t, a, i
|
|
3150
|
-
id:
|
|
3172
|
+
c == null || c.setGuestMode(!0), a(t);
|
|
3173
|
+
}, [c, t, a, i]), f = B(() => e.map((b, y) => ({
|
|
3174
|
+
id: y + 1,
|
|
3151
3175
|
label: "",
|
|
3152
|
-
content: /* @__PURE__ */
|
|
3153
|
-
|
|
3176
|
+
content: /* @__PURE__ */ m(
|
|
3177
|
+
ms,
|
|
3154
3178
|
{
|
|
3155
3179
|
...b,
|
|
3156
|
-
final:
|
|
3157
|
-
onClickNext: () => u((
|
|
3180
|
+
final: y === e.length - 1,
|
|
3181
|
+
onClickNext: () => u((g) => g + 1),
|
|
3158
3182
|
onSkip: d,
|
|
3159
|
-
onStartAsGuest:
|
|
3160
|
-
onSignIn:
|
|
3183
|
+
onStartAsGuest: p,
|
|
3184
|
+
onSignIn: h
|
|
3161
3185
|
}
|
|
3162
3186
|
)
|
|
3163
|
-
})), [
|
|
3164
|
-
return /* @__PURE__ */
|
|
3165
|
-
|
|
3187
|
+
})), [h, d, p, e]);
|
|
3188
|
+
return /* @__PURE__ */ m("div", { className: "onboarding-main", children: /* @__PURE__ */ m(
|
|
3189
|
+
ds,
|
|
3166
3190
|
{
|
|
3167
3191
|
currentTab: l,
|
|
3168
3192
|
onTabChange: (b) => u(Number(b)),
|
|
3169
|
-
tabs:
|
|
3193
|
+
tabs: f,
|
|
3170
3194
|
useLinks: !1
|
|
3171
3195
|
}
|
|
3172
3196
|
) });
|
|
3173
|
-
},
|
|
3197
|
+
}, hs = (n, e) => e === "/" ? n === "/" : n.startsWith(e), fs = (n) => {
|
|
3198
|
+
const e = n.filter((s) => !s.hidden);
|
|
3199
|
+
return {
|
|
3200
|
+
leftItems: e.filter((s) => s.position !== "right"),
|
|
3201
|
+
rightItems: e.filter((s) => s.position === "right")
|
|
3202
|
+
};
|
|
3203
|
+
}, xe = ({
|
|
3204
|
+
item: n,
|
|
3205
|
+
isActive: e,
|
|
3206
|
+
linkComponent: s
|
|
3207
|
+
}) => {
|
|
3208
|
+
const o = `flex flex-col items-center justify-center gap-0.5 flex-1 py-2 transition-colors ${e ? "text-hover-primary" : "text-text-muted/60"}`.trim(), i = n.ariaLabel ?? n.label;
|
|
3209
|
+
return n.disabled ? /* @__PURE__ */ E(
|
|
3210
|
+
"span",
|
|
3211
|
+
{
|
|
3212
|
+
className: `${o} opacity-50 cursor-not-allowed`,
|
|
3213
|
+
"aria-disabled": !0,
|
|
3214
|
+
children: [
|
|
3215
|
+
/* @__PURE__ */ m("span", { className: "text-lg", children: /* @__PURE__ */ m(F, { icon: n.icon }) }),
|
|
3216
|
+
/* @__PURE__ */ m("span", { className: "text-[10px] leading-tight", children: n.label })
|
|
3217
|
+
]
|
|
3218
|
+
}
|
|
3219
|
+
) : /* @__PURE__ */ E(s, { to: n.to, className: o, "aria-label": i, children: [
|
|
3220
|
+
/* @__PURE__ */ m("span", { className: "text-lg", children: /* @__PURE__ */ m(F, { icon: n.icon }) }),
|
|
3221
|
+
/* @__PURE__ */ m("span", { className: "text-[10px] leading-tight", children: n.label })
|
|
3222
|
+
] });
|
|
3223
|
+
}, bn = (n) => {
|
|
3224
|
+
const { items: e, centerAction: s, className: t = "", isItemActive: r } = n, { location: o, navigate: i, linkComponent: c } = ie(), { leftItems: a, rightItems: l } = B(
|
|
3225
|
+
() => fs(e),
|
|
3226
|
+
[e]
|
|
3227
|
+
), {
|
|
3228
|
+
hidden: u,
|
|
3229
|
+
to: d,
|
|
3230
|
+
icon: h = Nt,
|
|
3231
|
+
ariaLabel: p = "Bottom navigation action",
|
|
3232
|
+
onClick: f,
|
|
3233
|
+
variant: b = "submit",
|
|
3234
|
+
color: y = "primary",
|
|
3235
|
+
className: g = "",
|
|
3236
|
+
...C
|
|
3237
|
+
} = s ?? {}, w = !!s && !u, k = (v) => r ? r(o.pathname, v) : hs(o.pathname, v.to);
|
|
3238
|
+
return /* @__PURE__ */ m(
|
|
3239
|
+
"nav",
|
|
3240
|
+
{
|
|
3241
|
+
className: `fixed -bottom-1 left-0 right-0 z-20 bg-base border-t border-border sm:hidden ${t}`.trim(),
|
|
3242
|
+
children: /* @__PURE__ */ E("div", { className: "flex items-center justify-around h-16", children: [
|
|
3243
|
+
a.map((v) => /* @__PURE__ */ m(
|
|
3244
|
+
xe,
|
|
3245
|
+
{
|
|
3246
|
+
item: v,
|
|
3247
|
+
isActive: k(v),
|
|
3248
|
+
linkComponent: c
|
|
3249
|
+
},
|
|
3250
|
+
v.id
|
|
3251
|
+
)),
|
|
3252
|
+
w && /* @__PURE__ */ m("div", { className: "flex items-center justify-center flex-1", children: /* @__PURE__ */ m(
|
|
3253
|
+
z,
|
|
3254
|
+
{
|
|
3255
|
+
...C,
|
|
3256
|
+
type: "button",
|
|
3257
|
+
variant: b,
|
|
3258
|
+
color: y,
|
|
3259
|
+
icon: h,
|
|
3260
|
+
name: p,
|
|
3261
|
+
"aria-label": p,
|
|
3262
|
+
onClick: (v) => {
|
|
3263
|
+
f == null || f(v), !v.defaultPrevented && d && i(d);
|
|
3264
|
+
},
|
|
3265
|
+
className: `rounded-full! w-12! h-12! min-w-0! p-0! flex items-center justify-center shadow-lg -mt-4 ${g}`.trim()
|
|
3266
|
+
}
|
|
3267
|
+
) }),
|
|
3268
|
+
l.map((v) => /* @__PURE__ */ m(
|
|
3269
|
+
xe,
|
|
3270
|
+
{
|
|
3271
|
+
item: v,
|
|
3272
|
+
isActive: k(v),
|
|
3273
|
+
linkComponent: c
|
|
3274
|
+
},
|
|
3275
|
+
v.id
|
|
3276
|
+
))
|
|
3277
|
+
] })
|
|
3278
|
+
}
|
|
3279
|
+
);
|
|
3280
|
+
}, ps = (n) => {
|
|
3174
3281
|
const {
|
|
3175
3282
|
message: e,
|
|
3176
3283
|
messageProps: s = { className: "empty-message" },
|
|
3177
3284
|
action: t,
|
|
3178
|
-
iconProps:
|
|
3179
|
-
} =
|
|
3180
|
-
return /* @__PURE__ */
|
|
3181
|
-
|
|
3182
|
-
/* @__PURE__ */
|
|
3183
|
-
t && /* @__PURE__ */
|
|
3285
|
+
iconProps: r
|
|
3286
|
+
} = n;
|
|
3287
|
+
return /* @__PURE__ */ E("div", { className: "empty-container", children: [
|
|
3288
|
+
r && /* @__PURE__ */ m(F, { ...r }),
|
|
3289
|
+
/* @__PURE__ */ m("p", { ...s, children: e }),
|
|
3290
|
+
t && /* @__PURE__ */ m(dt, { showTooltips: !1, showText: !0, ...t })
|
|
3184
3291
|
] });
|
|
3185
3292
|
};
|
|
3186
3293
|
export {
|
|
3187
3294
|
de as APIClient,
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3295
|
+
Cn as Action,
|
|
3296
|
+
vn as Actions,
|
|
3297
|
+
Tn as ActionsDropdown,
|
|
3191
3298
|
z as AppIconButton,
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
ye as
|
|
3201
|
-
|
|
3299
|
+
Ut as AuthClient,
|
|
3300
|
+
me as AuthContext,
|
|
3301
|
+
Bs as AuthProvider,
|
|
3302
|
+
_s as BaseClient,
|
|
3303
|
+
bn as BottomNavigation,
|
|
3304
|
+
kn as Button,
|
|
3305
|
+
Gs as ConfigProvider,
|
|
3306
|
+
Ls as ConfirmationDialog,
|
|
3307
|
+
ye as Dialog,
|
|
3308
|
+
we as DialogActions,
|
|
3309
|
+
Ys as Drawer,
|
|
3202
3310
|
qe as DrawerMenuContext,
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3311
|
+
Js as DrawerMenuProvider,
|
|
3312
|
+
ps as Empty,
|
|
3313
|
+
ln as Error,
|
|
3314
|
+
xs as FormContainer,
|
|
3315
|
+
Ds as FormDialog,
|
|
3208
3316
|
J as GlobalActions,
|
|
3209
|
-
|
|
3317
|
+
Is as IManager,
|
|
3210
3318
|
z as IconButton,
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3319
|
+
Rs as ImportDialog,
|
|
3320
|
+
Ps as IndexedDBClient,
|
|
3321
|
+
qs as ManagerProvider,
|
|
3214
3322
|
P as Methods,
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3323
|
+
hn as Navbar,
|
|
3324
|
+
ze as NavbarContext,
|
|
3325
|
+
mn as NavbarProvider,
|
|
3326
|
+
fn as Notification,
|
|
3219
3327
|
O as NotificationEnumType,
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3328
|
+
Qs as NotificationProvider,
|
|
3329
|
+
gn as Onboarding,
|
|
3330
|
+
un as Page,
|
|
3331
|
+
As as ParagraphInput,
|
|
3332
|
+
$s as PasswordInput,
|
|
3333
|
+
dn as PrettyGrid,
|
|
3334
|
+
pn as SplashScreen,
|
|
3335
|
+
ms as Step,
|
|
3336
|
+
Ws as SupabaseAuthProvider,
|
|
3337
|
+
Ms as SupabaseDataClient,
|
|
3338
|
+
Qe as SupabaseManagerContext,
|
|
3339
|
+
zs as SupabaseManagerProvider,
|
|
3340
|
+
us as Tab,
|
|
3341
|
+
ds as TabsLayout,
|
|
3342
|
+
cn as ToTop,
|
|
3343
|
+
Ot as buildQueryUrl,
|
|
3344
|
+
ve as createQueryClient,
|
|
3345
|
+
Os as enumToKeyValueArray,
|
|
3346
|
+
Ks as formatForDatetimeLocal,
|
|
3347
|
+
W as fromLocal,
|
|
3348
|
+
Fs as getFormattedDateTime,
|
|
3349
|
+
Us as getShortFormattedDateTime,
|
|
3350
|
+
Ce as isHttpError,
|
|
3351
|
+
Vt as isMac,
|
|
3352
|
+
Se as isValidationError,
|
|
3353
|
+
he as makeRequest,
|
|
3354
|
+
Ee as mapSupabaseSessionToSessionDto,
|
|
3355
|
+
js as mapValidationErrors,
|
|
3356
|
+
Fe as parseQueries,
|
|
3357
|
+
Hs as queryClient,
|
|
3250
3358
|
I as removeFromLocal,
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3359
|
+
H as toLocal,
|
|
3360
|
+
Vs as useAuth,
|
|
3361
|
+
zt as useAuthContext,
|
|
3362
|
+
ie as useConfig,
|
|
3363
|
+
Be as useConfirmationForm,
|
|
3364
|
+
es as useDeleteAction,
|
|
3365
|
+
tn as useDeleteDialog,
|
|
3366
|
+
Ve as useDialog,
|
|
3367
|
+
Yt as useDrawerMenu,
|
|
3368
|
+
en as useEditAction,
|
|
3369
|
+
ss as useExportAction,
|
|
3370
|
+
an as useExportActionMutate,
|
|
3371
|
+
We as useFormDialog,
|
|
3372
|
+
ns as useImportAction,
|
|
3373
|
+
on as useImportDialog,
|
|
3374
|
+
Wt as useManager,
|
|
3375
|
+
is as useNavbar,
|
|
3268
3376
|
oe as useNotification,
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3377
|
+
je as useOptionalAuthContext,
|
|
3378
|
+
sn as usePostDialog,
|
|
3379
|
+
Zs as usePostForm,
|
|
3380
|
+
nn as usePutDialog,
|
|
3381
|
+
ts as useRestoreAction,
|
|
3382
|
+
rn as useRestoreDialog,
|
|
3383
|
+
rs as useScrollTrigger,
|
|
3275
3384
|
Gt as useSupabase,
|
|
3276
|
-
|
|
3385
|
+
Xs as useTimeAge
|
|
3277
3386
|
};
|