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