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