@mychoice/mychoice-sdk-modules 2.1.17 → 2.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/cjs/index.js +7 -9
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/init/StoryAppWrapper/StoryAppWrapper.d.ts +1 -1
  4. package/dist/cjs/init/StoryAppWrapper/interfaces.d.ts +1 -1
  5. package/dist/cjs/insurances/car/pages/{three-point-five/BestOfferFirst.d.ts → quote/PageAllQuotes.d.ts} +1 -1
  6. package/dist/cjs/insurances/car/pages/quote/sections/blocks/BlockConfirmImages.d.ts +1 -0
  7. package/dist/cjs/insurances/car/pages/quote/sections/blocks/BlockQuoteStatistics.d.ts +2 -0
  8. package/dist/cjs/shared/sections/quotes/OfferSection/BestOfferSection.d.ts +3 -0
  9. package/dist/cjs/shared/sections/quotes/OfferSection/DummyOfferSection.d.ts +3 -0
  10. package/dist/esm/index.js +7 -9
  11. package/dist/esm/index.js.map +1 -1
  12. package/dist/esm/init/StoryAppWrapper/StoryAppWrapper.d.ts +1 -1
  13. package/dist/esm/init/StoryAppWrapper/interfaces.d.ts +1 -1
  14. package/dist/esm/insurances/car/pages/{three-point-five/BestOfferFirst.d.ts → quote/PageAllQuotes.d.ts} +1 -1
  15. package/dist/esm/insurances/car/pages/quote/sections/blocks/BlockConfirmImages.d.ts +1 -0
  16. package/dist/esm/insurances/car/pages/quote/sections/blocks/BlockQuoteStatistics.d.ts +2 -0
  17. package/dist/esm/shared/sections/quotes/OfferSection/BestOfferSection.d.ts +3 -0
  18. package/dist/esm/shared/sections/quotes/OfferSection/DummyOfferSection.d.ts +3 -0
  19. package/package.json +3 -3
  20. package/dist/cjs/insurances/car/pages/three-point-five/index.d.ts +0 -1
  21. package/dist/cjs/insurances/car/pages/three-point-five/sections/OfferSectionCopy.d.ts +0 -3
  22. package/dist/cjs/insurances/car/pages/three-point-five/sections/OfferSectionDupe.d.ts +0 -3
  23. package/dist/cjs/insurances/car/pages/three-point-five/sections/index.d.ts +0 -1
  24. package/dist/esm/insurances/car/pages/three-point-five/index.d.ts +0 -1
  25. package/dist/esm/insurances/car/pages/three-point-five/sections/OfferSectionCopy.d.ts +0 -3
  26. package/dist/esm/insurances/car/pages/three-point-five/sections/OfferSectionDupe.d.ts +0 -3
  27. package/dist/esm/insurances/car/pages/three-point-five/sections/index.d.ts +0 -1
package/dist/cjs/index.js CHANGED
@@ -155,7 +155,7 @@ const OfferSection = ({ offerCompany, brokerCompany, offerPrice, phoneNumber, is
155
155
  const isTheBig = appType === mychoiceSdkComponents.AppTypes.TheBig;
156
156
  const mychoiceCls = appType === mychoiceSdkComponents.AppTypes.MyChoice ? 'mychoice' : '';
157
157
  const { weekdayHours, saturdayHours, sundayHours } = operationHours;
158
- const [detailsIsOpen, setDetailsIsOpenIsOpen] = React.useState(false);
158
+ const [detailsIsOpen, setDetailsIsOpenIsOpen] = React.useState(isBestOffer ?? false);
159
159
  const handleDropdownClick = () => {
160
160
  setDetailsIsOpenIsOpen(!detailsIsOpen);
161
161
  };
@@ -255,9 +255,7 @@ jsxRuntime.jsx("video", { src: "https://mychoice.ca/wp-content/uploads/2023/05/P
255
255
  const LoaderPrimary = () => {
256
256
  const { appLoaderState } = mychoiceSdkStore.useStoreAppLoader();
257
257
  const { appConfigState } = mychoiceSdkStore.useStoreAppConfig();
258
- console.log(window.location.pathname);
259
258
  const isLastPage = window.location.pathname.includes('discount') || window.location.pathname.includes('applicant');
260
- console.log(isLastPage);
261
259
  return (jsxRuntime.jsxs("div", { className: "loader-wrapper", children: [appConfigState.appType === mychoiceSdkComponents.AppTypes.TheBig || !isLastPage ? jsxRuntime.jsx(mychoiceSdkComponents.IconLoaderPrimary, {}) : jsxRuntime.jsx(LoaderVid, {}), !!appLoaderState.description && (jsxRuntime.jsx("h4", { children: appLoaderState.description.split('\n').map((line, index) => (jsxRuntime.jsxs("div", { children: [line, jsxRuntime.jsx("br", {})] }, index))) }))] }));
262
260
  };
263
261
 
@@ -314,11 +312,10 @@ const ModalPostal = () => {
314
312
  };
315
313
 
316
314
  const getVehicleYearRange = () => {
317
- const currentDate = new Date();
318
315
  const vehicleYear = [];
319
- const currentYear = currentDate.getFullYear();
316
+ const currentYear = 2024;
320
317
  const minYear = currentYear - 25;
321
- for (let year = (currentDate.getFullYear()); year > minYear; year -= 1) {
318
+ for (let year = (currentYear); year > minYear; year -= 1) {
322
319
  vehicleYear.push({ name: `${year}`, value: `${year}` });
323
320
  }
324
321
  vehicleYear.push({ name: `${minYear} or older`, value: `${minYear}` });
@@ -1847,7 +1844,7 @@ const PageCarQuote = () => {
1847
1844
  const { appDeviceType } = mychoiceSdkStore.useStoreDeviceType();
1848
1845
  const { items, quoteConfirm } = quoteState;
1849
1846
  const isTheBig = appType === mychoiceSdkComponents.AppTypes.TheBig;
1850
- const hasConfirmStep = items?.length && !isTheBig && items[0]?.confirmQuote && quoteConfirm;
1847
+ const hasConfirmStep = !!(items?.length && !isTheBig && items[0]?.confirmQuote && quoteConfirm);
1851
1848
  const quoteItems = hasConfirmStep ? items?.slice(0, 2) : items;
1852
1849
  const showContentWhileLoading = hasConfirmStep ? true : !appLoaderState.isOpen;
1853
1850
  mychoiceSdkComponents.useEffectOnce(() => {
@@ -4018,6 +4015,7 @@ const RedirectWithSearchParams = ({ to, path }) => {
4018
4015
  const { dispatchDiscountState: dispatchHomeDiscountState } = mychoiceSdkStore.useStoreFormHomeDiscount();
4019
4016
  const { dispatchApplicantState: dispatchLifeApplicantState } = mychoiceSdkStore.useStoreFormLifeApplicant();
4020
4017
  const queryRoot = reactRouterDom.useLocation().search.split('?');
4018
+ const toBasePath = to?.split('/')?.slice(-1)?.[0];
4021
4019
  mychoiceSdkComponents.useEffectOnce(() => {
4022
4020
  if (queryRoot.length > 1) {
4023
4021
  const query = JSON.parse(`{"${decodeURI(queryRoot[1]).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"')}"}`);
@@ -4044,7 +4042,7 @@ const RedirectWithSearchParams = ({ to, path }) => {
4044
4042
  payload: { utmCampaign: query.utm_campaign },
4045
4043
  });
4046
4044
  }
4047
- if (path === 'broker') {
4045
+ if (path === 'broker' || toBasePath === 'car') {
4048
4046
  dispatchCarDiscountState({
4049
4047
  type: mychoiceSdkStore.StoreFormCarDiscountActionTypes.FormCarDiscountQuoterBrokerInfoSet,
4050
4048
  payload: query,
@@ -4064,7 +4062,7 @@ const RedirectWithSearchParams = ({ to, path }) => {
4064
4062
  payload: { utmCampaign: query.utm_campaign },
4065
4063
  });
4066
4064
  }
4067
- if (path === 'broker') {
4065
+ if (path === 'broker' || ['home', 'condo', 'tenant'].includes(toBasePath)) {
4068
4066
  dispatchHomeDiscountState({
4069
4067
  type: mychoiceSdkStore.StoreFormHomeDiscountActionTypes.FormHomeQuoterBrokerInfoSet,
4070
4068
  payload: query,