@axos-web-dev/shared-components 1.0.18 → 1.0.20
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/ATMLocator/ATMLocator.js +15 -13
- package/dist/Accordion/Accordion.js +1 -1
- package/dist/Button/Button.js +2 -0
- package/dist/Calculators/AxosOneCalculator/index.js +1 -1
- package/dist/Calculators/BalanceAPYCalculator/index.js +1 -1
- package/dist/Calculators/BuyDownCalculator/BuyDownCalculator.css.d.ts +101 -0
- package/dist/Calculators/BuyDownCalculator/BuyDownCalculator.css.js +56 -0
- package/dist/Calculators/BuyDownCalculator/index.d.ts +25 -0
- package/dist/Calculators/BuyDownCalculator/index.js +868 -0
- package/dist/Calculators/Calculator.js +11 -0
- package/dist/Calculators/MarginTradingCalculator/index.js +2 -2
- package/dist/Calculators/SummitApyCalculator/index.js +1 -1
- package/dist/Calculators/index.d.ts +1 -0
- package/dist/Calculators/index.js +2 -0
- package/dist/CallToActionBar/index.js +1 -1
- package/dist/Carousel/index.js +3 -1
- package/dist/Chevron/index.js +3 -1
- package/dist/Comparison/Comparison.js +3 -1
- package/dist/Comparison/ComparisonSet.js +1 -1
- package/dist/ExecutiveBio/ExecutiveBio.js +2 -0
- package/dist/FaqAccordion/index.js +3 -1
- package/dist/FooterDisclosure/LVF/LaVictorieFooter.js +1 -1
- package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +2 -0
- package/dist/Forms/ApplicationStart.js +1 -1
- package/dist/Forms/ApplyNow.js +3 -1
- package/dist/Forms/ClearingForm.js +1 -1
- package/dist/Forms/CommercialDeposits.js +1 -1
- package/dist/Forms/CommercialLending.js +1 -1
- package/dist/Forms/ContactCompany.js +1 -1
- package/dist/Forms/ContactCompanyTitle.js +1 -1
- package/dist/Forms/ContactUs.js +1 -1
- package/dist/Forms/ContactUsAAS.js +1 -1
- package/dist/Forms/ContactUsBusiness.js +3 -1
- package/dist/Forms/ContactUsLVF.js +1 -1
- package/dist/Forms/ContactUsNMLSId.js +3 -1
- package/dist/Forms/CpraRequest.js +1 -1
- package/dist/Forms/CraPublicFile.js +3 -1
- package/dist/Forms/DealerServices.js +1 -1
- package/dist/Forms/EmailOnly.js +3 -1
- package/dist/Forms/EmailUs.js +1 -1
- package/dist/Forms/FormEnums.d.ts +21 -0
- package/dist/Forms/FormEnums.js +187 -0
- package/dist/Forms/MortgageRate/MortgageRateForm.js +3 -1
- package/dist/Forms/MortgageRate/MortgageRateQuoteFilters.js +1 -1
- package/dist/Forms/MortgageRate/MortgageRateWatch.js +2 -0
- package/dist/Forms/QuickPricer/QuickPricerForm.js +2 -2
- package/dist/Forms/ScheduleCall.js +1 -1
- package/dist/Forms/ScheduleCallPremier.js +1 -1
- package/dist/Forms/SuccesForm.js +15 -13
- package/dist/Forms/VendorQuestionnaire.js +1 -1
- package/dist/Forms/WcplSurvey.js +1 -1
- package/dist/HeroBanner/HeroBanner.js +1 -1
- package/dist/Hyperlink/index.js +2 -0
- package/dist/IconBillboard/IconBillboard.js +1 -1
- package/dist/ImageBillboard/ExitIntentModal/ModalWrapper.d.ts +9 -0
- package/dist/ImageBillboard/ExitIntentModal/ModalWrapper.js +85 -0
- package/dist/ImageBillboard/ExitIntentModal/useExitIntentModal.d.ts +5 -0
- package/dist/ImageBillboard/ExitIntentModal/useExitIntentModal.js +90 -0
- package/dist/ImageBillboard/ImageBillboard.css.d.ts +3 -0
- package/dist/ImageBillboard/ImageBillboard.css.js +6 -0
- package/dist/ImageBillboard/ImageBillboard.interface.d.ts +1 -0
- package/dist/ImageBillboard/ImageBillboardSet.d.ts +1 -1
- package/dist/ImageBillboard/ImageBillboardSet.js +24 -6
- package/dist/ImageBillboard/index.js +4 -1
- package/dist/ImageLink/ImageLink.js +2 -0
- package/dist/ImageLink/ImageLinkSet.js +2 -0
- package/dist/ImageLink/index.js +2 -0
- package/dist/Input/Checkbox.js +2 -1
- package/dist/Input/Input.js +2 -1
- package/dist/Input/PercentageInput.d.ts +3 -0
- package/dist/Input/PercentageInput.js +32 -0
- package/dist/Input/RadioButton.js +12 -3
- package/dist/Insight/Featured/CategorySelector.js +4 -2
- package/dist/Insight/Featured/Featured.js +3 -1
- package/dist/Insight/Featured/Header.js +3 -1
- package/dist/Modal/Modal.js +2 -0
- package/dist/Modal/contextApi/store.js +1 -1
- package/dist/NavigationMenu/AxosALTS/NavData.js +2 -0
- package/dist/NavigationMenu/AxosALTS/index.js +2 -0
- package/dist/NavigationMenu/AxosBank/NavData.js +2 -0
- package/dist/NavigationMenu/AxosBank/SubNavBar.js +2 -0
- package/dist/NavigationMenu/AxosBank/index.js +2 -0
- package/dist/NavigationMenu/LaVictoire/NavData.js +2 -0
- package/dist/NavigationMenu/LaVictoire/index.js +2 -0
- package/dist/PageNavSet/PageNavSet.js +1 -1
- package/dist/Pagination/Pagination.js +1 -1
- package/dist/SecondaryFooter/index.js +1 -1
- package/dist/SetContainer/SetContainer.js +3 -1
- package/dist/SocialMediaBar/iconsRepository.js +2 -0
- package/dist/Table/Table.js +1 -1
- package/dist/TextBlock/TextBlock.js +1 -1
- package/dist/VideoWrapper/index.js +2 -0
- package/dist/assets/Calculators/BuyDownCalculator/BuyDownCalculator.css +197 -0
- package/dist/assets/ImageBillboard/ImageBillboard.css +106 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +6 -1
- package/package.json +130 -130
|
@@ -0,0 +1,868 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
+
import "../../utils/allowedAxosDomains.js";
|
|
4
|
+
import { getVariant } from "../../utils/getVariant.js";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { calc_container, calculator_section, section_header, theme_header, mt_8, buydown_calculator_form, row_form, limit_one, calculate_row, form_wrapper, form_disclosure } from "./BuyDownCalculator.css.js";
|
|
7
|
+
import { Checkbox } from "../../Input/Checkbox.js";
|
|
8
|
+
import { CurrencyInput } from "../../Input/CurrencyInput.js";
|
|
9
|
+
import { Dropdown } from "../../Input/Dropdown.js";
|
|
10
|
+
import "../../Input/Dropdown.css.js";
|
|
11
|
+
import { Input } from "../../Input/Input.js";
|
|
12
|
+
import "../../Input/Input.css.js";
|
|
13
|
+
import "../../Input/InputAmount.js";
|
|
14
|
+
import "../../Input/InputPhone.js";
|
|
15
|
+
import "../../Input/InputTextArea.js";
|
|
16
|
+
import "../../Input/DownPaymentInput.js";
|
|
17
|
+
import { RadioButtonSet, RadioButton } from "../../Input/RadioButton.js";
|
|
18
|
+
import { z } from "zod";
|
|
19
|
+
import { useForm, FormProvider } from "react-hook-form";
|
|
20
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
21
|
+
import { PercentageInput } from "../../Input/PercentageInput.js";
|
|
22
|
+
import { Program, Fico, BuydownRate, BuydownTerm, LoanRates } from "../../Forms/FormEnums.js";
|
|
23
|
+
import { Button } from "../../Button/Button.js";
|
|
24
|
+
import "../../Button/Button.css.js";
|
|
25
|
+
import "react-use";
|
|
26
|
+
import clsx from "clsx";
|
|
27
|
+
const BuyDownCalculator = ({
|
|
28
|
+
header,
|
|
29
|
+
body,
|
|
30
|
+
disclosure,
|
|
31
|
+
variant
|
|
32
|
+
}) => {
|
|
33
|
+
const [loanRange, setLoanRange] = useState("");
|
|
34
|
+
const [financedAmount, setFinancedAmount] = useState("");
|
|
35
|
+
const [downPaymentPercentage, setDownPaymentPercentage] = useState("");
|
|
36
|
+
const [loanToValue, setLoanToValue] = useState("");
|
|
37
|
+
const [downPaymentQualifies, setDownPaymentQualifies] = useState("");
|
|
38
|
+
const [totalRateBuydown, setTotalRateBuydown] = useState("");
|
|
39
|
+
const [finalNoteRate, setFinalNoteRate] = useState("");
|
|
40
|
+
const [manuContributionPercentage, setManuContributionPercentage] = useState("");
|
|
41
|
+
const [buydownPayment, setBuydownPayment] = useState("");
|
|
42
|
+
const [manuContributionAmount, setManuContributionAmount] = useState("");
|
|
43
|
+
const [nonBuydownPayment, setNonBuydownPayment] = useState("");
|
|
44
|
+
const [totalBuydownCost, setTotalBuydownCost] = useState("");
|
|
45
|
+
const [monthlySavings, setMonthlySavings] = useState("");
|
|
46
|
+
const [dealerContributionAmount, setDealerContributionAmount] = useState("");
|
|
47
|
+
const [enableFullTimeCharter, setEnableFullTimeCharter] = useState(false);
|
|
48
|
+
const [disableMooringOutside, setDisableMooringOutside] = useState(false);
|
|
49
|
+
const [disableLTVAbove60, setDisableLTVAbove60] = useState(true);
|
|
50
|
+
const schema = z.object({
|
|
51
|
+
purchasePrice: z.string().min(1, { message: "Loan amount is required." }).transform((val) => {
|
|
52
|
+
return formatToNumber(val);
|
|
53
|
+
}),
|
|
54
|
+
downpayment: z.string().min(1, { message: "Down Payment is required." }).transform((val) => {
|
|
55
|
+
return formatToNumber(val);
|
|
56
|
+
}),
|
|
57
|
+
dealerContribution: z.string().min(1, { message: "Dealer Contribution is required." }).transform((val) => {
|
|
58
|
+
return formatToNumber(val);
|
|
59
|
+
}),
|
|
60
|
+
program: z.string().min(1, { message: "Program is required." }),
|
|
61
|
+
fico: z.string().min(1, { message: "FICO is required." }),
|
|
62
|
+
buydownRate: z.string().min(1, { message: "Buydown Rate is required." }).transform((val) => {
|
|
63
|
+
return formatToNumber(val);
|
|
64
|
+
}),
|
|
65
|
+
buydownTerm: z.string().min(1, { message: "Buydown Term is required." }).transform((val) => {
|
|
66
|
+
return formatToNumber(val);
|
|
67
|
+
})
|
|
68
|
+
}).superRefine((values, ctx) => {
|
|
69
|
+
const { purchasePrice, downpayment, program } = values;
|
|
70
|
+
if (purchasePrice && downpayment) {
|
|
71
|
+
const financedAmount2 = purchasePrice - downpayment;
|
|
72
|
+
const range = getRange(financedAmount2);
|
|
73
|
+
const disableLTV = checkLTVStatus(downpayment, purchasePrice);
|
|
74
|
+
if (financedAmount2 < 0) {
|
|
75
|
+
ctx.addIssue({
|
|
76
|
+
code: z.ZodIssueCode.custom,
|
|
77
|
+
path: ["downpayment"],
|
|
78
|
+
message: "Down Payment should be lower than Purchase Price"
|
|
79
|
+
});
|
|
80
|
+
} else {
|
|
81
|
+
if (program) {
|
|
82
|
+
const loanRange2 = getRange(financedAmount2, program);
|
|
83
|
+
setLoanRange(loanRange2);
|
|
84
|
+
}
|
|
85
|
+
if (!disableLTV) {
|
|
86
|
+
setDisableLTVAbove60(false);
|
|
87
|
+
} else {
|
|
88
|
+
setDisableLTVAbove60(true);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (updateFicoRequirements(range, program) === false) {
|
|
92
|
+
ctx.addIssue({
|
|
93
|
+
code: z.ZodIssueCode.custom,
|
|
94
|
+
path: ["fico"],
|
|
95
|
+
message: "Selected FICO is not within range for selected program."
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
const methods = useForm({
|
|
101
|
+
resolver: zodResolver(schema, {
|
|
102
|
+
async: true
|
|
103
|
+
}),
|
|
104
|
+
mode: "all"
|
|
105
|
+
});
|
|
106
|
+
const {
|
|
107
|
+
handleSubmit,
|
|
108
|
+
register,
|
|
109
|
+
watch,
|
|
110
|
+
setValue,
|
|
111
|
+
formState: { errors, isValid }
|
|
112
|
+
} = methods;
|
|
113
|
+
const calculator_variant = getVariant(variant);
|
|
114
|
+
const fullTimeCharterChecked = watch("fullTimeCharter", false);
|
|
115
|
+
const enableDependentInputs = enableFullTimeCharter && fullTimeCharterChecked;
|
|
116
|
+
const formatToNumber = (value) => {
|
|
117
|
+
const cleanValue = value.replace(/[%$, ]/gi, "");
|
|
118
|
+
return parseFloat(cleanValue);
|
|
119
|
+
};
|
|
120
|
+
const formatToCurrency = (value) => {
|
|
121
|
+
return value.toLocaleString("en-US", {
|
|
122
|
+
style: "currency",
|
|
123
|
+
currency: "USD",
|
|
124
|
+
minimumFractionDigits: 2,
|
|
125
|
+
maximumFractionDigits: 2
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
const formatToPercentage = (value) => {
|
|
129
|
+
return value.toLocaleString("en-US", {
|
|
130
|
+
minimumFractionDigits: 2,
|
|
131
|
+
maximumFractionDigits: 2
|
|
132
|
+
}) + "%";
|
|
133
|
+
};
|
|
134
|
+
const checkLTVStatus = (downpayment, purchasePrice) => {
|
|
135
|
+
const percentage = downpayment / purchasePrice * 100;
|
|
136
|
+
const loanToValue2 = 100 - percentage;
|
|
137
|
+
if (loanToValue2 <= 60) return false;
|
|
138
|
+
else return true;
|
|
139
|
+
};
|
|
140
|
+
const getRange = (financedAmount2, program, forRates) => {
|
|
141
|
+
let range = "";
|
|
142
|
+
if (forRates) {
|
|
143
|
+
if (financedAmount2 <= 1e5) {
|
|
144
|
+
range = "$75,000 ≤ $100,000";
|
|
145
|
+
} else if (financedAmount2 <= 15e4) {
|
|
146
|
+
range = "$100,001 ≤ $150,000";
|
|
147
|
+
} else if (financedAmount2 <= 25e4) {
|
|
148
|
+
range = "$150,001 ≤ $250,000";
|
|
149
|
+
} else if (financedAmount2 <= 5e5) {
|
|
150
|
+
range = "$250,001 ≤ $500,000";
|
|
151
|
+
} else if (financedAmount2 <= 15e5) {
|
|
152
|
+
range = "$500,001 ≤ $1,500,000";
|
|
153
|
+
} else if (financedAmount2 <= 2e6) {
|
|
154
|
+
range = "$1,500,001 ≤ $2,000,000";
|
|
155
|
+
} else if (financedAmount2 > 2e6) {
|
|
156
|
+
range = "> $2,000,000";
|
|
157
|
+
}
|
|
158
|
+
return range;
|
|
159
|
+
}
|
|
160
|
+
if (program) {
|
|
161
|
+
if (program?.includes("20")) {
|
|
162
|
+
if (financedAmount2 <= 15e4) {
|
|
163
|
+
range = "$75,000 ≤ $150,000";
|
|
164
|
+
} else if (financedAmount2 <= 25e4) {
|
|
165
|
+
range = "$150,001 ≤ $250,000";
|
|
166
|
+
} else if (financedAmount2 <= 5e5) {
|
|
167
|
+
range = "$250,001 ≤ $500,000";
|
|
168
|
+
} else if (financedAmount2 <= 15e5) {
|
|
169
|
+
range = "$500,001 ≤ $1,500,000";
|
|
170
|
+
} else if (financedAmount2 <= 2e6) {
|
|
171
|
+
range = "$1,500,001 ≤ $2,000,000";
|
|
172
|
+
} else if (financedAmount2 > 2e6) {
|
|
173
|
+
range = "> $2,000,000";
|
|
174
|
+
}
|
|
175
|
+
} else {
|
|
176
|
+
if (financedAmount2 <= 15e4) {
|
|
177
|
+
range = "$75,000 ≤ $150,000";
|
|
178
|
+
} else if (financedAmount2 <= 25e4) {
|
|
179
|
+
range = "$150,001 ≤ $250,000";
|
|
180
|
+
} else if (financedAmount2 <= 15e5) {
|
|
181
|
+
range = "$250,001 ≤ $1,500,000";
|
|
182
|
+
} else if (financedAmount2 <= 2e6) {
|
|
183
|
+
range = "$1,500,001 ≤ $2,000,000";
|
|
184
|
+
} else if (financedAmount2 > 2e6) {
|
|
185
|
+
range = "> $2,000,000";
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
} else {
|
|
189
|
+
if (financedAmount2 <= 15e4) {
|
|
190
|
+
range = "$75,000 ≤ $150,000";
|
|
191
|
+
} else if (financedAmount2 <= 25e4) {
|
|
192
|
+
range = "$150,001 ≤ $250,000";
|
|
193
|
+
} else if (financedAmount2 <= 5e5) {
|
|
194
|
+
range = "$250,001 ≤ $500,000";
|
|
195
|
+
} else if (financedAmount2 <= 15e5) {
|
|
196
|
+
range = "$500,001 ≤ $1,500,000";
|
|
197
|
+
} else if (financedAmount2 <= 2e6) {
|
|
198
|
+
range = "$1,500,001 ≤ $2,000,000";
|
|
199
|
+
} else if (financedAmount2 > 2e6) {
|
|
200
|
+
range = "> $2,000,000";
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return range;
|
|
204
|
+
};
|
|
205
|
+
const handleProgramChange = (event) => {
|
|
206
|
+
const value = event.target.value;
|
|
207
|
+
if (value !== "20 Year Fixed - Personal Use/Limited Charter") {
|
|
208
|
+
setEnableFullTimeCharter(true);
|
|
209
|
+
setDisableMooringOutside(false);
|
|
210
|
+
if (value === "20 Year Fixed - Full Time Charter") {
|
|
211
|
+
setValue("mooringOutsideContinentalUS", false);
|
|
212
|
+
setDisableMooringOutside(true);
|
|
213
|
+
}
|
|
214
|
+
} else {
|
|
215
|
+
setValue("mooringOutsideContinentalUS", false);
|
|
216
|
+
setValue("operatingAccount", false);
|
|
217
|
+
setValue("fullTimeCharter", false);
|
|
218
|
+
setEnableFullTimeCharter(false);
|
|
219
|
+
setDisableMooringOutside(true);
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
const updateFicoRequirements = (loanRangeValue, program) => {
|
|
223
|
+
const ficoOptionsToDisable = ["700-719", "720-759"];
|
|
224
|
+
const ficoSelect = document.getElementById("fico");
|
|
225
|
+
if ((program === "3/6 SOFR ARM" || program === "5/6 SOFR ARM") && loanRangeValue === "> $2,000,000") {
|
|
226
|
+
ficoOptionsToDisable.forEach((value) => {
|
|
227
|
+
const option = Array.from(ficoSelect.options).find(
|
|
228
|
+
(opt) => opt.value === value
|
|
229
|
+
);
|
|
230
|
+
if (option) {
|
|
231
|
+
option.disabled = true;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
if (ficoOptionsToDisable.includes(ficoSelect.value)) {
|
|
235
|
+
setValue("fico", "760-799");
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
} else {
|
|
239
|
+
ficoOptionsToDisable.forEach((value) => {
|
|
240
|
+
const option = Array.from(ficoSelect.options).find(
|
|
241
|
+
(opt) => opt.value === value
|
|
242
|
+
);
|
|
243
|
+
if (option) {
|
|
244
|
+
option.disabled = false;
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
return true;
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
const calculateDownpaymentQualifies = (program, purchasePrice, downpayment) => {
|
|
251
|
+
let threshold, thresholdMessage;
|
|
252
|
+
if (program.includes("20 Year Fixed")) {
|
|
253
|
+
threshold = 0.2;
|
|
254
|
+
thresholdMessage = "20% Min Amount Needed";
|
|
255
|
+
} else {
|
|
256
|
+
threshold = 0.3;
|
|
257
|
+
thresholdMessage = "30% Min Amount Needed";
|
|
258
|
+
}
|
|
259
|
+
const percentage = downpayment / purchasePrice;
|
|
260
|
+
if (percentage >= threshold) {
|
|
261
|
+
setDownPaymentQualifies("Qualifies");
|
|
262
|
+
} else {
|
|
263
|
+
setDownPaymentQualifies(thresholdMessage);
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
const getInterestRate = (program, fico, loanRange2) => {
|
|
267
|
+
const programData = LoanRates.get(program);
|
|
268
|
+
if (!programData) {
|
|
269
|
+
return "Program not found";
|
|
270
|
+
}
|
|
271
|
+
const ficoData = programData.get(fico);
|
|
272
|
+
if (!ficoData) {
|
|
273
|
+
return "FICO range not found";
|
|
274
|
+
}
|
|
275
|
+
const rate = ficoData.get(loanRange2);
|
|
276
|
+
if (!rate) {
|
|
277
|
+
return "Loan range not found";
|
|
278
|
+
}
|
|
279
|
+
return rate;
|
|
280
|
+
};
|
|
281
|
+
const calculateAdjustments = () => {
|
|
282
|
+
let total = 0;
|
|
283
|
+
const checkboxes = document.querySelectorAll(
|
|
284
|
+
'input[type="checkbox"]:checked, input[type="radio"]:checked'
|
|
285
|
+
);
|
|
286
|
+
checkboxes.forEach((checkbox) => {
|
|
287
|
+
total += parseFloat(checkbox.value);
|
|
288
|
+
});
|
|
289
|
+
return total;
|
|
290
|
+
};
|
|
291
|
+
const calculateRates = (program, fico, financedAmount2, buydownRate) => {
|
|
292
|
+
const minRate = 6.94;
|
|
293
|
+
const loanRange2 = getRange(financedAmount2, program, true);
|
|
294
|
+
const startingRate = parseFloat(
|
|
295
|
+
getInterestRate(program, fico, loanRange2).replace(/[%,]/g, "")
|
|
296
|
+
);
|
|
297
|
+
const rateAdjustments = calculateAdjustments();
|
|
298
|
+
const adjustedRate = startingRate + rateAdjustments;
|
|
299
|
+
const finalNoteRateValue = Math.max(minRate, adjustedRate);
|
|
300
|
+
const finalNoteRate2 = formatToPercentage(finalNoteRateValue);
|
|
301
|
+
const totalRateBuydownValue = finalNoteRateValue - buydownRate;
|
|
302
|
+
const totalRateBuydown2 = formatToPercentage(totalRateBuydownValue);
|
|
303
|
+
setFinalNoteRate(finalNoteRate2);
|
|
304
|
+
setTotalRateBuydown(totalRateBuydown2);
|
|
305
|
+
return finalNoteRateValue;
|
|
306
|
+
};
|
|
307
|
+
const calculateFinancedAmount = (purchasePrice, downpayment) => {
|
|
308
|
+
const financedAmount2 = purchasePrice - downpayment;
|
|
309
|
+
const downPaymentPercentage2 = downpayment / purchasePrice * 100;
|
|
310
|
+
const loanToValue2 = 100 - downPaymentPercentage2;
|
|
311
|
+
setFinancedAmount(formatToCurrency(financedAmount2));
|
|
312
|
+
setDownPaymentPercentage(formatToPercentage(downPaymentPercentage2));
|
|
313
|
+
setLoanToValue(formatToPercentage(loanToValue2));
|
|
314
|
+
return financedAmount2;
|
|
315
|
+
};
|
|
316
|
+
const calculateMonthlyPayment = (annualRate, years, principal) => {
|
|
317
|
+
const monthlyRate = annualRate / 12;
|
|
318
|
+
const numberOfPayments = years * 12;
|
|
319
|
+
const monthlyPayment = principal * (monthlyRate * Math.pow(1 + monthlyRate, numberOfPayments)) / (Math.pow(1 + monthlyRate, numberOfPayments) - 1);
|
|
320
|
+
return formatToCurrency(monthlyPayment);
|
|
321
|
+
};
|
|
322
|
+
const calculateBuydownPayment = (buydownRate, financedAmount2) => {
|
|
323
|
+
const buydownRateValue = buydownRate / 100;
|
|
324
|
+
const monthlyPayment = calculateMonthlyPayment(
|
|
325
|
+
buydownRateValue,
|
|
326
|
+
20,
|
|
327
|
+
financedAmount2
|
|
328
|
+
);
|
|
329
|
+
setBuydownPayment(monthlyPayment);
|
|
330
|
+
return formatToNumber(monthlyPayment);
|
|
331
|
+
};
|
|
332
|
+
const calculateNonBuydownPayment = (finalNoteRate2, financedAmount2, buydownPayment2) => {
|
|
333
|
+
const rate = finalNoteRate2 / 100;
|
|
334
|
+
const nonBuydownPayment2 = calculateMonthlyPayment(rate, 20, financedAmount2);
|
|
335
|
+
const nonBuydownPaymentValue = formatToNumber(nonBuydownPayment2);
|
|
336
|
+
const monthlySavingsValue = nonBuydownPaymentValue - buydownPayment2;
|
|
337
|
+
setNonBuydownPayment(nonBuydownPayment2);
|
|
338
|
+
setMonthlySavings(formatToCurrency(monthlySavingsValue));
|
|
339
|
+
};
|
|
340
|
+
const calculatePMT = (annualRate, totalPeriods, financedAmount2) => {
|
|
341
|
+
const monthlyRate = annualRate / 100 / 12;
|
|
342
|
+
const payment = financedAmount2 * monthlyRate / (1 - Math.pow(1 + monthlyRate, -240));
|
|
343
|
+
return payment;
|
|
344
|
+
};
|
|
345
|
+
const totalInterestByYear = (annualRate, totalPeriods, financedAmount2, years) => {
|
|
346
|
+
const monthlyRate = annualRate / 100 / 12;
|
|
347
|
+
const payment = calculatePMT(annualRate, totalPeriods, financedAmount2);
|
|
348
|
+
let totalInterest = 0;
|
|
349
|
+
let balance = financedAmount2;
|
|
350
|
+
for (let month = 1; month <= years * 12; month++) {
|
|
351
|
+
const interestPayment = balance * monthlyRate;
|
|
352
|
+
totalInterest += interestPayment;
|
|
353
|
+
const principalPayment = payment - interestPayment;
|
|
354
|
+
balance -= principalPayment;
|
|
355
|
+
}
|
|
356
|
+
return totalInterest;
|
|
357
|
+
};
|
|
358
|
+
const calculateTBC = (years, buydownRateValue, financedAmout) => {
|
|
359
|
+
const totalPeriods = 20 * 12;
|
|
360
|
+
const after1Year = totalInterestByYear(
|
|
361
|
+
buydownRateValue,
|
|
362
|
+
totalPeriods,
|
|
363
|
+
financedAmout,
|
|
364
|
+
years
|
|
365
|
+
);
|
|
366
|
+
return after1Year;
|
|
367
|
+
};
|
|
368
|
+
const calculateBuydownCost = (finalNoteRate2, buydownRateValue, financedAmount2, buydownTerm) => {
|
|
369
|
+
const totalPeriods = 20 * 12;
|
|
370
|
+
const totalReg = totalInterestByYear(
|
|
371
|
+
finalNoteRate2,
|
|
372
|
+
totalPeriods,
|
|
373
|
+
financedAmount2,
|
|
374
|
+
buydownTerm
|
|
375
|
+
);
|
|
376
|
+
const totalBD = calculateTBC(buydownTerm, buydownRateValue, financedAmount2);
|
|
377
|
+
const TBC = totalReg - totalBD;
|
|
378
|
+
setTotalBuydownCost(formatToCurrency(TBC));
|
|
379
|
+
return TBC;
|
|
380
|
+
};
|
|
381
|
+
const calculateManufacturerContribution = (dealerContribution) => {
|
|
382
|
+
const manufacturerContribution = 100 - dealerContribution;
|
|
383
|
+
const percentage = formatToPercentage(manufacturerContribution);
|
|
384
|
+
setManuContributionPercentage(percentage);
|
|
385
|
+
return manufacturerContribution;
|
|
386
|
+
};
|
|
387
|
+
const calculateManufacturerAmount = (totalBuydownCost2, manufacturerContribution) => {
|
|
388
|
+
const manufacturerAmount = totalBuydownCost2 * (manufacturerContribution / 100);
|
|
389
|
+
const formattedAmount = formatToCurrency(manufacturerAmount);
|
|
390
|
+
setManuContributionAmount(formattedAmount);
|
|
391
|
+
};
|
|
392
|
+
const calculateDealerContributionAmount = (dealerContribution, totalBuydownCost2) => {
|
|
393
|
+
const dealerContributionValue = totalBuydownCost2 * (dealerContribution / 100);
|
|
394
|
+
const formattedAmount = formatToCurrency(dealerContributionValue);
|
|
395
|
+
setDealerContributionAmount(formattedAmount);
|
|
396
|
+
};
|
|
397
|
+
const onSubmit = (data) => {
|
|
398
|
+
if (isValid) {
|
|
399
|
+
const {
|
|
400
|
+
buydownRate,
|
|
401
|
+
buydownTerm,
|
|
402
|
+
dealerContribution,
|
|
403
|
+
downpayment,
|
|
404
|
+
fico,
|
|
405
|
+
program,
|
|
406
|
+
purchasePrice
|
|
407
|
+
} = data;
|
|
408
|
+
const financedAmountValue = calculateFinancedAmount(
|
|
409
|
+
purchasePrice,
|
|
410
|
+
downpayment
|
|
411
|
+
);
|
|
412
|
+
calculateDownpaymentQualifies(program, purchasePrice, downpayment);
|
|
413
|
+
const finalNoteRateValue = calculateRates(
|
|
414
|
+
program,
|
|
415
|
+
fico,
|
|
416
|
+
financedAmountValue,
|
|
417
|
+
buydownRate
|
|
418
|
+
);
|
|
419
|
+
const buydownPayment2 = calculateBuydownPayment(
|
|
420
|
+
buydownRate,
|
|
421
|
+
financedAmountValue
|
|
422
|
+
);
|
|
423
|
+
calculateNonBuydownPayment(
|
|
424
|
+
finalNoteRateValue,
|
|
425
|
+
financedAmountValue,
|
|
426
|
+
buydownPayment2
|
|
427
|
+
);
|
|
428
|
+
const totalBuydownCost2 = calculateBuydownCost(
|
|
429
|
+
finalNoteRateValue,
|
|
430
|
+
buydownRate,
|
|
431
|
+
financedAmountValue,
|
|
432
|
+
buydownTerm
|
|
433
|
+
);
|
|
434
|
+
const manufacturerContribution = calculateManufacturerContribution(dealerContribution);
|
|
435
|
+
calculateManufacturerAmount(totalBuydownCost2, manufacturerContribution);
|
|
436
|
+
calculateDealerContributionAmount(dealerContribution, totalBuydownCost2);
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
return /* @__PURE__ */ jsxs("section", { className: `${calc_container({ variant: calculator_variant })}`, children: [
|
|
440
|
+
/* @__PURE__ */ jsx("div", { className: `${calculator_section}`, children: (header || body) && /* @__PURE__ */ jsxs("div", { className: `${section_header}`, children: [
|
|
441
|
+
header && /* @__PURE__ */ jsx(
|
|
442
|
+
"h2",
|
|
443
|
+
{
|
|
444
|
+
className: `header_2 ${theme_header({ variant: calculator_variant })}`,
|
|
445
|
+
children: header
|
|
446
|
+
}
|
|
447
|
+
),
|
|
448
|
+
body && /* @__PURE__ */ jsx("div", { className: mt_8, children: body })
|
|
449
|
+
] }) }),
|
|
450
|
+
/* @__PURE__ */ jsx(FormProvider, { ...methods, children: /* @__PURE__ */ jsxs(
|
|
451
|
+
"form",
|
|
452
|
+
{
|
|
453
|
+
id: "calculator_form",
|
|
454
|
+
className: `${buydown_calculator_form}`,
|
|
455
|
+
onSubmit: handleSubmit(onSubmit),
|
|
456
|
+
children: [
|
|
457
|
+
/* @__PURE__ */ jsxs("div", { className: clsx(form_wrapper({ variant: calculator_variant })), children: [
|
|
458
|
+
/* @__PURE__ */ jsxs("div", { className: `${row_form}`, children: [
|
|
459
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
460
|
+
CurrencyInput,
|
|
461
|
+
{
|
|
462
|
+
id: "purchasePrice",
|
|
463
|
+
...register("purchasePrice", { required: true }),
|
|
464
|
+
sizes: "medium",
|
|
465
|
+
placeholder: "$0.00",
|
|
466
|
+
label: "Purchase Price",
|
|
467
|
+
required: true,
|
|
468
|
+
error: !!errors["purchasePrice"],
|
|
469
|
+
helperText: errors["purchasePrice"]?.message,
|
|
470
|
+
variant: calculator_variant
|
|
471
|
+
}
|
|
472
|
+
) }),
|
|
473
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
474
|
+
CurrencyInput,
|
|
475
|
+
{
|
|
476
|
+
id: "downpayment",
|
|
477
|
+
...register("downpayment", { required: true }),
|
|
478
|
+
sizes: "medium",
|
|
479
|
+
placeholder: "$0.00",
|
|
480
|
+
label: "Down Payment",
|
|
481
|
+
required: true,
|
|
482
|
+
error: !!errors["downpayment"],
|
|
483
|
+
helperText: errors["downpayment"]?.message,
|
|
484
|
+
variant: calculator_variant
|
|
485
|
+
}
|
|
486
|
+
) })
|
|
487
|
+
] }),
|
|
488
|
+
/* @__PURE__ */ jsxs("div", { className: `${row_form}`, children: [
|
|
489
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
490
|
+
PercentageInput,
|
|
491
|
+
{
|
|
492
|
+
id: "dealerContribution",
|
|
493
|
+
...register("dealerContribution", { required: true }),
|
|
494
|
+
sizes: "medium",
|
|
495
|
+
placeholder: "0.00%",
|
|
496
|
+
label: "Dealer Contribution",
|
|
497
|
+
required: true,
|
|
498
|
+
error: !!errors["dealerContribution"],
|
|
499
|
+
helperText: errors["dealerContribution"]?.message,
|
|
500
|
+
variant: calculator_variant
|
|
501
|
+
}
|
|
502
|
+
) }),
|
|
503
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
|
|
504
|
+
Dropdown,
|
|
505
|
+
{
|
|
506
|
+
id: "program",
|
|
507
|
+
...register("program", {
|
|
508
|
+
required: true
|
|
509
|
+
}),
|
|
510
|
+
label: "Program",
|
|
511
|
+
sizes: "medium",
|
|
512
|
+
required: true,
|
|
513
|
+
error: !!errors.program,
|
|
514
|
+
helperText: errors.program?.message,
|
|
515
|
+
variant: calculator_variant,
|
|
516
|
+
defaultValue: "",
|
|
517
|
+
onChange: handleProgramChange,
|
|
518
|
+
children: [
|
|
519
|
+
/* @__PURE__ */ jsx("option", { value: "", disabled: true, children: "Select Program" }),
|
|
520
|
+
Program.map((item) => /* @__PURE__ */ jsx("option", { value: item.value, children: item.text }, item.value))
|
|
521
|
+
]
|
|
522
|
+
}
|
|
523
|
+
) })
|
|
524
|
+
] }),
|
|
525
|
+
/* @__PURE__ */ jsxs("div", { className: `${row_form}`, children: [
|
|
526
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
|
|
527
|
+
Dropdown,
|
|
528
|
+
{
|
|
529
|
+
id: "fico",
|
|
530
|
+
...register("fico", { required: true }),
|
|
531
|
+
label: "FICO",
|
|
532
|
+
sizes: "medium",
|
|
533
|
+
required: true,
|
|
534
|
+
error: !!errors["fico"],
|
|
535
|
+
helperText: errors["fico"]?.message,
|
|
536
|
+
variant: calculator_variant,
|
|
537
|
+
defaultValue: "",
|
|
538
|
+
children: [
|
|
539
|
+
/* @__PURE__ */ jsx("option", { value: "", disabled: true, children: "Select FICO" }),
|
|
540
|
+
Fico.map((item) => /* @__PURE__ */ jsx("option", { value: item.value, children: item.text }, item.value))
|
|
541
|
+
]
|
|
542
|
+
}
|
|
543
|
+
) }),
|
|
544
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
545
|
+
Input,
|
|
546
|
+
{
|
|
547
|
+
id: "loanRange",
|
|
548
|
+
sizes: "medium",
|
|
549
|
+
placeholder: "This value is calculated",
|
|
550
|
+
label: "Loan Range",
|
|
551
|
+
disabled: true,
|
|
552
|
+
variant: calculator_variant,
|
|
553
|
+
value: loanRange
|
|
554
|
+
}
|
|
555
|
+
) })
|
|
556
|
+
] }),
|
|
557
|
+
/* @__PURE__ */ jsxs("div", { className: `${row_form}`, children: [
|
|
558
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
|
|
559
|
+
Dropdown,
|
|
560
|
+
{
|
|
561
|
+
id: "buydownRate",
|
|
562
|
+
...register("buydownRate", {
|
|
563
|
+
required: true
|
|
564
|
+
}),
|
|
565
|
+
label: "Buydown Rate",
|
|
566
|
+
sizes: "medium",
|
|
567
|
+
required: true,
|
|
568
|
+
error: !!errors.buydownRate,
|
|
569
|
+
helperText: errors.buydownRate?.message,
|
|
570
|
+
variant: calculator_variant,
|
|
571
|
+
defaultValue: "",
|
|
572
|
+
children: [
|
|
573
|
+
/* @__PURE__ */ jsx("option", { value: "", disabled: true, children: "Select Buydown Rate" }),
|
|
574
|
+
BuydownRate.map((item) => /* @__PURE__ */ jsx("option", { value: item.value, children: item.text }, item.value))
|
|
575
|
+
]
|
|
576
|
+
}
|
|
577
|
+
) }),
|
|
578
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
|
|
579
|
+
Dropdown,
|
|
580
|
+
{
|
|
581
|
+
id: "buydownTerm",
|
|
582
|
+
...register("buydownTerm", {
|
|
583
|
+
required: true
|
|
584
|
+
}),
|
|
585
|
+
label: "Buydown Term (1-5 Years)",
|
|
586
|
+
sizes: "medium",
|
|
587
|
+
required: true,
|
|
588
|
+
error: !!errors.buydownTerm,
|
|
589
|
+
helperText: errors.buydownTerm?.message,
|
|
590
|
+
variant: calculator_variant,
|
|
591
|
+
defaultValue: 0,
|
|
592
|
+
children: [
|
|
593
|
+
/* @__PURE__ */ jsx("option", { value: "", disabled: true, children: "Select Buydown Term" }),
|
|
594
|
+
BuydownTerm.map((item) => /* @__PURE__ */ jsx("option", { value: item.value, children: item.text }, item.value))
|
|
595
|
+
]
|
|
596
|
+
}
|
|
597
|
+
) })
|
|
598
|
+
] }),
|
|
599
|
+
/* @__PURE__ */ jsx("div", { className: `${row_form}`, children: /* @__PURE__ */ jsxs("div", { children: [
|
|
600
|
+
/* @__PURE__ */ jsx("label", { children: "Loan Level Rate Adjustments" }),
|
|
601
|
+
/* @__PURE__ */ jsx(
|
|
602
|
+
Checkbox,
|
|
603
|
+
{
|
|
604
|
+
id: "fullTimeCharter",
|
|
605
|
+
...register("fullTimeCharter", {
|
|
606
|
+
onChange: (event) => {
|
|
607
|
+
if (!event.target.checked) {
|
|
608
|
+
setValue("mooringOutsideContinentalUS", false);
|
|
609
|
+
setValue("operatingAccount", false);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
}),
|
|
613
|
+
sizes: "medium",
|
|
614
|
+
variant: calculator_variant,
|
|
615
|
+
value: 0,
|
|
616
|
+
disabled: !enableFullTimeCharter,
|
|
617
|
+
children: "Full Time Charter"
|
|
618
|
+
}
|
|
619
|
+
)
|
|
620
|
+
] }) }),
|
|
621
|
+
/* @__PURE__ */ jsxs("div", { className: `${row_form}`, children: [
|
|
622
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("div", { className: row_form, children: /* @__PURE__ */ jsxs(
|
|
623
|
+
RadioButtonSet,
|
|
624
|
+
{
|
|
625
|
+
id: "dependentInputs",
|
|
626
|
+
label: "Limit One",
|
|
627
|
+
sizes: "medium",
|
|
628
|
+
variant,
|
|
629
|
+
direction: "column",
|
|
630
|
+
disabled: !enableDependentInputs,
|
|
631
|
+
className: limit_one,
|
|
632
|
+
children: [
|
|
633
|
+
/* @__PURE__ */ jsx(
|
|
634
|
+
RadioButton,
|
|
635
|
+
{
|
|
636
|
+
id: "mooringOutsideContinentalUS",
|
|
637
|
+
...register("mooringOutsideContinentalUS"),
|
|
638
|
+
value: 0.5,
|
|
639
|
+
radioText: "Mooring Outside Continental U.S. (Includes Puerto Rico,\r\n Hawaii, and Alaska) (Does not apply to Full Time Charter)\r\n +0.500",
|
|
640
|
+
groupName: "dependentInputs",
|
|
641
|
+
disabled: disableMooringOutside
|
|
642
|
+
}
|
|
643
|
+
),
|
|
644
|
+
/* @__PURE__ */ jsx(
|
|
645
|
+
RadioButton,
|
|
646
|
+
{
|
|
647
|
+
id: "operatingAccount",
|
|
648
|
+
...register("operatingAccount"),
|
|
649
|
+
value: -0.25,
|
|
650
|
+
radioText: "Operating Account with LLC Operating Account -0.25",
|
|
651
|
+
groupName: "dependentInputs"
|
|
652
|
+
}
|
|
653
|
+
)
|
|
654
|
+
]
|
|
655
|
+
}
|
|
656
|
+
) }) }),
|
|
657
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
658
|
+
/* @__PURE__ */ jsx("div", { className: row_form, children: /* @__PURE__ */ jsx(
|
|
659
|
+
Checkbox,
|
|
660
|
+
{
|
|
661
|
+
id: "ltvAbove60",
|
|
662
|
+
...register("ltvAbove60"),
|
|
663
|
+
sizes: "medium",
|
|
664
|
+
variant,
|
|
665
|
+
value: -0.35,
|
|
666
|
+
disabled: disableLTVAbove60,
|
|
667
|
+
children: "LTV ≤ 60% (If not required by program) -0.350"
|
|
668
|
+
}
|
|
669
|
+
) }),
|
|
670
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
671
|
+
Checkbox,
|
|
672
|
+
{
|
|
673
|
+
id: "floorplanDealerIncentive",
|
|
674
|
+
...register("floorplanDealerIncentive"),
|
|
675
|
+
sizes: "medium",
|
|
676
|
+
variant: calculator_variant,
|
|
677
|
+
value: -0.125,
|
|
678
|
+
children: "Floorplan dealer incentive -0.125"
|
|
679
|
+
}
|
|
680
|
+
) }),
|
|
681
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
682
|
+
Checkbox,
|
|
683
|
+
{
|
|
684
|
+
id: "dealerCommercialDeposit",
|
|
685
|
+
...register("dealerCommercialDeposit"),
|
|
686
|
+
sizes: "medium",
|
|
687
|
+
variant: calculator_variant,
|
|
688
|
+
value: -0.125,
|
|
689
|
+
children: "Dealer w/Commercial Deposit Relationship -0.125"
|
|
690
|
+
}
|
|
691
|
+
) })
|
|
692
|
+
] })
|
|
693
|
+
] }),
|
|
694
|
+
/* @__PURE__ */ jsx("div", { className: calculate_row, children: /* @__PURE__ */ jsx(
|
|
695
|
+
Button,
|
|
696
|
+
{
|
|
697
|
+
color: getVariant(variant),
|
|
698
|
+
as: "button",
|
|
699
|
+
type: "submit",
|
|
700
|
+
disabled: !isValid,
|
|
701
|
+
children: "Calculate"
|
|
702
|
+
}
|
|
703
|
+
) })
|
|
704
|
+
] }),
|
|
705
|
+
/* @__PURE__ */ jsxs("div", { className: `${row_form}`, children: [
|
|
706
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
707
|
+
CurrencyInput,
|
|
708
|
+
{
|
|
709
|
+
id: "financedAmount",
|
|
710
|
+
sizes: "medium",
|
|
711
|
+
label: "Financed Amount",
|
|
712
|
+
disabled: true,
|
|
713
|
+
variant: calculator_variant,
|
|
714
|
+
value: financedAmount
|
|
715
|
+
}
|
|
716
|
+
) }),
|
|
717
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
718
|
+
PercentageInput,
|
|
719
|
+
{
|
|
720
|
+
id: "downPaymentPercentage",
|
|
721
|
+
sizes: "medium",
|
|
722
|
+
label: "Down Payment %",
|
|
723
|
+
disabled: true,
|
|
724
|
+
variant: calculator_variant,
|
|
725
|
+
value: downPaymentPercentage
|
|
726
|
+
}
|
|
727
|
+
) })
|
|
728
|
+
] }),
|
|
729
|
+
/* @__PURE__ */ jsxs("div", { className: `${row_form}`, children: [
|
|
730
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
731
|
+
PercentageInput,
|
|
732
|
+
{
|
|
733
|
+
id: "loanToValue",
|
|
734
|
+
sizes: "medium",
|
|
735
|
+
label: "Loan to Value",
|
|
736
|
+
disabled: true,
|
|
737
|
+
variant: calculator_variant,
|
|
738
|
+
value: loanToValue
|
|
739
|
+
}
|
|
740
|
+
) }),
|
|
741
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
742
|
+
Input,
|
|
743
|
+
{
|
|
744
|
+
id: "downPaymentQualifies",
|
|
745
|
+
sizes: "medium",
|
|
746
|
+
label: "Down Payment Qualifies",
|
|
747
|
+
disabled: true,
|
|
748
|
+
variant: calculator_variant,
|
|
749
|
+
value: downPaymentQualifies
|
|
750
|
+
}
|
|
751
|
+
) })
|
|
752
|
+
] }),
|
|
753
|
+
/* @__PURE__ */ jsxs("div", { className: `${row_form}`, children: [
|
|
754
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
755
|
+
PercentageInput,
|
|
756
|
+
{
|
|
757
|
+
id: "totalRateBuydown",
|
|
758
|
+
sizes: "medium",
|
|
759
|
+
label: "Total Rate Buydown",
|
|
760
|
+
disabled: true,
|
|
761
|
+
variant: calculator_variant,
|
|
762
|
+
value: totalRateBuydown
|
|
763
|
+
}
|
|
764
|
+
) }),
|
|
765
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
766
|
+
PercentageInput,
|
|
767
|
+
{
|
|
768
|
+
id: "finalNoteRate",
|
|
769
|
+
sizes: "medium",
|
|
770
|
+
label: "Final Note Rate",
|
|
771
|
+
disabled: true,
|
|
772
|
+
variant: calculator_variant,
|
|
773
|
+
value: finalNoteRate
|
|
774
|
+
}
|
|
775
|
+
) })
|
|
776
|
+
] }),
|
|
777
|
+
/* @__PURE__ */ jsxs("div", { className: `${row_form}`, children: [
|
|
778
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
779
|
+
PercentageInput,
|
|
780
|
+
{
|
|
781
|
+
id: "manuContributionPercentage",
|
|
782
|
+
sizes: "medium",
|
|
783
|
+
label: "Manufacturer Contribution %",
|
|
784
|
+
disabled: true,
|
|
785
|
+
variant: calculator_variant,
|
|
786
|
+
value: manuContributionPercentage
|
|
787
|
+
}
|
|
788
|
+
) }),
|
|
789
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
790
|
+
CurrencyInput,
|
|
791
|
+
{
|
|
792
|
+
id: "buydownPayment",
|
|
793
|
+
sizes: "medium",
|
|
794
|
+
label: "Buydown Payment",
|
|
795
|
+
disabled: true,
|
|
796
|
+
variant: calculator_variant,
|
|
797
|
+
value: buydownPayment
|
|
798
|
+
}
|
|
799
|
+
) })
|
|
800
|
+
] }),
|
|
801
|
+
/* @__PURE__ */ jsxs("div", { className: `${row_form}`, children: [
|
|
802
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
803
|
+
CurrencyInput,
|
|
804
|
+
{
|
|
805
|
+
id: "manuContributionAmount",
|
|
806
|
+
sizes: "medium",
|
|
807
|
+
label: "Manufacturer Contribution Amount",
|
|
808
|
+
disabled: true,
|
|
809
|
+
variant: calculator_variant,
|
|
810
|
+
value: manuContributionAmount
|
|
811
|
+
}
|
|
812
|
+
) }),
|
|
813
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
814
|
+
CurrencyInput,
|
|
815
|
+
{
|
|
816
|
+
id: "nonBuydownPayment",
|
|
817
|
+
sizes: "medium",
|
|
818
|
+
label: "Non-buydown Payment",
|
|
819
|
+
disabled: true,
|
|
820
|
+
variant: calculator_variant,
|
|
821
|
+
value: nonBuydownPayment
|
|
822
|
+
}
|
|
823
|
+
) })
|
|
824
|
+
] }),
|
|
825
|
+
/* @__PURE__ */ jsxs("div", { className: `${row_form}`, children: [
|
|
826
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
827
|
+
CurrencyInput,
|
|
828
|
+
{
|
|
829
|
+
id: "totalBuydownCost",
|
|
830
|
+
sizes: "medium",
|
|
831
|
+
label: "Total Buydown Cost",
|
|
832
|
+
disabled: true,
|
|
833
|
+
variant: calculator_variant,
|
|
834
|
+
value: totalBuydownCost
|
|
835
|
+
}
|
|
836
|
+
) }),
|
|
837
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
838
|
+
CurrencyInput,
|
|
839
|
+
{
|
|
840
|
+
id: "monthlySavings",
|
|
841
|
+
sizes: "medium",
|
|
842
|
+
label: "Monthly Savings",
|
|
843
|
+
disabled: true,
|
|
844
|
+
variant: calculator_variant,
|
|
845
|
+
value: monthlySavings
|
|
846
|
+
}
|
|
847
|
+
) })
|
|
848
|
+
] }),
|
|
849
|
+
/* @__PURE__ */ jsx("div", { className: `${row_form}`, children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
850
|
+
CurrencyInput,
|
|
851
|
+
{
|
|
852
|
+
id: "dealerContributionAmount",
|
|
853
|
+
sizes: "medium",
|
|
854
|
+
label: "Dealer Contribution Amount",
|
|
855
|
+
disabled: true,
|
|
856
|
+
variant: calculator_variant,
|
|
857
|
+
value: dealerContributionAmount
|
|
858
|
+
}
|
|
859
|
+
) }) })
|
|
860
|
+
]
|
|
861
|
+
}
|
|
862
|
+
) }),
|
|
863
|
+
disclosure && /* @__PURE__ */ jsx("div", { className: `${form_disclosure} push_up_24`, children: disclosure })
|
|
864
|
+
] });
|
|
865
|
+
};
|
|
866
|
+
export {
|
|
867
|
+
BuyDownCalculator
|
|
868
|
+
};
|