@lanaco/lnc-react-ui 4.0.112 → 4.0.113
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/Accordion.cjs +1 -1
- package/dist/Accordion.js +1 -1
- package/dist/AccordionDetails.cjs +1 -1
- package/dist/AccordionDetails.js +1 -1
- package/dist/AccordionSummary.cjs +1 -1
- package/dist/AccordionSummary.js +1 -1
- package/dist/ActionsToolbar.cjs +1 -1
- package/dist/ActionsToolbar.js +1 -1
- package/dist/Alert.cjs +1 -1
- package/dist/Alert.js +1 -1
- package/dist/Avatar.cjs +1 -1
- package/dist/Avatar.js +1 -1
- package/dist/Badge.cjs +1 -1
- package/dist/Badge.js +1 -1
- package/dist/BannerSectionCarousel.cjs +1 -1
- package/dist/BannerSectionCarousel.js +3 -3
- package/dist/BlogCardsSponsoredSection.cjs +25 -14
- package/dist/BlogCardsSponsoredSection.js +58 -47
- package/dist/BlogListSection.cjs +37 -9
- package/dist/BlogListSection.js +127 -70
- package/dist/BlogsSectionDetailed.cjs +7 -2
- package/dist/BlogsSectionDetailed.js +6 -1
- package/dist/BlogsSectionSimpleCentered.cjs +3 -2
- package/dist/BlogsSectionSimpleCentered.js +1 -0
- package/dist/BlogsSectionWithFilters.cjs +1 -1
- package/dist/BlogsSectionWithFilters.js +1 -1
- package/dist/BrandHitsSection.cjs +11 -11
- package/dist/BrandHitsSection.js +40 -38
- package/dist/Breadcrumbs.cjs +1 -1
- package/dist/Breadcrumbs.js +1 -1
- package/dist/Button.cjs +1 -1
- package/dist/Button.js +2 -2
- package/dist/ButtonGroup.cjs +1 -1
- package/dist/ButtonGroup.js +1 -1
- package/dist/CalorieCalculatorSection.cjs +1 -1
- package/dist/CalorieCalculatorSection.js +1 -1
- package/dist/CheckBoxInput.cjs +1 -1
- package/dist/CheckBoxInput.js +1 -1
- package/dist/Chip.cjs +1 -1
- package/dist/Chip.js +1 -1
- package/dist/ColorInput.cjs +1 -1
- package/dist/ColorInput.js +2 -2
- package/dist/ConfirmationForm.cjs +1 -1
- package/dist/ConfirmationForm.js +1 -1
- package/dist/ContactSection.cjs +303 -0
- package/dist/ContactSection.js +1614 -0
- package/dist/Content.cjs +1 -1
- package/dist/Content.js +1 -1
- package/dist/{CustomStyles-DtKDPOdk.cjs → CustomStyles-D3JePSNK.cjs} +1 -1
- package/dist/{CustomStyles-Dd8IsVV6.js → CustomStyles-DpKzWczC.js} +2 -2
- package/dist/DailyMotion-CUHIuSln.js +136 -0
- package/dist/DailyMotion-D46sLmkS.cjs +1 -0
- package/dist/DataView.cjs +1 -1
- package/dist/DataView.js +1 -1
- package/dist/DateInput.cjs +4 -4
- package/dist/DateInput.js +496 -552
- package/dist/DecimalInput.cjs +1 -1
- package/dist/DecimalInput.js +2 -2
- package/dist/DecimalInputV2.cjs +1 -1
- package/dist/DecimalInputV2.js +1 -1
- package/dist/DetailedProductsSection.cjs +1 -1
- package/dist/DetailedProductsSection.js +1 -1
- package/dist/DetailsView.cjs +1 -1
- package/dist/DetailsView.js +1 -1
- package/dist/DoubleRangeSlider.cjs +1 -1
- package/dist/DoubleRangeSlider.js +1 -1
- package/dist/DragAndDropFile.cjs +1 -1
- package/dist/DragAndDropFile.js +1 -1
- package/dist/DragDropFiles.cjs +1 -1
- package/dist/DragDropFiles.js +1 -1
- package/dist/Drawer.cjs +1 -1
- package/dist/Drawer.js +2 -2
- package/dist/Dropdown.cjs +1 -1
- package/dist/Dropdown.js +5 -5
- package/dist/DropdownItem.cjs +1 -1
- package/dist/DropdownItem.js +1 -1
- package/dist/DropdownLookup.cjs +1 -1
- package/dist/DropdownLookup.js +4 -4
- package/dist/DropdownMenu.cjs +1 -1
- package/dist/DropdownMenu.js +1 -1
- package/dist/EditableTable.cjs +1 -1
- package/dist/EditableTable.js +1 -1
- package/dist/Facebook-R53Rry9l.cjs +1 -0
- package/dist/Facebook-aEQQxj-r.js +121 -0
- package/dist/FaqSection.cjs +219 -0
- package/dist/FaqSection.js +481 -0
- package/dist/FeedbackSection.cjs +1 -1
- package/dist/FeedbackSection.js +1 -1
- package/dist/FileInput.cjs +1 -1
- package/dist/FileInput.js +1 -1
- package/dist/FilePlayer-9FdL9kM0.js +202 -0
- package/dist/FilePlayer-D9up8eWZ.cjs +1 -0
- package/dist/FlexBox.cjs +1 -1
- package/dist/FlexBox.js +1 -1
- package/dist/FlexGrid.cjs +1 -1
- package/dist/FlexGrid.js +1 -1
- package/dist/FlexGridItem.cjs +1 -1
- package/dist/FlexGridItem.js +1 -1
- package/dist/Footer.cjs +1 -1
- package/dist/Footer.js +1 -1
- package/dist/FormField.cjs +1 -1
- package/dist/FormField.js +1 -1
- package/dist/FormView.cjs +1 -1
- package/dist/FormView.js +1 -1
- package/dist/Grid.cjs +1 -1
- package/dist/Grid.js +1 -1
- package/dist/GridItem.cjs +1 -1
- package/dist/GridItem.js +1 -1
- package/dist/Header.cjs +1 -1
- package/dist/Header.js +1 -1
- package/dist/HelpBannerSection.cjs +62 -0
- package/dist/HelpBannerSection.js +81 -0
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.js +1 -1
- package/dist/IconButton.cjs +1 -1
- package/dist/IconButton.js +1 -1
- package/dist/Kaltura-C170sgeD.cjs +1 -0
- package/dist/Kaltura-Dziqci9-.js +121 -0
- package/dist/Kanban.cjs +1 -1
- package/dist/Kanban.js +5 -5
- package/dist/KanbanActionsToolbar.cjs +1 -1
- package/dist/KanbanActionsToolbar.js +1 -1
- package/dist/{KanbanCard-CXRQQu4S.cjs → KanbanCard-CP60mpJO.cjs} +1 -1
- package/dist/{KanbanCard-CIscpYlR.js → KanbanCard-Crf-cTxA.js} +2 -2
- package/dist/KanbanCard.cjs +1 -1
- package/dist/KanbanCard.js +2 -2
- package/dist/KanbanFooter.cjs +1 -1
- package/dist/KanbanFooter.js +1 -1
- package/dist/KanbanHeader.cjs +1 -1
- package/dist/KanbanHeader.js +1 -1
- package/dist/KanbanView.cjs +1 -1
- package/dist/KanbanView.js +2 -2
- package/dist/Link.cjs +1 -1
- package/dist/Link.js +1 -1
- package/dist/LocationSearchSection.cjs +1 -1
- package/dist/LocationSearchSection.js +1 -1
- package/dist/MenuItem.cjs +1 -1
- package/dist/MenuItem.js +1 -1
- package/dist/Mixcloud-Cfn28kqf.js +113 -0
- package/dist/Mixcloud-Towpm_ct.cjs +1 -0
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.js +2 -2
- package/dist/MultiSelectDropdown.cjs +1 -1
- package/dist/MultiSelectDropdown.js +3 -3
- package/dist/MultiSelectDropdownLookup.cjs +1 -1
- package/dist/MultiSelectDropdownLookup.js +3 -3
- package/dist/Mux-D0MPDKkM.js +165 -0
- package/dist/Mux-yqNOmuss.cjs +1 -0
- package/dist/NestedDropdownItem.cjs +1 -1
- package/dist/NestedDropdownItem.js +1 -1
- package/dist/NestedMenuItem.cjs +1 -1
- package/dist/NestedMenuItem.js +1 -1
- package/dist/Notification.cjs +1 -1
- package/dist/Notification.js +1 -1
- package/dist/NotificationContainer.cjs +1 -1
- package/dist/NotificationContainer.js +2 -2
- package/dist/NotificationMessage.cjs +1 -1
- package/dist/NotificationMessage.js +1 -1
- package/dist/NumberInput.cjs +1 -1
- package/dist/NumberInput.js +2 -2
- package/dist/PageLayout.cjs +1 -1
- package/dist/PageLayout.js +1 -1
- package/dist/Pagination.cjs +1 -1
- package/dist/Pagination.js +1 -1
- package/dist/PasswordInput.cjs +1 -1
- package/dist/PasswordInput.js +2 -2
- package/dist/Popover.cjs +1 -1
- package/dist/Popover.js +1 -1
- package/dist/PopoverContent.cjs +1 -1
- package/dist/PopoverContent.js +2 -2
- package/dist/PopoverDescription.cjs +1 -1
- package/dist/PopoverDescription.js +1 -1
- package/dist/PopoverHeading.cjs +1 -1
- package/dist/PopoverHeading.js +1 -1
- package/dist/PopoverTrigger.cjs +1 -1
- package/dist/PopoverTrigger.js +2 -2
- package/dist/Preview-B8HyPnfR.cjs +1 -0
- package/dist/Preview-CO6WSP5f.js +127 -0
- package/dist/ProgressBar.cjs +1 -1
- package/dist/ProgressBar.js +1 -1
- package/dist/QuattroCardsSection.cjs +1 -1
- package/dist/QuattroCardsSection.js +1 -1
- package/dist/RadioGroup.cjs +1 -1
- package/dist/RadioGroup.js +1 -1
- package/dist/RadioInput.cjs +1 -1
- package/dist/RadioInput.js +1 -1
- package/dist/RangeSlider.cjs +1 -1
- package/dist/RangeSlider.js +1 -1
- package/dist/ReviewsSection.cjs +1 -1
- package/dist/ReviewsSection.js +1 -1
- package/dist/SalesCampaignsSection.cjs +1 -1
- package/dist/SalesCampaignsSection.js +1 -1
- package/dist/SearchBar.cjs +1 -1
- package/dist/SearchBar.js +3 -3
- package/dist/SearchSection-BUD-hnQA.cjs +161 -0
- package/dist/SearchSection-xe0nvARV.js +1214 -0
- package/dist/SearchSection.cjs +1 -0
- package/dist/SearchSection.js +9 -0
- package/dist/Separator.cjs +1 -1
- package/dist/Separator.js +1 -1
- package/dist/Sidebar.cjs +1 -1
- package/dist/Sidebar.js +1 -1
- package/dist/SoundCloud-D85Da68L.js +123 -0
- package/dist/SoundCloud-YZlcPffr.cjs +1 -0
- package/dist/Spinner.cjs +1 -1
- package/dist/Spinner.js +2 -2
- package/dist/StatsSection.cjs +117 -0
- package/dist/StatsSection.js +154 -0
- package/dist/Streamable-CJQf8evZ.cjs +1 -0
- package/dist/Streamable-Zj4FOeBP.js +115 -0
- package/dist/Surface.cjs +1 -1
- package/dist/Surface.js +1 -1
- package/dist/SwipeableDrawer.cjs +1 -1
- package/dist/SwipeableDrawer.js +1 -1
- package/dist/TabItem.cjs +1 -1
- package/dist/TabItem.js +1 -1
- package/dist/Table.cjs +1 -1
- package/dist/Table.js +3 -3
- package/dist/TableView.cjs +1 -1
- package/dist/TableView.js +1 -1
- package/dist/Tabs.cjs +1 -1
- package/dist/Tabs.js +1 -1
- package/dist/TextAreaInput.cjs +1 -1
- package/dist/TextAreaInput.js +2 -2
- package/dist/TextInput.cjs +1 -1
- package/dist/TextInput.js +2 -2
- package/dist/ThemeProvider.cjs +1 -1
- package/dist/ThemeProvider.js +2 -2
- package/dist/TimeInput.cjs +1 -1
- package/dist/TimeInput.js +2 -2
- package/dist/Toggle.cjs +1 -1
- package/dist/Toggle.js +1 -1
- package/dist/TreeMenu.cjs +1 -1
- package/dist/TreeMenu.js +1 -1
- package/dist/TreeMenuSeparator.cjs +1 -1
- package/dist/TreeMenuSeparator.js +1 -1
- package/dist/Twitch-Ba2O5gTX.cjs +1 -0
- package/dist/Twitch-DC97YrR8.js +117 -0
- package/dist/UploadedFile.cjs +1 -1
- package/dist/UploadedFile.js +1 -1
- package/dist/Vidyard-BdNB5Wka.cjs +1 -0
- package/dist/Vidyard-D9vYqvNv.js +113 -0
- package/dist/Vimeo-23LnW4uS.js +146 -0
- package/dist/Vimeo-DatJiKS5.cjs +1 -0
- package/dist/Wistia-D--UDN6c.cjs +1 -0
- package/dist/Wistia-d2TQ3m-s.js +124 -0
- package/dist/YouTube-BEkcZxN7.cjs +1 -0
- package/dist/YouTube-x5-hc3s6.js +176 -0
- package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
- package/dist/_commonjsHelpers-DwTZ_eVU.cjs +1 -0
- package/dist/{emotion-react.browser.esm-1R69UXoj.cjs → emotion-react.browser.esm-Cvnp-zmB.cjs} +1 -1
- package/dist/{emotion-react.browser.esm-C6iWxXPG.js → emotion-react.browser.esm-DUVZ5oEL.js} +1 -1
- package/dist/{floating-ui.react.esm-h3qa3pb9.js → floating-ui.react.esm-CfpRzwmn.js} +1 -1
- package/dist/{floating-ui.react.esm-Bb1ww976.cjs → floating-ui.react.esm-CiYofNnh.cjs} +1 -1
- package/dist/{hoist-non-react-statics.cjs-Dr-ytKVG.cjs → hoist-non-react-statics.cjs-DGqlkKoS.cjs} +1 -1
- package/dist/{hoist-non-react-statics.cjs-CAHiRNzQ.js → hoist-non-react-statics.cjs-NQME298B.js} +1 -1
- package/dist/{index-EeoArxOx.cjs → index-41nUb2kP.cjs} +1 -1
- package/dist/{index-BlxaTV-D.js → index-6RFrSPs_.js} +1 -1
- package/dist/{index-64mXPFBC.js → index-B1vKwsDE.js} +1 -1
- package/dist/{index-Bq3leL2e.js → index-BXrmgzsU.js} +1 -1
- package/dist/{index-gY9e_8LL.cjs → index-BZnmT78f.cjs} +1 -1
- package/dist/{index-CQLF61YV.js → index-BgRyIsRu.js} +1 -1
- package/dist/{index-BPVoEhTF.cjs → index-BpbMKBf_.cjs} +1 -1
- package/dist/index-CDGmG-qk.cjs +1 -0
- package/dist/{index-S5Cd7WrG.js → index-CblbdqjE.js} +1 -1
- package/dist/{index-DaiUAQVF.cjs → index-Cp66dWMi.cjs} +1 -1
- package/dist/{index-DAOBjHnD.cjs → index-DA7SIHV1.cjs} +1 -1
- package/dist/{index-C1DkD2ug.cjs → index-DCFJmN23.cjs} +1 -1
- package/dist/{index-CkWvbrVT.js → index-Dt62UGku.js} +1 -1
- package/dist/index-wlx30R-h.js +62 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +60 -50
- package/dist/{react-toastify.esm--2awuizG.js → react-toastify.esm-BLQznunb.js} +1 -1
- package/dist/{react-toastify.esm-Dq1k28O7.cjs → react-toastify.esm-BoMuFZcq.cjs} +1 -1
- package/dist/{styled-components.browser.esm-CMTEDJ_5.cjs → styled-components.browser.esm-CvykQBGY.cjs} +1 -1
- package/dist/{styled-components.browser.esm-C9FYANiy.js → styled-components.browser.esm-D-n22PJk.js} +1 -1
- package/dist/usePopover.cjs +1 -1
- package/dist/usePopover.js +1 -1
- package/package.json +8 -2
- package/vite.config.js +14 -0
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +0 -1
- package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
|
@@ -0,0 +1,1614 @@
|
|
|
1
|
+
import { jsxs as K, jsx as A } from "react/jsx-runtime";
|
|
2
|
+
import * as Je from "react";
|
|
3
|
+
import F, { forwardRef as Lt } from "react";
|
|
4
|
+
import { P } from "./index-CblbdqjE.js";
|
|
5
|
+
import Ot from "./CheckBoxInput.js";
|
|
6
|
+
import Te from "./TextInput.js";
|
|
7
|
+
import Rt from "./TextAreaInput.js";
|
|
8
|
+
import Qe from "./Icon.js";
|
|
9
|
+
import Mt from "./Button.js";
|
|
10
|
+
import { s as Ut } from "./emotion-styled.browser.esm-BNN1dTl3.js";
|
|
11
|
+
import { M as It } from "./consts-BuFChS64.js";
|
|
12
|
+
var _e = (e) => e.type === "checkbox", oe = (e) => e instanceof Date, z = (e) => e == null;
|
|
13
|
+
const ct = (e) => typeof e == "object";
|
|
14
|
+
var L = (e) => !z(e) && !Array.isArray(e) && ct(e) && !oe(e), ft = (e) => L(e) && e.target ? _e(e.target) ? e.target.checked : e.target.value : e, Pt = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, yt = (e, s) => e.has(Pt(s)), Bt = (e) => {
|
|
15
|
+
const s = e.constructor && e.constructor.prototype;
|
|
16
|
+
return L(s) && s.hasOwnProperty("isPrototypeOf");
|
|
17
|
+
}, Re = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
18
|
+
function U(e) {
|
|
19
|
+
let s;
|
|
20
|
+
const t = Array.isArray(e), a = typeof FileList < "u" ? e instanceof FileList : !1;
|
|
21
|
+
if (e instanceof Date)
|
|
22
|
+
s = new Date(e);
|
|
23
|
+
else if (e instanceof Set)
|
|
24
|
+
s = new Set(e);
|
|
25
|
+
else if (!(Re && (e instanceof Blob || a)) && (t || L(e)))
|
|
26
|
+
if (s = t ? [] : {}, !t && !Bt(e))
|
|
27
|
+
s = e;
|
|
28
|
+
else
|
|
29
|
+
for (const l in e)
|
|
30
|
+
e.hasOwnProperty(l) && (s[l] = U(e[l]));
|
|
31
|
+
else
|
|
32
|
+
return e;
|
|
33
|
+
return s;
|
|
34
|
+
}
|
|
35
|
+
var Ae = (e) => /^\w*$/.test(e), C = (e) => e === void 0, Me = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Ue = (e) => Me(e.replace(/["|']|\]/g, "").split(/\.|\[/)), y = (e, s, t) => {
|
|
36
|
+
if (!s || !L(e))
|
|
37
|
+
return t;
|
|
38
|
+
const a = (Ae(s) ? [s] : Ue(s)).reduce((l, n) => z(l) ? l : l[n], e);
|
|
39
|
+
return C(a) || a === e ? C(e[s]) ? t : e[s] : a;
|
|
40
|
+
}, $ = (e) => typeof e == "boolean", k = (e, s, t) => {
|
|
41
|
+
let a = -1;
|
|
42
|
+
const l = Ae(s) ? [s] : Ue(s), n = l.length, d = n - 1;
|
|
43
|
+
for (; ++a < n; ) {
|
|
44
|
+
const c = l[a];
|
|
45
|
+
let v = t;
|
|
46
|
+
if (a !== d) {
|
|
47
|
+
const O = e[c];
|
|
48
|
+
v = L(O) || Array.isArray(O) ? O : isNaN(+l[a + 1]) ? {} : [];
|
|
49
|
+
}
|
|
50
|
+
if (c === "__proto__" || c === "constructor" || c === "prototype")
|
|
51
|
+
return;
|
|
52
|
+
e[c] = v, e = e[c];
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const Ve = {
|
|
56
|
+
BLUR: "blur",
|
|
57
|
+
FOCUS_OUT: "focusout",
|
|
58
|
+
CHANGE: "change"
|
|
59
|
+
}, Y = {
|
|
60
|
+
onBlur: "onBlur",
|
|
61
|
+
onChange: "onChange",
|
|
62
|
+
onSubmit: "onSubmit",
|
|
63
|
+
onTouched: "onTouched",
|
|
64
|
+
all: "all"
|
|
65
|
+
}, re = {
|
|
66
|
+
max: "max",
|
|
67
|
+
min: "min",
|
|
68
|
+
maxLength: "maxLength",
|
|
69
|
+
minLength: "minLength",
|
|
70
|
+
pattern: "pattern",
|
|
71
|
+
required: "required",
|
|
72
|
+
validate: "validate"
|
|
73
|
+
}, mt = F.createContext(null);
|
|
74
|
+
mt.displayName = "HookFormContext";
|
|
75
|
+
const Ie = () => F.useContext(mt);
|
|
76
|
+
var gt = (e, s, t, a = !0) => {
|
|
77
|
+
const l = {
|
|
78
|
+
defaultValues: s._defaultValues
|
|
79
|
+
};
|
|
80
|
+
for (const n in e)
|
|
81
|
+
Object.defineProperty(l, n, {
|
|
82
|
+
get: () => {
|
|
83
|
+
const d = n;
|
|
84
|
+
return s._proxyFormState[d] !== Y.all && (s._proxyFormState[d] = !a || Y.all), t && (t[d] = !0), e[d];
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
return l;
|
|
88
|
+
};
|
|
89
|
+
const Pe = typeof window < "u" ? Je.useLayoutEffect : Je.useEffect;
|
|
90
|
+
function zt(e) {
|
|
91
|
+
const s = Ie(), { control: t = s.control, disabled: a, name: l, exact: n } = e || {}, [d, c] = F.useState(t._formState), v = F.useRef({
|
|
92
|
+
isDirty: !1,
|
|
93
|
+
isLoading: !1,
|
|
94
|
+
dirtyFields: !1,
|
|
95
|
+
touchedFields: !1,
|
|
96
|
+
validatingFields: !1,
|
|
97
|
+
isValidating: !1,
|
|
98
|
+
isValid: !1,
|
|
99
|
+
errors: !1
|
|
100
|
+
});
|
|
101
|
+
return Pe(() => t._subscribe({
|
|
102
|
+
name: l,
|
|
103
|
+
formState: v.current,
|
|
104
|
+
exact: n,
|
|
105
|
+
callback: (O) => {
|
|
106
|
+
!a && c({
|
|
107
|
+
...t._formState,
|
|
108
|
+
...O
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}), [l, a, n]), F.useEffect(() => {
|
|
112
|
+
v.current.isValid && t._setValid(!0);
|
|
113
|
+
}, [t]), F.useMemo(() => gt(d, t, v.current, !1), [d, t]);
|
|
114
|
+
}
|
|
115
|
+
var te = (e) => typeof e == "string", ht = (e, s, t, a, l) => te(e) ? (a && s.watch.add(e), y(t, e, l)) : Array.isArray(e) ? e.map((n) => (a && s.watch.add(n), y(t, n))) : (a && (s.watchAll = !0), t);
|
|
116
|
+
function Wt(e) {
|
|
117
|
+
const s = Ie(), { control: t = s.control, name: a, defaultValue: l, disabled: n, exact: d } = e || {}, c = F.useRef(l), [v, O] = F.useState(t._getWatch(a, c.current));
|
|
118
|
+
return Pe(() => t._subscribe({
|
|
119
|
+
name: a,
|
|
120
|
+
formState: {
|
|
121
|
+
values: !0
|
|
122
|
+
},
|
|
123
|
+
exact: d,
|
|
124
|
+
callback: (w) => !n && O(ht(a, t._names, w.values || t._formValues, !1, c.current))
|
|
125
|
+
}), [a, t, n, d]), F.useEffect(() => t._removeUnmounted()), v;
|
|
126
|
+
}
|
|
127
|
+
function qt(e) {
|
|
128
|
+
const s = Ie(), { name: t, disabled: a, control: l = s.control, shouldUnregister: n } = e, d = yt(l._names.array, t), c = Wt({
|
|
129
|
+
control: l,
|
|
130
|
+
name: t,
|
|
131
|
+
defaultValue: y(l._formValues, t, y(l._defaultValues, t, e.defaultValue)),
|
|
132
|
+
exact: !0
|
|
133
|
+
}), v = zt({
|
|
134
|
+
control: l,
|
|
135
|
+
name: t,
|
|
136
|
+
exact: !0
|
|
137
|
+
}), O = F.useRef(e), w = F.useRef(l.register(t, {
|
|
138
|
+
...e.rules,
|
|
139
|
+
value: c,
|
|
140
|
+
...$(e.disabled) ? { disabled: e.disabled } : {}
|
|
141
|
+
})), S = F.useMemo(() => Object.defineProperties({}, {
|
|
142
|
+
invalid: {
|
|
143
|
+
enumerable: !0,
|
|
144
|
+
get: () => !!y(v.errors, t)
|
|
145
|
+
},
|
|
146
|
+
isDirty: {
|
|
147
|
+
enumerable: !0,
|
|
148
|
+
get: () => !!y(v.dirtyFields, t)
|
|
149
|
+
},
|
|
150
|
+
isTouched: {
|
|
151
|
+
enumerable: !0,
|
|
152
|
+
get: () => !!y(v.touchedFields, t)
|
|
153
|
+
},
|
|
154
|
+
isValidating: {
|
|
155
|
+
enumerable: !0,
|
|
156
|
+
get: () => !!y(v.validatingFields, t)
|
|
157
|
+
},
|
|
158
|
+
error: {
|
|
159
|
+
enumerable: !0,
|
|
160
|
+
get: () => y(v.errors, t)
|
|
161
|
+
}
|
|
162
|
+
}), [v, t]), h = F.useCallback((N) => w.current.onChange({
|
|
163
|
+
target: {
|
|
164
|
+
value: ft(N),
|
|
165
|
+
name: t
|
|
166
|
+
},
|
|
167
|
+
type: Ve.CHANGE
|
|
168
|
+
}), [t]), J = F.useCallback(() => w.current.onBlur({
|
|
169
|
+
target: {
|
|
170
|
+
value: y(l._formValues, t),
|
|
171
|
+
name: t
|
|
172
|
+
},
|
|
173
|
+
type: Ve.BLUR
|
|
174
|
+
}), [t, l._formValues]), H = F.useCallback((N) => {
|
|
175
|
+
const G = y(l._fields, t);
|
|
176
|
+
G && N && (G._f.ref = {
|
|
177
|
+
focus: () => N.focus && N.focus(),
|
|
178
|
+
select: () => N.select && N.select(),
|
|
179
|
+
setCustomValidity: (_) => N.setCustomValidity(_),
|
|
180
|
+
reportValidity: () => N.reportValidity()
|
|
181
|
+
});
|
|
182
|
+
}, [l._fields, t]), E = F.useMemo(() => ({
|
|
183
|
+
name: t,
|
|
184
|
+
value: c,
|
|
185
|
+
...$(a) || v.disabled ? { disabled: v.disabled || a } : {},
|
|
186
|
+
onChange: h,
|
|
187
|
+
onBlur: J,
|
|
188
|
+
ref: H
|
|
189
|
+
}), [t, a, v.disabled, h, J, H, c]);
|
|
190
|
+
return F.useEffect(() => {
|
|
191
|
+
const N = l._options.shouldUnregister || n;
|
|
192
|
+
l.register(t, {
|
|
193
|
+
...O.current.rules,
|
|
194
|
+
...$(O.current.disabled) ? { disabled: O.current.disabled } : {}
|
|
195
|
+
});
|
|
196
|
+
const G = (_, I) => {
|
|
197
|
+
const M = y(l._fields, _);
|
|
198
|
+
M && M._f && (M._f.mount = I);
|
|
199
|
+
};
|
|
200
|
+
if (G(t, !0), N) {
|
|
201
|
+
const _ = U(y(l._options.defaultValues, t));
|
|
202
|
+
k(l._defaultValues, t, _), C(y(l._formValues, t)) && k(l._formValues, t, _);
|
|
203
|
+
}
|
|
204
|
+
return !d && l.register(t), () => {
|
|
205
|
+
(d ? N && !l._state.action : N) ? l.unregister(t) : G(t, !1);
|
|
206
|
+
};
|
|
207
|
+
}, [t, l, d, n]), F.useEffect(() => {
|
|
208
|
+
l._setDisabledField({
|
|
209
|
+
disabled: a,
|
|
210
|
+
name: t
|
|
211
|
+
});
|
|
212
|
+
}, [a, t, l]), F.useMemo(() => ({
|
|
213
|
+
field: E,
|
|
214
|
+
formState: v,
|
|
215
|
+
fieldState: S
|
|
216
|
+
}), [E, v, S]);
|
|
217
|
+
}
|
|
218
|
+
const fe = (e) => e.render(qt(e));
|
|
219
|
+
var Ht = (e, s, t, a, l) => s ? {
|
|
220
|
+
...t[e],
|
|
221
|
+
types: {
|
|
222
|
+
...t[e] && t[e].types ? t[e].types : {},
|
|
223
|
+
[a]: l || !0
|
|
224
|
+
}
|
|
225
|
+
} : {}, ge = (e) => Array.isArray(e) ? e : [e], et = () => {
|
|
226
|
+
let e = [];
|
|
227
|
+
return {
|
|
228
|
+
get observers() {
|
|
229
|
+
return e;
|
|
230
|
+
},
|
|
231
|
+
next: (l) => {
|
|
232
|
+
for (const n of e)
|
|
233
|
+
n.next && n.next(l);
|
|
234
|
+
},
|
|
235
|
+
subscribe: (l) => (e.push(l), {
|
|
236
|
+
unsubscribe: () => {
|
|
237
|
+
e = e.filter((n) => n !== l);
|
|
238
|
+
}
|
|
239
|
+
}),
|
|
240
|
+
unsubscribe: () => {
|
|
241
|
+
e = [];
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
}, Oe = (e) => z(e) || !ct(e);
|
|
245
|
+
function le(e, s, t = /* @__PURE__ */ new WeakSet()) {
|
|
246
|
+
if (Oe(e) || Oe(s))
|
|
247
|
+
return e === s;
|
|
248
|
+
if (oe(e) && oe(s))
|
|
249
|
+
return e.getTime() === s.getTime();
|
|
250
|
+
const a = Object.keys(e), l = Object.keys(s);
|
|
251
|
+
if (a.length !== l.length)
|
|
252
|
+
return !1;
|
|
253
|
+
if (t.has(e) || t.has(s))
|
|
254
|
+
return !0;
|
|
255
|
+
t.add(e), t.add(s);
|
|
256
|
+
for (const n of a) {
|
|
257
|
+
const d = e[n];
|
|
258
|
+
if (!l.includes(n))
|
|
259
|
+
return !1;
|
|
260
|
+
if (n !== "ref") {
|
|
261
|
+
const c = s[n];
|
|
262
|
+
if (oe(d) && oe(c) || L(d) && L(c) || Array.isArray(d) && Array.isArray(c) ? !le(d, c, t) : d !== c)
|
|
263
|
+
return !1;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return !0;
|
|
267
|
+
}
|
|
268
|
+
var q = (e) => L(e) && !Object.keys(e).length, Be = (e) => e.type === "file", Z = (e) => typeof e == "function", we = (e) => {
|
|
269
|
+
if (!Re)
|
|
270
|
+
return !1;
|
|
271
|
+
const s = e ? e.ownerDocument : 0;
|
|
272
|
+
return e instanceof (s && s.defaultView ? s.defaultView.HTMLElement : HTMLElement);
|
|
273
|
+
}, _t = (e) => e.type === "select-multiple", ze = (e) => e.type === "radio", $t = (e) => ze(e) || _e(e), Le = (e) => we(e) && e.isConnected;
|
|
274
|
+
function jt(e, s) {
|
|
275
|
+
const t = s.slice(0, -1).length;
|
|
276
|
+
let a = 0;
|
|
277
|
+
for (; a < t; )
|
|
278
|
+
e = C(e) ? a++ : e[s[a++]];
|
|
279
|
+
return e;
|
|
280
|
+
}
|
|
281
|
+
function Kt(e) {
|
|
282
|
+
for (const s in e)
|
|
283
|
+
if (e.hasOwnProperty(s) && !C(e[s]))
|
|
284
|
+
return !1;
|
|
285
|
+
return !0;
|
|
286
|
+
}
|
|
287
|
+
function R(e, s) {
|
|
288
|
+
const t = Array.isArray(s) ? s : Ae(s) ? [s] : Ue(s), a = t.length === 1 ? e : jt(e, t), l = t.length - 1, n = t[l];
|
|
289
|
+
return a && delete a[n], l !== 0 && (L(a) && q(a) || Array.isArray(a) && Kt(a)) && R(e, t.slice(0, -1)), e;
|
|
290
|
+
}
|
|
291
|
+
var vt = (e) => {
|
|
292
|
+
for (const s in e)
|
|
293
|
+
if (Z(e[s]))
|
|
294
|
+
return !0;
|
|
295
|
+
return !1;
|
|
296
|
+
};
|
|
297
|
+
function Fe(e, s = {}) {
|
|
298
|
+
const t = Array.isArray(e);
|
|
299
|
+
if (L(e) || t)
|
|
300
|
+
for (const a in e)
|
|
301
|
+
Array.isArray(e[a]) || L(e[a]) && !vt(e[a]) ? (s[a] = Array.isArray(e[a]) ? [] : {}, Fe(e[a], s[a])) : z(e[a]) || (s[a] = !0);
|
|
302
|
+
return s;
|
|
303
|
+
}
|
|
304
|
+
function bt(e, s, t) {
|
|
305
|
+
const a = Array.isArray(e);
|
|
306
|
+
if (L(e) || a)
|
|
307
|
+
for (const l in e)
|
|
308
|
+
Array.isArray(e[l]) || L(e[l]) && !vt(e[l]) ? C(s) || Oe(t[l]) ? t[l] = Array.isArray(e[l]) ? Fe(e[l], []) : { ...Fe(e[l]) } : bt(e[l], z(s) ? {} : s[l], t[l]) : t[l] = !le(e[l], s[l]);
|
|
309
|
+
return t;
|
|
310
|
+
}
|
|
311
|
+
var ye = (e, s) => bt(e, s, Fe(s));
|
|
312
|
+
const tt = {
|
|
313
|
+
value: !1,
|
|
314
|
+
isValid: !1
|
|
315
|
+
}, rt = { value: !0, isValid: !0 };
|
|
316
|
+
var xt = (e) => {
|
|
317
|
+
if (Array.isArray(e)) {
|
|
318
|
+
if (e.length > 1) {
|
|
319
|
+
const s = e.filter((t) => t && t.checked && !t.disabled).map((t) => t.value);
|
|
320
|
+
return { value: s, isValid: !!s.length };
|
|
321
|
+
}
|
|
322
|
+
return e[0].checked && !e[0].disabled ? (
|
|
323
|
+
// @ts-expect-error expected to work in the browser
|
|
324
|
+
e[0].attributes && !C(e[0].attributes.value) ? C(e[0].value) || e[0].value === "" ? rt : { value: e[0].value, isValid: !0 } : rt
|
|
325
|
+
) : tt;
|
|
326
|
+
}
|
|
327
|
+
return tt;
|
|
328
|
+
}, Vt = (e, { valueAsNumber: s, valueAsDate: t, setValueAs: a }) => C(e) ? e : s ? e === "" ? NaN : e && +e : t && te(e) ? new Date(e) : a ? a(e) : e;
|
|
329
|
+
const st = {
|
|
330
|
+
isValid: !1,
|
|
331
|
+
value: null
|
|
332
|
+
};
|
|
333
|
+
var wt = (e) => Array.isArray(e) ? e.reduce((s, t) => t && t.checked && !t.disabled ? {
|
|
334
|
+
isValid: !0,
|
|
335
|
+
value: t.value
|
|
336
|
+
} : s, st) : st;
|
|
337
|
+
function it(e) {
|
|
338
|
+
const s = e.ref;
|
|
339
|
+
return Be(s) ? s.files : ze(s) ? wt(e.refs).value : _t(s) ? [...s.selectedOptions].map(({ value: t }) => t) : _e(s) ? xt(e.refs).value : Vt(C(s.value) ? e.ref.value : s.value, e);
|
|
340
|
+
}
|
|
341
|
+
var Gt = (e, s, t, a) => {
|
|
342
|
+
const l = {};
|
|
343
|
+
for (const n of e) {
|
|
344
|
+
const d = y(s, n);
|
|
345
|
+
d && k(l, n, d._f);
|
|
346
|
+
}
|
|
347
|
+
return {
|
|
348
|
+
criteriaMode: t,
|
|
349
|
+
names: [...e],
|
|
350
|
+
fields: l,
|
|
351
|
+
shouldUseNativeValidation: a
|
|
352
|
+
};
|
|
353
|
+
}, pe = (e) => e instanceof RegExp, me = (e) => C(e) ? e : pe(e) ? e.source : L(e) ? pe(e.value) ? e.value.source : e.value : e, at = (e) => ({
|
|
354
|
+
isOnSubmit: !e || e === Y.onSubmit,
|
|
355
|
+
isOnBlur: e === Y.onBlur,
|
|
356
|
+
isOnChange: e === Y.onChange,
|
|
357
|
+
isOnAll: e === Y.all,
|
|
358
|
+
isOnTouch: e === Y.onTouched
|
|
359
|
+
});
|
|
360
|
+
const lt = "AsyncFunction";
|
|
361
|
+
var Xt = (e) => !!e && !!e.validate && !!(Z(e.validate) && e.validate.constructor.name === lt || L(e.validate) && Object.values(e.validate).find((s) => s.constructor.name === lt)), Yt = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), nt = (e, s, t) => !t && (s.watchAll || s.watch.has(e) || [...s.watch].some((a) => e.startsWith(a) && /^\.\w+/.test(e.slice(a.length))));
|
|
362
|
+
const he = (e, s, t, a) => {
|
|
363
|
+
for (const l of t || Object.keys(e)) {
|
|
364
|
+
const n = y(e, l);
|
|
365
|
+
if (n) {
|
|
366
|
+
const { _f: d, ...c } = n;
|
|
367
|
+
if (d) {
|
|
368
|
+
if (d.refs && d.refs[0] && s(d.refs[0], l) && !a)
|
|
369
|
+
return !0;
|
|
370
|
+
if (d.ref && s(d.ref, d.name) && !a)
|
|
371
|
+
return !0;
|
|
372
|
+
if (he(c, s))
|
|
373
|
+
break;
|
|
374
|
+
} else if (L(c) && he(c, s))
|
|
375
|
+
break;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
function ot(e, s, t) {
|
|
380
|
+
const a = y(e, t);
|
|
381
|
+
if (a || Ae(t))
|
|
382
|
+
return {
|
|
383
|
+
error: a,
|
|
384
|
+
name: t
|
|
385
|
+
};
|
|
386
|
+
const l = t.split(".");
|
|
387
|
+
for (; l.length; ) {
|
|
388
|
+
const n = l.join("."), d = y(s, n), c = y(e, n);
|
|
389
|
+
if (d && !Array.isArray(d) && t !== n)
|
|
390
|
+
return { name: t };
|
|
391
|
+
if (c && c.type)
|
|
392
|
+
return {
|
|
393
|
+
name: n,
|
|
394
|
+
error: c
|
|
395
|
+
};
|
|
396
|
+
if (c && c.root && c.root.type)
|
|
397
|
+
return {
|
|
398
|
+
name: `${n}.root`,
|
|
399
|
+
error: c.root
|
|
400
|
+
};
|
|
401
|
+
l.pop();
|
|
402
|
+
}
|
|
403
|
+
return {
|
|
404
|
+
name: t
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
var Zt = (e, s, t, a) => {
|
|
408
|
+
t(e);
|
|
409
|
+
const { name: l, ...n } = e;
|
|
410
|
+
return q(n) || Object.keys(n).length >= Object.keys(s).length || Object.keys(n).find((d) => s[d] === (!a || Y.all));
|
|
411
|
+
}, Jt = (e, s, t) => !e || !s || e === s || ge(e).some((a) => a && (t ? a === s : a.startsWith(s) || s.startsWith(a))), Qt = (e, s, t, a, l) => l.isOnAll ? !1 : !t && l.isOnTouch ? !(s || e) : (t ? a.isOnBlur : l.isOnBlur) ? !e : (t ? a.isOnChange : l.isOnChange) ? e : !0, er = (e, s) => !Me(y(e, s)).length && R(e, s), tr = (e, s, t) => {
|
|
412
|
+
const a = ge(y(e, t));
|
|
413
|
+
return k(a, "root", s[t]), k(e, t, a), e;
|
|
414
|
+
}, xe = (e) => te(e);
|
|
415
|
+
function ut(e, s, t = "validate") {
|
|
416
|
+
if (xe(e) || Array.isArray(e) && e.every(xe) || $(e) && !e)
|
|
417
|
+
return {
|
|
418
|
+
type: t,
|
|
419
|
+
message: xe(e) ? e : "",
|
|
420
|
+
ref: s
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
var de = (e) => L(e) && !pe(e) ? e : {
|
|
424
|
+
value: e,
|
|
425
|
+
message: ""
|
|
426
|
+
}, dt = async (e, s, t, a, l, n) => {
|
|
427
|
+
const { ref: d, refs: c, required: v, maxLength: O, minLength: w, min: S, max: h, pattern: J, validate: H, name: E, valueAsNumber: N, mount: G } = e._f, _ = y(t, E);
|
|
428
|
+
if (!G || s.has(E))
|
|
429
|
+
return {};
|
|
430
|
+
const I = c ? c[0] : d, M = (x) => {
|
|
431
|
+
l && I.reportValidity && (I.setCustomValidity($(x) ? "" : x || ""), I.reportValidity());
|
|
432
|
+
}, b = {}, se = ze(d), ie = _e(d), ke = se || ie, X = (N || Be(d)) && C(d.value) && C(_) || we(d) && d.value === "" || _ === "" || Array.isArray(_) && !_.length, ne = Ht.bind(null, E, a, b), Q = (x, p, T, B = re.maxLength, W = re.minLength) => {
|
|
433
|
+
const ee = x ? p : T;
|
|
434
|
+
b[E] = {
|
|
435
|
+
type: x ? B : W,
|
|
436
|
+
message: ee,
|
|
437
|
+
ref: d,
|
|
438
|
+
...ne(x ? B : W, ee)
|
|
439
|
+
};
|
|
440
|
+
};
|
|
441
|
+
if (n ? !Array.isArray(_) || !_.length : v && (!ke && (X || z(_)) || $(_) && !_ || ie && !xt(c).isValid || se && !wt(c).isValid)) {
|
|
442
|
+
const { value: x, message: p } = xe(v) ? { value: !!v, message: v } : de(v);
|
|
443
|
+
if (x && (b[E] = {
|
|
444
|
+
type: re.required,
|
|
445
|
+
message: p,
|
|
446
|
+
ref: I,
|
|
447
|
+
...ne(re.required, p)
|
|
448
|
+
}, !a))
|
|
449
|
+
return M(p), b;
|
|
450
|
+
}
|
|
451
|
+
if (!X && (!z(S) || !z(h))) {
|
|
452
|
+
let x, p;
|
|
453
|
+
const T = de(h), B = de(S);
|
|
454
|
+
if (!z(_) && !isNaN(_)) {
|
|
455
|
+
const W = d.valueAsNumber || _ && +_;
|
|
456
|
+
z(T.value) || (x = W > T.value), z(B.value) || (p = W < B.value);
|
|
457
|
+
} else {
|
|
458
|
+
const W = d.valueAsDate || new Date(_), ee = (ve) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ve), ce = d.type == "time", ue = d.type == "week";
|
|
459
|
+
te(T.value) && _ && (x = ce ? ee(_) > ee(T.value) : ue ? _ > T.value : W > new Date(T.value)), te(B.value) && _ && (p = ce ? ee(_) < ee(B.value) : ue ? _ < B.value : W < new Date(B.value));
|
|
460
|
+
}
|
|
461
|
+
if ((x || p) && (Q(!!x, T.message, B.message, re.max, re.min), !a))
|
|
462
|
+
return M(b[E].message), b;
|
|
463
|
+
}
|
|
464
|
+
if ((O || w) && !X && (te(_) || n && Array.isArray(_))) {
|
|
465
|
+
const x = de(O), p = de(w), T = !z(x.value) && _.length > +x.value, B = !z(p.value) && _.length < +p.value;
|
|
466
|
+
if ((T || B) && (Q(T, x.message, p.message), !a))
|
|
467
|
+
return M(b[E].message), b;
|
|
468
|
+
}
|
|
469
|
+
if (J && !X && te(_)) {
|
|
470
|
+
const { value: x, message: p } = de(J);
|
|
471
|
+
if (pe(x) && !_.match(x) && (b[E] = {
|
|
472
|
+
type: re.pattern,
|
|
473
|
+
message: p,
|
|
474
|
+
ref: d,
|
|
475
|
+
...ne(re.pattern, p)
|
|
476
|
+
}, !a))
|
|
477
|
+
return M(p), b;
|
|
478
|
+
}
|
|
479
|
+
if (H) {
|
|
480
|
+
if (Z(H)) {
|
|
481
|
+
const x = await H(_, t), p = ut(x, I);
|
|
482
|
+
if (p && (b[E] = {
|
|
483
|
+
...p,
|
|
484
|
+
...ne(re.validate, p.message)
|
|
485
|
+
}, !a))
|
|
486
|
+
return M(p.message), b;
|
|
487
|
+
} else if (L(H)) {
|
|
488
|
+
let x = {};
|
|
489
|
+
for (const p in H) {
|
|
490
|
+
if (!q(x) && !a)
|
|
491
|
+
break;
|
|
492
|
+
const T = ut(await H[p](_, t), I, p);
|
|
493
|
+
T && (x = {
|
|
494
|
+
...T,
|
|
495
|
+
...ne(p, T.message)
|
|
496
|
+
}, M(T.message), a && (b[E] = x));
|
|
497
|
+
}
|
|
498
|
+
if (!q(x) && (b[E] = {
|
|
499
|
+
ref: I,
|
|
500
|
+
...x
|
|
501
|
+
}, !a))
|
|
502
|
+
return b;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
return M(!0), b;
|
|
506
|
+
};
|
|
507
|
+
const rr = {
|
|
508
|
+
mode: Y.onSubmit,
|
|
509
|
+
reValidateMode: Y.onChange,
|
|
510
|
+
shouldFocusError: !0
|
|
511
|
+
};
|
|
512
|
+
function sr(e = {}) {
|
|
513
|
+
let s = {
|
|
514
|
+
...rr,
|
|
515
|
+
...e
|
|
516
|
+
}, t = {
|
|
517
|
+
submitCount: 0,
|
|
518
|
+
isDirty: !1,
|
|
519
|
+
isReady: !1,
|
|
520
|
+
isLoading: Z(s.defaultValues),
|
|
521
|
+
isValidating: !1,
|
|
522
|
+
isSubmitted: !1,
|
|
523
|
+
isSubmitting: !1,
|
|
524
|
+
isSubmitSuccessful: !1,
|
|
525
|
+
isValid: !1,
|
|
526
|
+
touchedFields: {},
|
|
527
|
+
dirtyFields: {},
|
|
528
|
+
validatingFields: {},
|
|
529
|
+
errors: s.errors || {},
|
|
530
|
+
disabled: s.disabled || !1
|
|
531
|
+
};
|
|
532
|
+
const a = {};
|
|
533
|
+
let l = L(s.defaultValues) || L(s.values) ? U(s.defaultValues || s.values) || {} : {}, n = s.shouldUnregister ? {} : U(l), d = {
|
|
534
|
+
action: !1,
|
|
535
|
+
mount: !1,
|
|
536
|
+
watch: !1
|
|
537
|
+
}, c = {
|
|
538
|
+
mount: /* @__PURE__ */ new Set(),
|
|
539
|
+
disabled: /* @__PURE__ */ new Set(),
|
|
540
|
+
unMount: /* @__PURE__ */ new Set(),
|
|
541
|
+
array: /* @__PURE__ */ new Set(),
|
|
542
|
+
watch: /* @__PURE__ */ new Set()
|
|
543
|
+
}, v, O = 0;
|
|
544
|
+
const w = {
|
|
545
|
+
isDirty: !1,
|
|
546
|
+
dirtyFields: !1,
|
|
547
|
+
validatingFields: !1,
|
|
548
|
+
touchedFields: !1,
|
|
549
|
+
isValidating: !1,
|
|
550
|
+
isValid: !1,
|
|
551
|
+
errors: !1
|
|
552
|
+
};
|
|
553
|
+
let S = {
|
|
554
|
+
...w
|
|
555
|
+
};
|
|
556
|
+
const h = {
|
|
557
|
+
array: et(),
|
|
558
|
+
state: et()
|
|
559
|
+
}, J = s.criteriaMode === Y.all, H = (r) => (i) => {
|
|
560
|
+
clearTimeout(O), O = setTimeout(r, i);
|
|
561
|
+
}, E = async (r) => {
|
|
562
|
+
if (!s.disabled && (w.isValid || S.isValid || r)) {
|
|
563
|
+
const i = s.resolver ? q((await ie()).errors) : await X(a, !0);
|
|
564
|
+
i !== t.isValid && h.state.next({
|
|
565
|
+
isValid: i
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
}, N = (r, i) => {
|
|
569
|
+
!s.disabled && (w.isValidating || w.validatingFields || S.isValidating || S.validatingFields) && ((r || Array.from(c.mount)).forEach((o) => {
|
|
570
|
+
o && (i ? k(t.validatingFields, o, i) : R(t.validatingFields, o));
|
|
571
|
+
}), h.state.next({
|
|
572
|
+
validatingFields: t.validatingFields,
|
|
573
|
+
isValidating: !q(t.validatingFields)
|
|
574
|
+
}));
|
|
575
|
+
}, G = (r, i = [], o, m, f = !0, u = !0) => {
|
|
576
|
+
if (m && o && !s.disabled) {
|
|
577
|
+
if (d.action = !0, u && Array.isArray(y(a, r))) {
|
|
578
|
+
const g = o(y(a, r), m.argA, m.argB);
|
|
579
|
+
f && k(a, r, g);
|
|
580
|
+
}
|
|
581
|
+
if (u && Array.isArray(y(t.errors, r))) {
|
|
582
|
+
const g = o(y(t.errors, r), m.argA, m.argB);
|
|
583
|
+
f && k(t.errors, r, g), er(t.errors, r);
|
|
584
|
+
}
|
|
585
|
+
if ((w.touchedFields || S.touchedFields) && u && Array.isArray(y(t.touchedFields, r))) {
|
|
586
|
+
const g = o(y(t.touchedFields, r), m.argA, m.argB);
|
|
587
|
+
f && k(t.touchedFields, r, g);
|
|
588
|
+
}
|
|
589
|
+
(w.dirtyFields || S.dirtyFields) && (t.dirtyFields = ye(l, n)), h.state.next({
|
|
590
|
+
name: r,
|
|
591
|
+
isDirty: Q(r, i),
|
|
592
|
+
dirtyFields: t.dirtyFields,
|
|
593
|
+
errors: t.errors,
|
|
594
|
+
isValid: t.isValid
|
|
595
|
+
});
|
|
596
|
+
} else
|
|
597
|
+
k(n, r, i);
|
|
598
|
+
}, _ = (r, i) => {
|
|
599
|
+
k(t.errors, r, i), h.state.next({
|
|
600
|
+
errors: t.errors
|
|
601
|
+
});
|
|
602
|
+
}, I = (r) => {
|
|
603
|
+
t.errors = r, h.state.next({
|
|
604
|
+
errors: t.errors,
|
|
605
|
+
isValid: !1
|
|
606
|
+
});
|
|
607
|
+
}, M = (r, i, o, m) => {
|
|
608
|
+
const f = y(a, r);
|
|
609
|
+
if (f) {
|
|
610
|
+
const u = y(n, r, C(o) ? y(l, r) : o);
|
|
611
|
+
C(u) || m && m.defaultChecked || i ? k(n, r, i ? u : it(f._f)) : T(r, u), d.mount && E();
|
|
612
|
+
}
|
|
613
|
+
}, b = (r, i, o, m, f) => {
|
|
614
|
+
let u = !1, g = !1;
|
|
615
|
+
const V = {
|
|
616
|
+
name: r
|
|
617
|
+
};
|
|
618
|
+
if (!s.disabled) {
|
|
619
|
+
if (!o || m) {
|
|
620
|
+
(w.isDirty || S.isDirty) && (g = t.isDirty, t.isDirty = V.isDirty = Q(), u = g !== V.isDirty);
|
|
621
|
+
const D = le(y(l, r), i);
|
|
622
|
+
g = !!y(t.dirtyFields, r), D ? R(t.dirtyFields, r) : k(t.dirtyFields, r, !0), V.dirtyFields = t.dirtyFields, u = u || (w.dirtyFields || S.dirtyFields) && g !== !D;
|
|
623
|
+
}
|
|
624
|
+
if (o) {
|
|
625
|
+
const D = y(t.touchedFields, r);
|
|
626
|
+
D || (k(t.touchedFields, r, o), V.touchedFields = t.touchedFields, u = u || (w.touchedFields || S.touchedFields) && D !== o);
|
|
627
|
+
}
|
|
628
|
+
u && f && h.state.next(V);
|
|
629
|
+
}
|
|
630
|
+
return u ? V : {};
|
|
631
|
+
}, se = (r, i, o, m) => {
|
|
632
|
+
const f = y(t.errors, r), u = (w.isValid || S.isValid) && $(i) && t.isValid !== i;
|
|
633
|
+
if (s.delayError && o ? (v = H(() => _(r, o)), v(s.delayError)) : (clearTimeout(O), v = null, o ? k(t.errors, r, o) : R(t.errors, r)), (o ? !le(f, o) : f) || !q(m) || u) {
|
|
634
|
+
const g = {
|
|
635
|
+
...m,
|
|
636
|
+
...u && $(i) ? { isValid: i } : {},
|
|
637
|
+
errors: t.errors,
|
|
638
|
+
name: r
|
|
639
|
+
};
|
|
640
|
+
t = {
|
|
641
|
+
...t,
|
|
642
|
+
...g
|
|
643
|
+
}, h.state.next(g);
|
|
644
|
+
}
|
|
645
|
+
}, ie = async (r) => {
|
|
646
|
+
N(r, !0);
|
|
647
|
+
const i = await s.resolver(n, s.context, Gt(r || c.mount, a, s.criteriaMode, s.shouldUseNativeValidation));
|
|
648
|
+
return N(r), i;
|
|
649
|
+
}, ke = async (r) => {
|
|
650
|
+
const { errors: i } = await ie(r);
|
|
651
|
+
if (r)
|
|
652
|
+
for (const o of r) {
|
|
653
|
+
const m = y(i, o);
|
|
654
|
+
m ? k(t.errors, o, m) : R(t.errors, o);
|
|
655
|
+
}
|
|
656
|
+
else
|
|
657
|
+
t.errors = i;
|
|
658
|
+
return i;
|
|
659
|
+
}, X = async (r, i, o = {
|
|
660
|
+
valid: !0
|
|
661
|
+
}) => {
|
|
662
|
+
for (const m in r) {
|
|
663
|
+
const f = r[m];
|
|
664
|
+
if (f) {
|
|
665
|
+
const { _f: u, ...g } = f;
|
|
666
|
+
if (u) {
|
|
667
|
+
const V = c.array.has(u.name), D = f._f && Xt(f._f);
|
|
668
|
+
D && w.validatingFields && N([m], !0);
|
|
669
|
+
const j = await dt(f, c.disabled, n, J, s.shouldUseNativeValidation && !i, V);
|
|
670
|
+
if (D && w.validatingFields && N([m]), j[u.name] && (o.valid = !1, i))
|
|
671
|
+
break;
|
|
672
|
+
!i && (y(j, u.name) ? V ? tr(t.errors, j, u.name) : k(t.errors, u.name, j[u.name]) : R(t.errors, u.name));
|
|
673
|
+
}
|
|
674
|
+
!q(g) && await X(g, i, o);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
return o.valid;
|
|
678
|
+
}, ne = () => {
|
|
679
|
+
for (const r of c.unMount) {
|
|
680
|
+
const i = y(a, r);
|
|
681
|
+
i && (i._f.refs ? i._f.refs.every((o) => !Le(o)) : !Le(i._f.ref)) && Se(r);
|
|
682
|
+
}
|
|
683
|
+
c.unMount = /* @__PURE__ */ new Set();
|
|
684
|
+
}, Q = (r, i) => !s.disabled && (r && i && k(n, r, i), !le(ve(), l)), x = (r, i, o) => ht(r, c, {
|
|
685
|
+
...d.mount ? n : C(i) ? l : te(r) ? { [r]: i } : i
|
|
686
|
+
}, o, i), p = (r) => Me(y(d.mount ? n : l, r, s.shouldUnregister ? y(l, r, []) : [])), T = (r, i, o = {}) => {
|
|
687
|
+
const m = y(a, r);
|
|
688
|
+
let f = i;
|
|
689
|
+
if (m) {
|
|
690
|
+
const u = m._f;
|
|
691
|
+
u && (!u.disabled && k(n, r, Vt(i, u)), f = we(u.ref) && z(i) ? "" : i, _t(u.ref) ? [...u.ref.options].forEach((g) => g.selected = f.includes(g.value)) : u.refs ? _e(u.ref) ? u.refs.forEach((g) => {
|
|
692
|
+
(!g.defaultChecked || !g.disabled) && (Array.isArray(f) ? g.checked = !!f.find((V) => V === g.value) : g.checked = f === g.value || !!f);
|
|
693
|
+
}) : u.refs.forEach((g) => g.checked = g.value === f) : Be(u.ref) ? u.ref.value = "" : (u.ref.value = f, u.ref.type || h.state.next({
|
|
694
|
+
name: r,
|
|
695
|
+
values: U(n)
|
|
696
|
+
})));
|
|
697
|
+
}
|
|
698
|
+
(o.shouldDirty || o.shouldTouch) && b(r, f, o.shouldTouch, o.shouldDirty, !0), o.shouldValidate && ue(r);
|
|
699
|
+
}, B = (r, i, o) => {
|
|
700
|
+
for (const m in i) {
|
|
701
|
+
if (!i.hasOwnProperty(m))
|
|
702
|
+
return;
|
|
703
|
+
const f = i[m], u = r + "." + m, g = y(a, u);
|
|
704
|
+
(c.array.has(r) || L(f) || g && !g._f) && !oe(f) ? B(u, f, o) : T(u, f, o);
|
|
705
|
+
}
|
|
706
|
+
}, W = (r, i, o = {}) => {
|
|
707
|
+
const m = y(a, r), f = c.array.has(r), u = U(i);
|
|
708
|
+
k(n, r, u), f ? (h.array.next({
|
|
709
|
+
name: r,
|
|
710
|
+
values: U(n)
|
|
711
|
+
}), (w.isDirty || w.dirtyFields || S.isDirty || S.dirtyFields) && o.shouldDirty && h.state.next({
|
|
712
|
+
name: r,
|
|
713
|
+
dirtyFields: ye(l, n),
|
|
714
|
+
isDirty: Q(r, u)
|
|
715
|
+
})) : m && !m._f && !z(u) ? B(r, u, o) : T(r, u, o), nt(r, c) && h.state.next({ ...t }), h.state.next({
|
|
716
|
+
name: d.mount ? r : void 0,
|
|
717
|
+
values: U(n)
|
|
718
|
+
});
|
|
719
|
+
}, ee = async (r) => {
|
|
720
|
+
d.mount = !0;
|
|
721
|
+
const i = r.target;
|
|
722
|
+
let o = i.name, m = !0;
|
|
723
|
+
const f = y(a, o), u = (D) => {
|
|
724
|
+
m = Number.isNaN(D) || oe(D) && isNaN(D.getTime()) || le(D, y(n, o, D));
|
|
725
|
+
}, g = at(s.mode), V = at(s.reValidateMode);
|
|
726
|
+
if (f) {
|
|
727
|
+
let D, j;
|
|
728
|
+
const be = i.type ? it(f._f) : ft(r), ae = r.type === Ve.BLUR || r.type === Ve.FOCUS_OUT, Nt = !Yt(f._f) && !s.resolver && !y(t.errors, o) && !f._f.deps || Qt(ae, y(t.touchedFields, o), t.isSubmitted, V, g), Ne = nt(o, c, ae);
|
|
729
|
+
k(n, o, be), ae ? (f._f.onBlur && f._f.onBlur(r), v && v(0)) : f._f.onChange && f._f.onChange(r);
|
|
730
|
+
const Ce = b(o, be, ae), Ct = !q(Ce) || Ne;
|
|
731
|
+
if (!ae && h.state.next({
|
|
732
|
+
name: o,
|
|
733
|
+
type: r.type,
|
|
734
|
+
values: U(n)
|
|
735
|
+
}), Nt)
|
|
736
|
+
return (w.isValid || S.isValid) && (s.mode === "onBlur" ? ae && E() : ae || E()), Ct && h.state.next({ name: o, ...Ne ? {} : Ce });
|
|
737
|
+
if (!ae && Ne && h.state.next({ ...t }), s.resolver) {
|
|
738
|
+
const { errors: Ye } = await ie([o]);
|
|
739
|
+
if (u(be), m) {
|
|
740
|
+
const Tt = ot(t.errors, a, o), Ze = ot(Ye, a, Tt.name || o);
|
|
741
|
+
D = Ze.error, o = Ze.name, j = q(Ye);
|
|
742
|
+
}
|
|
743
|
+
} else
|
|
744
|
+
N([o], !0), D = (await dt(f, c.disabled, n, J, s.shouldUseNativeValidation))[o], N([o]), u(be), m && (D ? j = !1 : (w.isValid || S.isValid) && (j = await X(a, !0)));
|
|
745
|
+
m && (f._f.deps && ue(f._f.deps), se(o, j, D, Ce));
|
|
746
|
+
}
|
|
747
|
+
}, ce = (r, i) => {
|
|
748
|
+
if (y(t.errors, i) && r.focus)
|
|
749
|
+
return r.focus(), 1;
|
|
750
|
+
}, ue = async (r, i = {}) => {
|
|
751
|
+
let o, m;
|
|
752
|
+
const f = ge(r);
|
|
753
|
+
if (s.resolver) {
|
|
754
|
+
const u = await ke(C(r) ? r : f);
|
|
755
|
+
o = q(u), m = r ? !f.some((g) => y(u, g)) : o;
|
|
756
|
+
} else r ? (m = (await Promise.all(f.map(async (u) => {
|
|
757
|
+
const g = y(a, u);
|
|
758
|
+
return await X(g && g._f ? { [u]: g } : g);
|
|
759
|
+
}))).every(Boolean), !(!m && !t.isValid) && E()) : m = o = await X(a);
|
|
760
|
+
return h.state.next({
|
|
761
|
+
...!te(r) || (w.isValid || S.isValid) && o !== t.isValid ? {} : { name: r },
|
|
762
|
+
...s.resolver || !r ? { isValid: o } : {},
|
|
763
|
+
errors: t.errors
|
|
764
|
+
}), i.shouldFocus && !m && he(a, ce, r ? f : c.mount), m;
|
|
765
|
+
}, ve = (r) => {
|
|
766
|
+
const i = {
|
|
767
|
+
...d.mount ? n : l
|
|
768
|
+
};
|
|
769
|
+
return C(r) ? i : te(r) ? y(i, r) : r.map((o) => y(i, o));
|
|
770
|
+
}, We = (r, i) => ({
|
|
771
|
+
invalid: !!y((i || t).errors, r),
|
|
772
|
+
isDirty: !!y((i || t).dirtyFields, r),
|
|
773
|
+
error: y((i || t).errors, r),
|
|
774
|
+
isValidating: !!y(t.validatingFields, r),
|
|
775
|
+
isTouched: !!y((i || t).touchedFields, r)
|
|
776
|
+
}), Ft = (r) => {
|
|
777
|
+
r && ge(r).forEach((i) => R(t.errors, i)), h.state.next({
|
|
778
|
+
errors: r ? t.errors : {}
|
|
779
|
+
});
|
|
780
|
+
}, qe = (r, i, o) => {
|
|
781
|
+
const m = (y(a, r, { _f: {} })._f || {}).ref, f = y(t.errors, r) || {}, { ref: u, message: g, type: V, ...D } = f;
|
|
782
|
+
k(t.errors, r, {
|
|
783
|
+
...D,
|
|
784
|
+
...i,
|
|
785
|
+
ref: m
|
|
786
|
+
}), h.state.next({
|
|
787
|
+
name: r,
|
|
788
|
+
errors: t.errors,
|
|
789
|
+
isValid: !1
|
|
790
|
+
}), o && o.shouldFocus && m && m.focus && m.focus();
|
|
791
|
+
}, pt = (r, i) => Z(r) ? h.state.subscribe({
|
|
792
|
+
next: (o) => r(x(void 0, i), o)
|
|
793
|
+
}) : x(r, i, !0), He = (r) => h.state.subscribe({
|
|
794
|
+
next: (i) => {
|
|
795
|
+
Jt(r.name, i.name, r.exact) && Zt(i, r.formState || w, Et, r.reRenderRoot) && r.callback({
|
|
796
|
+
values: { ...n },
|
|
797
|
+
...t,
|
|
798
|
+
...i
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
}).unsubscribe, At = (r) => (d.mount = !0, S = {
|
|
802
|
+
...S,
|
|
803
|
+
...r.formState
|
|
804
|
+
}, He({
|
|
805
|
+
...r,
|
|
806
|
+
formState: S
|
|
807
|
+
})), Se = (r, i = {}) => {
|
|
808
|
+
for (const o of r ? ge(r) : c.mount)
|
|
809
|
+
c.mount.delete(o), c.array.delete(o), i.keepValue || (R(a, o), R(n, o)), !i.keepError && R(t.errors, o), !i.keepDirty && R(t.dirtyFields, o), !i.keepTouched && R(t.touchedFields, o), !i.keepIsValidating && R(t.validatingFields, o), !s.shouldUnregister && !i.keepDefaultValue && R(l, o);
|
|
810
|
+
h.state.next({
|
|
811
|
+
values: U(n)
|
|
812
|
+
}), h.state.next({
|
|
813
|
+
...t,
|
|
814
|
+
...i.keepDirty ? { isDirty: Q() } : {}
|
|
815
|
+
}), !i.keepIsValid && E();
|
|
816
|
+
}, $e = ({ disabled: r, name: i }) => {
|
|
817
|
+
($(r) && d.mount || r || c.disabled.has(i)) && (r ? c.disabled.add(i) : c.disabled.delete(i));
|
|
818
|
+
}, De = (r, i = {}) => {
|
|
819
|
+
let o = y(a, r);
|
|
820
|
+
const m = $(i.disabled) || $(s.disabled);
|
|
821
|
+
return k(a, r, {
|
|
822
|
+
...o || {},
|
|
823
|
+
_f: {
|
|
824
|
+
...o && o._f ? o._f : { ref: { name: r } },
|
|
825
|
+
name: r,
|
|
826
|
+
mount: !0,
|
|
827
|
+
...i
|
|
828
|
+
}
|
|
829
|
+
}), c.mount.add(r), o ? $e({
|
|
830
|
+
disabled: $(i.disabled) ? i.disabled : s.disabled,
|
|
831
|
+
name: r
|
|
832
|
+
}) : M(r, !0, i.value), {
|
|
833
|
+
...m ? { disabled: i.disabled || s.disabled } : {},
|
|
834
|
+
...s.progressive ? {
|
|
835
|
+
required: !!i.required,
|
|
836
|
+
min: me(i.min),
|
|
837
|
+
max: me(i.max),
|
|
838
|
+
minLength: me(i.minLength),
|
|
839
|
+
maxLength: me(i.maxLength),
|
|
840
|
+
pattern: me(i.pattern)
|
|
841
|
+
} : {},
|
|
842
|
+
name: r,
|
|
843
|
+
onChange: ee,
|
|
844
|
+
onBlur: ee,
|
|
845
|
+
ref: (f) => {
|
|
846
|
+
if (f) {
|
|
847
|
+
De(r, i), o = y(a, r);
|
|
848
|
+
const u = C(f.value) && f.querySelectorAll && f.querySelectorAll("input,select,textarea")[0] || f, g = $t(u), V = o._f.refs || [];
|
|
849
|
+
if (g ? V.find((D) => D === u) : u === o._f.ref)
|
|
850
|
+
return;
|
|
851
|
+
k(a, r, {
|
|
852
|
+
_f: {
|
|
853
|
+
...o._f,
|
|
854
|
+
...g ? {
|
|
855
|
+
refs: [
|
|
856
|
+
...V.filter(Le),
|
|
857
|
+
u,
|
|
858
|
+
...Array.isArray(y(l, r)) ? [{}] : []
|
|
859
|
+
],
|
|
860
|
+
ref: { type: u.type, name: r }
|
|
861
|
+
} : { ref: u }
|
|
862
|
+
}
|
|
863
|
+
}), M(r, !1, void 0, u);
|
|
864
|
+
} else
|
|
865
|
+
o = y(a, r, {}), o._f && (o._f.mount = !1), (s.shouldUnregister || i.shouldUnregister) && !(yt(c.array, r) && d.action) && c.unMount.add(r);
|
|
866
|
+
}
|
|
867
|
+
};
|
|
868
|
+
}, Ee = () => s.shouldFocusError && he(a, ce, c.mount), kt = (r) => {
|
|
869
|
+
$(r) && (h.state.next({ disabled: r }), he(a, (i, o) => {
|
|
870
|
+
const m = y(a, o);
|
|
871
|
+
m && (i.disabled = m._f.disabled || r, Array.isArray(m._f.refs) && m._f.refs.forEach((f) => {
|
|
872
|
+
f.disabled = m._f.disabled || r;
|
|
873
|
+
}));
|
|
874
|
+
}, 0, !1));
|
|
875
|
+
}, je = (r, i) => async (o) => {
|
|
876
|
+
let m;
|
|
877
|
+
o && (o.preventDefault && o.preventDefault(), o.persist && o.persist());
|
|
878
|
+
let f = U(n);
|
|
879
|
+
if (h.state.next({
|
|
880
|
+
isSubmitting: !0
|
|
881
|
+
}), s.resolver) {
|
|
882
|
+
const { errors: u, values: g } = await ie();
|
|
883
|
+
t.errors = u, f = U(g);
|
|
884
|
+
} else
|
|
885
|
+
await X(a);
|
|
886
|
+
if (c.disabled.size)
|
|
887
|
+
for (const u of c.disabled)
|
|
888
|
+
R(f, u);
|
|
889
|
+
if (R(t.errors, "root"), q(t.errors)) {
|
|
890
|
+
h.state.next({
|
|
891
|
+
errors: {}
|
|
892
|
+
});
|
|
893
|
+
try {
|
|
894
|
+
await r(f, o);
|
|
895
|
+
} catch (u) {
|
|
896
|
+
m = u;
|
|
897
|
+
}
|
|
898
|
+
} else
|
|
899
|
+
i && await i({ ...t.errors }, o), Ee(), setTimeout(Ee);
|
|
900
|
+
if (h.state.next({
|
|
901
|
+
isSubmitted: !0,
|
|
902
|
+
isSubmitting: !1,
|
|
903
|
+
isSubmitSuccessful: q(t.errors) && !m,
|
|
904
|
+
submitCount: t.submitCount + 1,
|
|
905
|
+
errors: t.errors
|
|
906
|
+
}), m)
|
|
907
|
+
throw m;
|
|
908
|
+
}, St = (r, i = {}) => {
|
|
909
|
+
y(a, r) && (C(i.defaultValue) ? W(r, U(y(l, r))) : (W(r, i.defaultValue), k(l, r, U(i.defaultValue))), i.keepTouched || R(t.touchedFields, r), i.keepDirty || (R(t.dirtyFields, r), t.isDirty = i.defaultValue ? Q(r, U(y(l, r))) : Q()), i.keepError || (R(t.errors, r), w.isValid && E()), h.state.next({ ...t }));
|
|
910
|
+
}, Ke = (r, i = {}) => {
|
|
911
|
+
const o = r ? U(r) : l, m = U(o), f = q(r), u = f ? l : m;
|
|
912
|
+
if (i.keepDefaultValues || (l = o), !i.keepValues) {
|
|
913
|
+
if (i.keepDirtyValues) {
|
|
914
|
+
const g = /* @__PURE__ */ new Set([
|
|
915
|
+
...c.mount,
|
|
916
|
+
...Object.keys(ye(l, n))
|
|
917
|
+
]);
|
|
918
|
+
for (const V of Array.from(g))
|
|
919
|
+
y(t.dirtyFields, V) ? k(u, V, y(n, V)) : W(V, y(u, V));
|
|
920
|
+
} else {
|
|
921
|
+
if (Re && C(r))
|
|
922
|
+
for (const g of c.mount) {
|
|
923
|
+
const V = y(a, g);
|
|
924
|
+
if (V && V._f) {
|
|
925
|
+
const D = Array.isArray(V._f.refs) ? V._f.refs[0] : V._f.ref;
|
|
926
|
+
if (we(D)) {
|
|
927
|
+
const j = D.closest("form");
|
|
928
|
+
if (j) {
|
|
929
|
+
j.reset();
|
|
930
|
+
break;
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
for (const g of c.mount) {
|
|
936
|
+
const V = y(u, g, y(l, g));
|
|
937
|
+
C(V) || (k(u, g, V), W(g, y(u, g)));
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
n = U(u), h.array.next({
|
|
941
|
+
values: { ...u }
|
|
942
|
+
}), h.state.next({
|
|
943
|
+
values: { ...u }
|
|
944
|
+
});
|
|
945
|
+
}
|
|
946
|
+
c = {
|
|
947
|
+
mount: i.keepDirtyValues ? c.mount : /* @__PURE__ */ new Set(),
|
|
948
|
+
unMount: /* @__PURE__ */ new Set(),
|
|
949
|
+
array: /* @__PURE__ */ new Set(),
|
|
950
|
+
disabled: /* @__PURE__ */ new Set(),
|
|
951
|
+
watch: /* @__PURE__ */ new Set(),
|
|
952
|
+
watchAll: !1,
|
|
953
|
+
focus: ""
|
|
954
|
+
}, d.mount = !w.isValid || !!i.keepIsValid || !!i.keepDirtyValues, d.watch = !!s.shouldUnregister, h.state.next({
|
|
955
|
+
submitCount: i.keepSubmitCount ? t.submitCount : 0,
|
|
956
|
+
isDirty: f ? !1 : i.keepDirty ? t.isDirty : !!(i.keepDefaultValues && !le(r, l)),
|
|
957
|
+
isSubmitted: i.keepIsSubmitted ? t.isSubmitted : !1,
|
|
958
|
+
dirtyFields: f ? {} : i.keepDirtyValues ? i.keepDefaultValues && n ? ye(l, n) : t.dirtyFields : i.keepDefaultValues && r ? ye(l, r) : i.keepDirty ? t.dirtyFields : {},
|
|
959
|
+
touchedFields: i.keepTouched ? t.touchedFields : {},
|
|
960
|
+
errors: i.keepErrors ? t.errors : {},
|
|
961
|
+
isSubmitSuccessful: i.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
|
|
962
|
+
isSubmitting: !1
|
|
963
|
+
});
|
|
964
|
+
}, Ge = (r, i) => Ke(Z(r) ? r(n) : r, i), Dt = (r, i = {}) => {
|
|
965
|
+
const o = y(a, r), m = o && o._f;
|
|
966
|
+
if (m) {
|
|
967
|
+
const f = m.refs ? m.refs[0] : m.ref;
|
|
968
|
+
f.focus && (f.focus(), i.shouldSelect && Z(f.select) && f.select());
|
|
969
|
+
}
|
|
970
|
+
}, Et = (r) => {
|
|
971
|
+
t = {
|
|
972
|
+
...t,
|
|
973
|
+
...r
|
|
974
|
+
};
|
|
975
|
+
}, Xe = {
|
|
976
|
+
control: {
|
|
977
|
+
register: De,
|
|
978
|
+
unregister: Se,
|
|
979
|
+
getFieldState: We,
|
|
980
|
+
handleSubmit: je,
|
|
981
|
+
setError: qe,
|
|
982
|
+
_subscribe: He,
|
|
983
|
+
_runSchema: ie,
|
|
984
|
+
_focusError: Ee,
|
|
985
|
+
_getWatch: x,
|
|
986
|
+
_getDirty: Q,
|
|
987
|
+
_setValid: E,
|
|
988
|
+
_setFieldArray: G,
|
|
989
|
+
_setDisabledField: $e,
|
|
990
|
+
_setErrors: I,
|
|
991
|
+
_getFieldArray: p,
|
|
992
|
+
_reset: Ke,
|
|
993
|
+
_resetDefaultValues: () => Z(s.defaultValues) && s.defaultValues().then((r) => {
|
|
994
|
+
Ge(r, s.resetOptions), h.state.next({
|
|
995
|
+
isLoading: !1
|
|
996
|
+
});
|
|
997
|
+
}),
|
|
998
|
+
_removeUnmounted: ne,
|
|
999
|
+
_disableForm: kt,
|
|
1000
|
+
_subjects: h,
|
|
1001
|
+
_proxyFormState: w,
|
|
1002
|
+
get _fields() {
|
|
1003
|
+
return a;
|
|
1004
|
+
},
|
|
1005
|
+
get _formValues() {
|
|
1006
|
+
return n;
|
|
1007
|
+
},
|
|
1008
|
+
get _state() {
|
|
1009
|
+
return d;
|
|
1010
|
+
},
|
|
1011
|
+
set _state(r) {
|
|
1012
|
+
d = r;
|
|
1013
|
+
},
|
|
1014
|
+
get _defaultValues() {
|
|
1015
|
+
return l;
|
|
1016
|
+
},
|
|
1017
|
+
get _names() {
|
|
1018
|
+
return c;
|
|
1019
|
+
},
|
|
1020
|
+
set _names(r) {
|
|
1021
|
+
c = r;
|
|
1022
|
+
},
|
|
1023
|
+
get _formState() {
|
|
1024
|
+
return t;
|
|
1025
|
+
},
|
|
1026
|
+
get _options() {
|
|
1027
|
+
return s;
|
|
1028
|
+
},
|
|
1029
|
+
set _options(r) {
|
|
1030
|
+
s = {
|
|
1031
|
+
...s,
|
|
1032
|
+
...r
|
|
1033
|
+
};
|
|
1034
|
+
}
|
|
1035
|
+
},
|
|
1036
|
+
subscribe: At,
|
|
1037
|
+
trigger: ue,
|
|
1038
|
+
register: De,
|
|
1039
|
+
handleSubmit: je,
|
|
1040
|
+
watch: pt,
|
|
1041
|
+
setValue: W,
|
|
1042
|
+
getValues: ve,
|
|
1043
|
+
reset: Ge,
|
|
1044
|
+
resetField: St,
|
|
1045
|
+
clearErrors: Ft,
|
|
1046
|
+
unregister: Se,
|
|
1047
|
+
setError: qe,
|
|
1048
|
+
setFocus: Dt,
|
|
1049
|
+
getFieldState: We
|
|
1050
|
+
};
|
|
1051
|
+
return {
|
|
1052
|
+
...Xe,
|
|
1053
|
+
formControl: Xe
|
|
1054
|
+
};
|
|
1055
|
+
}
|
|
1056
|
+
function ir(e = {}) {
|
|
1057
|
+
const s = F.useRef(void 0), t = F.useRef(void 0), [a, l] = F.useState({
|
|
1058
|
+
isDirty: !1,
|
|
1059
|
+
isValidating: !1,
|
|
1060
|
+
isLoading: Z(e.defaultValues),
|
|
1061
|
+
isSubmitted: !1,
|
|
1062
|
+
isSubmitting: !1,
|
|
1063
|
+
isSubmitSuccessful: !1,
|
|
1064
|
+
isValid: !1,
|
|
1065
|
+
submitCount: 0,
|
|
1066
|
+
dirtyFields: {},
|
|
1067
|
+
touchedFields: {},
|
|
1068
|
+
validatingFields: {},
|
|
1069
|
+
errors: e.errors || {},
|
|
1070
|
+
disabled: e.disabled || !1,
|
|
1071
|
+
isReady: !1,
|
|
1072
|
+
defaultValues: Z(e.defaultValues) ? void 0 : e.defaultValues
|
|
1073
|
+
});
|
|
1074
|
+
if (!s.current)
|
|
1075
|
+
if (e.formControl)
|
|
1076
|
+
s.current = {
|
|
1077
|
+
...e.formControl,
|
|
1078
|
+
formState: a
|
|
1079
|
+
}, e.defaultValues && !Z(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
|
|
1080
|
+
else {
|
|
1081
|
+
const { formControl: d, ...c } = sr(e);
|
|
1082
|
+
s.current = {
|
|
1083
|
+
...c,
|
|
1084
|
+
formState: a
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1087
|
+
const n = s.current.control;
|
|
1088
|
+
return n._options = e, Pe(() => {
|
|
1089
|
+
const d = n._subscribe({
|
|
1090
|
+
formState: n._proxyFormState,
|
|
1091
|
+
callback: () => l({ ...n._formState }),
|
|
1092
|
+
reRenderRoot: !0
|
|
1093
|
+
});
|
|
1094
|
+
return l((c) => ({
|
|
1095
|
+
...c,
|
|
1096
|
+
isReady: !0
|
|
1097
|
+
})), n._formState.isReady = !0, d;
|
|
1098
|
+
}, [n]), F.useEffect(() => n._disableForm(e.disabled), [n, e.disabled]), F.useEffect(() => {
|
|
1099
|
+
e.mode && (n._options.mode = e.mode), e.reValidateMode && (n._options.reValidateMode = e.reValidateMode);
|
|
1100
|
+
}, [n, e.mode, e.reValidateMode]), F.useEffect(() => {
|
|
1101
|
+
e.errors && (n._setErrors(e.errors), n._focusError());
|
|
1102
|
+
}, [n, e.errors]), F.useEffect(() => {
|
|
1103
|
+
e.shouldUnregister && n._subjects.state.next({
|
|
1104
|
+
values: n._getWatch()
|
|
1105
|
+
});
|
|
1106
|
+
}, [n, e.shouldUnregister]), F.useEffect(() => {
|
|
1107
|
+
if (n._proxyFormState.isDirty) {
|
|
1108
|
+
const d = n._getDirty();
|
|
1109
|
+
d !== a.isDirty && n._subjects.state.next({
|
|
1110
|
+
isDirty: d
|
|
1111
|
+
});
|
|
1112
|
+
}
|
|
1113
|
+
}, [n, a.isDirty]), F.useEffect(() => {
|
|
1114
|
+
e.values && !le(e.values, t.current) ? (n._reset(e.values, n._options.resetOptions), t.current = e.values, l((d) => ({ ...d }))) : n._resetDefaultValues();
|
|
1115
|
+
}, [n, e.values]), F.useEffect(() => {
|
|
1116
|
+
n._state.mount || (n._setValid(), n._state.mount = !0), n._state.watch && (n._state.watch = !1, n._subjects.state.next({ ...n._formState })), n._removeUnmounted();
|
|
1117
|
+
}), s.current.formState = gt(a, n), s.current;
|
|
1118
|
+
}
|
|
1119
|
+
const ar = Ut.div`
|
|
1120
|
+
display: flex;
|
|
1121
|
+
align-items: flex-start;
|
|
1122
|
+
gap: 2.5rem;
|
|
1123
|
+
|
|
1124
|
+
& .section__card {
|
|
1125
|
+
display: flex;
|
|
1126
|
+
flex-direction: column;
|
|
1127
|
+
align-items: flex-start;
|
|
1128
|
+
border-radius: 0.75rem;
|
|
1129
|
+
border: 1px solid var(--gray-200, #e4e9f0);
|
|
1130
|
+
background: var(--white, #fff);
|
|
1131
|
+
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
1132
|
+
|
|
1133
|
+
& .card__image {
|
|
1134
|
+
border-top-left-radius: 0.75rem;
|
|
1135
|
+
border-top-right-radius: 0.75rem;
|
|
1136
|
+
max-width: 23.5rem;
|
|
1137
|
+
max-height: 18rem;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
& .card__content {
|
|
1141
|
+
display: flex;
|
|
1142
|
+
padding: 2rem 1.25rem;
|
|
1143
|
+
flex-direction: column;
|
|
1144
|
+
align-items: flex-start;
|
|
1145
|
+
gap: 1.5rem;
|
|
1146
|
+
|
|
1147
|
+
& .card__tile {
|
|
1148
|
+
display: flex;
|
|
1149
|
+
align-items: flex-start;
|
|
1150
|
+
gap: 1rem;
|
|
1151
|
+
|
|
1152
|
+
& .tile__image {
|
|
1153
|
+
display: flex;
|
|
1154
|
+
width: 2.5rem;
|
|
1155
|
+
height: 2.5rem;
|
|
1156
|
+
padding: 0.5rem;
|
|
1157
|
+
align-items: center;
|
|
1158
|
+
aspect-ratio: 1 / 1;
|
|
1159
|
+
border-radius: 999px;
|
|
1160
|
+
background: var(--primary-100, #dcf4f9);
|
|
1161
|
+
color: var(--primary-400, #27b4be);
|
|
1162
|
+
|
|
1163
|
+
& i {
|
|
1164
|
+
&::before {
|
|
1165
|
+
margin-left: 0.1rem;
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
& .tile__content {
|
|
1171
|
+
display: flex;
|
|
1172
|
+
flex-direction: column;
|
|
1173
|
+
align-items: flex-start;
|
|
1174
|
+
gap: 0.25rem;
|
|
1175
|
+
|
|
1176
|
+
& .tile__title {
|
|
1177
|
+
color: var(--gray-900, #0c1520);
|
|
1178
|
+
font-size: 1rem;
|
|
1179
|
+
font-style: normal;
|
|
1180
|
+
font-weight: 500;
|
|
1181
|
+
line-height: 1.5rem;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
& .tile__items {
|
|
1185
|
+
display: flex;
|
|
1186
|
+
flex-direction: column;
|
|
1187
|
+
align-items: flex-start;
|
|
1188
|
+
gap: 0.5rem;
|
|
1189
|
+
|
|
1190
|
+
& .tile__item {
|
|
1191
|
+
color: var(--gray-900, #0c1520);
|
|
1192
|
+
font-size: 0.875rem;
|
|
1193
|
+
font-style: normal;
|
|
1194
|
+
font-weight: 400;
|
|
1195
|
+
line-height: 1.25rem;
|
|
1196
|
+
letter-spacing: 0.0156rem;
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
& .section__form {
|
|
1205
|
+
display: flex;
|
|
1206
|
+
flex-direction: column;
|
|
1207
|
+
gap: 2rem;
|
|
1208
|
+
|
|
1209
|
+
& .form__title {
|
|
1210
|
+
color: var(--gray-900, #0c1520);
|
|
1211
|
+
font-size: 1.5rem;
|
|
1212
|
+
font-style: normal;
|
|
1213
|
+
font-weight: 600;
|
|
1214
|
+
line-height: 2rem;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
& .form__description {
|
|
1218
|
+
color: var(--gray-500, #7a8594);
|
|
1219
|
+
font-size: 1rem;
|
|
1220
|
+
font-style: normal;
|
|
1221
|
+
font-weight: 500;
|
|
1222
|
+
line-height: 1.5rem;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
& .form__fields {
|
|
1226
|
+
display: flex;
|
|
1227
|
+
flex-direction: column;
|
|
1228
|
+
align-items: flex-start;
|
|
1229
|
+
gap: 1.25rem;
|
|
1230
|
+
|
|
1231
|
+
& .form__field {
|
|
1232
|
+
display: flex;
|
|
1233
|
+
align-items: center;
|
|
1234
|
+
gap: 0.75rem;
|
|
1235
|
+
width: 100%;
|
|
1236
|
+
|
|
1237
|
+
&.right {
|
|
1238
|
+
justify-content: flex-end;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
& .field__wrapper {
|
|
1242
|
+
display: flex;
|
|
1243
|
+
flex-direction: column;
|
|
1244
|
+
width: 100%;
|
|
1245
|
+
|
|
1246
|
+
& .field__hint {
|
|
1247
|
+
color: var(--gray-400, #96a2b2);
|
|
1248
|
+
font-size: 0.75rem;
|
|
1249
|
+
font-style: normal;
|
|
1250
|
+
font-weight: 400;
|
|
1251
|
+
line-height: 1rem;
|
|
1252
|
+
letter-spacing: 0.01px;
|
|
1253
|
+
align-self: flex-end;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
& .field__checkbox-input {
|
|
1257
|
+
& input {
|
|
1258
|
+
&:focus ~ .checkmark {
|
|
1259
|
+
outline: none;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
&:checked ~ .checkmark {
|
|
1263
|
+
background: var(--primary-500, #ff7621);
|
|
1264
|
+
border: 1px solid var(--primary-400, #ff914d);
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
& .checkbox-label {
|
|
1269
|
+
color: var(--gray-900, #0c1520);
|
|
1270
|
+
font-size: 0.875rem;
|
|
1271
|
+
font-style: normal;
|
|
1272
|
+
font-weight: 400;
|
|
1273
|
+
line-height: 1.25rem;
|
|
1274
|
+
letter-spacing: -0.09px;
|
|
1275
|
+
|
|
1276
|
+
& a {
|
|
1277
|
+
font-weight: 500;
|
|
1278
|
+
color: var(--gray-900, #0c1520);
|
|
1279
|
+
|
|
1280
|
+
&:hover {
|
|
1281
|
+
color: var(--gray-900, #0c1520);
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
& .field__text-input {
|
|
1289
|
+
height: 2.75rem;
|
|
1290
|
+
min-height: 2.75rem;
|
|
1291
|
+
border-radius: 0.75rem;
|
|
1292
|
+
border: 1px solid var(--gray-200, #e4e9f0);
|
|
1293
|
+
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
1294
|
+
width: 100%;
|
|
1295
|
+
outline: none;
|
|
1296
|
+
|
|
1297
|
+
&.text-area {
|
|
1298
|
+
height: 100%;
|
|
1299
|
+
min-height: 100%;
|
|
1300
|
+
border: none;
|
|
1301
|
+
box-shadow: none;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
& input::placeholder {
|
|
1305
|
+
color: var(--gray-500, #7a8594);
|
|
1306
|
+
font-size: 0.875rem;
|
|
1307
|
+
font-style: normal;
|
|
1308
|
+
font-weight: 400;
|
|
1309
|
+
line-height: 1.25rem;
|
|
1310
|
+
letter-spacing: 0.0156rem;
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
& textarea {
|
|
1314
|
+
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
1315
|
+
|
|
1316
|
+
&::placeholder {
|
|
1317
|
+
color: var(--gray-500, #7a8594);
|
|
1318
|
+
font-size: 0.875rem;
|
|
1319
|
+
font-style: normal;
|
|
1320
|
+
font-weight: 400;
|
|
1321
|
+
line-height: 1.25rem;
|
|
1322
|
+
letter-spacing: 0.0156rem;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
&:focus {
|
|
1326
|
+
outline: none;
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
& button {
|
|
1332
|
+
min-width: 9rem;
|
|
1333
|
+
padding: 0.5rem;
|
|
1334
|
+
color: var(--white, #fff);
|
|
1335
|
+
font-size: 0.875rem;
|
|
1336
|
+
font-style: normal;
|
|
1337
|
+
font-weight: 600;
|
|
1338
|
+
line-height: 1.25rem;
|
|
1339
|
+
letter-spacing: 0.1px;
|
|
1340
|
+
|
|
1341
|
+
background: var(
|
|
1342
|
+
--Linear-button,
|
|
1343
|
+
linear-gradient(0deg, #ff7621 0%, #ff9706 100%)
|
|
1344
|
+
);
|
|
1345
|
+
|
|
1346
|
+
&:hover {
|
|
1347
|
+
background: var(
|
|
1348
|
+
--Linear-button-switched,
|
|
1349
|
+
linear-gradient(0deg, #ff9706 0%, #ff7621 100%)
|
|
1350
|
+
);
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
&:focus {
|
|
1354
|
+
outline: none;
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
& .section__divider {
|
|
1362
|
+
width: 100%;
|
|
1363
|
+
height: 1px;
|
|
1364
|
+
background: var(--gray-200, #e4e9f0);
|
|
1365
|
+
display: none;
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
@media (max-width: ${It + "px"}) {
|
|
1369
|
+
flex-direction: column;
|
|
1370
|
+
|
|
1371
|
+
& .section__divider {
|
|
1372
|
+
order: 1;
|
|
1373
|
+
display: block;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
& .section__card {
|
|
1377
|
+
width: 100%;
|
|
1378
|
+
border: none;
|
|
1379
|
+
background: transparent;
|
|
1380
|
+
box-shadow: none;
|
|
1381
|
+
order: 2;
|
|
1382
|
+
|
|
1383
|
+
& .card__image {
|
|
1384
|
+
display: none;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
& .card__content {
|
|
1388
|
+
padding: 0;
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
& .section__form {
|
|
1393
|
+
order: 0;
|
|
1394
|
+
|
|
1395
|
+
& .form__title {
|
|
1396
|
+
font-size: 1rem;
|
|
1397
|
+
font-style: normal;
|
|
1398
|
+
font-weight: 500;
|
|
1399
|
+
line-height: 1.5rem;
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
& .form__description {
|
|
1403
|
+
color: var(--gray-500, #7a8594);
|
|
1404
|
+
font-size: 0.875rem;
|
|
1405
|
+
font-style: normal;
|
|
1406
|
+
font-weight: 400;
|
|
1407
|
+
line-height: 1.25rem;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
& .form__fields {
|
|
1411
|
+
& .form__field {
|
|
1412
|
+
flex-direction: column;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
& button {
|
|
1416
|
+
width: 100%;
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
`, lr = Lt(
|
|
1422
|
+
({
|
|
1423
|
+
title: e,
|
|
1424
|
+
description: s,
|
|
1425
|
+
image: t,
|
|
1426
|
+
phoneText: a,
|
|
1427
|
+
phones: l = [],
|
|
1428
|
+
emailText: n,
|
|
1429
|
+
emails: d = [],
|
|
1430
|
+
fullNamePlaceholderText: c = "Name Surname",
|
|
1431
|
+
emailPlaceholderText: v = "E-mail",
|
|
1432
|
+
subjectPlaceholderText: O = "Subject",
|
|
1433
|
+
messagePlaceholderText: w = "Message",
|
|
1434
|
+
messageMaxLength: S = 250,
|
|
1435
|
+
hasAgrement: h = !1,
|
|
1436
|
+
agrementText: J = "I agree with Privacy policy.",
|
|
1437
|
+
submitText: H = "Submit",
|
|
1438
|
+
onSubmit: E = () => {
|
|
1439
|
+
}
|
|
1440
|
+
}, N) => {
|
|
1441
|
+
const { watch: G, handleSubmit: _, control: I } = ir(), M = G("message");
|
|
1442
|
+
return /* @__PURE__ */ K(ar, { ref: N, children: [
|
|
1443
|
+
/* @__PURE__ */ K("div", { className: "section__card", children: [
|
|
1444
|
+
/* @__PURE__ */ A("img", { src: t, alt: "Contact", className: "card__image" }),
|
|
1445
|
+
/* @__PURE__ */ K("div", { className: "card__content", children: [
|
|
1446
|
+
(l == null ? void 0 : l.length) > 0 && /* @__PURE__ */ K("div", { className: "card__tile", children: [
|
|
1447
|
+
/* @__PURE__ */ A(
|
|
1448
|
+
Qe,
|
|
1449
|
+
{
|
|
1450
|
+
icon: " mng-lnc-phone--filled",
|
|
1451
|
+
sizeInUnits: "1.25rem",
|
|
1452
|
+
className: "tile__image"
|
|
1453
|
+
}
|
|
1454
|
+
),
|
|
1455
|
+
/* @__PURE__ */ K("div", { className: "tile__content", children: [
|
|
1456
|
+
/* @__PURE__ */ A("div", { className: "tile__title", children: a }),
|
|
1457
|
+
/* @__PURE__ */ A("div", { className: "tile__items", children: l == null ? void 0 : l.map((b, se) => /* @__PURE__ */ A(
|
|
1458
|
+
"div",
|
|
1459
|
+
{
|
|
1460
|
+
className: "tile__item",
|
|
1461
|
+
children: b
|
|
1462
|
+
},
|
|
1463
|
+
`contanct-section-phone__${se}`
|
|
1464
|
+
)) })
|
|
1465
|
+
] })
|
|
1466
|
+
] }),
|
|
1467
|
+
(d == null ? void 0 : d.length) > 0 && /* @__PURE__ */ K("div", { className: "card__tile", children: [
|
|
1468
|
+
/* @__PURE__ */ A(
|
|
1469
|
+
Qe,
|
|
1470
|
+
{
|
|
1471
|
+
icon: " mng-lnc-email-filled",
|
|
1472
|
+
sizeInUnits: "1.25rem",
|
|
1473
|
+
className: "tile__image"
|
|
1474
|
+
}
|
|
1475
|
+
),
|
|
1476
|
+
/* @__PURE__ */ K("div", { className: "tile__content", children: [
|
|
1477
|
+
/* @__PURE__ */ A("div", { className: "tile__title", children: n }),
|
|
1478
|
+
/* @__PURE__ */ A("div", { className: "tile__items", children: d == null ? void 0 : d.map((b, se) => /* @__PURE__ */ A(
|
|
1479
|
+
"div",
|
|
1480
|
+
{
|
|
1481
|
+
className: "tile__item",
|
|
1482
|
+
children: b
|
|
1483
|
+
},
|
|
1484
|
+
`contanct-section-email__${se}`
|
|
1485
|
+
)) })
|
|
1486
|
+
] })
|
|
1487
|
+
] })
|
|
1488
|
+
] })
|
|
1489
|
+
] }),
|
|
1490
|
+
/* @__PURE__ */ A("div", { className: "section__divider" }),
|
|
1491
|
+
/* @__PURE__ */ K("div", { className: "section__form", children: [
|
|
1492
|
+
/* @__PURE__ */ K("div", { children: [
|
|
1493
|
+
e && /* @__PURE__ */ A("div", { className: "form__title", children: e }),
|
|
1494
|
+
s && /* @__PURE__ */ A("div", { className: "form__description", children: s })
|
|
1495
|
+
] }),
|
|
1496
|
+
/* @__PURE__ */ A("div", { children: /* @__PURE__ */ K("div", { className: "form__fields", children: [
|
|
1497
|
+
/* @__PURE__ */ K("div", { className: "form__field", children: [
|
|
1498
|
+
/* @__PURE__ */ A(
|
|
1499
|
+
fe,
|
|
1500
|
+
{
|
|
1501
|
+
control: I,
|
|
1502
|
+
name: "fullName",
|
|
1503
|
+
render: ({ field: b }) => /* @__PURE__ */ A(
|
|
1504
|
+
Te,
|
|
1505
|
+
{
|
|
1506
|
+
...b,
|
|
1507
|
+
className: "field__text-input",
|
|
1508
|
+
color: "neutral",
|
|
1509
|
+
placeholder: c,
|
|
1510
|
+
debounceTime: 200
|
|
1511
|
+
}
|
|
1512
|
+
)
|
|
1513
|
+
}
|
|
1514
|
+
),
|
|
1515
|
+
/* @__PURE__ */ A(
|
|
1516
|
+
fe,
|
|
1517
|
+
{
|
|
1518
|
+
control: I,
|
|
1519
|
+
name: "email",
|
|
1520
|
+
render: ({ field: b }) => /* @__PURE__ */ A(
|
|
1521
|
+
Te,
|
|
1522
|
+
{
|
|
1523
|
+
...b,
|
|
1524
|
+
className: "field__text-input",
|
|
1525
|
+
color: "neutral",
|
|
1526
|
+
placeholder: v,
|
|
1527
|
+
debounceTime: 200
|
|
1528
|
+
}
|
|
1529
|
+
)
|
|
1530
|
+
}
|
|
1531
|
+
)
|
|
1532
|
+
] }),
|
|
1533
|
+
/* @__PURE__ */ A("div", { className: "form__field", children: /* @__PURE__ */ A(
|
|
1534
|
+
fe,
|
|
1535
|
+
{
|
|
1536
|
+
control: I,
|
|
1537
|
+
name: "subject",
|
|
1538
|
+
render: ({ field: b }) => /* @__PURE__ */ A(
|
|
1539
|
+
Te,
|
|
1540
|
+
{
|
|
1541
|
+
...b,
|
|
1542
|
+
className: "field__text-input",
|
|
1543
|
+
color: "neutral",
|
|
1544
|
+
placeholder: O,
|
|
1545
|
+
debounceTime: 200
|
|
1546
|
+
}
|
|
1547
|
+
)
|
|
1548
|
+
}
|
|
1549
|
+
) }),
|
|
1550
|
+
/* @__PURE__ */ A("div", { className: "form__field", children: /* @__PURE__ */ K("div", { className: "field__wrapper", children: [
|
|
1551
|
+
/* @__PURE__ */ A(
|
|
1552
|
+
fe,
|
|
1553
|
+
{
|
|
1554
|
+
control: I,
|
|
1555
|
+
name: "message",
|
|
1556
|
+
render: ({ field: b }) => /* @__PURE__ */ A(
|
|
1557
|
+
Rt,
|
|
1558
|
+
{
|
|
1559
|
+
...b,
|
|
1560
|
+
className: "field__text-input text-area",
|
|
1561
|
+
color: "neutral",
|
|
1562
|
+
placeholder: w,
|
|
1563
|
+
debounceTime: 200,
|
|
1564
|
+
minRows: 7,
|
|
1565
|
+
maxLength: S
|
|
1566
|
+
}
|
|
1567
|
+
)
|
|
1568
|
+
}
|
|
1569
|
+
),
|
|
1570
|
+
/* @__PURE__ */ A("div", { className: "field__hint", children: `${(M == null ? void 0 : M.length) || 0}/${S}` }),
|
|
1571
|
+
h && /* @__PURE__ */ A(
|
|
1572
|
+
fe,
|
|
1573
|
+
{
|
|
1574
|
+
control: I,
|
|
1575
|
+
name: "agrement",
|
|
1576
|
+
render: ({ field: b }) => /* @__PURE__ */ A(
|
|
1577
|
+
Ot,
|
|
1578
|
+
{
|
|
1579
|
+
...b,
|
|
1580
|
+
label: J,
|
|
1581
|
+
size: "medium",
|
|
1582
|
+
className: "field__checkbox-input"
|
|
1583
|
+
}
|
|
1584
|
+
)
|
|
1585
|
+
}
|
|
1586
|
+
)
|
|
1587
|
+
] }) }),
|
|
1588
|
+
/* @__PURE__ */ A("div", { className: "form__field right", children: /* @__PURE__ */ A(Mt, { text: H, onClick: _(E) }) })
|
|
1589
|
+
] }) })
|
|
1590
|
+
] })
|
|
1591
|
+
] });
|
|
1592
|
+
}
|
|
1593
|
+
);
|
|
1594
|
+
lr.propTypes = {
|
|
1595
|
+
title: P.string,
|
|
1596
|
+
description: P.string,
|
|
1597
|
+
image: P.string,
|
|
1598
|
+
phoneText: P.string,
|
|
1599
|
+
phones: P.array,
|
|
1600
|
+
emailText: P.string,
|
|
1601
|
+
emails: P.array,
|
|
1602
|
+
fullNamePlaceholderText: P.string,
|
|
1603
|
+
emailPlaceholderText: P.string,
|
|
1604
|
+
subjectPlaceholderText: P.string,
|
|
1605
|
+
messagePlaceholderText: P.string,
|
|
1606
|
+
messageMaxLength: P.number,
|
|
1607
|
+
hasAgrement: P.bool,
|
|
1608
|
+
agrementText: P.string,
|
|
1609
|
+
submitText: P.string,
|
|
1610
|
+
onSubmit: P.func
|
|
1611
|
+
};
|
|
1612
|
+
export {
|
|
1613
|
+
lr as default
|
|
1614
|
+
};
|