@sito/dashboard-app 0.0.58 → 0.0.60
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 +99 -5
- 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 +1162 -1030
- 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 +9 -0
- package/dist/providers/BottomNavAction/BottomNavActionContext.d.ts +6 -0
- package/dist/providers/BottomNavAction/BottomNavActionProvider.d.ts +2 -0
- package/dist/providers/BottomNavAction/index.d.ts +3 -0
- package/dist/providers/BottomNavAction/useBottomNavAction.d.ts +15 -0
- package/dist/providers/NotificationProvider.d.ts +5 -0
- package/dist/providers/Supbase/SupabaseContext.d.ts +5 -0
- package/dist/providers/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/dashboard-app.js
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var A = (
|
|
1
|
+
var et = Object.defineProperty;
|
|
2
|
+
var tt = (n, e, s) => e in n ? et(n, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[e] = s;
|
|
3
|
+
var A = (n, e, s) => tt(n, typeof e != "symbol" ? e + "" : e, s);
|
|
4
4
|
import "./main.css";
|
|
5
|
-
import { State as
|
|
5
|
+
import { State as st, inputStateClassName as nt, labelStateClassName as rt, helperTextStateClassName as ot, useTranslation as E, Button as V, Loading as ne, TextInput as it, FileInput as at, IconButton as ct, Actions as lt, ActionsDropdown as ut, useTableOptions as dt, Badge as mt, Action as ht } from "@sito/dashboard";
|
|
6
6
|
export * from "@sito/dashboard";
|
|
7
|
-
import { Action as
|
|
8
|
-
import { jsxs as
|
|
9
|
-
import { FontAwesomeIcon as
|
|
10
|
-
import { forwardRef as
|
|
11
|
-
import { faEyeSlash as
|
|
12
|
-
import { createPortal as
|
|
13
|
-
import { faSadTear as
|
|
14
|
-
import { QueryClient as
|
|
15
|
-
import { useForm as
|
|
16
|
-
const
|
|
7
|
+
import { Action as An, Actions as xn, ActionsDropdown as $n, Button as Dn } from "@sito/dashboard";
|
|
8
|
+
import { jsxs as N, jsx as m, Fragment as ce } from "react/jsx-runtime";
|
|
9
|
+
import { FontAwesomeIcon as U } from "@fortawesome/react-fontawesome";
|
|
10
|
+
import { forwardRef as $e, useState as D, useCallback as v, useEffect as P, useReducer as De, useRef as K, useMemo as q, createContext as X, useContext as G, useLayoutEffect as ft } from "react";
|
|
11
|
+
import { faEyeSlash as pt, faEye as gt, faClose as Le, faTrash as bt, faRotateLeft as Re, faPencil as yt, faCircleNotch as Ie, faCloudArrowDown as wt, faCloudUpload as St, faArrowUp as vt, faArrowLeft as Ct, faAdd as Te, faFilter as Tt, faBars as Nt, faSearch as kt, faCircleCheck as Et, faWarning as At, faPlus as xt } from "@fortawesome/free-solid-svg-icons";
|
|
12
|
+
import { createPortal as _e } from "react-dom";
|
|
13
|
+
import { faSadTear as $t } from "@fortawesome/free-regular-svg-icons";
|
|
14
|
+
import { QueryClient as Dt, QueryClientProvider as Pe, useMutation as re, useQueryClient as Z, useQuery as Lt } from "@tanstack/react-query";
|
|
15
|
+
import { useForm as Oe } from "react-hook-form";
|
|
16
|
+
const Ne = (n) => n == null ? !1 : `${n}`.length > 0, Ls = $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 = st.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:
|
|
28
|
+
inputClassName: h = "",
|
|
29
29
|
labelClassName: f = "",
|
|
30
30
|
helperText: p = "",
|
|
31
31
|
helperTextClassName: b = "",
|
|
32
32
|
...y
|
|
33
|
-
} =
|
|
34
|
-
() =>
|
|
35
|
-
),
|
|
36
|
-
g || w(
|
|
33
|
+
} = n, g = s !== void 0, [C, w] = D(
|
|
34
|
+
() => Ne(t)
|
|
35
|
+
), T = g ? Ne(s) : C, k = (O) => {
|
|
36
|
+
g || w(O.currentTarget.value.length > 0), r == null || r(O);
|
|
37
37
|
};
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ N("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 ${nt(o)} ${T ? "has-value" : ""} ${y.placeholder ? "has-placeholder" : ""} ${h}`,
|
|
46
46
|
required: u,
|
|
47
47
|
defaultValue: t,
|
|
48
48
|
...g ? { value: s } : {},
|
|
49
|
-
onChange:
|
|
49
|
+
onChange: k,
|
|
50
50
|
disabled: l,
|
|
51
51
|
...y
|
|
52
52
|
}
|
|
53
53
|
),
|
|
54
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ N(
|
|
55
55
|
"label",
|
|
56
56
|
{
|
|
57
57
|
htmlFor: c,
|
|
58
|
-
className: `text-input-label ${
|
|
58
|
+
className: `text-input-label ${rt(o)} ${f}`,
|
|
59
59
|
children: [
|
|
60
60
|
a,
|
|
61
61
|
u ? " *" : ""
|
|
62
62
|
]
|
|
63
63
|
}
|
|
64
64
|
),
|
|
65
|
-
!!p && /* @__PURE__ */
|
|
65
|
+
!!p && /* @__PURE__ */ m(
|
|
66
66
|
"p",
|
|
67
67
|
{
|
|
68
|
-
className: `text-input-helper-text ${
|
|
68
|
+
className: `text-input-helper-text ${ot(o)} ${b}`,
|
|
69
69
|
children: p
|
|
70
70
|
}
|
|
71
71
|
)
|
|
72
72
|
] });
|
|
73
|
-
}),
|
|
74
|
-
const { t: e } =
|
|
73
|
+
}), Rs = (n) => {
|
|
74
|
+
const { t: e } = E(), {
|
|
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__ */ N("form", { className: "form-container", onSubmit: t(r), children: [
|
|
83
83
|
s,
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
|
|
84
|
+
/* @__PURE__ */ N("div", { className: `form-actions ${i ? "end" : ""}`, children: [
|
|
85
|
+
/* @__PURE__ */ N(
|
|
86
|
+
V,
|
|
87
87
|
{
|
|
88
88
|
type: "submit",
|
|
89
89
|
color: "primary",
|
|
@@ -92,8 +92,8 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(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 = xe(function(r, e) {
|
|
|
104
104
|
]
|
|
105
105
|
}
|
|
106
106
|
),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
|
|
107
|
+
/* @__PURE__ */ m(
|
|
108
|
+
V,
|
|
109
109
|
{
|
|
110
110
|
type: "button",
|
|
111
111
|
variant: "outlined",
|
|
@@ -117,10 +117,10 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(function(r, e) {
|
|
|
117
117
|
)
|
|
118
118
|
] })
|
|
119
119
|
] });
|
|
120
|
-
},
|
|
121
|
-
const { t: s } =
|
|
122
|
-
return /* @__PURE__ */
|
|
123
|
-
|
|
120
|
+
}, Is = $e(function(n, e) {
|
|
121
|
+
const { t: s } = E(), [t, r] = D(!1);
|
|
122
|
+
return /* @__PURE__ */ m(it, { ...n, type: t ? "text" : "password", ref: e, children: /* @__PURE__ */ m(
|
|
123
|
+
W,
|
|
124
124
|
{
|
|
125
125
|
type: "button",
|
|
126
126
|
tabIndex: -1,
|
|
@@ -128,63 +128,63 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(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 ? pt : gt
|
|
133
133
|
}
|
|
134
134
|
) });
|
|
135
|
-
}), ye = (
|
|
136
|
-
const { t: e } =
|
|
135
|
+
}), ye = (n) => {
|
|
136
|
+
const { t: e } = E(), {
|
|
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 = v(
|
|
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
|
+
P(() => (window.addEventListener("keydown", l), () => {
|
|
151
151
|
window.removeEventListener("keydown", l);
|
|
152
152
|
}), [l]);
|
|
153
|
-
const u =
|
|
153
|
+
const u = v(
|
|
154
154
|
(d) => {
|
|
155
|
-
d.target === d.currentTarget &&
|
|
155
|
+
d.target === d.currentTarget && r();
|
|
156
156
|
},
|
|
157
|
-
[
|
|
157
|
+
[r]
|
|
158
158
|
);
|
|
159
|
-
return
|
|
160
|
-
const d = (
|
|
161
|
-
|
|
159
|
+
return P(() => {
|
|
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__ */ N(
|
|
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__ */
|
|
182
|
-
|
|
179
|
+
/* @__PURE__ */ N("div", { className: "dialog-header", children: [
|
|
180
|
+
/* @__PURE__ */ m("h3", { className: "dialog-title", children: s }),
|
|
181
|
+
/* @__PURE__ */ m(
|
|
182
|
+
W,
|
|
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 = xe(function(r, e) {
|
|
|
201
201
|
),
|
|
202
202
|
document.body
|
|
203
203
|
);
|
|
204
|
-
}, we = (
|
|
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 = xe(function(r, e) {
|
|
|
214
214
|
primaryClassName: l = "",
|
|
215
215
|
alignEnd: u = !1,
|
|
216
216
|
primaryName: d,
|
|
217
|
-
primaryAriaLabel:
|
|
217
|
+
primaryAriaLabel: h,
|
|
218
218
|
cancelName: f,
|
|
219
219
|
cancelAriaLabel: p,
|
|
220
220
|
extraActions: b = []
|
|
221
|
-
} =
|
|
222
|
-
return /* @__PURE__ */
|
|
221
|
+
} = n;
|
|
222
|
+
return /* @__PURE__ */ N(
|
|
223
223
|
"div",
|
|
224
224
|
{
|
|
225
225
|
className: `dialog-actions ${u ? "end" : ""} ${a}`,
|
|
226
226
|
children: [
|
|
227
|
-
/* @__PURE__ */
|
|
228
|
-
|
|
227
|
+
/* @__PURE__ */ N(
|
|
228
|
+
V,
|
|
229
229
|
{
|
|
230
230
|
type: c,
|
|
231
231
|
color: "primary",
|
|
@@ -234,10 +234,10 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(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,14 +248,14 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(function(r, e) {
|
|
|
248
248
|
]
|
|
249
249
|
}
|
|
250
250
|
),
|
|
251
|
-
b == null ? void 0 : b.map((y) => /* @__PURE__ */
|
|
252
|
-
/* @__PURE__ */
|
|
253
|
-
|
|
251
|
+
b == null ? void 0 : b.map((y) => /* @__PURE__ */ m(V, { ...y }, y.id)),
|
|
252
|
+
/* @__PURE__ */ m(
|
|
253
|
+
V,
|
|
254
254
|
{
|
|
255
255
|
type: "button",
|
|
256
256
|
variant: "outlined",
|
|
257
257
|
disabled: i,
|
|
258
|
-
onClick:
|
|
258
|
+
onClick: r,
|
|
259
259
|
name: f,
|
|
260
260
|
"aria-label": p,
|
|
261
261
|
children: s
|
|
@@ -264,20 +264,20 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(function(r, e) {
|
|
|
264
264
|
]
|
|
265
265
|
}
|
|
266
266
|
);
|
|
267
|
-
},
|
|
268
|
-
const { t: e } =
|
|
267
|
+
}, _s = (n) => {
|
|
268
|
+
const { t: e } = E(), {
|
|
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__ */
|
|
277
|
+
} = n;
|
|
278
|
+
return /* @__PURE__ */ m(ye, { ...l, handleClose: o, children: /* @__PURE__ */ N("form", { onSubmit: t(r), children: [
|
|
279
|
+
/* @__PURE__ */ m("div", { className: "form-container", children: s }),
|
|
280
|
+
/* @__PURE__ */ m(
|
|
281
281
|
we,
|
|
282
282
|
{
|
|
283
283
|
primaryType: "submit",
|
|
@@ -296,24 +296,24 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(function(r, e) {
|
|
|
296
296
|
}
|
|
297
297
|
)
|
|
298
298
|
] }) });
|
|
299
|
-
},
|
|
300
|
-
const { t: e } =
|
|
299
|
+
}, Ps = (n) => {
|
|
300
|
+
const { t: e } = E(), {
|
|
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__ */ N(ye, { ...c, handleClose: r, children: [
|
|
309
309
|
s,
|
|
310
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ m(
|
|
311
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,31 +327,31 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(function(r, e) {
|
|
|
327
327
|
)
|
|
328
328
|
] });
|
|
329
329
|
};
|
|
330
|
-
function
|
|
331
|
-
const { message: e, className: s = "" } =
|
|
332
|
-
return /* @__PURE__ */
|
|
330
|
+
function Rt(n) {
|
|
331
|
+
const { message: e, className: s = "" } = n, { t } = E();
|
|
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 It(n) {
|
|
337
|
+
const { message: e, className: s = "" } = n, { t } = E();
|
|
338
|
+
return /* @__PURE__ */ N("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 _t(n) {
|
|
346
|
+
const { items: e, max: s = 5, className: t = "" } = n, { t: r } = E();
|
|
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__ */ N("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
357
|
const Me = () => ({
|
|
@@ -362,43 +362,43 @@ const Me = () => ({
|
|
|
362
362
|
overrideExisting: !1,
|
|
363
363
|
inputKey: 0
|
|
364
364
|
});
|
|
365
|
-
function
|
|
365
|
+
function Pt(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 { ...Me(), inputKey:
|
|
394
|
+
return { ...Me(), inputKey: n.inputKey + 1 };
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
const
|
|
398
|
-
const { t: e } =
|
|
397
|
+
const Os = (n) => {
|
|
398
|
+
const { t: e } = E(), {
|
|
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,84 +406,84 @@ const xs = (r) => {
|
|
|
406
406
|
onOverrideChange: l,
|
|
407
407
|
open: u,
|
|
408
408
|
extraActions: d = [],
|
|
409
|
-
...
|
|
410
|
-
} =
|
|
411
|
-
|
|
409
|
+
...h
|
|
410
|
+
} = n, [f, p] = De(
|
|
411
|
+
Pt,
|
|
412
412
|
Me()
|
|
413
413
|
), {
|
|
414
414
|
file: b,
|
|
415
415
|
previewItems: y,
|
|
416
416
|
parseError: g,
|
|
417
|
-
processing:
|
|
417
|
+
processing: C,
|
|
418
418
|
overrideExisting: w,
|
|
419
|
-
inputKey:
|
|
420
|
-
} = f,
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
}, [c]),
|
|
424
|
-
|
|
425
|
-
}, [i]),
|
|
419
|
+
inputKey: T
|
|
420
|
+
} = f, k = K(c), O = K(i);
|
|
421
|
+
P(() => {
|
|
422
|
+
k.current = c;
|
|
423
|
+
}, [c]), P(() => {
|
|
424
|
+
O.current = i;
|
|
425
|
+
}, [i]), P(() => {
|
|
426
426
|
u || p({ type: "RESET" });
|
|
427
427
|
}, [u]);
|
|
428
|
-
const
|
|
429
|
-
async (
|
|
430
|
-
var
|
|
431
|
-
if (
|
|
428
|
+
const j = v(
|
|
429
|
+
async (S, L) => {
|
|
430
|
+
var R;
|
|
431
|
+
if (O.current) {
|
|
432
432
|
p({ type: "START_PROCESSING" });
|
|
433
433
|
try {
|
|
434
|
-
const _ = await
|
|
435
|
-
p({ type: "SET_PREVIEW", items: _ ?? [] }), (
|
|
434
|
+
const _ = await O.current(S, { override: L });
|
|
435
|
+
p({ type: "SET_PREVIEW", items: _ ?? [] }), (R = k.current) == null || R.call(k, _ ?? []);
|
|
436
436
|
} catch (_) {
|
|
437
437
|
console.error(_);
|
|
438
|
-
const
|
|
439
|
-
p({ type: "SET_ERROR", message:
|
|
438
|
+
const Q = _ instanceof Error ? _.message : "Failed to parse file";
|
|
439
|
+
p({ type: "SET_ERROR", message: Q });
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
442
|
},
|
|
443
443
|
[]
|
|
444
444
|
);
|
|
445
|
-
return /* @__PURE__ */
|
|
446
|
-
/* @__PURE__ */
|
|
447
|
-
|
|
445
|
+
return /* @__PURE__ */ N(ye, { ...h, open: u, handleClose: r, children: [
|
|
446
|
+
/* @__PURE__ */ m(
|
|
447
|
+
at,
|
|
448
448
|
{
|
|
449
449
|
onClear: () => {
|
|
450
|
-
var
|
|
451
|
-
p({ type: "SET_FILE", file: null }), (
|
|
450
|
+
var S;
|
|
451
|
+
p({ type: "SET_FILE", file: null }), (S = k.current) == null || S.call(k, []);
|
|
452
452
|
},
|
|
453
|
-
onChange: (
|
|
454
|
-
var
|
|
455
|
-
const
|
|
456
|
-
if (!
|
|
457
|
-
p({ type: "SET_FILE", file: null }), (_ =
|
|
453
|
+
onChange: (S) => {
|
|
454
|
+
var R, _;
|
|
455
|
+
const L = (R = S.target.files) == null ? void 0 : R[0];
|
|
456
|
+
if (!L) {
|
|
457
|
+
p({ type: "SET_FILE", file: null }), (_ = k.current) == null || _.call(k, []);
|
|
458
458
|
return;
|
|
459
459
|
}
|
|
460
|
-
p({ type: "SET_FILE", file:
|
|
460
|
+
p({ type: "SET_FILE", file: L }), j(L, w);
|
|
461
461
|
},
|
|
462
462
|
label: e("_accessibility:labels.file")
|
|
463
463
|
},
|
|
464
|
-
|
|
464
|
+
T
|
|
465
465
|
),
|
|
466
|
-
/* @__PURE__ */
|
|
467
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ N("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
|
|
474
|
-
p({ type: "SET_OVERRIDE", value:
|
|
472
|
+
onChange: (S) => {
|
|
473
|
+
const L = S.target.checked;
|
|
474
|
+
p({ type: "SET_OVERRIDE", value: L }), l == null || l(L), b && j(b, L);
|
|
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(y) : !!y && y.length > 0 && /* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ m(Rt, { message: g }),
|
|
483
|
+
C && /* @__PURE__ */ m(It, {}),
|
|
484
|
+
a ? a(y) : !!y && y.length > 0 && /* @__PURE__ */ m(_t, { items: y }),
|
|
485
485
|
s,
|
|
486
|
-
/* @__PURE__ */
|
|
486
|
+
/* @__PURE__ */ m(
|
|
487
487
|
we,
|
|
488
488
|
{
|
|
489
489
|
primaryText: e("_accessibility:buttons.ok"),
|
|
@@ -491,7 +491,7 @@ const xs = (r) => {
|
|
|
491
491
|
onPrimaryClick: () => {
|
|
492
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 xs = (r) => {
|
|
|
504
504
|
)
|
|
505
505
|
] });
|
|
506
506
|
};
|
|
507
|
-
var
|
|
508
|
-
const
|
|
509
|
-
async function he(
|
|
510
|
-
const
|
|
507
|
+
var F = /* @__PURE__ */ ((n) => (n[n.success = 0] = "success", n[n.error = 1] = "error", n[n.warning = 2] = "warning", n[n.info = 3] = "info", n))(F || {}), M = /* @__PURE__ */ ((n) => (n.GET = "GET", n.POST = "POST", n.PUT = "PUT", n.PATCH = "PATCH", n.DELETE = "DELETE", n))(M || {});
|
|
508
|
+
const Ot = (n) => Array.isArray(n) || n instanceof Headers ? !1 : typeof n == "object" && n !== null && ("headers" in n || "credentials" in n), Mt = (n) => n ? Ot(n) ? n : { headers: n } : {}, Ft = (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 = Mt(t), o = {
|
|
511
511
|
...s !== void 0 ? { "Content-Type": "application/json" } : {},
|
|
512
|
-
...
|
|
512
|
+
...Ft(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 he(r, e = "GET", s, t) {
|
|
|
551
551
|
};
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function Ut(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 fe = (
|
|
565
|
-
if (typeof
|
|
566
|
-
const e =
|
|
564
|
+
const fe = (n) => typeof n == "object" && n !== null, J = (n) => n instanceof Date ? encodeURIComponent(n.toISOString()) : encodeURIComponent(String(n)), Kt = (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 = Kt(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}==${
|
|
582
|
+
return c.map((a) => a instanceof Date ? `${i}==${J(a)}` : fe(a) ? `${i}==${J(a.id ?? "")}` : `${i}==${J(a)}`);
|
|
583
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}>=${J(c.start)}`), c.end != null && c.end !== "" && a.push(`${i}<=${J(c.end)}`), a;
|
|
586
586
|
}
|
|
587
|
-
return c instanceof Date ? `${i}==${
|
|
587
|
+
return c instanceof Date ? `${i}==${J(c)}` : fe(c) ? `${i}==${J(c.id ?? "")}` : `${i}==${J(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,7 +596,7 @@ const fe = (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,
|
|
599
|
+
constructor(e, s = "user", t = !0, r, o = {}) {
|
|
600
600
|
A(this, "baseUrl");
|
|
601
601
|
A(this, "userKey");
|
|
602
602
|
A(this, "rememberKey");
|
|
@@ -606,11 +606,11 @@ const fe = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
|
|
|
606
606
|
A(this, "refreshExpirySkewMs");
|
|
607
607
|
A(this, "secured");
|
|
608
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 =
|
|
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 = z(this.userKey);
|
|
614
614
|
if (s && s.length) return { Authorization: `Bearer ${s}` };
|
|
615
615
|
}
|
|
616
616
|
getRefreshLockKey() {
|
|
@@ -621,12 +621,12 @@ const fe = (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 = z(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 = z(this.accessTokenExpiresAtKey);
|
|
630
630
|
if (typeof e == "string" && e.length)
|
|
631
631
|
return e;
|
|
632
632
|
}
|
|
@@ -643,9 +643,9 @@ const fe = (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,10 +659,10 @@ const fe = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
|
|
|
659
659
|
await t;
|
|
660
660
|
return;
|
|
661
661
|
}
|
|
662
|
-
const
|
|
662
|
+
const r = (async () => {
|
|
663
663
|
const { data: o, status: i, error: c } = await he(
|
|
664
664
|
this.buildUrl(this.refreshEndpoint),
|
|
665
|
-
|
|
665
|
+
M.POST,
|
|
666
666
|
{ refreshToken: e }
|
|
667
667
|
);
|
|
668
668
|
if (c || !(o != null && o.token))
|
|
@@ -672,9 +672,9 @@ const fe = (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 fe = (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
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
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 =
|
|
715
|
+
async doQuery(e, s = M.GET, t, r) {
|
|
716
716
|
const {
|
|
717
717
|
data: o,
|
|
718
718
|
status: i,
|
|
@@ -721,7 +721,7 @@ const fe = (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,13 +737,13 @@ const fe = (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
|
-
|
|
746
|
-
|
|
745
|
+
r,
|
|
746
|
+
M.GET
|
|
747
747
|
);
|
|
748
748
|
if (i || c < 200 || c >= 300 || !o)
|
|
749
749
|
throw i ?? {
|
|
@@ -761,19 +761,19 @@ const fe = (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
|
+
M.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 fe = (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
|
+
M.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,24 +806,29 @@ const fe = (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
|
+
M.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 jt {
|
|
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);
|
|
@@ -832,48 +837,53 @@ class Ot {
|
|
|
832
837
|
const s = "auth/sign-in", t = e;
|
|
833
838
|
return await this.api.doQuery(
|
|
834
839
|
s,
|
|
835
|
-
|
|
840
|
+
M.POST,
|
|
836
841
|
t
|
|
837
842
|
);
|
|
838
843
|
}
|
|
839
844
|
async refresh(e) {
|
|
840
845
|
return await this.api.doQuery(
|
|
841
846
|
"auth/refresh",
|
|
842
|
-
|
|
847
|
+
M.POST,
|
|
843
848
|
e
|
|
844
849
|
);
|
|
845
850
|
}
|
|
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
|
-
|
|
853
|
-
|
|
857
|
+
M.POST,
|
|
858
|
+
r,
|
|
854
859
|
t
|
|
855
860
|
);
|
|
856
861
|
}
|
|
857
862
|
async register(e) {
|
|
858
863
|
return await this.api.doQuery(
|
|
859
864
|
"auth/sign-up",
|
|
860
|
-
|
|
865
|
+
M.POST,
|
|
861
866
|
e
|
|
862
867
|
);
|
|
863
868
|
}
|
|
864
869
|
async getSession() {
|
|
865
870
|
return await this.api.doQuery(
|
|
866
871
|
"auth/session",
|
|
867
|
-
|
|
872
|
+
M.GET,
|
|
868
873
|
void 0,
|
|
869
874
|
this.api.defaultTokenAcquirer()
|
|
870
875
|
);
|
|
871
876
|
}
|
|
872
877
|
}
|
|
873
|
-
class
|
|
878
|
+
class Ms {
|
|
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
885
|
A(this, "auth");
|
|
876
|
-
this.auth = new
|
|
886
|
+
this.auth = new jt(e, s, t);
|
|
877
887
|
}
|
|
878
888
|
/**
|
|
879
889
|
* @returns auth
|
|
@@ -882,17 +892,19 @@ class $s {
|
|
|
882
892
|
return this.auth;
|
|
883
893
|
}
|
|
884
894
|
}
|
|
885
|
-
class
|
|
895
|
+
class Fs {
|
|
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",
|
|
903
|
+
constructor(e, s, t = "user", r = !0, o = {}) {
|
|
892
904
|
A(this, "table");
|
|
893
905
|
A(this, "secured");
|
|
894
906
|
A(this, "api");
|
|
895
|
-
this.table = e, this.secured =
|
|
907
|
+
this.table = e, this.secured = r, this.api = new de(s, t, r, void 0, o);
|
|
896
908
|
}
|
|
897
909
|
/**
|
|
898
910
|
*
|
|
@@ -910,7 +922,7 @@ class Ds {
|
|
|
910
922
|
async insertMany(e) {
|
|
911
923
|
return await this.api.doQuery(
|
|
912
924
|
`${this.table}/batch`,
|
|
913
|
-
|
|
925
|
+
M.POST,
|
|
914
926
|
e
|
|
915
927
|
);
|
|
916
928
|
}
|
|
@@ -940,12 +952,12 @@ 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
|
|
947
959
|
);
|
|
948
|
-
return await this.api.doQuery(s,
|
|
960
|
+
return await this.api.doQuery(s, M.GET, void 0);
|
|
949
961
|
}
|
|
950
962
|
/**
|
|
951
963
|
*
|
|
@@ -955,7 +967,7 @@ class Ds {
|
|
|
955
967
|
async import(e) {
|
|
956
968
|
return await this.api.doQuery(
|
|
957
969
|
`${this.table}/import`,
|
|
958
|
-
|
|
970
|
+
M.POST,
|
|
959
971
|
e
|
|
960
972
|
);
|
|
961
973
|
}
|
|
@@ -966,8 +978,8 @@ class Ds {
|
|
|
966
978
|
*/
|
|
967
979
|
async commonGet(e) {
|
|
968
980
|
return await this.api.doQuery(
|
|
969
|
-
|
|
970
|
-
|
|
981
|
+
Ut(`${this.table}/common`, e),
|
|
982
|
+
M.GET
|
|
971
983
|
);
|
|
972
984
|
}
|
|
973
985
|
/**
|
|
@@ -985,7 +997,12 @@ class Ds {
|
|
|
985
997
|
return await this.api.patch(`${this.table}/restore`, e);
|
|
986
998
|
}
|
|
987
999
|
}
|
|
988
|
-
class
|
|
1000
|
+
class Us {
|
|
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
1007
|
A(this, "table");
|
|
991
1008
|
A(this, "dbName");
|
|
@@ -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
1061
|
var f;
|
|
1045
|
-
const t = await this.transaction("readonly"),
|
|
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 = ((f = e == null ? void 0 : e.sortingOrder) == null ? void 0 : f.toLowerCase()) ?? "asc";
|
|
1046
1063
|
o.sort((p, b) => {
|
|
1047
1064
|
const y = p[i], g = b[i];
|
|
1048
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,14 +1160,19 @@ class Ls {
|
|
|
1143
1160
|
return e === "DELETED" ? t : !t;
|
|
1144
1161
|
}
|
|
1145
1162
|
}
|
|
1146
|
-
const be = (
|
|
1147
|
-
if (typeof
|
|
1148
|
-
const e =
|
|
1163
|
+
const be = (n) => typeof n == "object" && n !== null, Qt = (n) => be(n) ? "start" in n || "end" in n : !1, Bt = (n) => n !== void 0, ae = (n) => n instanceof Date ? n.toISOString() : n, Ht = (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 Ks {
|
|
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
1177
|
A(this, "table");
|
|
1156
1178
|
A(this, "supabase");
|
|
@@ -1163,14 +1185,14 @@ class Rs {
|
|
|
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 = Ht(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() : be(l) ? this.resolveObjectFilterValue(l) :
|
|
1224
|
+
const a = i.map((l) => l instanceof Date ? l.toISOString() : be(l) ? this.resolveObjectFilterValue(l) : ae(l)).filter(Bt);
|
|
1203
1225
|
a.length > 0 && (t = t.in(c, a));
|
|
1204
1226
|
return;
|
|
1205
1227
|
}
|
|
1206
|
-
if (
|
|
1228
|
+
if (Qt(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
|
}
|
|
@@ -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((f) => this.toDto(f)),
|
|
1316
|
+
const d = (u.data ?? []).map((f) => this.toDto(f)), 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 qt = (n) => typeof n == "object" && n !== null, Vt = (n, e) => {
|
|
1402
|
+
if (qt(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
|
+
}, zt = (n, e) => {
|
|
1409
|
+
if (!n) return e;
|
|
1410
|
+
const s = Number(n);
|
|
1389
1411
|
return Number.isFinite(s) ? s : e;
|
|
1390
|
-
}, ke = (
|
|
1412
|
+
}, ke = (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 = Vt(
|
|
1419
|
+
n.user.user_metadata,
|
|
1398
1420
|
o
|
|
1399
1421
|
);
|
|
1400
1422
|
return {
|
|
1401
|
-
id:
|
|
1423
|
+
id: zt(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 js(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 z = (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 Qs(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 Bs(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 Hs(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 Wt = () => {
|
|
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 Se(
|
|
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 ve(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 qs(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
|
-
(
|
|
1508
|
+
function Vs(n) {
|
|
1509
|
+
const { children: e } = n, s = K(0), [t, r] = De(
|
|
1510
|
+
(h, f) => {
|
|
1489
1511
|
const { type: p, items: b, id: y } = f;
|
|
1490
1512
|
switch (p) {
|
|
1491
1513
|
case "set":
|
|
1492
1514
|
return b ?? [];
|
|
1493
1515
|
case "remove":
|
|
1494
|
-
return y !== void 0 ?
|
|
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((f) => ({ ...f, id: s.current++ })), i = v(
|
|
1523
|
+
(h) => r({
|
|
1502
1524
|
type: "set",
|
|
1503
|
-
items: o([{ ...
|
|
1525
|
+
items: o([{ ...h, type: F.error }])
|
|
1504
1526
|
}),
|
|
1505
1527
|
[]
|
|
1506
|
-
), c =
|
|
1507
|
-
(
|
|
1528
|
+
), c = v(
|
|
1529
|
+
(h) => r({ type: "set", items: o([{ ...h }]) }),
|
|
1508
1530
|
[]
|
|
1509
|
-
), a =
|
|
1510
|
-
(
|
|
1531
|
+
), a = v(
|
|
1532
|
+
(h) => r({ type: "set", items: o(h) }),
|
|
1511
1533
|
[]
|
|
1512
|
-
), l =
|
|
1513
|
-
(
|
|
1534
|
+
), l = v(
|
|
1535
|
+
(h) => r({
|
|
1514
1536
|
type: "set",
|
|
1515
|
-
items: o([{ ...
|
|
1537
|
+
items: o([{ ...h, type: F.success }])
|
|
1516
1538
|
}),
|
|
1517
1539
|
[]
|
|
1518
|
-
), u = (
|
|
1540
|
+
), u = (h) => r({ type: "remove", id: h }), d = q(() => ({
|
|
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 = G(Ue);
|
|
1558
|
+
if (!n)
|
|
1537
1559
|
throw new Error("NotificationContext must be used within a Provider");
|
|
1538
|
-
return
|
|
1539
|
-
}, Ce = () => new
|
|
1560
|
+
return n;
|
|
1561
|
+
}, Ce = () => new Dt({
|
|
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
|
+
}), zs = Ce(), Ke = X(
|
|
1552
1574
|
void 0
|
|
1553
|
-
),
|
|
1554
|
-
const { children: e, manager: s, queryClient: t } =
|
|
1555
|
-
return /* @__PURE__ */
|
|
1556
|
-
},
|
|
1557
|
-
const
|
|
1558
|
-
if (!
|
|
1575
|
+
), Ws = (n) => {
|
|
1576
|
+
const { children: e, manager: s, queryClient: t } = n, [r] = D(Ce), o = t ?? r;
|
|
1577
|
+
return /* @__PURE__ */ m(Ke.Provider, { value: { client: s }, children: /* @__PURE__ */ m(Pe, { client: o, children: e }) });
|
|
1578
|
+
}, Gt = () => {
|
|
1579
|
+
const n = G(Ke);
|
|
1580
|
+
if (!n)
|
|
1559
1581
|
throw new Error("managerContext must be used within a Provider");
|
|
1560
|
-
return
|
|
1582
|
+
return n.client;
|
|
1561
1583
|
}, me = X(
|
|
1562
1584
|
void 0
|
|
1563
|
-
),
|
|
1564
|
-
const
|
|
1565
|
-
if (!
|
|
1566
|
-
return
|
|
1567
|
-
},
|
|
1585
|
+
), Jt = () => {
|
|
1586
|
+
const n = G(me);
|
|
1587
|
+
if (!n) throw new Error("authContext must be used within a Provider");
|
|
1588
|
+
return n;
|
|
1589
|
+
}, je = () => G(me), Gs = (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,
|
|
1597
|
+
} = n, c = Gt(), [a, l] = D({}), u = v(() => {
|
|
1598
|
+
I(t), I(r), I(o), I(i);
|
|
1599
|
+
}, [i, o, r, t]), d = v(() => !!z(s, "boolean") && a.token === void 0, [a.token, s]), h = v(
|
|
1578
1600
|
(g) => {
|
|
1579
|
-
|
|
1601
|
+
H(s, g);
|
|
1580
1602
|
},
|
|
1581
1603
|
[s]
|
|
1582
|
-
), f =
|
|
1583
|
-
(g,
|
|
1604
|
+
), f = v(
|
|
1605
|
+
(g, C) => {
|
|
1584
1606
|
if (!g) return;
|
|
1585
|
-
const w =
|
|
1586
|
-
l(g), I(s),
|
|
1607
|
+
const w = z(r, "boolean"), T = C ?? (typeof w == "boolean" ? w : !1);
|
|
1608
|
+
l(g), I(s), H(t, g.token), H(r, T), 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
|
-
), p =
|
|
1590
|
-
const g =
|
|
1610
|
+
[i, s, o, r, t]
|
|
1611
|
+
), p = v(async () => {
|
|
1612
|
+
const g = z(t) ?? a.token, C = z(o) ?? (typeof a.refreshToken == "string" ? a.refreshToken : void 0);
|
|
1591
1613
|
try {
|
|
1592
1614
|
await c.Auth.logout({
|
|
1593
1615
|
accessToken: g,
|
|
1594
|
-
refreshToken:
|
|
1616
|
+
refreshToken: C
|
|
1595
1617
|
});
|
|
1596
1618
|
} catch (w) {
|
|
1597
1619
|
console.error(w);
|
|
@@ -1604,100 +1626,100 @@ const oe = () => {
|
|
|
1604
1626
|
c.Auth,
|
|
1605
1627
|
o,
|
|
1606
1628
|
t
|
|
1607
|
-
]), b =
|
|
1629
|
+
]), b = v(async () => {
|
|
1608
1630
|
try {
|
|
1609
1631
|
const g = await c.Auth.getSession();
|
|
1610
1632
|
f(g);
|
|
1611
1633
|
} catch (g) {
|
|
1612
1634
|
console.error(g), p();
|
|
1613
1635
|
}
|
|
1614
|
-
}, [f, p, c.Auth]), y =
|
|
1636
|
+
}, [f, p, c.Auth]), y = q(() => ({
|
|
1615
1637
|
account: a,
|
|
1616
1638
|
logUser: f,
|
|
1617
1639
|
logoutUser: p,
|
|
1618
1640
|
logUserFromLocal: b,
|
|
1619
1641
|
isInGuestMode: d,
|
|
1620
|
-
setGuestMode:
|
|
1642
|
+
setGuestMode: h
|
|
1621
1643
|
}), [
|
|
1622
1644
|
a,
|
|
1623
1645
|
f,
|
|
1624
1646
|
p,
|
|
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
|
+
}, Js = () => Jt(), Qe = X(void 0), Yt = () => {
|
|
1653
|
+
const n = G(Qe);
|
|
1654
|
+
if (!n)
|
|
1633
1655
|
throw new Error("supabaseManagerContext must be used within a Provider");
|
|
1634
|
-
return
|
|
1635
|
-
},
|
|
1656
|
+
return n.client;
|
|
1657
|
+
}, Ys = (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
|
-
} =
|
|
1645
|
-
|
|
1666
|
+
} = n, a = Yt(), l = K(c ?? ke);
|
|
1667
|
+
P(() => {
|
|
1646
1668
|
l.current = c ?? ke;
|
|
1647
1669
|
}, [c]);
|
|
1648
|
-
const [u, d] =
|
|
1649
|
-
I(t), I(
|
|
1650
|
-
}, [i, o,
|
|
1670
|
+
const [u, d] = D({}), h = v(() => {
|
|
1671
|
+
I(t), I(r), I(o), I(i);
|
|
1672
|
+
}, [i, o, r, t]), f = v(() => !!z(s, "boolean") && u.token === void 0, [u.token, s]), p = v(
|
|
1651
1673
|
(w) => {
|
|
1652
|
-
|
|
1674
|
+
H(s, w);
|
|
1653
1675
|
},
|
|
1654
1676
|
[s]
|
|
1655
|
-
), b =
|
|
1656
|
-
(w,
|
|
1677
|
+
), b = v(
|
|
1678
|
+
(w, T) => {
|
|
1657
1679
|
if (!w) return;
|
|
1658
|
-
const
|
|
1659
|
-
d(w), I(s),
|
|
1680
|
+
const k = z(r, "boolean"), O = T ?? (typeof k == "boolean" ? k : !1);
|
|
1681
|
+
d(w), I(s), H(t, w.token), H(r, O), 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
|
-
), y =
|
|
1683
|
+
[i, s, o, r, t]
|
|
1684
|
+
), y = v(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 = v(async () => {
|
|
1670
1692
|
try {
|
|
1671
|
-
const { data: w, error:
|
|
1672
|
-
if (
|
|
1693
|
+
const { data: w, error: T } = await a.auth.getSession();
|
|
1694
|
+
if (T) throw T;
|
|
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
1701
|
console.error(w), await y();
|
|
1680
1702
|
}
|
|
1681
|
-
}, [
|
|
1682
|
-
|
|
1703
|
+
}, [h, b, y, a.auth]);
|
|
1704
|
+
P(() => {
|
|
1683
1705
|
let w = !0;
|
|
1684
1706
|
(async () => {
|
|
1685
1707
|
w && await g();
|
|
1686
1708
|
})();
|
|
1687
|
-
const { data:
|
|
1709
|
+
const { data: k } = a.auth.onAuthStateChange((O, j) => {
|
|
1688
1710
|
if (w) {
|
|
1689
|
-
if (!
|
|
1690
|
-
d({}),
|
|
1711
|
+
if (!j) {
|
|
1712
|
+
d({}), h();
|
|
1691
1713
|
return;
|
|
1692
1714
|
}
|
|
1693
|
-
b(l.current(
|
|
1715
|
+
b(l.current(j));
|
|
1694
1716
|
}
|
|
1695
1717
|
});
|
|
1696
1718
|
return () => {
|
|
1697
|
-
w = !1,
|
|
1719
|
+
w = !1, k.subscription.unsubscribe();
|
|
1698
1720
|
};
|
|
1699
|
-
}, [
|
|
1700
|
-
const
|
|
1721
|
+
}, [h, b, g, a.auth]);
|
|
1722
|
+
const C = q(() => ({
|
|
1701
1723
|
account: u,
|
|
1702
1724
|
logUser: b,
|
|
1703
1725
|
logoutUser: y,
|
|
@@ -1712,27 +1734,27 @@ const oe = () => {
|
|
|
1712
1734
|
f,
|
|
1713
1735
|
p
|
|
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
|
+
}, Xs = (n) => {
|
|
1739
|
+
const { children: e, supabase: s, queryClient: t } = n, [r] = D(Ce), o = t ?? r;
|
|
1740
|
+
return /* @__PURE__ */ m(Qe.Provider, { value: { client: s }, children: /* @__PURE__ */ m(Pe, { client: o, children: e }) });
|
|
1741
|
+
}, Be = X({}), Zs = (n) => {
|
|
1742
|
+
const { children: e, location: s, navigate: t, linkComponent: r, searchComponent: o } = n;
|
|
1743
|
+
return /* @__PURE__ */ m(
|
|
1744
|
+
Be.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 = G(Be);
|
|
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
|
+
}, Xt = {
|
|
1736
1758
|
addChildItem: () => {
|
|
1737
1759
|
},
|
|
1738
1760
|
removeChildItem: () => {
|
|
@@ -1740,67 +1762,88 @@ const oe = () => {
|
|
|
1740
1762
|
clearDynamicItems: () => {
|
|
1741
1763
|
},
|
|
1742
1764
|
dynamicItems: {}
|
|
1743
|
-
},
|
|
1744
|
-
|
|
1745
|
-
),
|
|
1746
|
-
const { children: e } =
|
|
1765
|
+
}, He = X(
|
|
1766
|
+
Xt
|
|
1767
|
+
), en = (n) => {
|
|
1768
|
+
const { children: e } = n, [s, t] = D({}), r = v(
|
|
1747
1769
|
(a, l) => t((u) => ({
|
|
1748
1770
|
...u,
|
|
1749
1771
|
[a]: [...u[a] ?? [], l]
|
|
1750
1772
|
})),
|
|
1751
1773
|
[]
|
|
1752
|
-
), o =
|
|
1774
|
+
), o = v(
|
|
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
|
-
), i =
|
|
1780
|
+
), i = v((a) => {
|
|
1759
1781
|
t(a ? (l) => ({
|
|
1760
1782
|
...l,
|
|
1761
1783
|
[a]: []
|
|
1762
1784
|
}) : {});
|
|
1763
|
-
}, []), c =
|
|
1785
|
+
}, []), c = q(
|
|
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__ */
|
|
1773
|
-
|
|
1794
|
+
return /* @__PURE__ */ m(
|
|
1795
|
+
He.Provider,
|
|
1774
1796
|
{
|
|
1775
1797
|
value: c,
|
|
1776
1798
|
children: e
|
|
1777
1799
|
}
|
|
1778
1800
|
);
|
|
1779
|
-
},
|
|
1780
|
-
|
|
1801
|
+
}, Zt = () => G(He), qe = X(void 0), tn = ({
|
|
1802
|
+
children: n
|
|
1803
|
+
}) => {
|
|
1804
|
+
const [e, s] = D(null), t = v(
|
|
1805
|
+
(o) => s(o),
|
|
1806
|
+
[]
|
|
1807
|
+
), r = q(
|
|
1808
|
+
() => ({ centerAction: e, setCenterAction: t }),
|
|
1809
|
+
[e, t]
|
|
1810
|
+
);
|
|
1811
|
+
return /* @__PURE__ */ m(qe.Provider, { value: r, children: n });
|
|
1812
|
+
}, es = (n) => n ? typeof n == "function" ? { onClick: () => n() } : n : null, Ve = () => G(qe), ts = () => {
|
|
1813
|
+
const n = Ve();
|
|
1814
|
+
if (!n)
|
|
1815
|
+
throw new Error(
|
|
1816
|
+
"useBottomNavAction must be used within BottomNavActionProvider"
|
|
1817
|
+
);
|
|
1818
|
+
return n;
|
|
1819
|
+
}, sn = (n) => {
|
|
1820
|
+
const { setCenterAction: e } = ts();
|
|
1821
|
+
P(() => (e(es(n)), () => e(null)), [n, e]);
|
|
1822
|
+
};
|
|
1823
|
+
function nn(n) {
|
|
1781
1824
|
var y;
|
|
1782
|
-
const { t: e } =
|
|
1783
|
-
var
|
|
1784
|
-
const
|
|
1785
|
-
return
|
|
1786
|
-
}), [(y = i == null ? void 0 : i.account) == null ? void 0 : y.email,
|
|
1825
|
+
const { t: e } = E(), { open: s, onClose: t, menuMap: r, logo: o } = n, i = je(), { dynamicItems: c } = Zt(), { linkComponent: a, location: l } = ie(), u = a, d = q(() => r.filter((g) => {
|
|
1826
|
+
var T;
|
|
1827
|
+
const C = g.auth, w = !!((T = i == null ? void 0 : i.account) != null && T.email);
|
|
1828
|
+
return C == null || C && w || !C && !w;
|
|
1829
|
+
}), [(y = i == null ? void 0 : i.account) == null ? void 0 : y.email, r]), h = v(
|
|
1787
1830
|
(g) => {
|
|
1788
1831
|
g.key === "Escape" && s && t();
|
|
1789
1832
|
},
|
|
1790
1833
|
[t, s]
|
|
1791
1834
|
);
|
|
1792
|
-
|
|
1793
|
-
document.removeEventListener("keydown",
|
|
1794
|
-
}), [
|
|
1795
|
-
const f =
|
|
1796
|
-
(g,
|
|
1835
|
+
P(() => (document.addEventListener("keydown", h), () => {
|
|
1836
|
+
document.removeEventListener("keydown", h);
|
|
1837
|
+
}), [h]);
|
|
1838
|
+
const f = v(
|
|
1839
|
+
(g, C) => C ? g === `${l.pathname}${l.search}` : g === l.pathname,
|
|
1797
1840
|
[l.pathname, l.search]
|
|
1798
|
-
), p =
|
|
1799
|
-
(g) => /* @__PURE__ */
|
|
1841
|
+
), p = v(
|
|
1842
|
+
(g) => /* @__PURE__ */ m(
|
|
1800
1843
|
"li",
|
|
1801
1844
|
{
|
|
1802
1845
|
className: `drawer-list-item-child ${f(g.path, !0) ? "active" : ""} animated`,
|
|
1803
|
-
children: g.path ? /* @__PURE__ */
|
|
1846
|
+
children: g.path ? /* @__PURE__ */ m(
|
|
1804
1847
|
u,
|
|
1805
1848
|
{
|
|
1806
1849
|
tabIndex: s ? 0 : -1,
|
|
@@ -1816,13 +1859,13 @@ function Gs(r) {
|
|
|
1816
1859
|
g.id
|
|
1817
1860
|
),
|
|
1818
1861
|
[u, s, e, f]
|
|
1819
|
-
), b =
|
|
1820
|
-
const w = g.page ?? String(
|
|
1862
|
+
), b = q(() => d.map((g, C) => {
|
|
1863
|
+
const w = g.page ?? String(C), T = `drawer-list-item ${f(g.path) ? "active" : ""} animated`;
|
|
1821
1864
|
if (g.type === "divider")
|
|
1822
|
-
return /* @__PURE__ */
|
|
1823
|
-
const
|
|
1824
|
-
return /* @__PURE__ */
|
|
1825
|
-
/* @__PURE__ */
|
|
1865
|
+
return /* @__PURE__ */ m("li", { className: T, children: /* @__PURE__ */ m("hr", { className: "drawer-divider" }) }, w);
|
|
1866
|
+
const k = g.children ?? (g.page && c ? c[g.page] : null);
|
|
1867
|
+
return /* @__PURE__ */ N("li", { className: T, children: [
|
|
1868
|
+
/* @__PURE__ */ N(
|
|
1826
1869
|
u,
|
|
1827
1870
|
{
|
|
1828
1871
|
tabIndex: s ? 0 : -1,
|
|
@@ -1837,32 +1880,32 @@ function Gs(r) {
|
|
|
1837
1880
|
]
|
|
1838
1881
|
}
|
|
1839
1882
|
),
|
|
1840
|
-
|
|
1883
|
+
k && /* @__PURE__ */ m("ul", { className: "drawer-children-list", children: k.map(p) })
|
|
1841
1884
|
] }, w);
|
|
1842
1885
|
}), [u, c, f, s, d, p, e]);
|
|
1843
|
-
return /* @__PURE__ */
|
|
1886
|
+
return /* @__PURE__ */ m(
|
|
1844
1887
|
"div",
|
|
1845
1888
|
{
|
|
1846
1889
|
"aria-label": e("_accessibility:ariaLabels.closeMenu"),
|
|
1847
1890
|
"aria-disabled": !s,
|
|
1848
1891
|
className: `${s ? "opened" : "closed"} drawer-backdrop`,
|
|
1849
1892
|
onClick: () => t(),
|
|
1850
|
-
children: /* @__PURE__ */
|
|
1851
|
-
/* @__PURE__ */
|
|
1893
|
+
children: /* @__PURE__ */ N("aside", { className: `${s ? "opened" : "closed"} drawer animated`, children: [
|
|
1894
|
+
/* @__PURE__ */ N("div", { className: "drawer-header-container", children: [
|
|
1852
1895
|
o,
|
|
1853
|
-
/* @__PURE__ */
|
|
1896
|
+
/* @__PURE__ */ m("h2", { className: "drawer-header poppins", children: e("_pages:home.appName") })
|
|
1854
1897
|
] }),
|
|
1855
|
-
/* @__PURE__ */
|
|
1898
|
+
/* @__PURE__ */ m("ul", { className: "drawer-menu-list", children: b })
|
|
1856
1899
|
] })
|
|
1857
1900
|
}
|
|
1858
1901
|
);
|
|
1859
1902
|
}
|
|
1860
|
-
const
|
|
1861
|
-
var pe,
|
|
1862
|
-
function
|
|
1863
|
-
if (
|
|
1864
|
-
|
|
1865
|
-
const
|
|
1903
|
+
const W = ({ icon: n, ...e }) => /* @__PURE__ */ m(ct, { icon: /* @__PURE__ */ m(U, { icon: n }), ...e });
|
|
1904
|
+
var pe, Ee;
|
|
1905
|
+
function ss() {
|
|
1906
|
+
if (Ee) return pe;
|
|
1907
|
+
Ee = 1;
|
|
1908
|
+
const n = (c, a = "local", l = void 0) => {
|
|
1866
1909
|
if (a === "local") {
|
|
1867
1910
|
if (localStorage.getItem(c) !== void 0 && localStorage.getItem(c) !== "undefined" && localStorage.getItem(c) !== null)
|
|
1868
1911
|
return l === void 0 || l !== void 0 && localStorage.getItem(c) === l;
|
|
@@ -1872,68 +1915,68 @@ function Jt() {
|
|
|
1872
1915
|
}, e = (c) => {
|
|
1873
1916
|
const a = {};
|
|
1874
1917
|
return c.substring(1).split("&").forEach((u) => {
|
|
1875
|
-
const [d,
|
|
1876
|
-
a[d] =
|
|
1918
|
+
const [d, h] = u.split("=");
|
|
1919
|
+
a[d] = h;
|
|
1877
1920
|
}), a;
|
|
1878
1921
|
}, s = (c = "") => {
|
|
1879
1922
|
if (o(c) && c.length) return o(c);
|
|
1880
1923
|
{
|
|
1881
1924
|
let a = navigator.language || navigator.userLanguage;
|
|
1882
1925
|
if (a.indexOf("en") < 0 && a.indexOf("es") < 0 && (a = "en-US"), a = a.split("-")[0], a)
|
|
1883
|
-
return c.length &&
|
|
1926
|
+
return c.length && r(c, 730, a), a;
|
|
1884
1927
|
}
|
|
1885
1928
|
return "en";
|
|
1886
1929
|
}, t = (c = 0, a = 0, l = window, u = "smooth") => l.scroll({
|
|
1887
1930
|
top: c,
|
|
1888
1931
|
left: a,
|
|
1889
1932
|
behavior: u
|
|
1890
|
-
}),
|
|
1891
|
-
var
|
|
1892
|
-
|
|
1893
|
-
const f = "; expires=" +
|
|
1933
|
+
}), r = (c, a, l, u = "/", d = "Lax") => {
|
|
1934
|
+
var h = /* @__PURE__ */ new Date();
|
|
1935
|
+
h.setTime(h.getTime() + a * 24 * 60 * 60 * 1e3);
|
|
1936
|
+
const f = "; expires=" + h.toUTCString();
|
|
1894
1937
|
document.cookie = `${c}=${l || ""}${f};path=${u};SameSite=${d}`;
|
|
1895
1938
|
}, o = (c) => {
|
|
1896
1939
|
const a = `${c}=`, u = decodeURIComponent(document.cookie).split(";");
|
|
1897
1940
|
for (let d = 0; d < u.length; d += 1) {
|
|
1898
|
-
let
|
|
1899
|
-
for (;
|
|
1900
|
-
|
|
1901
|
-
if (
|
|
1902
|
-
return
|
|
1941
|
+
let h = u[d];
|
|
1942
|
+
for (; h.charAt(0) === " "; )
|
|
1943
|
+
h = h.substring(1);
|
|
1944
|
+
if (h.indexOf(a) === 0)
|
|
1945
|
+
return h.substring(a.length, h.length);
|
|
1903
1946
|
}
|
|
1904
1947
|
return "";
|
|
1905
1948
|
};
|
|
1906
1949
|
return pe = {
|
|
1907
1950
|
getCookie: o,
|
|
1908
|
-
createCookie:
|
|
1951
|
+
createCookie: r,
|
|
1909
1952
|
deleteCookie: (c) => document.cookie = `${c}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`,
|
|
1910
1953
|
getUserLanguage: s,
|
|
1911
1954
|
scrollTo: t,
|
|
1912
1955
|
parseQueries: e,
|
|
1913
|
-
validation:
|
|
1956
|
+
validation: n
|
|
1914
1957
|
}, pe;
|
|
1915
1958
|
}
|
|
1916
|
-
var
|
|
1917
|
-
function
|
|
1918
|
-
const { t:
|
|
1919
|
-
return { timeAge:
|
|
1959
|
+
var ns = ss();
|
|
1960
|
+
function rn() {
|
|
1961
|
+
const { t: n, language: e } = E();
|
|
1962
|
+
return { timeAge: v(
|
|
1920
1963
|
(t) => {
|
|
1921
|
-
const o = /* @__PURE__ */ new Date() - t, i = Math.floor(o / (1e3 * 60)), c = Math.floor(i / 60), a = e === "es", l =
|
|
1922
|
-
return o < 1e3 * 60 ? b : i < 60 ? `${a ? l : ""} ${i} ${i === 1 ? u : d} ${a ? "" : l}` : c < 24 ? `${a ? l : ""} ${c} ${c === 1 ?
|
|
1964
|
+
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"), f = n("_accessibility:labels.hours"), p = n("_accessibility:labels.yesterday"), b = n("_accessibility:labels.justNow");
|
|
1965
|
+
return o < 1e3 * 60 ? b : i < 60 ? `${a ? l : ""} ${i} ${i === 1 ? u : d} ${a ? "" : l}` : c < 24 ? `${a ? l : ""} ${c} ${c === 1 ? h : f} ${a ? "" : l}` : c < 48 ? p : t.toLocaleDateString(navigator.language || "es-ES", {
|
|
1923
1966
|
day: "2-digit",
|
|
1924
1967
|
month: "2-digit",
|
|
1925
1968
|
year: "numeric"
|
|
1926
1969
|
});
|
|
1927
1970
|
},
|
|
1928
|
-
[
|
|
1971
|
+
[n, e]
|
|
1929
1972
|
) };
|
|
1930
1973
|
}
|
|
1931
|
-
const
|
|
1932
|
-
const { showSuccessNotification: e } = oe(), { mutationFn: s, onError: t, onSuccess:
|
|
1974
|
+
const ze = (n) => {
|
|
1975
|
+
const { showSuccessNotification: e } = oe(), { mutationFn: s, onError: t, onSuccess: r, onSuccessMessage: o } = n, [i, c] = D([]), { open: a, handleClose: l, handleOpen: u } = We(), d = () => {
|
|
1933
1976
|
l(), c([]);
|
|
1934
|
-
},
|
|
1977
|
+
}, h = async (p) => {
|
|
1935
1978
|
c(p), u();
|
|
1936
|
-
}, f =
|
|
1979
|
+
}, f = re({
|
|
1937
1980
|
mutationFn: () => s(
|
|
1938
1981
|
Array.isArray(i) ? i : [i]
|
|
1939
1982
|
),
|
|
@@ -1941,17 +1984,17 @@ const He = (r) => {
|
|
|
1941
1984
|
console.error(p), t && t(p), d();
|
|
1942
1985
|
},
|
|
1943
1986
|
onSuccess: async (p) => {
|
|
1944
|
-
|
|
1987
|
+
r && r(p), e({
|
|
1945
1988
|
message: o
|
|
1946
1989
|
}), d();
|
|
1947
1990
|
}
|
|
1948
1991
|
});
|
|
1949
|
-
return { open: a, onClick:
|
|
1950
|
-
},
|
|
1951
|
-
const { t: e } =
|
|
1992
|
+
return { open: a, onClick: h, close: d, dialogFn: f, isLoading: f.isPending };
|
|
1993
|
+
}, on = (n) => {
|
|
1994
|
+
const { t: e } = E(), {
|
|
1952
1995
|
showStackNotifications: s,
|
|
1953
1996
|
showSuccessNotification: t,
|
|
1954
|
-
showErrorNotification:
|
|
1997
|
+
showErrorNotification: r
|
|
1955
1998
|
} = oe(), o = Z(), {
|
|
1956
1999
|
defaultValues: i,
|
|
1957
2000
|
mutationFn: c,
|
|
@@ -1959,59 +2002,59 @@ const He = (r) => {
|
|
|
1959
2002
|
onError: l,
|
|
1960
2003
|
onSuccess: u,
|
|
1961
2004
|
queryKey: d,
|
|
1962
|
-
onSuccessMessage:
|
|
1963
|
-
} =
|
|
2005
|
+
onSuccessMessage: h
|
|
2006
|
+
} = n, { control: f, handleSubmit: p, reset: b, setError: y, getValues: g, setValue: C } = Oe({
|
|
1964
2007
|
defaultValues: i
|
|
1965
|
-
}), w =
|
|
1966
|
-
const
|
|
1967
|
-
if (!(
|
|
2008
|
+
}), w = K(null), T = v(() => {
|
|
2009
|
+
const S = document.activeElement;
|
|
2010
|
+
if (!(S instanceof HTMLElement)) {
|
|
1968
2011
|
w.current = null;
|
|
1969
2012
|
return;
|
|
1970
2013
|
}
|
|
1971
|
-
w.current =
|
|
1972
|
-
}, []),
|
|
1973
|
-
(
|
|
1974
|
-
const
|
|
1975
|
-
if (!_) return
|
|
1976
|
-
let
|
|
1977
|
-
return
|
|
1978
|
-
const
|
|
1979
|
-
(
|
|
1980
|
-
}),
|
|
2014
|
+
w.current = S.closest("form");
|
|
2015
|
+
}, []), k = v(
|
|
2016
|
+
(S) => {
|
|
2017
|
+
const L = S == null ? void 0 : S.errors, R = [], _ = w.current;
|
|
2018
|
+
if (!_) return R;
|
|
2019
|
+
let Q = !1;
|
|
2020
|
+
return L && L.forEach(([le, ee]) => {
|
|
2021
|
+
const B = _.querySelector(`[name="${le}"]`);
|
|
2022
|
+
(B instanceof HTMLInputElement || B instanceof HTMLTextAreaElement || B instanceof HTMLSelectElement) && (Q || (B.focus(), Q = !0), B.classList.add("error"), R.push(e(`_entities:${d}.${le}.${ee}`)));
|
|
2023
|
+
}), R;
|
|
1981
2024
|
},
|
|
1982
2025
|
[e, d]
|
|
1983
|
-
),
|
|
1984
|
-
const
|
|
1985
|
-
if (!
|
|
1986
|
-
|
|
1987
|
-
|
|
2026
|
+
), O = v(() => {
|
|
2027
|
+
const S = w.current;
|
|
2028
|
+
if (!S) return;
|
|
2029
|
+
S.querySelectorAll("input, textarea, select").forEach((R) => {
|
|
2030
|
+
R.classList.remove("error");
|
|
1988
2031
|
});
|
|
1989
|
-
}, []),
|
|
2032
|
+
}, []), j = re(
|
|
1990
2033
|
{
|
|
1991
2034
|
mutationFn: c,
|
|
1992
|
-
onError: (
|
|
1993
|
-
console.error(
|
|
1994
|
-
const
|
|
1995
|
-
if (l) l(
|
|
1996
|
-
else if (Se(
|
|
1997
|
-
const
|
|
2035
|
+
onError: (S) => {
|
|
2036
|
+
console.error(S);
|
|
2037
|
+
const L = S;
|
|
2038
|
+
if (l) l(S);
|
|
2039
|
+
else if (Se(L)) {
|
|
2040
|
+
const R = k(L);
|
|
1998
2041
|
s(
|
|
1999
|
-
|
|
2042
|
+
R.map(
|
|
2000
2043
|
(_) => ({
|
|
2001
2044
|
message: _,
|
|
2002
|
-
type:
|
|
2045
|
+
type: F.error
|
|
2003
2046
|
})
|
|
2004
2047
|
)
|
|
2005
2048
|
);
|
|
2006
|
-
} else if (
|
|
2007
|
-
const
|
|
2008
|
-
|
|
2049
|
+
} else if (ve(L)) {
|
|
2050
|
+
const R = L.message || e("_accessibility:errors.500"), _ = e(`_accessibility:errors.${L.status}`);
|
|
2051
|
+
r({ message: _ || R });
|
|
2009
2052
|
} else
|
|
2010
|
-
|
|
2053
|
+
r({ message: e("_accessibility:errors.500") });
|
|
2011
2054
|
},
|
|
2012
|
-
onSuccess: async (
|
|
2013
|
-
await o.invalidateQueries({ queryKey: d }), u && u(
|
|
2014
|
-
message:
|
|
2055
|
+
onSuccess: async (S) => {
|
|
2056
|
+
await o.invalidateQueries({ queryKey: d }), u && u(S), h && t({
|
|
2057
|
+
message: h
|
|
2015
2058
|
});
|
|
2016
2059
|
}
|
|
2017
2060
|
}
|
|
@@ -2019,151 +2062,151 @@ const He = (r) => {
|
|
|
2019
2062
|
return {
|
|
2020
2063
|
control: f,
|
|
2021
2064
|
getValues: g,
|
|
2022
|
-
setValue:
|
|
2065
|
+
setValue: C,
|
|
2023
2066
|
handleSubmit: p,
|
|
2024
|
-
onSubmit: (
|
|
2025
|
-
|
|
2026
|
-
a ? a(
|
|
2067
|
+
onSubmit: (S) => {
|
|
2068
|
+
T(), O(), j.mutate(
|
|
2069
|
+
a ? a(S) : S
|
|
2027
2070
|
);
|
|
2028
2071
|
},
|
|
2029
2072
|
reset: b,
|
|
2030
2073
|
setError: y,
|
|
2031
|
-
isLoading:
|
|
2074
|
+
isLoading: j.isPending
|
|
2032
2075
|
};
|
|
2033
|
-
},
|
|
2034
|
-
const { t: e } =
|
|
2076
|
+
}, rs = (n) => {
|
|
2077
|
+
const { t: e } = E(), {
|
|
2035
2078
|
onClick: s,
|
|
2036
|
-
icon: t =
|
|
2037
|
-
sticky:
|
|
2079
|
+
icon: t = bt,
|
|
2080
|
+
sticky: r = !0,
|
|
2038
2081
|
hidden: o = !1,
|
|
2039
2082
|
multiple: i = !0,
|
|
2040
2083
|
disabled: c = !1,
|
|
2041
|
-
id: a =
|
|
2084
|
+
id: a = Y.Delete,
|
|
2042
2085
|
tooltip: l = e("_pages:common.actions.delete.text")
|
|
2043
|
-
} =
|
|
2086
|
+
} = n;
|
|
2044
2087
|
return {
|
|
2045
|
-
action:
|
|
2088
|
+
action: v(
|
|
2046
2089
|
(d) => ({
|
|
2047
2090
|
id: a,
|
|
2048
|
-
sticky:
|
|
2091
|
+
sticky: r,
|
|
2049
2092
|
tooltip: l,
|
|
2050
2093
|
multiple: i,
|
|
2051
2094
|
onClick: () => s([d == null ? void 0 : d.id]),
|
|
2052
2095
|
hidden: !!d.deletedAt || o,
|
|
2053
2096
|
disabled: !!d.deletedAt || c,
|
|
2054
|
-
icon: /* @__PURE__ */
|
|
2055
|
-
onMultipleClick: (
|
|
2097
|
+
icon: /* @__PURE__ */ m(U, { className: "text-bg-error", icon: t }),
|
|
2098
|
+
onMultipleClick: (h) => s(h.map((f) => f.id))
|
|
2056
2099
|
}),
|
|
2057
|
-
[c, o, t, a, i, s,
|
|
2100
|
+
[c, o, t, a, i, s, r, l]
|
|
2058
2101
|
)
|
|
2059
2102
|
};
|
|
2060
|
-
},
|
|
2061
|
-
const { t: e } =
|
|
2103
|
+
}, os = (n) => {
|
|
2104
|
+
const { t: e } = E(), {
|
|
2062
2105
|
onClick: s,
|
|
2063
2106
|
sticky: t = !0,
|
|
2064
|
-
hidden:
|
|
2107
|
+
hidden: r = !1,
|
|
2065
2108
|
disabled: o = !1,
|
|
2066
2109
|
multiple: i = !1,
|
|
2067
|
-
icon: c =
|
|
2068
|
-
id: a =
|
|
2110
|
+
icon: c = Re,
|
|
2111
|
+
id: a = Y.Restore,
|
|
2069
2112
|
tooltip: l = e("_pages:common.actions.restore.text")
|
|
2070
|
-
} =
|
|
2113
|
+
} = n;
|
|
2071
2114
|
return {
|
|
2072
|
-
action:
|
|
2115
|
+
action: v(
|
|
2073
2116
|
(d) => ({
|
|
2074
2117
|
id: a,
|
|
2075
2118
|
sticky: t,
|
|
2076
2119
|
tooltip: l,
|
|
2077
2120
|
multiple: i,
|
|
2078
2121
|
onClick: () => s([d == null ? void 0 : d.id]),
|
|
2079
|
-
hidden: !d.deletedAt ||
|
|
2122
|
+
hidden: !d.deletedAt || r,
|
|
2080
2123
|
disabled: !d.deletedAt || o,
|
|
2081
|
-
icon: /* @__PURE__ */
|
|
2082
|
-
onMultipleClick: (
|
|
2124
|
+
icon: /* @__PURE__ */ m(U, { className: "text-bg-error", icon: c }),
|
|
2125
|
+
onMultipleClick: (h) => s(h.map((f) => f.id))
|
|
2083
2126
|
}),
|
|
2084
|
-
[o,
|
|
2127
|
+
[o, r, c, a, i, s, t, l]
|
|
2085
2128
|
)
|
|
2086
2129
|
};
|
|
2087
|
-
},
|
|
2088
|
-
const { t: e } =
|
|
2130
|
+
}, an = (n) => {
|
|
2131
|
+
const { t: e } = E(), {
|
|
2089
2132
|
onClick: s,
|
|
2090
2133
|
hidden: t = !1,
|
|
2091
|
-
sticky:
|
|
2134
|
+
sticky: r = !0,
|
|
2092
2135
|
disabled: o = !1,
|
|
2093
|
-
id: i =
|
|
2094
|
-
icon: c =
|
|
2136
|
+
id: i = Y.Edit,
|
|
2137
|
+
icon: c = yt,
|
|
2095
2138
|
tooltip: a = e("_pages:common.actions.edit.text")
|
|
2096
|
-
} =
|
|
2139
|
+
} = n;
|
|
2097
2140
|
return {
|
|
2098
|
-
action:
|
|
2141
|
+
action: v(
|
|
2099
2142
|
(u) => ({
|
|
2100
2143
|
id: i,
|
|
2101
|
-
sticky:
|
|
2144
|
+
sticky: r,
|
|
2102
2145
|
tooltip: a,
|
|
2103
2146
|
onClick: () => s(u == null ? void 0 : u.id),
|
|
2104
2147
|
hidden: !!u.deletedAt || t,
|
|
2105
2148
|
disabled: !!u.deletedAt || o,
|
|
2106
|
-
icon: /* @__PURE__ */
|
|
2149
|
+
icon: /* @__PURE__ */ m(U, { className: "primary", icon: c })
|
|
2107
2150
|
}),
|
|
2108
|
-
[o, t, c, i, s,
|
|
2151
|
+
[o, t, c, i, s, r, a]
|
|
2109
2152
|
)
|
|
2110
2153
|
};
|
|
2111
2154
|
};
|
|
2112
|
-
var
|
|
2113
|
-
const
|
|
2114
|
-
const { t: e } =
|
|
2155
|
+
var Y = /* @__PURE__ */ ((n) => (n.Add = "add", n.Edit = "edit", n.Delete = "delete", n.Restore = "restore", n.Refresh = "refresh", n.Export = "export", n.Import = "import", n))(Y || {});
|
|
2156
|
+
const is = (n) => {
|
|
2157
|
+
const { t: e } = E(), {
|
|
2115
2158
|
onClick: s,
|
|
2116
2159
|
hidden: t = !1,
|
|
2117
|
-
disabled:
|
|
2160
|
+
disabled: r = !1,
|
|
2118
2161
|
isLoading: o = !1
|
|
2119
|
-
} =
|
|
2162
|
+
} = n;
|
|
2120
2163
|
return {
|
|
2121
|
-
action:
|
|
2164
|
+
action: v(
|
|
2122
2165
|
() => ({
|
|
2123
|
-
id:
|
|
2166
|
+
id: Y.Export,
|
|
2124
2167
|
hidden: t,
|
|
2125
|
-
disabled:
|
|
2126
|
-
icon: /* @__PURE__ */
|
|
2127
|
-
|
|
2168
|
+
disabled: r,
|
|
2169
|
+
icon: /* @__PURE__ */ m(
|
|
2170
|
+
U,
|
|
2128
2171
|
{
|
|
2129
2172
|
className: `${o ? "rotate" : ""}`,
|
|
2130
|
-
icon: o ?
|
|
2173
|
+
icon: o ? Ie : wt
|
|
2131
2174
|
}
|
|
2132
2175
|
),
|
|
2133
2176
|
tooltip: e("_pages:common.actions.export.text"),
|
|
2134
2177
|
onClick: s
|
|
2135
2178
|
}),
|
|
2136
|
-
[
|
|
2179
|
+
[r, t, o, s, e]
|
|
2137
2180
|
)
|
|
2138
2181
|
};
|
|
2139
|
-
},
|
|
2140
|
-
const { t: e } =
|
|
2182
|
+
}, as = (n) => {
|
|
2183
|
+
const { t: e } = E(), {
|
|
2141
2184
|
onClick: s,
|
|
2142
2185
|
hidden: t = !1,
|
|
2143
|
-
disabled:
|
|
2186
|
+
disabled: r = !1,
|
|
2144
2187
|
isLoading: o = !1
|
|
2145
|
-
} =
|
|
2188
|
+
} = n;
|
|
2146
2189
|
return {
|
|
2147
|
-
action:
|
|
2190
|
+
action: v(
|
|
2148
2191
|
() => ({
|
|
2149
|
-
id:
|
|
2192
|
+
id: Y.Import,
|
|
2150
2193
|
hidden: t,
|
|
2151
|
-
disabled:
|
|
2152
|
-
icon: /* @__PURE__ */
|
|
2153
|
-
|
|
2194
|
+
disabled: r,
|
|
2195
|
+
icon: /* @__PURE__ */ m(
|
|
2196
|
+
U,
|
|
2154
2197
|
{
|
|
2155
2198
|
className: `${o ? "rotate" : ""}`,
|
|
2156
|
-
icon: o ?
|
|
2199
|
+
icon: o ? Ie : St
|
|
2157
2200
|
}
|
|
2158
2201
|
),
|
|
2159
2202
|
tooltip: e("_pages:common.actions.import.text"),
|
|
2160
2203
|
onClick: s
|
|
2161
2204
|
}),
|
|
2162
|
-
[
|
|
2205
|
+
[r, t, o, s, e]
|
|
2163
2206
|
)
|
|
2164
2207
|
};
|
|
2165
|
-
},
|
|
2166
|
-
const { queryKey: e, onSuccess: s, ...t } =
|
|
2208
|
+
}, cn = (n) => {
|
|
2209
|
+
const { queryKey: e, onSuccess: s, ...t } = n, r = Z(), { showStackNotifications: o } = oe(), { t: i } = E(), { open: c, onClick: a, close: l, dialogFn: u, isLoading: d } = ze({
|
|
2167
2210
|
onSuccessMessage: i("_pages:common.actions.delete.successMessage"),
|
|
2168
2211
|
onError: (f) => {
|
|
2169
2212
|
const p = f;
|
|
@@ -2172,25 +2215,25 @@ const es = (r) => {
|
|
|
2172
2215
|
p.errors.map(
|
|
2173
2216
|
([b, y]) => ({
|
|
2174
2217
|
message: i(`_pages:${b}.errors.${y}`),
|
|
2175
|
-
type:
|
|
2218
|
+
type: F.error
|
|
2176
2219
|
})
|
|
2177
2220
|
)
|
|
2178
2221
|
);
|
|
2179
|
-
else if (
|
|
2222
|
+
else if (ve(p)) {
|
|
2180
2223
|
const b = p.message || i("_accessibility:errors.500"), y = i(`_accessibility:errors.${p.status}`);
|
|
2181
2224
|
o([
|
|
2182
2225
|
{
|
|
2183
2226
|
message: y || b,
|
|
2184
|
-
type:
|
|
2227
|
+
type: F.error
|
|
2185
2228
|
}
|
|
2186
2229
|
]);
|
|
2187
2230
|
}
|
|
2188
2231
|
},
|
|
2189
2232
|
onSuccess: async (f) => {
|
|
2190
|
-
await
|
|
2233
|
+
await r.invalidateQueries({ queryKey: e }), s && s(f);
|
|
2191
2234
|
},
|
|
2192
2235
|
...t
|
|
2193
|
-
}), { action:
|
|
2236
|
+
}), { action: h } = rs({ onClick: a });
|
|
2194
2237
|
return {
|
|
2195
2238
|
onClick: a,
|
|
2196
2239
|
title: i("_pages:common.actions.delete.dialog.title"),
|
|
@@ -2198,17 +2241,17 @@ const es = (r) => {
|
|
|
2198
2241
|
isLoading: d,
|
|
2199
2242
|
handleSubmit: () => u.mutate(),
|
|
2200
2243
|
handleClose: l,
|
|
2201
|
-
action:
|
|
2244
|
+
action: h
|
|
2202
2245
|
};
|
|
2203
|
-
},
|
|
2204
|
-
const [
|
|
2205
|
-
return { open:
|
|
2206
|
-
},
|
|
2246
|
+
}, We = () => {
|
|
2247
|
+
const [n, e] = D(!1);
|
|
2248
|
+
return { open: n, setOpen: e, handleClose: () => e(!1), handleOpen: () => e(!0) };
|
|
2249
|
+
}, Ge = (n) => {
|
|
2207
2250
|
const {
|
|
2208
2251
|
closeOnSubmit: e = !0,
|
|
2209
2252
|
defaultValues: s,
|
|
2210
2253
|
dtoToForm: t,
|
|
2211
|
-
formToDto:
|
|
2254
|
+
formToDto: r,
|
|
2212
2255
|
mode: o = "state",
|
|
2213
2256
|
onApply: i,
|
|
2214
2257
|
onClear: c,
|
|
@@ -2216,149 +2259,149 @@ const es = (r) => {
|
|
|
2216
2259
|
onSubmit: l,
|
|
2217
2260
|
reinitializeOnOpen: u,
|
|
2218
2261
|
resetOnOpen: d,
|
|
2219
|
-
title:
|
|
2220
|
-
} =
|
|
2262
|
+
title: h
|
|
2263
|
+
} = n, [f, p] = D(), [b, y] = D(!1), g = K(!1), C = K(null), { open: w, handleClose: T, handleOpen: k } = We(), { control: O, handleSubmit: j, reset: S, setError: L, getValues: R, setValue: _ } = Oe({
|
|
2221
2264
|
defaultValues: s || {}
|
|
2222
2265
|
});
|
|
2223
|
-
|
|
2266
|
+
P(() => {
|
|
2224
2267
|
if (!w) {
|
|
2225
|
-
g.current = !1,
|
|
2268
|
+
g.current = !1, C.current = null;
|
|
2226
2269
|
return;
|
|
2227
2270
|
}
|
|
2228
2271
|
if (g.current) return;
|
|
2229
|
-
if (g.current = !0,
|
|
2230
|
-
C
|
|
2272
|
+
if (g.current = !0, C.current) {
|
|
2273
|
+
S(C.current), C.current = null;
|
|
2231
2274
|
return;
|
|
2232
2275
|
}
|
|
2233
2276
|
const $ = t;
|
|
2234
2277
|
if (u && $) {
|
|
2235
|
-
|
|
2278
|
+
S($(s || {}));
|
|
2236
2279
|
return;
|
|
2237
2280
|
}
|
|
2238
2281
|
if (u && s) {
|
|
2239
|
-
|
|
2282
|
+
S(s);
|
|
2240
2283
|
return;
|
|
2241
2284
|
}
|
|
2242
|
-
d &&
|
|
2243
|
-
}, [s, t, w, u,
|
|
2244
|
-
const
|
|
2245
|
-
|
|
2246
|
-
}, [
|
|
2285
|
+
d && S(s || {});
|
|
2286
|
+
}, [s, t, w, u, S, d]);
|
|
2287
|
+
const Q = v(() => {
|
|
2288
|
+
T(), S();
|
|
2289
|
+
}, [T, S]), le = v(
|
|
2247
2290
|
($) => {
|
|
2248
2291
|
let x, te;
|
|
2249
|
-
typeof $ == "number" || $ == null ? x = $ : (x = $.id, te = $.values), p(x), te ? w ?
|
|
2292
|
+
typeof $ == "number" || $ == null ? x = $ : (x = $.id, te = $.values), p(x), te ? w ? S(te) : C.current = te : C.current = null, w || k();
|
|
2250
2293
|
},
|
|
2251
|
-
[
|
|
2252
|
-
), ee =
|
|
2294
|
+
[k, w, S]
|
|
2295
|
+
), ee = v(
|
|
2253
2296
|
($) => {
|
|
2254
|
-
const x =
|
|
2297
|
+
const x = r;
|
|
2255
2298
|
return x ? x($, { id: f }) : $;
|
|
2256
2299
|
},
|
|
2257
|
-
[
|
|
2258
|
-
),
|
|
2300
|
+
[r, f]
|
|
2301
|
+
), B = v(
|
|
2259
2302
|
async ($, x, te) => {
|
|
2260
2303
|
a && await a($, {
|
|
2261
|
-
close:
|
|
2304
|
+
close: Q,
|
|
2262
2305
|
id: f,
|
|
2263
2306
|
phase: x,
|
|
2264
2307
|
values: te
|
|
2265
2308
|
});
|
|
2266
2309
|
},
|
|
2267
|
-
[
|
|
2268
|
-
),
|
|
2310
|
+
[Q, f, a]
|
|
2311
|
+
), Ye = v(async () => {
|
|
2269
2312
|
if (!i) return;
|
|
2270
|
-
const $ =
|
|
2313
|
+
const $ = R();
|
|
2271
2314
|
y(!0);
|
|
2272
2315
|
try {
|
|
2273
2316
|
const x = ee($);
|
|
2274
2317
|
await i(x, {
|
|
2275
|
-
close:
|
|
2318
|
+
close: Q,
|
|
2276
2319
|
id: f,
|
|
2277
2320
|
values: $
|
|
2278
2321
|
});
|
|
2279
2322
|
} catch (x) {
|
|
2280
|
-
throw await
|
|
2323
|
+
throw await B(x, "apply", $).catch(() => {
|
|
2281
2324
|
}), x;
|
|
2282
2325
|
} finally {
|
|
2283
2326
|
y(!1);
|
|
2284
2327
|
}
|
|
2285
|
-
}, [
|
|
2286
|
-
const $ =
|
|
2328
|
+
}, [Q, R, B, f, ee, i]), Xe = v(async () => {
|
|
2329
|
+
const $ = R();
|
|
2287
2330
|
if (c) {
|
|
2288
2331
|
y(!0);
|
|
2289
2332
|
try {
|
|
2290
2333
|
await c();
|
|
2291
2334
|
} catch (x) {
|
|
2292
|
-
throw await
|
|
2335
|
+
throw await B(x, "clear", $).catch(() => {
|
|
2293
2336
|
}), x;
|
|
2294
2337
|
} finally {
|
|
2295
2338
|
y(!1);
|
|
2296
2339
|
}
|
|
2297
2340
|
}
|
|
2298
2341
|
try {
|
|
2299
|
-
|
|
2342
|
+
S(s || {});
|
|
2300
2343
|
} catch (x) {
|
|
2301
|
-
throw await
|
|
2344
|
+
throw await B(x, "clear", $).catch(() => {
|
|
2302
2345
|
}), x;
|
|
2303
2346
|
}
|
|
2304
|
-
}, [s,
|
|
2347
|
+
}, [s, R, B, c, S]), Ze = v(
|
|
2305
2348
|
async ($) => {
|
|
2306
2349
|
y(!0);
|
|
2307
2350
|
try {
|
|
2308
2351
|
const x = ee($);
|
|
2309
2352
|
l && await l(x, {
|
|
2310
|
-
close:
|
|
2353
|
+
close: Q,
|
|
2311
2354
|
id: f,
|
|
2312
2355
|
values: $
|
|
2313
|
-
}), e &&
|
|
2356
|
+
}), e && Q();
|
|
2314
2357
|
} catch (x) {
|
|
2315
|
-
throw await
|
|
2358
|
+
throw await B(x, "submit", $).catch(() => {
|
|
2316
2359
|
}), x;
|
|
2317
2360
|
} finally {
|
|
2318
2361
|
y(!1);
|
|
2319
2362
|
}
|
|
2320
2363
|
},
|
|
2321
|
-
[
|
|
2364
|
+
[Q, e, B, f, ee, l]
|
|
2322
2365
|
);
|
|
2323
2366
|
return {
|
|
2324
2367
|
open: w,
|
|
2325
2368
|
mode: o,
|
|
2326
2369
|
id: f,
|
|
2327
2370
|
openDialog: le,
|
|
2328
|
-
handleClose:
|
|
2329
|
-
control:
|
|
2330
|
-
getValues:
|
|
2371
|
+
handleClose: Q,
|
|
2372
|
+
control: O,
|
|
2373
|
+
getValues: R,
|
|
2331
2374
|
setValue: _,
|
|
2332
|
-
handleSubmit:
|
|
2333
|
-
onSubmit:
|
|
2334
|
-
reset:
|
|
2335
|
-
setError:
|
|
2336
|
-
title:
|
|
2375
|
+
handleSubmit: j,
|
|
2376
|
+
onSubmit: Ze,
|
|
2377
|
+
reset: S,
|
|
2378
|
+
setError: L,
|
|
2379
|
+
title: h,
|
|
2337
2380
|
isSubmitting: b,
|
|
2338
|
-
onApply:
|
|
2339
|
-
onClear:
|
|
2381
|
+
onApply: Ye,
|
|
2382
|
+
onClear: Xe,
|
|
2340
2383
|
isLoading: b
|
|
2341
2384
|
};
|
|
2342
|
-
},
|
|
2343
|
-
const e = Z(), { mutationFn: s, queryKey: t, onSuccess:
|
|
2385
|
+
}, ln = (n) => {
|
|
2386
|
+
const e = Z(), { mutationFn: s, queryKey: t, onSuccess: r, onError: o, formToDto: i, ...c } = n, a = re({
|
|
2344
2387
|
mutationFn: s
|
|
2345
2388
|
});
|
|
2346
|
-
return
|
|
2389
|
+
return Ge({
|
|
2347
2390
|
...c,
|
|
2348
2391
|
mode: "entity",
|
|
2349
2392
|
formToDto: i,
|
|
2350
2393
|
onSubmit: async (l) => {
|
|
2351
2394
|
try {
|
|
2352
2395
|
const u = await a.mutateAsync(l);
|
|
2353
|
-
t && await e.invalidateQueries({ queryKey: t }),
|
|
2396
|
+
t && await e.invalidateQueries({ queryKey: t }), r && await r(u);
|
|
2354
2397
|
} catch (u) {
|
|
2355
2398
|
throw o && o(u), u;
|
|
2356
2399
|
}
|
|
2357
2400
|
}
|
|
2358
2401
|
});
|
|
2359
|
-
},
|
|
2360
|
-
const e = Z(), s =
|
|
2361
|
-
mutationFn:
|
|
2402
|
+
}, un = (n) => {
|
|
2403
|
+
const e = Z(), s = K(), t = K(), {
|
|
2404
|
+
mutationFn: r,
|
|
2362
2405
|
queryKey: o,
|
|
2363
2406
|
onSuccess: i,
|
|
2364
2407
|
onError: c,
|
|
@@ -2366,48 +2409,48 @@ const es = (r) => {
|
|
|
2366
2409
|
getFunction: l,
|
|
2367
2410
|
dtoToForm: u,
|
|
2368
2411
|
title: d,
|
|
2369
|
-
...
|
|
2370
|
-
} =
|
|
2371
|
-
|
|
2412
|
+
...h
|
|
2413
|
+
} = n, f = K(u);
|
|
2414
|
+
P(() => {
|
|
2372
2415
|
f.current = u;
|
|
2373
2416
|
}, [u]);
|
|
2374
|
-
const p =
|
|
2375
|
-
mutationFn:
|
|
2376
|
-
}), b =
|
|
2377
|
-
...
|
|
2417
|
+
const p = re({
|
|
2418
|
+
mutationFn: r
|
|
2419
|
+
}), b = Ge({
|
|
2420
|
+
...h,
|
|
2378
2421
|
mode: "entity",
|
|
2379
2422
|
title: d,
|
|
2380
2423
|
onSubmit: async (w) => {
|
|
2381
2424
|
try {
|
|
2382
|
-
const
|
|
2383
|
-
o && await e.invalidateQueries({ queryKey: o }), i && await i(
|
|
2384
|
-
} catch (
|
|
2385
|
-
throw c && c(
|
|
2425
|
+
const T = await p.mutateAsync(w);
|
|
2426
|
+
o && await e.invalidateQueries({ queryKey: o }), i && await i(T);
|
|
2427
|
+
} catch (T) {
|
|
2428
|
+
throw c && c(T), T;
|
|
2386
2429
|
}
|
|
2387
2430
|
},
|
|
2388
2431
|
formToDto: (w) => {
|
|
2389
|
-
const
|
|
2390
|
-
return
|
|
2432
|
+
const T = a;
|
|
2433
|
+
return T ? T(w, s.current) : w;
|
|
2391
2434
|
}
|
|
2392
|
-
}), { reset: y } = b,
|
|
2435
|
+
}), { reset: y } = b, C = Lt({
|
|
2393
2436
|
queryFn: () => l(b.id),
|
|
2394
2437
|
queryKey: [...o || ["put-dialog", d], b.id],
|
|
2395
2438
|
enabled: b.open && !!b.id
|
|
2396
2439
|
});
|
|
2397
|
-
return
|
|
2398
|
-
if (
|
|
2399
|
-
if (s.current =
|
|
2400
|
-
y(f.current(
|
|
2440
|
+
return P(() => {
|
|
2441
|
+
if (C.data && t.current !== C.data) {
|
|
2442
|
+
if (s.current = C.data, t.current = C.data, f.current && y) {
|
|
2443
|
+
y(f.current(C.data));
|
|
2401
2444
|
return;
|
|
2402
2445
|
}
|
|
2403
|
-
y == null || y(
|
|
2446
|
+
y == null || y(C.data);
|
|
2404
2447
|
}
|
|
2405
|
-
}, [
|
|
2448
|
+
}, [C.data, y]), {
|
|
2406
2449
|
...b,
|
|
2407
|
-
isLoading: b.isLoading || p.isPending ||
|
|
2450
|
+
isLoading: b.isLoading || p.isPending || C.isFetching || C.isLoading
|
|
2408
2451
|
};
|
|
2409
|
-
},
|
|
2410
|
-
const { queryKey: e, onSuccess: s, ...t } =
|
|
2452
|
+
}, dn = (n) => {
|
|
2453
|
+
const { queryKey: e, onSuccess: s, ...t } = n, r = Z(), { showStackNotifications: o } = oe(), { t: i } = E(), { open: c, onClick: a, close: l, dialogFn: u, isLoading: d } = ze({
|
|
2411
2454
|
onSuccessMessage: i("_pages:common.actions.restore.successMessage"),
|
|
2412
2455
|
onError: (f) => {
|
|
2413
2456
|
const p = f;
|
|
@@ -2416,25 +2459,25 @@ const es = (r) => {
|
|
|
2416
2459
|
p.errors.map(
|
|
2417
2460
|
([b, y]) => ({
|
|
2418
2461
|
message: i(`_pages:${b}.errors.${y}`),
|
|
2419
|
-
type:
|
|
2462
|
+
type: F.error
|
|
2420
2463
|
})
|
|
2421
2464
|
)
|
|
2422
2465
|
);
|
|
2423
|
-
else if (
|
|
2466
|
+
else if (ve(p)) {
|
|
2424
2467
|
const b = p.message || i("_accessibility:errors.500"), y = i(`_accessibility:errors.${p.status}`);
|
|
2425
2468
|
o([
|
|
2426
2469
|
{
|
|
2427
2470
|
message: y || b,
|
|
2428
|
-
type:
|
|
2471
|
+
type: F.error
|
|
2429
2472
|
}
|
|
2430
2473
|
]);
|
|
2431
2474
|
}
|
|
2432
2475
|
},
|
|
2433
2476
|
onSuccess: async (f) => {
|
|
2434
|
-
await
|
|
2477
|
+
await r.invalidateQueries({ queryKey: e }), s && s(f);
|
|
2435
2478
|
},
|
|
2436
2479
|
...t
|
|
2437
|
-
}), { action:
|
|
2480
|
+
}), { action: h } = os({ onClick: a });
|
|
2438
2481
|
return {
|
|
2439
2482
|
onClick: a,
|
|
2440
2483
|
title: i("_pages:common.actions.restore.dialog.title"),
|
|
@@ -2442,26 +2485,26 @@ const es = (r) => {
|
|
|
2442
2485
|
isLoading: d,
|
|
2443
2486
|
handleSubmit: () => u.mutate(),
|
|
2444
2487
|
handleClose: l,
|
|
2445
|
-
action:
|
|
2488
|
+
action: h
|
|
2446
2489
|
};
|
|
2447
2490
|
};
|
|
2448
|
-
function
|
|
2449
|
-
const { t: e } =
|
|
2491
|
+
function mn(n) {
|
|
2492
|
+
const { t: e } = E(), s = Z(), {
|
|
2450
2493
|
queryKey: t,
|
|
2451
|
-
mutationFn:
|
|
2494
|
+
mutationFn: r,
|
|
2452
2495
|
entity: o,
|
|
2453
2496
|
fileProcessor: i,
|
|
2454
2497
|
renderCustomPreview: c,
|
|
2455
2498
|
onError: a
|
|
2456
|
-
} =
|
|
2457
|
-
mutationFn:
|
|
2499
|
+
} = n, [l, u] = D(!1), [d, h] = D(null), [f, p] = D(!1), b = re({
|
|
2500
|
+
mutationFn: r,
|
|
2458
2501
|
onError: (g) => {
|
|
2459
2502
|
console.error(g), a == null || a(g);
|
|
2460
2503
|
},
|
|
2461
2504
|
onSuccess: async () => {
|
|
2462
2505
|
await s.invalidateQueries({ queryKey: t });
|
|
2463
2506
|
}
|
|
2464
|
-
}), { action: y } =
|
|
2507
|
+
}), { action: y } = as({
|
|
2465
2508
|
onClick: () => u(!0)
|
|
2466
2509
|
});
|
|
2467
2510
|
return {
|
|
@@ -2471,14 +2514,14 @@ function tr(r) {
|
|
|
2471
2514
|
await b.mutateAsync({
|
|
2472
2515
|
items: d,
|
|
2473
2516
|
override: f
|
|
2474
|
-
}), u(!1),
|
|
2517
|
+
}), u(!1), h(null), p(!1);
|
|
2475
2518
|
} catch (g) {
|
|
2476
2519
|
console.error(g);
|
|
2477
2520
|
}
|
|
2478
2521
|
},
|
|
2479
2522
|
isLoading: b.isPending,
|
|
2480
2523
|
fileProcessor: i,
|
|
2481
|
-
onFileProcessed: (g) =>
|
|
2524
|
+
onFileProcessed: (g) => h(g),
|
|
2482
2525
|
renderCustomPreview: c,
|
|
2483
2526
|
onOverrideChange: (g) => p(g),
|
|
2484
2527
|
open: l,
|
|
@@ -2486,32 +2529,32 @@ function tr(r) {
|
|
|
2486
2529
|
entity: e(`_pages:${o}.title`)
|
|
2487
2530
|
}),
|
|
2488
2531
|
handleClose: () => {
|
|
2489
|
-
u(!1),
|
|
2532
|
+
u(!1), h(null), p(!1);
|
|
2490
2533
|
},
|
|
2491
2534
|
action: y
|
|
2492
2535
|
};
|
|
2493
2536
|
}
|
|
2494
|
-
const
|
|
2495
|
-
const { showSuccessNotification: e } = oe(), { t: s } =
|
|
2537
|
+
const hn = (n) => {
|
|
2538
|
+
const { showSuccessNotification: e } = oe(), { t: s } = E(), {
|
|
2496
2539
|
entity: t,
|
|
2497
|
-
mutationFn:
|
|
2540
|
+
mutationFn: r,
|
|
2498
2541
|
onError: o,
|
|
2499
2542
|
onSuccess: i,
|
|
2500
2543
|
onSuccessMessage: c = s("_pages:common.actions.export.successMessage")
|
|
2501
|
-
} =
|
|
2502
|
-
mutationFn: () =>
|
|
2544
|
+
} = n, a = re({
|
|
2545
|
+
mutationFn: () => r(),
|
|
2503
2546
|
onError: (d) => {
|
|
2504
2547
|
console.error(d), o && o(d);
|
|
2505
2548
|
},
|
|
2506
2549
|
onSuccess: async (d) => {
|
|
2507
|
-
const
|
|
2550
|
+
const h = JSON.stringify(d, null, 2), f = new Blob([h], { type: "application/json" }), p = URL.createObjectURL(f), b = document.createElement("a");
|
|
2508
2551
|
b.href = p, b.download = `${t}.json`, b.click(), URL.revokeObjectURL(p), i && i(d), e({
|
|
2509
2552
|
message: c
|
|
2510
2553
|
});
|
|
2511
2554
|
}
|
|
2512
|
-
}), l =
|
|
2555
|
+
}), l = v(() => {
|
|
2513
2556
|
a.mutate();
|
|
2514
|
-
}, [a]), { action: u } =
|
|
2557
|
+
}, [a]), { action: u } = is({
|
|
2515
2558
|
onClick: l,
|
|
2516
2559
|
isLoading: a.isPending
|
|
2517
2560
|
});
|
|
@@ -2519,19 +2562,19 @@ const sr = (r) => {
|
|
|
2519
2562
|
action: u
|
|
2520
2563
|
};
|
|
2521
2564
|
}, Ae = () => typeof window < "u" ? window.scrollY : 0;
|
|
2522
|
-
function
|
|
2523
|
-
const [e, s] =
|
|
2565
|
+
function cs(n) {
|
|
2566
|
+
const [e, s] = D(Ae), t = v(() => {
|
|
2524
2567
|
s(Ae());
|
|
2525
2568
|
}, []);
|
|
2526
|
-
return
|
|
2569
|
+
return P(() => (window.addEventListener("scroll", t), () => {
|
|
2527
2570
|
window.removeEventListener("scroll", t);
|
|
2528
|
-
}), [t]), e >
|
|
2571
|
+
}), [t]), e > n;
|
|
2529
2572
|
}
|
|
2530
|
-
const
|
|
2531
|
-
const { t: e } =
|
|
2532
|
-
icon: s =
|
|
2573
|
+
const fn = (n) => {
|
|
2574
|
+
const { t: e } = E(), {
|
|
2575
|
+
icon: s = vt,
|
|
2533
2576
|
threshold: t = 200,
|
|
2534
|
-
scrollTop:
|
|
2577
|
+
scrollTop: r = 0,
|
|
2535
2578
|
scrollLeft: o = 0,
|
|
2536
2579
|
tooltip: i = e("_accessibility:buttons.toTop"),
|
|
2537
2580
|
scrollOnClick: c = !0,
|
|
@@ -2539,33 +2582,33 @@ const rr = (r) => {
|
|
|
2539
2582
|
className: l = "",
|
|
2540
2583
|
variant: u = "submit",
|
|
2541
2584
|
color: d = "primary",
|
|
2542
|
-
...
|
|
2543
|
-
} =
|
|
2544
|
-
return /* @__PURE__ */
|
|
2545
|
-
|
|
2585
|
+
...h
|
|
2586
|
+
} = n, f = cs(t);
|
|
2587
|
+
return /* @__PURE__ */ m(
|
|
2588
|
+
W,
|
|
2546
2589
|
{
|
|
2547
2590
|
variant: u,
|
|
2548
2591
|
color: d,
|
|
2549
2592
|
icon: s,
|
|
2550
2593
|
"data-tooltip-id": "tooltip",
|
|
2551
2594
|
onClick: () => {
|
|
2552
|
-
a == null || a(), c &&
|
|
2595
|
+
a == null || a(), c && ns.scrollTo(o, r);
|
|
2553
2596
|
},
|
|
2554
2597
|
className: `to-top ${f ? "show" : "hide"} ${l}`.trim(),
|
|
2555
2598
|
"data-tooltip-content": i,
|
|
2556
|
-
...
|
|
2599
|
+
...h
|
|
2557
2600
|
}
|
|
2558
2601
|
);
|
|
2559
2602
|
};
|
|
2560
|
-
function
|
|
2561
|
-
const { t: e } =
|
|
2562
|
-
if ("children" in
|
|
2563
|
-
const { children:
|
|
2564
|
-
return /* @__PURE__ */
|
|
2603
|
+
function pn(n) {
|
|
2604
|
+
const { t: e } = E();
|
|
2605
|
+
if ("children" in n) {
|
|
2606
|
+
const { children: T, className: k } = n;
|
|
2607
|
+
return /* @__PURE__ */ m("div", { className: `error-container${k ? ` ${k}` : ""}`, children: T });
|
|
2565
2608
|
}
|
|
2566
2609
|
const {
|
|
2567
2610
|
error: t,
|
|
2568
|
-
message:
|
|
2611
|
+
message: r,
|
|
2569
2612
|
iconProps: o,
|
|
2570
2613
|
onRetry: i,
|
|
2571
2614
|
retryLabel: c,
|
|
@@ -2573,72 +2616,72 @@ function nr(r) {
|
|
|
2573
2616
|
messageProps: l,
|
|
2574
2617
|
className: u,
|
|
2575
2618
|
resetErrorBoundary: d
|
|
2576
|
-
} =
|
|
2619
|
+
} = n, h = i ?? d, {
|
|
2577
2620
|
className: f,
|
|
2578
2621
|
children: p,
|
|
2579
2622
|
onClick: b,
|
|
2580
2623
|
...y
|
|
2581
|
-
} = a ?? {}, { className: g, ...
|
|
2582
|
-
return /* @__PURE__ */
|
|
2583
|
-
w && /* @__PURE__ */
|
|
2584
|
-
|
|
2624
|
+
} = a ?? {}, { className: g, ...C } = l ?? {}, w = o !== null;
|
|
2625
|
+
return /* @__PURE__ */ N("div", { className: `error-container${u ? ` ${u}` : ""}`, children: [
|
|
2626
|
+
w && /* @__PURE__ */ m(
|
|
2627
|
+
U,
|
|
2585
2628
|
{
|
|
2586
2629
|
...o,
|
|
2587
|
-
icon: (o == null ? void 0 : o.icon) ??
|
|
2630
|
+
icon: (o == null ? void 0 : o.icon) ?? $t,
|
|
2588
2631
|
className: `error-icon${o != null && o.className ? ` ${o.className}` : ""}`
|
|
2589
2632
|
}
|
|
2590
2633
|
),
|
|
2591
|
-
/* @__PURE__ */
|
|
2634
|
+
/* @__PURE__ */ m(
|
|
2592
2635
|
"p",
|
|
2593
2636
|
{
|
|
2594
|
-
...
|
|
2637
|
+
...C,
|
|
2595
2638
|
className: `error-message${g ? ` ${g}` : ""}`,
|
|
2596
|
-
children:
|
|
2639
|
+
children: r ?? (t == null ? void 0 : t.message) ?? e("_accessibility:errors.unknownError")
|
|
2597
2640
|
}
|
|
2598
2641
|
),
|
|
2599
|
-
|
|
2600
|
-
|
|
2642
|
+
h && /* @__PURE__ */ m(
|
|
2643
|
+
V,
|
|
2601
2644
|
{
|
|
2602
2645
|
type: "button",
|
|
2603
2646
|
variant: "submit",
|
|
2604
2647
|
color: "primary",
|
|
2605
2648
|
...y,
|
|
2606
2649
|
className: `error-retry ${f ? ` ${f}` : ""}`,
|
|
2607
|
-
onClick: (
|
|
2608
|
-
b == null || b(
|
|
2650
|
+
onClick: (T) => {
|
|
2651
|
+
b == null || b(T), T.defaultPrevented || h();
|
|
2609
2652
|
},
|
|
2610
2653
|
children: p ?? c ?? e("_accessibility:actions.retry", { defaultValue: "Retry" })
|
|
2611
2654
|
}
|
|
2612
2655
|
)
|
|
2613
2656
|
] });
|
|
2614
2657
|
}
|
|
2615
|
-
const
|
|
2616
|
-
const { showBackButton: e, title: s, actions: t } =
|
|
2617
|
-
return /* @__PURE__ */
|
|
2618
|
-
/* @__PURE__ */
|
|
2619
|
-
e && /* @__PURE__ */
|
|
2620
|
-
|
|
2658
|
+
const ls = (n) => {
|
|
2659
|
+
const { showBackButton: e, title: s, actions: t } = n, { t: r } = E(), { navigate: o } = ie();
|
|
2660
|
+
return /* @__PURE__ */ N("div", { className: "page-header", children: [
|
|
2661
|
+
/* @__PURE__ */ N("div", { className: "page-header-left", children: [
|
|
2662
|
+
e && /* @__PURE__ */ m(
|
|
2663
|
+
W,
|
|
2621
2664
|
{
|
|
2622
|
-
icon:
|
|
2665
|
+
icon: Ct,
|
|
2623
2666
|
onClick: () => o(-1),
|
|
2624
2667
|
className: "page-header-back",
|
|
2625
|
-
name:
|
|
2668
|
+
name: r("_accessibility:buttons.back"),
|
|
2626
2669
|
"data-tooltip-id": "tooltip",
|
|
2627
|
-
"data-tooltip-content":
|
|
2670
|
+
"data-tooltip-content": r("_accessibility:buttons.back")
|
|
2628
2671
|
}
|
|
2629
2672
|
),
|
|
2630
|
-
/* @__PURE__ */
|
|
2673
|
+
/* @__PURE__ */ m("h2", { className: "page-header-title", children: s })
|
|
2631
2674
|
] }),
|
|
2632
|
-
/* @__PURE__ */
|
|
2633
|
-
/* @__PURE__ */
|
|
2634
|
-
|
|
2675
|
+
/* @__PURE__ */ N("div", { children: [
|
|
2676
|
+
/* @__PURE__ */ m(
|
|
2677
|
+
lt,
|
|
2635
2678
|
{
|
|
2636
2679
|
className: "page-header-actions-desktop",
|
|
2637
2680
|
actions: t ?? []
|
|
2638
2681
|
}
|
|
2639
2682
|
),
|
|
2640
|
-
/* @__PURE__ */
|
|
2641
|
-
|
|
2683
|
+
/* @__PURE__ */ m(
|
|
2684
|
+
ut,
|
|
2642
2685
|
{
|
|
2643
2686
|
className: "page-header-actions-mobile",
|
|
2644
2687
|
actions: t ?? []
|
|
@@ -2646,24 +2689,24 @@ const rs = (r) => {
|
|
|
2646
2689
|
)
|
|
2647
2690
|
] })
|
|
2648
2691
|
] });
|
|
2649
|
-
},
|
|
2692
|
+
}, gn = (n) => {
|
|
2650
2693
|
const {
|
|
2651
2694
|
title: e,
|
|
2652
2695
|
children: s,
|
|
2653
2696
|
addOptions: t,
|
|
2654
|
-
filterOptions:
|
|
2697
|
+
filterOptions: r,
|
|
2655
2698
|
actions: o,
|
|
2656
2699
|
queryKey: i,
|
|
2657
2700
|
isLoading: c = !1,
|
|
2658
2701
|
isAnimated: a = !0,
|
|
2659
2702
|
showBackButton: l = !1
|
|
2660
|
-
} =
|
|
2703
|
+
} = n, { t: u } = E(), d = Z(), { countOfFilters: h } = dt(), f = q(() => {
|
|
2661
2704
|
const p = Array.isArray(o) ? [...o] : [];
|
|
2662
2705
|
if (i) {
|
|
2663
2706
|
const b = {
|
|
2664
|
-
id:
|
|
2707
|
+
id: Y.Refresh,
|
|
2665
2708
|
onClick: () => d.invalidateQueries({ queryKey: i }),
|
|
2666
|
-
icon: /* @__PURE__ */
|
|
2709
|
+
icon: /* @__PURE__ */ m(U, { icon: Re }),
|
|
2667
2710
|
tooltip: u("_pages:common.actions.refresh.text")
|
|
2668
2711
|
};
|
|
2669
2712
|
p.unshift(b);
|
|
@@ -2671,21 +2714,21 @@ const rs = (r) => {
|
|
|
2671
2714
|
if (t) {
|
|
2672
2715
|
const b = {
|
|
2673
2716
|
...t,
|
|
2674
|
-
id:
|
|
2675
|
-
icon: /* @__PURE__ */
|
|
2717
|
+
id: Y.Add,
|
|
2718
|
+
icon: /* @__PURE__ */ m(U, { icon: Te })
|
|
2676
2719
|
};
|
|
2677
2720
|
p.unshift(b);
|
|
2678
2721
|
}
|
|
2679
|
-
if (
|
|
2722
|
+
if (r) {
|
|
2680
2723
|
const b = {
|
|
2681
|
-
...
|
|
2724
|
+
...r,
|
|
2682
2725
|
id: "filter",
|
|
2683
|
-
icon: /* @__PURE__ */
|
|
2684
|
-
children: /* @__PURE__ */
|
|
2685
|
-
|
|
2726
|
+
icon: /* @__PURE__ */ m(U, { icon: Tt }),
|
|
2727
|
+
children: /* @__PURE__ */ m(
|
|
2728
|
+
mt,
|
|
2686
2729
|
{
|
|
2687
|
-
className: `${
|
|
2688
|
-
count:
|
|
2730
|
+
className: `${h > 0 ? "show" : "hide"} `,
|
|
2731
|
+
count: h
|
|
2689
2732
|
}
|
|
2690
2733
|
)
|
|
2691
2734
|
};
|
|
@@ -2695,26 +2738,26 @@ const rs = (r) => {
|
|
|
2695
2738
|
}, [
|
|
2696
2739
|
o,
|
|
2697
2740
|
t,
|
|
2698
|
-
|
|
2699
|
-
|
|
2741
|
+
h,
|
|
2742
|
+
r,
|
|
2700
2743
|
d,
|
|
2701
2744
|
i,
|
|
2702
2745
|
u
|
|
2703
2746
|
]);
|
|
2704
|
-
return /* @__PURE__ */
|
|
2705
|
-
/* @__PURE__ */
|
|
2706
|
-
|
|
2747
|
+
return /* @__PURE__ */ N("main", { className: "page-main", children: [
|
|
2748
|
+
/* @__PURE__ */ m(
|
|
2749
|
+
ls,
|
|
2707
2750
|
{
|
|
2708
2751
|
showBackButton: l,
|
|
2709
2752
|
actions: f,
|
|
2710
2753
|
title: e
|
|
2711
2754
|
}
|
|
2712
2755
|
),
|
|
2713
|
-
/* @__PURE__ */
|
|
2714
|
-
t && /* @__PURE__ */
|
|
2715
|
-
|
|
2756
|
+
/* @__PURE__ */ m("div", { className: `page-main-content ${a ? "appear" : ""}`, children: c ? /* @__PURE__ */ m(ne, { className: "page-loading" }) : s }),
|
|
2757
|
+
t && /* @__PURE__ */ m(
|
|
2758
|
+
W,
|
|
2716
2759
|
{
|
|
2717
|
-
icon: t.icon ??
|
|
2760
|
+
icon: t.icon ?? Te,
|
|
2718
2761
|
color: t.color ?? "primary",
|
|
2719
2762
|
variant: t.variant ?? "submit",
|
|
2720
2763
|
onClick: () => {
|
|
@@ -2725,11 +2768,11 @@ const rs = (r) => {
|
|
|
2725
2768
|
}
|
|
2726
2769
|
)
|
|
2727
2770
|
] });
|
|
2728
|
-
},
|
|
2729
|
-
const { t: e } =
|
|
2771
|
+
}, bn = (n) => {
|
|
2772
|
+
const { t: e } = E(), {
|
|
2730
2773
|
className: s = "",
|
|
2731
2774
|
itemClassName: t = "",
|
|
2732
|
-
loading:
|
|
2775
|
+
loading: r = !1,
|
|
2733
2776
|
emptyComponent: o = null,
|
|
2734
2777
|
emptyMessage: i = e("_accessibility:messages.empty"),
|
|
2735
2778
|
renderComponent: c,
|
|
@@ -2737,10 +2780,10 @@ const rs = (r) => {
|
|
|
2737
2780
|
hasMore: l = !1,
|
|
2738
2781
|
loadingMore: u = !1,
|
|
2739
2782
|
onLoadMore: d,
|
|
2740
|
-
loadMoreComponent:
|
|
2783
|
+
loadMoreComponent: h = null,
|
|
2741
2784
|
observerRootMargin: f = "0px 0px 200px 0px",
|
|
2742
2785
|
observerThreshold: p = 0
|
|
2743
|
-
} =
|
|
2786
|
+
} = n, b = K(!1), y = K(null), g = v(async () => {
|
|
2744
2787
|
if (!(!l || !d) && !(u || b.current)) {
|
|
2745
2788
|
b.current = !0;
|
|
2746
2789
|
try {
|
|
@@ -2750,86 +2793,86 @@ const rs = (r) => {
|
|
|
2750
2793
|
}
|
|
2751
2794
|
}
|
|
2752
2795
|
}, [l, u, d]);
|
|
2753
|
-
return
|
|
2796
|
+
return P(() => {
|
|
2754
2797
|
if (!l || !d || !y.current || typeof IntersectionObserver > "u") return;
|
|
2755
|
-
const
|
|
2798
|
+
const C = new IntersectionObserver(
|
|
2756
2799
|
(w) => {
|
|
2757
|
-
w.some((
|
|
2800
|
+
w.some((T) => T.isIntersecting) && g();
|
|
2758
2801
|
},
|
|
2759
2802
|
{
|
|
2760
2803
|
rootMargin: f,
|
|
2761
2804
|
threshold: p
|
|
2762
2805
|
}
|
|
2763
2806
|
);
|
|
2764
|
-
return
|
|
2807
|
+
return C.observe(y.current), () => C.disconnect();
|
|
2765
2808
|
}, [
|
|
2766
2809
|
l,
|
|
2767
2810
|
d,
|
|
2768
2811
|
f,
|
|
2769
2812
|
p,
|
|
2770
2813
|
g
|
|
2771
|
-
]),
|
|
2772
|
-
a == null ? void 0 : a.map((
|
|
2773
|
-
l && d && /* @__PURE__ */
|
|
2774
|
-
] }) : /* @__PURE__ */
|
|
2775
|
-
},
|
|
2814
|
+
]), r ? /* @__PURE__ */ m(ne, {}) : /* @__PURE__ */ m(ce, { children: a != null && a.length ? /* @__PURE__ */ N("ul", { className: `pretty-grid-main ${s}`, children: [
|
|
2815
|
+
a == null ? void 0 : a.map((C) => /* @__PURE__ */ m("li", { className: `pretty-grid-item ${t}`, children: c(C) }, C.id)),
|
|
2816
|
+
l && d && /* @__PURE__ */ m("li", { className: "pretty-grid-load-more", ref: y, children: h })
|
|
2817
|
+
] }) : /* @__PURE__ */ m(ce, { children: o || /* @__PURE__ */ m(ws, { message: i }) }) });
|
|
2818
|
+
}, Je = X({
|
|
2776
2819
|
title: "",
|
|
2777
2820
|
setTitle: () => {
|
|
2778
2821
|
},
|
|
2779
2822
|
rightContent: null,
|
|
2780
2823
|
setRightContent: () => {
|
|
2781
2824
|
}
|
|
2782
|
-
}),
|
|
2783
|
-
const { children: e } =
|
|
2825
|
+
}), yn = (n) => {
|
|
2826
|
+
const { children: e } = n, [s, t] = D(""), [r, o] = D(null), i = v((l) => {
|
|
2784
2827
|
t(l);
|
|
2785
|
-
}, []), c =
|
|
2828
|
+
}, []), c = v((l) => {
|
|
2786
2829
|
o(l);
|
|
2787
|
-
}, []), a =
|
|
2830
|
+
}, []), a = q(
|
|
2788
2831
|
() => ({
|
|
2789
2832
|
title: s,
|
|
2790
2833
|
setTitle: i,
|
|
2791
|
-
rightContent:
|
|
2834
|
+
rightContent: r,
|
|
2792
2835
|
setRightContent: c
|
|
2793
2836
|
}),
|
|
2794
|
-
[s, i,
|
|
2837
|
+
[s, i, r, c]
|
|
2795
2838
|
);
|
|
2796
|
-
return /* @__PURE__ */
|
|
2797
|
-
},
|
|
2798
|
-
function
|
|
2799
|
-
const { t: e } =
|
|
2800
|
-
(
|
|
2839
|
+
return /* @__PURE__ */ m(Je.Provider, { value: a, children: e });
|
|
2840
|
+
}, us = () => G(Je);
|
|
2841
|
+
function wn(n) {
|
|
2842
|
+
const { t: e } = E(), { openDrawer: s, showSearch: t = !0, menuButtonProps: r } = n, { searchComponent: o, location: i } = ie(), { title: c, rightContent: a } = us(), [l, u] = D(!1), d = v((p) => {
|
|
2843
|
+
(Wt() ? p.metaKey : p.ctrlKey) && p.shiftKey && p.key.toLowerCase() === "f" && (u(!0), p.preventDefault());
|
|
2801
2844
|
}, []);
|
|
2802
|
-
|
|
2845
|
+
P(() => (window.addEventListener("keydown", d), () => {
|
|
2803
2846
|
window.removeEventListener("keydown", d);
|
|
2804
2847
|
}), [d]);
|
|
2805
|
-
const
|
|
2806
|
-
return /* @__PURE__ */
|
|
2807
|
-
i.pathname !== "/" && !!
|
|
2808
|
-
/* @__PURE__ */
|
|
2809
|
-
/* @__PURE__ */
|
|
2810
|
-
/* @__PURE__ */
|
|
2811
|
-
|
|
2848
|
+
const h = o, f = t && !!h;
|
|
2849
|
+
return /* @__PURE__ */ N(ce, { children: [
|
|
2850
|
+
i.pathname !== "/" && !!h && /* @__PURE__ */ m(h, { open: l, onClose: () => u(!1) }),
|
|
2851
|
+
/* @__PURE__ */ N("header", { id: "header", className: "header", children: [
|
|
2852
|
+
/* @__PURE__ */ N("div", { className: "navbar-left", children: [
|
|
2853
|
+
/* @__PURE__ */ m(
|
|
2854
|
+
W,
|
|
2812
2855
|
{
|
|
2813
|
-
...
|
|
2814
|
-
type: (
|
|
2815
|
-
icon: (
|
|
2856
|
+
...r,
|
|
2857
|
+
type: (r == null ? void 0 : r.type) ?? "button",
|
|
2858
|
+
icon: (r == null ? void 0 : r.icon) ?? Nt,
|
|
2816
2859
|
onClick: (p) => {
|
|
2817
2860
|
var b;
|
|
2818
|
-
(b =
|
|
2861
|
+
(b = r == null ? void 0 : r.onClick) == null || b.call(r, p), s();
|
|
2819
2862
|
},
|
|
2820
|
-
name: (
|
|
2821
|
-
"aria-label": (
|
|
2822
|
-
className: `navbar-menu animated ${(
|
|
2863
|
+
name: (r == null ? void 0 : r.name) ?? e("_accessibility:buttons.openMenu"),
|
|
2864
|
+
"aria-label": (r == null ? void 0 : r["aria-label"]) ?? e("_accessibility:ariaLabels.openMenu"),
|
|
2865
|
+
className: `navbar-menu animated ${(r == null ? void 0 : r.className) ?? ""}`
|
|
2823
2866
|
}
|
|
2824
2867
|
),
|
|
2825
|
-
/* @__PURE__ */
|
|
2868
|
+
/* @__PURE__ */ m("h1", { className: "poppins navbar-title", children: c || e("_pages:home.appName") })
|
|
2826
2869
|
] }),
|
|
2827
|
-
/* @__PURE__ */
|
|
2870
|
+
/* @__PURE__ */ N("div", { className: "navbar-right", children: [
|
|
2828
2871
|
a,
|
|
2829
|
-
f && /* @__PURE__ */
|
|
2830
|
-
|
|
2872
|
+
f && /* @__PURE__ */ m(
|
|
2873
|
+
W,
|
|
2831
2874
|
{
|
|
2832
|
-
icon:
|
|
2875
|
+
icon: kt,
|
|
2833
2876
|
className: "navbar-search-btn",
|
|
2834
2877
|
onClick: () => u(!0)
|
|
2835
2878
|
}
|
|
@@ -2838,63 +2881,63 @@ function cr(r) {
|
|
|
2838
2881
|
] })
|
|
2839
2882
|
] });
|
|
2840
2883
|
}
|
|
2841
|
-
const ue = 300,
|
|
2842
|
-
switch (
|
|
2843
|
-
case
|
|
2844
|
-
return
|
|
2884
|
+
const ue = 300, ds = (n) => n ?? F.error, ms = (n) => {
|
|
2885
|
+
switch (n) {
|
|
2886
|
+
case F.error:
|
|
2887
|
+
return At;
|
|
2845
2888
|
default:
|
|
2846
|
-
return
|
|
2889
|
+
return Et;
|
|
2847
2890
|
}
|
|
2848
|
-
}, ge = (
|
|
2849
|
-
switch (
|
|
2850
|
-
case
|
|
2891
|
+
}, ge = (n) => {
|
|
2892
|
+
switch (n) {
|
|
2893
|
+
case F.success:
|
|
2851
2894
|
return "!text-success";
|
|
2852
|
-
case
|
|
2895
|
+
case F.error:
|
|
2853
2896
|
return "!text-error";
|
|
2854
|
-
case
|
|
2897
|
+
case F.warning:
|
|
2855
2898
|
return "!text-warning";
|
|
2856
2899
|
default:
|
|
2857
2900
|
return "!text-info";
|
|
2858
2901
|
}
|
|
2859
|
-
},
|
|
2860
|
-
switch (
|
|
2861
|
-
case
|
|
2902
|
+
}, hs = (n) => {
|
|
2903
|
+
switch (n) {
|
|
2904
|
+
case F.success:
|
|
2862
2905
|
return "bg-bg-success";
|
|
2863
|
-
case
|
|
2906
|
+
case F.error:
|
|
2864
2907
|
return "bg-bg-error";
|
|
2865
|
-
case
|
|
2908
|
+
case F.warning:
|
|
2866
2909
|
return "bg-bg-warning";
|
|
2867
2910
|
default:
|
|
2868
2911
|
return "bg-bg-info";
|
|
2869
2912
|
}
|
|
2870
2913
|
};
|
|
2871
|
-
function
|
|
2872
|
-
const { t:
|
|
2873
|
-
|
|
2914
|
+
function Sn() {
|
|
2915
|
+
const { t: n } = E(), { notification: e, removeNotification: s } = oe(), [t, r] = D([]), o = K(t);
|
|
2916
|
+
ft(() => {
|
|
2874
2917
|
o.current = t;
|
|
2875
2918
|
});
|
|
2876
|
-
const i =
|
|
2919
|
+
const i = K(null), c = v(
|
|
2877
2920
|
(a) => {
|
|
2878
|
-
|
|
2921
|
+
r(
|
|
2879
2922
|
(l) => a !== void 0 ? l.map((u) => u.id === a ? { ...u, closing: !0 } : u) : l.map((u) => ({ ...u, closing: !0 }))
|
|
2880
2923
|
), a !== void 0 ? setTimeout(() => {
|
|
2881
|
-
s(a),
|
|
2924
|
+
s(a), r((l) => l.filter((u) => u.id !== a));
|
|
2882
2925
|
}, ue) : (i.current && clearTimeout(i.current), i.current = setTimeout(() => {
|
|
2883
|
-
s(),
|
|
2926
|
+
s(), r([]), i.current = null;
|
|
2884
2927
|
}, ue));
|
|
2885
2928
|
},
|
|
2886
2929
|
[s]
|
|
2887
2930
|
);
|
|
2888
|
-
return
|
|
2931
|
+
return P(() => {
|
|
2889
2932
|
let a = null;
|
|
2890
2933
|
const l = () => {
|
|
2891
2934
|
a && clearTimeout(a), i.current && (clearTimeout(i.current), i.current = null);
|
|
2892
2935
|
};
|
|
2893
2936
|
if (e.length === 0)
|
|
2894
2937
|
return o.current.length === 0 ? void 0 : (i.current && clearTimeout(i.current), a = setTimeout(() => {
|
|
2895
|
-
|
|
2938
|
+
r((f) => f.map((p) => ({ ...p, closing: !0 }))), a = null;
|
|
2896
2939
|
}, 0), i.current = setTimeout(() => {
|
|
2897
|
-
|
|
2940
|
+
r([]), i.current = null;
|
|
2898
2941
|
}, ue), l);
|
|
2899
2942
|
const u = new Set(o.current.map((f) => f.id));
|
|
2900
2943
|
if (!e.some(
|
|
@@ -2903,21 +2946,21 @@ function lr() {
|
|
|
2903
2946
|
if (o.current.length === 0) {
|
|
2904
2947
|
const f = [...e];
|
|
2905
2948
|
return a = setTimeout(() => {
|
|
2906
|
-
|
|
2949
|
+
r(f.map((p) => ({ ...p, closing: !1 }))), a = null;
|
|
2907
2950
|
}, 0), () => {
|
|
2908
2951
|
a && clearTimeout(a);
|
|
2909
2952
|
};
|
|
2910
2953
|
}
|
|
2911
2954
|
i.current && clearTimeout(i.current), a = setTimeout(() => {
|
|
2912
|
-
|
|
2955
|
+
r(
|
|
2913
2956
|
(f) => f.every((p) => p.closing) ? f : f.map((p) => ({ ...p, closing: !0 }))
|
|
2914
2957
|
), a = null;
|
|
2915
2958
|
}, 0);
|
|
2916
|
-
const
|
|
2959
|
+
const h = [...e];
|
|
2917
2960
|
return i.current = setTimeout(() => {
|
|
2918
|
-
|
|
2961
|
+
r(h.map((f) => ({ ...f, closing: !1 }))), i.current = null;
|
|
2919
2962
|
}, ue), l;
|
|
2920
|
-
}, [e]),
|
|
2963
|
+
}, [e]), P(() => {
|
|
2921
2964
|
if (!t.length) return;
|
|
2922
2965
|
let a;
|
|
2923
2966
|
const l = window.setTimeout(() => {
|
|
@@ -2928,38 +2971,38 @@ function lr() {
|
|
|
2928
2971
|
return window.addEventListener("keydown", u), () => {
|
|
2929
2972
|
window.clearTimeout(l), a && window.removeEventListener("click", a), window.removeEventListener("keydown", u);
|
|
2930
2973
|
};
|
|
2931
|
-
}, [t.length, c]),
|
|
2932
|
-
/* @__PURE__ */
|
|
2933
|
-
const
|
|
2934
|
-
return /* @__PURE__ */
|
|
2974
|
+
}, [t.length, c]), _e(
|
|
2975
|
+
/* @__PURE__ */ m("div", { className: `notification-portal ${t.length ? "active" : ""}`, children: t.map(({ id: a, type: l, message: u, closing: d }) => {
|
|
2976
|
+
const h = ds(l);
|
|
2977
|
+
return /* @__PURE__ */ N(
|
|
2935
2978
|
"div",
|
|
2936
2979
|
{
|
|
2937
|
-
className: `notification ${d ? "closing" : ""} ${
|
|
2980
|
+
className: `notification ${d ? "closing" : ""} ${hs(h)}`,
|
|
2938
2981
|
onClick: (f) => f.stopPropagation(),
|
|
2939
2982
|
children: [
|
|
2940
|
-
/* @__PURE__ */
|
|
2941
|
-
/* @__PURE__ */
|
|
2942
|
-
|
|
2983
|
+
/* @__PURE__ */ N("div", { className: "notification-body", children: [
|
|
2984
|
+
/* @__PURE__ */ m(
|
|
2985
|
+
U,
|
|
2943
2986
|
{
|
|
2944
|
-
icon:
|
|
2945
|
-
className: `notification-icon ${ge(
|
|
2987
|
+
icon: ms(h),
|
|
2988
|
+
className: `notification-icon ${ge(h)}`
|
|
2946
2989
|
}
|
|
2947
2990
|
),
|
|
2948
|
-
/* @__PURE__ */
|
|
2991
|
+
/* @__PURE__ */ m("p", { className: `notification-text ${ge(h)}`, children: u })
|
|
2949
2992
|
] }),
|
|
2950
|
-
/* @__PURE__ */
|
|
2951
|
-
|
|
2993
|
+
/* @__PURE__ */ m(
|
|
2994
|
+
W,
|
|
2952
2995
|
{
|
|
2953
2996
|
type: "button",
|
|
2954
|
-
icon:
|
|
2997
|
+
icon: Le,
|
|
2955
2998
|
color: "error",
|
|
2956
2999
|
className: "notification-close group",
|
|
2957
3000
|
onClick: (f) => {
|
|
2958
3001
|
f.stopPropagation(), a !== void 0 && c(a);
|
|
2959
3002
|
},
|
|
2960
|
-
iconClassName: `${ge(
|
|
2961
|
-
name:
|
|
2962
|
-
"aria-label":
|
|
3003
|
+
iconClassName: `${ge(h)} notification-close-icon`,
|
|
3004
|
+
name: n("_accessibility:buttons.closeNotification"),
|
|
3005
|
+
"aria-label": n("_accessibility:ariaLabels.closeNotification")
|
|
2963
3006
|
}
|
|
2964
3007
|
)
|
|
2965
3008
|
]
|
|
@@ -2970,78 +3013,78 @@ function lr() {
|
|
|
2970
3013
|
document.body
|
|
2971
3014
|
);
|
|
2972
3015
|
}
|
|
2973
|
-
function
|
|
2974
|
-
const { className: e, ...s } =
|
|
2975
|
-
return /* @__PURE__ */
|
|
2976
|
-
|
|
3016
|
+
function vn(n) {
|
|
3017
|
+
const { className: e, ...s } = n;
|
|
3018
|
+
return /* @__PURE__ */ m("div", { className: "splash-screen", children: /* @__PURE__ */ m(
|
|
3019
|
+
ne,
|
|
2977
3020
|
{
|
|
2978
3021
|
className: `blur-appear ${e ? ` ${e}` : ""}`,
|
|
2979
3022
|
...s
|
|
2980
3023
|
}
|
|
2981
3024
|
) });
|
|
2982
3025
|
}
|
|
2983
|
-
const
|
|
3026
|
+
const fs = (n) => {
|
|
2984
3027
|
const {
|
|
2985
3028
|
id: e,
|
|
2986
3029
|
active: s,
|
|
2987
3030
|
onClick: t,
|
|
2988
|
-
children:
|
|
3031
|
+
children: r,
|
|
2989
3032
|
to: o,
|
|
2990
3033
|
useLinks: i = !0,
|
|
2991
3034
|
tabButtonProps: c
|
|
2992
|
-
} =
|
|
3035
|
+
} = n, { linkComponent: a } = ie(), l = a;
|
|
2993
3036
|
if (!i) {
|
|
2994
3037
|
const {
|
|
2995
3038
|
className: d = "",
|
|
2996
|
-
variant:
|
|
3039
|
+
variant: h = s ? "submit" : "outlined",
|
|
2997
3040
|
color: f = s ? "primary" : "default",
|
|
2998
3041
|
...p
|
|
2999
3042
|
} = c ?? {};
|
|
3000
|
-
return /* @__PURE__ */
|
|
3001
|
-
|
|
3043
|
+
return /* @__PURE__ */ m(
|
|
3044
|
+
V,
|
|
3002
3045
|
{
|
|
3003
3046
|
type: "button",
|
|
3004
|
-
variant:
|
|
3047
|
+
variant: h,
|
|
3005
3048
|
color: f,
|
|
3006
3049
|
className: `tab ${d}`,
|
|
3007
3050
|
onClick: t,
|
|
3008
3051
|
...p,
|
|
3009
|
-
children:
|
|
3052
|
+
children: r
|
|
3010
3053
|
}
|
|
3011
3054
|
);
|
|
3012
3055
|
}
|
|
3013
3056
|
const u = `button submit tab ${s ? "primary" : "outlined"} ${(c == null ? void 0 : c.className) ?? ""}`.trim();
|
|
3014
|
-
return /* @__PURE__ */
|
|
3057
|
+
return /* @__PURE__ */ m(
|
|
3015
3058
|
l,
|
|
3016
3059
|
{
|
|
3017
3060
|
to: o ?? `#${e}`,
|
|
3018
3061
|
onClick: () => t(),
|
|
3019
3062
|
className: u,
|
|
3020
|
-
children:
|
|
3063
|
+
children: r
|
|
3021
3064
|
}
|
|
3022
3065
|
);
|
|
3023
|
-
},
|
|
3066
|
+
}, ps = (n) => {
|
|
3024
3067
|
var f;
|
|
3025
3068
|
const {
|
|
3026
3069
|
tabs: e = [],
|
|
3027
3070
|
defaultTab: s,
|
|
3028
3071
|
currentTab: t,
|
|
3029
|
-
onTabChange:
|
|
3072
|
+
onTabChange: r,
|
|
3030
3073
|
className: o = "",
|
|
3031
3074
|
tabsContainerClassName: i = "",
|
|
3032
3075
|
useLinks: c = !0,
|
|
3033
3076
|
tabButtonProps: a
|
|
3034
|
-
} =
|
|
3035
|
-
return /* @__PURE__ */
|
|
3036
|
-
/* @__PURE__ */
|
|
3077
|
+
} = n, [l, u] = D(s ?? ((f = e[0]) == null ? void 0 : f.id)), d = t ?? l, h = q(() => e.find((p) => p.id === d), [e, d]);
|
|
3078
|
+
return /* @__PURE__ */ N("div", { className: `tabs-layout-main ${o}`, children: [
|
|
3079
|
+
/* @__PURE__ */ m(
|
|
3037
3080
|
"ul",
|
|
3038
3081
|
{
|
|
3039
3082
|
className: `horizontal tabs tabs-container ${i}`,
|
|
3040
|
-
children: e.map(({ id: p, to: b, label: y }) => /* @__PURE__ */
|
|
3041
|
-
|
|
3083
|
+
children: e.map(({ id: p, to: b, label: y }) => /* @__PURE__ */ m("li", { children: /* @__PURE__ */ m(
|
|
3084
|
+
fs,
|
|
3042
3085
|
{
|
|
3043
3086
|
onClick: () => {
|
|
3044
|
-
t === void 0 && u(p),
|
|
3087
|
+
t === void 0 && u(p), r == null || r(p);
|
|
3045
3088
|
},
|
|
3046
3089
|
id: p,
|
|
3047
3090
|
to: b,
|
|
@@ -3054,29 +3097,29 @@ const cs = (r) => {
|
|
|
3054
3097
|
) }, p))
|
|
3055
3098
|
}
|
|
3056
3099
|
),
|
|
3057
|
-
|
|
3100
|
+
h == null ? void 0 : h.content
|
|
3058
3101
|
] });
|
|
3059
|
-
},
|
|
3102
|
+
}, gs = (n) => {
|
|
3060
3103
|
const {
|
|
3061
3104
|
title: e,
|
|
3062
3105
|
body: s,
|
|
3063
3106
|
content: t,
|
|
3064
|
-
onClickNext:
|
|
3107
|
+
onClickNext: r,
|
|
3065
3108
|
onSkip: o,
|
|
3066
3109
|
onStartAsGuest: i,
|
|
3067
3110
|
onSignIn: c,
|
|
3068
3111
|
image: a = "",
|
|
3069
3112
|
alt: l = "",
|
|
3070
3113
|
final: u = !1
|
|
3071
|
-
} =
|
|
3072
|
-
return /* @__PURE__ */
|
|
3073
|
-
a && /* @__PURE__ */
|
|
3074
|
-
e != null && /* @__PURE__ */
|
|
3075
|
-
s != null && /* @__PURE__ */
|
|
3076
|
-
t != null && /* @__PURE__ */
|
|
3077
|
-
/* @__PURE__ */
|
|
3078
|
-
/* @__PURE__ */
|
|
3079
|
-
|
|
3114
|
+
} = n, { t: d } = E();
|
|
3115
|
+
return /* @__PURE__ */ N("div", { className: "big-appear step-container", children: [
|
|
3116
|
+
a && /* @__PURE__ */ m("img", { src: a, alt: l }),
|
|
3117
|
+
e != null && /* @__PURE__ */ m("h2", { className: "step-title", children: e }),
|
|
3118
|
+
s != null && /* @__PURE__ */ m("div", { className: "step-body", children: s }),
|
|
3119
|
+
t != null && /* @__PURE__ */ m("div", { className: "step-content", children: t }),
|
|
3120
|
+
/* @__PURE__ */ m("div", { className: "step-actions", children: u ? /* @__PURE__ */ N(ce, { children: [
|
|
3121
|
+
/* @__PURE__ */ m(
|
|
3122
|
+
V,
|
|
3080
3123
|
{
|
|
3081
3124
|
color: "primary",
|
|
3082
3125
|
className: "step-button",
|
|
@@ -3086,8 +3129,8 @@ const cs = (r) => {
|
|
|
3086
3129
|
children: d("_accessibility:buttons.startAsGuest")
|
|
3087
3130
|
}
|
|
3088
3131
|
),
|
|
3089
|
-
/* @__PURE__ */
|
|
3090
|
-
|
|
3132
|
+
/* @__PURE__ */ m(
|
|
3133
|
+
V,
|
|
3091
3134
|
{
|
|
3092
3135
|
color: "primary",
|
|
3093
3136
|
variant: "submit",
|
|
@@ -3097,9 +3140,9 @@ const cs = (r) => {
|
|
|
3097
3140
|
children: d("_accessibility:buttons.signIn")
|
|
3098
3141
|
}
|
|
3099
3142
|
)
|
|
3100
|
-
] }) : /* @__PURE__ */
|
|
3101
|
-
/* @__PURE__ */
|
|
3102
|
-
|
|
3143
|
+
] }) : /* @__PURE__ */ N(ce, { children: [
|
|
3144
|
+
/* @__PURE__ */ m(
|
|
3145
|
+
V,
|
|
3103
3146
|
{
|
|
3104
3147
|
color: "primary",
|
|
3105
3148
|
className: "step-button",
|
|
@@ -3109,62 +3152,62 @@ const cs = (r) => {
|
|
|
3109
3152
|
children: d("_accessibility:buttons.skip")
|
|
3110
3153
|
}
|
|
3111
3154
|
),
|
|
3112
|
-
/* @__PURE__ */
|
|
3113
|
-
|
|
3155
|
+
/* @__PURE__ */ m(
|
|
3156
|
+
V,
|
|
3114
3157
|
{
|
|
3115
3158
|
color: "primary",
|
|
3116
3159
|
className: "step-button",
|
|
3117
3160
|
variant: "outlined",
|
|
3118
|
-
onClick: () =>
|
|
3161
|
+
onClick: () => r(),
|
|
3119
3162
|
"aria-label": d("_accessibility:ariaLabels.next"),
|
|
3120
3163
|
children: d("_accessibility:buttons.next")
|
|
3121
3164
|
}
|
|
3122
3165
|
)
|
|
3123
3166
|
] }) })
|
|
3124
3167
|
] });
|
|
3125
|
-
},
|
|
3168
|
+
}, Cn = (n) => {
|
|
3126
3169
|
const {
|
|
3127
3170
|
steps: e,
|
|
3128
3171
|
signInPath: s = "/auth/sign-in",
|
|
3129
3172
|
guestPath: t = "/",
|
|
3130
|
-
onSkip:
|
|
3173
|
+
onSkip: r,
|
|
3131
3174
|
onSignIn: o,
|
|
3132
3175
|
onStartAsGuest: i
|
|
3133
|
-
} =
|
|
3134
|
-
if (
|
|
3135
|
-
|
|
3176
|
+
} = n, c = je(), { navigate: a } = ie(), [l, u] = D(1), d = v(() => {
|
|
3177
|
+
if (r) {
|
|
3178
|
+
r();
|
|
3136
3179
|
return;
|
|
3137
3180
|
}
|
|
3138
3181
|
a(s);
|
|
3139
|
-
}, [a,
|
|
3182
|
+
}, [a, r, s]), h = v(() => {
|
|
3140
3183
|
if (o) {
|
|
3141
3184
|
o();
|
|
3142
3185
|
return;
|
|
3143
3186
|
}
|
|
3144
3187
|
a(s);
|
|
3145
|
-
}, [a, o, s]), f =
|
|
3188
|
+
}, [a, o, s]), f = v(() => {
|
|
3146
3189
|
if (i) {
|
|
3147
3190
|
i();
|
|
3148
3191
|
return;
|
|
3149
3192
|
}
|
|
3150
3193
|
c == null || c.setGuestMode(!0), a(t);
|
|
3151
|
-
}, [c, t, a, i]), p =
|
|
3194
|
+
}, [c, t, a, i]), p = q(() => e.map((b, y) => ({
|
|
3152
3195
|
id: y + 1,
|
|
3153
3196
|
label: "",
|
|
3154
|
-
content: /* @__PURE__ */
|
|
3155
|
-
|
|
3197
|
+
content: /* @__PURE__ */ m(
|
|
3198
|
+
gs,
|
|
3156
3199
|
{
|
|
3157
3200
|
...b,
|
|
3158
3201
|
final: y === e.length - 1,
|
|
3159
3202
|
onClickNext: () => u((g) => g + 1),
|
|
3160
3203
|
onSkip: d,
|
|
3161
3204
|
onStartAsGuest: f,
|
|
3162
|
-
onSignIn:
|
|
3205
|
+
onSignIn: h
|
|
3163
3206
|
}
|
|
3164
3207
|
)
|
|
3165
|
-
})), [
|
|
3166
|
-
return /* @__PURE__ */
|
|
3167
|
-
|
|
3208
|
+
})), [h, d, f, e]);
|
|
3209
|
+
return /* @__PURE__ */ m("div", { className: "onboarding-main", children: /* @__PURE__ */ m(
|
|
3210
|
+
ps,
|
|
3168
3211
|
{
|
|
3169
3212
|
currentTab: l,
|
|
3170
3213
|
onTabChange: (b) => u(Number(b)),
|
|
@@ -3172,109 +3215,198 @@ const cs = (r) => {
|
|
|
3172
3215
|
useLinks: !1
|
|
3173
3216
|
}
|
|
3174
3217
|
) });
|
|
3175
|
-
},
|
|
3218
|
+
}, bs = (n, e) => e === "/" ? n === "/" : n.startsWith(e), ys = (n) => {
|
|
3219
|
+
const e = n.filter((s) => !s.hidden);
|
|
3220
|
+
return {
|
|
3221
|
+
leftItems: e.filter((s) => s.position !== "right"),
|
|
3222
|
+
rightItems: e.filter((s) => s.position === "right")
|
|
3223
|
+
};
|
|
3224
|
+
}, xe = ({
|
|
3225
|
+
item: n,
|
|
3226
|
+
isActive: e,
|
|
3227
|
+
linkComponent: s
|
|
3228
|
+
}) => {
|
|
3229
|
+
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;
|
|
3230
|
+
return n.disabled ? /* @__PURE__ */ N(
|
|
3231
|
+
"span",
|
|
3232
|
+
{
|
|
3233
|
+
className: `${o} opacity-50 cursor-not-allowed`,
|
|
3234
|
+
"aria-disabled": !0,
|
|
3235
|
+
children: [
|
|
3236
|
+
/* @__PURE__ */ m("span", { className: "text-lg", children: /* @__PURE__ */ m(U, { icon: n.icon }) }),
|
|
3237
|
+
/* @__PURE__ */ m("span", { className: "text-[10px] leading-tight", children: n.label })
|
|
3238
|
+
]
|
|
3239
|
+
}
|
|
3240
|
+
) : /* @__PURE__ */ N(s, { to: n.to, className: o, "aria-label": i, children: [
|
|
3241
|
+
/* @__PURE__ */ m("span", { className: "text-lg", children: /* @__PURE__ */ m(U, { icon: n.icon }) }),
|
|
3242
|
+
/* @__PURE__ */ m("span", { className: "text-[10px] leading-tight", children: n.label })
|
|
3243
|
+
] });
|
|
3244
|
+
}, Tn = (n) => {
|
|
3245
|
+
var j;
|
|
3246
|
+
const { items: e, centerAction: s, className: t = "", isItemActive: r } = n, o = (j = Ve()) == null ? void 0 : j.centerAction, i = o ? { ...s ?? {}, ...o } : s, { location: c, navigate: a, linkComponent: l } = ie(), { leftItems: u, rightItems: d } = q(
|
|
3247
|
+
() => ys(e),
|
|
3248
|
+
[e]
|
|
3249
|
+
), {
|
|
3250
|
+
hidden: h,
|
|
3251
|
+
to: f,
|
|
3252
|
+
icon: p = xt,
|
|
3253
|
+
ariaLabel: b = "Bottom navigation action",
|
|
3254
|
+
onClick: y,
|
|
3255
|
+
variant: g = "submit",
|
|
3256
|
+
color: C = "primary",
|
|
3257
|
+
className: w = "",
|
|
3258
|
+
...T
|
|
3259
|
+
} = i ?? {}, k = !!i && !h, O = (S) => r ? r(c.pathname, S) : bs(c.pathname, S.to);
|
|
3260
|
+
return /* @__PURE__ */ m(
|
|
3261
|
+
"nav",
|
|
3262
|
+
{
|
|
3263
|
+
className: `fixed -bottom-1 left-0 right-0 z-20 bg-base border-t border-border sm:hidden ${t}`.trim(),
|
|
3264
|
+
children: /* @__PURE__ */ N("div", { className: "flex items-center justify-around h-16", children: [
|
|
3265
|
+
u.map((S) => /* @__PURE__ */ m(
|
|
3266
|
+
xe,
|
|
3267
|
+
{
|
|
3268
|
+
item: S,
|
|
3269
|
+
isActive: O(S),
|
|
3270
|
+
linkComponent: l
|
|
3271
|
+
},
|
|
3272
|
+
S.id
|
|
3273
|
+
)),
|
|
3274
|
+
k && /* @__PURE__ */ m("div", { className: "flex items-center justify-center flex-1", children: /* @__PURE__ */ m(
|
|
3275
|
+
W,
|
|
3276
|
+
{
|
|
3277
|
+
...T,
|
|
3278
|
+
type: "button",
|
|
3279
|
+
variant: g,
|
|
3280
|
+
color: C,
|
|
3281
|
+
icon: p,
|
|
3282
|
+
name: b,
|
|
3283
|
+
"aria-label": b,
|
|
3284
|
+
onClick: (S) => {
|
|
3285
|
+
y == null || y(S), !S.defaultPrevented && f && a(f);
|
|
3286
|
+
},
|
|
3287
|
+
className: `rounded-full! w-12! h-12! min-w-0! p-0! flex items-center justify-center shadow-lg -mt-4 ${w}`.trim()
|
|
3288
|
+
}
|
|
3289
|
+
) }),
|
|
3290
|
+
d.map((S) => /* @__PURE__ */ m(
|
|
3291
|
+
xe,
|
|
3292
|
+
{
|
|
3293
|
+
item: S,
|
|
3294
|
+
isActive: O(S),
|
|
3295
|
+
linkComponent: l
|
|
3296
|
+
},
|
|
3297
|
+
S.id
|
|
3298
|
+
))
|
|
3299
|
+
] })
|
|
3300
|
+
}
|
|
3301
|
+
);
|
|
3302
|
+
}, ws = (n) => {
|
|
3176
3303
|
const {
|
|
3177
3304
|
message: e,
|
|
3178
3305
|
messageProps: s = { className: "empty-message" },
|
|
3179
3306
|
action: t,
|
|
3180
|
-
iconProps:
|
|
3181
|
-
} =
|
|
3182
|
-
return /* @__PURE__ */
|
|
3183
|
-
|
|
3184
|
-
/* @__PURE__ */
|
|
3185
|
-
t && /* @__PURE__ */
|
|
3307
|
+
iconProps: r
|
|
3308
|
+
} = n;
|
|
3309
|
+
return /* @__PURE__ */ N("div", { className: "empty-container", children: [
|
|
3310
|
+
r && /* @__PURE__ */ m(U, { ...r }),
|
|
3311
|
+
/* @__PURE__ */ m("p", { ...s, children: e }),
|
|
3312
|
+
t && /* @__PURE__ */ m(ht, { showTooltips: !1, showText: !0, ...t })
|
|
3186
3313
|
] });
|
|
3187
3314
|
};
|
|
3188
3315
|
export {
|
|
3189
3316
|
de as APIClient,
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3317
|
+
An as Action,
|
|
3318
|
+
xn as Actions,
|
|
3319
|
+
$n as ActionsDropdown,
|
|
3320
|
+
W as AppIconButton,
|
|
3321
|
+
jt as AuthClient,
|
|
3195
3322
|
me as AuthContext,
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3323
|
+
Gs as AuthProvider,
|
|
3324
|
+
Fs as BaseClient,
|
|
3325
|
+
tn as BottomNavActionProvider,
|
|
3326
|
+
Tn as BottomNavigation,
|
|
3327
|
+
Dn as Button,
|
|
3328
|
+
Zs as ConfigProvider,
|
|
3329
|
+
Ps as ConfirmationDialog,
|
|
3201
3330
|
ye as Dialog,
|
|
3202
3331
|
we as DialogActions,
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3332
|
+
nn as Drawer,
|
|
3333
|
+
He as DrawerMenuContext,
|
|
3334
|
+
en as DrawerMenuProvider,
|
|
3335
|
+
ws as Empty,
|
|
3336
|
+
pn as Error,
|
|
3337
|
+
Rs as FormContainer,
|
|
3338
|
+
_s as FormDialog,
|
|
3339
|
+
Y as GlobalActions,
|
|
3340
|
+
Ms as IManager,
|
|
3341
|
+
W as IconButton,
|
|
3342
|
+
Os as ImportDialog,
|
|
3343
|
+
Us as IndexedDBClient,
|
|
3344
|
+
Ws as ManagerProvider,
|
|
3345
|
+
M as Methods,
|
|
3346
|
+
wn as Navbar,
|
|
3347
|
+
Je as NavbarContext,
|
|
3348
|
+
yn as NavbarProvider,
|
|
3349
|
+
Sn as Notification,
|
|
3350
|
+
F as NotificationEnumType,
|
|
3351
|
+
Vs as NotificationProvider,
|
|
3352
|
+
Cn as Onboarding,
|
|
3353
|
+
gn as Page,
|
|
3354
|
+
Ls as ParagraphInput,
|
|
3355
|
+
Is as PasswordInput,
|
|
3356
|
+
bn as PrettyGrid,
|
|
3357
|
+
vn as SplashScreen,
|
|
3358
|
+
gs as Step,
|
|
3359
|
+
Ys as SupabaseAuthProvider,
|
|
3360
|
+
Ks as SupabaseDataClient,
|
|
3361
|
+
Qe as SupabaseManagerContext,
|
|
3362
|
+
Xs as SupabaseManagerProvider,
|
|
3363
|
+
fs as Tab,
|
|
3364
|
+
ps as TabsLayout,
|
|
3365
|
+
fn as ToTop,
|
|
3366
|
+
Ut as buildQueryUrl,
|
|
3238
3367
|
Ce as createQueryClient,
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3368
|
+
js as enumToKeyValueArray,
|
|
3369
|
+
Hs as formatForDatetimeLocal,
|
|
3370
|
+
z as fromLocal,
|
|
3371
|
+
Qs as getFormattedDateTime,
|
|
3372
|
+
Bs as getShortFormattedDateTime,
|
|
3373
|
+
ve as isHttpError,
|
|
3374
|
+
Wt as isMac,
|
|
3246
3375
|
Se as isValidationError,
|
|
3247
3376
|
he as makeRequest,
|
|
3248
3377
|
ke as mapSupabaseSessionToSessionDto,
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3378
|
+
qs as mapValidationErrors,
|
|
3379
|
+
Fe as parseQueries,
|
|
3380
|
+
zs as queryClient,
|
|
3252
3381
|
I as removeFromLocal,
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3382
|
+
H as toLocal,
|
|
3383
|
+
Js as useAuth,
|
|
3384
|
+
Jt as useAuthContext,
|
|
3385
|
+
ts as useBottomNavAction,
|
|
3386
|
+
ie as useConfig,
|
|
3387
|
+
ze as useConfirmationForm,
|
|
3388
|
+
rs as useDeleteAction,
|
|
3389
|
+
cn as useDeleteDialog,
|
|
3390
|
+
We as useDialog,
|
|
3391
|
+
Zt as useDrawerMenu,
|
|
3392
|
+
an as useEditAction,
|
|
3393
|
+
is as useExportAction,
|
|
3394
|
+
hn as useExportActionMutate,
|
|
3395
|
+
Ge as useFormDialog,
|
|
3396
|
+
as as useImportAction,
|
|
3397
|
+
mn as useImportDialog,
|
|
3398
|
+
Gt as useManager,
|
|
3399
|
+
us as useNavbar,
|
|
3270
3400
|
oe as useNotification,
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3401
|
+
je as useOptionalAuthContext,
|
|
3402
|
+
Ve as useOptionalBottomNavAction,
|
|
3403
|
+
ln as usePostDialog,
|
|
3404
|
+
on as usePostForm,
|
|
3405
|
+
un as usePutDialog,
|
|
3406
|
+
sn as useRegisterBottomNavAction,
|
|
3407
|
+
os as useRestoreAction,
|
|
3408
|
+
dn as useRestoreDialog,
|
|
3409
|
+
cs as useScrollTrigger,
|
|
3410
|
+
Yt as useSupabase,
|
|
3411
|
+
rn as useTimeAge
|
|
3280
3412
|
};
|