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