@burdenoff/microfe-admin 2026.625.1 → 2026.626.1

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/admin/components/AccessDenied.js +2 -2
  2. package/dist/admin/components/AccessDenied.js.map +1 -1
  3. package/dist/admin/components/ActivityFeed.js +4 -4
  4. package/dist/admin/components/ActivityFeed.js.map +1 -1
  5. package/dist/admin/components/Charts.js.map +1 -1
  6. package/dist/admin/components/ConfirmDialog.js +1 -1
  7. package/dist/admin/components/ConfirmDialog.js.map +1 -1
  8. package/dist/admin/components/FormSheet.js +1 -1
  9. package/dist/admin/components/FormSheet.js.map +1 -1
  10. package/dist/admin/components/TenantSsoPanel.js +1 -1
  11. package/dist/admin/components/TenantSsoPanel.js.map +1 -1
  12. package/dist/admin/components/Toast.js +11 -11
  13. package/dist/admin/components/Toast.js.map +1 -1
  14. package/dist/admin/components/forms/SubscriptionForm.js +2 -2
  15. package/dist/admin/components/forms/SubscriptionForm.js.map +1 -1
  16. package/dist/admin/components/forms/TenantForm.js +1 -1
  17. package/dist/admin/components/forms/UserForm.js +1 -1
  18. package/dist/admin/components/ui.js +3 -3
  19. package/dist/admin/components/ui.js.map +1 -1
  20. package/dist/admin/constants/index.js +33 -24
  21. package/dist/admin/constants/index.js.map +1 -1
  22. package/dist/admin/pages/AuditLogsPage.js +92 -77
  23. package/dist/admin/pages/AuditLogsPage.js.map +1 -1
  24. package/dist/admin/pages/BillingPage.js +95 -51
  25. package/dist/admin/pages/BillingPage.js.map +1 -1
  26. package/dist/admin/pages/CommunicationsPage.js +97 -92
  27. package/dist/admin/pages/CommunicationsPage.js.map +1 -1
  28. package/dist/admin/pages/ContentPagesPage.js +274 -259
  29. package/dist/admin/pages/ContentPagesPage.js.map +1 -1
  30. package/dist/admin/pages/DashboardPage.js +113 -84
  31. package/dist/admin/pages/DashboardPage.js.map +1 -1
  32. package/dist/admin/pages/FeatureFlagsPage.js +93 -75
  33. package/dist/admin/pages/FeatureFlagsPage.js.map +1 -1
  34. package/dist/admin/pages/OrganizationsListPage.js +105 -87
  35. package/dist/admin/pages/OrganizationsListPage.js.map +1 -1
  36. package/dist/admin/pages/ProductsPage.js +138 -130
  37. package/dist/admin/pages/ProductsPage.js.map +1 -1
  38. package/dist/admin/pages/ReferralsPage.js +70 -52
  39. package/dist/admin/pages/ReferralsPage.js.map +1 -1
  40. package/dist/admin/pages/RolesPermissionsPage.js +136 -118
  41. package/dist/admin/pages/RolesPermissionsPage.js.map +1 -1
  42. package/dist/admin/pages/SREPage.js +34 -32
  43. package/dist/admin/pages/SREPage.js.map +1 -1
  44. package/dist/admin/pages/SandboxSettingsPage.js +360 -322
  45. package/dist/admin/pages/SandboxSettingsPage.js.map +1 -1
  46. package/dist/admin/pages/SettingsPage.js +63 -60
  47. package/dist/admin/pages/SettingsPage.js.map +1 -1
  48. package/dist/admin/pages/SyncFailuresPage.js +120 -118
  49. package/dist/admin/pages/SyncFailuresPage.js.map +1 -1
  50. package/dist/admin/pages/TenantDetailPage.js +261 -218
  51. package/dist/admin/pages/TenantDetailPage.js.map +1 -1
  52. package/dist/admin/pages/TenantFormRoutePage.js +65 -61
  53. package/dist/admin/pages/TenantFormRoutePage.js.map +1 -1
  54. package/dist/admin/pages/TenantsListPage.js +86 -71
  55. package/dist/admin/pages/TenantsListPage.js.map +1 -1
  56. package/dist/admin/pages/UsersListPage.js +128 -113
  57. package/dist/admin/pages/UsersListPage.js.map +1 -1
  58. package/dist/admin/pages/WaitlistPage.js +78 -63
  59. package/dist/admin/pages/WaitlistPage.js.map +1 -1
  60. package/dist/admin/pages/WorkflowsPage.js +107 -102
  61. package/dist/admin/pages/WorkflowsPage.js.map +1 -1
  62. package/dist/admin/pages/WorkspacesListPage.js +61 -49
  63. package/dist/admin/pages/WorkspacesListPage.js.map +1 -1
  64. package/dist/node_modules/@hookform/resolvers/dist/resolvers.js +2 -2
  65. package/dist/node_modules/@hookform/resolvers/dist/resolvers.js.map +1 -1
  66. package/dist/node_modules/@hookform/resolvers/zod/dist/zod.js +35 -26
  67. package/dist/node_modules/@hookform/resolvers/zod/dist/zod.js.map +1 -1
  68. package/dist/node_modules/react-hook-form/dist/index.esm.js +609 -516
  69. package/dist/node_modules/react-hook-form/dist/index.esm.js.map +1 -1
  70. package/package.json +2 -2
@@ -14,35 +14,20 @@ function u(e) {
14
14
  for (let t in e) Object.prototype.hasOwnProperty.call(e, t) && (r[t] = u(e[t]));
15
15
  return r;
16
16
  }
17
- var d = (e) => /^\w*$/.test(e), f = (e) => e === void 0, p = (e) => Array.isArray(e) ? e.filter(Boolean) : [], m = (e) => p(e.replace(/["|']|\]/g, "").split(/\.|\[/)), h = (e, t, n) => {
18
- if (!t || !a(e)) return n;
19
- let i = (d(t) ? [t] : m(t)).reduce((e, t) => r(e) ? void 0 : e[t], e);
20
- return f(i) || i === e ? f(e[t]) ? n : e[t] : i;
21
- }, g = (e) => typeof e == "boolean", _ = (e) => typeof e == "function", v = (e, t, n) => {
22
- let r = -1, i = d(t) ? [t] : m(t), o = i.length, s = o - 1;
23
- for (; ++r < o;) {
24
- let t = i[r], o = n;
25
- if (r !== s) {
26
- let n = e[t];
27
- o = a(n) || Array.isArray(n) ? n : isNaN(+i[r + 1]) ? {} : [];
28
- }
29
- if (t === "__proto__" || t === "constructor" || t === "prototype") return;
30
- e[t] = o, e = e[t];
31
- }
32
- }, y = {
17
+ var d = {
33
18
  BLUR: "blur",
34
19
  FOCUS_OUT: "focusout",
35
20
  CHANGE: "change",
36
21
  SUBMIT: "submit",
37
22
  TRIGGER: "trigger",
38
23
  VALID: "valid"
39
- }, b = {
24
+ }, f = {
40
25
  onBlur: "onBlur",
41
26
  onChange: "onChange",
42
27
  onSubmit: "onSubmit",
43
28
  onTouched: "onTouched",
44
29
  all: "all"
45
- }, x = {
30
+ }, p = {
46
31
  max: "max",
47
32
  min: "min",
48
33
  maxLength: "maxLength",
@@ -50,18 +35,39 @@ var d = (e) => /^\w*$/.test(e), f = (e) => e === void 0, p = (e) => Array.isArra
50
35
  pattern: "pattern",
51
36
  required: "required",
52
37
  validate: "validate"
53
- }, S = "form", C = "root", w = e.createContext(null);
54
- w.displayName = "HookFormControlContext";
55
- var T = () => e.useContext(w), E = (e, t, n, r = !0) => {
38
+ }, m = "root", h = [
39
+ "__proto__",
40
+ "constructor",
41
+ "prototype"
42
+ ], g = /^\w*$/, _ = (e) => g.test(e), v = (e) => e === void 0, y = /[.[\]'"]/, b = (e) => e.split(y).filter(Boolean), x = (e, t, n) => {
43
+ if (!t || !a(e)) return n;
44
+ let i = _(t) ? [t] : b(t);
45
+ if (i.some((e) => h.includes(e))) return n;
46
+ let o = i.reduce((e, t) => r(e) ? void 0 : e[t], e);
47
+ return v(o) || o === e ? v(e[t]) ? n : e[t] : o;
48
+ }, S = (e) => typeof e == "boolean", C = (e) => typeof e == "function", w = (e, t, n) => {
49
+ let r = -1, i = _(t) ? [t] : b(t), o = i.length, s = o - 1;
50
+ for (; ++r < o;) {
51
+ let t = i[r], o = n;
52
+ if (r !== s) {
53
+ let n = e[t];
54
+ o = a(n) || Array.isArray(n) ? n : isNaN(+i[r + 1]) ? {} : [];
55
+ }
56
+ if (h.includes(t)) return;
57
+ e[t] = o, e = e[t];
58
+ }
59
+ }, T = e.createContext(null);
60
+ T.displayName = "HookFormControlContext";
61
+ var E = () => e.useContext(T), D = (e, t, n, r = !0) => {
56
62
  let i = {};
57
63
  for (let a in e) Object.defineProperty(i, a, { get: () => {
58
64
  let i = a;
59
- return t._proxyFormState[i] !== b.all && (t._proxyFormState[i] = !r || b.all), n && (n[i] = !0), e[i];
65
+ return t._proxyFormState[i] !== f.all && (t._proxyFormState[i] = !r || f.all), n && (n[i] = !0), e[i];
60
66
  } });
61
67
  return i;
62
- }, D = typeof window < "u" ? e.useLayoutEffect : e.useEffect;
63
- function O(t) {
64
- let n = T(), { control: r = n, disabled: i, name: a, exact: o } = t || {}, [s, c] = e.useState(() => ({
68
+ }, O = l ? e.useLayoutEffect : e.useEffect;
69
+ function k(t) {
70
+ let n = E(), { control: r = n, disabled: i, name: a, exact: o } = t || {}, [s, c] = e.useState(() => ({
65
71
  ...r._formState,
66
72
  defaultValues: r._defaultValues
67
73
  })), l = e.useRef({
@@ -74,7 +80,7 @@ function O(t) {
74
80
  isValid: !1,
75
81
  errors: !1
76
82
  });
77
- return D(() => r._subscribe({
83
+ return O(() => r._subscribe({
78
84
  name: a,
79
85
  formState: l.current,
80
86
  exact: o,
@@ -91,35 +97,42 @@ function O(t) {
91
97
  o
92
98
  ]), e.useEffect(() => {
93
99
  l.current.isValid && r._setValid(!0);
94
- }, [r]), e.useMemo(() => E(s, r, l.current, !1), [s, r]);
100
+ }, [r]), e.useMemo(() => D(s, r, l.current, !1), [s, r]);
95
101
  }
96
- var k = (e) => typeof e == "string", A = (e, t, n, r, i) => k(e) ? (r && t.watch.add(e), h(n, e, i)) : Array.isArray(e) ? e.map((e) => (r && t.watch.add(e), h(n, e))) : (r && (t.watchAll = !0), n), j = (e) => r(e) || !i(e);
97
- function M(e, t, r = /* @__PURE__ */ new WeakSet()) {
102
+ var A = (e) => typeof e == "string", j = (e, t, n, r, i) => A(e) ? (r && t.watch.add(e), x(n, e, i)) : Array.isArray(e) ? e.map((e) => (r && t.watch.add(e), x(n, e))) : (r && (t.watchAll = !0), n), M = (e) => r(e) || !i(e), N = (e, t) => t.length === 0 && !Array.isArray(e) && !c(e);
103
+ function P(e, t, r = /* @__PURE__ */ new WeakMap()) {
98
104
  if (e === t) return !0;
99
- if (j(e) || j(t)) return Object.is(e, t);
105
+ if (M(e) || M(t)) return Object.is(e, t);
100
106
  if (n(e) && n(t)) return Object.is(e.getTime(), t.getTime());
101
107
  let i = Object.keys(e), o = Object.keys(t);
102
108
  if (i.length !== o.length) return !1;
103
- if (r.has(e) || r.has(t)) return !0;
104
- r.add(e), r.add(t);
109
+ if (N(e, i) || N(t, o)) return Object.is(e, t);
110
+ if (!i.length && Array.isArray(e) !== Array.isArray(t)) return !1;
111
+ let s = r.get(e);
112
+ if (s && s.has(t)) return !0;
113
+ if (s) s.add(t);
114
+ else {
115
+ let n = /* @__PURE__ */ new WeakSet();
116
+ n.add(t), r.set(e, n);
117
+ }
105
118
  for (let o of i) {
106
119
  let i = e[o];
107
120
  if (!(o in t)) return !1;
108
121
  if (o !== "ref") {
109
122
  let e = t[o];
110
- if (n(i) && n(e) || (a(i) || Array.isArray(i)) && (a(e) || Array.isArray(e)) ? !M(i, e, r) : !Object.is(i, e)) return !1;
123
+ if (n(i) && n(e) || (a(i) || Array.isArray(i)) && (a(e) || Array.isArray(e)) ? !P(i, e, r) : !Object.is(i, e)) return !1;
111
124
  }
112
125
  }
113
126
  return !0;
114
127
  }
115
- function N(t) {
116
- let n = T(), { control: r = n, name: i, defaultValue: a, disabled: o, exact: s, compute: c } = t || {}, l = e.useRef(a), u = e.useRef(c), d = e.useRef(void 0), f = e.useRef(r), p = e.useRef(i);
128
+ function F(t) {
129
+ let n = E(), { control: r = n, name: i, defaultValue: a, disabled: o, exact: s, compute: c } = t || {}, l = e.useRef(a), u = e.useRef(c), d = e.useRef(void 0), f = e.useRef(r), p = e.useRef(i);
117
130
  u.current = c;
118
131
  let [m, h] = e.useState(() => {
119
132
  let e = r._getWatch(i, l.current);
120
133
  return u.current ? u.current(e) : e;
121
134
  }), g = e.useCallback((e) => {
122
- let t = A(i, r._names, e || r._formValues, !1, l.current);
135
+ let t = j(i, r._names, e || r._formValues, !1, l.current);
123
136
  return u.current ? u.current(t) : t;
124
137
  }, [
125
138
  r._formValues,
@@ -127,10 +140,10 @@ function N(t) {
127
140
  i
128
141
  ]), _ = e.useCallback((e) => {
129
142
  if (!o) {
130
- let t = A(i, r._names, e || r._formValues, !1, l.current);
143
+ let t = j(i, r._names, e || r._formValues, !1, l.current);
131
144
  if (u.current) {
132
145
  let e = u.current(t);
133
- M(e, d.current) || (h(e), d.current = e);
146
+ P(e, d.current) || (h(e), d.current = e);
134
147
  } else h(t);
135
148
  }
136
149
  }, [
@@ -139,7 +152,7 @@ function N(t) {
139
152
  o,
140
153
  i
141
154
  ]);
142
- D(() => ((f.current !== r || !M(p.current, i)) && (f.current = r, p.current = i, _()), r._subscribe({
155
+ O(() => ((f.current !== r || !P(p.current, i)) && (f.current = r, p.current = i, _()), r._subscribe({
143
156
  name: i,
144
157
  formState: { values: !0 },
145
158
  exact: s,
@@ -154,7 +167,7 @@ function N(t) {
154
167
  ]), e.useEffect(() => r._removeUnmounted());
155
168
  let v = f.current !== r, y = p.current, b = e.useMemo(() => {
156
169
  if (o) return null;
157
- let e = !v && !M(y, i);
170
+ let e = !v && !P(y, i);
158
171
  return v || e ? g() : null;
159
172
  }, [
160
173
  o,
@@ -165,98 +178,109 @@ function N(t) {
165
178
  ]);
166
179
  return b === null ? m : b;
167
180
  }
168
- function P(t) {
169
- let n = T(), { name: r, disabled: i, control: a = n, shouldUnregister: c, defaultValue: l, exact: d = !0 } = t, p = s(a._names.array, r), m = N({
181
+ function I(t) {
182
+ let n = E(), { name: r, disabled: i, control: a = n, shouldUnregister: c, defaultValue: l, exact: f = !0 } = t, p = s(a._names.array, r), m = F({
170
183
  control: a,
171
184
  name: r,
172
- defaultValue: e.useMemo(() => h(a._formValues, r, h(a._defaultValues, r, l)), [
185
+ defaultValue: e.useMemo(() => x(a._formValues, r, x(a._defaultValues, r, l)), [
173
186
  a,
174
187
  r,
175
188
  l
176
189
  ]),
177
- exact: d
178
- }), b = O({
190
+ exact: f
191
+ }), h = k({
179
192
  control: a,
180
193
  name: r,
181
- exact: d
182
- }), x = e.useRef(t), S = e.useRef(a.register(r, {
194
+ exact: f
195
+ }), g = e.useRef(t), _ = e.useRef(null), y = e.useRef(a.register(r, {
183
196
  ...t.rules,
184
197
  value: m,
185
- ...g(t.disabled) ? { disabled: t.disabled } : {}
198
+ ...S(t.disabled) ? { disabled: t.disabled } : {}
186
199
  }));
187
- x.current = t;
188
- let C = e.useMemo(() => Object.defineProperties({}, {
200
+ g.current = t;
201
+ let b = e.useMemo(() => Object.defineProperties({}, {
189
202
  invalid: {
190
203
  enumerable: !0,
191
- get: () => !!h(b.errors, r)
204
+ get: () => !!x(h.errors, r)
192
205
  },
193
206
  isDirty: {
194
207
  enumerable: !0,
195
- get: () => !!h(b.dirtyFields, r)
208
+ get: () => !!x(h.dirtyFields, r)
196
209
  },
197
210
  isTouched: {
198
211
  enumerable: !0,
199
- get: () => !!h(b.touchedFields, r)
212
+ get: () => !!x(h.touchedFields, r)
200
213
  },
201
214
  isValidating: {
202
215
  enumerable: !0,
203
- get: () => !!h(b.validatingFields, r)
216
+ get: () => !!x(h.validatingFields, r)
204
217
  },
205
218
  error: {
206
219
  enumerable: !0,
207
- get: () => h(b.errors, r)
220
+ get: () => x(h.errors, r)
208
221
  }
209
- }), [b, r]), w = e.useCallback((e) => S.current.onChange({
210
- target: {
211
- value: o(e),
212
- name: r
213
- },
214
- type: y.CHANGE
215
- }), [r]), E = e.useCallback(() => S.current.onBlur({
222
+ }), [h, r]), T = e.useCallback((e) => {
223
+ let t = o(e);
224
+ return x(a._fields, r) || (y.current = a.register(r, {
225
+ ...g.current.rules,
226
+ value: t
227
+ })), y.current.onChange({
228
+ target: {
229
+ value: o(e),
230
+ name: r
231
+ },
232
+ type: d.CHANGE
233
+ });
234
+ }, [r, a]), D = e.useCallback(() => y.current.onBlur({
216
235
  target: {
217
- value: h(a._formValues, r),
236
+ value: x(a._formValues, r),
218
237
  name: r
219
238
  },
220
- type: y.BLUR
221
- }), [r, a._formValues]), D = e.useCallback((e) => {
222
- let t = h(a._fields, r);
223
- t && t._f && e && (t._f.ref = {
224
- focus: () => _(e.focus) && e.focus(),
225
- select: () => _(e.select) && e.select(),
226
- setCustomValidity: (t) => _(e.setCustomValidity) && e.setCustomValidity(t),
227
- reportValidity: () => _(e.reportValidity) && e.reportValidity()
239
+ type: d.BLUR
240
+ }), [r, a._formValues]), O = e.useCallback((e) => {
241
+ e && (_.current = {
242
+ focus: () => C(e.focus) && e.focus(),
243
+ select: () => C(e.select) && e.select(),
244
+ setCustomValidity: (t) => C(e.setCustomValidity) && e.setCustomValidity(t),
245
+ reportValidity: () => C(e.reportValidity) && e.reportValidity()
228
246
  });
229
- }, [a._fields, r]), k = e.useMemo(() => ({
247
+ let t = x(a._fields, r);
248
+ t && t._f && e && (t._f.ref = _.current);
249
+ }, [a._fields, r]), A = e.useMemo(() => ({
230
250
  name: r,
231
251
  value: m,
232
- ...g(i) || b.disabled ? { disabled: b.disabled || i } : {},
233
- onChange: w,
234
- onBlur: E,
235
- ref: D
252
+ ...S(i) || h.disabled ? { disabled: h.disabled || i } : {},
253
+ onChange: T,
254
+ onBlur: D,
255
+ ref: O
236
256
  }), [
237
257
  r,
238
258
  i,
239
- b.disabled,
240
- w,
241
- E,
259
+ h.disabled,
260
+ T,
242
261
  D,
262
+ O,
243
263
  m
244
264
  ]);
245
265
  return e.useEffect(() => {
246
266
  let e = a._options.shouldUnregister || c;
247
267
  a.register(r, {
248
- ...x.current.rules,
249
- ...g(x.current.disabled) ? { disabled: x.current.disabled } : {}
268
+ ...g.current.rules,
269
+ ...S(g.current.disabled) ? { disabled: g.current.disabled } : {}
250
270
  });
251
271
  let t = (e, t) => {
252
- let n = h(a._fields, e);
272
+ let n = x(a._fields, e);
253
273
  n && n._f && (n._f.mount = t);
254
274
  };
255
275
  if (t(r, !0), e) {
256
- let e = u(h(a._options.defaultValues, r, x.current.defaultValue));
257
- v(a._defaultValues, r, e), f(h(a._formValues, r)) && v(a._formValues, r, e);
276
+ let e = u(x(c ? a._defaultValues : a._options.values || a._defaultValues, r, x(a._options.defaultValues, r, g.current.defaultValue)));
277
+ w(a._defaultValues, r, e), v(x(a._formValues, r)) && w(a._formValues, r, e);
278
+ }
279
+ if (!p && a.register(r), _.current) {
280
+ let e = x(a._fields, r);
281
+ e && e._f && (e._f.ref = _.current);
258
282
  }
259
- return !p && a.register(r), () => {
283
+ return () => {
260
284
  (p ? e && !a._state.action : e) ? a.unregister(r) : t(r, !1);
261
285
  };
262
286
  }, [
@@ -274,24 +298,24 @@ function P(t) {
274
298
  r,
275
299
  a
276
300
  ]), e.useMemo(() => ({
277
- field: k,
278
- formState: b,
279
- fieldState: C
301
+ field: A,
302
+ formState: h,
303
+ fieldState: b
280
304
  }), [
281
- k,
282
- b,
283
- C
305
+ A,
306
+ h,
307
+ b
284
308
  ]);
285
309
  }
286
- var F = (e) => e.render(P(e)), I = e.createContext(null);
287
- I.displayName = "HookFormContext";
310
+ var L = (e) => e.render(I(e)), R = e.createContext(null);
311
+ R.displayName = "HookFormContext";
288
312
  var ee = (e, t, n, r, i) => t ? {
289
313
  ...n[e],
290
314
  types: {
291
315
  ...n[e] && n[e].types ? n[e].types : {},
292
316
  [r]: i || !0
293
317
  }
294
- } : {}, L = (e) => Array.isArray(e) ? e : [e], te = () => {
318
+ } : {}, te = (e) => Array.isArray(e) ? e.filter(Boolean) : [], ne = (e) => Array.isArray(e) ? e : [e], re = () => {
295
319
  let e = [];
296
320
  return {
297
321
  get observers() {
@@ -308,23 +332,23 @@ var ee = (e, t, n, r, i) => t ? {
308
332
  }
309
333
  };
310
334
  };
311
- function ne(e, t) {
335
+ function ie(e, t) {
312
336
  let n = {};
313
337
  for (let r in e) if (e.hasOwnProperty(r)) {
314
338
  let i = e[r], o = t[r];
315
339
  if (i && a(i) && o) {
316
- let e = ne(i, o);
340
+ let e = ie(i, o);
317
341
  a(e) && (n[r] = e);
318
342
  } else e[r] && (n[r] = o);
319
343
  }
320
344
  return n;
321
345
  }
322
- var R = (e) => a(e) && !Object.keys(e).length, re = (e) => e.type === "file", z = (e) => {
346
+ var z = (e) => a(e) && !Object.keys(e).length, ae = (e) => e.type === "file", oe = (e) => {
323
347
  if (!l) return !1;
324
348
  let t = e ? e.ownerDocument : 0;
325
349
  return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
326
- }, ie = (e) => e.type === "select-multiple", B = (e) => e.type === "radio", ae = (e) => B(e) || t(e), oe = (e) => z(e) && e.isConnected;
327
- function V(e, t) {
350
+ }, se = (e) => e.type === "select-multiple", ce = (e) => e.type === "radio", le = (e) => ce(e) || t(e), ue = (e) => oe(e) && e.isConnected;
351
+ function B(e, t) {
328
352
  let n = t.slice(0, -1).length, i = 0;
329
353
  for (; i < n;) {
330
354
  if (r(e)) {
@@ -335,26 +359,26 @@ function V(e, t) {
335
359
  }
336
360
  return e;
337
361
  }
338
- function se(e) {
339
- for (let t in e) if (e.hasOwnProperty(t) && !f(e[t])) return !1;
362
+ function V(e) {
363
+ for (let t in e) if (e.hasOwnProperty(t) && !v(e[t])) return !1;
340
364
  return !0;
341
365
  }
342
366
  function H(e, t) {
343
- if (k(t) && Object.prototype.hasOwnProperty.call(e, t)) return delete e[t], e;
344
- let n = Array.isArray(t) ? t : d(t) ? [t] : m(t), r = n.length === 1 ? e : V(e, n), i = n.length - 1, o = n[i];
345
- return r && delete r[o], i !== 0 && (a(r) && R(r) || Array.isArray(r) && se(r)) && H(e, n.slice(0, -1)), e;
367
+ if (A(t) && Object.prototype.hasOwnProperty.call(e, t)) return delete e[t], e;
368
+ let n = Array.isArray(t) ? t : _(t) ? [t] : b(t), r = n.length === 1 ? e : B(e, n), i = n.length - 1, o = n[i];
369
+ return r && delete r[o], i !== 0 && (a(r) && z(r) || Array.isArray(r) && V(r)) && H(e, n.slice(0, -1)), e;
346
370
  }
347
- var ce = (e) => {
348
- for (let t in e) if (_(e[t])) return !0;
371
+ var de = (e) => {
372
+ for (let t in e) if (C(e[t])) return !0;
349
373
  return !1;
350
374
  };
351
- function le(e) {
352
- return Array.isArray(e) || a(e) && !ce(e);
375
+ function fe(e) {
376
+ return Array.isArray(e) || a(e) && !de(e);
353
377
  }
354
378
  function U(e, t = {}) {
355
379
  for (let n in e) {
356
380
  let r = e[n];
357
- le(r) ? (t[n] = Array.isArray(r) ? [] : {}, U(r, t[n])) : f(r) || (t[n] = !0);
381
+ fe(r) ? (t[n] = Array.isArray(r) ? [] : {}, U(r, t[n])) : v(r) || (t[n] = !0);
358
382
  }
359
383
  return t;
360
384
  }
@@ -369,7 +393,7 @@ function W(e) {
369
393
  let t = {};
370
394
  for (let n in e) {
371
395
  let r = W(e[n]);
372
- f(r) || (t[n] = r);
396
+ v(r) || (t[n] = r);
373
397
  }
374
398
  return Object.keys(t).length ? t : void 0;
375
399
  }
@@ -379,21 +403,21 @@ function G(e, t, n) {
379
403
  n ||= U(t);
380
404
  for (let i in e) {
381
405
  let a = e[i];
382
- if (le(a)) f(t) || j(n[i]) ? n[i] = U(a, Array.isArray(a) ? [] : {}) : G(a, r(t) ? {} : t[i], n[i]);
406
+ if (fe(a)) v(t) || M(n[i]) ? n[i] = U(a, Array.isArray(a) ? [] : {}) : G(a, r(t) ? {} : t[i], n[i]);
383
407
  else {
384
408
  let e = t[i];
385
- n[i] = !M(a, e);
409
+ n[i] = !P(a, e);
386
410
  }
387
411
  }
388
412
  return W(n) || {};
389
413
  }
390
- var K = {
414
+ var pe = {
391
415
  value: !1,
392
416
  isValid: !1
393
- }, ue = {
417
+ }, me = {
394
418
  value: !0,
395
419
  isValid: !0
396
- }, q = (e) => {
420
+ }, he = (e) => {
397
421
  if (Array.isArray(e)) {
398
422
  if (e.length > 1) {
399
423
  let t = e.filter((e) => e && e.checked && !e.disabled).map((e) => e.value);
@@ -402,28 +426,28 @@ var K = {
402
426
  isValid: !!t.length
403
427
  };
404
428
  }
405
- return e[0].checked && !e[0].disabled ? e[0].attributes && !f(e[0].attributes.value) ? f(e[0].value) || e[0].value === "" ? ue : {
429
+ return e[0].checked && !e[0].disabled ? e[0].attributes && !v(e[0].attributes.value) ? v(e[0].value) || e[0].value === "" ? me : {
406
430
  value: e[0].value,
407
431
  isValid: !0
408
- } : ue : K;
432
+ } : me : pe;
409
433
  }
410
- return K;
411
- }, de = (e, { valueAsNumber: t, valueAsDate: n, setValueAs: r }) => f(e) ? e : t ? e === "" ? NaN : e && +e : n && k(e) ? new Date(e) : r ? r(e) : e, fe = {
434
+ return pe;
435
+ }, ge = (e, { valueAsNumber: t, valueAsDate: n, setValueAs: r }) => v(e) ? e : t ? e === "" ? NaN : e && +e : n && A(e) ? new Date(e) : r ? r(e) : e, _e = {
412
436
  isValid: !1,
413
437
  value: null
414
- }, pe = (e) => Array.isArray(e) ? e.reduce((e, t) => t && t.checked && !t.disabled ? {
438
+ }, K = (e) => Array.isArray(e) ? e.reduce((e, t) => t && t.checked && !t.disabled ? {
415
439
  isValid: !0,
416
440
  value: t.value
417
- } : e, fe) : fe;
418
- function me(e) {
441
+ } : e, _e) : _e;
442
+ function ve(e) {
419
443
  let n = e.ref;
420
- return re(n) ? n.files : B(n) ? pe(e.refs).value : ie(n) ? [...n.selectedOptions].map(({ value: e }) => e) : t(n) ? q(e.refs).value : de(f(n.value) ? e.ref.value : n.value, e);
444
+ return ae(n) ? n.files : ce(n) ? K(e.refs).value : se(n) ? [...n.selectedOptions].map(({ value: e }) => e) : t(n) ? he(e.refs).value : ge(v(n.value) ? e.ref.value : n.value, e);
421
445
  }
422
- var he = (e, t, n, r) => {
446
+ var ye = (e, t, n, r) => {
423
447
  let i = {};
424
448
  for (let n of e) {
425
- let e = h(t, n);
426
- e && v(i, n, e._f);
449
+ let e = x(t, n);
450
+ e && w(i, n, e._f);
427
451
  }
428
452
  return {
429
453
  criteriaMode: n,
@@ -431,33 +455,45 @@ var he = (e, t, n, r) => {
431
455
  fields: i,
432
456
  shouldUseNativeValidation: r
433
457
  };
434
- }, J = (e) => e instanceof RegExp, Y = (e) => f(e) ? e : J(e) ? e.source : a(e) ? J(e.value) ? e.value.source : e.value : e, ge = (e) => ({
435
- isOnSubmit: !e || e === b.onSubmit,
436
- isOnBlur: e === b.onBlur,
437
- isOnChange: e === b.onChange,
438
- isOnAll: e === b.all,
439
- isOnTouch: e === b.onTouched
440
- }), _e = "AsyncFunction", ve = (e) => !!e && !!e.validate && !!(_(e.validate) && e.validate.constructor.name === _e || a(e.validate) && Object.values(e.validate).find((e) => e.constructor.name === _e)), ye = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), be = (e, t, n) => !n && (t.watchAll || t.watch.has(e) || [...t.watch].some((t) => e.startsWith(t) && /^\.\w+/.test(e.slice(t.length)))), X = (e, t, n, r) => {
458
+ }, q = (e) => e instanceof RegExp, J = (e) => v(e) ? e : q(e) ? e.source : a(e) ? q(e.value) ? e.value.source : e.value : e, be = (e) => ({
459
+ isOnSubmit: !e || e === f.onSubmit,
460
+ isOnBlur: e === f.onBlur,
461
+ isOnChange: e === f.onChange,
462
+ isOnAll: e === f.all,
463
+ isOnTouch: e === f.onTouched
464
+ }), xe = "AsyncFunction", Se = (e) => {
465
+ if (!e || !e.validate) return !1;
466
+ if (C(e.validate)) return e.validate.constructor.name === xe;
467
+ if (a(e.validate)) {
468
+ for (let t in e.validate) if (e.validate[t].constructor.name === xe) return !0;
469
+ }
470
+ return !1;
471
+ }, Ce = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), we = (e, t, n) => {
472
+ if (n) return !1;
473
+ if (t.watchAll || t.watch.has(e)) return !0;
474
+ for (let n of t.watch) if (e.startsWith(n) && e.charAt(n.length) === ".") return !0;
475
+ return !1;
476
+ }, Y = (e, t, n, r) => {
441
477
  for (let i of n || Object.keys(e)) {
442
- let n = h(e, i);
478
+ let n = x(e, i);
443
479
  if (n) {
444
480
  let { _f: e, ...o } = n;
445
481
  if (e) {
446
482
  if (e.refs && e.refs[0] && t(e.refs[0], i) && !r || e.ref && t(e.ref, e.name) && !r) return !0;
447
- if (X(o, t)) break;
448
- } else if (a(o) && X(o, t)) break;
483
+ if (Y(o, t)) break;
484
+ } else if (a(o) && Y(o, t)) break;
449
485
  }
450
486
  }
451
487
  };
452
- function xe(e, t, n) {
453
- let r = h(e, n);
454
- if (r || d(n)) return {
488
+ function Te(e, t, n) {
489
+ let r = x(e, n);
490
+ if (r || _(n)) return {
455
491
  error: r,
456
492
  name: n
457
493
  };
458
494
  let i = n.split(".");
459
495
  for (; i.length;) {
460
- let r = i.join("."), a = h(t, r), o = h(e, r);
496
+ let r = i.join("."), a = x(t, r), o = x(e, r);
461
497
  if (a && !Array.isArray(a) && n !== r) return { name: n };
462
498
  if (o && o.type) return {
463
499
  name: r,
@@ -471,103 +507,106 @@ function xe(e, t, n) {
471
507
  }
472
508
  return { name: n };
473
509
  }
474
- var Se = (e, t, n, r) => {
510
+ var Ee = (e, t, n, r) => {
475
511
  n(e);
476
- let { name: i, ...a } = e;
477
- return R(a) || r && Object.keys(a).length >= Object.keys(t).length || Object.keys(a).find((e) => t[e] === (!r || b.all));
478
- }, Ce = (e, t, n) => !e || !t || e === t || L(e).some((e) => e && (n ? e === t : e.startsWith(t) || t.startsWith(e))), we = (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, Te = (e, t) => !p(h(e, t)).length && H(e, t), Ee = (e, t, n) => {
479
- let r = L(h(e, n));
480
- return v(r, C, t[n]), v(e, n, r), e;
512
+ let { name: i, ...a } = e, o = Object.keys(a);
513
+ return !o.length || r && o.length >= Object.keys(t).length || o.find((e) => t[e] === (!r || f.all));
514
+ }, De = (e, t, n) => !e || !t || e === t || ne(e).some((e) => e && (n ? e === t : e.startsWith(t) || t.startsWith(e))), Oe = (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, ke = (e, t) => !te(x(e, t)).length && H(e, t), Ae = (e, t, n) => {
515
+ let r = x(e, n), i = Array.isArray(r) ? r : [];
516
+ return w(i, m, t[n]), w(e, n, i), e;
481
517
  };
482
- function Z(e, t, n = "validate") {
483
- if (k(e) || Array.isArray(e) && e.every(k) || g(e) && !e) return {
518
+ function X(e, t, n = "validate") {
519
+ if (A(e) || Array.isArray(e) && e.every(A) || S(e) && !e) return {
484
520
  type: n,
485
- message: k(e) ? e : "",
521
+ message: A(e) ? e : "",
486
522
  ref: t
487
523
  };
488
524
  }
489
- var Q = (e) => a(e) && !J(e) ? e : {
525
+ var Z = (e) => a(e) && !q(e) ? e : {
490
526
  value: e,
491
527
  message: ""
492
- }, De = async (e, n, i, o, s, c) => {
493
- let { ref: l, refs: u, required: d, maxLength: p, minLength: m, min: v, max: y, pattern: b, validate: S, name: C, valueAsNumber: w, mount: T } = e._f, E = h(i, C);
494
- if (!T || n.has(C)) return {};
528
+ }, je = async (e, n, i, o, s, c) => {
529
+ let { ref: l, refs: u, required: d, maxLength: f, minLength: m, min: h, max: g, pattern: _, validate: y, name: b, valueAsNumber: w, mount: T } = e._f, E = x(i, b);
530
+ if (!T || n.has(b)) return {};
495
531
  let D = u ? u[0] : l, O = (e) => {
496
- s && D.reportValidity && (D.setCustomValidity(g(e) ? "" : e || ""), D.reportValidity());
497
- }, A = {}, j = B(l), M = t(l), N = j || M, P = (w || re(l)) && f(l.value) && f(E) || z(l) && l.value === "" || E === "" || Array.isArray(E) && !E.length || w && typeof E == "number" && isNaN(E), F = ee.bind(null, C, o, A), I = (e, t, n, r = x.maxLength, i = x.minLength) => {
532
+ if (s && D.reportValidity) {
533
+ let t = S(e) ? "" : e || "";
534
+ u ? u.forEach((e) => e.setCustomValidity(t)) : D.setCustomValidity(t), D.reportValidity();
535
+ }
536
+ }, k = {}, j = ce(l), M = t(l), N = j || M, P = (w || ae(l)) && v(l.value) && v(E) || oe(l) && l.value === "" || E === "" || Array.isArray(E) && !E.length, F = ee.bind(null, b, o, k), I = (e, t, n, r = p.maxLength, i = p.minLength) => {
498
537
  let a = e ? t : n;
499
- A[C] = {
538
+ k[b] = {
500
539
  type: e ? r : i,
501
540
  message: a,
502
541
  ref: l,
503
542
  ...F(e ? r : i, a)
504
543
  };
505
544
  };
506
- if (c ? !Array.isArray(E) || !E.length : d && (!N && (P || r(E)) || g(E) && !E || M && !q(u).isValid || j && !pe(u).isValid)) {
507
- let { value: e, message: t } = k(d) ? {
545
+ if (c ? !Array.isArray(E) || !E.length : d && (!N && (P || r(E)) || S(E) && !E || M && !he(u).isValid || j && !K(u).isValid)) {
546
+ let { value: e, message: t } = A(d) ? {
508
547
  value: !!d,
509
548
  message: d
510
- } : Q(d);
511
- if (e && (A[C] = {
512
- type: x.required,
549
+ } : Z(d);
550
+ if (e && (k[b] = {
551
+ type: p.required,
513
552
  message: t,
514
553
  ref: D,
515
- ...F(x.required, t)
516
- }, !o)) return O(t), A;
554
+ ...F(p.required, t)
555
+ }, !o)) return O(t), k;
517
556
  }
518
- if (!P && (!r(v) || !r(y))) {
519
- let e, t, n = Q(y), i = Q(v);
557
+ if (!P && (!r(h) || !r(g))) {
558
+ let e, t, n = Z(g), i = Z(h);
520
559
  if (!r(E) && !isNaN(E)) {
521
560
  let a = l.valueAsNumber || E && +E;
522
561
  r(n.value) || (e = a > n.value), r(i.value) || (t = a < i.value);
523
562
  } else {
524
563
  let r = l.valueAsDate || new Date(E), a = (e) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + e), o = l.type == "time", s = l.type == "week";
525
- k(n.value) && E && (e = o ? a(E) > a(n.value) : s ? E > n.value : r > new Date(n.value)), k(i.value) && E && (t = o ? a(E) < a(i.value) : s ? E < i.value : r < new Date(i.value));
564
+ A(n.value) && E && (e = o ? a(E) > a(n.value) : s ? E > n.value : r > new Date(n.value)), A(i.value) && E && (t = o ? a(E) < a(i.value) : s ? E < i.value : r < new Date(i.value));
526
565
  }
527
- if ((e || t) && (I(!!e, n.message, i.message, x.max, x.min), !o)) return O(A[C].message), A;
566
+ if ((e || t) && (I(!!e, n.message, i.message, p.max, p.min), !o)) return O(k[b].message), k;
528
567
  }
529
- if ((p || m) && !P && (k(E) || c && Array.isArray(E))) {
530
- let e = Q(p), t = Q(m), n = !r(e.value) && E.length > +e.value, i = !r(t.value) && E.length < +t.value;
531
- if ((n || i) && (I(n, e.message, t.message), !o)) return O(A[C].message), A;
568
+ if ((f || m) && !P && (A(E) || c && Array.isArray(E))) {
569
+ let e = Z(f), t = Z(m), n = !r(e.value) && E.length > +e.value, i = !r(t.value) && E.length < +t.value;
570
+ if ((n || i) && (I(n, e.message, t.message), !o)) return O(k[b].message), k;
532
571
  }
533
- if (b && !P && k(E)) {
534
- let { value: e, message: t } = Q(b);
535
- if (J(e) && !E.match(e) && (A[C] = {
536
- type: x.pattern,
572
+ if (_ && !P && A(E)) {
573
+ let { value: e, message: t } = Z(_);
574
+ if (q(e) && !E.match(e) && (k[b] = {
575
+ type: p.pattern,
537
576
  message: t,
538
577
  ref: l,
539
- ...F(x.pattern, t)
540
- }, !o)) return O(t), A;
578
+ ...F(p.pattern, t)
579
+ }, !o)) return O(t), k;
541
580
  }
542
- if (S) {
543
- if (_(S)) {
544
- let e = Z(await S(E, i), D);
545
- if (e && (A[C] = {
581
+ if (y) {
582
+ if (C(y)) {
583
+ let e = X(await y(E, i), D);
584
+ if (e && (k[b] = {
546
585
  ...e,
547
- ...F(x.validate, e.message)
548
- }, !o)) return O(e.message), A;
549
- } else if (a(S)) {
586
+ ...F(p.validate, e.message)
587
+ }, !o)) return O(e.message), k;
588
+ } else if (a(y)) {
550
589
  let e = {};
551
- for (let t in S) {
552
- if (!R(e) && !o) break;
553
- let n = Z(await S[t](E, i), D, t);
590
+ for (let t in y) {
591
+ if (!z(e) && !o) break;
592
+ let n = X(await y[t](E, i), D, t);
554
593
  n && (e = {
555
594
  ...n,
556
595
  ...F(t, n.message)
557
- }, O(n.message), o && (A[C] = e));
596
+ }, O(n.message), o && (k[b] = e));
558
597
  }
559
- if (!R(e) && (A[C] = {
598
+ if (!z(e) && (k[b] = {
560
599
  ref: D,
561
600
  ...e
562
- }, !o)) return A;
601
+ }, !o)) return k;
563
602
  }
564
603
  }
565
- return O(!0), A;
566
- }, Oe = {
567
- mode: b.onSubmit,
568
- reValidateMode: b.onChange,
604
+ return O(!0), k;
605
+ }, Me = {
606
+ mode: f.onSubmit,
607
+ reValidateMode: f.onChange,
569
608
  shouldFocusError: !0
570
- }, ke = {
609
+ }, Ne = "form", Pe = {
571
610
  submitCount: 0,
572
611
  isDirty: !1,
573
612
  isReady: !1,
@@ -580,16 +619,16 @@ var Q = (e) => a(e) && !J(e) ? e : {
580
619
  dirtyFields: {},
581
620
  validatingFields: {}
582
621
  };
583
- function Ae(e = {}) {
622
+ function Q(e = {}) {
584
623
  let i = {
585
- ...Oe,
624
+ ...Me,
586
625
  ...e
587
626
  }, c = {
588
- ...u(ke),
589
- isLoading: _(i.defaultValues),
627
+ ...u(Pe),
628
+ isLoading: C(i.defaultValues),
590
629
  errors: i.errors || {},
591
630
  disabled: i.disabled || !1
592
- }, d = {}, m = (a(i.defaultValues) || a(i.values)) && u(i.defaultValues || i.values) || {}, w = i.shouldUnregister ? {} : u(m), T = {
631
+ }, h = {}, g = (a(i.defaultValues) || a(i.values)) && u(i.defaultValues || i.values) || {}, y = i.shouldUnregister ? {} : u(g), T = {
593
632
  action: !1,
594
633
  mount: !1,
595
634
  watch: !1,
@@ -601,7 +640,7 @@ function Ae(e = {}) {
601
640
  array: /* @__PURE__ */ new Set(),
602
641
  watch: /* @__PURE__ */ new Set(),
603
642
  registerName: /* @__PURE__ */ new Set()
604
- }, D, O = 0, j = {
643
+ }, D, O = 0, k = 0, M = be(i.mode), N = be(i.reValidateMode), F = {
605
644
  isDirty: !1,
606
645
  dirtyFields: !1,
607
646
  validatingFields: !1,
@@ -609,125 +648,137 @@ function Ae(e = {}) {
609
648
  isValidating: !1,
610
649
  isValid: !1,
611
650
  errors: !1
612
- }, N = { ...j }, P = { ...N }, F = {
613
- array: te(),
614
- state: te()
615
- }, I = i.criteriaMode === b.all, ee = (e) => (t) => {
651
+ }, I = { ...F }, L = { ...I }, R = {
652
+ array: re(),
653
+ state: re()
654
+ }, ee = i.criteriaMode === f.all, ce = (e) => (t) => {
616
655
  clearTimeout(O), O = setTimeout(e, t);
617
656
  }, B = async (e) => {
618
- if (!T.keepIsValid && !i.disabled && (N.isValid || P.isValid || e)) {
657
+ if (!T.keepIsValid && !i.disabled && (I.isValid || L.isValid || e)) {
619
658
  let e;
620
- i.resolver ? (e = R((await q()).errors), V()) : e = await J({
621
- fields: d,
659
+ i.resolver ? (e = z((await K()).errors), V()) : e = await X({
660
+ fields: h,
622
661
  onlyCheckValid: !0,
623
- eventType: y.VALID
624
- }), e !== c.isValid && F.state.next({ isValid: e });
662
+ eventType: d.VALID
663
+ }), e !== c.isValid && R.state.next({ isValid: e });
625
664
  }
626
665
  }, V = (e, t) => {
627
- !i.disabled && (N.isValidating || N.validatingFields || P.isValidating || P.validatingFields) && ((e || Array.from(E.mount)).forEach((e) => {
628
- e && (t ? v(c.validatingFields, e, t) : H(c.validatingFields, e));
629
- }), F.state.next({
666
+ !i.disabled && (I.isValidating || I.validatingFields || L.isValidating || L.validatingFields) && ((e || Array.from(E.mount)).forEach((e) => {
667
+ e && (t ? w(c.validatingFields, e, t) : H(c.validatingFields, e));
668
+ }), R.state.next({
630
669
  validatingFields: c.validatingFields,
631
- isValidating: !R(c.validatingFields)
670
+ isValidating: !z(c.validatingFields)
632
671
  }));
633
- }, se = () => {
634
- c.dirtyFields = G(m, w);
635
- }, ce = (e, t = [], n, r, a = !0, o = !0) => {
672
+ }, de = () => {
673
+ c.dirtyFields = G(g, y);
674
+ }, fe = (e, t = [], n, r, a = !0, o = !0) => {
636
675
  if (r && n && !i.disabled) {
637
- if (T.action = !0, o && Array.isArray(h(d, e))) {
638
- let t = n(h(d, e), r.argA, r.argB);
639
- a && v(d, e, t);
676
+ if (T.action = !0, o && Array.isArray(x(h, e))) {
677
+ let t = n(x(h, e), r.argA, r.argB);
678
+ a && w(h, e, t);
640
679
  }
641
- if (o && Array.isArray(h(c.errors, e))) {
642
- let t = n(h(c.errors, e), r.argA, r.argB);
643
- a && v(c.errors, e, t), Te(c.errors, e);
680
+ if (o && Array.isArray(x(c.errors, e))) {
681
+ let t = n(x(c.errors, e), r.argA, r.argB);
682
+ a && w(c.errors, e, t), ke(c.errors, e);
644
683
  }
645
- if ((N.touchedFields || P.touchedFields) && o && Array.isArray(h(c.touchedFields, e))) {
646
- let t = n(h(c.touchedFields, e), r.argA, r.argB);
647
- a && v(c.touchedFields, e, t);
684
+ if ((I.touchedFields || L.touchedFields) && o && Array.isArray(x(c.touchedFields, e))) {
685
+ let t = n(x(c.touchedFields, e), r.argA, r.argB);
686
+ a && w(c.touchedFields, e, t);
648
687
  }
649
- (N.dirtyFields || P.dirtyFields) && se(), F.state.next({
688
+ (I.dirtyFields || L.dirtyFields) && de(), R.state.next({
650
689
  name: e,
651
- isDirty: Z(e, t),
690
+ isDirty: Q(e, t),
652
691
  dirtyFields: c.dirtyFields,
653
692
  errors: c.errors,
654
693
  isValid: c.isValid
655
694
  });
656
- } else v(w, e, t);
657
- }, le = (e, t) => {
658
- v(c.errors, e, t), F.state.next({ errors: c.errors });
659
- }, U = (e) => {
660
- c.errors = e, F.state.next({
695
+ } else w(y, e, t);
696
+ }, U = (e, t) => {
697
+ w(c.errors, e, t), c.errors = { ...c.errors }, R.state.next({ errors: c.errors });
698
+ }, W = (e) => {
699
+ c.errors = e, R.state.next({
661
700
  errors: c.errors,
662
701
  isValid: !1
663
702
  });
664
- }, W = (e, t, n, r) => {
665
- let i = h(d, e);
666
- if (i) {
667
- let a = f(h(w, e)), o = h(w, e, f(n) ? h(m, e) : n);
668
- f(o) || r && r.defaultChecked || t ? v(w, e, t ? o : me(i._f)) : je(e, o), T.mount && !T.action && (B(), a && c.isDirty && (N.isDirty || P.isDirty) && (Z() || (c.isDirty = !1, F.state.next({ ...c }))));
703
+ }, pe = (e) => {
704
+ let t = _(e) ? [e] : b(e), n = y, i = g;
705
+ for (let e = 0; e < t.length - 1; e++) {
706
+ let a = t[e];
707
+ if (n = r(n) ? n : n[a], i = r(i) ? i : i[a], n === null && i !== null) return !0;
708
+ }
709
+ return !1;
710
+ }, me = (t, n, r, i) => {
711
+ let a = x(h, t);
712
+ if (a) {
713
+ if (pe(t)) return;
714
+ let o = v(x(y, t)), s = x(y, t, v(r) ? x(g, t) : r);
715
+ v(s) || i && i.defaultChecked || n ? w(y, t, n ? s : ve(a._f)) : Le(t, s), T.mount && !T.action && (B(), o && c.isDirty && (I.isDirty || L.isDirty) && (Q() || (c.isDirty = !1, R.state.next({ ...c }))), e.shouldUnregister && o && !v(x(y, t)) && we(t, E) && (T.watch = !0));
669
716
  }
670
- }, K = (e, t, n, r, a) => {
717
+ }, he = (e, t, n, r, a) => {
671
718
  let o = !1, s = !1, l = { name: e };
672
719
  if (!i.disabled) {
673
720
  if (!n || r) {
674
- (N.isDirty || P.isDirty) && (s = c.isDirty, c.isDirty = l.isDirty = Z(), o = s !== l.isDirty);
675
- let n = M(h(m, e), t);
676
- s = !!h(c.dirtyFields, e), n ? H(c.dirtyFields, e) : v(c.dirtyFields, e, !0), l.dirtyFields = c.dirtyFields, o ||= (N.dirtyFields || P.dirtyFields) && s !== !n;
721
+ let n = P(x(g, e), t);
722
+ (I.isDirty || L.isDirty) && (s = c.isDirty, c.isDirty = l.isDirty = !n || Q(), o = s !== l.isDirty), s = !!x(c.dirtyFields, e), n === c.isDirty ? n ? H(c.dirtyFields, e) : w(c.dirtyFields, e, !0) : c.dirtyFields = G(g, y), l.dirtyFields = c.dirtyFields, o ||= (I.dirtyFields || L.dirtyFields) && s !== !n;
677
723
  }
678
724
  if (n) {
679
- let t = h(c.touchedFields, e);
680
- t || (v(c.touchedFields, e, n), l.touchedFields = c.touchedFields, o ||= (N.touchedFields || P.touchedFields) && t !== n);
725
+ let t = x(c.touchedFields, e);
726
+ t || (w(c.touchedFields, e, n), l.touchedFields = c.touchedFields, o ||= (I.touchedFields || L.touchedFields) && t !== n);
681
727
  }
682
- o && a && F.state.next(l);
728
+ o && a && R.state.next(l);
683
729
  }
684
730
  return o ? l : {};
685
- }, ue = (e, t, n, r) => {
686
- let a = h(c.errors, e), o = (N.isValid || P.isValid) && g(t) && c.isValid !== t;
687
- if (i.delayError && n ? (D = ee(() => le(e, n)), D(i.delayError)) : (clearTimeout(O), D = null, n ? v(c.errors, e, n) : H(c.errors, e)), (n ? !M(a, n) : a) || !R(r) || o) {
731
+ }, _e = (e, t, n, r) => {
732
+ let a = x(c.errors, e), o = (I.isValid || L.isValid) && S(t) && c.isValid !== t;
733
+ if (i.delayError && n ? (D = ce(() => U(e, n)), D(i.delayError)) : (clearTimeout(O), D = null, n ? w(c.errors, e, n) : H(c.errors, e), c.errors = { ...c.errors }), (n ? !P(a, n) : a) || !z(r) || o) {
688
734
  let n = {
689
735
  ...r,
690
- ...o && g(t) ? { isValid: t } : {},
736
+ ...o && S(t) ? { isValid: t } : {},
691
737
  errors: c.errors,
692
738
  name: e
693
739
  };
694
740
  c = {
695
741
  ...c,
696
742
  ...n
697
- }, F.state.next(n);
698
- }
699
- }, q = async (e) => (V(e, !0), await i.resolver(w, i.context, he(e || E.mount, d, i.criteriaMode, i.shouldUseNativeValidation))), fe = async (e) => {
700
- let { errors: t } = await q(e);
701
- if (V(e), e) for (let n of e) {
702
- let e = h(t, n);
703
- e ? v(c.errors, n, e) : H(c.errors, n);
743
+ }, R.state.next(n);
704
744
  }
705
- else c.errors = t;
745
+ }, K = async (e) => (V(e, !0), await i.resolver(y, i.context, ye(e || E.mount, h, i.criteriaMode, i.shouldUseNativeValidation))), q = async (e) => {
746
+ let { errors: t } = await K(e);
747
+ if (V(e), e) {
748
+ for (let n of e) {
749
+ let e = x(t, n);
750
+ e ? E.array.has(n) && a(e) && !Object.keys(e).some((e) => !Number.isNaN(Number(e))) ? Ae(c.errors, { [n]: e }, n) : w(c.errors, n, e) : H(c.errors, n);
751
+ }
752
+ c.errors = { ...c.errors };
753
+ } else c.errors = t;
706
754
  return t;
707
- }, pe = async ({ name: t, eventType: n }) => {
755
+ }, xe = async ({ name: t, eventType: n }) => {
708
756
  if (e.validate) {
709
757
  let r = await e.validate({
710
- formValues: w,
758
+ formValues: y,
711
759
  formState: c,
712
760
  name: t,
713
761
  eventType: n
714
762
  });
715
- if (a(r)) for (let e in r) r[e] && Be(`${S}.${e}`, {
716
- message: k(r.message) ? r.message : "",
717
- type: x.validate
718
- });
719
- else k(r) || !r ? Be(S, {
763
+ if (a(r)) for (let e in r) {
764
+ let t = r[e];
765
+ t && qe(`${Ne}.${e}`, {
766
+ message: A(t.message) ? t.message : "",
767
+ type: t.type || p.validate
768
+ });
769
+ }
770
+ else A(r) || !r ? qe(Ne, {
720
771
  message: r || "",
721
- type: x.validate
722
- }) : ze(S);
772
+ type: p.validate
773
+ }) : Ke(Ne);
723
774
  return r;
724
775
  }
725
776
  return !0;
726
- }, J = async ({ fields: t, onlyCheckValid: n, name: r, eventType: a, context: o = {
777
+ }, X = async ({ fields: t, onlyCheckValid: n, name: r, eventType: a, context: o = {
727
778
  valid: !0,
728
779
  runRootValidation: !1
729
780
  } }) => {
730
- if (e.validate && (o.runRootValidation = !0, !await pe({
781
+ if (e.validate && (o.runRootValidation = !0, !await xe({
731
782
  name: r,
732
783
  eventType: a
733
784
  }) && (o.valid = !1, n))) return o.valid;
@@ -736,12 +787,12 @@ function Ae(e = {}) {
736
787
  if (s) {
737
788
  let { _f: t, ...l } = s;
738
789
  if (t) {
739
- let r = E.array.has(t.name), a = s._f && ve(s._f);
740
- a && N.validatingFields && V([t.name], !0);
741
- let l = await De(s, E.disabled, w, I, i.shouldUseNativeValidation && !n, r);
742
- if (a && N.validatingFields && V([t.name]), l[t.name] && (o.valid = !1, n) || (!n && (h(l, t.name) ? r ? Ee(c.errors, l, t.name) : v(c.errors, t.name, l[t.name]) : H(c.errors, t.name)), e.shouldUseNativeValidation && l[t.name])) break;
790
+ let r = E.array.has(t.name), a = s._f && Se(s._f), l = I.validatingFields || I.isValidating || L.validatingFields || L.isValidating;
791
+ a && l && V([t.name], !0);
792
+ let u = await je(s, E.disabled, y, ee, i.shouldUseNativeValidation && !n, r);
793
+ if (a && l && V([t.name]), u[t.name] && (o.valid = !1, n) || (!n && (x(u, t.name) ? r ? Ae(c.errors, u, t.name) : w(c.errors, t.name, u[t.name]) : H(c.errors, t.name)), e.shouldUseNativeValidation && u[t.name])) break;
743
794
  }
744
- !R(l) && await J({
795
+ !z(l) && await X({
745
796
  context: o,
746
797
  onlyCheckValid: n,
747
798
  fields: l,
@@ -751,179 +802,205 @@ function Ae(e = {}) {
751
802
  }
752
803
  }
753
804
  return o.valid;
754
- }, _e = () => {
805
+ }, Z = () => {
755
806
  for (let e of E.unMount) {
756
- let t = h(d, e);
757
- t && (t._f.refs ? t._f.refs.every((e) => !oe(e)) : !oe(t._f.ref)) && We(e);
807
+ let t = x(h, e);
808
+ t && (t._f.refs ? t._f.refs.every((e) => !ue(e)) : !ue(t._f.ref)) && Ze(e);
758
809
  }
759
810
  E.unMount = /* @__PURE__ */ new Set();
760
- }, Z = (e, t) => !i.disabled && (e && t && v(w, e, t), !M(Le(), m)), Q = (e, t, n) => A(e, E, { ...T.mount ? w : f(t) ? m : k(e) ? { [e]: t } : t }, n, t), Ae = (e) => p(h(T.mount ? w : m, e, i.shouldUnregister ? h(m, e, []) : [])), je = (e, n, i = {}) => {
761
- let a = h(d, e), o = n;
762
- if (a) {
763
- let i = a._f;
764
- i && (!i.disabled && v(w, e, de(n, i)), o = z(i.ref) && r(n) ? "" : n, ie(i.ref) ? [...i.ref.options].forEach((e) => e.selected = o.includes(e.value)) : i.refs ? t(i.ref) ? i.refs.forEach((e) => {
765
- (!e.defaultChecked || !e.disabled) && (Array.isArray(o) ? e.checked = !!o.find((t) => t === e.value) : e.checked = o === e.value || !!o);
766
- }) : i.refs.forEach((e) => e.checked = e.value === o) : re(i.ref) ? i.ref.value = "" : (i.ref.value = o, i.ref.type || F.state.next({
811
+ }, Q = (e, t) => !i.disabled && (e && t && w(y, e, t), !P(T.mount ? y : g, g)), Fe = (e, t, n) => j(e, E, { ...T.mount ? y : v(t) ? g : A(e) ? { [e]: t } : t }, n, t), Ie = (e) => te(x(T.mount ? y : g, e, i.shouldUnregister ? x(g, e, []) : [])), Le = (e, n, i = {}, a = !1, o = !1) => {
812
+ let s = x(h, e), c = n;
813
+ if (s) {
814
+ let i = s._f;
815
+ i && (!i.disabled && w(y, e, ge(n, i)), c = oe(i.ref) && r(n) ? "" : n, se(i.ref) ? [...i.ref.options].forEach((e) => e.selected = c.includes(e.value)) : i.refs ? t(i.ref) ? i.refs.forEach((e) => {
816
+ (!e.defaultChecked || !e.disabled) && (Array.isArray(c) ? e.checked = !!c.find((t) => t === e.value) : e.checked = c === e.value || !!c);
817
+ }) : i.refs.forEach((e) => e.checked = e.value === c) : ae(i.ref) ? i.ref.value = "" : (i.ref.value = c, !i.ref.type && !o && R.state.next({
767
818
  name: e,
768
- values: u(w)
819
+ values: a ? y : u(y)
769
820
  })));
770
821
  }
771
- (i.shouldDirty || i.shouldTouch) && K(e, o, i.shouldTouch, i.shouldDirty, !0), i.shouldValidate && Ie(e);
772
- }, Me = (e, t, r) => {
773
- for (let i in t) {
774
- if (!t.hasOwnProperty(i)) return;
775
- let o = t[i], s = e + "." + i, c = h(d, s);
776
- (E.array.has(e) || a(o) || c && !c._f) && !n(o) ? Me(s, o, r) : je(s, o, r);
822
+ (i.shouldDirty || i.shouldTouch) && he(e, c, i.shouldTouch, i.shouldDirty, !o), i.shouldValidate && Ue(e);
823
+ }, Re = (e, t, r, i = !1, o = !1) => {
824
+ for (let s in t) {
825
+ if (!t.hasOwnProperty(s)) return;
826
+ let c = t[s], l = e + "." + s, u = x(h, l);
827
+ (E.array.has(e) || a(c) || u && !u._f) && !n(c) ? Re(l, c, r, i, o) : Le(l, c, r, i, o);
777
828
  }
778
- }, $ = (e, t, n = {}) => {
779
- let i = h(d, e), a = E.array.has(e), o = u(t), s = M(h(w, e), o);
780
- if (v(w, e, o), a) F.array.next({
829
+ }, ze = (e, t, n, i, a = !1) => {
830
+ let o = x(h, e), s = E.array.has(e), l = i ? t : u(t), d = P(x(y, e), l);
831
+ if (d || w(y, e, l), s) R.array.next({
781
832
  name: e,
782
- values: u(w)
783
- }), (N.isDirty || N.dirtyFields || P.isDirty || P.dirtyFields) && n.shouldDirty && (se(), F.state.next({
833
+ values: i ? y : u(y)
834
+ }), (I.isDirty || I.dirtyFields || L.isDirty || L.dirtyFields) && n.shouldDirty && (de(), a || R.state.next({
784
835
  name: e,
785
836
  dirtyFields: c.dirtyFields,
786
- isDirty: Z(e, o)
837
+ isDirty: Q(e, l)
787
838
  }));
788
839
  else {
789
- let t = Array.isArray(o) && !o.length || R(o);
790
- !i || i._f || r(o) || t ? je(e, o, n) : Me(e, o, n);
840
+ let t = Array.isArray(l) && !l.length || z(l);
841
+ !o || o._f || r(l) || t ? Le(e, l, n, i, a) : Re(e, l, n, i, a);
791
842
  }
792
- if (!s) {
793
- let t = be(e, E);
794
- F.state.next({
843
+ if (!d && !a) {
844
+ let t = we(e, E), n = i ? y : u(y);
845
+ R.state.next({
795
846
  ...t && c,
796
847
  name: T.mount || t ? e : void 0,
797
- values: u(w)
848
+ values: n
798
849
  });
799
850
  }
800
- }, Ne = (e) => {
801
- let t = _(e) ? e(w) : e;
802
- M(w, t) || (w = {
803
- ...w,
804
- ...t
805
- }, F.state.next({
806
- ...c,
807
- values: w
808
- }));
809
- }, Pe = async (t) => {
851
+ }, $ = (e, t, n = {}) => ze(e, t, n, !1), Be = (e, t = {}) => {
852
+ let n = C(e) ? e(y) : e;
853
+ if (!P(y, n)) {
854
+ y = {
855
+ ...y,
856
+ ...n
857
+ };
858
+ for (let e of E.mount) ze(e, x(n, e), t, !0, !0);
859
+ R.state.next({
860
+ ...c,
861
+ name: void 0,
862
+ type: void 0,
863
+ ...k ? { values: y } : {}
864
+ }), t.shouldValidate && B();
865
+ }
866
+ }, Ve = async (t) => {
810
867
  T.mount = !0;
811
- let r = t.target, a = r.name, s = !0, l = h(d, a), f = (e) => {
812
- s = Number.isNaN(e) || n(e) && isNaN(e.getTime()) || M(e, h(w, a, e));
813
- }, p = ge(i.mode), m = ge(i.reValidateMode);
868
+ let r = t.target, a = r.name, s = !0, l = x(h, a), f = (e) => {
869
+ s = Number.isNaN(e) || n(e) && isNaN(e.getTime()) || P(e, x(y, a, e));
870
+ };
814
871
  if (l) {
815
- let n, g, _ = r.type ? me(l._f) : o(t), b = t.type === y.BLUR || t.type === y.FOCUS_OUT, x = !ye(l._f) && !e.validate && !i.resolver && !h(c.errors, a) && !l._f.deps || we(b, h(c.touchedFields, a), c.isSubmitted, m, p), S = be(a, E, b);
816
- v(w, a, _), b ? (!r || !r.readOnly) && (l._f.onBlur && l._f.onBlur(t), D && D(0)) : l._f.onChange && l._f.onChange(t);
817
- let C = K(a, _, b), T = !R(C) || S;
818
- if (!b && F.state.next({
872
+ let n, p, m = r.type ? ve(l._f) : o(t), g = t.type === d.BLUR || t.type === d.FOCUS_OUT, _ = !Ce(l._f) && !e.validate && !i.resolver && !x(c.errors, a) && !l._f.deps, v = _ || Oe(g, x(c.touchedFields, a), c.isSubmitted, N, M), b = we(a, E, g);
873
+ w(y, a, m), g ? (!r || !r.readOnly) && (l._f.onBlur && l._f.onBlur(t), D && D(0)) : l._f.onChange && l._f.onChange(t);
874
+ let S = he(a, m, g), C = !z(S) || b;
875
+ if (!g && R.state.next({
819
876
  name: a,
820
877
  type: t.type,
821
- values: u(w)
822
- }), x) return (N.isValid || P.isValid) && (i.mode === "onBlur" ? b && B() : b || B()), T && F.state.next({
878
+ ...k ? { values: u(y) } : {}
879
+ }), v) return (!_ || !c.isValid) && (I.isValid || L.isValid) && (i.mode === "onBlur" ? g && B() : g || B()), C && R.state.next({
823
880
  name: a,
824
- ...S ? {} : C
881
+ ...b ? {} : S
825
882
  });
826
- if (!i.resolver && e.validate && await pe({
883
+ if (!i.resolver && e.validate && await xe({
827
884
  name: a,
828
885
  eventType: t.type
829
- }), !b && S && F.state.next({ ...c }), i.resolver) {
830
- let { errors: e } = await q([a]);
831
- if (V([a]), f(_), s) {
832
- let t = xe(c.errors, d, a), r = xe(e, d, t.name || a);
833
- n = r.error, a = r.name, g = R(e);
886
+ }), !g && b && R.state.next({ ...c }), i.resolver) {
887
+ let { errors: e } = await K([a]);
888
+ if (V([a]), f(m), !s) {
889
+ !z(S) && R.state.next(S);
890
+ return;
834
891
  }
835
- } else V([a], !0), n = (await De(l, E.disabled, w, I, i.shouldUseNativeValidation))[a], V([a]), f(_), s && (n ? g = !1 : (N.isValid || P.isValid) && (g = await J({
836
- fields: d,
892
+ let t = Te(c.errors, h, a), r = Te(e, h, t.name || a);
893
+ n = r.error, a = r.name, p = z(e);
894
+ } else V([a], !0), n = (await je(l, E.disabled, y, ee, i.shouldUseNativeValidation))[a], V([a]), f(m), s && (n ? p = !1 : (I.isValid || L.isValid) && (p = await X({
895
+ fields: h,
837
896
  onlyCheckValid: !0,
838
897
  name: a,
839
898
  eventType: t.type
840
899
  })));
841
- s && (l._f.deps && (!Array.isArray(l._f.deps) || l._f.deps.length > 0) && Ie(l._f.deps), ue(a, g, n, C));
900
+ s && (l._f.deps && (!Array.isArray(l._f.deps) || l._f.deps.length > 0) && Ue(l._f.deps), _e(a, p, n, S));
842
901
  }
843
- }, Fe = (e, t) => {
844
- if (h(c.errors, t) && e.focus) return e.focus(), 1;
845
- }, Ie = async (e, t = {}) => {
846
- let n, r, a = L(e);
902
+ }, He = (e, t) => {
903
+ if (x(c.errors, t) && e.focus) return e.focus(), 1;
904
+ }, Ue = async (e, t = {}) => {
905
+ let n, r, a = ne(e);
847
906
  if (i.resolver) {
848
- let t = await fe(f(e) ? e : a);
849
- n = R(t), r = e ? !a.some((e) => h(t, e)) : n;
907
+ let t = await q(v(e) ? e : a);
908
+ n = z(t), r = e ? !a.some((e) => x(t, e)) : n;
850
909
  } else e ? (r = (await Promise.all(a.map(async (e) => {
851
- let t = h(d, e);
852
- return await J({
910
+ let t = x(h, e);
911
+ return await X({
853
912
  fields: t && t._f ? { [e]: t } : t,
854
- eventType: y.TRIGGER
913
+ eventType: d.TRIGGER
855
914
  });
856
- }))).every(Boolean), !(!r && !c.isValid) && B()) : r = n = await J({
857
- fields: d,
915
+ }))).every(Boolean), !(!r && !c.isValid) && B()) : r = n = await X({
916
+ fields: h,
858
917
  name: e,
859
- eventType: y.TRIGGER
918
+ eventType: d.TRIGGER
860
919
  });
861
- return F.state.next({
862
- ...!k(e) || (N.isValid || P.isValid) && n !== c.isValid ? {} : { name: e },
920
+ return R.state.next({
921
+ ...!A(e) || (I.isValid || L.isValid) && n !== c.isValid ? {} : { name: e },
863
922
  ...i.resolver || !e ? { isValid: n } : {},
864
923
  errors: c.errors
865
- }), t.shouldFocus && !r && X(d, Fe, e ? a : E.mount), r;
866
- }, Le = (e, t) => {
867
- let n = { ...T.mount ? w : m };
868
- return t && (n = ne(t.dirtyFields ? c.dirtyFields : c.touchedFields, n)), f(e) ? n : k(e) ? h(n, e) : e.map((e) => h(n, e));
869
- }, Re = (e, t) => ({
870
- invalid: !!h((t || c).errors, e),
871
- isDirty: !!h((t || c).dirtyFields, e),
872
- error: h((t || c).errors, e),
873
- isValidating: !!h(c.validatingFields, e),
874
- isTouched: !!h((t || c).touchedFields, e)
875
- }), ze = (e) => {
876
- let t = e ? L(e) : void 0;
924
+ }), t.shouldFocus && !r && Y(h, He, e ? a : E.mount), r;
925
+ }, We = (e, t) => {
926
+ let n = { ...T.mount ? y : g };
927
+ return t && (n = ie(t.dirtyFields ? c.dirtyFields : c.touchedFields, n)), v(e) ? n : A(e) ? x(n, e) : e.map((e) => x(n, e));
928
+ }, Ge = (e, t) => ({
929
+ invalid: !!x((t || c).errors, e),
930
+ isDirty: !!x((t || c).dirtyFields, e),
931
+ error: x((t || c).errors, e),
932
+ isValidating: !!x(c.validatingFields, e),
933
+ isTouched: !!x((t || c).touchedFields, e)
934
+ }), Ke = (e) => {
935
+ let t = e ? ne(e) : void 0;
877
936
  t?.forEach((e) => H(c.errors, e)), t ? t.forEach((e) => {
878
- F.state.next({
937
+ R.state.next({
879
938
  name: e,
880
939
  errors: c.errors
881
940
  });
882
- }) : F.state.next({ errors: {} });
883
- }, Be = (e, t, n) => {
884
- let r = (h(d, e, { _f: {} })._f || {}).ref, { ref: i, message: a, type: o, ...s } = h(c.errors, e) || {};
885
- v(c.errors, e, {
941
+ }) : R.state.next({ errors: {} });
942
+ }, qe = (e, t, n) => {
943
+ let r = (x(h, e, { _f: {} })._f || {}).ref, { ref: i, message: a, type: o, ...s } = x(c.errors, e) || {};
944
+ w(c.errors, e, {
886
945
  ...s,
887
946
  ...t,
888
947
  ref: r
889
- }), F.state.next({
948
+ }), R.state.next({
890
949
  name: e,
891
950
  errors: c.errors,
892
951
  isValid: !1
893
952
  }), n && n.shouldFocus && r && r.focus && r.focus();
894
- }, Ve = (e, t) => _(e) ? F.state.subscribe({ next: (n) => "values" in n && e(n.values || Q(void 0, t), n) }) : Q(e, t, !0), He = (e) => F.state.subscribe({ next: (t) => {
895
- if (Ce(e.name, t.name, e.exact) && Se(t, e.formState || N, et, e.reRenderRoot)) {
896
- let n = { ...w };
897
- e.callback({
898
- values: n,
899
- ...c,
900
- ...t,
901
- defaultValues: m
902
- });
953
+ }, Je = (e, t) => {
954
+ if (C(e)) {
955
+ k++;
956
+ let { unsubscribe: n } = R.state.subscribe({ next: (n) => "values" in n && e(n.values || Fe(void 0, t), n) }), r = !1;
957
+ return { unsubscribe: () => {
958
+ r || (r = !0, k--, n());
959
+ } };
903
960
  }
904
- } }).unsubscribe, Ue = (e) => (T.mount = !0, P = {
905
- ...P,
961
+ return Fe(e, t, !0);
962
+ }, Ye = (e) => {
963
+ let t = !!e.formState?.values;
964
+ t && k++;
965
+ let { unsubscribe: n } = R.state.subscribe({ next: (t) => {
966
+ if (De(e.name, t.name, e.exact) && Ee(t, e.formState || I, st, e.reRenderRoot)) {
967
+ let n = { ...y };
968
+ e.callback({
969
+ values: n,
970
+ ...c,
971
+ ...t,
972
+ defaultValues: g
973
+ });
974
+ }
975
+ } });
976
+ if (!t) return n;
977
+ let r = !1;
978
+ return () => {
979
+ r || (r = !0, k--, n());
980
+ };
981
+ }, Xe = (e) => (T.mount = !0, L = {
982
+ ...L,
906
983
  ...e.formState
907
- }, He({
984
+ }, Ye({
908
985
  ...e,
909
986
  formState: {
910
- ...j,
987
+ ...F,
911
988
  ...e.formState
912
989
  }
913
- })), We = (e, t = {}) => {
914
- for (let n of e ? L(e) : E.mount) E.mount.delete(n), E.array.delete(n), t.keepValue || (H(d, n), H(w, n)), !t.keepError && H(c.errors, n), !t.keepDirty && H(c.dirtyFields, n), !t.keepTouched && H(c.touchedFields, n), !t.keepIsValidating && H(c.validatingFields, n), !i.shouldUnregister && !t.keepDefaultValue && H(m, n);
915
- F.state.next({ values: u(w) }), F.state.next({
990
+ })), Ze = (e, t = {}) => {
991
+ for (let n of e ? ne(e) : E.mount) E.mount.delete(n), E.array.delete(n), t.keepValue || (H(h, n), H(y, n)), !t.keepError && H(c.errors, n), !t.keepDirty && H(c.dirtyFields, n), !t.keepTouched && H(c.touchedFields, n), !t.keepIsValidating && H(c.validatingFields, n), !i.shouldUnregister && !t.keepDefaultValue && H(g, n);
992
+ R.state.next({ values: u(y) }), R.state.next({
916
993
  ...c,
917
- ...t.keepDirty ? { isDirty: Z() } : {}
994
+ ...t.keepDirty ? { isDirty: Q() } : {}
918
995
  }), !t.keepIsValid && B();
919
- }, Ge = ({ disabled: e, name: t }) => {
920
- if (g(e) && T.mount || e || E.disabled.has(t)) {
996
+ }, Qe = ({ disabled: e, name: t }) => {
997
+ if (S(e) && T.mount || e || E.disabled.has(t)) {
921
998
  let n = E.disabled.has(t) !== !!e;
922
999
  e ? E.disabled.add(t) : E.disabled.delete(t), n && T.mount && !T.action && B();
923
1000
  }
924
- }, Ke = (e, t = {}) => {
925
- let n = h(d, e), r = g(t.disabled) || g(i.disabled), a = !E.registerName.has(e) && n && n._f && !n._f.mount;
926
- return v(d, e, {
1001
+ }, $e = (e, t = {}) => {
1002
+ let n = x(h, e), r = S(t.disabled) || S(i.disabled), a = !E.registerName.has(e) && n && n._f && !n._f.mount;
1003
+ return w(h, e, {
927
1004
  ...n || {},
928
1005
  _f: {
929
1006
  ...n && n._f ? n._f : { ref: { name: e } },
@@ -931,95 +1008,95 @@ function Ae(e = {}) {
931
1008
  mount: !0,
932
1009
  ...t
933
1010
  }
934
- }), E.mount.add(e), n && !a ? Ge({
935
- disabled: g(t.disabled) ? t.disabled : i.disabled,
1011
+ }), E.mount.add(e), n && !a ? Qe({
1012
+ disabled: S(t.disabled) ? t.disabled : i.disabled,
936
1013
  name: e
937
- }) : W(e, !0, t.value), {
1014
+ }) : me(e, !0, t.value), {
938
1015
  ...r ? { disabled: t.disabled || i.disabled } : {},
939
1016
  ...i.progressive ? {
940
1017
  required: !!t.required,
941
- min: Y(t.min),
942
- max: Y(t.max),
943
- minLength: Y(t.minLength),
944
- maxLength: Y(t.maxLength),
945
- pattern: Y(t.pattern)
1018
+ min: J(t.min),
1019
+ max: J(t.max),
1020
+ minLength: J(t.minLength),
1021
+ maxLength: J(t.maxLength),
1022
+ pattern: J(t.pattern)
946
1023
  } : {},
947
1024
  name: e,
948
- onChange: Pe,
949
- onBlur: Pe,
1025
+ onChange: Ve,
1026
+ onBlur: Ve,
950
1027
  ref: (r) => {
951
1028
  if (r) {
952
- E.registerName.add(e), Ke(e, t), E.registerName.delete(e), n = h(d, e);
953
- let i = f(r.value) && r.querySelectorAll && r.querySelectorAll("input,select,textarea")[0] || r, a = ae(i), o = n._f.refs || [];
1029
+ E.registerName.add(e), $e(e, t), E.registerName.delete(e), n = x(h, e);
1030
+ let i = v(r.value) && r.querySelectorAll && r.querySelectorAll("input,select,textarea")[0] || r, a = le(i), o = n._f.refs || [];
954
1031
  if (a ? o.find((e) => e === i) : i === n._f.ref) return;
955
- v(d, e, { _f: {
1032
+ w(h, e, { _f: {
956
1033
  ...n._f,
957
1034
  ...a ? {
958
1035
  refs: [
959
- ...o.filter(oe),
1036
+ ...o.filter(ue),
960
1037
  i,
961
- ...Array.isArray(h(m, e)) ? [{}] : []
1038
+ ...Array.isArray(x(g, e)) ? [{}] : []
962
1039
  ],
963
1040
  ref: {
964
1041
  type: i.type,
965
1042
  name: e
966
1043
  }
967
1044
  } : { ref: i }
968
- } }), W(e, !1, void 0, i);
969
- } else n = h(d, e, {}), n._f && (n._f.mount = !1), (i.shouldUnregister || t.shouldUnregister) && !(s(E.array, e) && T.action) && E.unMount.add(e);
1045
+ } }), me(e, !1, void 0, i);
1046
+ } else n = x(h, e, {}), n._f && (n._f.mount = !1), (i.shouldUnregister || t.shouldUnregister) && !(s(E.array, e) && T.action) && E.unMount.add(e);
970
1047
  }
971
1048
  };
972
- }, qe = () => i.shouldFocusError && X(d, Fe, E.mount), Je = (e) => {
973
- g(e) && (F.state.next({ disabled: e }), X(d, (t, n) => {
974
- let r = h(d, n);
1049
+ }, et = () => i.shouldFocusError && !i.shouldUseNativeValidation && Y(h, He, E.mount), tt = (e) => {
1050
+ S(e) && (R.state.next({ disabled: e }), Y(h, (t, n) => {
1051
+ let r = x(h, n);
975
1052
  r && (t.disabled = r._f.disabled || e, Array.isArray(r._f.refs) && r._f.refs.forEach((t) => {
976
1053
  t.disabled = r._f.disabled || e;
977
1054
  }));
978
1055
  }, 0, !1));
979
- }, Ye = (e, t) => async (n) => {
1056
+ }, nt = (e, t) => async (n) => {
980
1057
  let r;
981
1058
  n && (n.preventDefault && n.preventDefault(), n.persist && n.persist());
982
- let a = u(w);
983
- if (F.state.next({ isSubmitting: !0 }), i.resolver) {
984
- let { errors: e, values: t } = await q();
1059
+ let a = u(y);
1060
+ if (R.state.next({ isSubmitting: !0 }), i.resolver) {
1061
+ let { errors: e, values: t } = await K();
985
1062
  V(), c.errors = e, a = u(t);
986
- } else await J({
987
- fields: d,
988
- eventType: y.SUBMIT
1063
+ } else await X({
1064
+ fields: h,
1065
+ eventType: d.SUBMIT
989
1066
  });
990
1067
  if (E.disabled.size) for (let e of E.disabled) H(a, e);
991
- if (H(c.errors, C), R(c.errors)) {
992
- F.state.next({ errors: {} });
1068
+ if (H(c.errors, m), z(c.errors)) {
1069
+ R.state.next({ errors: {} });
993
1070
  try {
994
1071
  await e(a, n);
995
1072
  } catch (e) {
996
1073
  r = e;
997
1074
  }
998
- } else t && await t({ ...c.errors }, n), qe(), setTimeout(qe);
999
- if (F.state.next({
1075
+ } else t && await t({ ...c.errors }, n), et(), setTimeout(et);
1076
+ if (R.state.next({
1000
1077
  isSubmitted: !0,
1001
1078
  isSubmitting: !1,
1002
- isSubmitSuccessful: R(c.errors) && !r,
1079
+ isSubmitSuccessful: z(c.errors) && !r,
1003
1080
  submitCount: c.submitCount + 1,
1004
1081
  errors: c.errors
1005
1082
  }), r) throw r;
1006
- }, Xe = (e, t = {}) => {
1007
- h(d, e) && (f(t.defaultValue) ? $(e, u(h(m, e))) : ($(e, t.defaultValue), v(m, e, u(t.defaultValue))), t.keepTouched || H(c.touchedFields, e), t.keepDirty || (H(c.dirtyFields, e), c.isDirty = t.defaultValue ? Z(e, u(h(m, e))) : Z()), t.keepError || (H(c.errors, e), N.isValid && B()), F.state.next({ ...c }));
1008
- }, Ze = (e, t = {}) => {
1009
- let n = e ? u(e) : m, r = u(n), a = R(e), o = a ? m : r;
1010
- if (t.keepDefaultValues || (m = n), !t.keepValues) {
1083
+ }, rt = (e, t = {}) => {
1084
+ x(h, e) && (v(t.defaultValue) ? $(e, u(x(g, e))) : ($(e, t.defaultValue), w(g, e, u(t.defaultValue))), t.keepTouched || H(c.touchedFields, e), t.keepDirty || (H(c.dirtyFields, e), c.isDirty = t.defaultValue ? Q(e, u(x(g, e))) : Q()), t.keepError || (H(c.errors, e), I.isValid && B()), R.state.next({ ...c }));
1085
+ }, it = (e, t = {}) => {
1086
+ let n = e ? u(e) : g, r = u(n), a = z(e), o = r;
1087
+ if (t.keepDefaultValues || (g = n), !t.keepValues) {
1011
1088
  if (t.keepDirtyValues) {
1012
- let e = new Set([...E.mount, ...Object.keys(G(m, w))]);
1089
+ let e = new Set([...E.mount, ...Object.keys(G(g, y))]);
1013
1090
  for (let t of Array.from(e)) {
1014
- let e = h(c.dirtyFields, t), n = h(w, t), r = h(o, t);
1015
- e && !f(n) ? v(o, t, n) : !e && !f(r) && $(t, r);
1091
+ let e = x(c.dirtyFields, t), n = x(y, t), r = x(o, t);
1092
+ e && !v(n) ? w(o, t, n) : !e && !v(r) && $(t, r);
1016
1093
  }
1017
1094
  } else {
1018
- if (l && f(e)) for (let e of E.mount) {
1019
- let t = h(d, e);
1095
+ if (l && v(e)) for (let e of E.mount) {
1096
+ let t = x(h, e);
1020
1097
  if (t && t._f) {
1021
1098
  let e = Array.isArray(t._f.refs) ? t._f.refs[0] : t._f.ref;
1022
- if (z(e)) {
1099
+ if (oe(e)) {
1023
1100
  let t = e.closest("form");
1024
1101
  if (t) {
1025
1102
  t.reset();
@@ -1028,10 +1105,13 @@ function Ae(e = {}) {
1028
1105
  }
1029
1106
  }
1030
1107
  }
1031
- if (t.keepFieldsRef) for (let e of E.mount) $(e, h(o, e));
1032
- else d = {};
1108
+ if (t.keepFieldsRef) for (let e of E.mount) $(e, x(o, e));
1109
+ else h = {};
1033
1110
  }
1034
- w = i.shouldUnregister ? t.keepDefaultValues ? u(m) : {} : u(o), F.array.next({ values: { ...o } }), F.state.next({ values: { ...o } });
1111
+ if (i.shouldUnregister) {
1112
+ if (y = t.keepDefaultValues ? u(g) : {}, t.keepFieldsRef) for (let e of E.mount) w(y, e, x(o, e));
1113
+ } else y = u(o);
1114
+ R.array.next({ values: { ...o } }), R.state.next({ values: { ...o } });
1035
1115
  }
1036
1116
  E = {
1037
1117
  mount: t.keepDirtyValues ? E.mount : /* @__PURE__ */ new Set(),
@@ -1042,64 +1122,64 @@ function Ae(e = {}) {
1042
1122
  watch: /* @__PURE__ */ new Set(),
1043
1123
  watchAll: !1,
1044
1124
  focus: ""
1045
- }, T.mount = !N.isValid || !!t.keepIsValid || !!t.keepDirtyValues || !i.shouldUnregister && !R(o), T.watch = !!i.shouldUnregister, T.keepIsValid = !!t.keepIsValid, T.action = !1, t.keepErrors || (c.errors = {}), F.state.next({
1125
+ }, T.mount = !I.isValid || !!t.keepIsValid || !!t.keepDirtyValues || !i.shouldUnregister && !z(o), T.watch = !!i.shouldUnregister, T.keepIsValid = !!t.keepIsValid, T.action = !1, t.keepErrors || (c.errors = {}), R.state.next({
1046
1126
  submitCount: t.keepSubmitCount ? c.submitCount : 0,
1047
- isDirty: a ? !1 : t.keepDirty ? c.isDirty : !!(t.keepDefaultValues && !M(e, m)),
1127
+ isDirty: a ? !1 : t.keepDirty ? c.isDirty : t.keepValues ? Q() : !!(t.keepDefaultValues && !P(e, g)),
1048
1128
  isSubmitted: t.keepIsSubmitted ? c.isSubmitted : !1,
1049
- dirtyFields: a ? {} : t.keepDirtyValues ? t.keepDefaultValues && w ? G(m, w) : c.dirtyFields : t.keepDefaultValues && e ? G(m, e) : t.keepDirty ? c.dirtyFields : {},
1129
+ dirtyFields: a ? {} : t.keepDirtyValues ? t.keepDefaultValues && y ? G(g, y) : c.dirtyFields : t.keepDefaultValues && e ? G(g, e) : t.keepDirty ? c.dirtyFields : {},
1050
1130
  touchedFields: t.keepTouched ? c.touchedFields : {},
1051
1131
  errors: t.keepErrors ? c.errors : {},
1052
1132
  isSubmitSuccessful: t.keepIsSubmitSuccessful ? c.isSubmitSuccessful : !1,
1053
1133
  isSubmitting: !1,
1054
- defaultValues: m
1134
+ defaultValues: g
1055
1135
  });
1056
- }, Qe = (e, t) => Ze(_(e) ? e(w) : e, {
1136
+ }, at = (e, t) => it(C(e) ? e(y) : e, {
1057
1137
  ...i.resetOptions,
1058
1138
  ...t
1059
- }), $e = (e, t = {}) => {
1060
- let n = h(d, e), r = n && n._f;
1139
+ }), ot = (e, t = {}) => {
1140
+ let n = x(h, e), r = n && n._f;
1061
1141
  if (r) {
1062
1142
  let e = r.refs ? r.refs[0] : r.ref;
1063
1143
  e.focus && setTimeout(() => {
1064
- e.focus(), t.shouldSelect && _(e.select) && e.select();
1144
+ e.focus(), t.shouldSelect && C(e.select) && e.select();
1065
1145
  });
1066
1146
  }
1067
- }, et = (e) => {
1147
+ }, st = (e) => {
1068
1148
  c = {
1069
1149
  ...c,
1070
1150
  ...e
1071
1151
  };
1072
- }, tt = {
1152
+ }, ct = {
1073
1153
  control: {
1074
- register: Ke,
1075
- unregister: We,
1076
- getFieldState: Re,
1077
- handleSubmit: Ye,
1078
- setError: Be,
1079
- _subscribe: He,
1080
- _runSchema: q,
1154
+ register: $e,
1155
+ unregister: Ze,
1156
+ getFieldState: Ge,
1157
+ handleSubmit: nt,
1158
+ setError: qe,
1159
+ _subscribe: Ye,
1160
+ _runSchema: K,
1081
1161
  _updateIsValidating: V,
1082
- _focusError: qe,
1083
- _getWatch: Q,
1084
- _getDirty: Z,
1162
+ _focusError: et,
1163
+ _getWatch: Fe,
1164
+ _getDirty: Q,
1085
1165
  _setValid: B,
1086
- _setFieldArray: ce,
1087
- _setDisabledField: Ge,
1088
- _setErrors: U,
1089
- _getFieldArray: Ae,
1090
- _reset: Ze,
1091
- _resetDefaultValues: () => _(i.defaultValues) && i.defaultValues().then((e) => {
1092
- Qe(e, i.resetOptions), F.state.next({ isLoading: !1 });
1166
+ _setFieldArray: fe,
1167
+ _setDisabledField: Qe,
1168
+ _setErrors: W,
1169
+ _getFieldArray: Ie,
1170
+ _reset: it,
1171
+ _resetDefaultValues: () => C(i.defaultValues) && i.defaultValues().then((e) => {
1172
+ at(e, i.resetOptions), R.state.next({ isLoading: !1 });
1093
1173
  }),
1094
- _removeUnmounted: _e,
1095
- _disableForm: Je,
1096
- _subjects: F,
1097
- _proxyFormState: N,
1174
+ _removeUnmounted: Z,
1175
+ _disableForm: tt,
1176
+ _subjects: R,
1177
+ _proxyFormState: I,
1098
1178
  get _fields() {
1099
- return d;
1179
+ return h;
1100
1180
  },
1101
1181
  get _formValues() {
1102
- return w;
1182
+ return y;
1103
1183
  },
1104
1184
  get _state() {
1105
1185
  return T;
@@ -1108,7 +1188,7 @@ function Ae(e = {}) {
1108
1188
  T = e;
1109
1189
  },
1110
1190
  get _defaultValues() {
1111
- return m;
1191
+ return g;
1112
1192
  },
1113
1193
  get _names() {
1114
1194
  return E;
@@ -1126,85 +1206,98 @@ function Ae(e = {}) {
1126
1206
  i = {
1127
1207
  ...i,
1128
1208
  ...e
1129
- };
1209
+ }, M = be(i.mode), N = be(i.reValidateMode);
1130
1210
  }
1131
1211
  },
1132
- subscribe: Ue,
1133
- trigger: Ie,
1134
- register: Ke,
1135
- handleSubmit: Ye,
1136
- watch: Ve,
1212
+ subscribe: Xe,
1213
+ trigger: Ue,
1214
+ register: $e,
1215
+ handleSubmit: nt,
1216
+ watch: Je,
1137
1217
  setValue: $,
1138
- setValues: Ne,
1139
- getValues: Le,
1140
- reset: Qe,
1141
- resetField: Xe,
1142
- clearErrors: ze,
1143
- unregister: We,
1144
- setError: Be,
1145
- setFocus: $e,
1146
- getFieldState: Re
1218
+ setValues: Be,
1219
+ getValues: We,
1220
+ reset: at,
1221
+ resetField: rt,
1222
+ resetDefaultValues: (e, t = {}) => {
1223
+ if (g = u(e), !t.keepDirty) {
1224
+ let e = G(g, y);
1225
+ c.dirtyFields = e, c.isDirty = !z(e);
1226
+ }
1227
+ t.keepIsValid || B(), R.state.next({
1228
+ ...c,
1229
+ defaultValues: g
1230
+ });
1231
+ },
1232
+ clearErrors: Ke,
1233
+ unregister: Ze,
1234
+ setError: qe,
1235
+ setFocus: ot,
1236
+ getFieldState: Ge
1147
1237
  };
1148
1238
  return {
1149
- ...tt,
1150
- formControl: tt
1239
+ ...ct,
1240
+ formControl: ct
1151
1241
  };
1152
1242
  }
1153
- function je(t = {}) {
1154
- let n = e.useRef(void 0), r = e.useRef(void 0), [i, a] = e.useState(() => ({
1155
- ...u(ke),
1156
- isLoading: _(t.defaultValues),
1243
+ function Fe(t = {}) {
1244
+ let n = e.useRef(void 0), r = e.useRef(void 0), i = e.useRef(t.formControl), [a, o] = e.useState(() => ({
1245
+ ...u(Pe),
1246
+ isLoading: C(t.defaultValues),
1157
1247
  errors: t.errors || {},
1158
1248
  disabled: t.disabled || !1,
1159
- defaultValues: _(t.defaultValues) ? void 0 : t.defaultValues
1249
+ defaultValues: C(t.defaultValues) ? void 0 : t.defaultValues
1160
1250
  }));
1161
- if (!n.current) if (t.formControl) n.current = {
1251
+ if (!n.current || t.formControl && i.current !== t.formControl) if (i.current = t.formControl, t.formControl) n.current = {
1162
1252
  ...t.formControl,
1163
- formState: i
1164
- }, t.defaultValues && !_(t.defaultValues) && t.formControl.reset(t.defaultValues, t.resetOptions);
1253
+ formState: a
1254
+ }, t.defaultValues && !C(t.defaultValues) && t.formControl.reset(t.defaultValues, t.resetOptions);
1165
1255
  else {
1166
- let { formControl: e, ...r } = Ae(t);
1256
+ let { formControl: e, ...r } = Q(t);
1167
1257
  n.current = {
1168
1258
  ...r,
1169
- formState: i
1259
+ formState: a
1170
1260
  };
1171
1261
  }
1172
- let o = n.current.control;
1173
- return o._options = t, D(() => {
1174
- let e = o._subscribe({
1175
- formState: o._proxyFormState,
1176
- callback: () => a({ ...o._formState }),
1262
+ let s = n.current.control;
1263
+ return s._options = t, O(() => {
1264
+ let e = s._subscribe({
1265
+ formState: s._proxyFormState,
1266
+ callback: () => o({
1267
+ ...s._formState,
1268
+ defaultValues: s._defaultValues
1269
+ }),
1177
1270
  reRenderRoot: !0
1178
1271
  });
1179
- return a((e) => ({
1272
+ return o((e) => ({
1180
1273
  ...e,
1181
1274
  isReady: !0
1182
- })), o._formState.isReady = !0, e;
1183
- }, [o]), e.useEffect(() => o._disableForm(t.disabled), [o, t.disabled]), e.useEffect(() => {
1184
- t.mode && (o._options.mode = t.mode), t.reValidateMode && (o._options.reValidateMode = t.reValidateMode);
1275
+ })), s._formState.isReady = !0, e;
1276
+ }, [s]), e.useEffect(() => s._disableForm(t.disabled), [s, t.disabled]), e.useEffect(() => {
1277
+ t.mode && (s._options.mode = t.mode), t.reValidateMode && (s._options.reValidateMode = t.reValidateMode);
1185
1278
  }, [
1186
- o,
1279
+ s,
1187
1280
  t.mode,
1188
1281
  t.reValidateMode
1189
1282
  ]), e.useEffect(() => {
1190
- t.errors && (o._setErrors(t.errors), o._focusError());
1191
- }, [o, t.errors]), e.useEffect(() => {
1192
- t.shouldUnregister && o._subjects.state.next({ values: o._getWatch() });
1193
- }, [o, t.shouldUnregister]), e.useEffect(() => {
1194
- if (o._proxyFormState.isDirty) {
1195
- let e = o._getDirty();
1196
- e !== i.isDirty && o._subjects.state.next({ isDirty: e });
1283
+ t.errors && (s._setErrors(t.errors), s._focusError());
1284
+ }, [s, t.errors]), e.useEffect(() => {
1285
+ t.shouldUnregister && s._subjects.state.next({ values: s._getWatch() });
1286
+ }, [s, t.shouldUnregister]), e.useEffect(() => {
1287
+ if (s._proxyFormState.isDirty) {
1288
+ let e = s._getDirty();
1289
+ e !== a.isDirty && s._subjects.state.next({ isDirty: e });
1197
1290
  }
1198
- }, [o, i.isDirty]), e.useEffect(() => {
1199
- t.values && !M(t.values, r.current) ? (o._reset(t.values, {
1291
+ }, [s, a.isDirty]), e.useEffect(() => {
1292
+ t.values && !P(t.values, r.current) ? (s._reset(t.values, {
1200
1293
  keepFieldsRef: !0,
1201
- ...o._options.resetOptions
1202
- }), o._options.resetOptions?.keepIsValid || o._setValid(), r.current = t.values, a((e) => ({ ...e }))) : o._resetDefaultValues();
1203
- }, [o, t.values]), e.useEffect(() => {
1204
- o._state.mount || (o._setValid(), o._state.mount = !0), o._state.watch && (o._state.watch = !1, o._subjects.state.next({ ...o._formState })), o._removeUnmounted();
1205
- }), n.current.formState = e.useMemo(() => E(i, o), [o, i]), n.current;
1294
+ ...s._options.resetOptions
1295
+ }), s._options.resetOptions?.keepIsValid || s._setValid(), r.current = t.values, o((e) => ({ ...e }))) : s._resetDefaultValues();
1296
+ }, [s, t.values]), e.useEffect(() => {
1297
+ s._state.mount || (s._setValid(), s._state.mount = !0), s._state.watch && (s._state.watch = !1, s._subjects.state.next({ ...s._formState })), s._removeUnmounted();
1298
+ }), n.current.formState = e.useMemo(() => D(a, s), [s, a]), n.current;
1206
1299
  }
1207
1300
  //#endregion
1208
- export { F as Controller, ee as appendErrors, h as get, v as set, je as useForm };
1301
+ export { L as Controller, ee as appendErrors, x as get, w as set, Fe as useForm };
1209
1302
 
1210
1303
  //# sourceMappingURL=index.esm.js.map