stone-kit 0.0.237 → 0.0.240

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,63 +1,64 @@
1
- import { jsx as W, jsxs as Se } from "react/jsx-runtime";
1
+ import { jsx as O, jsxs as Se } from "react/jsx-runtime";
2
2
  import { I as xt } from "../../../index-CbZmuQco.js";
3
3
  import { M as Vt } from "../../../Modal-258KOiTO.js";
4
- import { Flex as Ft } from "../../Flex/ui/Flex.js";
5
- import { Input as je } from "../../Input/ui/Input.js";
6
- import I from "react";
4
+ import { Flex as At } from "../../Flex/ui/Flex.js";
5
+ import { Input as Ee } from "../../Input/ui/Input.js";
6
+ import W from "react";
7
7
  import { Button as Ke } from "../../Button/ui/Button.js";
8
- import { NewIcon as At } from "../../NewIcon/ui/NewIcon.js";
9
- import { phoneReg as wt, nameReg as pt } from "../utils/reg.js";
8
+ import { NewIcon as Ft } from "../../NewIcon/ui/NewIcon.js";
9
+ import { phoneReg as wt, nameReg as pt, emailReg as Dt } from "../utils/reg.js";
10
10
  import { CheckBox as Ge } from "../../CheckBox/CheckBox.js";
11
- const Dt = "_btn_m4eyd_1", kt = "_modal_m4eyd_9", St = "_modalBody_m4eyd_16", Et = "_root_m4eyd_21", Ct = "_title_m4eyd_31", Bt = "_description_m4eyd_38", Tt = "_inputWrapper_m4eyd_45", X = {
12
- btn: Dt,
13
- modal: kt,
14
- modalBody: St,
15
- root: Et,
16
- title: Ct,
17
- description: Bt,
18
- inputWrapper: Tt
11
+ import { TextArea as kt } from "../../TextArea/TextArea.js";
12
+ const St = "_btn_q5rib_1", Et = "_modal_q5rib_9", Ct = "_modalBody_q5rib_16", Bt = "_root_q5rib_21", Tt = "_title_q5rib_31", Rt = "_description_q5rib_38", Lt = "_inputWrapper_q5rib_45", Z = {
13
+ btn: St,
14
+ modal: Et,
15
+ modalBody: Ct,
16
+ root: Bt,
17
+ title: Tt,
18
+ description: Rt,
19
+ inputWrapper: Lt
19
20
  };
20
- var ye = (e) => e.type === "checkbox", ae = (e) => e instanceof Date, B = (e) => e == null;
21
- const nt = (e) => typeof e == "object";
22
- var S = (e) => !B(e) && !Array.isArray(e) && nt(e) && !ae(e), Rt = (e) => S(e) && e.target ? ye(e.target) ? e.target.checked : e.target.value : e, Lt = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Mt = (e, s) => e.has(Lt(s)), Ot = (e) => {
21
+ var he = (e) => e.type === "checkbox", ne = (e) => e instanceof Date, B = (e) => e == null;
22
+ const at = (e) => typeof e == "object";
23
+ var S = (e) => !B(e) && !Array.isArray(e) && at(e) && !ne(e), Mt = (e) => S(e) && e.target ? he(e.target) ? e.target.checked : e.target.value : e, Ot = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Nt = (e, s) => e.has(Ot(s)), Ut = (e) => {
23
24
  const s = e.constructor && e.constructor.prototype;
24
25
  return S(s) && s.hasOwnProperty("isPrototypeOf");
25
- }, Te = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
26
- function U(e) {
26
+ }, Re = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
27
+ function P(e) {
27
28
  let s;
28
29
  const r = Array.isArray(e);
29
30
  if (e instanceof Date)
30
31
  s = new Date(e);
31
32
  else if (e instanceof Set)
32
33
  s = new Set(e);
33
- else if (!(Te && (e instanceof Blob || e instanceof FileList)) && (r || S(e)))
34
- if (s = r ? [] : {}, !r && !Ot(e))
34
+ else if (!(Re && (e instanceof Blob || e instanceof FileList)) && (r || S(e)))
35
+ if (s = r ? [] : {}, !r && !Ut(e))
35
36
  s = e;
36
37
  else
37
- for (const l in e)
38
- e.hasOwnProperty(l) && (s[l] = U(e[l]));
38
+ for (const n in e)
39
+ e.hasOwnProperty(n) && (s[n] = P(e[n]));
39
40
  else
40
41
  return e;
41
42
  return s;
42
43
  }
43
- var Ae = (e) => Array.isArray(e) ? e.filter(Boolean) : [], A = (e) => e === void 0, d = (e, s, r) => {
44
+ var Fe = (e) => Array.isArray(e) ? e.filter(Boolean) : [], w = (e) => e === void 0, d = (e, s, r) => {
44
45
  if (!s || !S(e))
45
46
  return r;
46
- const l = Ae(s.split(/[,[\].]+?/)).reduce((u, a) => B(u) ? u : u[a], e);
47
- return A(l) || l === e ? A(e[s]) ? r : e[s] : l;
48
- }, Y = (e) => typeof e == "boolean", Re = (e) => /^\w*$/.test(e), at = (e) => Ae(e.replace(/["|']|\]/g, "").split(/\.|\[/)), V = (e, s, r) => {
49
- let l = -1;
50
- const u = Re(s) ? [s] : at(s), a = u.length, y = a - 1;
51
- for (; ++l < a; ) {
52
- const g = u[l];
53
- let R = r;
54
- if (l !== y) {
55
- const M = e[g];
56
- R = S(M) || Array.isArray(M) ? M : isNaN(+u[l + 1]) ? {} : [];
47
+ const n = Fe(s.split(/[,[\].]+?/)).reduce((u, l) => B(u) ? u : u[l], e);
48
+ return w(n) || n === e ? w(e[s]) ? r : e[s] : n;
49
+ }, ee = (e) => typeof e == "boolean", Le = (e) => /^\w*$/.test(e), lt = (e) => Fe(e.replace(/["|']|\]/g, "").split(/\.|\[/)), V = (e, s, r) => {
50
+ let n = -1;
51
+ const u = Le(s) ? [s] : lt(s), l = u.length, y = l - 1;
52
+ for (; ++n < l; ) {
53
+ const g = u[n];
54
+ let L = r;
55
+ if (n !== y) {
56
+ const N = e[g];
57
+ L = S(N) || Array.isArray(N) ? N : isNaN(+u[n + 1]) ? {} : [];
57
58
  }
58
59
  if (g === "__proto__")
59
60
  return;
60
- e[g] = R, e = e[g];
61
+ e[g] = L, e = e[g];
61
62
  }
62
63
  return e;
63
64
  };
@@ -65,13 +66,13 @@ const Je = {
65
66
  BLUR: "blur",
66
67
  FOCUS_OUT: "focusout",
67
68
  CHANGE: "change"
68
- }, H = {
69
+ }, K = {
69
70
  onBlur: "onBlur",
70
71
  onChange: "onChange",
71
72
  onSubmit: "onSubmit",
72
73
  onTouched: "onTouched",
73
74
  all: "all"
74
- }, Q = {
75
+ }, X = {
75
76
  max: "max",
76
77
  min: "min",
77
78
  maxLength: "maxLength",
@@ -80,27 +81,27 @@ const Je = {
80
81
  required: "required",
81
82
  validate: "validate"
82
83
  };
83
- I.createContext(null);
84
- var Nt = (e, s, r, l = !0) => {
84
+ W.createContext(null);
85
+ var qt = (e, s, r, n = !0) => {
85
86
  const u = {
86
87
  defaultValues: s._defaultValues
87
88
  };
88
- for (const a in e)
89
- Object.defineProperty(u, a, {
89
+ for (const l in e)
90
+ Object.defineProperty(u, l, {
90
91
  get: () => {
91
- const y = a;
92
- return s._proxyFormState[y] !== H.all && (s._proxyFormState[y] = !l || H.all), e[y];
92
+ const y = l;
93
+ return s._proxyFormState[y] !== K.all && (s._proxyFormState[y] = !n || K.all), e[y];
93
94
  }
94
95
  });
95
96
  return u;
96
- }, T = (e) => S(e) && !Object.keys(e).length, Ut = (e, s, r, l) => {
97
+ }, R = (e) => S(e) && !Object.keys(e).length, It = (e, s, r, n) => {
97
98
  r(e);
98
- const { name: u, ...a } = e;
99
- return T(a) || Object.keys(a).length >= Object.keys(s).length || Object.keys(a).find((y) => s[y] === H.all);
99
+ const { name: u, ...l } = e;
100
+ return R(l) || Object.keys(l).length >= Object.keys(s).length || Object.keys(l).find((y) => s[y] === K.all);
100
101
  }, _e = (e) => Array.isArray(e) ? e : [e];
101
- function It(e) {
102
- const s = I.useRef(e);
103
- s.current = e, I.useEffect(() => {
102
+ function Pt(e) {
103
+ const s = W.useRef(e);
104
+ s.current = e, W.useEffect(() => {
104
105
  const r = !e.disabled && s.current.subject && s.current.subject.subscribe({
105
106
  next: s.current.next
106
107
  });
@@ -109,49 +110,49 @@ function It(e) {
109
110
  };
110
111
  }, [e.disabled]);
111
112
  }
112
- var K = (e) => typeof e == "string", Pt = (e, s, r, l, u) => K(e) ? (l && s.watch.add(e), d(r, e, u)) : Array.isArray(e) ? e.map((a) => (l && s.watch.add(a), d(r, a))) : (l && (s.watchAll = !0), r), qt = (e, s, r, l, u) => s ? {
113
+ var J = (e) => typeof e == "string", Wt = (e, s, r, n, u) => J(e) ? (n && s.watch.add(e), d(r, e, u)) : Array.isArray(e) ? e.map((l) => (n && s.watch.add(l), d(r, l))) : (n && (s.watchAll = !0), r), Ht = (e, s, r, n, u) => s ? {
113
114
  ...r[e],
114
115
  types: {
115
116
  ...r[e] && r[e].types ? r[e].types : {},
116
- [l]: u || !0
117
+ [n]: u || !0
117
118
  }
118
119
  } : {}, Qe = (e) => ({
119
- isOnSubmit: !e || e === H.onSubmit,
120
- isOnBlur: e === H.onBlur,
121
- isOnChange: e === H.onChange,
122
- isOnAll: e === H.all,
123
- isOnTouch: e === H.onTouched
124
- }), Xe = (e, s, r) => !r && (s.watchAll || s.watch.has(e) || [...s.watch].some((l) => e.startsWith(l) && /^\.\w+/.test(e.slice(l.length))));
125
- const de = (e, s, r, l) => {
120
+ isOnSubmit: !e || e === K.onSubmit,
121
+ isOnBlur: e === K.onBlur,
122
+ isOnChange: e === K.onChange,
123
+ isOnAll: e === K.all,
124
+ isOnTouch: e === K.onTouched
125
+ }), Xe = (e, s, r) => !r && (s.watchAll || s.watch.has(e) || [...s.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
126
+ const ye = (e, s, r, n) => {
126
127
  for (const u of r || Object.keys(e)) {
127
- const a = d(e, u);
128
- if (a) {
129
- const { _f: y, ...g } = a;
128
+ const l = d(e, u);
129
+ if (l) {
130
+ const { _f: y, ...g } = l;
130
131
  if (y) {
131
- if (y.refs && y.refs[0] && s(y.refs[0], u) && !l)
132
+ if (y.refs && y.refs[0] && s(y.refs[0], u) && !n)
132
133
  break;
133
- if (y.ref && s(y.ref, y.name) && !l)
134
+ if (y.ref && s(y.ref, y.name) && !n)
134
135
  break;
135
- de(g, s);
136
+ ye(g, s);
136
137
  } else
137
- S(g) && de(g, s);
138
+ S(g) && ye(g, s);
138
139
  }
139
140
  }
140
141
  };
141
- var Wt = (e, s, r) => {
142
- const l = _e(d(e, r));
143
- return V(l, "root", s[r]), V(e, r, l), e;
144
- }, Le = (e) => e.type === "file", Z = (e) => typeof e == "function", be = (e) => {
145
- if (!Te)
142
+ var zt = (e, s, r) => {
143
+ const n = _e(d(e, r));
144
+ return V(n, "root", s[r]), V(e, r, n), e;
145
+ }, Me = (e) => e.type === "file", te = (e) => typeof e == "function", be = (e) => {
146
+ if (!Re)
146
147
  return !1;
147
148
  const s = e ? e.ownerDocument : 0;
148
149
  return e instanceof (s && s.defaultView ? s.defaultView.HTMLElement : HTMLElement);
149
- }, me = (e) => K(e), Me = (e) => e.type === "radio", xe = (e) => e instanceof RegExp;
150
+ }, me = (e) => J(e), Oe = (e) => e.type === "radio", xe = (e) => e instanceof RegExp;
150
151
  const Ye = {
151
152
  value: !1,
152
153
  isValid: !1
153
154
  }, Ze = { value: !0, isValid: !0 };
154
- var lt = (e) => {
155
+ var nt = (e) => {
155
156
  if (Array.isArray(e)) {
156
157
  if (e.length > 1) {
157
158
  const s = e.filter((r) => r && r.checked && !r.disabled).map((r) => r.value);
@@ -159,7 +160,7 @@ var lt = (e) => {
159
160
  }
160
161
  return e[0].checked && !e[0].disabled ? (
161
162
  // @ts-expect-error expected to work in the browser
162
- e[0].attributes && !A(e[0].attributes.value) ? A(e[0].value) || e[0].value === "" ? Ze : { value: e[0].value, isValid: !0 } : Ze
163
+ e[0].attributes && !w(e[0].attributes.value) ? w(e[0].value) || e[0].value === "" ? Ze : { value: e[0].value, isValid: !0 } : Ze
163
164
  ) : Ye;
164
165
  }
165
166
  return Ye;
@@ -173,208 +174,208 @@ var ut = (e) => Array.isArray(e) ? e.reduce((s, r) => r && r.checked && !r.disab
173
174
  value: r.value
174
175
  } : s, et) : et;
175
176
  function tt(e, s, r = "validate") {
176
- if (me(e) || Array.isArray(e) && e.every(me) || Y(e) && !e)
177
+ if (me(e) || Array.isArray(e) && e.every(me) || ee(e) && !e)
177
178
  return {
178
179
  type: r,
179
180
  message: me(e) ? e : "",
180
181
  ref: s
181
182
  };
182
183
  }
183
- var ne = (e) => S(e) && !xe(e) ? e : {
184
+ var le = (e) => S(e) && !xe(e) ? e : {
184
185
  value: e,
185
186
  message: ""
186
- }, rt = async (e, s, r, l, u) => {
187
- const { ref: a, refs: y, required: g, maxLength: R, minLength: M, min: F, max: v, pattern: G, validate: z, name: C, valueAsNumber: le, mount: $, disabled: j } = e._f, m = d(s, C);
188
- if (!$ || j)
187
+ }, rt = async (e, s, r, n, u) => {
188
+ const { ref: l, refs: y, required: g, maxLength: L, minLength: N, min: A, max: v, pattern: U, validate: G, name: C, valueAsNumber: ue, mount: H, disabled: T } = e._f, m = d(s, C);
189
+ if (!H || T)
189
190
  return {};
190
- const P = y ? y[0] : a, J = (_) => {
191
- l && P.reportValidity && (P.setCustomValidity(Y(_) ? "" : _ || ""), P.reportValidity());
192
- }, p = {}, re = Me(a), he = ye(a), ee = re || he, se = (le || Le(a)) && A(a.value) && A(m) || be(a) && a.value === "" || m === "" || Array.isArray(m) && !m.length, O = qt.bind(null, C, r, p), ge = (_, b, D, E = Q.maxLength, q = Q.minLength) => {
193
- const N = _ ? b : D;
194
- p[C] = {
195
- type: _ ? E : q,
196
- message: N,
197
- ref: a,
198
- ...O(_ ? E : q, N)
191
+ const z = y ? y[0] : l, $ = (_) => {
192
+ n && z.reportValidity && (z.setCustomValidity(ee(_) ? "" : _ || ""), z.reportValidity());
193
+ }, F = {}, Y = Oe(l), se = he(l), Q = Y || se, ie = (ue || Me(l)) && w(l.value) && w(m) || be(l) && l.value === "" || m === "" || Array.isArray(m) && !m.length, q = Ht.bind(null, C, r, F), ge = (_, b, D, E = X.maxLength, j = X.minLength) => {
194
+ const I = _ ? b : D;
195
+ F[C] = {
196
+ type: _ ? E : j,
197
+ message: I,
198
+ ref: l,
199
+ ...q(_ ? E : j, I)
199
200
  };
200
201
  };
201
- if (u ? !Array.isArray(m) || !m.length : g && (!ee && (se || B(m)) || Y(m) && !m || he && !lt(y).isValid || re && !ut(y).isValid)) {
202
- const { value: _, message: b } = me(g) ? { value: !!g, message: g } : ne(g);
203
- if (_ && (p[C] = {
204
- type: Q.required,
202
+ if (u ? !Array.isArray(m) || !m.length : g && (!Q && (ie || B(m)) || ee(m) && !m || se && !nt(y).isValid || Y && !ut(y).isValid)) {
203
+ const { value: _, message: b } = me(g) ? { value: !!g, message: g } : le(g);
204
+ if (_ && (F[C] = {
205
+ type: X.required,
205
206
  message: b,
206
- ref: P,
207
- ...O(Q.required, b)
207
+ ref: z,
208
+ ...q(X.required, b)
208
209
  }, !r))
209
- return J(b), p;
210
+ return $(b), F;
210
211
  }
211
- if (!se && (!B(F) || !B(v))) {
212
+ if (!ie && (!B(A) || !B(v))) {
212
213
  let _, b;
213
- const D = ne(v), E = ne(F);
214
+ const D = le(v), E = le(A);
214
215
  if (!B(m) && !isNaN(m)) {
215
- const q = a.valueAsNumber || m && +m;
216
- B(D.value) || (_ = q > D.value), B(E.value) || (b = q < E.value);
216
+ const j = l.valueAsNumber || m && +m;
217
+ B(D.value) || (_ = j > D.value), B(E.value) || (b = j < E.value);
217
218
  } else {
218
- const q = a.valueAsDate || new Date(m), N = (ce) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ce), ue = a.type == "time", oe = a.type == "week";
219
- K(D.value) && m && (_ = ue ? N(m) > N(D.value) : oe ? m > D.value : q > new Date(D.value)), K(E.value) && m && (b = ue ? N(m) < N(E.value) : oe ? m < E.value : q < new Date(E.value));
219
+ const j = l.valueAsDate || new Date(m), I = (fe) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + fe), oe = l.type == "time", ce = l.type == "week";
220
+ J(D.value) && m && (_ = oe ? I(m) > I(D.value) : ce ? m > D.value : j > new Date(D.value)), J(E.value) && m && (b = oe ? I(m) < I(E.value) : ce ? m < E.value : j < new Date(E.value));
220
221
  }
221
- if ((_ || b) && (ge(!!_, D.message, E.message, Q.max, Q.min), !r))
222
- return J(p[C].message), p;
222
+ if ((_ || b) && (ge(!!_, D.message, E.message, X.max, X.min), !r))
223
+ return $(F[C].message), F;
223
224
  }
224
- if ((R || M) && !se && (K(m) || u && Array.isArray(m))) {
225
- const _ = ne(R), b = ne(M), D = !B(_.value) && m.length > +_.value, E = !B(b.value) && m.length < +b.value;
225
+ if ((L || N) && !ie && (J(m) || u && Array.isArray(m))) {
226
+ const _ = le(L), b = le(N), D = !B(_.value) && m.length > +_.value, E = !B(b.value) && m.length < +b.value;
226
227
  if ((D || E) && (ge(D, _.message, b.message), !r))
227
- return J(p[C].message), p;
228
+ return $(F[C].message), F;
228
229
  }
229
- if (G && !se && K(m)) {
230
- const { value: _, message: b } = ne(G);
231
- if (xe(_) && !m.match(_) && (p[C] = {
232
- type: Q.pattern,
230
+ if (U && !ie && J(m)) {
231
+ const { value: _, message: b } = le(U);
232
+ if (xe(_) && !m.match(_) && (F[C] = {
233
+ type: X.pattern,
233
234
  message: b,
234
- ref: a,
235
- ...O(Q.pattern, b)
235
+ ref: l,
236
+ ...q(X.pattern, b)
236
237
  }, !r))
237
- return J(b), p;
238
+ return $(b), F;
238
239
  }
239
- if (z) {
240
- if (Z(z)) {
241
- const _ = await z(m, s), b = tt(_, P);
242
- if (b && (p[C] = {
240
+ if (G) {
241
+ if (te(G)) {
242
+ const _ = await G(m, s), b = tt(_, z);
243
+ if (b && (F[C] = {
243
244
  ...b,
244
- ...O(Q.validate, b.message)
245
+ ...q(X.validate, b.message)
245
246
  }, !r))
246
- return J(b.message), p;
247
- } else if (S(z)) {
247
+ return $(b.message), F;
248
+ } else if (S(G)) {
248
249
  let _ = {};
249
- for (const b in z) {
250
- if (!T(_) && !r)
250
+ for (const b in G) {
251
+ if (!R(_) && !r)
251
252
  break;
252
- const D = tt(await z[b](m, s), P, b);
253
+ const D = tt(await G[b](m, s), z, b);
253
254
  D && (_ = {
254
255
  ...D,
255
- ...O(b, D.message)
256
- }, J(D.message), r && (p[C] = _));
256
+ ...q(b, D.message)
257
+ }, $(D.message), r && (F[C] = _));
257
258
  }
258
- if (!T(_) && (p[C] = {
259
- ref: P,
259
+ if (!R(_) && (F[C] = {
260
+ ref: z,
260
261
  ..._
261
262
  }, !r))
262
- return p;
263
+ return F;
263
264
  }
264
265
  }
265
- return J(!0), p;
266
+ return $(!0), F;
266
267
  };
267
- function Ht(e, s) {
268
+ function $t(e, s) {
268
269
  const r = s.slice(0, -1).length;
269
- let l = 0;
270
- for (; l < r; )
271
- e = A(e) ? l++ : e[s[l++]];
270
+ let n = 0;
271
+ for (; n < r; )
272
+ e = w(e) ? n++ : e[s[n++]];
272
273
  return e;
273
274
  }
274
- function zt(e) {
275
+ function jt(e) {
275
276
  for (const s in e)
276
- if (e.hasOwnProperty(s) && !A(e[s]))
277
+ if (e.hasOwnProperty(s) && !w(e[s]))
277
278
  return !1;
278
279
  return !0;
279
280
  }
280
281
  function k(e, s) {
281
- const r = Array.isArray(s) ? s : Re(s) ? [s] : at(s), l = r.length === 1 ? e : Ht(e, r), u = r.length - 1, a = r[u];
282
- return l && delete l[a], u !== 0 && (S(l) && T(l) || Array.isArray(l) && zt(l)) && k(e, r.slice(0, -1)), e;
282
+ const r = Array.isArray(s) ? s : Le(s) ? [s] : lt(s), n = r.length === 1 ? e : $t(e, r), u = r.length - 1, l = r[u];
283
+ return n && delete n[l], u !== 0 && (S(n) && R(n) || Array.isArray(n) && jt(n)) && k(e, r.slice(0, -1)), e;
283
284
  }
284
- var Ee = () => {
285
+ var Ce = () => {
285
286
  let e = [];
286
287
  return {
287
288
  get observers() {
288
289
  return e;
289
290
  },
290
291
  next: (u) => {
291
- for (const a of e)
292
- a.next && a.next(u);
292
+ for (const l of e)
293
+ l.next && l.next(u);
293
294
  },
294
295
  subscribe: (u) => (e.push(u), {
295
296
  unsubscribe: () => {
296
- e = e.filter((a) => a !== u);
297
+ e = e.filter((l) => l !== u);
297
298
  }
298
299
  }),
299
300
  unsubscribe: () => {
300
301
  e = [];
301
302
  }
302
303
  };
303
- }, Ve = (e) => B(e) || !nt(e);
304
- function te(e, s) {
304
+ }, Ve = (e) => B(e) || !at(e);
305
+ function re(e, s) {
305
306
  if (Ve(e) || Ve(s))
306
307
  return e === s;
307
- if (ae(e) && ae(s))
308
+ if (ne(e) && ne(s))
308
309
  return e.getTime() === s.getTime();
309
- const r = Object.keys(e), l = Object.keys(s);
310
- if (r.length !== l.length)
310
+ const r = Object.keys(e), n = Object.keys(s);
311
+ if (r.length !== n.length)
311
312
  return !1;
312
313
  for (const u of r) {
313
- const a = e[u];
314
- if (!l.includes(u))
314
+ const l = e[u];
315
+ if (!n.includes(u))
315
316
  return !1;
316
317
  if (u !== "ref") {
317
318
  const y = s[u];
318
- if (ae(a) && ae(y) || S(a) && S(y) || Array.isArray(a) && Array.isArray(y) ? !te(a, y) : a !== y)
319
+ if (ne(l) && ne(y) || S(l) && S(y) || Array.isArray(l) && Array.isArray(y) ? !re(l, y) : l !== y)
319
320
  return !1;
320
321
  }
321
322
  }
322
323
  return !0;
323
324
  }
324
- var ot = (e) => e.type === "select-multiple", $t = (e) => Me(e) || ye(e), Ce = (e) => be(e) && e.isConnected, ct = (e) => {
325
+ var ot = (e) => e.type === "select-multiple", Kt = (e) => Oe(e) || he(e), Be = (e) => be(e) && e.isConnected, ct = (e) => {
325
326
  for (const s in e)
326
- if (Z(e[s]))
327
+ if (te(e[s]))
327
328
  return !0;
328
329
  return !1;
329
330
  };
330
- function Fe(e, s = {}) {
331
+ function Ae(e, s = {}) {
331
332
  const r = Array.isArray(e);
332
333
  if (S(e) || r)
333
- for (const l in e)
334
- Array.isArray(e[l]) || S(e[l]) && !ct(e[l]) ? (s[l] = Array.isArray(e[l]) ? [] : {}, Fe(e[l], s[l])) : B(e[l]) || (s[l] = !0);
334
+ for (const n in e)
335
+ Array.isArray(e[n]) || S(e[n]) && !ct(e[n]) ? (s[n] = Array.isArray(e[n]) ? [] : {}, Ae(e[n], s[n])) : B(e[n]) || (s[n] = !0);
335
336
  return s;
336
337
  }
337
338
  function ft(e, s, r) {
338
- const l = Array.isArray(e);
339
- if (S(e) || l)
339
+ const n = Array.isArray(e);
340
+ if (S(e) || n)
340
341
  for (const u in e)
341
- Array.isArray(e[u]) || S(e[u]) && !ct(e[u]) ? A(s) || Ve(r[u]) ? r[u] = Array.isArray(e[u]) ? Fe(e[u], []) : { ...Fe(e[u]) } : ft(e[u], B(s) ? {} : s[u], r[u]) : r[u] = !te(e[u], s[u]);
342
+ Array.isArray(e[u]) || S(e[u]) && !ct(e[u]) ? w(s) || Ve(r[u]) ? r[u] = Array.isArray(e[u]) ? Ae(e[u], []) : { ...Ae(e[u]) } : ft(e[u], B(s) ? {} : s[u], r[u]) : r[u] = !re(e[u], s[u]);
342
343
  return r;
343
344
  }
344
- var ve = (e, s) => ft(e, s, Fe(s)), dt = (e, { valueAsNumber: s, valueAsDate: r, setValueAs: l }) => A(e) ? e : s ? e === "" ? NaN : e && +e : r && K(e) ? new Date(e) : l ? l(e) : e;
345
- function Be(e) {
345
+ var ve = (e, s) => ft(e, s, Ae(s)), dt = (e, { valueAsNumber: s, valueAsDate: r, setValueAs: n }) => w(e) ? e : s ? e === "" ? NaN : e && +e : r && J(e) ? new Date(e) : n ? n(e) : e;
346
+ function Te(e) {
346
347
  const s = e.ref;
347
348
  if (!(e.refs ? e.refs.every((r) => r.disabled) : s.disabled))
348
- return Le(s) ? s.files : Me(s) ? ut(e.refs).value : ot(s) ? [...s.selectedOptions].map(({ value: r }) => r) : ye(s) ? lt(e.refs).value : dt(A(s.value) ? e.ref.value : s.value, e);
349
+ return Me(s) ? s.files : Oe(s) ? ut(e.refs).value : ot(s) ? [...s.selectedOptions].map(({ value: r }) => r) : he(s) ? nt(e.refs).value : dt(w(s.value) ? e.ref.value : s.value, e);
349
350
  }
350
- var jt = (e, s, r, l) => {
351
+ var Gt = (e, s, r, n) => {
351
352
  const u = {};
352
- for (const a of e) {
353
- const y = d(s, a);
354
- y && V(u, a, y._f);
353
+ for (const l of e) {
354
+ const y = d(s, l);
355
+ y && V(u, l, y._f);
355
356
  }
356
357
  return {
357
358
  criteriaMode: r,
358
359
  names: [...e],
359
360
  fields: u,
360
- shouldUseNativeValidation: l
361
+ shouldUseNativeValidation: n
361
362
  };
362
- }, fe = (e) => A(e) ? e : xe(e) ? e.source : S(e) ? xe(e.value) ? e.value.source : e.value : e, Kt = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
363
+ }, de = (e) => w(e) ? e : xe(e) ? e.source : S(e) ? xe(e.value) ? e.value.source : e.value : e, Jt = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
363
364
  function st(e, s, r) {
364
- const l = d(e, r);
365
- if (l || Re(r))
365
+ const n = d(e, r);
366
+ if (n || Le(r))
366
367
  return {
367
- error: l,
368
+ error: n,
368
369
  name: r
369
370
  };
370
371
  const u = r.split(".");
371
372
  for (; u.length; ) {
372
- const a = u.join("."), y = d(s, a), g = d(e, a);
373
- if (y && !Array.isArray(y) && r !== a)
373
+ const l = u.join("."), y = d(s, l), g = d(e, l);
374
+ if (y && !Array.isArray(y) && r !== l)
374
375
  return { name: r };
375
376
  if (g && g.type)
376
377
  return {
377
- name: a,
378
+ name: l,
378
379
  error: g
379
380
  };
380
381
  u.pop();
@@ -383,20 +384,20 @@ function st(e, s, r) {
383
384
  name: r
384
385
  };
385
386
  }
386
- var Gt = (e, s, r, l, u) => u.isOnAll ? !1 : !r && u.isOnTouch ? !(s || e) : (r ? l.isOnBlur : u.isOnBlur) ? !e : (r ? l.isOnChange : u.isOnChange) ? e : !0, Jt = (e, s) => !Ae(d(e, s)).length && k(e, s);
387
- const Qt = {
388
- mode: H.onSubmit,
389
- reValidateMode: H.onChange,
387
+ var Qt = (e, s, r, n, u) => u.isOnAll ? !1 : !r && u.isOnTouch ? !(s || e) : (r ? n.isOnBlur : u.isOnBlur) ? !e : (r ? n.isOnChange : u.isOnChange) ? e : !0, Xt = (e, s) => !Fe(d(e, s)).length && k(e, s);
388
+ const Yt = {
389
+ mode: K.onSubmit,
390
+ reValidateMode: K.onChange,
390
391
  shouldFocusError: !0
391
392
  };
392
- function Xt(e = {}) {
393
+ function Zt(e = {}) {
393
394
  let s = {
394
- ...Qt,
395
+ ...Yt,
395
396
  ...e
396
397
  }, r = {
397
398
  submitCount: 0,
398
399
  isDirty: !1,
399
- isLoading: Z(s.defaultValues),
400
+ isLoading: te(s.defaultValues),
400
401
  isValidating: !1,
401
402
  isSubmitted: !1,
402
403
  isSubmitting: !1,
@@ -407,7 +408,7 @@ function Xt(e = {}) {
407
408
  validatingFields: {},
408
409
  errors: s.errors || {},
409
410
  disabled: s.disabled || !1
410
- }, l = {}, u = S(s.defaultValues) || S(s.values) ? U(s.defaultValues || s.values) || {} : {}, a = s.shouldUnregister ? {} : U(u), y = {
411
+ }, n = {}, u = S(s.defaultValues) || S(s.values) ? P(s.defaultValues || s.values) || {} : {}, l = s.shouldUnregister ? {} : P(u), y = {
411
412
  action: !1,
412
413
  mount: !1,
413
414
  watch: !1
@@ -416,8 +417,8 @@ function Xt(e = {}) {
416
417
  unMount: /* @__PURE__ */ new Set(),
417
418
  array: /* @__PURE__ */ new Set(),
418
419
  watch: /* @__PURE__ */ new Set()
419
- }, R, M = 0;
420
- const F = {
420
+ }, L, N = 0;
421
+ const A = {
421
422
  isDirty: !1,
422
423
  dirtyFields: !1,
423
424
  validatingFields: !1,
@@ -426,40 +427,40 @@ function Xt(e = {}) {
426
427
  isValid: !1,
427
428
  errors: !1
428
429
  }, v = {
429
- values: Ee(),
430
- array: Ee(),
431
- state: Ee()
432
- }, G = Qe(s.mode), z = Qe(s.reValidateMode), C = s.criteriaMode === H.all, le = (t) => (i) => {
433
- clearTimeout(M), M = setTimeout(t, i);
434
- }, $ = async (t) => {
435
- if (F.isValid || t) {
436
- const i = s.resolver ? T((await ee()).errors) : await O(l, !0);
430
+ values: Ce(),
431
+ array: Ce(),
432
+ state: Ce()
433
+ }, U = Qe(s.mode), G = Qe(s.reValidateMode), C = s.criteriaMode === K.all, ue = (t) => (i) => {
434
+ clearTimeout(N), N = setTimeout(t, i);
435
+ }, H = async (t) => {
436
+ if (A.isValid || t) {
437
+ const i = s.resolver ? R((await Q()).errors) : await q(n, !0);
437
438
  i !== r.isValid && v.state.next({
438
439
  isValid: i
439
440
  });
440
441
  }
441
- }, j = (t, i) => {
442
- (F.isValidating || F.validatingFields) && ((t || Array.from(g.mount)).forEach((n) => {
443
- n && (i ? V(r.validatingFields, n, i) : k(r.validatingFields, n));
442
+ }, T = (t, i) => {
443
+ (A.isValidating || A.validatingFields) && ((t || Array.from(g.mount)).forEach((a) => {
444
+ a && (i ? V(r.validatingFields, a, i) : k(r.validatingFields, a));
444
445
  }), v.state.next({
445
446
  validatingFields: r.validatingFields,
446
- isValidating: !T(r.validatingFields)
447
+ isValidating: !R(r.validatingFields)
447
448
  }));
448
- }, m = (t, i = [], n, f, c = !0, o = !0) => {
449
- if (f && n) {
450
- if (y.action = !0, o && Array.isArray(d(l, t))) {
451
- const h = n(d(l, t), f.argA, f.argB);
452
- c && V(l, t, h);
449
+ }, m = (t, i = [], a, f, c = !0, o = !0) => {
450
+ if (f && a) {
451
+ if (y.action = !0, o && Array.isArray(d(n, t))) {
452
+ const h = a(d(n, t), f.argA, f.argB);
453
+ c && V(n, t, h);
453
454
  }
454
455
  if (o && Array.isArray(d(r.errors, t))) {
455
- const h = n(d(r.errors, t), f.argA, f.argB);
456
- c && V(r.errors, t, h), Jt(r.errors, t);
456
+ const h = a(d(r.errors, t), f.argA, f.argB);
457
+ c && V(r.errors, t, h), Xt(r.errors, t);
457
458
  }
458
- if (F.touchedFields && o && Array.isArray(d(r.touchedFields, t))) {
459
- const h = n(d(r.touchedFields, t), f.argA, f.argB);
459
+ if (A.touchedFields && o && Array.isArray(d(r.touchedFields, t))) {
460
+ const h = a(d(r.touchedFields, t), f.argA, f.argB);
460
461
  c && V(r.touchedFields, t, h);
461
462
  }
462
- F.dirtyFields && (r.dirtyFields = ve(u, a)), v.state.next({
463
+ A.dirtyFields && (r.dirtyFields = ve(u, l)), v.state.next({
463
464
  name: t,
464
465
  isDirty: _(t, i),
465
466
  dirtyFields: r.dirtyFields,
@@ -467,43 +468,43 @@ function Xt(e = {}) {
467
468
  isValid: r.isValid
468
469
  });
469
470
  } else
470
- V(a, t, i);
471
- }, P = (t, i) => {
471
+ V(l, t, i);
472
+ }, z = (t, i) => {
472
473
  V(r.errors, t, i), v.state.next({
473
474
  errors: r.errors
474
475
  });
475
- }, J = (t) => {
476
+ }, $ = (t) => {
476
477
  r.errors = t, v.state.next({
477
478
  errors: r.errors,
478
479
  isValid: !1
479
480
  });
480
- }, p = (t, i, n, f) => {
481
- const c = d(l, t);
481
+ }, F = (t, i, a, f) => {
482
+ const c = d(n, t);
482
483
  if (c) {
483
- const o = d(a, t, A(n) ? d(u, t) : n);
484
- A(o) || f && f.defaultChecked || i ? V(a, t, i ? o : Be(c._f)) : E(t, o), y.mount && $();
484
+ const o = d(l, t, w(a) ? d(u, t) : a);
485
+ w(o) || f && f.defaultChecked || i ? V(l, t, i ? o : Te(c._f)) : E(t, o), y.mount && H();
485
486
  }
486
- }, re = (t, i, n, f, c) => {
487
+ }, Y = (t, i, a, f, c) => {
487
488
  let o = !1, h = !1;
488
489
  const x = {
489
490
  name: t
490
- }, w = !!(d(l, t) && d(l, t)._f && d(l, t)._f.disabled);
491
- if (!n || f) {
492
- F.isDirty && (h = r.isDirty, r.isDirty = x.isDirty = _(), o = h !== x.isDirty);
493
- const L = w || te(d(u, t), i);
494
- h = !!(!w && d(r.dirtyFields, t)), L || w ? k(r.dirtyFields, t) : V(r.dirtyFields, t, !0), x.dirtyFields = r.dirtyFields, o = o || F.dirtyFields && h !== !L;
491
+ }, p = !!(d(n, t) && d(n, t)._f && d(n, t)._f.disabled);
492
+ if (!a || f) {
493
+ A.isDirty && (h = r.isDirty, r.isDirty = x.isDirty = _(), o = h !== x.isDirty);
494
+ const M = p || re(d(u, t), i);
495
+ h = !!(!p && d(r.dirtyFields, t)), M || p ? k(r.dirtyFields, t) : V(r.dirtyFields, t, !0), x.dirtyFields = r.dirtyFields, o = o || A.dirtyFields && h !== !M;
495
496
  }
496
- if (n) {
497
- const L = d(r.touchedFields, t);
498
- L || (V(r.touchedFields, t, n), x.touchedFields = r.touchedFields, o = o || F.touchedFields && L !== n);
497
+ if (a) {
498
+ const M = d(r.touchedFields, t);
499
+ M || (V(r.touchedFields, t, a), x.touchedFields = r.touchedFields, o = o || A.touchedFields && M !== a);
499
500
  }
500
501
  return o && c && v.state.next(x), o ? x : {};
501
- }, he = (t, i, n, f) => {
502
- const c = d(r.errors, t), o = F.isValid && Y(i) && r.isValid !== i;
503
- if (e.delayError && n ? (R = le(() => P(t, n)), R(e.delayError)) : (clearTimeout(M), R = null, n ? V(r.errors, t, n) : k(r.errors, t)), (n ? !te(c, n) : c) || !T(f) || o) {
502
+ }, se = (t, i, a, f) => {
503
+ const c = d(r.errors, t), o = A.isValid && ee(i) && r.isValid !== i;
504
+ if (e.delayError && a ? (L = ue(() => z(t, a)), L(e.delayError)) : (clearTimeout(N), L = null, a ? V(r.errors, t, a) : k(r.errors, t)), (a ? !re(c, a) : c) || !R(f) || o) {
504
505
  const h = {
505
506
  ...f,
506
- ...o && Y(i) ? { isValid: i } : {},
507
+ ...o && ee(i) ? { isValid: i } : {},
507
508
  errors: r.errors,
508
509
  name: t
509
510
  };
@@ -512,21 +513,21 @@ function Xt(e = {}) {
512
513
  ...h
513
514
  }, v.state.next(h);
514
515
  }
515
- }, ee = async (t) => {
516
- j(t, !0);
517
- const i = await s.resolver(a, s.context, jt(t || g.mount, l, s.criteriaMode, s.shouldUseNativeValidation));
518
- return j(t), i;
519
- }, se = async (t) => {
520
- const { errors: i } = await ee(t);
516
+ }, Q = async (t) => {
517
+ T(t, !0);
518
+ const i = await s.resolver(l, s.context, Gt(t || g.mount, n, s.criteriaMode, s.shouldUseNativeValidation));
519
+ return T(t), i;
520
+ }, ie = async (t) => {
521
+ const { errors: i } = await Q(t);
521
522
  if (t)
522
- for (const n of t) {
523
- const f = d(i, n);
524
- f ? V(r.errors, n, f) : k(r.errors, n);
523
+ for (const a of t) {
524
+ const f = d(i, a);
525
+ f ? V(r.errors, a, f) : k(r.errors, a);
525
526
  }
526
527
  else
527
528
  r.errors = i;
528
529
  return i;
529
- }, O = async (t, i, n = {
530
+ }, q = async (t, i, a = {
530
531
  valid: !0
531
532
  }) => {
532
533
  for (const f in t) {
@@ -535,106 +536,106 @@ function Xt(e = {}) {
535
536
  const { _f: o, ...h } = c;
536
537
  if (o) {
537
538
  const x = g.array.has(o.name);
538
- j([f], !0);
539
- const w = await rt(c, a, C, s.shouldUseNativeValidation && !i, x);
540
- if (j([f]), w[o.name] && (n.valid = !1, i))
539
+ T([f], !0);
540
+ const p = await rt(c, l, C, s.shouldUseNativeValidation && !i, x);
541
+ if (T([f]), p[o.name] && (a.valid = !1, i))
541
542
  break;
542
- !i && (d(w, o.name) ? x ? Wt(r.errors, w, o.name) : V(r.errors, o.name, w[o.name]) : k(r.errors, o.name));
543
+ !i && (d(p, o.name) ? x ? zt(r.errors, p, o.name) : V(r.errors, o.name, p[o.name]) : k(r.errors, o.name));
543
544
  }
544
- !T(h) && await O(h, i, n);
545
+ !R(h) && await q(h, i, a);
545
546
  }
546
547
  }
547
- return n.valid;
548
+ return a.valid;
548
549
  }, ge = () => {
549
550
  for (const t of g.unMount) {
550
- const i = d(l, t);
551
- i && (i._f.refs ? i._f.refs.every((n) => !Ce(n)) : !Ce(i._f.ref)) && we(t);
551
+ const i = d(n, t);
552
+ i && (i._f.refs ? i._f.refs.every((a) => !Be(a)) : !Be(i._f.ref)) && we(t);
552
553
  }
553
554
  g.unMount = /* @__PURE__ */ new Set();
554
- }, _ = (t, i) => (t && i && V(a, t, i), !te(Oe(), u)), b = (t, i, n) => Pt(t, g, {
555
- ...y.mount ? a : A(i) ? u : K(t) ? { [t]: i } : i
556
- }, n, i), D = (t) => Ae(d(y.mount ? a : u, t, e.shouldUnregister ? d(u, t, []) : [])), E = (t, i, n = {}) => {
557
- const f = d(l, t);
555
+ }, _ = (t, i) => (t && i && V(l, t, i), !re(Ne(), u)), b = (t, i, a) => Wt(t, g, {
556
+ ...y.mount ? l : w(i) ? u : J(t) ? { [t]: i } : i
557
+ }, a, i), D = (t) => Fe(d(y.mount ? l : u, t, e.shouldUnregister ? d(u, t, []) : [])), E = (t, i, a = {}) => {
558
+ const f = d(n, t);
558
559
  let c = i;
559
560
  if (f) {
560
561
  const o = f._f;
561
- o && (!o.disabled && V(a, t, dt(i, o)), c = be(o.ref) && B(i) ? "" : i, ot(o.ref) ? [...o.ref.options].forEach((h) => h.selected = c.includes(h.value)) : o.refs ? ye(o.ref) ? o.refs.length > 1 ? o.refs.forEach((h) => (!h.defaultChecked || !h.disabled) && (h.checked = Array.isArray(c) ? !!c.find((x) => x === h.value) : c === h.value)) : o.refs[0] && (o.refs[0].checked = !!c) : o.refs.forEach((h) => h.checked = h.value === c) : Le(o.ref) ? o.ref.value = "" : (o.ref.value = c, o.ref.type || v.values.next({
562
+ o && (!o.disabled && V(l, t, dt(i, o)), c = be(o.ref) && B(i) ? "" : i, ot(o.ref) ? [...o.ref.options].forEach((h) => h.selected = c.includes(h.value)) : o.refs ? he(o.ref) ? o.refs.length > 1 ? o.refs.forEach((h) => (!h.defaultChecked || !h.disabled) && (h.checked = Array.isArray(c) ? !!c.find((x) => x === h.value) : c === h.value)) : o.refs[0] && (o.refs[0].checked = !!c) : o.refs.forEach((h) => h.checked = h.value === c) : Me(o.ref) ? o.ref.value = "" : (o.ref.value = c, o.ref.type || v.values.next({
562
563
  name: t,
563
- values: { ...a }
564
+ values: { ...l }
564
565
  })));
565
566
  }
566
- (n.shouldDirty || n.shouldTouch) && re(t, c, n.shouldTouch, n.shouldDirty, !0), n.shouldValidate && ce(t);
567
- }, q = (t, i, n) => {
567
+ (a.shouldDirty || a.shouldTouch) && Y(t, c, a.shouldTouch, a.shouldDirty, !0), a.shouldValidate && fe(t);
568
+ }, j = (t, i, a) => {
568
569
  for (const f in i) {
569
- const c = i[f], o = `${t}.${f}`, h = d(l, o);
570
- (g.array.has(t) || !Ve(c) || h && !h._f) && !ae(c) ? q(o, c, n) : E(o, c, n);
570
+ const c = i[f], o = `${t}.${f}`, h = d(n, o);
571
+ (g.array.has(t) || !Ve(c) || h && !h._f) && !ne(c) ? j(o, c, a) : E(o, c, a);
571
572
  }
572
- }, N = (t, i, n = {}) => {
573
- const f = d(l, t), c = g.array.has(t), o = U(i);
574
- V(a, t, o), c ? (v.array.next({
573
+ }, I = (t, i, a = {}) => {
574
+ const f = d(n, t), c = g.array.has(t), o = P(i);
575
+ V(l, t, o), c ? (v.array.next({
575
576
  name: t,
576
- values: { ...a }
577
- }), (F.isDirty || F.dirtyFields) && n.shouldDirty && v.state.next({
577
+ values: { ...l }
578
+ }), (A.isDirty || A.dirtyFields) && a.shouldDirty && v.state.next({
578
579
  name: t,
579
- dirtyFields: ve(u, a),
580
+ dirtyFields: ve(u, l),
580
581
  isDirty: _(t, o)
581
- })) : f && !f._f && !B(o) ? q(t, o, n) : E(t, o, n), Xe(t, g) && v.state.next({ ...r }), v.values.next({
582
+ })) : f && !f._f && !B(o) ? j(t, o, a) : E(t, o, a), Xe(t, g) && v.state.next({ ...r }), v.values.next({
582
583
  name: y.mount ? t : void 0,
583
- values: { ...a }
584
+ values: { ...l }
584
585
  });
585
- }, ue = async (t) => {
586
+ }, oe = async (t) => {
586
587
  y.mount = !0;
587
588
  const i = t.target;
588
- let n = i.name, f = !0;
589
- const c = d(l, n), o = () => i.type ? Be(c._f) : Rt(t), h = (x) => {
590
- f = Number.isNaN(x) || x === d(a, n, x);
589
+ let a = i.name, f = !0;
590
+ const c = d(n, a), o = () => i.type ? Te(c._f) : Mt(t), h = (x) => {
591
+ f = Number.isNaN(x) || x === d(l, a, x);
591
592
  };
592
593
  if (c) {
593
- let x, w;
594
- const L = o(), ie = t.type === Je.BLUR || t.type === Je.FOCUS_OUT, _t = !Kt(c._f) && !s.resolver && !d(r.errors, n) && !c._f.deps || Gt(ie, d(r.touchedFields, n), r.isSubmitted, z, G), De = Xe(n, g, ie);
595
- V(a, n, L), ie ? (c._f.onBlur && c._f.onBlur(t), R && R(0)) : c._f.onChange && c._f.onChange(t);
596
- const ke = re(n, L, ie, !1), mt = !T(ke) || De;
597
- if (!ie && v.values.next({
598
- name: n,
594
+ let x, p;
595
+ const M = o(), ae = t.type === Je.BLUR || t.type === Je.FOCUS_OUT, _t = !Jt(c._f) && !s.resolver && !d(r.errors, a) && !c._f.deps || Qt(ae, d(r.touchedFields, a), r.isSubmitted, G, U), De = Xe(a, g, ae);
596
+ V(l, a, M), ae ? (c._f.onBlur && c._f.onBlur(t), L && L(0)) : c._f.onChange && c._f.onChange(t);
597
+ const ke = Y(a, M, ae, !1), mt = !R(ke) || De;
598
+ if (!ae && v.values.next({
599
+ name: a,
599
600
  type: t.type,
600
- values: { ...a }
601
+ values: { ...l }
601
602
  }), _t)
602
- return F.isValid && $(), mt && v.state.next({ name: n, ...De ? {} : ke });
603
- if (!ie && De && v.state.next({ ...r }), s.resolver) {
604
- const { errors: ze } = await ee([n]);
605
- if (h(L), f) {
606
- const bt = st(r.errors, l, n), $e = st(ze, l, bt.name || n);
607
- x = $e.error, n = $e.name, w = T(ze);
603
+ return A.isValid && H(), mt && v.state.next({ name: a, ...De ? {} : ke });
604
+ if (!ae && De && v.state.next({ ...r }), s.resolver) {
605
+ const { errors: $e } = await Q([a]);
606
+ if (h(M), f) {
607
+ const bt = st(r.errors, n, a), je = st($e, n, bt.name || a);
608
+ x = je.error, a = je.name, p = R($e);
608
609
  }
609
610
  } else
610
- j([n], !0), x = (await rt(c, a, C, s.shouldUseNativeValidation))[n], j([n]), h(L), f && (x ? w = !1 : F.isValid && (w = await O(l, !0)));
611
- f && (c._f.deps && ce(c._f.deps), he(n, w, x, ke));
611
+ T([a], !0), x = (await rt(c, l, C, s.shouldUseNativeValidation))[a], T([a]), h(M), f && (x ? p = !1 : A.isValid && (p = await q(n, !0)));
612
+ f && (c._f.deps && fe(c._f.deps), se(a, p, x, ke));
612
613
  }
613
- }, oe = (t, i) => {
614
+ }, ce = (t, i) => {
614
615
  if (d(r.errors, i) && t.focus)
615
616
  return t.focus(), 1;
616
- }, ce = async (t, i = {}) => {
617
- let n, f;
617
+ }, fe = async (t, i = {}) => {
618
+ let a, f;
618
619
  const c = _e(t);
619
620
  if (s.resolver) {
620
- const o = await se(A(t) ? t : c);
621
- n = T(o), f = t ? !c.some((h) => d(o, h)) : n;
621
+ const o = await ie(w(t) ? t : c);
622
+ a = R(o), f = t ? !c.some((h) => d(o, h)) : a;
622
623
  } else
623
624
  t ? (f = (await Promise.all(c.map(async (o) => {
624
- const h = d(l, o);
625
- return await O(h && h._f ? { [o]: h } : h);
626
- }))).every(Boolean), !(!f && !r.isValid) && $()) : f = n = await O(l);
625
+ const h = d(n, o);
626
+ return await q(h && h._f ? { [o]: h } : h);
627
+ }))).every(Boolean), !(!f && !r.isValid) && H()) : f = a = await q(n);
627
628
  return v.state.next({
628
- ...!K(t) || F.isValid && n !== r.isValid ? {} : { name: t },
629
- ...s.resolver || !t ? { isValid: n } : {},
629
+ ...!J(t) || A.isValid && a !== r.isValid ? {} : { name: t },
630
+ ...s.resolver || !t ? { isValid: a } : {},
630
631
  errors: r.errors
631
- }), i.shouldFocus && !f && de(l, oe, t ? c : g.mount), f;
632
- }, Oe = (t) => {
632
+ }), i.shouldFocus && !f && ye(n, ce, t ? c : g.mount), f;
633
+ }, Ne = (t) => {
633
634
  const i = {
634
- ...y.mount ? a : u
635
+ ...y.mount ? l : u
635
636
  };
636
- return A(t) ? i : K(t) ? d(i, t) : t.map((n) => d(i, n));
637
- }, Ne = (t, i) => ({
637
+ return w(t) ? i : J(t) ? d(i, t) : t.map((a) => d(i, a));
638
+ }, Ue = (t, i) => ({
638
639
  invalid: !!d((i || r).errors, t),
639
640
  isDirty: !!d((i || r).dirtyFields, t),
640
641
  error: d((i || r).errors, t),
@@ -644,148 +645,148 @@ function Xt(e = {}) {
644
645
  t && _e(t).forEach((i) => k(r.errors, i)), v.state.next({
645
646
  errors: t ? r.errors : {}
646
647
  });
647
- }, Ue = (t, i, n) => {
648
- const f = (d(l, t, { _f: {} })._f || {}).ref, c = d(r.errors, t) || {}, { ref: o, message: h, type: x, ...w } = c;
648
+ }, qe = (t, i, a) => {
649
+ const f = (d(n, t, { _f: {} })._f || {}).ref, c = d(r.errors, t) || {}, { ref: o, message: h, type: x, ...p } = c;
649
650
  V(r.errors, t, {
650
- ...w,
651
+ ...p,
651
652
  ...i,
652
653
  ref: f
653
654
  }), v.state.next({
654
655
  name: t,
655
656
  errors: r.errors,
656
657
  isValid: !1
657
- }), n && n.shouldFocus && f && f.focus && f.focus();
658
- }, ht = (t, i) => Z(t) ? v.values.subscribe({
659
- next: (n) => t(b(void 0, i), n)
658
+ }), a && a.shouldFocus && f && f.focus && f.focus();
659
+ }, ht = (t, i) => te(t) ? v.values.subscribe({
660
+ next: (a) => t(b(void 0, i), a)
660
661
  }) : b(t, i, !0), we = (t, i = {}) => {
661
- for (const n of t ? _e(t) : g.mount)
662
- g.mount.delete(n), g.array.delete(n), i.keepValue || (k(l, n), k(a, n)), !i.keepError && k(r.errors, n), !i.keepDirty && k(r.dirtyFields, n), !i.keepTouched && k(r.touchedFields, n), !i.keepIsValidating && k(r.validatingFields, n), !s.shouldUnregister && !i.keepDefaultValue && k(u, n);
662
+ for (const a of t ? _e(t) : g.mount)
663
+ g.mount.delete(a), g.array.delete(a), i.keepValue || (k(n, a), k(l, a)), !i.keepError && k(r.errors, a), !i.keepDirty && k(r.dirtyFields, a), !i.keepTouched && k(r.touchedFields, a), !i.keepIsValidating && k(r.validatingFields, a), !s.shouldUnregister && !i.keepDefaultValue && k(u, a);
663
664
  v.values.next({
664
- values: { ...a }
665
+ values: { ...l }
665
666
  }), v.state.next({
666
667
  ...r,
667
668
  ...i.keepDirty ? { isDirty: _() } : {}
668
- }), !i.keepIsValid && $();
669
- }, Ie = ({ disabled: t, name: i, field: n, fields: f, value: c }) => {
670
- if (Y(t) && y.mount || t) {
671
- const o = t ? void 0 : A(c) ? Be(n ? n._f : d(f, i)._f) : c;
672
- V(a, i, o), re(i, o, !1, !1, !0);
669
+ }), !i.keepIsValid && H();
670
+ }, Ie = ({ disabled: t, name: i, field: a, fields: f, value: c }) => {
671
+ if (ee(t) && y.mount || t) {
672
+ const o = t ? void 0 : w(c) ? Te(a ? a._f : d(f, i)._f) : c;
673
+ V(l, i, o), Y(i, o, !1, !1, !0);
673
674
  }
674
675
  }, pe = (t, i = {}) => {
675
- let n = d(l, t);
676
- const f = Y(i.disabled);
677
- return V(l, t, {
678
- ...n || {},
676
+ let a = d(n, t);
677
+ const f = ee(i.disabled);
678
+ return V(n, t, {
679
+ ...a || {},
679
680
  _f: {
680
- ...n && n._f ? n._f : { ref: { name: t } },
681
+ ...a && a._f ? a._f : { ref: { name: t } },
681
682
  name: t,
682
683
  mount: !0,
683
684
  ...i
684
685
  }
685
- }), g.mount.add(t), n ? Ie({
686
- field: n,
686
+ }), g.mount.add(t), a ? Ie({
687
+ field: a,
687
688
  disabled: i.disabled,
688
689
  name: t,
689
690
  value: i.value
690
- }) : p(t, !0, i.value), {
691
+ }) : F(t, !0, i.value), {
691
692
  ...f ? { disabled: i.disabled } : {},
692
693
  ...s.progressive ? {
693
694
  required: !!i.required,
694
- min: fe(i.min),
695
- max: fe(i.max),
696
- minLength: fe(i.minLength),
697
- maxLength: fe(i.maxLength),
698
- pattern: fe(i.pattern)
695
+ min: de(i.min),
696
+ max: de(i.max),
697
+ minLength: de(i.minLength),
698
+ maxLength: de(i.maxLength),
699
+ pattern: de(i.pattern)
699
700
  } : {},
700
701
  name: t,
701
- onChange: ue,
702
- onBlur: ue,
702
+ onChange: oe,
703
+ onBlur: oe,
703
704
  ref: (c) => {
704
705
  if (c) {
705
- pe(t, i), n = d(l, t);
706
- const o = A(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, h = $t(o), x = n._f.refs || [];
707
- if (h ? x.find((w) => w === o) : o === n._f.ref)
706
+ pe(t, i), a = d(n, t);
707
+ const o = w(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, h = Kt(o), x = a._f.refs || [];
708
+ if (h ? x.find((p) => p === o) : o === a._f.ref)
708
709
  return;
709
- V(l, t, {
710
+ V(n, t, {
710
711
  _f: {
711
- ...n._f,
712
+ ...a._f,
712
713
  ...h ? {
713
714
  refs: [
714
- ...x.filter(Ce),
715
+ ...x.filter(Be),
715
716
  o,
716
717
  ...Array.isArray(d(u, t)) ? [{}] : []
717
718
  ],
718
719
  ref: { type: o.type, name: t }
719
720
  } : { ref: o }
720
721
  }
721
- }), p(t, !1, void 0, o);
722
+ }), F(t, !1, void 0, o);
722
723
  } else
723
- n = d(l, t, {}), n._f && (n._f.mount = !1), (s.shouldUnregister || i.shouldUnregister) && !(Mt(g.array, t) && y.action) && g.unMount.add(t);
724
+ a = d(n, t, {}), a._f && (a._f.mount = !1), (s.shouldUnregister || i.shouldUnregister) && !(Nt(g.array, t) && y.action) && g.unMount.add(t);
724
725
  }
725
726
  };
726
- }, Pe = () => s.shouldFocusError && de(l, oe, g.mount), gt = (t) => {
727
- Y(t) && (v.state.next({ disabled: t }), de(l, (i, n) => {
728
- const f = d(l, n);
727
+ }, Pe = () => s.shouldFocusError && ye(n, ce, g.mount), gt = (t) => {
728
+ ee(t) && (v.state.next({ disabled: t }), ye(n, (i, a) => {
729
+ const f = d(n, a);
729
730
  f && (i.disabled = f._f.disabled || t, Array.isArray(f._f.refs) && f._f.refs.forEach((c) => {
730
731
  c.disabled = f._f.disabled || t;
731
732
  }));
732
733
  }, 0, !1));
733
- }, qe = (t, i) => async (n) => {
734
+ }, We = (t, i) => async (a) => {
734
735
  let f;
735
- n && (n.preventDefault && n.preventDefault(), n.persist && n.persist());
736
- let c = U(a);
736
+ a && (a.preventDefault && a.preventDefault(), a.persist && a.persist());
737
+ let c = P(l);
737
738
  if (v.state.next({
738
739
  isSubmitting: !0
739
740
  }), s.resolver) {
740
- const { errors: o, values: h } = await ee();
741
+ const { errors: o, values: h } = await Q();
741
742
  r.errors = o, c = h;
742
743
  } else
743
- await O(l);
744
- if (k(r.errors, "root"), T(r.errors)) {
744
+ await q(n);
745
+ if (k(r.errors, "root"), R(r.errors)) {
745
746
  v.state.next({
746
747
  errors: {}
747
748
  });
748
749
  try {
749
- await t(c, n);
750
+ await t(c, a);
750
751
  } catch (o) {
751
752
  f = o;
752
753
  }
753
754
  } else
754
- i && await i({ ...r.errors }, n), Pe(), setTimeout(Pe);
755
+ i && await i({ ...r.errors }, a), Pe(), setTimeout(Pe);
755
756
  if (v.state.next({
756
757
  isSubmitted: !0,
757
758
  isSubmitting: !1,
758
- isSubmitSuccessful: T(r.errors) && !f,
759
+ isSubmitSuccessful: R(r.errors) && !f,
759
760
  submitCount: r.submitCount + 1,
760
761
  errors: r.errors
761
762
  }), f)
762
763
  throw f;
763
764
  }, vt = (t, i = {}) => {
764
- d(l, t) && (A(i.defaultValue) ? N(t, U(d(u, t))) : (N(t, i.defaultValue), V(u, t, U(i.defaultValue))), i.keepTouched || k(r.touchedFields, t), i.keepDirty || (k(r.dirtyFields, t), r.isDirty = i.defaultValue ? _(t, U(d(u, t))) : _()), i.keepError || (k(r.errors, t), F.isValid && $()), v.state.next({ ...r }));
765
- }, We = (t, i = {}) => {
766
- const n = t ? U(t) : u, f = U(n), c = T(t), o = c ? u : f;
767
- if (i.keepDefaultValues || (u = n), !i.keepValues) {
765
+ d(n, t) && (w(i.defaultValue) ? I(t, P(d(u, t))) : (I(t, i.defaultValue), V(u, t, P(i.defaultValue))), i.keepTouched || k(r.touchedFields, t), i.keepDirty || (k(r.dirtyFields, t), r.isDirty = i.defaultValue ? _(t, P(d(u, t))) : _()), i.keepError || (k(r.errors, t), A.isValid && H()), v.state.next({ ...r }));
766
+ }, He = (t, i = {}) => {
767
+ const a = t ? P(t) : u, f = P(a), c = R(t), o = c ? u : f;
768
+ if (i.keepDefaultValues || (u = a), !i.keepValues) {
768
769
  if (i.keepDirtyValues)
769
770
  for (const h of g.mount)
770
- d(r.dirtyFields, h) ? V(o, h, d(a, h)) : N(h, d(o, h));
771
+ d(r.dirtyFields, h) ? V(o, h, d(l, h)) : I(h, d(o, h));
771
772
  else {
772
- if (Te && A(t))
773
+ if (Re && w(t))
773
774
  for (const h of g.mount) {
774
- const x = d(l, h);
775
+ const x = d(n, h);
775
776
  if (x && x._f) {
776
- const w = Array.isArray(x._f.refs) ? x._f.refs[0] : x._f.ref;
777
- if (be(w)) {
778
- const L = w.closest("form");
779
- if (L) {
780
- L.reset();
777
+ const p = Array.isArray(x._f.refs) ? x._f.refs[0] : x._f.ref;
778
+ if (be(p)) {
779
+ const M = p.closest("form");
780
+ if (M) {
781
+ M.reset();
781
782
  break;
782
783
  }
783
784
  }
784
785
  }
785
786
  }
786
- l = {};
787
+ n = {};
787
788
  }
788
- a = e.shouldUnregister ? i.keepDefaultValues ? U(u) : {} : U(o), v.array.next({
789
+ l = e.shouldUnregister ? i.keepDefaultValues ? P(u) : {} : P(o), v.array.next({
789
790
  values: { ...o }
790
791
  }), v.values.next({
791
792
  values: { ...o }
@@ -798,35 +799,35 @@ function Xt(e = {}) {
798
799
  watch: /* @__PURE__ */ new Set(),
799
800
  watchAll: !1,
800
801
  focus: ""
801
- }, y.mount = !F.isValid || !!i.keepIsValid || !!i.keepDirtyValues, y.watch = !!e.shouldUnregister, v.state.next({
802
+ }, y.mount = !A.isValid || !!i.keepIsValid || !!i.keepDirtyValues, y.watch = !!e.shouldUnregister, v.state.next({
802
803
  submitCount: i.keepSubmitCount ? r.submitCount : 0,
803
- isDirty: c ? !1 : i.keepDirty ? r.isDirty : !!(i.keepDefaultValues && !te(t, u)),
804
+ isDirty: c ? !1 : i.keepDirty ? r.isDirty : !!(i.keepDefaultValues && !re(t, u)),
804
805
  isSubmitted: i.keepIsSubmitted ? r.isSubmitted : !1,
805
- dirtyFields: c ? {} : i.keepDirtyValues ? i.keepDefaultValues && a ? ve(u, a) : r.dirtyFields : i.keepDefaultValues && t ? ve(u, t) : i.keepDirty ? r.dirtyFields : {},
806
+ dirtyFields: c ? {} : i.keepDirtyValues ? i.keepDefaultValues && l ? ve(u, l) : r.dirtyFields : i.keepDefaultValues && t ? ve(u, t) : i.keepDirty ? r.dirtyFields : {},
806
807
  touchedFields: i.keepTouched ? r.touchedFields : {},
807
808
  errors: i.keepErrors ? r.errors : {},
808
809
  isSubmitSuccessful: i.keepIsSubmitSuccessful ? r.isSubmitSuccessful : !1,
809
810
  isSubmitting: !1
810
811
  });
811
- }, He = (t, i) => We(Z(t) ? t(a) : t, i);
812
+ }, ze = (t, i) => He(te(t) ? t(l) : t, i);
812
813
  return {
813
814
  control: {
814
815
  register: pe,
815
816
  unregister: we,
816
- getFieldState: Ne,
817
- handleSubmit: qe,
818
- setError: Ue,
819
- _executeSchema: ee,
817
+ getFieldState: Ue,
818
+ handleSubmit: We,
819
+ setError: qe,
820
+ _executeSchema: Q,
820
821
  _getWatch: b,
821
822
  _getDirty: _,
822
- _updateValid: $,
823
+ _updateValid: H,
823
824
  _removeUnmounted: ge,
824
825
  _updateFieldArray: m,
825
826
  _updateDisabledField: Ie,
826
827
  _getFieldArray: D,
827
- _reset: We,
828
- _resetDefaultValues: () => Z(s.defaultValues) && s.defaultValues().then((t) => {
829
- He(t, s.resetOptions), v.state.next({
828
+ _reset: He,
829
+ _resetDefaultValues: () => te(s.defaultValues) && s.defaultValues().then((t) => {
830
+ ze(t, s.resetOptions), v.state.next({
830
831
  isLoading: !1
831
832
  });
832
833
  }),
@@ -838,13 +839,13 @@ function Xt(e = {}) {
838
839
  },
839
840
  _disableForm: gt,
840
841
  _subjects: v,
841
- _proxyFormState: F,
842
- _setErrors: J,
842
+ _proxyFormState: A,
843
+ _setErrors: $,
843
844
  get _fields() {
844
- return l;
845
+ return n;
845
846
  },
846
847
  get _formValues() {
847
- return a;
848
+ return l;
848
849
  },
849
850
  get _state() {
850
851
  return y;
@@ -877,32 +878,32 @@ function Xt(e = {}) {
877
878
  };
878
879
  }
879
880
  },
880
- trigger: ce,
881
+ trigger: fe,
881
882
  register: pe,
882
- handleSubmit: qe,
883
+ handleSubmit: We,
883
884
  watch: ht,
884
- setValue: N,
885
- getValues: Oe,
886
- reset: He,
885
+ setValue: I,
886
+ getValues: Ne,
887
+ reset: ze,
887
888
  resetField: vt,
888
889
  clearErrors: yt,
889
890
  unregister: we,
890
- setError: Ue,
891
+ setError: qe,
891
892
  setFocus: (t, i = {}) => {
892
- const n = d(l, t), f = n && n._f;
893
+ const a = d(n, t), f = a && a._f;
893
894
  if (f) {
894
895
  const c = f.refs ? f.refs[0] : f.ref;
895
896
  c.focus && (c.focus(), i.shouldSelect && c.select());
896
897
  }
897
898
  },
898
- getFieldState: Ne
899
+ getFieldState: Ue
899
900
  };
900
901
  }
901
- function Yt(e = {}) {
902
- const s = I.useRef(), r = I.useRef(), [l, u] = I.useState({
902
+ function er(e = {}) {
903
+ const s = W.useRef(), r = W.useRef(), [n, u] = W.useState({
903
904
  isDirty: !1,
904
905
  isValidating: !1,
905
- isLoading: Z(e.defaultValues),
906
+ isLoading: te(e.defaultValues),
906
907
  isSubmitted: !1,
907
908
  isSubmitting: !1,
908
909
  isSubmitSuccessful: !1,
@@ -913,139 +914,169 @@ function Yt(e = {}) {
913
914
  validatingFields: {},
914
915
  errors: e.errors || {},
915
916
  disabled: e.disabled || !1,
916
- defaultValues: Z(e.defaultValues) ? void 0 : e.defaultValues
917
+ defaultValues: te(e.defaultValues) ? void 0 : e.defaultValues
917
918
  });
918
919
  s.current || (s.current = {
919
- ...Xt(e),
920
- formState: l
920
+ ...Zt(e),
921
+ formState: n
921
922
  });
922
- const a = s.current.control;
923
- return a._options = e, It({
924
- subject: a._subjects.state,
923
+ const l = s.current.control;
924
+ return l._options = e, Pt({
925
+ subject: l._subjects.state,
925
926
  next: (y) => {
926
- Ut(y, a._proxyFormState, a._updateFormState) && u({ ...a._formState });
927
+ It(y, l._proxyFormState, l._updateFormState) && u({ ...l._formState });
927
928
  }
928
- }), I.useEffect(() => a._disableForm(e.disabled), [a, e.disabled]), I.useEffect(() => {
929
- if (a._proxyFormState.isDirty) {
930
- const y = a._getDirty();
931
- y !== l.isDirty && a._subjects.state.next({
929
+ }), W.useEffect(() => l._disableForm(e.disabled), [l, e.disabled]), W.useEffect(() => {
930
+ if (l._proxyFormState.isDirty) {
931
+ const y = l._getDirty();
932
+ y !== n.isDirty && l._subjects.state.next({
932
933
  isDirty: y
933
934
  });
934
935
  }
935
- }, [a, l.isDirty]), I.useEffect(() => {
936
- e.values && !te(e.values, r.current) ? (a._reset(e.values, a._options.resetOptions), r.current = e.values, u((y) => ({ ...y }))) : a._resetDefaultValues();
937
- }, [e.values, a]), I.useEffect(() => {
938
- e.errors && a._setErrors(e.errors);
939
- }, [e.errors, a]), I.useEffect(() => {
940
- a._state.mount || (a._updateValid(), a._state.mount = !0), a._state.watch && (a._state.watch = !1, a._subjects.state.next({ ...a._formState })), a._removeUnmounted();
941
- }), I.useEffect(() => {
942
- e.shouldUnregister && a._subjects.values.next({
943
- values: a._getWatch()
936
+ }, [l, n.isDirty]), W.useEffect(() => {
937
+ e.values && !re(e.values, r.current) ? (l._reset(e.values, l._options.resetOptions), r.current = e.values, u((y) => ({ ...y }))) : l._resetDefaultValues();
938
+ }, [e.values, l]), W.useEffect(() => {
939
+ e.errors && l._setErrors(e.errors);
940
+ }, [e.errors, l]), W.useEffect(() => {
941
+ l._state.mount || (l._updateValid(), l._state.mount = !0), l._state.watch && (l._state.watch = !1, l._subjects.state.next({ ...l._formState })), l._removeUnmounted();
942
+ }), W.useEffect(() => {
943
+ e.shouldUnregister && l._subjects.values.next({
944
+ values: l._getWatch()
944
945
  });
945
- }, [e.shouldUnregister, a]), s.current.formState = Nt(l, a), s.current;
946
+ }, [e.shouldUnregister, l]), s.current.formState = qt(n, l), s.current;
946
947
  }
947
948
  const it = `Я принимаю условия Политики обработки
948
949
  и защиты персональных данных, даю согласия на обработку персональных
949
- данных`, dr = ({
950
+ данных`, gr = ({
950
951
  isFormOpen: e,
951
952
  setIsFormOpen: s,
952
953
  title: r,
953
- subTitle: l,
954
- submitHandler: u,
955
- personalCheckBox: a = { text: it, isRequired: !0 },
956
- advCheckBox: y = { text: it, isRequired: !0 }
954
+ isEmail: n,
955
+ isTextArea: u,
956
+ textAreaPlaceholder: l,
957
+ subTitle: y,
958
+ submitHandler: g,
959
+ modalWidth: L = "442px",
960
+ rowsTextArea: N = 2,
961
+ personalCheckBox: A = { text: it, isRequired: !0 },
962
+ advCheckBox: v = { text: it, isRequired: !0 }
957
963
  }) => {
958
964
  const {
959
- register: g,
960
- handleSubmit: R,
961
- trigger: M,
962
- reset: F,
963
- watch: v,
964
- formState: { errors: G }
965
- } = Yt(), { onChange: z, onBlur: C, ...le } = g("phone", {
965
+ register: U,
966
+ handleSubmit: G,
967
+ trigger: C,
968
+ reset: ue,
969
+ watch: H,
970
+ formState: { errors: T }
971
+ } = er(), { onChange: m, onBlur: z, ...$ } = U("phone", {
966
972
  required: !0,
967
973
  pattern: { value: wt, message: "" },
968
- onBlur: () => M("phone")
969
- }), $ = v("personalCheckBox"), j = v("advCheckBox"), m = (P) => {
970
- u(P), F();
974
+ onBlur: () => C("phone")
975
+ }), F = H("personalCheckBox"), Y = H("advCheckBox"), se = (Q) => {
976
+ g(Q), ue();
971
977
  };
972
- return /* @__PURE__ */ W(
978
+ return /* @__PURE__ */ O(
973
979
  Vt,
974
980
  {
975
981
  isOpen: e,
976
982
  emitIsOpen: () => s(!1),
977
- additionalClass: X.modal,
983
+ additionalClass: Z.modal,
978
984
  opacity: 0.7,
979
985
  isTransparentBack: !0,
980
- additionalClassModalBody: X.modalBody,
981
- children: /* @__PURE__ */ Se("div", { className: X.root, children: [
982
- /* @__PURE__ */ W("div", { className: X.title, dangerouslySetInnerHTML: { __html: r ?? "Оставить обращение" } }),
983
- /* @__PURE__ */ W(
986
+ additionalClassModalBody: Z.modalBody,
987
+ children: /* @__PURE__ */ Se("div", { className: Z.root, style: { width: L }, children: [
988
+ /* @__PURE__ */ O("div", { className: Z.title, dangerouslySetInnerHTML: { __html: r ?? "Оставить обращение" } }),
989
+ /* @__PURE__ */ O(
984
990
  "div",
985
991
  {
986
- className: X.description,
987
- dangerouslySetInnerHTML: { __html: l ?? "Оставьте номер телефона для получения консультации" }
992
+ className: Z.description,
993
+ dangerouslySetInnerHTML: { __html: y ?? "Оставьте номер телефона для получения консультации" }
988
994
  }
989
995
  ),
990
- /* @__PURE__ */ Se("form", { onSubmit: R(m), children: [
991
- /* @__PURE__ */ Se(Ft, { className: X.inputWrapper, children: [
992
- /* @__PURE__ */ W(
993
- je,
996
+ /* @__PURE__ */ Se("form", { onSubmit: G(se), children: [
997
+ /* @__PURE__ */ Se(At, { className: Z.inputWrapper, children: [
998
+ /* @__PURE__ */ O(
999
+ Ee,
994
1000
  {
995
1001
  width: "full",
996
1002
  size_s: "small",
997
1003
  variant: "light",
998
1004
  placeholder: "Введите имя",
999
1005
  "data-testid": "modal_name",
1000
- ...g("name", { required: !0, pattern: pt }),
1001
- error: !!G.name
1006
+ ...U("name", { required: !0, pattern: pt }),
1007
+ error: !!T.name
1002
1008
  }
1003
1009
  ),
1004
- /* @__PURE__ */ W(
1010
+ /* @__PURE__ */ O(
1005
1011
  xt,
1006
1012
  {
1007
1013
  inputMode: "numeric",
1008
1014
  name: "phone",
1009
1015
  mask: "+7 (999) 999-99-99",
1010
- onChange: z,
1016
+ onChange: m,
1011
1017
  placeholder: "+7 (- - -) - - - - - - -",
1012
- onBlur: C,
1013
- children: /* @__PURE__ */ W(
1014
- je,
1018
+ onBlur: z,
1019
+ children: /* @__PURE__ */ O(
1020
+ Ee,
1015
1021
  {
1016
1022
  width: "full",
1017
1023
  "data-testid": "phone_modal",
1018
1024
  type: "tel",
1019
1025
  size_s: "small",
1020
1026
  variant: "light",
1021
- ...le,
1022
- ...g("phone"),
1023
- error: !!G.phone
1027
+ ...$,
1028
+ ...U("phone"),
1029
+ error: !!T.phone
1024
1030
  }
1025
1031
  )
1026
1032
  }
1027
1033
  ),
1028
- y && /* @__PURE__ */ W(
1034
+ n && /* @__PURE__ */ O(
1035
+ Ee,
1036
+ {
1037
+ width: "full",
1038
+ size_s: "small",
1039
+ variant: "light",
1040
+ placeholder: "Введите email",
1041
+ "data-testid": "modal_email",
1042
+ ...U(
1043
+ "email",
1044
+ { required: !1, pattern: Dt }
1045
+ ),
1046
+ error: !!T.email
1047
+ }
1048
+ ),
1049
+ u && /* @__PURE__ */ O(
1050
+ kt,
1051
+ {
1052
+ "data-testid": "modal_textarea",
1053
+ placeholder: l,
1054
+ rows: N,
1055
+ width: "full",
1056
+ ...U("textarea")
1057
+ }
1058
+ ),
1059
+ v && /* @__PURE__ */ O(
1029
1060
  Ge,
1030
1061
  {
1031
1062
  "data-testid": "modal_advCheckBox",
1032
- isChecked: j,
1033
- error: !!G.advCheckBox,
1034
- text: y.text,
1035
- ...g("advCheckBox", { required: y == null ? void 0 : y.isRequired })
1063
+ isChecked: Y,
1064
+ error: !!T.advCheckBox,
1065
+ text: v.text,
1066
+ ...U("advCheckBox", { required: v == null ? void 0 : v.isRequired })
1036
1067
  }
1037
1068
  ),
1038
- /* @__PURE__ */ W(
1069
+ /* @__PURE__ */ O(
1039
1070
  Ge,
1040
1071
  {
1041
1072
  "data-testid": "modal_personalCheckBox",
1042
- isChecked: $,
1043
- error: !!G.personalCheckBox,
1044
- text: a.text,
1045
- ...g("personalCheckBox", { required: a.isRequired })
1073
+ isChecked: F,
1074
+ error: !!T.personalCheckBox,
1075
+ text: A.text,
1076
+ ...U("personalCheckBox", { required: A.isRequired })
1046
1077
  }
1047
1078
  ),
1048
- /* @__PURE__ */ W(
1079
+ /* @__PURE__ */ O(
1049
1080
  Ke,
1050
1081
  {
1051
1082
  "data-testid": "modal_submit",
@@ -1054,22 +1085,22 @@ const it = `Я принимаю условия Политики обработк
1054
1085
  type: "submit",
1055
1086
  size: "large",
1056
1087
  as: "button",
1057
- additionalClass: X.modalBtn,
1088
+ additionalClass: Z.modalBtn,
1058
1089
  children: "Отправить"
1059
1090
  }
1060
1091
  )
1061
1092
  ] }),
1062
- /* @__PURE__ */ W(
1093
+ /* @__PURE__ */ O(
1063
1094
  Ke,
1064
1095
  {
1065
- additionalClass: X.btn,
1096
+ additionalClass: Z.btn,
1066
1097
  onClick: () => s(!1),
1067
1098
  as: "button",
1068
1099
  variant: "gray",
1069
1100
  type: "button",
1070
1101
  size: "small",
1071
- children: /* @__PURE__ */ W(
1072
- At,
1102
+ children: /* @__PURE__ */ O(
1103
+ Ft,
1073
1104
  {
1074
1105
  name: "close",
1075
1106
  size: "16",
@@ -1084,5 +1115,5 @@ const it = `Я принимаю условия Политики обработк
1084
1115
  );
1085
1116
  };
1086
1117
  export {
1087
- dr as ModalForm
1118
+ gr as ModalForm
1088
1119
  };