@scbt-ecom/ui 0.74.0 → 0.74.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.
@@ -1,5 +1,5 @@
1
- import * as ie from "react";
2
- import w, { useCallback as $e, useSyncExternalStore as ze } from "react";
1
+ import * as ne from "react";
2
+ import x, { useCallback as $e, useSyncExternalStore as ze } from "react";
3
3
  import { i as Ot } from "./isClient-C9aZtt2Q.js";
4
4
  const Ge = () => !1, or = () => {
5
5
  const e = "(max-width: 1187px)", r = "(min-width: 1188px)", t = $e(
@@ -27,7 +27,7 @@ const Ge = () => !1, or = () => {
27
27
  const t = (i) => {
28
28
  e.current && !e.current.contains(i.target) && r();
29
29
  };
30
- ie.useEffect(() => {
30
+ ne.useEffect(() => {
31
31
  var i;
32
32
  if (Ot)
33
33
  return (i = globalThis == null ? void 0 : globalThis.document) == null || i.addEventListener("mousedown", t), () => {
@@ -35,50 +35,50 @@ const Ge = () => !1, or = () => {
35
35
  };
36
36
  }, [e, r]);
37
37
  };
38
- var ye = (e) => e.type === "checkbox", se = (e) => e instanceof Date, p = (e) => e == null;
38
+ var ye = (e) => e.type === "checkbox", ie = (e) => e instanceof Date, B = (e) => e == null;
39
39
  const lt = (e) => typeof e == "object";
40
- var C = (e) => !p(e) && !Array.isArray(e) && lt(e) && !se(e), ut = (e) => C(e) && e.target ? ye(e.target) ? e.target.checked : e.target.value : e, Rt = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, ct = (e, r) => e.has(Rt(r)), Ut = (e) => {
40
+ var M = (e) => !B(e) && !Array.isArray(e) && lt(e) && !ie(e), ut = (e) => M(e) && e.target ? ye(e.target) ? e.target.checked : e.target.value : e, Rt = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, ct = (e, r) => e.has(Rt(r)), Ut = (e) => {
41
41
  const r = e.constructor && e.constructor.prototype;
42
- return C(r) && r.hasOwnProperty("isPrototypeOf");
43
- }, Ce = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
44
- function R(e) {
42
+ return M(r) && r.hasOwnProperty("isPrototypeOf");
43
+ }, Te = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
44
+ function U(e) {
45
45
  let r;
46
46
  const t = Array.isArray(e), i = typeof FileList < "u" ? e instanceof FileList : !1;
47
47
  if (e instanceof Date)
48
48
  r = new Date(e);
49
49
  else if (e instanceof Set)
50
50
  r = new Set(e);
51
- else if (!(Ce && (e instanceof Blob || i)) && (t || C(e)))
51
+ else if (!(Te && (e instanceof Blob || i)) && (t || M(e)))
52
52
  if (r = t ? [] : {}, !t && !Ut(e))
53
53
  r = e;
54
54
  else
55
55
  for (const a in e)
56
- e.hasOwnProperty(a) && (r[a] = R(e[a]));
56
+ e.hasOwnProperty(a) && (r[a] = U(e[a]));
57
57
  else
58
58
  return e;
59
59
  return r;
60
60
  }
61
- var Ve = (e) => Array.isArray(e) ? e.filter(Boolean) : [], k = (e) => e === void 0, y = (e, r, t) => {
62
- if (!r || !C(e))
61
+ var Ae = (e) => Array.isArray(e) ? e.filter(Boolean) : [], T = (e) => e === void 0, y = (e, r, t) => {
62
+ if (!r || !M(e))
63
63
  return t;
64
- const i = Ve(r.split(/[,[\].]+?/)).reduce((a, o) => p(a) ? a : a[o], e);
65
- return k(i) || i === e ? k(e[r]) ? t : e[r] : i;
66
- }, q = (e) => typeof e == "boolean", Te = (e) => /^\w*$/.test(e), dt = (e) => Ve(e.replace(/["|']|\]/g, "").split(/\.|\[/)), x = (e, r, t) => {
64
+ const i = Ae(r.split(/[,[\].]+?/)).reduce((a, o) => B(a) ? a : a[o], e);
65
+ return T(i) || i === e ? T(e[r]) ? t : e[r] : i;
66
+ }, W = (e) => typeof e == "boolean", Me = (e) => /^\w*$/.test(e), dt = (e) => Ae(e.replace(/["|']|\]/g, "").split(/\.|\[/)), F = (e, r, t) => {
67
67
  let i = -1;
68
- const a = Te(r) ? [r] : dt(r), o = a.length, u = o - 1;
68
+ const a = Me(r) ? [r] : dt(r), o = a.length, u = o - 1;
69
69
  for (; ++i < o; ) {
70
70
  const d = a[i];
71
- let b = t;
71
+ let v = t;
72
72
  if (i !== u) {
73
- const D = e[d];
74
- b = C(D) || Array.isArray(D) ? D : isNaN(+a[i + 1]) ? {} : [];
73
+ const E = e[d];
74
+ v = M(E) || Array.isArray(E) ? E : isNaN(+a[i + 1]) ? {} : [];
75
75
  }
76
76
  if (d === "__proto__" || d === "constructor" || d === "prototype")
77
77
  return;
78
- e[d] = b, e = e[d];
78
+ e[d] = v, e = e[d];
79
79
  }
80
80
  };
81
- const ve = {
81
+ const me = {
82
82
  BLUR: "blur",
83
83
  FOCUS_OUT: "focusout",
84
84
  CHANGE: "change"
@@ -96,9 +96,9 @@ const ve = {
96
96
  pattern: "pattern",
97
97
  required: "required",
98
98
  validate: "validate"
99
- }, ft = w.createContext(null), Me = () => w.useContext(ft), ur = (e) => {
99
+ }, ft = x.createContext(null), Le = () => x.useContext(ft), ur = (e) => {
100
100
  const { children: r, ...t } = e;
101
- return w.createElement(ft.Provider, { value: t }, r);
101
+ return x.createElement(ft.Provider, { value: t }, r);
102
102
  };
103
103
  var yt = (e, r, t, i = !0) => {
104
104
  const a = {
@@ -113,9 +113,9 @@ var yt = (e, r, t, i = !0) => {
113
113
  });
114
114
  return a;
115
115
  };
116
- const Le = typeof window < "u" ? ie.useLayoutEffect : ie.useEffect;
116
+ const Oe = typeof window < "u" ? ne.useLayoutEffect : ne.useEffect;
117
117
  function Nt(e) {
118
- const r = Me(), { control: t = r.control, disabled: i, name: a, exact: o } = e || {}, [u, d] = w.useState(t._formState), b = w.useRef({
118
+ const r = Le(), { control: t = r.control, disabled: i, name: a, exact: o } = e || {}, [u, d] = x.useState(t._formState), v = x.useRef({
119
119
  isDirty: !1,
120
120
  isLoading: !1,
121
121
  dirtyFields: !1,
@@ -125,122 +125,122 @@ function Nt(e) {
125
125
  isValid: !1,
126
126
  errors: !1
127
127
  });
128
- return Le(() => t._subscribe({
128
+ return Oe(() => t._subscribe({
129
129
  name: a,
130
- formState: b.current,
130
+ formState: v.current,
131
131
  exact: o,
132
- callback: (D) => {
132
+ callback: (E) => {
133
133
  !i && d({
134
134
  ...t._formState,
135
- ...D
135
+ ...E
136
136
  });
137
137
  }
138
- }), [a, i, o]), w.useEffect(() => {
139
- b.current.isValid && t._setValid(!0);
140
- }, [t]), w.useMemo(() => yt(u, t, b.current, !1), [u, t]);
138
+ }), [a, i, o]), x.useEffect(() => {
139
+ v.current.isValid && t._setValid(!0);
140
+ }, [t]), x.useMemo(() => yt(u, t, v.current, !1), [u, t]);
141
141
  }
142
142
  var Y = (e) => typeof e == "string", ht = (e, r, t, i, a) => Y(e) ? (i && r.watch.add(e), y(t, e, a)) : Array.isArray(e) ? e.map((o) => (i && r.watch.add(o), y(t, o))) : (i && (r.watchAll = !0), t);
143
143
  function Pt(e) {
144
- const r = Me(), { control: t = r.control, name: i, defaultValue: a, disabled: o, exact: u } = e || {}, d = w.useRef(a), [b, D] = w.useState(t._getWatch(i, d.current));
145
- return Le(() => t._subscribe({
144
+ const r = Le(), { control: t = r.control, name: i, defaultValue: a, disabled: o, exact: u } = e || {}, d = x.useRef(a), [v, E] = x.useState(t._getWatch(i, d.current));
145
+ return Oe(() => t._subscribe({
146
146
  name: i,
147
147
  formState: {
148
148
  values: !0
149
149
  },
150
150
  exact: u,
151
- callback: (F) => !o && D(ht(i, t._names, F.values || t._formValues, !1, d.current))
152
- }), [i, t, o, u]), w.useEffect(() => t._removeUnmounted()), b;
151
+ callback: (V) => !o && E(ht(i, t._names, V.values || t._formValues, !1, d.current))
152
+ }), [i, t, o, u]), x.useEffect(() => t._removeUnmounted()), v;
153
153
  }
154
154
  function cr(e) {
155
- const r = Me(), { name: t, disabled: i, control: a = r.control, shouldUnregister: o } = e, u = ct(a._names.array, t), d = Pt({
155
+ const r = Le(), { name: t, disabled: i, control: a = r.control, shouldUnregister: o } = e, u = ct(a._names.array, t), d = Pt({
156
156
  control: a,
157
157
  name: t,
158
158
  defaultValue: y(a._formValues, t, y(a._defaultValues, t, e.defaultValue)),
159
159
  exact: !0
160
- }), b = Nt({
160
+ }), v = Nt({
161
161
  control: a,
162
162
  name: t,
163
163
  exact: !0
164
- }), D = w.useRef(e), F = w.useRef(a.register(t, {
164
+ }), E = x.useRef(e), V = x.useRef(a.register(t, {
165
165
  ...e.rules,
166
166
  value: d,
167
- ...q(e.disabled) ? { disabled: e.disabled } : {}
168
- })), E = w.useMemo(() => Object.defineProperties({}, {
167
+ ...W(e.disabled) ? { disabled: e.disabled } : {}
168
+ })), S = x.useMemo(() => Object.defineProperties({}, {
169
169
  invalid: {
170
170
  enumerable: !0,
171
- get: () => !!y(b.errors, t)
171
+ get: () => !!y(v.errors, t)
172
172
  },
173
173
  isDirty: {
174
174
  enumerable: !0,
175
- get: () => !!y(b.dirtyFields, t)
175
+ get: () => !!y(v.dirtyFields, t)
176
176
  },
177
177
  isTouched: {
178
178
  enumerable: !0,
179
- get: () => !!y(b.touchedFields, t)
179
+ get: () => !!y(v.touchedFields, t)
180
180
  },
181
181
  isValidating: {
182
182
  enumerable: !0,
183
- get: () => !!y(b.validatingFields, t)
183
+ get: () => !!y(v.validatingFields, t)
184
184
  },
185
185
  error: {
186
186
  enumerable: !0,
187
- get: () => y(b.errors, t)
187
+ get: () => y(v.errors, t)
188
188
  }
189
- }), [b, t]), m = w.useCallback((N) => F.current.onChange({
189
+ }), [v, t]), b = x.useCallback((L) => V.current.onChange({
190
190
  target: {
191
- value: ut(N),
191
+ value: ut(L),
192
192
  name: t
193
193
  },
194
- type: ve.CHANGE
195
- }), [t]), te = w.useCallback(() => F.current.onBlur({
194
+ type: me.CHANGE
195
+ }), [t]), Z = x.useCallback(() => V.current.onBlur({
196
196
  target: {
197
197
  value: y(a._formValues, t),
198
198
  name: t
199
199
  },
200
- type: ve.BLUR
201
- }), [t, a._formValues]), j = w.useCallback((N) => {
202
- const P = y(a._fields, t);
203
- P && N && (P._f.ref = {
204
- focus: () => N.focus(),
205
- select: () => N.select(),
206
- setCustomValidity: (v) => N.setCustomValidity(v),
207
- reportValidity: () => N.reportValidity()
200
+ type: me.BLUR
201
+ }), [t, a._formValues]), H = x.useCallback((L) => {
202
+ const J = y(a._fields, t);
203
+ J && L && (J._f.ref = {
204
+ focus: () => L.focus(),
205
+ select: () => L.select(),
206
+ setCustomValidity: (m) => L.setCustomValidity(m),
207
+ reportValidity: () => L.reportValidity()
208
208
  });
209
- }, [a._fields, t]), O = w.useMemo(() => ({
209
+ }, [a._fields, t]), k = x.useMemo(() => ({
210
210
  name: t,
211
211
  value: d,
212
- ...q(i) || b.disabled ? { disabled: b.disabled || i } : {},
213
- onChange: m,
214
- onBlur: te,
215
- ref: j
216
- }), [t, i, b.disabled, m, te, j, d]);
217
- return w.useEffect(() => {
218
- const N = a._options.shouldUnregister || o;
212
+ ...W(i) || v.disabled ? { disabled: v.disabled || i } : {},
213
+ onChange: b,
214
+ onBlur: Z,
215
+ ref: H
216
+ }), [t, i, v.disabled, b, Z, H, d]);
217
+ return x.useEffect(() => {
218
+ const L = a._options.shouldUnregister || o;
219
219
  a.register(t, {
220
- ...D.current.rules,
221
- ...q(D.current.disabled) ? { disabled: D.current.disabled } : {}
220
+ ...E.current.rules,
221
+ ...W(E.current.disabled) ? { disabled: E.current.disabled } : {}
222
222
  });
223
- const P = (v, K) => {
224
- const W = y(a._fields, v);
225
- W && W._f && (W._f.mount = K);
223
+ const J = (m, j) => {
224
+ const p = y(a._fields, m);
225
+ p && p._f && (p._f.mount = j);
226
226
  };
227
- if (P(t, !0), N) {
228
- const v = R(y(a._options.defaultValues, t));
229
- x(a._defaultValues, t, v), k(y(a._formValues, t)) && x(a._formValues, t, v);
227
+ if (J(t, !0), L) {
228
+ const m = U(y(a._options.defaultValues, t));
229
+ F(a._defaultValues, t, m), T(y(a._formValues, t)) && F(a._formValues, t, m);
230
230
  }
231
231
  return !u && a.register(t), () => {
232
- (u ? N && !a._state.action : N) ? a.unregister(t) : P(t, !1);
232
+ (u ? L && !a._state.action : L) ? a.unregister(t) : J(t, !1);
233
233
  };
234
- }, [t, a, u, o]), w.useEffect(() => {
234
+ }, [t, a, u, o]), x.useEffect(() => {
235
235
  a._setDisabledField({
236
236
  disabled: i,
237
237
  name: t
238
238
  });
239
- }, [i, t, a]), w.useMemo(() => ({
240
- field: O,
241
- formState: b,
242
- fieldState: E
243
- }), [O, b, E]);
239
+ }, [i, t, a]), x.useMemo(() => ({
240
+ field: k,
241
+ formState: v,
242
+ fieldState: S
243
+ }), [k, v, S]);
244
244
  }
245
245
  var gt = (e, r, t, i, a) => r ? {
246
246
  ...t[e],
@@ -267,11 +267,11 @@ var gt = (e, r, t, i, a) => r ? {
267
267
  e = [];
268
268
  }
269
269
  };
270
- }, ke = (e) => p(e) || !lt(e);
271
- function ee(e, r) {
272
- if (ke(e) || ke(r))
270
+ }, Ce = (e) => B(e) || !lt(e);
271
+ function re(e, r) {
272
+ if (Ce(e) || Ce(r))
273
273
  return e === r;
274
- if (se(e) && se(r))
274
+ if (ie(e) && ie(r))
275
275
  return e.getTime() === r.getTime();
276
276
  const t = Object.keys(e), i = Object.keys(r);
277
277
  if (t.length !== i.length)
@@ -282,34 +282,34 @@ function ee(e, r) {
282
282
  return !1;
283
283
  if (a !== "ref") {
284
284
  const u = r[a];
285
- if (se(o) && se(u) || C(o) && C(u) || Array.isArray(o) && Array.isArray(u) ? !ee(o, u) : o !== u)
285
+ if (ie(o) && ie(u) || M(o) && M(u) || Array.isArray(o) && Array.isArray(u) ? !re(o, u) : o !== u)
286
286
  return !1;
287
287
  }
288
288
  }
289
289
  return !0;
290
290
  }
291
- var B = (e) => C(e) && !Object.keys(e).length, Oe = (e) => e.type === "file", $ = (e) => typeof e == "function", be = (e) => {
292
- if (!Ce)
291
+ var P = (e) => M(e) && !Object.keys(e).length, Re = (e) => e.type === "file", $ = (e) => typeof e == "function", _e = (e) => {
292
+ if (!Te)
293
293
  return !1;
294
294
  const r = e ? e.ownerDocument : 0;
295
295
  return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
296
- }, vt = (e) => e.type === "select-multiple", Re = (e) => e.type === "radio", Bt = (e) => Re(e) || ye(e), Se = (e) => be(e) && e.isConnected;
296
+ }, vt = (e) => e.type === "select-multiple", Ue = (e) => e.type === "radio", Bt = (e) => Ue(e) || ye(e), ke = (e) => _e(e) && e.isConnected;
297
297
  function pt(e, r) {
298
298
  const t = r.slice(0, -1).length;
299
299
  let i = 0;
300
300
  for (; i < t; )
301
- e = k(e) ? i++ : e[r[i++]];
301
+ e = T(e) ? i++ : e[r[i++]];
302
302
  return e;
303
303
  }
304
304
  function It(e) {
305
305
  for (const r in e)
306
- if (e.hasOwnProperty(r) && !k(e[r]))
306
+ if (e.hasOwnProperty(r) && !T(e[r]))
307
307
  return !1;
308
308
  return !0;
309
309
  }
310
- function M(e, r) {
311
- const t = Array.isArray(r) ? r : Te(r) ? [r] : dt(r), i = t.length === 1 ? e : pt(e, t), a = t.length - 1, o = t[a];
312
- return i && delete i[o], a !== 0 && (C(i) && B(i) || Array.isArray(i) && It(i)) && M(e, t.slice(0, -1)), e;
310
+ function R(e, r) {
311
+ const t = Array.isArray(r) ? r : Me(r) ? [r] : dt(r), i = t.length === 1 ? e : pt(e, t), a = t.length - 1, o = t[a];
312
+ return i && delete i[o], a !== 0 && (M(i) && P(i) || Array.isArray(i) && It(i)) && R(e, t.slice(0, -1)), e;
313
313
  }
314
314
  var bt = (e) => {
315
315
  for (const r in e)
@@ -317,21 +317,21 @@ var bt = (e) => {
317
317
  return !0;
318
318
  return !1;
319
319
  };
320
- function me(e, r = {}) {
320
+ function Ve(e, r = {}) {
321
321
  const t = Array.isArray(e);
322
- if (C(e) || t)
322
+ if (M(e) || t)
323
323
  for (const i in e)
324
- Array.isArray(e[i]) || C(e[i]) && !bt(e[i]) ? (r[i] = Array.isArray(e[i]) ? [] : {}, me(e[i], r[i])) : p(e[i]) || (r[i] = !0);
324
+ Array.isArray(e[i]) || M(e[i]) && !bt(e[i]) ? (r[i] = Array.isArray(e[i]) ? [] : {}, Ve(e[i], r[i])) : B(e[i]) || (r[i] = !0);
325
325
  return r;
326
326
  }
327
327
  function mt(e, r, t) {
328
328
  const i = Array.isArray(e);
329
- if (C(e) || i)
329
+ if (M(e) || i)
330
330
  for (const a in e)
331
- Array.isArray(e[a]) || C(e[a]) && !bt(e[a]) ? k(r) || ke(t[a]) ? t[a] = Array.isArray(e[a]) ? me(e[a], []) : { ...me(e[a]) } : mt(e[a], p(r) ? {} : r[a], t[a]) : t[a] = !ee(e[a], r[a]);
331
+ Array.isArray(e[a]) || M(e[a]) && !bt(e[a]) ? T(r) || Ce(t[a]) ? t[a] = Array.isArray(e[a]) ? Ve(e[a], []) : { ...Ve(e[a]) } : mt(e[a], B(r) ? {} : r[a], t[a]) : t[a] = !re(e[a], r[a]);
332
332
  return t;
333
333
  }
334
- var ue = (e, r) => mt(e, r, me(r));
334
+ var ue = (e, r) => mt(e, r, Ve(r));
335
335
  const Je = {
336
336
  value: !1,
337
337
  isValid: !1
@@ -344,11 +344,11 @@ var _t = (e) => {
344
344
  }
345
345
  return e[0].checked && !e[0].disabled ? (
346
346
  // @ts-expect-error expected to work in the browser
347
- e[0].attributes && !k(e[0].attributes.value) ? k(e[0].value) || e[0].value === "" ? Xe : { value: e[0].value, isValid: !0 } : Xe
347
+ e[0].attributes && !T(e[0].attributes.value) ? T(e[0].value) || e[0].value === "" ? Xe : { value: e[0].value, isValid: !0 } : Xe
348
348
  ) : Je;
349
349
  }
350
350
  return Je;
351
- }, Vt = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: i }) => k(e) ? e : r ? e === "" ? NaN : e && +e : t && Y(e) ? new Date(e) : i ? i(e) : e;
351
+ }, Vt = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: i }) => T(e) ? e : r ? e === "" ? NaN : e && +e : t && Y(e) ? new Date(e) : i ? i(e) : e;
352
352
  const Ze = {
353
353
  isValid: !1,
354
354
  value: null
@@ -359,13 +359,13 @@ var Ft = (e) => Array.isArray(e) ? e.reduce((r, t) => t && t.checked && !t.disab
359
359
  } : r, Ze) : Ze;
360
360
  function et(e) {
361
361
  const r = e.ref;
362
- return Oe(r) ? r.files : Re(r) ? Ft(e.refs).value : vt(r) ? [...r.selectedOptions].map(({ value: t }) => t) : ye(r) ? _t(e.refs).value : Vt(k(r.value) ? e.ref.value : r.value, e);
362
+ return Re(r) ? r.files : Ue(r) ? Ft(e.refs).value : vt(r) ? [...r.selectedOptions].map(({ value: t }) => t) : ye(r) ? _t(e.refs).value : Vt(T(r.value) ? e.ref.value : r.value, e);
363
363
  }
364
364
  var Wt = (e, r, t, i) => {
365
365
  const a = {};
366
366
  for (const o of e) {
367
367
  const u = y(r, o);
368
- u && x(a, o, u._f);
368
+ u && F(a, o, u._f);
369
369
  }
370
370
  return {
371
371
  criteriaMode: t,
@@ -373,7 +373,7 @@ var Wt = (e, r, t, i) => {
373
373
  fields: a,
374
374
  shouldUseNativeValidation: i
375
375
  };
376
- }, _e = (e) => e instanceof RegExp, ce = (e) => k(e) ? e : _e(e) ? e.source : C(e) ? _e(e.value) ? e.value.source : e.value : e, tt = (e) => ({
376
+ }, Fe = (e) => e instanceof RegExp, ce = (e) => T(e) ? e : Fe(e) ? e.source : M(e) ? Fe(e.value) ? e.value.source : e.value : e, tt = (e) => ({
377
377
  isOnSubmit: !e || e === Q.onSubmit,
378
378
  isOnBlur: e === Q.onBlur,
379
379
  isOnChange: e === Q.onChange,
@@ -381,7 +381,7 @@ var Wt = (e, r, t, i) => {
381
381
  isOnTouch: e === Q.onTouched
382
382
  });
383
383
  const rt = "AsyncFunction";
384
- var qt = (e) => !!e && !!e.validate && !!($(e.validate) && e.validate.constructor.name === rt || C(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === rt)), Ht = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), st = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((i) => e.startsWith(i) && /^\.\w+/.test(e.slice(i.length))));
384
+ var qt = (e) => !!e && !!e.validate && !!($(e.validate) && e.validate.constructor.name === rt || M(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === rt)), Ht = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), st = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((i) => e.startsWith(i) && /^\.\w+/.test(e.slice(i.length))));
385
385
  const fe = (e, r, t, i) => {
386
386
  for (const a of t || Object.keys(e)) {
387
387
  const o = y(e, a);
@@ -394,14 +394,14 @@ const fe = (e, r, t, i) => {
394
394
  return !0;
395
395
  if (fe(d, r))
396
396
  break;
397
- } else if (C(d) && fe(d, r))
397
+ } else if (M(d) && fe(d, r))
398
398
  break;
399
399
  }
400
400
  }
401
401
  };
402
402
  function it(e, r, t) {
403
403
  const i = y(e, t);
404
- if (i || Te(t))
404
+ if (i || Me(t))
405
405
  return {
406
406
  error: i,
407
407
  name: t
@@ -425,102 +425,102 @@ function it(e, r, t) {
425
425
  var jt = (e, r, t, i) => {
426
426
  t(e);
427
427
  const { name: a, ...o } = e;
428
- return B(o) || Object.keys(o).length >= Object.keys(r).length || Object.keys(o).find((u) => r[u] === (!i || Q.all));
429
- }, Kt = (e, r, t) => !e || !r || e === r || de(e).some((i) => i && (t ? i === r : i.startsWith(r) || r.startsWith(i))), Qt = (e, r, t, i, a) => a.isOnAll ? !1 : !t && a.isOnTouch ? !(r || e) : (t ? i.isOnBlur : a.isOnBlur) ? !e : (t ? i.isOnChange : a.isOnChange) ? e : !0, $t = (e, r) => !Ve(y(e, r)).length && M(e, r), zt = (e, r, t) => {
428
+ return P(o) || Object.keys(o).length >= Object.keys(r).length || Object.keys(o).find((u) => r[u] === (!i || Q.all));
429
+ }, Kt = (e, r, t) => !e || !r || e === r || de(e).some((i) => i && (t ? i === r : i.startsWith(r) || r.startsWith(i))), Qt = (e, r, t, i, a) => a.isOnAll ? !1 : !t && a.isOnTouch ? !(r || e) : (t ? i.isOnBlur : a.isOnBlur) ? !e : (t ? i.isOnChange : a.isOnChange) ? e : !0, $t = (e, r) => !Ae(y(e, r)).length && R(e, r), zt = (e, r, t) => {
430
430
  const i = de(y(e, t));
431
- return x(i, "root", r[t]), x(e, t, i), e;
432
- }, ge = (e) => Y(e);
431
+ return F(i, "root", r[t]), F(e, t, i), e;
432
+ }, be = (e) => Y(e);
433
433
  function nt(e, r, t = "validate") {
434
- if (ge(e) || Array.isArray(e) && e.every(ge) || q(e) && !e)
434
+ if (be(e) || Array.isArray(e) && e.every(be) || W(e) && !e)
435
435
  return {
436
436
  type: t,
437
- message: ge(e) ? e : "",
437
+ message: be(e) ? e : "",
438
438
  ref: r
439
439
  };
440
440
  }
441
- var ne = (e) => C(e) && !_e(e) ? e : {
441
+ var oe = (e) => M(e) && !Fe(e) ? e : {
442
442
  value: e,
443
443
  message: ""
444
444
  }, at = async (e, r, t, i, a, o) => {
445
- const { ref: u, refs: d, required: b, maxLength: D, minLength: F, min: E, max: m, pattern: te, validate: j, name: O, valueAsNumber: N, mount: P } = e._f, v = y(t, O);
446
- if (!P || r.has(O))
445
+ const { ref: u, refs: d, required: v, maxLength: E, minLength: V, min: S, max: b, pattern: Z, validate: H, name: k, valueAsNumber: L, mount: J } = e._f, m = y(t, k);
446
+ if (!J || r.has(k))
447
447
  return {};
448
- const K = d ? d[0] : u, W = (A) => {
449
- a && K.reportValidity && (K.setCustomValidity(q(A) ? "" : A || ""), K.reportValidity());
450
- }, L = {}, ae = Re(u), oe = ye(u), Fe = ae || oe, z = (N || Oe(u)) && k(u.value) && k(v) || be(u) && u.value === "" || v === "" || Array.isArray(v) && !v.length, re = gt.bind(null, O, i, L), J = (A, _, S, I = X.maxLength, H = X.minLength) => {
451
- const G = A ? _ : S;
452
- L[O] = {
453
- type: A ? I : H,
448
+ const j = d ? d[0] : u, p = (_) => {
449
+ a && j.reportValidity && (j.setCustomValidity(W(_) ? "" : _ || ""), j.reportValidity());
450
+ }, O = {}, he = Ue(u), ee = ye(u), xe = he || ee, K = (L || Re(u)) && T(u.value) && T(m) || _e(u) && u.value === "" || m === "" || Array.isArray(m) && !m.length, se = gt.bind(null, k, i, O), z = (_, w, C, N = X.maxLength, I = X.minLength) => {
451
+ const G = _ ? w : C;
452
+ O[k] = {
453
+ type: _ ? N : I,
454
454
  message: G,
455
455
  ref: u,
456
- ...re(A ? I : H, G)
456
+ ...se(_ ? N : I, G)
457
457
  };
458
458
  };
459
- if (o ? !Array.isArray(v) || !v.length : b && (!Fe && (z || p(v)) || q(v) && !v || oe && !_t(d).isValid || ae && !Ft(d).isValid)) {
460
- const { value: A, message: _ } = ge(b) ? { value: !!b, message: b } : ne(b);
461
- if (A && (L[O] = {
459
+ if (o ? !Array.isArray(m) || !m.length : v && (!xe && (K || B(m)) || W(m) && !m || ee && !_t(d).isValid || he && !Ft(d).isValid)) {
460
+ const { value: _, message: w } = be(v) ? { value: !!v, message: v } : oe(v);
461
+ if (_ && (O[k] = {
462
462
  type: X.required,
463
- message: _,
464
- ref: K,
465
- ...re(X.required, _)
463
+ message: w,
464
+ ref: j,
465
+ ...se(X.required, w)
466
466
  }, !i))
467
- return W(_), L;
467
+ return p(w), O;
468
468
  }
469
- if (!z && (!p(E) || !p(m))) {
470
- let A, _;
471
- const S = ne(m), I = ne(E);
472
- if (!p(v) && !isNaN(v)) {
473
- const H = u.valueAsNumber || v && +v;
474
- p(S.value) || (A = H > S.value), p(I.value) || (_ = H < I.value);
469
+ if (!K && (!B(S) || !B(b))) {
470
+ let _, w;
471
+ const C = oe(b), N = oe(S);
472
+ if (!B(m) && !isNaN(m)) {
473
+ const I = u.valueAsNumber || m && +m;
474
+ B(C.value) || (_ = I > C.value), B(N.value) || (w = I < N.value);
475
475
  } else {
476
- const H = u.valueAsDate || new Date(v), G = (he) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + he), Z = u.type == "time", le = u.type == "week";
477
- Y(S.value) && v && (A = Z ? G(v) > G(S.value) : le ? v > S.value : H > new Date(S.value)), Y(I.value) && v && (_ = Z ? G(v) < G(I.value) : le ? v < I.value : H < new Date(I.value));
476
+ const I = u.valueAsDate || new Date(m), G = (ge) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ge), le = u.type == "time", ae = u.type == "week";
477
+ Y(C.value) && m && (_ = le ? G(m) > G(C.value) : ae ? m > C.value : I > new Date(C.value)), Y(N.value) && m && (w = le ? G(m) < G(N.value) : ae ? m < N.value : I < new Date(N.value));
478
478
  }
479
- if ((A || _) && (J(!!A, S.message, I.message, X.max, X.min), !i))
480
- return W(L[O].message), L;
479
+ if ((_ || w) && (z(!!_, C.message, N.message, X.max, X.min), !i))
480
+ return p(O[k].message), O;
481
481
  }
482
- if ((D || F) && !z && (Y(v) || o && Array.isArray(v))) {
483
- const A = ne(D), _ = ne(F), S = !p(A.value) && v.length > +A.value, I = !p(_.value) && v.length < +_.value;
484
- if ((S || I) && (J(S, A.message, _.message), !i))
485
- return W(L[O].message), L;
482
+ if ((E || V) && !K && (Y(m) || o && Array.isArray(m))) {
483
+ const _ = oe(E), w = oe(V), C = !B(_.value) && m.length > +_.value, N = !B(w.value) && m.length < +w.value;
484
+ if ((C || N) && (z(C, _.message, w.message), !i))
485
+ return p(O[k].message), O;
486
486
  }
487
- if (te && !z && Y(v)) {
488
- const { value: A, message: _ } = ne(te);
489
- if (_e(A) && !v.match(A) && (L[O] = {
487
+ if (Z && !K && Y(m)) {
488
+ const { value: _, message: w } = oe(Z);
489
+ if (Fe(_) && !m.match(_) && (O[k] = {
490
490
  type: X.pattern,
491
- message: _,
491
+ message: w,
492
492
  ref: u,
493
- ...re(X.pattern, _)
493
+ ...se(X.pattern, w)
494
494
  }, !i))
495
- return W(_), L;
495
+ return p(w), O;
496
496
  }
497
- if (j) {
498
- if ($(j)) {
499
- const A = await j(v, t), _ = nt(A, K);
500
- if (_ && (L[O] = {
501
- ..._,
502
- ...re(X.validate, _.message)
497
+ if (H) {
498
+ if ($(H)) {
499
+ const _ = await H(m, t), w = nt(_, j);
500
+ if (w && (O[k] = {
501
+ ...w,
502
+ ...se(X.validate, w.message)
503
503
  }, !i))
504
- return W(_.message), L;
505
- } else if (C(j)) {
506
- let A = {};
507
- for (const _ in j) {
508
- if (!B(A) && !i)
504
+ return p(w.message), O;
505
+ } else if (M(H)) {
506
+ let _ = {};
507
+ for (const w in H) {
508
+ if (!P(_) && !i)
509
509
  break;
510
- const S = nt(await j[_](v, t), K, _);
511
- S && (A = {
512
- ...S,
513
- ...re(_, S.message)
514
- }, W(S.message), i && (L[O] = A));
510
+ const C = nt(await H[w](m, t), j, w);
511
+ C && (_ = {
512
+ ...C,
513
+ ...se(w, C.message)
514
+ }, p(C.message), i && (O[k] = _));
515
515
  }
516
- if (!B(A) && (L[O] = {
517
- ref: K,
518
- ...A
516
+ if (!P(_) && (O[k] = {
517
+ ref: j,
518
+ ..._
519
519
  }, !i))
520
- return L;
520
+ return O;
521
521
  }
522
522
  }
523
- return W(!0), L;
523
+ return p(!0), O;
524
524
  };
525
525
  const Gt = {
526
526
  mode: Q.onSubmit,
@@ -548,7 +548,7 @@ function Yt(e = {}) {
548
548
  disabled: r.disabled || !1
549
549
  };
550
550
  const i = {};
551
- let a = C(r.defaultValues) || C(r.values) ? R(r.defaultValues || r.values) || {} : {}, o = r.shouldUnregister ? {} : R(a), u = {
551
+ let a = M(r.defaultValues) || M(r.values) ? U(r.defaultValues || r.values) || {} : {}, o = r.shouldUnregister ? {} : U(a), u = {
552
552
  action: !1,
553
553
  mount: !1,
554
554
  watch: !1
@@ -558,8 +558,8 @@ function Yt(e = {}) {
558
558
  unMount: /* @__PURE__ */ new Set(),
559
559
  array: /* @__PURE__ */ new Set(),
560
560
  watch: /* @__PURE__ */ new Set()
561
- }, b, D = 0;
562
- const F = {
561
+ }, v, E = 0;
562
+ const V = {
563
563
  isDirty: !1,
564
564
  dirtyFields: !1,
565
565
  validatingFields: !1,
@@ -568,113 +568,113 @@ function Yt(e = {}) {
568
568
  isValid: !1,
569
569
  errors: !1
570
570
  };
571
- let E = {
572
- ...F
571
+ let S = {
572
+ ...V
573
573
  };
574
- const m = {
574
+ const b = {
575
575
  array: Ye(),
576
576
  state: Ye()
577
- }, te = tt(r.mode), j = tt(r.reValidateMode), O = r.criteriaMode === Q.all, N = (s) => (n) => {
578
- clearTimeout(D), D = setTimeout(s, n);
579
- }, P = async (s) => {
580
- if (!r.disabled && (F.isValid || E.isValid || s)) {
581
- const n = r.resolver ? B((await z()).errors) : await J(i, !0);
582
- n !== t.isValid && m.state.next({
577
+ }, Z = r.criteriaMode === Q.all, H = (s) => (n) => {
578
+ clearTimeout(E), E = setTimeout(s, n);
579
+ }, k = async (s) => {
580
+ if (!r.disabled && (V.isValid || S.isValid || s)) {
581
+ const n = r.resolver ? P((await ee()).errors) : await K(i, !0);
582
+ n !== t.isValid && b.state.next({
583
583
  isValid: n
584
584
  });
585
585
  }
586
- }, v = (s, n) => {
587
- !r.disabled && (F.isValidating || F.validatingFields || E.isValidating || E.validatingFields) && ((s || Array.from(d.mount)).forEach((l) => {
588
- l && (n ? x(t.validatingFields, l, n) : M(t.validatingFields, l));
589
- }), m.state.next({
586
+ }, L = (s, n) => {
587
+ !r.disabled && (V.isValidating || V.validatingFields || S.isValidating || S.validatingFields) && ((s || Array.from(d.mount)).forEach((l) => {
588
+ l && (n ? F(t.validatingFields, l, n) : R(t.validatingFields, l));
589
+ }), b.state.next({
590
590
  validatingFields: t.validatingFields,
591
- isValidating: !B(t.validatingFields)
591
+ isValidating: !P(t.validatingFields)
592
592
  }));
593
- }, K = (s, n = [], l, h, f = !0, c = !0) => {
593
+ }, J = (s, n = [], l, h, f = !0, c = !0) => {
594
594
  if (h && l && !r.disabled) {
595
595
  if (u.action = !0, c && Array.isArray(y(i, s))) {
596
596
  const g = l(y(i, s), h.argA, h.argB);
597
- f && x(i, s, g);
597
+ f && F(i, s, g);
598
598
  }
599
599
  if (c && Array.isArray(y(t.errors, s))) {
600
600
  const g = l(y(t.errors, s), h.argA, h.argB);
601
- f && x(t.errors, s, g), $t(t.errors, s);
601
+ f && F(t.errors, s, g), $t(t.errors, s);
602
602
  }
603
- if ((F.touchedFields || E.touchedFields) && c && Array.isArray(y(t.touchedFields, s))) {
603
+ if ((V.touchedFields || S.touchedFields) && c && Array.isArray(y(t.touchedFields, s))) {
604
604
  const g = l(y(t.touchedFields, s), h.argA, h.argB);
605
- f && x(t.touchedFields, s, g);
605
+ f && F(t.touchedFields, s, g);
606
606
  }
607
- (F.dirtyFields || E.dirtyFields) && (t.dirtyFields = ue(a, o)), m.state.next({
607
+ (V.dirtyFields || S.dirtyFields) && (t.dirtyFields = ue(a, o)), b.state.next({
608
608
  name: s,
609
- isDirty: _(s, n),
609
+ isDirty: z(s, n),
610
610
  dirtyFields: t.dirtyFields,
611
611
  errors: t.errors,
612
612
  isValid: t.isValid
613
613
  });
614
614
  } else
615
- x(o, s, n);
616
- }, W = (s, n) => {
617
- x(t.errors, s, n), m.state.next({
615
+ F(o, s, n);
616
+ }, m = (s, n) => {
617
+ F(t.errors, s, n), b.state.next({
618
618
  errors: t.errors
619
619
  });
620
- }, L = (s) => {
621
- t.errors = s, m.state.next({
620
+ }, j = (s) => {
621
+ t.errors = s, b.state.next({
622
622
  errors: t.errors,
623
623
  isValid: !1
624
624
  });
625
- }, ae = (s, n, l, h) => {
625
+ }, p = (s, n, l, h) => {
626
626
  const f = y(i, s);
627
627
  if (f) {
628
- const c = y(o, s, k(l) ? y(a, s) : l);
629
- k(c) || h && h.defaultChecked || n ? x(o, s, n ? c : et(f._f)) : H(s, c), u.mount && P();
628
+ const c = y(o, s, T(l) ? y(a, s) : l);
629
+ T(c) || h && h.defaultChecked || n ? F(o, s, n ? c : et(f._f)) : C(s, c), u.mount && k();
630
630
  }
631
- }, oe = (s, n, l, h, f) => {
631
+ }, O = (s, n, l, h, f) => {
632
632
  let c = !1, g = !1;
633
- const V = {
633
+ const A = {
634
634
  name: s
635
635
  };
636
636
  if (!r.disabled) {
637
637
  if (!l || h) {
638
- (F.isDirty || E.isDirty) && (g = t.isDirty, t.isDirty = V.isDirty = _(), c = g !== V.isDirty);
639
- const T = ee(y(a, s), n);
640
- g = !!y(t.dirtyFields, s), T ? M(t.dirtyFields, s) : x(t.dirtyFields, s, !0), V.dirtyFields = t.dirtyFields, c = c || (F.dirtyFields || E.dirtyFields) && g !== !T;
638
+ (V.isDirty || S.isDirty) && (g = t.isDirty, t.isDirty = A.isDirty = z(), c = g !== A.isDirty);
639
+ const D = re(y(a, s), n);
640
+ g = !!y(t.dirtyFields, s), D ? R(t.dirtyFields, s) : F(t.dirtyFields, s, !0), A.dirtyFields = t.dirtyFields, c = c || (V.dirtyFields || S.dirtyFields) && g !== !D;
641
641
  }
642
642
  if (l) {
643
- const T = y(t.touchedFields, s);
644
- T || (x(t.touchedFields, s, l), V.touchedFields = t.touchedFields, c = c || (F.touchedFields || E.touchedFields) && T !== l);
643
+ const D = y(t.touchedFields, s);
644
+ D || (F(t.touchedFields, s, l), A.touchedFields = t.touchedFields, c = c || (V.touchedFields || S.touchedFields) && D !== l);
645
645
  }
646
- c && f && m.state.next(V);
646
+ c && f && b.state.next(A);
647
647
  }
648
- return c ? V : {};
649
- }, Fe = (s, n, l, h) => {
650
- const f = y(t.errors, s), c = (F.isValid || E.isValid) && q(n) && t.isValid !== n;
651
- if (r.delayError && l ? (b = N(() => W(s, l)), b(r.delayError)) : (clearTimeout(D), b = null, l ? x(t.errors, s, l) : M(t.errors, s)), (l ? !ee(f, l) : f) || !B(h) || c) {
648
+ return c ? A : {};
649
+ }, he = (s, n, l, h) => {
650
+ const f = y(t.errors, s), c = (V.isValid || S.isValid) && W(n) && t.isValid !== n;
651
+ if (r.delayError && l ? (v = H(() => m(s, l)), v(r.delayError)) : (clearTimeout(E), v = null, l ? F(t.errors, s, l) : R(t.errors, s)), (l ? !re(f, l) : f) || !P(h) || c) {
652
652
  const g = {
653
653
  ...h,
654
- ...c && q(n) ? { isValid: n } : {},
654
+ ...c && W(n) ? { isValid: n } : {},
655
655
  errors: t.errors,
656
656
  name: s
657
657
  };
658
658
  t = {
659
659
  ...t,
660
660
  ...g
661
- }, m.state.next(g);
661
+ }, b.state.next(g);
662
662
  }
663
- }, z = async (s) => {
664
- v(s, !0);
663
+ }, ee = async (s) => {
664
+ L(s, !0);
665
665
  const n = await r.resolver(o, r.context, Wt(s || d.mount, i, r.criteriaMode, r.shouldUseNativeValidation));
666
- return v(s), n;
667
- }, re = async (s) => {
668
- const { errors: n } = await z(s);
666
+ return L(s), n;
667
+ }, xe = async (s) => {
668
+ const { errors: n } = await ee(s);
669
669
  if (s)
670
670
  for (const l of s) {
671
671
  const h = y(n, l);
672
- h ? x(t.errors, l, h) : M(t.errors, l);
672
+ h ? F(t.errors, l, h) : R(t.errors, l);
673
673
  }
674
674
  else
675
675
  t.errors = n;
676
676
  return n;
677
- }, J = async (s, n, l = {
677
+ }, K = async (s, n, l = {
678
678
  valid: !0
679
679
  }) => {
680
680
  for (const h in s) {
@@ -682,105 +682,109 @@ function Yt(e = {}) {
682
682
  if (f) {
683
683
  const { _f: c, ...g } = f;
684
684
  if (c) {
685
- const V = d.array.has(c.name), T = f._f && qt(f._f);
686
- T && F.validatingFields && v([h], !0);
687
- const U = await at(f, d.disabled, o, O, r.shouldUseNativeValidation && !n, V);
688
- if (T && F.validatingFields && v([h]), U[c.name] && (l.valid = !1, n))
685
+ const A = d.array.has(c.name), D = f._f && qt(f._f);
686
+ D && V.validatingFields && L([h], !0);
687
+ const q = await at(f, d.disabled, o, Z, r.shouldUseNativeValidation && !n, A);
688
+ if (D && V.validatingFields && L([h]), q[c.name] && (l.valid = !1, n))
689
689
  break;
690
- !n && (y(U, c.name) ? V ? zt(t.errors, U, c.name) : x(t.errors, c.name, U[c.name]) : M(t.errors, c.name));
690
+ !n && (y(q, c.name) ? A ? zt(t.errors, q, c.name) : F(t.errors, c.name, q[c.name]) : R(t.errors, c.name));
691
691
  }
692
- !B(g) && await J(g, n, l);
692
+ !P(g) && await K(g, n, l);
693
693
  }
694
694
  }
695
695
  return l.valid;
696
- }, A = () => {
696
+ }, se = () => {
697
697
  for (const s of d.unMount) {
698
698
  const n = y(i, s);
699
- n && (n._f.refs ? n._f.refs.every((l) => !Se(l)) : !Se(n._f.ref)) && xe(s);
699
+ n && (n._f.refs ? n._f.refs.every((l) => !ke(l)) : !ke(n._f.ref)) && we(s);
700
700
  }
701
701
  d.unMount = /* @__PURE__ */ new Set();
702
- }, _ = (s, n) => !r.disabled && (s && n && x(o, s, n), !ee(Ue(), a)), S = (s, n, l) => ht(s, d, {
703
- ...u.mount ? o : k(n) ? a : Y(s) ? { [s]: n } : n
704
- }, l, n), I = (s) => Ve(y(u.mount ? o : a, s, r.shouldUnregister ? y(a, s, []) : [])), H = (s, n, l = {}) => {
702
+ }, z = (s, n) => !r.disabled && (s && n && F(o, s, n), !re(ge(), a)), _ = (s, n, l) => ht(s, d, {
703
+ ...u.mount ? o : T(n) ? a : Y(s) ? { [s]: n } : n
704
+ }, l, n), w = (s) => Ae(y(u.mount ? o : a, s, r.shouldUnregister ? y(a, s, []) : [])), C = (s, n, l = {}) => {
705
705
  const h = y(i, s);
706
706
  let f = n;
707
707
  if (h) {
708
708
  const c = h._f;
709
- c && (!c.disabled && x(o, s, Vt(n, c)), f = be(c.ref) && p(n) ? "" : n, vt(c.ref) ? [...c.ref.options].forEach((g) => g.selected = f.includes(g.value)) : c.refs ? ye(c.ref) ? c.refs.length > 1 ? c.refs.forEach((g) => (!g.defaultChecked || !g.disabled) && (g.checked = Array.isArray(f) ? !!f.find((V) => V === g.value) : f === g.value)) : c.refs[0] && (c.refs[0].checked = !!f) : c.refs.forEach((g) => g.checked = g.value === f) : Oe(c.ref) ? c.ref.value = "" : (c.ref.value = f, c.ref.type || m.state.next({
709
+ c && (!c.disabled && F(o, s, Vt(n, c)), f = _e(c.ref) && B(n) ? "" : n, vt(c.ref) ? [...c.ref.options].forEach((g) => g.selected = f.includes(g.value)) : c.refs ? ye(c.ref) ? c.refs.forEach((g) => {
710
+ (!g.defaultChecked || !g.disabled) && (Array.isArray(f) ? g.checked = !!f.find((A) => A === g.value) : g.checked = f === g.value || !!f);
711
+ }) : c.refs.forEach((g) => g.checked = g.value === f) : Re(c.ref) ? c.ref.value = "" : (c.ref.value = f, c.ref.type || b.state.next({
710
712
  name: s,
711
- values: R(o)
713
+ values: U(o)
712
714
  })));
713
715
  }
714
- (l.shouldDirty || l.shouldTouch) && oe(s, f, l.shouldTouch, l.shouldDirty, !0), l.shouldValidate && Ae(s);
715
- }, G = (s, n, l) => {
716
+ (l.shouldDirty || l.shouldTouch) && O(s, f, l.shouldTouch, l.shouldDirty, !0), l.shouldValidate && ae(s);
717
+ }, N = (s, n, l) => {
716
718
  for (const h in n) {
719
+ if (!n.hasOwnProperty(h))
720
+ return;
717
721
  const f = n[h], c = `${s}.${h}`, g = y(i, c);
718
- (d.array.has(s) || C(f) || g && !g._f) && !se(f) ? G(c, f, l) : H(c, f, l);
722
+ (d.array.has(s) || M(f) || g && !g._f) && !ie(f) ? N(c, f, l) : C(c, f, l);
719
723
  }
720
- }, Z = (s, n, l = {}) => {
721
- const h = y(i, s), f = d.array.has(s), c = R(n);
722
- x(o, s, c), f ? (m.array.next({
724
+ }, I = (s, n, l = {}) => {
725
+ const h = y(i, s), f = d.array.has(s), c = U(n);
726
+ F(o, s, c), f ? (b.array.next({
723
727
  name: s,
724
- values: R(o)
725
- }), (F.isDirty || F.dirtyFields || E.isDirty || E.dirtyFields) && l.shouldDirty && m.state.next({
728
+ values: U(o)
729
+ }), (V.isDirty || V.dirtyFields || S.isDirty || S.dirtyFields) && l.shouldDirty && b.state.next({
726
730
  name: s,
727
731
  dirtyFields: ue(a, o),
728
- isDirty: _(s, c)
729
- })) : h && !h._f && !p(c) ? G(s, c, l) : H(s, c, l), st(s, d) && m.state.next({ ...t }), m.state.next({
732
+ isDirty: z(s, c)
733
+ })) : h && !h._f && !B(c) ? N(s, c, l) : C(s, c, l), st(s, d) && b.state.next({ ...t }), b.state.next({
730
734
  name: u.mount ? s : void 0,
731
- values: R(o)
735
+ values: U(o)
732
736
  });
733
- }, le = async (s) => {
737
+ }, G = async (s) => {
734
738
  u.mount = !0;
735
739
  const n = s.target;
736
740
  let l = n.name, h = !0;
737
- const f = y(i, l), c = (g) => {
738
- h = Number.isNaN(g) || se(g) && isNaN(g.getTime()) || ee(g, y(o, l, g));
739
- };
741
+ const f = y(i, l), c = (D) => {
742
+ h = Number.isNaN(D) || ie(D) && isNaN(D.getTime()) || re(D, y(o, l, D));
743
+ }, g = tt(r.mode), A = tt(r.reValidateMode);
740
744
  if (f) {
741
- let g, V;
742
- const T = n.type ? et(f._f) : ut(s), U = s.type === ve.BLUR || s.type === ve.FOCUS_OUT, Tt = !Ht(f._f) && !r.resolver && !y(t.errors, l) && !f._f.deps || Qt(U, y(t.touchedFields, l), t.isSubmitted, j, te), De = st(l, d, U);
743
- x(o, l, T), U ? (f._f.onBlur && f._f.onBlur(s), b && b(0)) : f._f.onChange && f._f.onChange(s);
744
- const Ee = oe(l, T, U), Mt = !B(Ee) || De;
745
- if (!U && m.state.next({
745
+ let D, q;
746
+ const ve = n.type ? et(f._f) : ut(s), te = s.type === me.BLUR || s.type === me.FOCUS_OUT, Tt = !Ht(f._f) && !r.resolver && !y(t.errors, l) && !f._f.deps || Qt(te, y(t.touchedFields, l), t.isSubmitted, A, g), Ee = st(l, d, te);
747
+ F(o, l, ve), te ? (f._f.onBlur && f._f.onBlur(s), v && v(0)) : f._f.onChange && f._f.onChange(s);
748
+ const Se = O(l, ve, te), Mt = !P(Se) || Ee;
749
+ if (!te && b.state.next({
746
750
  name: l,
747
751
  type: s.type,
748
- values: R(o)
752
+ values: U(o)
749
753
  }), Tt)
750
- return (F.isValid || E.isValid) && (r.mode === "onBlur" ? U && P() : U || P()), Mt && m.state.next({ name: l, ...De ? {} : Ee });
751
- if (!U && De && m.state.next({ ...t }), r.resolver) {
752
- const { errors: Ke } = await z([l]);
753
- if (c(T), h) {
754
+ return (V.isValid || S.isValid) && (r.mode === "onBlur" ? te && k() : te || k()), Mt && b.state.next({ name: l, ...Ee ? {} : Se });
755
+ if (!te && Ee && b.state.next({ ...t }), r.resolver) {
756
+ const { errors: Ke } = await ee([l]);
757
+ if (c(ve), h) {
754
758
  const Lt = it(t.errors, i, l), Qe = it(Ke, i, Lt.name || l);
755
- g = Qe.error, l = Qe.name, V = B(Ke);
759
+ D = Qe.error, l = Qe.name, q = P(Ke);
756
760
  }
757
761
  } else
758
- v([l], !0), g = (await at(f, d.disabled, o, O, r.shouldUseNativeValidation))[l], v([l]), c(T), h && (g ? V = !1 : (F.isValid || E.isValid) && (V = await J(i, !0)));
759
- h && (f._f.deps && Ae(f._f.deps), Fe(l, V, g, Ee));
762
+ L([l], !0), D = (await at(f, d.disabled, o, Z, r.shouldUseNativeValidation))[l], L([l]), c(ve), h && (D ? q = !1 : (V.isValid || S.isValid) && (q = await K(i, !0)));
763
+ h && (f._f.deps && ae(f._f.deps), he(l, q, D, Se));
760
764
  }
761
- }, he = (s, n) => {
765
+ }, le = (s, n) => {
762
766
  if (y(t.errors, n) && s.focus)
763
767
  return s.focus(), 1;
764
- }, Ae = async (s, n = {}) => {
768
+ }, ae = async (s, n = {}) => {
765
769
  let l, h;
766
770
  const f = de(s);
767
771
  if (r.resolver) {
768
- const c = await re(k(s) ? s : f);
769
- l = B(c), h = s ? !f.some((g) => y(c, g)) : l;
772
+ const c = await xe(T(s) ? s : f);
773
+ l = P(c), h = s ? !f.some((g) => y(c, g)) : l;
770
774
  } else s ? (h = (await Promise.all(f.map(async (c) => {
771
775
  const g = y(i, c);
772
- return await J(g && g._f ? { [c]: g } : g);
773
- }))).every(Boolean), !(!h && !t.isValid) && P()) : h = l = await J(i);
774
- return m.state.next({
775
- ...!Y(s) || (F.isValid || E.isValid) && l !== t.isValid ? {} : { name: s },
776
+ return await K(g && g._f ? { [c]: g } : g);
777
+ }))).every(Boolean), !(!h && !t.isValid) && k()) : h = l = await K(i);
778
+ return b.state.next({
779
+ ...!Y(s) || (V.isValid || S.isValid) && l !== t.isValid ? {} : { name: s },
776
780
  ...r.resolver || !s ? { isValid: l } : {},
777
781
  errors: t.errors
778
- }), n.shouldFocus && !h && fe(i, he, s ? f : d.mount), h;
779
- }, Ue = (s) => {
782
+ }), n.shouldFocus && !h && fe(i, le, s ? f : d.mount), h;
783
+ }, ge = (s) => {
780
784
  const n = {
781
785
  ...u.mount ? o : a
782
786
  };
783
- return k(s) ? n : Y(s) ? y(n, s) : s.map((l) => y(n, l));
787
+ return T(s) ? n : Y(s) ? y(n, s) : s.map((l) => y(n, l));
784
788
  }, Ne = (s, n) => ({
785
789
  invalid: !!y((n || t).errors, s),
786
790
  isDirty: !!y((n || t).dirtyFields, s),
@@ -788,51 +792,51 @@ function Yt(e = {}) {
788
792
  isValidating: !!y(t.validatingFields, s),
789
793
  isTouched: !!y((n || t).touchedFields, s)
790
794
  }), xt = (s) => {
791
- s && de(s).forEach((n) => M(t.errors, n)), m.state.next({
795
+ s && de(s).forEach((n) => R(t.errors, n)), b.state.next({
792
796
  errors: s ? t.errors : {}
793
797
  });
794
798
  }, Pe = (s, n, l) => {
795
- const h = (y(i, s, { _f: {} })._f || {}).ref, f = y(t.errors, s) || {}, { ref: c, message: g, type: V, ...T } = f;
796
- x(t.errors, s, {
797
- ...T,
799
+ const h = (y(i, s, { _f: {} })._f || {}).ref, f = y(t.errors, s) || {}, { ref: c, message: g, type: A, ...D } = f;
800
+ F(t.errors, s, {
801
+ ...D,
798
802
  ...n,
799
803
  ref: h
800
- }), m.state.next({
804
+ }), b.state.next({
801
805
  name: s,
802
806
  errors: t.errors,
803
807
  isValid: !1
804
808
  }), l && l.shouldFocus && h && h.focus && h.focus();
805
- }, wt = (s, n) => $(s) ? m.state.subscribe({
806
- next: (l) => s(S(void 0, n), l)
807
- }) : S(s, n, !0), Be = (s) => m.state.subscribe({
809
+ }, wt = (s, n) => $(s) ? b.state.subscribe({
810
+ next: (l) => s(_(void 0, n), l)
811
+ }) : _(s, n, !0), Be = (s) => b.state.subscribe({
808
812
  next: (n) => {
809
- Kt(s.name, n.name, s.exact) && jt(n, s.formState || F, Ct, s.reRenderRoot) && s.callback({
813
+ Kt(s.name, n.name, s.exact) && jt(n, s.formState || V, Ct, s.reRenderRoot) && s.callback({
810
814
  values: { ...o },
811
815
  ...t,
812
816
  ...n
813
817
  });
814
818
  }
815
- }).unsubscribe, Dt = (s) => (u.mount = !0, E = {
816
- ...E,
819
+ }).unsubscribe, Dt = (s) => (u.mount = !0, S = {
820
+ ...S,
817
821
  ...s.formState
818
822
  }, Be({
819
823
  ...s,
820
- formState: E
821
- })), xe = (s, n = {}) => {
824
+ formState: S
825
+ })), we = (s, n = {}) => {
822
826
  for (const l of s ? de(s) : d.mount)
823
- d.mount.delete(l), d.array.delete(l), n.keepValue || (M(i, l), M(o, l)), !n.keepError && M(t.errors, l), !n.keepDirty && M(t.dirtyFields, l), !n.keepTouched && M(t.touchedFields, l), !n.keepIsValidating && M(t.validatingFields, l), !r.shouldUnregister && !n.keepDefaultValue && M(a, l);
824
- m.state.next({
825
- values: R(o)
826
- }), m.state.next({
827
+ d.mount.delete(l), d.array.delete(l), n.keepValue || (R(i, l), R(o, l)), !n.keepError && R(t.errors, l), !n.keepDirty && R(t.dirtyFields, l), !n.keepTouched && R(t.touchedFields, l), !n.keepIsValidating && R(t.validatingFields, l), !r.shouldUnregister && !n.keepDefaultValue && R(a, l);
828
+ b.state.next({
829
+ values: U(o)
830
+ }), b.state.next({
827
831
  ...t,
828
- ...n.keepDirty ? { isDirty: _() } : {}
829
- }), !n.keepIsValid && P();
832
+ ...n.keepDirty ? { isDirty: z() } : {}
833
+ }), !n.keepIsValid && k();
830
834
  }, pe = ({ disabled: s, name: n }) => {
831
- (q(s) && u.mount || s || d.disabled.has(n)) && (s ? d.disabled.add(n) : d.disabled.delete(n));
832
- }, we = (s, n = {}) => {
835
+ (W(s) && u.mount || s || d.disabled.has(n)) && (s ? d.disabled.add(n) : d.disabled.delete(n));
836
+ }, De = (s, n = {}) => {
833
837
  let l = y(i, s);
834
- const h = q(n.disabled) || q(r.disabled);
835
- return x(i, s, {
838
+ const h = W(n.disabled) || W(r.disabled);
839
+ return F(i, s, {
836
840
  ...l || {},
837
841
  _f: {
838
842
  ...l && l._f ? l._f : { ref: { name: s } },
@@ -841,9 +845,9 @@ function Yt(e = {}) {
841
845
  ...n
842
846
  }
843
847
  }), d.mount.add(s), l ? pe({
844
- disabled: q(n.disabled) ? n.disabled : r.disabled,
848
+ disabled: W(n.disabled) ? n.disabled : r.disabled,
845
849
  name: s
846
- }) : ae(s, !0, n.value), {
850
+ }) : p(s, !0, n.value), {
847
851
  ...h ? { disabled: n.disabled || r.disabled } : {},
848
852
  ...r.progressive ? {
849
853
  required: !!n.required,
@@ -854,33 +858,33 @@ function Yt(e = {}) {
854
858
  pattern: ce(n.pattern)
855
859
  } : {},
856
860
  name: s,
857
- onChange: le,
858
- onBlur: le,
861
+ onChange: G,
862
+ onBlur: G,
859
863
  ref: (f) => {
860
864
  if (f) {
861
- we(s, n), l = y(i, s);
862
- const c = k(f.value) && f.querySelectorAll && f.querySelectorAll("input,select,textarea")[0] || f, g = Bt(c), V = l._f.refs || [];
863
- if (g ? V.find((T) => T === c) : c === l._f.ref)
865
+ De(s, n), l = y(i, s);
866
+ const c = T(f.value) && f.querySelectorAll && f.querySelectorAll("input,select,textarea")[0] || f, g = Bt(c), A = l._f.refs || [];
867
+ if (g ? A.find((D) => D === c) : c === l._f.ref)
864
868
  return;
865
- x(i, s, {
869
+ F(i, s, {
866
870
  _f: {
867
871
  ...l._f,
868
872
  ...g ? {
869
873
  refs: [
870
- ...V.filter(Se),
874
+ ...A.filter(ke),
871
875
  c,
872
876
  ...Array.isArray(y(a, s)) ? [{}] : []
873
877
  ],
874
878
  ref: { type: c.type, name: s }
875
879
  } : { ref: c }
876
880
  }
877
- }), ae(s, !1, void 0, c);
881
+ }), p(s, !1, void 0, c);
878
882
  } else
879
883
  l = y(i, s, {}), l._f && (l._f.mount = !1), (r.shouldUnregister || n.shouldUnregister) && !(ct(d.array, s) && u.action) && d.unMount.add(s);
880
884
  }
881
885
  };
882
- }, Ie = () => r.shouldFocusError && fe(i, he, d.mount), Et = (s) => {
883
- q(s) && (m.state.next({ disabled: s }), fe(i, (n, l) => {
886
+ }, Ie = () => r.shouldFocusError && fe(i, le, d.mount), Et = (s) => {
887
+ W(s) && (b.state.next({ disabled: s }), fe(i, (n, l) => {
884
888
  const h = y(i, l);
885
889
  h && (n.disabled = h._f.disabled || s, Array.isArray(h._f.refs) && h._f.refs.forEach((f) => {
886
890
  f.disabled = h._f.disabled || s;
@@ -889,19 +893,19 @@ function Yt(e = {}) {
889
893
  }, We = (s, n) => async (l) => {
890
894
  let h;
891
895
  l && (l.preventDefault && l.preventDefault(), l.persist && l.persist());
892
- let f = R(o);
893
- if (m.state.next({
896
+ let f = U(o);
897
+ if (b.state.next({
894
898
  isSubmitting: !0
895
899
  }), r.resolver) {
896
- const { errors: c, values: g } = await z();
900
+ const { errors: c, values: g } = await ee();
897
901
  t.errors = c, f = g;
898
902
  } else
899
- await J(i);
903
+ await K(i);
900
904
  if (d.disabled.size)
901
905
  for (const c of d.disabled)
902
- x(f, c, void 0);
903
- if (M(t.errors, "root"), B(t.errors)) {
904
- m.state.next({
906
+ F(f, c, void 0);
907
+ if (R(t.errors, "root"), P(t.errors)) {
908
+ b.state.next({
905
909
  errors: {}
906
910
  });
907
911
  try {
@@ -911,47 +915,47 @@ function Yt(e = {}) {
911
915
  }
912
916
  } else
913
917
  n && await n({ ...t.errors }, l), Ie(), setTimeout(Ie);
914
- if (m.state.next({
918
+ if (b.state.next({
915
919
  isSubmitted: !0,
916
920
  isSubmitting: !1,
917
- isSubmitSuccessful: B(t.errors) && !h,
921
+ isSubmitSuccessful: P(t.errors) && !h,
918
922
  submitCount: t.submitCount + 1,
919
923
  errors: t.errors
920
924
  }), h)
921
925
  throw h;
922
926
  }, St = (s, n = {}) => {
923
- y(i, s) && (k(n.defaultValue) ? Z(s, R(y(a, s))) : (Z(s, n.defaultValue), x(a, s, R(n.defaultValue))), n.keepTouched || M(t.touchedFields, s), n.keepDirty || (M(t.dirtyFields, s), t.isDirty = n.defaultValue ? _(s, R(y(a, s))) : _()), n.keepError || (M(t.errors, s), F.isValid && P()), m.state.next({ ...t }));
927
+ y(i, s) && (T(n.defaultValue) ? I(s, U(y(a, s))) : (I(s, n.defaultValue), F(a, s, U(n.defaultValue))), n.keepTouched || R(t.touchedFields, s), n.keepDirty || (R(t.dirtyFields, s), t.isDirty = n.defaultValue ? z(s, U(y(a, s))) : z()), n.keepError || (R(t.errors, s), V.isValid && k()), b.state.next({ ...t }));
924
928
  }, qe = (s, n = {}) => {
925
- const l = s ? R(s) : a, h = R(l), f = B(s), c = f ? a : h;
929
+ const l = s ? U(s) : a, h = U(l), f = P(s), c = f ? a : h;
926
930
  if (n.keepDefaultValues || (a = l), !n.keepValues) {
927
931
  if (n.keepDirtyValues) {
928
932
  const g = /* @__PURE__ */ new Set([
929
933
  ...d.mount,
930
934
  ...Object.keys(ue(a, o))
931
935
  ]);
932
- for (const V of Array.from(g))
933
- y(t.dirtyFields, V) ? x(c, V, y(o, V)) : Z(V, y(c, V));
936
+ for (const A of Array.from(g))
937
+ y(t.dirtyFields, A) ? F(c, A, y(o, A)) : I(A, y(c, A));
934
938
  } else {
935
- if (Ce && k(s))
939
+ if (Te && T(s))
936
940
  for (const g of d.mount) {
937
- const V = y(i, g);
938
- if (V && V._f) {
939
- const T = Array.isArray(V._f.refs) ? V._f.refs[0] : V._f.ref;
940
- if (be(T)) {
941
- const U = T.closest("form");
942
- if (U) {
943
- U.reset();
941
+ const A = y(i, g);
942
+ if (A && A._f) {
943
+ const D = Array.isArray(A._f.refs) ? A._f.refs[0] : A._f.ref;
944
+ if (_e(D)) {
945
+ const q = D.closest("form");
946
+ if (q) {
947
+ q.reset();
944
948
  break;
945
949
  }
946
950
  }
947
951
  }
948
952
  }
949
953
  for (const g of d.mount)
950
- Z(g, y(c, g));
954
+ I(g, y(c, g));
951
955
  }
952
- o = R(c), m.array.next({
956
+ o = U(c), b.array.next({
953
957
  values: { ...c }
954
- }), m.state.next({
958
+ }), b.state.next({
955
959
  values: { ...c }
956
960
  });
957
961
  }
@@ -963,9 +967,9 @@ function Yt(e = {}) {
963
967
  watch: /* @__PURE__ */ new Set(),
964
968
  watchAll: !1,
965
969
  focus: ""
966
- }, u.mount = !F.isValid || !!n.keepIsValid || !!n.keepDirtyValues, u.watch = !!r.shouldUnregister, m.state.next({
970
+ }, u.mount = !V.isValid || !!n.keepIsValid || !!n.keepDirtyValues, u.watch = !!r.shouldUnregister, b.state.next({
967
971
  submitCount: n.keepSubmitCount ? t.submitCount : 0,
968
- isDirty: f ? !1 : n.keepDirty ? t.isDirty : !!(n.keepDefaultValues && !ee(s, a)),
972
+ isDirty: f ? !1 : n.keepDirty ? t.isDirty : !!(n.keepDefaultValues && !re(s, a)),
969
973
  isSubmitted: n.keepIsSubmitted ? t.isSubmitted : !1,
970
974
  dirtyFields: f ? {} : n.keepDirtyValues ? n.keepDefaultValues && o ? ue(a, o) : t.dirtyFields : n.keepDefaultValues && s ? ue(a, s) : n.keepDirty ? t.dirtyFields : {},
971
975
  touchedFields: n.keepTouched ? t.touchedFields : {},
@@ -986,30 +990,30 @@ function Yt(e = {}) {
986
990
  };
987
991
  }, je = {
988
992
  control: {
989
- register: we,
990
- unregister: xe,
993
+ register: De,
994
+ unregister: we,
991
995
  getFieldState: Ne,
992
996
  handleSubmit: We,
993
997
  setError: Pe,
994
998
  _subscribe: Be,
995
- _runSchema: z,
996
- _getWatch: S,
997
- _getDirty: _,
998
- _setValid: P,
999
- _setFieldArray: K,
999
+ _runSchema: ee,
1000
+ _getWatch: _,
1001
+ _getDirty: z,
1002
+ _setValid: k,
1003
+ _setFieldArray: J,
1000
1004
  _setDisabledField: pe,
1001
- _setErrors: L,
1002
- _getFieldArray: I,
1005
+ _setErrors: j,
1006
+ _getFieldArray: w,
1003
1007
  _reset: qe,
1004
1008
  _resetDefaultValues: () => $(r.defaultValues) && r.defaultValues().then((s) => {
1005
- He(s, r.resetOptions), m.state.next({
1009
+ He(s, r.resetOptions), b.state.next({
1006
1010
  isLoading: !1
1007
1011
  });
1008
1012
  }),
1009
- _removeUnmounted: A,
1013
+ _removeUnmounted: se,
1010
1014
  _disableForm: Et,
1011
- _subjects: m,
1012
- _proxyFormState: F,
1015
+ _subjects: b,
1016
+ _proxyFormState: V,
1013
1017
  get _fields() {
1014
1018
  return i;
1015
1019
  },
@@ -1045,16 +1049,16 @@ function Yt(e = {}) {
1045
1049
  }
1046
1050
  },
1047
1051
  subscribe: Dt,
1048
- trigger: Ae,
1049
- register: we,
1052
+ trigger: ae,
1053
+ register: De,
1050
1054
  handleSubmit: We,
1051
1055
  watch: wt,
1052
- setValue: Z,
1053
- getValues: Ue,
1056
+ setValue: I,
1057
+ getValues: ge,
1054
1058
  reset: He,
1055
1059
  resetField: St,
1056
1060
  clearErrors: xt,
1057
- unregister: xe,
1061
+ unregister: we,
1058
1062
  setError: Pe,
1059
1063
  setFocus: kt,
1060
1064
  getFieldState: Ne
@@ -1065,7 +1069,7 @@ function Yt(e = {}) {
1065
1069
  };
1066
1070
  }
1067
1071
  function Jt(e = {}) {
1068
- const r = w.useRef(void 0), t = w.useRef(void 0), [i, a] = w.useState({
1072
+ const r = x.useRef(void 0), t = x.useRef(void 0), [i, a] = x.useState({
1069
1073
  isDirty: !1,
1070
1074
  isValidating: !1,
1071
1075
  isLoading: $(e.defaultValues),
@@ -1087,7 +1091,7 @@ function Jt(e = {}) {
1087
1091
  formState: i
1088
1092
  }, e.formControl && e.defaultValues && !$(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions));
1089
1093
  const o = r.current.control;
1090
- return o._options = e, Le(() => {
1094
+ return o._options = e, Oe(() => {
1091
1095
  const u = o._subscribe({
1092
1096
  formState: o._proxyFormState,
1093
1097
  callback: () => a({ ...o._formState }),
@@ -1097,22 +1101,22 @@ function Jt(e = {}) {
1097
1101
  ...d,
1098
1102
  isReady: !0
1099
1103
  })), o._formState.isReady = !0, u;
1100
- }, [o]), w.useEffect(() => o._disableForm(e.disabled), [o, e.disabled]), w.useEffect(() => {
1101
- e.mode && (o._options.mode = e.mode), e.reValidateMode && (o._options.reValidateMode = e.reValidateMode), e.errors && !B(e.errors) && o._setErrors(e.errors);
1102
- }, [o, e.errors, e.mode, e.reValidateMode]), w.useEffect(() => {
1104
+ }, [o]), x.useEffect(() => o._disableForm(e.disabled), [o, e.disabled]), x.useEffect(() => {
1105
+ e.mode && (o._options.mode = e.mode), e.reValidateMode && (o._options.reValidateMode = e.reValidateMode), e.errors && !P(e.errors) && o._setErrors(e.errors);
1106
+ }, [o, e.errors, e.mode, e.reValidateMode]), x.useEffect(() => {
1103
1107
  e.shouldUnregister && o._subjects.state.next({
1104
1108
  values: o._getWatch()
1105
1109
  });
1106
- }, [o, e.shouldUnregister]), w.useEffect(() => {
1110
+ }, [o, e.shouldUnregister]), x.useEffect(() => {
1107
1111
  if (o._proxyFormState.isDirty) {
1108
1112
  const u = o._getDirty();
1109
1113
  u !== i.isDirty && o._subjects.state.next({
1110
1114
  isDirty: u
1111
1115
  });
1112
1116
  }
1113
- }, [o, i.isDirty]), w.useEffect(() => {
1114
- e.values && !ee(e.values, t.current) ? (o._reset(e.values, o._options.resetOptions), t.current = e.values, a((u) => ({ ...u }))) : o._resetDefaultValues();
1115
- }, [o, e.values]), w.useEffect(() => {
1117
+ }, [o, i.isDirty]), x.useEffect(() => {
1118
+ e.values && !re(e.values, t.current) ? (o._reset(e.values, o._options.resetOptions), t.current = e.values, a((u) => ({ ...u }))) : o._resetDefaultValues();
1119
+ }, [o, e.values]), x.useEffect(() => {
1116
1120
  o._state.mount || (o._setValid(), o._state.mount = !0), o._state.watch && (o._state.watch = !1, o._subjects.state.next({ ...o._formState })), o._removeUnmounted();
1117
1121
  }), r.current.formState = yt(i, o), r.current;
1118
1122
  }
@@ -1133,8 +1137,8 @@ const ot = (e, r, t) => {
1133
1137
  const a = y(r.fields, i), o = Object.assign(e[i] || {}, { ref: a && a.ref });
1134
1138
  if (Zt(r.names || Object.keys(e), i)) {
1135
1139
  const u = Object.assign({}, y(t, i));
1136
- x(u, "root", o), x(t, i, u);
1137
- } else x(t, i, o);
1140
+ F(u, "root", o), F(t, i, u);
1141
+ } else F(t, i, o);
1138
1142
  }
1139
1143
  return t;
1140
1144
  }, Zt = (e, r) => e.some((t) => t.startsWith(r + "."));
@@ -1145,13 +1149,13 @@ var er = function(e, r) {
1145
1149
  var d = i.unionErrors[0].errors[0];
1146
1150
  t[u] = { message: d.message, type: d.code };
1147
1151
  } else t[u] = { message: o, type: a };
1148
- if ("unionErrors" in i && i.unionErrors.forEach(function(F) {
1149
- return F.errors.forEach(function(E) {
1150
- return e.push(E);
1152
+ if ("unionErrors" in i && i.unionErrors.forEach(function(V) {
1153
+ return V.errors.forEach(function(S) {
1154
+ return e.push(S);
1151
1155
  });
1152
1156
  }), r) {
1153
- var b = t[u].types, D = b && b[i.code];
1154
- t[u] = gt(u, r, t, a, D ? [].concat(D, i.message) : i.message);
1157
+ var v = t[u].types, E = v && v[i.code];
1158
+ t[u] = gt(u, r, t, a, E ? [].concat(E, i.message) : i.message);
1155
1159
  }
1156
1160
  e.shift();
1157
1161
  }
@@ -1161,13 +1165,13 @@ var er = function(e, r) {
1161
1165
  try {
1162
1166
  return Promise.resolve(function(u, d) {
1163
1167
  try {
1164
- var b = Promise.resolve(e[t.mode === "sync" ? "parse" : "parseAsync"](i, r)).then(function(D) {
1165
- return o.shouldUseNativeValidation && At({}, o), { errors: {}, values: t.raw ? i : D };
1168
+ var v = Promise.resolve(e[t.mode === "sync" ? "parse" : "parseAsync"](i, r)).then(function(E) {
1169
+ return o.shouldUseNativeValidation && At({}, o), { errors: {}, values: t.raw ? i : E };
1166
1170
  });
1167
- } catch (D) {
1168
- return d(D);
1171
+ } catch (E) {
1172
+ return d(E);
1169
1173
  }
1170
- return b && b.then ? b.then(void 0, d) : b;
1174
+ return v && v.then ? v.then(void 0, d) : v;
1171
1175
  }(0, function(u) {
1172
1176
  if (function(d) {
1173
1177
  return Array.isArray(d == null ? void 0 : d.errors);
@@ -1187,9 +1191,9 @@ const dr = ({ schema: e, ...r }) => Jt({
1187
1191
  return function(...i) {
1188
1192
  clearTimeout(t), t = setTimeout(() => e(...i), r);
1189
1193
  };
1190
- }, sr = (e, r) => ie.useMemo(() => rr(e, r), [r]), fr = (e, r) => {
1191
- const t = ie.useRef(e), [i, a] = ie.useState(e), o = sr(a, r);
1192
- return ie.useEffect(() => {
1194
+ }, sr = (e, r) => ne.useMemo(() => rr(e, r), [r]), fr = (e, r) => {
1195
+ const t = ne.useRef(e), [i, a] = ne.useState(e), o = sr(a, r);
1196
+ return ne.useEffect(() => {
1193
1197
  t.current !== e && (o(e), t.current = e);
1194
1198
  }, [e]), i;
1195
1199
  };
@@ -1201,8 +1205,8 @@ export {
1201
1205
  rr as d,
1202
1206
  fr as e,
1203
1207
  Pt as f,
1204
- Me as g,
1208
+ Le as g,
1205
1209
  cr as h,
1206
1210
  or as u
1207
1211
  };
1208
- //# sourceMappingURL=useDebounce-B__kmLt7.js.map
1212
+ //# sourceMappingURL=useDebounce-BH0d8exl.js.map