@scbt-ecom/ui 0.91.2 → 0.91.4

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,20 +1,20 @@
1
1
  import * as ne from "react";
2
- import A, { useCallback as Ye, useSyncExternalStore as $e } from "react";
2
+ import x, { useCallback as Ye, useSyncExternalStore as $e } from "react";
3
3
  import { i as Ot } from "./isClient-C9aZtt2Q.js";
4
4
  const Je = () => !1, or = () => {
5
5
  const e = "(max-width: 1187px)", r = "(min-width: 1188px)", t = Ye(
6
- (u) => {
6
+ (l) => {
7
7
  const c = globalThis.matchMedia(e);
8
- return c.addEventListener("change", u), () => {
9
- c.removeEventListener("change", u);
8
+ return c.addEventListener("change", l), () => {
9
+ c.removeEventListener("change", l);
10
10
  };
11
11
  },
12
12
  [e]
13
13
  ), i = Ye(
14
- (u) => {
14
+ (l) => {
15
15
  const c = globalThis.matchMedia(r);
16
- return c.addEventListener("change", u), () => {
17
- c.removeEventListener("change", u);
16
+ return c.addEventListener("change", l), () => {
17
+ c.removeEventListener("change", l);
18
18
  };
19
19
  },
20
20
  [r]
@@ -23,7 +23,7 @@ const Je = () => !1, or = () => {
23
23
  isMobile: $e(t, a, Je),
24
24
  isDesktop: $e(i, o, Je)
25
25
  };
26
- }, lr = (e, r) => {
26
+ }, ur = (e, r) => {
27
27
  const t = (i) => {
28
28
  e.current && !e.current.contains(i.target) && r();
29
29
  };
@@ -58,18 +58,18 @@ function U(e) {
58
58
  return e;
59
59
  return r;
60
60
  }
61
- var Ae = (e) => /^\w*$/.test(e), M = (e) => e === void 0, Le = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Oe = (e) => Le(e.replace(/["|']|\]/g, "").split(/\.|\[/)), y = (e, r, t) => {
61
+ var Ae = (e) => /^\w*$/.test(e), T = (e) => e === void 0, Le = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Oe = (e) => Le(e.replace(/["|']|\]/g, "").split(/\.|\[/)), f = (e, r, t) => {
62
62
  if (!r || !L(e))
63
63
  return t;
64
64
  const i = (Ae(r) ? [r] : Oe(r)).reduce((a, o) => P(a) ? a : a[o], e);
65
- return M(i) || i === e ? M(e[r]) ? t : e[r] : i;
66
- }, W = (e) => typeof e == "boolean", F = (e, r, t) => {
65
+ return T(i) || i === e ? T(e[r]) ? t : e[r] : i;
66
+ }, W = (e) => typeof e == "boolean", A = (e, r, t) => {
67
67
  let i = -1;
68
- const a = Ae(r) ? [r] : Oe(r), o = a.length, u = o - 1;
68
+ const a = Ae(r) ? [r] : Oe(r), o = a.length, l = o - 1;
69
69
  for (; ++i < o; ) {
70
70
  const c = a[i];
71
71
  let v = t;
72
- if (i !== u) {
72
+ if (i !== l) {
73
73
  const D = e[c];
74
74
  v = L(D) || Array.isArray(D) ? D : isNaN(+a[i + 1]) ? {} : [];
75
75
  }
@@ -96,11 +96,11 @@ const me = {
96
96
  pattern: "pattern",
97
97
  required: "required",
98
98
  validate: "validate"
99
- }, Re = A.createContext(null);
99
+ }, Re = x.createContext(null);
100
100
  Re.displayName = "HookFormContext";
101
- const Ue = () => A.useContext(Re), ur = (e) => {
101
+ const Ue = () => x.useContext(Re), lr = (e) => {
102
102
  const { children: r, ...t } = e;
103
- return A.createElement(Re.Provider, { value: t }, r);
103
+ return x.createElement(Re.Provider, { value: t }, r);
104
104
  };
105
105
  var yt = (e, r, t, i = !0) => {
106
106
  const a = {
@@ -109,15 +109,15 @@ var yt = (e, r, t, i = !0) => {
109
109
  for (const o in e)
110
110
  Object.defineProperty(a, o, {
111
111
  get: () => {
112
- const u = o;
113
- return r._proxyFormState[u] !== Q.all && (r._proxyFormState[u] = !i || Q.all), t && (t[u] = !0), e[u];
112
+ const l = o;
113
+ return r._proxyFormState[l] !== Q.all && (r._proxyFormState[l] = !i || Q.all), t && (t[l] = !0), e[l];
114
114
  }
115
115
  });
116
116
  return a;
117
117
  };
118
118
  const Ne = typeof window < "u" ? ne.useLayoutEffect : ne.useEffect;
119
119
  function Nt(e) {
120
- const r = Ue(), { control: t = r.control, disabled: i, name: a, exact: o } = e || {}, [u, c] = A.useState(t._formState), v = A.useRef({
120
+ const r = Ue(), { control: t = r.control, disabled: i, name: a, exact: o } = e || {}, [l, c] = x.useState(t._formState), v = x.useRef({
121
121
  isDirty: !1,
122
122
  isLoading: !1,
123
123
  dirtyFields: !1,
@@ -137,78 +137,78 @@ function Nt(e) {
137
137
  ...D
138
138
  });
139
139
  }
140
- }), [a, i, o]), A.useEffect(() => {
140
+ }), [a, i, o]), x.useEffect(() => {
141
141
  v.current.isValid && t._setValid(!0);
142
- }, [t]), A.useMemo(() => yt(u, t, v.current, !1), [u, t]);
142
+ }, [t]), x.useMemo(() => yt(l, t, v.current, !1), [l, t]);
143
143
  }
144
- var $ = (e) => typeof e == "string", ht = (e, r, t, i, a) => $(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);
144
+ var $ = (e) => typeof e == "string", ht = (e, r, t, i, a) => $(e) ? (i && r.watch.add(e), f(t, e, a)) : Array.isArray(e) ? e.map((o) => (i && r.watch.add(o), f(t, o))) : (i && (r.watchAll = !0), t);
145
145
  function Pt(e) {
146
- const r = Ue(), { control: t = r.control, name: i, defaultValue: a, disabled: o, exact: u } = e || {}, c = A.useRef(a), [v, D] = A.useState(t._getWatch(i, c.current));
146
+ const r = Ue(), { control: t = r.control, name: i, defaultValue: a, disabled: o, exact: l } = e || {}, c = x.useRef(a), [v, D] = x.useState(t._getWatch(i, c.current));
147
147
  return Ne(() => t._subscribe({
148
148
  name: i,
149
149
  formState: {
150
150
  values: !0
151
151
  },
152
- exact: u,
153
- callback: (V) => !o && D(ht(i, t._names, V.values || t._formValues, !1, c.current))
154
- }), [i, t, o, u]), A.useEffect(() => t._removeUnmounted()), v;
152
+ exact: l,
153
+ callback: (F) => !o && D(ht(i, t._names, F.values || t._formValues, !1, c.current))
154
+ }), [i, t, o, l]), x.useEffect(() => t._removeUnmounted()), v;
155
155
  }
156
156
  function cr(e) {
157
- const r = Ue(), { name: t, disabled: i, control: a = r.control, shouldUnregister: o } = e, u = ft(a._names.array, t), c = Pt({
157
+ const r = Ue(), { name: t, disabled: i, control: a = r.control, shouldUnregister: o } = e, l = ft(a._names.array, t), c = Pt({
158
158
  control: a,
159
159
  name: t,
160
- defaultValue: y(a._formValues, t, y(a._defaultValues, t, e.defaultValue)),
160
+ defaultValue: f(a._formValues, t, f(a._defaultValues, t, e.defaultValue)),
161
161
  exact: !0
162
162
  }), v = Nt({
163
163
  control: a,
164
164
  name: t,
165
165
  exact: !0
166
- }), D = A.useRef(e), V = A.useRef(a.register(t, {
166
+ }), D = x.useRef(e), F = x.useRef(a.register(t, {
167
167
  ...e.rules,
168
168
  value: c,
169
169
  ...W(e.disabled) ? { disabled: e.disabled } : {}
170
- })), S = A.useMemo(() => Object.defineProperties({}, {
170
+ })), S = x.useMemo(() => Object.defineProperties({}, {
171
171
  invalid: {
172
172
  enumerable: !0,
173
- get: () => !!y(v.errors, t)
173
+ get: () => !!f(v.errors, t)
174
174
  },
175
175
  isDirty: {
176
176
  enumerable: !0,
177
- get: () => !!y(v.dirtyFields, t)
177
+ get: () => !!f(v.dirtyFields, t)
178
178
  },
179
179
  isTouched: {
180
180
  enumerable: !0,
181
- get: () => !!y(v.touchedFields, t)
181
+ get: () => !!f(v.touchedFields, t)
182
182
  },
183
183
  isValidating: {
184
184
  enumerable: !0,
185
- get: () => !!y(v.validatingFields, t)
185
+ get: () => !!f(v.validatingFields, t)
186
186
  },
187
187
  error: {
188
188
  enumerable: !0,
189
- get: () => y(v.errors, t)
189
+ get: () => f(v.errors, t)
190
190
  }
191
- }), [v, t]), b = A.useCallback((C) => V.current.onChange({
191
+ }), [v, t]), b = x.useCallback((C) => F.current.onChange({
192
192
  target: {
193
193
  value: dt(C),
194
194
  name: t
195
195
  },
196
196
  type: me.CHANGE
197
- }), [t]), Z = A.useCallback(() => V.current.onBlur({
197
+ }), [t]), Z = x.useCallback(() => F.current.onBlur({
198
198
  target: {
199
- value: y(a._formValues, t),
199
+ value: f(a._formValues, t),
200
200
  name: t
201
201
  },
202
202
  type: me.BLUR
203
- }), [t, a._formValues]), H = A.useCallback((C) => {
204
- const J = y(a._fields, t);
203
+ }), [t, a._formValues]), H = x.useCallback((C) => {
204
+ const J = f(a._fields, t);
205
205
  J && C && (J._f.ref = {
206
206
  focus: () => C.focus && C.focus(),
207
207
  select: () => C.select && C.select(),
208
208
  setCustomValidity: (m) => C.setCustomValidity(m),
209
209
  reportValidity: () => C.reportValidity()
210
210
  });
211
- }, [a._fields, t]), k = A.useMemo(() => ({
211
+ }, [a._fields, t]), k = x.useMemo(() => ({
212
212
  name: t,
213
213
  value: c,
214
214
  ...W(i) || v.disabled ? { disabled: v.disabled || i } : {},
@@ -216,29 +216,29 @@ function cr(e) {
216
216
  onBlur: Z,
217
217
  ref: H
218
218
  }), [t, i, v.disabled, b, Z, H, c]);
219
- return A.useEffect(() => {
219
+ return x.useEffect(() => {
220
220
  const C = a._options.shouldUnregister || o;
221
221
  a.register(t, {
222
222
  ...D.current.rules,
223
223
  ...W(D.current.disabled) ? { disabled: D.current.disabled } : {}
224
224
  });
225
225
  const J = (m, j) => {
226
- const p = y(a._fields, m);
226
+ const p = f(a._fields, m);
227
227
  p && p._f && (p._f.mount = j);
228
228
  };
229
229
  if (J(t, !0), C) {
230
- const m = U(y(a._options.defaultValues, t));
231
- F(a._defaultValues, t, m), M(y(a._formValues, t)) && F(a._formValues, t, m);
230
+ const m = U(f(a._options.defaultValues, t));
231
+ A(a._defaultValues, t, m), T(f(a._formValues, t)) && A(a._formValues, t, m);
232
232
  }
233
- return !u && a.register(t), () => {
234
- (u ? C && !a._state.action : C) ? a.unregister(t) : J(t, !1);
233
+ return !l && a.register(t), () => {
234
+ (l ? C && !a._state.action : C) ? a.unregister(t) : J(t, !1);
235
235
  };
236
- }, [t, a, u, o]), A.useEffect(() => {
236
+ }, [t, a, l, o]), x.useEffect(() => {
237
237
  a._setDisabledField({
238
238
  disabled: i,
239
239
  name: t
240
240
  });
241
- }, [i, t, a]), A.useMemo(() => ({
241
+ }, [i, t, a]), x.useMemo(() => ({
242
242
  field: k,
243
243
  formState: v,
244
244
  fieldState: S
@@ -270,21 +270,24 @@ var gt = (e, r, t, i, a) => r ? {
270
270
  }
271
271
  };
272
272
  }, Te = (e) => P(e) || !ct(e);
273
- function re(e, r) {
273
+ function re(e, r, t = /* @__PURE__ */ new WeakSet()) {
274
274
  if (Te(e) || Te(r))
275
275
  return e === r;
276
276
  if (ie(e) && ie(r))
277
277
  return e.getTime() === r.getTime();
278
- const t = Object.keys(e), i = Object.keys(r);
279
- if (t.length !== i.length)
278
+ const i = Object.keys(e), a = Object.keys(r);
279
+ if (i.length !== a.length)
280
280
  return !1;
281
- for (const a of t) {
282
- const o = e[a];
283
- if (!i.includes(a))
281
+ if (t.has(e) || t.has(r))
282
+ return !0;
283
+ t.add(e), t.add(r);
284
+ for (const o of i) {
285
+ const l = e[o];
286
+ if (!a.includes(o))
284
287
  return !1;
285
- if (a !== "ref") {
286
- const u = r[a];
287
- if (ie(o) && ie(u) || L(o) && L(u) || Array.isArray(o) && Array.isArray(u) ? !re(o, u) : o !== u)
288
+ if (o !== "ref") {
289
+ const c = r[o];
290
+ if (ie(l) && ie(c) || L(l) && L(c) || Array.isArray(l) && Array.isArray(c) ? !re(l, c, t) : l !== c)
288
291
  return !1;
289
292
  }
290
293
  }
@@ -300,18 +303,18 @@ function Bt(e, r) {
300
303
  const t = r.slice(0, -1).length;
301
304
  let i = 0;
302
305
  for (; i < t; )
303
- e = M(e) ? i++ : e[r[i++]];
306
+ e = T(e) ? i++ : e[r[i++]];
304
307
  return e;
305
308
  }
306
309
  function It(e) {
307
310
  for (const r in e)
308
- if (e.hasOwnProperty(r) && !M(e[r]))
311
+ if (e.hasOwnProperty(r) && !T(e[r]))
309
312
  return !1;
310
313
  return !0;
311
314
  }
312
- function R(e, r) {
315
+ function O(e, r) {
313
316
  const t = Array.isArray(r) ? r : Ae(r) ? [r] : Oe(r), i = t.length === 1 ? e : Bt(e, t), a = t.length - 1, o = t[a];
314
- return i && delete i[o], a !== 0 && (L(i) && I(i) || Array.isArray(i) && It(i)) && R(e, t.slice(0, -1)), e;
317
+ return i && delete i[o], a !== 0 && (L(i) && I(i) || Array.isArray(i) && It(i)) && O(e, t.slice(0, -1)), e;
315
318
  }
316
319
  var bt = (e) => {
317
320
  for (const r in e)
@@ -330,10 +333,10 @@ function mt(e, r, t) {
330
333
  const i = Array.isArray(e);
331
334
  if (L(e) || i)
332
335
  for (const a in e)
333
- Array.isArray(e[a]) || L(e[a]) && !bt(e[a]) ? M(r) || Te(t[a]) ? t[a] = Array.isArray(e[a]) ? Ve(e[a], []) : { ...Ve(e[a]) } : mt(e[a], P(r) ? {} : r[a], t[a]) : t[a] = !re(e[a], r[a]);
336
+ Array.isArray(e[a]) || L(e[a]) && !bt(e[a]) ? T(r) || Te(t[a]) ? t[a] = Array.isArray(e[a]) ? Ve(e[a], []) : { ...Ve(e[a]) } : mt(e[a], P(r) ? {} : r[a], t[a]) : t[a] = !re(e[a], r[a]);
334
337
  return t;
335
338
  }
336
- var ue = (e, r) => mt(e, r, Ve(r));
339
+ var le = (e, r) => mt(e, r, Ve(r));
337
340
  const Ze = {
338
341
  value: !1,
339
342
  isValid: !1
@@ -346,11 +349,11 @@ var _t = (e) => {
346
349
  }
347
350
  return e[0].checked && !e[0].disabled ? (
348
351
  // @ts-expect-error expected to work in the browser
349
- e[0].attributes && !M(e[0].attributes.value) ? M(e[0].value) || e[0].value === "" ? et : { value: e[0].value, isValid: !0 } : et
352
+ e[0].attributes && !T(e[0].attributes.value) ? T(e[0].value) || e[0].value === "" ? et : { value: e[0].value, isValid: !0 } : et
350
353
  ) : Ze;
351
354
  }
352
355
  return Ze;
353
- }, Vt = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: i }) => M(e) ? e : r ? e === "" ? NaN : e && +e : t && $(e) ? new Date(e) : i ? i(e) : e;
356
+ }, Vt = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: i }) => T(e) ? e : r ? e === "" ? NaN : e && +e : t && $(e) ? new Date(e) : i ? i(e) : e;
354
357
  const tt = {
355
358
  isValid: !1,
356
359
  value: null
@@ -361,13 +364,13 @@ var Ft = (e) => Array.isArray(e) ? e.reduce((r, t) => t && t.checked && !t.disab
361
364
  } : r, tt) : tt;
362
365
  function rt(e) {
363
366
  const r = e.ref;
364
- return Pe(r) ? r.files : pe(r) ? Ft(e.refs).value : vt(r) ? [...r.selectedOptions].map(({ value: t }) => t) : ye(r) ? _t(e.refs).value : Vt(M(r.value) ? e.ref.value : r.value, e);
367
+ return Pe(r) ? r.files : pe(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);
365
368
  }
366
369
  var Wt = (e, r, t, i) => {
367
370
  const a = {};
368
371
  for (const o of e) {
369
- const u = y(r, o);
370
- u && F(a, o, u._f);
372
+ const l = f(r, o);
373
+ l && A(a, o, l._f);
371
374
  }
372
375
  return {
373
376
  criteriaMode: t,
@@ -375,7 +378,7 @@ var Wt = (e, r, t, i) => {
375
378
  fields: a,
376
379
  shouldUseNativeValidation: i
377
380
  };
378
- }, Fe = (e) => e instanceof RegExp, ce = (e) => M(e) ? e : Fe(e) ? e.source : L(e) ? Fe(e.value) ? e.value.source : e.value : e, st = (e) => ({
381
+ }, Fe = (e) => e instanceof RegExp, ce = (e) => T(e) ? e : Fe(e) ? e.source : L(e) ? Fe(e.value) ? e.value.source : e.value : e, st = (e) => ({
379
382
  isOnSubmit: !e || e === Q.onSubmit,
380
383
  isOnBlur: e === Q.onBlur,
381
384
  isOnChange: e === Q.onChange,
@@ -386,13 +389,13 @@ const it = "AsyncFunction";
386
389
  var qt = (e) => !!e && !!e.validate && !!(z(e.validate) && e.validate.constructor.name === it || L(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === it)), Ht = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), nt = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((i) => e.startsWith(i) && /^\.\w+/.test(e.slice(i.length))));
387
390
  const fe = (e, r, t, i) => {
388
391
  for (const a of t || Object.keys(e)) {
389
- const o = y(e, a);
392
+ const o = f(e, a);
390
393
  if (o) {
391
- const { _f: u, ...c } = o;
392
- if (u) {
393
- if (u.refs && u.refs[0] && r(u.refs[0], a) && !i)
394
+ const { _f: l, ...c } = o;
395
+ if (l) {
396
+ if (l.refs && l.refs[0] && r(l.refs[0], a) && !i)
394
397
  return !0;
395
- if (u.ref && r(u.ref, u.name) && !i)
398
+ if (l.ref && r(l.ref, l.name) && !i)
396
399
  return !0;
397
400
  if (fe(c, r))
398
401
  break;
@@ -402,7 +405,7 @@ const fe = (e, r, t, i) => {
402
405
  }
403
406
  };
404
407
  function at(e, r, t) {
405
- const i = y(e, t);
408
+ const i = f(e, t);
406
409
  if (i || Ae(t))
407
410
  return {
408
411
  error: i,
@@ -410,8 +413,8 @@ function at(e, r, t) {
410
413
  };
411
414
  const a = t.split(".");
412
415
  for (; a.length; ) {
413
- const o = a.join("."), u = y(r, o), c = y(e, o);
414
- if (u && !Array.isArray(u) && t !== o)
416
+ const o = a.join("."), l = f(r, o), c = f(e, o);
417
+ if (l && !Array.isArray(l) && t !== o)
415
418
  return { name: t };
416
419
  if (c && c.type)
417
420
  return {
@@ -432,10 +435,10 @@ function at(e, r, t) {
432
435
  var jt = (e, r, t, i) => {
433
436
  t(e);
434
437
  const { name: a, ...o } = e;
435
- return I(o) || Object.keys(o).length >= Object.keys(r).length || Object.keys(o).find((u) => r[u] === (!i || Q.all));
436
- }, 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, zt = (e, r) => !Le(y(e, r)).length && R(e, r), Gt = (e, r, t) => {
437
- const i = de(y(e, t));
438
- return F(i, "root", r[t]), F(e, t, i), e;
438
+ return I(o) || Object.keys(o).length >= Object.keys(r).length || Object.keys(o).find((l) => r[l] === (!i || Q.all));
439
+ }, 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, zt = (e, r) => !Le(f(e, r)).length && O(e, r), Gt = (e, r, t) => {
440
+ const i = de(f(e, t));
441
+ return A(i, "root", r[t]), A(e, t, i), e;
439
442
  }, be = (e) => $(e);
440
443
  function ot(e, r, t = "validate") {
441
444
  if (be(e) || Array.isArray(e) && e.every(be) || W(e) && !e)
@@ -448,86 +451,86 @@ function ot(e, r, t = "validate") {
448
451
  var oe = (e) => L(e) && !Fe(e) ? e : {
449
452
  value: e,
450
453
  message: ""
451
- }, lt = async (e, r, t, i, a, o) => {
452
- const { ref: u, refs: c, required: v, maxLength: D, minLength: V, min: S, max: b, pattern: Z, validate: H, name: k, valueAsNumber: C, mount: J } = e._f, m = y(t, k);
454
+ }, ut = async (e, r, t, i, a, o) => {
455
+ const { ref: l, refs: c, required: v, maxLength: D, minLength: F, min: S, max: b, pattern: Z, validate: H, name: k, valueAsNumber: C, mount: J } = e._f, m = f(t, k);
453
456
  if (!J || r.has(k))
454
457
  return {};
455
- const j = c ? c[0] : u, p = (_) => {
458
+ const j = c ? c[0] : l, p = (_) => {
456
459
  a && j.reportValidity && (j.setCustomValidity(W(_) ? "" : _ || ""), j.reportValidity());
457
- }, O = {}, he = pe(u), ee = ye(u), xe = he || ee, K = (C || Pe(u)) && M(u.value) && M(m) || _e(u) && u.value === "" || m === "" || Array.isArray(m) && !m.length, se = gt.bind(null, k, i, O), G = (_, E, T, N = X.maxLength, B = X.minLength) => {
458
- const Y = _ ? E : T;
459
- O[k] = {
460
+ }, R = {}, he = pe(l), ee = ye(l), xe = he || ee, K = (C || Pe(l)) && T(l.value) && T(m) || _e(l) && l.value === "" || m === "" || Array.isArray(m) && !m.length, se = gt.bind(null, k, i, R), G = (_, w, M, N = X.maxLength, B = X.minLength) => {
461
+ const Y = _ ? w : M;
462
+ R[k] = {
460
463
  type: _ ? N : B,
461
464
  message: Y,
462
- ref: u,
465
+ ref: l,
463
466
  ...se(_ ? N : B, Y)
464
467
  };
465
468
  };
466
469
  if (o ? !Array.isArray(m) || !m.length : v && (!xe && (K || P(m)) || W(m) && !m || ee && !_t(c).isValid || he && !Ft(c).isValid)) {
467
- const { value: _, message: E } = be(v) ? { value: !!v, message: v } : oe(v);
468
- if (_ && (O[k] = {
470
+ const { value: _, message: w } = be(v) ? { value: !!v, message: v } : oe(v);
471
+ if (_ && (R[k] = {
469
472
  type: X.required,
470
- message: E,
473
+ message: w,
471
474
  ref: j,
472
- ...se(X.required, E)
475
+ ...se(X.required, w)
473
476
  }, !i))
474
- return p(E), O;
477
+ return p(w), R;
475
478
  }
476
479
  if (!K && (!P(S) || !P(b))) {
477
- let _, E;
478
- const T = oe(b), N = oe(S);
480
+ let _, w;
481
+ const M = oe(b), N = oe(S);
479
482
  if (!P(m) && !isNaN(m)) {
480
- const B = u.valueAsNumber || m && +m;
481
- P(T.value) || (_ = B > T.value), P(N.value) || (E = B < N.value);
483
+ const B = l.valueAsNumber || m && +m;
484
+ P(M.value) || (_ = B > M.value), P(N.value) || (w = B < N.value);
482
485
  } else {
483
- const B = u.valueAsDate || new Date(m), Y = (ge) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ge), le = u.type == "time", ae = u.type == "week";
484
- $(T.value) && m && (_ = le ? Y(m) > Y(T.value) : ae ? m > T.value : B > new Date(T.value)), $(N.value) && m && (E = le ? Y(m) < Y(N.value) : ae ? m < N.value : B < new Date(N.value));
486
+ const B = l.valueAsDate || new Date(m), Y = (ge) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ge), ue = l.type == "time", ae = l.type == "week";
487
+ $(M.value) && m && (_ = ue ? Y(m) > Y(M.value) : ae ? m > M.value : B > new Date(M.value)), $(N.value) && m && (w = ue ? Y(m) < Y(N.value) : ae ? m < N.value : B < new Date(N.value));
485
488
  }
486
- if ((_ || E) && (G(!!_, T.message, N.message, X.max, X.min), !i))
487
- return p(O[k].message), O;
489
+ if ((_ || w) && (G(!!_, M.message, N.message, X.max, X.min), !i))
490
+ return p(R[k].message), R;
488
491
  }
489
- if ((D || V) && !K && ($(m) || o && Array.isArray(m))) {
490
- const _ = oe(D), E = oe(V), T = !P(_.value) && m.length > +_.value, N = !P(E.value) && m.length < +E.value;
491
- if ((T || N) && (G(T, _.message, E.message), !i))
492
- return p(O[k].message), O;
492
+ if ((D || F) && !K && ($(m) || o && Array.isArray(m))) {
493
+ const _ = oe(D), w = oe(F), M = !P(_.value) && m.length > +_.value, N = !P(w.value) && m.length < +w.value;
494
+ if ((M || N) && (G(M, _.message, w.message), !i))
495
+ return p(R[k].message), R;
493
496
  }
494
497
  if (Z && !K && $(m)) {
495
- const { value: _, message: E } = oe(Z);
496
- if (Fe(_) && !m.match(_) && (O[k] = {
498
+ const { value: _, message: w } = oe(Z);
499
+ if (Fe(_) && !m.match(_) && (R[k] = {
497
500
  type: X.pattern,
498
- message: E,
499
- ref: u,
500
- ...se(X.pattern, E)
501
+ message: w,
502
+ ref: l,
503
+ ...se(X.pattern, w)
501
504
  }, !i))
502
- return p(E), O;
505
+ return p(w), R;
503
506
  }
504
507
  if (H) {
505
508
  if (z(H)) {
506
- const _ = await H(m, t), E = ot(_, j);
507
- if (E && (O[k] = {
508
- ...E,
509
- ...se(X.validate, E.message)
509
+ const _ = await H(m, t), w = ot(_, j);
510
+ if (w && (R[k] = {
511
+ ...w,
512
+ ...se(X.validate, w.message)
510
513
  }, !i))
511
- return p(E.message), O;
514
+ return p(w.message), R;
512
515
  } else if (L(H)) {
513
516
  let _ = {};
514
- for (const E in H) {
517
+ for (const w in H) {
515
518
  if (!I(_) && !i)
516
519
  break;
517
- const T = ot(await H[E](m, t), j, E);
518
- T && (_ = {
519
- ...T,
520
- ...se(E, T.message)
521
- }, p(T.message), i && (O[k] = _));
520
+ const M = ot(await H[w](m, t), j, w);
521
+ M && (_ = {
522
+ ...M,
523
+ ...se(w, M.message)
524
+ }, p(M.message), i && (R[k] = _));
522
525
  }
523
- if (!I(_) && (O[k] = {
526
+ if (!I(_) && (R[k] = {
524
527
  ref: j,
525
528
  ..._
526
529
  }, !i))
527
- return O;
530
+ return R;
528
531
  }
529
532
  }
530
- return p(!0), O;
533
+ return p(!0), R;
531
534
  };
532
535
  const Yt = {
533
536
  mode: Q.onSubmit,
@@ -555,7 +558,7 @@ function $t(e = {}) {
555
558
  disabled: r.disabled || !1
556
559
  };
557
560
  const i = {};
558
- let a = L(r.defaultValues) || L(r.values) ? U(r.defaultValues || r.values) || {} : {}, o = r.shouldUnregister ? {} : U(a), u = {
561
+ let a = L(r.defaultValues) || L(r.values) ? U(r.defaultValues || r.values) || {} : {}, o = r.shouldUnregister ? {} : U(a), l = {
559
562
  action: !1,
560
563
  mount: !1,
561
564
  watch: !1
@@ -566,7 +569,7 @@ function $t(e = {}) {
566
569
  array: /* @__PURE__ */ new Set(),
567
570
  watch: /* @__PURE__ */ new Set()
568
571
  }, v, D = 0;
569
- const V = {
572
+ const F = {
570
573
  isDirty: !1,
571
574
  dirtyFields: !1,
572
575
  validatingFields: !1,
@@ -576,7 +579,7 @@ function $t(e = {}) {
576
579
  errors: !1
577
580
  };
578
581
  let S = {
579
- ...V
582
+ ...F
580
583
  };
581
584
  const b = {
582
585
  array: Xe(),
@@ -584,34 +587,34 @@ function $t(e = {}) {
584
587
  }, Z = r.criteriaMode === Q.all, H = (s) => (n) => {
585
588
  clearTimeout(D), D = setTimeout(s, n);
586
589
  }, k = async (s) => {
587
- if (!r.disabled && (V.isValid || S.isValid || s)) {
590
+ if (!r.disabled && (F.isValid || S.isValid || s)) {
588
591
  const n = r.resolver ? I((await ee()).errors) : await K(i, !0);
589
592
  n !== t.isValid && b.state.next({
590
593
  isValid: n
591
594
  });
592
595
  }
593
596
  }, C = (s, n) => {
594
- !r.disabled && (V.isValidating || V.validatingFields || S.isValidating || S.validatingFields) && ((s || Array.from(c.mount)).forEach((l) => {
595
- l && (n ? F(t.validatingFields, l, n) : R(t.validatingFields, l));
597
+ !r.disabled && (F.isValidating || F.validatingFields || S.isValidating || S.validatingFields) && ((s || Array.from(c.mount)).forEach((u) => {
598
+ u && (n ? A(t.validatingFields, u, n) : O(t.validatingFields, u));
596
599
  }), b.state.next({
597
600
  validatingFields: t.validatingFields,
598
601
  isValidating: !I(t.validatingFields)
599
602
  }));
600
- }, J = (s, n = [], l, h, f = !0, d = !0) => {
601
- if (h && l && !r.disabled) {
602
- if (u.action = !0, d && Array.isArray(y(i, s))) {
603
- const g = l(y(i, s), h.argA, h.argB);
604
- f && F(i, s, g);
603
+ }, J = (s, n = [], u, h, y = !0, d = !0) => {
604
+ if (h && u && !r.disabled) {
605
+ if (l.action = !0, d && Array.isArray(f(i, s))) {
606
+ const g = u(f(i, s), h.argA, h.argB);
607
+ y && A(i, s, g);
605
608
  }
606
- if (d && Array.isArray(y(t.errors, s))) {
607
- const g = l(y(t.errors, s), h.argA, h.argB);
608
- f && F(t.errors, s, g), zt(t.errors, s);
609
+ if (d && Array.isArray(f(t.errors, s))) {
610
+ const g = u(f(t.errors, s), h.argA, h.argB);
611
+ y && A(t.errors, s, g), zt(t.errors, s);
609
612
  }
610
- if ((V.touchedFields || S.touchedFields) && d && Array.isArray(y(t.touchedFields, s))) {
611
- const g = l(y(t.touchedFields, s), h.argA, h.argB);
612
- f && F(t.touchedFields, s, g);
613
+ if ((F.touchedFields || S.touchedFields) && d && Array.isArray(f(t.touchedFields, s))) {
614
+ const g = u(f(t.touchedFields, s), h.argA, h.argB);
615
+ y && A(t.touchedFields, s, g);
613
616
  }
614
- (V.dirtyFields || S.dirtyFields) && (t.dirtyFields = ue(a, o)), b.state.next({
617
+ (F.dirtyFields || S.dirtyFields) && (t.dirtyFields = le(a, o)), b.state.next({
615
618
  name: s,
616
619
  isDirty: G(s, n),
617
620
  dirtyFields: t.dirtyFields,
@@ -619,9 +622,9 @@ function $t(e = {}) {
619
622
  isValid: t.isValid
620
623
  });
621
624
  } else
622
- F(o, s, n);
625
+ A(o, s, n);
623
626
  }, m = (s, n) => {
624
- F(t.errors, s, n), b.state.next({
627
+ A(t.errors, s, n), b.state.next({
625
628
  errors: t.errors
626
629
  });
627
630
  }, j = (s) => {
@@ -629,33 +632,33 @@ function $t(e = {}) {
629
632
  errors: t.errors,
630
633
  isValid: !1
631
634
  });
632
- }, p = (s, n, l, h) => {
633
- const f = y(i, s);
634
- if (f) {
635
- const d = y(o, s, M(l) ? y(a, s) : l);
636
- M(d) || h && h.defaultChecked || n ? F(o, s, n ? d : rt(f._f)) : T(s, d), u.mount && k();
635
+ }, p = (s, n, u, h) => {
636
+ const y = f(i, s);
637
+ if (y) {
638
+ const d = f(o, s, T(u) ? f(a, s) : u);
639
+ T(d) || h && h.defaultChecked || n ? A(o, s, n ? d : rt(y._f)) : M(s, d), l.mount && k();
637
640
  }
638
- }, O = (s, n, l, h, f) => {
641
+ }, R = (s, n, u, h, y) => {
639
642
  let d = !1, g = !1;
640
- const x = {
643
+ const V = {
641
644
  name: s
642
645
  };
643
646
  if (!r.disabled) {
644
- if (!l || h) {
645
- (V.isDirty || S.isDirty) && (g = t.isDirty, t.isDirty = x.isDirty = G(), d = g !== x.isDirty);
646
- const w = re(y(a, s), n);
647
- g = !!y(t.dirtyFields, s), w ? R(t.dirtyFields, s) : F(t.dirtyFields, s, !0), x.dirtyFields = t.dirtyFields, d = d || (V.dirtyFields || S.dirtyFields) && g !== !w;
647
+ if (!u || h) {
648
+ (F.isDirty || S.isDirty) && (g = t.isDirty, t.isDirty = V.isDirty = G(), d = g !== V.isDirty);
649
+ const E = re(f(a, s), n);
650
+ g = !!f(t.dirtyFields, s), E ? O(t.dirtyFields, s) : A(t.dirtyFields, s, !0), V.dirtyFields = t.dirtyFields, d = d || (F.dirtyFields || S.dirtyFields) && g !== !E;
648
651
  }
649
- if (l) {
650
- const w = y(t.touchedFields, s);
651
- w || (F(t.touchedFields, s, l), x.touchedFields = t.touchedFields, d = d || (V.touchedFields || S.touchedFields) && w !== l);
652
+ if (u) {
653
+ const E = f(t.touchedFields, s);
654
+ E || (A(t.touchedFields, s, u), V.touchedFields = t.touchedFields, d = d || (F.touchedFields || S.touchedFields) && E !== u);
652
655
  }
653
- d && f && b.state.next(x);
656
+ d && y && b.state.next(V);
654
657
  }
655
- return d ? x : {};
656
- }, he = (s, n, l, h) => {
657
- const f = y(t.errors, s), d = (V.isValid || S.isValid) && W(n) && t.isValid !== n;
658
- if (r.delayError && l ? (v = H(() => m(s, l)), v(r.delayError)) : (clearTimeout(D), v = null, l ? F(t.errors, s, l) : R(t.errors, s)), (l ? !re(f, l) : f) || !I(h) || d) {
658
+ return d ? V : {};
659
+ }, he = (s, n, u, h) => {
660
+ const y = f(t.errors, s), d = (F.isValid || S.isValid) && W(n) && t.isValid !== n;
661
+ if (r.delayError && u ? (v = H(() => m(s, u)), v(r.delayError)) : (clearTimeout(D), v = null, u ? A(t.errors, s, u) : O(t.errors, s)), (u ? !re(y, u) : y) || !I(h) || d) {
659
662
  const g = {
660
663
  ...h,
661
664
  ...d && W(n) ? { isValid: n } : {},
@@ -674,164 +677,164 @@ function $t(e = {}) {
674
677
  }, xe = async (s) => {
675
678
  const { errors: n } = await ee(s);
676
679
  if (s)
677
- for (const l of s) {
678
- const h = y(n, l);
679
- h ? F(t.errors, l, h) : R(t.errors, l);
680
+ for (const u of s) {
681
+ const h = f(n, u);
682
+ h ? A(t.errors, u, h) : O(t.errors, u);
680
683
  }
681
684
  else
682
685
  t.errors = n;
683
686
  return n;
684
- }, K = async (s, n, l = {
687
+ }, K = async (s, n, u = {
685
688
  valid: !0
686
689
  }) => {
687
690
  for (const h in s) {
688
- const f = s[h];
689
- if (f) {
690
- const { _f: d, ...g } = f;
691
+ const y = s[h];
692
+ if (y) {
693
+ const { _f: d, ...g } = y;
691
694
  if (d) {
692
- const x = c.array.has(d.name), w = f._f && qt(f._f);
693
- w && V.validatingFields && C([h], !0);
694
- const q = await lt(f, c.disabled, o, Z, r.shouldUseNativeValidation && !n, x);
695
- if (w && V.validatingFields && C([h]), q[d.name] && (l.valid = !1, n))
695
+ const V = c.array.has(d.name), E = y._f && qt(y._f);
696
+ E && F.validatingFields && C([h], !0);
697
+ const q = await ut(y, c.disabled, o, Z, r.shouldUseNativeValidation && !n, V);
698
+ if (E && F.validatingFields && C([h]), q[d.name] && (u.valid = !1, n))
696
699
  break;
697
- !n && (y(q, d.name) ? x ? Gt(t.errors, q, d.name) : F(t.errors, d.name, q[d.name]) : R(t.errors, d.name));
700
+ !n && (f(q, d.name) ? V ? Gt(t.errors, q, d.name) : A(t.errors, d.name, q[d.name]) : O(t.errors, d.name));
698
701
  }
699
- !I(g) && await K(g, n, l);
702
+ !I(g) && await K(g, n, u);
700
703
  }
701
704
  }
702
- return l.valid;
705
+ return u.valid;
703
706
  }, se = () => {
704
707
  for (const s of c.unMount) {
705
- const n = y(i, s);
706
- n && (n._f.refs ? n._f.refs.every((l) => !Ce(l)) : !Ce(n._f.ref)) && Ee(s);
708
+ const n = f(i, s);
709
+ n && (n._f.refs ? n._f.refs.every((u) => !Ce(u)) : !Ce(n._f.ref)) && we(s);
707
710
  }
708
711
  c.unMount = /* @__PURE__ */ new Set();
709
- }, G = (s, n) => !r.disabled && (s && n && F(o, s, n), !re(ge(), a)), _ = (s, n, l) => ht(s, c, {
710
- ...u.mount ? o : M(n) ? a : $(s) ? { [s]: n } : n
711
- }, l, n), E = (s) => Le(y(u.mount ? o : a, s, r.shouldUnregister ? y(a, s, []) : [])), T = (s, n, l = {}) => {
712
- const h = y(i, s);
713
- let f = n;
712
+ }, G = (s, n) => !r.disabled && (s && n && A(o, s, n), !re(ge(), a)), _ = (s, n, u) => ht(s, c, {
713
+ ...l.mount ? o : T(n) ? a : $(s) ? { [s]: n } : n
714
+ }, u, n), w = (s) => Le(f(l.mount ? o : a, s, r.shouldUnregister ? f(a, s, []) : [])), M = (s, n, u = {}) => {
715
+ const h = f(i, s);
716
+ let y = n;
714
717
  if (h) {
715
718
  const d = h._f;
716
- d && (!d.disabled && F(o, s, Vt(n, d)), f = _e(d.ref) && P(n) ? "" : n, vt(d.ref) ? [...d.ref.options].forEach((g) => g.selected = f.includes(g.value)) : d.refs ? ye(d.ref) ? d.refs.forEach((g) => {
717
- (!g.defaultChecked || !g.disabled) && (Array.isArray(f) ? g.checked = !!f.find((x) => x === g.value) : g.checked = f === g.value || !!f);
718
- }) : d.refs.forEach((g) => g.checked = g.value === f) : Pe(d.ref) ? d.ref.value = "" : (d.ref.value = f, d.ref.type || b.state.next({
719
+ d && (!d.disabled && A(o, s, Vt(n, d)), y = _e(d.ref) && P(n) ? "" : n, vt(d.ref) ? [...d.ref.options].forEach((g) => g.selected = y.includes(g.value)) : d.refs ? ye(d.ref) ? d.refs.forEach((g) => {
720
+ (!g.defaultChecked || !g.disabled) && (Array.isArray(y) ? g.checked = !!y.find((V) => V === g.value) : g.checked = y === g.value || !!y);
721
+ }) : d.refs.forEach((g) => g.checked = g.value === y) : Pe(d.ref) ? d.ref.value = "" : (d.ref.value = y, d.ref.type || b.state.next({
719
722
  name: s,
720
723
  values: U(o)
721
724
  })));
722
725
  }
723
- (l.shouldDirty || l.shouldTouch) && O(s, f, l.shouldTouch, l.shouldDirty, !0), l.shouldValidate && ae(s);
724
- }, N = (s, n, l) => {
726
+ (u.shouldDirty || u.shouldTouch) && R(s, y, u.shouldTouch, u.shouldDirty, !0), u.shouldValidate && ae(s);
727
+ }, N = (s, n, u) => {
725
728
  for (const h in n) {
726
729
  if (!n.hasOwnProperty(h))
727
730
  return;
728
- const f = n[h], d = s + "." + h, g = y(i, d);
729
- (c.array.has(s) || L(f) || g && !g._f) && !ie(f) ? N(d, f, l) : T(d, f, l);
731
+ const y = n[h], d = s + "." + h, g = f(i, d);
732
+ (c.array.has(s) || L(y) || g && !g._f) && !ie(y) ? N(d, y, u) : M(d, y, u);
730
733
  }
731
- }, B = (s, n, l = {}) => {
732
- const h = y(i, s), f = c.array.has(s), d = U(n);
733
- F(o, s, d), f ? (b.array.next({
734
+ }, B = (s, n, u = {}) => {
735
+ const h = f(i, s), y = c.array.has(s), d = U(n);
736
+ A(o, s, d), y ? (b.array.next({
734
737
  name: s,
735
738
  values: U(o)
736
- }), (V.isDirty || V.dirtyFields || S.isDirty || S.dirtyFields) && l.shouldDirty && b.state.next({
739
+ }), (F.isDirty || F.dirtyFields || S.isDirty || S.dirtyFields) && u.shouldDirty && b.state.next({
737
740
  name: s,
738
- dirtyFields: ue(a, o),
741
+ dirtyFields: le(a, o),
739
742
  isDirty: G(s, d)
740
- })) : h && !h._f && !P(d) ? N(s, d, l) : T(s, d, l), nt(s, c) && b.state.next({ ...t }), b.state.next({
741
- name: u.mount ? s : void 0,
743
+ })) : h && !h._f && !P(d) ? N(s, d, u) : M(s, d, u), nt(s, c) && b.state.next({ ...t }), b.state.next({
744
+ name: l.mount ? s : void 0,
742
745
  values: U(o)
743
746
  });
744
747
  }, Y = async (s) => {
745
- u.mount = !0;
748
+ l.mount = !0;
746
749
  const n = s.target;
747
- let l = n.name, h = !0;
748
- const f = y(i, l), d = (w) => {
749
- h = Number.isNaN(w) || ie(w) && isNaN(w.getTime()) || re(w, y(o, l, w));
750
- }, g = st(r.mode), x = st(r.reValidateMode);
751
- if (f) {
752
- let w, q;
753
- const ve = n.type ? rt(f._f) : dt(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, x, g), Se = nt(l, c, te);
754
- F(o, l, ve), te ? (f._f.onBlur && f._f.onBlur(s), v && v(0)) : f._f.onChange && f._f.onChange(s);
755
- const ke = O(l, ve, te), Mt = !I(ke) || Se;
750
+ let u = n.name, h = !0;
751
+ const y = f(i, u), d = (E) => {
752
+ h = Number.isNaN(E) || ie(E) && isNaN(E.getTime()) || re(E, f(o, u, E));
753
+ }, g = st(r.mode), V = st(r.reValidateMode);
754
+ if (y) {
755
+ let E, q;
756
+ const ve = n.type ? rt(y._f) : dt(s), te = s.type === me.BLUR || s.type === me.FOCUS_OUT, Tt = !Ht(y._f) && !r.resolver && !f(t.errors, u) && !y._f.deps || Qt(te, f(t.touchedFields, u), t.isSubmitted, V, g), Se = nt(u, c, te);
757
+ A(o, u, ve), te ? (y._f.onBlur && y._f.onBlur(s), v && v(0)) : y._f.onChange && y._f.onChange(s);
758
+ const ke = R(u, ve, te), Mt = !I(ke) || Se;
756
759
  if (!te && b.state.next({
757
- name: l,
760
+ name: u,
758
761
  type: s.type,
759
762
  values: U(o)
760
763
  }), Tt)
761
- return (V.isValid || S.isValid) && (r.mode === "onBlur" ? te && k() : te || k()), Mt && b.state.next({ name: l, ...Se ? {} : ke });
764
+ return (F.isValid || S.isValid) && (r.mode === "onBlur" ? te && k() : te || k()), Mt && b.state.next({ name: u, ...Se ? {} : ke });
762
765
  if (!te && Se && b.state.next({ ...t }), r.resolver) {
763
- const { errors: ze } = await ee([l]);
766
+ const { errors: ze } = await ee([u]);
764
767
  if (d(ve), h) {
765
- const Lt = at(t.errors, i, l), Ge = at(ze, i, Lt.name || l);
766
- w = Ge.error, l = Ge.name, q = I(ze);
768
+ const Lt = at(t.errors, i, u), Ge = at(ze, i, Lt.name || u);
769
+ E = Ge.error, u = Ge.name, q = I(ze);
767
770
  }
768
771
  } else
769
- C([l], !0), w = (await lt(f, c.disabled, o, Z, r.shouldUseNativeValidation))[l], C([l]), d(ve), h && (w ? q = !1 : (V.isValid || S.isValid) && (q = await K(i, !0)));
770
- h && (f._f.deps && ae(f._f.deps), he(l, q, w, ke));
772
+ C([u], !0), E = (await ut(y, c.disabled, o, Z, r.shouldUseNativeValidation))[u], C([u]), d(ve), h && (E ? q = !1 : (F.isValid || S.isValid) && (q = await K(i, !0)));
773
+ h && (y._f.deps && ae(y._f.deps), he(u, q, E, ke));
771
774
  }
772
- }, le = (s, n) => {
773
- if (y(t.errors, n) && s.focus)
775
+ }, ue = (s, n) => {
776
+ if (f(t.errors, n) && s.focus)
774
777
  return s.focus(), 1;
775
778
  }, ae = async (s, n = {}) => {
776
- let l, h;
777
- const f = de(s);
779
+ let u, h;
780
+ const y = de(s);
778
781
  if (r.resolver) {
779
- const d = await xe(M(s) ? s : f);
780
- l = I(d), h = s ? !f.some((g) => y(d, g)) : l;
781
- } else s ? (h = (await Promise.all(f.map(async (d) => {
782
- const g = y(i, d);
782
+ const d = await xe(T(s) ? s : y);
783
+ u = I(d), h = s ? !y.some((g) => f(d, g)) : u;
784
+ } else s ? (h = (await Promise.all(y.map(async (d) => {
785
+ const g = f(i, d);
783
786
  return await K(g && g._f ? { [d]: g } : g);
784
- }))).every(Boolean), !(!h && !t.isValid) && k()) : h = l = await K(i);
787
+ }))).every(Boolean), !(!h && !t.isValid) && k()) : h = u = await K(i);
785
788
  return b.state.next({
786
- ...!$(s) || (V.isValid || S.isValid) && l !== t.isValid ? {} : { name: s },
787
- ...r.resolver || !s ? { isValid: l } : {},
789
+ ...!$(s) || (F.isValid || S.isValid) && u !== t.isValid ? {} : { name: s },
790
+ ...r.resolver || !s ? { isValid: u } : {},
788
791
  errors: t.errors
789
- }), n.shouldFocus && !h && fe(i, le, s ? f : c.mount), h;
792
+ }), n.shouldFocus && !h && fe(i, ue, s ? y : c.mount), h;
790
793
  }, ge = (s) => {
791
794
  const n = {
792
- ...u.mount ? o : a
795
+ ...l.mount ? o : a
793
796
  };
794
- return M(s) ? n : $(s) ? y(n, s) : s.map((l) => y(n, l));
797
+ return T(s) ? n : $(s) ? f(n, s) : s.map((u) => f(n, u));
795
798
  }, Be = (s, n) => ({
796
- invalid: !!y((n || t).errors, s),
797
- isDirty: !!y((n || t).dirtyFields, s),
798
- error: y((n || t).errors, s),
799
- isValidating: !!y(t.validatingFields, s),
800
- isTouched: !!y((n || t).touchedFields, s)
799
+ invalid: !!f((n || t).errors, s),
800
+ isDirty: !!f((n || t).dirtyFields, s),
801
+ error: f((n || t).errors, s),
802
+ isValidating: !!f(t.validatingFields, s),
803
+ isTouched: !!f((n || t).touchedFields, s)
801
804
  }), xt = (s) => {
802
- s && de(s).forEach((n) => R(t.errors, n)), b.state.next({
805
+ s && de(s).forEach((n) => O(t.errors, n)), b.state.next({
803
806
  errors: s ? t.errors : {}
804
807
  });
805
- }, Ie = (s, n, l) => {
806
- const h = (y(i, s, { _f: {} })._f || {}).ref, f = y(t.errors, s) || {}, { ref: d, message: g, type: x, ...w } = f;
807
- F(t.errors, s, {
808
- ...w,
808
+ }, Ie = (s, n, u) => {
809
+ const h = (f(i, s, { _f: {} })._f || {}).ref, y = f(t.errors, s) || {}, { ref: d, message: g, type: V, ...E } = y;
810
+ A(t.errors, s, {
811
+ ...E,
809
812
  ...n,
810
813
  ref: h
811
814
  }), b.state.next({
812
815
  name: s,
813
816
  errors: t.errors,
814
817
  isValid: !1
815
- }), l && l.shouldFocus && h && h.focus && h.focus();
816
- }, Et = (s, n) => z(s) ? b.state.subscribe({
817
- next: (l) => s(_(void 0, n), l)
818
+ }), u && u.shouldFocus && h && h.focus && h.focus();
819
+ }, wt = (s, n) => z(s) ? b.state.subscribe({
820
+ next: (u) => s(_(void 0, n), u)
818
821
  }) : _(s, n, !0), We = (s) => b.state.subscribe({
819
822
  next: (n) => {
820
- Kt(s.name, n.name, s.exact) && jt(n, s.formState || V, Ct, s.reRenderRoot) && s.callback({
823
+ Kt(s.name, n.name, s.exact) && jt(n, s.formState || F, Ct, s.reRenderRoot) && s.callback({
821
824
  values: { ...o },
822
825
  ...t,
823
826
  ...n
824
827
  });
825
828
  }
826
- }).unsubscribe, wt = (s) => (u.mount = !0, S = {
829
+ }).unsubscribe, Et = (s) => (l.mount = !0, S = {
827
830
  ...S,
828
831
  ...s.formState
829
832
  }, We({
830
833
  ...s,
831
834
  formState: S
832
- })), Ee = (s, n = {}) => {
833
- for (const l of s ? de(s) : c.mount)
834
- c.mount.delete(l), c.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);
835
+ })), we = (s, n = {}) => {
836
+ for (const u of s ? de(s) : c.mount)
837
+ c.mount.delete(u), c.array.delete(u), n.keepValue || (O(i, u), O(o, u)), !n.keepError && O(t.errors, u), !n.keepDirty && O(t.dirtyFields, u), !n.keepTouched && O(t.touchedFields, u), !n.keepIsValidating && O(t.validatingFields, u), !r.shouldUnregister && !n.keepDefaultValue && O(a, u);
835
838
  b.state.next({
836
839
  values: U(o)
837
840
  }), b.state.next({
@@ -839,19 +842,19 @@ function $t(e = {}) {
839
842
  ...n.keepDirty ? { isDirty: G() } : {}
840
843
  }), !n.keepIsValid && k();
841
844
  }, qe = ({ disabled: s, name: n }) => {
842
- (W(s) && u.mount || s || c.disabled.has(n)) && (s ? c.disabled.add(n) : c.disabled.delete(n));
843
- }, we = (s, n = {}) => {
844
- let l = y(i, s);
845
+ (W(s) && l.mount || s || c.disabled.has(n)) && (s ? c.disabled.add(n) : c.disabled.delete(n));
846
+ }, Ee = (s, n = {}) => {
847
+ let u = f(i, s);
845
848
  const h = W(n.disabled) || W(r.disabled);
846
- return F(i, s, {
847
- ...l || {},
849
+ return A(i, s, {
850
+ ...u || {},
848
851
  _f: {
849
- ...l && l._f ? l._f : { ref: { name: s } },
852
+ ...u && u._f ? u._f : { ref: { name: s } },
850
853
  name: s,
851
854
  mount: !0,
852
855
  ...n
853
856
  }
854
- }), c.mount.add(s), l ? qe({
857
+ }), c.mount.add(s), u ? qe({
855
858
  disabled: W(n.disabled) ? n.disabled : r.disabled,
856
859
  name: s
857
860
  }) : p(s, !0, n.value), {
@@ -867,61 +870,61 @@ function $t(e = {}) {
867
870
  name: s,
868
871
  onChange: Y,
869
872
  onBlur: Y,
870
- ref: (f) => {
871
- if (f) {
872
- we(s, n), l = y(i, s);
873
- const d = M(f.value) && f.querySelectorAll && f.querySelectorAll("input,select,textarea")[0] || f, g = pt(d), x = l._f.refs || [];
874
- if (g ? x.find((w) => w === d) : d === l._f.ref)
873
+ ref: (y) => {
874
+ if (y) {
875
+ Ee(s, n), u = f(i, s);
876
+ const d = T(y.value) && y.querySelectorAll && y.querySelectorAll("input,select,textarea")[0] || y, g = pt(d), V = u._f.refs || [];
877
+ if (g ? V.find((E) => E === d) : d === u._f.ref)
875
878
  return;
876
- F(i, s, {
879
+ A(i, s, {
877
880
  _f: {
878
- ...l._f,
881
+ ...u._f,
879
882
  ...g ? {
880
883
  refs: [
881
- ...x.filter(Ce),
884
+ ...V.filter(Ce),
882
885
  d,
883
- ...Array.isArray(y(a, s)) ? [{}] : []
886
+ ...Array.isArray(f(a, s)) ? [{}] : []
884
887
  ],
885
888
  ref: { type: d.type, name: s }
886
889
  } : { ref: d }
887
890
  }
888
891
  }), p(s, !1, void 0, d);
889
892
  } else
890
- l = y(i, s, {}), l._f && (l._f.mount = !1), (r.shouldUnregister || n.shouldUnregister) && !(ft(c.array, s) && u.action) && c.unMount.add(s);
893
+ u = f(i, s, {}), u._f && (u._f.mount = !1), (r.shouldUnregister || n.shouldUnregister) && !(ft(c.array, s) && l.action) && c.unMount.add(s);
891
894
  }
892
895
  };
893
- }, De = () => r.shouldFocusError && fe(i, le, c.mount), Dt = (s) => {
894
- W(s) && (b.state.next({ disabled: s }), fe(i, (n, l) => {
895
- const h = y(i, l);
896
- h && (n.disabled = h._f.disabled || s, Array.isArray(h._f.refs) && h._f.refs.forEach((f) => {
897
- f.disabled = h._f.disabled || s;
896
+ }, De = () => r.shouldFocusError && fe(i, ue, c.mount), Dt = (s) => {
897
+ W(s) && (b.state.next({ disabled: s }), fe(i, (n, u) => {
898
+ const h = f(i, u);
899
+ h && (n.disabled = h._f.disabled || s, Array.isArray(h._f.refs) && h._f.refs.forEach((y) => {
900
+ y.disabled = h._f.disabled || s;
898
901
  }));
899
902
  }, 0, !1));
900
- }, He = (s, n) => async (l) => {
903
+ }, He = (s, n) => async (u) => {
901
904
  let h;
902
- l && (l.preventDefault && l.preventDefault(), l.persist && l.persist());
903
- let f = U(o);
905
+ u && (u.preventDefault && u.preventDefault(), u.persist && u.persist());
906
+ let y = U(o);
904
907
  if (b.state.next({
905
908
  isSubmitting: !0
906
909
  }), r.resolver) {
907
910
  const { errors: d, values: g } = await ee();
908
- t.errors = d, f = g;
911
+ t.errors = d, y = U(g);
909
912
  } else
910
913
  await K(i);
911
914
  if (c.disabled.size)
912
915
  for (const d of c.disabled)
913
- F(f, d, void 0);
914
- if (R(t.errors, "root"), I(t.errors)) {
916
+ O(y, d);
917
+ if (O(t.errors, "root"), I(t.errors)) {
915
918
  b.state.next({
916
919
  errors: {}
917
920
  });
918
921
  try {
919
- await s(f, l);
922
+ await s(y, u);
920
923
  } catch (d) {
921
924
  h = d;
922
925
  }
923
926
  } else
924
- n && await n({ ...t.errors }, l), De(), setTimeout(De);
927
+ n && await n({ ...t.errors }, u), De(), setTimeout(De);
925
928
  if (b.state.next({
926
929
  isSubmitted: !0,
927
930
  isSubmitting: !1,
@@ -931,25 +934,25 @@ function $t(e = {}) {
931
934
  }), h)
932
935
  throw h;
933
936
  }, St = (s, n = {}) => {
934
- y(i, s) && (M(n.defaultValue) ? B(s, U(y(a, s))) : (B(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 ? G(s, U(y(a, s))) : G()), n.keepError || (R(t.errors, s), V.isValid && k()), b.state.next({ ...t }));
937
+ f(i, s) && (T(n.defaultValue) ? B(s, U(f(a, s))) : (B(s, n.defaultValue), A(a, s, U(n.defaultValue))), n.keepTouched || O(t.touchedFields, s), n.keepDirty || (O(t.dirtyFields, s), t.isDirty = n.defaultValue ? G(s, U(f(a, s))) : G()), n.keepError || (O(t.errors, s), F.isValid && k()), b.state.next({ ...t }));
935
938
  }, je = (s, n = {}) => {
936
- const l = s ? U(s) : a, h = U(l), f = I(s), d = f ? a : h;
937
- if (n.keepDefaultValues || (a = l), !n.keepValues) {
939
+ const u = s ? U(s) : a, h = U(u), y = I(s), d = y ? a : h;
940
+ if (n.keepDefaultValues || (a = u), !n.keepValues) {
938
941
  if (n.keepDirtyValues) {
939
942
  const g = /* @__PURE__ */ new Set([
940
943
  ...c.mount,
941
- ...Object.keys(ue(a, o))
944
+ ...Object.keys(le(a, o))
942
945
  ]);
943
- for (const x of Array.from(g))
944
- y(t.dirtyFields, x) ? F(d, x, y(o, x)) : B(x, y(d, x));
946
+ for (const V of Array.from(g))
947
+ f(t.dirtyFields, V) ? A(d, V, f(o, V)) : B(V, f(d, V));
945
948
  } else {
946
- if (Me && M(s))
949
+ if (Me && T(s))
947
950
  for (const g of c.mount) {
948
- const x = y(i, g);
949
- if (x && x._f) {
950
- const w = Array.isArray(x._f.refs) ? x._f.refs[0] : x._f.ref;
951
- if (_e(w)) {
952
- const q = w.closest("form");
951
+ const V = f(i, g);
952
+ if (V && V._f) {
953
+ const E = Array.isArray(V._f.refs) ? V._f.refs[0] : V._f.ref;
954
+ if (_e(E)) {
955
+ const q = E.closest("form");
953
956
  if (q) {
954
957
  q.reset();
955
958
  break;
@@ -957,8 +960,10 @@ function $t(e = {}) {
957
960
  }
958
961
  }
959
962
  }
960
- for (const g of c.mount)
961
- B(g, y(d, g));
963
+ for (const g of c.mount) {
964
+ const V = f(d, g, f(a, g));
965
+ T(V) || (A(d, g, V), B(g, f(d, g)));
966
+ }
962
967
  }
963
968
  o = U(d), b.array.next({
964
969
  values: { ...d }
@@ -974,21 +979,21 @@ function $t(e = {}) {
974
979
  watch: /* @__PURE__ */ new Set(),
975
980
  watchAll: !1,
976
981
  focus: ""
977
- }, u.mount = !V.isValid || !!n.keepIsValid || !!n.keepDirtyValues, u.watch = !!r.shouldUnregister, b.state.next({
982
+ }, l.mount = !F.isValid || !!n.keepIsValid || !!n.keepDirtyValues, l.watch = !!r.shouldUnregister, b.state.next({
978
983
  submitCount: n.keepSubmitCount ? t.submitCount : 0,
979
- isDirty: f ? !1 : n.keepDirty ? t.isDirty : !!(n.keepDefaultValues && !re(s, a)),
984
+ isDirty: y ? !1 : n.keepDirty ? t.isDirty : !!(n.keepDefaultValues && !re(s, a)),
980
985
  isSubmitted: n.keepIsSubmitted ? t.isSubmitted : !1,
981
- dirtyFields: f ? {} : n.keepDirtyValues ? n.keepDefaultValues && o ? ue(a, o) : t.dirtyFields : n.keepDefaultValues && s ? ue(a, s) : n.keepDirty ? t.dirtyFields : {},
986
+ dirtyFields: y ? {} : n.keepDirtyValues ? n.keepDefaultValues && o ? le(a, o) : t.dirtyFields : n.keepDefaultValues && s ? le(a, s) : n.keepDirty ? t.dirtyFields : {},
982
987
  touchedFields: n.keepTouched ? t.touchedFields : {},
983
988
  errors: n.keepErrors ? t.errors : {},
984
989
  isSubmitSuccessful: n.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
985
990
  isSubmitting: !1
986
991
  });
987
992
  }, Ke = (s, n) => je(z(s) ? s(o) : s, n), kt = (s, n = {}) => {
988
- const l = y(i, s), h = l && l._f;
993
+ const u = f(i, s), h = u && u._f;
989
994
  if (h) {
990
- const f = h.refs ? h.refs[0] : h.ref;
991
- f.focus && (f.focus(), n.shouldSelect && z(f.select) && f.select());
995
+ const y = h.refs ? h.refs[0] : h.ref;
996
+ y.focus && (y.focus(), n.shouldSelect && z(y.select) && y.select());
992
997
  }
993
998
  }, Ct = (s) => {
994
999
  t = {
@@ -997,8 +1002,8 @@ function $t(e = {}) {
997
1002
  };
998
1003
  }, Qe = {
999
1004
  control: {
1000
- register: we,
1001
- unregister: Ee,
1005
+ register: Ee,
1006
+ unregister: we,
1002
1007
  getFieldState: Be,
1003
1008
  handleSubmit: He,
1004
1009
  setError: Ie,
@@ -1011,7 +1016,7 @@ function $t(e = {}) {
1011
1016
  _setFieldArray: J,
1012
1017
  _setDisabledField: qe,
1013
1018
  _setErrors: j,
1014
- _getFieldArray: E,
1019
+ _getFieldArray: w,
1015
1020
  _reset: je,
1016
1021
  _resetDefaultValues: () => z(r.defaultValues) && r.defaultValues().then((s) => {
1017
1022
  Ke(s, r.resetOptions), b.state.next({
@@ -1021,7 +1026,7 @@ function $t(e = {}) {
1021
1026
  _removeUnmounted: se,
1022
1027
  _disableForm: Dt,
1023
1028
  _subjects: b,
1024
- _proxyFormState: V,
1029
+ _proxyFormState: F,
1025
1030
  get _fields() {
1026
1031
  return i;
1027
1032
  },
@@ -1029,10 +1034,10 @@ function $t(e = {}) {
1029
1034
  return o;
1030
1035
  },
1031
1036
  get _state() {
1032
- return u;
1037
+ return l;
1033
1038
  },
1034
1039
  set _state(s) {
1035
- u = s;
1040
+ l = s;
1036
1041
  },
1037
1042
  get _defaultValues() {
1038
1043
  return a;
@@ -1056,17 +1061,17 @@ function $t(e = {}) {
1056
1061
  };
1057
1062
  }
1058
1063
  },
1059
- subscribe: wt,
1064
+ subscribe: Et,
1060
1065
  trigger: ae,
1061
- register: we,
1066
+ register: Ee,
1062
1067
  handleSubmit: He,
1063
- watch: Et,
1068
+ watch: wt,
1064
1069
  setValue: B,
1065
1070
  getValues: ge,
1066
1071
  reset: Ke,
1067
1072
  resetField: St,
1068
1073
  clearErrors: xt,
1069
- unregister: Ee,
1074
+ unregister: we,
1070
1075
  setError: Ie,
1071
1076
  setFocus: kt,
1072
1077
  getFieldState: Be
@@ -1077,7 +1082,7 @@ function $t(e = {}) {
1077
1082
  };
1078
1083
  }
1079
1084
  function Jt(e = {}) {
1080
- const r = A.useRef(void 0), t = A.useRef(void 0), [i, a] = A.useState({
1085
+ const r = x.useRef(void 0), t = x.useRef(void 0), [i, a] = x.useState({
1081
1086
  isDirty: !1,
1082
1087
  isValidating: !1,
1083
1088
  isLoading: z(e.defaultValues),
@@ -1101,7 +1106,7 @@ function Jt(e = {}) {
1101
1106
  formState: i
1102
1107
  }, e.defaultValues && !z(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
1103
1108
  else {
1104
- const { formControl: u, ...c } = $t(e);
1109
+ const { formControl: l, ...c } = $t(e);
1105
1110
  r.current = {
1106
1111
  ...c,
1107
1112
  formState: i
@@ -1109,7 +1114,7 @@ function Jt(e = {}) {
1109
1114
  }
1110
1115
  const o = r.current.control;
1111
1116
  return o._options = e, Ne(() => {
1112
- const u = o._subscribe({
1117
+ const l = o._subscribe({
1113
1118
  formState: o._proxyFormState,
1114
1119
  callback: () => a({ ...o._formState }),
1115
1120
  reRenderRoot: !0
@@ -1117,64 +1122,64 @@ function Jt(e = {}) {
1117
1122
  return a((c) => ({
1118
1123
  ...c,
1119
1124
  isReady: !0
1120
- })), o._formState.isReady = !0, u;
1121
- }, [o]), A.useEffect(() => o._disableForm(e.disabled), [o, e.disabled]), A.useEffect(() => {
1125
+ })), o._formState.isReady = !0, l;
1126
+ }, [o]), x.useEffect(() => o._disableForm(e.disabled), [o, e.disabled]), x.useEffect(() => {
1122
1127
  e.mode && (o._options.mode = e.mode), e.reValidateMode && (o._options.reValidateMode = e.reValidateMode);
1123
- }, [o, e.mode, e.reValidateMode]), A.useEffect(() => {
1128
+ }, [o, e.mode, e.reValidateMode]), x.useEffect(() => {
1124
1129
  e.errors && (o._setErrors(e.errors), o._focusError());
1125
- }, [o, e.errors]), A.useEffect(() => {
1130
+ }, [o, e.errors]), x.useEffect(() => {
1126
1131
  e.shouldUnregister && o._subjects.state.next({
1127
1132
  values: o._getWatch()
1128
1133
  });
1129
- }, [o, e.shouldUnregister]), A.useEffect(() => {
1134
+ }, [o, e.shouldUnregister]), x.useEffect(() => {
1130
1135
  if (o._proxyFormState.isDirty) {
1131
- const u = o._getDirty();
1132
- u !== i.isDirty && o._subjects.state.next({
1133
- isDirty: u
1136
+ const l = o._getDirty();
1137
+ l !== i.isDirty && o._subjects.state.next({
1138
+ isDirty: l
1134
1139
  });
1135
1140
  }
1136
- }, [o, i.isDirty]), A.useEffect(() => {
1137
- e.values && !re(e.values, t.current) ? (o._reset(e.values, o._options.resetOptions), t.current = e.values, a((u) => ({ ...u }))) : o._resetDefaultValues();
1138
- }, [o, e.values]), A.useEffect(() => {
1141
+ }, [o, i.isDirty]), x.useEffect(() => {
1142
+ e.values && !re(e.values, t.current) ? (o._reset(e.values, o._options.resetOptions), t.current = e.values, a((l) => ({ ...l }))) : o._resetDefaultValues();
1143
+ }, [o, e.values]), x.useEffect(() => {
1139
1144
  o._state.mount || (o._setValid(), o._state.mount = !0), o._state.watch && (o._state.watch = !1, o._subjects.state.next({ ...o._formState })), o._removeUnmounted();
1140
1145
  }), r.current.formState = yt(i, o), r.current;
1141
1146
  }
1142
- const ut = (e, r, t) => {
1147
+ const lt = (e, r, t) => {
1143
1148
  if (e && "reportValidity" in e) {
1144
- const i = y(t, r);
1149
+ const i = f(t, r);
1145
1150
  e.setCustomValidity(i && i.message || ""), e.reportValidity();
1146
1151
  }
1147
1152
  }, At = (e, r) => {
1148
1153
  for (const t in r.fields) {
1149
1154
  const i = r.fields[t];
1150
- i && i.ref && "reportValidity" in i.ref ? ut(i.ref, t, e) : i.refs && i.refs.forEach((a) => ut(a, t, e));
1155
+ i && i.ref && "reportValidity" in i.ref ? lt(i.ref, t, e) : i.refs && i.refs.forEach((a) => lt(a, t, e));
1151
1156
  }
1152
1157
  }, Xt = (e, r) => {
1153
1158
  r.shouldUseNativeValidation && At(e, r);
1154
1159
  const t = {};
1155
1160
  for (const i in e) {
1156
- const a = y(r.fields, i), o = Object.assign(e[i] || {}, { ref: a && a.ref });
1161
+ const a = f(r.fields, i), o = Object.assign(e[i] || {}, { ref: a && a.ref });
1157
1162
  if (Zt(r.names || Object.keys(e), i)) {
1158
- const u = Object.assign({}, y(t, i));
1159
- F(u, "root", o), F(t, i, u);
1160
- } else F(t, i, o);
1163
+ const l = Object.assign({}, f(t, i));
1164
+ A(l, "root", o), A(t, i, l);
1165
+ } else A(t, i, o);
1161
1166
  }
1162
1167
  return t;
1163
1168
  }, Zt = (e, r) => e.some((t) => t.startsWith(r + "."));
1164
1169
  var er = function(e, r) {
1165
1170
  for (var t = {}; e.length; ) {
1166
- var i = e[0], a = i.code, o = i.message, u = i.path.join(".");
1167
- if (!t[u]) if ("unionErrors" in i) {
1171
+ var i = e[0], a = i.code, o = i.message, l = i.path.join(".");
1172
+ if (!t[l]) if ("unionErrors" in i) {
1168
1173
  var c = i.unionErrors[0].errors[0];
1169
- t[u] = { message: c.message, type: c.code };
1170
- } else t[u] = { message: o, type: a };
1171
- if ("unionErrors" in i && i.unionErrors.forEach(function(V) {
1172
- return V.errors.forEach(function(S) {
1174
+ t[l] = { message: c.message, type: c.code };
1175
+ } else t[l] = { message: o, type: a };
1176
+ if ("unionErrors" in i && i.unionErrors.forEach(function(F) {
1177
+ return F.errors.forEach(function(S) {
1173
1178
  return e.push(S);
1174
1179
  });
1175
1180
  }), r) {
1176
- var v = t[u].types, D = v && v[i.code];
1177
- t[u] = gt(u, r, t, a, D ? [].concat(D, i.message) : i.message);
1181
+ var v = t[l].types, D = v && v[i.code];
1182
+ t[l] = gt(l, r, t, a, D ? [].concat(D, i.message) : i.message);
1178
1183
  }
1179
1184
  e.shift();
1180
1185
  }
@@ -1182,7 +1187,7 @@ var er = function(e, r) {
1182
1187
  }, tr = function(e, r, t) {
1183
1188
  return t === void 0 && (t = {}), function(i, a, o) {
1184
1189
  try {
1185
- return Promise.resolve(function(u, c) {
1190
+ return Promise.resolve(function(l, c) {
1186
1191
  try {
1187
1192
  var v = Promise.resolve(e[t.mode === "sync" ? "parse" : "parseAsync"](i, r)).then(function(D) {
1188
1193
  return o.shouldUseNativeValidation && At({}, o), { errors: {}, values: t.raw ? i : D };
@@ -1191,14 +1196,14 @@ var er = function(e, r) {
1191
1196
  return c(D);
1192
1197
  }
1193
1198
  return v && v.then ? v.then(void 0, c) : v;
1194
- }(0, function(u) {
1199
+ }(0, function(l) {
1195
1200
  if (function(c) {
1196
1201
  return Array.isArray(c == null ? void 0 : c.errors);
1197
- }(u)) return { values: {}, errors: Xt(er(u.errors, !o.shouldUseNativeValidation && o.criteriaMode === "all"), o) };
1198
- throw u;
1202
+ }(l)) return { values: {}, errors: Xt(er(l.errors, !o.shouldUseNativeValidation && o.criteriaMode === "all"), o) };
1203
+ throw l;
1199
1204
  }));
1200
- } catch (u) {
1201
- return Promise.reject(u);
1205
+ } catch (l) {
1206
+ return Promise.reject(l);
1202
1207
  }
1203
1208
  };
1204
1209
  };
@@ -1217,8 +1222,8 @@ const dr = ({ schema: e, ...r }) => Jt({
1217
1222
  }, [e]), i;
1218
1223
  };
1219
1224
  export {
1220
- ur as F,
1221
- lr as a,
1225
+ lr as F,
1226
+ ur as a,
1222
1227
  dr as b,
1223
1228
  sr as c,
1224
1229
  rr as d,
@@ -1228,4 +1233,4 @@ export {
1228
1233
  cr as h,
1229
1234
  or as u
1230
1235
  };
1231
- //# sourceMappingURL=useDebounce-5MeprqTX.js.map
1236
+ //# sourceMappingURL=useDebounce-DqiN3mnG.js.map