@mychoice/mychoice-sdk-modules 2.2.13 → 2.2.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.
@@ -4,4 +4,5 @@ export interface SubmitBlockInterface {
4
4
  label?: string;
5
5
  buttonSize?: SizeTypes;
6
6
  isRecalc?: boolean;
7
+ onSubmitClick?: () => void;
7
8
  }
@@ -0,0 +1,7 @@
1
+ import { SdkFC } from '@mychoice/mychoice-sdk-components';
2
+ export type AccidentBenefitsModalProps = {
3
+ selectedCoverages: string[];
4
+ onApply: (selected: string[]) => void;
5
+ onCancel: () => void;
6
+ };
7
+ export declare const AccidentBenefitsModal: SdkFC<AccidentBenefitsModalProps>;
@@ -0,0 +1,2 @@
1
+ import { SdkFC } from '@mychoice/mychoice-sdk-components';
2
+ export declare const VehicleSectionAccidentBenefits: SdkFC;
@@ -1,2 +1,3 @@
1
1
  export { VehicleSectionMain } from './SectionMain';
2
+ export { VehicleSectionAccidentBenefits } from './SectionAccidentBenefits';
2
3
  export { VehicleSectionCoverage } from './SectionCoverage';
package/dist/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { ErrorBoundary } from 'react-error-boundary';
3
- import { AppTypes, isMyChoiceLike, TitleForm, TooltipForm, IconDelete, ColorVariablesTypes, InputTypes, InputForm, InputFormPhone, InputFormEmail, InputFormLicence, SelectForm, getFormattedDate, DateTypes, getDateOptions, ButtonForm, defaultBrokerPhone, DriverPriorityTypes, SizeTypes, ButtonBase, CategoryTypes, ColorTypes, defaultLocalIndex, liabilityOptions, coverageOptions, lossOfUseOptions, liabilityForDamageOptions, limitedWaiverOfDepreciationOptions, OfferDetail, CompanyRoleTypes, OperationHoursInfo, OfferHeader, OfferPrice, ButtonTypes, ButtonVariantTypes, IconDropdownArrow, InsuranceTypes, HeaderNavGroup, ButtonMenu, DeviceTypes, IconLoaderPrimary, getInsuranceType, RequestStatusTypes, formatPostalCode, IconLoaderSecondary, postalCodeFormat, useEffectOnce, carCondition, carStatus, carWinterTiresCheck, carKeepPlace, carUsagePurpose, firstDriveDistanceList, dailyDriveBusinessDistanceList, yearlyDriveDistanceList, numberWithCommas, VehiclePrimaryUseTypes, comprehensiveCoverage, collisionCoverage, maritalStatusOptions, subYearsFromDate, occupationOptions, genderOptions, applicantRelationshipOptions, addYearsToDate, checkDateIsSpecial, DriverLicenceTypes, getDifferenceInYears, getLicenceTypeOptions, getDisabledLicenceTypes, yesNoOptions, addDaysToDate, getMinDate, CheckboxForm, getMinDateByYears, compareDates, insuranceCancellationReasonOptions, DriverListTypes, licenceSuspensionsReasonOptions, trafficTicketsGroupOptions, ValidationStatusTypes, getPlaceholderEmail, QuoteEdit, homeOwnerTypeOptions, tenantBuildingStructureOptions, condoBuildingStructureOptions, homeBuildingStructureOptions, residentsOptions, insuredYearsOptions, getInsuranceYearsOptions, ApplicantListTypes, claimTypeOptions, exteriorFinishOptions, constructionTypeOptions, garageTypeOptions, getNumericOptions, fireHallDistanceOptions, fireHydrantDistanceOptions, primaryHeatingTypeOptions, auxHeatingTypeOptions, InfoMessage, ppOptions, homeCoverageOptions, homeLiabilityOptions, lifeInsuranceTypeOptions, lifeInsuranceOntarioTypeOptions, lifeCoverageOptions, smokerOptions, MychoiceStep, Step, IconClock, ButtonArrow, DirectionTypes, ButtonTabArrow, ButtonTab, ButtonTabMobile, NavigationCar, NavigationPerson, NavigationDiscount, NavigationQuotes, NavigationAddress, NavigationProperty, ModalTypes } from '@mychoice/mychoice-sdk-components';
4
- import { useStoreAppConfig, useStoreFormCarVehicle, useStoreFormCarDriverBase, useStoreFormCarDiscount, StoreFormCarDiscountActionTypes, useStoreFormCarQuote, CarQuoteDataHandler, useValidationCarDiscount, StoreFormCarVehicleActionTypes, useStoreFormHomeDiscount, useStorePartner, useStoreDeviceType, useStoreAppLoader, useStoreAppModal, StoreConfigAppModalActionTypes, useHandlerPostal, useHandlerCarMake, useHandlerCarModel, useProvince, useValidationVehicle, useAutofillCarForm, StoreFormCarDriverBaseActionTypes, useStoreFormCarConfig, useStoreFormCarDriverInfo, StoreFormCarDriverInfoActionTypes, useStoreFormCarDriverLicence, addDayToDate, StoreFormCarDriverLicenceActionTypes, useStoreFormCarDriverInsurance, StoreFormCarDriverInsuranceActionTypes, useStoreFormCarDriverCancellation, StoreFormCarDriverCancellationActionTypes, useStoreFormCarDriverSuspension, StoreFormCarDriverSuspensionActionTypes, useStoreFormCarDriverAccident, StoreFormCarDriverAccidentActionTypes, useStoreFormCarDriverTicket, StoreFormCarDriverTicketActionTypes, useValidationDriver, useHandlerCarQuoterEmail, useStoreFormHomeDwelling, useStoreFormHomePostal, useStoreFormHomeApplicantBase, StoreFormHomePostalActionTypes, StoreFormHomeDwellingActionTypes, StoreConfigAppConfigActionTypes, StoreFormHomeApplicantBaseActionTypes, useValidationAddress, useStoreFormHomeApplicantInfo, StoreFormHomeDiscountActionTypes, StoreFormHomeApplicantInfoActionTypes, useStoreFormHomeApplicantInsurance, StoreFormHomeApplicantInsuranceActionTypes, useStoreFormHomeApplicantCancellation, StoreFormHomeApplicantCancellationActionTypes, useStoreFormHomeApplicantClaim, StoreFormHomeApplicantClaimActionTypes, useValidationApplicant, useValidationDwelling, useStoreFormHomeQuote, HomeQuoteDataHandler, useValidationHomeDiscount, useHandlerHomeQuoterEmail, useStoreFormLifeCoverage, StoreFormLifeCoverageActionTypes, useValidationCoverage, useAutofillLifeForm, useStoreFormLifeQuote, useStoreFormLifeApplicant, LifeQuoteDataHandler, useValidationLifeApplicant, useHandlerLifeQuoterEmail, StoreFormLifeApplicantActionTypes, useStoreFormCarPostal, useStoreFormLifePostal, ClearFormDataHandler, useStoreAppDevice, useStoreClient, useHandlerAuth, useHandlerPartner, StoreConfigAppLoaderActionTypes, StoreFormCarConfigActionTypes, StoreFormCarPostalActionTypes, StoreFormCarQuoteActionTypes, StoreFormHomeQuoteActionTypes, StoreFormLifePostalActionTypes, StoreFormLifeQuoteActionTypes, StoreClientActionTypes, StoreConfigAppDeviceActionTypes, StoreProvider, initHttpResponse } from '@mychoice/mychoice-sdk-store';
3
+ import { AppTypes, isMyChoiceLike, TitleForm, TooltipForm, IconDelete, ColorVariablesTypes, InputTypes, InputForm, InputFormPhone, InputFormEmail, InputFormLicence, SelectForm, getFormattedDate, DateTypes, getDateOptions, ButtonForm, defaultBrokerPhone, DriverPriorityTypes, SizeTypes, ButtonBase, CategoryTypes, ColorTypes, defaultLocalIndex, liabilityOptions, accidentBenefitsOptionalOptions, coverageOptions, lossOfUseOptions, liabilityForDamageOptions, limitedWaiverOfDepreciationOptions, OfferDetail, CompanyRoleTypes, OperationHoursInfo, OfferHeader, OfferPrice, ButtonTypes, ButtonVariantTypes, IconDropdownArrow, InsuranceTypes, HeaderNavGroup, ButtonMenu, DeviceTypes, IconLoaderPrimary, getInsuranceType, RequestStatusTypes, formatPostalCode, IconLoaderSecondary, postalCodeFormat, useEffectOnce, carCondition, carStatus, carWinterTiresCheck, carKeepPlace, carUsagePurpose, firstDriveDistanceList, dailyDriveBusinessDistanceList, yearlyDriveDistanceList, numberWithCommas, VehiclePrimaryUseTypes, addDaysToDate, comprehensiveCoverage, collisionCoverage, maritalStatusOptions, subYearsFromDate, occupationOptions, genderOptions, applicantRelationshipOptions, addYearsToDate, checkDateIsSpecial, DriverLicenceTypes, getDifferenceInYears, getLicenceTypeOptions, getDisabledLicenceTypes, yesNoOptions, getMinDate, CheckboxForm, getMinDateByYears, compareDates, insuranceCancellationReasonOptions, DriverListTypes, licenceSuspensionsReasonOptions, trafficTicketsGroupOptions, ValidationStatusTypes, getPlaceholderEmail, QuoteEdit, homeOwnerTypeOptions, tenantBuildingStructureOptions, condoBuildingStructureOptions, homeBuildingStructureOptions, residentsOptions, insuredYearsOptions, getInsuranceYearsOptions, ApplicantListTypes, claimTypeOptions, exteriorFinishOptions, constructionTypeOptions, garageTypeOptions, getNumericOptions, fireHallDistanceOptions, fireHydrantDistanceOptions, primaryHeatingTypeOptions, auxHeatingTypeOptions, InfoMessage, ppOptions, homeCoverageOptions, homeLiabilityOptions, lifeInsuranceTypeOptions, lifeInsuranceOntarioTypeOptions, lifeCoverageOptions, smokerOptions, MychoiceStep, Step, IconClock, ButtonArrow, DirectionTypes, ButtonTabArrow, ButtonTab, ButtonTabMobile, NavigationCar, NavigationPerson, NavigationDiscount, NavigationQuotes, NavigationAddress, NavigationProperty, ModalTypes } from '@mychoice/mychoice-sdk-components';
4
+ import { useStoreAppConfig, useStoreFormCarVehicle, useStoreFormCarDriverBase, useStoreFormCarDiscount, StoreFormCarDiscountActionTypes, useStoreFormCarQuote, CarQuoteDataHandler, useValidationCarDiscount, StoreFormCarVehicleActionTypes, useStoreFormHomeDiscount, useStorePartner, useStoreDeviceType, useStoreAppLoader, useStoreAppModal, StoreConfigAppModalActionTypes, useHandlerPostal, useHandlerCarMake, useHandlerCarModel, useProvince, useAbReform, useValidationVehicle, useAutofillCarForm, StoreFormCarDriverBaseActionTypes, useStoreFormCarConfig, useStoreFormCarDriverInfo, StoreFormCarDriverInfoActionTypes, useStoreFormCarDriverLicence, addDayToDate, StoreFormCarDriverLicenceActionTypes, useStoreFormCarDriverInsurance, StoreFormCarDriverInsuranceActionTypes, useStoreFormCarDriverCancellation, StoreFormCarDriverCancellationActionTypes, useStoreFormCarDriverSuspension, StoreFormCarDriverSuspensionActionTypes, useStoreFormCarDriverAccident, StoreFormCarDriverAccidentActionTypes, useStoreFormCarDriverTicket, StoreFormCarDriverTicketActionTypes, useValidationDriver, useHandlerCarQuoterEmail, useStoreFormHomeDwelling, useStoreFormHomePostal, useStoreFormHomeApplicantBase, StoreFormHomePostalActionTypes, StoreFormHomeDwellingActionTypes, StoreConfigAppConfigActionTypes, StoreFormHomeApplicantBaseActionTypes, useValidationAddress, useStoreFormHomeApplicantInfo, StoreFormHomeDiscountActionTypes, StoreFormHomeApplicantInfoActionTypes, useStoreFormHomeApplicantInsurance, StoreFormHomeApplicantInsuranceActionTypes, useStoreFormHomeApplicantCancellation, StoreFormHomeApplicantCancellationActionTypes, useStoreFormHomeApplicantClaim, StoreFormHomeApplicantClaimActionTypes, useValidationApplicant, useValidationDwelling, useStoreFormHomeQuote, HomeQuoteDataHandler, useValidationHomeDiscount, useHandlerHomeQuoterEmail, useStoreFormLifeCoverage, StoreFormLifeCoverageActionTypes, useValidationCoverage, useAutofillLifeForm, useStoreFormLifeQuote, useStoreFormLifeApplicant, LifeQuoteDataHandler, useValidationLifeApplicant, useHandlerLifeQuoterEmail, StoreFormLifeApplicantActionTypes, useStoreFormCarPostal, useStoreFormLifePostal, ClearFormDataHandler, useStoreAppDevice, useStoreClient, useHandlerAuth, useHandlerPartner, StoreConfigAppLoaderActionTypes, StoreFormCarConfigActionTypes, StoreFormCarPostalActionTypes, StoreFormCarQuoteActionTypes, StoreFormHomeQuoteActionTypes, StoreFormLifePostalActionTypes, StoreFormLifeQuoteActionTypes, StoreClientActionTypes, StoreConfigAppDeviceActionTypes, StoreProvider, initHttpResponse } from '@mychoice/mychoice-sdk-store';
5
5
  import { useNavigate, useLocation, BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';
6
6
  import React, { useState, useCallback, useEffect, useRef, useMemo } from 'react';
7
7
  import { random } from 'lodash';
@@ -231,7 +231,7 @@ const BlockNextPageInfo$2 = () => {
231
231
  return null;
232
232
  };
233
233
 
234
- const BlockSubmit$2 = ({ className, label, buttonSize, isRecalc = false, }) => {
234
+ const BlockSubmit$2 = ({ className, label, buttonSize, isRecalc = false, onSubmitClick, }) => {
235
235
  const { quoteState: { isRequested, quoteConfirm } } = useStoreFormCarQuote();
236
236
  const { discountState: { isValid } } = useStoreFormCarDiscount();
237
237
  const { appConfigState: { localIndex, insuranceType } } = useStoreAppConfig();
@@ -239,13 +239,17 @@ const BlockSubmit$2 = ({ className, label, buttonSize, isRecalc = false, }) => {
239
239
  const { postRequestQuote } = CarQuoteDataHandler();
240
240
  const { carDiscountFormValidate } = useValidationCarDiscount();
241
241
  const handleGetQuotesClick = () => {
242
+ onSubmitClick?.();
242
243
  if (!isValid) {
243
244
  carDiscountFormValidate(false, () => postRequestQuote(isRecalc, quoteConfirm));
244
245
  }
245
- else if (!isRequested) {
246
+ else if (isRecalc) {
246
247
  postRequestQuote(isRecalc, quoteConfirm);
247
248
  }
248
- else if (!isRecalc) {
249
+ else if (!isRequested) {
250
+ postRequestQuote(false, quoteConfirm);
251
+ }
252
+ else {
249
253
  navigate(`/${localIndex || defaultLocalIndex}/${insuranceType}/quotes`);
250
254
  }
251
255
  };
@@ -255,11 +259,12 @@ BlockSubmit$2.defaultProps = {
255
259
  buttonSize: SizeTypes.Large,
256
260
  label: 'Get Your Quotes',
257
261
  className: '',
262
+ onSubmitClick: undefined,
258
263
  };
259
264
 
260
265
  const VehicleOfferCoverages = ({ coverages, nonStandardCoverages, }) => {
261
266
  const { vehicleState, dispatchVehicleState } = useStoreFormCarVehicle();
262
- const { comprehensive, collision, liability, lossofuse, liabilityfordamage, limitedwaiverofdepreciation } = vehicleState.items[vehicleState.activeIndex];
267
+ const { comprehensive, collision, liability, lossofuse, liabilityfordamage, limitedwaiverofdepreciation, accidentbenefits } = vehicleState.items[vehicleState.activeIndex];
263
268
  const vehicle_names = vehicleState.items.map(({ year, make, model }) => [`${year} ${make} ${model}`]);
264
269
  const isLeased = vehicleState.items.some((item) => item.leased);
265
270
  const handleComprehensiveChange = ({ value }) => {
@@ -374,7 +379,9 @@ const VehicleOfferCoverages = ({ coverages, nonStandardCoverages, }) => {
374
379
  }, 0);
375
380
  return `$${total.toFixed(2)}`;
376
381
  };
377
- return (jsxs(Fragment, { children: [jsx("div", { className: "offer-coverages-container", children: jsxs("table", { className: "offer-coverages-table", children: [jsxs("tr", { className: "table-header", children: [jsx("td", { children: vehicle_names.join(', ') }), jsx("td", { children: "Selection" }), jsx("td", { children: "Premium" })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) }), jsxs("tr", { children: [jsxs("td", { children: ["Third Party Liability Coverage", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: "Third-party liability coverage is mandatory in Ontario and protects you if you're found at fault for injuring or killing someone or damaging their property while driving. This includes people in other vehicles, pedestrians, cyclists, and even passengers in your own car, as well as property like fences, buildings, street signs, and light poles. If you’re sued, this coverage helps pay for legal defence, settlements, and any court-ordered payments. The minimum required coverage is $200,000, but that amount often isn’t enough—most drivers choose at least $2 million to avoid having to pay out-of-pocket if costs exceed the limit. This is a mandatory coverage in Ontario. Talk to your broker to ensure you have the right amount of protection." }) })] }), jsx("td", { children: jsx(SelectFormBox, { options: liabilityOptions, name: "liability-limit", onChange: handleLiabilityChange, defaultValue: getSelectedOption(liabilityOptions, liability.coverage ? liability.limit : 1000000), title: "", description: "", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false, size: SizeTypes.Small, className: "coverages-select-input" }) }), jsx("td", { children: getTPBIandTPPD() })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) }), jsxs("tr", { children: [jsxs("td", { children: ["Direct Compensation - Property Damange Coverage", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: "Third - Party Liability Direct Compensation responds when you are determined to be not at-fault in an accident with another vehicle, and covers the cost of damage to your vehicle (or actual cash value payout), it's equipment, contents, loss of use, and other associated incidentals such as towing fees and lot fees. This is considered an optional coverage, and it is highly recommended that you do not remove it. If your vehicle is financed or leased, the lienholder/lessor must agree to allow you to remove it. Should you remove it, you must also remove collision or all perils coverage. You will be entirely out-of-pocket in a not-at-fault accident and are legally restricted from claiming reimbursement (suing) the other vehicle owner or their insurer. Chat to your broker for more details about this coverage." }) })] }), jsx("td", { children: "$0 Deductible" }), jsx("td", { children: getCoveragePremium('TPDC') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) }), jsxs("tr", { children: [jsxs("td", { children: ["Accident Benefits Coverage", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: 'Accident Benefits is a mandatory coverage that responds when there is injury or death in an accident, regardless of fault, and for all affected individuals. It provides a core series of benefits with the capacity to increase coverage values, along with a menu of optional additional benefits that can be added on. The core and optional coverages must be thoroughly reviewed and evaluated, and decisions made based on your own personal circumstances and needs. Chat to your broker for more details about this coverage.' }) })] }), jsx("td", { children: "Included" }), jsx("td", { children: getCoveragePremium('AB') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) }), jsxs("tr", { children: [jsxs("td", { children: ["Uninsured Automobile Coverage", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: 'Uninsured Motorist Coverage is a mandatory coverage which responds when you are not at-fault in an accident with an uninsured or unidentified (hit-and-run) vehicle, and have incurred bodily injuries, death, or damage to your property, and the offending vehicle owner cannot be found, of if identified, cannot adequately compensate you. Coverage is capped to match the province minimum liability limit of $200,000. Due to the low coverage value, it is highly recommended to ensure inclusion of the OPCF44 Family Protection Coverage endorsement for additional protection. Chat to your broker for more details about this coverage.' }) })] }), jsx("td", { children: "Included" }), jsx("td", { children: getCoveragePremium('UA') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) }), jsxs("tr", { children: [jsxs("td", { children: ["Comprehensive Coverage", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: 'Comprehensive coverage responds to types of damages ( repair or actual cash value payout) incurred by your vehicle when it is not actively being driven. Examples would be fire, theft, vandalism, glass breakage, and weather-related losses. While considered an optional coverage, it is highly recommended. Should your vehicle be financed or leased, the lienholder/lessor will not allow you to leave this coverage out and will impose a satisfactory deductible to meet their requirements.' }) })] }), jsx("td", { children: jsx(SelectFormBox, { options: coverageOptions, name: "comprehensive-coverage", onChange: handleComprehensiveChange, defaultValue: getSelectedOption(coverageOptions, comprehensive.coverage ? comprehensive.deductible : 0), title: "", description: "", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false, size: SizeTypes.Small, className: "coverages-select-input" }) }), jsx("td", { children: getCoveragePremium('CMP') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) }), jsxs("tr", { children: [jsxs("td", { children: ["Collision Coverage", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: 'Collision coverage responds to your vehicle damages (repair or actual cash value payout) in the event you collide with another vehicle or object in the course of its use or operation, and is determined to be at-fault. While considered an optional coverage, it is highly recommended. Should your vehicle be financed or leased, the lienholder/lessor will not allow you to leave this coverage out and will impose a satisfactory deductible to meet their requirements. Chat to your broker for more details about this coverage.' }) })] }), jsx("td", { children: jsx(SelectFormBox, { options: coverageOptions, name: "collision-coverage", onChange: handleCollisionChange, defaultValue: getSelectedOption(coverageOptions, collision.coverage ? collision.deductible : 0), title: "", description: "", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false, size: SizeTypes.Small, className: "coverages-select-input" }) }), jsx("td", { children: getCoveragePremium('COL') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) }), doesCoverageExist('5') && (jsxs(Fragment, { children: [jsxs("tr", { children: [jsx("td", { children: "Permission to Rent or Lease (OPCF 5)" }), jsx("td", { children: "Included" }), jsx("td", { children: getCoveragePremium('5') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) })] })), isNonStandardCoverageActive(20) && (jsx(Fragment, { children: jsxs("tr", { children: [jsxs("td", { children: ["Loss of Use (OPCF 20)", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: 'The OPCF20 Loss of Use / Transportation Replacement endorsement responds when you are determined to be at-fault for an accident, or have a comprehensive claim, and need replacement transportation while your vehicle is out-of-service being repaired, or until it is deemed to be a total loss and a settlement offer is made by your insurer. Most often used to pay for a temporary replacement vehicle rental, it can also be used to compensate for other acceptable forms of travel. Depending on the insurer, the coverage limits available may be a dollar amount or a time amount, and you must have collision and comprehensive, or all perils coverage to include this endorsement. While it is optional, it is highly recommended, and careful consideration must be given to the coverage amounts chosen, as repair delays can quickly exhaust your policy limits, leaving you out-of-pocket for transportation expenses. Chat to your broker for more details about this coverage.' }) })] }), jsx("td", { style: { paddingBottom: '7px' }, children: jsx(SelectFormBox, { options: lossOfUseOptions, name: "loss-of-use", onChange: handleLossOfUseChange, defaultValue: getSelectedOption(lossOfUseOptions, lossofuse.coverage ? lossofuse.limit : 0), title: "", description: "", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false, size: SizeTypes.Small, className: "coverages-select-input" }) }), jsx("td", { rowSpan: doesCoverageExist('PAK6') ? 2 : 1, children: doesCoverageExist('PAK6') ? getCoveragePremium('PAK6') : getCoveragePremium('20') })] }) })), isNonStandardCoverageActive(27) && (jsxs(Fragment, { children: [jsxs("tr", { children: [jsxs("td", { children: ["Liability for Damage for Non-Owned Cars (OPCF 27)", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: 'The OPCF27 Liability for Damage to Non-Owned Automobile(s) endorsement responds when you rent or borrow a vehicle, and want to extend your coverages to that vehicle. Often used for special occasion rentals or vacation vehicle rentals. Full liability and physical damage coverages must be on your insured vehicle for this endorsement to apply, and a deductible is applicable. Careful consideration must be given in choosing a coverage amount that adequately covers the value of the vehicle you are expecting to rent or borrow. While considered optional, it is highly recommended, and often "packaged" with the OPCF20 Loss of Use / Transportation Replacement coverage by many insurers. Chat to your broker for more details about this coverage.' }) })] }), jsx("td", { children: jsx(SelectFormBox, { options: liabilityForDamageOptions, name: "liaiblity-for-damage", onChange: handleLiaiblityForDamageChange, defaultValue: getSelectedOption(liabilityForDamageOptions, liabilityfordamage.coverage ? liabilityfordamage.limit : 0), title: "", description: "", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false, size: SizeTypes.Small, className: "coverages-select-input" }) }), !doesCoverageExist('PAK6') && jsx("td", { children: getCoveragePremium('27') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) })] })), isNonStandardCoverageActive('aCCW') && (jsxs(Fragment, { children: [jsxs("tr", { children: [jsxs("td", { children: ["Accident Waiver or Forgiveness (OPCF 39)", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: "The OPCF39 Accident Waiver/Forgiveness endorsement responds by protecting your existing driving record from being negatively impacted by a single, partial at-fault or fully at-fault accident, and must be on the policy before the accident. The benefit of the coverage continues as long as you stay with the same insurer, as it's not transferable should you move to another insurance company. Subsequent at-fault or partial at-fault accidents will not have the protection and will be adversely rated accordingly. Eligibility, terms, conditions, and formulations used can vary significantly between insurers, so careful review and consideration are essential. While purchasing this endorsement is optional, it is highly recommended as the alternative of being accident-rated for several years will be significantly higher in premiums than the cost of the endorsement. Chat to your broker for more details about this coverage." }) })] }), jsx("td", { children: "Included" }), jsx("td", { children: getCoveragePremium('ACCW') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) })] })), isNonStandardCoverageActive(43) && (jsxs(Fragment, { children: [jsxs("tr", { children: [jsxs("td", { children: ["Limited waiver of depreciation (OPCF ", isLeased ? '43A' : '43', ")", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: 'The OPCF43/43A Removing Depreciation Deduction / Limited Waiver of Depreciation endorsement responds by protecting your original purchase/lease price of a "new" vehicle (as evidenced by a bill of sale or lease agreement) from depreciation should the vehicle be a total loss from an insured peril. Only new vehicles, and in some cases "demo\'s" with limited mileage are eligible, and the endorsement must be added immediately upon the vehicle delivery. Coverage durations available vary between insurers, generally ranging from 24 months to 60 months from the possession date of the vehicle. While an optional coverage, it is highly recommended as, without it, a total loss settlement based on actual cash value could leave you contractually owing money to a lienholder or lessor. Chat to your broker for more details about this coverage.' }) })] }), jsx("td", { children: jsx(SelectFormBox, { options: limitedWaiverOfDepreciationOptions, name: "liaiblity-for-damage", onChange: handleLimitedWaiverOfDepreciationChange, defaultValue: getSelectedOption(limitedWaiverOfDepreciationOptions, limitedwaiverofdepreciation.coverage ? limitedwaiverofdepreciation.limit : 0), title: "", description: "", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false, size: SizeTypes.Small, className: "coverages-select-input" }) }), jsx("td", { children: getCoveragePremium('43') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) })] })), jsxs("tr", { children: [jsxs("td", { children: ["Family Protection (OPCF 44)", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: 'The OPCF44 Family Protection Endorsement responds when you are determined to be not at-fault in a vehicle accident, and your claim / civil suit against the offending vehicle owner is not adequately satisfied as they are unidentified, uninsured, or underinsured. This endorsement bridges their coverages (if any) up to the full limits of the OPCF44 coverage on your policy. While considered an optional coverage, it is highly recommended as a form of self protection, and is extremely low in cost. Chat to your broker for more details about this coverage.' }) })] }), jsx("td", { children: "Included" }), jsx("td", { children: getCoveragePremium('44') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) }), jsxs("tr", { className: "premium-total", children: [jsx("td", { children: "Annual Premium" }), jsx("td", {}), jsx("td", { children: getSumOfPremiums() })] })] }) }), jsx("div", { style: { display: 'flex', flexDirection: 'column' }, children: jsx(BlockSubmit$2, { className: "mychoice recalculate", label: "Recalculate Quote", buttonSize: SizeTypes.Medium, isRecalc: true }) })] }));
382
+ return (jsxs(Fragment, { children: [jsx("div", { className: "offer-coverages-container", children: jsxs("table", { className: "offer-coverages-table", children: [jsxs("tr", { className: "table-header", children: [jsx("td", { children: vehicle_names.join(', ') }), jsx("td", { children: "Selection" }), jsx("td", { children: "Premium" })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) }), jsxs("tr", { children: [jsxs("td", { children: ["Third Party Liability Coverage", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: "Third-party liability coverage is mandatory in Ontario and protects you if you're found at fault for injuring or killing someone or damaging their property while driving. This includes people in other vehicles, pedestrians, cyclists, and even passengers in your own car, as well as property like fences, buildings, street signs, and light poles. If you’re sued, this coverage helps pay for legal defence, settlements, and any court-ordered payments. The minimum required coverage is $200,000, but that amount often isn’t enough—most drivers choose at least $2 million to avoid having to pay out-of-pocket if costs exceed the limit. This is a mandatory coverage in Ontario. Talk to your broker to ensure you have the right amount of protection." }) })] }), jsx("td", { children: jsx(SelectFormBox, { options: liabilityOptions, name: "liability-limit", onChange: handleLiabilityChange, defaultValue: getSelectedOption(liabilityOptions, liability.coverage ? liability.limit : 1000000), title: "", description: "", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false, size: SizeTypes.Small, className: "coverages-select-input" }) }), jsx("td", { children: getTPBIandTPPD() })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) }), jsxs("tr", { children: [jsxs("td", { children: ["Direct Compensation - Property Damange Coverage", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: "Third - Party Liability Direct Compensation responds when you are determined to be not at-fault in an accident with another vehicle, and covers the cost of damage to your vehicle (or actual cash value payout), it's equipment, contents, loss of use, and other associated incidentals such as towing fees and lot fees. This is considered an optional coverage, and it is highly recommended that you do not remove it. If your vehicle is financed or leased, the lienholder/lessor must agree to allow you to remove it. Should you remove it, you must also remove collision or all perils coverage. You will be entirely out-of-pocket in a not-at-fault accident and are legally restricted from claiming reimbursement (suing) the other vehicle owner or their insurer. Chat to your broker for more details about this coverage." }) })] }), jsx("td", { children: "$0 Deductible" }), jsx("td", { children: getCoveragePremium('TPDC') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) }), jsxs("tr", { children: [jsxs("td", { children: ["Accident Benefits Coverage", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: 'Accident Benefits is a mandatory coverage that responds when there is injury or death in an accident, regardless of fault, and for all affected individuals. It provides a core series of benefits with the capacity to increase coverage values, along with a menu of optional additional benefits that can be added on. The core and optional coverages must be thoroughly reviewed and evaluated, and decisions made based on your own personal circumstances and needs. Chat to your broker for more details about this coverage.' }) }), accidentbenefits && accidentbenefits.additionalCoverages.length > 0 && (jsx("div", { style: { marginTop: '4px', fontSize: '0.85em' }, children: accidentBenefitsOptionalOptions
383
+ .filter((o) => accidentbenefits.additionalCoverages.includes(o.value))
384
+ .map((o) => (jsx("div", { children: o.name }, o.value))) }))] }), jsx("td", { children: "Included" }), jsx("td", { children: getCoveragePremium('AB') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) }), jsxs("tr", { children: [jsxs("td", { children: ["Uninsured Automobile Coverage", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: 'Uninsured Motorist Coverage is a mandatory coverage which responds when you are not at-fault in an accident with an uninsured or unidentified (hit-and-run) vehicle, and have incurred bodily injuries, death, or damage to your property, and the offending vehicle owner cannot be found, of if identified, cannot adequately compensate you. Coverage is capped to match the province minimum liability limit of $200,000. Due to the low coverage value, it is highly recommended to ensure inclusion of the OPCF44 Family Protection Coverage endorsement for additional protection. Chat to your broker for more details about this coverage.' }) })] }), jsx("td", { children: "Included" }), jsx("td", { children: getCoveragePremium('UA') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) }), jsxs("tr", { children: [jsxs("td", { children: ["Comprehensive Coverage", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: 'Comprehensive coverage responds to types of damages ( repair or actual cash value payout) incurred by your vehicle when it is not actively being driven. Examples would be fire, theft, vandalism, glass breakage, and weather-related losses. While considered an optional coverage, it is highly recommended. Should your vehicle be financed or leased, the lienholder/lessor will not allow you to leave this coverage out and will impose a satisfactory deductible to meet their requirements.' }) })] }), jsx("td", { children: jsx(SelectFormBox, { options: coverageOptions, name: "comprehensive-coverage", onChange: handleComprehensiveChange, defaultValue: getSelectedOption(coverageOptions, comprehensive.coverage ? comprehensive.deductible : 0), title: "", description: "", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false, size: SizeTypes.Small, className: "coverages-select-input" }) }), jsx("td", { children: getCoveragePremium('CMP') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) }), jsxs("tr", { children: [jsxs("td", { children: ["Collision Coverage", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: 'Collision coverage responds to your vehicle damages (repair or actual cash value payout) in the event you collide with another vehicle or object in the course of its use or operation, and is determined to be at-fault. While considered an optional coverage, it is highly recommended. Should your vehicle be financed or leased, the lienholder/lessor will not allow you to leave this coverage out and will impose a satisfactory deductible to meet their requirements. Chat to your broker for more details about this coverage.' }) })] }), jsx("td", { children: jsx(SelectFormBox, { options: coverageOptions, name: "collision-coverage", onChange: handleCollisionChange, defaultValue: getSelectedOption(coverageOptions, collision.coverage ? collision.deductible : 0), title: "", description: "", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false, size: SizeTypes.Small, className: "coverages-select-input" }) }), jsx("td", { children: getCoveragePremium('COL') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) }), doesCoverageExist('5') && (jsxs(Fragment, { children: [jsxs("tr", { children: [jsx("td", { children: "Permission to Rent or Lease (OPCF 5)" }), jsx("td", { children: "Included" }), jsx("td", { children: getCoveragePremium('5') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) })] })), isNonStandardCoverageActive(20) && (jsx(Fragment, { children: jsxs("tr", { children: [jsxs("td", { children: ["Loss of Use (OPCF 20)", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: 'The OPCF20 Loss of Use / Transportation Replacement endorsement responds when you are determined to be at-fault for an accident, or have a comprehensive claim, and need replacement transportation while your vehicle is out-of-service being repaired, or until it is deemed to be a total loss and a settlement offer is made by your insurer. Most often used to pay for a temporary replacement vehicle rental, it can also be used to compensate for other acceptable forms of travel. Depending on the insurer, the coverage limits available may be a dollar amount or a time amount, and you must have collision and comprehensive, or all perils coverage to include this endorsement. While it is optional, it is highly recommended, and careful consideration must be given to the coverage amounts chosen, as repair delays can quickly exhaust your policy limits, leaving you out-of-pocket for transportation expenses. Chat to your broker for more details about this coverage.' }) })] }), jsx("td", { style: { paddingBottom: '7px' }, children: jsx(SelectFormBox, { options: lossOfUseOptions, name: "loss-of-use", onChange: handleLossOfUseChange, defaultValue: getSelectedOption(lossOfUseOptions, lossofuse.coverage ? lossofuse.limit : 0), title: "", description: "", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false, size: SizeTypes.Small, className: "coverages-select-input" }) }), jsx("td", { rowSpan: doesCoverageExist('PAK6') ? 2 : 1, children: doesCoverageExist('PAK6') ? getCoveragePremium('PAK6') : getCoveragePremium('20') })] }) })), isNonStandardCoverageActive(27) && (jsxs(Fragment, { children: [jsxs("tr", { children: [jsxs("td", { children: ["Liability for Damage for Non-Owned Cars (OPCF 27)", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: 'The OPCF27 Liability for Damage to Non-Owned Automobile(s) endorsement responds when you rent or borrow a vehicle, and want to extend your coverages to that vehicle. Often used for special occasion rentals or vacation vehicle rentals. Full liability and physical damage coverages must be on your insured vehicle for this endorsement to apply, and a deductible is applicable. Careful consideration must be given in choosing a coverage amount that adequately covers the value of the vehicle you are expecting to rent or borrow. While considered optional, it is highly recommended, and often "packaged" with the OPCF20 Loss of Use / Transportation Replacement coverage by many insurers. Chat to your broker for more details about this coverage.' }) })] }), jsx("td", { children: jsx(SelectFormBox, { options: liabilityForDamageOptions, name: "liaiblity-for-damage", onChange: handleLiaiblityForDamageChange, defaultValue: getSelectedOption(liabilityForDamageOptions, liabilityfordamage.coverage ? liabilityfordamage.limit : 0), title: "", description: "", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false, size: SizeTypes.Small, className: "coverages-select-input" }) }), !doesCoverageExist('PAK6') && jsx("td", { children: getCoveragePremium('27') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) })] })), isNonStandardCoverageActive('aCCW') && (jsxs(Fragment, { children: [jsxs("tr", { children: [jsxs("td", { children: ["Accident Waiver or Forgiveness (OPCF 39)", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: "The OPCF39 Accident Waiver/Forgiveness endorsement responds by protecting your existing driving record from being negatively impacted by a single, partial at-fault or fully at-fault accident, and must be on the policy before the accident. The benefit of the coverage continues as long as you stay with the same insurer, as it's not transferable should you move to another insurance company. Subsequent at-fault or partial at-fault accidents will not have the protection and will be adversely rated accordingly. Eligibility, terms, conditions, and formulations used can vary significantly between insurers, so careful review and consideration are essential. While purchasing this endorsement is optional, it is highly recommended as the alternative of being accident-rated for several years will be significantly higher in premiums than the cost of the endorsement. Chat to your broker for more details about this coverage." }) })] }), jsx("td", { children: "Included" }), jsx("td", { children: getCoveragePremium('ACCW') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) })] })), isNonStandardCoverageActive(43) && (jsxs(Fragment, { children: [jsxs("tr", { children: [jsxs("td", { children: ["Limited waiver of depreciation (OPCF ", isLeased ? '43A' : '43', ")", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: 'The OPCF43/43A Removing Depreciation Deduction / Limited Waiver of Depreciation endorsement responds by protecting your original purchase/lease price of a "new" vehicle (as evidenced by a bill of sale or lease agreement) from depreciation should the vehicle be a total loss from an insured peril. Only new vehicles, and in some cases "demo\'s" with limited mileage are eligible, and the endorsement must be added immediately upon the vehicle delivery. Coverage durations available vary between insurers, generally ranging from 24 months to 60 months from the possession date of the vehicle. While an optional coverage, it is highly recommended as, without it, a total loss settlement based on actual cash value could leave you contractually owing money to a lienholder or lessor. Chat to your broker for more details about this coverage.' }) })] }), jsx("td", { children: jsx(SelectFormBox, { options: limitedWaiverOfDepreciationOptions, name: "liaiblity-for-damage", onChange: handleLimitedWaiverOfDepreciationChange, defaultValue: getSelectedOption(limitedWaiverOfDepreciationOptions, limitedwaiverofdepreciation.coverage ? limitedwaiverofdepreciation.limit : 0), title: "", description: "", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false, size: SizeTypes.Small, className: "coverages-select-input" }) }), jsx("td", { children: getCoveragePremium('43') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) })] })), jsxs("tr", { children: [jsxs("td", { children: ["Family Protection (OPCF 44)", jsx("div", { style: { display: 'inline-block', marginLeft: '5px' }, children: jsx(TooltipForm, { id: "my-tooltip", description: 'The OPCF44 Family Protection Endorsement responds when you are determined to be not at-fault in a vehicle accident, and your claim / civil suit against the offending vehicle owner is not adequately satisfied as they are unidentified, uninsured, or underinsured. This endorsement bridges their coverages (if any) up to the full limits of the OPCF44 coverage on your policy. While considered an optional coverage, it is highly recommended as a form of self protection, and is extremely low in cost. Chat to your broker for more details about this coverage.' }) })] }), jsx("td", { children: "Included" }), jsx("td", { children: getCoveragePremium('44') })] }), jsx("tr", { children: jsx("td", { colSpan: 3, children: jsx("div", { className: "divider" }) }) }), jsxs("tr", { className: "premium-total", children: [jsx("td", { children: "Annual Premium" }), jsx("td", {}), jsx("td", { children: getSumOfPremiums() })] })] }) }), jsx("div", { style: { display: 'flex', flexDirection: 'column' }, children: jsx(BlockSubmit$2, { className: "mychoice recalculate", label: "Recalculate Quote", buttonSize: SizeTypes.Medium, isRecalc: true }) })] }));
378
385
  };
379
386
 
380
387
  const OfferSection = ({ offerCompany, brokerCompany, offerPrice, phoneNumber, isBestOffer, isFirstOffer = true, operationHours = {}, redirectUrl, fulfillmentUrl, coverages, nonStandardCoverages, brokerIntegration, }) => {
@@ -733,8 +740,35 @@ const BlockCarInfo = () => {
733
740
  const BlockCarConditionInfo = () => {
734
741
  const { appConfigState: { appType } } = useStoreAppConfig();
735
742
  const { vehicleState, dispatchVehicleState } = useStoreFormCarVehicle();
743
+ const { discountState, dispatchDiscountState } = useStoreFormCarDiscount();
736
744
  const { isAlbertaProvince } = useProvince();
737
745
  const isTheBig = appType === AppTypes.TheBig;
746
+ const { policyStartYear, policyStartMonth, policyStartDay } = discountState;
747
+ const defaultPolicyStartDate = {
748
+ year: policyStartYear,
749
+ month: policyStartMonth,
750
+ day: policyStartDay,
751
+ };
752
+ const handlePolicyStartDateChange = (dateType) => ({ value }) => {
753
+ if (dateType === DateTypes.Day) {
754
+ dispatchDiscountState({
755
+ type: StoreFormCarDiscountActionTypes.FormCarDiscountPolicyStartDaySelect,
756
+ payload: { policyStartDay: value },
757
+ });
758
+ }
759
+ if (dateType === DateTypes.Month) {
760
+ dispatchDiscountState({
761
+ type: StoreFormCarDiscountActionTypes.FormCarDiscountPolicyStartMonthSelect,
762
+ payload: { policyStartMonth: value },
763
+ });
764
+ }
765
+ if (dateType === DateTypes.Year) {
766
+ dispatchDiscountState({
767
+ type: StoreFormCarDiscountActionTypes.FormCarDiscountPolicyStartYearSelect,
768
+ payload: { policyStartYear: value },
769
+ });
770
+ }
771
+ };
738
772
  const { year, condition, leased, winterTires, parkingLocation, primaryUse, distanceDaily, distanceBusiness, distanceYearly, purchaseYear, purchaseMonth, purchaseDay, } = vehicleState.items[vehicleState.activeIndex];
739
773
  // eslint-disable-next-line max-len
740
774
  const primaryUseHintMessage = primaryUse === 'business' ? 'Please choose "Business" only if your vehicle is used primarily for work (sales representatives, realtors, consultants, etc.). If you drive back and forth to work or use your vehicle occasionally for work, please select "Personal".' : '';
@@ -824,7 +858,7 @@ const BlockCarConditionInfo = () => {
824
858
  purchaseMonth || '',
825
859
  purchaseYear || '',
826
860
  ], vehicleState.inValidation), error: vehicleState.inValidation, minDate: year ? `${Number(year) - 1}-01-01` : getFormattedDate('', 'yyyy-MM-dd'), maxDate: getFormattedDate('', 'yyyy-MM-dd') }), !(isAlbertaProvince && isTheBig) && (jsx(SwitchButtonBox, { items: carWinterTiresCheck, onChange: handleWinterTiresChange, name: "winterTires", defaultValue: getSelectedOption(carWinterTiresCheck, winterTires), description: "Snow. Ice. Freezing temperatures. Winter tires protect you from all these winter weather conditions, and more. It also protects your wallet. Investing in winter tires can save you $50 to $100 on your insurance.", title: "Does your car have winter tires?" })), jsx(SelectFormBox, { options: carKeepPlace, name: "parkingLocation", onChange: handleCarParkingLocationChange, defaultValue: getSelectedOption(carKeepPlace, parkingLocation), title: "Where do you keep your car overnight?", placeholder: "Select from the list", description: "For many of us, the answer is \u201Cat home.\u201D If you park your car in various locations throughout the year, then select the most frequently parking spot. Be honest\u2014some insurers will use your overnight parking location to calculate a quote, which could affect your claims in the future.", autoSelectIfValueIsOutOfOptions: false, error: !parkingLocation && vehicleState.inValidation, errorMessage: getErrorMessage(parkingLocation, vehicleState.inValidation) }), jsx(SwitchButtonBox, { items: carUsagePurpose, onChange: handleCarUsageChange, name: "primaryUse", defaultValue: getSelectedOption(carUsagePurpose, primaryUse) || carUsagePurpose[0].value, hintMessage: primaryUseHintMessage, description: "The way you use your vehicle is a primary factor that insurers use in your policy terms and fees, whether it be personal or business.\n \u2022 Personal is driving from work or school to home.\n \u2022 Business considers other uses like sales calls, pick-ups or deliveries, or other business errands.", title: "What do you mainly use your car for?" }), jsx(SelectFormBox, { options: firstDriveDistanceList, name: "distanceDaily", onChange: handleCarDailyDistanceChange, defaultValue: getSelectedOption(firstDriveDistanceList, distanceDaily), title: "How far is your 1-way commute to work or school?", placeholder: "Select", description: "The distance you drive to work or school would be an example of your daily commute. It is one of the most important factors when determining coverage options since it exposes you to traffic each day. The shorter your commute, the less risk you carry of an accident.", autoSelectIfValueIsOutOfOptions: false, error: !distanceDaily && vehicleState.inValidation, errorMessage: getErrorMessage(distanceDaily, vehicleState.inValidation) }), primaryUse === 'business' && (jsx(SelectFormBox, { options: dailyDriveBusinessDistanceList, name: "distanceBusiness", onChange: handleCarBusinessDailyDistanceChange, defaultValue: getSelectedOption(dailyDriveBusinessDistanceList, distanceBusiness), title: "How many kilometers are driven for business use each day?", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false, error: !distanceBusiness && vehicleState.inValidation, errorMessage: getErrorMessage(distanceBusiness, vehicleState.inValidation) })), jsx(SelectFormBox, { options: yearlyDriveDistanceList, name: "distanceYearly", onChange: handleCarYearlyDistanceChange, defaultValue: getSelectedOption(yearlyDriveDistanceList, distanceYearly), title: "How many total kilometers are driven each year?", placeholder: "Select", hintMessage: distanceDaily ? `Based on your daily driven kilometers, we recommend
827
- ${numberWithCommas(getRecommendedRange(distanceDaily, primaryUse === VehiclePrimaryUseTypes.Business ? distanceBusiness : 1))} for your yearly driven kilometers` : '', autoSelectIfValueIsOutOfOptions: false, error: !distanceYearly && vehicleState.inValidation, errorMessage: getErrorMessage(distanceYearly, vehicleState.inValidation) })] }));
861
+ ${numberWithCommas(getRecommendedRange(distanceDaily, primaryUse === VehiclePrimaryUseTypes.Business ? distanceBusiness : 1))} for your yearly driven kilometers` : '', autoSelectIfValueIsOutOfOptions: false, error: !distanceYearly && vehicleState.inValidation, errorMessage: getErrorMessage(distanceYearly, vehicleState.inValidation) }), isTheBig && (jsx(DateSelectFormBox, { name: "policyStart", dateNames: ['policyStartYear', 'policyStartMonth', 'policyStartDay'], onDateChange: handlePolicyStartDateChange, defaultValue: defaultPolicyStartDate, title: "What is the ideal start date for your new insurance policy?", description: "Select your preferred date for the beginning of your new insurance policy. For instance, you may set the start date for the day that your current insurance expires to ensure that you're continuously covered. Alternatively, select today's date for a quote or new policy.", minDate: addDaysToDate('', 1), maxDate: addDaysToDate('', 90), isDay: true }))] }));
828
862
  };
829
863
 
830
864
  const VehicleSectionMain = () => {
@@ -833,6 +867,59 @@ const VehicleSectionMain = () => {
833
867
  return (jsxs("div", { className: `form-section top-section ${mychoiceCls}`, children: [mychoiceCls && jsx("h2", { className: "section-title", children: "Give us the scoop on your four-wheeled friend." }), jsx(BlockCarInfo, {}), jsx(BlockCarConditionInfo, {})] }));
834
868
  };
835
869
 
870
+ const AccidentBenefitsModal = ({ selectedCoverages, onApply, onCancel, }) => {
871
+ const [localSelected, setLocalSelected] = useState([...selectedCoverages]);
872
+ const allValues = accidentBenefitsOptionalOptions.map((o) => o.value);
873
+ const allSelected = allValues.every((v) => localSelected.includes(v));
874
+ const handleToggle = (value) => {
875
+ setLocalSelected((prev) => prev.includes(value) ? prev.filter((v) => v !== value) : [...prev, value]);
876
+ };
877
+ const handleSelectAll = () => {
878
+ if (allSelected) {
879
+ setLocalSelected([]);
880
+ }
881
+ else {
882
+ setLocalSelected([...allValues]);
883
+ }
884
+ };
885
+ return (jsx("div", { className: "ab-modal-overlay", onClick: onCancel, children: jsxs("div", { className: "ab-modal", onClick: (e) => e.stopPropagation(), children: [jsxs("div", { className: "ab-modal-header", children: [jsx("h3", { children: "Accident Benefits" }), jsx("p", { className: "ab-modal-subtitle", children: "Standard Coverage + Self-Selected Optional Enhancements" }), jsx("p", { className: "ab-modal-body-text", children: "Base coverage with flexibility to select additional benefits" })] }), jsxs("div", { className: "ab-modal-content", children: [jsxs("div", { className: "ab-modal-standard-block", children: [jsx("h4", { children: "Standard Benefits" }), jsx("p", { className: "ab-modal-standard-subtitle", children: "Medical, Rehabilitation, and Attendant Care" }), jsx("p", { className: "ab-modal-standard-description", children: "Covers medical expenses, therapy and personal care for injuries from an accident, including doctor visits and physiotherapy." })] }), jsxs("div", { className: "ab-modal-optional-block", children: [jsxs("div", { className: "ab-modal-minimum-notice", children: [jsx("strong", { children: "Minimum Limits Apply" }), jsx("p", { children: "All optional benefits selected below will be quoted at their minimum coverage limits. Please speak with your broker if you wish to discuss higher limits." })] }), jsxs("label", { className: "ab-modal-select-all", children: [jsx("input", { type: "checkbox", checked: allSelected, onChange: handleSelectAll }), jsx("span", { children: "Select All" })] }), jsx("div", { className: "ab-modal-options", children: accidentBenefitsOptionalOptions.map((option) => (jsxs("label", { className: "ab-modal-option", children: [jsx("input", { type: "checkbox", checked: localSelected.includes(option.value), onChange: () => handleToggle(option.value) }), jsxs("div", { className: "ab-modal-option-text", children: [jsx("strong", { children: option.name }), jsx("span", { children: option.description })] })] }, option.value))) })] })] }), jsxs("div", { className: "ab-modal-actions", children: [jsx("button", { type: "button", className: "ab-modal-btn ab-modal-btn-cancel", onClick: onCancel, children: "Cancel" }), jsx("button", { type: "button", className: "ab-modal-btn ab-modal-btn-apply", onClick: () => onApply(localSelected), children: "Apply" })] })] }) }));
886
+ };
887
+
888
+ const VehicleSectionAccidentBenefits = () => {
889
+ const { vehicleState, dispatchVehicleState } = useStoreFormCarVehicle();
890
+ const { accidentbenefits } = vehicleState.items[vehicleState.activeIndex];
891
+ const { appConfigState: { appType }, } = useStoreAppConfig();
892
+ const mychoiceCls = isMyChoiceLike(appType) ? 'mychoice' : '';
893
+ const { isAbReformActive } = useAbReform();
894
+ const [modalOpen, setModalOpen] = useState(false);
895
+ if (!isAbReformActive || appType !== AppTypes.TheBig)
896
+ return null;
897
+ const handleApply = (selected) => {
898
+ dispatchVehicleState({
899
+ type: StoreFormCarVehicleActionTypes.FormCarAccidentBenefitsAdditionalCoveragesSet,
900
+ payload: { additionalCoverages: selected },
901
+ });
902
+ if (selected.includes('med_rehab_cat_1m')) {
903
+ dispatchVehicleState({
904
+ type: StoreFormCarVehicleActionTypes.FormCarAccidentBenefitsBaseCoverageSelect,
905
+ payload: { baseCoverage: 'med_rehab_cat_1m' },
906
+ });
907
+ }
908
+ else {
909
+ dispatchVehicleState({
910
+ type: StoreFormCarVehicleActionTypes.FormCarAccidentBenefitsBaseCoverageSelect,
911
+ payload: { baseCoverage: 'minimum_required' },
912
+ });
913
+ }
914
+ dispatchVehicleState({
915
+ type: StoreFormCarVehicleActionTypes.FormCarAccidentBenefitsAcknowledge,
916
+ });
917
+ setModalOpen(false);
918
+ };
919
+ const hasError = !accidentbenefits.abAcknowledged && vehicleState.inValidation;
920
+ return (jsxs("div", { id: "abAcknowledged", className: `form-section ab-section ${mychoiceCls}`, children: [jsxs("div", { className: "ab-notice-banner", children: [jsx("strong", { children: "Important Notice \u2013 Accident Benefits Changes (Effective July 1, 2026)" }), jsx("p", { children: "As of July 1, 2026, significant changes have been made to the Accident Benefits coverage in Ontario. Many benefits that were previously included are now optional and must be selected based on your individual needs." })] }), jsxs("div", { className: `ab-option-selector${hasError ? ' ab-option-selector--error' : ''}`, role: "button", tabIndex: 0, onClick: () => setModalOpen(true), onKeyDown: (e) => e.key === 'Enter' && setModalOpen(true), children: [jsxs("div", { className: "ab-option-selector-content", children: [jsx("strong", { children: "Standard Mandatory Accident Benefits + Self-Selected Optional Enhancements" }), jsx("p", { children: "Base coverage with flexibility to select additional benefits" }), jsx("p", { className: "ab-option-selector-hint", children: "Selecting this option will open a window displaying all available optional Accident Benefits, which you may individually select based on your needs. Each selected benefit will be quoted at its minimum limit." })] }), jsx("span", { className: "ab-option-selector-arrow", children: "\u203A" })] }), modalOpen && (jsx(AccidentBenefitsModal, { selectedCoverages: accidentbenefits.additionalCoverages, onApply: handleApply, onCancel: () => setModalOpen(false) }))] }));
921
+ };
922
+
836
923
  const VehicleSectionCoverage = () => {
837
924
  const { vehicleState, dispatchVehicleState } = useStoreFormCarVehicle();
838
925
  const { collision, comprehensive } = vehicleState.items[vehicleState.activeIndex];
@@ -937,7 +1024,7 @@ const PageVehicle = () => {
937
1024
  behavior: 'smooth',
938
1025
  });
939
1026
  };
940
- return (jsxs("div", { className: "form-container", children: [jsx(TabVehicle, { createItem: createVehicle }), jsxs("div", { className: "form-section-container", children: [isRender && (jsxs(Fragment, { children: [jsx(VehicleSectionMain, {}), jsx(VehicleSectionCoverage, {})] })), appType === AppTypes.TheBig ? (jsx(NavigationBottomTheBig, { createItem: createVehicle, formSteps: formSteps[InsuranceTypes.Car], itemCount: items.length, validateForm: validateForm, formIsValid: vehicleFormIsValid })) : (jsx(NavigationBottom, { className: "mychoice", createItem: createVehicle, formSteps: formSteps[InsuranceTypes.Car], itemCount: items.length, validateForm: validateForm, formIsValid: vehicleFormIsValid }))] }), localIndex !== defaultLocalIndex && (jsx("img", { className: "logo-for-partner", src: myChoicePartnerLogo, alt: "partner logo" }))] }));
1027
+ return (jsxs("div", { className: "form-container", children: [jsx(TabVehicle, { createItem: createVehicle }), jsxs("div", { className: "form-section-container", children: [isRender && (jsxs(Fragment, { children: [jsx(VehicleSectionMain, {}), jsx(VehicleSectionAccidentBenefits, {}), jsx(VehicleSectionCoverage, {})] })), appType === AppTypes.TheBig ? (jsx(NavigationBottomTheBig, { createItem: createVehicle, formSteps: formSteps[InsuranceTypes.Car], itemCount: items.length, validateForm: validateForm, formIsValid: vehicleFormIsValid })) : (jsx(NavigationBottom, { className: "mychoice", createItem: createVehicle, formSteps: formSteps[InsuranceTypes.Car], itemCount: items.length, validateForm: validateForm, formIsValid: vehicleFormIsValid }))] }), localIndex !== defaultLocalIndex && (jsx("img", { className: "logo-for-partner", src: myChoicePartnerLogo, alt: "partner logo" }))] }));
941
1028
  };
942
1029
 
943
1030
  const TabDriver = ({ createItem, readOnly }) => {
@@ -1225,6 +1312,7 @@ const SectionDriverInsurancePolicy = () => {
1225
1312
  const birthDate = birthYear && birthMonth && birthDay ? `${birthYear}-${birthMonth}-${birthDay}` : '';
1226
1313
  const { appConfigState: { appType }, } = useStoreAppConfig();
1227
1314
  const mychoiceCls = isMyChoiceLike(appType) ? 'mychoice' : '';
1315
+ const isTheBig = appType === AppTypes.TheBig;
1228
1316
  const getPeriodOptions = (year, month) => {
1229
1317
  const options = [{ value: '', name: 'Date Period', disabled: true }];
1230
1318
  if (year && month) {
@@ -1356,7 +1444,7 @@ you had insurance. If this is correct, please continue with the form.`);
1356
1444
  };
1357
1445
  return (jsxs("div", { className: `form-section ${mychoiceCls}`, children: [jsxs("div", { className: "box-container", children: [jsx(DateSelectFormBox, { name: "listedYear", dateNames: ['listedYear', 'listedMonth'], onDateChange: handleListedDateChange, defaultValue: defaultListedDate, disabled: !listed, title: `When was ${firstName || driverNameDefault} first listed as a driver on a Canadian or US insurance policy?`, description: "The selection indicates what year the main driver was first listed on a Canadian or US insurance policy. If you do not remember your age, it is acceptable to provide a best estimate for the purposes of the policy or quote.", errorMessage: listed
1358
1446
  ? getDateErrorMessage(['01', listedMonth, listedYear], driverState.inValidation)
1359
- : '', error: driverState.inValidation, hintMessage: hintMessage, minDate: getMinDate(birthDate, firstLicenceAge) }), jsx(CheckboxForm, { name: "listed", label: "Never listed on an insurance policy", onChange: handleListedChange, defaultValue: !listed })] }), listed && (jsxs("div", { className: "box-container", children: [jsx(SelectFormBox, { name: "insuredDate", onChange: handleInsuredPeriodChange, options: getPeriodOptions(listedYear, listedMonth), defaultValue: insuredDate, disabled: !insured, title: `How long has ${firstName || driverNameDefault} been with their current insurance provider?`, description: "It is common for insurers to provide loyalty rewards or discounts for valued customers. Loyalty is a positive trait in the industry, and most insurance companies will want to provide some incentive for continued customer relationships through tangible policy rewards.", errorMessage: insured ? getErrorMessage(insuredDate, driverState.inValidation) : '', error: !insuredDate && driverState.inValidation }), jsx(CheckboxForm, { name: "insured", label: "Not currently insured", onChange: handleInsuredChange, defaultValue: !insured })] })), jsx(DateSelectFormBox, { name: "policyStart", dateNames: ['policyStartYear', 'policyStartMonth', 'policyStartDay'], onDateChange: handlePolicyStartDateChange, defaultValue: defaultPolicyStartDate, title: "What is the ideal start date for your new insurance policy?", description: "Select your preferred date for the beginning of your new insurance policy.For instance, you may set the start date for the day that your current insurance expires to ensure that you\u2019re continuously covered. Alternatively, select today's date for a quote or new policy.", errorMessage: getDateErrorMessage([policyStartDay || '', policyStartMonth || '', policyStartYear || ''], driverState.inValidation), error: driverState.inValidation, minDate: addDaysToDate('', 1), maxDate: addDaysToDate('', 60), isDay: true })] }));
1447
+ : '', error: driverState.inValidation, hintMessage: hintMessage, minDate: getMinDate(birthDate, firstLicenceAge) }), jsx(CheckboxForm, { name: "listed", label: "Never listed on an insurance policy", onChange: handleListedChange, defaultValue: !listed })] }), listed && (jsxs("div", { className: "box-container", children: [jsx(SelectFormBox, { name: "insuredDate", onChange: handleInsuredPeriodChange, options: getPeriodOptions(listedYear, listedMonth), defaultValue: insuredDate, disabled: !insured, title: `How long has ${firstName || driverNameDefault} been with their current insurance provider?`, description: "It is common for insurers to provide loyalty rewards or discounts for valued customers. Loyalty is a positive trait in the industry, and most insurance companies will want to provide some incentive for continued customer relationships through tangible policy rewards.", errorMessage: insured ? getErrorMessage(insuredDate, driverState.inValidation) : '', error: !insuredDate && driverState.inValidation }), jsx(CheckboxForm, { name: "insured", label: "Not currently insured", onChange: handleInsuredChange, defaultValue: !insured })] })), !isTheBig && (jsx(DateSelectFormBox, { name: "policyStart", dateNames: ['policyStartYear', 'policyStartMonth', 'policyStartDay'], onDateChange: handlePolicyStartDateChange, defaultValue: defaultPolicyStartDate, title: "What is the ideal start date for your new insurance policy?", description: "Select your preferred date for the beginning of your new insurance policy. For instance, you may set the start date for the day that your current insurance expires to ensure that you\u2019re continuously covered. Alternatively, select today's date for a quote or new policy.", errorMessage: getDateErrorMessage([policyStartDay || '', policyStartMonth || '', policyStartYear || ''], driverState.inValidation), error: driverState.inValidation, minDate: addDaysToDate('', 1), maxDate: addDaysToDate('', 60), isDay: true }))] }));
1360
1448
  };
1361
1449
 
1362
1450
  const SectionDriverCancellation = () => {
@@ -1953,8 +2041,24 @@ const SectionQuoteRecalc$1 = () => {
1953
2041
  const { appConfigState: { appType }, } = useStoreAppConfig();
1954
2042
  const isTheBig = appType === AppTypes.TheBig;
1955
2043
  const mychoiceCls = isMyChoiceLike(appType) ? 'mychoice' : '';
2044
+ const [isRecalcSubmitted, setIsRecalcSubmitted] = useState(false);
1956
2045
  const { vehicleState, dispatchVehicleState } = useStoreFormCarVehicle();
1957
- const { comprehensive, collision, liability } = vehicleState.items[vehicleState.activeIndex];
2046
+ const { quoteState } = useStoreFormCarQuote();
2047
+ const { comprehensive, collision, liability, accidentbenefits } = vehicleState.items[vehicleState.activeIndex];
2048
+ const { isAbReformActive } = useAbReform();
2049
+ const recalcInitiatedRef = useRef(false);
2050
+ const prevRequestDateRef = useRef(quoteState.requestDate);
2051
+ useEffect(() => {
2052
+ if (recalcInitiatedRef.current
2053
+ && quoteState.requestDate
2054
+ && quoteState.requestDate !== prevRequestDateRef.current) {
2055
+ setIsRecalcSubmitted(true);
2056
+ recalcInitiatedRef.current = false;
2057
+ prevRequestDateRef.current = quoteState.requestDate;
2058
+ }
2059
+ }, [quoteState.requestDate]);
2060
+ const hasAbChanges = accidentbenefits.baseCoverage !== 'minimum_required'
2061
+ || accidentbenefits.additionalCoverages.length > 0;
1958
2062
  const handleComprehensiveChange = ({ value }) => {
1959
2063
  dispatchVehicleState({
1960
2064
  type: StoreFormCarVehicleActionTypes.FormCarComprehensiveCoverageSelect,
@@ -1973,7 +2077,34 @@ const SectionQuoteRecalc$1 = () => {
1973
2077
  payload: { coverage: true, limit: value },
1974
2078
  });
1975
2079
  };
1976
- return (jsxs("div", { className: "form-container", children: [jsx(TabVehicle, { readOnly: true }), jsxs("div", { className: `form-section edit-recalc-container ${mychoiceCls}`, children: [jsx(SelectFormBox, { options: coverageOptions, name: "comprehensive-coverage", onChange: handleComprehensiveChange, defaultValue: getSelectedOption(coverageOptions, comprehensive.coverage ? comprehensive.deductible : 0), title: "Comprehensive coverage", description: "This deductible is the amount of money that you will pay out of your own pocket if your vehicle is damaged in events not covered by collision coverage. This includes events such as falling or flying objects, vandalism, and theft. Your insurance company covers the cost of repair minus the deductible chosen.", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false }), jsx(SelectFormBox, { options: coverageOptions, name: "collision-coverage", onChange: handleCollisionChange, defaultValue: getSelectedOption(coverageOptions, collision.coverage ? collision.deductible : 0), title: "Collision coverage", description: "This deductible is the specific dollar amount you will pay out of your own pocket if your vehicle is damaged in an accident. Your insurance company covers the remaining amount.", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false }), jsx(SelectFormBox, { options: liabilityOptions, name: "liability-limit", onChange: handleLiabilityChange, defaultValue: getSelectedOption(liabilityOptions, liability.coverage ? liability.limit : 1000000), title: "Third Party Liability", description: "This protects you from lawsuits resulting from accidents causing bodily injury or death to others or property damage.", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false }), jsx(BlockSubmit$2, { className: `${isTheBig ? 'thebig-bold' : 'mychoice'} recalculate`, label: "Recalculate Quote", buttonSize: SizeTypes.Medium, isRecalc: true }), isTheBig ? jsx(BlockEndorsements, {}) : jsx(BlockMCEndorsements, {})] })] }));
2080
+ const [modalOpen, setModalOpen] = useState(false);
2081
+ const handleModalApply = (selected) => {
2082
+ dispatchVehicleState({
2083
+ type: StoreFormCarVehicleActionTypes.FormCarAccidentBenefitsAdditionalCoveragesSet,
2084
+ payload: { additionalCoverages: selected },
2085
+ });
2086
+ if (selected.includes('med_rehab_cat_1m')) {
2087
+ dispatchVehicleState({
2088
+ type: StoreFormCarVehicleActionTypes.FormCarAccidentBenefitsBaseCoverageSelect,
2089
+ payload: { baseCoverage: 'med_rehab_cat_1m' },
2090
+ });
2091
+ }
2092
+ else {
2093
+ dispatchVehicleState({
2094
+ type: StoreFormCarVehicleActionTypes.FormCarAccidentBenefitsBaseCoverageSelect,
2095
+ payload: { baseCoverage: 'minimum_required' },
2096
+ });
2097
+ }
2098
+ setModalOpen(false);
2099
+ };
2100
+ return (jsxs("div", { className: "form-container", children: [jsx(TabVehicle, { readOnly: true }), jsxs("div", { className: `form-section edit-recalc-container ${mychoiceCls}`, children: [jsx(SelectFormBox, { options: coverageOptions, name: "comprehensive-coverage", onChange: handleComprehensiveChange, defaultValue: getSelectedOption(coverageOptions, comprehensive.coverage ? comprehensive.deductible : 0), title: "Comprehensive coverage", description: "This deductible is the amount of money that you will pay out of your own pocket if your vehicle is damaged in events not covered by collision coverage. This includes events such as falling or flying objects, vandalism, and theft. Your insurance company covers the cost of repair minus the deductible chosen.", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false }), jsx(SelectFormBox, { options: coverageOptions, name: "collision-coverage", onChange: handleCollisionChange, defaultValue: getSelectedOption(coverageOptions, collision.coverage ? collision.deductible : 0), title: "Collision coverage", description: "This deductible is the specific dollar amount you will pay out of your own pocket if your vehicle is damaged in an accident. Your insurance company covers the remaining amount.", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false }), jsx(SelectFormBox, { options: liabilityOptions, name: "liability-limit", onChange: handleLiabilityChange, defaultValue: getSelectedOption(liabilityOptions, liability.coverage ? liability.limit : 1000000), title: "Third Party Liability", description: "This protects you from lawsuits resulting from accidents causing bodily injury or death to others or property damage.", placeholder: "Select from the list", autoSelectIfValueIsOutOfOptions: false }), isAbReformActive && isTheBig && (jsxs("div", { className: "accident-benefits-container", children: [jsxs("div", { className: "ab-notice-banner", children: [jsx("strong", { children: "Important Notice \u2013 Accident Benefits Changes (Effective July 1, 2026)" }), jsx("p", { children: "As of July 1, 2026, significant changes have been made to the Accident Benefits coverage in Ontario. Many benefits that were previously included are now optional and must be selected based on your individual needs." })] }), jsxs("div", { className: "ab-option-selector", onClick: () => setModalOpen(true), children: [jsxs("div", { className: "ab-option-selector-content", children: [jsx("strong", { children: "Standard Mandatory Accident Benefits + Self-Selected Optional Enhancements" }), jsx("p", { children: "Base coverage with flexibility to select additional benefits" })] }), jsx("span", { className: "ab-option-selector-arrow", children: "\u203A" })] }), modalOpen && (jsx(AccidentBenefitsModal, { selectedCoverages: accidentbenefits.additionalCoverages, onApply: handleModalApply, onCancel: () => setModalOpen(false) }))] })), jsx(BlockSubmit$2, { className: `${isTheBig ? 'thebig-bold' : 'mychoice'} recalculate`, label: "Recalculate Quote", buttonSize: SizeTypes.Medium, isRecalc: true, onSubmitClick: () => {
2101
+ recalcInitiatedRef.current = true;
2102
+ setIsRecalcSubmitted(false);
2103
+ } }), isAbReformActive && isTheBig && isRecalcSubmitted && (jsx("p", { className: "accident-benefits-recalc-message", children: quoteState.items?.length
2104
+ ? hasAbChanges
2105
+ ? 'Your premium has been recalculated. Your broker has been notified and will contact you to discuss your Accident Benefits selections.'
2106
+ : 'Your premium has been recalculated.'
2107
+ : 'We could not calculate a premium for the selected Accident Benefits options. Please speak to your broker to review the implications of these changes.' })), isTheBig ? jsx(BlockEndorsements, {}) : jsx(BlockMCEndorsements, {})] })] }));
1977
2108
  };
1978
2109
 
1979
2110
  const lockEmoji$1 = '\u{1F512}';
@@ -2052,12 +2183,36 @@ const PageCarQuote = () => {
2052
2183
  const { appLoaderState } = useStoreAppLoader();
2053
2184
  const { appDeviceType } = useStoreDeviceType();
2054
2185
  const { appConfigState: { localIndex, insuranceType }, } = useStoreAppConfig();
2186
+ const { isAbReformActive } = useAbReform();
2055
2187
  const { items, quoteConfirm } = quoteState;
2056
2188
  const isTheBig = appType === AppTypes.TheBig;
2057
2189
  const hasConfirmStep = !!(items?.length && !isTheBig && items[0]?.confirmQuote && quoteConfirm);
2058
2190
  const quoteItems = hasConfirmStep ? items?.slice(0, 2) : items;
2059
2191
  const showContentWhileLoading = hasConfirmStep ? true : !appLoaderState.isOpen;
2060
2192
  const navigate = useNavigate();
2193
+ const [recalcFailed, setRecalcFailed] = useState(false);
2194
+ const prevRequestDateRef = useRef(undefined);
2195
+ const lastSuccessfulItemsRef = useRef(undefined);
2196
+ if (items?.length) {
2197
+ lastSuccessfulItemsRef.current = items;
2198
+ }
2199
+ const displayBestItem = recalcFailed ? lastSuccessfulItemsRef.current?.[0] : items?.[0];
2200
+ const lastSuccessfulItems = lastSuccessfulItemsRef.current;
2201
+ const displayItems = recalcFailed
2202
+ ? (hasConfirmStep ? lastSuccessfulItems?.slice(0, 2) : lastSuccessfulItems)
2203
+ : quoteItems;
2204
+ useEffect(() => {
2205
+ if (!quoteState.requestDate)
2206
+ return;
2207
+ if (prevRequestDateRef.current === undefined) {
2208
+ prevRequestDateRef.current = quoteState.requestDate;
2209
+ return;
2210
+ }
2211
+ if (quoteState.requestDate !== prevRequestDateRef.current) {
2212
+ setRecalcFailed(!quoteState.items?.length);
2213
+ prevRequestDateRef.current = quoteState.requestDate;
2214
+ }
2215
+ }, [quoteState.requestDate]);
2061
2216
  useEffectOnce(() => {
2062
2217
  if (!vehicleFormIsValid) {
2063
2218
  vehicleFormValidate();
@@ -2079,14 +2234,14 @@ const PageCarQuote = () => {
2079
2234
  navigate(`/${localIndex || defaultLocalIndex}/${insuranceType}/offer`);
2080
2235
  }
2081
2236
  });
2082
- return (jsx("div", { className: `quote-page-content ${hasConfirmStep ? 'confirm-step' : ''}`, children: showContentWhileLoading && (jsxs(Fragment, { children: [hasConfirmStep && jsx(BlockConfirmHeading, {}), jsxs("div", { className: "form-section-container", children: [appDeviceType === DeviceTypes.Mobile && !hasConfirmStep && (jsx(Fragment, { children: !!items?.length ? (jsx(Fragment, { children: !quoteState.showCallMessage ? (jsx("div", { className: "offer-container", children: jsx(OfferSection, { isBestOffer: true, offerCompany: items[0]?.company, brokerCompany: items[0]?.brokerProfile, offerPrice: {
2083
- monthly: items[0]?.priceMonthly,
2084
- yearly: items[0]?.priceYearly,
2237
+ return (jsx("div", { className: `quote-page-content ${hasConfirmStep ? 'confirm-step' : ''}`, children: showContentWhileLoading && (jsxs(Fragment, { children: [hasConfirmStep && jsx(BlockConfirmHeading, {}), jsxs("div", { className: "form-section-container", children: [appDeviceType === DeviceTypes.Mobile && !hasConfirmStep && (jsx(Fragment, { children: !!(items?.length || recalcFailed) ? (jsx(Fragment, { children: !quoteState.showCallMessage ? (jsx("div", { className: `offer-container${recalcFailed ? ' greyed-out' : ''}`, children: jsx(OfferSection, { isBestOffer: true, offerCompany: displayBestItem?.company, brokerCompany: displayBestItem?.brokerProfile, offerPrice: {
2238
+ monthly: displayBestItem?.priceMonthly,
2239
+ yearly: displayBestItem?.priceYearly,
2085
2240
  }, operationHours: {
2086
- saturdayHours: items[0]?.brokerProfile.hoursSaturday,
2087
- sundayHours: items[0]?.brokerProfile.hoursSunday,
2088
- weekdayHours: items[0]?.brokerProfile.hoursWorkdays,
2089
- }, phoneNumber: formatPhoneObject(items[0]?.brokerProfile.phone), redirectUrl: items[0]?.brokerProfile.redirectUrl || '', coverages: items[0]?.coverages, nonStandardCoverages: items[0]?.nonStandardCoverages, brokerIntegration: items[0]?.brokerIntegration }) })) : (jsx(SplashScreen$2, {})) })) : (jsx(NoQuotesMessage, { type: "car" })) })), (!hasConfirmStep || appDeviceType !== DeviceTypes.Mobile) && (jsxs(Fragment, { children: [jsx(SectionQuoteEdit$2, {}), (isTheBig || !items[0]?.coverages) && jsx(SectionQuoteRecalc$1, {})] }))] }), appDeviceType !== DeviceTypes.Mobile && quoteState.showCallMessage && jsx(SplashScreen$2, {}), !quoteState.showCallMessage && (jsx(Fragment, { children: jsxs("div", { style: { position: 'relative', width: '100%' }, children: [hasConfirmStep && (jsxs(Fragment, { children: [jsx("div", { className: "offer-container", children: jsx(SectionConfirm, {}) }), appDeviceType === DeviceTypes.Mobile && (jsxs(Fragment, { children: [jsx(SectionQuoteEdit$2, {}), (isTheBig || !items[0]?.coverages) && jsx(SectionQuoteRecalc$1, {})] }))] })), jsx("div", { className: `offer-container ${hasConfirmStep ? 'blur' : ''}`, children: !!items?.length ? (quoteItems.map(({ company, brokerProfile, priceMonthly, priceYearly, coverages, nonStandardCoverages, brokerIntegration, }, index) => (jsx("div", { children: (appDeviceType !== DeviceTypes.Mobile ||
2241
+ saturdayHours: displayBestItem?.brokerProfile.hoursSaturday,
2242
+ sundayHours: displayBestItem?.brokerProfile.hoursSunday,
2243
+ weekdayHours: displayBestItem?.brokerProfile.hoursWorkdays,
2244
+ }, phoneNumber: formatPhoneObject(displayBestItem?.brokerProfile.phone ?? ''), redirectUrl: displayBestItem?.brokerProfile.redirectUrl || '', coverages: displayBestItem?.coverages, nonStandardCoverages: displayBestItem?.nonStandardCoverages, brokerIntegration: displayBestItem?.brokerIntegration }) })) : (jsx(SplashScreen$2, {})) })) : (jsx(NoQuotesMessage, { type: "car" })) })), (!hasConfirmStep || appDeviceType !== DeviceTypes.Mobile) && (jsxs(Fragment, { children: [jsx(SectionQuoteEdit$2, {}), (isTheBig || !items[0]?.coverages) && jsx(SectionQuoteRecalc$1, {})] }))] }), appDeviceType !== DeviceTypes.Mobile && quoteState.showCallMessage && jsx(SplashScreen$2, {}), !quoteState.showCallMessage && (jsx(Fragment, { children: jsxs("div", { style: { position: 'relative', width: '100%' }, children: [isAbReformActive && isTheBig && (jsxs("div", { className: "ab-disclaimer", children: [jsx("strong", { children: "Important Disclaimer" }), jsxs("p", { children: ["Due to the changes to the Statutory Accident Benefit Coverage, effective July 1, 2026", ' ', jsx("a", { href: "https://www.fsrao.ca/industry/auto-insurance/changes-statutory-accident-benefits-coverage-ontario-july-1-2026#:~:text=July%201%2C%202026-,Changes%20in%20Statutory%20Accident%20Benefits%20coverage%20in%20Ontario%20on%20July,fits%20their%20needs%20and%20budgets.", target: "_blank", rel: "noreferrer noopener", children: "(Government of Ontario website)" }), ", please consider the individual circumstances for all drivers quoted before making your selections. Speak with your insurance broker if you have questions or need help understanding your options. Your Accident Benefits coverage selections will impact both your quoted premium and the coverage available to drivers on the quote."] })] })), hasConfirmStep && (jsxs(Fragment, { children: [jsx("div", { className: "offer-container", children: jsx(SectionConfirm, {}) }), appDeviceType === DeviceTypes.Mobile && (jsxs(Fragment, { children: [jsx(SectionQuoteEdit$2, {}), (isTheBig || !items[0]?.coverages) && jsx(SectionQuoteRecalc$1, {})] }))] })), jsx("div", { className: `offer-container ${hasConfirmStep ? 'blur' : ''} ${recalcFailed ? 'greyed-out' : ''}`, children: !!(items?.length || recalcFailed) ? ((displayItems ?? []).map(({ company, brokerProfile, priceMonthly, priceYearly, coverages, nonStandardCoverages, brokerIntegration, }, index) => (jsx("div", { children: (appDeviceType !== DeviceTypes.Mobile ||
2090
2245
  (appDeviceType === DeviceTypes.Mobile && index !== 0)) && (jsx(OfferSection, { isBestOffer: index === 0, isFirstOffer: index === 0, offerCompany: company, brokerCompany: brokerProfile, offerPrice: {
2091
2246
  monthly: priceMonthly,
2092
2247
  yearly: priceYearly,