@middag-io/react 0.27.0 → 0.29.0

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.
Files changed (70) hide show
  1. package/dist-lib/{DateField-CU9qDJwH.js → DateField-BCCidKwl.js} +1 -1
  2. package/dist-lib/{DocumentField-COJZZV5_.js → DocumentField-5uXJyXlL.js} +1 -1
  3. package/dist-lib/{FormPanelBlock-B7Rc-PLS.js → FormPanelBlock-DJ0T69X7.js} +367 -365
  4. package/dist-lib/MarkdownContent-CN-ZN_69.js +2 -0
  5. package/dist-lib/{MarkdownContent-DZf86c3J.js → MarkdownContent-aIIUC0Fl.js} +1 -1
  6. package/dist-lib/{PhoneField-fFUyYj--.js → PhoneField-DpHb6FQE.js} +44 -40
  7. package/dist-lib/app/providers/index.d.ts +2 -4
  8. package/dist-lib/app/providers/index.d.ts.map +1 -1
  9. package/dist-lib/app/providers/inertia-error-reporter.d.ts.map +1 -1
  10. package/dist-lib/base/blocks/ActionGridBlock.d.ts.map +1 -1
  11. package/dist-lib/base/blocks/ActivityTimelineBlock.d.ts.map +1 -1
  12. package/dist-lib/base/blocks/CardGridBlock.d.ts.map +1 -1
  13. package/dist-lib/base/blocks/DenseTableBlock.d.ts.map +1 -1
  14. package/dist-lib/base/blocks/DetailPanelBlock.d.ts.map +1 -1
  15. package/dist-lib/base/blocks/EmptyStateBlock.d.ts.map +1 -1
  16. package/dist-lib/base/blocks/FormPanelBlock.d.ts.map +1 -1
  17. package/dist-lib/base/blocks/MarkdownPanelBlock.d.ts.map +1 -1
  18. package/dist-lib/base/form/FormField.d.ts.map +1 -1
  19. package/dist-lib/base/form/fields/EntityPickerField.d.ts +3 -1
  20. package/dist-lib/base/form/fields/EntityPickerField.d.ts.map +1 -1
  21. package/dist-lib/base/form/fields/MultiSelectField.d.ts.map +1 -1
  22. package/dist-lib/base/form/fields/NativeSelectField.d.ts.map +1 -1
  23. package/dist-lib/base/form/form-schema-builder.d.ts +2 -1
  24. package/dist-lib/base/form/form-schema-builder.d.ts.map +1 -1
  25. package/dist-lib/base/layout/DashboardLayout.d.ts.map +1 -1
  26. package/dist-lib/base/partials/ActionBar/index.d.ts.map +1 -1
  27. package/dist-lib/base/partials/DataTable/index.d.ts.map +1 -1
  28. package/dist-lib/base/partials/FormSection/index.d.ts.map +1 -1
  29. package/dist-lib/base/shell/BasicShell.d.ts.map +1 -1
  30. package/dist-lib/base/shell/ImmersiveShell.d.ts.map +1 -1
  31. package/dist-lib/base/shell/partials/PageActionButton.d.ts.map +1 -1
  32. package/dist-lib/{combobox-BbYGWCFO.js → combobox-DZ_qm1VH.js} +1486 -1571
  33. package/dist-lib/components/reui/data-grid/data-grid-table-virtual.d.ts.map +1 -1
  34. package/dist-lib/contracts/block-data/actions.d.ts +2 -1
  35. package/dist-lib/contracts/block-data/actions.d.ts.map +1 -1
  36. package/dist-lib/contracts/block-data/form.d.ts +14 -1
  37. package/dist-lib/contracts/block-data/form.d.ts.map +1 -1
  38. package/dist-lib/i18n/I18nProvider.d.ts +15 -0
  39. package/dist-lib/i18n/I18nProvider.d.ts.map +1 -0
  40. package/dist-lib/i18n/host-resolver.d.ts +11 -0
  41. package/dist-lib/i18n/host-resolver.d.ts.map +1 -0
  42. package/dist-lib/i18n/instance.d.ts +13 -0
  43. package/dist-lib/i18n/instance.d.ts.map +1 -0
  44. package/dist-lib/i18n/register-strings.d.ts +4 -0
  45. package/dist-lib/i18n/register-strings.d.ts.map +1 -0
  46. package/dist-lib/i18n/render-label.d.ts +14 -0
  47. package/dist-lib/i18n/render-label.d.ts.map +1 -0
  48. package/dist-lib/i18n/resolve-field-error.d.ts +9 -0
  49. package/dist-lib/i18n/resolve-field-error.d.ts.map +1 -0
  50. package/dist-lib/i18n/useHostString.d.ts +2 -0
  51. package/dist-lib/i18n/useHostString.d.ts.map +1 -0
  52. package/dist-lib/i18n/useTranslation.d.ts +12 -0
  53. package/dist-lib/i18n/useTranslation.d.ts.map +1 -0
  54. package/dist-lib/index.d.ts +9 -4
  55. package/dist-lib/index.d.ts.map +1 -1
  56. package/dist-lib/middag-react.css +1 -1
  57. package/dist-lib/middag-react.js +5483 -3505
  58. package/dist-lib/{FormSection-C7bOS9Wy.js → resolve-field-error-bG2_dMOY.js} +480 -466
  59. package/dist-lib/useTranslation-CHN-BFba.js +321 -0
  60. package/package.json +2 -1
  61. package/dist-lib/MarkdownContent-BeNHDP09.js +0 -2
  62. package/dist-lib/app/providers/i18n-defaults.d.ts +0 -19
  63. package/dist-lib/app/providers/i18n-defaults.d.ts.map +0 -1
  64. package/dist-lib/app/providers/i18n.d.ts +0 -55
  65. package/dist-lib/app/providers/i18n.d.ts.map +0 -1
  66. package/dist-lib/app/providers/locales/pt-BR.d.ts +0 -15
  67. package/dist-lib/app/providers/locales/pt-BR.d.ts.map +0 -1
  68. package/dist-lib/i18n-D5Nt1tut.js +0 -326
  69. package/dist-lib/lib/i18n/render-label.d.ts +0 -31
  70. package/dist-lib/lib/i18n/render-label.d.ts.map +0 -1
@@ -1,33 +1,33 @@
1
1
  import { t as e } from "./utils-Yj2czlvU.js";
2
- import { B as t, C as n, E as r, F as i, H as a, O as o, P as s, R as c, S as l, T as u, U as d, V as f, _ as p, a as m, at as h, c as g, ct as _, d as v, f as y, ft as b, g as x, gt as S, h as C, ht as ee, i as w, l as T, lt as E, m as D, mt as O, n as k, o as A, ot as te, p as ne, r as re, s as j, st as ie, t as ae, u as oe, ut as se, v as ce, w as le, z as ue } from "./FormSection-C7bOS9Wy.js";
3
- import { t as M } from "./button-Ba1PcsOx.js";
4
- import { n as de } from "./i18n-D5Nt1tut.js";
5
- import { t as fe } from "./skeleton-HpnbVVji.js";
6
- import { t as pe } from "./document-validation-YgxIqb8k.js";
7
- import N, { Suspense as P, lazy as F, useCallback as me, useEffect as he, useId as ge, useMemo as _e, useRef as ve, useState as ye } from "react";
8
- import { router as be } from "@inertiajs/core";
9
- import { Fragment as xe, jsx as I, jsxs as L } from "react/jsx-runtime";
2
+ import { B as t, C as n, D as r, E as i, F as a, G as o, H as s, L as c, T as l, U as u, V as d, W as f, _ as p, _t as m, a as h, c as g, ct as _, d as v, dt as y, f as b, ft as x, g as S, gt as C, h as ee, i as w, k as T, l as E, lt as D, m as O, mt as k, n as A, o as te, p as ne, r as re, s as ie, st as ae, t as oe, u as se, ut as j, v as ce, vt as le, w as ue, y as de } from "./resolve-field-error-bG2_dMOY.js";
3
+ import { t as fe } from "./button-Ba1PcsOx.js";
4
+ import { t as pe } from "./useTranslation-CHN-BFba.js";
5
+ import { t as me } from "./skeleton-HpnbVVji.js";
6
+ import { t as he } from "./document-validation-YgxIqb8k.js";
7
+ import M, { Suspense as N, lazy as P, useCallback as ge, useEffect as _e, useId as ve, useMemo as F, useRef as ye, useState as be } from "react";
8
+ import { router as xe } from "@inertiajs/core";
9
+ import { Fragment as Se, jsx as I, jsxs as L } from "react/jsx-runtime";
10
10
  //#region node_modules/react-hook-form/dist/index.esm.mjs
11
- var Se = (e) => e.type === "checkbox", R = (e) => e instanceof Date, z = (e) => e == null, Ce = (e) => typeof e == "object", B = (e) => !z(e) && !Array.isArray(e) && Ce(e) && !R(e), we = (e) => B(e) && e.target ? Se(e.target) ? e.target.checked : e.target.value : e, Te = (e, t) => t.split(".").some((t, n, r) => !isNaN(Number(t)) && e.has(r.slice(0, n).join("."))), Ee = (e) => {
11
+ var Ce = (e) => e.type === "checkbox", R = (e) => e instanceof Date, z = (e) => e == null, we = (e) => typeof e == "object", B = (e) => !z(e) && !Array.isArray(e) && we(e) && !R(e), Te = (e) => B(e) && e.target ? Ce(e.target) ? e.target.checked : e.target.value : e, Ee = (e, t) => t.split(".").some((t, n, r) => !isNaN(Number(t)) && e.has(r.slice(0, n).join("."))), De = (e) => {
12
12
  let t = e.constructor && e.constructor.prototype;
13
13
  return B(t) && t.hasOwnProperty("isPrototypeOf");
14
- }, De = typeof window < "u" && window.HTMLElement !== void 0 && typeof document < "u";
14
+ }, Oe = typeof window < "u" && window.HTMLElement !== void 0 && typeof document < "u";
15
15
  function V(e) {
16
16
  if (e instanceof Date) return new Date(e);
17
17
  let t = typeof FileList < "u" && e instanceof FileList;
18
- if (De && (e instanceof Blob || t)) return e;
18
+ if (Oe && (e instanceof Blob || t)) return e;
19
19
  let n = Array.isArray(e);
20
- if (!n && !(B(e) && Ee(e))) return e;
20
+ if (!n && !(B(e) && De(e))) return e;
21
21
  let r = n ? [] : Object.create(Object.getPrototypeOf(e));
22
22
  for (let t in e) Object.prototype.hasOwnProperty.call(e, t) && (r[t] = V(e[t]));
23
23
  return r;
24
24
  }
25
- var Oe = (e) => /^\w*$/.test(e), H = (e) => e === void 0, ke = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Ae = (e) => ke(e.replace(/["|']|\]/g, "").split(/\.|\[/)), U = (e, t, n) => {
25
+ var ke = (e) => /^\w*$/.test(e), H = (e) => e === void 0, Ae = (e) => Array.isArray(e) ? e.filter(Boolean) : [], je = (e) => Ae(e.replace(/["|']|\]/g, "").split(/\.|\[/)), U = (e, t, n) => {
26
26
  if (!t || !B(e)) return n;
27
- let r = (Oe(t) ? [t] : Ae(t)).reduce((e, t) => z(e) ? void 0 : e[t], e);
27
+ let r = (ke(t) ? [t] : je(t)).reduce((e, t) => z(e) ? void 0 : e[t], e);
28
28
  return H(r) || r === e ? H(e[t]) ? n : e[t] : r;
29
29
  }, W = (e) => typeof e == "boolean", G = (e) => typeof e == "function", K = (e, t, n) => {
30
- let r = -1, i = Oe(t) ? [t] : Ae(t), a = i.length, o = a - 1;
30
+ let r = -1, i = ke(t) ? [t] : je(t), a = i.length, o = a - 1;
31
31
  for (; ++r < a;) {
32
32
  let t = i[r], a = n;
33
33
  if (r !== o) {
@@ -58,19 +58,19 @@ var Oe = (e) => /^\w*$/.test(e), H = (e) => e === void 0, ke = (e) => Array.isAr
58
58
  pattern: "pattern",
59
59
  required: "required",
60
60
  validate: "validate"
61
- }, je = "form", Me = "root", Ne = N.createContext(null);
62
- Ne.displayName = "HookFormControlContext";
63
- var Pe = () => N.useContext(Ne), Fe = (e, t, n, r = !0) => {
61
+ }, Me = "form", Ne = "root", Pe = M.createContext(null);
62
+ Pe.displayName = "HookFormControlContext";
63
+ var Fe = () => M.useContext(Pe), Ie = (e, t, n, r = !0) => {
64
64
  let i = {};
65
65
  for (let a in e) Object.defineProperty(i, a, { get: () => {
66
66
  let i = a;
67
67
  return t._proxyFormState[i] !== J.all && (t._proxyFormState[i] = !r || J.all), n && (n[i] = !0), e[i];
68
68
  } });
69
69
  return i;
70
- }, Ie = typeof window < "u" ? N.useLayoutEffect : N.useEffect, X = (e) => typeof e == "string", Le = (e, t, n, r, i) => X(e) ? (r && t.watch.add(e), U(n, e, i)) : Array.isArray(e) ? e.map((e) => (r && t.watch.add(e), U(n, e))) : (r && (t.watchAll = !0), n), Re = (e) => z(e) || !Ce(e);
70
+ }, Le = typeof window < "u" ? M.useLayoutEffect : M.useEffect, X = (e) => typeof e == "string", Re = (e, t, n, r, i) => X(e) ? (r && t.watch.add(e), U(n, e, i)) : Array.isArray(e) ? e.map((e) => (r && t.watch.add(e), U(n, e))) : (r && (t.watchAll = !0), n), ze = (e) => z(e) || !we(e);
71
71
  function Z(e, t, n = /* @__PURE__ */ new WeakSet()) {
72
72
  if (e === t) return !0;
73
- if (Re(e) || Re(t)) return Object.is(e, t);
73
+ if (ze(e) || ze(t)) return Object.is(e, t);
74
74
  if (R(e) && R(t)) return Object.is(e.getTime(), t.getTime());
75
75
  let r = Object.keys(e), i = Object.keys(t);
76
76
  if (r.length !== i.length) return !1;
@@ -86,22 +86,22 @@ function Z(e, t, n = /* @__PURE__ */ new WeakSet()) {
86
86
  }
87
87
  return !0;
88
88
  }
89
- function ze(e) {
90
- let t = Pe(), { control: n = t, name: r, defaultValue: i, disabled: a, exact: o, compute: s } = e || {}, c = N.useRef(i), l = N.useRef(s), u = N.useRef(void 0), d = N.useRef(n), f = N.useRef(r);
89
+ function Be(e) {
90
+ let t = Fe(), { control: n = t, name: r, defaultValue: i, disabled: a, exact: o, compute: s } = e || {}, c = M.useRef(i), l = M.useRef(s), u = M.useRef(void 0), d = M.useRef(n), f = M.useRef(r);
91
91
  l.current = s;
92
- let [p, m] = N.useState(() => {
92
+ let [p, m] = M.useState(() => {
93
93
  let e = n._getWatch(r, c.current);
94
94
  return l.current ? l.current(e) : e;
95
- }), h = N.useCallback((e) => {
96
- let t = Le(r, n._names, e || n._formValues, !1, c.current);
95
+ }), h = M.useCallback((e) => {
96
+ let t = Re(r, n._names, e || n._formValues, !1, c.current);
97
97
  return l.current ? l.current(t) : t;
98
98
  }, [
99
99
  n._formValues,
100
100
  n._names,
101
101
  r
102
- ]), g = N.useCallback((e) => {
102
+ ]), g = M.useCallback((e) => {
103
103
  if (!a) {
104
- let t = Le(r, n._names, e || n._formValues, !1, c.current);
104
+ let t = Re(r, n._names, e || n._formValues, !1, c.current);
105
105
  if (l.current) {
106
106
  let e = l.current(t);
107
107
  Z(e, u.current) || (m(e), u.current = e);
@@ -113,7 +113,7 @@ function ze(e) {
113
113
  a,
114
114
  r
115
115
  ]);
116
- Ie(() => ((d.current !== n || !Z(f.current, r)) && (d.current = n, f.current = r, g()), n._subscribe({
116
+ Le(() => ((d.current !== n || !Z(f.current, r)) && (d.current = n, f.current = r, g()), n._subscribe({
117
117
  name: r,
118
118
  formState: { values: !0 },
119
119
  exact: o,
@@ -125,8 +125,8 @@ function ze(e) {
125
125
  o,
126
126
  r,
127
127
  g
128
- ]), N.useEffect(() => n._removeUnmounted());
129
- let _ = d.current !== n, v = f.current, y = N.useMemo(() => {
128
+ ]), M.useEffect(() => n._removeUnmounted());
129
+ let _ = d.current !== n, v = f.current, y = M.useMemo(() => {
130
130
  if (a) return null;
131
131
  let e = !_ && !Z(v, r);
132
132
  return _ || e ? h() : null;
@@ -139,15 +139,15 @@ function ze(e) {
139
139
  ]);
140
140
  return y === null ? p : y;
141
141
  }
142
- var Be = N.createContext(null);
143
- Be.displayName = "HookFormContext";
144
- var Ve = (e, t, n, r, i) => t ? {
142
+ var Ve = M.createContext(null);
143
+ Ve.displayName = "HookFormContext";
144
+ var He = (e, t, n, r, i) => t ? {
145
145
  ...n[e],
146
146
  types: {
147
147
  ...n[e] && n[e].types ? n[e].types : {},
148
148
  [r]: i || !0
149
149
  }
150
- } : {}, He = (e) => Array.isArray(e) ? e : [e], Ue = () => {
150
+ } : {}, Ue = (e) => Array.isArray(e) ? e : [e], We = () => {
151
151
  let e = [];
152
152
  return {
153
153
  get observers() {
@@ -164,23 +164,23 @@ var Ve = (e, t, n, r, i) => t ? {
164
164
  }
165
165
  };
166
166
  };
167
- function We(e, t) {
167
+ function Ge(e, t) {
168
168
  let n = {};
169
169
  for (let r in e) if (e.hasOwnProperty(r)) {
170
170
  let i = e[r], a = t[r];
171
171
  if (i && B(i) && a) {
172
- let e = We(i, a);
172
+ let e = Ge(i, a);
173
173
  B(e) && (n[r] = e);
174
174
  } else e[r] && (n[r] = a);
175
175
  }
176
176
  return n;
177
177
  }
178
- var Q = (e) => B(e) && !Object.keys(e).length, Ge = (e) => e.type === "file", Ke = (e) => {
179
- if (!De) return !1;
178
+ var Q = (e) => B(e) && !Object.keys(e).length, Ke = (e) => e.type === "file", qe = (e) => {
179
+ if (!Oe) return !1;
180
180
  let t = e ? e.ownerDocument : 0;
181
181
  return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
182
- }, qe = (e) => e.type === "select-multiple", Je = (e) => e.type === "radio", Ye = (e) => Je(e) || Se(e), Xe = (e) => Ke(e) && e.isConnected;
183
- function Ze(e, t) {
182
+ }, Je = (e) => e.type === "select-multiple", Ye = (e) => e.type === "radio", Xe = (e) => Ye(e) || Ce(e), Ze = (e) => qe(e) && e.isConnected;
183
+ function Qe(e, t) {
184
184
  let n = t.slice(0, -1).length, r = 0;
185
185
  for (; r < n;) {
186
186
  if (z(e)) {
@@ -191,65 +191,65 @@ function Ze(e, t) {
191
191
  }
192
192
  return e;
193
193
  }
194
- function Qe(e) {
194
+ function $e(e) {
195
195
  for (let t in e) if (e.hasOwnProperty(t) && !H(e[t])) return !1;
196
196
  return !0;
197
197
  }
198
198
  function $(e, t) {
199
199
  if (X(t) && Object.prototype.hasOwnProperty.call(e, t)) return delete e[t], e;
200
- let n = Array.isArray(t) ? t : Oe(t) ? [t] : Ae(t), r = n.length === 1 ? e : Ze(e, n), i = n.length - 1, a = n[i];
201
- return r && delete r[a], i !== 0 && (B(r) && Q(r) || Array.isArray(r) && Qe(r)) && $(e, n.slice(0, -1)), e;
200
+ let n = Array.isArray(t) ? t : ke(t) ? [t] : je(t), r = n.length === 1 ? e : Qe(e, n), i = n.length - 1, a = n[i];
201
+ return r && delete r[a], i !== 0 && (B(r) && Q(r) || Array.isArray(r) && $e(r)) && $(e, n.slice(0, -1)), e;
202
202
  }
203
- var $e = (e) => {
203
+ var et = (e) => {
204
204
  for (let t in e) if (G(e[t])) return !0;
205
205
  return !1;
206
206
  };
207
- function et(e) {
208
- return Array.isArray(e) || B(e) && !$e(e);
207
+ function tt(e) {
208
+ return Array.isArray(e) || B(e) && !et(e);
209
209
  }
210
- function tt(e, t = {}) {
210
+ function nt(e, t = {}) {
211
211
  for (let n in e) {
212
212
  let r = e[n];
213
- et(r) ? (t[n] = Array.isArray(r) ? [] : {}, tt(r, t[n])) : H(r) || (t[n] = !0);
213
+ tt(r) ? (t[n] = Array.isArray(r) ? [] : {}, nt(r, t[n])) : H(r) || (t[n] = !0);
214
214
  }
215
215
  return t;
216
216
  }
217
- function nt(e) {
217
+ function rt(e) {
218
218
  if (e !== !1) {
219
219
  if (e === !0) return !0;
220
220
  if (Array.isArray(e)) {
221
- let t = e.map((e) => nt(e));
221
+ let t = e.map((e) => rt(e));
222
222
  return t.some((e) => e !== void 0) ? t : void 0;
223
223
  }
224
224
  if (B(e)) {
225
225
  let t = {};
226
226
  for (let n in e) {
227
- let r = nt(e[n]);
227
+ let r = rt(e[n]);
228
228
  H(r) || (t[n] = r);
229
229
  }
230
230
  return Object.keys(t).length ? t : void 0;
231
231
  }
232
232
  }
233
233
  }
234
- function rt(e, t, n) {
235
- n ||= tt(t);
234
+ function it(e, t, n) {
235
+ n ||= nt(t);
236
236
  for (let r in e) {
237
237
  let i = e[r];
238
- if (et(i)) H(t) || Re(n[r]) ? n[r] = tt(i, Array.isArray(i) ? [] : {}) : rt(i, z(t) ? {} : t[r], n[r]);
238
+ if (tt(i)) H(t) || ze(n[r]) ? n[r] = nt(i, Array.isArray(i) ? [] : {}) : it(i, z(t) ? {} : t[r], n[r]);
239
239
  else {
240
240
  let e = t[r];
241
241
  n[r] = !Z(i, e);
242
242
  }
243
243
  }
244
- return nt(n) || {};
244
+ return rt(n) || {};
245
245
  }
246
- var it = {
246
+ var at = {
247
247
  value: !1,
248
248
  isValid: !1
249
- }, at = {
249
+ }, ot = {
250
250
  value: !0,
251
251
  isValid: !0
252
- }, ot = (e) => {
252
+ }, st = (e) => {
253
253
  if (Array.isArray(e)) {
254
254
  if (e.length > 1) {
255
255
  let t = e.filter((e) => e && e.checked && !e.disabled).map((e) => e.value);
@@ -258,24 +258,24 @@ var it = {
258
258
  isValid: !!t.length
259
259
  };
260
260
  }
261
- return e[0].checked && !e[0].disabled ? e[0].attributes && !H(e[0].attributes.value) ? H(e[0].value) || e[0].value === "" ? at : {
261
+ return e[0].checked && !e[0].disabled ? e[0].attributes && !H(e[0].attributes.value) ? H(e[0].value) || e[0].value === "" ? ot : {
262
262
  value: e[0].value,
263
263
  isValid: !0
264
- } : at : it;
264
+ } : ot : at;
265
265
  }
266
- return it;
267
- }, st = (e, { valueAsNumber: t, valueAsDate: n, setValueAs: r }) => H(e) ? e : t ? e === "" ? NaN : e && +e : n && X(e) ? new Date(e) : r ? r(e) : e, ct = {
266
+ return at;
267
+ }, ct = (e, { valueAsNumber: t, valueAsDate: n, setValueAs: r }) => H(e) ? e : t ? e === "" ? NaN : e && +e : n && X(e) ? new Date(e) : r ? r(e) : e, lt = {
268
268
  isValid: !1,
269
269
  value: null
270
- }, lt = (e) => Array.isArray(e) ? e.reduce((e, t) => t && t.checked && !t.disabled ? {
270
+ }, ut = (e) => Array.isArray(e) ? e.reduce((e, t) => t && t.checked && !t.disabled ? {
271
271
  isValid: !0,
272
272
  value: t.value
273
- } : e, ct) : ct;
274
- function ut(e) {
273
+ } : e, lt) : lt;
274
+ function dt(e) {
275
275
  let t = e.ref;
276
- return Ge(t) ? t.files : Je(t) ? lt(e.refs).value : qe(t) ? [...t.selectedOptions].map(({ value: e }) => e) : Se(t) ? ot(e.refs).value : st(H(t.value) ? e.ref.value : t.value, e);
276
+ return Ke(t) ? t.files : Ye(t) ? ut(e.refs).value : Je(t) ? [...t.selectedOptions].map(({ value: e }) => e) : Ce(t) ? st(e.refs).value : ct(H(t.value) ? e.ref.value : t.value, e);
277
277
  }
278
- var dt = (e, t, n, r) => {
278
+ var ft = (e, t, n, r) => {
279
279
  let i = {};
280
280
  for (let n of e) {
281
281
  let e = U(t, n);
@@ -287,27 +287,27 @@ var dt = (e, t, n, r) => {
287
287
  fields: i,
288
288
  shouldUseNativeValidation: r
289
289
  };
290
- }, ft = (e) => e instanceof RegExp, pt = (e) => H(e) ? e : ft(e) ? e.source : B(e) ? ft(e.value) ? e.value.source : e.value : e, mt = (e) => ({
290
+ }, pt = (e) => e instanceof RegExp, mt = (e) => H(e) ? e : pt(e) ? e.source : B(e) ? pt(e.value) ? e.value.source : e.value : e, ht = (e) => ({
291
291
  isOnSubmit: !e || e === J.onSubmit,
292
292
  isOnBlur: e === J.onBlur,
293
293
  isOnChange: e === J.onChange,
294
294
  isOnAll: e === J.all,
295
295
  isOnTouch: e === J.onTouched
296
- }), ht = "AsyncFunction", gt = (e) => !!e && !!e.validate && !!(G(e.validate) && e.validate.constructor.name === ht || B(e.validate) && Object.values(e.validate).find((e) => e.constructor.name === ht)), _t = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), vt = (e, t, n) => !n && (t.watchAll || t.watch.has(e) || [...t.watch].some((t) => e.startsWith(t) && /^\.\w+/.test(e.slice(t.length)))), yt = (e, t, n, r) => {
296
+ }), gt = "AsyncFunction", _t = (e) => !!e && !!e.validate && !!(G(e.validate) && e.validate.constructor.name === gt || B(e.validate) && Object.values(e.validate).find((e) => e.constructor.name === gt)), vt = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), yt = (e, t, n) => !n && (t.watchAll || t.watch.has(e) || [...t.watch].some((t) => e.startsWith(t) && /^\.\w+/.test(e.slice(t.length)))), bt = (e, t, n, r) => {
297
297
  for (let i of n || Object.keys(e)) {
298
298
  let n = U(e, i);
299
299
  if (n) {
300
300
  let { _f: e, ...a } = n;
301
301
  if (e) {
302
302
  if (e.refs && e.refs[0] && t(e.refs[0], i) && !r || e.ref && t(e.ref, e.name) && !r) return !0;
303
- if (yt(a, t)) break;
304
- } else if (B(a) && yt(a, t)) break;
303
+ if (bt(a, t)) break;
304
+ } else if (B(a) && bt(a, t)) break;
305
305
  }
306
306
  }
307
307
  };
308
- function bt(e, t, n) {
308
+ function xt(e, t, n) {
309
309
  let r = U(e, n);
310
- if (r || Oe(n)) return {
310
+ if (r || ke(n)) return {
311
311
  error: r,
312
312
  name: n
313
313
  };
@@ -327,30 +327,30 @@ function bt(e, t, n) {
327
327
  }
328
328
  return { name: n };
329
329
  }
330
- var xt = (e, t, n, r) => {
330
+ var St = (e, t, n, r) => {
331
331
  n(e);
332
332
  let { name: i, ...a } = e;
333
333
  return Q(a) || r && Object.keys(a).length >= Object.keys(t).length || Object.keys(a).find((e) => t[e] === (!r || J.all));
334
- }, St = (e, t, n) => !e || !t || e === t || He(e).some((e) => e && (n ? e === t : e.startsWith(t) || t.startsWith(e))), Ct = (e, t, n, r, i) => i.isOnAll ? !1 : !n && i.isOnTouch ? !(t || e) : (n ? r.isOnBlur : i.isOnBlur) ? !e : (n ? r.isOnChange : i.isOnChange) ? e : !0, wt = (e, t) => !ke(U(e, t)).length && $(e, t), Tt = (e, t, n) => {
335
- let r = He(U(e, n));
336
- return K(r, Me, t[n]), K(e, n, r), e;
334
+ }, Ct = (e, t, n) => !e || !t || e === t || Ue(e).some((e) => e && (n ? e === t : e.startsWith(t) || t.startsWith(e))), wt = (e, t, n, r, i) => i.isOnAll ? !1 : !n && i.isOnTouch ? !(t || e) : (n ? r.isOnBlur : i.isOnBlur) ? !e : (n ? r.isOnChange : i.isOnChange) ? e : !0, Tt = (e, t) => !Ae(U(e, t)).length && $(e, t), Et = (e, t, n) => {
335
+ let r = Ue(U(e, n));
336
+ return K(r, Ne, t[n]), K(e, n, r), e;
337
337
  };
338
- function Et(e, t, n = "validate") {
338
+ function Dt(e, t, n = "validate") {
339
339
  if (X(e) || Array.isArray(e) && e.every(X) || W(e) && !e) return {
340
340
  type: n,
341
341
  message: X(e) ? e : "",
342
342
  ref: t
343
343
  };
344
344
  }
345
- var Dt = (e) => B(e) && !ft(e) ? e : {
345
+ var Ot = (e) => B(e) && !pt(e) ? e : {
346
346
  value: e,
347
347
  message: ""
348
- }, Ot = async (e, t, n, r, i, a) => {
348
+ }, kt = async (e, t, n, r, i, a) => {
349
349
  let { ref: o, refs: s, required: c, maxLength: l, minLength: u, min: d, max: f, pattern: p, validate: m, name: h, valueAsNumber: g, mount: _ } = e._f, v = U(n, h);
350
350
  if (!_ || t.has(h)) return {};
351
351
  let y = s ? s[0] : o, b = (e) => {
352
352
  i && y.reportValidity && (y.setCustomValidity(W(e) ? "" : e || ""), y.reportValidity());
353
- }, x = {}, S = Je(o), C = Se(o), ee = S || C, w = (g || Ge(o)) && H(o.value) && H(v) || Ke(o) && o.value === "" || v === "" || Array.isArray(v) && !v.length || g && typeof v == "number" && isNaN(v), T = Ve.bind(null, h, r, x), E = (e, t, n, r = Y.maxLength, i = Y.minLength) => {
353
+ }, x = {}, S = Ye(o), C = Ce(o), ee = S || C, w = (g || Ke(o)) && H(o.value) && H(v) || qe(o) && o.value === "" || v === "" || Array.isArray(v) && !v.length || g && typeof v == "number" && isNaN(v), T = He.bind(null, h, r, x), E = (e, t, n, r = Y.maxLength, i = Y.minLength) => {
354
354
  let a = e ? t : n;
355
355
  x[h] = {
356
356
  type: e ? r : i,
@@ -359,11 +359,11 @@ var Dt = (e) => B(e) && !ft(e) ? e : {
359
359
  ...T(e ? r : i, a)
360
360
  };
361
361
  };
362
- if (a ? !Array.isArray(v) || !v.length : c && (!ee && (w || z(v)) || W(v) && !v || C && !ot(s).isValid || S && !lt(s).isValid)) {
362
+ if (a ? !Array.isArray(v) || !v.length : c && (!ee && (w || z(v)) || W(v) && !v || C && !st(s).isValid || S && !ut(s).isValid)) {
363
363
  let { value: e, message: t } = X(c) ? {
364
364
  value: !!c,
365
365
  message: c
366
- } : Dt(c);
366
+ } : Ot(c);
367
367
  if (e && (x[h] = {
368
368
  type: Y.required,
369
369
  message: t,
@@ -372,7 +372,7 @@ var Dt = (e) => B(e) && !ft(e) ? e : {
372
372
  }, !r)) return b(t), x;
373
373
  }
374
374
  if (!w && (!z(d) || !z(f))) {
375
- let e, t, n = Dt(f), i = Dt(d);
375
+ let e, t, n = Ot(f), i = Ot(d);
376
376
  if (!z(v) && !isNaN(v)) {
377
377
  let r = o.valueAsNumber || v && +v;
378
378
  z(n.value) || (e = r > n.value), z(i.value) || (t = r < i.value);
@@ -383,12 +383,12 @@ var Dt = (e) => B(e) && !ft(e) ? e : {
383
383
  if ((e || t) && (E(!!e, n.message, i.message, Y.max, Y.min), !r)) return b(x[h].message), x;
384
384
  }
385
385
  if ((l || u) && !w && (X(v) || a && Array.isArray(v))) {
386
- let e = Dt(l), t = Dt(u), n = !z(e.value) && v.length > +e.value, i = !z(t.value) && v.length < +t.value;
386
+ let e = Ot(l), t = Ot(u), n = !z(e.value) && v.length > +e.value, i = !z(t.value) && v.length < +t.value;
387
387
  if ((n || i) && (E(n, e.message, t.message), !r)) return b(x[h].message), x;
388
388
  }
389
389
  if (p && !w && X(v)) {
390
- let { value: e, message: t } = Dt(p);
391
- if (ft(e) && !v.match(e) && (x[h] = {
390
+ let { value: e, message: t } = Ot(p);
391
+ if (pt(e) && !v.match(e) && (x[h] = {
392
392
  type: Y.pattern,
393
393
  message: t,
394
394
  ref: o,
@@ -397,7 +397,7 @@ var Dt = (e) => B(e) && !ft(e) ? e : {
397
397
  }
398
398
  if (m) {
399
399
  if (G(m)) {
400
- let e = Et(await m(v, n), y);
400
+ let e = Dt(await m(v, n), y);
401
401
  if (e && (x[h] = {
402
402
  ...e,
403
403
  ...T(Y.validate, e.message)
@@ -406,7 +406,7 @@ var Dt = (e) => B(e) && !ft(e) ? e : {
406
406
  let e = {};
407
407
  for (let t in m) {
408
408
  if (!Q(e) && !r) break;
409
- let i = Et(await m[t](v, n), y, t);
409
+ let i = Dt(await m[t](v, n), y, t);
410
410
  i && (e = {
411
411
  ...i,
412
412
  ...T(t, i.message)
@@ -419,11 +419,11 @@ var Dt = (e) => B(e) && !ft(e) ? e : {
419
419
  }
420
420
  }
421
421
  return b(!0), x;
422
- }, kt = {
422
+ }, At = {
423
423
  mode: J.onSubmit,
424
424
  reValidateMode: J.onChange,
425
425
  shouldFocusError: !0
426
- }, At = {
426
+ }, jt = {
427
427
  submitCount: 0,
428
428
  isDirty: !1,
429
429
  isReady: !1,
@@ -436,12 +436,12 @@ var Dt = (e) => B(e) && !ft(e) ? e : {
436
436
  dirtyFields: {},
437
437
  validatingFields: {}
438
438
  };
439
- function jt(e = {}) {
439
+ function Mt(e = {}) {
440
440
  let t = {
441
- ...kt,
441
+ ...At,
442
442
  ...e
443
443
  }, n = {
444
- ...V(At),
444
+ ...V(jt),
445
445
  isLoading: G(t.defaultValues),
446
446
  errors: t.errors || {},
447
447
  disabled: t.disabled || !1
@@ -466,8 +466,8 @@ function jt(e = {}) {
466
466
  isValid: !1,
467
467
  errors: !1
468
468
  }, d = { ...u }, f = { ...d }, p = {
469
- array: Ue(),
470
- state: Ue()
469
+ array: We(),
470
+ state: We()
471
471
  }, m = t.criteriaMode === J.all, h = (e) => (t) => {
472
472
  clearTimeout(l), l = setTimeout(e, t);
473
473
  }, g = async (e) => {
@@ -487,7 +487,7 @@ function jt(e = {}) {
487
487
  isValidating: !Q(n.validatingFields)
488
488
  }));
489
489
  }, v = () => {
490
- n.dirtyFields = rt(i, a);
490
+ n.dirtyFields = it(i, a);
491
491
  }, y = (e, i = [], s, c, l = !0, u = !0) => {
492
492
  if (c && s && !t.disabled) {
493
493
  if (o.action = !0, u && Array.isArray(U(r, e))) {
@@ -496,7 +496,7 @@ function jt(e = {}) {
496
496
  }
497
497
  if (u && Array.isArray(U(n.errors, e))) {
498
498
  let t = s(U(n.errors, e), c.argA, c.argB);
499
- l && K(n.errors, e, t), wt(n.errors, e);
499
+ l && K(n.errors, e, t), Tt(n.errors, e);
500
500
  }
501
501
  if ((d.touchedFields || f.touchedFields) && u && Array.isArray(U(n.touchedFields, e))) {
502
502
  let t = s(U(n.touchedFields, e), c.argA, c.argB);
@@ -521,7 +521,7 @@ function jt(e = {}) {
521
521
  let l = U(r, e);
522
522
  if (l) {
523
523
  let r = H(U(a, e)), u = U(a, e, H(s) ? U(i, e) : s);
524
- H(u) || c && c.defaultChecked || t ? K(a, e, t ? u : ut(l._f)) : ne(e, u), o.mount && !o.action && (g(), r && n.isDirty && (d.isDirty || f.isDirty) && (k() || (n.isDirty = !1, p.state.next({ ...n }))));
524
+ H(u) || c && c.defaultChecked || t ? K(a, e, t ? u : dt(l._f)) : ne(e, u), o.mount && !o.action && (g(), r && n.isDirty && (d.isDirty || f.isDirty) && (k() || (n.isDirty = !1, p.state.next({ ...n }))));
525
525
  }
526
526
  }, C = (e, r, a, o, s) => {
527
527
  let c = !1, l = !1, u = { name: e };
@@ -552,7 +552,7 @@ function jt(e = {}) {
552
552
  ...t
553
553
  }, p.state.next(t);
554
554
  }
555
- }, w = async (e) => (_(e, !0), await t.resolver(a, t.context, dt(e || s.mount, r, t.criteriaMode, t.shouldUseNativeValidation))), T = async (e) => {
555
+ }, w = async (e) => (_(e, !0), await t.resolver(a, t.context, ft(e || s.mount, r, t.criteriaMode, t.shouldUseNativeValidation))), T = async (e) => {
556
556
  let { errors: t } = await w(e);
557
557
  if (_(e), e) for (let r of e) {
558
558
  let e = U(t, r);
@@ -568,14 +568,14 @@ function jt(e = {}) {
568
568
  name: t,
569
569
  eventType: r
570
570
  });
571
- if (B(i)) for (let e in i) i[e] && M(`${je}.${e}`, {
571
+ if (B(i)) for (let e in i) i[e] && de(`${Me}.${e}`, {
572
572
  message: X(i.message) ? i.message : "",
573
573
  type: Y.validate
574
574
  });
575
- else X(i) || !i ? M(je, {
575
+ else X(i) || !i ? de(Me, {
576
576
  message: i || "",
577
577
  type: Y.validate
578
- }) : ue(je);
578
+ }) : ue(Me);
579
579
  return i;
580
580
  }
581
581
  return !0;
@@ -592,10 +592,10 @@ function jt(e = {}) {
592
592
  if (u) {
593
593
  let { _f: r, ...f } = u;
594
594
  if (r) {
595
- let o = s.array.has(r.name), c = u._f && gt(u._f);
595
+ let o = s.array.has(r.name), c = u._f && _t(u._f);
596
596
  c && d.validatingFields && _([r.name], !0);
597
- let f = await Ot(u, s.disabled, a, m, t.shouldUseNativeValidation && !i, o);
598
- if (c && d.validatingFields && _([r.name]), f[r.name] && (l.valid = !1, i) || (!i && (U(f, r.name) ? o ? Tt(n.errors, f, r.name) : K(n.errors, r.name, f[r.name]) : $(n.errors, r.name)), e.shouldUseNativeValidation && f[r.name])) break;
597
+ let f = await kt(u, s.disabled, a, m, t.shouldUseNativeValidation && !i, o);
598
+ if (c && d.validatingFields && _([r.name]), f[r.name] && (l.valid = !1, i) || (!i && (U(f, r.name) ? o ? Et(n.errors, f, r.name) : K(n.errors, r.name, f[r.name]) : $(n.errors, r.name)), e.shouldUseNativeValidation && f[r.name])) break;
599
599
  }
600
600
  !Q(f) && await D({
601
601
  context: l,
@@ -610,28 +610,28 @@ function jt(e = {}) {
610
610
  }, O = () => {
611
611
  for (let e of s.unMount) {
612
612
  let t = U(r, e);
613
- t && (t._f.refs ? t._f.refs.every((e) => !Xe(e)) : !Xe(t._f.ref)) && N(e);
613
+ t && (t._f.refs ? t._f.refs.every((e) => !Ze(e)) : !Ze(t._f.ref)) && he(e);
614
614
  }
615
615
  s.unMount = /* @__PURE__ */ new Set();
616
- }, k = (e, n) => !t.disabled && (e && n && K(a, e, n), !Z(ce(), i)), A = (e, t, n) => Le(e, s, { ...o.mount ? a : H(t) ? i : X(e) ? { [e]: t } : t }, n, t), te = (e) => ke(U(o.mount ? a : i, e, t.shouldUnregister ? U(i, e, []) : [])), ne = (e, t, n = {}) => {
616
+ }, k = (e, n) => !t.disabled && (e && n && K(a, e, n), !Z(ce(), i)), A = (e, t, n) => Re(e, s, { ...o.mount ? a : H(t) ? i : X(e) ? { [e]: t } : t }, n, t), te = (e) => Ae(U(o.mount ? a : i, e, t.shouldUnregister ? U(i, e, []) : [])), ne = (e, t, n = {}) => {
617
617
  let i = U(r, e), o = t;
618
618
  if (i) {
619
619
  let n = i._f;
620
- n && (!n.disabled && K(a, e, st(t, n)), o = Ke(n.ref) && z(t) ? "" : t, qe(n.ref) ? [...n.ref.options].forEach((e) => e.selected = o.includes(e.value)) : n.refs ? Se(n.ref) ? n.refs.forEach((e) => {
620
+ n && (!n.disabled && K(a, e, ct(t, n)), o = qe(n.ref) && z(t) ? "" : t, Je(n.ref) ? [...n.ref.options].forEach((e) => e.selected = o.includes(e.value)) : n.refs ? Ce(n.ref) ? n.refs.forEach((e) => {
621
621
  (!e.defaultChecked || !e.disabled) && (Array.isArray(o) ? e.checked = !!o.find((t) => t === e.value) : e.checked = o === e.value || !!o);
622
- }) : n.refs.forEach((e) => e.checked = e.value === o) : Ge(n.ref) ? n.ref.value = "" : (n.ref.value = o, n.ref.type || p.state.next({
622
+ }) : n.refs.forEach((e) => e.checked = e.value === o) : Ke(n.ref) ? n.ref.value = "" : (n.ref.value = o, n.ref.type || p.state.next({
623
623
  name: e,
624
624
  values: V(a)
625
625
  })));
626
626
  }
627
- (n.shouldDirty || n.shouldTouch) && C(e, o, n.shouldTouch, n.shouldDirty, !0), n.shouldValidate && se(e);
627
+ (n.shouldDirty || n.shouldTouch) && C(e, o, n.shouldTouch, n.shouldDirty, !0), n.shouldValidate && j(e);
628
628
  }, re = (e, t, n) => {
629
629
  for (let i in t) {
630
630
  if (!t.hasOwnProperty(i)) return;
631
631
  let a = t[i], o = e + "." + i, c = U(r, o);
632
632
  (s.array.has(e) || B(a) || c && !c._f) && !R(a) ? re(o, a, n) : ne(o, a, n);
633
633
  }
634
- }, j = (e, t, i = {}) => {
634
+ }, ie = (e, t, i = {}) => {
635
635
  let c = U(r, e), l = s.array.has(e), u = V(t), m = Z(U(a, e), u);
636
636
  if (K(a, e, u), l) p.array.next({
637
637
  name: e,
@@ -646,14 +646,14 @@ function jt(e = {}) {
646
646
  !c || c._f || z(u) || t ? ne(e, u, i) : re(e, u, i);
647
647
  }
648
648
  if (!m) {
649
- let t = vt(e, s);
649
+ let t = yt(e, s);
650
650
  p.state.next({
651
651
  ...t && n,
652
652
  name: o.mount || t ? e : void 0,
653
653
  values: V(a)
654
654
  });
655
655
  }
656
- }, ie = (e) => {
656
+ }, ae = (e) => {
657
657
  let t = G(e) ? e(a) : e;
658
658
  Z(a, t) || (a = {
659
659
  ...a,
@@ -662,13 +662,13 @@ function jt(e = {}) {
662
662
  ...n,
663
663
  values: a
664
664
  }));
665
- }, ae = async (i) => {
665
+ }, oe = async (i) => {
666
666
  o.mount = !0;
667
667
  let l = i.target, u = l.name, h = !0, v = U(r, u), y = (e) => {
668
668
  h = Number.isNaN(e) || R(e) && isNaN(e.getTime()) || Z(e, U(a, u, e));
669
- }, b = mt(t.mode), x = mt(t.reValidateMode);
669
+ }, b = ht(t.mode), x = ht(t.reValidateMode);
670
670
  if (v) {
671
- let o, S, T = l.type ? ut(v._f) : we(i), O = i.type === q.BLUR || i.type === q.FOCUS_OUT, k = !_t(v._f) && !e.validate && !t.resolver && !U(n.errors, u) && !v._f.deps || Ct(O, U(n.touchedFields, u), n.isSubmitted, x, b), A = vt(u, s, O);
671
+ let o, S, T = l.type ? dt(v._f) : Te(i), O = i.type === q.BLUR || i.type === q.FOCUS_OUT, k = !vt(v._f) && !e.validate && !t.resolver && !U(n.errors, u) && !v._f.deps || wt(O, U(n.touchedFields, u), n.isSubmitted, x, b), A = yt(u, s, O);
672
672
  K(a, u, T), O ? (!l || !l.readOnly) && (v._f.onBlur && v._f.onBlur(i), c && c(0)) : v._f.onChange && v._f.onChange(i);
673
673
  let te = C(u, T, O), ne = !Q(te) || A;
674
674
  if (!O && p.state.next({
@@ -685,21 +685,21 @@ function jt(e = {}) {
685
685
  }), !O && A && p.state.next({ ...n }), t.resolver) {
686
686
  let { errors: e } = await w([u]);
687
687
  if (_([u]), y(T), h) {
688
- let t = bt(n.errors, r, u), i = bt(e, r, t.name || u);
688
+ let t = xt(n.errors, r, u), i = xt(e, r, t.name || u);
689
689
  o = i.error, u = i.name, S = Q(e);
690
690
  }
691
- } else _([u], !0), o = (await Ot(v, s.disabled, a, m, t.shouldUseNativeValidation))[u], _([u]), y(T), h && (o ? S = !1 : (d.isValid || f.isValid) && (S = await D({
691
+ } else _([u], !0), o = (await kt(v, s.disabled, a, m, t.shouldUseNativeValidation))[u], _([u]), y(T), h && (o ? S = !1 : (d.isValid || f.isValid) && (S = await D({
692
692
  fields: r,
693
693
  onlyCheckValid: !0,
694
694
  name: u,
695
695
  eventType: i.type
696
696
  })));
697
- h && (v._f.deps && (!Array.isArray(v._f.deps) || v._f.deps.length > 0) && se(v._f.deps), ee(u, S, o, te));
697
+ h && (v._f.deps && (!Array.isArray(v._f.deps) || v._f.deps.length > 0) && j(v._f.deps), ee(u, S, o, te));
698
698
  }
699
- }, oe = (e, t) => {
699
+ }, se = (e, t) => {
700
700
  if (U(n.errors, t) && e.focus) return e.focus(), 1;
701
- }, se = async (e, i = {}) => {
702
- let a, o, c = He(e);
701
+ }, j = async (e, i = {}) => {
702
+ let a, o, c = Ue(e);
703
703
  if (t.resolver) {
704
704
  let t = await T(H(e) ? e : c);
705
705
  a = Q(t), o = e ? !c.some((e) => U(t, e)) : a;
@@ -718,10 +718,10 @@ function jt(e = {}) {
718
718
  ...!X(e) || (d.isValid || f.isValid) && a !== n.isValid ? {} : { name: e },
719
719
  ...t.resolver || !e ? { isValid: a } : {},
720
720
  errors: n.errors
721
- }), i.shouldFocus && !o && yt(r, oe, e ? c : s.mount), o;
721
+ }), i.shouldFocus && !o && bt(r, se, e ? c : s.mount), o;
722
722
  }, ce = (e, t) => {
723
723
  let r = { ...o.mount ? a : i };
724
- return t && (r = We(t.dirtyFields ? n.dirtyFields : n.touchedFields, r)), H(e) ? r : X(e) ? U(r, e) : e.map((e) => U(r, e));
724
+ return t && (r = Ge(t.dirtyFields ? n.dirtyFields : n.touchedFields, r)), H(e) ? r : X(e) ? U(r, e) : e.map((e) => U(r, e));
725
725
  }, le = (e, t) => ({
726
726
  invalid: !!U((t || n).errors, e),
727
727
  isDirty: !!U((t || n).dirtyFields, e),
@@ -729,14 +729,14 @@ function jt(e = {}) {
729
729
  isValidating: !!U(n.validatingFields, e),
730
730
  isTouched: !!U((t || n).touchedFields, e)
731
731
  }), ue = (e) => {
732
- let t = e ? He(e) : void 0;
732
+ let t = e ? Ue(e) : void 0;
733
733
  t?.forEach((e) => $(n.errors, e)), t ? t.forEach((e) => {
734
734
  p.state.next({
735
735
  name: e,
736
736
  errors: n.errors
737
737
  });
738
738
  }) : p.state.next({ errors: {} });
739
- }, M = (e, t, i) => {
739
+ }, de = (e, t, i) => {
740
740
  let a = (U(r, e, { _f: {} })._f || {}).ref, { ref: o, message: s, type: c, ...l } = U(n.errors, e) || {};
741
741
  K(n.errors, e, {
742
742
  ...l,
@@ -747,8 +747,8 @@ function jt(e = {}) {
747
747
  errors: n.errors,
748
748
  isValid: !1
749
749
  }), i && i.shouldFocus && a && a.focus && a.focus();
750
- }, de = (e, t) => G(e) ? p.state.subscribe({ next: (n) => "values" in n && e(n.values || A(void 0, t), n) }) : A(e, t, !0), fe = (e) => p.state.subscribe({ next: (t) => {
751
- if (St(e.name, t.name, e.exact) && xt(t, e.formState || d, xe, e.reRenderRoot)) {
750
+ }, fe = (e, t) => G(e) ? p.state.subscribe({ next: (n) => "values" in n && e(n.values || A(void 0, t), n) }) : A(e, t, !0), pe = (e) => p.state.subscribe({ next: (t) => {
751
+ if (Ct(e.name, t.name, e.exact) && St(t, e.formState || d, xe, e.reRenderRoot)) {
752
752
  let r = { ...a };
753
753
  e.callback({
754
754
  values: r,
@@ -757,27 +757,27 @@ function jt(e = {}) {
757
757
  defaultValues: i
758
758
  });
759
759
  }
760
- } }).unsubscribe, pe = (e) => (o.mount = !0, f = {
760
+ } }).unsubscribe, me = (e) => (o.mount = !0, f = {
761
761
  ...f,
762
762
  ...e.formState
763
- }, fe({
763
+ }, pe({
764
764
  ...e,
765
765
  formState: {
766
766
  ...u,
767
767
  ...e.formState
768
768
  }
769
- })), N = (e, o = {}) => {
770
- for (let c of e ? He(e) : s.mount) s.mount.delete(c), s.array.delete(c), o.keepValue || ($(r, c), $(a, c)), !o.keepError && $(n.errors, c), !o.keepDirty && $(n.dirtyFields, c), !o.keepTouched && $(n.touchedFields, c), !o.keepIsValidating && $(n.validatingFields, c), !t.shouldUnregister && !o.keepDefaultValue && $(i, c);
769
+ })), he = (e, o = {}) => {
770
+ for (let c of e ? Ue(e) : s.mount) s.mount.delete(c), s.array.delete(c), o.keepValue || ($(r, c), $(a, c)), !o.keepError && $(n.errors, c), !o.keepDirty && $(n.dirtyFields, c), !o.keepTouched && $(n.touchedFields, c), !o.keepIsValidating && $(n.validatingFields, c), !t.shouldUnregister && !o.keepDefaultValue && $(i, c);
771
771
  p.state.next({ values: V(a) }), p.state.next({
772
772
  ...n,
773
773
  ...o.keepDirty ? { isDirty: k() } : {}
774
774
  }), !o.keepIsValid && g();
775
- }, P = ({ disabled: e, name: t }) => {
775
+ }, M = ({ disabled: e, name: t }) => {
776
776
  if (W(e) && o.mount || e || s.disabled.has(t)) {
777
777
  let n = s.disabled.has(t) !== !!e;
778
778
  e ? s.disabled.add(t) : s.disabled.delete(t), n && o.mount && !o.action && g();
779
779
  }
780
- }, F = (e, n = {}) => {
780
+ }, N = (e, n = {}) => {
781
781
  let a = U(r, e), c = W(n.disabled) || W(t.disabled), l = !s.registerName.has(e) && a && a._f && !a._f.mount;
782
782
  return K(r, e, {
783
783
  ...a || {},
@@ -787,32 +787,32 @@ function jt(e = {}) {
787
787
  mount: !0,
788
788
  ...n
789
789
  }
790
- }), s.mount.add(e), a && !l ? P({
790
+ }), s.mount.add(e), a && !l ? M({
791
791
  disabled: W(n.disabled) ? n.disabled : t.disabled,
792
792
  name: e
793
793
  }) : S(e, !0, n.value), {
794
794
  ...c ? { disabled: n.disabled || t.disabled } : {},
795
795
  ...t.progressive ? {
796
796
  required: !!n.required,
797
- min: pt(n.min),
798
- max: pt(n.max),
799
- minLength: pt(n.minLength),
800
- maxLength: pt(n.maxLength),
801
- pattern: pt(n.pattern)
797
+ min: mt(n.min),
798
+ max: mt(n.max),
799
+ minLength: mt(n.minLength),
800
+ maxLength: mt(n.maxLength),
801
+ pattern: mt(n.pattern)
802
802
  } : {},
803
803
  name: e,
804
- onChange: ae,
805
- onBlur: ae,
804
+ onChange: oe,
805
+ onBlur: oe,
806
806
  ref: (c) => {
807
807
  if (c) {
808
- s.registerName.add(e), F(e, n), s.registerName.delete(e), a = U(r, e);
809
- let t = H(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, o = Ye(t), l = a._f.refs || [];
808
+ s.registerName.add(e), N(e, n), s.registerName.delete(e), a = U(r, e);
809
+ let t = H(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, o = Xe(t), l = a._f.refs || [];
810
810
  if (o ? l.find((e) => e === t) : t === a._f.ref) return;
811
811
  K(r, e, { _f: {
812
812
  ...a._f,
813
813
  ...o ? {
814
814
  refs: [
815
- ...l.filter(Xe),
815
+ ...l.filter(Ze),
816
816
  t,
817
817
  ...Array.isArray(U(i, e)) ? [{}] : []
818
818
  ],
@@ -822,17 +822,17 @@ function jt(e = {}) {
822
822
  }
823
823
  } : { ref: t }
824
824
  } }), S(e, !1, void 0, t);
825
- } else a = U(r, e, {}), a._f && (a._f.mount = !1), (t.shouldUnregister || n.shouldUnregister) && !(Te(s.array, e) && o.action) && s.unMount.add(e);
825
+ } else a = U(r, e, {}), a._f && (a._f.mount = !1), (t.shouldUnregister || n.shouldUnregister) && !(Ee(s.array, e) && o.action) && s.unMount.add(e);
826
826
  }
827
827
  };
828
- }, me = () => t.shouldFocusError && yt(r, oe, s.mount), he = (e) => {
829
- W(e) && (p.state.next({ disabled: e }), yt(r, (t, n) => {
828
+ }, P = () => t.shouldFocusError && bt(r, se, s.mount), ge = (e) => {
829
+ W(e) && (p.state.next({ disabled: e }), bt(r, (t, n) => {
830
830
  let i = U(r, n);
831
831
  i && (t.disabled = i._f.disabled || e, Array.isArray(i._f.refs) && i._f.refs.forEach((t) => {
832
832
  t.disabled = i._f.disabled || e;
833
833
  }));
834
834
  }, 0, !1));
835
- }, ge = (e, i) => async (o) => {
835
+ }, _e = (e, i) => async (o) => {
836
836
  let c;
837
837
  o && (o.preventDefault && o.preventDefault(), o.persist && o.persist());
838
838
  let l = V(a);
@@ -844,14 +844,14 @@ function jt(e = {}) {
844
844
  eventType: q.SUBMIT
845
845
  });
846
846
  if (s.disabled.size) for (let e of s.disabled) $(l, e);
847
- if ($(n.errors, Me), Q(n.errors)) {
847
+ if ($(n.errors, Ne), Q(n.errors)) {
848
848
  p.state.next({ errors: {} });
849
849
  try {
850
850
  await e(l, o);
851
851
  } catch (e) {
852
852
  c = e;
853
853
  }
854
- } else i && await i({ ...n.errors }, o), me(), setTimeout(me);
854
+ } else i && await i({ ...n.errors }, o), P(), setTimeout(P);
855
855
  if (p.state.next({
856
856
  isSubmitted: !0,
857
857
  isSubmitting: !1,
@@ -859,23 +859,23 @@ function jt(e = {}) {
859
859
  submitCount: n.submitCount + 1,
860
860
  errors: n.errors
861
861
  }), c) throw c;
862
- }, _e = (e, t = {}) => {
863
- U(r, e) && (H(t.defaultValue) ? j(e, V(U(i, e))) : (j(e, t.defaultValue), K(i, e, V(t.defaultValue))), t.keepTouched || $(n.touchedFields, e), t.keepDirty || ($(n.dirtyFields, e), n.isDirty = t.defaultValue ? k(e, V(U(i, e))) : k()), t.keepError || ($(n.errors, e), d.isValid && g()), p.state.next({ ...n }));
864
- }, ve = (e, c = {}) => {
862
+ }, ve = (e, t = {}) => {
863
+ U(r, e) && (H(t.defaultValue) ? ie(e, V(U(i, e))) : (ie(e, t.defaultValue), K(i, e, V(t.defaultValue))), t.keepTouched || $(n.touchedFields, e), t.keepDirty || ($(n.dirtyFields, e), n.isDirty = t.defaultValue ? k(e, V(U(i, e))) : k()), t.keepError || ($(n.errors, e), d.isValid && g()), p.state.next({ ...n }));
864
+ }, F = (e, c = {}) => {
865
865
  let l = e ? V(e) : i, u = V(l), f = Q(e), m = f ? i : u;
866
866
  if (c.keepDefaultValues || (i = l), !c.keepValues) {
867
867
  if (c.keepDirtyValues) {
868
- let e = new Set([...s.mount, ...Object.keys(rt(i, a))]);
868
+ let e = new Set([...s.mount, ...Object.keys(it(i, a))]);
869
869
  for (let t of Array.from(e)) {
870
870
  let e = U(n.dirtyFields, t), r = U(a, t), i = U(m, t);
871
- e && !H(r) ? K(m, t, r) : !e && !H(i) && j(t, i);
871
+ e && !H(r) ? K(m, t, r) : !e && !H(i) && ie(t, i);
872
872
  }
873
873
  } else {
874
- if (De && H(e)) for (let e of s.mount) {
874
+ if (Oe && H(e)) for (let e of s.mount) {
875
875
  let t = U(r, e);
876
876
  if (t && t._f) {
877
877
  let e = Array.isArray(t._f.refs) ? t._f.refs[0] : t._f.ref;
878
- if (Ke(e)) {
878
+ if (qe(e)) {
879
879
  let t = e.closest("form");
880
880
  if (t) {
881
881
  t.reset();
@@ -884,7 +884,7 @@ function jt(e = {}) {
884
884
  }
885
885
  }
886
886
  }
887
- if (c.keepFieldsRef) for (let e of s.mount) j(e, U(m, e));
887
+ if (c.keepFieldsRef) for (let e of s.mount) ie(e, U(m, e));
888
888
  else r = {};
889
889
  }
890
890
  a = t.shouldUnregister ? c.keepDefaultValues ? V(i) : {} : V(m), p.array.next({ values: { ...m } }), p.state.next({ values: { ...m } });
@@ -902,14 +902,14 @@ function jt(e = {}) {
902
902
  submitCount: c.keepSubmitCount ? n.submitCount : 0,
903
903
  isDirty: f ? !1 : c.keepDirty ? n.isDirty : !!(c.keepDefaultValues && !Z(e, i)),
904
904
  isSubmitted: c.keepIsSubmitted ? n.isSubmitted : !1,
905
- dirtyFields: f ? {} : c.keepDirtyValues ? c.keepDefaultValues && a ? rt(i, a) : n.dirtyFields : c.keepDefaultValues && e ? rt(i, e) : c.keepDirty ? n.dirtyFields : {},
905
+ dirtyFields: f ? {} : c.keepDirtyValues ? c.keepDefaultValues && a ? it(i, a) : n.dirtyFields : c.keepDefaultValues && e ? it(i, e) : c.keepDirty ? n.dirtyFields : {},
906
906
  touchedFields: c.keepTouched ? n.touchedFields : {},
907
907
  errors: c.keepErrors ? n.errors : {},
908
908
  isSubmitSuccessful: c.keepIsSubmitSuccessful ? n.isSubmitSuccessful : !1,
909
909
  isSubmitting: !1,
910
910
  defaultValues: i
911
911
  });
912
- }, ye = (e, n) => ve(G(e) ? e(a) : e, {
912
+ }, ye = (e, n) => F(G(e) ? e(a) : e, {
913
913
  ...t.resetOptions,
914
914
  ...n
915
915
  }), be = (e, t = {}) => {
@@ -925,30 +925,30 @@ function jt(e = {}) {
925
925
  ...n,
926
926
  ...e
927
927
  };
928
- }, I = {
928
+ }, Se = {
929
929
  control: {
930
- register: F,
931
- unregister: N,
930
+ register: N,
931
+ unregister: he,
932
932
  getFieldState: le,
933
- handleSubmit: ge,
934
- setError: M,
935
- _subscribe: fe,
933
+ handleSubmit: _e,
934
+ setError: de,
935
+ _subscribe: pe,
936
936
  _runSchema: w,
937
937
  _updateIsValidating: _,
938
- _focusError: me,
938
+ _focusError: P,
939
939
  _getWatch: A,
940
940
  _getDirty: k,
941
941
  _setValid: g,
942
942
  _setFieldArray: y,
943
- _setDisabledField: P,
943
+ _setDisabledField: M,
944
944
  _setErrors: x,
945
945
  _getFieldArray: te,
946
- _reset: ve,
946
+ _reset: F,
947
947
  _resetDefaultValues: () => G(t.defaultValues) && t.defaultValues().then((e) => {
948
948
  ye(e, t.resetOptions), p.state.next({ isLoading: !1 });
949
949
  }),
950
950
  _removeUnmounted: O,
951
- _disableForm: he,
951
+ _disableForm: ge,
952
952
  _subjects: p,
953
953
  _proxyFormState: d,
954
954
  get _fields() {
@@ -985,30 +985,30 @@ function jt(e = {}) {
985
985
  };
986
986
  }
987
987
  },
988
- subscribe: pe,
989
- trigger: se,
990
- register: F,
991
- handleSubmit: ge,
992
- watch: de,
993
- setValue: j,
994
- setValues: ie,
988
+ subscribe: me,
989
+ trigger: j,
990
+ register: N,
991
+ handleSubmit: _e,
992
+ watch: fe,
993
+ setValue: ie,
994
+ setValues: ae,
995
995
  getValues: ce,
996
996
  reset: ye,
997
- resetField: _e,
997
+ resetField: ve,
998
998
  clearErrors: ue,
999
- unregister: N,
1000
- setError: M,
999
+ unregister: he,
1000
+ setError: de,
1001
1001
  setFocus: be,
1002
1002
  getFieldState: le
1003
1003
  };
1004
1004
  return {
1005
- ...I,
1006
- formControl: I
1005
+ ...Se,
1006
+ formControl: Se
1007
1007
  };
1008
1008
  }
1009
- function Mt(e = {}) {
1010
- let t = N.useRef(void 0), n = N.useRef(void 0), [r, i] = N.useState(() => ({
1011
- ...V(At),
1009
+ function Nt(e = {}) {
1010
+ let t = M.useRef(void 0), n = M.useRef(void 0), [r, i] = M.useState(() => ({
1011
+ ...V(jt),
1012
1012
  isLoading: G(e.defaultValues),
1013
1013
  errors: e.errors || {},
1014
1014
  disabled: e.disabled || !1,
@@ -1019,14 +1019,14 @@ function Mt(e = {}) {
1019
1019
  formState: r
1020
1020
  }, e.defaultValues && !G(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
1021
1021
  else {
1022
- let { formControl: n, ...i } = jt(e);
1022
+ let { formControl: n, ...i } = Mt(e);
1023
1023
  t.current = {
1024
1024
  ...i,
1025
1025
  formState: r
1026
1026
  };
1027
1027
  }
1028
1028
  let a = t.current.control;
1029
- return a._options = e, Ie(() => {
1029
+ return a._options = e, Le(() => {
1030
1030
  let e = a._subscribe({
1031
1031
  formState: a._proxyFormState,
1032
1032
  callback: () => i({ ...a._formState }),
@@ -1036,63 +1036,63 @@ function Mt(e = {}) {
1036
1036
  ...e,
1037
1037
  isReady: !0
1038
1038
  })), a._formState.isReady = !0, e;
1039
- }, [a]), N.useEffect(() => a._disableForm(e.disabled), [a, e.disabled]), N.useEffect(() => {
1039
+ }, [a]), M.useEffect(() => a._disableForm(e.disabled), [a, e.disabled]), M.useEffect(() => {
1040
1040
  e.mode && (a._options.mode = e.mode), e.reValidateMode && (a._options.reValidateMode = e.reValidateMode);
1041
1041
  }, [
1042
1042
  a,
1043
1043
  e.mode,
1044
1044
  e.reValidateMode
1045
- ]), N.useEffect(() => {
1045
+ ]), M.useEffect(() => {
1046
1046
  e.errors && (a._setErrors(e.errors), a._focusError());
1047
- }, [a, e.errors]), N.useEffect(() => {
1047
+ }, [a, e.errors]), M.useEffect(() => {
1048
1048
  e.shouldUnregister && a._subjects.state.next({ values: a._getWatch() });
1049
- }, [a, e.shouldUnregister]), N.useEffect(() => {
1049
+ }, [a, e.shouldUnregister]), M.useEffect(() => {
1050
1050
  if (a._proxyFormState.isDirty) {
1051
1051
  let e = a._getDirty();
1052
1052
  e !== r.isDirty && a._subjects.state.next({ isDirty: e });
1053
1053
  }
1054
- }, [a, r.isDirty]), N.useEffect(() => {
1054
+ }, [a, r.isDirty]), M.useEffect(() => {
1055
1055
  e.values && !Z(e.values, n.current) ? (a._reset(e.values, {
1056
1056
  keepFieldsRef: !0,
1057
1057
  ...a._options.resetOptions
1058
1058
  }), a._options.resetOptions?.keepIsValid || a._setValid(), n.current = e.values, i((e) => ({ ...e }))) : a._resetDefaultValues();
1059
- }, [a, e.values]), N.useEffect(() => {
1059
+ }, [a, e.values]), M.useEffect(() => {
1060
1060
  a._state.mount || (a._setValid(), a._state.mount = !0), a._state.watch && (a._state.watch = !1, a._subjects.state.next({ ...a._formState })), a._removeUnmounted();
1061
- }), t.current.formState = N.useMemo(() => Fe(r, a), [a, r]), t.current;
1061
+ }), t.current.formState = M.useMemo(() => Ie(r, a), [a, r]), t.current;
1062
1062
  }
1063
1063
  //#endregion
1064
1064
  //#region node_modules/@hookform/resolvers/dist/resolvers.mjs
1065
- var Nt = (e, t, n) => {
1065
+ var Pt = (e, t, n) => {
1066
1066
  if (e && "reportValidity" in e) {
1067
1067
  let r = U(n, t);
1068
1068
  e.setCustomValidity(r && r.message || ""), e.reportValidity();
1069
1069
  }
1070
- }, Pt = (e, t) => {
1070
+ }, Ft = (e, t) => {
1071
1071
  for (let n in t.fields) {
1072
1072
  let r = t.fields[n];
1073
- r && r.ref && "reportValidity" in r.ref ? Nt(r.ref, n, e) : r && r.refs && r.refs.forEach((t) => Nt(t, n, e));
1073
+ r && r.ref && "reportValidity" in r.ref ? Pt(r.ref, n, e) : r && r.refs && r.refs.forEach((t) => Pt(t, n, e));
1074
1074
  }
1075
- }, Ft = (e, t) => {
1076
- t.shouldUseNativeValidation && Pt(e, t);
1075
+ }, It = (e, t) => {
1076
+ t.shouldUseNativeValidation && Ft(e, t);
1077
1077
  let n = {};
1078
1078
  for (let r in e) {
1079
1079
  let i = U(t.fields, r), a = Object.assign(e[r] || {}, { ref: i && i.ref });
1080
- if (It(t.names || Object.keys(e), r)) {
1080
+ if (Lt(t.names || Object.keys(e), r)) {
1081
1081
  let e = Object.assign({}, U(n, r));
1082
1082
  K(e, "root", a), K(n, r, e);
1083
1083
  } else K(n, r, a);
1084
1084
  }
1085
1085
  return n;
1086
- }, It = (e, t) => {
1087
- let n = Lt(t);
1088
- return e.some((e) => Lt(e).match(`^${n}\\.\\d+`));
1086
+ }, Lt = (e, t) => {
1087
+ let n = Rt(t);
1088
+ return e.some((e) => Rt(e).match(`^${n}\\.\\d+`));
1089
1089
  };
1090
- function Lt(e) {
1090
+ function Rt(e) {
1091
1091
  return e.replace(/\]|\[/g, "");
1092
1092
  }
1093
1093
  //#endregion
1094
1094
  //#region node_modules/@hookform/resolvers/zod/dist/zod.mjs
1095
- function Rt(e, t) {
1095
+ function zt(e, t) {
1096
1096
  try {
1097
1097
  var n = e();
1098
1098
  } catch (e) {
@@ -1100,7 +1100,7 @@ function Rt(e, t) {
1100
1100
  }
1101
1101
  return n && n.then ? n.then(void 0, t) : n;
1102
1102
  }
1103
- function zt(e, t) {
1103
+ function Bt(e, t) {
1104
1104
  for (var n = {}; e.length;) {
1105
1105
  var r = e[0], i = r.code, a = r.message, o = r.path.join(".");
1106
1106
  if (!n[o]) if ("unionErrors" in r) {
@@ -1119,13 +1119,13 @@ function zt(e, t) {
1119
1119
  });
1120
1120
  }), t) {
1121
1121
  var c = n[o].types, l = c && c[r.code];
1122
- n[o] = Ve(o, t, n, i, l ? [].concat(l, r.message) : r.message);
1122
+ n[o] = He(o, t, n, i, l ? [].concat(l, r.message) : r.message);
1123
1123
  }
1124
1124
  e.shift();
1125
1125
  }
1126
1126
  return n;
1127
1127
  }
1128
- function Bt(e, t) {
1128
+ function Vt(e, t) {
1129
1129
  for (var n = {}; e.length;) {
1130
1130
  var r = e[0], i = r.code, a = r.message, o = r.path.join(".");
1131
1131
  if (!n[o]) if (r.code === "invalid_union" && r.errors.length > 0) {
@@ -1144,20 +1144,20 @@ function Bt(e, t) {
1144
1144
  });
1145
1145
  }), t) {
1146
1146
  var c = n[o].types, l = c && c[r.code];
1147
- n[o] = Ve(o, t, n, i, l ? [].concat(l, r.message) : r.message);
1147
+ n[o] = He(o, t, n, i, l ? [].concat(l, r.message) : r.message);
1148
1148
  }
1149
1149
  e.shift();
1150
1150
  }
1151
1151
  return n;
1152
1152
  }
1153
- function Vt(e, t, n) {
1153
+ function Ht(e, t, n) {
1154
1154
  if (n === void 0 && (n = {}), function(e) {
1155
1155
  return "_def" in e && typeof e._def == "object" && "typeName" in e._def;
1156
1156
  }(e)) return function(r, i, a) {
1157
1157
  try {
1158
- return Promise.resolve(Rt(function() {
1158
+ return Promise.resolve(zt(function() {
1159
1159
  return Promise.resolve(e[n.mode === "sync" ? "parse" : "parseAsync"](r, t)).then(function(e) {
1160
- return a.shouldUseNativeValidation && Pt({}, a), {
1160
+ return a.shouldUseNativeValidation && Ft({}, a), {
1161
1161
  errors: {},
1162
1162
  values: n.raw ? Object.assign({}, r) : e
1163
1163
  };
@@ -1167,7 +1167,7 @@ function Vt(e, t, n) {
1167
1167
  return Array.isArray(e?.issues);
1168
1168
  }(e)) return {
1169
1169
  values: {},
1170
- errors: Ft(zt(e.errors, !a.shouldUseNativeValidation && a.criteriaMode === "all"), a)
1170
+ errors: It(Bt(e.errors, !a.shouldUseNativeValidation && a.criteriaMode === "all"), a)
1171
1171
  };
1172
1172
  throw e;
1173
1173
  }));
@@ -1179,19 +1179,19 @@ function Vt(e, t, n) {
1179
1179
  return "_zod" in e && typeof e._zod == "object";
1180
1180
  }(e)) return function(r, i, a) {
1181
1181
  try {
1182
- return Promise.resolve(Rt(function() {
1183
- return Promise.resolve((n.mode === "sync" ? O : ee)(e, r, t)).then(function(e) {
1184
- return a.shouldUseNativeValidation && Pt({}, a), {
1182
+ return Promise.resolve(zt(function() {
1183
+ return Promise.resolve((n.mode === "sync" ? C : m)(e, r, t)).then(function(e) {
1184
+ return a.shouldUseNativeValidation && Ft({}, a), {
1185
1185
  errors: {},
1186
1186
  values: n.raw ? Object.assign({}, r) : e
1187
1187
  };
1188
1188
  });
1189
1189
  }, function(e) {
1190
1190
  if (function(e) {
1191
- return e instanceof S;
1191
+ return e instanceof le;
1192
1192
  }(e)) return {
1193
1193
  values: {},
1194
- errors: Ft(Bt(e.issues, !a.shouldUseNativeValidation && a.criteriaMode === "all"), a)
1194
+ errors: It(Vt(e.issues, !a.shouldUseNativeValidation && a.criteriaMode === "all"), a)
1195
1195
  };
1196
1196
  throw e;
1197
1197
  }));
@@ -1203,19 +1203,19 @@ function Vt(e, t, n) {
1203
1203
  }
1204
1204
  //#endregion
1205
1205
  //#region src/base/form/form-utils.ts
1206
- function Ht(e) {
1206
+ function Ut(e) {
1207
1207
  let t = [];
1208
- for (let n of e) n.kind === "field" ? t.push(n) : (n.kind === "section" || n.kind === "group") && t.push(...Ht(n.children));
1208
+ for (let n of e) n.kind === "field" ? t.push(n) : (n.kind === "section" || n.kind === "group") && t.push(...Ut(n.children));
1209
1209
  return t;
1210
1210
  }
1211
- function Ut(e, t) {
1211
+ function Wt(e, t) {
1212
1212
  if (e.component === "header") return !0;
1213
1213
  let { props: n } = e;
1214
1214
  return !(n.hidden_when && r(n.hidden_when, t) || n.visible_when && !r(n.visible_when, t));
1215
1215
  }
1216
1216
  //#endregion
1217
1217
  //#region src/base/form/form-schema-builder.ts
1218
- function Wt(e, t) {
1218
+ function Gt(e, t) {
1219
1219
  let { component: n, props: r } = e, i = r.validation, a = r.required;
1220
1220
  switch (n) {
1221
1221
  case "text":
@@ -1223,74 +1223,74 @@ function Wt(e, t) {
1223
1223
  case "password":
1224
1224
  case "slug":
1225
1225
  case "color": {
1226
- let e = b();
1227
- return a && (e = e.min(1, t("middag.ui.validation.required"))), i?.minLength && (e = e.min(i.minLength, t("middag.ui.validation.min_length", { min: i.minLength }))), i?.maxLength && (e = e.max(i.maxLength, t("middag.ui.validation.max_length", { max: i.maxLength }))), i?.pattern && (e = e.regex(new RegExp(i.pattern), i.patternMessage ?? t("middag.ui.validation.pattern"))), a ? e : e.or(_(""));
1226
+ let e = k();
1227
+ return a && (e = e.min(1, t("middag.ui.validation.required"))), i?.minLength && (e = e.min(i.minLength, t("middag.ui.validation.min_length", { min: i.minLength }))), i?.maxLength && (e = e.max(i.maxLength, t("middag.ui.validation.max_length", { max: i.maxLength }))), i?.pattern && (e = e.regex(new RegExp(i.pattern), i.patternMessage ?? t("middag.ui.validation.pattern"))), a ? e : e.or(j(""));
1228
1228
  }
1229
1229
  case "email": {
1230
- let e = b();
1230
+ let e = k();
1231
1231
  if (a) e = e.min(1, t("middag.ui.validation.required")).email(t("middag.ui.validation.email"));
1232
- else return e.email(t("middag.ui.validation.email")).or(_(""));
1232
+ else return e.email(t("middag.ui.validation.email")).or(j(""));
1233
1233
  return e;
1234
1234
  }
1235
1235
  case "url": {
1236
- let e = b();
1236
+ let e = k();
1237
1237
  if (a) e = e.min(1, t("middag.ui.validation.required")).url(t("middag.ui.validation.url"));
1238
- else return e.url(t("middag.ui.validation.url")).or(_(""));
1238
+ else return e.url(t("middag.ui.validation.url")).or(j(""));
1239
1239
  return e;
1240
1240
  }
1241
1241
  case "int": {
1242
- let e = E({ message: t("middag.ui.validation.integer") }).int(t("middag.ui.validation.integer"));
1242
+ let e = y({ message: t("middag.ui.validation.integer") }).int(t("middag.ui.validation.integer"));
1243
1243
  return r.min != null && (e = e.min(r.min, t("middag.ui.validation.min_value", { min: r.min }))), r.max != null && (e = e.max(r.max, t("middag.ui.validation.max_value", { max: r.max }))), a ? e : e.nullable();
1244
1244
  }
1245
1245
  case "float": {
1246
- let e = E();
1246
+ let e = y();
1247
1247
  return r.min != null && (e = e.min(r.min, t("middag.ui.validation.min_value", { min: r.min }))), r.max != null && (e = e.max(r.max, t("middag.ui.validation.max_value", { max: r.max }))), a ? e : e.nullable();
1248
1248
  }
1249
1249
  case "currency": {
1250
- let e = E();
1250
+ let e = y();
1251
1251
  return a ? e : e.nullable();
1252
1252
  }
1253
1253
  case "select":
1254
1254
  case "radio":
1255
1255
  case "entity_picker": {
1256
- let e = b();
1256
+ let e = k();
1257
1257
  return a ? e.min(1, t("middag.ui.validation.required")) : e;
1258
1258
  }
1259
1259
  case "multiselect":
1260
1260
  case "tags": {
1261
- let e = te(b());
1261
+ let e = _(k());
1262
1262
  return a ? e.min(1, t("middag.ui.validation.required")) : e;
1263
1263
  }
1264
1264
  case "checkbox":
1265
- case "switch": return ie();
1265
+ case "switch": return D();
1266
1266
  case "date":
1267
1267
  case "datetime": {
1268
- let e = b();
1268
+ let e = k();
1269
1269
  return a ? e.min(1, t("middag.ui.validation.required")) : e;
1270
1270
  }
1271
1271
  case "phone": {
1272
- let e = b();
1272
+ let e = k();
1273
1273
  return a ? e.min(1, t("middag.ui.validation.required")) : e;
1274
1274
  }
1275
1275
  case "document": {
1276
- let e = r.documentType ?? "generic", n = r.documentScope ?? "any", i = b();
1277
- return a ? i.min(1, t("middag.ui.validation.required")).refine((t) => pe(t, e, n), t("middag.ui.validation.document_invalid")) : i.refine((t) => t === "" || pe(t, e, n), t("middag.ui.validation.document_invalid"));
1276
+ let e = r.documentType ?? "generic", n = r.documentScope ?? "any", i = k();
1277
+ return a ? i.min(1, t("middag.ui.validation.required")).refine((t) => he(t, e, n), t("middag.ui.validation.document_invalid")) : i.refine((t) => t === "" || he(t, e, n), t("middag.ui.validation.document_invalid"));
1278
1278
  }
1279
- default: return h();
1279
+ default: return ae();
1280
1280
  }
1281
1281
  }
1282
- function Gt(e, t, n) {
1283
- let r = Ht(e), i = {};
1284
- for (let e of r) e.component === "header" || e.component === "hidden" || e.component === "static" || Ut(e, t) && (i[e.key] = Wt(e, n));
1285
- return se(i);
1282
+ function Kt(e, t, n) {
1283
+ let r = Ut(e), i = {};
1284
+ for (let e of r) e.component === "header" || e.component === "hidden" || e.component === "static" || Wt(e, t) && (i[e.key] = Gt(e, n));
1285
+ return x(i);
1286
1286
  }
1287
1287
  //#endregion
1288
1288
  //#region src/base/form/FormField.tsx
1289
- var Kt = F(() => import("./PhoneField-fFUyYj--.js").then((e) => ({ default: e.PhoneField }))), qt = F(() => import("./DateField-CU9qDJwH.js").then((e) => ({ default: e.DateField }))), Jt = F(() => import("./DocumentField-COJZZV5_.js").then((e) => ({ default: e.DocumentField }))), Yt = F(() => import("./DateRangeField-CvU7wiyr.js").then((e) => ({ default: e.DateRangeField })));
1290
- function Xt() {
1291
- return /* @__PURE__ */ I(fe, { className: "h-9 w-full rounded-md" });
1289
+ var qt = P(() => import("./PhoneField-DpHb6FQE.js").then((e) => ({ default: e.PhoneField }))), Jt = P(() => import("./DateField-BCCidKwl.js").then((e) => ({ default: e.DateField }))), Yt = P(() => import("./DocumentField-5uXJyXlL.js").then((e) => ({ default: e.DocumentField }))), Xt = P(() => import("./DateRangeField-CvU7wiyr.js").then((e) => ({ default: e.DateRangeField })));
1290
+ function Zt() {
1291
+ return /* @__PURE__ */ I(me, { className: "h-9 w-full rounded-md" });
1292
1292
  }
1293
- function Zt({ label: e }) {
1293
+ function Qt({ label: e }) {
1294
1294
  return /* @__PURE__ */ I("div", {
1295
1295
  className: "pt-4 pb-1",
1296
1296
  children: /* @__PURE__ */ I("h4", {
@@ -1299,39 +1299,39 @@ function Zt({ label: e }) {
1299
1299
  })
1300
1300
  });
1301
1301
  }
1302
- function Qt({ id: e, value: t }) {
1302
+ function $t({ id: e, value: t }) {
1303
1303
  return /* @__PURE__ */ I("input", {
1304
1304
  type: "hidden",
1305
1305
  id: e,
1306
1306
  value: String(t ?? "")
1307
1307
  });
1308
1308
  }
1309
- function $t({ field: e, value: t, onChange: n, error: r }) {
1310
- let { t: i } = de(), a = ge(), o = `field-${e.key}-${a}`, s = `${o}-help`, c = `${o}-error`, { component: l, props: d } = e;
1311
- if (l === "header") return /* @__PURE__ */ I(Zt, { label: d.label });
1312
- if (l === "hidden") return /* @__PURE__ */ I(Qt, {
1313
- id: o,
1309
+ function en({ field: e, value: t, onChange: n, error: r }) {
1310
+ let { t: a } = pe(), o = ve(), s = `field-${e.key}-${o}`, c = `${s}-help`, l = `${s}-error`, { component: u, props: d } = e;
1311
+ if (u === "header") return /* @__PURE__ */ I(Qt, { label: d.label });
1312
+ if (u === "hidden") return /* @__PURE__ */ I($t, {
1313
+ id: s,
1314
1314
  value: t
1315
1315
  });
1316
- let f = l === "checkbox" || l === "switch", p = en(l, o, t, n, d, r, s, c, i);
1316
+ let f = u === "checkbox" || u === "switch", p = tn(u, s, t, n, d, r, c, l, a);
1317
1317
  return /* @__PURE__ */ L("div", {
1318
1318
  className: "space-y-1.5",
1319
1319
  children: [
1320
- !f && /* @__PURE__ */ L(u, {
1321
- htmlFor: o,
1320
+ !f && /* @__PURE__ */ L(i, {
1321
+ htmlFor: s,
1322
1322
  children: [d.label, d.required && /* @__PURE__ */ I("span", {
1323
1323
  className: "text-destructive ml-0.5",
1324
1324
  children: "*"
1325
1325
  })]
1326
1326
  }),
1327
1327
  d.helpText && /* @__PURE__ */ I("p", {
1328
- id: s,
1328
+ id: c,
1329
1329
  className: "text-muted-foreground text-xs",
1330
1330
  children: d.helpText
1331
1331
  }),
1332
1332
  p,
1333
1333
  r && /* @__PURE__ */ I("p", {
1334
- id: c,
1334
+ id: l,
1335
1335
  className: "text-destructive text-xs",
1336
1336
  "aria-live": "polite",
1337
1337
  children: r
@@ -1339,7 +1339,7 @@ function $t({ field: e, value: t, onChange: n, error: r }) {
1339
1339
  ]
1340
1340
  });
1341
1341
  }
1342
- function en(e, t, r, i, a, o, s, c, u) {
1342
+ function tn(e, t, r, i, a, o, s, c, u) {
1343
1343
  let d = {
1344
1344
  id: t,
1345
1345
  error: o,
@@ -1349,7 +1349,7 @@ function en(e, t, r, i, a, o, s, c, u) {
1349
1349
  required: a.required
1350
1350
  };
1351
1351
  switch (e) {
1352
- case "text": return /* @__PURE__ */ I(k, {
1352
+ case "text": return /* @__PURE__ */ I(re, {
1353
1353
  ...d,
1354
1354
  type: "text",
1355
1355
  value: r,
@@ -1357,7 +1357,7 @@ function en(e, t, r, i, a, o, s, c, u) {
1357
1357
  placeholder: a.placeholder,
1358
1358
  readOnly: a.readOnly
1359
1359
  });
1360
- case "email": return /* @__PURE__ */ I(k, {
1360
+ case "email": return /* @__PURE__ */ I(re, {
1361
1361
  ...d,
1362
1362
  type: "email",
1363
1363
  value: r,
@@ -1365,7 +1365,7 @@ function en(e, t, r, i, a, o, s, c, u) {
1365
1365
  placeholder: a.placeholder,
1366
1366
  readOnly: a.readOnly
1367
1367
  });
1368
- case "url": return /* @__PURE__ */ I(k, {
1368
+ case "url": return /* @__PURE__ */ I(re, {
1369
1369
  ...d,
1370
1370
  type: "url",
1371
1371
  value: r,
@@ -1373,7 +1373,7 @@ function en(e, t, r, i, a, o, s, c, u) {
1373
1373
  placeholder: a.placeholder,
1374
1374
  readOnly: a.readOnly
1375
1375
  });
1376
- case "textarea": return /* @__PURE__ */ I(re, {
1376
+ case "textarea": return /* @__PURE__ */ I(w, {
1377
1377
  ...d,
1378
1378
  value: r,
1379
1379
  onChange: i,
@@ -1381,13 +1381,13 @@ function en(e, t, r, i, a, o, s, c, u) {
1381
1381
  rows: a.rows,
1382
1382
  readOnly: a.readOnly
1383
1383
  });
1384
- case "password": return /* @__PURE__ */ I(y, {
1384
+ case "password": return /* @__PURE__ */ I(ne, {
1385
1385
  ...d,
1386
1386
  value: r,
1387
1387
  onChange: i,
1388
1388
  placeholder: a.placeholder
1389
1389
  });
1390
- case "otp": return /* @__PURE__ */ I(ne, {
1390
+ case "otp": return /* @__PURE__ */ I(O, {
1391
1391
  ...d,
1392
1392
  value: r,
1393
1393
  onChange: i,
@@ -1395,34 +1395,34 @@ function en(e, t, r, i, a, o, s, c, u) {
1395
1395
  pattern: a.pattern,
1396
1396
  groupSize: a.groupSize
1397
1397
  });
1398
- case "select": return /* @__PURE__ */ I(T, {
1398
+ case "select": return /* @__PURE__ */ I(se, {
1399
1399
  ...d,
1400
1400
  value: r,
1401
1401
  onChange: i,
1402
1402
  options: a.options ?? [],
1403
1403
  placeholder: a.placeholder
1404
1404
  });
1405
- case "native_select": return /* @__PURE__ */ I(C, {
1405
+ case "native_select": return /* @__PURE__ */ I(S, {
1406
1406
  ...d,
1407
1407
  value: r,
1408
1408
  onChange: i,
1409
1409
  options: a.options ?? [],
1410
1410
  placeholder: a.placeholder
1411
1411
  });
1412
- case "multiselect": return /* @__PURE__ */ I(x, {
1412
+ case "multiselect": return /* @__PURE__ */ I(p, {
1413
1413
  ...d,
1414
1414
  value: r,
1415
1415
  onChange: i,
1416
1416
  options: a.options ?? [],
1417
1417
  placeholder: a.placeholder
1418
1418
  });
1419
- case "radio": return /* @__PURE__ */ I(v, {
1419
+ case "radio": return /* @__PURE__ */ I(b, {
1420
1420
  ...d,
1421
1421
  value: r,
1422
1422
  onChange: i,
1423
1423
  options: a.options ?? []
1424
1424
  });
1425
- case "int": return /* @__PURE__ */ I(D, {
1425
+ case "int": return /* @__PURE__ */ I(ee, {
1426
1426
  ...d,
1427
1427
  value: r,
1428
1428
  onChange: i,
@@ -1430,7 +1430,7 @@ function en(e, t, r, i, a, o, s, c, u) {
1430
1430
  max: a.max,
1431
1431
  step: 1
1432
1432
  });
1433
- case "float": return /* @__PURE__ */ I(D, {
1433
+ case "float": return /* @__PURE__ */ I(ee, {
1434
1434
  ...d,
1435
1435
  value: r,
1436
1436
  onChange: i,
@@ -1438,7 +1438,7 @@ function en(e, t, r, i, a, o, s, c, u) {
1438
1438
  max: a.max,
1439
1439
  step: a.step ?? .1
1440
1440
  });
1441
- case "slider": return /* @__PURE__ */ I(g, {
1441
+ case "slider": return /* @__PURE__ */ I(E, {
1442
1442
  ...d,
1443
1443
  value: r,
1444
1444
  onChange: i,
@@ -1447,21 +1447,21 @@ function en(e, t, r, i, a, o, s, c, u) {
1447
1447
  step: a.step,
1448
1448
  multiple: a.multiple
1449
1449
  });
1450
- case "checkbox": return /* @__PURE__ */ I(le, {
1450
+ case "checkbox": return /* @__PURE__ */ I(l, {
1451
1451
  ...d,
1452
1452
  value: r,
1453
1453
  onChange: i,
1454
1454
  label: a.label
1455
1455
  });
1456
- case "switch": return /* @__PURE__ */ I(m, {
1456
+ case "switch": return /* @__PURE__ */ I(te, {
1457
1457
  ...d,
1458
1458
  value: r,
1459
1459
  onChange: i,
1460
1460
  label: a.label
1461
1461
  });
1462
- case "date": return /* @__PURE__ */ I(P, {
1463
- fallback: /* @__PURE__ */ I(Xt, {}),
1464
- children: /* @__PURE__ */ I(qt, {
1462
+ case "date": return /* @__PURE__ */ I(N, {
1463
+ fallback: /* @__PURE__ */ I(Zt, {}),
1464
+ children: /* @__PURE__ */ I(Jt, {
1465
1465
  ...d,
1466
1466
  mode: "date",
1467
1467
  value: r,
@@ -1469,9 +1469,9 @@ function en(e, t, r, i, a, o, s, c, u) {
1469
1469
  placeholder: a.placeholder
1470
1470
  })
1471
1471
  });
1472
- case "datetime": return /* @__PURE__ */ I(P, {
1473
- fallback: /* @__PURE__ */ I(Xt, {}),
1474
- children: /* @__PURE__ */ I(qt, {
1472
+ case "datetime": return /* @__PURE__ */ I(N, {
1473
+ fallback: /* @__PURE__ */ I(Zt, {}),
1474
+ children: /* @__PURE__ */ I(Jt, {
1475
1475
  ...d,
1476
1476
  mode: "datetime",
1477
1477
  value: r,
@@ -1479,7 +1479,7 @@ function en(e, t, r, i, a, o, s, c, u) {
1479
1479
  placeholder: a.placeholder
1480
1480
  })
1481
1481
  });
1482
- case "file": return /* @__PURE__ */ I(p, {
1482
+ case "file": return /* @__PURE__ */ I(ce, {
1483
1483
  ...d,
1484
1484
  value: r,
1485
1485
  onChange: i,
@@ -1488,24 +1488,25 @@ function en(e, t, r, i, a, o, s, c, u) {
1488
1488
  maxFiles: a.maxFiles,
1489
1489
  maxSize: a.maxSize
1490
1490
  });
1491
- case "entity_picker": return /* @__PURE__ */ I(ce, {
1491
+ case "entity_picker": return /* @__PURE__ */ I(de, {
1492
1492
  ...d,
1493
1493
  value: r,
1494
1494
  onChange: i,
1495
1495
  options: a.options,
1496
1496
  autocompleteHref: a.autocompleteHref,
1497
1497
  autocompleteMinChars: a.autocompleteMinChars,
1498
+ initialOption: a.initialOption,
1498
1499
  entityAvatarField: a.entityAvatarField,
1499
1500
  entitySubtitleField: a.entitySubtitleField,
1500
1501
  placeholder: a.placeholder
1501
1502
  });
1502
- case "static": return /* @__PURE__ */ I(A, {
1503
+ case "static": return /* @__PURE__ */ I(ie, {
1503
1504
  id: t,
1504
1505
  value: r
1505
1506
  });
1506
- case "phone": return /* @__PURE__ */ I(P, {
1507
- fallback: /* @__PURE__ */ I(Xt, {}),
1508
- children: /* @__PURE__ */ I(Kt, {
1507
+ case "phone": return /* @__PURE__ */ I(N, {
1508
+ fallback: /* @__PURE__ */ I(Zt, {}),
1509
+ children: /* @__PURE__ */ I(qt, {
1509
1510
  ...d,
1510
1511
  value: r,
1511
1512
  onChange: i,
@@ -1514,9 +1515,9 @@ function en(e, t, r, i, a, o, s, c, u) {
1514
1515
  fixedCountry: a.fixedCountry
1515
1516
  })
1516
1517
  });
1517
- case "document": return /* @__PURE__ */ I(P, {
1518
- fallback: /* @__PURE__ */ I(Xt, {}),
1519
- children: /* @__PURE__ */ I(Jt, {
1518
+ case "document": return /* @__PURE__ */ I(N, {
1519
+ fallback: /* @__PURE__ */ I(Zt, {}),
1520
+ children: /* @__PURE__ */ I(Yt, {
1520
1521
  ...d,
1521
1522
  value: r,
1522
1523
  onChange: i,
@@ -1526,7 +1527,7 @@ function en(e, t, r, i, a, o, s, c, u) {
1526
1527
  placeholder: a.placeholder
1527
1528
  })
1528
1529
  });
1529
- case "currency": return /* @__PURE__ */ I(l, {
1530
+ case "currency": return /* @__PURE__ */ I(n, {
1530
1531
  ...d,
1531
1532
  value: r,
1532
1533
  onChange: i,
@@ -1535,13 +1536,13 @@ function en(e, t, r, i, a, o, s, c, u) {
1535
1536
  min: a.min,
1536
1537
  max: a.max
1537
1538
  });
1538
- case "color": return /* @__PURE__ */ I(n, {
1539
+ case "color": return /* @__PURE__ */ I(ue, {
1539
1540
  ...d,
1540
1541
  value: r,
1541
1542
  onChange: i,
1542
1543
  placeholder: a.placeholder
1543
1544
  });
1544
- case "slug": return /* @__PURE__ */ I(j, {
1545
+ case "slug": return /* @__PURE__ */ I(g, {
1545
1546
  ...d,
1546
1547
  value: r,
1547
1548
  onChange: i,
@@ -1549,23 +1550,23 @@ function en(e, t, r, i, a, o, s, c, u) {
1549
1550
  prefix: a.prefix,
1550
1551
  placeholder: a.placeholder
1551
1552
  });
1552
- case "tags": return /* @__PURE__ */ I(w, {
1553
+ case "tags": return /* @__PURE__ */ I(h, {
1553
1554
  ...d,
1554
1555
  value: r,
1555
1556
  onChange: i,
1556
1557
  placeholder: a.placeholder,
1557
1558
  maxTags: a.maxTags
1558
1559
  });
1559
- case "date_range": return /* @__PURE__ */ I(P, {
1560
- fallback: /* @__PURE__ */ I(Xt, {}),
1561
- children: /* @__PURE__ */ I(Yt, {
1560
+ case "date_range": return /* @__PURE__ */ I(N, {
1561
+ fallback: /* @__PURE__ */ I(Zt, {}),
1562
+ children: /* @__PURE__ */ I(Xt, {
1562
1563
  ...d,
1563
1564
  value: r,
1564
1565
  onChange: i,
1565
1566
  operator: a.operator
1566
1567
  })
1567
1568
  });
1568
- case "rating": return /* @__PURE__ */ I(oe, {
1569
+ case "rating": return /* @__PURE__ */ I(v, {
1569
1570
  ...d,
1570
1571
  value: r,
1571
1572
  onChange: i,
@@ -1579,22 +1580,22 @@ function en(e, t, r, i, a, o, s, c, u) {
1579
1580
  }
1580
1581
  //#endregion
1581
1582
  //#region src/base/blocks/FormPanelBlock.tsx
1582
- function tn({ nodes: t, values: n, errors: r, onChange: i }) {
1583
- return /* @__PURE__ */ I(xe, { children: t.map((t, a) => {
1583
+ function nn({ nodes: t, values: n, errors: r, onChange: i }) {
1584
+ return /* @__PURE__ */ I(Se, { children: t.map((t, a) => {
1584
1585
  switch (t.kind) {
1585
- case "field": return Ut(t, n) ? /* @__PURE__ */ I($t, {
1586
+ case "field": return Wt(t, n) ? /* @__PURE__ */ I(en, {
1586
1587
  field: t,
1587
1588
  value: n[t.key] ?? "",
1588
1589
  onChange: (e) => i(t.key, e),
1589
1590
  error: r[t.key]
1590
1591
  }, t.key) : null;
1591
- case "section": return /* @__PURE__ */ I(ae, {
1592
+ case "section": return /* @__PURE__ */ I(A, {
1592
1593
  id: t.id,
1593
1594
  title: t.label,
1594
1595
  defaultCollapsed: t.defaultCollapsed,
1595
1596
  hasErrors: t.children.some((e) => e.kind === "field" && !!r[e.key]),
1596
1597
  errorCount: t.children.filter((e) => e.kind === "field" && !!r[e.key]).length,
1597
- children: /* @__PURE__ */ I(tn, {
1598
+ children: /* @__PURE__ */ I(nn, {
1598
1599
  nodes: t.children,
1599
1600
  values: n,
1600
1601
  errors: r,
@@ -1603,7 +1604,7 @@ function tn({ nodes: t, values: n, errors: r, onChange: i }) {
1603
1604
  }, t.id);
1604
1605
  case "group": return /* @__PURE__ */ I("div", {
1605
1606
  className: e("grid gap-6", t.columns === 2 ? "md:grid-cols-2" : "grid-cols-1"),
1606
- children: /* @__PURE__ */ I(tn, {
1607
+ children: /* @__PURE__ */ I(nn, {
1607
1608
  nodes: t.children,
1608
1609
  values: n,
1609
1610
  errors: r,
@@ -1612,7 +1613,7 @@ function tn({ nodes: t, values: n, errors: r, onChange: i }) {
1612
1613
  }, t.id);
1613
1614
  case "header": return /* @__PURE__ */ L("div", {
1614
1615
  className: "space-y-2",
1615
- children: [/* @__PURE__ */ I(o, {}), /* @__PURE__ */ I("h4", {
1616
+ children: [/* @__PURE__ */ I(T, {}), /* @__PURE__ */ I("h4", {
1616
1617
  className: "text-foreground text-base font-semibold",
1617
1618
  children: t.label
1618
1619
  })]
@@ -1621,115 +1622,116 @@ function tn({ nodes: t, values: n, errors: r, onChange: i }) {
1621
1622
  }
1622
1623
  }) });
1623
1624
  }
1624
- function nn({ block: e }) {
1625
- let { t: n } = de(), { data: r } = e, o = _e(() => Ht(r.schema), [r.schema]), l = (r.meta.validation ?? "both") !== "server", u = _e(() => Object.fromEntries(o.map((e) => [e.key, r.values[e.key] ?? ""])), [o, r.values]), p = ve(l ? Gt(r.schema, u, n) : null), m = Mt({
1626
- defaultValues: u,
1625
+ function rn({ block: e }) {
1626
+ let { t: n } = pe(), { data: r } = e, i = F(() => Ut(r.schema), [r.schema]), l = (r.meta.validation ?? "both") !== "server", p = F(() => Object.fromEntries(i.map((e) => [e.key, r.values[e.key] ?? ""])), [i, r.values]), m = ye(l ? Kt(r.schema, p, n) : null), h = Nt({
1627
+ defaultValues: p,
1627
1628
  mode: "onTouched",
1628
- resolver: _e(() => {
1629
- if (l) return async (e, t, n) => p.current ? Vt(p.current)(e, t, n) : {
1629
+ resolver: F(() => {
1630
+ if (l) return async (e, t, n) => m.current ? Ht(m.current)(e, t, n) : {
1630
1631
  values: e,
1631
1632
  errors: {}
1632
1633
  };
1633
1634
  }, [l])
1634
- }), h = ze({ control: m.control }) ?? u, g = o.map((e) => Ut(e, h) ? "1" : "0").join("");
1635
- he(() => {
1636
- l && (p.current = Gt(r.schema, h, n));
1635
+ }), g = Be({ control: h.control }) ?? p, _ = i.map((e) => Wt(e, g) ? "1" : "0").join("");
1636
+ _e(() => {
1637
+ l && (m.current = Kt(r.schema, g, n));
1637
1638
  }, [
1638
1639
  l,
1639
1640
  r.schema,
1640
1641
  n,
1641
- g
1642
+ _
1642
1643
  ]);
1643
- let [_, v] = ye(!1), [y, b] = ye(null);
1644
- he(() => {
1645
- if (Object.keys(r.errors).length > 0) for (let [e, t] of Object.entries(r.errors)) m.setError(e, {
1644
+ let [v, y] = be(!1), [b, x] = be(null);
1645
+ _e(() => {
1646
+ if (Object.keys(r.errors).length > 0) for (let [e, t] of Object.entries(r.errors)) h.setError(e, {
1646
1647
  type: "server",
1647
- message: t
1648
+ message: oe(t, n)
1648
1649
  });
1649
1650
  }, [JSON.stringify(r.errors)]);
1650
- let { isDirty: x, isSubmitting: S } = m.formState;
1651
- he(() => {
1652
- if (!x) return;
1651
+ let { isDirty: S, isSubmitting: C } = h.formState;
1652
+ _e(() => {
1653
+ if (!S) return;
1653
1654
  let e = (e) => {
1654
1655
  e.preventDefault();
1655
1656
  };
1656
1657
  return window.addEventListener("beforeunload", e), () => window.removeEventListener("beforeunload", e);
1657
- }, [x]);
1658
- let C = me((e, t) => {
1659
- m.setValue(e, t, {
1658
+ }, [S]);
1659
+ let ee = ge((e, t) => {
1660
+ h.setValue(e, t, {
1660
1661
  shouldDirty: !0,
1661
- shouldValidate: m.formState.isSubmitted
1662
- }), m.clearErrors(e);
1663
- }, [m]), ee = me((e) => {
1664
- let t = o.filter((t) => Ut(t, e)), n = Object.fromEntries(t.map((t) => [t.key, e[t.key]])), i = Object.values(n).some((e) => e instanceof File || Array.isArray(e) && e.some((e) => e instanceof File));
1665
- be[r.method === "put" ? "put" : r.method === "patch" ? "patch" : "post"](r.action, n, {
1666
- forceFormData: i,
1662
+ shouldValidate: h.formState.isSubmitted
1663
+ }), h.clearErrors(e);
1664
+ }, [h]), w = ge((e) => {
1665
+ let t = i.filter((t) => Wt(t, e)), a = Object.fromEntries(t.map((t) => [t.key, e[t.key]])), o = Object.values(a).some((e) => e instanceof File || Array.isArray(e) && e.some((e) => e instanceof File));
1666
+ xe[r.method === "put" ? "put" : r.method === "patch" ? "patch" : "post"](r.action, a, {
1667
+ forceFormData: o,
1667
1668
  onProgress: (e) => {
1668
- e && typeof e.percentage == "number" && b(Math.round(e.percentage));
1669
+ e && typeof e.percentage == "number" && x(Math.round(e.percentage));
1669
1670
  },
1670
1671
  onError: (e) => {
1671
- for (let [t, n] of Object.entries(e)) m.setError(t, {
1672
+ for (let [t, r] of Object.entries(e)) h.setError(t, {
1672
1673
  type: "server",
1673
- message: n
1674
+ message: oe(r, n)
1674
1675
  });
1675
1676
  },
1676
- onFinish: () => b(null)
1677
+ onFinish: () => x(null)
1677
1678
  });
1678
1679
  }, [
1679
- o,
1680
+ i,
1680
1681
  r,
1681
- m
1682
- ]), w = me(() => {
1683
- x ? v(!0) : r.meta.cancelHref ? be.visit(r.meta.cancelHref) : window.history.back();
1684
- }, [x, r.meta.cancelHref]), T = _e(() => {
1682
+ h,
1683
+ n
1684
+ ]), T = ge(() => {
1685
+ S ? y(!0) : r.meta.cancelHref ? xe.visit(r.meta.cancelHref) : window.history.back();
1686
+ }, [S, r.meta.cancelHref]), E = F(() => {
1685
1687
  let e = {};
1686
- for (let [t, n] of Object.entries(m.formState.errors)) n?.message && (e[t] = n.message);
1688
+ for (let [t, n] of Object.entries(h.formState.errors)) n?.message && (e[t] = n.message);
1687
1689
  return e;
1688
- }, [m.formState.errors]);
1689
- return o.filter((e) => Ut(e, h)).length === 0 && r.schema.length === 0 ? /* @__PURE__ */ I(s, {
1690
+ }, [h.formState.errors]);
1691
+ return i.filter((e) => Wt(e, g)).length === 0 && r.schema.length === 0 ? /* @__PURE__ */ I(a, {
1690
1692
  variant: "inline",
1691
1693
  title: n("middag.ui.form.no_fields")
1692
- }) : /* @__PURE__ */ L(xe, { children: [/* @__PURE__ */ L("form", {
1693
- onSubmit: m.handleSubmit(ee),
1694
+ }) : /* @__PURE__ */ L(Se, { children: [/* @__PURE__ */ L("form", {
1695
+ onSubmit: h.handleSubmit(w),
1694
1696
  className: "mx-auto max-w-[720px] space-y-6",
1695
1697
  noValidate: !0,
1696
1698
  role: "form",
1697
- "aria-label": i(e.title, n) || n("middag.ui.form.default_title"),
1698
- children: [/* @__PURE__ */ I(tn, {
1699
+ "aria-label": c(e.title, n) || n("middag.ui.form.default_title"),
1700
+ children: [/* @__PURE__ */ I(nn, {
1699
1701
  nodes: r.schema,
1700
- values: h,
1701
- errors: T,
1702
- onChange: C
1702
+ values: g,
1703
+ errors: E,
1704
+ onChange: ee
1703
1705
  }), /* @__PURE__ */ L("div", {
1704
1706
  className: "flex gap-3 pt-4",
1705
- children: [/* @__PURE__ */ I(M, {
1707
+ children: [/* @__PURE__ */ I(fe, {
1706
1708
  type: "submit",
1707
- disabled: S,
1708
- "aria-disabled": S,
1709
- "aria-busy": S,
1710
- children: S ? y === null ? n("middag.ui.form.saving") : `${n("middag.ui.form.saving")} ${y}%` : r.meta.submitLabel ?? n("middag.ui.form.save")
1711
- }), /* @__PURE__ */ I(M, {
1709
+ disabled: C,
1710
+ "aria-disabled": C,
1711
+ "aria-busy": C,
1712
+ children: C ? b === null ? n("middag.ui.form.saving") : `${n("middag.ui.form.saving")} ${b}%` : r.meta.submitLabel ?? n("middag.ui.form.save")
1713
+ }), /* @__PURE__ */ I(fe, {
1712
1714
  type: "button",
1713
1715
  variant: "outline",
1714
- onClick: w,
1716
+ onClick: T,
1715
1717
  children: r.meta.cancelLabel ?? n("middag.ui.cancel")
1716
1718
  })]
1717
1719
  })]
1718
- }), /* @__PURE__ */ I(c, {
1719
- open: _,
1720
- onOpenChange: v,
1721
- children: /* @__PURE__ */ L(ue, { children: [/* @__PURE__ */ L(a, { children: [/* @__PURE__ */ I(d, { children: n("middag.ui.form.dirty_title") }), /* @__PURE__ */ I(t, { children: n("middag.ui.form.dirty_message") })] }), /* @__PURE__ */ L(f, { children: [/* @__PURE__ */ I(M, {
1720
+ }), /* @__PURE__ */ I(t, {
1721
+ open: v,
1722
+ onOpenChange: y,
1723
+ children: /* @__PURE__ */ L(d, { children: [/* @__PURE__ */ L(f, { children: [/* @__PURE__ */ I(o, { children: n("middag.ui.form.dirty_title") }), /* @__PURE__ */ I(s, { children: n("middag.ui.form.dirty_message") })] }), /* @__PURE__ */ L(u, { children: [/* @__PURE__ */ I(fe, {
1722
1724
  variant: "outline",
1723
- onClick: () => v(!1),
1725
+ onClick: () => y(!1),
1724
1726
  children: n("middag.ui.cancel")
1725
- }), /* @__PURE__ */ I(M, {
1727
+ }), /* @__PURE__ */ I(fe, {
1726
1728
  variant: "destructive",
1727
1729
  onClick: () => {
1728
- v(!1), r.meta.cancelHref ? be.visit(r.meta.cancelHref) : window.history.back();
1730
+ y(!1), r.meta.cancelHref ? xe.visit(r.meta.cancelHref) : window.history.back();
1729
1731
  },
1730
1732
  children: n("middag.ui.form.dirty_leave")
1731
1733
  })] })] })
1732
1734
  })] });
1733
1735
  }
1734
1736
  //#endregion
1735
- export { nn as FormPanelBlock };
1737
+ export { rn as FormPanelBlock };