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