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