@axos-web-dev/shared-components 1.0.99-honeypot.1 → 1.0.99-leadpriority

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/Auth/ErrorAlert.js +2 -2
  2. package/dist/Button/Button.js +2 -2
  3. package/dist/Calculators/BuyDownCalculator/index.js +1 -1
  4. package/dist/Calculators/Calculator.js +14 -2
  5. package/dist/Calculators/MarineLoanMonthlyPaymentCalculator/index.d.ts +9 -0
  6. package/dist/Calculators/MarineLoanMonthlyPaymentCalculator/index.js +219 -0
  7. package/dist/Calculators/MaxLoanCalculator/index.js +22 -5
  8. package/dist/Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.d.ts +1 -0
  9. package/dist/Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js +2 -0
  10. package/dist/Calculators/MonthlyPaymentCalculator/index.js +15 -5
  11. package/dist/Calculators/index.d.ts +2 -1
  12. package/dist/Calculators/index.js +3 -1
  13. package/dist/Carousel/index.js +2 -2
  14. package/dist/Chevron/index.js +2 -2
  15. package/dist/Comparison/Comparison.js +2 -2
  16. package/dist/ExecutiveBio/ExecutiveBio.js +2 -2
  17. package/dist/FaqAccordion/index.js +2 -2
  18. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +2 -2
  19. package/dist/Forms/ApplicationStart.d.ts +1 -1
  20. package/dist/Forms/ApplicationStart.js +101 -89
  21. package/dist/Forms/ApplyNow.d.ts +2 -2
  22. package/dist/Forms/ApplyNow.js +170 -145
  23. package/dist/Forms/ClearingForm.d.ts +1 -1
  24. package/dist/Forms/ClearingForm.js +174 -162
  25. package/dist/Forms/CommercialDeposits.d.ts +1 -1
  26. package/dist/Forms/CommercialDeposits.js +191 -179
  27. package/dist/Forms/CommercialLending.d.ts +1 -1
  28. package/dist/Forms/CommercialLending.js +268 -256
  29. package/dist/Forms/CommercialPremiumFinance.d.ts +1 -1
  30. package/dist/Forms/CommercialPremiumFinance.js +106 -94
  31. package/dist/Forms/ContactCompany.d.ts +1 -1
  32. package/dist/Forms/ContactCompany.js +103 -91
  33. package/dist/Forms/ContactCompanyTitle.d.ts +1 -1
  34. package/dist/Forms/ContactCompanyTitle.js +117 -105
  35. package/dist/Forms/ContactUs.d.ts +1 -1
  36. package/dist/Forms/ContactUs.js +90 -79
  37. package/dist/Forms/ContactUsAAS.d.ts +1 -1
  38. package/dist/Forms/ContactUsAAS.js +170 -158
  39. package/dist/Forms/ContactUsBusiness.d.ts +1 -1
  40. package/dist/Forms/ContactUsBusiness.js +126 -114
  41. package/dist/Forms/ContactUsBusinessNameEmail.d.ts +1 -1
  42. package/dist/Forms/ContactUsBusinessNameEmail.js +95 -83
  43. package/dist/Forms/ContactUsLVF.d.ts +3 -1
  44. package/dist/Forms/ContactUsLVF.js +117 -101
  45. package/dist/Forms/ContactUsNMLSId.d.ts +1 -1
  46. package/dist/Forms/ContactUsNMLSId.js +109 -97
  47. package/dist/Forms/CpraRequest.d.ts +1 -1
  48. package/dist/Forms/CpraRequest.js +630 -618
  49. package/dist/Forms/CraPublicFile.d.ts +1 -1
  50. package/dist/Forms/CraPublicFile.js +101 -89
  51. package/dist/Forms/DealerServices.d.ts +1 -1
  52. package/dist/Forms/DealerServices.js +215 -203
  53. package/dist/Forms/EmailOnly.d.ts +1 -1
  54. package/dist/Forms/EmailOnly.js +48 -36
  55. package/dist/Forms/EmailUs.d.ts +1 -1
  56. package/dist/Forms/EmailUs.js +65 -53
  57. package/dist/Forms/FormProps.d.ts +3 -0
  58. package/dist/Forms/Forms.css.d.ts +18 -0
  59. package/dist/Forms/Forms.css.js +44 -38
  60. package/dist/Forms/HoneyPot/HoneyPot.css.d.ts +1 -1
  61. package/dist/Forms/HoneyPot/HoneyPot.css.js +2 -2
  62. package/dist/Forms/HoneyPot/index.d.ts +10 -11
  63. package/dist/Forms/HoneyPot/index.js +21 -24
  64. package/dist/Forms/MortgageRate/MortgageRateForm.d.ts +1 -1
  65. package/dist/Forms/MortgageRate/MortgageRateForm.js +369 -348
  66. package/dist/Forms/MortgageRate/MortgageRateWatch.js +2 -2
  67. package/dist/Forms/MortgageWarehouseLending.d.ts +11 -0
  68. package/dist/Forms/MortgageWarehouseLending.js +337 -0
  69. package/dist/Forms/QuickPricer/QuickPricerForm.d.ts +1 -1
  70. package/dist/Forms/QuickPricer/QuickPricerForm.js +608 -596
  71. package/dist/Forms/SalesforceFieldsForm.d.ts +5 -0
  72. package/dist/Forms/SalesforceFieldsForm.js +11 -1
  73. package/dist/Forms/ScheduleCall.d.ts +1 -1
  74. package/dist/Forms/ScheduleCall.js +146 -134
  75. package/dist/Forms/ScheduleCallPremier.d.ts +1 -1
  76. package/dist/Forms/ScheduleCallPremier.js +168 -156
  77. package/dist/Forms/SuccesForm.js +5 -5
  78. package/dist/Forms/VendorQuestionnaire.d.ts +1 -1
  79. package/dist/Forms/VendorQuestionnaire.js +807 -795
  80. package/dist/Forms/WcplSurvey.d.ts +1 -1
  81. package/dist/Forms/WcplSurvey.js +102 -90
  82. package/dist/Forms/applynow-utils.d.ts +1 -0
  83. package/dist/Forms/applynow-utils.js +48 -0
  84. package/dist/Forms/index.d.ts +2 -0
  85. package/dist/Forms/index.js +8 -2
  86. package/dist/HeroBanner/HeroBanner.js +38 -1
  87. package/dist/Hyperlink/index.js +2 -2
  88. package/dist/IconBillboard/sections/CallToActionSection.js +2 -1
  89. package/dist/ImageBillboard/ExitIntentModal/useExitIntentModal.js +6 -1
  90. package/dist/ImageLink/ImageLink.js +2 -2
  91. package/dist/ImageLink/ImageLinkSet.js +2 -2
  92. package/dist/ImageLink/index.js +2 -2
  93. package/dist/Insight/Featured/CategorySelector.js +2 -2
  94. package/dist/Insight/Featured/Featured.js +2 -2
  95. package/dist/Insight/Featured/Header.js +2 -2
  96. package/dist/Modal/Modal.js +2 -2
  97. package/dist/NavigationMenu/AxosALTS/NavData.js +2 -2
  98. package/dist/NavigationMenu/AxosALTS/index.js +2 -2
  99. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +14 -6
  100. package/dist/NavigationMenu/AxosBank/NavData.js +2 -2
  101. package/dist/NavigationMenu/AxosBank/SubNavBar.js +15 -7
  102. package/dist/NavigationMenu/AxosBank/index.js +2 -2
  103. package/dist/NavigationMenu/LaVictoire/NavData.js +2 -2
  104. package/dist/NavigationMenu/LaVictoire/index.js +2 -2
  105. package/dist/NavigationMenu/NavDataJson.js +2 -2
  106. package/dist/NavigationMenu/Navbar.js +2 -2
  107. package/dist/NavigationMenu/SignInNavButton.js +2 -2
  108. package/dist/SetContainer/SetContainer.js +2 -2
  109. package/dist/SocialMediaBar/iconsRepository.js +2 -2
  110. package/dist/VideoTile/VideoTile.js +2 -2
  111. package/dist/VideoWrapper/index.js +2 -2
  112. package/dist/assets/Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css +3 -0
  113. package/dist/assets/Forms/Forms.css +135 -105
  114. package/dist/assets/Forms/HoneyPot/HoneyPot.css +4 -0
  115. package/dist/main.js +11 -3
  116. package/dist/utils/allowedAxosDomains.js +2 -1
  117. package/package.json +1 -1
@@ -41,10 +41,12 @@ import { InputPhone } from "../../Input/InputPhone.js";
41
41
  import "../../Input/InputTextArea.js";
42
42
  import { DownPaymentInput } from "../../Input/DownPaymentInput.js";
43
43
  import "../../Input/RadioButton.js";
44
+ import "../../Input/PercentageInput.js";
44
45
  import { useForm, FormProvider } from "react-hook-form";
45
46
  import * as z from "zod";
47
+ import "../../Calculators/BuyDownCalculator/BuyDownCalculator.css.js";
46
48
  import { iconForm, headerForm, form, descriptionField, headerContainer, fullRowSelect, formWrapper, centerSelect, mt2rem, fullRowForm, disclosureForm, actions, formBtns, na_cursor, formContainer } from "../Forms.css.js";
47
- import "../HoneyPot/index.js";
49
+ import { honeyPotSchema, isValidHoneyPot, HoneyPot } from "../HoneyPot/index.js";
48
50
  import { SalesforceSchema } from "../SalesforceFieldsForm.js";
49
51
  import "../../Input/RadioButton.css.js";
50
52
  import "../../Input/Checkbox.css.js";
@@ -64,8 +66,6 @@ import "iframe-resizer";
64
66
  import "../../Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js";
65
67
  import "../../Calculators/MonthlyPaymentLVFCalculator/MonthlyPaymentCalculator.css.js";
66
68
  import "../../Calculators/SummitApyCalculator/BalanceAPYCalculator.css.js";
67
- import "../../Input/PercentageInput.js";
68
- import "../../Calculators/BuyDownCalculator/BuyDownCalculator.css.js";
69
69
  /* empty css */
70
70
  import "react-dom";
71
71
  /* empty css */
@@ -141,7 +141,8 @@ const MortgageRate = ({
141
141
  rateWatchOnSubmit,
142
142
  setRateWatchSubmitted,
143
143
  hideModalValue,
144
- showingTables
144
+ showingTables,
145
+ onValidate
145
146
  }) => {
146
147
  const [loanPurpose, setLoanPurpose] = useState(1);
147
148
  const [rateType, setRateType] = useState("Purchase");
@@ -220,8 +221,16 @@ const MortgageRate = ({
220
221
  cashOut: z.number({ message: "Cash Out is required." }).optional(),
221
222
  loanPurpose: z.number({ message: "Loan Purpose is required." })
222
223
  });
224
+ const gen_schema = schema.merge(SalesforceSchema).merge(honeyPotSchema).superRefine((data, ctx) => {
225
+ if (!isValidHoneyPot(data)) {
226
+ ctx.addIssue({
227
+ code: z.ZodIssueCode.custom,
228
+ message: "fields are not valid."
229
+ });
230
+ }
231
+ });
223
232
  const methods = useForm({
224
- resolver: zodResolver(schema.merge(SalesforceSchema), {
233
+ resolver: zodResolver(gen_schema, {
225
234
  async: true
226
235
  }),
227
236
  mode: "all"
@@ -408,361 +417,373 @@ const MortgageRate = ({
408
417
  children: "Tell us about your property and loan to personalize your rate."
409
418
  }
410
419
  ) }),
411
- /* @__PURE__ */ jsxs("form", { className: form, onSubmit: handleSubmit(submitForm), children: [
412
- /* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
413
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
414
- Dropdown,
415
- {
416
- id: "propertyType",
417
- ...register("propertyType", {
418
- required: true,
419
- setValueAs: (value) => Number(value)
420
- }),
421
- label: "Property Type",
422
- sizes: "medium",
423
- required: true,
424
- error: !!errors.propertyType,
425
- helperText: errors.propertyType?.message,
426
- variant,
427
- defaultValue: "Select option",
428
- children: [
429
- /* @__PURE__ */ jsx("option", { disabled: true, value: "Select option", children: "Select Option" }),
430
- /* @__PURE__ */ jsx("option", { value: "1", children: "Single Family Home" }),
431
- /* @__PURE__ */ jsx("option", { value: "3", children: "Condo" }),
432
- /* @__PURE__ */ jsx("option", { value: "5", children: "Hi-Rise Condo" }),
433
- /* @__PURE__ */ jsx("option", { value: "2", children: "Co-op" }),
434
- /* @__PURE__ */ jsx("option", { value: "4", children: "2-4 Unit" }),
435
- /* @__PURE__ */ jsx("option", { value: "6", children: "Manufactured" })
436
- ]
437
- }
438
- ) }),
439
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
440
- Dropdown,
441
- {
442
- id: "occupancy",
443
- ...register("occupancy", {
444
- required: true,
445
- setValueAs: (value) => Number(value)
446
- }),
447
- label: "Property Usage",
448
- sizes: "medium",
449
- required: true,
450
- error: !!errors.occupancy,
451
- helperText: errors.occupancy?.message,
452
- variant,
453
- defaultValue: "Select option",
454
- children: [
455
- /* @__PURE__ */ jsx("option", { disabled: true, value: "Select option", children: "Select Option" }),
456
- /* @__PURE__ */ jsx("option", { value: "1", children: "Primary Residence" }),
457
- /* @__PURE__ */ jsx("option", { value: "2", children: "Vacation Home" }),
458
- /* @__PURE__ */ jsx("option", { value: "3", children: "Investment" })
459
- ]
460
- }
461
- ) }),
462
- loanPurpose === 1 && /* @__PURE__ */ jsxs(Fragment, { children: [
463
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
464
- Input,
465
- {
466
- id: "salesPrice",
467
- type: "text",
468
- ...register("salesPrice", {
420
+ /* @__PURE__ */ jsxs(
421
+ "form",
422
+ {
423
+ className: form,
424
+ onSubmit: async (e) => {
425
+ onValidate && onValidate(e);
426
+ await handleSubmit(submitForm)(e);
427
+ e.preventDefault();
428
+ },
429
+ children: [
430
+ /* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
431
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
432
+ Dropdown,
433
+ {
434
+ id: "propertyType",
435
+ ...register("propertyType", {
436
+ required: true,
437
+ setValueAs: (value) => Number(value)
438
+ }),
439
+ label: "Property Type",
440
+ sizes: "medium",
469
441
  required: true,
470
- setValueAs: (value) => parseCurrency(value)
471
- }),
472
- label: "Purchase Price",
473
- sizes: "medium",
474
- required: true,
475
- error: !!errors.salesPrice,
476
- helperText: errors.salesPrice?.message,
477
- variant,
478
- onBlur: (e) => {
479
- setIsTypingDownPayment(false);
480
- const rawValue = e.target.value;
481
- const parsedValue = parseCurrency(rawValue);
482
- if (parsedValue === 0) {
483
- methods.setError("salesPrice", {
484
- type: "manual",
485
- message: "Purchase Price is required."
486
- });
487
- } else {
488
- methods.setValue("salesPrice", parsedValue);
442
+ error: !!errors.propertyType,
443
+ helperText: errors.propertyType?.message,
444
+ variant,
445
+ defaultValue: "Select option",
446
+ children: [
447
+ /* @__PURE__ */ jsx("option", { disabled: true, value: "Select option", children: "Select Option" }),
448
+ /* @__PURE__ */ jsx("option", { value: "1", children: "Single Family Home" }),
449
+ /* @__PURE__ */ jsx("option", { value: "3", children: "Condo" }),
450
+ /* @__PURE__ */ jsx("option", { value: "5", children: "Hi-Rise Condo" }),
451
+ /* @__PURE__ */ jsx("option", { value: "2", children: "Co-op" }),
452
+ /* @__PURE__ */ jsx("option", { value: "4", children: "2-4 Unit" }),
453
+ /* @__PURE__ */ jsx("option", { value: "6", children: "Manufactured" })
454
+ ]
455
+ }
456
+ ) }),
457
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
458
+ Dropdown,
459
+ {
460
+ id: "occupancy",
461
+ ...register("occupancy", {
462
+ required: true,
463
+ setValueAs: (value) => Number(value)
464
+ }),
465
+ label: "Property Usage",
466
+ sizes: "medium",
467
+ required: true,
468
+ error: !!errors.occupancy,
469
+ helperText: errors.occupancy?.message,
470
+ variant,
471
+ defaultValue: "Select option",
472
+ children: [
473
+ /* @__PURE__ */ jsx("option", { disabled: true, value: "Select option", children: "Select Option" }),
474
+ /* @__PURE__ */ jsx("option", { value: "1", children: "Primary Residence" }),
475
+ /* @__PURE__ */ jsx("option", { value: "2", children: "Vacation Home" }),
476
+ /* @__PURE__ */ jsx("option", { value: "3", children: "Investment" })
477
+ ]
478
+ }
479
+ ) }),
480
+ loanPurpose === 1 && /* @__PURE__ */ jsxs(Fragment, { children: [
481
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
482
+ Input,
483
+ {
484
+ id: "salesPrice",
485
+ type: "text",
486
+ ...register("salesPrice", {
487
+ required: true,
488
+ setValueAs: (value) => parseCurrency(value)
489
+ }),
490
+ label: "Purchase Price",
491
+ sizes: "medium",
492
+ required: true,
493
+ error: !!errors.salesPrice,
494
+ helperText: errors.salesPrice?.message,
495
+ variant,
496
+ onBlur: (e) => {
497
+ setIsTypingDownPayment(false);
498
+ const rawValue = e.target.value;
499
+ const parsedValue = parseCurrency(rawValue);
500
+ if (parsedValue === 0) {
501
+ methods.setError("salesPrice", {
502
+ type: "manual",
503
+ message: "Purchase Price is required."
504
+ });
505
+ } else {
506
+ methods.setValue("salesPrice", parsedValue);
507
+ e.target.value = formatCurrency(parsedValue);
508
+ }
509
+ methods.trigger("downPayment");
510
+ },
511
+ onFocus: (e) => {
512
+ const currentValue = e.target.value;
513
+ e.target.value = currentValue.replace(/[$,]/g, "");
514
+ }
515
+ }
516
+ ) }),
517
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
518
+ DownPaymentInput,
519
+ {
520
+ id: "downPayment",
521
+ type: "text",
522
+ ...register("downPayment", {
523
+ required: true,
524
+ setValueAs: (value) => parseCurrency(value)
525
+ }),
526
+ salesPrice: watch("salesPrice"),
527
+ downPaymentPercentage,
528
+ setDownPaymentPercentage,
529
+ label: "Down Payment",
530
+ sizes: "medium",
531
+ error: !!errors.downPayment,
532
+ helperText: errors.downPayment?.message,
533
+ onChange: (e) => {
534
+ const value = parseCurrency(e.target.value);
535
+ methods.setValue("downPayment", value);
536
+ },
537
+ variant,
538
+ isTypingDownPayment,
539
+ setIsTypingDownPayment,
540
+ methods
541
+ }
542
+ ) })
543
+ ] }),
544
+ loanPurpose === 2 && /* @__PURE__ */ jsxs(Fragment, { children: [
545
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
546
+ Input,
547
+ {
548
+ id: "appraisedValue",
549
+ type: "text",
550
+ ...register("appraisedValue", {
551
+ required: true,
552
+ setValueAs: (value) => parseCurrency(value)
553
+ }),
554
+ label: "Home Value",
555
+ sizes: "medium",
556
+ required: true,
557
+ error: !!errors.appraisedValue,
558
+ helperText: errors.appraisedValue?.message,
559
+ variant,
560
+ onBlur: (e) => {
561
+ const rawValue = e.target.value;
562
+ const parsedValue = parseCurrency(rawValue);
563
+ methods.setValue("appraisedValue", parsedValue);
564
+ e.target.value = formatCurrency(parsedValue);
565
+ },
566
+ onFocus: (e) => {
567
+ const currentValue = e.target.value;
568
+ e.target.value = currentValue.replace(/[$,]/g, "");
569
+ }
570
+ }
571
+ ) }),
572
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
573
+ Input,
574
+ {
575
+ id: "mortgageBalance",
576
+ type: "text",
577
+ ...register("mortgageBalance", {
578
+ required: true,
579
+ setValueAs: (value) => parseCurrency(value)
580
+ }),
581
+ label: "Mortgage Balance",
582
+ sizes: "medium",
583
+ required: true,
584
+ error: !!errors.mortgageBalance,
585
+ helperText: errors.mortgageBalance?.message,
586
+ variant,
587
+ onBlur: (e) => {
588
+ const rawValue = e.target.value;
589
+ const parsedValue = parseCurrency(rawValue);
590
+ methods.setValue("mortgageBalance", parsedValue);
591
+ e.target.value = formatCurrency(parsedValue);
592
+ },
593
+ onFocus: (e) => {
594
+ const currentValue = e.target.value;
595
+ e.target.value = currentValue.replace(/[$,]/g, "");
596
+ }
597
+ }
598
+ ) })
599
+ ] }),
600
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
601
+ Dropdown,
602
+ {
603
+ id: "creditScore",
604
+ ...register("creditScore", {
605
+ required: true,
606
+ setValueAs: (value) => value === "" ? void 0 : Number(value)
607
+ }),
608
+ label: "Credit Score",
609
+ sizes: "medium",
610
+ required: true,
611
+ error: !!errors.creditScore,
612
+ helperText: errors.creditScore?.message,
613
+ variant,
614
+ defaultValue: "Select option",
615
+ children: [
616
+ /* @__PURE__ */ jsx("option", { disabled: true, value: "Select option", children: "Select Option" }),
617
+ /* @__PURE__ */ jsx("option", { value: "740", children: "740+" }),
618
+ /* @__PURE__ */ jsx("option", { value: "720", children: "739-720" }),
619
+ /* @__PURE__ */ jsx("option", { value: "700", children: "719-700" }),
620
+ /* @__PURE__ */ jsx("option", { value: "680", children: "699-680" }),
621
+ /* @__PURE__ */ jsx("option", { value: "660", children: "679-660" }),
622
+ /* @__PURE__ */ jsx("option", { value: "640", children: "659-640" }),
623
+ /* @__PURE__ */ jsx("option", { value: "620", children: "639-620" }),
624
+ /* @__PURE__ */ jsx("option", { value: "600", children: "Below 620" })
625
+ ]
626
+ }
627
+ ) }),
628
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
629
+ Input,
630
+ {
631
+ id: "zipCode",
632
+ type: "number",
633
+ ...register("zipCode", {
634
+ required: true,
635
+ setValueAs: (value) => Number(value)
636
+ }),
637
+ label: "Zip Code",
638
+ sizes: "medium",
639
+ required: true,
640
+ error: !!errors.zipCode,
641
+ helperText: errors.zipCode?.message,
642
+ variant
643
+ }
644
+ ) }),
645
+ loanPurpose === 2 ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: fullRowForm, children: /* @__PURE__ */ jsx(
646
+ Input,
647
+ {
648
+ id: "cashOut",
649
+ type: "text",
650
+ ...register("cashOut", {
651
+ required: true,
652
+ setValueAs: (value) => parseCurrency(value)
653
+ }),
654
+ label: "Cash Out (Optional)",
655
+ sizes: "medium",
656
+ error: !!errors.cashOut,
657
+ helperText: errors.cashOut?.message,
658
+ variant,
659
+ onBlur: (e) => {
660
+ const rawValue = e.target.value;
661
+ const parsedValue = parseCurrency(rawValue);
662
+ methods.setValue("cashOut", parsedValue);
489
663
  e.target.value = formatCurrency(parsedValue);
664
+ },
665
+ onFocus: (e) => {
666
+ const currentValue = e.target.value;
667
+ e.target.value = currentValue.replace(/[$,]/g, "");
490
668
  }
491
- methods.trigger("downPayment");
492
- },
493
- onFocus: (e) => {
494
- const currentValue = e.target.value;
495
- e.target.value = currentValue.replace(/[$,]/g, "");
496
669
  }
497
- }
498
- ) }),
499
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
500
- DownPaymentInput,
501
- {
502
- id: "downPayment",
503
- type: "text",
504
- ...register("downPayment", {
670
+ ) }) }) : null,
671
+ /* @__PURE__ */ jsx("div", { className: clsx(fullRowForm, "text_center"), children: /* @__PURE__ */ jsx(
672
+ "div",
673
+ {
674
+ className: clsx(
675
+ descriptionField({ variant }),
676
+ "text_center"
677
+ ),
678
+ children: "Almost there! Please provide your contact information to view rates and sign up for Rate Watch."
679
+ }
680
+ ) }),
681
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
682
+ Input,
683
+ {
684
+ id: "firstName",
685
+ ...register("firstName", {
686
+ required: "First Name is required"
687
+ }),
688
+ label: "First Name",
689
+ sizes: "medium",
505
690
  required: true,
506
- setValueAs: (value) => parseCurrency(value)
507
- }),
508
- salesPrice: watch("salesPrice"),
509
- downPaymentPercentage,
510
- setDownPaymentPercentage,
511
- label: "Down Payment",
512
- sizes: "medium",
513
- error: !!errors.downPayment,
514
- helperText: errors.downPayment?.message,
515
- onChange: (e) => {
516
- const value = parseCurrency(e.target.value);
517
- methods.setValue("downPayment", value);
518
- },
519
- variant,
520
- isTypingDownPayment,
521
- setIsTypingDownPayment,
522
- methods
523
- }
524
- ) })
525
- ] }),
526
- loanPurpose === 2 && /* @__PURE__ */ jsxs(Fragment, { children: [
527
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
528
- Input,
529
- {
530
- id: "appraisedValue",
531
- type: "text",
532
- ...register("appraisedValue", {
691
+ error: !!errors.firstName,
692
+ helperText: errors.firstName?.message,
693
+ variant
694
+ }
695
+ ) }),
696
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
697
+ Input,
698
+ {
699
+ id: "lastName",
700
+ ...register("lastName", { required: true }),
701
+ label: "Last Name",
702
+ sizes: "medium",
533
703
  required: true,
534
- setValueAs: (value) => parseCurrency(value)
535
- }),
536
- label: "Home Value",
537
- sizes: "medium",
538
- required: true,
539
- error: !!errors.appraisedValue,
540
- helperText: errors.appraisedValue?.message,
541
- variant,
542
- onBlur: (e) => {
543
- const rawValue = e.target.value;
544
- const parsedValue = parseCurrency(rawValue);
545
- methods.setValue("appraisedValue", parsedValue);
546
- e.target.value = formatCurrency(parsedValue);
547
- },
548
- onFocus: (e) => {
549
- const currentValue = e.target.value;
550
- e.target.value = currentValue.replace(/[$,]/g, "");
704
+ error: !!errors.lastName,
705
+ helperText: errors.lastName?.message,
706
+ variant
551
707
  }
552
- }
553
- ) }),
554
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
555
- Input,
556
- {
557
- id: "mortgageBalance",
558
- type: "text",
559
- ...register("mortgageBalance", {
708
+ ) }),
709
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
710
+ Input,
711
+ {
712
+ id: "email",
713
+ ...register("email", {
714
+ required: true,
715
+ validate: {
716
+ isValid: associatedEmail
717
+ }
718
+ }),
719
+ label: "Email",
720
+ sizes: "medium",
560
721
  required: true,
561
- setValueAs: (value) => parseCurrency(value)
562
- }),
563
- label: "Mortgage Balance",
564
- sizes: "medium",
565
- required: true,
566
- error: !!errors.mortgageBalance,
567
- helperText: errors.mortgageBalance?.message,
568
- variant,
569
- onBlur: (e) => {
570
- const rawValue = e.target.value;
571
- const parsedValue = parseCurrency(rawValue);
572
- methods.setValue("mortgageBalance", parsedValue);
573
- e.target.value = formatCurrency(parsedValue);
574
- },
575
- onFocus: (e) => {
576
- const currentValue = e.target.value;
577
- e.target.value = currentValue.replace(/[$,]/g, "");
722
+ error: !!errors.email,
723
+ helperText: errors.email?.message,
724
+ variant
578
725
  }
579
- }
580
- ) })
581
- ] }),
582
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
583
- Dropdown,
584
- {
585
- id: "creditScore",
586
- ...register("creditScore", {
587
- required: true,
588
- setValueAs: (value) => value === "" ? void 0 : Number(value)
589
- }),
590
- label: "Credit Score",
591
- sizes: "medium",
592
- required: true,
593
- error: !!errors.creditScore,
594
- helperText: errors.creditScore?.message,
595
- variant,
596
- defaultValue: "Select option",
597
- children: [
598
- /* @__PURE__ */ jsx("option", { disabled: true, value: "Select option", children: "Select Option" }),
599
- /* @__PURE__ */ jsx("option", { value: "740", children: "740+" }),
600
- /* @__PURE__ */ jsx("option", { value: "720", children: "739-720" }),
601
- /* @__PURE__ */ jsx("option", { value: "700", children: "719-700" }),
602
- /* @__PURE__ */ jsx("option", { value: "680", children: "699-680" }),
603
- /* @__PURE__ */ jsx("option", { value: "660", children: "679-660" }),
604
- /* @__PURE__ */ jsx("option", { value: "640", children: "659-640" }),
605
- /* @__PURE__ */ jsx("option", { value: "620", children: "639-620" }),
606
- /* @__PURE__ */ jsx("option", { value: "600", children: "Below 620" })
607
- ]
608
- }
609
- ) }),
610
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
611
- Input,
612
- {
613
- id: "zipCode",
614
- type: "number",
615
- ...register("zipCode", {
616
- required: true,
617
- setValueAs: (value) => Number(value)
618
- }),
619
- label: "Zip Code",
620
- sizes: "medium",
621
- required: true,
622
- error: !!errors.zipCode,
623
- helperText: errors.zipCode?.message,
624
- variant
625
- }
626
- ) }),
627
- loanPurpose === 2 ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: fullRowForm, children: /* @__PURE__ */ jsx(
628
- Input,
629
- {
630
- id: "cashOut",
631
- type: "text",
632
- ...register("cashOut", {
633
- required: true,
634
- setValueAs: (value) => parseCurrency(value)
635
- }),
636
- label: "Cash Out (Optional)",
637
- sizes: "medium",
638
- error: !!errors.cashOut,
639
- helperText: errors.cashOut?.message,
640
- variant,
641
- onBlur: (e) => {
642
- const rawValue = e.target.value;
643
- const parsedValue = parseCurrency(rawValue);
644
- methods.setValue("cashOut", parsedValue);
645
- e.target.value = formatCurrency(parsedValue);
646
- },
647
- onFocus: (e) => {
648
- const currentValue = e.target.value;
649
- e.target.value = currentValue.replace(/[$,]/g, "");
650
- }
651
- }
652
- ) }) }) : null,
653
- /* @__PURE__ */ jsx("div", { className: clsx(fullRowForm, "text_center"), children: /* @__PURE__ */ jsx(
654
- "div",
655
- {
656
- className: clsx(
657
- descriptionField({ variant }),
658
- "text_center"
659
- ),
660
- children: "Almost there! Please provide your contact information to view rates and sign up for Rate Watch."
661
- }
662
- ) }),
663
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
664
- Input,
665
- {
666
- id: "firstName",
667
- ...register("firstName", {
668
- required: "First Name is required"
669
- }),
670
- label: "First Name",
671
- sizes: "medium",
672
- required: true,
673
- error: !!errors.firstName,
674
- helperText: errors.firstName?.message,
675
- variant
676
- }
677
- ) }),
678
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
679
- Input,
680
- {
681
- id: "lastName",
682
- ...register("lastName", { required: true }),
683
- label: "Last Name",
684
- sizes: "medium",
685
- required: true,
686
- error: !!errors.lastName,
687
- helperText: errors.lastName?.message,
688
- variant
689
- }
690
- ) }),
691
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
692
- Input,
693
- {
694
- id: "email",
695
- ...register("email", {
696
- required: true,
697
- validate: {
698
- isValid: associatedEmail
726
+ ) }),
727
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
728
+ InputPhone,
729
+ {
730
+ id: "phone",
731
+ ...register("phone", { required: true, maxLength: 12 }),
732
+ label: "Phone Number",
733
+ sizes: "medium",
734
+ required: true,
735
+ error: !!errors.phone,
736
+ helperText: errors.phone?.message,
737
+ variant
699
738
  }
700
- }),
701
- label: "Email",
702
- sizes: "medium",
703
- required: true,
704
- error: !!errors.email,
705
- helperText: errors.email?.message,
706
- variant
707
- }
708
- ) }),
709
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
710
- InputPhone,
711
- {
712
- id: "phone",
713
- ...register("phone", { required: true, maxLength: 12 }),
714
- label: "Phone Number",
715
- sizes: "medium",
716
- required: true,
717
- error: !!errors.phone,
718
- helperText: errors.phone?.message,
719
- variant
720
- }
721
- ) })
722
- ] }),
723
- children,
724
- /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
725
- /* @__PURE__ */ jsx("div", { className: actions, children: isSubmitting ? /* @__PURE__ */ jsx(
726
- LoadingIndicator,
727
- {
728
- style: { marginInline: "auto" },
729
- variant
730
- }
731
- ) : /* @__PURE__ */ jsxs("div", { className: formBtns, children: [
732
- /* @__PURE__ */ jsx(
733
- "button",
734
- {
735
- type: "submit",
736
- disabled: !isValid,
737
- className: button({
738
- color: "secondary",
739
- size: "large",
740
- rounded: "medium",
741
- disabled: !isValid
742
- }),
743
- children: "Get My Rate"
744
- }
745
- ),
746
- /* @__PURE__ */ jsxs("span", { className: `sc__btn ${chevron_wrapper}`, children: [
747
- /* @__PURE__ */ jsx(
748
- "a",
739
+ ) })
740
+ ] }),
741
+ children,
742
+ /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
743
+ /* @__PURE__ */ jsx("div", { className: actions, children: isSubmitting ? /* @__PURE__ */ jsx(
744
+ LoadingIndicator,
749
745
  {
750
- id,
751
- className: `${chevron({ variant })} ${!isValid ? na_cursor : ""}`,
752
- onClick: isValid ? handleSubmit(async (data) => {
753
- await onSubmit(data);
754
- toggleModal();
755
- setHideModal(false);
756
- }) : (e) => {
757
- e.preventDefault();
758
- },
759
- children: "Sign Up For Ratewatch"
746
+ style: { marginInline: "auto" },
747
+ variant
760
748
  }
761
- ),
762
- /* @__PURE__ */ jsx(SvgArrowIcon, { className: "arrow", variant: "tertiary" })
763
- ] })
764
- ] }) })
765
- ] })
749
+ ) : /* @__PURE__ */ jsxs("div", { className: formBtns, children: [
750
+ /* @__PURE__ */ jsx(
751
+ "button",
752
+ {
753
+ type: "submit",
754
+ disabled: !isValid,
755
+ className: button({
756
+ color: "secondary",
757
+ size: "large",
758
+ rounded: "medium",
759
+ disabled: !isValid
760
+ }),
761
+ children: "Get My Rate"
762
+ }
763
+ ),
764
+ /* @__PURE__ */ jsxs("span", { className: `sc__btn ${chevron_wrapper}`, children: [
765
+ /* @__PURE__ */ jsx(
766
+ "a",
767
+ {
768
+ id,
769
+ className: `${chevron({ variant })} ${!isValid ? na_cursor : ""}`,
770
+ onClick: isValid ? handleSubmit(async (data) => {
771
+ await onSubmit(data);
772
+ toggleModal();
773
+ setHideModal(false);
774
+ }) : (e) => {
775
+ e.preventDefault();
776
+ },
777
+ children: "Sign Up For Ratewatch"
778
+ }
779
+ ),
780
+ /* @__PURE__ */ jsx(SvgArrowIcon, { className: "arrow", variant: "tertiary" })
781
+ ] })
782
+ ] }) }),
783
+ /* @__PURE__ */ jsx(HoneyPot, { register, variant })
784
+ ]
785
+ }
786
+ )
766
787
  ] }) })
767
788
  },
768
789
  id