@mychoice/mychoice-sdk-modules 2.1.28 → 2.1.30
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 +15 -24
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +15 -24
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -2951,7 +2951,6 @@ const SectionCoverage = () => {
|
|
|
2951
2951
|
payload: { coverage: value },
|
|
2952
2952
|
});
|
|
2953
2953
|
};
|
|
2954
|
-
console.log(mychoiceSdkComponents.lifeInsuranceTypeOptions, "opts");
|
|
2955
2954
|
const newLifeOptions = mychoiceSdkComponents.lifeInsuranceTypeOptions.filter(option => option.name.includes("Year Level") && option.name !== "40 Year Level Term");
|
|
2956
2955
|
return (jsxRuntime.jsxs("div", { className: "form-section", children: [jsxRuntime.jsx("h2", { className: "section-title", style: { textAlign: 'center' }, children: "Let us meet your needs." }), jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.lifeProvinceOptions, name: "province", onChange: handleProvinceChange, defaultValue: province, title: "Province", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false, error: !province && inValidation, errorMessage: getErrorMessage(type, inValidation) }), jsxRuntime.jsx(SelectFormBox, { options: newLifeOptions, name: "type", onChange: handleLifeInsuranceTypeChange, defaultValue: type, title: "Type of Insurance", description: jsxRuntime.jsx(Description, {}), placeholder: "Select", autoSelectIfValueIsOutOfOptions: false, error: !type && inValidation, errorMessage: getErrorMessage(type, inValidation) }), jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.lifeCoverageOptions, name: "coverage", onChange: handleCoverageChange, defaultValue: coverage, title: "Required coverage", description: "The extent of coverage you need is determined by several factors,\n including your expenditure patterns, anticipated future expenses, yearly earnings,\n and so forth. Generally, individuals opt for a coverage amount that equals five\n times their current annual income before taxes. On an average,\n it is observed that Canadians choose a coverage amount of around $500,000.", placeholder: "Select", autoSelectIfValueIsOutOfOptions: false, error: !coverage && inValidation, errorMessage: getErrorMessage(coverage, inValidation) })] }));
|
|
2957
2956
|
};
|
|
@@ -3135,36 +3134,28 @@ const PageLifeQuote = () => {
|
|
|
3135
3134
|
});
|
|
3136
3135
|
});
|
|
3137
3136
|
const uniqueItems = items.reduce((acc, currentItem) => {
|
|
3138
|
-
// Check if the company is already added.
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
// If exists, keep the one with the lower priceMonthly.
|
|
3142
|
-
if (currentItem.priceMonthly < existingItem.priceMonthly) {
|
|
3143
|
-
// Replace the existing item with the current item.
|
|
3144
|
-
const index = acc.indexOf(existingItem);
|
|
3145
|
-
acc[index] = currentItem;
|
|
3146
|
-
}
|
|
3147
|
-
}
|
|
3148
|
-
else {
|
|
3149
|
-
// If !exists, add the current item.
|
|
3150
|
-
acc.push(currentItem);
|
|
3137
|
+
// Check if the company is already added and if so, whether the current item has a lower priceMonthly.
|
|
3138
|
+
if (!acc[currentItem.company] || currentItem.priceMonthly < acc[currentItem.company].priceMonthly) {
|
|
3139
|
+
acc[currentItem.company] = currentItem; // Add or update the item for the company
|
|
3151
3140
|
}
|
|
3152
3141
|
return acc;
|
|
3153
|
-
},
|
|
3142
|
+
}, {});
|
|
3143
|
+
const result = Object.values(uniqueItems);
|
|
3144
|
+
console.log(result, "ach");
|
|
3154
3145
|
return (jsxRuntime.jsx("div", { className: "quote-page-content", children: !appLoaderState.isOpen
|
|
3155
|
-
&& (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "form-section-container", children: [appDeviceType === mychoiceSdkComponents.DeviceTypes.Mobile && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !!
|
|
3156
|
-
? (jsxRuntime.jsx("div", { className: "offer-container", children: jsxRuntime.jsx(OfferSection, { isBestOffer: true, offerCompany:
|
|
3157
|
-
monthly:
|
|
3158
|
-
yearly:
|
|
3146
|
+
&& (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "form-section-container", children: [appDeviceType === mychoiceSdkComponents.DeviceTypes.Mobile && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !!result?.length && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !quoteState.showCallMessage
|
|
3147
|
+
? (jsxRuntime.jsx("div", { className: "offer-container", children: jsxRuntime.jsx(OfferSection, { isBestOffer: true, offerCompany: result[0]?.company, brokerCompany: result[0]?.brokerProfile, offerPrice: {
|
|
3148
|
+
monthly: result[0]?.priceMonthly,
|
|
3149
|
+
yearly: result[0]?.priceYearly,
|
|
3159
3150
|
}, operationHours: {
|
|
3160
|
-
saturdayHours:
|
|
3161
|
-
sundayHours:
|
|
3162
|
-
weekdayHours:
|
|
3151
|
+
saturdayHours: result[0]?.brokerProfile.hoursSaturday,
|
|
3152
|
+
sundayHours: result[0]?.brokerProfile.hoursSunday,
|
|
3153
|
+
weekdayHours: result[0]?.brokerProfile.hoursWorkdays,
|
|
3163
3154
|
}, phoneNumber: formatPhoneObject(items[0]?.brokerProfile.phone), redirectUrl: items[0]?.brokerProfile.redirectUrl || '' }) }))
|
|
3164
3155
|
: jsxRuntime.jsx(SplashScreen, {}) })) })), jsxRuntime.jsx(SectionQuoteEdit, {})] }), appDeviceType !== mychoiceSdkComponents.DeviceTypes.Mobile && quoteState.showCallMessage
|
|
3165
3156
|
&& jsxRuntime.jsx(SplashScreen, {}), !quoteState.showCallMessage
|
|
3166
|
-
&& (jsxRuntime.jsx("div", { className: "offer-container", children: !!
|
|
3167
|
-
&&
|
|
3157
|
+
&& (jsxRuntime.jsx("div", { className: "offer-container", children: !!result?.length
|
|
3158
|
+
&& result.map(({ company, brokerProfile, priceMonthly, priceYearly, }, index) => (jsxRuntime.jsx("div", { children: (appDeviceType !== mychoiceSdkComponents.DeviceTypes.Mobile || (appDeviceType === mychoiceSdkComponents.DeviceTypes.Mobile && index !== 0)) && (jsxRuntime.jsx(OfferSection, { isBestOffer: index === 0, offerCompany: company, brokerCompany: brokerProfile, offerPrice: {
|
|
3168
3159
|
monthly: priceMonthly,
|
|
3169
3160
|
yearly: priceYearly,
|
|
3170
3161
|
}, operationHours: {
|