@sito/dashboard-app 0.0.39 → 0.0.40

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