@mychoice/mychoice-sdk-modules 2.1.9 → 2.1.14
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/cjs/index.js +20 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/init/StoryAppWrapper/StoryAppWrapper.d.ts +1 -1
- package/dist/cjs/init/StoryAppWrapper/interfaces.d.ts +1 -1
- package/dist/cjs/insurances/car/pages/{quote/PageAllQuotes.d.ts → three-point-five/BestOfferFirst.d.ts} +1 -1
- package/dist/cjs/insurances/car/pages/three-point-five/index.d.ts +1 -0
- package/dist/cjs/insurances/car/pages/three-point-five/sections/OfferSectionCopy.d.ts +3 -0
- package/dist/cjs/insurances/car/pages/three-point-five/sections/OfferSectionDupe.d.ts +3 -0
- package/dist/cjs/insurances/car/pages/three-point-five/sections/index.d.ts +1 -0
- package/dist/esm/index.js +20 -10
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/init/StoryAppWrapper/StoryAppWrapper.d.ts +1 -1
- package/dist/esm/init/StoryAppWrapper/interfaces.d.ts +1 -1
- package/dist/esm/insurances/car/pages/{quote/PageAllQuotes.d.ts → three-point-five/BestOfferFirst.d.ts} +1 -1
- package/dist/esm/insurances/car/pages/three-point-five/index.d.ts +1 -0
- package/dist/esm/insurances/car/pages/three-point-five/sections/OfferSectionCopy.d.ts +3 -0
- package/dist/esm/insurances/car/pages/three-point-five/sections/OfferSectionDupe.d.ts +3 -0
- package/dist/esm/insurances/car/pages/three-point-five/sections/index.d.ts +1 -0
- package/package.json +4 -4
- package/dist/cjs/insurances/car/pages/quote/sections/blocks/BlockConfirmImages.d.ts +0 -1
- package/dist/cjs/insurances/car/pages/quote/sections/blocks/BlockQuoteStatistics.d.ts +0 -2
- package/dist/cjs/shared/sections/quotes/OfferSection/BestOfferSection.d.ts +0 -3
- package/dist/cjs/shared/sections/quotes/OfferSection/DummyOfferSection.d.ts +0 -3
- package/dist/esm/insurances/car/pages/quote/sections/blocks/BlockConfirmImages.d.ts +0 -1
- package/dist/esm/insurances/car/pages/quote/sections/blocks/BlockQuoteStatistics.d.ts +0 -2
- package/dist/esm/shared/sections/quotes/OfferSection/BestOfferSection.d.ts +0 -3
- package/dist/esm/shared/sections/quotes/OfferSection/DummyOfferSection.d.ts +0 -3
package/dist/cjs/index.js
CHANGED
|
@@ -188,9 +188,9 @@ const usePathGroups = (insuranceType) => {
|
|
|
188
188
|
// [`${InsuranceTypes.Life}`]: [{ name: 'Life', link: `/${appConfigState.localIndex}/life` }],
|
|
189
189
|
};
|
|
190
190
|
const externalPathGroup = [
|
|
191
|
-
{ name: 'Car', link: 'https://
|
|
192
|
-
{ name: 'Home', link: 'https://
|
|
193
|
-
{ name: 'Life', link: 'https://
|
|
191
|
+
{ name: 'Car', link: 'https://quote.mychoice.ca/insurance/car' },
|
|
192
|
+
{ name: 'Home', link: 'https://quote.mychoice.ca/insurance/home' },
|
|
193
|
+
{ name: 'Life', link: 'https://quote.mychoice.ca/insurance/life' },
|
|
194
194
|
{ name: 'Learn', link: 'https://www.mychoice.ca/blog/' },
|
|
195
195
|
];
|
|
196
196
|
// @todo: use in future.
|
|
@@ -308,10 +308,12 @@ const ModalPostal = () => {
|
|
|
308
308
|
const getVehicleYearRange = () => {
|
|
309
309
|
const currentDate = new Date();
|
|
310
310
|
const vehicleYear = [];
|
|
311
|
-
|
|
311
|
+
const currentYear = currentDate.getFullYear();
|
|
312
|
+
const minYear = currentYear - 25;
|
|
313
|
+
for (let year = (currentDate.getFullYear()); year > minYear; year -= 1) {
|
|
312
314
|
vehicleYear.push({ name: `${year}`, value: `${year}` });
|
|
313
315
|
}
|
|
314
|
-
vehicleYear.push({ name:
|
|
316
|
+
vehicleYear.push({ name: `${minYear} or older`, value: `${minYear}` });
|
|
315
317
|
return vehicleYear;
|
|
316
318
|
};
|
|
317
319
|
const getRecommendedRange = (distanceDaily, distanceBusiness) => {
|
|
@@ -414,7 +416,7 @@ const BlockCarInfo = () => {
|
|
|
414
416
|
const { vehicleState, dispatchVehicleState } = mychoiceSdkStore.useStoreFormCarVehicle();
|
|
415
417
|
const { year: currentYear, make: currentMake, model: currentModel, } = vehicleState.items[vehicleState.activeIndex];
|
|
416
418
|
const yearIsValid = !currentYear || Number(currentYear) > 1998;
|
|
417
|
-
const yearMessage = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: ["Please contact a licenced representative at
|
|
419
|
+
const yearMessage = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: ["Please contact a licenced representative at Hagerty for classic car insurance:", ' ', jsxRuntime.jsx("a", { href: "tel:18335431540", children: "1-833-543-1540" })] }));
|
|
418
420
|
const handleVehicleYearChange = ({ value }) => {
|
|
419
421
|
if (value) {
|
|
420
422
|
dispatchVehicleState({
|
|
@@ -559,7 +561,12 @@ const BlockCarConditionInfo = () => {
|
|
|
559
561
|
const VehicleSectionMain = () => {
|
|
560
562
|
const { appConfigState: { appType } } = mychoiceSdkStore.useStoreAppConfig();
|
|
561
563
|
const mychoiceCls = appType === mychoiceSdkComponents.AppTypes.MyChoice ? 'mychoice' : '';
|
|
562
|
-
|
|
564
|
+
const carEmoji = '\u{1F697}';
|
|
565
|
+
return (jsxRuntime.jsxs("div", { className: `form-section top-section ${mychoiceCls}`, children: [mychoiceCls && (jsxRuntime.jsx("h2", { style: {
|
|
566
|
+
whiteSpace: 'normal',
|
|
567
|
+
marginTop: '20px',
|
|
568
|
+
textAlign: 'center',
|
|
569
|
+
}, children: `${carEmoji} Give us the scoop on your four-wheeled friend.` })), jsxRuntime.jsx(BlockCarInfo, {}), jsxRuntime.jsx(BlockCarConditionInfo, {})] }));
|
|
563
570
|
};
|
|
564
571
|
|
|
565
572
|
const VehicleSectionCoverage = () => {
|
|
@@ -788,7 +795,8 @@ const SectionDriverInfo = () => {
|
|
|
788
795
|
payload: { applicantRelationship: value },
|
|
789
796
|
});
|
|
790
797
|
};
|
|
791
|
-
|
|
798
|
+
const inspectEmoji = '\u{1F50D}';
|
|
799
|
+
return (jsxRuntime.jsxs("div", { className: `form-section ${mychoiceCls}`, children: [mychoiceCls && jsxRuntime.jsx("h2", { className: "section-title", children: `${inspectEmoji} Time for a micro autobiography – tell us about you.` }), jsxRuntime.jsx(InputFormBox, { name: "firstName", title: "What is your legal first name?", onChange: handleFirstNameChange, defaultValue: firstName, description: "The name on a policy should match the one on your official driver\u2019s licence.", placeholder: "Driver First Name", error: !firstName && driverState.inValidation, errorMessage: getErrorMessage(firstName, driverState.inValidation) }), jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.maritalStatusOptions, name: "maritalStatus", onChange: handleMaritalStatusChange, defaultValue: getSelectedOption(mychoiceSdkComponents.maritalStatusOptions, maritalStatus), title: "What is your marital status?", placeholder: "Select from the list", description: "If you are married, it may have a positive effect on your car insurance premiums and coverage. In some provinces, the law now considers same-sex partners to have a common-law marriage, so you will need to check your local regulations. If you are divorced or widowed, select single.", autoSelectIfValueIsOutOfOptions: false, error: !maritalStatus && driverState.inValidation, errorMessage: getErrorMessage(maritalStatus, driverState.inValidation) }), jsxRuntime.jsx(DateSelectFormBox, { name: "dateOfBirth", dateNames: ['birthYear', 'birthMonth', 'birthDay'], onDateChange: handleDateOfBirthChange, defaultValue: defaultDateOfBirth, title: "When were you born?", description: "Insurers generally consider your age and driving experience when calculating a vehicle insurance quote. The safest drivers are often those who are over thirty, but each insurer will have their own parameters. The youngest and oldest drivers have the greatest liability reflected in their premiums due to inexperience or health complications, respectively.", errorMessage: getDateErrorMessage([birthDay || '', birthMonth || '', birthYear || ''], driverState.inValidation), error: driverState.inValidation, maxDate: mychoiceSdkComponents.subYearsFromDate('', configState.licenceConfig.minLicenceAge || 16), isDay: true }), jsxRuntime.jsx(SwitchButtonBox, { name: "occupation", items: mychoiceSdkComponents.occupationOptions, onChange: handleOccupationChange, defaultValue: getSelectedOption(mychoiceSdkComponents.occupationOptions, occupation), title: "Are you currently employed or unemployed?", description: "Your employment status reflects your driving frequency, and insurers consider this in your policy." }), jsxRuntime.jsx(SwitchButtonBox, { items: mychoiceSdkComponents.genderOptions, onChange: handleGenderChange, name: "gender", defaultValue: getSelectedOption(mychoiceSdkComponents.genderOptions, gender), title: "What is your gender?", description: "The gender on the policy should match your official driver\u2019s licence. Some insurers analyze a driver's sex when creating a policy. Men are typically considered higher risk than female drivers, but the statistics supporting this idea vary from province to province. On average, men and women pay roughly the same for insurance, though." }), driverState.activeIndex > 0
|
|
792
800
|
&& (jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.applicantRelationshipOptions, name: "applicantRelationship", onChange: handleApplicantRelationshipChange, defaultValue: getSelectedOption(mychoiceSdkComponents.applicantRelationshipOptions, applicantRelationship), title: "Relationship to applicant", placeholder: "Select...", autoSelectIfValueIsOutOfOptions: false, error: !applicantRelationship && driverState.inValidation, errorMessage: getErrorMessage(applicantRelationship, driverState.inValidation) }))] }));
|
|
793
801
|
};
|
|
794
802
|
|
|
@@ -1643,9 +1651,10 @@ const SectionDiscountInfo$1 = () => {
|
|
|
1643
1651
|
payload: { caslConsent: value },
|
|
1644
1652
|
});
|
|
1645
1653
|
};
|
|
1654
|
+
const moneyEmoji = '\u{1F4B0}';
|
|
1646
1655
|
return (jsxRuntime.jsxs("div", { className: `form-section ${mychoiceCls}`, children: [isTheBig
|
|
1647
1656
|
? (jsxRuntime.jsx(LabelFormBox, { title: "You are seconds away from receiving your car insurance quotes,\n please provide your email after completing the discount section so we\n can send you your personalized free car insurance quotes!" }))
|
|
1648
|
-
: (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("h2", { className: "section-title", children:
|
|
1657
|
+
: (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("h2", { className: "section-title", children: `${moneyEmoji} A little extra info for discounts and connecting you with our partners.` }), jsxRuntime.jsx("span", { className: "info-title-message", children: "You are seconds away from receiving your car insurance quotes, please provide your email after completing the discount section so we can send you your personalized free car insurance quotes!" })] })), jsxRuntime.jsx(BlockVehLinks, {}), jsxRuntime.jsx(SwitchButtonBox, { items: mychoiceSdkComponents.yesNoOptions, onChange: handleMultiplePolicyChange, name: "multiplePoliciesDiscount", defaultValue: getSelectedOption(mychoiceSdkComponents.yesNoOptions, multiplePoliciesDiscount), title: "You could receive a 10-15% discount for bundling insurance with multiple policies with the same insurance company. Does that interest you?", description: "Bundling your home and auto insurance can save you significantly on insurance premiums as a whole package. Do you want to learn more about the benefits of multiple policies for home, tenant, condo, or car insurance? All you have to do is select yes.." }), !(allProvinces.isAlbertaProvince && isTheBig) && (jsxRuntime.jsx(SwitchButtonBox, { items: mychoiceSdkComponents.yesNoOptions, onChange: handleCaaMemberChange, name: "caaMemberDiscount", defaultValue: getSelectedOption(mychoiceSdkComponents.yesNoOptions, caaMemberDiscount), title: "Please indicate if you are a member of CAA, you could save up to an additional 20%." })), jsxRuntime.jsx(SwitchButtonBox, { items: mychoiceSdkComponents.yesNoOptions, onChange: handleAppInstallChange, name: "appInstallDiscount", defaultValue: getSelectedOption(mychoiceSdkComponents.yesNoOptions, appInstallDiscount), title: "You could receive up to a 30% discount by using an app to track driving habits. Does that interest you?", description: "Get rewarded for safe driving with the click of a button. If you install the app, you may be eligible for a 30% discount on your insurance premiums. Typically, you receive 10% of the discount upfront and the balance after six months of good driving." }), isTheBig
|
|
1649
1658
|
? (jsxRuntime.jsxs("div", { className: "input-form-box-container", children: [jsxRuntime.jsx(LabelFormBox, { title: "Complete this form to see all your personalized\n quotes on the next page, you will also be able to:" }), jsxRuntime.jsxs("ol", { className: "ordered-block", children: [jsxRuntime.jsx("li", { children: "See what rates insurance carriers are offering" }), jsxRuntime.jsx("li", { children: "Get in touch with us and secure your rate" }), jsxRuntime.jsx("li", { children: "Potentially save more by speaking with a broker" })] })] }))
|
|
1650
1659
|
: jsxRuntime.jsx("h2", { children: "Complete the form below to see which companies are offering your quotes." }), jsxRuntime.jsx(InputFormBox, { name: "firstName", title: "First Name", onChange: handleFirstNameChange, defaultValue: firstName, placeholder: "Your First Name", error: !firstName && discountState.inValidation, errorMessage: getErrorMessage(firstName, discountState.inValidation) }), jsxRuntime.jsx(InputFormBox, { name: "lastname", title: "Last Name", onChange: handleLastNameChange, defaultValue: lastName, placeholder: "Your Last Name", error: !lastName && discountState.inValidation, errorMessage: getErrorMessage(lastName, discountState.inValidation) }), isTheBig
|
|
1651
1660
|
&& (jsxRuntime.jsx(InputFormLicenceBox, { ...getDynamicLicenceBoxProps({ ...allProvinces }), name: "driverLicense", title: "Driver Licence Number (Optional)", onChange: handleDriverLicenseChange, defaultValue: driverLicense, description: "Enter your drivers licence number in to receive a more accurate, prequalified quote from our broker partners. This will enable you to provide less details over the phone if you choose to have a broker contact you. This is an optional input." })), jsxRuntime.jsx(InputFormPhoneBox, { name: "phone", onChange: handlePhoneNumberChange, defaultValue: phone, title: "Phone Number", placeholder: "(855) 325-8444", error: !phone && discountState.inValidation, errorMessage: getErrorMessage(phone, discountState.inValidation) }), jsxRuntime.jsx(InputFormEmailBox, { validationStatus: emailStatus, errorMessage: emailStatus === mychoiceSdkComponents.ValidationStatusTypes.Declined
|
|
@@ -3776,6 +3785,7 @@ const AppRouteWrapper = (props) => {
|
|
|
3776
3785
|
let postalCode = carPostal;
|
|
3777
3786
|
const { clearFormData, checkIsExpired, checkIsExpiredWithModal, } = mychoiceSdkStore.ClearFormDataHandler();
|
|
3778
3787
|
const { appLoaderState } = mychoiceSdkStore.useStoreAppLoader();
|
|
3788
|
+
const isMychoice = appType === mychoiceSdkComponents.AppTypes.MyChoice;
|
|
3779
3789
|
switch (insuranceType) {
|
|
3780
3790
|
case mychoiceSdkComponents.InsuranceTypes.Car:
|
|
3781
3791
|
postalCode = carPostal;
|
|
@@ -3985,7 +3995,7 @@ const AppRouteWrapper = (props) => {
|
|
|
3985
3995
|
}
|
|
3986
3996
|
}
|
|
3987
3997
|
}, [carPostal, homePostal, lifePostal, isReady]);
|
|
3988
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: isReady && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(AppHeader, {}), jsxRuntime.jsx(AppModal, {}), insuranceType && (jsxRuntime.jsx(NavigationTop, { title: `${insuranceType.replace(/^./, insuranceType[0].toUpperCase())} Insurance Quote`, postalCode: postalCode, formSteps: steps, validationHooks: validationHooks, clearForm: clearFormData, propertyIsCompleted: isCompleted })), insuranceType && appType === mychoiceSdkComponents.AppTypes.MyChoice && (jsxRuntime.jsx("div", { className: "step-progress-bar", children: jsxRuntime.jsx("span", { style: { width: progressLength } }) })), jsxRuntime.jsx("div", { className: `${insuranceType ? 'form-page-content' : ''} ${insuranceType && appType === mychoiceSdkComponents.AppTypes.MyChoice ? 'mychoice' : ''}`, children: insuranceType && appType === mychoiceSdkComponents.AppTypes.MyChoice && isDesktop && progressLength ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { className: "mychoice-content", children: [jsxRuntime.jsx(StepsBox, { className: "step-box", formSteps: steps, validationHooks: validationHooks, propertyIsCompleted: isCompleted }), children, jsxRuntime.jsx("div", { className: "empty-steps-container" })] }) })) : children }), !appLoaderState.isOpen &&
|
|
3998
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: isReady && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(AppHeader, {}), jsxRuntime.jsx(AppModal, {}), insuranceType && (jsxRuntime.jsx(NavigationTop, { title: `${insuranceType.replace(/^./, insuranceType[0].toUpperCase())} Insurance Quote`, postalCode: postalCode, formSteps: steps, validationHooks: validationHooks, clearForm: clearFormData, propertyIsCompleted: isCompleted })), insuranceType && appType === mychoiceSdkComponents.AppTypes.MyChoice && (jsxRuntime.jsx("div", { className: "step-progress-bar", children: jsxRuntime.jsx("span", { style: { width: progressLength } }) })), jsxRuntime.jsx("div", { className: `${insuranceType ? 'form-page-content' : ''} ${insuranceType && appType === mychoiceSdkComponents.AppTypes.MyChoice ? 'mychoice' : ''}`, children: insuranceType && appType === mychoiceSdkComponents.AppTypes.MyChoice && isDesktop && progressLength ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { className: "mychoice-content", children: [jsxRuntime.jsx(StepsBox, { className: "step-box", formSteps: steps, validationHooks: validationHooks, propertyIsCompleted: isCompleted }), children, jsxRuntime.jsx("div", { className: "empty-steps-container" })] }) })) : children }), isMychoice && !appLoaderState.isOpen && jsxRuntime.jsx(ProviderImageFooter, {})] })) }));
|
|
3989
3999
|
};
|
|
3990
4000
|
const NestedRoutes = () => {
|
|
3991
4001
|
const insuranceType = mychoiceSdkComponents.getInsuranceType();
|