stone-kit 0.0.186 → 0.0.188
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.
- package/dist/Modal-G1ISsPJt.js +19622 -0
- package/dist/components/Button/ui/Button.js +1 -1
- package/dist/components/CheckBox/CheckBox.d.ts +9 -0
- package/dist/components/CheckBox/CheckBox.js +38 -0
- package/dist/components/CheckBox/CheckBox.types.d.ts +17 -0
- package/dist/components/CheckBox/CheckBox.types.js +6 -0
- package/dist/components/DestinationTab/ui/DestinationTab.js +1 -1
- package/dist/components/Flex/ui/Flex.js +1 -1
- package/dist/components/FormModal/ui/ModalForm.d.ts +16 -0
- package/dist/components/FormModal/ui/ModalForm.js +2635 -0
- package/dist/components/FormModal/utils/reg.d.ts +4 -0
- package/dist/components/FormModal/utils/reg.js +6 -0
- package/dist/components/GroupedInput/ui/GroupedInputs.js +1 -1
- package/dist/components/Input/ui/Input.js +56 -50
- package/dist/components/Logo/ui/Logo.js +1 -1
- package/dist/components/MetroLabel/ui/MetroLabel.js +1 -1
- package/dist/components/MetroTag/ui/MetroTag.js +1 -1
- package/dist/components/Modal/index.js +2 -2
- package/dist/components/Modal/ui/Modal.js +4 -19619
- package/dist/components/NewIcon/ui/NewIcon.js +8 -7
- package/dist/components/RoundButton/ui/RoundButton.js +39 -39
- package/dist/components/Select/ui/Select.js +1 -1
- package/dist/components/SliderNavigation/ui/SliderNavigation.js +1 -1
- package/dist/components/SortSelect/hooks/useSortSelect.js +2 -2
- package/dist/components/SortSelect/ui/SortSelect.js +7 -7
- package/dist/components/Switcher/ui/Switcher.js +1 -1
- package/dist/components/TabSelect/ui/TabSelect.js +1 -1
- package/dist/components/TabSwitcher/ui/TabSwitcher.js +1 -1
- package/dist/components/Tag/ui/Tag.js +1 -1
- package/dist/components/Text/ui/Text.js +1 -1
- package/dist/components/mobileButton/ui/MobileButton.js +1 -1
- package/dist/{index-DIxK0V-G.js → index-rKuIKazb.js} +9 -8
- package/dist/main.js +10 -10
- package/dist/style.css +1 -1
- package/dist/{useSortSelect-Dy4WKDDY.js → useSortSelect-BXr8BYtw.js} +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,2635 @@
|
|
|
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
|
|
1571
|
+
};
|
|
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;
|
|
1580
|
+
const r = Array.isArray(e);
|
|
1581
|
+
if (e instanceof Date)
|
|
1582
|
+
t = new Date(e);
|
|
1583
|
+
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;
|
|
1588
|
+
else
|
|
1589
|
+
for (const l in e)
|
|
1590
|
+
e.hasOwnProperty(l) && (t[l] = xe(e[l]));
|
|
1591
|
+
else
|
|
1592
|
+
return e;
|
|
1593
|
+
return t;
|
|
1594
|
+
}
|
|
1595
|
+
var tt = (e) => Array.isArray(e) ? e.filter(Boolean) : [], ge = (e) => e === void 0, j = (e, t, r) => {
|
|
1596
|
+
if (!t || !pe(e))
|
|
1597
|
+
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) => {
|
|
1601
|
+
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__")
|
|
1611
|
+
return;
|
|
1612
|
+
e[k] = X, e = e[k];
|
|
1613
|
+
}
|
|
1614
|
+
return e;
|
|
1615
|
+
};
|
|
1616
|
+
const zt = {
|
|
1617
|
+
BLUR: "blur",
|
|
1618
|
+
FOCUS_OUT: "focusout",
|
|
1619
|
+
CHANGE: "change"
|
|
1620
|
+
}, Oe = {
|
|
1621
|
+
onBlur: "onBlur",
|
|
1622
|
+
onChange: "onChange",
|
|
1623
|
+
onSubmit: "onSubmit",
|
|
1624
|
+
onTouched: "onTouched",
|
|
1625
|
+
all: "all"
|
|
1626
|
+
}, Ae = {
|
|
1627
|
+
max: "max",
|
|
1628
|
+
min: "min",
|
|
1629
|
+
maxLength: "maxLength",
|
|
1630
|
+
minLength: "minLength",
|
|
1631
|
+
pattern: "pattern",
|
|
1632
|
+
required: "required",
|
|
1633
|
+
validate: "validate"
|
|
1634
|
+
};
|
|
1635
|
+
Pe.createContext(null);
|
|
1636
|
+
var Xr = (e, t, r, l = !0) => {
|
|
1637
|
+
const f = {
|
|
1638
|
+
defaultValues: t._defaultValues
|
|
1639
|
+
};
|
|
1640
|
+
for (const i in e)
|
|
1641
|
+
Object.defineProperty(f, i, {
|
|
1642
|
+
get: () => {
|
|
1643
|
+
const E = i;
|
|
1644
|
+
return t._proxyFormState[E] !== Oe.all && (t._proxyFormState[E] = !l || Oe.all), e[E];
|
|
1645
|
+
}
|
|
1646
|
+
});
|
|
1647
|
+
return f;
|
|
1648
|
+
}, ke = (e) => pe(e) && !Object.keys(e).length, Zr = (e, t, r, l) => {
|
|
1649
|
+
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
|
|
1658
|
+
});
|
|
1659
|
+
return () => {
|
|
1660
|
+
r && r.unsubscribe();
|
|
1661
|
+
};
|
|
1662
|
+
}, [e.disabled]);
|
|
1663
|
+
}
|
|
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 ? {
|
|
1665
|
+
...r[e],
|
|
1666
|
+
types: {
|
|
1667
|
+
...r[e] && r[e].types ? r[e].types : {},
|
|
1668
|
+
[l]: f || !0
|
|
1669
|
+
}
|
|
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)
|
|
1684
|
+
break;
|
|
1685
|
+
if (E.ref && t(E.ref, E.name) && !l)
|
|
1686
|
+
break;
|
|
1687
|
+
$e(k, t);
|
|
1688
|
+
} else
|
|
1689
|
+
pe(k) && $e(k, t);
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
};
|
|
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)
|
|
1698
|
+
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 = {
|
|
1703
|
+
value: !1,
|
|
1704
|
+
isValid: !1
|
|
1705
|
+
}, Kt = { value: !0, isValid: !0 };
|
|
1706
|
+
var cr = (e) => {
|
|
1707
|
+
if (Array.isArray(e)) {
|
|
1708
|
+
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 };
|
|
1711
|
+
}
|
|
1712
|
+
return e[0].checked && !e[0].disabled ? (
|
|
1713
|
+
// @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;
|
|
1716
|
+
}
|
|
1717
|
+
return Zt;
|
|
1718
|
+
};
|
|
1719
|
+
const Jt = {
|
|
1720
|
+
isValid: !1,
|
|
1721
|
+
value: null
|
|
1722
|
+
};
|
|
1723
|
+
var fr = (e) => Array.isArray(e) ? e.reduce((t, r) => r && r.checked && !r.disabled ? {
|
|
1724
|
+
isValid: !0,
|
|
1725
|
+
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)
|
|
1729
|
+
return {
|
|
1730
|
+
type: r,
|
|
1731
|
+
message: Ke(e) ? e : "",
|
|
1732
|
+
ref: t
|
|
1733
|
+
};
|
|
1734
|
+
}
|
|
1735
|
+
var Le = (e) => pe(e) && !Ge(e) ? e : {
|
|
1736
|
+
value: e,
|
|
1737
|
+
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)
|
|
1741
|
+
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)
|
|
1751
|
+
};
|
|
1752
|
+
};
|
|
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)
|
|
1760
|
+
}, !r))
|
|
1761
|
+
return ee(B), o;
|
|
1762
|
+
}
|
|
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);
|
|
1769
|
+
} 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));
|
|
1772
|
+
}
|
|
1773
|
+
if ((T || B) && (Y(!!T, W.message, M.message, Ae.max, Ae.min), !r))
|
|
1774
|
+
return ee(o[te].message), o;
|
|
1775
|
+
}
|
|
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;
|
|
1780
|
+
}
|
|
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)
|
|
1788
|
+
}, !r))
|
|
1789
|
+
return ee(B), o;
|
|
1790
|
+
}
|
|
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)
|
|
1797
|
+
}, !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)
|
|
1803
|
+
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));
|
|
1809
|
+
}
|
|
1810
|
+
if (!ke(T) && (o[te] = {
|
|
1811
|
+
ref: ie,
|
|
1812
|
+
...T
|
|
1813
|
+
}, !r))
|
|
1814
|
+
return o;
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
return ee(!0), o;
|
|
1818
|
+
};
|
|
1819
|
+
function en(e, t) {
|
|
1820
|
+
const r = t.slice(0, -1).length;
|
|
1821
|
+
let l = 0;
|
|
1822
|
+
for (; l < r; )
|
|
1823
|
+
e = ge(e) ? l++ : e[t[l++]];
|
|
1824
|
+
return e;
|
|
1825
|
+
}
|
|
1826
|
+
function tn(e) {
|
|
1827
|
+
for (const t in e)
|
|
1828
|
+
if (e.hasOwnProperty(t) && !ge(e[t]))
|
|
1829
|
+
return !1;
|
|
1830
|
+
return !0;
|
|
1831
|
+
}
|
|
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;
|
|
1835
|
+
}
|
|
1836
|
+
var yt = () => {
|
|
1837
|
+
let e = [];
|
|
1838
|
+
return {
|
|
1839
|
+
get observers() {
|
|
1840
|
+
return e;
|
|
1841
|
+
},
|
|
1842
|
+
next: (f) => {
|
|
1843
|
+
for (const i of e)
|
|
1844
|
+
i.next && i.next(f);
|
|
1845
|
+
},
|
|
1846
|
+
subscribe: (f) => (e.push(f), {
|
|
1847
|
+
unsubscribe: () => {
|
|
1848
|
+
e = e.filter((i) => i !== f);
|
|
1849
|
+
}
|
|
1850
|
+
}),
|
|
1851
|
+
unsubscribe: () => {
|
|
1852
|
+
e = [];
|
|
1853
|
+
}
|
|
1854
|
+
};
|
|
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);
|
|
1862
|
+
if (r.length !== l.length)
|
|
1863
|
+
return !1;
|
|
1864
|
+
for (const f of r) {
|
|
1865
|
+
const i = e[f];
|
|
1866
|
+
if (!l.includes(f))
|
|
1867
|
+
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)
|
|
1871
|
+
return !1;
|
|
1872
|
+
}
|
|
1873
|
+
}
|
|
1874
|
+
return !0;
|
|
1875
|
+
}
|
|
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]))
|
|
1879
|
+
return !0;
|
|
1880
|
+
return !1;
|
|
1881
|
+
};
|
|
1882
|
+
function et(e, t = {}) {
|
|
1883
|
+
const r = Array.isArray(e);
|
|
1884
|
+
if (pe(e) || r)
|
|
1885
|
+
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;
|
|
1888
|
+
}
|
|
1889
|
+
function hr(e, t, r) {
|
|
1890
|
+
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]);
|
|
1894
|
+
return r;
|
|
1895
|
+
}
|
|
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);
|
|
1901
|
+
}
|
|
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);
|
|
1907
|
+
}
|
|
1908
|
+
return {
|
|
1909
|
+
criteriaMode: r,
|
|
1910
|
+
names: [...e],
|
|
1911
|
+
fields: f,
|
|
1912
|
+
shouldUseNativeValidation: l
|
|
1913
|
+
};
|
|
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))
|
|
1918
|
+
return {
|
|
1919
|
+
error: l,
|
|
1920
|
+
name: r
|
|
1921
|
+
};
|
|
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)
|
|
1926
|
+
return { name: r };
|
|
1927
|
+
if (k && k.type)
|
|
1928
|
+
return {
|
|
1929
|
+
name: i,
|
|
1930
|
+
error: k
|
|
1931
|
+
};
|
|
1932
|
+
f.pop();
|
|
1933
|
+
}
|
|
1934
|
+
return {
|
|
1935
|
+
name: r
|
|
1936
|
+
};
|
|
1937
|
+
}
|
|
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,
|
|
1942
|
+
shouldFocusError: !0
|
|
1943
|
+
};
|
|
1944
|
+
function ln(e = {}) {
|
|
1945
|
+
let t = {
|
|
1946
|
+
...un,
|
|
1947
|
+
...e
|
|
1948
|
+
}, r = {
|
|
1949
|
+
submitCount: 0,
|
|
1950
|
+
isDirty: !1,
|
|
1951
|
+
isLoading: Fe(t.defaultValues),
|
|
1952
|
+
isValidating: !1,
|
|
1953
|
+
isSubmitted: !1,
|
|
1954
|
+
isSubmitting: !1,
|
|
1955
|
+
isSubmitSuccessful: !1,
|
|
1956
|
+
isValid: !1,
|
|
1957
|
+
touchedFields: {},
|
|
1958
|
+
dirtyFields: {},
|
|
1959
|
+
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 = {
|
|
1963
|
+
action: !1,
|
|
1964
|
+
mount: !1,
|
|
1965
|
+
watch: !1
|
|
1966
|
+
}, k = {
|
|
1967
|
+
mount: /* @__PURE__ */ new Set(),
|
|
1968
|
+
unMount: /* @__PURE__ */ new Set(),
|
|
1969
|
+
array: /* @__PURE__ */ new Set(),
|
|
1970
|
+
watch: /* @__PURE__ */ new Set()
|
|
1971
|
+
}, X, H = 0;
|
|
1972
|
+
const L = {
|
|
1973
|
+
isDirty: !1,
|
|
1974
|
+
dirtyFields: !1,
|
|
1975
|
+
validatingFields: !1,
|
|
1976
|
+
touchedFields: !1,
|
|
1977
|
+
isValidating: !1,
|
|
1978
|
+
isValid: !1,
|
|
1979
|
+
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
|
|
1991
|
+
});
|
|
1992
|
+
}
|
|
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({
|
|
1997
|
+
validatingFields: r.validatingFields,
|
|
1998
|
+
isValidating: !ke(r.validatingFields)
|
|
1999
|
+
}));
|
|
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);
|
|
2005
|
+
}
|
|
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);
|
|
2009
|
+
}
|
|
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);
|
|
2013
|
+
}
|
|
2014
|
+
L.dirtyFields && (r.dirtyFields = Xe(f, i)), V.state.next({
|
|
2015
|
+
name: n,
|
|
2016
|
+
isDirty: T(n, s),
|
|
2017
|
+
dirtyFields: r.dirtyFields,
|
|
2018
|
+
errors: r.errors,
|
|
2019
|
+
isValid: r.isValid
|
|
2020
|
+
});
|
|
2021
|
+
} else
|
|
2022
|
+
ce(i, n, s);
|
|
2023
|
+
}, ie = (n, s) => {
|
|
2024
|
+
ce(r.errors, n, s), V.state.next({
|
|
2025
|
+
errors: r.errors
|
|
2026
|
+
});
|
|
2027
|
+
}, ee = (n) => {
|
|
2028
|
+
r.errors = n, V.state.next({
|
|
2029
|
+
errors: r.errors,
|
|
2030
|
+
isValid: !1
|
|
2031
|
+
});
|
|
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 } : {},
|
|
2059
|
+
errors: r.errors,
|
|
2060
|
+
name: n
|
|
2061
|
+
};
|
|
2062
|
+
r = {
|
|
2063
|
+
...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);
|
|
2077
|
+
}
|
|
2078
|
+
else
|
|
2079
|
+
r.errors = s;
|
|
2080
|
+
return s;
|
|
2081
|
+
}, F = async (n, s, d = {
|
|
2082
|
+
valid: !0
|
|
2083
|
+
}) => {
|
|
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))
|
|
2093
|
+
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));
|
|
2095
|
+
}
|
|
2096
|
+
!ke(N) && await F(N, s, d);
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
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 }
|
|
2116
|
+
})));
|
|
2117
|
+
}
|
|
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 }
|
|
2136
|
+
});
|
|
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);
|
|
2143
|
+
};
|
|
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);
|
|
2160
|
+
}
|
|
2161
|
+
} 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;
|
|
2174
|
+
} 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 } : {},
|
|
2182
|
+
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
|
|
2187
|
+
};
|
|
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 : {}
|
|
2198
|
+
});
|
|
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,
|
|
2207
|
+
errors: r.errors,
|
|
2208
|
+
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({
|
|
2218
|
+
...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 || {},
|
|
2231
|
+
_f: {
|
|
2232
|
+
...d && d._f ? d._f : { ref: { name: n } },
|
|
2233
|
+
name: n,
|
|
2234
|
+
mount: !0,
|
|
2235
|
+
...s
|
|
2236
|
+
}
|
|
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)
|
|
2251
|
+
} : {},
|
|
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)
|
|
2260
|
+
return;
|
|
2261
|
+
ce(l, n, {
|
|
2262
|
+
_f: {
|
|
2263
|
+
...d._f,
|
|
2264
|
+
...N ? {
|
|
2265
|
+
refs: [
|
|
2266
|
+
...Q.filter(pt),
|
|
2267
|
+
x,
|
|
2268
|
+
...Array.isArray(j(f, n)) ? [{}] : []
|
|
2269
|
+
],
|
|
2270
|
+
ref: { type: x.type, name: n }
|
|
2271
|
+
} : { ref: x }
|
|
2272
|
+
}
|
|
2273
|
+
}), o(n, !1, void 0, x);
|
|
2274
|
+
} 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);
|
|
2276
|
+
}
|
|
2277
|
+
};
|
|
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;
|
|
2283
|
+
}));
|
|
2284
|
+
}, 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({
|
|
2290
|
+
isSubmitting: !0
|
|
2291
|
+
}), t.resolver) {
|
|
2292
|
+
const { errors: x, values: N } = await b();
|
|
2293
|
+
r.errors = x, w = N;
|
|
2294
|
+
} else
|
|
2295
|
+
await F(l);
|
|
2296
|
+
if (ye(r.errors, "root"), ke(r.errors)) {
|
|
2297
|
+
V.state.next({
|
|
2298
|
+
errors: {}
|
|
2299
|
+
});
|
|
2300
|
+
try {
|
|
2301
|
+
await n(w, d);
|
|
2302
|
+
} catch (x) {
|
|
2303
|
+
A = x;
|
|
2304
|
+
}
|
|
2305
|
+
} else
|
|
2306
|
+
s && await s({ ...r.errors }, d), O(), setTimeout(O);
|
|
2307
|
+
if (V.state.next({
|
|
2308
|
+
isSubmitted: !0,
|
|
2309
|
+
isSubmitting: !1,
|
|
2310
|
+
isSubmitSuccessful: ke(r.errors) && !A,
|
|
2311
|
+
submitCount: r.submitCount + 1,
|
|
2312
|
+
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));
|
|
2323
|
+
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();
|
|
2333
|
+
break;
|
|
2334
|
+
}
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
l = {};
|
|
2339
|
+
}
|
|
2340
|
+
i = e.shouldUnregister ? s.keepDefaultValues ? xe(f) : {} : xe(x), V.array.next({
|
|
2341
|
+
values: { ...x }
|
|
2342
|
+
}), V.values.next({
|
|
2343
|
+
values: { ...x }
|
|
2344
|
+
});
|
|
2345
|
+
}
|
|
2346
|
+
k = {
|
|
2347
|
+
mount: s.keepDirtyValues ? k.mount : /* @__PURE__ */ new Set(),
|
|
2348
|
+
unMount: /* @__PURE__ */ new Set(),
|
|
2349
|
+
array: /* @__PURE__ */ new Set(),
|
|
2350
|
+
watch: /* @__PURE__ */ new Set(),
|
|
2351
|
+
watchAll: !1,
|
|
2352
|
+
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,
|
|
2361
|
+
isSubmitting: !1
|
|
2362
|
+
});
|
|
2363
|
+
}, q = (n, s) => I(Fe(n) ? n(i) : n, s);
|
|
2364
|
+
return {
|
|
2365
|
+
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({
|
|
2382
|
+
isLoading: !1
|
|
2383
|
+
});
|
|
2384
|
+
}),
|
|
2385
|
+
_updateFormState: (n) => {
|
|
2386
|
+
r = {
|
|
2387
|
+
...r,
|
|
2388
|
+
...n
|
|
2389
|
+
};
|
|
2390
|
+
},
|
|
2391
|
+
_disableForm: C,
|
|
2392
|
+
_subjects: V,
|
|
2393
|
+
_proxyFormState: L,
|
|
2394
|
+
_setErrors: ee,
|
|
2395
|
+
get _fields() {
|
|
2396
|
+
return l;
|
|
2397
|
+
},
|
|
2398
|
+
get _formValues() {
|
|
2399
|
+
return i;
|
|
2400
|
+
},
|
|
2401
|
+
get _state() {
|
|
2402
|
+
return E;
|
|
2403
|
+
},
|
|
2404
|
+
set _state(n) {
|
|
2405
|
+
E = n;
|
|
2406
|
+
},
|
|
2407
|
+
get _defaultValues() {
|
|
2408
|
+
return f;
|
|
2409
|
+
},
|
|
2410
|
+
get _names() {
|
|
2411
|
+
return k;
|
|
2412
|
+
},
|
|
2413
|
+
set _names(n) {
|
|
2414
|
+
k = n;
|
|
2415
|
+
},
|
|
2416
|
+
get _formState() {
|
|
2417
|
+
return r;
|
|
2418
|
+
},
|
|
2419
|
+
set _formState(n) {
|
|
2420
|
+
r = n;
|
|
2421
|
+
},
|
|
2422
|
+
get _options() {
|
|
2423
|
+
return t;
|
|
2424
|
+
},
|
|
2425
|
+
set _options(n) {
|
|
2426
|
+
t = {
|
|
2427
|
+
...t,
|
|
2428
|
+
...n
|
|
2429
|
+
};
|
|
2430
|
+
}
|
|
2431
|
+
},
|
|
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());
|
|
2448
|
+
}
|
|
2449
|
+
},
|
|
2450
|
+
getFieldState: v
|
|
2451
|
+
};
|
|
2452
|
+
}
|
|
2453
|
+
function cn(e = {}) {
|
|
2454
|
+
const t = Pe.useRef(), r = Pe.useRef(), [l, f] = Pe.useState({
|
|
2455
|
+
isDirty: !1,
|
|
2456
|
+
isValidating: !1,
|
|
2457
|
+
isLoading: Fe(e.defaultValues),
|
|
2458
|
+
isSubmitted: !1,
|
|
2459
|
+
isSubmitting: !1,
|
|
2460
|
+
isSubmitSuccessful: !1,
|
|
2461
|
+
isValid: !1,
|
|
2462
|
+
submitCount: 0,
|
|
2463
|
+
dirtyFields: {},
|
|
2464
|
+
touchedFields: {},
|
|
2465
|
+
validatingFields: {},
|
|
2466
|
+
errors: e.errors || {},
|
|
2467
|
+
disabled: e.disabled || !1,
|
|
2468
|
+
defaultValues: Fe(e.defaultValues) ? void 0 : e.defaultValues
|
|
2469
|
+
});
|
|
2470
|
+
t.current || (t.current = {
|
|
2471
|
+
...ln(e),
|
|
2472
|
+
formState: l
|
|
2473
|
+
});
|
|
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
|
|
2485
|
+
});
|
|
2486
|
+
}
|
|
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()
|
|
2496
|
+
});
|
|
2497
|
+
}, [e.shouldUnregister, i]), t.current.formState = Xr(l, i), t.current;
|
|
2498
|
+
}
|
|
2499
|
+
const tr = `Я принимаю условия Политики обработки
|
|
2500
|
+
и защиты персональных данных, даю согласия на обработку персональных
|
|
2501
|
+
данных`, _n = ({
|
|
2502
|
+
isFormOpen: e,
|
|
2503
|
+
setIsFormOpen: t,
|
|
2504
|
+
title: r,
|
|
2505
|
+
subTitle: l,
|
|
2506
|
+
personalCheckbox: f = { text: tr, isRequired: !0 },
|
|
2507
|
+
advCheckBox: i = { text: tr, isRequired: !0 }
|
|
2508
|
+
}) => {
|
|
2509
|
+
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", {
|
|
2517
|
+
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();
|
|
2522
|
+
};
|
|
2523
|
+
return /* @__PURE__ */ we(
|
|
2524
|
+
Sr,
|
|
2525
|
+
{
|
|
2526
|
+
isOpen: e,
|
|
2527
|
+
emitIsOpen: () => t(!1),
|
|
2528
|
+
additionalClass: Re.modal,
|
|
2529
|
+
opacity: 0.7,
|
|
2530
|
+
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(
|
|
2535
|
+
"div",
|
|
2536
|
+
{
|
|
2537
|
+
className: Re.description,
|
|
2538
|
+
dangerouslySetInnerHTML: { __html: l ?? "Оставьте номер телефона для получения консультации" }
|
|
2539
|
+
}
|
|
2540
|
+
),
|
|
2541
|
+
/* @__PURE__ */ at("form", { onSubmit: k(ue), children: [
|
|
2542
|
+
/* @__PURE__ */ at(kr, { className: Re.inputWrapper, children: [
|
|
2543
|
+
/* @__PURE__ */ we(
|
|
2544
|
+
At,
|
|
2545
|
+
{
|
|
2546
|
+
width: "full",
|
|
2547
|
+
size_s: "small",
|
|
2548
|
+
variant: "light",
|
|
2549
|
+
placeholder: "Введите имя",
|
|
2550
|
+
...E("name", { required: !0, pattern: wr }),
|
|
2551
|
+
error: !!V.name
|
|
2552
|
+
}
|
|
2553
|
+
),
|
|
2554
|
+
/* @__PURE__ */ we(
|
|
2555
|
+
Lr,
|
|
2556
|
+
{
|
|
2557
|
+
inputMode: "numeric",
|
|
2558
|
+
name: "phone",
|
|
2559
|
+
mask: "+7 (999) 999-99-99",
|
|
2560
|
+
onChange: ne,
|
|
2561
|
+
placeholder: "+7 (- - -) - - - - - - -",
|
|
2562
|
+
onBlur: G,
|
|
2563
|
+
children: /* @__PURE__ */ we(
|
|
2564
|
+
At,
|
|
2565
|
+
{
|
|
2566
|
+
width: "full",
|
|
2567
|
+
"data-testid": "phone_modal",
|
|
2568
|
+
type: "tel",
|
|
2569
|
+
size_s: "small",
|
|
2570
|
+
variant: "light",
|
|
2571
|
+
...te,
|
|
2572
|
+
...E("phone"),
|
|
2573
|
+
error: !!V.phone
|
|
2574
|
+
}
|
|
2575
|
+
)
|
|
2576
|
+
}
|
|
2577
|
+
),
|
|
2578
|
+
i && /* @__PURE__ */ we(
|
|
2579
|
+
Rt,
|
|
2580
|
+
{
|
|
2581
|
+
isChecked: re,
|
|
2582
|
+
error: !!V.advCheckBox,
|
|
2583
|
+
text: i.text,
|
|
2584
|
+
...E("advCheckBox", { required: i == null ? void 0 : i.isRequired })
|
|
2585
|
+
}
|
|
2586
|
+
),
|
|
2587
|
+
/* @__PURE__ */ we(
|
|
2588
|
+
Rt,
|
|
2589
|
+
{
|
|
2590
|
+
isChecked: K,
|
|
2591
|
+
error: !!V.personalCheckbox,
|
|
2592
|
+
text: f.text,
|
|
2593
|
+
...E("personalCheckbox", { required: f.isRequired })
|
|
2594
|
+
}
|
|
2595
|
+
),
|
|
2596
|
+
/* @__PURE__ */ we(
|
|
2597
|
+
Tt,
|
|
2598
|
+
{
|
|
2599
|
+
variant: "blue",
|
|
2600
|
+
width: "full",
|
|
2601
|
+
type: "submit",
|
|
2602
|
+
size: "large",
|
|
2603
|
+
as: "button",
|
|
2604
|
+
additionalClass: Re.modalBtn,
|
|
2605
|
+
children: "Отправить"
|
|
2606
|
+
}
|
|
2607
|
+
)
|
|
2608
|
+
] }),
|
|
2609
|
+
/* @__PURE__ */ we(
|
|
2610
|
+
Tt,
|
|
2611
|
+
{
|
|
2612
|
+
additionalClass: Re.btn,
|
|
2613
|
+
onClick: () => t(!1),
|
|
2614
|
+
as: "button",
|
|
2615
|
+
variant: "gray",
|
|
2616
|
+
type: "button",
|
|
2617
|
+
size: "small",
|
|
2618
|
+
children: /* @__PURE__ */ we(
|
|
2619
|
+
Pr,
|
|
2620
|
+
{
|
|
2621
|
+
name: "close",
|
|
2622
|
+
size: "16",
|
|
2623
|
+
color: "#141416"
|
|
2624
|
+
}
|
|
2625
|
+
)
|
|
2626
|
+
}
|
|
2627
|
+
)
|
|
2628
|
+
] })
|
|
2629
|
+
] })
|
|
2630
|
+
}
|
|
2631
|
+
);
|
|
2632
|
+
};
|
|
2633
|
+
export {
|
|
2634
|
+
_n as ModalForm
|
|
2635
|
+
};
|