stone-kit 0.0.188 → 0.0.190

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,1629 +1,77 @@
1
- import { jsx as we, jsxs as at } from "react/jsx-runtime";
2
- import { g as _r } from "../../../index-rKuIKazb.js";
3
- import Pe from "react";
4
- import { r as rr, M as Sr } from "../../../Modal-G1ISsPJt.js";
5
- import { Flex as kr } from "../../Flex/ui/Flex.js";
6
- import { Input as At } from "../../Input/ui/Input.js";
7
- import { Button as Tt } from "../../Button/ui/Button.js";
8
- import { NewIcon as Pr } from "../../NewIcon/ui/NewIcon.js";
9
- import { phoneReg as xr, nameReg as wr } from "../utils/reg.js";
10
- import { CheckBox as Rt } from "../../CheckBox/CheckBox.js";
11
- var bt = { exports: {} }, st = { exports: {} }, ze = { exports: {} }, He = { exports: {} }, se = {};
12
- /** @license React v16.13.1
13
- * react-is.production.min.js
14
- *
15
- * Copyright (c) Facebook, Inc. and its affiliates.
16
- *
17
- * This source code is licensed under the MIT license found in the
18
- * LICENSE file in the root directory of this source tree.
19
- */
20
- var Vt;
21
- function Or() {
22
- if (Vt)
23
- return se;
24
- Vt = 1;
25
- var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, l = e ? Symbol.for("react.fragment") : 60107, f = e ? Symbol.for("react.strict_mode") : 60108, i = e ? Symbol.for("react.profiler") : 60114, E = e ? Symbol.for("react.provider") : 60109, k = e ? Symbol.for("react.context") : 60110, X = e ? Symbol.for("react.async_mode") : 60111, H = e ? Symbol.for("react.concurrent_mode") : 60111, L = e ? Symbol.for("react.forward_ref") : 60112, V = e ? Symbol.for("react.suspense") : 60113, ne = e ? Symbol.for("react.suspense_list") : 60120, G = e ? Symbol.for("react.memo") : 60115, te = e ? Symbol.for("react.lazy") : 60116, K = e ? Symbol.for("react.block") : 60121, re = e ? Symbol.for("react.fundamental") : 60117, ue = e ? Symbol.for("react.responder") : 60118, Z = e ? Symbol.for("react.scope") : 60119;
26
- function ie(o) {
27
- if (typeof o == "object" && o !== null) {
28
- var _ = o.$$typeof;
29
- switch (_) {
30
- case t:
31
- switch (o = o.type, o) {
32
- case X:
33
- case H:
34
- case l:
35
- case i:
36
- case f:
37
- case V:
38
- return o;
39
- default:
40
- switch (o = o && o.$$typeof, o) {
41
- case k:
42
- case L:
43
- case te:
44
- case G:
45
- case E:
46
- return o;
47
- default:
48
- return _;
49
- }
50
- }
51
- case r:
52
- return _;
53
- }
54
- }
55
- }
56
- function ee(o) {
57
- return ie(o) === H;
58
- }
59
- return se.AsyncMode = X, se.ConcurrentMode = H, se.ContextConsumer = k, se.ContextProvider = E, se.Element = t, se.ForwardRef = L, se.Fragment = l, se.Lazy = te, se.Memo = G, se.Portal = r, se.Profiler = i, se.StrictMode = f, se.Suspense = V, se.isAsyncMode = function(o) {
60
- return ee(o) || ie(o) === X;
61
- }, se.isConcurrentMode = ee, se.isContextConsumer = function(o) {
62
- return ie(o) === k;
63
- }, se.isContextProvider = function(o) {
64
- return ie(o) === E;
65
- }, se.isElement = function(o) {
66
- return typeof o == "object" && o !== null && o.$$typeof === t;
67
- }, se.isForwardRef = function(o) {
68
- return ie(o) === L;
69
- }, se.isFragment = function(o) {
70
- return ie(o) === l;
71
- }, se.isLazy = function(o) {
72
- return ie(o) === te;
73
- }, se.isMemo = function(o) {
74
- return ie(o) === G;
75
- }, se.isPortal = function(o) {
76
- return ie(o) === r;
77
- }, se.isProfiler = function(o) {
78
- return ie(o) === i;
79
- }, se.isStrictMode = function(o) {
80
- return ie(o) === f;
81
- }, se.isSuspense = function(o) {
82
- return ie(o) === V;
83
- }, se.isValidElementType = function(o) {
84
- return typeof o == "string" || typeof o == "function" || o === l || o === H || o === i || o === f || o === V || o === ne || typeof o == "object" && o !== null && (o.$$typeof === te || o.$$typeof === G || o.$$typeof === E || o.$$typeof === k || o.$$typeof === L || o.$$typeof === re || o.$$typeof === ue || o.$$typeof === Z || o.$$typeof === K);
85
- }, se.typeOf = ie, se;
86
- }
87
- var oe = {};
88
- /** @license React v16.13.1
89
- * react-is.development.js
90
- *
91
- * Copyright (c) Facebook, Inc. and its affiliates.
92
- *
93
- * This source code is licensed under the MIT license found in the
94
- * LICENSE file in the root directory of this source tree.
95
- */
96
- var Ft;
97
- function Cr() {
98
- return Ft || (Ft = 1, process.env.NODE_ENV !== "production" && function() {
99
- var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, l = e ? Symbol.for("react.fragment") : 60107, f = e ? Symbol.for("react.strict_mode") : 60108, i = e ? Symbol.for("react.profiler") : 60114, E = e ? Symbol.for("react.provider") : 60109, k = e ? Symbol.for("react.context") : 60110, X = e ? Symbol.for("react.async_mode") : 60111, H = e ? Symbol.for("react.concurrent_mode") : 60111, L = e ? Symbol.for("react.forward_ref") : 60112, V = e ? Symbol.for("react.suspense") : 60113, ne = e ? Symbol.for("react.suspense_list") : 60120, G = e ? Symbol.for("react.memo") : 60115, te = e ? Symbol.for("react.lazy") : 60116, K = e ? Symbol.for("react.block") : 60121, re = e ? Symbol.for("react.fundamental") : 60117, ue = e ? Symbol.for("react.responder") : 60118, Z = e ? Symbol.for("react.scope") : 60119;
100
- function ie(h) {
101
- return typeof h == "string" || typeof h == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
102
- h === l || h === H || h === i || h === f || h === V || h === ne || typeof h == "object" && h !== null && (h.$$typeof === te || h.$$typeof === G || h.$$typeof === E || h.$$typeof === k || h.$$typeof === L || h.$$typeof === re || h.$$typeof === ue || h.$$typeof === Z || h.$$typeof === K);
103
- }
104
- function ee(h) {
105
- if (typeof h == "object" && h !== null) {
106
- var I = h.$$typeof;
107
- switch (I) {
108
- case t:
109
- var q = h.type;
110
- switch (q) {
111
- case X:
112
- case H:
113
- case l:
114
- case i:
115
- case f:
116
- case V:
117
- return q;
118
- default:
119
- var $ = q && q.$$typeof;
120
- switch ($) {
121
- case k:
122
- case L:
123
- case te:
124
- case G:
125
- case E:
126
- return $;
127
- default:
128
- return I;
129
- }
130
- }
131
- case r:
132
- return I;
133
- }
134
- }
135
- }
136
- var o = X, _ = H, m = k, b = E, P = t, F = L, Y = l, T = te, B = G, W = r, M = i, R = f, z = V, J = !1;
137
- function le(h) {
138
- return J || (J = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), g(h) || ee(h) === X;
139
- }
140
- function g(h) {
141
- return ee(h) === H;
142
- }
143
- function S(h) {
144
- return ee(h) === k;
145
- }
146
- function v(h) {
147
- return ee(h) === E;
148
- }
149
- function u(h) {
150
- return typeof h == "object" && h !== null && h.$$typeof === t;
151
- }
152
- function a(h) {
153
- return ee(h) === L;
154
- }
155
- function c(h) {
156
- return ee(h) === l;
157
- }
158
- function y(h) {
159
- return ee(h) === te;
160
- }
161
- function p(h) {
162
- return ee(h) === G;
163
- }
164
- function D(h) {
165
- return ee(h) === r;
166
- }
167
- function O(h) {
168
- return ee(h) === i;
169
- }
170
- function C(h) {
171
- return ee(h) === f;
172
- }
173
- function U(h) {
174
- return ee(h) === V;
175
- }
176
- oe.AsyncMode = o, oe.ConcurrentMode = _, oe.ContextConsumer = m, oe.ContextProvider = b, oe.Element = P, oe.ForwardRef = F, oe.Fragment = Y, oe.Lazy = T, oe.Memo = B, oe.Portal = W, oe.Profiler = M, oe.StrictMode = R, oe.Suspense = z, oe.isAsyncMode = le, oe.isConcurrentMode = g, oe.isContextConsumer = S, oe.isContextProvider = v, oe.isElement = u, oe.isForwardRef = a, oe.isFragment = c, oe.isLazy = y, oe.isMemo = p, oe.isPortal = D, oe.isProfiler = O, oe.isStrictMode = C, oe.isSuspense = U, oe.isValidElementType = ie, oe.typeOf = ee;
177
- }()), oe;
178
- }
179
- var Dt;
180
- function nr() {
181
- return Dt || (Dt = 1, process.env.NODE_ENV === "production" ? He.exports = Or() : He.exports = Cr()), He.exports;
182
- }
183
- /*
184
- object-assign
185
- (c) Sindre Sorhus
186
- @license MIT
187
- */
188
- var ot, Mt;
189
- function Ar() {
190
- if (Mt)
191
- return ot;
192
- Mt = 1;
193
- var e = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, r = Object.prototype.propertyIsEnumerable;
194
- function l(i) {
195
- if (i == null)
196
- throw new TypeError("Object.assign cannot be called with null or undefined");
197
- return Object(i);
198
- }
199
- function f() {
200
- try {
201
- if (!Object.assign)
202
- return !1;
203
- var i = new String("abc");
204
- if (i[5] = "de", Object.getOwnPropertyNames(i)[0] === "5")
205
- return !1;
206
- for (var E = {}, k = 0; k < 10; k++)
207
- E["_" + String.fromCharCode(k)] = k;
208
- var X = Object.getOwnPropertyNames(E).map(function(L) {
209
- return E[L];
210
- });
211
- if (X.join("") !== "0123456789")
212
- return !1;
213
- var H = {};
214
- return "abcdefghijklmnopqrst".split("").forEach(function(L) {
215
- H[L] = L;
216
- }), Object.keys(Object.assign({}, H)).join("") === "abcdefghijklmnopqrst";
217
- } catch {
218
- return !1;
219
- }
220
- }
221
- return ot = f() ? Object.assign : function(i, E) {
222
- for (var k, X = l(i), H, L = 1; L < arguments.length; L++) {
223
- k = Object(arguments[L]);
224
- for (var V in k)
225
- t.call(k, V) && (X[V] = k[V]);
226
- if (e) {
227
- H = e(k);
228
- for (var ne = 0; ne < H.length; ne++)
229
- r.call(k, H[ne]) && (X[H[ne]] = k[H[ne]]);
230
- }
231
- }
232
- return X;
233
- }, ot;
234
- }
235
- var ut, Lt;
236
- function Et() {
237
- if (Lt)
238
- return ut;
239
- Lt = 1;
240
- var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
241
- return ut = e, ut;
242
- }
243
- var lt, It;
244
- function ir() {
245
- return It || (It = 1, lt = Function.call.bind(Object.prototype.hasOwnProperty)), lt;
246
- }
247
- var ct, jt;
248
- function Tr() {
249
- if (jt)
250
- return ct;
251
- jt = 1;
252
- var e = function() {
253
- };
254
- if (process.env.NODE_ENV !== "production") {
255
- var t = Et(), r = {}, l = ir();
256
- e = function(i) {
257
- var E = "Warning: " + i;
258
- typeof console < "u" && console.error(E);
259
- try {
260
- throw new Error(E);
261
- } catch {
262
- }
263
- };
264
- }
265
- function f(i, E, k, X, H) {
266
- if (process.env.NODE_ENV !== "production") {
267
- for (var L in i)
268
- if (l(i, L)) {
269
- var V;
270
- try {
271
- if (typeof i[L] != "function") {
272
- var ne = Error(
273
- (X || "React class") + ": " + k + " type `" + L + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[L] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
274
- );
275
- throw ne.name = "Invariant Violation", ne;
276
- }
277
- V = i[L](E, L, X, k, null, t);
278
- } catch (te) {
279
- V = te;
280
- }
281
- if (V && !(V instanceof Error) && e(
282
- (X || "React class") + ": type specification of " + k + " `" + L + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof V + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
283
- ), V instanceof Error && !(V.message in r)) {
284
- r[V.message] = !0;
285
- var G = H ? H() : "";
286
- e(
287
- "Failed " + k + " type: " + V.message + (G ?? "")
288
- );
289
- }
290
- }
291
- }
292
- }
293
- return f.resetWarningCache = function() {
294
- process.env.NODE_ENV !== "production" && (r = {});
295
- }, ct = f, ct;
296
- }
297
- var ft, qt;
298
- function Rr() {
299
- if (qt)
300
- return ft;
301
- qt = 1;
302
- var e = nr(), t = Ar(), r = Et(), l = ir(), f = Tr(), i = function() {
303
- };
304
- process.env.NODE_ENV !== "production" && (i = function(k) {
305
- var X = "Warning: " + k;
306
- typeof console < "u" && console.error(X);
307
- try {
308
- throw new Error(X);
309
- } catch {
310
- }
311
- });
312
- function E() {
313
- return null;
314
- }
315
- return ft = function(k, X) {
316
- var H = typeof Symbol == "function" && Symbol.iterator, L = "@@iterator";
317
- function V(g) {
318
- var S = g && (H && g[H] || g[L]);
319
- if (typeof S == "function")
320
- return S;
321
- }
322
- var ne = "<<anonymous>>", G = {
323
- array: ue("array"),
324
- bigint: ue("bigint"),
325
- bool: ue("boolean"),
326
- func: ue("function"),
327
- number: ue("number"),
328
- object: ue("object"),
329
- string: ue("string"),
330
- symbol: ue("symbol"),
331
- any: Z(),
332
- arrayOf: ie,
333
- element: ee(),
334
- elementType: o(),
335
- instanceOf: _,
336
- node: F(),
337
- objectOf: b,
338
- oneOf: m,
339
- oneOfType: P,
340
- shape: T,
341
- exact: B
342
- };
343
- function te(g, S) {
344
- return g === S ? g !== 0 || 1 / g === 1 / S : g !== g && S !== S;
345
- }
346
- function K(g, S) {
347
- this.message = g, this.data = S && typeof S == "object" ? S : {}, this.stack = "";
348
- }
349
- K.prototype = Error.prototype;
350
- function re(g) {
351
- if (process.env.NODE_ENV !== "production")
352
- var S = {}, v = 0;
353
- function u(c, y, p, D, O, C, U) {
354
- if (D = D || ne, C = C || p, U !== r) {
355
- if (X) {
356
- var h = new Error(
357
- "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
358
- );
359
- throw h.name = "Invariant Violation", h;
360
- } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
361
- var I = D + ":" + p;
362
- !S[I] && // Avoid spamming the console because they are often not actionable except for lib authors
363
- v < 3 && (i(
364
- "You are manually calling a React.PropTypes validation function for the `" + C + "` prop on `" + D + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
365
- ), S[I] = !0, v++);
366
- }
367
- }
368
- return y[p] == null ? c ? y[p] === null ? new K("The " + O + " `" + C + "` is marked as required " + ("in `" + D + "`, but its value is `null`.")) : new K("The " + O + " `" + C + "` is marked as required in " + ("`" + D + "`, but its value is `undefined`.")) : null : g(y, p, D, O, C);
369
- }
370
- var a = u.bind(null, !1);
371
- return a.isRequired = u.bind(null, !0), a;
372
- }
373
- function ue(g) {
374
- function S(v, u, a, c, y, p) {
375
- var D = v[u], O = R(D);
376
- if (O !== g) {
377
- var C = z(D);
378
- return new K(
379
- "Invalid " + c + " `" + y + "` of type " + ("`" + C + "` supplied to `" + a + "`, expected ") + ("`" + g + "`."),
380
- { expectedType: g }
381
- );
382
- }
383
- return null;
384
- }
385
- return re(S);
386
- }
387
- function Z() {
388
- return re(E);
389
- }
390
- function ie(g) {
391
- function S(v, u, a, c, y) {
392
- if (typeof g != "function")
393
- return new K("Property `" + y + "` of component `" + a + "` has invalid PropType notation inside arrayOf.");
394
- var p = v[u];
395
- if (!Array.isArray(p)) {
396
- var D = R(p);
397
- return new K("Invalid " + c + " `" + y + "` of type " + ("`" + D + "` supplied to `" + a + "`, expected an array."));
398
- }
399
- for (var O = 0; O < p.length; O++) {
400
- var C = g(p, O, a, c, y + "[" + O + "]", r);
401
- if (C instanceof Error)
402
- return C;
403
- }
404
- return null;
405
- }
406
- return re(S);
407
- }
408
- function ee() {
409
- function g(S, v, u, a, c) {
410
- var y = S[v];
411
- if (!k(y)) {
412
- var p = R(y);
413
- return new K("Invalid " + a + " `" + c + "` of type " + ("`" + p + "` supplied to `" + u + "`, expected a single ReactElement."));
414
- }
415
- return null;
416
- }
417
- return re(g);
418
- }
419
- function o() {
420
- function g(S, v, u, a, c) {
421
- var y = S[v];
422
- if (!e.isValidElementType(y)) {
423
- var p = R(y);
424
- return new K("Invalid " + a + " `" + c + "` of type " + ("`" + p + "` supplied to `" + u + "`, expected a single ReactElement type."));
425
- }
426
- return null;
427
- }
428
- return re(g);
429
- }
430
- function _(g) {
431
- function S(v, u, a, c, y) {
432
- if (!(v[u] instanceof g)) {
433
- var p = g.name || ne, D = le(v[u]);
434
- return new K("Invalid " + c + " `" + y + "` of type " + ("`" + D + "` supplied to `" + a + "`, expected ") + ("instance of `" + p + "`."));
435
- }
436
- return null;
437
- }
438
- return re(S);
439
- }
440
- function m(g) {
441
- if (!Array.isArray(g))
442
- return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? i(
443
- "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
444
- ) : i("Invalid argument supplied to oneOf, expected an array.")), E;
445
- function S(v, u, a, c, y) {
446
- for (var p = v[u], D = 0; D < g.length; D++)
447
- if (te(p, g[D]))
448
- return null;
449
- var O = JSON.stringify(g, function(U, h) {
450
- var I = z(h);
451
- return I === "symbol" ? String(h) : h;
452
- });
453
- return new K("Invalid " + c + " `" + y + "` of value `" + String(p) + "` " + ("supplied to `" + a + "`, expected one of " + O + "."));
454
- }
455
- return re(S);
456
- }
457
- function b(g) {
458
- function S(v, u, a, c, y) {
459
- if (typeof g != "function")
460
- return new K("Property `" + y + "` of component `" + a + "` has invalid PropType notation inside objectOf.");
461
- var p = v[u], D = R(p);
462
- if (D !== "object")
463
- return new K("Invalid " + c + " `" + y + "` of type " + ("`" + D + "` supplied to `" + a + "`, expected an object."));
464
- for (var O in p)
465
- if (l(p, O)) {
466
- var C = g(p, O, a, c, y + "." + O, r);
467
- if (C instanceof Error)
468
- return C;
469
- }
470
- return null;
471
- }
472
- return re(S);
473
- }
474
- function P(g) {
475
- if (!Array.isArray(g))
476
- return process.env.NODE_ENV !== "production" && i("Invalid argument supplied to oneOfType, expected an instance of array."), E;
477
- for (var S = 0; S < g.length; S++) {
478
- var v = g[S];
479
- if (typeof v != "function")
480
- return i(
481
- "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + J(v) + " at index " + S + "."
482
- ), E;
483
- }
484
- function u(a, c, y, p, D) {
485
- for (var O = [], C = 0; C < g.length; C++) {
486
- var U = g[C], h = U(a, c, y, p, D, r);
487
- if (h == null)
488
- return null;
489
- h.data && l(h.data, "expectedType") && O.push(h.data.expectedType);
490
- }
491
- var I = O.length > 0 ? ", expected one of type [" + O.join(", ") + "]" : "";
492
- return new K("Invalid " + p + " `" + D + "` supplied to " + ("`" + y + "`" + I + "."));
493
- }
494
- return re(u);
495
- }
496
- function F() {
497
- function g(S, v, u, a, c) {
498
- return W(S[v]) ? null : new K("Invalid " + a + " `" + c + "` supplied to " + ("`" + u + "`, expected a ReactNode."));
499
- }
500
- return re(g);
501
- }
502
- function Y(g, S, v, u, a) {
503
- return new K(
504
- (g || "React class") + ": " + S + " type `" + v + "." + u + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + a + "`."
505
- );
506
- }
507
- function T(g) {
508
- function S(v, u, a, c, y) {
509
- var p = v[u], D = R(p);
510
- if (D !== "object")
511
- return new K("Invalid " + c + " `" + y + "` of type `" + D + "` " + ("supplied to `" + a + "`, expected `object`."));
512
- for (var O in g) {
513
- var C = g[O];
514
- if (typeof C != "function")
515
- return Y(a, c, y, O, z(C));
516
- var U = C(p, O, a, c, y + "." + O, r);
517
- if (U)
518
- return U;
519
- }
520
- return null;
521
- }
522
- return re(S);
523
- }
524
- function B(g) {
525
- function S(v, u, a, c, y) {
526
- var p = v[u], D = R(p);
527
- if (D !== "object")
528
- return new K("Invalid " + c + " `" + y + "` of type `" + D + "` " + ("supplied to `" + a + "`, expected `object`."));
529
- var O = t({}, v[u], g);
530
- for (var C in O) {
531
- var U = g[C];
532
- if (l(g, C) && typeof U != "function")
533
- return Y(a, c, y, C, z(U));
534
- if (!U)
535
- return new K(
536
- "Invalid " + c + " `" + y + "` key `" + C + "` supplied to `" + a + "`.\nBad object: " + JSON.stringify(v[u], null, " ") + `
537
- Valid keys: ` + JSON.stringify(Object.keys(g), null, " ")
538
- );
539
- var h = U(p, C, a, c, y + "." + C, r);
540
- if (h)
541
- return h;
542
- }
543
- return null;
544
- }
545
- return re(S);
546
- }
547
- function W(g) {
548
- switch (typeof g) {
549
- case "number":
550
- case "string":
551
- case "undefined":
552
- return !0;
553
- case "boolean":
554
- return !g;
555
- case "object":
556
- if (Array.isArray(g))
557
- return g.every(W);
558
- if (g === null || k(g))
559
- return !0;
560
- var S = V(g);
561
- if (S) {
562
- var v = S.call(g), u;
563
- if (S !== g.entries) {
564
- for (; !(u = v.next()).done; )
565
- if (!W(u.value))
566
- return !1;
567
- } else
568
- for (; !(u = v.next()).done; ) {
569
- var a = u.value;
570
- if (a && !W(a[1]))
571
- return !1;
572
- }
573
- } else
574
- return !1;
575
- return !0;
576
- default:
577
- return !1;
578
- }
579
- }
580
- function M(g, S) {
581
- return g === "symbol" ? !0 : S ? S["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && S instanceof Symbol : !1;
582
- }
583
- function R(g) {
584
- var S = typeof g;
585
- return Array.isArray(g) ? "array" : g instanceof RegExp ? "object" : M(S, g) ? "symbol" : S;
586
- }
587
- function z(g) {
588
- if (typeof g > "u" || g === null)
589
- return "" + g;
590
- var S = R(g);
591
- if (S === "object") {
592
- if (g instanceof Date)
593
- return "date";
594
- if (g instanceof RegExp)
595
- return "regexp";
596
- }
597
- return S;
598
- }
599
- function J(g) {
600
- var S = z(g);
601
- switch (S) {
602
- case "array":
603
- case "object":
604
- return "an " + S;
605
- case "boolean":
606
- case "date":
607
- case "regexp":
608
- return "a " + S;
609
- default:
610
- return S;
611
- }
612
- }
613
- function le(g) {
614
- return !g.constructor || !g.constructor.name ? ne : g.constructor.name;
615
- }
616
- return G.checkPropTypes = f, G.resetWarningCache = f.resetWarningCache, G.PropTypes = G, G;
617
- }, ft;
618
- }
619
- var dt, Nt;
620
- function Vr() {
621
- if (Nt)
622
- return dt;
623
- Nt = 1;
624
- var e = Et();
625
- function t() {
626
- }
627
- function r() {
628
- }
629
- return r.resetWarningCache = t, dt = function() {
630
- function l(E, k, X, H, L, V) {
631
- if (V !== e) {
632
- var ne = new Error(
633
- "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
634
- );
635
- throw ne.name = "Invariant Violation", ne;
636
- }
637
- }
638
- l.isRequired = l;
639
- function f() {
640
- return l;
641
- }
642
- var i = {
643
- array: l,
644
- bigint: l,
645
- bool: l,
646
- func: l,
647
- number: l,
648
- object: l,
649
- string: l,
650
- symbol: l,
651
- any: l,
652
- arrayOf: f,
653
- element: l,
654
- elementType: l,
655
- instanceOf: f,
656
- node: l,
657
- objectOf: f,
658
- oneOf: f,
659
- oneOfType: f,
660
- shape: f,
661
- exact: f,
662
- checkPropTypes: r,
663
- resetWarningCache: t
664
- };
665
- return i.PropTypes = i, i;
666
- }, dt;
667
- }
668
- var Bt;
669
- function ar() {
670
- if (Bt)
671
- return ze.exports;
672
- if (Bt = 1, process.env.NODE_ENV !== "production") {
673
- var e = nr(), t = !0;
674
- ze.exports = Rr()(e.isElement, t);
675
- } else
676
- ze.exports = Vr()();
677
- return ze.exports;
678
- }
679
- var vt, $t;
680
- function sr() {
681
- if ($t)
682
- return vt;
683
- $t = 1;
684
- var e = function(t, r, l, f, i, E, k, X) {
685
- if (process.env.NODE_ENV !== "production" && r === void 0)
686
- throw new Error("invariant requires an error message argument");
687
- if (!t) {
688
- var H;
689
- if (r === void 0)
690
- H = new Error(
691
- "Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."
692
- );
693
- else {
694
- var L = [l, f, i, E, k, X], V = 0;
695
- H = new Error(
696
- r.replace(/%s/g, function() {
697
- return L[V++];
698
- })
699
- ), H.name = "Invariant Violation";
700
- }
701
- throw H.framesToPop = 1, H;
702
- }
703
- };
704
- return vt = e, vt;
705
- }
706
- var ht, Ut;
707
- function or() {
708
- if (Ut)
709
- return ht;
710
- Ut = 1;
711
- var e = process.env.NODE_ENV !== "production", t = function() {
712
- };
713
- if (e) {
714
- var r = function(f, i) {
715
- var E = arguments.length;
716
- i = new Array(E > 1 ? E - 1 : 0);
717
- for (var k = 1; k < E; k++)
718
- i[k - 1] = arguments[k];
719
- var X = 0, H = "Warning: " + f.replace(/%s/g, function() {
720
- return i[X++];
721
- });
722
- typeof console < "u" && console.error(H);
723
- try {
724
- throw new Error(H);
725
- } catch {
726
- }
727
- };
728
- t = function(l, f, i) {
729
- var E = arguments.length;
730
- i = new Array(E > 2 ? E - 2 : 0);
731
- for (var k = 2; k < E; k++)
732
- i[k - 2] = arguments[k];
733
- if (f === void 0)
734
- throw new Error(
735
- "`warning(condition, format, ...args)` requires a warning message argument"
736
- );
737
- l || r.apply(null, [f].concat(i));
738
- };
739
- }
740
- return ht = t, ht;
741
- }
742
- var Wt;
743
- function Fr() {
744
- if (Wt)
745
- return st.exports;
746
- Wt = 1;
747
- function e(o) {
748
- return o && typeof o == "object" && "default" in o ? o.default : o;
749
- }
750
- var t = Pe, r = e(t), l = rr;
751
- ar();
752
- var f = e(sr());
753
- function i() {
754
- return (i = Object.assign || function(o) {
755
- for (var _ = 1; _ < arguments.length; _++) {
756
- var m = arguments[_];
757
- for (var b in m)
758
- Object.prototype.hasOwnProperty.call(m, b) && (o[b] = m[b]);
759
- }
760
- return o;
761
- }).apply(this, arguments);
762
- }
763
- function E(o, _) {
764
- o.prototype = Object.create(_.prototype), o.prototype.constructor = o, function(m, b) {
765
- for (var P = Object.getOwnPropertyNames(b), F = 0; F < P.length; F++) {
766
- var Y = P[F], T = Object.getOwnPropertyDescriptor(b, Y);
767
- T && T.configurable && m[Y] === void 0 && Object.defineProperty(m, Y, T);
768
- }
769
- }(o, _);
770
- }
771
- function k(o, _) {
772
- if (o == null)
773
- return {};
774
- var m, b, P = {}, F = Object.keys(o);
775
- for (b = 0; b < F.length; b++)
776
- m = F[b], _.indexOf(m) >= 0 || (P[m] = o[m]);
777
- return P;
778
- }
779
- function X(o) {
780
- return requestAnimationFrame(o);
781
- }
782
- function H(o) {
783
- cancelAnimationFrame(o);
784
- }
785
- function L(o) {
786
- var _ = o.ownerDocument;
787
- return _.hasFocus() && _.activeElement === o;
788
- }
789
- function V(o) {
790
- return o == null ? void 0 : o.ownerDocument;
791
- }
792
- function ne(o) {
793
- var _ = function(m) {
794
- var b;
795
- return (b = V(m)) == null ? void 0 : b.defaultView;
796
- }(o);
797
- return !!_ && o instanceof _.HTMLElement;
798
- }
799
- function G(o) {
800
- return t.useCallback(function() {
801
- var _ = o.current, m = typeof window < "u" && ne(_);
802
- if (!_ || !m)
803
- return null;
804
- if (_.nodeName !== "INPUT" && (_ = _.querySelector("input")), !_)
805
- throw new Error("react-input-mask: inputComponent doesn't contain input node");
806
- return _;
807
- }, [o]);
808
- }
809
- function te(o, _) {
810
- var m, b, P, F, Y = t.useRef({ start: null, end: null }), T = G(o), B = t.useCallback(function() {
811
- return function(g) {
812
- var S = g.selectionStart, v = g.selectionEnd;
813
- return { start: S, end: v, length: v - S };
814
- }(T());
815
- }, [T]), W = t.useCallback(function() {
816
- return Y.current;
817
- }, []), M = t.useCallback(function(g) {
818
- var S = T();
819
- S && L(S) && (function(v, u, a) {
820
- a === void 0 && (a = u), v.setSelectionRange(u, a);
821
- }(S, g.start, g.end), Y.current = B());
822
- }, [T, B]), R = t.useCallback(function() {
823
- Y.current = B();
824
- }, [B]), z = (m = R, b = t.useRef(null), P = t.useCallback(function() {
825
- b.current === null && function g() {
826
- m(), b.current = X(g);
827
- }();
828
- }, [m]), F = t.useCallback(function() {
829
- H(b.current), b.current = null;
830
- }, []), t.useEffect(function() {
831
- b.current && (F(), P());
832
- }, [P, F]), t.useEffect(H, []), [P, F]), J = z[0], le = z[1];
833
- return t.useLayoutEffect(function() {
834
- if (_) {
835
- var g = T();
836
- return g.addEventListener("focus", J), g.addEventListener("blur", le), L(g) && J(), function() {
837
- g.removeEventListener("focus", J), g.removeEventListener("blur", le), le();
838
- };
839
- }
840
- }), { getSelection: B, getLastSelection: W, setSelection: M };
841
- }
842
- function K(o, _) {
843
- var m = t.useRef(), b = te(m, _), P = b.getSelection, F = b.getLastSelection, Y = b.setSelection, T = function(R, z) {
844
- var J = G(R), le = t.useRef(z);
845
- return { getValue: t.useCallback(function() {
846
- return J().value;
847
- }, [J]), getLastValue: t.useCallback(function() {
848
- return le.current;
849
- }, []), setValue: t.useCallback(function(g) {
850
- le.current = g;
851
- var S = J();
852
- S && (S.value = g);
853
- }, [J]) };
854
- }(m, o), B = T.getValue, W = T.getLastValue, M = T.setValue;
855
- return { inputRef: m, getInputState: function() {
856
- return { value: B(), selection: P() };
857
- }, getLastInputState: function() {
858
- return { value: W(), selection: F() };
859
- }, setInputState: function(R) {
860
- var z = R.value, J = R.selection;
861
- M(z), Y(J);
862
- } };
863
- }
864
- or();
865
- var re = ["disabled", "onBlur", "onChange", "onFocus", "onMouseDown", "readOnly", "value"], ue = { 9: /[0-9]/, a: /[A-Za-z]/, "*": /[A-Za-z0-9]/ }, Z = function(o) {
866
- var _ = this;
867
- this.isCharacterAllowedAtPosition = function(m, b) {
868
- var P = _.maskOptions.maskPlaceholder;
869
- return !!_.isCharacterFillingPosition(m, b) || !!P && P[b] === m;
870
- }, this.isCharacterFillingPosition = function(m, b) {
871
- var P = _.maskOptions.mask;
872
- if (!m || b >= P.length)
873
- return !1;
874
- if (!_.isPositionEditable(b))
875
- return P[b] === m;
876
- var F = P[b];
877
- return new RegExp(F).test(m);
878
- }, this.isPositionEditable = function(m) {
879
- var b = _.maskOptions, P = b.mask, F = b.permanents;
880
- return m < P.length && F.indexOf(m) === -1;
881
- }, this.isValueEmpty = function(m) {
882
- return m.split("").every(function(b, P) {
883
- return !_.isPositionEditable(P) || !_.isCharacterFillingPosition(b, P);
884
- });
885
- }, this.isValueFilled = function(m) {
886
- return _.getFilledLength(m) === _.maskOptions.lastEditablePosition + 1;
887
- }, this.getDefaultSelectionForValue = function(m) {
888
- var b = _.getFilledLength(m), P = _.getRightEditablePosition(b);
889
- return { start: P, end: P };
890
- }, this.getFilledLength = function(m) {
891
- return function(b, P) {
892
- for (var F = b.length - 1; F >= 0; F--)
893
- if (P(b[F], F))
894
- return F;
895
- return -1;
896
- }(m.split(""), function(b, P) {
897
- return _.isPositionEditable(P) && _.isCharacterFillingPosition(b, P);
898
- }) + 1;
899
- }, this.getStringFillingLengthAtPosition = function(m, b) {
900
- return m.split("").reduce(function(P, F) {
901
- return _.insertCharacterAtPosition(P, F, P.length);
902
- }, function(P, F) {
903
- F === void 0 && (F = 1);
904
- for (var Y = "", T = 0; T < F; T++)
905
- Y += P;
906
- return Y;
907
- }(" ", b)).length - b;
908
- }, this.getLeftEditablePosition = function(m) {
909
- for (var b = m; b >= 0; b--)
910
- if (_.isPositionEditable(b))
911
- return b;
912
- return null;
913
- }, this.getRightEditablePosition = function(m) {
914
- for (var b = _.maskOptions.mask, P = m; P < b.length; P++)
915
- if (_.isPositionEditable(P))
916
- return P;
917
- return null;
918
- }, this.formatValue = function(m) {
919
- var b = _.maskOptions, P = b.maskPlaceholder, F = b.mask;
920
- if (!P) {
921
- for (m = _.insertStringAtPosition("", m, 0); m.length < F.length && !_.isPositionEditable(m.length); )
922
- m += F[m.length];
923
- return m;
924
- }
925
- return _.insertStringAtPosition(P, m, 0);
926
- }, this.clearRange = function(m, b, P) {
927
- if (!P)
928
- return m;
929
- var F = b + P, Y = _.maskOptions, T = Y.maskPlaceholder, B = Y.mask, W = m.split("").map(function(M, R) {
930
- var z = _.isPositionEditable(R);
931
- return !T && R >= F && !z ? "" : R < b || R >= F ? M : z ? T ? T[R] : "" : B[R];
932
- }).join("");
933
- return _.formatValue(W);
934
- }, this.insertCharacterAtPosition = function(m, b, P) {
935
- var F = _.maskOptions, Y = F.mask, T = F.maskPlaceholder;
936
- if (P >= Y.length)
937
- return m;
938
- var B = _.isCharacterAllowedAtPosition(b, P), W = _.isPositionEditable(P), M = _.getRightEditablePosition(P), R = T && M ? b === T[M] : null, z = m.slice(0, P);
939
- return !B && W || (m = z + (B ? b : Y[P])), B || W || R || (m = _.insertCharacterAtPosition(m, b, P + 1)), m;
940
- }, this.insertStringAtPosition = function(m, b, P) {
941
- var F = _.maskOptions, Y = F.mask, T = F.maskPlaceholder;
942
- if (!b || P >= Y.length)
943
- return m;
944
- var B = b.split(""), W = _.isValueFilled(m) || !!T, M = m.slice(P);
945
- return m = B.reduce(function(R, z) {
946
- return _.insertCharacterAtPosition(R, z, R.length);
947
- }, m.slice(0, P)), W ? m += M.slice(m.length - P) : _.isValueFilled(m) ? m += Y.slice(m.length).join("") : m = M.split("").filter(function(R, z) {
948
- return _.isPositionEditable(P + z);
949
- }).reduce(function(R, z) {
950
- var J = _.getRightEditablePosition(R.length);
951
- return J === null ? R : (_.isPositionEditable(R.length) || (R += Y.slice(R.length, J).join("")), _.insertCharacterAtPosition(R, z, R.length));
952
- }, m), m;
953
- }, this.processChange = function(m, b) {
954
- var P = _.maskOptions, F = P.mask, Y = P.prefix, T = P.lastEditablePosition, B = m.value, W = m.selection, M = b.value, R = b.selection, z = B, J = "", le = 0, g = 0, S = Math.min(R.start, W.start);
955
- return W.end > R.start ? (J = z.slice(R.start, W.end), g = (le = _.getStringFillingLengthAtPosition(J, S)) ? R.length : 0) : z.length < M.length && (g = M.length - z.length), z = M, g && (g === 1 && !R.length && (S = R.start === W.start ? _.getRightEditablePosition(W.start) : _.getLeftEditablePosition(W.start)), z = _.clearRange(z, S, g)), z = _.insertStringAtPosition(z, J, S), (S += le) >= F.length ? S = F.length : S < Y.length && !le ? S = Y.length : S >= Y.length && S < T && le && (S = _.getRightEditablePosition(S)), { value: z = _.formatValue(z), enteredString: J, selection: { start: S, end: S } };
956
- }, this.maskOptions = function(m) {
957
- var b = m.mask, P = m.maskPlaceholder, F = [];
958
- if (!b)
959
- return { maskPlaceholder: null, mask: null, prefix: null, lastEditablePosition: null, permanents: [] };
960
- if (typeof b == "string") {
961
- var Y = !1, T = "";
962
- b.split("").forEach(function(M) {
963
- Y || M !== "\\" ? (!Y && ue[M] || F.push(T.length), T += M, Y = !1) : Y = !0;
964
- }), b = T.split("").map(function(M, R) {
965
- return F.indexOf(R) === -1 ? ue[M] : M;
966
- });
967
- } else
968
- b.forEach(function(M, R) {
969
- typeof M == "string" && F.push(R);
970
- });
971
- P && (P = P.length === 1 ? b.map(function(M, R) {
972
- return F.indexOf(R) !== -1 ? M : P;
973
- }) : P.split(""), F.forEach(function(M) {
974
- P[M] = b[M];
975
- }), P = P.join(""));
976
- for (var B = F.filter(function(M, R) {
977
- return M === R;
978
- }).map(function(M) {
979
- return b[M];
980
- }).join(""), W = b.length - 1; F.indexOf(W) !== -1; )
981
- W--;
982
- return { maskPlaceholder: P, prefix: B, mask: b, lastEditablePosition: W, permanents: F };
983
- }(o);
984
- }, ie = function(o) {
985
- function _() {
986
- return o.apply(this, arguments) || this;
987
- }
988
- return E(_, o), _.prototype.render = function() {
989
- var m = this.props, b = m.children, P = k(m, ["children"]);
990
- return r.cloneElement(b, P);
991
- }, _;
992
- }(r.Component), ee = t.forwardRef(function(o, _) {
993
- var m = o.alwaysShowMask, b = o.children, P = o.mask, F = o.maskPlaceholder, Y = o.beforeMaskedStateChange, T = k(o, ["alwaysShowMask", "children", "mask", "maskPlaceholder", "beforeMaskedStateChange"]);
994
- (function(h) {
995
- var I = h.mask, q = h.maskPlaceholder;
996
- I && q && q.length !== 1 && q.length !== I.length && f(!1);
997
- })(o);
998
- var B, W, M = new Z({ mask: P, maskPlaceholder: F }), R = !!P, z = !T.disabled && !T.readOnly, J = o.value !== null && o.value !== void 0, le = (B = R, W = t.useRef(), t.useEffect(function() {
999
- W.current = B;
1000
- }), W.current), g = K(function(h) {
1001
- return "" + h;
1002
- }((J ? o.value : o.defaultValue) || ""), R), S = g.inputRef, v = g.getInputState, u = g.setInputState, a = g.getLastInputState, c = G(S);
1003
- if (R && J) {
1004
- var y = c(), p = y && L(y) || m || o.value ? M.formatValue(o.value) : o.value;
1005
- Y && (p = Y({ nextState: { value: p, selection: { start: null, end: null } } }).value), u(i({}, a(), { value: p }));
1006
- }
1007
- var D = a(), O = D.selection, C = D.value;
1008
- t.useLayoutEffect(function() {
1009
- if (R) {
1010
- var h = L(c()), I = O, q = v(), $ = i({}, q);
1011
- if (!J) {
1012
- var ae = q.value, he = M.formatValue(ae), n = M.isValueEmpty(he);
1013
- !n || h || m ? $.value = he : n && !h && ($.value = "");
1014
- }
1015
- h && !le ? $.selection = M.getDefaultSelectionForValue($.value) : J && h && I && I.start !== null && I.end !== null && ($.selection = I), Y && ($ = Y({ currentState: q, nextState: $ })), u($);
1016
- }
1017
- });
1018
- var U = i({}, T, { onFocus: function(h) {
1019
- S.current = h.target;
1020
- var I = v().value;
1021
- if (R && !M.isValueFilled(I)) {
1022
- var q = M.formatValue(I), $ = M.getDefaultSelectionForValue(q), ae = { value: q, selection: $ };
1023
- Y && (q = (ae = Y({ currentState: v(), nextState: ae })).value, $ = ae.selection), u(ae), q !== I && o.onChange && o.onChange(h), X(function() {
1024
- u(a());
1025
- });
1026
- }
1027
- o.onFocus && o.onFocus(h);
1028
- }, onBlur: function(h) {
1029
- var I = v().value, q = a().value;
1030
- if (R && !m && M.isValueEmpty(q)) {
1031
- var $ = "", ae = { value: $, selection: { start: null, end: null } };
1032
- Y && ($ = (ae = Y({ currentState: v(), nextState: ae })).value), u(ae), $ !== I && o.onChange && o.onChange(h);
1033
- }
1034
- o.onBlur && o.onBlur(h);
1035
- }, onChange: R && z ? function(h) {
1036
- var I = v(), q = a(), $ = M.processChange(I, q);
1037
- Y && ($ = Y({ currentState: I, previousState: q, nextState: $ })), u($), o.onChange && o.onChange(h);
1038
- } : o.onChange, onMouseDown: R && z ? function(h) {
1039
- var I = c(), q = v().value, $ = V(I);
1040
- if (!L(I) && !M.isValueFilled(q)) {
1041
- var ae = h.clientX, he = h.clientY, n = (/* @__PURE__ */ new Date()).getTime();
1042
- $.addEventListener("mouseup", function s(d) {
1043
- if ($.removeEventListener("mouseup", s), L(I)) {
1044
- var A = Math.abs(d.clientX - ae), w = Math.abs(d.clientY - he), x = Math.max(A, w), N = (/* @__PURE__ */ new Date()).getTime() - n;
1045
- if (x <= 10 && N <= 200 || x <= 5 && N <= 300) {
1046
- var Q = a(), fe = i({}, Q, { selection: M.getDefaultSelectionForValue(Q.value) });
1047
- u(fe);
1048
- }
1049
- }
1050
- });
1051
- }
1052
- o.onMouseDown && o.onMouseDown(h);
1053
- } : o.onMouseDown, ref: function(h) {
1054
- S.current = l.findDOMNode(h), /* @__PURE__ */ function(I) {
1055
- return typeof I == "function";
1056
- }(_) ? _(h) : _ !== null && typeof _ == "object" && (_.current = h);
1057
- }, value: R && J ? C : o.value });
1058
- return b ? (function(h, I) {
1059
- re.filter(function(q) {
1060
- return I.props[q] != null && I.props[q] !== h[q];
1061
- }).length && f(!1);
1062
- }(o, b), r.createElement(ie, U, b)) : r.createElement("input", U);
1063
- });
1064
- return ee.displayName = "InputMask", ee.defaultProps = { alwaysShowMask: !1, maskPlaceholder: "_" }, st.exports = ee, st.exports;
1065
- }
1066
- var gt, Yt;
1067
- function Dr() {
1068
- if (Yt)
1069
- return gt;
1070
- Yt = 1;
1071
- function e(v) {
1072
- return v && typeof v == "object" && "default" in v ? v.default : v;
1073
- }
1074
- var t = Pe, r = e(t), l = rr, f = e(ar()), i = e(sr()), E = e(or());
1075
- function k(v, u) {
1076
- for (var a = Object.getOwnPropertyNames(u), c = 0; c < a.length; c++) {
1077
- var y = a[c], p = Object.getOwnPropertyDescriptor(u, y);
1078
- p && p.configurable && v[y] === void 0 && Object.defineProperty(v, y, p);
1079
- }
1080
- return v;
1081
- }
1082
- function X() {
1083
- return X = Object.assign || function(v) {
1084
- for (var u = 1; u < arguments.length; u++) {
1085
- var a = arguments[u];
1086
- for (var c in a)
1087
- Object.prototype.hasOwnProperty.call(a, c) && (v[c] = a[c]);
1088
- }
1089
- return v;
1090
- }, X.apply(this, arguments);
1091
- }
1092
- function H(v, u) {
1093
- v.prototype = Object.create(u.prototype), v.prototype.constructor = v, k(v, u);
1094
- }
1095
- function L(v, u) {
1096
- if (v == null)
1097
- return {};
1098
- var a = {}, c = Object.keys(v), y, p;
1099
- for (p = 0; p < c.length; p++)
1100
- y = c[p], !(u.indexOf(y) >= 0) && (a[y] = v[y]);
1101
- return a;
1102
- }
1103
- function V(v) {
1104
- return requestAnimationFrame(v);
1105
- }
1106
- function ne(v) {
1107
- cancelAnimationFrame(v);
1108
- }
1109
- function G(v, u, a) {
1110
- a === void 0 && (a = u), v.setSelectionRange(u, a);
1111
- }
1112
- function te(v) {
1113
- var u = v.selectionStart, a = v.selectionEnd;
1114
- return {
1115
- start: u,
1116
- end: a,
1117
- length: a - u
1118
- };
1119
- }
1120
- function K(v) {
1121
- var u = v.ownerDocument;
1122
- return u.hasFocus() && u.activeElement === v;
1123
- }
1124
- function re(v) {
1125
- return v == null ? void 0 : v.ownerDocument;
1126
- }
1127
- function ue(v) {
1128
- var u;
1129
- return (u = re(v)) == null ? void 0 : u.defaultView;
1130
- }
1131
- function Z(v) {
1132
- var u = ue(v);
1133
- return !!u && v instanceof u.HTMLElement;
1134
- }
1135
- function ie(v) {
1136
- return typeof v == "function";
1137
- }
1138
- function ee(v, u) {
1139
- for (var a = v.length - 1; a >= 0; a--) {
1140
- var c = v[a];
1141
- if (u(c, a))
1142
- return a;
1143
- }
1144
- return -1;
1145
- }
1146
- function o(v, u) {
1147
- u === void 0 && (u = 1);
1148
- for (var a = "", c = 0; c < u; c++)
1149
- a += v;
1150
- return a;
1151
- }
1152
- function _(v) {
1153
- return "" + v;
1154
- }
1155
- function m(v) {
1156
- return t.useCallback(function() {
1157
- var u = v.current, a = typeof window < "u" && Z(u);
1158
- if (!u || !a)
1159
- return null;
1160
- if (u.nodeName !== "INPUT" && (u = u.querySelector("input")), !u)
1161
- throw new Error("react-input-mask: inputComponent doesn't contain input node");
1162
- return u;
1163
- }, [v]);
1164
- }
1165
- function b(v) {
1166
- var u = t.useRef(null), a = t.useCallback(function() {
1167
- if (u.current !== null)
1168
- return;
1169
- function y() {
1170
- v(), u.current = V(y);
1171
- }
1172
- y();
1173
- }, [v]), c = t.useCallback(function() {
1174
- ne(u.current), u.current = null;
1175
- }, []);
1176
- return t.useEffect(function() {
1177
- u.current && (c(), a());
1178
- }, [a, c]), t.useEffect(ne, []), [a, c];
1179
- }
1180
- function P(v, u) {
1181
- var a = t.useRef({
1182
- start: null,
1183
- end: null
1184
- }), c = m(v), y = t.useCallback(function() {
1185
- var I = c();
1186
- return te(I);
1187
- }, [c]), p = t.useCallback(function() {
1188
- return a.current;
1189
- }, []), D = t.useCallback(function(I) {
1190
- var q = c();
1191
- !q || !K(q) || (G(q, I.start, I.end), a.current = y());
1192
- }, [c, y]), O = t.useCallback(function() {
1193
- a.current = y();
1194
- }, [y]), C = b(O), U = C[0], h = C[1];
1195
- return t.useLayoutEffect(function() {
1196
- if (u) {
1197
- var I = c();
1198
- return I.addEventListener("focus", U), I.addEventListener("blur", h), K(I) && U(), function() {
1199
- I.removeEventListener("focus", U), I.removeEventListener("blur", h), h();
1200
- };
1201
- }
1202
- }), {
1203
- getSelection: y,
1204
- getLastSelection: p,
1205
- setSelection: D
1206
- };
1207
- }
1208
- function F(v, u) {
1209
- var a = m(v), c = t.useRef(u), y = t.useCallback(function() {
1210
- var O = a();
1211
- return O.value;
1212
- }, [a]), p = t.useCallback(function() {
1213
- return c.current;
1214
- }, []), D = t.useCallback(function(O) {
1215
- c.current = O;
1216
- var C = a();
1217
- C && (C.value = O);
1218
- }, [a]);
1219
- return {
1220
- getValue: y,
1221
- getLastValue: p,
1222
- setValue: D
1223
- };
1224
- }
1225
- function Y(v, u) {
1226
- var a = t.useRef(), c = P(a, u), y = c.getSelection, p = c.getLastSelection, D = c.setSelection, O = F(a, v), C = O.getValue, U = O.getLastValue, h = O.setValue;
1227
- function I() {
1228
- return {
1229
- value: U(),
1230
- selection: p()
1231
- };
1232
- }
1233
- function q() {
1234
- return {
1235
- value: C(),
1236
- selection: y()
1237
- };
1238
- }
1239
- function $(ae) {
1240
- var he = ae.value, n = ae.selection;
1241
- h(he), D(n);
1242
- }
1243
- return {
1244
- inputRef: a,
1245
- getInputState: q,
1246
- getLastInputState: I,
1247
- setInputState: $
1248
- };
1249
- }
1250
- function T(v) {
1251
- var u = t.useRef();
1252
- return t.useEffect(function() {
1253
- u.current = v;
1254
- }), u.current;
1255
- }
1256
- var B = ["disabled", "onBlur", "onChange", "onFocus", "onMouseDown", "readOnly", "value"], W = {
1257
- 9: /[0-9]/,
1258
- a: /[A-Za-z]/,
1259
- "*": /[A-Za-z0-9]/
1260
- };
1261
- function M(v) {
1262
- process.env.NODE_ENV !== "production" && E(!v.maxLength || !v.mask, "react-input-mask: maxLength property shouldn't be passed to the masked input. It breaks masking and unnecessary because length is limited by the mask length.");
1263
- }
1264
- function R(v) {
1265
- var u = v.mask, a = v.maskPlaceholder;
1266
- !u || !a || a.length === 1 || a.length === u.length || (process.env.NODE_ENV !== "production" ? i(!1, `react-input-mask: maskPlaceholder should either be a single character or have the same length as the mask:
1267
- ` + ("mask: " + u + `
1268
- `) + ("maskPlaceholder: " + a)) : i(!1));
1269
- }
1270
- function z(v, u) {
1271
- var a = B.filter(function(c) {
1272
- return u.props[c] != null && u.props[c] !== v[c];
1273
- });
1274
- a.length && (process.env.NODE_ENV !== "production" ? i(!1, "react-input-mask: the following props should be passed to the InputMask component, not to children: " + a.join(",")) : i(!1));
1275
- }
1276
- function J(v) {
1277
- var u = v.mask, a = v.maskPlaceholder, c = [];
1278
- if (!u)
1279
- return {
1280
- maskPlaceholder: null,
1281
- mask: null,
1282
- prefix: null,
1283
- lastEditablePosition: null,
1284
- permanents: []
1285
- };
1286
- if (typeof u == "string") {
1287
- var y = !1, p = "";
1288
- u.split("").forEach(function(C) {
1289
- !y && C === "\\" ? y = !0 : ((y || !W[C]) && c.push(p.length), p += C, y = !1);
1290
- }), u = p.split("").map(function(C, U) {
1291
- return c.indexOf(U) === -1 ? W[C] : C;
1292
- });
1293
- } else
1294
- u.forEach(function(C, U) {
1295
- typeof C == "string" && c.push(U);
1296
- });
1297
- a && (a.length === 1 ? a = u.map(function(C, U) {
1298
- return c.indexOf(U) !== -1 ? C : a;
1299
- }) : a = a.split(""), c.forEach(function(C) {
1300
- a[C] = u[C];
1301
- }), a = a.join(""));
1302
- for (var D = c.filter(function(C, U) {
1303
- return C === U;
1304
- }).map(function(C) {
1305
- return u[C];
1306
- }).join(""), O = u.length - 1; c.indexOf(O) !== -1; )
1307
- O--;
1308
- return {
1309
- maskPlaceholder: a,
1310
- prefix: D,
1311
- mask: u,
1312
- lastEditablePosition: O,
1313
- permanents: c
1314
- };
1315
- }
1316
- var le = function(u) {
1317
- var a = this;
1318
- this.isCharacterAllowedAtPosition = function(c, y) {
1319
- var p = a.maskOptions.maskPlaceholder;
1320
- return a.isCharacterFillingPosition(c, y) ? !0 : p ? p[y] === c : !1;
1321
- }, this.isCharacterFillingPosition = function(c, y) {
1322
- var p = a.maskOptions.mask;
1323
- if (!c || y >= p.length)
1324
- return !1;
1325
- if (!a.isPositionEditable(y))
1326
- return p[y] === c;
1327
- var D = p[y];
1328
- return new RegExp(D).test(c);
1329
- }, this.isPositionEditable = function(c) {
1330
- var y = a.maskOptions, p = y.mask, D = y.permanents;
1331
- return c < p.length && D.indexOf(c) === -1;
1332
- }, this.isValueEmpty = function(c) {
1333
- return c.split("").every(function(y, p) {
1334
- return !a.isPositionEditable(p) || !a.isCharacterFillingPosition(y, p);
1335
- });
1336
- }, this.isValueFilled = function(c) {
1337
- return a.getFilledLength(c) === a.maskOptions.lastEditablePosition + 1;
1338
- }, this.getDefaultSelectionForValue = function(c) {
1339
- var y = a.getFilledLength(c), p = a.getRightEditablePosition(y);
1340
- return {
1341
- start: p,
1342
- end: p
1343
- };
1344
- }, this.getFilledLength = function(c) {
1345
- var y = c.split(""), p = ee(y, function(D, O) {
1346
- return a.isPositionEditable(O) && a.isCharacterFillingPosition(D, O);
1347
- });
1348
- return p + 1;
1349
- }, this.getStringFillingLengthAtPosition = function(c, y) {
1350
- var p = c.split(""), D = p.reduce(function(O, C) {
1351
- return a.insertCharacterAtPosition(O, C, O.length);
1352
- }, o(" ", y));
1353
- return D.length - y;
1354
- }, this.getLeftEditablePosition = function(c) {
1355
- for (var y = c; y >= 0; y--)
1356
- if (a.isPositionEditable(y))
1357
- return y;
1358
- return null;
1359
- }, this.getRightEditablePosition = function(c) {
1360
- for (var y = a.maskOptions.mask, p = c; p < y.length; p++)
1361
- if (a.isPositionEditable(p))
1362
- return p;
1363
- return null;
1364
- }, this.formatValue = function(c) {
1365
- var y = a.maskOptions, p = y.maskPlaceholder, D = y.mask;
1366
- if (!p) {
1367
- for (c = a.insertStringAtPosition("", c, 0); c.length < D.length && !a.isPositionEditable(c.length); )
1368
- c += D[c.length];
1369
- return c;
1370
- }
1371
- return a.insertStringAtPosition(p, c, 0);
1372
- }, this.clearRange = function(c, y, p) {
1373
- if (!p)
1374
- return c;
1375
- var D = y + p, O = a.maskOptions, C = O.maskPlaceholder, U = O.mask, h = c.split("").map(function(I, q) {
1376
- var $ = a.isPositionEditable(q);
1377
- return !C && q >= D && !$ ? "" : q < y || q >= D ? I : $ ? C ? C[q] : "" : U[q];
1378
- }).join("");
1379
- return a.formatValue(h);
1380
- }, this.insertCharacterAtPosition = function(c, y, p) {
1381
- var D = a.maskOptions, O = D.mask, C = D.maskPlaceholder;
1382
- if (p >= O.length)
1383
- return c;
1384
- var U = a.isCharacterAllowedAtPosition(y, p), h = a.isPositionEditable(p), I = a.getRightEditablePosition(p), q = C && I ? y === C[I] : null, $ = c.slice(0, p);
1385
- if (U || !h) {
1386
- var ae = U ? y : O[p];
1387
- c = $ + ae;
1388
- }
1389
- return !U && !h && !q && (c = a.insertCharacterAtPosition(c, y, p + 1)), c;
1390
- }, this.insertStringAtPosition = function(c, y, p) {
1391
- var D = a.maskOptions, O = D.mask, C = D.maskPlaceholder;
1392
- if (!y || p >= O.length)
1393
- return c;
1394
- var U = y.split(""), h = a.isValueFilled(c) || !!C, I = c.slice(p);
1395
- if (c = U.reduce(function($, ae) {
1396
- return a.insertCharacterAtPosition($, ae, $.length);
1397
- }, c.slice(0, p)), h)
1398
- c += I.slice(c.length - p);
1399
- else if (a.isValueFilled(c))
1400
- c += O.slice(c.length).join("");
1401
- else {
1402
- var q = I.split("").filter(function($, ae) {
1403
- return a.isPositionEditable(p + ae);
1404
- });
1405
- c = q.reduce(function($, ae) {
1406
- var he = a.getRightEditablePosition($.length);
1407
- return he === null ? $ : (a.isPositionEditable($.length) || ($ += O.slice($.length, he).join("")), a.insertCharacterAtPosition($, ae, $.length));
1408
- }, c);
1409
- }
1410
- return c;
1411
- }, this.processChange = function(c, y) {
1412
- var p = a.maskOptions, D = p.mask, O = p.prefix, C = p.lastEditablePosition, U = c.value, h = c.selection, I = y.value, q = y.selection, $ = U, ae = "", he = 0, n = 0, s = Math.min(q.start, h.start);
1413
- if (h.end > q.start ? (ae = $.slice(q.start, h.end), he = a.getStringFillingLengthAtPosition(ae, s), he ? n = q.length : n = 0) : $.length < I.length && (n = I.length - $.length), $ = I, n) {
1414
- if (n === 1 && !q.length) {
1415
- var d = q.start === h.start;
1416
- s = d ? a.getRightEditablePosition(h.start) : a.getLeftEditablePosition(h.start);
1417
- }
1418
- $ = a.clearRange($, s, n);
1419
- }
1420
- return $ = a.insertStringAtPosition($, ae, s), s += he, s >= D.length ? s = D.length : s < O.length && !he ? s = O.length : s >= O.length && s < C && he && (s = a.getRightEditablePosition(s)), $ = a.formatValue($), {
1421
- value: $,
1422
- enteredString: ae,
1423
- selection: {
1424
- start: s,
1425
- end: s
1426
- }
1427
- };
1428
- }, this.maskOptions = J(u);
1429
- }, g = /* @__PURE__ */ function(v) {
1430
- H(u, v);
1431
- function u() {
1432
- return v.apply(this, arguments) || this;
1433
- }
1434
- var a = u.prototype;
1435
- return a.render = function() {
1436
- var y = this.props, p = y.children, D = L(y, ["children"]);
1437
- return r.cloneElement(p, D);
1438
- }, u;
1439
- }(r.Component), S = t.forwardRef(function(u, a) {
1440
- var c = u.alwaysShowMask, y = u.children, p = u.mask, D = u.maskPlaceholder, O = u.beforeMaskedStateChange, C = L(u, ["alwaysShowMask", "children", "mask", "maskPlaceholder", "beforeMaskedStateChange"]);
1441
- M(u), R(u);
1442
- var U = new le({
1443
- mask: p,
1444
- maskPlaceholder: D
1445
- }), h = !!p, I = !C.disabled && !C.readOnly, q = u.value !== null && u.value !== void 0, $ = T(h), ae = _((q ? u.value : u.defaultValue) || ""), he = Y(ae, h), n = he.inputRef, s = he.getInputState, d = he.setInputState, A = he.getLastInputState, w = m(n);
1446
- function x(me) {
1447
- var de = s(), Ee = A(), _e = U.processChange(de, Ee);
1448
- O && (_e = O({
1449
- currentState: de,
1450
- previousState: Ee,
1451
- nextState: _e
1452
- })), d(_e), u.onChange && u.onChange(me);
1453
- }
1454
- function N(me) {
1455
- n.current = me.target;
1456
- var de = s().value;
1457
- if (h && !U.isValueFilled(de)) {
1458
- var Ee = U.formatValue(de), _e = U.getDefaultSelectionForValue(Ee), ve = {
1459
- value: Ee,
1460
- selection: _e
1461
- };
1462
- O && (ve = O({
1463
- currentState: s(),
1464
- nextState: ve
1465
- }), Ee = ve.value, _e = ve.selection), d(ve), Ee !== de && u.onChange && u.onChange(me), V(function() {
1466
- d(A());
1467
- });
1468
- }
1469
- u.onFocus && u.onFocus(me);
1470
- }
1471
- function Q(me) {
1472
- var de = s().value, Ee = A().value;
1473
- if (h && !c && U.isValueEmpty(Ee)) {
1474
- var _e = "", ve = {
1475
- value: _e,
1476
- selection: {
1477
- start: null,
1478
- end: null
1479
- }
1480
- };
1481
- O && (ve = O({
1482
- currentState: s(),
1483
- nextState: ve
1484
- }), _e = ve.value), d(ve), _e !== de && u.onChange && u.onChange(me);
1485
- }
1486
- u.onBlur && u.onBlur(me);
1487
- }
1488
- function fe(me) {
1489
- var de = w(), Ee = s(), _e = Ee.value, ve = re(de);
1490
- if (!K(de) && !U.isValueFilled(_e)) {
1491
- var nt = me.clientX, We = me.clientY, Ye = (/* @__PURE__ */ new Date()).getTime(), it = function yr(xt) {
1492
- if (ve.removeEventListener("mouseup", yr), !!K(de)) {
1493
- var pr = Math.abs(xt.clientX - nt), mr = Math.abs(xt.clientY - We), wt = Math.max(pr, mr), Ot = (/* @__PURE__ */ new Date()).getTime() - Ye;
1494
- if (wt <= 10 && Ot <= 200 || wt <= 5 && Ot <= 300) {
1495
- var Ct = A(), br = U.getDefaultSelectionForValue(Ct.value), Er = X({}, Ct, {
1496
- selection: br
1497
- });
1498
- d(Er);
1499
- }
1500
- }
1501
- };
1502
- ve.addEventListener("mouseup", it);
1503
- }
1504
- u.onMouseDown && u.onMouseDown(me);
1505
- }
1506
- if (h && q) {
1507
- var be = w(), Te = be && K(be), je = Te || c || u.value ? U.formatValue(u.value) : u.value;
1508
- O && (je = O({
1509
- nextState: {
1510
- value: je,
1511
- selection: {
1512
- start: null,
1513
- end: null
1514
- }
1515
- }
1516
- }).value), d(X({}, A(), {
1517
- value: je
1518
- }));
1519
- }
1520
- var Me = A(), qe = Me.selection, rt = Me.value;
1521
- t.useLayoutEffect(function() {
1522
- if (h) {
1523
- var me = w(), de = K(me), Ee = qe, _e = s(), ve = X({}, _e);
1524
- if (!q) {
1525
- var nt = _e.value, We = U.formatValue(nt), Ye = U.isValueEmpty(We), it = !Ye || de || c;
1526
- it ? ve.value = We : Ye && !de && (ve.value = "");
1527
- }
1528
- de && !$ ? ve.selection = U.getDefaultSelectionForValue(ve.value) : q && de && Ee && Ee.start !== null && Ee.end !== null && (ve.selection = Ee), O && (ve = O({
1529
- currentState: _e,
1530
- nextState: ve
1531
- })), d(ve);
1532
- }
1533
- });
1534
- var Ne = X({}, C, {
1535
- onFocus: N,
1536
- onBlur: Q,
1537
- onChange: h && I ? x : u.onChange,
1538
- onMouseDown: h && I ? fe : u.onMouseDown,
1539
- ref: function(de) {
1540
- n.current = l.findDOMNode(de), ie(a) ? a(de) : a !== null && typeof a == "object" && (a.current = de);
1541
- },
1542
- value: h && q ? rt : u.value
1543
- });
1544
- return y ? (z(u, y), r.createElement(g, Ne, y)) : r.createElement("input", Ne);
1545
- });
1546
- return S.displayName = "InputMask", S.defaultProps = {
1547
- alwaysShowMask: !1,
1548
- maskPlaceholder: "_"
1549
- }, S.propTypes = {
1550
- alwaysShowMask: f.bool,
1551
- beforeMaskedStateChange: f.func,
1552
- children: f.element,
1553
- mask: f.oneOfType([f.string, f.arrayOf(f.oneOfType([f.string, f.instanceOf(RegExp)]))]),
1554
- maskPlaceholder: f.string,
1555
- onFocus: f.func,
1556
- onBlur: f.func,
1557
- onChange: f.func,
1558
- onMouseDown: f.func
1559
- }, gt = S, gt;
1560
- }
1561
- process.env.NODE_ENV === "production" ? bt.exports = Fr() : bt.exports = Dr();
1562
- var Mr = bt.exports;
1563
- const Lr = /* @__PURE__ */ _r(Mr), Ir = "_btn_m4eyd_1", jr = "_modal_m4eyd_9", qr = "_modalBody_m4eyd_16", Nr = "_root_m4eyd_21", Br = "_title_m4eyd_31", $r = "_description_m4eyd_38", Ur = "_inputWrapper_m4eyd_45", Re = {
1564
- btn: Ir,
1565
- modal: jr,
1566
- modalBody: qr,
1567
- root: Nr,
1568
- title: Br,
1569
- description: $r,
1570
- inputWrapper: Ur
1
+ import { jsx as W, jsxs as Se } from "react/jsx-runtime";
2
+ import { I as xt } from "../../../index-DB-VhohW.js";
3
+ import { M as Vt } from "../../../Modal-G1ISsPJt.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";
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";
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
1571
19
  };
1572
- var Ue = (e) => e.type === "checkbox", Ie = (e) => e instanceof Date, Se = (e) => e == null;
1573
- const ur = (e) => typeof e == "object";
1574
- var pe = (e) => !Se(e) && !Array.isArray(e) && ur(e) && !Ie(e), Wr = (e) => pe(e) && e.target ? Ue(e.target) ? e.target.checked : e.target.value : e, Yr = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, zr = (e, t) => e.has(Yr(t)), Hr = (e) => {
1575
- const t = e.constructor && e.constructor.prototype;
1576
- return pe(t) && t.hasOwnProperty("isPrototypeOf");
1577
- }, _t = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
1578
- function xe(e) {
1579
- let t;
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) => {
23
+ const s = e.constructor && e.constructor.prototype;
24
+ return S(s) && s.hasOwnProperty("isPrototypeOf");
25
+ }, Te = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
26
+ function U(e) {
27
+ let s;
1580
28
  const r = Array.isArray(e);
1581
29
  if (e instanceof Date)
1582
- t = new Date(e);
30
+ s = new Date(e);
1583
31
  else if (e instanceof Set)
1584
- t = new Set(e);
1585
- else if (!(_t && (e instanceof Blob || e instanceof FileList)) && (r || pe(e)))
1586
- if (t = r ? [] : {}, !r && !Hr(e))
1587
- t = e;
32
+ s = new Set(e);
33
+ else if (!(Te && (e instanceof Blob || e instanceof FileList)) && (r || S(e)))
34
+ if (s = r ? [] : {}, !r && !Ot(e))
35
+ s = e;
1588
36
  else
1589
37
  for (const l in e)
1590
- e.hasOwnProperty(l) && (t[l] = xe(e[l]));
38
+ e.hasOwnProperty(l) && (s[l] = U(e[l]));
1591
39
  else
1592
40
  return e;
1593
- return t;
41
+ return s;
1594
42
  }
1595
- var tt = (e) => Array.isArray(e) ? e.filter(Boolean) : [], ge = (e) => e === void 0, j = (e, t, r) => {
1596
- if (!t || !pe(e))
43
+ var Ae = (e) => Array.isArray(e) ? e.filter(Boolean) : [], A = (e) => e === void 0, d = (e, s, r) => {
44
+ if (!s || !S(e))
1597
45
  return r;
1598
- const l = tt(t.split(/[,[\].]+?/)).reduce((f, i) => Se(f) ? f : f[i], e);
1599
- return ge(l) || l === e ? ge(e[t]) ? r : e[t] : l;
1600
- }, Ve = (e) => typeof e == "boolean", St = (e) => /^\w*$/.test(e), lr = (e) => tt(e.replace(/["|']|\]/g, "").split(/\.|\[/)), ce = (e, t, 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) => {
1601
49
  let l = -1;
1602
- const f = St(t) ? [t] : lr(t), i = f.length, E = i - 1;
1603
- for (; ++l < i; ) {
1604
- const k = f[l];
1605
- let X = r;
1606
- if (l !== E) {
1607
- const H = e[k];
1608
- X = pe(H) || Array.isArray(H) ? H : isNaN(+f[l + 1]) ? {} : [];
1609
- }
1610
- if (k === "__proto__")
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]) ? {} : [];
57
+ }
58
+ if (g === "__proto__")
1611
59
  return;
1612
- e[k] = X, e = e[k];
60
+ e[g] = R, e = e[g];
1613
61
  }
1614
62
  return e;
1615
63
  };
1616
- const zt = {
64
+ const Je = {
1617
65
  BLUR: "blur",
1618
66
  FOCUS_OUT: "focusout",
1619
67
  CHANGE: "change"
1620
- }, Oe = {
68
+ }, H = {
1621
69
  onBlur: "onBlur",
1622
70
  onChange: "onChange",
1623
71
  onSubmit: "onSubmit",
1624
72
  onTouched: "onTouched",
1625
73
  all: "all"
1626
- }, Ae = {
74
+ }, Q = {
1627
75
  max: "max",
1628
76
  min: "min",
1629
77
  maxLength: "maxLength",
@@ -1632,323 +80,323 @@ const zt = {
1632
80
  required: "required",
1633
81
  validate: "validate"
1634
82
  };
1635
- Pe.createContext(null);
1636
- var Xr = (e, t, r, l = !0) => {
1637
- const f = {
1638
- defaultValues: t._defaultValues
83
+ I.createContext(null);
84
+ var Nt = (e, s, r, l = !0) => {
85
+ const u = {
86
+ defaultValues: s._defaultValues
1639
87
  };
1640
- for (const i in e)
1641
- Object.defineProperty(f, i, {
88
+ for (const a in e)
89
+ Object.defineProperty(u, a, {
1642
90
  get: () => {
1643
- const E = i;
1644
- return t._proxyFormState[E] !== Oe.all && (t._proxyFormState[E] = !l || Oe.all), e[E];
91
+ const y = a;
92
+ return s._proxyFormState[y] !== H.all && (s._proxyFormState[y] = !l || H.all), e[y];
1645
93
  }
1646
94
  });
1647
- return f;
1648
- }, ke = (e) => pe(e) && !Object.keys(e).length, Zr = (e, t, r, l) => {
95
+ return u;
96
+ }, T = (e) => S(e) && !Object.keys(e).length, Ut = (e, s, r, l) => {
1649
97
  r(e);
1650
- const { name: f, ...i } = e;
1651
- return ke(i) || Object.keys(i).length >= Object.keys(t).length || Object.keys(i).find((E) => t[E] === Oe.all);
1652
- }, Ze = (e) => Array.isArray(e) ? e : [e];
1653
- function Kr(e) {
1654
- const t = Pe.useRef(e);
1655
- t.current = e, Pe.useEffect(() => {
1656
- const r = !e.disabled && t.current.subject && t.current.subject.subscribe({
1657
- next: t.current.next
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);
100
+ }, _e = (e) => Array.isArray(e) ? e : [e];
101
+ function It(e) {
102
+ const s = I.useRef(e);
103
+ s.current = e, I.useEffect(() => {
104
+ const r = !e.disabled && s.current.subject && s.current.subject.subscribe({
105
+ next: s.current.next
1658
106
  });
1659
107
  return () => {
1660
108
  r && r.unsubscribe();
1661
109
  };
1662
110
  }, [e.disabled]);
1663
111
  }
1664
- var Ce = (e) => typeof e == "string", Jr = (e, t, r, l, f) => Ce(e) ? (l && t.watch.add(e), j(r, e, f)) : Array.isArray(e) ? e.map((i) => (l && t.watch.add(i), j(r, i))) : (l && (t.watchAll = !0), r), Gr = (e, t, r, l, f) => t ? {
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 ? {
1665
113
  ...r[e],
1666
114
  types: {
1667
115
  ...r[e] && r[e].types ? r[e].types : {},
1668
- [l]: f || !0
116
+ [l]: u || !0
1669
117
  }
1670
- } : {}, Ht = (e) => ({
1671
- isOnSubmit: !e || e === Oe.onSubmit,
1672
- isOnBlur: e === Oe.onBlur,
1673
- isOnChange: e === Oe.onChange,
1674
- isOnAll: e === Oe.all,
1675
- isOnTouch: e === Oe.onTouched
1676
- }), Xt = (e, t, r) => !r && (t.watchAll || t.watch.has(e) || [...t.watch].some((l) => e.startsWith(l) && /^\.\w+/.test(e.slice(l.length))));
1677
- const $e = (e, t, r, l) => {
1678
- for (const f of r || Object.keys(e)) {
1679
- const i = j(e, f);
1680
- if (i) {
1681
- const { _f: E, ...k } = i;
1682
- if (E) {
1683
- if (E.refs && E.refs[0] && t(E.refs[0], f) && !l)
118
+ } : {}, 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) => {
126
+ for (const u of r || Object.keys(e)) {
127
+ const a = d(e, u);
128
+ if (a) {
129
+ const { _f: y, ...g } = a;
130
+ if (y) {
131
+ if (y.refs && y.refs[0] && s(y.refs[0], u) && !l)
1684
132
  break;
1685
- if (E.ref && t(E.ref, E.name) && !l)
133
+ if (y.ref && s(y.ref, y.name) && !l)
1686
134
  break;
1687
- $e(k, t);
135
+ de(g, s);
1688
136
  } else
1689
- pe(k) && $e(k, t);
137
+ S(g) && de(g, s);
1690
138
  }
1691
139
  }
1692
140
  };
1693
- var Qr = (e, t, r) => {
1694
- const l = Ze(j(e, r));
1695
- return ce(l, "root", t[r]), ce(e, r, l), e;
1696
- }, kt = (e) => e.type === "file", Fe = (e) => typeof e == "function", Je = (e) => {
1697
- if (!_t)
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)
1698
146
  return !1;
1699
- const t = e ? e.ownerDocument : 0;
1700
- return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
1701
- }, Ke = (e) => Ce(e), Pt = (e) => e.type === "radio", Ge = (e) => e instanceof RegExp;
1702
- const Zt = {
147
+ const s = e ? e.ownerDocument : 0;
148
+ 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
+ const Ye = {
1703
151
  value: !1,
1704
152
  isValid: !1
1705
- }, Kt = { value: !0, isValid: !0 };
1706
- var cr = (e) => {
153
+ }, Ze = { value: !0, isValid: !0 };
154
+ var lt = (e) => {
1707
155
  if (Array.isArray(e)) {
1708
156
  if (e.length > 1) {
1709
- const t = e.filter((r) => r && r.checked && !r.disabled).map((r) => r.value);
1710
- return { value: t, isValid: !!t.length };
157
+ const s = e.filter((r) => r && r.checked && !r.disabled).map((r) => r.value);
158
+ return { value: s, isValid: !!s.length };
1711
159
  }
1712
160
  return e[0].checked && !e[0].disabled ? (
1713
161
  // @ts-expect-error expected to work in the browser
1714
- e[0].attributes && !ge(e[0].attributes.value) ? ge(e[0].value) || e[0].value === "" ? Kt : { value: e[0].value, isValid: !0 } : Kt
1715
- ) : Zt;
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
+ ) : Ye;
1716
164
  }
1717
- return Zt;
165
+ return Ye;
1718
166
  };
1719
- const Jt = {
167
+ const et = {
1720
168
  isValid: !1,
1721
169
  value: null
1722
170
  };
1723
- var fr = (e) => Array.isArray(e) ? e.reduce((t, r) => r && r.checked && !r.disabled ? {
171
+ var ut = (e) => Array.isArray(e) ? e.reduce((s, r) => r && r.checked && !r.disabled ? {
1724
172
  isValid: !0,
1725
173
  value: r.value
1726
- } : t, Jt) : Jt;
1727
- function Gt(e, t, r = "validate") {
1728
- if (Ke(e) || Array.isArray(e) && e.every(Ke) || Ve(e) && !e)
174
+ } : s, et) : et;
175
+ function tt(e, s, r = "validate") {
176
+ if (me(e) || Array.isArray(e) && e.every(me) || Y(e) && !e)
1729
177
  return {
1730
178
  type: r,
1731
- message: Ke(e) ? e : "",
1732
- ref: t
179
+ message: me(e) ? e : "",
180
+ ref: s
1733
181
  };
1734
182
  }
1735
- var Le = (e) => pe(e) && !Ge(e) ? e : {
183
+ var ne = (e) => S(e) && !xe(e) ? e : {
1736
184
  value: e,
1737
185
  message: ""
1738
- }, Qt = async (e, t, r, l, f) => {
1739
- const { ref: i, refs: E, required: k, maxLength: X, minLength: H, min: L, max: V, pattern: ne, validate: G, name: te, valueAsNumber: K, mount: re, disabled: ue } = e._f, Z = j(t, te);
1740
- if (!re || ue)
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)
1741
189
  return {};
1742
- const ie = E ? E[0] : i, ee = (T) => {
1743
- l && ie.reportValidity && (ie.setCustomValidity(Ve(T) ? "" : T || ""), ie.reportValidity());
1744
- }, o = {}, _ = Pt(i), m = Ue(i), b = _ || m, P = (K || kt(i)) && ge(i.value) && ge(Z) || Je(i) && i.value === "" || Z === "" || Array.isArray(Z) && !Z.length, F = Gr.bind(null, te, r, o), Y = (T, B, W, M = Ae.maxLength, R = Ae.minLength) => {
1745
- const z = T ? B : W;
1746
- o[te] = {
1747
- type: T ? M : R,
1748
- message: z,
1749
- ref: i,
1750
- ...F(T ? M : R, z)
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)
1751
199
  };
1752
200
  };
1753
- if (f ? !Array.isArray(Z) || !Z.length : k && (!b && (P || Se(Z)) || Ve(Z) && !Z || m && !cr(E).isValid || _ && !fr(E).isValid)) {
1754
- const { value: T, message: B } = Ke(k) ? { value: !!k, message: k } : Le(k);
1755
- if (T && (o[te] = {
1756
- type: Ae.required,
1757
- message: B,
1758
- ref: ie,
1759
- ...F(Ae.required, B)
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,
205
+ message: b,
206
+ ref: P,
207
+ ...O(Q.required, b)
1760
208
  }, !r))
1761
- return ee(B), o;
209
+ return J(b), p;
1762
210
  }
1763
- if (!P && (!Se(L) || !Se(V))) {
1764
- let T, B;
1765
- const W = Le(V), M = Le(L);
1766
- if (!Se(Z) && !isNaN(Z)) {
1767
- const R = i.valueAsNumber || Z && +Z;
1768
- Se(W.value) || (T = R > W.value), Se(M.value) || (B = R < M.value);
211
+ if (!se && (!B(F) || !B(v))) {
212
+ let _, b;
213
+ const D = ne(v), E = ne(F);
214
+ 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);
1769
217
  } else {
1770
- const R = i.valueAsDate || new Date(Z), z = (g) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + g), J = i.type == "time", le = i.type == "week";
1771
- Ce(W.value) && Z && (T = J ? z(Z) > z(W.value) : le ? Z > W.value : R > new Date(W.value)), Ce(M.value) && Z && (B = J ? z(Z) < z(M.value) : le ? Z < M.value : R < new Date(M.value));
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));
1772
220
  }
1773
- if ((T || B) && (Y(!!T, W.message, M.message, Ae.max, Ae.min), !r))
1774
- return ee(o[te].message), o;
221
+ if ((_ || b) && (ge(!!_, D.message, E.message, Q.max, Q.min), !r))
222
+ return J(p[C].message), p;
1775
223
  }
1776
- if ((X || H) && !P && (Ce(Z) || f && Array.isArray(Z))) {
1777
- const T = Le(X), B = Le(H), W = !Se(T.value) && Z.length > +T.value, M = !Se(B.value) && Z.length < +B.value;
1778
- if ((W || M) && (Y(W, T.message, B.message), !r))
1779
- return ee(o[te].message), o;
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;
226
+ if ((D || E) && (ge(D, _.message, b.message), !r))
227
+ return J(p[C].message), p;
1780
228
  }
1781
- if (ne && !P && Ce(Z)) {
1782
- const { value: T, message: B } = Le(ne);
1783
- if (Ge(T) && !Z.match(T) && (o[te] = {
1784
- type: Ae.pattern,
1785
- message: B,
1786
- ref: i,
1787
- ...F(Ae.pattern, B)
229
+ if (G && !se && K(m)) {
230
+ const { value: _, message: b } = ne(G);
231
+ if (xe(_) && !m.match(_) && (p[C] = {
232
+ type: Q.pattern,
233
+ message: b,
234
+ ref: a,
235
+ ...O(Q.pattern, b)
1788
236
  }, !r))
1789
- return ee(B), o;
237
+ return J(b), p;
1790
238
  }
1791
- if (G) {
1792
- if (Fe(G)) {
1793
- const T = await G(Z, t), B = Gt(T, ie);
1794
- if (B && (o[te] = {
1795
- ...B,
1796
- ...F(Ae.validate, B.message)
239
+ if (z) {
240
+ if (Z(z)) {
241
+ const _ = await z(m, s), b = tt(_, P);
242
+ if (b && (p[C] = {
243
+ ...b,
244
+ ...O(Q.validate, b.message)
1797
245
  }, !r))
1798
- return ee(B.message), o;
1799
- } else if (pe(G)) {
1800
- let T = {};
1801
- for (const B in G) {
1802
- if (!ke(T) && !r)
246
+ return J(b.message), p;
247
+ } else if (S(z)) {
248
+ let _ = {};
249
+ for (const b in z) {
250
+ if (!T(_) && !r)
1803
251
  break;
1804
- const W = Gt(await G[B](Z, t), ie, B);
1805
- W && (T = {
1806
- ...W,
1807
- ...F(B, W.message)
1808
- }, ee(W.message), r && (o[te] = T));
252
+ const D = tt(await z[b](m, s), P, b);
253
+ D && (_ = {
254
+ ...D,
255
+ ...O(b, D.message)
256
+ }, J(D.message), r && (p[C] = _));
1809
257
  }
1810
- if (!ke(T) && (o[te] = {
1811
- ref: ie,
1812
- ...T
258
+ if (!T(_) && (p[C] = {
259
+ ref: P,
260
+ ..._
1813
261
  }, !r))
1814
- return o;
262
+ return p;
1815
263
  }
1816
264
  }
1817
- return ee(!0), o;
265
+ return J(!0), p;
1818
266
  };
1819
- function en(e, t) {
1820
- const r = t.slice(0, -1).length;
267
+ function Ht(e, s) {
268
+ const r = s.slice(0, -1).length;
1821
269
  let l = 0;
1822
270
  for (; l < r; )
1823
- e = ge(e) ? l++ : e[t[l++]];
271
+ e = A(e) ? l++ : e[s[l++]];
1824
272
  return e;
1825
273
  }
1826
- function tn(e) {
1827
- for (const t in e)
1828
- if (e.hasOwnProperty(t) && !ge(e[t]))
274
+ function zt(e) {
275
+ for (const s in e)
276
+ if (e.hasOwnProperty(s) && !A(e[s]))
1829
277
  return !1;
1830
278
  return !0;
1831
279
  }
1832
- function ye(e, t) {
1833
- const r = Array.isArray(t) ? t : St(t) ? [t] : lr(t), l = r.length === 1 ? e : en(e, r), f = r.length - 1, i = r[f];
1834
- return l && delete l[i], f !== 0 && (pe(l) && ke(l) || Array.isArray(l) && tn(l)) && ye(e, r.slice(0, -1)), e;
280
+ 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;
1835
283
  }
1836
- var yt = () => {
284
+ var Ee = () => {
1837
285
  let e = [];
1838
286
  return {
1839
287
  get observers() {
1840
288
  return e;
1841
289
  },
1842
- next: (f) => {
1843
- for (const i of e)
1844
- i.next && i.next(f);
290
+ next: (u) => {
291
+ for (const a of e)
292
+ a.next && a.next(u);
1845
293
  },
1846
- subscribe: (f) => (e.push(f), {
294
+ subscribe: (u) => (e.push(u), {
1847
295
  unsubscribe: () => {
1848
- e = e.filter((i) => i !== f);
296
+ e = e.filter((a) => a !== u);
1849
297
  }
1850
298
  }),
1851
299
  unsubscribe: () => {
1852
300
  e = [];
1853
301
  }
1854
302
  };
1855
- }, Qe = (e) => Se(e) || !ur(e);
1856
- function De(e, t) {
1857
- if (Qe(e) || Qe(t))
1858
- return e === t;
1859
- if (Ie(e) && Ie(t))
1860
- return e.getTime() === t.getTime();
1861
- const r = Object.keys(e), l = Object.keys(t);
303
+ }, Ve = (e) => B(e) || !nt(e);
304
+ function te(e, s) {
305
+ if (Ve(e) || Ve(s))
306
+ return e === s;
307
+ if (ae(e) && ae(s))
308
+ return e.getTime() === s.getTime();
309
+ const r = Object.keys(e), l = Object.keys(s);
1862
310
  if (r.length !== l.length)
1863
311
  return !1;
1864
- for (const f of r) {
1865
- const i = e[f];
1866
- if (!l.includes(f))
312
+ for (const u of r) {
313
+ const a = e[u];
314
+ if (!l.includes(u))
1867
315
  return !1;
1868
- if (f !== "ref") {
1869
- const E = t[f];
1870
- if (Ie(i) && Ie(E) || pe(i) && pe(E) || Array.isArray(i) && Array.isArray(E) ? !De(i, E) : i !== E)
316
+ if (u !== "ref") {
317
+ 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)
1871
319
  return !1;
1872
320
  }
1873
321
  }
1874
322
  return !0;
1875
323
  }
1876
- var dr = (e) => e.type === "select-multiple", rn = (e) => Pt(e) || Ue(e), pt = (e) => Je(e) && e.isConnected, vr = (e) => {
1877
- for (const t in e)
1878
- if (Fe(e[t]))
324
+ var ot = (e) => e.type === "select-multiple", $t = (e) => Me(e) || ye(e), Ce = (e) => be(e) && e.isConnected, ct = (e) => {
325
+ for (const s in e)
326
+ if (Z(e[s]))
1879
327
  return !0;
1880
328
  return !1;
1881
329
  };
1882
- function et(e, t = {}) {
330
+ function Fe(e, s = {}) {
1883
331
  const r = Array.isArray(e);
1884
- if (pe(e) || r)
332
+ if (S(e) || r)
1885
333
  for (const l in e)
1886
- Array.isArray(e[l]) || pe(e[l]) && !vr(e[l]) ? (t[l] = Array.isArray(e[l]) ? [] : {}, et(e[l], t[l])) : Se(e[l]) || (t[l] = !0);
1887
- return t;
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);
335
+ return s;
1888
336
  }
1889
- function hr(e, t, r) {
337
+ function ft(e, s, r) {
1890
338
  const l = Array.isArray(e);
1891
- if (pe(e) || l)
1892
- for (const f in e)
1893
- Array.isArray(e[f]) || pe(e[f]) && !vr(e[f]) ? ge(t) || Qe(r[f]) ? r[f] = Array.isArray(e[f]) ? et(e[f], []) : { ...et(e[f]) } : hr(e[f], Se(t) ? {} : t[f], r[f]) : r[f] = !De(e[f], t[f]);
339
+ if (S(e) || l)
340
+ 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]);
1894
342
  return r;
1895
343
  }
1896
- var Xe = (e, t) => hr(e, t, et(t)), gr = (e, { valueAsNumber: t, valueAsDate: r, setValueAs: l }) => ge(e) ? e : t ? e === "" ? NaN : e && +e : r && Ce(e) ? new Date(e) : l ? l(e) : e;
1897
- function mt(e) {
1898
- const t = e.ref;
1899
- if (!(e.refs ? e.refs.every((r) => r.disabled) : t.disabled))
1900
- return kt(t) ? t.files : Pt(t) ? fr(e.refs).value : dr(t) ? [...t.selectedOptions].map(({ value: r }) => r) : Ue(t) ? cr(e.refs).value : gr(ge(t.value) ? e.ref.value : t.value, e);
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) {
346
+ const s = e.ref;
347
+ 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);
1901
349
  }
1902
- var nn = (e, t, r, l) => {
1903
- const f = {};
1904
- for (const i of e) {
1905
- const E = j(t, i);
1906
- E && ce(f, i, E._f);
350
+ var jt = (e, s, r, l) => {
351
+ const u = {};
352
+ for (const a of e) {
353
+ const y = d(s, a);
354
+ y && V(u, a, y._f);
1907
355
  }
1908
356
  return {
1909
357
  criteriaMode: r,
1910
358
  names: [...e],
1911
- fields: f,
359
+ fields: u,
1912
360
  shouldUseNativeValidation: l
1913
361
  };
1914
- }, Be = (e) => ge(e) ? e : Ge(e) ? e.source : pe(e) ? Ge(e.value) ? e.value.source : e.value : e, an = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
1915
- function er(e, t, r) {
1916
- const l = j(e, r);
1917
- if (l || St(r))
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
+ function st(e, s, r) {
364
+ const l = d(e, r);
365
+ if (l || Re(r))
1918
366
  return {
1919
367
  error: l,
1920
368
  name: r
1921
369
  };
1922
- const f = r.split(".");
1923
- for (; f.length; ) {
1924
- const i = f.join("."), E = j(t, i), k = j(e, i);
1925
- if (E && !Array.isArray(E) && r !== i)
370
+ const u = r.split(".");
371
+ for (; u.length; ) {
372
+ const a = u.join("."), y = d(s, a), g = d(e, a);
373
+ if (y && !Array.isArray(y) && r !== a)
1926
374
  return { name: r };
1927
- if (k && k.type)
375
+ if (g && g.type)
1928
376
  return {
1929
- name: i,
1930
- error: k
377
+ name: a,
378
+ error: g
1931
379
  };
1932
- f.pop();
380
+ u.pop();
1933
381
  }
1934
382
  return {
1935
383
  name: r
1936
384
  };
1937
385
  }
1938
- var sn = (e, t, r, l, f) => f.isOnAll ? !1 : !r && f.isOnTouch ? !(t || e) : (r ? l.isOnBlur : f.isOnBlur) ? !e : (r ? l.isOnChange : f.isOnChange) ? e : !0, on = (e, t) => !tt(j(e, t)).length && ye(e, t);
1939
- const un = {
1940
- mode: Oe.onSubmit,
1941
- reValidateMode: Oe.onChange,
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,
1942
390
  shouldFocusError: !0
1943
391
  };
1944
- function ln(e = {}) {
1945
- let t = {
1946
- ...un,
392
+ function Xt(e = {}) {
393
+ let s = {
394
+ ...Qt,
1947
395
  ...e
1948
396
  }, r = {
1949
397
  submitCount: 0,
1950
398
  isDirty: !1,
1951
- isLoading: Fe(t.defaultValues),
399
+ isLoading: Z(s.defaultValues),
1952
400
  isValidating: !1,
1953
401
  isSubmitted: !1,
1954
402
  isSubmitting: !1,
@@ -1957,19 +405,19 @@ function ln(e = {}) {
1957
405
  touchedFields: {},
1958
406
  dirtyFields: {},
1959
407
  validatingFields: {},
1960
- errors: t.errors || {},
1961
- disabled: t.disabled || !1
1962
- }, l = {}, f = pe(t.defaultValues) || pe(t.values) ? xe(t.defaultValues || t.values) || {} : {}, i = t.shouldUnregister ? {} : xe(f), E = {
408
+ errors: s.errors || {},
409
+ disabled: s.disabled || !1
410
+ }, l = {}, u = S(s.defaultValues) || S(s.values) ? U(s.defaultValues || s.values) || {} : {}, a = s.shouldUnregister ? {} : U(u), y = {
1963
411
  action: !1,
1964
412
  mount: !1,
1965
413
  watch: !1
1966
- }, k = {
414
+ }, g = {
1967
415
  mount: /* @__PURE__ */ new Set(),
1968
416
  unMount: /* @__PURE__ */ new Set(),
1969
417
  array: /* @__PURE__ */ new Set(),
1970
418
  watch: /* @__PURE__ */ new Set()
1971
- }, X, H = 0;
1972
- const L = {
419
+ }, R, M = 0;
420
+ const F = {
1973
421
  isDirty: !1,
1974
422
  dirtyFields: !1,
1975
423
  validatingFields: !1,
@@ -1977,359 +425,359 @@ function ln(e = {}) {
1977
425
  isValidating: !1,
1978
426
  isValid: !1,
1979
427
  errors: !1
1980
- }, V = {
1981
- values: yt(),
1982
- array: yt(),
1983
- state: yt()
1984
- }, ne = Ht(t.mode), G = Ht(t.reValidateMode), te = t.criteriaMode === Oe.all, K = (n) => (s) => {
1985
- clearTimeout(H), H = setTimeout(n, s);
1986
- }, re = async (n) => {
1987
- if (L.isValid || n) {
1988
- const s = t.resolver ? ke((await b()).errors) : await F(l, !0);
1989
- s !== r.isValid && V.state.next({
1990
- isValid: s
428
+ }, 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);
437
+ i !== r.isValid && v.state.next({
438
+ isValid: i
1991
439
  });
1992
440
  }
1993
- }, ue = (n, s) => {
1994
- (L.isValidating || L.validatingFields) && ((n || Array.from(k.mount)).forEach((d) => {
1995
- d && (s ? ce(r.validatingFields, d, s) : ye(r.validatingFields, d));
1996
- }), V.state.next({
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));
444
+ }), v.state.next({
1997
445
  validatingFields: r.validatingFields,
1998
- isValidating: !ke(r.validatingFields)
446
+ isValidating: !T(r.validatingFields)
1999
447
  }));
2000
- }, Z = (n, s = [], d, A, w = !0, x = !0) => {
2001
- if (A && d) {
2002
- if (E.action = !0, x && Array.isArray(j(l, n))) {
2003
- const N = d(j(l, n), A.argA, A.argB);
2004
- w && ce(l, n, N);
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);
2005
453
  }
2006
- if (x && Array.isArray(j(r.errors, n))) {
2007
- const N = d(j(r.errors, n), A.argA, A.argB);
2008
- w && ce(r.errors, n, N), on(r.errors, n);
454
+ 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);
2009
457
  }
2010
- if (L.touchedFields && x && Array.isArray(j(r.touchedFields, n))) {
2011
- const N = d(j(r.touchedFields, n), A.argA, A.argB);
2012
- w && ce(r.touchedFields, n, N);
458
+ if (F.touchedFields && o && Array.isArray(d(r.touchedFields, t))) {
459
+ const h = n(d(r.touchedFields, t), f.argA, f.argB);
460
+ c && V(r.touchedFields, t, h);
2013
461
  }
2014
- L.dirtyFields && (r.dirtyFields = Xe(f, i)), V.state.next({
2015
- name: n,
2016
- isDirty: T(n, s),
462
+ F.dirtyFields && (r.dirtyFields = ve(u, a)), v.state.next({
463
+ name: t,
464
+ isDirty: _(t, i),
2017
465
  dirtyFields: r.dirtyFields,
2018
466
  errors: r.errors,
2019
467
  isValid: r.isValid
2020
468
  });
2021
469
  } else
2022
- ce(i, n, s);
2023
- }, ie = (n, s) => {
2024
- ce(r.errors, n, s), V.state.next({
470
+ V(a, t, i);
471
+ }, P = (t, i) => {
472
+ V(r.errors, t, i), v.state.next({
2025
473
  errors: r.errors
2026
474
  });
2027
- }, ee = (n) => {
2028
- r.errors = n, V.state.next({
475
+ }, J = (t) => {
476
+ r.errors = t, v.state.next({
2029
477
  errors: r.errors,
2030
478
  isValid: !1
2031
479
  });
2032
- }, o = (n, s, d, A) => {
2033
- const w = j(l, n);
2034
- if (w) {
2035
- const x = j(i, n, ge(d) ? j(f, n) : d);
2036
- ge(x) || A && A.defaultChecked || s ? ce(i, n, s ? x : mt(w._f)) : M(n, x), E.mount && re();
2037
- }
2038
- }, _ = (n, s, d, A, w) => {
2039
- let x = !1, N = !1;
2040
- const Q = {
2041
- name: n
2042
- }, fe = !!(j(l, n) && j(l, n)._f && j(l, n)._f.disabled);
2043
- if (!d || A) {
2044
- L.isDirty && (N = r.isDirty, r.isDirty = Q.isDirty = T(), x = N !== Q.isDirty);
2045
- const be = fe || De(j(f, n), s);
2046
- N = !!(!fe && j(r.dirtyFields, n)), be || fe ? ye(r.dirtyFields, n) : ce(r.dirtyFields, n, !0), Q.dirtyFields = r.dirtyFields, x = x || L.dirtyFields && N !== !be;
2047
- }
2048
- if (d) {
2049
- const be = j(r.touchedFields, n);
2050
- be || (ce(r.touchedFields, n, d), Q.touchedFields = r.touchedFields, x = x || L.touchedFields && be !== d);
2051
- }
2052
- return x && w && V.state.next(Q), x ? Q : {};
2053
- }, m = (n, s, d, A) => {
2054
- const w = j(r.errors, n), x = L.isValid && Ve(s) && r.isValid !== s;
2055
- if (e.delayError && d ? (X = K(() => ie(n, d)), X(e.delayError)) : (clearTimeout(H), X = null, d ? ce(r.errors, n, d) : ye(r.errors, n)), (d ? !De(w, d) : w) || !ke(A) || x) {
2056
- const N = {
2057
- ...A,
2058
- ...x && Ve(s) ? { isValid: s } : {},
480
+ }, p = (t, i, n, f) => {
481
+ const c = d(l, t);
482
+ 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 && $();
485
+ }
486
+ }, re = (t, i, n, f, c) => {
487
+ let o = !1, h = !1;
488
+ const x = {
489
+ 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;
495
+ }
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);
499
+ }
500
+ 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) {
504
+ const h = {
505
+ ...f,
506
+ ...o && Y(i) ? { isValid: i } : {},
2059
507
  errors: r.errors,
2060
- name: n
508
+ name: t
2061
509
  };
2062
510
  r = {
2063
511
  ...r,
2064
- ...N
2065
- }, V.state.next(N);
2066
- }
2067
- }, b = async (n) => {
2068
- ue(n, !0);
2069
- const s = await t.resolver(i, t.context, nn(n || k.mount, l, t.criteriaMode, t.shouldUseNativeValidation));
2070
- return ue(n), s;
2071
- }, P = async (n) => {
2072
- const { errors: s } = await b(n);
2073
- if (n)
2074
- for (const d of n) {
2075
- const A = j(s, d);
2076
- A ? ce(r.errors, d, A) : ye(r.errors, d);
512
+ ...h
513
+ }, v.state.next(h);
514
+ }
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);
521
+ 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);
2077
525
  }
2078
526
  else
2079
- r.errors = s;
2080
- return s;
2081
- }, F = async (n, s, d = {
527
+ r.errors = i;
528
+ return i;
529
+ }, O = async (t, i, n = {
2082
530
  valid: !0
2083
531
  }) => {
2084
- for (const A in n) {
2085
- const w = n[A];
2086
- if (w) {
2087
- const { _f: x, ...N } = w;
2088
- if (x) {
2089
- const Q = k.array.has(x.name);
2090
- ue([A], !0);
2091
- const fe = await Qt(w, i, te, t.shouldUseNativeValidation && !s, Q);
2092
- if (ue([A]), fe[x.name] && (d.valid = !1, s))
532
+ for (const f in t) {
533
+ const c = t[f];
534
+ if (c) {
535
+ const { _f: o, ...h } = c;
536
+ if (o) {
537
+ 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))
2093
541
  break;
2094
- !s && (j(fe, x.name) ? Q ? Qr(r.errors, fe, x.name) : ce(r.errors, x.name, fe[x.name]) : ye(r.errors, x.name));
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));
2095
543
  }
2096
- !ke(N) && await F(N, s, d);
544
+ !T(h) && await O(h, i, n);
2097
545
  }
2098
546
  }
2099
- return d.valid;
2100
- }, Y = () => {
2101
- for (const n of k.unMount) {
2102
- const s = j(l, n);
2103
- s && (s._f.refs ? s._f.refs.every((d) => !pt(d)) : !pt(s._f.ref)) && y(n);
2104
- }
2105
- k.unMount = /* @__PURE__ */ new Set();
2106
- }, T = (n, s) => (n && s && ce(i, n, s), !De(S(), f)), B = (n, s, d) => Jr(n, k, {
2107
- ...E.mount ? i : ge(s) ? f : Ce(n) ? { [n]: s } : s
2108
- }, d, s), W = (n) => tt(j(E.mount ? i : f, n, e.shouldUnregister ? j(f, n, []) : [])), M = (n, s, d = {}) => {
2109
- const A = j(l, n);
2110
- let w = s;
2111
- if (A) {
2112
- const x = A._f;
2113
- x && (!x.disabled && ce(i, n, gr(s, x)), w = Je(x.ref) && Se(s) ? "" : s, dr(x.ref) ? [...x.ref.options].forEach((N) => N.selected = w.includes(N.value)) : x.refs ? Ue(x.ref) ? x.refs.length > 1 ? x.refs.forEach((N) => (!N.defaultChecked || !N.disabled) && (N.checked = Array.isArray(w) ? !!w.find((Q) => Q === N.value) : w === N.value)) : x.refs[0] && (x.refs[0].checked = !!w) : x.refs.forEach((N) => N.checked = N.value === w) : kt(x.ref) ? x.ref.value = "" : (x.ref.value = w, x.ref.type || V.values.next({
2114
- name: n,
2115
- values: { ...i }
547
+ return n.valid;
548
+ }, ge = () => {
549
+ 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);
552
+ }
553
+ 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);
558
+ let c = i;
559
+ if (f) {
560
+ 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
+ name: t,
563
+ values: { ...a }
2116
564
  })));
2117
565
  }
2118
- (d.shouldDirty || d.shouldTouch) && _(n, w, d.shouldTouch, d.shouldDirty, !0), d.shouldValidate && g(n);
2119
- }, R = (n, s, d) => {
2120
- for (const A in s) {
2121
- const w = s[A], x = `${n}.${A}`, N = j(l, x);
2122
- (k.array.has(n) || !Qe(w) || N && !N._f) && !Ie(w) ? R(x, w, d) : M(x, w, d);
2123
- }
2124
- }, z = (n, s, d = {}) => {
2125
- const A = j(l, n), w = k.array.has(n), x = xe(s);
2126
- ce(i, n, x), w ? (V.array.next({
2127
- name: n,
2128
- values: { ...i }
2129
- }), (L.isDirty || L.dirtyFields) && d.shouldDirty && V.state.next({
2130
- name: n,
2131
- dirtyFields: Xe(f, i),
2132
- isDirty: T(n, x)
2133
- })) : A && !A._f && !Se(x) ? R(n, x, d) : M(n, x, d), Xt(n, k) && V.state.next({ ...r }), V.values.next({
2134
- name: E.mount ? n : void 0,
2135
- values: { ...i }
566
+ (n.shouldDirty || n.shouldTouch) && re(t, c, n.shouldTouch, n.shouldDirty, !0), n.shouldValidate && ce(t);
567
+ }, q = (t, i, n) => {
568
+ 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);
571
+ }
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({
575
+ name: t,
576
+ values: { ...a }
577
+ }), (F.isDirty || F.dirtyFields) && n.shouldDirty && v.state.next({
578
+ name: t,
579
+ dirtyFields: ve(u, a),
580
+ 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
+ name: y.mount ? t : void 0,
583
+ values: { ...a }
2136
584
  });
2137
- }, J = async (n) => {
2138
- E.mount = !0;
2139
- const s = n.target;
2140
- let d = s.name, A = !0;
2141
- const w = j(l, d), x = () => s.type ? mt(w._f) : Wr(n), N = (Q) => {
2142
- A = Number.isNaN(Q) || Q === j(i, d, Q);
585
+ }, ue = async (t) => {
586
+ y.mount = !0;
587
+ 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);
2143
591
  };
2144
- if (w) {
2145
- let Q, fe;
2146
- const be = x(), Te = n.type === zt.BLUR || n.type === zt.FOCUS_OUT, je = !an(w._f) && !t.resolver && !j(r.errors, d) && !w._f.deps || sn(Te, j(r.touchedFields, d), r.isSubmitted, G, ne), Me = Xt(d, k, Te);
2147
- ce(i, d, be), Te ? (w._f.onBlur && w._f.onBlur(n), X && X(0)) : w._f.onChange && w._f.onChange(n);
2148
- const qe = _(d, be, Te, !1), rt = !ke(qe) || Me;
2149
- if (!Te && V.values.next({
2150
- name: d,
2151
- type: n.type,
2152
- values: { ...i }
2153
- }), je)
2154
- return L.isValid && re(), rt && V.state.next({ name: d, ...Me ? {} : qe });
2155
- if (!Te && Me && V.state.next({ ...r }), t.resolver) {
2156
- const { errors: Ne } = await b([d]);
2157
- if (N(be), A) {
2158
- const me = er(r.errors, l, d), de = er(Ne, l, me.name || d);
2159
- Q = de.error, d = de.name, fe = ke(Ne);
592
+ 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,
599
+ type: t.type,
600
+ values: { ...a }
601
+ }), _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);
2160
608
  }
2161
609
  } else
2162
- ue([d], !0), Q = (await Qt(w, i, te, t.shouldUseNativeValidation))[d], ue([d]), N(be), A && (Q ? fe = !1 : L.isValid && (fe = await F(l, !0)));
2163
- A && (w._f.deps && g(w._f.deps), m(d, fe, Q, qe));
2164
- }
2165
- }, le = (n, s) => {
2166
- if (j(r.errors, s) && n.focus)
2167
- return n.focus(), 1;
2168
- }, g = async (n, s = {}) => {
2169
- let d, A;
2170
- const w = Ze(n);
2171
- if (t.resolver) {
2172
- const x = await P(ge(n) ? n : w);
2173
- d = ke(x), A = n ? !w.some((N) => j(x, N)) : d;
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));
612
+ }
613
+ }, oe = (t, i) => {
614
+ if (d(r.errors, i) && t.focus)
615
+ return t.focus(), 1;
616
+ }, ce = async (t, i = {}) => {
617
+ let n, f;
618
+ const c = _e(t);
619
+ 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;
2174
622
  } else
2175
- n ? (A = (await Promise.all(w.map(async (x) => {
2176
- const N = j(l, x);
2177
- return await F(N && N._f ? { [x]: N } : N);
2178
- }))).every(Boolean), !(!A && !r.isValid) && re()) : A = d = await F(l);
2179
- return V.state.next({
2180
- ...!Ce(n) || L.isValid && d !== r.isValid ? {} : { name: n },
2181
- ...t.resolver || !n ? { isValid: d } : {},
623
+ 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);
627
+ return v.state.next({
628
+ ...!K(t) || F.isValid && n !== r.isValid ? {} : { name: t },
629
+ ...s.resolver || !t ? { isValid: n } : {},
2182
630
  errors: r.errors
2183
- }), s.shouldFocus && !A && $e(l, le, n ? w : k.mount), A;
2184
- }, S = (n) => {
2185
- const s = {
2186
- ...E.mount ? i : f
631
+ }), i.shouldFocus && !f && de(l, oe, t ? c : g.mount), f;
632
+ }, Oe = (t) => {
633
+ const i = {
634
+ ...y.mount ? a : u
2187
635
  };
2188
- return ge(n) ? s : Ce(n) ? j(s, n) : n.map((d) => j(s, d));
2189
- }, v = (n, s) => ({
2190
- invalid: !!j((s || r).errors, n),
2191
- isDirty: !!j((s || r).dirtyFields, n),
2192
- error: j((s || r).errors, n),
2193
- isValidating: !!j(r.validatingFields, n),
2194
- isTouched: !!j((s || r).touchedFields, n)
2195
- }), u = (n) => {
2196
- n && Ze(n).forEach((s) => ye(r.errors, s)), V.state.next({
2197
- errors: n ? r.errors : {}
636
+ return A(t) ? i : K(t) ? d(i, t) : t.map((n) => d(i, n));
637
+ }, Ne = (t, i) => ({
638
+ invalid: !!d((i || r).errors, t),
639
+ isDirty: !!d((i || r).dirtyFields, t),
640
+ error: d((i || r).errors, t),
641
+ isValidating: !!d(r.validatingFields, t),
642
+ isTouched: !!d((i || r).touchedFields, t)
643
+ }), yt = (t) => {
644
+ t && _e(t).forEach((i) => k(r.errors, i)), v.state.next({
645
+ errors: t ? r.errors : {}
2198
646
  });
2199
- }, a = (n, s, d) => {
2200
- const A = (j(l, n, { _f: {} })._f || {}).ref, w = j(r.errors, n) || {}, { ref: x, message: N, type: Q, ...fe } = w;
2201
- ce(r.errors, n, {
2202
- ...fe,
2203
- ...s,
2204
- ref: A
2205
- }), V.state.next({
2206
- name: n,
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;
649
+ V(r.errors, t, {
650
+ ...w,
651
+ ...i,
652
+ ref: f
653
+ }), v.state.next({
654
+ name: t,
2207
655
  errors: r.errors,
2208
656
  isValid: !1
2209
- }), d && d.shouldFocus && A && A.focus && A.focus();
2210
- }, c = (n, s) => Fe(n) ? V.values.subscribe({
2211
- next: (d) => n(B(void 0, s), d)
2212
- }) : B(n, s, !0), y = (n, s = {}) => {
2213
- for (const d of n ? Ze(n) : k.mount)
2214
- k.mount.delete(d), k.array.delete(d), s.keepValue || (ye(l, d), ye(i, d)), !s.keepError && ye(r.errors, d), !s.keepDirty && ye(r.dirtyFields, d), !s.keepTouched && ye(r.touchedFields, d), !s.keepIsValidating && ye(r.validatingFields, d), !t.shouldUnregister && !s.keepDefaultValue && ye(f, d);
2215
- V.values.next({
2216
- values: { ...i }
2217
- }), V.state.next({
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)
660
+ }) : 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);
663
+ v.values.next({
664
+ values: { ...a }
665
+ }), v.state.next({
2218
666
  ...r,
2219
- ...s.keepDirty ? { isDirty: T() } : {}
2220
- }), !s.keepIsValid && re();
2221
- }, p = ({ disabled: n, name: s, field: d, fields: A, value: w }) => {
2222
- if (Ve(n) && E.mount || n) {
2223
- const x = n ? void 0 : ge(w) ? mt(d ? d._f : j(A, s)._f) : w;
2224
- ce(i, s, x), _(s, x, !1, !1, !0);
2225
- }
2226
- }, D = (n, s = {}) => {
2227
- let d = j(l, n);
2228
- const A = Ve(s.disabled);
2229
- return ce(l, n, {
2230
- ...d || {},
667
+ ...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);
673
+ }
674
+ }, pe = (t, i = {}) => {
675
+ let n = d(l, t);
676
+ const f = Y(i.disabled);
677
+ return V(l, t, {
678
+ ...n || {},
2231
679
  _f: {
2232
- ...d && d._f ? d._f : { ref: { name: n } },
2233
- name: n,
680
+ ...n && n._f ? n._f : { ref: { name: t } },
681
+ name: t,
2234
682
  mount: !0,
2235
- ...s
683
+ ...i
2236
684
  }
2237
- }), k.mount.add(n), d ? p({
2238
- field: d,
2239
- disabled: s.disabled,
2240
- name: n,
2241
- value: s.value
2242
- }) : o(n, !0, s.value), {
2243
- ...A ? { disabled: s.disabled } : {},
2244
- ...t.progressive ? {
2245
- required: !!s.required,
2246
- min: Be(s.min),
2247
- max: Be(s.max),
2248
- minLength: Be(s.minLength),
2249
- maxLength: Be(s.maxLength),
2250
- pattern: Be(s.pattern)
685
+ }), g.mount.add(t), n ? Ie({
686
+ field: n,
687
+ disabled: i.disabled,
688
+ name: t,
689
+ value: i.value
690
+ }) : p(t, !0, i.value), {
691
+ ...f ? { disabled: i.disabled } : {},
692
+ ...s.progressive ? {
693
+ 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)
2251
699
  } : {},
2252
- name: n,
2253
- onChange: J,
2254
- onBlur: J,
2255
- ref: (w) => {
2256
- if (w) {
2257
- D(n, s), d = j(l, n);
2258
- const x = ge(w.value) && w.querySelectorAll && w.querySelectorAll("input,select,textarea")[0] || w, N = rn(x), Q = d._f.refs || [];
2259
- if (N ? Q.find((fe) => fe === x) : x === d._f.ref)
700
+ name: t,
701
+ onChange: ue,
702
+ onBlur: ue,
703
+ ref: (c) => {
704
+ 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)
2260
708
  return;
2261
- ce(l, n, {
709
+ V(l, t, {
2262
710
  _f: {
2263
- ...d._f,
2264
- ...N ? {
711
+ ...n._f,
712
+ ...h ? {
2265
713
  refs: [
2266
- ...Q.filter(pt),
2267
- x,
2268
- ...Array.isArray(j(f, n)) ? [{}] : []
714
+ ...x.filter(Ce),
715
+ o,
716
+ ...Array.isArray(d(u, t)) ? [{}] : []
2269
717
  ],
2270
- ref: { type: x.type, name: n }
2271
- } : { ref: x }
718
+ ref: { type: o.type, name: t }
719
+ } : { ref: o }
2272
720
  }
2273
- }), o(n, !1, void 0, x);
721
+ }), p(t, !1, void 0, o);
2274
722
  } else
2275
- d = j(l, n, {}), d._f && (d._f.mount = !1), (t.shouldUnregister || s.shouldUnregister) && !(zr(k.array, n) && E.action) && k.unMount.add(n);
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);
2276
724
  }
2277
725
  };
2278
- }, O = () => t.shouldFocusError && $e(l, le, k.mount), C = (n) => {
2279
- Ve(n) && (V.state.next({ disabled: n }), $e(l, (s, d) => {
2280
- const A = j(l, d);
2281
- A && (s.disabled = A._f.disabled || n, Array.isArray(A._f.refs) && A._f.refs.forEach((w) => {
2282
- w.disabled = A._f.disabled || n;
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);
729
+ f && (i.disabled = f._f.disabled || t, Array.isArray(f._f.refs) && f._f.refs.forEach((c) => {
730
+ c.disabled = f._f.disabled || t;
2283
731
  }));
2284
732
  }, 0, !1));
2285
- }, U = (n, s) => async (d) => {
2286
- let A;
2287
- d && (d.preventDefault && d.preventDefault(), d.persist && d.persist());
2288
- let w = xe(i);
2289
- if (V.state.next({
733
+ }, qe = (t, i) => async (n) => {
734
+ let f;
735
+ n && (n.preventDefault && n.preventDefault(), n.persist && n.persist());
736
+ let c = U(a);
737
+ if (v.state.next({
2290
738
  isSubmitting: !0
2291
- }), t.resolver) {
2292
- const { errors: x, values: N } = await b();
2293
- r.errors = x, w = N;
739
+ }), s.resolver) {
740
+ const { errors: o, values: h } = await ee();
741
+ r.errors = o, c = h;
2294
742
  } else
2295
- await F(l);
2296
- if (ye(r.errors, "root"), ke(r.errors)) {
2297
- V.state.next({
743
+ await O(l);
744
+ if (k(r.errors, "root"), T(r.errors)) {
745
+ v.state.next({
2298
746
  errors: {}
2299
747
  });
2300
748
  try {
2301
- await n(w, d);
2302
- } catch (x) {
2303
- A = x;
749
+ await t(c, n);
750
+ } catch (o) {
751
+ f = o;
2304
752
  }
2305
753
  } else
2306
- s && await s({ ...r.errors }, d), O(), setTimeout(O);
2307
- if (V.state.next({
754
+ i && await i({ ...r.errors }, n), Pe(), setTimeout(Pe);
755
+ if (v.state.next({
2308
756
  isSubmitted: !0,
2309
757
  isSubmitting: !1,
2310
- isSubmitSuccessful: ke(r.errors) && !A,
758
+ isSubmitSuccessful: T(r.errors) && !f,
2311
759
  submitCount: r.submitCount + 1,
2312
760
  errors: r.errors
2313
- }), A)
2314
- throw A;
2315
- }, h = (n, s = {}) => {
2316
- j(l, n) && (ge(s.defaultValue) ? z(n, xe(j(f, n))) : (z(n, s.defaultValue), ce(f, n, xe(s.defaultValue))), s.keepTouched || ye(r.touchedFields, n), s.keepDirty || (ye(r.dirtyFields, n), r.isDirty = s.defaultValue ? T(n, xe(j(f, n))) : T()), s.keepError || (ye(r.errors, n), L.isValid && re()), V.state.next({ ...r }));
2317
- }, I = (n, s = {}) => {
2318
- const d = n ? xe(n) : f, A = xe(d), w = ke(n), x = w ? f : A;
2319
- if (s.keepDefaultValues || (f = d), !s.keepValues) {
2320
- if (s.keepDirtyValues)
2321
- for (const N of k.mount)
2322
- j(r.dirtyFields, N) ? ce(x, N, j(i, N)) : z(N, j(x, N));
761
+ }), f)
762
+ throw f;
763
+ }, 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) {
768
+ if (i.keepDirtyValues)
769
+ for (const h of g.mount)
770
+ d(r.dirtyFields, h) ? V(o, h, d(a, h)) : N(h, d(o, h));
2323
771
  else {
2324
- if (_t && ge(n))
2325
- for (const N of k.mount) {
2326
- const Q = j(l, N);
2327
- if (Q && Q._f) {
2328
- const fe = Array.isArray(Q._f.refs) ? Q._f.refs[0] : Q._f.ref;
2329
- if (Je(fe)) {
2330
- const be = fe.closest("form");
2331
- if (be) {
2332
- be.reset();
772
+ if (Te && A(t))
773
+ for (const h of g.mount) {
774
+ const x = d(l, h);
775
+ 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();
2333
781
  break;
2334
782
  }
2335
783
  }
@@ -2337,124 +785,124 @@ function ln(e = {}) {
2337
785
  }
2338
786
  l = {};
2339
787
  }
2340
- i = e.shouldUnregister ? s.keepDefaultValues ? xe(f) : {} : xe(x), V.array.next({
2341
- values: { ...x }
2342
- }), V.values.next({
2343
- values: { ...x }
788
+ a = e.shouldUnregister ? i.keepDefaultValues ? U(u) : {} : U(o), v.array.next({
789
+ values: { ...o }
790
+ }), v.values.next({
791
+ values: { ...o }
2344
792
  });
2345
793
  }
2346
- k = {
2347
- mount: s.keepDirtyValues ? k.mount : /* @__PURE__ */ new Set(),
794
+ g = {
795
+ mount: i.keepDirtyValues ? g.mount : /* @__PURE__ */ new Set(),
2348
796
  unMount: /* @__PURE__ */ new Set(),
2349
797
  array: /* @__PURE__ */ new Set(),
2350
798
  watch: /* @__PURE__ */ new Set(),
2351
799
  watchAll: !1,
2352
800
  focus: ""
2353
- }, E.mount = !L.isValid || !!s.keepIsValid || !!s.keepDirtyValues, E.watch = !!e.shouldUnregister, V.state.next({
2354
- submitCount: s.keepSubmitCount ? r.submitCount : 0,
2355
- isDirty: w ? !1 : s.keepDirty ? r.isDirty : !!(s.keepDefaultValues && !De(n, f)),
2356
- isSubmitted: s.keepIsSubmitted ? r.isSubmitted : !1,
2357
- dirtyFields: w ? {} : s.keepDirtyValues ? s.keepDefaultValues && i ? Xe(f, i) : r.dirtyFields : s.keepDefaultValues && n ? Xe(f, n) : s.keepDirty ? r.dirtyFields : {},
2358
- touchedFields: s.keepTouched ? r.touchedFields : {},
2359
- errors: s.keepErrors ? r.errors : {},
2360
- isSubmitSuccessful: s.keepIsSubmitSuccessful ? r.isSubmitSuccessful : !1,
801
+ }, y.mount = !F.isValid || !!i.keepIsValid || !!i.keepDirtyValues, y.watch = !!e.shouldUnregister, v.state.next({
802
+ submitCount: i.keepSubmitCount ? r.submitCount : 0,
803
+ isDirty: c ? !1 : i.keepDirty ? r.isDirty : !!(i.keepDefaultValues && !te(t, u)),
804
+ 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
+ touchedFields: i.keepTouched ? r.touchedFields : {},
807
+ errors: i.keepErrors ? r.errors : {},
808
+ isSubmitSuccessful: i.keepIsSubmitSuccessful ? r.isSubmitSuccessful : !1,
2361
809
  isSubmitting: !1
2362
810
  });
2363
- }, q = (n, s) => I(Fe(n) ? n(i) : n, s);
811
+ }, He = (t, i) => We(Z(t) ? t(a) : t, i);
2364
812
  return {
2365
813
  control: {
2366
- register: D,
2367
- unregister: y,
2368
- getFieldState: v,
2369
- handleSubmit: U,
2370
- setError: a,
2371
- _executeSchema: b,
2372
- _getWatch: B,
2373
- _getDirty: T,
2374
- _updateValid: re,
2375
- _removeUnmounted: Y,
2376
- _updateFieldArray: Z,
2377
- _updateDisabledField: p,
2378
- _getFieldArray: W,
2379
- _reset: I,
2380
- _resetDefaultValues: () => Fe(t.defaultValues) && t.defaultValues().then((n) => {
2381
- q(n, t.resetOptions), V.state.next({
814
+ register: pe,
815
+ unregister: we,
816
+ getFieldState: Ne,
817
+ handleSubmit: qe,
818
+ setError: Ue,
819
+ _executeSchema: ee,
820
+ _getWatch: b,
821
+ _getDirty: _,
822
+ _updateValid: $,
823
+ _removeUnmounted: ge,
824
+ _updateFieldArray: m,
825
+ _updateDisabledField: Ie,
826
+ _getFieldArray: D,
827
+ _reset: We,
828
+ _resetDefaultValues: () => Z(s.defaultValues) && s.defaultValues().then((t) => {
829
+ He(t, s.resetOptions), v.state.next({
2382
830
  isLoading: !1
2383
831
  });
2384
832
  }),
2385
- _updateFormState: (n) => {
833
+ _updateFormState: (t) => {
2386
834
  r = {
2387
835
  ...r,
2388
- ...n
836
+ ...t
2389
837
  };
2390
838
  },
2391
- _disableForm: C,
2392
- _subjects: V,
2393
- _proxyFormState: L,
2394
- _setErrors: ee,
839
+ _disableForm: gt,
840
+ _subjects: v,
841
+ _proxyFormState: F,
842
+ _setErrors: J,
2395
843
  get _fields() {
2396
844
  return l;
2397
845
  },
2398
846
  get _formValues() {
2399
- return i;
847
+ return a;
2400
848
  },
2401
849
  get _state() {
2402
- return E;
850
+ return y;
2403
851
  },
2404
- set _state(n) {
2405
- E = n;
852
+ set _state(t) {
853
+ y = t;
2406
854
  },
2407
855
  get _defaultValues() {
2408
- return f;
856
+ return u;
2409
857
  },
2410
858
  get _names() {
2411
- return k;
859
+ return g;
2412
860
  },
2413
- set _names(n) {
2414
- k = n;
861
+ set _names(t) {
862
+ g = t;
2415
863
  },
2416
864
  get _formState() {
2417
865
  return r;
2418
866
  },
2419
- set _formState(n) {
2420
- r = n;
867
+ set _formState(t) {
868
+ r = t;
2421
869
  },
2422
870
  get _options() {
2423
- return t;
871
+ return s;
2424
872
  },
2425
- set _options(n) {
2426
- t = {
2427
- ...t,
2428
- ...n
873
+ set _options(t) {
874
+ s = {
875
+ ...s,
876
+ ...t
2429
877
  };
2430
878
  }
2431
879
  },
2432
- trigger: g,
2433
- register: D,
2434
- handleSubmit: U,
2435
- watch: c,
2436
- setValue: z,
2437
- getValues: S,
2438
- reset: q,
2439
- resetField: h,
2440
- clearErrors: u,
2441
- unregister: y,
2442
- setError: a,
2443
- setFocus: (n, s = {}) => {
2444
- const d = j(l, n), A = d && d._f;
2445
- if (A) {
2446
- const w = A.refs ? A.refs[0] : A.ref;
2447
- w.focus && (w.focus(), s.shouldSelect && w.select());
880
+ trigger: ce,
881
+ register: pe,
882
+ handleSubmit: qe,
883
+ watch: ht,
884
+ setValue: N,
885
+ getValues: Oe,
886
+ reset: He,
887
+ resetField: vt,
888
+ clearErrors: yt,
889
+ unregister: we,
890
+ setError: Ue,
891
+ setFocus: (t, i = {}) => {
892
+ const n = d(l, t), f = n && n._f;
893
+ if (f) {
894
+ const c = f.refs ? f.refs[0] : f.ref;
895
+ c.focus && (c.focus(), i.shouldSelect && c.select());
2448
896
  }
2449
897
  },
2450
- getFieldState: v
898
+ getFieldState: Ne
2451
899
  };
2452
900
  }
2453
- function cn(e = {}) {
2454
- const t = Pe.useRef(), r = Pe.useRef(), [l, f] = Pe.useState({
901
+ function Yt(e = {}) {
902
+ const s = I.useRef(), r = I.useRef(), [l, u] = I.useState({
2455
903
  isDirty: !1,
2456
904
  isValidating: !1,
2457
- isLoading: Fe(e.defaultValues),
905
+ isLoading: Z(e.defaultValues),
2458
906
  isSubmitted: !1,
2459
907
  isSubmitting: !1,
2460
908
  isSubmitSuccessful: !1,
@@ -2465,158 +913,163 @@ function cn(e = {}) {
2465
913
  validatingFields: {},
2466
914
  errors: e.errors || {},
2467
915
  disabled: e.disabled || !1,
2468
- defaultValues: Fe(e.defaultValues) ? void 0 : e.defaultValues
916
+ defaultValues: Z(e.defaultValues) ? void 0 : e.defaultValues
2469
917
  });
2470
- t.current || (t.current = {
2471
- ...ln(e),
918
+ s.current || (s.current = {
919
+ ...Xt(e),
2472
920
  formState: l
2473
921
  });
2474
- const i = t.current.control;
2475
- return i._options = e, Kr({
2476
- subject: i._subjects.state,
2477
- next: (E) => {
2478
- Zr(E, i._proxyFormState, i._updateFormState) && f({ ...i._formState });
2479
- }
2480
- }), Pe.useEffect(() => i._disableForm(e.disabled), [i, e.disabled]), Pe.useEffect(() => {
2481
- if (i._proxyFormState.isDirty) {
2482
- const E = i._getDirty();
2483
- E !== l.isDirty && i._subjects.state.next({
2484
- isDirty: E
922
+ const a = s.current.control;
923
+ return a._options = e, It({
924
+ subject: a._subjects.state,
925
+ next: (y) => {
926
+ Ut(y, a._proxyFormState, a._updateFormState) && u({ ...a._formState });
927
+ }
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({
932
+ isDirty: y
2485
933
  });
2486
934
  }
2487
- }, [i, l.isDirty]), Pe.useEffect(() => {
2488
- e.values && !De(e.values, r.current) ? (i._reset(e.values, i._options.resetOptions), r.current = e.values, f((E) => ({ ...E }))) : i._resetDefaultValues();
2489
- }, [e.values, i]), Pe.useEffect(() => {
2490
- e.errors && i._setErrors(e.errors);
2491
- }, [e.errors, i]), Pe.useEffect(() => {
2492
- i._state.mount || (i._updateValid(), i._state.mount = !0), i._state.watch && (i._state.watch = !1, i._subjects.state.next({ ...i._formState })), i._removeUnmounted();
2493
- }), Pe.useEffect(() => {
2494
- e.shouldUnregister && i._subjects.values.next({
2495
- values: i._getWatch()
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()
2496
944
  });
2497
- }, [e.shouldUnregister, i]), t.current.formState = Xr(l, i), t.current;
945
+ }, [e.shouldUnregister, a]), s.current.formState = Nt(l, a), s.current;
2498
946
  }
2499
- const tr = `Я принимаю условия Политики обработки
947
+ const it = `Я принимаю условия Политики обработки
2500
948
  и защиты персональных данных, даю согласия на обработку персональных
2501
- данных`, _n = ({
949
+ данных`, dr = ({
2502
950
  isFormOpen: e,
2503
- setIsFormOpen: t,
951
+ setIsFormOpen: s,
2504
952
  title: r,
2505
953
  subTitle: l,
2506
- personalCheckbox: f = { text: tr, isRequired: !0 },
2507
- advCheckBox: i = { text: tr, isRequired: !0 }
954
+ submitHandler: u,
955
+ personalCheckBox: a = { text: it, isRequired: !0 },
956
+ advCheckBox: y = { text: it, isRequired: !0 }
2508
957
  }) => {
2509
958
  const {
2510
- register: E,
2511
- handleSubmit: k,
2512
- trigger: X,
2513
- reset: H,
2514
- watch: L,
2515
- formState: { errors: V }
2516
- } = cn(), { onChange: ne, onBlur: G, ...te } = E("phone", {
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", {
2517
966
  required: !0,
2518
- pattern: { value: xr, message: "" },
2519
- onBlur: () => X("phone")
2520
- }), K = L("personalCheckbox"), re = L("advCheckBox"), ue = (Z) => {
2521
- console.log(Z), H();
967
+ pattern: { value: wt, message: "" },
968
+ onBlur: () => M("phone")
969
+ }), $ = v("personalCheckBox"), j = v("advCheckBox"), m = (P) => {
970
+ u(P), F();
2522
971
  };
2523
- return /* @__PURE__ */ we(
2524
- Sr,
972
+ return /* @__PURE__ */ W(
973
+ Vt,
2525
974
  {
2526
975
  isOpen: e,
2527
- emitIsOpen: () => t(!1),
2528
- additionalClass: Re.modal,
976
+ emitIsOpen: () => s(!1),
977
+ additionalClass: X.modal,
2529
978
  opacity: 0.7,
2530
979
  isTransparentBack: !0,
2531
- additionalClassModalBody: Re.modalBody,
2532
- children: /* @__PURE__ */ at("div", { className: Re.root, children: [
2533
- /* @__PURE__ */ we("div", { className: Re.title, dangerouslySetInnerHTML: { __html: r ?? "Оставить обращение" } }),
2534
- /* @__PURE__ */ we(
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(
2535
984
  "div",
2536
985
  {
2537
- className: Re.description,
986
+ className: X.description,
2538
987
  dangerouslySetInnerHTML: { __html: l ?? "Оставьте номер телефона для получения консультации" }
2539
988
  }
2540
989
  ),
2541
- /* @__PURE__ */ at("form", { onSubmit: k(ue), children: [
2542
- /* @__PURE__ */ at(kr, { className: Re.inputWrapper, children: [
2543
- /* @__PURE__ */ we(
2544
- At,
990
+ /* @__PURE__ */ Se("form", { onSubmit: R(m), children: [
991
+ /* @__PURE__ */ Se(Ft, { className: X.inputWrapper, children: [
992
+ /* @__PURE__ */ W(
993
+ je,
2545
994
  {
2546
995
  width: "full",
2547
996
  size_s: "small",
2548
997
  variant: "light",
2549
998
  placeholder: "Введите имя",
2550
- ...E("name", { required: !0, pattern: wr }),
2551
- error: !!V.name
999
+ "data-testid": "modal_name",
1000
+ ...g("name", { required: !0, pattern: pt }),
1001
+ error: !!G.name
2552
1002
  }
2553
1003
  ),
2554
- /* @__PURE__ */ we(
2555
- Lr,
1004
+ /* @__PURE__ */ W(
1005
+ xt,
2556
1006
  {
2557
1007
  inputMode: "numeric",
2558
1008
  name: "phone",
2559
1009
  mask: "+7 (999) 999-99-99",
2560
- onChange: ne,
1010
+ onChange: z,
2561
1011
  placeholder: "+7 (- - -) - - - - - - -",
2562
- onBlur: G,
2563
- children: /* @__PURE__ */ we(
2564
- At,
1012
+ onBlur: C,
1013
+ children: /* @__PURE__ */ W(
1014
+ je,
2565
1015
  {
2566
1016
  width: "full",
2567
1017
  "data-testid": "phone_modal",
2568
1018
  type: "tel",
2569
1019
  size_s: "small",
2570
1020
  variant: "light",
2571
- ...te,
2572
- ...E("phone"),
2573
- error: !!V.phone
1021
+ ...le,
1022
+ ...g("phone"),
1023
+ error: !!G.phone
2574
1024
  }
2575
1025
  )
2576
1026
  }
2577
1027
  ),
2578
- i && /* @__PURE__ */ we(
2579
- Rt,
1028
+ y && /* @__PURE__ */ W(
1029
+ Ge,
2580
1030
  {
2581
- isChecked: re,
2582
- error: !!V.advCheckBox,
2583
- text: i.text,
2584
- ...E("advCheckBox", { required: i == null ? void 0 : i.isRequired })
1031
+ "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 })
2585
1036
  }
2586
1037
  ),
2587
- /* @__PURE__ */ we(
2588
- Rt,
1038
+ /* @__PURE__ */ W(
1039
+ Ge,
2589
1040
  {
2590
- isChecked: K,
2591
- error: !!V.personalCheckbox,
2592
- text: f.text,
2593
- ...E("personalCheckbox", { required: f.isRequired })
1041
+ "data-testid": "modal_personalCheckBox",
1042
+ isChecked: $,
1043
+ error: !!G.personalCheckBox,
1044
+ text: a.text,
1045
+ ...g("personalCheckBox", { required: a.isRequired })
2594
1046
  }
2595
1047
  ),
2596
- /* @__PURE__ */ we(
2597
- Tt,
1048
+ /* @__PURE__ */ W(
1049
+ Ke,
2598
1050
  {
1051
+ "data-testid": "modal_submit",
2599
1052
  variant: "blue",
2600
1053
  width: "full",
2601
1054
  type: "submit",
2602
1055
  size: "large",
2603
1056
  as: "button",
2604
- additionalClass: Re.modalBtn,
1057
+ additionalClass: X.modalBtn,
2605
1058
  children: "Отправить"
2606
1059
  }
2607
1060
  )
2608
1061
  ] }),
2609
- /* @__PURE__ */ we(
2610
- Tt,
1062
+ /* @__PURE__ */ W(
1063
+ Ke,
2611
1064
  {
2612
- additionalClass: Re.btn,
2613
- onClick: () => t(!1),
1065
+ additionalClass: X.btn,
1066
+ onClick: () => s(!1),
2614
1067
  as: "button",
2615
1068
  variant: "gray",
2616
1069
  type: "button",
2617
1070
  size: "small",
2618
- children: /* @__PURE__ */ we(
2619
- Pr,
1071
+ children: /* @__PURE__ */ W(
1072
+ At,
2620
1073
  {
2621
1074
  name: "close",
2622
1075
  size: "16",
@@ -2631,5 +1084,5 @@ const tr = `Я принимаю условия Политики обработк
2631
1084
  );
2632
1085
  };
2633
1086
  export {
2634
- _n as ModalForm
1087
+ dr as ModalForm
2635
1088
  };