react-simple-formkit 2.2.3 → 2.2.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,5 +1,5 @@
1
- import ye, { createContext as we, useContext as Fe, useEffect as de, useState as ae, useRef as P, useCallback as d, useMemo as le, useLayoutEffect as be } from "react";
2
- var ue = { exports: {} }, K = {};
1
+ import we, { createContext as Te, useContext as _e, useEffect as de, useState as ie, useRef as V, useCallback as d, useMemo as le, useLayoutEffect as be } from "react";
2
+ var ae = { exports: {} }, K = {};
3
3
  /**
4
4
  * @license React
5
5
  * react-jsx-runtime.production.js
@@ -10,26 +10,26 @@ var ue = { exports: {} }, K = {};
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
12
  var he;
13
- function Te() {
13
+ function ke() {
14
14
  if (he) return K;
15
15
  he = 1;
16
- var t = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
17
- function a(i, g, h) {
18
- var E = null;
19
- if (h !== void 0 && (E = "" + h), g.key !== void 0 && (E = "" + g.key), "key" in g) {
20
- h = {};
21
- for (var R in g)
22
- R !== "key" && (h[R] = g[R]);
23
- } else h = g;
24
- return g = h.ref, {
16
+ var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
17
+ function i(l, h, E) {
18
+ var g = null;
19
+ if (E !== void 0 && (g = "" + E), h.key !== void 0 && (g = "" + h.key), "key" in h) {
20
+ E = {};
21
+ for (var m in h)
22
+ m !== "key" && (E[m] = h[m]);
23
+ } else E = h;
24
+ return h = E.ref, {
25
25
  $$typeof: t,
26
- type: i,
27
- key: E,
28
- ref: g !== void 0 ? g : null,
29
- props: h
26
+ type: l,
27
+ key: g,
28
+ ref: h !== void 0 ? h : null,
29
+ props: E
30
30
  };
31
31
  }
32
- return K.Fragment = s, K.jsx = a, K.jsxs = a, K;
32
+ return K.Fragment = n, K.jsx = i, K.jsxs = i, K;
33
33
  }
34
34
  var ee = {};
35
35
  /**
@@ -41,125 +41,125 @@ var ee = {};
41
41
  * This source code is licensed under the MIT license found in the
42
42
  * LICENSE file in the root directory of this source tree.
43
43
  */
44
- var ge;
45
- function _e() {
46
- return ge || (ge = 1, process.env.NODE_ENV !== "production" && function() {
44
+ var Ee;
45
+ function Ae() {
46
+ return Ee || (Ee = 1, process.env.NODE_ENV !== "production" && function() {
47
47
  function t(e) {
48
48
  if (e == null) return null;
49
49
  if (typeof e == "function")
50
- return e.$$typeof === G ? null : e.displayName || e.name || null;
50
+ return e.$$typeof === $ ? null : e.displayName || e.name || null;
51
51
  if (typeof e == "string") return e;
52
52
  switch (e) {
53
- case f:
53
+ case y:
54
54
  return "Fragment";
55
- case N:
55
+ case x:
56
56
  return "Profiler";
57
- case O:
57
+ case C:
58
58
  return "StrictMode";
59
- case re:
59
+ case se:
60
60
  return "Suspense";
61
- case te:
61
+ case ne:
62
62
  return "SuspenseList";
63
- case j:
63
+ case G:
64
64
  return "Activity";
65
65
  }
66
66
  if (typeof e == "object")
67
67
  switch (typeof e.tag == "number" && console.error(
68
68
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
69
69
  ), e.$$typeof) {
70
- case b:
70
+ case o:
71
71
  return "Portal";
72
- case ie:
72
+ case z:
73
73
  return (e.displayName || "Context") + ".Provider";
74
- case M:
75
- return (e._context.displayName || "Context") + ".Consumer";
76
74
  case J:
77
- var u = e.render;
78
- return e = e.displayName, e || (e = u.displayName || u.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
79
- case ne:
80
- return u = e.displayName || null, u !== null ? u : t(e.type) || "Memo";
81
- case z:
82
- u = e._payload, e = e._init;
75
+ return (e._context.displayName || "Context") + ".Consumer";
76
+ case te:
77
+ var a = e.render;
78
+ return e = e.displayName, e || (e = a.displayName || a.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
79
+ case oe:
80
+ return a = e.displayName || null, a !== null ? a : t(e.type) || "Memo";
81
+ case P:
82
+ a = e._payload, e = e._init;
83
83
  try {
84
- return t(e(u));
84
+ return t(e(a));
85
85
  } catch {
86
86
  }
87
87
  }
88
88
  return null;
89
89
  }
90
- function s(e) {
90
+ function n(e) {
91
91
  return "" + e;
92
92
  }
93
- function a(e) {
93
+ function i(e) {
94
94
  try {
95
- s(e);
96
- var u = !1;
95
+ n(e);
96
+ var a = !1;
97
97
  } catch {
98
- u = !0;
98
+ a = !0;
99
99
  }
100
- if (u) {
101
- u = console;
102
- var v = u.error, w = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
103
- return v.call(
104
- u,
100
+ if (a) {
101
+ a = console;
102
+ var R = a.error, T = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
103
+ return R.call(
104
+ a,
105
105
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
106
- w
107
- ), s(e);
106
+ T
107
+ ), n(e);
108
108
  }
109
109
  }
110
- function i(e) {
111
- if (e === f) return "<>";
112
- if (typeof e == "object" && e !== null && e.$$typeof === z)
110
+ function l(e) {
111
+ if (e === y) return "<>";
112
+ if (typeof e == "object" && e !== null && e.$$typeof === P)
113
113
  return "<...>";
114
114
  try {
115
- var u = t(e);
116
- return u ? "<" + u + ">" : "<...>";
115
+ var a = t(e);
116
+ return a ? "<" + a + ">" : "<...>";
117
117
  } catch {
118
118
  return "<...>";
119
119
  }
120
120
  }
121
- function g() {
121
+ function h() {
122
122
  var e = W.A;
123
123
  return e === null ? null : e.getOwner();
124
124
  }
125
- function h() {
125
+ function E() {
126
126
  return Error("react-stack-top-frame");
127
127
  }
128
- function E(e) {
129
- if (Y.call(e, "key")) {
130
- var u = Object.getOwnPropertyDescriptor(e, "key").get;
131
- if (u && u.isReactWarning) return !1;
128
+ function g(e) {
129
+ if (M.call(e, "key")) {
130
+ var a = Object.getOwnPropertyDescriptor(e, "key").get;
131
+ if (a && a.isReactWarning) return !1;
132
132
  }
133
133
  return e.key !== void 0;
134
134
  }
135
- function R(e, u) {
136
- function v() {
135
+ function m(e, a) {
136
+ function R() {
137
137
  H || (H = !0, console.error(
138
138
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
139
- u
139
+ a
140
140
  ));
141
141
  }
142
- v.isReactWarning = !0, Object.defineProperty(e, "key", {
143
- get: v,
142
+ R.isReactWarning = !0, Object.defineProperty(e, "key", {
143
+ get: R,
144
144
  configurable: !0
145
145
  });
146
146
  }
147
- function p() {
147
+ function v() {
148
148
  var e = t(this.type);
149
149
  return X[e] || (X[e] = !0, console.error(
150
150
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
151
151
  )), e = this.props.ref, e !== void 0 ? e : null;
152
152
  }
153
- function _(e, u, v, w, C, A, I, L) {
154
- return v = A.ref, e = {
153
+ function p(e, a, R, T, j, A, I, L) {
154
+ return R = A.ref, e = {
155
155
  $$typeof: c,
156
156
  type: e,
157
- key: u,
157
+ key: a,
158
158
  props: A,
159
- _owner: C
160
- }, (v !== void 0 ? v : null) !== null ? Object.defineProperty(e, "ref", {
159
+ _owner: j
160
+ }, (R !== void 0 ? R : null) !== null ? Object.defineProperty(e, "ref", {
161
161
  enumerable: !1,
162
- get: p
162
+ get: v
163
163
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
164
164
  configurable: !1,
165
165
  enumerable: !1,
@@ -182,105 +182,105 @@ function _e() {
182
182
  value: L
183
183
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
184
184
  }
185
- function l(e, u, v, w, C, A, I, L) {
186
- var F = u.children;
187
- if (F !== void 0)
188
- if (w)
189
- if (D(F)) {
190
- for (w = 0; w < F.length; w++)
191
- m(F[w]);
192
- Object.freeze && Object.freeze(F);
185
+ function f(e, a, R, T, j, A, I, L) {
186
+ var _ = a.children;
187
+ if (_ !== void 0)
188
+ if (T)
189
+ if (Y(_)) {
190
+ for (T = 0; T < _.length; T++)
191
+ b(_[T]);
192
+ Object.freeze && Object.freeze(_);
193
193
  } else
194
194
  console.error(
195
195
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
196
196
  );
197
- else m(F);
198
- if (Y.call(u, "key")) {
199
- F = t(e);
200
- var V = Object.keys(u).filter(function(se) {
201
- return se !== "key";
197
+ else b(_);
198
+ if (M.call(a, "key")) {
199
+ _ = t(e);
200
+ var D = Object.keys(a).filter(function(ue) {
201
+ return ue !== "key";
202
202
  });
203
- w = 0 < V.length ? "{key: someKey, " + V.join(": ..., ") + ": ...}" : "{key: someKey}", Q[F + w] || (V = 0 < V.length ? "{" + V.join(": ..., ") + ": ...}" : "{}", console.error(
203
+ T = 0 < D.length ? "{key: someKey, " + D.join(": ..., ") + ": ...}" : "{key: someKey}", Q[_ + T] || (D = 0 < D.length ? "{" + D.join(": ..., ") + ": ...}" : "{}", console.error(
204
204
  `A props object containing a "key" prop is being spread into JSX:
205
205
  let props = %s;
206
206
  <%s {...props} />
207
207
  React keys must be passed directly to JSX without using spread:
208
208
  let props = %s;
209
209
  <%s key={someKey} {...props} />`,
210
- w,
211
- F,
212
- V,
213
- F
214
- ), Q[F + w] = !0);
210
+ T,
211
+ _,
212
+ D,
213
+ _
214
+ ), Q[_ + T] = !0);
215
215
  }
216
- if (F = null, v !== void 0 && (a(v), F = "" + v), E(u) && (a(u.key), F = "" + u.key), "key" in u) {
217
- v = {};
218
- for (var x in u)
219
- x !== "key" && (v[x] = u[x]);
220
- } else v = u;
221
- return F && R(
222
- v,
216
+ if (_ = null, R !== void 0 && (i(R), _ = "" + R), g(a) && (i(a.key), _ = "" + a.key), "key" in a) {
217
+ R = {};
218
+ for (var N in a)
219
+ N !== "key" && (R[N] = a[N]);
220
+ } else R = a;
221
+ return _ && m(
222
+ R,
223
223
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
224
- ), _(
224
+ ), p(
225
225
  e,
226
- F,
226
+ _,
227
227
  A,
228
- C,
229
- g(),
230
- v,
228
+ j,
229
+ h(),
230
+ R,
231
231
  I,
232
232
  L
233
233
  );
234
234
  }
235
- function m(e) {
235
+ function b(e) {
236
236
  typeof e == "object" && e !== null && e.$$typeof === c && e._store && (e._store.validated = 1);
237
237
  }
238
- var o = ye, c = Symbol.for("react.transitional.element"), b = Symbol.for("react.portal"), f = Symbol.for("react.fragment"), O = Symbol.for("react.strict_mode"), N = Symbol.for("react.profiler"), M = Symbol.for("react.consumer"), ie = Symbol.for("react.context"), J = Symbol.for("react.forward_ref"), re = Symbol.for("react.suspense"), te = Symbol.for("react.suspense_list"), ne = Symbol.for("react.memo"), z = Symbol.for("react.lazy"), j = Symbol.for("react.activity"), G = Symbol.for("react.client.reference"), W = o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Y = Object.prototype.hasOwnProperty, D = Array.isArray, $ = console.createTask ? console.createTask : function() {
238
+ var u = we, c = Symbol.for("react.transitional.element"), o = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), x = Symbol.for("react.profiler"), J = Symbol.for("react.consumer"), z = Symbol.for("react.context"), te = Symbol.for("react.forward_ref"), se = Symbol.for("react.suspense"), ne = Symbol.for("react.suspense_list"), oe = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), G = Symbol.for("react.activity"), $ = Symbol.for("react.client.reference"), W = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, Y = Array.isArray, B = console.createTask ? console.createTask : function() {
239
239
  return null;
240
240
  };
241
- o = {
241
+ u = {
242
242
  "react-stack-bottom-frame": function(e) {
243
243
  return e();
244
244
  }
245
245
  };
246
- var H, X = {}, Z = o["react-stack-bottom-frame"].bind(
247
- o,
248
- h
249
- )(), y = $(i(h)), Q = {};
250
- ee.Fragment = f, ee.jsx = function(e, u, v, w, C) {
246
+ var H, X = {}, Z = u["react-stack-bottom-frame"].bind(
247
+ u,
248
+ E
249
+ )(), w = B(l(E)), Q = {};
250
+ ee.Fragment = y, ee.jsx = function(e, a, R, T, j) {
251
251
  var A = 1e4 > W.recentlyCreatedOwnerStacks++;
252
- return l(
252
+ return f(
253
253
  e,
254
- u,
255
- v,
254
+ a,
255
+ R,
256
256
  !1,
257
- w,
258
- C,
257
+ T,
258
+ j,
259
259
  A ? Error("react-stack-top-frame") : Z,
260
- A ? $(i(e)) : y
260
+ A ? B(l(e)) : w
261
261
  );
262
- }, ee.jsxs = function(e, u, v, w, C) {
262
+ }, ee.jsxs = function(e, a, R, T, j) {
263
263
  var A = 1e4 > W.recentlyCreatedOwnerStacks++;
264
- return l(
264
+ return f(
265
265
  e,
266
- u,
267
- v,
266
+ a,
267
+ R,
268
268
  !0,
269
- w,
270
- C,
269
+ T,
270
+ j,
271
271
  A ? Error("react-stack-top-frame") : Z,
272
- A ? $(i(e)) : y
272
+ A ? B(l(e)) : w
273
273
  );
274
274
  };
275
275
  }()), ee;
276
276
  }
277
- var Ee;
278
- function ke() {
279
- return Ee || (Ee = 1, process.env.NODE_ENV === "production" ? ue.exports = Te() : ue.exports = _e()), ue.exports;
277
+ var ge;
278
+ function Oe() {
279
+ return ge || (ge = 1, process.env.NODE_ENV === "production" ? ae.exports = ke() : ae.exports = Ae()), ae.exports;
280
280
  }
281
- var me = ke();
281
+ var me = Oe();
282
282
  const S = () => {
283
- }, Re = we({
283
+ }, pe = Te({
284
284
  ref: null,
285
285
  watch: S,
286
286
  actions: {
@@ -308,94 +308,94 @@ const S = () => {
308
308
  loadFormValues: S,
309
309
  getWatchValue: S,
310
310
  channels: {}
311
- }), pe = () => Fe(Re), Ie = ({
311
+ }), ye = () => _e(pe), Le = ({
312
312
  id: t,
313
- control: s,
314
- method: a,
315
- action: i,
316
- children: g,
317
- onSubmit: h = () => {
313
+ control: n,
314
+ method: i,
315
+ action: l,
316
+ children: h,
317
+ onSubmit: E = () => {
318
318
  },
319
- onInput: E = () => {
319
+ onInput: g = () => {
320
320
  },
321
- onChange: R = () => {
321
+ onChange: m = () => {
322
322
  },
323
- onBlur: p = () => {
323
+ onBlur: v = () => {
324
324
  },
325
- onReset: _ = () => {
325
+ onReset: p = () => {
326
326
  },
327
- numberFields: l = [],
328
- className: m,
329
- ...o
327
+ numberFields: f = [],
328
+ className: b,
329
+ ...u
330
330
  }) => (de(() => {
331
- const c = s.channels.subscribe("onChange", R), b = s.channels.subscribe("onBlur", p);
331
+ const c = n.channels.subscribe("onChange", m), o = n.channels.subscribe("onBlur", v);
332
332
  return () => {
333
- c(), b();
333
+ c(), o();
334
334
  };
335
- }, [s.lastReloadedAt]), /* @__PURE__ */ me.jsx(Re.Provider, { value: s, children: /* @__PURE__ */ me.jsx(
335
+ }, [n.lastReloadedAt]), /* @__PURE__ */ me.jsx(pe.Provider, { value: n, children: /* @__PURE__ */ me.jsx(
336
336
  "form",
337
337
  {
338
338
  id: t,
339
- ref: s.ref,
340
- action: i,
341
- method: a,
342
- className: m,
343
- onInput: E,
339
+ ref: n.ref,
340
+ action: l,
341
+ method: i,
342
+ className: b,
343
+ onInput: g,
344
344
  onSubmit: (c) => {
345
- a || c.preventDefault();
346
- const b = s.loadFormValues();
347
- h(b);
345
+ i || c.preventDefault();
346
+ const o = n.loadFormValues();
347
+ E(o);
348
348
  },
349
349
  onChange: (c) => {
350
- const b = c.target.name;
351
- !b || s.actions.getControlledFields().has(b) || s.actions.setValue(b, c.target.value);
350
+ const o = c.target.name;
351
+ !o || n.actions.getControlledFields().has(o) || n.actions.setValue(o, c.target.value);
352
352
  },
353
353
  onBlur: (c) => {
354
- const b = c.target.name;
355
- if (!b || s.actions.getControlledFields().has(b)) return;
356
- const f = c.target.value;
357
- s.channels.publish("onBlur", b, f, s.actions.getValues());
354
+ const o = c.target.name;
355
+ if (!o || n.actions.getControlledFields().has(o)) return;
356
+ const y = c.target.value;
357
+ n.channels.publish("onBlur", o, y, n.actions.getValues());
358
358
  },
359
359
  onReset: (c) => {
360
- s.actions.reset(), _(c);
360
+ n.actions.reset(), p(c);
361
361
  },
362
- ...o,
363
- children: g
362
+ ...u,
363
+ children: h
364
364
  },
365
- s.lastReloadedAt
366
- ) })), Ae = ({ control: t, name: s, compute: a }) => {
367
- const { getWatchValue: i, registerHookWatcher: g } = t || pe(), h = i({ name: s, compute: a }), [E, R] = ae(h);
365
+ n.lastReloadedAt
366
+ ) })), Ce = ({ control: t, name: n, compute: i }) => {
367
+ const { getWatchValue: l, registerHookWatcher: h } = t || ye(), E = l({ name: n, compute: i }), [g, m] = ie(E);
368
368
  return de(() => {
369
- const p = g({ name: s, compute: a, value: E, setValue: R });
370
- return () => p.forEach((_) => _());
371
- }, []), E;
372
- }, Oe = ({ name: t, defaultValue: s }) => {
373
- const { actions: a, registerController: i, channels: g } = pe(), h = P(), E = a.getDefaultValues()[t] || s || "", [R, p] = ae(E), _ = Ae({ name: `fieldStates.${t}` }), l = d(
374
- (o, { shouldDirty: c = !0, shouldOnChange: b = !0 } = {}) => {
375
- var O, N;
376
- let f = o;
377
- (O = o == null ? void 0 : o.target) != null && O.value && (f = o.target.value), (N = o == null ? void 0 : o.target) != null && N.checked && (f = o.target.checked + ""), p(f), a.setValue(t, f, { shouldDirty: c, shouldOnChange: b });
369
+ const v = h({ name: n, compute: i, value: g, setValue: m });
370
+ return () => v.forEach((p) => p());
371
+ }, []), g;
372
+ }, Pe = ({ name: t, defaultValue: n }) => {
373
+ const { actions: i, registerController: l, channels: h } = ye(), E = V(), g = i.getDefaultValues()[t] || n || "", [m, v] = ie(g), p = Ce({ name: `fieldStates.${t}` }), f = d(
374
+ (u, { shouldDirty: c = !0, shouldOnChange: o = !0 } = {}) => {
375
+ var C, x;
376
+ let y = u;
377
+ (C = u == null ? void 0 : u.target) != null && C.value && (y = u.target.value), (x = u == null ? void 0 : u.target) != null && x.checked && (y = u.target.checked + ""), v(y), i.setValue(t, y, { shouldDirty: c, shouldOnChange: o });
378
378
  },
379
- [a.setValue]
380
- ), m = d((o) => {
381
- const c = a.getValues(), b = o ?? c[t];
382
- g.publish("onBlur", t, b, c);
379
+ [i.setValue]
380
+ ), b = d((u) => {
381
+ const c = i.getValues(), o = u ?? c[t];
382
+ h.publish("onBlur", t, o, c);
383
383
  }, []);
384
- return de(() => i(t, p), []), { ref: h, name: t, defaultValue: E, value: R, onChange: l, onBlur: m, fieldState: _ };
385
- }, Le = ({
384
+ return de(() => l(t, v), []), { ref: E, name: t, defaultValue: g, value: m, onChange: f, onBlur: b, fieldState: p };
385
+ }, Ue = ({
386
386
  name: t,
387
- defaultValue: s,
388
- render: a = ({ ref: i, name: g, defaultValue: h, value: E, onChange: R, onBlur: p, fieldState: _ }) => null
387
+ defaultValue: n,
388
+ render: i = ({ ref: l, name: h, defaultValue: E, value: g, onChange: m, onBlur: v, fieldState: p }) => null
389
389
  }) => {
390
- const i = Oe({ name: t, defaultValue: s });
391
- return a(i);
392
- }, Ce = ["errors", "fieldStates", "formState"], ce = (t = {}, s = "") => s.split(".").reduce((a, i) => a && a[i] !== void 0 ? a[i] : void 0, t), Pe = (t = {}, s = "", a) => {
393
- let i = t;
394
- const g = s.split(".");
395
- return g.forEach((h, E) => {
396
- E < g.length - 1 && (i[h] || (i[h] = {}), E === g.length - 2 && (i[h] = { ...i[h] }), i = i[h]), i[h] = a;
390
+ const l = Pe({ name: t, defaultValue: n });
391
+ return i(l);
392
+ }, je = ["errors", "fieldStates", "formState"], re = (t = {}, n = "") => n.split(".").reduce((i, l) => i && i[l] !== void 0 ? i[l] : void 0, t), ve = (t = {}, n = "", i) => {
393
+ let l = t;
394
+ const h = n.split(".");
395
+ return h.forEach((E, g) => {
396
+ g < h.length - 1 && (l[E] || (l[E] = {}), g === h.length - 2 && (l[E] = { ...l[E] }), l = l[E]), l[E] = i;
397
397
  }), t;
398
- }, q = (t) => Ce.some((s) => t.startsWith(s)) ? t : "values." + t, je = [
398
+ }, q = (t) => je.some((n) => t.startsWith(n)) ? t : "values." + t, xe = [
399
399
  "badInput",
400
400
  "customError",
401
401
  "patternMismatch",
@@ -406,12 +406,12 @@ const S = () => {
406
406
  "tooShort",
407
407
  "typeMismatch",
408
408
  "valueMissing"
409
- ], ve = (t) => {
409
+ ], Re = (t) => {
410
410
  typeof t.setCustomValidity == "function" && t.setCustomValidity("");
411
- let s = t.validity, a = je.find((i) => s[i]);
412
- if (a) return { type: a, message: t.validationMessage };
411
+ let n = t.validity, i = xe.find((l) => n[l]);
412
+ if (i) return { type: i, message: t.validationMessage };
413
413
  };
414
- class xe {
414
+ class Ne {
415
415
  constructor() {
416
416
  this.events = /* @__PURE__ */ new Map(), this.watchEvents = /* @__PURE__ */ new Map();
417
417
  }
@@ -421,309 +421,318 @@ class xe {
421
421
  getEvents() {
422
422
  return this.events;
423
423
  }
424
- subscribe(s, a) {
425
- return this.events.has(s) || this.events.set(s, /* @__PURE__ */ new Set()), this.events.get(s).add(a), () => {
426
- var i;
427
- return (i = this.events.get(s)) == null ? void 0 : i.delete(a);
424
+ subscribe(n, i) {
425
+ return this.events.has(n) || this.events.set(n, /* @__PURE__ */ new Set()), this.events.get(n).add(i), () => {
426
+ var l;
427
+ return (l = this.events.get(n)) == null ? void 0 : l.delete(i);
428
428
  };
429
429
  }
430
- subscribeWatch(s, a) {
431
- this.watchEvents.has(s) || (this.watchEvents.set(s, /* @__PURE__ */ new Set()), this.watchEvents.get(s).add(a));
430
+ subscribeWatch(n, i) {
431
+ this.watchEvents.has(n) || (this.watchEvents.set(n, /* @__PURE__ */ new Set()), this.watchEvents.get(n).add(i));
432
432
  }
433
- publish(s, ...a) {
434
- this.events.forEach((i, g) => {
435
- s.includes(g) && i.forEach((h) => h(...a));
436
- }), this.watchEvents.forEach((i, g) => {
437
- s.includes(g) && i.forEach((h) => h(...a));
433
+ publish(n, ...i) {
434
+ this.events.forEach((l, h) => {
435
+ n.includes(h) && l.forEach((E) => E(...i));
436
+ }), this.watchEvents.forEach((l, h) => {
437
+ n.includes(h) && l.forEach((E) => E(...i));
438
438
  });
439
439
  }
440
440
  reset() {
441
441
  this.events.clear(), this.watchEvents.clear();
442
442
  }
443
443
  }
444
- const Ne = () => {
445
- const t = P(new xe()), s = d((R, ...p) => {
446
- t.current.publish(R, ...p);
447
- }, []), a = d((R, p) => t.current.subscribe(R, p), []), i = d((R, p) => {
448
- t.current.subscribeWatch(R, p);
449
- }, []), g = d(() => t.current.getEvents(), []), h = d(() => t.current.getWatchEvents(), []), E = d(() => {
444
+ const Ve = () => {
445
+ const t = V(new Ne()), n = d((m, ...v) => {
446
+ t.current.publish(m, ...v);
447
+ }, []), i = d((m, v) => t.current.subscribe(m, v), []), l = d((m, v) => {
448
+ t.current.subscribeWatch(m, v);
449
+ }, []), h = d(() => t.current.getEvents(), []), E = d(() => t.current.getWatchEvents(), []), g = d(() => {
450
450
  t.current.reset();
451
451
  }, []);
452
- return { publish: s, subscribe: a, reset: E, getEvents: g, subscribeWatch: i, getWatchEvents: h };
453
- }, Ve = () => {
454
- const [t, s] = ae(), a = d(() => s((/* @__PURE__ */ new Date()).toString()), []);
455
- return [t, a];
452
+ return { publish: n, subscribe: i, reset: g, getEvents: h, subscribeWatch: l, getWatchEvents: E };
453
+ }, De = () => {
454
+ const [t, n] = ie(), i = d(() => n((/* @__PURE__ */ new Date()).toString()), []);
455
+ return [t, i];
456
456
  }, We = () => {
457
- const [, t] = ae({});
457
+ const [, t] = ie({});
458
458
  return d(() => t({}), []);
459
- }, De = ({ channels: t, getValues: s, getErrors: a, getFieldStates: i, getFormState: g }) => {
460
- const h = We(), E = d(({ name: l, compute: m }) => {
461
- if (typeof m == "function") return m(s());
462
- if (Array.isArray(l)) {
463
- const o = {};
464
- return l.forEach((c) => {
465
- o[c] = E({ name: c });
466
- }), o;
459
+ }, $e = ({ channels: t, getValues: n, getErrors: i, getFieldStates: l, getFormState: h }) => {
460
+ const E = We(), g = d(({ name: f, compute: b }) => {
461
+ if (typeof b == "function") return b(n());
462
+ if (Array.isArray(f)) {
463
+ const u = {};
464
+ return f.forEach((c) => {
465
+ u[c] = g({ name: c });
466
+ }), u;
467
467
  }
468
- return ce(
468
+ return re(
469
469
  {
470
- ...s(),
471
- errors: { ...a() },
472
- formState: { ...g() },
473
- fieldStates: { ...i() }
470
+ ...n(),
471
+ errors: { ...i() },
472
+ formState: { ...h() },
473
+ fieldStates: { ...l() }
474
474
  },
475
- l
475
+ f
476
476
  );
477
- }, []), R = d((l) => {
478
- if (!l)
479
- return t.subscribeWatch("values", () => h()), s();
480
- if (typeof l == "string") {
481
- const m = q(l);
482
- return t.subscribeWatch(m, () => h()), E({ name: l });
477
+ }, []), m = d((f) => {
478
+ if (!f)
479
+ return t.subscribeWatch("values", () => E()), n();
480
+ if (typeof f == "string") {
481
+ const b = q(f);
482
+ return t.subscribeWatch(b, () => E()), g({ name: f });
483
483
  }
484
- if (Array.isArray(l)) {
485
- const m = {};
486
- return l.forEach((o) => {
487
- const c = q(o);
488
- t.subscribeWatch(c, () => h()), m[o] = E({ name: o });
489
- }), { ...m };
484
+ if (Array.isArray(f)) {
485
+ const b = {};
486
+ return f.forEach((u) => {
487
+ const c = q(u);
488
+ t.subscribeWatch(c, () => E()), b[u] = g({ name: u });
489
+ }), { ...b };
490
490
  }
491
491
  throw new Error("Parameters of watch must be string or array of string");
492
- }, []), p = d(({ name: l, compute: m, setValue: o }) => {
493
- if (typeof m == "function")
492
+ }, []), v = d(({ name: f, compute: b, setValue: u }) => {
493
+ if (typeof b == "function")
494
494
  return [t.subscribe("values", () => {
495
- const b = E({ compute: m });
496
- o(b);
495
+ const o = g({ compute: b });
496
+ u(o);
497
497
  })];
498
- if (!l)
498
+ if (!f)
499
499
  return [t.subscribe("values", () => {
500
- o(s());
500
+ u(n());
501
501
  })];
502
- if (typeof l == "string") {
503
- const c = q(l);
502
+ if (typeof f == "string") {
503
+ const c = q(f);
504
504
  return [t.subscribe(c, () => {
505
- const f = E({ name: l });
506
- o(f);
505
+ const y = g({ name: f });
506
+ u(y);
507
507
  })];
508
508
  }
509
- if (Array.isArray(l)) {
510
- const c = E({ name: l }), b = [];
511
- return l.forEach((f) => {
512
- const O = q(f), N = t.subscribe(O, () => {
513
- const M = E({ name: f });
514
- c[f] = M, o({ ...c });
509
+ if (Array.isArray(f)) {
510
+ const c = g({ name: f }), o = [];
511
+ return f.forEach((y) => {
512
+ const C = q(y), x = t.subscribe(C, () => {
513
+ const J = g({ name: y });
514
+ c[y] = J, u({ ...c });
515
515
  });
516
- b.push(N);
517
- }), b;
516
+ o.push(x);
517
+ }), o;
518
518
  }
519
519
  throw new Error("Parameters of name must be string or array of string or compute must be a function");
520
- }, []), _ = d(
521
- (l, m) => {
522
- if (!l)
523
- return t.subscribe("values", m);
524
- if (typeof l == "string") {
525
- const o = q(l);
526
- return t.subscribe(o, m);
520
+ }, []), p = d(
521
+ (f, b) => {
522
+ if (!f)
523
+ return t.subscribe("values", b);
524
+ if (typeof f == "string") {
525
+ const u = q(f);
526
+ return t.subscribe(u, b);
527
527
  }
528
- if (Array.isArray(l)) {
529
- const o = {}, c = [];
530
- return l.forEach((b) => {
531
- const f = q(b), O = t.subscribe(f, () => {
532
- o[b] = E({ name: b }), m({ ...o });
528
+ if (Array.isArray(f)) {
529
+ const u = {}, c = [];
530
+ return f.forEach((o) => {
531
+ const y = q(o), C = t.subscribe(y, () => {
532
+ u[o] = g({ name: o }), b({ ...u });
533
533
  });
534
- c.push(O);
534
+ c.push(C);
535
535
  }), c;
536
536
  }
537
537
  throw new Error("Parameters of name must be string or array of string");
538
538
  },
539
539
  [t]
540
540
  );
541
- return { watch: R, registerHookWatcher: p, getWatchValue: E, subscribe: _ };
542
- }, fe = { isDirty: !1, isTouched: !1, error: null }, $e = [], Me = {}, Ue = ({
543
- numberFields: t = $e,
544
- defaultValues: s = Me,
545
- shouldUnRegister: a = !1,
546
- shouldConvertNumber: i = !1
541
+ return { watch: m, registerHookWatcher: v, getWatchValue: g, subscribe: p };
542
+ }, Se = {
543
+ lastReset: null,
544
+ isDirty: !1,
545
+ isError: !1,
546
+ errorFields: [],
547
+ dirtyFields: [],
548
+ touchedFields: []
549
+ }, fe = { isDirty: !1, isTouched: !1, error: null }, Me = [], Ye = {}, qe = ({
550
+ numberFields: t = Me,
551
+ defaultValues: n = Ye,
552
+ shouldUnRegister: i = !1,
553
+ shouldConvertNumber: l = !1
547
554
  } = {}) => {
548
- const [g, h] = Ve(), E = P(), R = P(!1), p = P(!1), _ = P(t), l = P(/* @__PURE__ */ new Map()), m = P({}), o = P({}), c = P({ ...s }), b = P({ ...s }), f = Ne(), O = d(() => {
549
- o.current = Object.keys(b.current).reduce((r, n) => ({ ...r, [n]: { ...fe } }), {});
550
- }, []), N = d((r = {}) => {
551
- b.current = { ...b.current, ...r }, c.current = { ...b.current }, l.current.forEach((n, T) => {
552
- n(b.current[T]);
553
- }), R.current = !1, m.current = {}, _.current = t, l.current = /* @__PURE__ */ new Map(), f.reset(), O(), t.length > 0 && (i = !0), h();
554
- }, []), M = d(() => {
555
- const r = Object.fromEntries(new FormData(E.current));
556
- return l.current.forEach((T, k) => {
557
- r[k] = c.current[k];
558
- }), i && _.current.forEach(
559
- (T) => r.hasOwnProperty(T) && (r[T] = Number(r[T]) || 0)
560
- ), { ...c.current, ...r };
561
- }, []), ie = d(() => !!Object.values(Y()).find((r) => r.isDirty), []), J = d(() => !!Object.values(W()).find((r) => !!r), []), re = d((r) => ve(r.target), []), te = d(() => b.current, []), ne = d(() => _.current, []), z = d(() => l.current, []), j = d((r, n) => n ? Array.isArray(n) ? n.reduce((T, k) => ({ ...T, [k]: ce(r, k) }), {}) : ce(r, n) : { ...r }, []), G = d((r) => j(c.current, r), [j]), W = d((r) => j(m.current, r), [j]), Y = d((r) => j(o.current, r), [j]), D = d(
562
- (r) => j(
563
- {
564
- isDirty: R.current,
565
- isError: p.current,
566
- errorFields: Object.keys(m.current).filter((n) => !!m.current[n]),
567
- dirtyFields: Object.keys(o.current).filter((n) => o.current[n].isDirty),
568
- touchedFields: Object.keys(o.current).filter((n) => o.current[n].isTouched)
569
- },
570
- r
571
- ),
572
- [j]
573
- ), { watch: $, registerHookWatcher: H, getWatchValue: X, subscribe: Z } = De({
574
- channels: f,
555
+ const [h, E] = De(), g = V(), m = V(t), v = V(/* @__PURE__ */ new Map()), p = V({}), f = V({}), b = V({ ...Se }), u = V({ ...n }), c = V({ ...n }), o = Ve(), y = d(() => {
556
+ f.current = Object.keys(c.current).reduce((r, s) => ({ ...r, [s]: { ...fe } }), {});
557
+ }, []), C = d((r = {}) => {
558
+ c.current = { ...c.current, ...r }, u.current = { ...c.current }, v.current.forEach((s, F) => {
559
+ s(c.current[F]);
560
+ }), p.current = {}, b.current = { ...Se }, m.current = t, v.current = /* @__PURE__ */ new Map(), o.reset(), y(), t.length > 0 && (l = !0), E();
561
+ }, []), x = d(() => {
562
+ const r = Object.fromEntries(new FormData(g.current));
563
+ return v.current.forEach((F, k) => {
564
+ r[k] = u.current[k];
565
+ }), l && m.current.forEach(
566
+ (F) => r.hasOwnProperty(F) && (r[F] = Number(r[F]) || 0)
567
+ ), { ...u.current, ...r };
568
+ }, []), J = d(() => !!Object.values(W()).find((r) => r.isDirty), []), z = d(() => !!Object.values($()).find((r) => !!r), []), te = d((r) => Re(r.target), []), se = d(() => c.current, []), ne = d(() => m.current, []), oe = d(() => v.current, []), P = d((r, s) => s ? Array.isArray(s) ? s.reduce((F, k) => ({ ...F, [k]: re(r, k) }), {}) : re(r, s) : { ...r }, []), G = d((r) => P(u.current, r), [P]), $ = d((r) => P(p.current, r), [P]), W = d((r) => P(f.current, r), [P]), M = d(
569
+ (r) => P({ ...b.current, lastReset: h }, r),
570
+ [P, h]
571
+ ), { watch: Y, registerHookWatcher: B, getWatchValue: H, subscribe: X } = $e({
572
+ channels: o,
575
573
  getValues: G,
576
- getErrors: W,
577
- getFieldStates: Y,
578
- getFormState: D
579
- }), y = d((r, n, T) => {
580
- const k = o.current[r] || { ...fe };
581
- ce(k, n) !== T && (Pe(o.current, `${r}.${n}`, T), f.publish(`fieldStates.${r}.${n}`, T), n === "error" && f.publish("formState.errorFields", D("errorFields")), n === "isDirty" && f.publish("formState.dirtyFields", D("dirtyFields")), n === "isTouched" && f.publish("formState.touchedFields", D("touchedFields")));
574
+ getErrors: $,
575
+ getFieldStates: W,
576
+ getFormState: M
577
+ }), Z = d((r, s) => {
578
+ const F = b.current;
579
+ re(F, r) !== s && (ve(b.current, r, s), o.publish(`formState.${r}`, s));
580
+ }, []), w = d((r, s, F) => {
581
+ const k = f.current[r] || { ...fe };
582
+ re(k, s) !== F && (ve(f.current, `${r}.${s}`, F), o.publish(`fieldStates.${r}.${s}`, F), s === "error" && (b.current.errorFields = Object.keys(p.current).filter(
583
+ (O) => !!p.current[O]
584
+ ), o.publish("formState.errorFields", b.current.errorFields)), s === "isDirty" && (b.current.dirtyFields = Object.keys(f.current).filter(
585
+ (O) => f.current[O].isDirty
586
+ ), o.publish("formState.dirtyFields", b.current.dirtyFields)), s === "isTouched" && (b.current.touchedFields = Object.keys(f.current).filter(
587
+ (O) => f.current[O].isTouched
588
+ ), o.publish("formState.touchedFields", b.current.touchedFields)));
582
589
  }, []), Q = d(
583
590
  (r) => {
584
- y(r, "isDirty", !1), y(r, "isTouched", !1), y(r, "error", null);
591
+ w(r, "isDirty", !1), w(r, "isTouched", !1), w(r, "error", null);
585
592
  },
586
- [y]
593
+ [w]
587
594
  ), e = d(
588
- (r, n) => {
589
- if (m.current[r] === n) return;
590
- m.current[r] = n, y(r, "error", n), f.publish(`errors.${r}`, n);
591
- const k = J();
592
- p.current !== k && (p.current = k, f.publish("formState.isError", k));
595
+ (r, s) => {
596
+ if (p.current[r] === s) return;
597
+ p.current[r] = s, w(r, "error", s), o.publish(`errors.${r}`, s);
598
+ const k = z();
599
+ b.current.isError !== k && (b.current.isError = k, o.publish("formState.isError", k));
593
600
  },
594
- [y]
595
- ), u = d(
601
+ [w]
602
+ ), a = d(
596
603
  (r) => {
597
- if (!m.current[r]) return;
598
- m.current[r] = null, y(r, "error", null), f.publish(`errors.${r}`, null);
599
- const n = J();
600
- p.current !== n && (p.current = n, f.publish("formState.isError", n));
604
+ if (!p.current[r]) return;
605
+ p.current[r] = null, w(r, "error", null), o.publish(`errors.${r}`, null);
606
+ const s = z();
607
+ b.current.isError !== s && (b.current.isError = s, o.publish("formState.isError", s));
601
608
  },
602
- [y]
603
- ), v = d(() => {
604
- if (Object.keys(m.current) === 0) return;
605
- Object.keys(m.current).forEach((n) => u(n)), m.current = {};
606
- const r = J();
607
- p.current !== r && (p.current = r, f.publish("formState.isError", r));
608
- }, []), w = d(
609
+ [w]
610
+ ), R = d(() => {
611
+ if (Object.keys(p.current) === 0) return;
612
+ Object.keys(p.current).forEach((s) => a(s)), p.current = {};
613
+ const r = z();
614
+ b.current.isError !== r && (b.current.isError = r, o.publish("formState.isError", r));
615
+ }, []), T = d(
609
616
  (r) => {
610
- const n = ve(r.target);
611
- n ? e(r.target.name, n) : u(r.target.name);
617
+ const s = Re(r.target);
618
+ s ? e(r.target.name, s) : a(r.target.name);
612
619
  },
613
- [e, u]
614
- ), C = d(
615
- (r, n, { shouldDirty: T = !0, shouldOnChange: k = !0 } = {}) => {
616
- if (n === c.current[r]) return;
617
- i && _.current.includes(r) && (n = Number(n) || void 0), y(r, "isTouched", !0);
618
- const oe = n !== b.current[r];
619
- T && o.current[r].isDirty !== oe && y(r, "isDirty", oe);
620
- const B = ie();
621
- R.current !== B && (R.current = B, f.publish("formState.isDirty", B)), c.current[r] = n;
622
- const U = l.current.get(r);
623
- U && U(n), f.publish(`values.${r}`, n, { shouldDirty: T, shouldOnChange: k }), k && f.publish("onChange", r, n, c.current);
620
+ [e, a]
621
+ ), j = d(
622
+ (r, s, { shouldDirty: F = !0, shouldOnChange: k = !0 } = {}) => {
623
+ if (s === u.current[r]) return;
624
+ l && m.current.includes(r) && (s = Number(s) || void 0), w(r, "isTouched", !0);
625
+ const ce = s !== c.current[r];
626
+ F && f.current[r].isDirty !== ce && w(r, "isDirty", ce);
627
+ const O = J();
628
+ b.current.isDirty !== O && (b.current.isDirty = O, o.publish("formState.isDirty", O)), u.current[r] = s;
629
+ const U = v.current.get(r);
630
+ U && U(s), o.publish(`values.${r}`, s, { shouldDirty: F, shouldOnChange: k }), k && o.publish("onChange", r, s, u.current);
624
631
  },
625
- [y]
626
- ), A = d((r, n) => (l.current.set(r, n), o.current[r] = { ...fe }, () => {
627
- a && l.current.delete(r);
632
+ [w]
633
+ ), A = d((r, s) => (v.current.set(r, s), f.current[r] = { ...fe }, () => {
634
+ i && v.current.delete(r);
628
635
  }), []), I = d(
629
- (r, { keepError: n, keepDirty: T, keepTouched: k, keepCustomState: oe, defaultValue: B }) => {
630
- const U = l.current.get(r);
636
+ (r, { keepError: s, keepDirty: F, keepTouched: k, keepCustomState: ce, defaultValue: O }) => {
637
+ const U = v.current.get(r);
631
638
  if (!U)
632
639
  throw new Error(`Cannot reset "${r}" because it's uncontrolled field`);
633
- b.current[r] = B, c.current[r] = B, U && U(B), n || u(r), T || y(r, "isDirty", !1), k || y(r, "isTouched", !1);
640
+ c.current[r] = O, u.current[r] = O, U && U(O), s || a(r), F || w(r, "isDirty", !1), k || w(r, "isTouched", !1);
634
641
  },
635
- [u, y]
636
- ), L = d((r, n = x.getValues(r)) => {
637
- f.publish("onBlur", r, n, x.getValues());
638
- }, []), F = d((r) => f.subscribe("onChange", r), []), V = d((r) => f.subscribe("onBlur", r), []), x = le(
642
+ [a, w]
643
+ ), L = d((r, s = N.getValues(r)) => {
644
+ o.publish("onBlur", r, s, N.getValues());
645
+ }, []), _ = d((r) => o.subscribe("onChange", r), []), D = d((r) => o.subscribe("onBlur", r), []), N = le(
639
646
  () => ({
640
- subscribe: Z,
641
- reset: N,
647
+ subscribe: X,
648
+ reset: C,
642
649
  resetField: I,
643
- setValue: C,
650
+ setValue: j,
644
651
  getValues: G,
645
- getErrors: W,
646
- getFieldStates: Y,
647
- getFormState: D,
652
+ getErrors: $,
653
+ getFieldStates: W,
654
+ getFormState: M,
648
655
  setError: e,
649
- clearError: u,
650
- clearErrors: v,
651
- checkValidity: w,
656
+ clearError: a,
657
+ clearErrors: R,
658
+ checkValidity: T,
652
659
  getNumberFields: ne,
653
- getFieldValidity: re,
654
- getDefaultValues: te,
655
- setFieldState: y,
660
+ getFieldValidity: te,
661
+ getDefaultValues: se,
662
+ setFieldState: w,
656
663
  triggerFieldBlur: L,
657
664
  resetFieldState: Q,
658
- getControlledFields: z,
659
- subscribeChange: F,
660
- subscribeBlur: V,
661
- getEvents: f.getEvents,
662
- getWatchEvents: f.getWatchEvents
665
+ getControlledFields: oe,
666
+ subscribeChange: _,
667
+ subscribeBlur: D,
668
+ setFormState: Z,
669
+ getEvents: o.getEvents,
670
+ getWatchEvents: o.getWatchEvents
663
671
  }),
664
672
  [
665
- Z,
666
- N,
667
- I,
673
+ X,
668
674
  C,
675
+ I,
676
+ j,
669
677
  G,
678
+ $,
670
679
  W,
671
- Y,
672
- D,
680
+ M,
673
681
  e,
674
- u,
675
- v,
676
- w,
682
+ a,
683
+ R,
684
+ T,
677
685
  ne,
678
- re,
679
686
  te,
680
- y,
687
+ se,
688
+ w,
681
689
  Q,
682
690
  L,
683
- z,
684
- F,
685
- V
691
+ oe,
692
+ _,
693
+ D,
694
+ Z
686
695
  ]
687
- ), se = le(
696
+ ), ue = le(
688
697
  () => ({
689
- ref: E,
690
- watch: $,
691
- actions: x,
698
+ ref: g,
699
+ watch: Y,
700
+ actions: N,
692
701
  registerController: A,
693
- registerHookWatcher: H,
694
- lastReloadedAt: g,
695
- loadFormValues: M,
696
- getWatchValue: X,
697
- channels: f
702
+ registerHookWatcher: B,
703
+ lastReloadedAt: h,
704
+ loadFormValues: x,
705
+ getWatchValue: H,
706
+ channels: o
698
707
  }),
699
708
  [
700
- E,
701
- $,
702
- x,
709
+ g,
710
+ Y,
711
+ N,
703
712
  A,
713
+ B,
714
+ h,
715
+ x,
704
716
  H,
705
- g,
706
- M,
707
- X,
708
- f
717
+ o
709
718
  ]
710
- ), Se = le(() => ({ control: se, actions: x, watch: $ }), [g, se, x, $]);
719
+ ), Fe = le(() => ({ control: ue, actions: N, watch: Y }), [h, ue, N, Y]);
711
720
  return be(() => {
712
- if ([...E.current.querySelectorAll("[name]")].forEach((n) => {
713
- !n.defaultValue && !l.current.has(n.name) && b.current[n.name] && (n.defaultValue = b.current[n.name]), n.type === "number" && !_.current.includes(n.name) && _.current.push(n.name);
714
- }), E.current) {
715
- const n = M();
716
- c.current = { ...n }, b.current = { ...n };
721
+ if ([...g.current.querySelectorAll("[name]")].forEach((s) => {
722
+ !s.defaultValue && !v.current.has(s.name) && c.current[s.name] && (s.defaultValue = c.current[s.name]), s.type === "number" && !m.current.includes(s.name) && m.current.push(s.name);
723
+ }), g.current) {
724
+ const s = x();
725
+ u.current = { ...s }, c.current = { ...s };
717
726
  }
718
- }, [g]), be(() => {
719
- O();
720
- }, []), Se;
727
+ }, [h]), be(() => {
728
+ y();
729
+ }, []), Fe;
721
730
  };
722
731
  export {
723
- Le as Controller,
724
- Ie as Form,
725
- Oe as useController,
726
- Ue as useForm,
727
- pe as useFormContext,
728
- Ae as useWatch
732
+ Ue as Controller,
733
+ Le as Form,
734
+ Pe as useController,
735
+ qe as useForm,
736
+ ye as useFormContext,
737
+ Ce as useWatch
729
738
  };