stone-kit 0.0.1028 → 0.0.1030

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.
Files changed (177) hide show
  1. package/dist/App.js +1 -1
  2. package/dist/FilterWithSave-BWA01WwU.js +2476 -0
  3. package/dist/{Menu-CdJTzN7T.js → Menu-CeBSiTyP.js} +176 -157
  4. package/dist/{Option-rFBMQAPk.js → Option-DU8cvBnA.js} +1 -1
  5. package/dist/Router.js +1 -1
  6. package/dist/components/Button/ui/Button.d.ts +1 -0
  7. package/dist/components/Button/ui/Button.js +1 -1
  8. package/dist/components/Button/ui/Button.types.d.ts +1 -0
  9. package/dist/components/CheckBox/CheckBox.d.ts +1 -0
  10. package/dist/components/CheckBox/CheckBox.js +1 -1
  11. package/dist/components/CheckBox/CheckBox.types.d.ts +1 -0
  12. package/dist/components/CheckBoxNew/CheckBox.types.d.ts +1 -0
  13. package/dist/components/CheckBoxNew/CheckBoxNew.d.ts +1 -0
  14. package/dist/components/CheckBoxNew/CheckBoxNew.js +17 -17
  15. package/dist/components/CheckboxSelect/ui/CheckboxSelect.d.ts +1 -0
  16. package/dist/components/CheckboxSelect/ui/CheckboxSelect.js +34 -34
  17. package/dist/components/CommercialLotCard/CommercialLotCard.d.ts +1 -0
  18. package/dist/components/CommercialLotCard/CommercialLotCard.js +7 -50
  19. package/dist/components/CommercialLotCard/components/Price/Price.d.ts +1 -0
  20. package/dist/components/CommercialLotCard/components/Price/Price.js +24 -23
  21. package/dist/components/CommercialLotCard/components/Snippets/Snippets.d.ts +1 -0
  22. package/dist/components/CommercialLotCard/components/Snippets/Snippets.js +27 -98
  23. package/dist/components/CommercialLotCard/components/Tags/Tags.d.ts +1 -0
  24. package/dist/components/CommercialLotCard/components/Tags/Tags.js +17 -17
  25. package/dist/components/CommercialLotCard/types/CommercialLotCard.types.d.ts +1 -0
  26. package/dist/components/CommercialLotCard/types/LotCard.d.ts +1 -0
  27. package/dist/components/CommercialLotCard/utils/formatPrice.js +2 -1
  28. package/dist/components/CommercialLotCard/utils/getTagsFeatures.d.ts +2 -1
  29. package/dist/components/DestinationTab/ui/DestinationTab.d.ts +1 -0
  30. package/dist/components/DestinationTab/ui/DestinationTab.js +41 -41
  31. package/dist/components/DestinationTab/ui/DestinationTab.types.d.ts +1 -0
  32. package/dist/components/FieldInput/ui/FieldInput.d.ts +1 -0
  33. package/dist/components/FieldInput/ui/FieldInput.types.d.ts +1 -0
  34. package/dist/components/FilterWithSave/hooks/useFilterWithSave.d.ts +1 -0
  35. package/dist/components/FilterWithSave/hooks/useFilterWithSave.js +26 -54
  36. package/dist/components/FilterWithSave/ui/FilterWithSave.d.ts +1 -0
  37. package/dist/components/FilterWithSave/ui/FilterWithSave.js +7 -328
  38. package/dist/components/Flex/ui/Flex.d.ts +1 -0
  39. package/dist/components/Flex/ui/Flex.js +1 -1
  40. package/dist/components/Flex/ui/Flex.types.d.ts +1 -0
  41. package/dist/components/FormModal/ui/ModalForm.js +28 -1430
  42. package/dist/components/GroupedInput/ui/GroupedInputs.d.ts +1 -0
  43. package/dist/components/GroupedInput/ui/GroupedInputs.js +1 -1
  44. package/dist/components/GroupedInput/ui/GroupedInputs.types.d.ts +1 -0
  45. package/dist/components/Input/ui/Input.d.ts +2 -1
  46. package/dist/components/Input/ui/Input.js +304 -234
  47. package/dist/components/Logo/ui/Logo.d.ts +1 -0
  48. package/dist/components/Logo/ui/Logo.js +6 -6
  49. package/dist/components/LotCard/hooks/useLotCard.d.ts +1 -0
  50. package/dist/components/LotCard/hooks/useLotCard.js +24 -6
  51. package/dist/components/LotCard/index.js +2 -2
  52. package/dist/components/LotCard/ui/LotCard.d.ts +1 -0
  53. package/dist/components/LotCard/ui/LotCard.js +10 -213
  54. package/dist/components/LotCard/ui/LotCard.types.d.ts +1 -0
  55. package/dist/components/LotCard/utils/formatPrice.js +2 -1
  56. package/dist/components/LotCard/utils/getTagsFeatures.d.ts +2 -1
  57. package/dist/components/LotCardSkeleton/ui/LotCardSkeleton.js +1 -1
  58. package/dist/components/MetroLabel/ui/MetroLabel.d.ts +1 -0
  59. package/dist/components/MetroLabel/ui/MetroLabel.js +16 -16
  60. package/dist/components/MetroLabel/ui/MetroLabel.types.d.ts +1 -0
  61. package/dist/components/MetroTag/ui/MetroTag.d.ts +1 -0
  62. package/dist/components/MetroTag/ui/MetroTag.js +74 -74
  63. package/dist/components/MetroTag/ui/MetroTag.types.d.ts +1 -0
  64. package/dist/components/Modal/ui/Modal.d.ts +1 -0
  65. package/dist/components/Modal/ui/Modal.js +37 -34
  66. package/dist/components/Modal/ui/Modal.types.d.ts +1 -0
  67. package/dist/components/ModalSuccess/ModalSuccess.d.ts +1 -0
  68. package/dist/components/ModalSuccess/ModalSuccess.js +19 -18
  69. package/dist/components/ModalSuccess/ModalSuccess.types.d.ts +1 -0
  70. package/dist/components/NewIcon/icons/PinTrans.d.ts +1 -0
  71. package/dist/components/NewIcon/icons/SmallFilter.d.ts +1 -0
  72. package/dist/components/NewIcon/ui/NewIcon.d.ts +1 -0
  73. package/dist/components/NewIcon/ui/NewIcon.js +3 -3
  74. package/dist/components/NewIcon/ui/NewIcon.types.d.ts +1 -0
  75. package/dist/components/NewIcon/ui/iconTypes.d.ts +1 -0
  76. package/dist/components/ProjectCardSkeleton/ui/ProjectCardSkeleton.js +11 -9
  77. package/dist/components/RoundButton/ui/RoundButton.d.ts +1 -0
  78. package/dist/components/RoundButton/ui/RoundButton.js +2 -2
  79. package/dist/components/RoundButton/ui/RoundButton.types.d.ts +1 -0
  80. package/dist/components/Select/model/selectMode.d.ts +1 -0
  81. package/dist/components/Select/model/selectMode.js +30 -30
  82. package/dist/components/Select/ui/Category.d.ts +1 -0
  83. package/dist/components/Select/ui/Category.js +3 -3
  84. package/dist/components/Select/ui/Option.d.ts +1 -0
  85. package/dist/components/Select/ui/Option.js +2 -2
  86. package/dist/components/Select/ui/Select.d.ts +1 -0
  87. package/dist/components/Select/ui/Select.js +115 -115
  88. package/dist/components/SliderNavigation/index.d.ts +1 -0
  89. package/dist/components/SliderNavigation/ui/SliderNavigation.d.ts +1 -0
  90. package/dist/components/SliderNavigation/ui/SliderNavigation.js +6 -6
  91. package/dist/components/SortSelect/hooks/useSortSelect.d.ts +2 -1
  92. package/dist/components/SortSelect/hooks/useSortSelect.js +2 -2
  93. package/dist/components/SortSelect/index.js +1 -1
  94. package/dist/components/SortSelect/ui/SortSelect.d.ts +1 -0
  95. package/dist/components/SortSelect/ui/SortSelect.js +26 -108
  96. package/dist/components/SortSelect/ui/SortSelect.types.d.ts +1 -0
  97. package/dist/components/SummarySelect/ui/SummarySelect.d.ts +1 -0
  98. package/dist/components/SummarySelect/ui/SummarySelect.js +65 -59
  99. package/dist/components/Switcher/ui/Switcher.d.ts +1 -0
  100. package/dist/components/Switcher/ui/Switcher.js +1 -1
  101. package/dist/components/Switcher/ui/Switcher.types.d.ts +1 -0
  102. package/dist/components/TabSelect/ui/TabSelect.d.ts +13 -7
  103. package/dist/components/TabSelect/ui/TabSelect.js +42 -37
  104. package/dist/components/TabSwitcher/index.js +2 -2
  105. package/dist/components/TabSwitcher/ui/TabSwitcher.d.ts +5 -3
  106. package/dist/components/TabSwitcher/ui/TabSwitcher.js +26 -118
  107. package/dist/components/TabSwitcher/ui/TabSwitcher.types.d.ts +2 -1
  108. package/dist/components/Tag/ui/Tag.d.ts +1 -0
  109. package/dist/components/Tag/ui/Tag.js +91 -91
  110. package/dist/components/Tag/ui/Tag.types.d.ts +1 -0
  111. package/dist/components/Text/ui/Text.d.ts +1 -0
  112. package/dist/components/Text/ui/Text.js +1 -1
  113. package/dist/components/Text/ui/Text.types.d.ts +1 -0
  114. package/dist/components/TextArea/TextArea.d.ts +9 -0
  115. package/dist/components/TextArea/TextArea.js +18 -12
  116. package/dist/components/ZoomControls/ui/ZoomControls.d.ts +1 -0
  117. package/dist/components/ZoomControls/ui/ZoomControls.types.d.ts +1 -0
  118. package/dist/components/mobileButton/ui/MobileButton.d.ts +1 -0
  119. package/dist/components/mobileButton/ui/MobileButton.js +1 -1
  120. package/dist/components/mobileButton/ui/MobileButton.types.d.ts +1 -0
  121. package/dist/{index-CBdtKu-u.js → index-DmANy9jd.js} +271 -272
  122. package/dist/{index-3E04UaC2.js → index-DvCs2JPX.js} +9629 -9529
  123. package/dist/index-rKuIKazb.js +45 -0
  124. package/dist/layout/Layout.d.ts +1 -0
  125. package/dist/layout/components/Header/Header.js +71 -48
  126. package/dist/layout/components/Menu.js +24 -2
  127. package/dist/main.js +65 -70
  128. package/dist/pages/ButtonsPage/Buttons.js +63 -57
  129. package/dist/pages/FormsPage/FormsPage.js +50 -26
  130. package/dist/pages/IconsPage/IconsPage.js +31 -9
  131. package/dist/pages/InputPage/InputPage.js +32 -10
  132. package/dist/pages/LogoPage/LogoPage.js +35 -13
  133. package/dist/pages/LotsPage/LotsPage.js +17 -18
  134. package/dist/pages/LotsPage/const.d.ts +1 -0
  135. package/dist/pages/ModalsPage/ModalPage.js +66 -46
  136. package/dist/pages/SelectPage/SelectPage.js +58 -58
  137. package/dist/pages/TabsPage/TabsPage.js +20 -19
  138. package/dist/pages/TagsPage/TagsPage.js +44 -23
  139. package/dist/shared/checkLargeOffice.d.ts +1 -0
  140. package/dist/shared/checkLargeOffice.js +1 -1
  141. package/dist/shared/mlnRound.js +2 -1
  142. package/dist/stories/entities/CommercialLotCard/CommercialLotCard.stories.js +2 -2
  143. package/dist/stories/shared/ui/Button/Button.stories.js +5 -5
  144. package/dist/stories/shared/ui/CheckBox/CheckBox.stories.js +1 -1
  145. package/dist/stories/shared/ui/CheckBox/CheckBoxNew.stories.js +1 -1
  146. package/dist/stories/shared/ui/CheckboxSelect/CheckboxSelect.stories.js +1 -1
  147. package/dist/stories/shared/ui/DestinationTab/DestinationTab.stories.js +1 -1
  148. package/dist/stories/shared/ui/FieldInput/FieldInput.stories.js +1 -1
  149. package/dist/stories/shared/ui/FilterWithSave/FilterWithSave.stories.js +2 -2
  150. package/dist/stories/shared/ui/FormModal/FormModal.stories.js +8 -8
  151. package/dist/stories/shared/ui/GroupedInput/GroupedInput.stories.js +1 -1
  152. package/dist/stories/shared/ui/Logo/Logo.stories.js +1 -1
  153. package/dist/stories/shared/ui/MobileButton/MobileButton.stories.js +1 -1
  154. package/dist/stories/shared/ui/Modal/Modal.stories.js +1 -1
  155. package/dist/stories/shared/ui/ModalSuccess/ModalSuccess.stories.js +1 -1
  156. package/dist/stories/shared/ui/RoundButton/RoundButton.stories.js +1 -1
  157. package/dist/stories/shared/ui/Select/Select.stories.js +1 -1
  158. package/dist/stories/shared/ui/SliderNavigation/SliderNavigation.stories.js +1 -1
  159. package/dist/stories/shared/ui/SortSelect/SortSelect.stories.js +2 -2
  160. package/dist/stories/shared/ui/SummarySelect/SummarySelect.stories.js +1 -1
  161. package/dist/stories/shared/ui/Switcher/Switcher.stories.js +1 -1
  162. package/dist/stories/shared/ui/TabSelect/TabSelect.stories.js +1 -1
  163. package/dist/stories/shared/ui/TabSwitcher/TabSwitcher.stories.js +2 -2
  164. package/dist/stories/shared/ui/Tag/Tag.stories.js +4 -4
  165. package/dist/stories/shared/ui/ZoomControls/ZoomControls.stories.js +1 -1
  166. package/dist/style.css +1 -0
  167. package/dist/useSortSelect-BTCEVMVn.js +80 -0
  168. package/package.json +22 -31
  169. package/dist/ButtonState.module-DtW3aevR.js +0 -8
  170. package/dist/components/TextArea/TextArea.types.d.ts +0 -10
  171. package/dist/components/TextArea/TextArea.types.js +0 -1
  172. package/dist/index-B2JRaoNz.js +0 -48
  173. package/dist/pages/ButtonsPage/ButtonState/ButtonState.d.ts +0 -6
  174. package/dist/pages/ButtonsPage/ButtonState/ButtonState.js +0 -121
  175. package/dist/stone-kit.css +0 -1
  176. package/dist/useLotCard-DG9doKCX.js +0 -186
  177. package/dist/useSortSelect-C72ddcYI.js +0 -80
@@ -1,1432 +1,30 @@
1
- import { jsx as R, jsxs as ce } from "react/jsx-runtime";
2
- import b, { useEffect as Ze } from "react";
3
- import { nameReg as Lt, phoneReg as Mt, emailReg as Rt } from "../utils/reg.js";
4
- import { TextArea as Ot } from "../../TextArea/TextArea.js";
5
- import { c as Nt } from "../../../index-B2JRaoNz.js";
6
- import { useClientWidth as Ut } from "../../../shared/useClientWidth.js";
7
- import { Modal as Pt } from "../../Modal/ui/Modal.js";
8
- import { NewIcon as et } from "../../NewIcon/ui/NewIcon.js";
9
- import { Flex as It } from "../../Flex/ui/Flex.js";
10
- import { Input as Re } from "../../Input/ui/Input.js";
11
- import { CheckBox as tt } from "../../CheckBox/CheckBox.js";
12
- import { Button as rt } from "../../Button/ui/Button.js";
13
- const Wt = "_btn_ky28a_1", qt = "_modal_ky28a_9", Ht = "_modalBody_ky28a_16", zt = "_root_ky28a_21", $t = "_title_ky28a_34", Kt = "_description_ky28a_41", jt = "_inputWrapper_ky28a_48", Gt = "_linkPolicy_ky28a_55", Yt = "_telegramLink_ky28a_60", Jt = "_telegramWrapper_ky28a_65", Qt = "_telegram_ky28a_60", Xt = "_orText_ky28a_88", Zt = "_checkboxText_ky28a_116", I = {
14
- btn: Wt,
15
- modal: qt,
16
- modalBody: Ht,
17
- root: zt,
18
- title: $t,
19
- description: Kt,
20
- inputWrapper: jt,
21
- linkPolicy: Gt,
22
- telegramLink: Yt,
23
- telegramWrapper: Jt,
24
- telegram: Qt,
25
- orText: Xt,
26
- checkboxText: Zt
27
- };
28
- var ke = (e) => e.type === "checkbox", fe = (e) => e instanceof Date, K = (e) => e == null;
29
- const ht = (e) => typeof e == "object";
30
- var N = (e) => !K(e) && !Array.isArray(e) && ht(e) && !fe(e), mt = (e) => N(e) && e.target ? ke(e.target) ? e.target.checked : e.target.value : e, er = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, _t = (e, s) => e.has(er(s)), tr = (e) => {
31
- const s = e.constructor && e.constructor.prototype;
32
- return N(s) && s.hasOwnProperty("isPrototypeOf");
33
- }, Pe = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
34
- function P(e) {
35
- let s;
36
- const t = Array.isArray(e), a = typeof FileList < "u" ? e instanceof FileList : !1;
37
- if (e instanceof Date)
38
- s = new Date(e);
39
- else if (!(Pe && (e instanceof Blob || a)) && (t || N(e)))
40
- if (s = t ? [] : Object.create(Object.getPrototypeOf(e)), !t && !tr(e))
41
- s = e;
42
- else
43
- for (const o in e)
44
- e.hasOwnProperty(o) && (s[o] = P(e[o]));
45
- else
46
- return e;
47
- return s;
48
- }
49
- var De = (e) => /^\w*$/.test(e), L = (e) => e === void 0, Ie = (e) => Array.isArray(e) ? e.filter(Boolean) : [], We = (e) => Ie(e.replace(/["|']|\]/g, "").split(/\.|\[/)), y = (e, s, t) => {
50
- if (!s || !N(e))
51
- return t;
52
- const a = (De(s) ? [s] : We(s)).reduce((o, l) => K(o) ? o : o[l], e);
53
- return L(a) || a === e ? L(e[s]) ? t : e[s] : a;
54
- }, J = (e) => typeof e == "boolean", B = (e, s, t) => {
55
- let a = -1;
56
- const o = De(s) ? [s] : We(s), l = o.length, d = l - 1;
57
- for (; ++a < l; ) {
58
- const c = o[a];
59
- let S = t;
60
- if (a !== d) {
61
- const D = e[c];
62
- S = N(D) || Array.isArray(D) ? D : isNaN(+o[a + 1]) ? {} : [];
63
- }
64
- if (c === "__proto__" || c === "constructor" || c === "prototype")
65
- return;
66
- e[c] = S, e = e[c];
67
- }
68
- };
69
- const we = {
70
- BLUR: "blur",
71
- FOCUS_OUT: "focusout",
72
- CHANGE: "change"
73
- }, se = {
74
- onBlur: "onBlur",
75
- onChange: "onChange",
76
- onSubmit: "onSubmit",
77
- onTouched: "onTouched",
78
- all: "all"
79
- }, ae = {
80
- max: "max",
81
- min: "min",
82
- maxLength: "maxLength",
83
- minLength: "minLength",
84
- pattern: "pattern",
85
- required: "required",
86
- validate: "validate"
87
- }, gt = b.createContext(null);
88
- gt.displayName = "HookFormContext";
89
- const qe = () => b.useContext(gt);
90
- var vt = (e, s, t, a = !0) => {
91
- const o = {
92
- defaultValues: s._defaultValues
93
- };
94
- for (const l in e)
95
- Object.defineProperty(o, l, {
96
- get: () => {
97
- const d = l;
98
- return s._proxyFormState[d] !== se.all && (s._proxyFormState[d] = !a || se.all), t && (t[d] = !0), e[d];
99
- }
100
- });
101
- return o;
102
- };
103
- const He = typeof window < "u" ? b.useLayoutEffect : b.useEffect;
104
- function rr(e) {
105
- const s = qe(), { control: t = s.control, disabled: a, name: o, exact: l } = e || {}, [d, c] = b.useState(t._formState), S = b.useRef({
106
- isDirty: !1,
107
- isLoading: !1,
108
- dirtyFields: !1,
109
- touchedFields: !1,
110
- validatingFields: !1,
111
- isValidating: !1,
112
- isValid: !1,
113
- errors: !1
114
- });
115
- return He(() => t._subscribe({
116
- name: o,
117
- formState: S.current,
118
- exact: l,
119
- callback: (D) => {
120
- !a && c({
121
- ...t._formState,
122
- ...D
123
- });
124
- }
125
- }), [o, a, l]), b.useEffect(() => {
126
- S.current.isValid && t._setValid(!0);
127
- }, [t]), b.useMemo(() => vt(d, t, S.current, !1), [d, t]);
128
- }
129
- var Q = (e) => typeof e == "string", bt = (e, s, t, a, o) => Q(e) ? (a && s.watch.add(e), y(t, e, o)) : Array.isArray(e) ? e.map((l) => (a && s.watch.add(l), y(t, l))) : (a && (s.watchAll = !0), t), Ne = (e) => K(e) || !ht(e);
130
- function le(e, s, t = /* @__PURE__ */ new WeakSet()) {
131
- if (Ne(e) || Ne(s))
132
- return e === s;
133
- if (fe(e) && fe(s))
134
- return e.getTime() === s.getTime();
135
- const a = Object.keys(e), o = Object.keys(s);
136
- if (a.length !== o.length)
137
- return !1;
138
- if (t.has(e) || t.has(s))
139
- return !0;
140
- t.add(e), t.add(s);
141
- for (const l of a) {
142
- const d = e[l];
143
- if (!o.includes(l))
144
- return !1;
145
- if (l !== "ref") {
146
- const c = s[l];
147
- if (fe(d) && fe(c) || N(d) && N(c) || Array.isArray(d) && Array.isArray(c) ? !le(d, c, t) : d !== c)
148
- return !1;
149
- }
150
- }
151
- return !0;
152
- }
153
- function sr(e) {
154
- const s = qe(), { control: t = s.control, name: a, defaultValue: o, disabled: l, exact: d, compute: c } = e || {}, S = b.useRef(o), D = b.useRef(c), _ = b.useRef(void 0);
155
- D.current = c;
156
- const x = b.useMemo(() => t._getWatch(a, S.current), [t, a]), [g, j] = b.useState(D.current ? D.current(x) : x);
157
- return He(() => t._subscribe({
158
- name: a,
159
- formState: {
160
- values: !0
161
- },
162
- exact: d,
163
- callback: (q) => {
164
- if (!l) {
165
- const p = bt(a, t._names, q.values || t._formValues, !1, S.current);
166
- if (D.current) {
167
- const M = D.current(p);
168
- le(M, _.current) || (j(M), _.current = M);
169
- } else
170
- j(p);
171
- }
172
- }
173
- }), [t, l, a, d]), b.useEffect(() => t._removeUnmounted()), g;
174
- }
175
- function ir(e) {
176
- const s = qe(), { name: t, disabled: a, control: o = s.control, shouldUnregister: l, defaultValue: d } = e, c = _t(o._names.array, t), S = b.useMemo(() => y(o._formValues, t, y(o._defaultValues, t, d)), [o, t, d]), D = sr({
177
- control: o,
178
- name: t,
179
- defaultValue: S,
180
- exact: !0
181
- }), _ = rr({
182
- control: o,
183
- name: t,
184
- exact: !0
185
- }), x = b.useRef(e), g = b.useRef(void 0), j = b.useRef(o.register(t, {
186
- ...e.rules,
187
- value: D,
188
- ...J(e.disabled) ? { disabled: e.disabled } : {}
189
- }));
190
- x.current = e;
191
- const q = b.useMemo(() => Object.defineProperties({}, {
192
- invalid: {
193
- enumerable: !0,
194
- get: () => !!y(_.errors, t)
195
- },
196
- isDirty: {
197
- enumerable: !0,
198
- get: () => !!y(_.dirtyFields, t)
199
- },
200
- isTouched: {
201
- enumerable: !0,
202
- get: () => !!y(_.touchedFields, t)
203
- },
204
- isValidating: {
205
- enumerable: !0,
206
- get: () => !!y(_.validatingFields, t)
207
- },
208
- error: {
209
- enumerable: !0,
210
- get: () => y(_.errors, t)
211
- }
212
- }), [_, t]), p = b.useCallback((T) => j.current.onChange({
213
- target: {
214
- value: mt(T),
215
- name: t
216
- },
217
- type: we.CHANGE
218
- }), [t]), M = b.useCallback(() => j.current.onBlur({
219
- target: {
220
- value: y(o._formValues, t),
221
- name: t
222
- },
223
- type: we.BLUR
224
- }), [t, o._formValues]), ne = b.useCallback((T) => {
225
- const U = y(o._fields, t);
226
- U && T && (U._f.ref = {
227
- focus: () => T.focus && T.focus(),
228
- select: () => T.select && T.select(),
229
- setCustomValidity: (w) => T.setCustomValidity(w),
230
- reportValidity: () => T.reportValidity()
231
- });
232
- }, [o._fields, t]), v = b.useMemo(() => ({
233
- name: t,
234
- value: D,
235
- ...J(a) || _.disabled ? { disabled: _.disabled || a } : {},
236
- onChange: p,
237
- onBlur: M,
238
- ref: ne
239
- }), [t, a, _.disabled, p, M, ne, D]);
240
- return b.useEffect(() => {
241
- const T = o._options.shouldUnregister || l, U = g.current;
242
- U && U !== t && !c && o.unregister(U), o.register(t, {
243
- ...x.current.rules,
244
- ...J(x.current.disabled) ? { disabled: x.current.disabled } : {}
245
- });
246
- const w = (X, H) => {
247
- const re = y(o._fields, X);
248
- re && re._f && (re._f.mount = H);
249
- };
250
- if (w(t, !0), T) {
251
- const X = P(y(o._options.defaultValues, t, x.current.defaultValue));
252
- B(o._defaultValues, t, X), L(y(o._formValues, t)) && B(o._formValues, t, X);
253
- }
254
- return !c && o.register(t), g.current = t, () => {
255
- (c ? T && !o._state.action : T) ? o.unregister(t) : w(t, !1);
256
- };
257
- }, [t, o, c, l]), b.useEffect(() => {
258
- o._setDisabledField({
259
- disabled: a,
260
- name: t
261
- });
262
- }, [a, t, o]), b.useMemo(() => ({
263
- field: v,
264
- formState: _,
265
- fieldState: q
266
- }), [v, _, q]);
267
- }
268
- const ar = (e) => e.render(ir(e));
269
- var lr = (e, s, t, a, o) => s ? {
270
- ...t[e],
271
- types: {
272
- ...t[e] && t[e].types ? t[e].types : {},
273
- [a]: o || !0
274
- }
275
- } : {}, Ve = (e) => Array.isArray(e) ? e : [e], st = () => {
276
- let e = [];
277
- return {
278
- get observers() {
279
- return e;
280
- },
281
- next: (o) => {
282
- for (const l of e)
283
- l.next && l.next(o);
284
- },
285
- subscribe: (o) => (e.push(o), {
286
- unsubscribe: () => {
287
- e = e.filter((l) => l !== o);
288
- }
289
- }),
290
- unsubscribe: () => {
291
- e = [];
292
- }
293
- };
294
- };
295
- function Vt(e, s) {
296
- const t = {};
297
- for (const a in e)
298
- if (e.hasOwnProperty(a)) {
299
- const o = e[a], l = s[a];
300
- if (o && N(o) && l) {
301
- const d = Vt(o, l);
302
- N(d) && (t[a] = d);
303
- } else e[a] && (t[a] = l);
304
- }
305
- return t;
306
- }
307
- var $ = (e) => N(e) && !Object.keys(e).length, ze = (e) => e.type === "file", ie = (e) => typeof e == "function", Ce = (e) => {
308
- if (!Pe)
309
- return !1;
310
- const s = e ? e.ownerDocument : 0;
311
- return e instanceof (s && s.defaultView ? s.defaultView.HTMLElement : HTMLElement);
312
- }, xt = (e) => e.type === "select-multiple", $e = (e) => e.type === "radio", nr = (e) => $e(e) || ke(e), Oe = (e) => Ce(e) && e.isConnected;
313
- function or(e, s) {
314
- const t = s.slice(0, -1).length;
315
- let a = 0;
316
- for (; a < t; )
317
- e = L(e) ? a++ : e[s[a++]];
318
- return e;
319
- }
320
- function ur(e) {
321
- for (const s in e)
322
- if (e.hasOwnProperty(s) && !L(e[s]))
323
- return !1;
324
- return !0;
325
- }
326
- function O(e, s) {
327
- const t = Array.isArray(s) ? s : De(s) ? [s] : We(s), a = t.length === 1 ? e : or(e, t), o = t.length - 1, l = t[o];
328
- return a && delete a[l], o !== 0 && (N(a) && $(a) || Array.isArray(a) && ur(a)) && O(e, t.slice(0, -1)), e;
329
- }
330
- var dr = (e) => {
331
- for (const s in e)
332
- if (ie(e[s]))
333
- return !0;
334
- return !1;
335
- };
336
- function kt(e) {
337
- return Array.isArray(e) || N(e) && !dr(e);
338
- }
339
- function Ue(e, s = {}) {
340
- for (const t in e)
341
- kt(e[t]) ? (s[t] = Array.isArray(e[t]) ? [] : {}, Ue(e[t], s[t])) : L(e[t]) || (s[t] = !0);
342
- return s;
343
- }
344
- function me(e, s, t) {
345
- t || (t = Ue(s));
346
- for (const a in e)
347
- kt(e[a]) ? L(s) || Ne(t[a]) ? t[a] = Ue(e[a], Array.isArray(e[a]) ? [] : {}) : me(e[a], K(s) ? {} : s[a], t[a]) : t[a] = !le(e[a], s[a]);
348
- return t;
349
- }
350
- const it = {
351
- value: !1,
352
- isValid: !1
353
- }, at = { value: !0, isValid: !0 };
354
- var Ft = (e) => {
355
- if (Array.isArray(e)) {
356
- if (e.length > 1) {
357
- const s = e.filter((t) => t && t.checked && !t.disabled).map((t) => t.value);
358
- return { value: s, isValid: !!s.length };
359
- }
360
- return e[0].checked && !e[0].disabled ? (
361
- // @ts-expect-error expected to work in the browser
362
- e[0].attributes && !L(e[0].attributes.value) ? L(e[0].value) || e[0].value === "" ? at : { value: e[0].value, isValid: !0 } : at
363
- ) : it;
364
- }
365
- return it;
366
- }, At = (e, { valueAsNumber: s, valueAsDate: t, setValueAs: a }) => L(e) ? e : s ? e === "" ? NaN : e && +e : t && Q(e) ? new Date(e) : a ? a(e) : e;
367
- const lt = {
368
- isValid: !1,
369
- value: null
370
- };
371
- var pt = (e) => Array.isArray(e) ? e.reduce((s, t) => t && t.checked && !t.disabled ? {
372
- isValid: !0,
373
- value: t.value
374
- } : s, lt) : lt;
375
- function nt(e) {
376
- const s = e.ref;
377
- return ze(s) ? s.files : $e(s) ? pt(e.refs).value : xt(s) ? [...s.selectedOptions].map(({ value: t }) => t) : ke(s) ? Ft(e.refs).value : At(L(s.value) ? e.ref.value : s.value, e);
378
- }
379
- var cr = (e, s, t, a) => {
380
- const o = {};
381
- for (const l of e) {
382
- const d = y(s, l);
383
- d && B(o, l, d._f);
384
- }
385
- return {
386
- criteriaMode: t,
387
- names: [...e],
388
- fields: o,
389
- shouldUseNativeValidation: a
390
- };
391
- }, Se = (e) => e instanceof RegExp, be = (e) => L(e) ? e : Se(e) ? e.source : N(e) ? Se(e.value) ? e.value.source : e.value : e, ot = (e) => ({
392
- isOnSubmit: !e || e === se.onSubmit,
393
- isOnBlur: e === se.onBlur,
394
- isOnChange: e === se.onChange,
395
- isOnAll: e === se.all,
396
- isOnTouch: e === se.onTouched
397
- });
398
- const ut = "AsyncFunction";
399
- var fr = (e) => !!e && !!e.validate && !!(ie(e.validate) && e.validate.constructor.name === ut || N(e.validate) && Object.values(e.validate).find((s) => s.constructor.name === ut)), yr = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), dt = (e, s, t) => !t && (s.watchAll || s.watch.has(e) || [...s.watch].some((a) => e.startsWith(a) && /^\.\w+/.test(e.slice(a.length))));
400
- const xe = (e, s, t, a) => {
401
- for (const o of t || Object.keys(e)) {
402
- const l = y(e, o);
403
- if (l) {
404
- const { _f: d, ...c } = l;
405
- if (d) {
406
- if (d.refs && d.refs[0] && s(d.refs[0], o) && !a)
407
- return !0;
408
- if (d.ref && s(d.ref, d.name) && !a)
409
- return !0;
410
- if (xe(c, s))
411
- break;
412
- } else if (N(c) && xe(c, s))
413
- break;
414
- }
415
- }
416
- };
417
- function ct(e, s, t) {
418
- const a = y(e, t);
419
- if (a || De(t))
420
- return {
421
- error: a,
422
- name: t
423
- };
424
- const o = t.split(".");
425
- for (; o.length; ) {
426
- const l = o.join("."), d = y(s, l), c = y(e, l);
427
- if (d && !Array.isArray(d) && t !== l)
428
- return { name: t };
429
- if (c && c.type)
430
- return {
431
- name: l,
432
- error: c
433
- };
434
- if (c && c.root && c.root.type)
435
- return {
436
- name: `${l}.root`,
437
- error: c.root
438
- };
439
- o.pop();
440
- }
441
- return {
442
- name: t
443
- };
444
- }
445
- var hr = (e, s, t, a) => {
446
- t(e);
447
- const { name: o, ...l } = e;
448
- return $(l) || Object.keys(l).length >= Object.keys(s).length || Object.keys(l).find((d) => s[d] === (!a || se.all));
449
- }, mr = (e, s, t) => !e || !s || e === s || Ve(e).some((a) => a && (t ? a === s : a.startsWith(s) || s.startsWith(a))), _r = (e, s, t, a, o) => o.isOnAll ? !1 : !t && o.isOnTouch ? !(s || e) : (t ? a.isOnBlur : o.isOnBlur) ? !e : (t ? a.isOnChange : o.isOnChange) ? e : !0, gr = (e, s) => !Ie(y(e, s)).length && O(e, s), vr = (e, s, t) => {
450
- const a = Ve(y(e, t));
451
- return B(a, "root", s[t]), B(e, t, a), e;
452
- };
453
- function ft(e, s, t = "validate") {
454
- if (Q(e) || Array.isArray(e) && e.every(Q) || J(e) && !e)
455
- return {
456
- type: t,
457
- message: Q(e) ? e : "",
458
- ref: s
459
- };
460
- }
461
- var he = (e) => N(e) && !Se(e) ? e : {
462
- value: e,
463
- message: ""
464
- }, yt = async (e, s, t, a, o, l) => {
465
- const { ref: d, refs: c, required: S, maxLength: D, minLength: _, min: x, max: g, pattern: j, validate: q, name: p, valueAsNumber: M, mount: ne } = e._f, v = y(t, p);
466
- if (!ne || s.has(p))
467
- return {};
468
- const T = c ? c[0] : d, U = (V) => {
469
- o && T.reportValidity && (T.setCustomValidity(J(V) ? "" : V || ""), T.reportValidity());
470
- }, w = {}, X = $e(d), H = ke(d), re = X || H, z = (M || ze(d)) && L(d.value) && L(v) || Ce(d) && d.value === "" || v === "" || Array.isArray(v) && !v.length, G = lr.bind(null, p, a, w), Z = (V, k, C, F = ae.maxLength, W = ae.minLength) => {
471
- const Y = V ? k : C;
472
- w[p] = {
473
- type: V ? F : W,
474
- message: Y,
475
- ref: d,
476
- ...G(V ? F : W, Y)
477
- };
478
- };
479
- if (l ? !Array.isArray(v) || !v.length : S && (!re && (z || K(v)) || J(v) && !v || H && !Ft(c).isValid || X && !pt(c).isValid)) {
480
- const { value: V, message: k } = Q(S) ? { value: !!S, message: S } : he(S);
481
- if (V && (w[p] = {
482
- type: ae.required,
483
- message: k,
484
- ref: T,
485
- ...G(ae.required, k)
486
- }, !a))
487
- return U(k), w;
488
- }
489
- if (!z && (!K(x) || !K(g))) {
490
- let V, k;
491
- const C = he(g), F = he(x);
492
- if (!K(v) && !isNaN(v)) {
493
- const W = d.valueAsNumber || v && +v;
494
- K(C.value) || (V = W > C.value), K(F.value) || (k = W < F.value);
495
- } else {
496
- const W = d.valueAsDate || new Date(v), Y = (ye) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ye), oe = d.type == "time", ue = d.type == "week";
497
- Q(C.value) && v && (V = oe ? Y(v) > Y(C.value) : ue ? v > C.value : W > new Date(C.value)), Q(F.value) && v && (k = oe ? Y(v) < Y(F.value) : ue ? v < F.value : W < new Date(F.value));
498
- }
499
- if ((V || k) && (Z(!!V, C.message, F.message, ae.max, ae.min), !a))
500
- return U(w[p].message), w;
501
- }
502
- if ((D || _) && !z && (Q(v) || l && Array.isArray(v))) {
503
- const V = he(D), k = he(_), C = !K(V.value) && v.length > +V.value, F = !K(k.value) && v.length < +k.value;
504
- if ((C || F) && (Z(C, V.message, k.message), !a))
505
- return U(w[p].message), w;
506
- }
507
- if (j && !z && Q(v)) {
508
- const { value: V, message: k } = he(j);
509
- if (Se(V) && !v.match(V) && (w[p] = {
510
- type: ae.pattern,
511
- message: k,
512
- ref: d,
513
- ...G(ae.pattern, k)
514
- }, !a))
515
- return U(k), w;
516
- }
517
- if (q) {
518
- if (ie(q)) {
519
- const V = await q(v, t), k = ft(V, T);
520
- if (k && (w[p] = {
521
- ...k,
522
- ...G(ae.validate, k.message)
523
- }, !a))
524
- return U(k.message), w;
525
- } else if (N(q)) {
526
- let V = {};
527
- for (const k in q) {
528
- if (!$(V) && !a)
529
- break;
530
- const C = ft(await q[k](v, t), T, k);
531
- C && (V = {
532
- ...C,
533
- ...G(k, C.message)
534
- }, U(C.message), a && (w[p] = V));
535
- }
536
- if (!$(V) && (w[p] = {
537
- ref: T,
538
- ...V
539
- }, !a))
540
- return w;
541
- }
542
- }
543
- return U(!0), w;
544
- };
545
- const br = {
546
- mode: se.onSubmit,
547
- reValidateMode: se.onChange,
548
- shouldFocusError: !0
549
- };
550
- function Vr(e = {}) {
551
- let s = {
552
- ...br,
553
- ...e
554
- }, t = {
555
- submitCount: 0,
556
- isDirty: !1,
557
- isReady: !1,
558
- isLoading: ie(s.defaultValues),
559
- isValidating: !1,
560
- isSubmitted: !1,
561
- isSubmitting: !1,
562
- isSubmitSuccessful: !1,
563
- isValid: !1,
564
- touchedFields: {},
565
- dirtyFields: {},
566
- validatingFields: {},
567
- errors: s.errors || {},
568
- disabled: s.disabled || !1
569
- }, a = {}, o = N(s.defaultValues) || N(s.values) ? P(s.defaultValues || s.values) || {} : {}, l = s.shouldUnregister ? {} : P(o), d = {
570
- action: !1,
571
- mount: !1,
572
- watch: !1
573
- }, c = {
574
- mount: /* @__PURE__ */ new Set(),
575
- disabled: /* @__PURE__ */ new Set(),
576
- unMount: /* @__PURE__ */ new Set(),
577
- array: /* @__PURE__ */ new Set(),
578
- watch: /* @__PURE__ */ new Set()
579
- }, S, D = 0;
580
- const _ = {
581
- isDirty: !1,
582
- dirtyFields: !1,
583
- validatingFields: !1,
584
- touchedFields: !1,
585
- isValidating: !1,
586
- isValid: !1,
587
- errors: !1
588
- };
589
- let x = {
590
- ..._
591
- };
592
- const g = {
593
- array: st(),
594
- state: st()
595
- }, j = s.criteriaMode === se.all, q = (r) => (i) => {
596
- clearTimeout(D), D = setTimeout(r, i);
597
- }, p = async (r) => {
598
- if (!s.disabled && (_.isValid || x.isValid || r)) {
599
- const i = s.resolver ? $((await H()).errors) : await z(a, !0);
600
- i !== t.isValid && g.state.next({
601
- isValid: i
602
- });
603
- }
604
- }, M = (r, i) => {
605
- !s.disabled && (_.isValidating || _.validatingFields || x.isValidating || x.validatingFields) && ((r || Array.from(c.mount)).forEach((n) => {
606
- n && (i ? B(t.validatingFields, n, i) : O(t.validatingFields, n));
607
- }), g.state.next({
608
- validatingFields: t.validatingFields,
609
- isValidating: !$(t.validatingFields)
610
- }));
611
- }, ne = (r, i = [], n, h, f = !0, u = !0) => {
612
- if (h && n && !s.disabled) {
613
- if (d.action = !0, u && Array.isArray(y(a, r))) {
614
- const m = n(y(a, r), h.argA, h.argB);
615
- f && B(a, r, m);
616
- }
617
- if (u && Array.isArray(y(t.errors, r))) {
618
- const m = n(y(t.errors, r), h.argA, h.argB);
619
- f && B(t.errors, r, m), gr(t.errors, r);
620
- }
621
- if ((_.touchedFields || x.touchedFields) && u && Array.isArray(y(t.touchedFields, r))) {
622
- const m = n(y(t.touchedFields, r), h.argA, h.argB);
623
- f && B(t.touchedFields, r, m);
624
- }
625
- (_.dirtyFields || x.dirtyFields) && (t.dirtyFields = me(o, l)), g.state.next({
626
- name: r,
627
- isDirty: Z(r, i),
628
- dirtyFields: t.dirtyFields,
629
- errors: t.errors,
630
- isValid: t.isValid
631
- });
632
- } else
633
- B(l, r, i);
634
- }, v = (r, i) => {
635
- B(t.errors, r, i), g.state.next({
636
- errors: t.errors
637
- });
638
- }, T = (r) => {
639
- t.errors = r, g.state.next({
640
- errors: t.errors,
641
- isValid: !1
642
- });
643
- }, U = (r, i, n, h) => {
644
- const f = y(a, r);
645
- if (f) {
646
- const u = y(l, r, L(n) ? y(o, r) : n);
647
- L(u) || h && h.defaultChecked || i ? B(l, r, i ? u : nt(f._f)) : C(r, u), d.mount && p();
648
- }
649
- }, w = (r, i, n, h, f) => {
650
- let u = !1, m = !1;
651
- const A = {
652
- name: r
653
- };
654
- if (!s.disabled) {
655
- if (!n || h) {
656
- (_.isDirty || x.isDirty) && (m = t.isDirty, t.isDirty = A.isDirty = Z(), u = m !== A.isDirty);
657
- const E = le(y(o, r), i);
658
- m = !!y(t.dirtyFields, r), E ? O(t.dirtyFields, r) : B(t.dirtyFields, r, !0), A.dirtyFields = t.dirtyFields, u = u || (_.dirtyFields || x.dirtyFields) && m !== !E;
659
- }
660
- if (n) {
661
- const E = y(t.touchedFields, r);
662
- E || (B(t.touchedFields, r, n), A.touchedFields = t.touchedFields, u = u || (_.touchedFields || x.touchedFields) && E !== n);
663
- }
664
- u && f && g.state.next(A);
665
- }
666
- return u ? A : {};
667
- }, X = (r, i, n, h) => {
668
- const f = y(t.errors, r), u = (_.isValid || x.isValid) && J(i) && t.isValid !== i;
669
- if (s.delayError && n ? (S = q(() => v(r, n)), S(s.delayError)) : (clearTimeout(D), S = null, n ? B(t.errors, r, n) : O(t.errors, r)), (n ? !le(f, n) : f) || !$(h) || u) {
670
- const m = {
671
- ...h,
672
- ...u && J(i) ? { isValid: i } : {},
673
- errors: t.errors,
674
- name: r
675
- };
676
- t = {
677
- ...t,
678
- ...m
679
- }, g.state.next(m);
680
- }
681
- }, H = async (r) => {
682
- M(r, !0);
683
- const i = await s.resolver(l, s.context, cr(r || c.mount, a, s.criteriaMode, s.shouldUseNativeValidation));
684
- return M(r), i;
685
- }, re = async (r) => {
686
- const { errors: i } = await H(r);
687
- if (r)
688
- for (const n of r) {
689
- const h = y(i, n);
690
- h ? B(t.errors, n, h) : O(t.errors, n);
691
- }
692
- else
693
- t.errors = i;
694
- return i;
695
- }, z = async (r, i, n = {
696
- valid: !0
697
- }) => {
698
- for (const h in r) {
699
- const f = r[h];
700
- if (f) {
701
- const { _f: u, ...m } = f;
702
- if (u) {
703
- const A = c.array.has(u.name), E = f._f && fr(f._f);
704
- E && _.validatingFields && M([u.name], !0);
705
- const te = await yt(f, c.disabled, l, j, s.shouldUseNativeValidation && !i, A);
706
- if (E && _.validatingFields && M([u.name]), te[u.name] && (n.valid = !1, i))
707
- break;
708
- !i && (y(te, u.name) ? A ? vr(t.errors, te, u.name) : B(t.errors, u.name, te[u.name]) : O(t.errors, u.name));
709
- }
710
- !$(m) && await z(m, i, n);
711
- }
712
- }
713
- return n.valid;
714
- }, G = () => {
715
- for (const r of c.unMount) {
716
- const i = y(a, r);
717
- i && (i._f.refs ? i._f.refs.every((n) => !Oe(n)) : !Oe(i._f.ref)) && ve(r);
718
- }
719
- c.unMount = /* @__PURE__ */ new Set();
720
- }, Z = (r, i) => !s.disabled && (r && i && B(l, r, i), !le(ye(), o)), V = (r, i, n) => bt(r, c, {
721
- ...d.mount ? l : L(i) ? o : Q(r) ? { [r]: i } : i
722
- }, n, i), k = (r) => Ie(y(d.mount ? l : o, r, s.shouldUnregister ? y(o, r, []) : [])), C = (r, i, n = {}) => {
723
- const h = y(a, r);
724
- let f = i;
725
- if (h) {
726
- const u = h._f;
727
- u && (!u.disabled && B(l, r, At(i, u)), f = Ce(u.ref) && K(i) ? "" : i, xt(u.ref) ? [...u.ref.options].forEach((m) => m.selected = f.includes(m.value)) : u.refs ? ke(u.ref) ? u.refs.forEach((m) => {
728
- (!m.defaultChecked || !m.disabled) && (Array.isArray(f) ? m.checked = !!f.find((A) => A === m.value) : m.checked = f === m.value || !!f);
729
- }) : u.refs.forEach((m) => m.checked = m.value === f) : ze(u.ref) ? u.ref.value = "" : (u.ref.value = f, u.ref.type || g.state.next({
730
- name: r,
731
- values: P(l)
732
- })));
733
- }
734
- (n.shouldDirty || n.shouldTouch) && w(r, f, n.shouldTouch, n.shouldDirty, !0), n.shouldValidate && ue(r);
735
- }, F = (r, i, n) => {
736
- for (const h in i) {
737
- if (!i.hasOwnProperty(h))
738
- return;
739
- const f = i[h], u = r + "." + h, m = y(a, u);
740
- (c.array.has(r) || N(f) || m && !m._f) && !fe(f) ? F(u, f, n) : C(u, f, n);
741
- }
742
- }, W = (r, i, n = {}) => {
743
- const h = y(a, r), f = c.array.has(r), u = P(i);
744
- B(l, r, u), f ? (g.array.next({
745
- name: r,
746
- values: P(l)
747
- }), (_.isDirty || _.dirtyFields || x.isDirty || x.dirtyFields) && n.shouldDirty && g.state.next({
748
- name: r,
749
- dirtyFields: me(o, l),
750
- isDirty: Z(r, u)
751
- })) : h && !h._f && !K(u) ? F(r, u, n) : C(r, u, n), dt(r, c) && g.state.next({ ...t, name: r }), g.state.next({
752
- name: d.mount ? r : void 0,
753
- values: P(l)
754
- });
755
- }, Y = async (r) => {
756
- d.mount = !0;
757
- const i = r.target;
758
- let n = i.name, h = !0;
759
- const f = y(a, n), u = (E) => {
760
- h = Number.isNaN(E) || fe(E) && isNaN(E.getTime()) || le(E, y(l, n, E));
761
- }, m = ot(s.mode), A = ot(s.reValidateMode);
762
- if (f) {
763
- let E, te;
764
- const pe = i.type ? nt(f._f) : mt(r), de = r.type === we.BLUR || r.type === we.FOCUS_OUT, Et = !yr(f._f) && !s.resolver && !y(t.errors, n) && !f._f.deps || _r(de, y(t.touchedFields, n), t.isSubmitted, A, m), Le = dt(n, c, de);
765
- B(l, n, pe), de ? (!i || !i.readOnly) && (f._f.onBlur && f._f.onBlur(r), S && S(0)) : f._f.onChange && f._f.onChange(r);
766
- const Me = w(n, pe, de), Bt = !$(Me) || Le;
767
- if (!de && g.state.next({
768
- name: n,
769
- type: r.type,
770
- values: P(l)
771
- }), Et)
772
- return (_.isValid || x.isValid) && (s.mode === "onBlur" ? de && p() : de || p()), Bt && g.state.next({ name: n, ...Le ? {} : Me });
773
- if (!de && Le && g.state.next({ ...t }), s.resolver) {
774
- const { errors: Qe } = await H([n]);
775
- if (u(pe), h) {
776
- const Tt = ct(t.errors, a, n), Xe = ct(Qe, a, Tt.name || n);
777
- E = Xe.error, n = Xe.name, te = $(Qe);
778
- }
779
- } else
780
- M([n], !0), E = (await yt(f, c.disabled, l, j, s.shouldUseNativeValidation))[n], M([n]), u(pe), h && (E ? te = !1 : (_.isValid || x.isValid) && (te = await z(a, !0)));
781
- h && (f._f.deps && (!Array.isArray(f._f.deps) || f._f.deps.length > 0) && ue(f._f.deps), X(n, te, E, Me));
782
- }
783
- }, oe = (r, i) => {
784
- if (y(t.errors, i) && r.focus)
785
- return r.focus(), 1;
786
- }, ue = async (r, i = {}) => {
787
- let n, h;
788
- const f = Ve(r);
789
- if (s.resolver) {
790
- const u = await re(L(r) ? r : f);
791
- n = $(u), h = r ? !f.some((m) => y(u, m)) : n;
792
- } else r ? (h = (await Promise.all(f.map(async (u) => {
793
- const m = y(a, u);
794
- return await z(m && m._f ? { [u]: m } : m);
795
- }))).every(Boolean), !(!h && !t.isValid) && p()) : h = n = await z(a);
796
- return g.state.next({
797
- ...!Q(r) || (_.isValid || x.isValid) && n !== t.isValid ? {} : { name: r },
798
- ...s.resolver || !r ? { isValid: n } : {},
799
- errors: t.errors
800
- }), i.shouldFocus && !h && xe(a, oe, r ? f : c.mount), h;
801
- }, ye = (r, i) => {
802
- let n = {
803
- ...d.mount ? l : o
804
- };
805
- return i && (n = Vt(i.dirtyFields ? t.dirtyFields : t.touchedFields, n)), L(r) ? n : Q(r) ? y(n, r) : r.map((h) => y(n, h));
806
- }, Fe = (r, i) => ({
807
- invalid: !!y((i || t).errors, r),
808
- isDirty: !!y((i || t).dirtyFields, r),
809
- error: y((i || t).errors, r),
810
- isValidating: !!y(t.validatingFields, r),
811
- isTouched: !!y((i || t).touchedFields, r)
812
- }), Ee = (r) => {
813
- r && Ve(r).forEach((i) => O(t.errors, i)), g.state.next({
814
- errors: r ? t.errors : {}
815
- });
816
- }, Ae = (r, i, n) => {
817
- const h = (y(a, r, { _f: {} })._f || {}).ref, f = y(t.errors, r) || {}, { ref: u, message: m, type: A, ...E } = f;
818
- B(t.errors, r, {
819
- ...E,
820
- ...i,
821
- ref: h
822
- }), g.state.next({
823
- name: r,
824
- errors: t.errors,
825
- isValid: !1
826
- }), n && n.shouldFocus && h && h.focus && h.focus();
827
- }, _e = (r, i) => ie(r) ? g.state.subscribe({
828
- next: (n) => "values" in n && r(V(void 0, i), n)
829
- }) : V(r, i, !0), ee = (r) => g.state.subscribe({
830
- next: (i) => {
831
- mr(r.name, i.name, r.exact) && hr(i, r.formState || _, Dt, r.reRenderRoot) && r.callback({
832
- values: { ...l },
833
- ...t,
834
- ...i,
835
- defaultValues: o
836
- });
837
- }
838
- }).unsubscribe, ge = (r) => (d.mount = !0, x = {
839
- ...x,
840
- ...r.formState
841
- }, ee({
842
- ...r,
843
- formState: x
844
- })), ve = (r, i = {}) => {
845
- for (const n of r ? Ve(r) : c.mount)
846
- c.mount.delete(n), c.array.delete(n), i.keepValue || (O(a, n), O(l, n)), !i.keepError && O(t.errors, n), !i.keepDirty && O(t.dirtyFields, n), !i.keepTouched && O(t.touchedFields, n), !i.keepIsValidating && O(t.validatingFields, n), !s.shouldUnregister && !i.keepDefaultValue && O(o, n);
847
- g.state.next({
848
- values: P(l)
849
- }), g.state.next({
850
- ...t,
851
- ...i.keepDirty ? { isDirty: Z() } : {}
852
- }), !i.keepIsValid && p();
853
- }, Ke = ({ disabled: r, name: i }) => {
854
- (J(r) && d.mount || r || c.disabled.has(i)) && (r ? c.disabled.add(i) : c.disabled.delete(i));
855
- }, Be = (r, i = {}) => {
856
- let n = y(a, r);
857
- const h = J(i.disabled) || J(s.disabled);
858
- return B(a, r, {
859
- ...n || {},
860
- _f: {
861
- ...n && n._f ? n._f : { ref: { name: r } },
862
- name: r,
863
- mount: !0,
864
- ...i
865
- }
866
- }), c.mount.add(r), n ? Ke({
867
- disabled: J(i.disabled) ? i.disabled : s.disabled,
868
- name: r
869
- }) : U(r, !0, i.value), {
870
- ...h ? { disabled: i.disabled || s.disabled } : {},
871
- ...s.progressive ? {
872
- required: !!i.required,
873
- min: be(i.min),
874
- max: be(i.max),
875
- minLength: be(i.minLength),
876
- maxLength: be(i.maxLength),
877
- pattern: be(i.pattern)
878
- } : {},
879
- name: r,
880
- onChange: Y,
881
- onBlur: Y,
882
- ref: (f) => {
883
- if (f) {
884
- Be(r, i), n = y(a, r);
885
- const u = L(f.value) && f.querySelectorAll && f.querySelectorAll("input,select,textarea")[0] || f, m = nr(u), A = n._f.refs || [];
886
- if (m ? A.find((E) => E === u) : u === n._f.ref)
887
- return;
888
- B(a, r, {
889
- _f: {
890
- ...n._f,
891
- ...m ? {
892
- refs: [
893
- ...A.filter(Oe),
894
- u,
895
- ...Array.isArray(y(o, r)) ? [{}] : []
896
- ],
897
- ref: { type: u.type, name: r }
898
- } : { ref: u }
899
- }
900
- }), U(r, !1, void 0, u);
901
- } else
902
- n = y(a, r, {}), n._f && (n._f.mount = !1), (s.shouldUnregister || i.shouldUnregister) && !(_t(c.array, r) && d.action) && c.unMount.add(r);
903
- }
904
- };
905
- }, Te = () => s.shouldFocusError && xe(a, oe, c.mount), wt = (r) => {
906
- J(r) && (g.state.next({ disabled: r }), xe(a, (i, n) => {
907
- const h = y(a, n);
908
- h && (i.disabled = h._f.disabled || r, Array.isArray(h._f.refs) && h._f.refs.forEach((f) => {
909
- f.disabled = h._f.disabled || r;
910
- }));
911
- }, 0, !1));
912
- }, je = (r, i) => async (n) => {
913
- let h;
914
- n && (n.preventDefault && n.preventDefault(), n.persist && n.persist());
915
- let f = P(l);
916
- if (g.state.next({
917
- isSubmitting: !0
918
- }), s.resolver) {
919
- const { errors: u, values: m } = await H();
920
- t.errors = u, f = P(m);
921
- } else
922
- await z(a);
923
- if (c.disabled.size)
924
- for (const u of c.disabled)
925
- O(f, u);
926
- if (O(t.errors, "root"), $(t.errors)) {
927
- g.state.next({
928
- errors: {}
929
- });
930
- try {
931
- await r(f, n);
932
- } catch (u) {
933
- h = u;
934
- }
935
- } else
936
- i && await i({ ...t.errors }, n), Te(), setTimeout(Te);
937
- if (g.state.next({
938
- isSubmitted: !0,
939
- isSubmitting: !1,
940
- isSubmitSuccessful: $(t.errors) && !h,
941
- submitCount: t.submitCount + 1,
942
- errors: t.errors
943
- }), h)
944
- throw h;
945
- }, Ct = (r, i = {}) => {
946
- y(a, r) && (L(i.defaultValue) ? W(r, P(y(o, r))) : (W(r, i.defaultValue), B(o, r, P(i.defaultValue))), i.keepTouched || O(t.touchedFields, r), i.keepDirty || (O(t.dirtyFields, r), t.isDirty = i.defaultValue ? Z(r, P(y(o, r))) : Z()), i.keepError || (O(t.errors, r), _.isValid && p()), g.state.next({ ...t }));
947
- }, Ge = (r, i = {}) => {
948
- const n = r ? P(r) : o, h = P(n), f = $(r), u = f ? o : h;
949
- if (i.keepDefaultValues || (o = n), !i.keepValues) {
950
- if (i.keepDirtyValues) {
951
- const m = /* @__PURE__ */ new Set([
952
- ...c.mount,
953
- ...Object.keys(me(o, l))
954
- ]);
955
- for (const A of Array.from(m))
956
- y(t.dirtyFields, A) ? B(u, A, y(l, A)) : W(A, y(u, A));
957
- } else {
958
- if (Pe && L(r))
959
- for (const m of c.mount) {
960
- const A = y(a, m);
961
- if (A && A._f) {
962
- const E = Array.isArray(A._f.refs) ? A._f.refs[0] : A._f.ref;
963
- if (Ce(E)) {
964
- const te = E.closest("form");
965
- if (te) {
966
- te.reset();
967
- break;
968
- }
969
- }
970
- }
971
- }
972
- if (i.keepFieldsRef)
973
- for (const m of c.mount)
974
- W(m, y(u, m));
975
- else
976
- a = {};
977
- }
978
- l = s.shouldUnregister ? i.keepDefaultValues ? P(o) : {} : P(u), g.array.next({
979
- values: { ...u }
980
- }), g.state.next({
981
- values: { ...u }
982
- });
983
- }
984
- c = {
985
- mount: i.keepDirtyValues ? c.mount : /* @__PURE__ */ new Set(),
986
- unMount: /* @__PURE__ */ new Set(),
987
- array: /* @__PURE__ */ new Set(),
988
- disabled: /* @__PURE__ */ new Set(),
989
- watch: /* @__PURE__ */ new Set(),
990
- watchAll: !1,
991
- focus: ""
992
- }, d.mount = !_.isValid || !!i.keepIsValid || !!i.keepDirtyValues, d.watch = !!s.shouldUnregister, g.state.next({
993
- submitCount: i.keepSubmitCount ? t.submitCount : 0,
994
- isDirty: f ? !1 : i.keepDirty ? t.isDirty : !!(i.keepDefaultValues && !le(r, o)),
995
- isSubmitted: i.keepIsSubmitted ? t.isSubmitted : !1,
996
- dirtyFields: f ? {} : i.keepDirtyValues ? i.keepDefaultValues && l ? me(o, l) : t.dirtyFields : i.keepDefaultValues && r ? me(o, r) : i.keepDirty ? t.dirtyFields : {},
997
- touchedFields: i.keepTouched ? t.touchedFields : {},
998
- errors: i.keepErrors ? t.errors : {},
999
- isSubmitSuccessful: i.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
1000
- isSubmitting: !1,
1001
- defaultValues: o
1002
- });
1003
- }, Ye = (r, i) => Ge(ie(r) ? r(l) : r, i), St = (r, i = {}) => {
1004
- const n = y(a, r), h = n && n._f;
1005
- if (h) {
1006
- const f = h.refs ? h.refs[0] : h.ref;
1007
- f.focus && (f.focus(), i.shouldSelect && ie(f.select) && f.select());
1008
- }
1009
- }, Dt = (r) => {
1010
- t = {
1011
- ...t,
1012
- ...r
1013
- };
1014
- }, Je = {
1015
- control: {
1016
- register: Be,
1017
- unregister: ve,
1018
- getFieldState: Fe,
1019
- handleSubmit: je,
1020
- setError: Ae,
1021
- _subscribe: ee,
1022
- _runSchema: H,
1023
- _focusError: Te,
1024
- _getWatch: V,
1025
- _getDirty: Z,
1026
- _setValid: p,
1027
- _setFieldArray: ne,
1028
- _setDisabledField: Ke,
1029
- _setErrors: T,
1030
- _getFieldArray: k,
1031
- _reset: Ge,
1032
- _resetDefaultValues: () => ie(s.defaultValues) && s.defaultValues().then((r) => {
1033
- Ye(r, s.resetOptions), g.state.next({
1034
- isLoading: !1
1035
- });
1036
- }),
1037
- _removeUnmounted: G,
1038
- _disableForm: wt,
1039
- _subjects: g,
1040
- _proxyFormState: _,
1041
- get _fields() {
1042
- return a;
1043
- },
1044
- get _formValues() {
1045
- return l;
1046
- },
1047
- get _state() {
1048
- return d;
1049
- },
1050
- set _state(r) {
1051
- d = r;
1052
- },
1053
- get _defaultValues() {
1054
- return o;
1055
- },
1056
- get _names() {
1057
- return c;
1058
- },
1059
- set _names(r) {
1060
- c = r;
1061
- },
1062
- get _formState() {
1063
- return t;
1064
- },
1065
- get _options() {
1066
- return s;
1067
- },
1068
- set _options(r) {
1069
- s = {
1070
- ...s,
1071
- ...r
1072
- };
1073
- }
1074
- },
1075
- subscribe: ge,
1076
- trigger: ue,
1077
- register: Be,
1078
- handleSubmit: je,
1079
- watch: _e,
1080
- setValue: W,
1081
- getValues: ye,
1082
- reset: Ye,
1083
- resetField: Ct,
1084
- clearErrors: Ee,
1085
- unregister: ve,
1086
- setError: Ae,
1087
- setFocus: St,
1088
- getFieldState: Fe
1089
- };
1090
- return {
1091
- ...Je,
1092
- formControl: Je
1093
- };
1094
- }
1095
- function xr(e = {}) {
1096
- const s = b.useRef(void 0), t = b.useRef(void 0), [a, o] = b.useState({
1097
- isDirty: !1,
1098
- isValidating: !1,
1099
- isLoading: ie(e.defaultValues),
1100
- isSubmitted: !1,
1101
- isSubmitting: !1,
1102
- isSubmitSuccessful: !1,
1103
- isValid: !1,
1104
- submitCount: 0,
1105
- dirtyFields: {},
1106
- touchedFields: {},
1107
- validatingFields: {},
1108
- errors: e.errors || {},
1109
- disabled: e.disabled || !1,
1110
- isReady: !1,
1111
- defaultValues: ie(e.defaultValues) ? void 0 : e.defaultValues
1112
- });
1113
- if (!s.current)
1114
- if (e.formControl)
1115
- s.current = {
1116
- ...e.formControl,
1117
- formState: a
1118
- }, e.defaultValues && !ie(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
1119
- else {
1120
- const { formControl: d, ...c } = Vr(e);
1121
- s.current = {
1122
- ...c,
1123
- formState: a
1124
- };
1125
- }
1126
- const l = s.current.control;
1127
- return l._options = e, He(() => {
1128
- const d = l._subscribe({
1129
- formState: l._proxyFormState,
1130
- callback: () => o({ ...l._formState }),
1131
- reRenderRoot: !0
1132
- });
1133
- return o((c) => ({
1134
- ...c,
1135
- isReady: !0
1136
- })), l._formState.isReady = !0, d;
1137
- }, [l]), b.useEffect(() => l._disableForm(e.disabled), [l, e.disabled]), b.useEffect(() => {
1138
- e.mode && (l._options.mode = e.mode), e.reValidateMode && (l._options.reValidateMode = e.reValidateMode);
1139
- }, [l, e.mode, e.reValidateMode]), b.useEffect(() => {
1140
- e.errors && (l._setErrors(e.errors), l._focusError());
1141
- }, [l, e.errors]), b.useEffect(() => {
1142
- e.shouldUnregister && l._subjects.state.next({
1143
- values: l._getWatch()
1144
- });
1145
- }, [l, e.shouldUnregister]), b.useEffect(() => {
1146
- if (l._proxyFormState.isDirty) {
1147
- const d = l._getDirty();
1148
- d !== a.isDirty && l._subjects.state.next({
1149
- isDirty: d
1150
- });
1151
- }
1152
- }, [l, a.isDirty]), b.useEffect(() => {
1153
- e.values && !le(e.values, t.current) ? (l._reset(e.values, {
1154
- keepFieldsRef: !0,
1155
- ...l._options.resetOptions
1156
- }), t.current = e.values, o((d) => ({ ...d }))) : l._resetDefaultValues();
1157
- }, [l, e.values]), b.useEffect(() => {
1158
- l._state.mount || (l._setValid(), l._state.mount = !0), l._state.watch && (l._state.watch = !1, l._subjects.state.next({ ...l._formState })), l._removeUnmounted();
1159
- }), s.current.formState = vt(a, l), s.current;
1160
- }
1161
- const kr = Nt.bind(I), Fr = "Я принимаю условия Политики обработки и защиты персональных данных, даю согласия на обработку персональных данных", Nr = ({
1162
- isFormOpen: e,
1163
- setIsFormOpen: s,
1164
- isNews: t,
1165
- title: a,
1166
- isEmail: o,
1167
- isPhone: l,
1168
- isTextArea: d,
1169
- telegramLink: c = "https://t.me/stone_developer",
1170
- isRequiredPhone: S = !0,
1171
- isRequiredEmail: D = !1,
1172
- isRequiredPhoneOrEmail: _,
1173
- textAreaPlaceholder: x,
1174
- subTitle: g,
1175
- submitHandler: j,
1176
- modalWidth: q = "442px",
1177
- rowsTextArea: p = 2,
1178
- advCheckBox: M = { text: Fr, isRequired: !0 },
1179
- isAdvCheckBox: ne,
1180
- addTitleClassName: v,
1181
- createPortalObj: T,
1182
- telegramClickHandler: U = () => null,
1183
- blurHandler: w,
1184
- handlerButton: X,
1185
- block_name: H,
1186
- emitCheckBox: re,
1187
- emitAdvCheckBox: z
1188
- }) => {
1189
- const {
1190
- register: G,
1191
- handleSubmit: Z,
1192
- reset: V,
1193
- control: k,
1194
- watch: C,
1195
- formState: { errors: F }
1196
- } = xr(), W = !!C("email"), Y = C("personalCheckBox"), oe = C("advCheckBox");
1197
- Ze(() => {
1198
- typeof Y < "u" && re && re();
1199
- }, [re, Y]), Ze(() => {
1200
- typeof oe < "u" && z && z();
1201
- }, [z, oe]);
1202
- const { isMobile: ue, currentClientWidth: ye } = Ut(), Fe = C("personalCheckBox"), Ee = C("advCheckBox"), Ae = (ee) => {
1203
- j(ee), V();
1204
- }, _e = (ee, { action_element_status: ge, action_element: ve }) => {
1205
- w && w({
1206
- e: ee,
1207
- analyticParams: { action_element: ve, action_element_status: ge, block_name: H }
1208
- });
1209
- };
1210
- return ye ? /* @__PURE__ */ R(
1211
- Pt,
1212
- {
1213
- additionalClass: I.modal,
1214
- additionalClassModalBody: I.modalBody,
1215
- createPortalObj: T,
1216
- isOpen: e,
1217
- isTransparentBack: !0,
1218
- emitIsOpen: () => s(!1),
1219
- opacity: 0.7,
1220
- children: /* @__PURE__ */ ce(
1221
- "div",
1222
- {
1223
- className: I.root,
1224
- style: { width: ue ? "100%" : q },
1225
- "data-testid": "modal_window",
1226
- children: [
1227
- /* @__PURE__ */ R(
1228
- "div",
1229
- {
1230
- className: kr(I.title, v),
1231
- dangerouslySetInnerHTML: { __html: a ?? "Оставить обращение" }
1232
- }
1233
- ),
1234
- t && /* @__PURE__ */ ce("div", { className: I.telegramWrapper, children: [
1235
- /* @__PURE__ */ R(
1236
- "a",
1237
- {
1238
- className: I.telegramLink,
1239
- href: c,
1240
- target: "_blank",
1241
- "data-testid": "modal_telegram_link",
1242
- children: /* @__PURE__ */ ce(
1243
- "div",
1244
- {
1245
- className: I.telegram,
1246
- onClick: U,
1247
- children: [
1248
- /* @__PURE__ */ R("div", { children: "Подписаться в Telegram" }),
1249
- /* @__PURE__ */ R(et, { name: "telegram" })
1250
- ]
1251
- }
1252
- )
1253
- }
1254
- ),
1255
- /* @__PURE__ */ R("div", { className: I.orText, children: "или" })
1256
- ] }),
1257
- !t && /* @__PURE__ */ R(
1258
- "div",
1259
- {
1260
- className: I.description,
1261
- dangerouslySetInnerHTML: {
1262
- __html: g && !t ? "Оставьте номер телефона для получения консультации" : `${/* @__PURE__ */ R("div", { children: "привет" })}`
1263
- }
1264
- }
1265
- ),
1266
- /* @__PURE__ */ ce("form", { onSubmit: Z(Ae), children: [
1267
- /* @__PURE__ */ ce(It, { className: I.inputWrapper, children: [
1268
- /* @__PURE__ */ R(
1269
- Re,
1270
- {
1271
- width: "full",
1272
- size_s: "large",
1273
- variant: "light",
1274
- placeholder: "Введите имя",
1275
- "data-testid": "modal_name",
1276
- ...G("name", { required: !0, pattern: Lt }),
1277
- onBlur: (ee) => _e(ee, {
1278
- action_element_status: F.name ? "error" : "success",
1279
- action_element: `input_${H}_name`
1280
- }),
1281
- error: !!F.name
1282
- }
1283
- ),
1284
- l && /* @__PURE__ */ R(
1285
- ar,
1286
- {
1287
- name: "phone",
1288
- control: k,
1289
- rules: {
1290
- required: D || S || _ && !W,
1291
- pattern: { value: Mt, message: "" }
1292
- },
1293
- defaultValue: "",
1294
- render: ({ field: ee }) => /* @__PURE__ */ R(
1295
- Re,
1296
- {
1297
- inputMode: "numeric",
1298
- isPhoneIMask: !0,
1299
- ...ee,
1300
- width: "full",
1301
- "data-testid": "phone_modal",
1302
- type: "tel",
1303
- error: !!F.phone,
1304
- size_s: "large",
1305
- variant: "light",
1306
- onBlur: (ge) => _e(ge, {
1307
- action_element_status: F.phone ? "error" : "success",
1308
- action_element: `input_${H}_phone`
1309
- })
1310
- }
1311
- )
1312
- }
1313
- ),
1314
- o && /* @__PURE__ */ R(
1315
- Re,
1316
- {
1317
- width: "full",
1318
- size_s: "large",
1319
- variant: "light",
1320
- placeholder: "Введите email",
1321
- "data-testid": "modal_email",
1322
- ...G("email", {
1323
- required: D || _ && !W,
1324
- pattern: Rt
1325
- }),
1326
- error: !!F.email,
1327
- onBlur: (ee) => _e(ee, {
1328
- action_element_status: F.email ? "error" : "success",
1329
- action_element: `input_${H}_email`
1330
- })
1331
- }
1332
- ),
1333
- d && /* @__PURE__ */ R(
1334
- Ot,
1335
- {
1336
- "data-testid": "modal_textarea",
1337
- placeholder: x,
1338
- rows: p,
1339
- width: "full",
1340
- ...G("textarea")
1341
- }
1342
- ),
1343
- M && !t && ne && /* @__PURE__ */ R(
1344
- tt,
1345
- {
1346
- "data-testid": "modal_advCheckBox",
1347
- isChecked: Ee,
1348
- error: !!F.advCheckBox,
1349
- text: M.text,
1350
- ...G("advCheckBox", { required: M?.isRequired })
1351
- }
1352
- ),
1353
- /* @__PURE__ */ ce(
1354
- tt,
1355
- {
1356
- "data-testid": "modal_personalCheckBox",
1357
- isChecked: Fe,
1358
- error: !!F.personalCheckBox,
1359
- ...G("personalCheckBox", { required: !t }),
1360
- children: [
1361
- t && /* @__PURE__ */ ce("div", { className: I.checkboxText, children: [
1362
- "Согласен(-на)",
1363
- " ",
1364
- /* @__PURE__ */ R(
1365
- "a",
1366
- {
1367
- className: I.linkPolicy,
1368
- href: "/documents/soglasie-na-rassylki",
1369
- children: "получать новости, информацию по сделке и рекламу"
1370
- }
1371
- ),
1372
- " ",
1373
- "от Stone"
1374
- ] }),
1375
- !t && /* @__PURE__ */ ce("div", { className: I.checkboxText, children: [
1376
- "Я принимаю условия",
1377
- " ",
1378
- /* @__PURE__ */ R("a", { className: I.linkPolicy, href: "/documents/politika-konfidenczialnosti", children: "Политики обработки и защиты персональных данных" }),
1379
- ", даю",
1380
- " ",
1381
- /* @__PURE__ */ R("a", { className: I.linkPolicy, href: "/documents/docs", children: "согласие на обработку персональных данных" })
1382
- ] })
1383
- ]
1384
- }
1385
- ),
1386
- /* @__PURE__ */ R(
1387
- rt,
1388
- {
1389
- "data-testid": "modal_submit",
1390
- variant: "blue",
1391
- width: "full",
1392
- type: "submit",
1393
- size: "large",
1394
- as: "button",
1395
- additionalClass: I.modalBtn,
1396
- onClick: () => {
1397
- X && X();
1398
- },
1399
- disabled: !!F.name || !!F.phone && S || !!F.email && D || !!F.advCheckBox && M?.isRequired || !!F.personalCheckBox && !t,
1400
- children: "Отправить запрос"
1401
- }
1402
- )
1403
- ] }),
1404
- /* @__PURE__ */ R(
1405
- rt,
1406
- {
1407
- additionalClass: I.btn,
1408
- onClick: () => s(!1),
1409
- as: "button",
1410
- variant: "gray",
1411
- type: "button",
1412
- size: "small",
1413
- children: /* @__PURE__ */ R(
1414
- et,
1415
- {
1416
- name: "close",
1417
- size: "16",
1418
- color: "#141416"
1419
- }
1420
- )
1421
- }
1422
- )
1423
- ] })
1424
- ]
1425
- }
1426
- )
1427
- }
1428
- ) : null;
1429
- };
1
+ import "react/jsx-runtime";
2
+ import { M as A } from "../../../FilterWithSave-BWA01WwU.js";
3
+ import "../../Modal/ui/Modal.js";
4
+ import "../../Flex/ui/Flex.js";
5
+ import "../../Input/ui/Input.js";
6
+ import "../../Button/ui/Button.js";
7
+ import "../../NewIcon/ui/NewIcon.js";
8
+ import "../utils/reg.js";
9
+ import "../../CheckBox/CheckBox.js";
10
+ import "../../TextArea/TextArea.js";
11
+ import "../../../index-rKuIKazb.js";
12
+ import "../../mobileButton/ui/MobileButton.js";
13
+ import "../../DestinationTab/ui/DestinationTab.js";
14
+ import "../../RoundButton/ui/RoundButton.js";
15
+ import "../../Tag/ui/Tag.js";
16
+ import "../../Switcher/ui/Switcher.js";
17
+ import "../../Text/ui/Text.js";
18
+ import "../../GroupedInput/ui/GroupedInputs.js";
19
+ import "../../MetroTag/ui/MetroTag.js";
20
+ import "../../Select/ui/Select.js";
21
+ import "../../../shared/useClientWidth.js";
22
+ import "../../SliderNavigation/ui/SliderNavigation.js";
23
+ import "../../LotCardSkeleton/ui/LotCardSkeleton.js";
24
+ import "../../TabSelect/ui/TabSelect.js";
25
+ import "../../CheckBoxNew/CheckBoxNew.js";
26
+ import "../../CheckboxSelect/ui/CheckboxSelect.js";
27
+ import "react";
1430
28
  export {
1431
- Nr as ModalForm
29
+ A as ModalForm
1432
30
  };