@sunrise-upc/mobile-prod-card 12.0.2 → 12.0.3

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.
@@ -1 +1 @@
1
- .card_TBosU.sr-card_Eo691{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}.card_TBosU.border-top_18q7h{border-top-left-radius:16px;border-top-right-radius:16px;box-shadow:0 -2px 20px 0 rgba(61,57,53,.2);border:none}@media (min-width:768px){.sr-desk-card_fmqWp{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}@media (max-width:767px){.sr-mob-card_cE7mi{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}@media (min-width:1024px){.sr-md-card_nwsBG{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}.container_c8st7{order:-1}.stickyStyleUp_39Ybs,.stickyStyle_JW7TL{position:fixed;z-index:8;width:100%}.stickyStyle_JW7TL{margin-top:-55px}@media (max-width:1023px){.stickyStyle_JW7TL{margin-top:auto}}.animations_wbW76,.wrapper_x0eeF{min-height:60px;overflow:hidden;display:flex;align-items:center;justify-content:center;gap:16px;padding:0 16px;position:relative}@media (max-width:767px){.animations_wbW76,.wrapper_x0eeF{min-height:76px;padding:8px 56px 8px 6px!important}}.animations_wbW76 .iconStyle_ftxQx,.wrapper_x0eeF .iconStyle_ftxQx{cursor:pointer;width:44px;height:44px;display:flex;align-items:center;justify-content:center;position:absolute;right:10px;top:50%;transform:translateY(-50%)}@media (min-width:768px) and (max-width:1023px){.animations_wbW76 .iconStyle_ftxQx,.wrapper_x0eeF .iconStyle_ftxQx{right:30px}}.animations_wbW76 .textStyle_LyRjq,.wrapper_x0eeF .textStyle_LyRjq{font-size:18px;line-height:24px;font-weight:700;display:inline;color:#3d3935}@media (max-width:767px){.animations_wbW76 .textStyle_LyRjq,.wrapper_x0eeF .textStyle_LyRjq{font-size:14px;line-height:20px}}.animations_wbW76 .descriptionColorWhite_Y5SPq,.wrapper_x0eeF .descriptionColorWhite_Y5SPq{color:#fff}.animations_wbW76 .descriptionColorBlack_9AYnW,.wrapper_x0eeF .descriptionColorBlack_9AYnW{color:#000}.animations_wbW76 .btnStyleBlack_J3qnm,.animations_wbW76 .btnStyleIceWhite_dtMgV,.animations_wbW76 .btnStyle_oc2fd,.animations_wbW76 .btnanimations_-xgbH,.wrapper_x0eeF .btnStyleBlack_J3qnm,.wrapper_x0eeF .btnStyleIceWhite_dtMgV,.wrapper_x0eeF .btnStyle_oc2fd,.wrapper_x0eeF .btnanimations_-xgbH{min-width:fit-content;text-decoration:none;border-radius:25px;background-color:#da291c;color:#fff;font-size:16px;line-height:24px;font-weight:700;border:none;padding:10px 24px}.animations_wbW76 .btnStyleIceWhite_dtMgV,.wrapper_x0eeF .btnStyleIceWhite_dtMgV{background-color:transparent;color:#fff;border:2px solid #fff}.animations_wbW76 .btnStyleBlack_J3qnm,.wrapper_x0eeF .btnStyleBlack_J3qnm{background-color:#fff;color:#3d3935;border:none}@media (max-width:767px){.container_c8st7{order:-1}.stickyStyle_JW7TL{position:fixed;z-index:1;width:100%}}.close_gz0j1{display:none}.animations_wbW76{animation-name:anime_PLkrN;animation-duration:5s;animation-fill-mode:forwards;background-color:#da291c}.btnanimations_-xgbH{animation-name:btnAnime_amQr7;animation-duration:5s;animation-fill-mode:forwards}@keyframes btnAnime_amQr7{0%{background-color:#fff;color:#da291c}to{background-color:#da291c;color:#fff}}@keyframes anime_PLkrN{0%{background-color:#da291c;color:#fff}to{background-color:#f4d4dd;color:#000}}
1
+ .card_TBosU.sr-card_Eo691{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}.card_TBosU.border-top_18q7h{border-top-left-radius:16px;border-top-right-radius:16px;box-shadow:0 -2px 20px 0 rgba(61,57,53,.2);border:none}@media (min-width:768px){.sr-desk-card_fmqWp{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}@media (max-width:767px){.sr-mob-card_cE7mi{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}@media (min-width:1024px){.sr-md-card_nwsBG{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}.container_c8st7{order:-1}.stickyStyleUp_39Ybs,.stickyStyle_JW7TL{position:fixed;z-index:8;width:100%}.stickyStyle_JW7TL{margin-top:-55px}@media (max-width:1023px){.stickyStyle_JW7TL{margin-top:auto}}.animations_wbW76,.wrapper_x0eeF{min-height:60px;overflow:hidden;display:flex;align-items:center;justify-content:center;gap:16px;padding:0 16px;position:relative}@media (max-width:767px){.animations_wbW76,.wrapper_x0eeF{min-height:76px;padding:8px 56px 8px 6px!important}}.animations_wbW76 .iconStyle_ftxQx,.wrapper_x0eeF .iconStyle_ftxQx{cursor:pointer;width:44px;height:44px;display:flex;align-items:center;justify-content:center;position:absolute;right:10px;top:50%;transform:translateY(-50%)}@media (min-width:768px) and (max-width:1023px){.animations_wbW76 .iconStyle_ftxQx,.wrapper_x0eeF .iconStyle_ftxQx{right:30px}}.animations_wbW76 .textStyle_LyRjq,.wrapper_x0eeF .textStyle_LyRjq{font-size:18px;line-height:24px;font-weight:700;display:inline;color:#3d3935}@media (max-width:767px){.animations_wbW76 .textStyle_LyRjq,.wrapper_x0eeF .textStyle_LyRjq{font-size:14px;line-height:20px}}.animations_wbW76 .descriptionColorWhite_Y5SPq,.wrapper_x0eeF .descriptionColorWhite_Y5SPq{color:#fff}.animations_wbW76 .descriptionColorBlack_9AYnW,.wrapper_x0eeF .descriptionColorBlack_9AYnW{color:#000}.animations_wbW76 .btnStyleBlack_J3qnm,.animations_wbW76 .btnStyleIceWhite_dtMgV,.animations_wbW76 .btnStyle_oc2fd,.animations_wbW76 .btnanimations_-xgbH,.wrapper_x0eeF .btnStyleBlack_J3qnm,.wrapper_x0eeF .btnStyleIceWhite_dtMgV,.wrapper_x0eeF .btnStyle_oc2fd,.wrapper_x0eeF .btnanimations_-xgbH{min-width:fit-content;text-decoration:none;border-radius:25px;background-color:#da291c;color:#fff;font-size:16px;line-height:24px;font-weight:700;border:none;padding:10px 24px}.animations_wbW76 .btnStyleIceWhite_dtMgV,.wrapper_x0eeF .btnStyleIceWhite_dtMgV{background-color:transparent;color:#fff;border:2px solid #fff}.animations_wbW76 .btnStyleBlack_J3qnm,.wrapper_x0eeF .btnStyleBlack_J3qnm{background-color:#fff;color:#3d3935;border:none}@media (max-width:767px){.container_c8st7{order:-1}.stickyStyle_JW7TL{position:fixed;z-index:1;width:100%}}.close_gz0j1{display:none}.animations_wbW76{animation-name:anime_PLkrN;background-color:#da291c}.animations_wbW76,.btnanimations_-xgbH{animation-duration:5s;animation-fill-mode:forwards}.btnanimations_-xgbH{animation-name:btnAnime_amQr7}@keyframes btnAnime_amQr7{0%{background-color:#fff;color:#da291c}to{background-color:#da291c;color:#fff}}@keyframes anime_PLkrN{0%{background-color:#da291c;color:#fff}to{background-color:#f4d4dd;color:#000}}
@@ -1,2 +1,2 @@
1
- import o,{useState as i,useEffect as e}from"react";import l from"../sharedCarousel/CarouselComponent.js";import{viewport as n}from"../../utils/utils.js";import{LineTableBasicPropConfig as t}from"../../services/LineTableBasicPropConfig.js";import"../../services/ProductTeaserPropsConfig.js";import"../../services/LinecheckBasicPropConfig.js";import"../../services/LoginBasicPropConfig.js";import"../../services/DevicePropConfig.js";import"../../services/StickyBottomSheetConfig.js";import"../../services/ServiceOptionsPropConfig.js";import{fetchOfferingDataV2 as d,getDeviceDetails as r,getDeviceModelsList as v}from"../../services/LineTableService.js";import{getDeviceWithVarients as a}from"./DpTableUtils.js";import s from"./DpProduct.js";const u=({tabData:u,tabIndex:c,mainContent:m,activeTab:b,metadata:p,isProdEnv:g})=>{var f,h,C,j;const[P,D]=i([]),[x,L]=i(),[k,I]=i([]),y=null===(f=null==t?void 0:t.getInstance())||void 0===f?void 0:f.getBaseUrl(),E=n(),O=null===(h=null==u?void 0:u.items)||void 0===h?void 0:h.map(o=>{if(null==o?void 0:o.mobProductId)return{id:null==o?void 0:o.mobProductId,promoIds:[null==o?void 0:o.mobPromoId]}});e(()=>{var o,i,e,l,n,t,r,v,a,s,c,p,g,f;0===(null==P?void 0:P.length)&&(null==O?void 0:O.length)>0&&(null===(i=null===(o=null==m?void 0:m.tabContainer)||void 0===o?void 0:o[b])||void 0===i?void 0:i.brand)===(null==u?void 0:u.brand)&&d(O,y,!0).then(o=>{var i;o&&(null===(i=Object.keys(o))||void 0===i?void 0:i.length)>0&&D(o)}).catch(o=>{console.log("error---\x3e",o)}),(null===(l=null===(e=null==m?void 0:m.tabContainer)||void 0===e?void 0:e[b])||void 0===l?void 0:l.defaultDevice)&&(null===(t=null===(n=null==m?void 0:m.tabContainer)||void 0===n?void 0:n[b])||void 0===t?void 0:t.brand)===(null==u?void 0:u.brand)&&T(null===(v=null===(r=null==m?void 0:m.tabContainer)||void 0===r?void 0:r[b])||void 0===v?void 0:v.defaultDevice),(null===(s=null===(a=null==m?void 0:m.tabContainer)||void 0===a?void 0:a[b])||void 0===s?void 0:s.brand)&&(null===(p=null===(c=null==m?void 0:m.tabContainer)||void 0===c?void 0:c[b])||void 0===p?void 0:p.brand)===(null==u?void 0:u.brand)&&B(null===(f=null===(g=null==m?void 0:m.tabContainer)||void 0===g?void 0:g[b])||void 0===f?void 0:f.brand)},[b]);const T=o=>{(null==x?void 0:x[o])||r(o,y).then(i=>{var e,l;const n=null!==(e=a(i))&&void 0!==e&&e;n&&(null===(l=null==Object?void 0:Object.keys(n))||void 0===l?void 0:l.length)>0&&L(Object.assign(Object.assign({},x),{[`${o}`]:n}))}).catch(o=>{console.log("error---\x3e",o)})},B=o=>{0===(null==k?void 0:k.length)&&o&&v(o,y).then(o=>{var i;(null===(i=null==o?void 0:o.hardwares)||void 0===i?void 0:i.length)>0&&I(null==o?void 0:o.hardwares)}).catch(o=>{console.log("error---\x3e",o)})};return o.createElement("div",{className:"linetableV3"},E&&(null===(C=null==u?void 0:u.items)||void 0===C?void 0:C.length)>0&&o.createElement(l,{carouselIndex:0,key:c,arrow:!0,responsive:{superLargeDesktop:{breakpoint:{max:1e4,min:1440},items:3}}},null===(j=(null==u?void 0:u.items)||[])||void 0===j?void 0:j.map((i,e)=>{var l;return o.createElement("div",{key:e},o.createElement(s,{productData:i,mainContent:m,tabIndex:c,indexKey:e,cardsLength:null===(l=null==u?void 0:u.items)||void 0===l?void 0:l.length,offerDataList:P,activeTab:b,deviceModelsList:k,deviceDetailsList:x,fetchDeviceDetails:T,metadata:p,isProdEnv:g}))})))};export{u as default};
1
+ import o,{useState as i,useEffect as e}from"react";import l from"../sharedCarousel/CarouselComponent.js";import{viewport as n}from"../../utils/utils.js";import{LineTableBasicPropConfig as t}from"../../services/LineTableBasicPropConfig.js";import"../../services/ProductTeaserPropsConfig.js";import"../../services/LinecheckBasicPropConfig.js";import"../../services/LoginBasicPropConfig.js";import"../../services/DevicePropConfig.js";import"../../services/StickyBottomSheetConfig.js";import"../../services/ServiceOptionsPropConfig.js";import{fetchOfferingDataV2 as d,getDeviceDetails as r,getDeviceModelsList as v}from"../../services/LineTableService.js";import{getDeviceWithVarients as a}from"./DpTableUtils.js";import s from"./DpProduct.js";const u=({tabData:u,tabIndex:c,mainContent:m,activeTab:p,metadata:b,isProdEnv:g})=>{var f,h,C,j;const[P,D]=i([]),[x,L]=i(),[k,I]=i([]),y=null===(f=null==t?void 0:t.getInstance())||void 0===f?void 0:f.getBaseUrl(),T=n(),E=null===(h=null==u?void 0:u.items)||void 0===h?void 0:h.map(o=>{if(null==o?void 0:o.mobProductId)return{id:null==o?void 0:o.mobProductId,promoIds:[null==o?void 0:o.mobPromoId]}});e(()=>{var o,i,e,l,n,t,r,v,a,s,c,b,g,f;0===(null==P?void 0:P.length)&&(null==E?void 0:E.length)>0&&(null===(i=null===(o=null==m?void 0:m.tabContainer)||void 0===o?void 0:o[p])||void 0===i?void 0:i.brand)===(null==u?void 0:u.brand)&&d(E,y,!0).then(o=>{var i;o&&(null===(i=Object.keys(o))||void 0===i?void 0:i.length)>0&&D(o)}).catch(o=>{console.log("error---\x3e",o)}),(null===(l=null===(e=null==m?void 0:m.tabContainer)||void 0===e?void 0:e[p])||void 0===l?void 0:l.defaultDevice)&&(null===(t=null===(n=null==m?void 0:m.tabContainer)||void 0===n?void 0:n[p])||void 0===t?void 0:t.brand)===(null==u?void 0:u.brand)&&O(null===(v=null===(r=null==m?void 0:m.tabContainer)||void 0===r?void 0:r[p])||void 0===v?void 0:v.defaultDevice,null==m?void 0:m.pageType),(null===(s=null===(a=null==m?void 0:m.tabContainer)||void 0===a?void 0:a[p])||void 0===s?void 0:s.brand)&&(null===(b=null===(c=null==m?void 0:m.tabContainer)||void 0===c?void 0:c[p])||void 0===b?void 0:b.brand)===(null==u?void 0:u.brand)&&B(null===(f=null===(g=null==m?void 0:m.tabContainer)||void 0===g?void 0:g[p])||void 0===f?void 0:f.brand)},[p]);const O=(o,i)=>{(null==x?void 0:x[o])||r(o,y,i).then(i=>{var e,l;const n=null!==(e=a(i))&&void 0!==e&&e;n&&(null===(l=null==Object?void 0:Object.keys(n))||void 0===l?void 0:l.length)>0&&L(Object.assign(Object.assign({},x),{[`${o}`]:n}))}).catch(o=>{console.log("error---\x3e",o)})},B=o=>{0===(null==k?void 0:k.length)&&o&&v(o,y).then(o=>{var i;(null===(i=null==o?void 0:o.hardwares)||void 0===i?void 0:i.length)>0&&I(null==o?void 0:o.hardwares)}).catch(o=>{console.log("error---\x3e",o)})};return o.createElement("div",{className:"linetableV3"},T&&(null===(C=null==u?void 0:u.items)||void 0===C?void 0:C.length)>0&&o.createElement(l,{carouselIndex:0,key:c,arrow:!0,responsive:{superLargeDesktop:{breakpoint:{max:1e4,min:1440},items:3}}},null===(j=(null==u?void 0:u.items)||[])||void 0===j?void 0:j.map((i,e)=>{var l;return o.createElement("div",{key:e},o.createElement(s,{productData:i,mainContent:m,tabIndex:c,indexKey:e,cardsLength:null===(l=null==u?void 0:u.items)||void 0===l?void 0:l.length,offerDataList:P,activeTab:p,deviceModelsList:k,deviceDetailsList:x,fetchDeviceDetails:O,metadata:b,isProdEnv:g}))})))};export{u as default};
2
2
  //# sourceMappingURL=DpTabContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DpTabContainer.js","sources":["../../../../src/components/UltimateBundleLinetable/DpTabContainer.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\r\nimport CarouselComponent from '../sharedCarousel/CarouselComponent';\r\nimport { viewport } from '../../utils/utils';\r\nimport { LineTableBasicPropConfig } from '../../services';\r\nimport {\r\n fetchOfferingDataV2,\r\n getDeviceDetails,\r\n getDeviceModelsList\r\n} from '../../services/LineTableService';\r\nimport { getDeviceWithVarients } from './DpTableUtils';\r\nimport DpProduct from './DpProduct';\r\n\r\nconst DpTabContainer = ({ tabData, tabIndex, mainContent, activeTab, metadata, isProdEnv }: any) => {\r\n const [offeringData, setOfferingData] = useState<any[]>([]); //offerAPI response\r\n const [devicesVarientList, setDevicesVarientList] = useState<any>(); //Holds the detail list of selected device like memory and color ex: Black-256GB\r\n const [deviceModelsList, setDeviceModelsList] = useState([]); //Holds the list of device models which is displayed in dropdown\r\n const endPoint = LineTableBasicPropConfig?.getInstance()?.getBaseUrl();\r\n const viewPort = viewport();\r\n\r\n //To make only 3 items visible even in large desktop view\r\n const responsive = {\r\n superLargeDesktop: {\r\n breakpoint: { max: 10000, min: 1440 },\r\n items: 3\r\n }\r\n };\r\n\r\n //creating reuestBody for offer API call\r\n const offerRequestBody = tabData?.items?.map((rateplan: any) => {\r\n if (rateplan?.mobProductId) {\r\n return {\r\n id: rateplan?.mobProductId,\r\n promoIds: [rateplan?.mobPromoId]\r\n };\r\n }\r\n });\r\n\r\n useEffect(() => {\r\n if (\r\n offeringData?.length === 0 &&\r\n offerRequestBody?.length > 0 &&\r\n mainContent?.tabContainer?.[activeTab]?.brand === tabData?.brand\r\n ) {\r\n // Making the offerAPI call\r\n fetchOfferingDataV2(offerRequestBody, endPoint, true)\r\n .then((data: any) => {\r\n if (data && Object.keys(data)?.length > 0) {\r\n setOfferingData(data);\r\n }\r\n })\r\n .catch((error) => {\r\n // eslint-disable-next-line no-console\r\n console.log('error--->', error);\r\n });\r\n }\r\n\r\n if (\r\n mainContent?.tabContainer?.[activeTab]?.defaultDevice &&\r\n mainContent?.tabContainer?.[activeTab]?.brand === tabData?.brand\r\n ) {\r\n //API call to get the device price and varient details from the default device name we get from SB\r\n fetchDeviceDetails(mainContent?.tabContainer?.[activeTab]?.defaultDevice);\r\n }\r\n\r\n if (\r\n mainContent?.tabContainer?.[activeTab]?.brand &&\r\n mainContent?.tabContainer?.[activeTab]?.brand === tabData?.brand\r\n ) {\r\n //API call to get the list of devices which needs to be displayed in dropdown\r\n fetchDeviceModelsList(mainContent?.tabContainer?.[activeTab]?.brand);\r\n }\r\n }, [activeTab]);\r\n\r\n //API call to get the device price and varient details from the default device name we get from SB\r\n const fetchDeviceDetails = (deviceID: string | any) => {\r\n if (!devicesVarientList?.[deviceID]) {\r\n getDeviceDetails(deviceID, endPoint)\r\n .then((res: any) => {\r\n const deviceWithVarients = getDeviceWithVarients(res) ?? false;\r\n if (deviceWithVarients && Object?.keys(deviceWithVarients)?.length > 0) {\r\n setDevicesVarientList({ ...devicesVarientList, [`${deviceID}`]: deviceWithVarients });\r\n }\r\n })\r\n .catch((error) => {\r\n // eslint-disable-next-line no-console\r\n console.log('error--->', error);\r\n });\r\n }\r\n };\r\n\r\n //API call to get the list of devices which needs to be displayed in dropdown\r\n const fetchDeviceModelsList = (brandId: string) => {\r\n if (deviceModelsList?.length === 0 && brandId) {\r\n getDeviceModelsList(brandId, endPoint)\r\n .then((res: any) => {\r\n if (res?.hardwares?.length > 0) {\r\n setDeviceModelsList(res?.hardwares);\r\n }\r\n })\r\n .catch((error) => {\r\n // eslint-disable-next-line no-console\r\n console.log('error--->', error);\r\n });\r\n }\r\n };\r\n\r\n return (\r\n //added the classname as linetableV3 to add the padding for the linetable which is handeled in main repos\r\n <div className='linetableV3'>\r\n {viewPort && tabData?.items?.length > 0 && (\r\n //mapping the products in each tab\r\n <CarouselComponent carouselIndex={0} key={tabIndex} arrow={true} responsive={responsive}>\r\n {(tabData?.items || [])?.map((product: any, index: number) => {\r\n return (\r\n <div key={index}>\r\n <DpProduct\r\n productData={product} //individual items data\r\n mainContent={mainContent} //whole content\r\n tabIndex={tabIndex} //present tab indx\r\n indexKey={index} //product index\r\n cardsLength={tabData?.items?.length} //total no of products in the tab\r\n offerDataList={offeringData} //offerAPI\r\n activeTab={activeTab} //active tab index\r\n deviceModelsList={deviceModelsList} //device models list for dropdown\r\n deviceDetailsList={devicesVarientList} //device hardware details like memory, color and price\r\n fetchDeviceDetails={fetchDeviceDetails} //call back to trigger hardwares API call when device model is changed\r\n metadata={metadata}\r\n isProdEnv={isProdEnv}\r\n />\r\n </div>\r\n );\r\n })}\r\n </CarouselComponent>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default DpTabContainer;\r\n"],"names":["DpTabContainer","tabData","tabIndex","mainContent","activeTab","metadata","isProdEnv","offeringData","setOfferingData","useState","devicesVarientList","setDevicesVarientList","deviceModelsList","setDeviceModelsList","endPoint","_a","LineTableBasicPropConfig","getInstance","getBaseUrl","viewPort","viewport","offerRequestBody","_b","items","map","rateplan","mobProductId","id","promoIds","mobPromoId","useEffect","length","tabContainer","brand","fetchOfferingDataV2","then","data","Object","keys","catch","error","console","log","_d","_c","defaultDevice","_f","_e","fetchDeviceDetails","_h","_g","_k","_j","_m","_l","fetchDeviceModelsList","_p","_o","deviceID","getDeviceDetails","res","deviceWithVarients","getDeviceWithVarients","assign","brandId","getDeviceModelsList","hardwares","React","createElement","className","CarouselComponent","carouselIndex","key","arrow","responsive","superLargeDesktop","breakpoint","max","min","product","index","DpProduct","productData","indexKey","cardsLength","offerDataList","deviceDetailsList"],"mappings":"ouBAYA,MAAMA,EAAiB,EAAGC,UAASC,WAAUC,cAAaC,YAAWC,WAAUC,4BAC7E,MAAOC,EAAcC,GAAmBC,EAAgB,KACjDC,EAAoBC,GAAyBF,KAC7CG,EAAkBC,GAAuBJ,EAAS,IACnDK,EAAkD,QAAvCC,EAAAC,aAAwB,EAAxBA,EAA0BC,qBAAa,IAAAF,OAAA,EAAAA,EAAEG,aACpDC,EAAWC,IAWXC,UAAmBC,EAAArB,aAAO,EAAPA,EAASsB,4BAAOC,IAAKC,IAC5C,GAAIA,aAAQ,EAARA,EAAUC,aACZ,MAAO,CACLC,GAAIF,aAAQ,EAARA,EAAUC,aACdE,SAAU,CAACH,aAAQ,EAARA,EAAUI,eAK3BC,EAAU,qCAEmB,KAAzBvB,eAAAA,EAAcwB,UACdV,aAAgB,EAAhBA,EAAkBU,QAAS,YAC3BT,EAAyB,QAAzBP,EAAAZ,eAAAA,EAAa6B,oBAAY,IAAAjB,OAAA,EAAAA,EAAGX,yBAAY6B,UAAUhC,aAAO,EAAPA,EAASgC,QAG3DC,EAAoBb,EAAkBP,GAAU,GAC7CqB,KAAMC,UACDA,IAAyB,QAAjBrB,EAAAsB,OAAOC,KAAKF,UAAK,IAAArB,OAAA,EAAAA,EAAEgB,QAAS,GACtCvB,EAAgB4B,KAGnBG,MAAOC,IAENC,QAAQC,IAAI,eAAaF,cAK7BG,EAAyB,QAAzBC,EAAAzC,aAAW,EAAXA,EAAa6B,oBAAY,IAAAY,OAAA,EAAAA,EAAGxC,yBAAYyC,yBACxCC,EAAyB,QAAzBC,EAAA5C,eAAAA,EAAa6B,oBAAY,IAAAe,OAAA,EAAAA,EAAG3C,yBAAY6B,UAAUhC,aAAO,EAAPA,EAASgC,QAG3De,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AEpCoC,EAAAC,cAACE,EAAiB,CAACC,cAAe,EAAGC,IAAKtE,EAAUuE,OAAO,EAAMC,WA3FpD,CACjBC,kBAAmB,CACjBC,WAAY,CAAEC,IAAK,IAAOC,IAAK,MAC/BvD,MAAO,KAyFoB,QAAtBoB,GAAC1C,eAAAA,EAASsB,QAAS,UAAG,IAAAoB,OAAA,EAAAA,EAAEnB,IAAI,CAACuD,EAAcC,WAC1C,OACEb,EAAAC,cAAA,MAAA,CAAKI,IAAKQ,GACRb,EAAAC,cAACa,EAAS,CACRC,YAAaH,EACb5E,YAAaA,EACbD,SAAUA,EACViF,SAAUH,EACVI,YAA2B,QAAdrE,EAAAd,aAAO,EAAPA,EAASsB,aAAK,IAAAR,OAAA,EAAAA,EAAEgB,OAC7BsD,cAAe9E,EACfH,UAAWA,EACXQ,iBAAkBA,EAClB0E,kBAAmB5E,EACnBsC,mBAAoBA,EACpB3C,SAAUA,EACVC,UAAWA"}
1
+ {"version":3,"file":"DpTabContainer.js","sources":["../../../../src/components/UltimateBundleLinetable/DpTabContainer.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\r\nimport CarouselComponent from '../sharedCarousel/CarouselComponent';\r\nimport { viewport } from '../../utils/utils';\r\nimport { LineTableBasicPropConfig } from '../../services';\r\nimport {\r\n fetchOfferingDataV2,\r\n getDeviceDetails,\r\n getDeviceModelsList\r\n} from '../../services/LineTableService';\r\nimport { getDeviceWithVarients } from './DpTableUtils';\r\nimport DpProduct from './DpProduct';\r\n\r\nconst DpTabContainer = ({ tabData, tabIndex, mainContent, activeTab, metadata, isProdEnv }: any) => {\r\n const [offeringData, setOfferingData] = useState<any[]>([]); //offerAPI response\r\n const [devicesVarientList, setDevicesVarientList] = useState<any>(); //Holds the detail list of selected device like memory and color ex: Black-256GB\r\n const [deviceModelsList, setDeviceModelsList] = useState([]); //Holds the list of device models which is displayed in dropdown\r\n const endPoint = LineTableBasicPropConfig?.getInstance()?.getBaseUrl();\r\n const viewPort = viewport();\r\n\r\n //To make only 3 items visible even in large desktop view\r\n const responsive = {\r\n superLargeDesktop: {\r\n breakpoint: { max: 10000, min: 1440 },\r\n items: 3\r\n }\r\n };\r\n\r\n //creating reuestBody for offer API call\r\n const offerRequestBody = tabData?.items?.map((rateplan: any) => {\r\n if (rateplan?.mobProductId) {\r\n return {\r\n id: rateplan?.mobProductId,\r\n promoIds: [rateplan?.mobPromoId]\r\n };\r\n }\r\n });\r\n\r\n useEffect(() => {\r\n if (\r\n offeringData?.length === 0 &&\r\n offerRequestBody?.length > 0 &&\r\n mainContent?.tabContainer?.[activeTab]?.brand === tabData?.brand\r\n ) {\r\n // Making the offerAPI call\r\n fetchOfferingDataV2(offerRequestBody, endPoint, true)\r\n .then((data: any) => {\r\n if (data && Object.keys(data)?.length > 0) {\r\n setOfferingData(data);\r\n }\r\n })\r\n .catch((error) => {\r\n // eslint-disable-next-line no-console\r\n console.log('error--->', error);\r\n });\r\n }\r\n\r\n if (\r\n mainContent?.tabContainer?.[activeTab]?.defaultDevice &&\r\n mainContent?.tabContainer?.[activeTab]?.brand === tabData?.brand\r\n ) {\r\n //API call to get the device price and varient details from the default device name we get from SB\r\n fetchDeviceDetails(mainContent?.tabContainer?.[activeTab]?.defaultDevice, mainContent?.pageType);\r\n }\r\n\r\n if (\r\n mainContent?.tabContainer?.[activeTab]?.brand &&\r\n mainContent?.tabContainer?.[activeTab]?.brand === tabData?.brand\r\n ) {\r\n //API call to get the list of devices which needs to be displayed in dropdown\r\n fetchDeviceModelsList(mainContent?.tabContainer?.[activeTab]?.brand);\r\n }\r\n }, [activeTab]);\r\n\r\n //API call to get the device price and varient details from the default device name we get from SB\r\n const fetchDeviceDetails = (deviceID: string | any, deviceType?: string | any) => {\r\n if (!devicesVarientList?.[deviceID]) {\r\n getDeviceDetails(deviceID, endPoint, deviceType)\r\n .then((res: any) => {\r\n const deviceWithVarients = getDeviceWithVarients(res) ?? false;\r\n if (deviceWithVarients && Object?.keys(deviceWithVarients)?.length > 0) {\r\n setDevicesVarientList({ ...devicesVarientList, [`${deviceID}`]: deviceWithVarients });\r\n }\r\n })\r\n .catch((error) => {\r\n // eslint-disable-next-line no-console\r\n console.log('error--->', error);\r\n });\r\n }\r\n };\r\n\r\n //API call to get the list of devices which needs to be displayed in dropdown\r\n const fetchDeviceModelsList = (brandId: string) => {\r\n if (deviceModelsList?.length === 0 && brandId) {\r\n getDeviceModelsList(brandId, endPoint)\r\n .then((res: any) => {\r\n if (res?.hardwares?.length > 0) {\r\n setDeviceModelsList(res?.hardwares);\r\n }\r\n })\r\n .catch((error) => {\r\n // eslint-disable-next-line no-console\r\n console.log('error--->', error);\r\n });\r\n }\r\n };\r\n\r\n return (\r\n //added the classname as linetableV3 to add the padding for the linetable which is handeled in main repos\r\n <div className='linetableV3'>\r\n {viewPort && tabData?.items?.length > 0 && (\r\n //mapping the products in each tab\r\n <CarouselComponent carouselIndex={0} key={tabIndex} arrow={true} responsive={responsive}>\r\n {(tabData?.items || [])?.map((product: any, index: number) => {\r\n return (\r\n <div key={index}>\r\n <DpProduct\r\n productData={product} //individual items data\r\n mainContent={mainContent} //whole content\r\n tabIndex={tabIndex} //present tab indx\r\n indexKey={index} //product index\r\n cardsLength={tabData?.items?.length} //total no of products in the tab\r\n offerDataList={offeringData} //offerAPI\r\n activeTab={activeTab} //active tab index\r\n deviceModelsList={deviceModelsList} //device models list for dropdown\r\n deviceDetailsList={devicesVarientList} //device hardware details like memory, color and price\r\n fetchDeviceDetails={fetchDeviceDetails} //call back to trigger hardwares API call when device model is changed\r\n metadata={metadata}\r\n isProdEnv={isProdEnv}\r\n />\r\n </div>\r\n );\r\n })}\r\n </CarouselComponent>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default DpTabContainer;\r\n"],"names":["DpTabContainer","tabData","tabIndex","mainContent","activeTab","metadata","isProdEnv","offeringData","setOfferingData","useState","devicesVarientList","setDevicesVarientList","deviceModelsList","setDeviceModelsList","endPoint","_a","LineTableBasicPropConfig","getInstance","getBaseUrl","viewPort","viewport","offerRequestBody","_b","items","map","rateplan","mobProductId","id","promoIds","mobPromoId","useEffect","length","tabContainer","brand","fetchOfferingDataV2","then","data","Object","keys","catch","error","console","log","_d","_c","defaultDevice","_f","_e","fetchDeviceDetails","_h","_g","pageType","_k","_j","_m","_l","fetchDeviceModelsList","_p","_o","deviceID","deviceType","getDeviceDetails","res","deviceWithVarients","getDeviceWithVarients","assign","brandId","getDeviceModelsList","hardwares","React","createElement","className","CarouselComponent","carouselIndex","key","arrow","responsive","superLargeDesktop","breakpoint","max","min","product","index","DpProduct","productData","indexKey","cardsLength","offerDataList","deviceDetailsList"],"mappings":"ouBAYA,MAAMA,EAAiB,EAAGC,UAASC,WAAUC,cAAaC,YAAWC,WAAUC,4BAC7E,MAAOC,EAAcC,GAAmBC,EAAgB,KACjDC,EAAoBC,GAAyBF,KAC7CG,EAAkBC,GAAuBJ,EAAS,IACnDK,EAAkD,QAAvCC,EAAAC,aAAwB,EAAxBA,EAA0BC,qBAAa,IAAAF,OAAA,EAAAA,EAAEG,aACpDC,EAAWC,IAWXC,UAAmBC,EAAArB,aAAO,EAAPA,EAASsB,4BAAOC,IAAKC,IAC5C,GAAIA,aAAQ,EAARA,EAAUC,aACZ,MAAO,CACLC,GAAIF,aAAQ,EAARA,EAAUC,aACdE,SAAU,CAACH,aAAQ,EAARA,EAAUI,eAK3BC,EAAU,qCAEmB,KAAzBvB,eAAAA,EAAcwB,UACdV,aAAgB,EAAhBA,EAAkBU,QAAS,YAC3BT,EAAyB,QAAzBP,EAAAZ,eAAAA,EAAa6B,oBAAY,IAAAjB,OAAA,EAAAA,EAAGX,yBAAY6B,UAAUhC,aAAO,EAAPA,EAASgC,QAG3DC,EAAoBb,EAAkBP,GAAU,GAC7CqB,KAAMC,UACDA,IAAyB,QAAjBrB,EAAAsB,OAAOC,KAAKF,UAAK,IAAArB,OAAA,EAAAA,EAAEgB,QAAS,GACtCvB,EAAgB4B,KAGnBG,MAAOC,IAENC,QAAQC,IA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AgBmC,GACpCC,EAAoBD,EAASpD,GAC1BqB,KAAM2B,WACa,QAAd/C,EAAA+C,aAAG,EAAHA,EAAKM,iBAAS,IAAArD,OAAA,EAAAA,EAAEgB,QAAS,GAC3BlB,EAAoBiD,eAAAA,EAAKM,aAG5B7B,MAAOC,IAENC,QAAQC,IAAI,eAAaF,MAKjC,OAEE6B,EAAAC,cAAA,MAAA,CAAKC,UAAU,eACZpD,YAAYyB,EAAA3C,aAAO,EAAPA,EAASsB,4BAAOQ,QAAS,GAEpCsC,EAAAC,cAACE,EAAiB,CAACC,cAAe,EAAGC,IAAKxE,EAAUyE,OAAO,EAAMC,WA3FpD,CACjBC,kBAAmB,CACjBC,WAAY,CAAEC,IAAK,IAAOC,IAAK,MAC/BzD,MAAO,KAyFoB,QAAtBoB,GAAC1C,eAAAA,EAASsB,QAAS,UAAG,IAAAoB,OAAA,EAAAA,EAAEnB,IAAI,CAACyD,EAAcC,WAC1C,OACEb,EAAAC,cAAA,MAAA,CAAKI,IAAKQ,GACRb,EAAAC,cAACa,EAAS,CACRC,YAAaH,EACb9E,YAAaA,EACbD,SAAUA,EACVmF,SAAUH,EACVI,YAA2B,QAAdvE,EAAAd,aAAO,EAAPA,EAASsB,aAAK,IAAAR,OAAA,EAAAA,EAAEgB,OAC7BwD,cAAehF,EACfH,UAAWA,EACXQ,iBAAkBA,EAClB4E,kBAAmB9E,EACnBsC,mBAAoBA,EACpB3C,SAAUA,EACVC,UAAWA"}
@@ -1,2 +1,2 @@
1
- import e,{useState as l,useEffect as i}from"react";import o from"./DpTableDeviceSection.module.scss.js";import n from"../../ProductDetailsV3/ReactInputSelectV2/ReactInputSelectV2.js";import d from"../../richtext.js";import{getElementMaximumHeight as t,countZero as v}from"../../../utils/utils.js";import{getOptionsList as a}from"../DpTableUtils.js";import u from"../../SkeletonLoader/SkeletonLoader.js";import c from"../../ToolTip/ToolTip.js";const r=({productData:r,mainContent:s,activeTab:m,tabIndex:b,indexKey:f,cardsLength:h,deviceModelsList:g,deviceDetailsList:p,setDeviceDetails:S,fetchDeviceDetails:E})=>{var y,V,$,C,L,D,w,j,T,x,I,O,N;const[A,M]=l([]),[P,k]=l(),[R,U]=l(),[B,F]=l(),[_,z]=l(),[K,q]=l(0),[G,H]=l(0),[J,Q]=l(),W=null!==(y=null==p?void 0:p[null==P?void 0:P.id])&&void 0!==y&&y,[X,Y]=l([]),[Z,ee]=l([]),[le,ie]=l(),oe=(e,l)=>{var i,o,n,d,t,v,a,u,c,r,m,b,f,h;const g=`${e}-${l}`,p=null===(i=null==W?void 0:W.deviceVarientsList)||void 0===i?void 0:i[g];if(p){let e,l;(null===(d=null===(n=null===(o=null==p?void 0:p.hardwarePrices)||void 0===o?void 0:o.smartUpgradeInstallments)||void 0===n?void 0:n.monthlyInstallment)||void 0===d?void 0:d.value)&&H(null===(a=null===(v=null===(t=null==p?void 0:p.hardwarePrices)||void 0===t?void 0:t.smartUpgradeInstallments)||void 0===v?void 0:v.monthlyInstallment)||void 0===a?void 0:a.value),(null===(r=null===(c=null===(u=null==p?void 0:p.hardwarePrices)||void 0===u?void 0:u.installments)||void 0===c?void 0:c.monthlyInstallment)||void 0===r?void 0:r.value)&&q(null===(f=null===(b=null===(m=null==p?void 0:p.hardwarePrices)||void 0===m?void 0:m.installments)||void 0===b?void 0:b.monthlyInstallment)||void 0===f?void 0:f.value),null===(h=(null==s?void 0:s.availabilityDetails)||[])||void 0===h||h.forEach(i=>{var o,n;(null==i?void 0:i.key)===(null==p?void 0:p.availabilityStatus)?e=null!==(o=null==i?void 0:i.value)&&void 0!==o?o:"":"dd_delivery_details"===(null==i?void 0:i.key)&&(l=null!==(n=null==i?void 0:i.value)&&void 0!==n?n:"")}),(e||l)&&Q({availabilityText:e,defaultAvailabilityText:l})}};i(()=>{var e,l,i,o,n,d,t,v,a,u;if(null===(o=null===(i=null===(l=null===(e=null==s?void 0:s.colorCode)||void 0===e?void 0:e[0])||void 0===l?void 0:l.reference)||void 0===i?void 0:i.content)||void 0===o?void 0:o.colorCode){const e=[];null===(a=(null===(v=null===(t=null===(d=null===(n=null==s?void 0:s.colorCode)||void 0===n?void 0:n[0])||void 0===d?void 0:d.reference)||void 0===t?void 0:t.content)||void 0===v?void 0:v.colorCode)||[])||void 0===a||a.forEach(l=>{var i;e[`${null==l?void 0:l.colorKey}`]=null===(i=null==l?void 0:l.hexCode)||void 0===i?void 0:i.color}),e&&(null===(u=null==Object?void 0:Object.keys(e))||void 0===u?void 0:u.length)>0&&ie(e)}},[s]),i(()=>{var e,l,i,o,n,d,t,v,a;if((null==g?void 0:g.length)>0&&(null===(n=null===(o=null===(i=null===(l=null===(e=null==s?void 0:s.deviceReference)||void 0===e?void 0:e[0])||void 0===l?void 0:l.reference)||void 0===i?void 0:i.content)||void 0===o?void 0:o.body)||void 0===n?void 0:n.length)>0){const e=null!==(v=null===(t=null===(d=null==s?void 0:s.tabContainer)||void 0===d?void 0:d[m])||void 0===t?void 0:t.ignoreDevices)&&void 0!==v?v:"",l=null===(a=(g=null==g?void 0:g.filter(l=>-1===(null==e?void 0:e.indexOf(null==l?void 0:l.id))))||[])||void 0===a?void 0:a.map(e=>{var l,i,o,n,d,t,v,a,u;const c=null!==(v=null===(t=null===(d=null===(n=null===(o=null===(i=null===(l=null==s?void 0:s.deviceReference)||void 0===l?void 0:l[0])||void 0===i?void 0:i.reference)||void 0===o?void 0:o.content)||void 0===n?void 0:n.body)||void 0===d?void 0:d.filter(l=>(null==l?void 0:l.defaultVariantId)===(null==e?void 0:e.id)))||void 0===t?void 0:t[0])&&void 0!==v?v:[];return Object.assign(Object.assign({},e),{icon:null===(u=null===(a=null==c?void 0:c.images)||void 0===a?void 0:a[0])||void 0===u?void 0:u.filename})});if((null==l?void 0:l.length)>0){M(l);const e=null==l?void 0:l.filter(e=>{var l,i;return(null==e?void 0:e.id)===(null===(i=null===(l=null==s?void 0:s.tabContainer)||void 0===l?void 0:l[m])||void 0===i?void 0:i.defaultDevice)});(null==e?void 0:e.length)>0&&k(null==e?void 0:e[0])}}},[g]),i(()=>{var e,l,i,o,n;if(W&&(null===(e=Object.keys(W))||void 0===e?void 0:e.length)>0){U(null===(l=a([null==W?void 0:W.defaultMemorySelected]))||void 0===l?void 0:l[0]),F(Object.assign(Object.assign({},null===(i=a([null==W?void 0:W.defaultColorSelected]))||void 0===i?void 0:i[0]),{code:null!==(o=le[`${null==W?void 0:W.defaultColorSelected}`])&&void 0!==o?o:""}));const e=ne(null==W?void 0:W.deviceVarientsList,null==W?void 0:W.defaultColorSelected);Y(a(e));const d=ne(null==W?void 0:W.deviceVarientsList,null==W?void 0:W.defaultMemorySelected),t=null===(n=a(d)||[])||void 0===n?void 0:n.map(e=>Object.assign(Object.assign({},e),{code:le[`${null==e?void 0:e.id}`]}));ee(t),oe(null==W?void 0:W.defaultColorSelected,null==W?void 0:W.defaultMemorySelected)}},[p,P]),i(()=>{var e,l,i,o;const n=null===(e=A||[])||void 0===e?void 0:e.filter(e=>(null==e?void 0:e.id)===(null==P?void 0:P.id));if(B&&R){const e=`${null==B?void 0:B.id}-${null==R?void 0:R.id}`,d=null===(l=null==W?void 0:W.deviceVarientsList)||void 0===l?void 0:l[e];z(d),oe(null==B?void 0:B.id,null==R?void 0:R.id),S({selectedDeviceModal:null==P?void 0:P.id,selectedColor:null==B?void 0:B.id,selectedStorage:null==R?void 0:R.id,selectedImageUrl:null!==(o=null===(i=null==n?void 0:n[0])||void 0===i?void 0:i.icon)&&void 0!==o?o:"",selectedVarientDetails:d})}return setTimeout(()=>{de()},100),null===window||void 0===window||window.addEventListener("load",de),null===window||void 0===window||window.addEventListener("resize",de),()=>{window.removeEventListener("resize",de),window.removeEventListener("load",de)}},[B,R]),i(()=>{if(null==W?void 0:W.deviceVarientsList){const e=ne(null==W?void 0:W.deviceVarientsList,null==B?void 0:B.id);(null==e?void 0:e.length)>0&&Y(a(e))}},[B]),i(()=>{var e;if(null==W?void 0:W.deviceVarientsList){const l=ne(null==W?void 0:W.deviceVarientsList,null==R?void 0:R.id),i=null===(e=a(l)||[])||void 0===e?void 0:e.map(e=>Object.assign(Object.assign({},e),{code:le[`${null==e?void 0:e.id}`]}));(null==l?void 0:l.length)>0&&ee(i)}},[R]);const ne=(e,l)=>{const i=[],o=e&&(null==Object?void 0:Object.entries(e));return null==o||o.forEach(e=>{var o;const n=null===(o=null==e?void 0:e[0])||void 0===o?void 0:o.split("-");(null==n?void 0:n[0])===l?i.push(null==n?void 0:n[1]):(null==n?void 0:n[1])===l&&i.push(null==n?void 0:n[0])}),i},de=()=>{t(`deviceSection${b}`,h),t(`deviceDetailsSection${b}`,h),t(`devicePriceSection${b}`,h),t(`deviceAvailSection${b}`,h),t(`deviceSectionLoader${b}`,h),t(`deviceModalSelector${b}`,h),t(`deviceSpecsSelector${b}`,h)};return e.createElement(e.Fragment,null,(null==A?void 0:A.length)>0&&W&&(null===(V=Object.keys(W))||void 0===V?void 0:V.length)>0?e.createElement("div",{className:o.deviceSection,id:`deviceSection${b}${f}`},e.createElement("div",{className:o.deviceDetailsContainer,id:`deviceDetailsSection${b}${f}`},(null==A?void 0:A.length)>0&&e.createElement("div",{className:o.deviceModalSelector,id:`deviceModalSelector${b}${f}`},e.createElement(n,{name:"deviceModal",content:{label:"",errorMessage:""},options:A,optionsValue:"id",optionsLabel:"name",onChange:e=>{var l,i,o;(null==e?void 0:e.value)&&k(null==e?void 0:e.value),(null===(l=null==e?void 0:e.value)||void 0===l?void 0:l.id)&&(null===(i=null==e?void 0:e.value)||void 0===i?void 0:i.id)!==(null==P?void 0:P.id)&&E(null===(o=null==e?void 0:e.value)||void 0===o?void 0:o.id)},isSearchable:!1,isClearable:!1,defaultValue:P,valueContainerVarient:"deviceModalValue"})),e.createElement("div",{className:"row",id:`deviceSpecsSelector${b}${f}`},(null==X?void 0:X.length)>0&&R&&e.createElement("div",{className:"col-5"},e.createElement(n,{name:"deviceStorage",content:{label:"",errorMessage:""},options:X,optionsValue:"id",optionsLabel:"name",onChange:e=>{(null==e?void 0:e.value)&&U(null==e?void 0:e.value)},isSearchable:!1,isClearable:!1,defaultValue:R,updateValue:R,valueContainerVarient:"deviceStorageValue"})),(null==Z?void 0:Z.length)>0&&B&&e.createElement("div",{className:"col-7"},e.createElement(n,{name:"deviceColor",content:{label:"",errorMessage:""},options:Z,optionsValue:"id",optionsLabel:"name",onChange:e=>{(null==e?void 0:e.value)&&F(null==e?void 0:e.value)},isSearchable:!1,isClearable:!1,defaultValue:B,updateValue:B,valueContainerVarient:"deviceColorValue",optionsContainerVarient:"deviceColorOptions"})))),G>0&&e.createElement(e.Fragment,null,e.createElement("hr",null),e.createElement("div",{className:o.devicePriceContainer,id:`devicePriceSection${b}${f}`},e.createElement("div",{className:o.devicePriceSection},e.createElement("img",{src:null===($=null==s?void 0:s.discountIcon)||void 0===$?void 0:$.filename,alt:"",width:24,height:24}),e.createElement("div",{className:o.deviceDiscountedPrice},v(G),e.createElement("span",{className:o.month},null==s?void 0:s.contractLabel)),e.createElement("div",{className:o.deviceBasePrice},v(K))),(null===(C=null==r?void 0:r.deviceDiscountText)||void 0===C?void 0:C.length)>0&&e.createElement("div",{className:o.devicePriceDescription},e.createElement(d,{content:null===(D=null===(L=null==r?void 0:r.deviceDiscountText)||void 0===L?void 0:L[0])||void 0===D?void 0:D.text}),(null===(j=null===(w=null==r?void 0:r.deviceDiscountText)||void 0===w?void 0:w[0])||void 0===j?void 0:j.tooltipTxt)&&e.createElement(c,{content:e.createElement(d,{content:null===(x=null===(T=null==r?void 0:r.deviceDiscountText)||void 0===T?void 0:T[0])||void 0===x?void 0:x.tooltipTxt})})))),e.createElement("hr",null),J&&e.createElement("div",{className:o.deviceAvailability,id:`deviceAvailSection${b}${f}`},e.createElement("img",{src:"NOT_AVAILABLE"===(null==_?void 0:_.availabilityStatus)?null===(I=null==s?void 0:s.notAvailableIcon)||void 0===I?void 0:I.filename:(null==_?void 0:_.availabilityStatus)&&(null==J?void 0:J.availabilityText)&&"AVAILABLE"!==(null==_?void 0:_.availabilityStatus)?null===(O=null==s?void 0:s.delayedAvailableIcon)||void 0===O?void 0:O.filename:null===(N=null==s?void 0:s.availableIcon)||void 0===N?void 0:N.filename,alt:"",width:16,height:16}),(null==_?void 0:_.availabilityStatus)&&(null==J?void 0:J.availabilityText)?null==J?void 0:J.availabilityText:null==J?void 0:J.defaultAvailabilityText)):e.createElement("div",{className:o.deviceSection,id:`deviceSectionLoader${b}${f}`},e.createElement(e.Fragment,null,e.createElement(u,{stylename:o.skeletontittle,count:1}),e.createElement(u,{stylename:o.skeletonline,count:5}),e.createElement(u,{stylename:o.skeletontittle,count:1}),e.createElement(u,{stylename:o.skeletonline,count:5}))))};export{r as default};
1
+ import e,{useState as l,useEffect as i}from"react";import o from"./DpTableDeviceSection.module.scss.js";import n from"../../ProductDetailsV3/ReactInputSelectV2/ReactInputSelectV2.js";import d from"../../richtext.js";import{getElementMaximumHeight as t,countZero as v}from"../../../utils/utils.js";import{getOptionsList as a}from"../DpTableUtils.js";import u from"../../SkeletonLoader/SkeletonLoader.js";import c from"../../ToolTip/ToolTip.js";const r=({productData:r,mainContent:s,activeTab:m,tabIndex:b,indexKey:f,cardsLength:h,deviceModelsList:g,deviceDetailsList:p,setDeviceDetails:S,fetchDeviceDetails:E})=>{var y,V,$,C,L,D,w,T,j,x,I,O,N;const[A,M]=l([]),[P,k]=l(),[R,U]=l(),[B,F]=l(),[_,z]=l(),[K,q]=l(0),[G,H]=l(0),[J,Q]=l(),W=null!==(y=null==p?void 0:p[null==P?void 0:P.id])&&void 0!==y&&y,[X,Y]=l([]),[Z,ee]=l([]),[le,ie]=l(),oe=(e,l)=>{var i,o,n,d,t,v,a,u,c,r,m,b,f,h;const g=`${e}-${l}`,p=null===(i=null==W?void 0:W.deviceVarientsList)||void 0===i?void 0:i[g];if(p){let e,l;(null===(d=null===(n=null===(o=null==p?void 0:p.hardwarePrices)||void 0===o?void 0:o.smartUpgradeInstallments)||void 0===n?void 0:n.monthlyInstallment)||void 0===d?void 0:d.value)&&H(null===(a=null===(v=null===(t=null==p?void 0:p.hardwarePrices)||void 0===t?void 0:t.smartUpgradeInstallments)||void 0===v?void 0:v.monthlyInstallment)||void 0===a?void 0:a.value),(null===(r=null===(c=null===(u=null==p?void 0:p.hardwarePrices)||void 0===u?void 0:u.installments)||void 0===c?void 0:c.monthlyInstallment)||void 0===r?void 0:r.value)&&q(null===(f=null===(b=null===(m=null==p?void 0:p.hardwarePrices)||void 0===m?void 0:m.installments)||void 0===b?void 0:b.monthlyInstallment)||void 0===f?void 0:f.value),null===(h=(null==s?void 0:s.availabilityDetails)||[])||void 0===h||h.forEach(i=>{var o,n;(null==i?void 0:i.key)===(null==p?void 0:p.availabilityStatus)?e=null!==(o=null==i?void 0:i.value)&&void 0!==o?o:"":"dd_delivery_details"===(null==i?void 0:i.key)&&(l=null!==(n=null==i?void 0:i.value)&&void 0!==n?n:"")}),(e||l)&&Q({availabilityText:e,defaultAvailabilityText:l})}};i(()=>{var e,l,i,o,n,d,t,v,a,u;if(null===(o=null===(i=null===(l=null===(e=null==s?void 0:s.colorCode)||void 0===e?void 0:e[0])||void 0===l?void 0:l.reference)||void 0===i?void 0:i.content)||void 0===o?void 0:o.colorCode){const e=[];null===(a=(null===(v=null===(t=null===(d=null===(n=null==s?void 0:s.colorCode)||void 0===n?void 0:n[0])||void 0===d?void 0:d.reference)||void 0===t?void 0:t.content)||void 0===v?void 0:v.colorCode)||[])||void 0===a||a.forEach(l=>{var i;e[`${null==l?void 0:l.colorKey}`]=null===(i=null==l?void 0:l.hexCode)||void 0===i?void 0:i.color}),e&&(null===(u=null==Object?void 0:Object.keys(e))||void 0===u?void 0:u.length)>0&&ie(e)}},[s]),i(()=>{var e,l,i,o,n,d,t,v,a;if((null==g?void 0:g.length)>0&&(null===(n=null===(o=null===(i=null===(l=null===(e=null==s?void 0:s.deviceReference)||void 0===e?void 0:e[0])||void 0===l?void 0:l.reference)||void 0===i?void 0:i.content)||void 0===o?void 0:o.body)||void 0===n?void 0:n.length)>0){const e=null!==(v=null===(t=null===(d=null==s?void 0:s.tabContainer)||void 0===d?void 0:d[m])||void 0===t?void 0:t.ignoreDevices)&&void 0!==v?v:"",l=null===(a=(g=null==g?void 0:g.filter(l=>-1===(null==e?void 0:e.indexOf(null==l?void 0:l.id))))||[])||void 0===a?void 0:a.map(e=>{var l,i,o,n,d,t,v,a,u;const c=null!==(v=null===(t=null===(d=null===(n=null===(o=null===(i=null===(l=null==s?void 0:s.deviceReference)||void 0===l?void 0:l[0])||void 0===i?void 0:i.reference)||void 0===o?void 0:o.content)||void 0===n?void 0:n.body)||void 0===d?void 0:d.filter(l=>(null==l?void 0:l.defaultVariantId)===(null==e?void 0:e.id)))||void 0===t?void 0:t[0])&&void 0!==v?v:[];return Object.assign(Object.assign({},e),{icon:null===(u=null===(a=null==c?void 0:c.images)||void 0===a?void 0:a[0])||void 0===u?void 0:u.filename})});if((null==l?void 0:l.length)>0){M(l);const e=null==l?void 0:l.filter(e=>{var l,i;return(null==e?void 0:e.id)===(null===(i=null===(l=null==s?void 0:s.tabContainer)||void 0===l?void 0:l[m])||void 0===i?void 0:i.defaultDevice)});(null==e?void 0:e.length)>0&&k(null==e?void 0:e[0])}}},[g]),i(()=>{var e,l,i,o,n;if(W&&(null===(e=Object.keys(W))||void 0===e?void 0:e.length)>0){U(null===(l=a([null==W?void 0:W.defaultMemorySelected]))||void 0===l?void 0:l[0]),F(Object.assign(Object.assign({},null===(i=a([null==W?void 0:W.defaultColorSelected]))||void 0===i?void 0:i[0]),{code:null!==(o=le[`${null==W?void 0:W.defaultColorSelected}`])&&void 0!==o?o:""}));const e=ne(null==W?void 0:W.deviceVarientsList,null==W?void 0:W.defaultColorSelected);Y(a(e));const d=ne(null==W?void 0:W.deviceVarientsList,null==W?void 0:W.defaultMemorySelected),t=null===(n=a(d)||[])||void 0===n?void 0:n.map(e=>Object.assign(Object.assign({},e),{code:le[`${null==e?void 0:e.id}`]}));ee(t),oe(null==W?void 0:W.defaultColorSelected,null==W?void 0:W.defaultMemorySelected)}},[p,P]),i(()=>{var e,l,i,o;const n=null===(e=A||[])||void 0===e?void 0:e.filter(e=>(null==e?void 0:e.id)===(null==P?void 0:P.id));if(B&&R){const e=`${null==B?void 0:B.id}-${null==R?void 0:R.id}`,d=null===(l=null==W?void 0:W.deviceVarientsList)||void 0===l?void 0:l[e];z(d),oe(null==B?void 0:B.id,null==R?void 0:R.id),S({selectedDeviceModal:null==P?void 0:P.id,selectedColor:null==B?void 0:B.id,selectedStorage:null==R?void 0:R.id,selectedImageUrl:null!==(o=null===(i=null==n?void 0:n[0])||void 0===i?void 0:i.icon)&&void 0!==o?o:"",selectedVarientDetails:d})}return setTimeout(()=>{de()},100),null===window||void 0===window||window.addEventListener("load",de),null===window||void 0===window||window.addEventListener("resize",de),()=>{window.removeEventListener("resize",de),window.removeEventListener("load",de)}},[B,R]),i(()=>{if(null==W?void 0:W.deviceVarientsList){const e=ne(null==W?void 0:W.deviceVarientsList,null==B?void 0:B.id);(null==e?void 0:e.length)>0&&Y(a(e))}},[B]),i(()=>{var e;if(null==W?void 0:W.deviceVarientsList){const l=ne(null==W?void 0:W.deviceVarientsList,null==R?void 0:R.id),i=null===(e=a(l)||[])||void 0===e?void 0:e.map(e=>Object.assign(Object.assign({},e),{code:le[`${null==e?void 0:e.id}`]}));(null==l?void 0:l.length)>0&&ee(i)}},[R]);const ne=(e,l)=>{const i=[],o=e&&(null==Object?void 0:Object.entries(e));return null==o||o.forEach(e=>{var o;const n=null===(o=null==e?void 0:e[0])||void 0===o?void 0:o.split("-");(null==n?void 0:n[0])===l?i.push(null==n?void 0:n[1]):(null==n?void 0:n[1])===l&&i.push(null==n?void 0:n[0])}),i},de=()=>{t(`deviceSection${b}`,h),t(`deviceDetailsSection${b}`,h),t(`devicePriceSection${b}`,h),t(`deviceAvailSection${b}`,h),t(`deviceSectionLoader${b}`,h),t(`deviceModalSelector${b}`,h),t(`deviceSpecsSelector${b}`,h)};return e.createElement(e.Fragment,null,(null==A?void 0:A.length)>0&&W&&(null===(V=Object.keys(W))||void 0===V?void 0:V.length)>0?e.createElement("div",{className:o.deviceSection,id:`deviceSection${b}${f}`},e.createElement("div",{className:o.deviceDetailsContainer,id:`deviceDetailsSection${b}${f}`},(null==A?void 0:A.length)>0&&e.createElement("div",{className:o.deviceModalSelector,id:`deviceModalSelector${b}${f}`},e.createElement(n,{name:"deviceModal",content:{label:"",errorMessage:""},options:A,optionsValue:"id",optionsLabel:"name",onChange:e=>{var l,i,o;(null==e?void 0:e.value)&&k(null==e?void 0:e.value),(null===(l=null==e?void 0:e.value)||void 0===l?void 0:l.id)&&(null===(i=null==e?void 0:e.value)||void 0===i?void 0:i.id)!==(null==P?void 0:P.id)&&E(null===(o=null==e?void 0:e.value)||void 0===o?void 0:o.id,null==s?void 0:s.pageType)},isSearchable:!1,isClearable:!1,defaultValue:P,valueContainerVarient:"deviceModalValue"})),e.createElement("div",{className:"row",id:`deviceSpecsSelector${b}${f}`},(null==X?void 0:X.length)>0&&R&&e.createElement("div",{className:"col-5"},e.createElement(n,{name:"deviceStorage",content:{label:"",errorMessage:""},options:X,optionsValue:"id",optionsLabel:"name",onChange:e=>{(null==e?void 0:e.value)&&U(null==e?void 0:e.value)},isSearchable:!1,isClearable:!1,defaultValue:R,updateValue:R,valueContainerVarient:"deviceStorageValue"})),(null==Z?void 0:Z.length)>0&&B&&e.createElement("div",{className:"col-7"},e.createElement(n,{name:"deviceColor",content:{label:"",errorMessage:""},options:Z,optionsValue:"id",optionsLabel:"name",onChange:e=>{(null==e?void 0:e.value)&&F(null==e?void 0:e.value)},isSearchable:!1,isClearable:!1,defaultValue:B,updateValue:B,valueContainerVarient:"deviceColorValue",optionsContainerVarient:"deviceColorOptions"})))),G>0&&e.createElement(e.Fragment,null,e.createElement("hr",null),e.createElement("div",{className:o.devicePriceContainer,id:`devicePriceSection${b}${f}`},e.createElement("div",{className:o.devicePriceSection},e.createElement("img",{src:null===($=null==s?void 0:s.discountIcon)||void 0===$?void 0:$.filename,alt:"",width:24,height:24}),e.createElement("div",{className:o.deviceDiscountedPrice},v(G),e.createElement("span",{className:o.month},null==s?void 0:s.contractLabel)),e.createElement("div",{className:o.deviceBasePrice},v(K))),(null===(C=null==r?void 0:r.deviceDiscountText)||void 0===C?void 0:C.length)>0&&e.createElement("div",{className:o.devicePriceDescription},e.createElement(d,{content:null===(D=null===(L=null==r?void 0:r.deviceDiscountText)||void 0===L?void 0:L[0])||void 0===D?void 0:D.text}),(null===(T=null===(w=null==r?void 0:r.deviceDiscountText)||void 0===w?void 0:w[0])||void 0===T?void 0:T.tooltipTxt)&&e.createElement(c,{content:e.createElement(d,{content:null===(x=null===(j=null==r?void 0:r.deviceDiscountText)||void 0===j?void 0:j[0])||void 0===x?void 0:x.tooltipTxt})})))),e.createElement("hr",null),J&&e.createElement("div",{className:o.deviceAvailability,id:`deviceAvailSection${b}${f}`},e.createElement("img",{src:"NOT_AVAILABLE"===(null==_?void 0:_.availabilityStatus)?null===(I=null==s?void 0:s.notAvailableIcon)||void 0===I?void 0:I.filename:(null==_?void 0:_.availabilityStatus)&&(null==J?void 0:J.availabilityText)&&"AVAILABLE"!==(null==_?void 0:_.availabilityStatus)?null===(O=null==s?void 0:s.delayedAvailableIcon)||void 0===O?void 0:O.filename:null===(N=null==s?void 0:s.availableIcon)||void 0===N?void 0:N.filename,alt:"",width:16,height:16}),(null==_?void 0:_.availabilityStatus)&&(null==J?void 0:J.availabilityText)?null==J?void 0:J.availabilityText:null==J?void 0:J.defaultAvailabilityText)):e.createElement("div",{className:o.deviceSection,id:`deviceSectionLoader${b}${f}`},e.createElement(e.Fragment,null,e.createElement(u,{stylename:o.skeletontittle,count:1}),e.createElement(u,{stylename:o.skeletonline,count:5}),e.createElement(u,{stylename:o.skeletontittle,count:1}),e.createElement(u,{stylename:o.skeletonline,count:5}))))};export{r as default};
2
2
  //# sourceMappingURL=DpTableDeviceSection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DpTableDeviceSection.js","sources":["../../../../../src/components/UltimateBundleLinetable/DpTableDeviceSection/DpTableDeviceSection.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\r\nimport styles from './DpTableDeviceSection.module.scss';\r\nimport ReactInputSelectV2 from '../../ProductDetailsV3/ReactInputSelectV2/ReactInputSelectV2';\r\nimport RichText from '../../richtext';\r\nimport { countZero, getElementMaximumHeight } from '../../../utils/utils';\r\nimport { getOptionsList } from '../DpTableUtils';\r\nimport SkeletonLoader from '../../SkeletonLoader/SkeletonLoader';\r\nimport ToolTip from '../../ToolTip/ToolTip';\r\n\r\nconst DpTableDeviceSection = ({\r\n productData, //products sb data\r\n mainContent, // whole content\r\n activeTab,\r\n tabIndex,\r\n indexKey, //products index\r\n cardsLength,\r\n deviceModelsList, //list of only device models ex: {id: Apple iphone 16,name: Apple iphone 16}\r\n deviceDetailsList, // All details of specific modal like color, memory and prices\r\n setDeviceDetails, // call back to update the selected device details in dpProduct.tsx\r\n fetchDeviceDetails // call back from dpTabCOntainer to trigger hardwares API call to get model's varient and price details on switch of models\r\n}: any) => {\r\n const [updatedDeviceList, setUpdatedDeviceList] = useState<any[]>([]); //Updated device models list with its respective device images\r\n const [selectedDeviceModal, setSelectedDeviceModal] = useState<any>();\r\n const [selectedStorage, setSelectedStorage] = useState<any>();\r\n const [selectedColor, setSelectedColor] = useState<any>();\r\n const [selectedVarientData, setSelectedVarientData] = useState<any>(); // details of the selected device varient like price and all\r\n const [basePrice, setBasePrice] = useState(0);\r\n const [discountPrice, setDiscountPrice] = useState(0);\r\n const [availabilityStatus, setAvailabilityStatus] = useState<any>();\r\n const deviceDetails = deviceDetailsList?.[selectedDeviceModal?.id] ?? false; //picking details of the selected modal from the whole list\r\n const [storageOptions, setStorageOptions] = useState<any[]>([]);\r\n const [colorOptions, setColorOptions] = useState<any[]>([]);\r\n const [colorWithHexCode, setcolorWithHexCode] = useState<any>();\r\n\r\n const onModalChange = (e: any) => {\r\n if (e?.value) {\r\n setSelectedDeviceModal(e?.value);\r\n }\r\n if (e?.value?.id && e?.value?.id !== selectedDeviceModal?.id) {\r\n fetchDeviceDetails(e?.value?.id);\r\n }\r\n };\r\n\r\n const onStorageChange = (e: any) => {\r\n if (e?.value) {\r\n setSelectedStorage(e?.value);\r\n }\r\n };\r\n\r\n const onColorChange = (e: any) => {\r\n if (e?.value) {\r\n setSelectedColor(e?.value);\r\n }\r\n };\r\n\r\n // to update the display price based on the varients selected\r\n const setDevicePrices = (color: string, memory: string) => {\r\n const varient = `${color}-${memory}`;\r\n const varientDetails = deviceDetails?.deviceVarientsList?.[varient];\r\n if (varientDetails) {\r\n if (varientDetails?.hardwarePrices?.smartUpgradeInstallments?.monthlyInstallment?.value) {\r\n setDiscountPrice(\r\n varientDetails?.hardwarePrices?.smartUpgradeInstallments?.monthlyInstallment?.value\r\n );\r\n }\r\n if (varientDetails?.hardwarePrices?.installments?.monthlyInstallment?.value) {\r\n setBasePrice(varientDetails?.hardwarePrices?.installments?.monthlyInstallment?.value);\r\n }\r\n let availableText, defaultAvailableText;\r\n (mainContent?.availabilityDetails || [])?.forEach((data: any) => {\r\n if (data?.key === varientDetails?.availabilityStatus) {\r\n availableText = data?.value ?? '';\r\n } else if (data?.key === 'dd_delivery_details') {\r\n defaultAvailableText = data?.value ?? '';\r\n }\r\n });\r\n\r\n if (availableText || defaultAvailableText)\r\n setAvailabilityStatus({\r\n availabilityText: availableText,\r\n defaultAvailabilityText: defaultAvailableText\r\n });\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n if (mainContent?.colorCode?.[0]?.reference?.content?.colorCode) {\r\n const colorWithCode: any = [];\r\n (mainContent?.colorCode?.[0]?.reference?.content?.colorCode || [])?.forEach((color: any) => {\r\n colorWithCode[`${color?.colorKey}`] = color?.hexCode?.color;\r\n });\r\n colorWithCode &&\r\n Object?.keys(colorWithCode)?.length > 0 &&\r\n setcolorWithHexCode(colorWithCode);\r\n }\r\n }, [mainContent]);\r\n\r\n //default selecting the modal once we get the response from device list API\r\n useEffect(() => {\r\n if (\r\n deviceModelsList?.length > 0 &&\r\n mainContent?.deviceReference?.[0]?.reference?.content?.body?.length > 0\r\n ) {\r\n //to hide the selected device from devicemodelist dropdown\r\n const ignoreDeviceList = mainContent?.tabContainer?.[activeTab]?.ignoreDevices ?? \"\";\r\n deviceModelsList = deviceModelsList?.filter(\r\n (items: any) => ignoreDeviceList?.indexOf(items?.id) === -1\r\n );\r\n const newDeviceList = (deviceModelsList || [])?.map((products: any) => {\r\n const deviceContent =\r\n mainContent?.deviceReference?.[0]?.reference?.content?.body?.filter(\r\n (items: any) => items?.defaultVariantId === products?.id\r\n )?.[0] ?? [];\r\n return {\r\n ...products,\r\n icon: deviceContent?.images?.[0]?.filename\r\n };\r\n });\r\n if (newDeviceList?.length > 0) {\r\n setUpdatedDeviceList(newDeviceList);\r\n const defaultModalValue = newDeviceList?.filter(\r\n (device: any) => device?.id === mainContent?.tabContainer?.[activeTab]?.defaultDevice\r\n );\r\n if (defaultModalValue?.length > 0) {\r\n setSelectedDeviceModal(defaultModalValue?.[0]);\r\n }\r\n }\r\n }\r\n }, [deviceModelsList]);\r\n\r\n //to update the default selected color and memory once we get hardware details of selected model\r\n useEffect(() => {\r\n if (deviceDetails && Object.keys(deviceDetails)?.length > 0) {\r\n setSelectedStorage(getOptionsList([deviceDetails?.defaultMemorySelected])?.[0]);\r\n setSelectedColor({\r\n ...getOptionsList([deviceDetails?.defaultColorSelected])?.[0],\r\n code: colorWithHexCode[`${deviceDetails?.defaultColorSelected}`] ?? ''\r\n });\r\n const updatedStorageList = getCombination(\r\n deviceDetails?.deviceVarientsList,\r\n deviceDetails?.defaultColorSelected\r\n );\r\n setStorageOptions(getOptionsList(updatedStorageList));\r\n\r\n const updatedColorOptions = getCombination(\r\n deviceDetails?.deviceVarientsList,\r\n deviceDetails?.defaultMemorySelected\r\n );\r\n const colorsList = getOptionsList(updatedColorOptions);\r\n const updateColorList = (colorsList || [])?.map((color: any) => {\r\n return {\r\n ...color,\r\n code: colorWithHexCode[`${color?.id}`]\r\n };\r\n });\r\n setColorOptions(updateColorList);\r\n setDevicePrices(deviceDetails?.defaultColorSelected, deviceDetails?.defaultMemorySelected);\r\n }\r\n }, [deviceDetailsList, selectedDeviceModal]);\r\n\r\n //call back to update details in dpProduct and updating price on change of color or memory\r\n useEffect(() => {\r\n const imgURL = (updatedDeviceList || [])?.filter(\r\n (device: any) => device?.id === selectedDeviceModal?.id\r\n );\r\n if (selectedColor && selectedStorage) {\r\n const varient = `${selectedColor?.id}-${selectedStorage?.id}`;\r\n const varientDetails = deviceDetails?.deviceVarientsList?.[varient];\r\n setSelectedVarientData(varientDetails);\r\n setDevicePrices(selectedColor?.id, selectedStorage?.id);\r\n setDeviceDetails({\r\n selectedDeviceModal: selectedDeviceModal?.id,\r\n selectedColor: selectedColor?.id,\r\n selectedStorage: selectedStorage?.id,\r\n selectedImageUrl: imgURL?.[0]?.icon ?? '',\r\n selectedVarientDetails: varientDetails\r\n });\r\n }\r\n setTimeout(() => {\r\n findHeight();\r\n }, 100);\r\n window?.addEventListener('load', findHeight);\r\n window?.addEventListener('resize', findHeight);\r\n return () => {\r\n window.removeEventListener('resize', findHeight);\r\n window.removeEventListener('load', findHeight);\r\n };\r\n }, [selectedColor, selectedStorage]);\r\n\r\n useEffect(() => {\r\n if (deviceDetails?.deviceVarientsList) {\r\n const newStorageList = getCombination(deviceDetails?.deviceVarientsList, selectedColor?.id);\r\n if (newStorageList?.length > 0) {\r\n setStorageOptions(getOptionsList(newStorageList));\r\n }\r\n }\r\n }, [selectedColor]);\r\n\r\n useEffect(() => {\r\n if (deviceDetails?.deviceVarientsList) {\r\n const newColorList = getCombination(deviceDetails?.deviceVarientsList, selectedStorage?.id);\r\n const colorsList = getOptionsList(newColorList);\r\n const updateColorList = (colorsList || [])?.map((color: any) => {\r\n return {\r\n ...color,\r\n code: colorWithHexCode[`${color?.id}`]\r\n };\r\n });\r\n if (newColorList?.length > 0) {\r\n setColorOptions(updateColorList);\r\n }\r\n }\r\n }, [selectedStorage]);\r\n\r\n const getCombination = (array: any, partialKey: any) => {\r\n const matchedArray: any = [];\r\n const list = array && Object?.entries(array);\r\n list?.forEach((key: any) => {\r\n const keys = key?.[0]?.split('-');\r\n if (keys?.[0] === partialKey) {\r\n matchedArray.push(keys?.[1]);\r\n } else if (keys?.[1] === partialKey) {\r\n matchedArray.push(keys?.[0]);\r\n }\r\n });\r\n return matchedArray;\r\n };\r\n\r\n const findHeight = () => {\r\n getElementMaximumHeight(`deviceSection${tabIndex}`, cardsLength);\r\n getElementMaximumHeight(`deviceDetailsSection${tabIndex}`, cardsLength);\r\n getElementMaximumHeight(`devicePriceSection${tabIndex}`, cardsLength);\r\n getElementMaximumHeight(`deviceAvailSection${tabIndex}`, cardsLength);\r\n getElementMaximumHeight(`deviceSectionLoader${tabIndex}`, cardsLength);\r\n getElementMaximumHeight(`deviceModalSelector${tabIndex}`, cardsLength);\r\n getElementMaximumHeight(`deviceSpecsSelector${tabIndex}`, cardsLength);\r\n };\r\n\r\n return (\r\n <>\r\n {updatedDeviceList?.length > 0 && deviceDetails && Object.keys(deviceDetails)?.length > 0 ? (\r\n <div className={styles.deviceSection} id={`deviceSection${tabIndex}${indexKey}`}>\r\n <div\r\n className={styles.deviceDetailsContainer}\r\n id={`deviceDetailsSection${tabIndex}${indexKey}`}\r\n >\r\n {updatedDeviceList?.length > 0 && (\r\n <div\r\n className={styles.deviceModalSelector}\r\n id={`deviceModalSelector${tabIndex}${indexKey}`}\r\n >\r\n <ReactInputSelectV2\r\n name='deviceModal'\r\n content={{ label: '', errorMessage: '' }}\r\n options={updatedDeviceList}\r\n optionsValue='id'\r\n optionsLabel='name'\r\n onChange={onModalChange}\r\n isSearchable={false}\r\n isClearable={false}\r\n defaultValue={selectedDeviceModal}\r\n valueContainerVarient='deviceModalValue'\r\n />\r\n </div>\r\n )}\r\n <div className='row' id={`deviceSpecsSelector${tabIndex}${indexKey}`}>\r\n {storageOptions?.length > 0 && selectedStorage && (\r\n <div className='col-5'>\r\n <ReactInputSelectV2\r\n name='deviceStorage'\r\n content={{ label: '', errorMessage: '' }}\r\n options={storageOptions}\r\n optionsValue='id'\r\n optionsLabel='name'\r\n onChange={onStorageChange}\r\n isSearchable={false}\r\n isClearable={false}\r\n defaultValue={selectedStorage}\r\n updateValue={selectedStorage}\r\n valueContainerVarient='deviceStorageValue'\r\n />\r\n </div>\r\n )}\r\n {colorOptions?.length > 0 && selectedColor && (\r\n <div className='col-7'>\r\n <ReactInputSelectV2\r\n name='deviceColor'\r\n content={{ label: '', errorMessage: '' }}\r\n options={colorOptions}\r\n optionsValue='id'\r\n optionsLabel='name'\r\n onChange={onColorChange}\r\n isSearchable={false}\r\n isClearable={false}\r\n defaultValue={selectedColor}\r\n updateValue={selectedColor}\r\n valueContainerVarient='deviceColorValue'\r\n optionsContainerVarient='deviceColorOptions'\r\n />\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n {discountPrice > 0 && (\r\n <>\r\n <hr />\r\n <div\r\n className={styles.devicePriceContainer}\r\n id={`devicePriceSection${tabIndex}${indexKey}`}\r\n >\r\n <div className={styles.devicePriceSection}>\r\n <img src={mainContent?.discountIcon?.filename} alt='' width={24} height={24} />\r\n <div className={styles.deviceDiscountedPrice}>\r\n {countZero(discountPrice)}\r\n <span className={styles.month}>{mainContent?.contractLabel}</span>\r\n </div>\r\n <div className={styles.deviceBasePrice}>{countZero(basePrice)}</div>\r\n </div>\r\n {productData?.deviceDiscountText?.length > 0 && (\r\n <div className={styles.devicePriceDescription}>\r\n <RichText content={productData?.deviceDiscountText?.[0]?.text} />\r\n {productData?.deviceDiscountText?.[0]?.tooltipTxt && (\r\n <ToolTip\r\n content={\r\n <RichText content={productData?.deviceDiscountText?.[0]?.tooltipTxt} />\r\n }\r\n />\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n )}\r\n <hr />\r\n {/* device avialibility section */}\r\n {availabilityStatus && (\r\n <div\r\n className={styles.deviceAvailability}\r\n id={`deviceAvailSection${tabIndex}${indexKey}`}\r\n >\r\n <img\r\n src={\r\n selectedVarientData?.availabilityStatus === 'NOT_AVAILABLE'\r\n ? mainContent?.notAvailableIcon?.filename\r\n : selectedVarientData?.availabilityStatus &&\r\n availabilityStatus?.availabilityText &&\r\n selectedVarientData?.availabilityStatus !== 'AVAILABLE'\r\n ? mainContent?.delayedAvailableIcon?.filename\r\n : mainContent?.availableIcon?.filename\r\n }\r\n alt=''\r\n width={16}\r\n height={16}\r\n />\r\n {selectedVarientData?.availabilityStatus && availabilityStatus?.availabilityText\r\n ? availabilityStatus?.availabilityText\r\n : availabilityStatus?.defaultAvailabilityText}\r\n </div>\r\n )}\r\n </div>\r\n ) : (\r\n <div className={styles.deviceSection} id={`deviceSectionLoader${tabIndex}${indexKey}`}>\r\n <>\r\n <SkeletonLoader stylename={styles.skeletontittle} count={1} />\r\n <SkeletonLoader stylename={styles.skeletonline} count={5} />\r\n <SkeletonLoader stylename={styles.skeletontittle} count={1} />\r\n <SkeletonLoader stylename={styles.skeletonline} count={5} />\r\n </>\r\n </div>\r\n )}\r\n </>\r\n );\r\n};\r\n\r\nexport default DpTableDeviceSection;\r\n"],"names":["DpTableDeviceSection","productData","mainContent","activeTab","tabIndex","indexKey","cardsLength","deviceModelsList","deviceDetailsList","setDeviceDetails","fetchDeviceDetails","updatedDeviceList","setUpdatedDeviceList","useState","selectedDeviceModal","setSelectedDeviceModal","selectedStorage","setSelectedStorage","selectedColor","setSelectedColor","selectedVarientData","setSelectedVarientData","basePrice","setBasePrice","discountPrice","setDiscountPrice","availabilityStatus","setAvailabilityStatus","deviceDetails","_a","id","storageOptions","setStorageOptions","colorOptions","setColorOptions","colorWithHexCode","setcolorWithHexCode","setDevicePrices","color","memory","varient","varientDetails","deviceVarientsList","availableText","defaultAvailableText","_c","_b","hardwarePrices","smartUpgradeInstallments","monthlyInstallment","_d","value","_g","_f","_j","_h","installments","_k","_o","_m","_p","availabilityDetails","forEach","data","key","availabilityText","defaultAvailabilityText","useEffect","colorCode","reference","content","colorWithCode","_e","colorKey","hexCode","Object","keys","length","deviceReference","body","ignoreDeviceList","tabContainer","ignoreDevices","newDeviceList","filter","items","indexOf","map","products","deviceContent","defaultVariantId","assign","icon","images","filename","defaultModalValue","device","defaultDevice","getOptionsList","defaultMemorySelected","defaultColorSelected","code","updatedStorageList","getCombination","updatedColorOptions","updateColorList","imgURL","selectedImageUrl","selectedVarientDetails","setTimeout","findHeight","window","addEventListener","removeEventListener","newStorageList","newColorList","array","partialKey","matchedArray","list","entries","split","push","getElementMaximumHeight","React","className","styles","deviceSection","createElement","deviceDetailsContainer","deviceModalSelector","ReactInputSelectV2","name","label","errorMessage","options","optionsValue","optionsLabel","onChange","e","isSearchable","isClearable","defaultValue","valueContainerVarient","updateValue","optionsContainerVarient","Fragment","devicePriceContainer","devicePriceSection","src","discountIcon","alt","width","height","deviceDiscountedPrice","countZero","month","contractLabel","deviceBasePrice","deviceDiscountText","devicePriceDescription","RichText","text","tooltipTxt","ToolTip","deviceAvailability","_l","notAvailableIcon","delayedAvailableIcon","availableIcon","SkeletonLoader","stylename","skeletontittle","count","skeletonline"],"mappings":"2bASA,MAAMA,EAAuB,EAC3BC,cACAC,cACAC,YACAC,WACAC,WACAC,cACAC,mBACAC,oBACAC,mBACAC,uDAEA,MAAOC,EAAmBC,GAAwBC,EAAgB,KAC3DC,EAAqBC,GAA0BF,KAC/CG,EAAiBC,GAAsBJ,KACvCK,EAAeC,GAAoBN,KACnCO,EAAqBC,GAA0BR,KAC/CS,EAAWC,GAAgBV,EAAS,IACpCW,EAAeC,GAAoBZ,EAAS,IAC5Ca,EAAoBC,GAAyBd,IAC9Ce,EAA4D,QAA5CC,EAAArB,aAAiB,EAAjBA,EAAoBM,aAAmB,EAAnBA,EAAqBgB,WAAG,IAAAD,GAAAA,GAC3DE,EAAgBC,GAAqBnB,EAAgB,KACrDoB,EAAcC,IAAmBrB,EAAgB,KACjDsB,GAAkBC,IAAuBvB,IAwB1CwB,GAAkB,CAACC,EAAeC,qCACtC,MAAMC,EAAU,GAAGF,K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AaqK,wBAAgB,IAAAD,OAAA,EAAAA,EAAExE,UAC/B1E,aAAmB,EAAnBA,EAAqBM,sBACrBA,aAAkB,EAAlBA,EAAoBuC,mBACwB,eAA5C7C,aAAmB,EAAnBA,EAAqBM,oBACY,QAAjCiC,EAAAzD,eAAAA,EAAasK,4BAAoB,IAAA7G,OAAA,EAAAA,EAAEmC,SACT,UAA1B5F,aAAW,EAAXA,EAAauK,qBAAa,IAAA/G,OAAA,EAAAA,EAAEoC,SAElCyD,IAAI,GACJC,MAAO,GACPC,OAAQ,MAETrI,aAAmB,EAAnBA,EAAqBM,sBAAsBA,aAAkB,EAAlBA,EAAoBuC,kBAC5DvC,aAAkB,EAAlBA,EAAoBuC,iBACpBvC,aAAkB,EAAlBA,EAAoBwC,0BAK9B0D,EAAAI,cAAA,MAAA,CAAKH,UAAWC,EAAOC,cAAejG,GAAI,sBAAsB1B,IAAWC,KACzEuH,EAAAI,cAAAJ,EAAAsB,SAAA,KACEtB,EAAAI,cAAC0C,EAAc,CAACC,UAAW7C,EAAO8C,eAAgBC,MAAO,IACzDjD,EAAAI,cAAC0C,EAAc,CAACC,UAAW7C,EAAOgD,aAAcD,MAAO,IACvDjD,EAAAI,cAAC0C,EAAc,CAACC,UAAW7C,EAAO8C,eAAgBC,MAAO,IACzDjD,EAAAI,cAAC0C,EAAc,CAACC,UAAW7C,EAAOgD,aAAcD,MAAO"}
1
+ {"version":3,"file":"DpTableDeviceSection.js","sources":["../../../../../src/components/UltimateBundleLinetable/DpTableDeviceSection/DpTableDeviceSection.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\r\nimport styles from './DpTableDeviceSection.module.scss';\r\nimport ReactInputSelectV2 from '../../ProductDetailsV3/ReactInputSelectV2/ReactInputSelectV2';\r\nimport RichText from '../../richtext';\r\nimport { countZero, getElementMaximumHeight } from '../../../utils/utils';\r\nimport { getOptionsList } from '../DpTableUtils';\r\nimport SkeletonLoader from '../../SkeletonLoader/SkeletonLoader';\r\nimport ToolTip from '../../ToolTip/ToolTip';\r\n\r\nconst DpTableDeviceSection = ({\r\n productData, //products sb data\r\n mainContent, // whole content\r\n activeTab,\r\n tabIndex,\r\n indexKey, //products index\r\n cardsLength,\r\n deviceModelsList, //list of only device models ex: {id: Apple iphone 16,name: Apple iphone 16}\r\n deviceDetailsList, // All details of specific modal like color, memory and prices\r\n setDeviceDetails, // call back to update the selected device details in dpProduct.tsx\r\n fetchDeviceDetails // call back from dpTabCOntainer to trigger hardwares API call to get model's varient and price details on switch of models\r\n}: any) => {\r\n const [updatedDeviceList, setUpdatedDeviceList] = useState<any[]>([]); //Updated device models list with its respective device images\r\n const [selectedDeviceModal, setSelectedDeviceModal] = useState<any>();\r\n const [selectedStorage, setSelectedStorage] = useState<any>();\r\n const [selectedColor, setSelectedColor] = useState<any>();\r\n const [selectedVarientData, setSelectedVarientData] = useState<any>(); // details of the selected device varient like price and all\r\n const [basePrice, setBasePrice] = useState(0);\r\n const [discountPrice, setDiscountPrice] = useState(0);\r\n const [availabilityStatus, setAvailabilityStatus] = useState<any>();\r\n const deviceDetails = deviceDetailsList?.[selectedDeviceModal?.id] ?? false; //picking details of the selected modal from the whole list\r\n const [storageOptions, setStorageOptions] = useState<any[]>([]);\r\n const [colorOptions, setColorOptions] = useState<any[]>([]);\r\n const [colorWithHexCode, setcolorWithHexCode] = useState<any>();\r\n\r\n const onModalChange = (e: any) => {\r\n if (e?.value) {\r\n setSelectedDeviceModal(e?.value);\r\n }\r\n if (e?.value?.id && e?.value?.id !== selectedDeviceModal?.id) {\r\n fetchDeviceDetails(e?.value?.id, mainContent?.pageType);\r\n }\r\n };\r\n\r\n const onStorageChange = (e: any) => {\r\n if (e?.value) {\r\n setSelectedStorage(e?.value);\r\n }\r\n };\r\n\r\n const onColorChange = (e: any) => {\r\n if (e?.value) {\r\n setSelectedColor(e?.value);\r\n }\r\n };\r\n\r\n // to update the display price based on the varients selected\r\n const setDevicePrices = (color: string, memory: string) => {\r\n const varient = `${color}-${memory}`;\r\n const varientDetails = deviceDetails?.deviceVarientsList?.[varient];\r\n if (varientDetails) {\r\n if (varientDetails?.hardwarePrices?.smartUpgradeInstallments?.monthlyInstallment?.value) {\r\n setDiscountPrice(\r\n varientDetails?.hardwarePrices?.smartUpgradeInstallments?.monthlyInstallment?.value\r\n );\r\n }\r\n if (varientDetails?.hardwarePrices?.installments?.monthlyInstallment?.value) {\r\n setBasePrice(varientDetails?.hardwarePrices?.installments?.monthlyInstallment?.value);\r\n }\r\n let availableText, defaultAvailableText;\r\n (mainContent?.availabilityDetails || [])?.forEach((data: any) => {\r\n if (data?.key === varientDetails?.availabilityStatus) {\r\n availableText = data?.value ?? '';\r\n } else if (data?.key === 'dd_delivery_details') {\r\n defaultAvailableText = data?.value ?? '';\r\n }\r\n });\r\n\r\n if (availableText || defaultAvailableText)\r\n setAvailabilityStatus({\r\n availabilityText: availableText,\r\n defaultAvailabilityText: defaultAvailableText\r\n });\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n if (mainContent?.colorCode?.[0]?.reference?.content?.colorCode) {\r\n const colorWithCode: any = [];\r\n (mainContent?.colorCode?.[0]?.reference?.content?.colorCode || [])?.forEach((color: any) => {\r\n colorWithCode[`${color?.colorKey}`] = color?.hexCode?.color;\r\n });\r\n colorWithCode &&\r\n Object?.keys(colorWithCode)?.length > 0 &&\r\n setcolorWithHexCode(colorWithCode);\r\n }\r\n }, [mainContent]);\r\n\r\n //default selecting the modal once we get the response from device list API\r\n useEffect(() => {\r\n if (\r\n deviceModelsList?.length > 0 &&\r\n mainContent?.deviceReference?.[0]?.reference?.content?.body?.length > 0\r\n ) {\r\n //to hide the selected device from devicemodelist dropdown\r\n const ignoreDeviceList = mainContent?.tabContainer?.[activeTab]?.ignoreDevices ?? \"\";\r\n deviceModelsList = deviceModelsList?.filter(\r\n (items: any) => ignoreDeviceList?.indexOf(items?.id) === -1\r\n );\r\n const newDeviceList = (deviceModelsList || [])?.map((products: any) => {\r\n const deviceContent =\r\n mainContent?.deviceReference?.[0]?.reference?.content?.body?.filter(\r\n (items: any) => items?.defaultVariantId === products?.id\r\n )?.[0] ?? [];\r\n return {\r\n ...products,\r\n icon: deviceContent?.images?.[0]?.filename\r\n };\r\n });\r\n if (newDeviceList?.length > 0) {\r\n setUpdatedDeviceList(newDeviceList);\r\n const defaultModalValue = newDeviceList?.filter(\r\n (device: any) => device?.id === mainContent?.tabContainer?.[activeTab]?.defaultDevice\r\n );\r\n if (defaultModalValue?.length > 0) {\r\n setSelectedDeviceModal(defaultModalValue?.[0]);\r\n }\r\n }\r\n }\r\n }, [deviceModelsList]);\r\n\r\n //to update the default selected color and memory once we get hardware details of selected model\r\n useEffect(() => {\r\n if (deviceDetails && Object.keys(deviceDetails)?.length > 0) {\r\n setSelectedStorage(getOptionsList([deviceDetails?.defaultMemorySelected])?.[0]);\r\n setSelectedColor({\r\n ...getOptionsList([deviceDetails?.defaultColorSelected])?.[0],\r\n code: colorWithHexCode[`${deviceDetails?.defaultColorSelected}`] ?? ''\r\n });\r\n const updatedStorageList = getCombination(\r\n deviceDetails?.deviceVarientsList,\r\n deviceDetails?.defaultColorSelected\r\n );\r\n setStorageOptions(getOptionsList(updatedStorageList));\r\n\r\n const updatedColorOptions = getCombination(\r\n deviceDetails?.deviceVarientsList,\r\n deviceDetails?.defaultMemorySelected\r\n );\r\n const colorsList = getOptionsList(updatedColorOptions);\r\n const updateColorList = (colorsList || [])?.map((color: any) => {\r\n return {\r\n ...color,\r\n code: colorWithHexCode[`${color?.id}`]\r\n };\r\n });\r\n setColorOptions(updateColorList);\r\n setDevicePrices(deviceDetails?.defaultColorSelected, deviceDetails?.defaultMemorySelected);\r\n }\r\n }, [deviceDetailsList, selectedDeviceModal]);\r\n\r\n //call back to update details in dpProduct and updating price on change of color or memory\r\n useEffect(() => {\r\n const imgURL = (updatedDeviceList || [])?.filter(\r\n (device: any) => device?.id === selectedDeviceModal?.id\r\n );\r\n if (selectedColor && selectedStorage) {\r\n const varient = `${selectedColor?.id}-${selectedStorage?.id}`;\r\n const varientDetails = deviceDetails?.deviceVarientsList?.[varient];\r\n setSelectedVarientData(varientDetails);\r\n setDevicePrices(selectedColor?.id, selectedStorage?.id);\r\n setDeviceDetails({\r\n selectedDeviceModal: selectedDeviceModal?.id,\r\n selectedColor: selectedColor?.id,\r\n selectedStorage: selectedStorage?.id,\r\n selectedImageUrl: imgURL?.[0]?.icon ?? '',\r\n selectedVarientDetails: varientDetails\r\n });\r\n }\r\n setTimeout(() => {\r\n findHeight();\r\n }, 100);\r\n window?.addEventListener('load', findHeight);\r\n window?.addEventListener('resize', findHeight);\r\n return () => {\r\n window.removeEventListener('resize', findHeight);\r\n window.removeEventListener('load', findHeight);\r\n };\r\n }, [selectedColor, selectedStorage]);\r\n\r\n useEffect(() => {\r\n if (deviceDetails?.deviceVarientsList) {\r\n const newStorageList = getCombination(deviceDetails?.deviceVarientsList, selectedColor?.id);\r\n if (newStorageList?.length > 0) {\r\n setStorageOptions(getOptionsList(newStorageList));\r\n }\r\n }\r\n }, [selectedColor]);\r\n\r\n useEffect(() => {\r\n if (deviceDetails?.deviceVarientsList) {\r\n const newColorList = getCombination(deviceDetails?.deviceVarientsList, selectedStorage?.id);\r\n const colorsList = getOptionsList(newColorList);\r\n const updateColorList = (colorsList || [])?.map((color: any) => {\r\n return {\r\n ...color,\r\n code: colorWithHexCode[`${color?.id}`]\r\n };\r\n });\r\n if (newColorList?.length > 0) {\r\n setColorOptions(updateColorList);\r\n }\r\n }\r\n }, [selectedStorage]);\r\n\r\n const getCombination = (array: any, partialKey: any) => {\r\n const matchedArray: any = [];\r\n const list = array && Object?.entries(array);\r\n list?.forEach((key: any) => {\r\n const keys = key?.[0]?.split('-');\r\n if (keys?.[0] === partialKey) {\r\n matchedArray.push(keys?.[1]);\r\n } else if (keys?.[1] === partialKey) {\r\n matchedArray.push(keys?.[0]);\r\n }\r\n });\r\n return matchedArray;\r\n };\r\n\r\n const findHeight = () => {\r\n getElementMaximumHeight(`deviceSection${tabIndex}`, cardsLength);\r\n getElementMaximumHeight(`deviceDetailsSection${tabIndex}`, cardsLength);\r\n getElementMaximumHeight(`devicePriceSection${tabIndex}`, cardsLength);\r\n getElementMaximumHeight(`deviceAvailSection${tabIndex}`, cardsLength);\r\n getElementMaximumHeight(`deviceSectionLoader${tabIndex}`, cardsLength);\r\n getElementMaximumHeight(`deviceModalSelector${tabIndex}`, cardsLength);\r\n getElementMaximumHeight(`deviceSpecsSelector${tabIndex}`, cardsLength);\r\n };\r\n\r\n return (\r\n <>\r\n {updatedDeviceList?.length > 0 && deviceDetails && Object.keys(deviceDetails)?.length > 0 ? (\r\n <div className={styles.deviceSection} id={`deviceSection${tabIndex}${indexKey}`}>\r\n <div\r\n className={styles.deviceDetailsContainer}\r\n id={`deviceDetailsSection${tabIndex}${indexKey}`}\r\n >\r\n {updatedDeviceList?.length > 0 && (\r\n <div\r\n className={styles.deviceModalSelector}\r\n id={`deviceModalSelector${tabIndex}${indexKey}`}\r\n >\r\n <ReactInputSelectV2\r\n name='deviceModal'\r\n content={{ label: '', errorMessage: '' }}\r\n options={updatedDeviceList}\r\n optionsValue='id'\r\n optionsLabel='name'\r\n onChange={onModalChange}\r\n isSearchable={false}\r\n isClearable={false}\r\n defaultValue={selectedDeviceModal}\r\n valueContainerVarient='deviceModalValue'\r\n />\r\n </div>\r\n )}\r\n <div className='row' id={`deviceSpecsSelector${tabIndex}${indexKey}`}>\r\n {storageOptions?.length > 0 && selectedStorage && (\r\n <div className='col-5'>\r\n <ReactInputSelectV2\r\n name='deviceStorage'\r\n content={{ label: '', errorMessage: '' }}\r\n options={storageOptions}\r\n optionsValue='id'\r\n optionsLabel='name'\r\n onChange={onStorageChange}\r\n isSearchable={false}\r\n isClearable={false}\r\n defaultValue={selectedStorage}\r\n updateValue={selectedStorage}\r\n valueContainerVarient='deviceStorageValue'\r\n />\r\n </div>\r\n )}\r\n {colorOptions?.length > 0 && selectedColor && (\r\n <div className='col-7'>\r\n <ReactInputSelectV2\r\n name='deviceColor'\r\n content={{ label: '', errorMessage: '' }}\r\n options={colorOptions}\r\n optionsValue='id'\r\n optionsLabel='name'\r\n onChange={onColorChange}\r\n isSearchable={false}\r\n isClearable={false}\r\n defaultValue={selectedColor}\r\n updateValue={selectedColor}\r\n valueContainerVarient='deviceColorValue'\r\n optionsContainerVarient='deviceColorOptions'\r\n />\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n {discountPrice > 0 && (\r\n <>\r\n <hr />\r\n <div\r\n className={styles.devicePriceContainer}\r\n id={`devicePriceSection${tabIndex}${indexKey}`}\r\n >\r\n <div className={styles.devicePriceSection}>\r\n <img src={mainContent?.discountIcon?.filename} alt='' width={24} height={24} />\r\n <div className={styles.deviceDiscountedPrice}>\r\n {countZero(discountPrice)}\r\n <span className={styles.month}>{mainContent?.contractLabel}</span>\r\n </div>\r\n <div className={styles.deviceBasePrice}>{countZero(basePrice)}</div>\r\n </div>\r\n {productData?.deviceDiscountText?.length > 0 && (\r\n <div className={styles.devicePriceDescription}>\r\n <RichText content={productData?.deviceDiscountText?.[0]?.text} />\r\n {productData?.deviceDiscountText?.[0]?.tooltipTxt && (\r\n <ToolTip\r\n content={\r\n <RichText content={productData?.deviceDiscountText?.[0]?.tooltipTxt} />\r\n }\r\n />\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n )}\r\n <hr />\r\n {/* device avialibility section */}\r\n {availabilityStatus && (\r\n <div\r\n className={styles.deviceAvailability}\r\n id={`deviceAvailSection${tabIndex}${indexKey}`}\r\n >\r\n <img\r\n src={\r\n selectedVarientData?.availabilityStatus === 'NOT_AVAILABLE'\r\n ? mainContent?.notAvailableIcon?.filename\r\n : selectedVarientData?.availabilityStatus &&\r\n availabilityStatus?.availabilityText &&\r\n selectedVarientData?.availabilityStatus !== 'AVAILABLE'\r\n ? mainContent?.delayedAvailableIcon?.filename\r\n : mainContent?.availableIcon?.filename\r\n }\r\n alt=''\r\n width={16}\r\n height={16}\r\n />\r\n {selectedVarientData?.availabilityStatus && availabilityStatus?.availabilityText\r\n ? availabilityStatus?.availabilityText\r\n : availabilityStatus?.defaultAvailabilityText}\r\n </div>\r\n )}\r\n </div>\r\n ) : (\r\n <div className={styles.deviceSection} id={`deviceSectionLoader${tabIndex}${indexKey}`}>\r\n <>\r\n <SkeletonLoader stylename={styles.skeletontittle} count={1} />\r\n <SkeletonLoader stylename={styles.skeletonline} count={5} />\r\n <SkeletonLoader stylename={styles.skeletontittle} count={1} />\r\n <SkeletonLoader stylename={styles.skeletonline} count={5} />\r\n </>\r\n </div>\r\n )}\r\n </>\r\n );\r\n};\r\n\r\nexport default DpTableDeviceSection;\r\n"],"names":["DpTableDeviceSection","productData","mainContent","activeTab","tabIndex","indexKey","cardsLength","deviceModelsList","deviceDetailsList","setDeviceDetails","fetchDeviceDetails","updatedDeviceList","setUpdatedDeviceList","useState","selectedDeviceModal","setSelectedDeviceModal","selectedStorage","setSelectedStorage","selectedColor","setSelectedColor","selectedVarientData","setSelectedVarientData","basePrice","setBasePrice","discountPrice","setDiscountPrice","availabilityStatus","setAvailabilityStatus","deviceDetails","_a","id","storageOptions","setStorageOptions","colorOptions","setColorOptions","colorWithHexCode","setcolorWithHexCode","setDevicePrices","color","memory","varient","varientDetails","deviceVarientsList","availableText","defaultAvailableText","_c","_b","hardwarePrices","smartUpgradeInstallments","monthlyInstallment","_d","value","_g","_f","_j","_h","installments","_k","_o","_m","_p","availabilityDetails","forEach","data","key","availabilityText","defaultAvailabilityText","useEffect","colorCode","reference","content","colorWithCode","_e","colorKey","hexCode","Object","keys","length","deviceReference","body","ignoreDeviceList","tabContainer","ignoreDevices","newDeviceList","filter","items","indexOf","map","products","deviceContent","defaultVariantId","assign","icon","images","filename","defaultModalValue","device","defaultDevice","getOptionsList","defaultMemorySelected","defaultColorSelected","code","updatedStorageList","getCombination","updatedColorOptions","updateColorList","imgURL","selectedImageUrl","selectedVarientDetails","setTimeout","findHeight","window","addEventListener","removeEventListener","newStorageList","newColorList","array","partialKey","matchedArray","list","entries","split","push","getElementMaximumHeight","React","className","styles","deviceSection","createElement","deviceDetailsContainer","deviceModalSelector","ReactInputSelectV2","name","label","errorMessage","options","optionsValue","optionsLabel","onChange","e","pageType","isSearchable","isClearable","defaultValue","valueContainerVarient","updateValue","optionsContainerVarient","Fragment","devicePriceContainer","devicePriceSection","src","discountIcon","alt","width","height","deviceDiscountedPrice","countZero","month","contractLabel","deviceBasePrice","deviceDiscountText","devicePriceDescription","RichText","text","tooltipTxt","ToolTip","deviceAvailability","_l","notAvailableIcon","delayedAvailableIcon","availableIcon","SkeletonLoader","stylename","skeletontittle","count","skeletonline"],"mappings":"2bASA,MAAMA,EAAuB,EAC3BC,cACAC,cACAC,YACAC,WACAC,WACAC,cACAC,mBACAC,oBACAC,mBACAC,uDAEA,MAAOC,EAAmBC,GAAwBC,EAAgB,KAC3DC,EAAqBC,GAA0BF,KAC/CG,EAAiBC,GAAsBJ,KACvCK,EAAeC,GAAoBN,KACnCO,EAAqBC,GAA0BR,KAC/CS,EAAWC,GAAgBV,EAAS,IACpCW,EAAeC,GAAoBZ,EAAS,IAC5Ca,EAAoBC,GAAyBd,IAC9Ce,EAA4D,QAA5CC,EAAArB,aAAiB,EAAjBA,EAAoBM,aAAmB,EAAnBA,EAAqBgB,WAAG,IAAAD,GAAAA,GAC3DE,EAAgBC,GAAqBnB,EAAgB,KACrDoB,EAAcC,IAAmBrB,EAAgB,KACjDsB,GAAkBC,IAAuBvB,IAwB1CwB,GAAkB,CAACC,EAAeC,qCACtC,MAAMC,EAAU,GAAGF,KAASC,IACtBE,EAAkD,QAAjCZ,EAAAD,aAAa,EAAbA,EAAec,0BAAkB,IAAAb,OAAA,EAAAA,EAAGW,GAC3D,GAAIC,EAAgB,CASlB,IAAIE,EAAeC,GAR6D,UAApB,QAAxDC,UAAAC,EAAAL,aAAc,EAAdA,EAAgBM,qCAAgBC,gCAAwB,IAAAH,OAAA,EAAAA,EAAEI,0BAAkB,IAAAC,OAAA,EAAAA,EAAEC,QAChF1B,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K,qBAAa,IAAAhH,OAAA,EAAAA,EAAEoC,SAElC0D,IAAI,GACJC,MAAO,GACPC,OAAQ,MAETtI,aAAmB,EAAnBA,EAAqBM,sBAAsBA,aAAkB,EAAlBA,EAAoBuC,kBAC5DvC,aAAkB,EAAlBA,EAAoBuC,iBACpBvC,aAAkB,EAAlBA,EAAoBwC,0BAK9B0D,EAAAI,cAAA,MAAA,CAAKH,UAAWC,EAAOC,cAAejG,GAAI,sBAAsB1B,IAAWC,KACzEuH,EAAAI,cAAAJ,EAAAuB,SAAA,KACEvB,EAAAI,cAAC2C,EAAc,CAACC,UAAW9C,EAAO+C,eAAgBC,MAAO,IACzDlD,EAAAI,cAAC2C,EAAc,CAACC,UAAW9C,EAAOiD,aAAcD,MAAO,IACvDlD,EAAAI,cAAC2C,EAAc,CAACC,UAAW9C,EAAO+C,eAAgBC,MAAO,IACzDlD,EAAAI,cAAC2C,EAAc,CAACC,UAAW9C,EAAOiD,aAAcD,MAAO"}
@@ -1 +1 @@
1
- .card_G6N3b.sr-card_79oCF{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}.card_G6N3b.border-top_V2zp5{border-top-left-radius:16px;border-top-right-radius:16px;box-shadow:0 -2px 20px 0 rgba(61,57,53,.2);border:none}@media (min-width:768px){.sr-desk-card_KSJOc{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}@media (max-width:767px){.sr-mob-card_DfJ-i{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}@media (min-width:1024px){.sr-md-card_4trTA{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}.login-container_Ad6KQ{align-items:center;background-color:#fff;box-shadow:-1px 18px 25px 5px rgba(87,84,82,.4);display:flex;flex-direction:column;justify-content:center;max-width:624px;padding:24px 32px;position:absolute;width:100%;border-radius:4px}@media (max-width:767px){.login-container_Ad6KQ{padding:16px}}.login-header_hzlgu{width:100%;margin-bottom:24px;display:flex;justify-content:space-between}.login-header_hzlgu img,.login-header_hzlgu span{cursor:pointer}.icon-container_FGJQU{width:24px;height:24px}.back-text_MKh1u{font-weight:700;font-size:16px;line-height:24px;color:#da291c;padding-left:4px}.channel-selection-title_0iFVE{font-weight:700;line-height:36px;font-size:28px;text-align:center;margin-bottom:24px}.channel-selection-description_MFGOM{font-size:16px;font-weight:400;line-height:24px;text-align:left;color:#333;margin-bottom:24px}.btn-primary_9w79K{background:#d9415c;border:none;border-radius:28px;color:#fff;font-weight:700;overflow:visible;padding:14px 24px}.btn-primary_9w79K:disabled{background-color:#e6e3df;color:#b3aeaa;cursor:default}@media (max-width:767px){.btn-primary_9w79K{padding:10px 24px}}.errorMsg_pDhM4{color:#bf0760;display:flex;font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px}.resend_DQ50C{font-size:16px;font-weight:700;line-height:24px;text-align:center;color:#3d3935}.loginmodal_XhQt-{align-items:center;background-color:rgba(87,84,82,.4);font-size:16px;line-height:24px;color:#333;display:flex;height:100%;justify-content:center;left:0;padding:16px;position:fixed;top:0;transition:opacity 3s;width:100%;z-index:11}.loginmodal_XhQt- input{background:#f7f6f5!important}.loginmodal_XhQt- input:focus{border:2px solid #3d3935!important;border-radius:4px}.loginmodal_XhQt- input:disabled{background:#e6e3df!important}.loginmodal_XhQt- input.inputSuccess_dK7Uz{border-color:#8fd200!important;box-shadow:0 0 0 1px #8fd200!important}.loginmodal_XhQt- input::-webkit-inner-spin-button,.loginmodal_XhQt- input::-webkit-outer-spin-button{-webkit-appearance:none!important;margin:0!important}.loginmodal_XhQt- input[type=number]{-moz-appearance:textfield!important}.iconcontainer_QpoFB{bottom:14px;position:absolute;right:12.25px}.logintitle_bnFYd{font-size:24px;font-weight:700;line-height:32px;text-align:center;width:100%}.formControl_hBGQP{border:none;padding:14px 0}.formControl_hBGQP::-ms-reveal{display:none}.formControl_hBGQP:focus,.formControl_hBGQP:not(:placeholder-shown){border-color:#000;box-shadow:none}.loginmodalLabel_gakRq{overflow:hidden;right:0;text-overflow:ellipsis;white-space:nowrap}.confirmbtn_woa5L{height:52px;width:150px}.horizontalline_ew-1o{border:1px solid #e5e5e5;margin:25px 0;width:70%}.infotooltip_e3Al0{font-size:12px;line-height:1.33;margin-top:4px}.eyeicon_XTxJn{display:inline-block;height:24px;margin-left:8px;width:24px}.credentialerror_T9TK0{color:#bf0760;display:flex;font-size:12px;font-weight:400;height:32px;line-height:16px;margin-top:4px;position:absolute;top:52px}.tempcode_rzrt5{font-size:16px;font-style:normal;font-weight:700;line-height:24px;padding:16px 0 0}.warningicon_3HIvk{content:"";display:inline-block;height:16px;margin-right:4px;margin-top:2px;width:16px}.blockedcontent_OQn79{background:#f9e7f0;border:1.5px solid #bf0760;border-radius:8px}.blockedcontent_OQn79,.warningcontent_KzTOC{align-items:flex-start;display:flex;flex-direction:column;height:120px;justify-content:center;padding:16px 16px 8px}.warningcontent_KzTOC{background:#fffae6;border:1.5px solid #ffc805;border-radius:8px}.technicalerror_n3C0N{height:90px}.updatedetails_DHwPR{color:#da291c;cursor:pointer;margin:0 5px;text-decoration:underline}.loginmodalrem_GKQDm{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;cursor:pointer;display:block;font-weight:700;padding-left:28px;position:relative;text-align:left;user-select:none}.loginmodalrem_GKQDm input{cursor:pointer;height:0;opacity:0;position:absolute;width:0}.loginmodalrem_GKQDm input:checked~.checkmark_XKH5n{background-color:#da291c;border:2px solid #da291c}.loginmodalrem_GKQDm input:checked~.checkmark_XKH5n:after{display:block}.loginmodalrem_GKQDm .checkmark_XKH5n{border:2px solid #5f5955;border-radius:4px;height:20px;left:0;position:absolute;top:2px;width:20px}.loginmodalrem_GKQDm .checkmark_XKH5n:after{-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);border:solid #fff;border-width:0 3px 3px 0;height:10px;left:5px;top:2px;transform:rotate(45deg);width:5px}
1
+ .card_G6N3b.sr-card_79oCF{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}.card_G6N3b.border-top_V2zp5{border-top-left-radius:16px;border-top-right-radius:16px;box-shadow:0 -2px 20px 0 rgba(61,57,53,.2);border:none}@media (min-width:768px){.sr-desk-card_KSJOc{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}@media (max-width:767px){.sr-mob-card_DfJ-i{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}@media (min-width:1024px){.sr-md-card_4trTA{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}.login-container_Ad6KQ{align-items:center;background-color:#fff;box-shadow:-1px 18px 25px 5px rgba(87,84,82,.4);display:flex;flex-direction:column;justify-content:center;max-width:624px;padding:24px 32px;position:absolute;width:100%;border-radius:4px}@media (max-width:767px){.login-container_Ad6KQ{padding:16px}}.login-header_hzlgu{width:100%;margin-bottom:24px;display:flex;justify-content:space-between}.login-header_hzlgu img,.login-header_hzlgu span{cursor:pointer}.icon-container_FGJQU{width:24px;height:24px}.back-text_MKh1u{font-weight:700;font-size:16px;line-height:24px;color:#da291c;padding-left:4px}.channel-selection-title_0iFVE{font-weight:700;line-height:36px;font-size:28px;text-align:center;margin-bottom:24px}.channel-selection-description_MFGOM{font-size:16px;font-weight:400;line-height:24px;text-align:left;color:#333;margin-bottom:24px}.btn-primary_9w79K{background:#d9415c;border:none;border-radius:28px;color:#fff;font-weight:700;overflow:visible;padding:14px 24px}.btn-primary_9w79K:disabled{background-color:#e6e3df;color:#b3aeaa;cursor:default}@media (max-width:767px){.btn-primary_9w79K{padding:10px 24px}}.errorMsg_pDhM4{color:#bf0760;display:flex;font-size:12px;font-weight:400;line-height:16px;margin-bottom:4px}.resend_DQ50C{font-size:16px;font-weight:700;line-height:24px;text-align:center;color:#3d3935}.loginmodal_XhQt-{align-items:center;background-color:rgba(87,84,82,.4);font-size:16px;line-height:24px;color:#333;display:flex;height:100%;justify-content:center;left:0;padding:16px;position:fixed;top:0;transition:opacity 3s;width:100%;z-index:11}.loginmodal_XhQt- input{background:#f7f6f5!important}.loginmodal_XhQt- input:focus{border:2px solid #3d3935!important;border-radius:4px}.loginmodal_XhQt- input:disabled{background:#e6e3df!important}.loginmodal_XhQt- input.inputSuccess_dK7Uz{border-color:#8fd200!important;box-shadow:0 0 0 1px #8fd200!important}.loginmodal_XhQt- input::-webkit-inner-spin-button,.loginmodal_XhQt- input::-webkit-outer-spin-button{-webkit-appearance:none!important;margin:0!important}.loginmodal_XhQt- input[type=number]{-moz-appearance:textfield!important}.iconcontainer_QpoFB{bottom:14px;position:absolute;right:12.25px}.logintitle_bnFYd{font-size:24px;font-weight:700;line-height:32px;text-align:center;width:100%}.formControl_hBGQP{border:none;padding:14px 0}.formControl_hBGQP::-ms-reveal{display:none}.formControl_hBGQP:focus,.formControl_hBGQP:not(:placeholder-shown){border-color:#000;box-shadow:none}.loginmodalLabel_gakRq{overflow:hidden;right:0;text-overflow:ellipsis;white-space:nowrap}.confirmbtn_woa5L{height:52px;width:150px}.horizontalline_ew-1o{border:1px solid #e5e5e5;margin:25px 0;width:70%}.infotooltip_e3Al0{font-size:12px;line-height:1.33;margin-top:4px}.eyeicon_XTxJn{display:inline-block;height:24px;margin-left:8px;width:24px}.credentialerror_T9TK0{color:#bf0760;display:flex;font-size:12px;font-weight:400;height:32px;line-height:16px;margin-top:4px;position:absolute;top:52px}.tempcode_rzrt5{font-size:16px;font-style:normal;font-weight:700;line-height:24px;padding:16px 0 0}.warningicon_3HIvk{content:"";display:inline-block;height:16px;margin-right:4px;margin-top:2px;width:16px}.blockedcontent_OQn79{background:#f9e7f0;border:1.5px solid #bf0760}.blockedcontent_OQn79,.warningcontent_KzTOC{align-items:flex-start;border-radius:8px;display:flex;flex-direction:column;height:120px;justify-content:center;padding:16px 16px 8px}.warningcontent_KzTOC{background:#fffae6;border:1.5px solid #ffc805}.technicalerror_n3C0N{height:90px}.updatedetails_DHwPR{color:#da291c;cursor:pointer;margin:0 5px;text-decoration:underline}.loginmodalrem_GKQDm{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;cursor:pointer;display:block;font-weight:700;padding-left:28px;position:relative;text-align:left;user-select:none}.loginmodalrem_GKQDm input{cursor:pointer;height:0;opacity:0;position:absolute;width:0}.loginmodalrem_GKQDm input:checked~.checkmark_XKH5n{background-color:#da291c;border:2px solid #da291c}.loginmodalrem_GKQDm input:checked~.checkmark_XKH5n:after{display:block}.loginmodalrem_GKQDm .checkmark_XKH5n{border:2px solid #5f5955;border-radius:4px;height:20px;left:0;position:absolute;top:2px;width:20px}.loginmodalrem_GKQDm .checkmark_XKH5n:after{-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);border:solid #fff;border-width:0 3px 3px 0;height:10px;left:5px;top:2px;transform:rotate(45deg);width:5px}
@@ -1,2 +1,2 @@
1
- import{__awaiter as o}from"../_virtual/_tslib.js";import{ApiServiceV2 as i,CMSStoryblokServiceV2 as l}from"@sunrise-upc/ajax-lib";import{getCookies as e,getSessionStorage as n,removeLocalStorage as d,getLocalStorageWithExpiry as t,setLocalStoreWithExpiry as v}from"../utils/utils.js";import{APIResourceConstants as r,API_BASE_BASEPOINT as u}from"./api-constants.js";import s from"js-cookie";import{v4 as a}from"uuid";import{ONE_ECOMMERCE_OTT as c,FIXNET as p,TV_SERVICE_OPTION as m,MOBILE as h,PRE_TO_POST as I,P2PSUBSCRIBEDPLAN as f,QOQA as y,VOUCHERTYPE as T,VOUCHERCODE as g,HARDWARE as A,DEVICE_INSURANCE as E}from"../utils/constants.js";import{getAccessDataFromLineCheck as S}from"../components/lineTable/LineTableV3.utils.js";import{LineTableBasicPropConfig as C}from"./LineTableBasicPropConfig.js";import{errorTrackingDataLayer as _}from"../utils/AnalyticsUtils.js";import{apiResConstants as L}from"../components/LineCheckV3/APIResourceConstants.js";import{getDeviceNotes as x}from"../components/UltimateBundleLinetable/DpTableUtils.js";import{fetchOttItems as N}from"../components/StaticLineTable/Product.utils.js";let P=void 0!==typeof window&&s.get("sunriseAuth");P=P&&JSON.parse(P);const O=(i,e,n,d)=>o(void 0,void 0,void 0,function*(){var o;const r=t(`${i}_${e}_countryData`);if(r)return r;try{const t={language:e,type:"B2C"},r=null===(o=(yield l.get(n,t)).data)||void 0===o?void 0:o.stories;return r&&r.length>0&&v(`${i}_${e}_countryData`,r,d),r}catch(o){return console.error(o),o}}),w=(l,e,n)=>o(void 0,void 0,void 0,function*(){var o,d,t;try{localStorage.removeItem("entertainment");const o={headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL},params:{}};n&&(o.params={returnPromo:!0});const d=e+r.LINE_TABLEV2,t=yield i.getApiServiceInstance().post(d,l,o).then(o=>{if(200==o.status)return null==o?void 0:o.data});if(t.error)return t.error;{const o=[];return null==t||t.forEach(i=>{o[i.id]=i}),o}}catch(i){((null===(d=null===(o=null==i?void 0:i.response)||void 0===o?void 0:o.data)||void 0===d?void 0:d.code)||504===(null===(t=null==i?void 0:i.response)||void 0===t?void 0:t.status))&&_(null==i?void 0:i.response),console.log("error---\x3e",i)}}),b=(l,t,v,u,C,L,P,O,w,...b)=>o(void 0,[l,t,v,u,C,L,P,O,w,...b],void 0,function*(o,l,t,v,u,C,L,P,O,w="",b,R,U,B,H){var j,V,k,D,G,$,M,F,X,J,W,K,q,z,Q,Y,Z,oo,io,lo,eo,no,to,vo,ro,uo,so,ao,co,po,mo,ho,Io,fo,yo,To,go,Ao,Eo,So,Co,_o,Lo,xo,No,Po,Oo,wo,bo,Ro,Uo,Bo,Ho,jo,Vo,ko,Do,Go;let $o={};const Mo=n(c);if(u===p){let i="",n="";const d=null!==(j=s.get("one-commerce-linecheckcorrelationid"))&&void 0!==j?j:"",v=S(null===(V=null==o?void 0:o[0])||void 0===V?void 0:V.id);$o={relatedParty:[{id:"anonymous",segment:"RESIDENTIAL"}],cartItem:[{itemType:"HOME",promotionId:t,items:[],note:[{author:"linecheckCorrelationId",text:d}]}]};const r={itemType:"MOBILE",promotionId:t,items:[]};if(null===(k=o[0])||void 0===k?void 0:k.isBundle)null===(G=null===(D=o[0])||void 0===D?void 0:D.bundledOffers)||void 0===G||G.map(o=>{var e,d,t,v,u,s,a,c,p,m,h,I,f,y,T,g,A,E,S;if(null===(d=null===(e=null==o?void 0:o.promotionInfo)||void 0===e?void 0:e[0])||void 0===d?void 0:d.id){const l=1==(null===(a=null===(s=null===(u=null===(v=null===(t=null==o?void 0:o.promotionInfo)||void 0===t?void 0:t[0])||void 0===v?void 0:v.hardwareGift)||void 0===u?void 0:u[0])||void 0===s?void 0:s.ids)||void 0===a?void 0:a.length)?null===(I=null===(h=null===(m=null===(p=null===(c=null==o?void 0:o.promotionInfo)||void 0===c?void 0:c[0])||void 0===p?void 0:p.hardwareGift)||void 0===m?void 0:m[0])||void 0===h?void 0:h.ids)||void 0===I?void 0:I[0]:"";"mobile"===(null===(f=null==o?void 0:o.productType)||void 0===f?void 0:f.toLowerCase())?(r.promotionId=null===(T=null===(y=null==o?void 0:o.promotionInfo)||void 0===y?void 0:y[0])||void 0===T?void 0:T.id,i=l):($o.cartItem[0].promotionId=null===(A=null===(g=null==o?void 0:o.promotionInfo)||void 0===g?void 0:g[0])||void 0===A?void 0:A.id,n=l)}"tv"==(null===(E=null==o?void 0:o.productType)||void 0===E?void 0:E.toLowerCase())&&l?$o.cartItem[0].items.push({itemType:null==o?void 0:o.productType,id:l}):"mobile"===(null===(S=null==o?void 0:o.productType)||void 0===S?void 0:S.toLowerCase())?r.items.push({itemType:"RATEPLAN",id:null==o?void 0:o.id}):$o.cartItem[0].items.push({itemType:null==o?void 0:o.productType,id:null==o?void 0:o.id})}),n&&(null===($=$o.cartItem[0].items)||void 0===$||$.push({itemType:"GIFT",id:n})),i&&r.items.push({itemType:"GIFT",id:i}),(null===(M=null==r?void 0:r.items)||void 0===M?void 0:M.length)>0&&(null===(F=null==$o?void 0:$o.cartItem)||void 0===F||F.push(r)),(null==R?void 0:R.length)>0&&(null==R||R.forEach(o=>{$o.cartItem[0].items.push({itemType:m,id:null==o?void 0:o.id})}));else{const i=1==(null===(z=null===(q=null===(K=null===(W=null===(J=null===(X=null==o?void 0:o[0])||void 0===X?void 0:X.promotionInfo)||void 0===J?void 0:J[0])||void 0===W?void 0:W.hardwareGift)||void 0===K?void 0:K[0])||void 0===q?void 0:q.ids)||void 0===z?void 0:z.length)?null===(lo=null===(io=null===(oo=null===(Z=null===(Y=null===(Q=null==o?void 0:o[0])||void 0===Q?void 0:Q.promotionInfo)||void 0===Y?void 0:Y[0])||void 0===Z?void 0:Z.hardwareGift)||void 0===oo?void 0:oo[0])||void 0===io?void 0:io.ids)||void 0===lo?void 0:lo[0]:"";$o.cartItem[0].items.push({itemType:null===(eo=null==o?void 0:o[0])||void 0===eo?void 0:eo.productType,id:null===(no=null==o?void 0:o[0])||void 0===no?void 0:no.id}),i&&(null===(to=$o.cartItem[0].items)||void 0===to||to.push({itemType:"GIFT",id:i}))}C&&(null==C?void 0:C.length)>0&&(null==C||C.map(o=>{var i,l,e,n;"HOME"===(null==o?void 0:o.parentPoType)?null===(e=null===(l=null===(i=null==$o?void 0:$o.cartItem)||void 0===i?void 0:i[0])||void 0===l?void 0:l.items)||void 0===e||e.push({itemType:"GIFT",id:null==o?void 0:o.tuaProdId}):null===(n=r.items)||void 0===n||n.push({itemType:"GIFT",id:null==o?void 0:o.tuaProdId})})),(null==v?void 0:v.accessType)&&(null===(uo=null===(ro=null===(vo=null==$o?void 0:$o.cartItem)||void 0===vo?void 0:vo[0])||void 0===ro?void 0:ro.note)||void 0===uo||uo.push({author:"lineCheckaccessType",text:null==v?void 0:v.accessType})),(null==v?void 0:v.timeSlot)&&(null===(co=null===(ao=null===(so=null==$o?void 0:$o.cartItem)||void 0===so?void 0:so[0])||void 0===ao?void 0:ao.note)||void 0===co||co.push({author:"lineCheckEarliestActivationDate",text:null===(po=null==v?void 0:v.timeSlot)||void 0===po?void 0:po.start}));try{const o=e("chAddressJson"),i=[{characteristic:{installationAddress:!0,country:"CH",city:null===(mo=null==o?void 0:o.selectedAdd)||void 0===mo?void 0:mo.city,street1:null===(ho=null==o?void 0:o.selectedAdd)||void 0===ho?void 0:ho.street,postCode:null===(Io=null==o?void 0:o.selectedAdd)||void 0===Io?void 0:Io.postCode,street2:null===(fo=null==o?void 0:o.selectedAdd)||void 0===fo?void 0:fo.houseNumber}}];$o.contactMedium=i}catch(o){console.log("issue at line check address addition in create cart ==>",o)}}else if(u===h){$o=L?{relatedParty:[{segment:"RESIDENTIAL"}],cartItem:[{itemType:"MOBILE",promotionId:t,items:[{itemType:"RATEPLAN",id:(null===(yo=null==o?void 0:o[0])||void 0===yo?void 0:yo.id)?null===(To=null==o?void 0:o[0])||void 0===To?void 0:To.id:o,subscribedInfo:{installedPlan:f,id:P}}],processType:{id:I}}]}:{relatedParty:[{segment:"RESIDENTIAL"}],cartItem:[{itemType:"MOBILE",promotionId:t,items:[{itemType:"RATEPLAN",id:(null===(go=null==o?void 0:o[0])||void 0===go?void 0:go.id)?null===(Ao=null==o?void 0:o[0])||void 0===Ao?void 0:Ao.id:o,clientDiscountInfo:U?[{discountRef:U,discountType:"DISCOUNT"}]:void 0}]}]};const i=1==(null===(xo=null===(Lo=null===(_o=null===(Co=null===(So=null===(Eo=null==o?void 0:o[0])||void 0===Eo?void 0:Eo.promotionInfo)||void 0===So?void 0:So[0])||void 0===Co?void 0:Co.hardwareGift)||void 0===_o?void 0:_o[0])||void 0===Lo?void 0:Lo.ids)||void 0===xo?void 0:xo.length)?null===(Ro=null===(bo=null===(wo=null===(Oo=null===(Po=null===(No=null==o?void 0:o[0])||void 0===No?void 0:No.promotionInfo)||void 0===Po?void 0:Po[0])||void 0===Oo?void 0:Oo.hardwareGift)||void 0===wo?void 0:wo[0])||void 0===bo?void 0:bo.ids)||void 0===Ro?void 0:Ro[0]:"";i&&(null===(Uo=$o.cartItem[0].items)||void 0===Uo||Uo.push({itemType:"GIFT",id:i})),C&&(null==C?void 0:C.length)>0&&(null==C||C.map(o=>{var i,l,e;"HOME"!==(null==o?void 0:o.parentPoType)&&(null===(e=null===(l=null===(i=null==$o?void 0:$o.cartItem)||void 0===i?void 0:i[0])||void 0===l?void 0:l.items)||void 0===e||e.push({itemType:"GIFT",id:null==o?void 0:o.tuaProdId}))}))}if(O){const o=[];o.push({author:T,text:y}),""!==w&&(o.push({author:g,text:w}),d("vctype")),$o.cartItem[0].note=o}else if(U&&B){const o=[];null==o||o.push({author:"offerType",text:"ATL"}),null==o||o.push({author:"externalPromotionName",text:U}),null==o||o.push({author:"offerVersion",text:B}),$o.cartItem[0].note=o}if(H&&(null===(Bo=null==$o?void 0:$o.cartItem)||void 0===Bo?void 0:Bo[0])){const{pointsBurnt:o,rewardOfferId:i,gloxTokenId:l}=H;l&&($o.guid=l);const e=[null!=o&&""!=`${o}`&&{author:"pointsBurnt",text:`${o}`},null!=i&&""!=`${i}`&&{author:"rewardOfferId",text:`${i}`}].filter(Boolean);e.length>0&&(null===(Ho=null==$o?void 0:$o.cartItem)||void 0===Ho||Ho.forEach(o=>{Array.isArray(null==o?void 0:o.items)&&o.items.forEach(o=>{const i=`${(null==o?void 0:o.itemType)||""}`.toUpperCase();"RATEPLAN"!==i&&"INTERNET"!==i||(o.note=[...o.note||[],...e])})}))}if(b){const o=(o=>{var i,l,e,n,d,t,v,r,u,s,a,c,p,m,h,I;let f=[];const y=null!==(n=null===(e=null===(l=null===(i=null==o?void 0:o.selectedVarientDetails)||void 0===i?void 0:i.hardwarePrices)||void 0===l?void 0:l.smartUpgradeInstallments)||void 0===e?void 0:e.duration)&&void 0!==n?n:0,T=null!==(u=null===(r=null===(v=null===(t=null===(d=null==o?void 0:o.selectedVarientDetails)||void 0===d?void 0:d.hardwarePrices)||void 0===t?void 0:t.smartUpgradeInstallments)||void 0===v?void 0:v.upFrontPayment)||void 0===r?void 0:r.value)&&void 0!==u?u:0,g=null!==(m=null===(p=null===(c=null===(a=null===(s=null==o?void 0:o.selectedVarientDetails)||void 0===s?void 0:s.hardwarePrices)||void 0===a?void 0:a.smartUpgradeInstallments)||void 0===c?void 0:c.insurance)||void 0===p?void 0:p.value)&&void 0!==m?m:0,S={itemType:A,id:null!==(I=null===(h=null==o?void 0:o.selectedVarientDetails)||void 0===h?void 0:h.id)&&void 0!==I?I:"",contractTerm:y,note:x(o,T)};if(S&&(null==f||f.push(S)),g){const i={itemType:E,id:null==o?void 0:o.insuranceName};null==f||f.push(i)}return(null==f?void 0:f.length)>0?f:null})(b);o&&(null===(ko=null===(Vo=null===(jo=null==$o?void 0:$o.cartItem)||void 0===jo?void 0:jo[0])||void 0===Vo?void 0:Vo.items)||void 0===ko||ko.push(...o))}let Fo=null;if("undefined"!=typeof window){Fo=new URLSearchParams(window.location.search).get("flow")}if(Mo&&"ott"===Fo){const o=N(Mo);if((null==o?void 0:o.length)>0){const i={},l=null===(Do=null==$o?void 0:$o.cartItem)||void 0===Do?void 0:Do.find(o=>"HOME"===(null==o?void 0:o.itemType));o.forEach(o=>{var e;const n=null==o?void 0:o.itemType;if("OTT"===n){const l=(null===(e=null==o?void 0:o.promotionId)||void 0===e?void 0:e.trim())||"defaultOttBundle",d=`OTT_${l}`;i[d]||(i[d]={itemType:n,promotionId:l,items:[]}),i[d].items.push(...(null==o?void 0:o.items)||[])}else l&&l.items&&(null==o?void 0:o.items)&&l.items.push(...o.items)}),Object.keys(i).forEach(o=>{const l=i[o];null==$o||$o.cartItem.push({itemType:l.itemType,promotionId:l.promotionId,items:l.items})})}}const Xo={headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL}},Jo=v+r.CREATE_CARTV3;if((null===(Go=Object.keys($o))||void 0===Go?void 0:Go.length)>0){const o=yield i.getApiServiceInstance().post(Jo,$o,Xo).then(o=>{if(d("isB2BCustomer"),200==o.status)return null==o?void 0:o.data}).catch(o=>{var i,l,e;((null===(l=null===(i=null==o?void 0:o.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.code)||504===(null===(e=null==o?void 0:o.response)||void 0===e?void 0:e.status))&&_(null==o?void 0:o.response)});if(o.error)throw o.error;return o}}),R=(i,e)=>o(void 0,void 0,void 0,function*(){try{return yield l.get(i,e).then(o=>{var i,l,e,n;const d=null===(e=null===(l=null===(i=null==o?void 0:o.data)||void 0===i?void 0:i.story)||void 0===l?void 0:l.content)||void 0===e?void 0:e.body;for(const o of d){if("productTableV2"==o.component||"productTableWithOutLC"===o.component||"prodConfigContainer"===o.component)return o;if("roamingProductTable"==o.component)return null===(n=null==o?void 0:o.productTable)||void 0===n?void 0:n[0]}}).catch(o=>{throw o})}catch(o){return o}}),U=(o="en",i)=>{try{return l.get(i,{dimension:o,per_page:1e3,type:"B2C"}).then(o=>{var i;const l={};((null===(i=null==o?void 0:o.data)||void 0===i?void 0:i.datasource_entries)||[]).map(o=>{l[o.name]=null!=o.dimension_value?o.dimension_value:o.value});try{localStorage.removeItem("sbstaticcontent"),localStorage.setItem("sbstaticcontent",JSON.stringify(l))}catch(o){}return l}).catch(o=>o)}catch(o){throw Error("Promise failed")}},B=(l,e,n,d,t,v,u,s,c)=>o(void 0,void 0,void 0,function*(){let o;localStorage.removeItem("entertainment"),o={headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL}},v&&(o.params={returnPromo:!0}),u&&(o.params={journey:"P2P"}),c&&(o.params=Object.assign(Object.assign({},o.params),{journey:"FPB"}));let p=n+r.LINE_TABLEV2;s&&localStorage.getItem("prospectId")&&(o.headers["x-sunrise-prospect-id"]=localStorage.getItem("prospectId"),p=n+r.LINE_TABLEV3);const m=t?p+r.SUBSCRIPTION+t:p,h=d||t?m:p,I=yield i.getApiServiceInstance().post(h,l,o).then(o=>{if(200==o.status)return null==o?void 0:o.data}).catch(o=>{var i,l,e;((null===(l=null===(i=null==o?void 0:o.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.code)||504===(null===(e=null==o?void 0:o.response)||void 0===e?void 0:e.status))&&_(null==o?void 0:o.response)});return I.error?I.error:{[e]:I}}),H=(l,e,n)=>o(void 0,void 0,void 0,function*(){const o={params:{gloxTokenId:l},headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL}},d=n+r.LINE_TABLEV2,t=yield i.getApiServiceInstance().post(d,[],o).then(o=>{if(200===o.status)return null==o?void 0:o.data}).catch(o=>{var i,l,e;((null===(l=null===(i=null==o?void 0:o.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.code)||504===(null===(e=null==o?void 0:o.response)||void 0===e?void 0:e.status))&&_(null==o?void 0:o.response)});if(!t||t.error)throw new Error("Shogun offer API failed");return{[e]:t}}),j=(l,e)=>o(void 0,void 0,void 0,function*(){let o;o={params:{},headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL}},o.params={category:l};const n=e,d=yield i.getApiServiceInstance().get(n,o).then(o=>200==o.status?null==o?void 0:o.data:null==o?void 0:o.status).catch(o=>{var i,l,e;((null===(l=null===(i=null==o?void 0:o.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.code)||504===(null===(e=null==o?void 0:o.response)||void 0===e?void 0:e.status))&&_(null==o?void 0:o.response)});return(null==d?void 0:d.error)?null==d?void 0:d.error:{subscriptionData:d}}),V=(l,e)=>o(void 0,void 0,void 0,function*(){var o;try{const n={headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL},params:{offerIds:l,voucherCode:e}},d=(null===(o=null==C?void 0:C.getInstance())||void 0===o?void 0:o.getBaseUrl())+`${r.VOUCHER_PROMOTIONS}`;yield i.getApiServiceInstance().get(d,n).then(o=>{if(200==o.status)return null==o?void 0:o.data})}catch(o){}}),k=(l,e)=>o(void 0,void 0,void 0,function*(){let o;o={params:{},headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL}},o.params={msisdn:l};const n=e;return yield i.getApiServiceInstance().get(n,o).then(o=>{var i;return"OK"==(null===(i=null==o?void 0:o.data)||void 0===i?void 0:i.preToPostConversionStatus)}).catch(o=>{var i,l,e;return((null===(l=null===(i=null==o?void 0:o.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.code)||504===(null===(e=null==o?void 0:o.response)||void 0===e?void 0:e.status))&&_(null==o?void 0:o.response),console.log("err",o),!1})}),D=(l,e)=>o(void 0,void 0,void 0,function*(){try{let o;o={params:{},headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL}};const n=e+r.HARDWARES+`baseProduct__${l}`;return yield i.getApiServiceInstance().get(n,o).then(o=>{var i;return 200===(null==o?void 0:o.status)&&(null===(i=Object.keys(null==o?void 0:o.data))||void 0===i?void 0:i.length)>0?null==o?void 0:o.data:null})}catch(o){return console.log("err",o),null}}),G=(l,e)=>o(void 0,void 0,void 0,function*(){try{let o;o={params:{},headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL}};const n=e+r.HARDWARE_DEVICES+`manufacturerName__${l}`;return yield i.getApiServiceInstance().get(n,o).then(o=>{var i,l;return 200===(null==o?void 0:o.status)&&(null===(l=null===(i=null==o?void 0:o.data)||void 0===i?void 0:i.hardwares)||void 0===l?void 0:l.length)>0?null==o?void 0:o.data:null})}catch(o){return console.log("err",o),null}}),$=(l,...e)=>o(void 0,[l,...e],void 0,function*(o,l={},e){let n;n={headers:{"x-correlation-id":a(),"x-sunrise-channel":L.X_SUN_CHAL,"x-sunrise-prospect-id":e}};let d=o+(null==r?void 0:r.CUSTOMER_EVENTS);yield i.getApiServiceInstance().post(d,l,n).then(o=>{if(200==o.status)return console.log("trackPegaEvents result.data",o.data),null==o?void 0:o.data}).catch(o=>{var i,l,e;((null===(l=null===(i=null==o?void 0:o.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.code)||504===(null===(e=null==o?void 0:o.response)||void 0===e?void 0:e.status))&&_(null==o?void 0:o.response)})}),M=(l,n,d,t,v)=>o(void 0,void 0,void 0,function*(){var o,t,c,p,m,h,I,f,y,T,g,A,E,_,L,x,N,P,O,w,b,R,U,B,H;let j={},V="",k="";const D=null!==(o=s.get("one-commerce-linecheckcorrelationid"))&&void 0!==o?o:"",G=S(null===(t=null==l?void 0:l[0])||void 0===t?void 0:t.id);j={relatedParty:[{id:"anonymous",segment:"RESIDENTIAL"}],cartItem:[{itemType:"HOME",promotionId:d,items:[],note:[{author:"linecheckCorrelationId",text:D}]}]};const $={itemType:"MOBILE",promotionId:d,items:[]};(null===(c=null==l?void 0:l[0])||void 0===c?void 0:c.isBundle)?(null===(m=null===(p=null==l?void 0:l[0])||void 0===p?void 0:p.bundledOffers)||void 0===m||m.map(o=>{var i,l,e,d,t,v,r,u,s,a,c,p,m,h,I,f,y,T,g;if(null===(l=null===(i=null==o?void 0:o.promotionInfo)||void 0===i?void 0:i[0])||void 0===l?void 0:l.id){const i=1==(null===(r=null===(v=null===(t=null===(d=null===(e=null==o?void 0:o.promotionInfo)||void 0===e?void 0:e[0])||void 0===d?void 0:d.hardwareGift)||void 0===t?void 0:t[0])||void 0===v?void 0:v.ids)||void 0===r?void 0:r.length)?null===(p=null===(c=null===(a=null===(s=null===(u=null==o?void 0:o.promotionInfo)||void 0===u?void 0:u[0])||void 0===s?void 0:s.hardwareGift)||void 0===a?void 0:a[0])||void 0===c?void 0:c.ids)||void 0===p?void 0:p[0]:"";"mobile"===(null===(m=null==o?void 0:o.productType)||void 0===m?void 0:m.toLowerCase())?($.promotionId=null===(I=null===(h=null==o?void 0:o.promotionInfo)||void 0===h?void 0:h[0])||void 0===I?void 0:I.id,V=i):(j.cartItem[0].promotionId=null===(y=null===(f=null==o?void 0:o.promotionInfo)||void 0===f?void 0:f[0])||void 0===y?void 0:y.id,k=i)}"tv"==(null===(T=null==o?void 0:o.productType)||void 0===T?void 0:T.toLowerCase())&&n||("mobile"===(null===(g=null==o?void 0:o.productType)||void 0===g?void 0:g.toLowerCase())?$.items.push({itemType:"RATEPLAN",id:null==o?void 0:o.id}):j.cartItem[0].items.push({itemType:null==o?void 0:o.productType,id:null==o?void 0:o.id}))}),k&&(null===(I=null===(h=null==j?void 0:j.cartItem)||void 0===h?void 0:h[0].items)||void 0===I||I.push({itemType:"GIFT",id:k})),V&&(null===(f=null==$?void 0:$.items)||void 0===f||f.push({itemType:"GIFT",id:V})),(null===(y=null==$?void 0:$.items)||void 0===y?void 0:y.length)>0&&(null===(T=null==j?void 0:j.cartItem)||void 0===T||T.push($)),v&&(null==v?void 0:v.length)>0&&(null==v||v.map(o=>{var i,l,e;null===(e=null===(l=null===(i=null==j?void 0:j.cartItem)||void 0===i?void 0:i[0])||void 0===l?void 0:l.items)||void 0===e||e.push({itemType:"GIFT",id:null==o?void 0:o.tuaProdId})}))):j.cartItem[0].items.push({itemType:null===(g=null==l?void 0:l[0])||void 0===g?void 0:g.productType,id:null===(A=null==l?void 0:l[0])||void 0===A?void 0:A.id}),(null==G?void 0:G.accessType)&&(null===(L=null===(_=null===(E=null==j?void 0:j.cartItem)||void 0===E?void 0:E[0])||void 0===_?void 0:_.note)||void 0===L||L.push({author:"lineCheckaccessType",text:null==G?void 0:G.accessType})),(null==G?void 0:G.timeSlot)&&(null===(P=null===(N=null===(x=null==j?void 0:j.cartItem)||void 0===x?void 0:x[0])||void 0===N?void 0:N.note)||void 0===P||P.push({author:"lineCheckEarliestActivationDate",text:null===(O=null==G?void 0:G.timeSlot)||void 0===O?void 0:O.start}));try{const o=e("chAddressJson"),i=[{characteristic:{installationAddress:!0,country:"CH",city:null===(w=null==o?void 0:o.selectedAdd)||void 0===w?void 0:w.city,street1:null===(b=null==o?void 0:o.selectedAdd)||void 0===b?void 0:b.street,postCode:null===(R=null==o?void 0:o.selectedAdd)||void 0===R?void 0:R.postCode,street2:null===(U=null==o?void 0:o.selectedAdd)||void 0===U?void 0:U.houseNumber}}];j.contactMedium=i}catch(o){console.log("issue at line check address addition in create cart ==>",o)}const M={headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL}},F=`${null===(B=null==C?void 0:C.getInstance())||void 0===B?void 0:B.getBaseUrl()}${u.CART_MGMT}/${r.CREATE_CARTV2}`;if((null===(H=Object.keys(j))||void 0===H?void 0:H.length)>0){const o=yield i.getApiServiceInstance().post(F,j,M).then(o=>{if(200==o.status)return null==o?void 0:o.data});if(o.error)throw o.error;return o}}),F=()=>o(void 0,void 0,void 0,function*(){var o;const l=`${null===(o=null==C?void 0:C.getInstance())||void 0===o?void 0:o.getBaseUrl()}${r.TV_SERVICE_OPTIONS_V2}`,e={params:{},headers:{"x-sunrise-channel":r.X_SUN_CHAL,"x-correlation-id":a()}};try{const o=yield i.getApiServiceInstance().get(l,e).then(o=>{var i;return(null===(i=null==o?void 0:o.data)||void 0===i?void 0:i.length)>0?null==o?void 0:o.data:[]});return o}catch(o){console.log(o)}});export{b as createCartV2,M as createCartWinV2,O as fetchCountryList,R as fetchLinetableContent,B as fetchOfferingDataLineTableV2,w as fetchOfferingDataV2,F as fetchOttServiceOptions,H as fetchShogunOfferData,j as fetchSubscriptionData,D as getDeviceDetails,G as getDeviceModelsList,U as getStaticContent,V as getVocherPromotion,$ as trackPegaEvents,k as validateP2P};
1
+ import{__awaiter as o}from"../_virtual/_tslib.js";import{ApiServiceV2 as i,CMSStoryblokServiceV2 as l}from"@sunrise-upc/ajax-lib";import{getCookies as e,getSessionStorage as n,removeLocalStorage as d,getLocalStorageWithExpiry as t,setLocalStoreWithExpiry as v}from"../utils/utils.js";import{APIResourceConstants as r,API_BASE_BASEPOINT as u}from"./api-constants.js";import s from"js-cookie";import{v4 as a}from"uuid";import{ONE_ECOMMERCE_OTT as c,FIXNET as p,TV_SERVICE_OPTION as m,MOBILE as h,PRE_TO_POST as I,P2PSUBSCRIBEDPLAN as f,QOQA as y,VOUCHERTYPE as T,VOUCHERCODE as g,HARDWARE as A,DEVICE_INSURANCE as E}from"../utils/constants.js";import{getAccessDataFromLineCheck as C}from"../components/lineTable/LineTableV3.utils.js";import{LineTableBasicPropConfig as S}from"./LineTableBasicPropConfig.js";import{errorTrackingDataLayer as _}from"../utils/AnalyticsUtils.js";import{apiResConstants as L}from"../components/LineCheckV3/APIResourceConstants.js";import{getDeviceNotes as x}from"../components/UltimateBundleLinetable/DpTableUtils.js";import{fetchOttItems as N}from"../components/StaticLineTable/Product.utils.js";let P=void 0!==typeof window&&s.get("sunriseAuth");P=P&&JSON.parse(P);const O=(i,e,n,d)=>o(void 0,void 0,void 0,function*(){var o;const r=t(`${i}_${e}_countryData`);if(r)return r;try{const t={language:e,type:"B2C"},r=null===(o=(yield l.get(n,t)).data)||void 0===o?void 0:o.stories;return r&&r.length>0&&v(`${i}_${e}_countryData`,r,d),r}catch(o){return console.error(o),o}}),w=(l,e,n)=>o(void 0,void 0,void 0,function*(){var o,d,t;try{localStorage.removeItem("entertainment");const o={headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL},params:{}};n&&(o.params={returnPromo:!0});const d=e+r.LINE_TABLEV2,t=yield i.getApiServiceInstance().post(d,l,o).then(o=>{if(200==o.status)return null==o?void 0:o.data});if(t.error)return t.error;{const o=[];return null==t||t.forEach(i=>{o[i.id]=i}),o}}catch(i){((null===(d=null===(o=null==i?void 0:i.response)||void 0===o?void 0:o.data)||void 0===d?void 0:d.code)||504===(null===(t=null==i?void 0:i.response)||void 0===t?void 0:t.status))&&_(null==i?void 0:i.response),console.log("error---\x3e",i)}}),b=(l,t,v,u,S,L,P,O,w,...b)=>o(void 0,[l,t,v,u,S,L,P,O,w,...b],void 0,function*(o,l,t,v,u,S,L,P,O,w="",b,R,U,B,H){var j,V,k,D,G,$,M,F,X,J,W,K,q,z,Q,Y,Z,oo,io,lo,eo,no,to,vo,ro,uo,so,ao,co,po,mo,ho,Io,fo,yo,To,go,Ao,Eo,Co,So,_o,Lo,xo,No,Po,Oo,wo,bo,Ro,Uo,Bo,Ho,jo,Vo,ko,Do,Go;let $o={};const Mo=n(c);if(u===p){let i="",n="";const d=null!==(j=s.get("one-commerce-linecheckcorrelationid"))&&void 0!==j?j:"",v=C(null===(V=null==o?void 0:o[0])||void 0===V?void 0:V.id);$o={relatedParty:[{id:"anonymous",segment:"RESIDENTIAL"}],cartItem:[{itemType:"HOME",promotionId:t,items:[],note:[{author:"linecheckCorrelationId",text:d}]}]};const r={itemType:"MOBILE",promotionId:t,items:[]};if(null===(k=o[0])||void 0===k?void 0:k.isBundle)null===(G=null===(D=o[0])||void 0===D?void 0:D.bundledOffers)||void 0===G||G.map(o=>{var e,d,t,v,u,s,a,c,p,m,h,I,f,y,T,g,A,E,C;if(null===(d=null===(e=null==o?void 0:o.promotionInfo)||void 0===e?void 0:e[0])||void 0===d?void 0:d.id){const l=1==(null===(a=null===(s=null===(u=null===(v=null===(t=null==o?void 0:o.promotionInfo)||void 0===t?void 0:t[0])||void 0===v?void 0:v.hardwareGift)||void 0===u?void 0:u[0])||void 0===s?void 0:s.ids)||void 0===a?void 0:a.length)?null===(I=null===(h=null===(m=null===(p=null===(c=null==o?void 0:o.promotionInfo)||void 0===c?void 0:c[0])||void 0===p?void 0:p.hardwareGift)||void 0===m?void 0:m[0])||void 0===h?void 0:h.ids)||void 0===I?void 0:I[0]:"";"mobile"===(null===(f=null==o?void 0:o.productType)||void 0===f?void 0:f.toLowerCase())?(r.promotionId=null===(T=null===(y=null==o?void 0:o.promotionInfo)||void 0===y?void 0:y[0])||void 0===T?void 0:T.id,i=l):($o.cartItem[0].promotionId=null===(A=null===(g=null==o?void 0:o.promotionInfo)||void 0===g?void 0:g[0])||void 0===A?void 0:A.id,n=l)}"tv"==(null===(E=null==o?void 0:o.productType)||void 0===E?void 0:E.toLowerCase())&&l?$o.cartItem[0].items.push({itemType:null==o?void 0:o.productType,id:l}):"mobile"===(null===(C=null==o?void 0:o.productType)||void 0===C?void 0:C.toLowerCase())?r.items.push({itemType:"RATEPLAN",id:null==o?void 0:o.id}):$o.cartItem[0].items.push({itemType:null==o?void 0:o.productType,id:null==o?void 0:o.id})}),n&&(null===($=$o.cartItem[0].items)||void 0===$||$.push({itemType:"GIFT",id:n})),i&&r.items.push({itemType:"GIFT",id:i}),(null===(M=null==r?void 0:r.items)||void 0===M?void 0:M.length)>0&&(null===(F=null==$o?void 0:$o.cartItem)||void 0===F||F.push(r)),(null==R?void 0:R.length)>0&&(null==R||R.forEach(o=>{$o.cartItem[0].items.push({itemType:m,id:null==o?void 0:o.id})}));else{const i=1==(null===(z=null===(q=null===(K=null===(W=null===(J=null===(X=null==o?void 0:o[0])||void 0===X?void 0:X.promotionInfo)||void 0===J?void 0:J[0])||void 0===W?void 0:W.hardwareGift)||void 0===K?void 0:K[0])||void 0===q?void 0:q.ids)||void 0===z?void 0:z.length)?null===(lo=null===(io=null===(oo=null===(Z=null===(Y=null===(Q=null==o?void 0:o[0])||void 0===Q?void 0:Q.promotionInfo)||void 0===Y?void 0:Y[0])||void 0===Z?void 0:Z.hardwareGift)||void 0===oo?void 0:oo[0])||void 0===io?void 0:io.ids)||void 0===lo?void 0:lo[0]:"";$o.cartItem[0].items.push({itemType:null===(eo=null==o?void 0:o[0])||void 0===eo?void 0:eo.productType,id:null===(no=null==o?void 0:o[0])||void 0===no?void 0:no.id}),i&&(null===(to=$o.cartItem[0].items)||void 0===to||to.push({itemType:"GIFT",id:i}))}S&&(null==S?void 0:S.length)>0&&(null==S||S.map(o=>{var i,l,e,n;"HOME"===(null==o?void 0:o.parentPoType)?null===(e=null===(l=null===(i=null==$o?void 0:$o.cartItem)||void 0===i?void 0:i[0])||void 0===l?void 0:l.items)||void 0===e||e.push({itemType:"GIFT",id:null==o?void 0:o.tuaProdId}):null===(n=r.items)||void 0===n||n.push({itemType:"GIFT",id:null==o?void 0:o.tuaProdId})})),(null==v?void 0:v.accessType)&&(null===(uo=null===(ro=null===(vo=null==$o?void 0:$o.cartItem)||void 0===vo?void 0:vo[0])||void 0===ro?void 0:ro.note)||void 0===uo||uo.push({author:"lineCheckaccessType",text:null==v?void 0:v.accessType})),(null==v?void 0:v.timeSlot)&&(null===(co=null===(ao=null===(so=null==$o?void 0:$o.cartItem)||void 0===so?void 0:so[0])||void 0===ao?void 0:ao.note)||void 0===co||co.push({author:"lineCheckEarliestActivationDate",text:null===(po=null==v?void 0:v.timeSlot)||void 0===po?void 0:po.start}));try{const o=e("chAddressJson"),i=[{characteristic:{installationAddress:!0,country:"CH",city:null===(mo=null==o?void 0:o.selectedAdd)||void 0===mo?void 0:mo.city,street1:null===(ho=null==o?void 0:o.selectedAdd)||void 0===ho?void 0:ho.street,postCode:null===(Io=null==o?void 0:o.selectedAdd)||void 0===Io?void 0:Io.postCode,street2:null===(fo=null==o?void 0:o.selectedAdd)||void 0===fo?void 0:fo.houseNumber}}];$o.contactMedium=i}catch(o){console.log("issue at line check address addition in create cart ==>",o)}}else if(u===h){$o=L?{relatedParty:[{segment:"RESIDENTIAL"}],cartItem:[{itemType:"MOBILE",promotionId:t,items:[{itemType:"RATEPLAN",id:(null===(yo=null==o?void 0:o[0])||void 0===yo?void 0:yo.id)?null===(To=null==o?void 0:o[0])||void 0===To?void 0:To.id:o,subscribedInfo:{installedPlan:f,id:P}}],processType:{id:I}}]}:{relatedParty:[{segment:"RESIDENTIAL"}],cartItem:[{itemType:"MOBILE",promotionId:t,items:[{itemType:"RATEPLAN",id:(null===(go=null==o?void 0:o[0])||void 0===go?void 0:go.id)?null===(Ao=null==o?void 0:o[0])||void 0===Ao?void 0:Ao.id:o,clientDiscountInfo:U?[{discountRef:U,discountType:"DISCOUNT"}]:void 0}]}]};const i=1==(null===(xo=null===(Lo=null===(_o=null===(So=null===(Co=null===(Eo=null==o?void 0:o[0])||void 0===Eo?void 0:Eo.promotionInfo)||void 0===Co?void 0:Co[0])||void 0===So?void 0:So.hardwareGift)||void 0===_o?void 0:_o[0])||void 0===Lo?void 0:Lo.ids)||void 0===xo?void 0:xo.length)?null===(Ro=null===(bo=null===(wo=null===(Oo=null===(Po=null===(No=null==o?void 0:o[0])||void 0===No?void 0:No.promotionInfo)||void 0===Po?void 0:Po[0])||void 0===Oo?void 0:Oo.hardwareGift)||void 0===wo?void 0:wo[0])||void 0===bo?void 0:bo.ids)||void 0===Ro?void 0:Ro[0]:"";i&&(null===(Uo=$o.cartItem[0].items)||void 0===Uo||Uo.push({itemType:"GIFT",id:i})),S&&(null==S?void 0:S.length)>0&&(null==S||S.map(o=>{var i,l,e;"HOME"!==(null==o?void 0:o.parentPoType)&&(null===(e=null===(l=null===(i=null==$o?void 0:$o.cartItem)||void 0===i?void 0:i[0])||void 0===l?void 0:l.items)||void 0===e||e.push({itemType:"GIFT",id:null==o?void 0:o.tuaProdId}))}))}if(O){const o=[];o.push({author:T,text:y}),""!==w&&(o.push({author:g,text:w}),d("vctype")),$o.cartItem[0].note=o}else if(U&&B){const o=[];null==o||o.push({author:"offerType",text:"ATL"}),null==o||o.push({author:"externalPromotionName",text:U}),null==o||o.push({author:"offerVersion",text:B}),$o.cartItem[0].note=o}if(H&&(null===(Bo=null==$o?void 0:$o.cartItem)||void 0===Bo?void 0:Bo[0])){const{pointsBurnt:o,rewardOfferId:i,gloxTokenId:l}=H;l&&($o.guid=l);const e=[null!=o&&""!=`${o}`&&{author:"pointsBurnt",text:`${o}`},null!=i&&""!=`${i}`&&{author:"rewardOfferId",text:`${i}`}].filter(Boolean);e.length>0&&(null===(Ho=null==$o?void 0:$o.cartItem)||void 0===Ho||Ho.forEach(o=>{Array.isArray(null==o?void 0:o.items)&&o.items.forEach(o=>{const i=`${(null==o?void 0:o.itemType)||""}`.toUpperCase();"RATEPLAN"!==i&&"INTERNET"!==i||(o.note=[...o.note||[],...e])})}))}if(b){const o=(o=>{var i,l,e,n,d,t,v,r,u,s,a,c,p,m,h,I;let f=[];const y=null!==(n=null===(e=null===(l=null===(i=null==o?void 0:o.selectedVarientDetails)||void 0===i?void 0:i.hardwarePrices)||void 0===l?void 0:l.smartUpgradeInstallments)||void 0===e?void 0:e.duration)&&void 0!==n?n:0,T=null!==(u=null===(r=null===(v=null===(t=null===(d=null==o?void 0:o.selectedVarientDetails)||void 0===d?void 0:d.hardwarePrices)||void 0===t?void 0:t.smartUpgradeInstallments)||void 0===v?void 0:v.upFrontPayment)||void 0===r?void 0:r.value)&&void 0!==u?u:0,g=null!==(m=null===(p=null===(c=null===(a=null===(s=null==o?void 0:o.selectedVarientDetails)||void 0===s?void 0:s.hardwarePrices)||void 0===a?void 0:a.smartUpgradeInstallments)||void 0===c?void 0:c.insurance)||void 0===p?void 0:p.value)&&void 0!==m?m:0,C={itemType:A,id:null!==(I=null===(h=null==o?void 0:o.selectedVarientDetails)||void 0===h?void 0:h.id)&&void 0!==I?I:"",contractTerm:y,note:x(o,T)};if(C&&(null==f||f.push(C)),g){const i={itemType:E,id:null==o?void 0:o.insuranceName};null==f||f.push(i)}return(null==f?void 0:f.length)>0?f:null})(b);o&&(null===(ko=null===(Vo=null===(jo=null==$o?void 0:$o.cartItem)||void 0===jo?void 0:jo[0])||void 0===Vo?void 0:Vo.items)||void 0===ko||ko.push(...o))}let Fo=null;if("undefined"!=typeof window){Fo=new URLSearchParams(window.location.search).get("flow")}if(Mo&&"ott"===Fo){const o=N(Mo);if((null==o?void 0:o.length)>0){const i={},l=null===(Do=null==$o?void 0:$o.cartItem)||void 0===Do?void 0:Do.find(o=>"HOME"===(null==o?void 0:o.itemType));o.forEach(o=>{var e;const n=null==o?void 0:o.itemType;if("OTT"===n){const l=(null===(e=null==o?void 0:o.promotionId)||void 0===e?void 0:e.trim())||"defaultOttBundle",d=`OTT_${l}`;i[d]||(i[d]={itemType:n,promotionId:l,items:[]}),i[d].items.push(...(null==o?void 0:o.items)||[])}else l&&l.items&&(null==o?void 0:o.items)&&l.items.push(...o.items)}),Object.keys(i).forEach(o=>{const l=i[o];null==$o||$o.cartItem.push({itemType:l.itemType,promotionId:l.promotionId,items:l.items})})}}const Xo={headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL}},Jo=v+r.CREATE_CARTV3;if((null===(Go=Object.keys($o))||void 0===Go?void 0:Go.length)>0){const o=yield i.getApiServiceInstance().post(Jo,$o,Xo).then(o=>{if(d("isB2BCustomer"),200==o.status)return null==o?void 0:o.data}).catch(o=>{var i,l,e;((null===(l=null===(i=null==o?void 0:o.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.code)||504===(null===(e=null==o?void 0:o.response)||void 0===e?void 0:e.status))&&_(null==o?void 0:o.response)});if(o.error)throw o.error;return o}}),R=(i,e)=>o(void 0,void 0,void 0,function*(){try{return yield l.get(i,e).then(o=>{var i,l,e,n;const d=null===(e=null===(l=null===(i=null==o?void 0:o.data)||void 0===i?void 0:i.story)||void 0===l?void 0:l.content)||void 0===e?void 0:e.body;for(const o of d){if("productTableV2"==o.component||"productTableWithOutLC"===o.component||"prodConfigContainer"===o.component)return o;if("roamingProductTable"==o.component)return null===(n=null==o?void 0:o.productTable)||void 0===n?void 0:n[0]}}).catch(o=>{throw o})}catch(o){return o}}),U=(o="en",i)=>{try{return l.get(i,{dimension:o,per_page:1e3,type:"B2C"}).then(o=>{var i;const l={};((null===(i=null==o?void 0:o.data)||void 0===i?void 0:i.datasource_entries)||[]).map(o=>{l[o.name]=null!=o.dimension_value?o.dimension_value:o.value});try{localStorage.removeItem("sbstaticcontent"),localStorage.setItem("sbstaticcontent",JSON.stringify(l))}catch(o){}return l}).catch(o=>o)}catch(o){throw Error("Promise failed")}},B=(l,e,n,d,t,v,u,s,c)=>o(void 0,void 0,void 0,function*(){let o;localStorage.removeItem("entertainment"),o={headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL}},v&&(o.params={returnPromo:!0}),u&&(o.params={journey:"P2P"}),c&&(o.params=Object.assign(Object.assign({},o.params),{journey:"FPB"}));let p=n+r.LINE_TABLEV2;s&&localStorage.getItem("prospectId")&&(o.headers["x-sunrise-prospect-id"]=localStorage.getItem("prospectId"),p=n+r.LINE_TABLEV3);const m=t?p+r.SUBSCRIPTION+t:p,h=d||t?m:p,I=yield i.getApiServiceInstance().post(h,l,o).then(o=>{if(200==o.status)return null==o?void 0:o.data}).catch(o=>{var i,l,e;((null===(l=null===(i=null==o?void 0:o.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.code)||504===(null===(e=null==o?void 0:o.response)||void 0===e?void 0:e.status))&&_(null==o?void 0:o.response)});return I.error?I.error:{[e]:I}}),H=(l,e,n)=>o(void 0,void 0,void 0,function*(){const o={params:{gloxTokenId:l},headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL}},d=n+r.LINE_TABLEV2,t=yield i.getApiServiceInstance().post(d,[],o).then(o=>{if(200===o.status)return null==o?void 0:o.data}).catch(o=>{var i,l,e;((null===(l=null===(i=null==o?void 0:o.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.code)||504===(null===(e=null==o?void 0:o.response)||void 0===e?void 0:e.status))&&_(null==o?void 0:o.response)});if(!t||t.error)throw new Error("Shogun offer API failed");return{[e]:t}}),j=(l,e)=>o(void 0,void 0,void 0,function*(){let o;o={params:{},headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL}},o.params={category:l};const n=e,d=yield i.getApiServiceInstance().get(n,o).then(o=>200==o.status?null==o?void 0:o.data:null==o?void 0:o.status).catch(o=>{var i,l,e;((null===(l=null===(i=null==o?void 0:o.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.code)||504===(null===(e=null==o?void 0:o.response)||void 0===e?void 0:e.status))&&_(null==o?void 0:o.response)});return(null==d?void 0:d.error)?null==d?void 0:d.error:{subscriptionData:d}}),V=(l,e)=>o(void 0,void 0,void 0,function*(){var o;try{const n={headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL},params:{offerIds:l,voucherCode:e}},d=(null===(o=null==S?void 0:S.getInstance())||void 0===o?void 0:o.getBaseUrl())+`${r.VOUCHER_PROMOTIONS}`;yield i.getApiServiceInstance().get(d,n).then(o=>{if(200==o.status)return null==o?void 0:o.data})}catch(o){}}),k=(l,e)=>o(void 0,void 0,void 0,function*(){let o;o={params:{},headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL}},o.params={msisdn:l};const n=e;return yield i.getApiServiceInstance().get(n,o).then(o=>{var i;return"OK"==(null===(i=null==o?void 0:o.data)||void 0===i?void 0:i.preToPostConversionStatus)}).catch(o=>{var i,l,e;return((null===(l=null===(i=null==o?void 0:o.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.code)||504===(null===(e=null==o?void 0:o.response)||void 0===e?void 0:e.status))&&_(null==o?void 0:o.response),console.log("err",o),!1})}),D=(l,e,n)=>o(void 0,void 0,void 0,function*(){try{let o;o={params:{},headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL}};let d=e+r.HARDWARES+`baseProduct__${l}`;n&&(d+=`&deviceType=${encodeURIComponent(n)}`);return yield i.getApiServiceInstance().get(d,o).then(o=>{var i;return 200===(null==o?void 0:o.status)&&(null===(i=Object.keys(null==o?void 0:o.data))||void 0===i?void 0:i.length)>0?null==o?void 0:o.data:null})}catch(o){return console.log("err",o),null}}),G=(l,e,n)=>o(void 0,void 0,void 0,function*(){try{let o;o={params:{},headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL}};let n=e+r.HARDWARE_DEVICES+`manufacturerName__${l}`;return yield i.getApiServiceInstance().get(n,o).then(o=>{var i,l;return 200===(null==o?void 0:o.status)&&(null===(l=null===(i=null==o?void 0:o.data)||void 0===i?void 0:i.hardwares)||void 0===l?void 0:l.length)>0?null==o?void 0:o.data:null})}catch(o){return console.log("err",o),null}}),$=(l,...e)=>o(void 0,[l,...e],void 0,function*(o,l={},e){let n;n={headers:{"x-correlation-id":a(),"x-sunrise-channel":L.X_SUN_CHAL,"x-sunrise-prospect-id":e}};let d=o+(null==r?void 0:r.CUSTOMER_EVENTS);yield i.getApiServiceInstance().post(d,l,n).then(o=>{if(200==o.status)return console.log("trackPegaEvents result.data",o.data),null==o?void 0:o.data}).catch(o=>{var i,l,e;((null===(l=null===(i=null==o?void 0:o.response)||void 0===i?void 0:i.data)||void 0===l?void 0:l.code)||504===(null===(e=null==o?void 0:o.response)||void 0===e?void 0:e.status))&&_(null==o?void 0:o.response)})}),M=(l,n,d,t,v)=>o(void 0,void 0,void 0,function*(){var o,t,c,p,m,h,I,f,y,T,g,A,E,_,L,x,N,P,O,w,b,R,U,B,H;let j={},V="",k="";const D=null!==(o=s.get("one-commerce-linecheckcorrelationid"))&&void 0!==o?o:"",G=C(null===(t=null==l?void 0:l[0])||void 0===t?void 0:t.id);j={relatedParty:[{id:"anonymous",segment:"RESIDENTIAL"}],cartItem:[{itemType:"HOME",promotionId:d,items:[],note:[{author:"linecheckCorrelationId",text:D}]}]};const $={itemType:"MOBILE",promotionId:d,items:[]};(null===(c=null==l?void 0:l[0])||void 0===c?void 0:c.isBundle)?(null===(m=null===(p=null==l?void 0:l[0])||void 0===p?void 0:p.bundledOffers)||void 0===m||m.map(o=>{var i,l,e,d,t,v,r,u,s,a,c,p,m,h,I,f,y,T,g;if(null===(l=null===(i=null==o?void 0:o.promotionInfo)||void 0===i?void 0:i[0])||void 0===l?void 0:l.id){const i=1==(null===(r=null===(v=null===(t=null===(d=null===(e=null==o?void 0:o.promotionInfo)||void 0===e?void 0:e[0])||void 0===d?void 0:d.hardwareGift)||void 0===t?void 0:t[0])||void 0===v?void 0:v.ids)||void 0===r?void 0:r.length)?null===(p=null===(c=null===(a=null===(s=null===(u=null==o?void 0:o.promotionInfo)||void 0===u?void 0:u[0])||void 0===s?void 0:s.hardwareGift)||void 0===a?void 0:a[0])||void 0===c?void 0:c.ids)||void 0===p?void 0:p[0]:"";"mobile"===(null===(m=null==o?void 0:o.productType)||void 0===m?void 0:m.toLowerCase())?($.promotionId=null===(I=null===(h=null==o?void 0:o.promotionInfo)||void 0===h?void 0:h[0])||void 0===I?void 0:I.id,V=i):(j.cartItem[0].promotionId=null===(y=null===(f=null==o?void 0:o.promotionInfo)||void 0===f?void 0:f[0])||void 0===y?void 0:y.id,k=i)}"tv"==(null===(T=null==o?void 0:o.productType)||void 0===T?void 0:T.toLowerCase())&&n||("mobile"===(null===(g=null==o?void 0:o.productType)||void 0===g?void 0:g.toLowerCase())?$.items.push({itemType:"RATEPLAN",id:null==o?void 0:o.id}):j.cartItem[0].items.push({itemType:null==o?void 0:o.productType,id:null==o?void 0:o.id}))}),k&&(null===(I=null===(h=null==j?void 0:j.cartItem)||void 0===h?void 0:h[0].items)||void 0===I||I.push({itemType:"GIFT",id:k})),V&&(null===(f=null==$?void 0:$.items)||void 0===f||f.push({itemType:"GIFT",id:V})),(null===(y=null==$?void 0:$.items)||void 0===y?void 0:y.length)>0&&(null===(T=null==j?void 0:j.cartItem)||void 0===T||T.push($)),v&&(null==v?void 0:v.length)>0&&(null==v||v.map(o=>{var i,l,e;null===(e=null===(l=null===(i=null==j?void 0:j.cartItem)||void 0===i?void 0:i[0])||void 0===l?void 0:l.items)||void 0===e||e.push({itemType:"GIFT",id:null==o?void 0:o.tuaProdId})}))):j.cartItem[0].items.push({itemType:null===(g=null==l?void 0:l[0])||void 0===g?void 0:g.productType,id:null===(A=null==l?void 0:l[0])||void 0===A?void 0:A.id}),(null==G?void 0:G.accessType)&&(null===(L=null===(_=null===(E=null==j?void 0:j.cartItem)||void 0===E?void 0:E[0])||void 0===_?void 0:_.note)||void 0===L||L.push({author:"lineCheckaccessType",text:null==G?void 0:G.accessType})),(null==G?void 0:G.timeSlot)&&(null===(P=null===(N=null===(x=null==j?void 0:j.cartItem)||void 0===x?void 0:x[0])||void 0===N?void 0:N.note)||void 0===P||P.push({author:"lineCheckEarliestActivationDate",text:null===(O=null==G?void 0:G.timeSlot)||void 0===O?void 0:O.start}));try{const o=e("chAddressJson"),i=[{characteristic:{installationAddress:!0,country:"CH",city:null===(w=null==o?void 0:o.selectedAdd)||void 0===w?void 0:w.city,street1:null===(b=null==o?void 0:o.selectedAdd)||void 0===b?void 0:b.street,postCode:null===(R=null==o?void 0:o.selectedAdd)||void 0===R?void 0:R.postCode,street2:null===(U=null==o?void 0:o.selectedAdd)||void 0===U?void 0:U.houseNumber}}];j.contactMedium=i}catch(o){console.log("issue at line check address addition in create cart ==>",o)}const M={headers:{"x-correlation-id":a(),"x-sunrise-channel":r.X_SUN_CHAL}},F=`${null===(B=null==S?void 0:S.getInstance())||void 0===B?void 0:B.getBaseUrl()}${u.CART_MGMT}/${r.CREATE_CARTV2}`;if((null===(H=Object.keys(j))||void 0===H?void 0:H.length)>0){const o=yield i.getApiServiceInstance().post(F,j,M).then(o=>{if(200==o.status)return null==o?void 0:o.data});if(o.error)throw o.error;return o}}),F=()=>o(void 0,void 0,void 0,function*(){var o;const l=`${null===(o=null==S?void 0:S.getInstance())||void 0===o?void 0:o.getBaseUrl()}${r.TV_SERVICE_OPTIONS_V2}`,e={params:{},headers:{"x-sunrise-channel":r.X_SUN_CHAL,"x-correlation-id":a()}};try{const o=yield i.getApiServiceInstance().get(l,e).then(o=>{var i;return(null===(i=null==o?void 0:o.data)||void 0===i?void 0:i.length)>0?null==o?void 0:o.data:[]});return o}catch(o){console.log(o)}});export{b as createCartV2,M as createCartWinV2,O as fetchCountryList,R as fetchLinetableContent,B as fetchOfferingDataLineTableV2,w as fetchOfferingDataV2,F as fetchOttServiceOptions,H as fetchShogunOfferData,j as fetchSubscriptionData,D as getDeviceDetails,G as getDeviceModelsList,U as getStaticContent,V as getVocherPromotion,$ as trackPegaEvents,k as validateP2P};
2
2
  //# sourceMappingURL=LineTableService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LineTableService.js","sources":["../../../src/services/LineTableService.ts"],"sourcesContent":["import { ApiServiceV2, CMSStoryblokServiceV2 } from '@sunrise-upc/ajax-lib';\r\nimport {\r\n getCookies,\r\n getLocalStorageWithExpiry,\r\n getSessionStorage,\r\n removeLocalStorage,\r\n setLocalStoreWithExpiry\r\n} from '../utils/utils';\r\nimport { API_BASE_BASEPOINT, APIResourceConstants } from './api-constants';\r\nimport Cookies from 'js-cookie';\r\nimport { v4 as generateUID } from 'uuid';\r\nimport {\r\n DEVICE_INSURANCE,\r\n FIXNET,\r\n HARDWARE,\r\n MOBILE,\r\n ONE_ECOMMERCE_OTT,\r\n P2PSUBSCRIBEDPLAN,\r\n PRE_TO_POST,\r\n QOQA,\r\n TV_SERVICE_OPTION,\r\n VOUCHERCODE,\r\n VOUCHERTYPE\r\n} from '../utils/constants';\r\nimport { getAccessDataFromLineCheck } from '../components/lineTable/LineTableV3.utils';\r\nimport { LineTableBasicPropConfig } from './LineTableBasicPropConfig';\r\nimport { errorTrackingDataLayer } from '../utils/AnalyticsUtils';\r\nimport { apiResConstants } from '../components/LineCheckV3/APIResourceConstants';\r\nimport { getDeviceNotes } from '../components/UltimateBundleLinetable/DpTableUtils';\r\nimport {fetchOttItems} from '../components/StaticLineTable/Product.utils'\r\n\r\n// Device cart utility functions moved here to avoid circular dependency\r\nconst getDeviceCartNotes = (deviceDetails: any, upFrontValue: string) => {\r\n let note = '';\r\n const smartUpgradeInstallments =\r\n deviceDetails?.selectedVarientDetails?.hardwarePrices?.smartUpgradeInstallments;\r\n const installments = deviceDetails?.selectedVarientDetails?.hardwarePrices?.installments;\r\n const basePrice = deviceDetails?.selectedVarientDetails?.hardwarePrices?.basePrice;\r\n\r\n if (smartUpgradeInstallments) {\r\n note = `${smartUpgradeInstallments?.duration} months, CHF ${upFrontValue} upfront, CHF ${smartUpgradeInstallments?.monthlyPayment?.value}/month`;\r\n } else if (installments) {\r\n note = `${installments?.duration} months, CHF ${installments?.monthlyPayment?.value}/month`;\r\n } else if (basePrice) {\r\n note = `CHF ${basePrice?.value} one-time payment`;\r\n }\r\n return note;\r\n};\r\n\r\nconst getDeviceCartItem = (deviceDetails: any) => {\r\n let items = [];\r\n const contractDuration =\r\n deviceDetails?.selectedVarientDetails?.hardwarePrices?.smartUpgradeInstallments?.duration ?? 0;\r\n const upFrontValue =\r\n deviceDetails?.selectedVarientDetails?.hardwarePrices?.smartUpgradeInstallments?.upFrontPayment\r\n ?.value ?? 0;\r\n const insuranceValue =\r\n deviceDetails?.selectedVarientDetails?.hardwarePrices?.smartUpgradeInstallments?.insurance\r\n ?.value ?? 0;\r\n const deviceItem = {\r\n itemType: HARDWARE,\r\n id: deviceDetails?.selectedVarientDetails?.id ?? '',\r\n contractTerm: contractDuration,\r\n note: getDeviceNotes(deviceDetails, upFrontValue)\r\n };\r\n deviceItem && items?.push(deviceItem);\r\n\r\n if (insuranceValue) {\r\n const flexItem = {\r\n itemType: DEVICE_INSURANCE,\r\n id: deviceDetails?.insuranceName\r\n };\r\n items?.push(flexItem);\r\n }\r\n return items?.length > 0 ? items : null;\r\n};\r\n\r\nlet AuthData: any = typeof window !== undefined && Cookies.get('sunriseAuth');\r\nAuthData = AuthData && JSON.parse(AuthData);\r\n\r\nexport const fetchCountryList = async (name: string, lang: string, url: string, TTL: number) => {\r\n const getCountryData = getLocalStorageWithExpiry(`${name}_${lang}_countryData`);\r\n if (getCountryData) {\r\n return getCountryData;\r\n } else {\r\n try {\r\n const sbParams = {\r\n language: lang,\r\n type: 'B2C'\r\n };\r\n const res = await CMSStoryblokServiceV2.get(url, sbParams);\r\n const stories = res.data?.stories;\r\n if (stories && stories.length > 0)\r\n setLocalStoreWithExpiry(`${name}_${lang}_countryData`, stories, TTL);\r\n return stories;\r\n } catch (e: any) {\r\n // eslint-disable-next-line no-console\r\n console.error(e);\r\n return e;\r\n }\r\n }\r\n};\r\n\r\nexport const fetchOfferingDataV2 = async (\r\n requestBody: any,\r\n url: any,\r\n returnPromo?: boolean\r\n): Promise<any> => {\r\n try {\r\n localStorage.removeItem('entertainment');\r\n const options = {\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n },\r\n params: {}\r\n };\r\n if (returnPromo) {\r\n options.params = {\r\n returnPromo: true\r\n };\r\n }\r\n const URL = url + APIResourceConstants.LINE_TABLEV2;\r\n const productDynamicData: any = await ApiServiceV2.getApiServiceInstance()\r\n .post(URL, requestBody, options)\r\n .then((res): any => {\r\n if (res.status == 200) {\r\n return res?.data;\r\n }\r\n });\r\n if (productDynamicData.error) {\r\n return productDynamicData.error;\r\n } else {\r\n const response: any[] = [];\r\n productDynamicData?.forEach((data: any) => {\r\n response[data.id] = data;\r\n });\r\n return response;\r\n }\r\n } catch (error: any) {\r\n if (error?.response?.data?.code || error?.response?.status === 504) {\r\n errorTrackingDataLayer(error?.response);\r\n }\r\n // eslint-disable-next-line no-console\r\n console.log('error--->', error);\r\n }\r\n};\r\n\r\nexport const createCartV2 = async (\r\n productData: any,\r\n radioValue: string,\r\n defaultPromo: string,\r\n cartUrl: string,\r\n productType: string,\r\n chooseGift?: any,\r\n enabledP2P?: any,\r\n P2PData?: any,\r\n isQoqaFlow?: boolean,\r\n qVoucher: any = '',\r\n deviceDetails?: any,\r\n tvOptions?: any,\r\n discountRef?: string,\r\n discountVersion?: string,\r\n // Shogun/rewards (loyalty) flow: when the user redeems loyalty points we must\r\n // attach a `pointsBurnt` note at the item level — the RATEPLAN item for\r\n // MOBILE and the internet item for FIXNET — so the backend can apply the\r\n // burn. See StaticProduct.tsx (isShogunFlow branch).\r\n rewardsInfo?: { pointsBurnt?: string | number; rewardOfferId?: string | number; gloxTokenId?: string | null }\r\n): Promise<any> => {\r\n let cartData: any = {};\r\n /**WIN FLows*/\r\n \r\n // Get OTT data from session storage\r\n const ottCartData = getSessionStorage(ONE_ECOMMERCE_OTT);\r\n \r\n if (productType === FIXNET) {\r\n let mobGiftId = '';\r\n let mandatoryGift = '';\r\n const getCoorelationIdFromCookie = Cookies.get('one-commerce-linecheckcorrelationid') ?? '';\r\n const lineCheckData = getAccessDataFromLineCheck(productData?.[0]?.id);\r\n cartData = {\r\n relatedParty: [\r\n {\r\n id: 'anonymous',\r\n segment: 'RESIDENTIAL'\r\n }\r\n ],\r\n cartItem: [\r\n {\r\n itemType: 'HOME',\r\n promotionId: defaultPromo,\r\n items: [],\r\n note: [\r\n {\r\n author: 'linecheckCorrelationId',\r\n text: getCoorelationIdFromCookie\r\n }\r\n ]\r\n }\r\n ]\r\n };\r\n /**for 4P bundles*/\r\n const mobileItem: any = {\r\n itemType: 'MOBILE',\r\n promotionId: defaultPromo,\r\n items: []\r\n };\r\n /**Check if bundle or Internet and add it to cart request*/\r\n if (productData[0]?.isBundle) {\r\n productData[0]?.bundledOffers?.map((item: any) => {\r\n if (item?.promotionInfo?.[0]?.id) {\r\n const giftId =\r\n item?.promotionInfo?.[0]?.hardwareGift?.[0]?.ids?.length == 1\r\n ? item?.promotionInfo?.[0]?.hardwareGift?.[0]?.ids?.[0]\r\n : '';\r\n if (item?.productType?.toLowerCase() === 'mobile') {\r\n mobileItem['promotionId'] = item?.promotionInfo?.[0]?.id;\r\n mobGiftId = giftId;\r\n } else {\r\n cartData['cartItem'][0]['promotionId'] = item?.promotionInfo?.[0]?.id;\r\n mandatoryGift = giftId;\r\n }\r\n }\r\n if (item?.productType?.toLowerCase() == 'tv' && radioValue) {\r\n cartData.cartItem[0].items.push({ itemType: item?.productType, id: radioValue });\r\n } else if (item?.productType?.toLowerCase() === 'mobile') {\r\n mobileItem.items.push({ itemType: 'RATEPLAN', id: item?.id });\r\n } else cartData.cartItem[0].items.push({ itemType: item?.productType, id: item?.id });\r\n });\r\n mandatoryGift && cartData.cartItem[0].items?.push({ itemType: 'GIFT', id: mandatoryGift });\r\n mobGiftId && mobileItem.items.push({ itemType: 'GIFT', id: mobGiftId });\r\n if (mobileItem?.items?.length > 0) {\r\n cartData?.cartItem?.push(mobileItem);\r\n }\r\n\r\n //If product has tv options\r\n if (tvOptions?.length > 0) {\r\n tvOptions?.forEach((option: any) => {\r\n cartData.cartItem[0].items.push({ itemType: TV_SERVICE_OPTION, id: option?.id });\r\n });\r\n }\r\n } else {\r\n /**Add standlone product such as internet to cart request*/\r\n const mandatoryGift =\r\n productData?.[0]?.promotionInfo?.[0]?.hardwareGift?.[0]?.ids?.length == 1\r\n ? productData?.[0]?.promotionInfo?.[0]?.hardwareGift?.[0]?.ids?.[0]\r\n : '';\r\n cartData.cartItem[0].items.push({\r\n itemType: productData?.[0]?.productType,\r\n id: productData?.[0]?.id\r\n });\r\n mandatoryGift && cartData.cartItem[0].items?.push({ itemType: 'GIFT', id: mandatoryGift });\r\n }\r\n if (chooseGift && chooseGift?.length > 0) {\r\n chooseGift?.map((giftItem: any) => {\r\n giftItem?.parentPoType === 'HOME'\r\n ? cartData?.cartItem?.[0]?.items?.push({ itemType: 'GIFT', id: giftItem?.tuaProdId })\r\n : mobileItem.items?.push({ itemType: 'GIFT', id: giftItem?.tuaProdId });\r\n });\r\n }\r\n /**\r\n * changes added for new internet activation section\r\n */\r\n if (lineCheckData?.accessType) {\r\n cartData?.cartItem?.[0]?.note?.push({\r\n author: 'lineCheckaccessType',\r\n text: lineCheckData?.accessType\r\n });\r\n }\r\n if (lineCheckData?.timeSlot) {\r\n cartData?.cartItem?.[0]?.note?.push({\r\n author: 'lineCheckEarliestActivationDate',\r\n text: lineCheckData?.timeSlot?.start\r\n });\r\n }\r\n /**\r\n * Adding line check address while cart creation\r\n * As part of DEX abandon basket use case\r\n */\r\n try {\r\n const address: any = getCookies('chAddressJson');\r\n const contactMedium: any = [\r\n {\r\n characteristic: {\r\n installationAddress: true,\r\n country: 'CH',\r\n city: address?.selectedAdd?.city,\r\n street1: address?.selectedAdd?.street,\r\n postCode: address?.selectedAdd?.postCode,\r\n street2: address?.selectedAdd?.houseNumber\r\n }\r\n }\r\n ];\r\n cartData.contactMedium = contactMedium;\r\n } catch (error: any) {\r\n // eslint-disable-next-line no-console\r\n console.log('issue at line check address addition in create cart ==>', error);\r\n }\r\n } else if (productType === MOBILE) {\r\n /**Mobile*/\r\n if (enabledP2P) {\r\n cartData = {\r\n relatedParty: [\r\n {\r\n segment: 'RESIDENTIAL'\r\n }\r\n ],\r\n cartItem: [\r\n {\r\n itemType: 'MOBILE',\r\n promotionId: defaultPromo,\r\n items: [\r\n {\r\n itemType: 'RATEPLAN',\r\n id: productData?.[0]?.id ? productData?.[0]?.id : productData,\r\n subscribedInfo: {\r\n installedPlan: P2PSUBSCRIBEDPLAN,\r\n id: P2PData\r\n }\r\n }\r\n ],\r\n processType: {\r\n id: PRE_TO_POST\r\n }\r\n }\r\n ]\r\n };\r\n } else {\r\n cartData = {\r\n relatedParty: [\r\n {\r\n segment: 'RESIDENTIAL'\r\n }\r\n ],\r\n cartItem: [\r\n {\r\n itemType: 'MOBILE',\r\n promotionId: defaultPromo,\r\n items: [\r\n {\r\n itemType: 'RATEPLAN',\r\n id: productData?.[0]?.id ? productData?.[0]?.id : productData,\r\n clientDiscountInfo: discountRef\r\n ? [\r\n {\r\n discountRef: discountRef,\r\n discountType: 'DISCOUNT'\r\n }\r\n ]\r\n : undefined\r\n }\r\n ]\r\n }\r\n ]\r\n };\r\n }\r\n const mandatoryGift =\r\n productData?.[0]?.promotionInfo?.[0]?.hardwareGift?.[0]?.ids?.length == 1\r\n ? productData?.[0]?.promotionInfo?.[0]?.hardwareGift?.[0]?.ids?.[0]\r\n : '';\r\n mandatoryGift && cartData.cartItem[0].items?.push({ itemType: 'GIFT', id: mandatoryGift });\r\n if (chooseGift && chooseGift?.length > 0) {\r\n chooseGift?.map((giftItem: any) => {\r\n giftItem?.parentPoType !== 'HOME' &&\r\n cartData?.cartItem?.[0]?.items?.push({ itemType: 'GIFT', id: giftItem?.tuaProdId });\r\n });\r\n }\r\n }\r\n\r\n if (isQoqaFlow) {\r\n const note = [];\r\n note.push({\r\n author: VOUCHERTYPE,\r\n text: QOQA\r\n });\r\n if (qVoucher !== '') {\r\n note.push({\r\n author: VOUCHERCODE,\r\n text: qVoucher\r\n });\r\n removeLocalStorage('vctype');\r\n }\r\n cartData.cartItem[0]['note'] = note;\r\n } else if (discountRef && discountVersion) {\r\n const note = [];\r\n note?.push({\r\n author: 'offerType',\r\n text: 'ATL'\r\n });\r\n note?.push({\r\n author: 'externalPromotionName',\r\n text: discountRef\r\n });\r\n note?.push({\r\n author: 'offerVersion',\r\n text: discountVersion\r\n });\r\n cartData.cartItem[0]['note'] = note;\r\n }\r\n\r\n // Shogun / rewards (loyalty) flow — append a pointsBurnt note at the\r\n // item level (not the cartItem level). For MOBILE this attaches to the\r\n // RATEPLAN item; for Internet (FIXNET) it attaches to the internet item\r\n // inside the cartItem's items array. We only push the note when it has\r\n // a value so the backend does not receive an empty string.\r\n if (rewardsInfo && cartData?.cartItem?.[0]) {\r\n const { pointsBurnt, rewardOfferId, gloxTokenId } = rewardsInfo;\r\n if (gloxTokenId) {\r\n cartData.guid = gloxTokenId;\r\n }\r\n const rewardsNotes = [\r\n pointsBurnt != null && `${pointsBurnt}` !== '' && { author: 'pointsBurnt', text: `${pointsBurnt}` },\r\n rewardOfferId != null && `${rewardOfferId}` !== '' && { author: 'rewardOfferId', text: `${rewardOfferId}` }\r\n ].filter(Boolean);\r\n\r\n if (rewardsNotes.length > 0) {\r\n cartData?.cartItem?.forEach((ci: any) => {\r\n if (!Array.isArray(ci?.items)) return;\r\n ci.items.forEach((it: any) => {\r\n const itType = `${it?.itemType || ''}`.toUpperCase();\r\n if (itType === 'RATEPLAN' || itType === 'INTERNET') {\r\n it.note = [...(it.note || []), ...rewardsNotes];\r\n }\r\n });\r\n });\r\n }\r\n }\r\n\r\n //To add hardware item while creating cart\r\n if (deviceDetails) {\r\n const deviceCartItem = getDeviceCartItem(deviceDetails);\r\n deviceCartItem && cartData?.cartItem?.[0]?.items?.push(...deviceCartItem);\r\n }\r\n // Get flow parameter from URL query string if in browser\r\n let flow: string | null = null;\r\n if (typeof window !== 'undefined') {\r\n const params = new URLSearchParams(window.location.search);\r\n flow = params.get('flow');\r\n }\r\n \r\n // Add OTT items to cart if session storage exists and flow is 'ott'\r\n const shouldAddOttItems = ottCartData && flow === 'ott';\r\n if (shouldAddOttItems) {\r\n const ottItems = fetchOttItems(ottCartData);\r\n if (ottItems?.length > 0) {\r\n const groupedByTypeAndPromo: {\r\n [key: string]: { itemType: string; promotionId: string; items: any[] };\r\n } = {};\r\n const homeCartItem = cartData?.cartItem?.find((item: any) => item?.itemType === 'HOME');\r\n ottItems.forEach((ottItem: any) => {\r\n const itemType = ottItem?.itemType;\r\n \r\n // Only group OTT items, add others directly\r\n if (itemType === 'OTT') {\r\n const promoId = ottItem?.promotionId?.trim() || 'defaultOttBundle';\r\n const groupKey = `${'OTT'}_${promoId}`;\r\n\r\n if (!groupedByTypeAndPromo[groupKey]) {\r\n groupedByTypeAndPromo[groupKey] = {\r\n itemType: itemType,\r\n promotionId: promoId,\r\n items: []\r\n };\r\n }\r\n groupedByTypeAndPromo[groupKey].items.push(...(ottItem?.items || []));\r\n } else {\r\n // Add non-OTT items to HOME cartItem's items array\r\n \r\n if (homeCartItem && homeCartItem.items && ottItem?.items) {\r\n homeCartItem.items.push(...ottItem.items);\r\n }\r\n }\r\n });\r\n\r\n // Add each grouped OTT item as a separate cart item list\r\n Object.keys(groupedByTypeAndPromo).forEach((groupKey) => {\r\n const group = groupedByTypeAndPromo[groupKey];\r\n cartData?.cartItem.push({\r\n itemType: group.itemType,\r\n promotionId: group.promotionId,\r\n items: group.items\r\n });\r\n });\r\n }\r\n }\r\n\r\n const options = {\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n }\r\n };\r\n\r\n const URL = cartUrl + APIResourceConstants.CREATE_CARTV3;\r\n if (Object.keys(cartData)?.length > 0) {\r\n const createCartV2Resp: any = await ApiServiceV2.getApiServiceInstance()\r\n .post(URL, cartData, options)\r\n .then((res: any) => {\r\n removeLocalStorage('isB2BCustomer');\r\n if (res.status == 200) {\r\n return res?.data;\r\n }\r\n })\r\n .catch((error) => {\r\n if (error?.response?.data?.code || error?.response?.status === 504) {\r\n errorTrackingDataLayer(error?.response);\r\n }\r\n });\r\n if (createCartV2Resp.error) {\r\n throw createCartV2Resp.error;\r\n } else {\r\n return createCartV2Resp;\r\n }\r\n }\r\n};\r\n\r\nexport const fetchLinetableContent = async (slugurl: string, params: any): Promise<any> => {\r\n try {\r\n const resp = await CMSStoryblokServiceV2.get(slugurl, params)\r\n .then((response: any) => {\r\n const contentTable = response?.data?.story?.content?.body;\r\n // return comp;\r\n for (const comp of contentTable) {\r\n if (\r\n comp.component == 'productTableV2' ||\r\n comp.component === 'productTableWithOutLC' ||\r\n comp.component === 'prodConfigContainer'\r\n ) {\r\n return comp;\r\n } else if (comp.component == 'roamingProductTable') {\r\n return comp?.productTable?.[0];\r\n }\r\n }\r\n })\r\n .catch((err: any) => {\r\n throw err;\r\n });\r\n return resp;\r\n } catch (error) {\r\n return error;\r\n }\r\n};\r\n\r\nexport const getStaticContent = (language: any = 'en', endPoints: any) => {\r\n try {\r\n return CMSStoryblokServiceV2.get(endPoints, {\r\n dimension: language,\r\n per_page: 1000,\r\n type: 'B2C'\r\n })\r\n .then((res: any) => {\r\n const response: any = {};\r\n (res?.data?.datasource_entries || []).map((entry: any) => {\r\n response[entry.name] =\r\n entry.dimension_value != null ? entry.dimension_value : entry.value;\r\n });\r\n try {\r\n localStorage.removeItem('sbstaticcontent');\r\n localStorage.setItem('sbstaticcontent', JSON.stringify(response));\r\n } catch {\r\n //\r\n }\r\n return response;\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n } catch {\r\n throw Error('Promise failed');\r\n }\r\n};\r\n\r\nexport const fetchOfferingDataLineTableV2 = async (\r\n params: any,\r\n uniqueId: any,\r\n endpoint: any,\r\n existingCustomer?: boolean,\r\n subscriptionType?: string,\r\n enableReturnPromo?: boolean,\r\n P2PEnabled?: boolean,\r\n pegaIntegration?: boolean,\r\n deviceUltimateBundle?:boolean,\r\n): Promise<any> => {\r\n localStorage.removeItem('entertainment');\r\n let options: any;\r\n options = {\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n }\r\n };\r\n if (enableReturnPromo) {\r\n options.params = {\r\n returnPromo: true\r\n };\r\n }\r\n if (P2PEnabled) {\r\n options.params = {\r\n journey: 'P2P'\r\n };\r\n }\r\n if(deviceUltimateBundle){\r\n options.params = {\r\n ...options.params,\r\n journey: 'FPB',\r\n }\r\n }\r\n\r\n let URL = endpoint + APIResourceConstants.LINE_TABLEV2;\r\n if (pegaIntegration && localStorage.getItem('prospectId')) {\r\n options.headers['x-sunrise-prospect-id'] = localStorage.getItem('prospectId');\r\n URL = endpoint + APIResourceConstants.LINE_TABLEV3;\r\n }\r\n const subscriptionUrl = subscriptionType\r\n ? URL + APIResourceConstants.SUBSCRIPTION + subscriptionType\r\n : URL;\r\n //US_31295\r\n const finalUrl = existingCustomer || subscriptionType? subscriptionUrl : URL;\r\n const productDynamicData: any = await ApiServiceV2.getApiServiceInstance()\r\n .post(finalUrl, params, options)\r\n .then((res): any => {\r\n if (res.status == 200) {\r\n return res?.data;\r\n }\r\n })\r\n .catch((err) => {\r\n if (err?.response?.data?.code || err?.response?.status === 504) {\r\n errorTrackingDataLayer(err?.response);\r\n }\r\n });\r\n if (productDynamicData.error) {\r\n return productDynamicData.error;\r\n } else {\r\n return { [uniqueId]: productDynamicData };\r\n }\r\n};\r\n\r\n/**\r\n * Shogun xSell (rewards/loyalty) flow: fetches offer data using `gloxtoken`\r\n * as a query parameter. The offer endpoint expects a POST request, so we\r\n * send an empty JSON body `{}` — the backend resolves eligible products\r\n * from the token only.\r\n */\r\nexport const fetchShogunOfferData = async (\r\n gloxTokenId: string,\r\n uniqueId: string,\r\n endpoint: string\r\n): Promise<any> => {\r\n const options: any = {\r\n params: { gloxTokenId: gloxTokenId },\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n }\r\n };\r\n const URL = endpoint + APIResourceConstants.LINE_TABLEV2;\r\n const productDynamicData: any = await ApiServiceV2.getApiServiceInstance()\r\n .post(URL, [], options)\r\n .then((res: any): any => {\r\n if (res.status === 200) {\r\n return res?.data;\r\n }\r\n })\r\n .catch((err: any) => {\r\n if (err?.response?.data?.code || err?.response?.status === 504) {\r\n errorTrackingDataLayer(err?.response);\r\n }\r\n });\r\n if (!productDynamicData || productDynamicData.error) {\r\n throw new Error('Shogun offer API failed');\r\n }\r\n return { [uniqueId]: productDynamicData };\r\n};\r\n\r\nexport const fetchSubscriptionData = async (category: any, endpoint: any): Promise<any> => {\r\n let options: any;\r\n options = {\r\n params: {},\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n }\r\n };\r\n options.params = {\r\n category: category\r\n };\r\n const URL = endpoint;\r\n const subscriptionData: any = await ApiServiceV2.getApiServiceInstance()\r\n .get(URL, options)\r\n .then((res): any => {\r\n if (res.status == 200) {\r\n return res?.data;\r\n } else {\r\n return res?.status;\r\n }\r\n })\r\n .catch((err: any) => {\r\n if (err?.response?.data?.code || err?.response?.status === 504) {\r\n errorTrackingDataLayer(err?.response);\r\n }\r\n });\r\n if (subscriptionData?.error) {\r\n return subscriptionData?.error;\r\n } else {\r\n return { subscriptionData };\r\n }\r\n};\r\n\r\nexport const getVocherPromotion = async (productID: string, voucher: string) => {\r\n try {\r\n const options = {\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n },\r\n params: {\r\n offerIds: productID,\r\n voucherCode: voucher\r\n }\r\n };\r\n\r\n const URL =\r\n LineTableBasicPropConfig?.getInstance()?.getBaseUrl() +\r\n `${APIResourceConstants.VOUCHER_PROMOTIONS}`;\r\n await ApiServiceV2.getApiServiceInstance()\r\n .get(URL, options)\r\n .then((res): any => {\r\n if (res.status == 200) {\r\n return res?.data;\r\n }\r\n });\r\n } catch (error) {}\r\n};\r\n\r\nexport const validateP2P = async (msisdn: any, endpoint: any): Promise<any> => {\r\n let options: any;\r\n options = {\r\n params: {},\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n }\r\n };\r\n options.params = {\r\n msisdn: msisdn\r\n };\r\n const URL = endpoint;\r\n return await ApiServiceV2.getApiServiceInstance()\r\n .get(URL, options)\r\n .then((res): any => {\r\n if (res?.data?.preToPostConversionStatus == 'OK') {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n })\r\n .catch((err) => {\r\n if (err?.response?.data?.code || err?.response?.status === 504) {\r\n errorTrackingDataLayer(err?.response);\r\n }\r\n console.log('err', err);\r\n return false;\r\n });\r\n};\r\n\r\nexport const getDeviceDetails = async (deviceID: any, endpoint: any): Promise<any> => {\r\n try {\r\n let options: any;\r\n options = {\r\n params: {},\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n }\r\n };\r\n const URL = endpoint + APIResourceConstants.HARDWARES + `baseProduct__${deviceID}`;\r\n const deviceData: any = await ApiServiceV2.getApiServiceInstance()\r\n .get(URL, options)\r\n .then((res: any) => {\r\n if (res?.status === 200 && Object.keys(res?.data)?.length > 0) {\r\n return res?.data;\r\n } else {\r\n return null;\r\n }\r\n });\r\n return deviceData;\r\n } catch (err) {\r\n // eslint-disable-next-line no-console\r\n console.log('err', err);\r\n return null;\r\n }\r\n};\r\n\r\nexport const getDeviceModelsList = async (brandId: any, endpoint: any): Promise<any> => {\r\n try {\r\n let options: any;\r\n options = {\r\n params: {},\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n }\r\n };\r\n const URL = endpoint + APIResourceConstants.HARDWARE_DEVICES + `manufacturerName__${brandId}`;\r\n const deviceData: any = await ApiServiceV2.getApiServiceInstance()\r\n .get(URL, options)\r\n .then((res: any) => {\r\n if (res?.status === 200 && res?.data?.hardwares?.length > 0) {\r\n return res?.data;\r\n } else {\r\n return null;\r\n }\r\n });\r\n return deviceData;\r\n } catch (err) {\r\n // eslint-disable-next-line no-console\r\n console.log('err', err);\r\n return null;\r\n }\r\n};\r\n\r\nexport const trackPegaEvents = async (\r\n endpoint: any,\r\n payload = {},\r\n prospectId: string\r\n): Promise<any> => {\r\n let options: any;\r\n options = {\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': apiResConstants.X_SUN_CHAL,\r\n 'x-sunrise-prospect-id': prospectId\r\n }\r\n };\r\n\r\n let URL = endpoint + APIResourceConstants?.CUSTOMER_EVENTS;\r\n const productDynamicData: any = await ApiServiceV2.getApiServiceInstance()\r\n .post(URL, payload, options)\r\n .then((res): any => {\r\n if (res.status == 200) {\r\n // eslint-disable-next-line no-console\r\n console.log('trackPegaEvents result.data', res.data);\r\n return res?.data;\r\n }\r\n })\r\n .catch((err) => {\r\n if (err?.response?.data?.code || err?.response?.status === 504) {\r\n errorTrackingDataLayer(err?.response);\r\n }\r\n });\r\n};\r\n\r\nexport const createCartWinV2 = async (\r\n productData: any,\r\n radioValue: string,\r\n defaultPromo: string,\r\n cartUrl: string,\r\n chooseGift:any\r\n): Promise<any> => {\r\n let cartData: any = {};\r\n /**WIN FLows*/\r\n let mobGiftId = '';\r\n let mandatoryGift = '';\r\n const getCoorelationIdFromCookie = Cookies.get('one-commerce-linecheckcorrelationid') ?? '';\r\n const lineCheckData = getAccessDataFromLineCheck(productData?.[0]?.id);\r\n cartData = {\r\n relatedParty: [\r\n {\r\n id: 'anonymous',\r\n segment: 'RESIDENTIAL'\r\n }\r\n ],\r\n cartItem: [\r\n {\r\n itemType: 'HOME',\r\n promotionId: defaultPromo,\r\n items: [],\r\n note: [\r\n {\r\n author: 'linecheckCorrelationId',\r\n text: getCoorelationIdFromCookie\r\n }\r\n ]\r\n }\r\n ]\r\n };\r\n /**for 4P bundles*/\r\n const mobileItem: any = {\r\n itemType: 'MOBILE',\r\n promotionId: defaultPromo,\r\n items: []\r\n };\r\n /**Check if bundle or Internet and add it to cart request*/\r\n if (productData?.[0]?.isBundle) {\r\n productData?.[0]?.bundledOffers?.map((item: any) => {\r\n if (item?.promotionInfo?.[0]?.id) {\r\n const giftId =\r\n item?.promotionInfo?.[0]?.hardwareGift?.[0]?.ids?.length == 1\r\n ? item?.promotionInfo?.[0]?.hardwareGift?.[0]?.ids?.[0]\r\n : '';\r\n if (item?.productType?.toLowerCase() === 'mobile') {\r\n mobileItem['promotionId'] = item?.promotionInfo?.[0]?.id;\r\n mobGiftId = giftId;\r\n } else {\r\n cartData['cartItem'][0]['promotionId'] = item?.promotionInfo?.[0]?.id;\r\n mandatoryGift = giftId;\r\n }\r\n }\r\n if (item?.productType?.toLowerCase() == 'tv' && radioValue) {\r\n cartData.cartItem[0].items.push({ itemType: item?.productType, id: radioValue });\r\n } else if (item?.productType?.toLowerCase() === 'mobile') {\r\n mobileItem.items.push({ itemType: 'RATEPLAN', id: item?.id });\r\n } else cartData.cartItem[0].items.push({ itemType: item?.productType, id: item?.id });\r\n });\r\n mandatoryGift && cartData?.cartItem?.[0].items?.push({ itemType: 'GIFT', id: mandatoryGift });\r\n mobGiftId && mobileItem?.items?.push({ itemType: 'GIFT', id: mobGiftId });\r\n\r\n if (mobileItem?.items?.length > 0) {\r\n cartData?.cartItem?.push(mobileItem);\r\n }\r\n if (chooseGift && chooseGift?.length > 0) {\r\n chooseGift?.map((giftItem: any) => {\r\n cartData?.cartItem?.[0]?.items?.push({ itemType: 'GIFT', id: giftItem?.tuaProdId })\r\n })\r\n }\r\n } else {\r\n /**Add standlone product such as internet to cart request*/\r\n cartData.cartItem[0].items.push({\r\n itemType: productData?.[0]?.productType,\r\n id: productData?.[0]?.id\r\n });\r\n }\r\n /**\r\n * changes added for new internet activation section\r\n */\r\n if (lineCheckData?.accessType) {\r\n cartData?.cartItem?.[0]?.note?.push({\r\n author: 'lineCheckaccessType',\r\n text: lineCheckData?.accessType,\r\n });\r\n }\r\n if (lineCheckData?.timeSlot) {\r\n cartData?.cartItem?.[0]?.note?.push({\r\n author: 'lineCheckEarliestActivationDate',\r\n text: lineCheckData?.timeSlot?.start,\r\n });\r\n }\r\n /**\r\n * Adding line check address while cart creation\r\n * As part of DEX abandon basket use case\r\n */\r\n try {\r\n const address: any = getCookies('chAddressJson');\r\n const contactMedium: any = [\r\n {\r\n characteristic: {\r\n installationAddress: true,\r\n country: 'CH',\r\n city: address?.selectedAdd?.city,\r\n street1: address?.selectedAdd?.street,\r\n postCode: address?.selectedAdd?.postCode,\r\n street2: address?.selectedAdd?.houseNumber\r\n }\r\n }\r\n ];\r\n cartData.contactMedium = contactMedium;\r\n } catch (error: any) {\r\n // eslint-disable-next-line no-console\r\n console.log('issue at line check address addition in create cart ==>', error);\r\n }\r\n\r\n const options = {\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n }\r\n };\r\n const endPoint = LineTableBasicPropConfig?.getInstance()?.getBaseUrl();\r\n\r\n const URL = `${endPoint}${API_BASE_BASEPOINT.CART_MGMT}/${APIResourceConstants.CREATE_CARTV2}`;\r\n if (Object.keys(cartData)?.length > 0) {\r\n const createCartV2Resp: any = await ApiServiceV2.getApiServiceInstance()\r\n .post(URL, cartData, options)\r\n .then((res: any) => {\r\n if (res.status == 200) {\r\n return res?.data;\r\n }\r\n });\r\n if (createCartV2Resp.error) {\r\n throw createCartV2Resp.error;\r\n } else {\r\n return createCartV2Resp;\r\n }\r\n }\r\n}\r\n\r\nexport const fetchOttServiceOptions = async (): Promise<any> => {\r\n const endPoint = LineTableBasicPropConfig?.getInstance()?.getBaseUrl();\r\n const url = `${endPoint}${APIResourceConstants.TV_SERVICE_OPTIONS_V2}`;\r\n const options = {\r\n params: {},\r\n headers: {\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL,\r\n 'x-correlation-id': generateUID()\r\n }\r\n };\r\n try {\r\n const optionsData: any = await ApiServiceV2.getApiServiceInstance()\r\n .get(url, options)\r\n .then((res) => {\r\n return res?.data?.length > 0 ? res?.data : [];\r\n });\r\n return optionsData;\r\n } catch (error) {\r\n // eslint-disable-next-line no-console\r\n console.log(error);\r\n }\r\n};\r\n"],"names":["AuthData","undefined","window","Cookies","get","JSON","parse","fetchCountryList","name","lang","url","TTL","__awaiter","getCountryData","getLocalStorageWithExpiry","sbParams","language","type","stories","_a","CMSStoryblokServiceV2","data","length","setLocalStoreWithExpiry","e","console","error","fetchOfferingDataV2","requestBody","returnPromo","localStorage","removeItem","options","headers","generateUID","APIResourceConstants","X_SUN_CHAL","params","URL","LINE_TABLEV2","productDynamicData","ApiServiceV2","getApiServiceInstance","post","then","res","status","response","forEach","id","_b","code","_c","errorTrackingDataLayer","log","createCartV2","productData_1","radioValue_1","defaultPromo_1","cartUrl_1","productType_1","chooseGift_1","enabledP2P_1","P2PData_1","isQoqaFlow_1","args_1","productData","radioValue","defaultPromo","cartUrl","productType","chooseGift","enabledP2P","P2PData","isQoqaFlow","qVoucher","deviceDetails","tvOptions","discountRef","discountVersion","rewardsInfo","cartData","ottCartData","getSessionStorage","ONE_ECOMMERCE_OTT","FIXNET","mobGiftId","mandatoryGift","getCoorelationIdFromCookie","lineCheckData","getAccessDataFromLineCheck","relatedParty","segment","cartItem","itemType","promotionId","items","note","author","text","mobileItem","isBundle","_e","_d","bundledOffers","map","item","promotionInfo","giftId","_g","_f","hardwareGift","ids","_m","_l","_k","_j","_h","_o","toLowerCase","_q","_p","_s","_r","_t","push","_u","option","TV_SERVICE_OPTION","_v","_w","_x","_y","giftItem","parentPoType","tuaProdId","accessType","_1","_z","_0","timeSlot","_4","_2","_3","_5","start","address","getCookies","contactMedium","characteristic","installationAddress","country","city","_6","selectedAdd","street1","_7","street","postCode","_8","street2","_9","houseNumber","MOBILE","_10","_11","subscribedInfo","installedPlan","P2PSUBSCRIBEDPLAN","processType","PRE_TO_POST","_12","_13","clientDiscountInfo","discountType","_19","_17","_16","_15","_14","_18","_25","_24","_23","_22","_21","_20","_26","VOUCHERTYPE","QOQA","VOUCHERCODE","removeLocalStorage","_27","pointsBurnt","rewardOfferId","gloxTokenId","guid","rewardsNotes","filter","Boolean","_28","ci","Array","isArray","it","itType","toUpperCase","deviceCartItem","contractDuration","selectedVarientDetails","hardwarePrices","smartUpgradeInstallments","duration","upFrontValue","upFrontPayment","value","insuranceValue","insurance","deviceItem","HARDWARE","contractTerm","getDeviceNotes","flexItem","DEVICE_INSURANCE","insuranceName","getDeviceCartItem","_30","_29","_31","flow","URLSearchParams","location","search","ottItems","fetchOttItems","groupedByTypeAndPromo","homeCartItem","_32","find","ottItem","promoId","trim","groupKey","Object","keys","group","CREATE_CARTV3","_33","createCartV2Resp","catch","fetchLinetableContent","slugurl","contentTable","story","content","body","comp","component","productTable","err","getStaticContent","endPoints","dimension","per_page","datasource_entries","entry","dimension_value","setItem","stringify","Error","fetchOfferingDataLineTableV2","uniqueId","endpoint","existingCustomer","subscriptionType","enableReturnPromo","P2PEnabled","pegaIntegration","deviceUltimateBundle","journey","assign","getItem","LINE_TABLEV3","subscriptionUrl","SUBSCRIPTION","finalUrl","fetchShogunOfferData","fetchSubscriptionData","category","subscriptionData","getVocherPromotion","productID","voucher","offerIds","voucherCode","LineTableBasicPropConfig","getInstance","getBaseUrl","VOUCHER_PROMOTIONS","validateP2P","msisdn","preToPostConversionStatus","getDeviceDetails","deviceID","HARDWARES","getDeviceModelsList","brandId","HARDWARE_DEVICES","hardwares","trackPegaEvents","endpoint_1","payload","prospectId","apiResConstants","CUSTOMER_EVENTS","createCartWinV2","API_BASE_BASEPOINT","CART_MGMT","CREATE_CARTV2","fetchOttServiceOptions","TV_SERVICE_OPTIONS_V2","optionsData"],"mappings":"mmCA6EA,IAAIA,OAAkCC,WAAXC,QAAwBC,EAAQC,IAAI,eAC/DJ,EAAWA,GAAYK,KAAKC,MAAMN,GAE3B,MAAMO,EAAmB,CAAOC,EAAcC,EAAcC,EAAaC,IAAeC,OAAA,OAAA,OAAA,EAAA,kBAC7F,MAAMC,EAAiBC,EAA0B,GAAGN,KAAQC,iBAC5D,GAAII,EACF,OAAOA,EAE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sourcesContent":["import { ApiServiceV2, CMSStoryblokServiceV2 } from '@sunrise-upc/ajax-lib';\r\nimport {\r\n getCookies,\r\n getLocalStorageWithExpiry,\r\n getSessionStorage,\r\n removeLocalStorage,\r\n setLocalStoreWithExpiry\r\n} from '../utils/utils';\r\nimport { API_BASE_BASEPOINT, APIResourceConstants } from './api-constants';\r\nimport Cookies from 'js-cookie';\r\nimport { v4 as generateUID } from 'uuid';\r\nimport {\r\n DEVICE_INSURANCE,\r\n FIXNET,\r\n HARDWARE,\r\n MOBILE,\r\n ONE_ECOMMERCE_OTT,\r\n P2PSUBSCRIBEDPLAN,\r\n PRE_TO_POST,\r\n QOQA,\r\n TV_SERVICE_OPTION,\r\n VOUCHERCODE,\r\n VOUCHERTYPE\r\n} from '../utils/constants';\r\nimport { getAccessDataFromLineCheck } from '../components/lineTable/LineTableV3.utils';\r\nimport { LineTableBasicPropConfig } from './LineTableBasicPropConfig';\r\nimport { errorTrackingDataLayer } from '../utils/AnalyticsUtils';\r\nimport { apiResConstants } from '../components/LineCheckV3/APIResourceConstants';\r\nimport { getDeviceNotes } from '../components/UltimateBundleLinetable/DpTableUtils';\r\nimport {fetchOttItems} from '../components/StaticLineTable/Product.utils'\r\n\r\n// Device cart utility functions moved here to avoid circular dependency\r\nconst getDeviceCartNotes = (deviceDetails: any, upFrontValue: string) => {\r\n let note = '';\r\n const smartUpgradeInstallments =\r\n deviceDetails?.selectedVarientDetails?.hardwarePrices?.smartUpgradeInstallments;\r\n const installments = deviceDetails?.selectedVarientDetails?.hardwarePrices?.installments;\r\n const basePrice = deviceDetails?.selectedVarientDetails?.hardwarePrices?.basePrice;\r\n\r\n if (smartUpgradeInstallments) {\r\n note = `${smartUpgradeInstallments?.duration} months, CHF ${upFrontValue} upfront, CHF ${smartUpgradeInstallments?.monthlyPayment?.value}/month`;\r\n } else if (installments) {\r\n note = `${installments?.duration} months, CHF ${installments?.monthlyPayment?.value}/month`;\r\n } else if (basePrice) {\r\n note = `CHF ${basePrice?.value} one-time payment`;\r\n }\r\n return note;\r\n};\r\n\r\nconst getDeviceCartItem = (deviceDetails: any) => {\r\n let items = [];\r\n const contractDuration =\r\n deviceDetails?.selectedVarientDetails?.hardwarePrices?.smartUpgradeInstallments?.duration ?? 0;\r\n const upFrontValue =\r\n deviceDetails?.selectedVarientDetails?.hardwarePrices?.smartUpgradeInstallments?.upFrontPayment\r\n ?.value ?? 0;\r\n const insuranceValue =\r\n deviceDetails?.selectedVarientDetails?.hardwarePrices?.smartUpgradeInstallments?.insurance\r\n ?.value ?? 0;\r\n const deviceItem = {\r\n itemType: HARDWARE,\r\n id: deviceDetails?.selectedVarientDetails?.id ?? '',\r\n contractTerm: contractDuration,\r\n note: getDeviceNotes(deviceDetails, upFrontValue)\r\n };\r\n deviceItem && items?.push(deviceItem);\r\n\r\n if (insuranceValue) {\r\n const flexItem = {\r\n itemType: DEVICE_INSURANCE,\r\n id: deviceDetails?.insuranceName\r\n };\r\n items?.push(flexItem);\r\n }\r\n return items?.length > 0 ? items : null;\r\n};\r\n\r\nlet AuthData: any = typeof window !== undefined && Cookies.get('sunriseAuth');\r\nAuthData = AuthData && JSON.parse(AuthData);\r\n\r\nexport const fetchCountryList = async (name: string, lang: string, url: string, TTL: number) => {\r\n const getCountryData = getLocalStorageWithExpiry(`${name}_${lang}_countryData`);\r\n if (getCountryData) {\r\n return getCountryData;\r\n } else {\r\n try {\r\n const sbParams = {\r\n language: lang,\r\n type: 'B2C'\r\n };\r\n const res = await CMSStoryblokServiceV2.get(url, sbParams);\r\n const stories = res.data?.stories;\r\n if (stories && stories.length > 0)\r\n setLocalStoreWithExpiry(`${name}_${lang}_countryData`, stories, TTL);\r\n return stories;\r\n } catch (e: any) {\r\n // eslint-disable-next-line no-console\r\n console.error(e);\r\n return e;\r\n }\r\n }\r\n};\r\n\r\nexport const fetchOfferingDataV2 = async (\r\n requestBody: any,\r\n url: any,\r\n returnPromo?: boolean\r\n): Promise<any> => {\r\n try {\r\n localStorage.removeItem('entertainment');\r\n const options = {\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n },\r\n params: {}\r\n };\r\n if (returnPromo) {\r\n options.params = {\r\n returnPromo: true\r\n };\r\n }\r\n const URL = url + APIResourceConstants.LINE_TABLEV2;\r\n const productDynamicData: any = await ApiServiceV2.getApiServiceInstance()\r\n .post(URL, requestBody, options)\r\n .then((res): any => {\r\n if (res.status == 200) {\r\n return res?.data;\r\n }\r\n });\r\n if (productDynamicData.error) {\r\n return productDynamicData.error;\r\n } else {\r\n const response: any[] = [];\r\n productDynamicData?.forEach((data: any) => {\r\n response[data.id] = data;\r\n });\r\n return response;\r\n }\r\n } catch (error: any) {\r\n if (error?.response?.data?.code || error?.response?.status === 504) {\r\n errorTrackingDataLayer(error?.response);\r\n }\r\n // eslint-disable-next-line no-console\r\n console.log('error--->', error);\r\n }\r\n};\r\n\r\nexport const createCartV2 = async (\r\n productData: any,\r\n radioValue: string,\r\n defaultPromo: string,\r\n cartUrl: string,\r\n productType: string,\r\n chooseGift?: any,\r\n enabledP2P?: any,\r\n P2PData?: any,\r\n isQoqaFlow?: boolean,\r\n qVoucher: any = '',\r\n deviceDetails?: any,\r\n tvOptions?: any,\r\n discountRef?: string,\r\n discountVersion?: string,\r\n // Shogun/rewards (loyalty) flow: when the user redeems loyalty points we must\r\n // attach a `pointsBurnt` note at the item level — the RATEPLAN item for\r\n // MOBILE and the internet item for FIXNET — so the backend can apply the\r\n // burn. See StaticProduct.tsx (isShogunFlow branch).\r\n rewardsInfo?: { pointsBurnt?: string | number; rewardOfferId?: string | number; gloxTokenId?: string | null }\r\n): Promise<any> => {\r\n let cartData: any = {};\r\n /**WIN FLows*/\r\n \r\n // Get OTT data from session storage\r\n const ottCartData = getSessionStorage(ONE_ECOMMERCE_OTT);\r\n \r\n if (productType === FIXNET) {\r\n let mobGiftId = '';\r\n let mandatoryGift = '';\r\n const getCoorelationIdFromCookie = Cookies.get('one-commerce-linecheckcorrelationid') ?? '';\r\n const lineCheckData = getAccessDataFromLineCheck(productData?.[0]?.id);\r\n cartData = {\r\n relatedParty: [\r\n {\r\n id: 'anonymous',\r\n segment: 'RESIDENTIAL'\r\n }\r\n ],\r\n cartItem: [\r\n {\r\n itemType: 'HOME',\r\n promotionId: defaultPromo,\r\n items: [],\r\n note: [\r\n {\r\n author: 'linecheckCorrelationId',\r\n text: getCoorelationIdFromCookie\r\n }\r\n ]\r\n }\r\n ]\r\n };\r\n /**for 4P bundles*/\r\n const mobileItem: any = {\r\n itemType: 'MOBILE',\r\n promotionId: defaultPromo,\r\n items: []\r\n };\r\n /**Check if bundle or Internet and add it to cart request*/\r\n if (productData[0]?.isBundle) {\r\n productData[0]?.bundledOffers?.map((item: any) => {\r\n if (item?.promotionInfo?.[0]?.id) {\r\n const giftId =\r\n item?.promotionInfo?.[0]?.hardwareGift?.[0]?.ids?.length == 1\r\n ? item?.promotionInfo?.[0]?.hardwareGift?.[0]?.ids?.[0]\r\n : '';\r\n if (item?.productType?.toLowerCase() === 'mobile') {\r\n mobileItem['promotionId'] = item?.promotionInfo?.[0]?.id;\r\n mobGiftId = giftId;\r\n } else {\r\n cartData['cartItem'][0]['promotionId'] = item?.promotionInfo?.[0]?.id;\r\n mandatoryGift = giftId;\r\n }\r\n }\r\n if (item?.productType?.toLowerCase() == 'tv' && radioValue) {\r\n cartData.cartItem[0].items.push({ itemType: item?.productType, id: radioValue });\r\n } else if (item?.productType?.toLowerCase() === 'mobile') {\r\n mobileItem.items.push({ itemType: 'RATEPLAN', id: item?.id });\r\n } else cartData.cartItem[0].items.push({ itemType: item?.productType, id: item?.id });\r\n });\r\n mandatoryGift && cartData.cartItem[0].items?.push({ itemType: 'GIFT', id: mandatoryGift });\r\n mobGiftId && mobileItem.items.push({ itemType: 'GIFT', id: mobGiftId });\r\n if (mobileItem?.items?.length > 0) {\r\n cartData?.cartItem?.push(mobileItem);\r\n }\r\n\r\n //If product has tv options\r\n if (tvOptions?.length > 0) {\r\n tvOptions?.forEach((option: any) => {\r\n cartData.cartItem[0].items.push({ itemType: TV_SERVICE_OPTION, id: option?.id });\r\n });\r\n }\r\n } else {\r\n /**Add standlone product such as internet to cart request*/\r\n const mandatoryGift =\r\n productData?.[0]?.promotionInfo?.[0]?.hardwareGift?.[0]?.ids?.length == 1\r\n ? productData?.[0]?.promotionInfo?.[0]?.hardwareGift?.[0]?.ids?.[0]\r\n : '';\r\n cartData.cartItem[0].items.push({\r\n itemType: productData?.[0]?.productType,\r\n id: productData?.[0]?.id\r\n });\r\n mandatoryGift && cartData.cartItem[0].items?.push({ itemType: 'GIFT', id: mandatoryGift });\r\n }\r\n if (chooseGift && chooseGift?.length > 0) {\r\n chooseGift?.map((giftItem: any) => {\r\n giftItem?.parentPoType === 'HOME'\r\n ? cartData?.cartItem?.[0]?.items?.push({ itemType: 'GIFT', id: giftItem?.tuaProdId })\r\n : mobileItem.items?.push({ itemType: 'GIFT', id: giftItem?.tuaProdId });\r\n });\r\n }\r\n /**\r\n * changes added for new internet activation section\r\n */\r\n if (lineCheckData?.accessType) {\r\n cartData?.cartItem?.[0]?.note?.push({\r\n author: 'lineCheckaccessType',\r\n text: lineCheckData?.accessType\r\n });\r\n }\r\n if (lineCheckData?.timeSlot) {\r\n cartData?.cartItem?.[0]?.note?.push({\r\n author: 'lineCheckEarliestActivationDate',\r\n text: lineCheckData?.timeSlot?.start\r\n });\r\n }\r\n /**\r\n * Adding line check address while cart creation\r\n * As part of DEX abandon basket use case\r\n */\r\n try {\r\n const address: any = getCookies('chAddressJson');\r\n const contactMedium: any = [\r\n {\r\n characteristic: {\r\n installationAddress: true,\r\n country: 'CH',\r\n city: address?.selectedAdd?.city,\r\n street1: address?.selectedAdd?.street,\r\n postCode: address?.selectedAdd?.postCode,\r\n street2: address?.selectedAdd?.houseNumber\r\n }\r\n }\r\n ];\r\n cartData.contactMedium = contactMedium;\r\n } catch (error: any) {\r\n // eslint-disable-next-line no-console\r\n console.log('issue at line check address addition in create cart ==>', error);\r\n }\r\n } else if (productType === MOBILE) {\r\n /**Mobile*/\r\n if (enabledP2P) {\r\n cartData = {\r\n relatedParty: [\r\n {\r\n segment: 'RESIDENTIAL'\r\n }\r\n ],\r\n cartItem: [\r\n {\r\n itemType: 'MOBILE',\r\n promotionId: defaultPromo,\r\n items: [\r\n {\r\n itemType: 'RATEPLAN',\r\n id: productData?.[0]?.id ? productData?.[0]?.id : productData,\r\n subscribedInfo: {\r\n installedPlan: P2PSUBSCRIBEDPLAN,\r\n id: P2PData\r\n }\r\n }\r\n ],\r\n processType: {\r\n id: PRE_TO_POST\r\n }\r\n }\r\n ]\r\n };\r\n } else {\r\n cartData = {\r\n relatedParty: [\r\n {\r\n segment: 'RESIDENTIAL'\r\n }\r\n ],\r\n cartItem: [\r\n {\r\n itemType: 'MOBILE',\r\n promotionId: defaultPromo,\r\n items: [\r\n {\r\n itemType: 'RATEPLAN',\r\n id: productData?.[0]?.id ? productData?.[0]?.id : productData,\r\n clientDiscountInfo: discountRef\r\n ? [\r\n {\r\n discountRef: discountRef,\r\n discountType: 'DISCOUNT'\r\n }\r\n ]\r\n : undefined\r\n }\r\n ]\r\n }\r\n ]\r\n };\r\n }\r\n const mandatoryGift =\r\n productData?.[0]?.promotionInfo?.[0]?.hardwareGift?.[0]?.ids?.length == 1\r\n ? productData?.[0]?.promotionInfo?.[0]?.hardwareGift?.[0]?.ids?.[0]\r\n : '';\r\n mandatoryGift && cartData.cartItem[0].items?.push({ itemType: 'GIFT', id: mandatoryGift });\r\n if (chooseGift && chooseGift?.length > 0) {\r\n chooseGift?.map((giftItem: any) => {\r\n giftItem?.parentPoType !== 'HOME' &&\r\n cartData?.cartItem?.[0]?.items?.push({ itemType: 'GIFT', id: giftItem?.tuaProdId });\r\n });\r\n }\r\n }\r\n\r\n if (isQoqaFlow) {\r\n const note = [];\r\n note.push({\r\n author: VOUCHERTYPE,\r\n text: QOQA\r\n });\r\n if (qVoucher !== '') {\r\n note.push({\r\n author: VOUCHERCODE,\r\n text: qVoucher\r\n });\r\n removeLocalStorage('vctype');\r\n }\r\n cartData.cartItem[0]['note'] = note;\r\n } else if (discountRef && discountVersion) {\r\n const note = [];\r\n note?.push({\r\n author: 'offerType',\r\n text: 'ATL'\r\n });\r\n note?.push({\r\n author: 'externalPromotionName',\r\n text: discountRef\r\n });\r\n note?.push({\r\n author: 'offerVersion',\r\n text: discountVersion\r\n });\r\n cartData.cartItem[0]['note'] = note;\r\n }\r\n\r\n // Shogun / rewards (loyalty) flow — append a pointsBurnt note at the\r\n // item level (not the cartItem level). For MOBILE this attaches to the\r\n // RATEPLAN item; for Internet (FIXNET) it attaches to the internet item\r\n // inside the cartItem's items array. We only push the note when it has\r\n // a value so the backend does not receive an empty string.\r\n if (rewardsInfo && cartData?.cartItem?.[0]) {\r\n const { pointsBurnt, rewardOfferId, gloxTokenId } = rewardsInfo;\r\n if (gloxTokenId) {\r\n cartData.guid = gloxTokenId;\r\n }\r\n const rewardsNotes = [\r\n pointsBurnt != null && `${pointsBurnt}` !== '' && { author: 'pointsBurnt', text: `${pointsBurnt}` },\r\n rewardOfferId != null && `${rewardOfferId}` !== '' && { author: 'rewardOfferId', text: `${rewardOfferId}` }\r\n ].filter(Boolean);\r\n\r\n if (rewardsNotes.length > 0) {\r\n cartData?.cartItem?.forEach((ci: any) => {\r\n if (!Array.isArray(ci?.items)) return;\r\n ci.items.forEach((it: any) => {\r\n const itType = `${it?.itemType || ''}`.toUpperCase();\r\n if (itType === 'RATEPLAN' || itType === 'INTERNET') {\r\n it.note = [...(it.note || []), ...rewardsNotes];\r\n }\r\n });\r\n });\r\n }\r\n }\r\n\r\n //To add hardware item while creating cart\r\n if (deviceDetails) {\r\n const deviceCartItem = getDeviceCartItem(deviceDetails);\r\n deviceCartItem && cartData?.cartItem?.[0]?.items?.push(...deviceCartItem);\r\n }\r\n // Get flow parameter from URL query string if in browser\r\n let flow: string | null = null;\r\n if (typeof window !== 'undefined') {\r\n const params = new URLSearchParams(window.location.search);\r\n flow = params.get('flow');\r\n }\r\n \r\n // Add OTT items to cart if session storage exists and flow is 'ott'\r\n const shouldAddOttItems = ottCartData && flow === 'ott';\r\n if (shouldAddOttItems) {\r\n const ottItems = fetchOttItems(ottCartData);\r\n if (ottItems?.length > 0) {\r\n const groupedByTypeAndPromo: {\r\n [key: string]: { itemType: string; promotionId: string; items: any[] };\r\n } = {};\r\n const homeCartItem = cartData?.cartItem?.find((item: any) => item?.itemType === 'HOME');\r\n ottItems.forEach((ottItem: any) => {\r\n const itemType = ottItem?.itemType;\r\n \r\n // Only group OTT items, add others directly\r\n if (itemType === 'OTT') {\r\n const promoId = ottItem?.promotionId?.trim() || 'defaultOttBundle';\r\n const groupKey = `${'OTT'}_${promoId}`;\r\n\r\n if (!groupedByTypeAndPromo[groupKey]) {\r\n groupedByTypeAndPromo[groupKey] = {\r\n itemType: itemType,\r\n promotionId: promoId,\r\n items: []\r\n };\r\n }\r\n groupedByTypeAndPromo[groupKey].items.push(...(ottItem?.items || []));\r\n } else {\r\n // Add non-OTT items to HOME cartItem's items array\r\n \r\n if (homeCartItem && homeCartItem.items && ottItem?.items) {\r\n homeCartItem.items.push(...ottItem.items);\r\n }\r\n }\r\n });\r\n\r\n // Add each grouped OTT item as a separate cart item list\r\n Object.keys(groupedByTypeAndPromo).forEach((groupKey) => {\r\n const group = groupedByTypeAndPromo[groupKey];\r\n cartData?.cartItem.push({\r\n itemType: group.itemType,\r\n promotionId: group.promotionId,\r\n items: group.items\r\n });\r\n });\r\n }\r\n }\r\n\r\n const options = {\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n }\r\n };\r\n\r\n const URL = cartUrl + APIResourceConstants.CREATE_CARTV3;\r\n if (Object.keys(cartData)?.length > 0) {\r\n const createCartV2Resp: any = await ApiServiceV2.getApiServiceInstance()\r\n .post(URL, cartData, options)\r\n .then((res: any) => {\r\n removeLocalStorage('isB2BCustomer');\r\n if (res.status == 200) {\r\n return res?.data;\r\n }\r\n })\r\n .catch((error) => {\r\n if (error?.response?.data?.code || error?.response?.status === 504) {\r\n errorTrackingDataLayer(error?.response);\r\n }\r\n });\r\n if (createCartV2Resp.error) {\r\n throw createCartV2Resp.error;\r\n } else {\r\n return createCartV2Resp;\r\n }\r\n }\r\n};\r\n\r\nexport const fetchLinetableContent = async (slugurl: string, params: any): Promise<any> => {\r\n try {\r\n const resp = await CMSStoryblokServiceV2.get(slugurl, params)\r\n .then((response: any) => {\r\n const contentTable = response?.data?.story?.content?.body;\r\n // return comp;\r\n for (const comp of contentTable) {\r\n if (\r\n comp.component == 'productTableV2' ||\r\n comp.component === 'productTableWithOutLC' ||\r\n comp.component === 'prodConfigContainer'\r\n ) {\r\n return comp;\r\n } else if (comp.component == 'roamingProductTable') {\r\n return comp?.productTable?.[0];\r\n }\r\n }\r\n })\r\n .catch((err: any) => {\r\n throw err;\r\n });\r\n return resp;\r\n } catch (error) {\r\n return error;\r\n }\r\n};\r\n\r\nexport const getStaticContent = (language: any = 'en', endPoints: any) => {\r\n try {\r\n return CMSStoryblokServiceV2.get(endPoints, {\r\n dimension: language,\r\n per_page: 1000,\r\n type: 'B2C'\r\n })\r\n .then((res: any) => {\r\n const response: any = {};\r\n (res?.data?.datasource_entries || []).map((entry: any) => {\r\n response[entry.name] =\r\n entry.dimension_value != null ? entry.dimension_value : entry.value;\r\n });\r\n try {\r\n localStorage.removeItem('sbstaticcontent');\r\n localStorage.setItem('sbstaticcontent', JSON.stringify(response));\r\n } catch {\r\n //\r\n }\r\n return response;\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n } catch {\r\n throw Error('Promise failed');\r\n }\r\n};\r\n\r\nexport const fetchOfferingDataLineTableV2 = async (\r\n params: any,\r\n uniqueId: any,\r\n endpoint: any,\r\n existingCustomer?: boolean,\r\n subscriptionType?: string,\r\n enableReturnPromo?: boolean,\r\n P2PEnabled?: boolean,\r\n pegaIntegration?: boolean,\r\n deviceUltimateBundle?:boolean,\r\n): Promise<any> => {\r\n localStorage.removeItem('entertainment');\r\n let options: any;\r\n options = {\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n }\r\n };\r\n if (enableReturnPromo) {\r\n options.params = {\r\n returnPromo: true\r\n };\r\n }\r\n if (P2PEnabled) {\r\n options.params = {\r\n journey: 'P2P'\r\n };\r\n }\r\n if(deviceUltimateBundle){\r\n options.params = {\r\n ...options.params,\r\n journey: 'FPB',\r\n }\r\n }\r\n\r\n let URL = endpoint + APIResourceConstants.LINE_TABLEV2;\r\n if (pegaIntegration && localStorage.getItem('prospectId')) {\r\n options.headers['x-sunrise-prospect-id'] = localStorage.getItem('prospectId');\r\n URL = endpoint + APIResourceConstants.LINE_TABLEV3;\r\n }\r\n const subscriptionUrl = subscriptionType\r\n ? URL + APIResourceConstants.SUBSCRIPTION + subscriptionType\r\n : URL;\r\n //US_31295\r\n const finalUrl = existingCustomer || subscriptionType? subscriptionUrl : URL;\r\n const productDynamicData: any = await ApiServiceV2.getApiServiceInstance()\r\n .post(finalUrl, params, options)\r\n .then((res): any => {\r\n if (res.status == 200) {\r\n return res?.data;\r\n }\r\n })\r\n .catch((err) => {\r\n if (err?.response?.data?.code || err?.response?.status === 504) {\r\n errorTrackingDataLayer(err?.response);\r\n }\r\n });\r\n if (productDynamicData.error) {\r\n return productDynamicData.error;\r\n } else {\r\n return { [uniqueId]: productDynamicData };\r\n }\r\n};\r\n\r\n/**\r\n * Shogun xSell (rewards/loyalty) flow: fetches offer data using `gloxtoken`\r\n * as a query parameter. The offer endpoint expects a POST request, so we\r\n * send an empty JSON body `{}` — the backend resolves eligible products\r\n * from the token only.\r\n */\r\nexport const fetchShogunOfferData = async (\r\n gloxTokenId: string,\r\n uniqueId: string,\r\n endpoint: string\r\n): Promise<any> => {\r\n const options: any = {\r\n params: { gloxTokenId: gloxTokenId },\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n }\r\n };\r\n const URL = endpoint + APIResourceConstants.LINE_TABLEV2;\r\n const productDynamicData: any = await ApiServiceV2.getApiServiceInstance()\r\n .post(URL, [], options)\r\n .then((res: any): any => {\r\n if (res.status === 200) {\r\n return res?.data;\r\n }\r\n })\r\n .catch((err: any) => {\r\n if (err?.response?.data?.code || err?.response?.status === 504) {\r\n errorTrackingDataLayer(err?.response);\r\n }\r\n });\r\n if (!productDynamicData || productDynamicData.error) {\r\n throw new Error('Shogun offer API failed');\r\n }\r\n return { [uniqueId]: productDynamicData };\r\n};\r\n\r\nexport const fetchSubscriptionData = async (category: any, endpoint: any): Promise<any> => {\r\n let options: any;\r\n options = {\r\n params: {},\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n }\r\n };\r\n options.params = {\r\n category: category\r\n };\r\n const URL = endpoint;\r\n const subscriptionData: any = await ApiServiceV2.getApiServiceInstance()\r\n .get(URL, options)\r\n .then((res): any => {\r\n if (res.status == 200) {\r\n return res?.data;\r\n } else {\r\n return res?.status;\r\n }\r\n })\r\n .catch((err: any) => {\r\n if (err?.response?.data?.code || err?.response?.status === 504) {\r\n errorTrackingDataLayer(err?.response);\r\n }\r\n });\r\n if (subscriptionData?.error) {\r\n return subscriptionData?.error;\r\n } else {\r\n return { subscriptionData };\r\n }\r\n};\r\n\r\nexport const getVocherPromotion = async (productID: string, voucher: string) => {\r\n try {\r\n const options = {\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n },\r\n params: {\r\n offerIds: productID,\r\n voucherCode: voucher\r\n }\r\n };\r\n\r\n const URL =\r\n LineTableBasicPropConfig?.getInstance()?.getBaseUrl() +\r\n `${APIResourceConstants.VOUCHER_PROMOTIONS}`;\r\n await ApiServiceV2.getApiServiceInstance()\r\n .get(URL, options)\r\n .then((res): any => {\r\n if (res.status == 200) {\r\n return res?.data;\r\n }\r\n });\r\n } catch (error) {}\r\n};\r\n\r\nexport const validateP2P = async (msisdn: any, endpoint: any): Promise<any> => {\r\n let options: any;\r\n options = {\r\n params: {},\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n }\r\n };\r\n options.params = {\r\n msisdn: msisdn\r\n };\r\n const URL = endpoint;\r\n return await ApiServiceV2.getApiServiceInstance()\r\n .get(URL, options)\r\n .then((res): any => {\r\n if (res?.data?.preToPostConversionStatus == 'OK') {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n })\r\n .catch((err) => {\r\n if (err?.response?.data?.code || err?.response?.status === 504) {\r\n errorTrackingDataLayer(err?.response);\r\n }\r\n console.log('err', err);\r\n return false;\r\n });\r\n};\r\n\r\nexport const getDeviceDetails = async (\r\n deviceID: any,\r\n endpoint: any,\r\n deviceType?: string\r\n): Promise<any> => {\r\n try {\r\n let options: any;\r\n options = {\r\n params: {},\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n }\r\n };\r\n let URL = endpoint + APIResourceConstants.HARDWARES + `baseProduct__${deviceID}`;\r\n if (deviceType) {\r\n URL += `&deviceType=${encodeURIComponent(deviceType)}`;\r\n }\r\n const deviceData: any = await ApiServiceV2.getApiServiceInstance()\r\n .get(URL, options)\r\n .then((res: any) => {\r\n if (res?.status === 200 && Object.keys(res?.data)?.length > 0) {\r\n return res?.data;\r\n } else {\r\n return null;\r\n }\r\n });\r\n return deviceData;\r\n } catch (err) {\r\n // eslint-disable-next-line no-console\r\n console.log('err', err);\r\n return null;\r\n }\r\n};\r\n\r\nexport const getDeviceModelsList = async (\r\n brandId: any,\r\n endpoint: any,\r\n deviceType?: string\r\n): Promise<any> => {\r\n try {\r\n let options: any;\r\n options = {\r\n params: {},\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n }\r\n };\r\n let URL = endpoint + APIResourceConstants.HARDWARE_DEVICES + `manufacturerName__${brandId}`;\r\n if (deviceType) {\r\n URL += `&deviceType=${encodeURIComponent(deviceType)}`;\r\n }\r\n const deviceData: any = await ApiServiceV2.getApiServiceInstance()\r\n .get(URL, options)\r\n .then((res: any) => {\r\n if (res?.status === 200 && res?.data?.hardwares?.length > 0) {\r\n return res?.data;\r\n } else {\r\n return null;\r\n }\r\n });\r\n return deviceData;\r\n } catch (err) {\r\n // eslint-disable-next-line no-console\r\n console.log('err', err);\r\n return null;\r\n }\r\n};\r\n\r\nexport const trackPegaEvents = async (\r\n endpoint: any,\r\n payload = {},\r\n prospectId: string\r\n): Promise<any> => {\r\n let options: any;\r\n options = {\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': apiResConstants.X_SUN_CHAL,\r\n 'x-sunrise-prospect-id': prospectId\r\n }\r\n };\r\n\r\n let URL = endpoint + APIResourceConstants?.CUSTOMER_EVENTS;\r\n const productDynamicData: any = await ApiServiceV2.getApiServiceInstance()\r\n .post(URL, payload, options)\r\n .then((res): any => {\r\n if (res.status == 200) {\r\n // eslint-disable-next-line no-console\r\n console.log('trackPegaEvents result.data', res.data);\r\n return res?.data;\r\n }\r\n })\r\n .catch((err) => {\r\n if (err?.response?.data?.code || err?.response?.status === 504) {\r\n errorTrackingDataLayer(err?.response);\r\n }\r\n });\r\n};\r\n\r\nexport const createCartWinV2 = async (\r\n productData: any,\r\n radioValue: string,\r\n defaultPromo: string,\r\n cartUrl: string,\r\n chooseGift:any\r\n): Promise<any> => {\r\n let cartData: any = {};\r\n /**WIN FLows*/\r\n let mobGiftId = '';\r\n let mandatoryGift = '';\r\n const getCoorelationIdFromCookie = Cookies.get('one-commerce-linecheckcorrelationid') ?? '';\r\n const lineCheckData = getAccessDataFromLineCheck(productData?.[0]?.id);\r\n cartData = {\r\n relatedParty: [\r\n {\r\n id: 'anonymous',\r\n segment: 'RESIDENTIAL'\r\n }\r\n ],\r\n cartItem: [\r\n {\r\n itemType: 'HOME',\r\n promotionId: defaultPromo,\r\n items: [],\r\n note: [\r\n {\r\n author: 'linecheckCorrelationId',\r\n text: getCoorelationIdFromCookie\r\n }\r\n ]\r\n }\r\n ]\r\n };\r\n /**for 4P bundles*/\r\n const mobileItem: any = {\r\n itemType: 'MOBILE',\r\n promotionId: defaultPromo,\r\n items: []\r\n };\r\n /**Check if bundle or Internet and add it to cart request*/\r\n if (productData?.[0]?.isBundle) {\r\n productData?.[0]?.bundledOffers?.map((item: any) => {\r\n if (item?.promotionInfo?.[0]?.id) {\r\n const giftId =\r\n item?.promotionInfo?.[0]?.hardwareGift?.[0]?.ids?.length == 1\r\n ? item?.promotionInfo?.[0]?.hardwareGift?.[0]?.ids?.[0]\r\n : '';\r\n if (item?.productType?.toLowerCase() === 'mobile') {\r\n mobileItem['promotionId'] = item?.promotionInfo?.[0]?.id;\r\n mobGiftId = giftId;\r\n } else {\r\n cartData['cartItem'][0]['promotionId'] = item?.promotionInfo?.[0]?.id;\r\n mandatoryGift = giftId;\r\n }\r\n }\r\n if (item?.productType?.toLowerCase() == 'tv' && radioValue) {\r\n cartData.cartItem[0].items.push({ itemType: item?.productType, id: radioValue });\r\n } else if (item?.productType?.toLowerCase() === 'mobile') {\r\n mobileItem.items.push({ itemType: 'RATEPLAN', id: item?.id });\r\n } else cartData.cartItem[0].items.push({ itemType: item?.productType, id: item?.id });\r\n });\r\n mandatoryGift && cartData?.cartItem?.[0].items?.push({ itemType: 'GIFT', id: mandatoryGift });\r\n mobGiftId && mobileItem?.items?.push({ itemType: 'GIFT', id: mobGiftId });\r\n\r\n if (mobileItem?.items?.length > 0) {\r\n cartData?.cartItem?.push(mobileItem);\r\n }\r\n if (chooseGift && chooseGift?.length > 0) {\r\n chooseGift?.map((giftItem: any) => {\r\n cartData?.cartItem?.[0]?.items?.push({ itemType: 'GIFT', id: giftItem?.tuaProdId })\r\n })\r\n }\r\n } else {\r\n /**Add standlone product such as internet to cart request*/\r\n cartData.cartItem[0].items.push({\r\n itemType: productData?.[0]?.productType,\r\n id: productData?.[0]?.id\r\n });\r\n }\r\n /**\r\n * changes added for new internet activation section\r\n */\r\n if (lineCheckData?.accessType) {\r\n cartData?.cartItem?.[0]?.note?.push({\r\n author: 'lineCheckaccessType',\r\n text: lineCheckData?.accessType,\r\n });\r\n }\r\n if (lineCheckData?.timeSlot) {\r\n cartData?.cartItem?.[0]?.note?.push({\r\n author: 'lineCheckEarliestActivationDate',\r\n text: lineCheckData?.timeSlot?.start,\r\n });\r\n }\r\n /**\r\n * Adding line check address while cart creation\r\n * As part of DEX abandon basket use case\r\n */\r\n try {\r\n const address: any = getCookies('chAddressJson');\r\n const contactMedium: any = [\r\n {\r\n characteristic: {\r\n installationAddress: true,\r\n country: 'CH',\r\n city: address?.selectedAdd?.city,\r\n street1: address?.selectedAdd?.street,\r\n postCode: address?.selectedAdd?.postCode,\r\n street2: address?.selectedAdd?.houseNumber\r\n }\r\n }\r\n ];\r\n cartData.contactMedium = contactMedium;\r\n } catch (error: any) {\r\n // eslint-disable-next-line no-console\r\n console.log('issue at line check address addition in create cart ==>', error);\r\n }\r\n\r\n const options = {\r\n headers: {\r\n 'x-correlation-id': generateUID(),\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL\r\n }\r\n };\r\n const endPoint = LineTableBasicPropConfig?.getInstance()?.getBaseUrl();\r\n\r\n const URL = `${endPoint}${API_BASE_BASEPOINT.CART_MGMT}/${APIResourceConstants.CREATE_CARTV2}`;\r\n if (Object.keys(cartData)?.length > 0) {\r\n const createCartV2Resp: any = await ApiServiceV2.getApiServiceInstance()\r\n .post(URL, cartData, options)\r\n .then((res: any) => {\r\n if (res.status == 200) {\r\n return res?.data;\r\n }\r\n });\r\n if (createCartV2Resp.error) {\r\n throw createCartV2Resp.error;\r\n } else {\r\n return createCartV2Resp;\r\n }\r\n }\r\n}\r\n\r\nexport const fetchOttServiceOptions = async (): Promise<any> => {\r\n const endPoint = LineTableBasicPropConfig?.getInstance()?.getBaseUrl();\r\n const url = `${endPoint}${APIResourceConstants.TV_SERVICE_OPTIONS_V2}`;\r\n const options = {\r\n params: {},\r\n headers: {\r\n 'x-sunrise-channel': APIResourceConstants.X_SUN_CHAL,\r\n 'x-correlation-id': generateUID()\r\n }\r\n };\r\n try {\r\n const optionsData: any = await ApiServiceV2.getApiServiceInstance()\r\n .get(url, options)\r\n .then((res) => {\r\n return res?.data?.length > 0 ? res?.data : [];\r\n });\r\n return optionsData;\r\n } catch (error) {\r\n // eslint-disable-next-line no-console\r\n console.log(error);\r\n }\r\n};\r\n"],"names":["AuthData","undefined","window","Cookies","get","JSON","parse","fetchCountryList","name","lang","url","TTL","__awaiter","getCountryData","getLocalStorageWithExpiry","sbParams","language","type","stories","_a","CMSStoryblokServiceV2","data","length","setLocalStoreWithExpiry","e","console","error","fetchOfferingDataV2","requestBody","returnPromo","localStorage","removeItem","options","headers","generateUID","APIResourceConstants","X_SUN_CHAL","params","URL","LINE_TABLEV2","productDynamicData","ApiServiceV2","getApiServiceInstance","post","then","res","status","response","forEach","id","_b","code","_c","errorTrackingDataLayer","log","createCartV2","productData_1","radioValue_1","defaultPromo_1","cartUrl_1","productType_1","chooseGift_1","enabledP2P_1","P2PData_1","isQoqaFlow_1","args_1","productData","radioValue","defaultPromo","cartUrl","productType","chooseGift","enabledP2P","P2PData","isQoqaFlow","qVoucher","deviceDetails","tvOptions","discountRef","discountVersion","rewardsInfo","cartData","ottCartData","getSessionStorage","ONE_ECOMMERCE_OTT","FIXNET","mobGiftId","mandatoryGift","getCoorelationIdFromCookie","lineCheckData","getAccessDataFromLineCheck","relatedParty","segment","cartItem","itemType","promotionId","items","note","author","text","mobileItem","isBundle","_e","_d","bundledOffers","map","item","promotionInfo","giftId","_g","_f","hardwareGift","ids","_m","_l","_k","_j","_h","_o","toLowerCase","_q","_p","_s","_r","_t","push","_u","option","TV_SERVICE_OPTION","_v","_w","_x","_y","giftItem","parentPoType","tuaProdId","accessType","_1","_z","_0","timeSlot","_4","_2","_3","_5","start","address","getCookies","contactMedium","characteristic","installationAddress","country","city","_6","selectedAdd","street1","_7","street","postCode","_8","street2","_9","houseNumber","MOBILE","_10","_11","subscribedInfo","installedPlan","P2PSUBSCRIBEDPLAN","processType","PRE_TO_POST","_12","_13","clientDiscountInfo","discountType","_19","_17","_16","_15","_14","_18","_25","_24","_23","_22","_21","_20","_26","VOUCHERTYPE","QOQA","VOUCHERCODE","removeLocalStorage","_27","pointsBurnt","rewardOfferId","gloxTokenId","guid","rewardsNotes","filter","Boolean","_28","ci","Array","isArray","it","itType","toUpperCase","deviceCartItem","contractDuration","selectedVarientDetails","hardwarePrices","smartUpgradeInstallments","duration","upFrontValue","upFrontPayment","value","insuranceValue","insurance","deviceItem","HARDWARE","contractTerm","getDeviceNotes","flexItem","DEVICE_INSURANCE","insuranceName","getDeviceCartItem","_30","_29","_31","flow","URLSearchParams","location","search","ottItems","fetchOttItems","groupedByTypeAndPromo","homeCartItem","_32","find","ottItem","promoId","trim","groupKey","Object","keys","group","CREATE_CARTV3","_33","createCartV2Resp","catch","fetchLinetableContent","slugurl","contentTable","story","content","body","comp","component","productTable","err","getStaticContent","endPoints","dimension","per_page","datasource_entries","entry","dimension_value","setItem","stringify","Error","fetchOfferingDataLineTableV2","uniqueId","endpoint","existingCustomer","subscriptionType","enableReturnPromo","P2PEnabled","pegaIntegration","deviceUltimateBundle","journey","assign","getItem","LINE_TABLEV3","subscriptionUrl","SUBSCRIPTION","finalUrl","fetchShogunOfferData","fetchSubscriptionData","category","subscriptionData","getVocherPromotion","productID","voucher","offerIds","voucherCode","LineTableBasicPropConfig","getInstance","getBaseUrl","VOUCHER_PROMOTIONS","validateP2P","msisdn","preToPostConversionStatus","getDeviceDetails","deviceID","deviceType","HARDWARES","encodeURIComponent","getDeviceModelsList","brandId","HARDWARE_DEVICES","hardwares","trackPegaEvents","endpoint_1","payload","prospectId","apiResConstants","CUSTOMER_EVENTS","createCartWinV2","API_BASE_BASEPOINT","CART_MGMT","CREATE_CARTV2","fetchOttServiceOptions","TV_SERVICE_OPTIONS_V2","optionsData"],"mappings":"mmCA6EA,IAAIA,OAAkCC,WAAXC,QAAwBC,EAAQC,IAAI,eAC/DJ,EAAWA,GAAYK,KAAKC,MAAMN,GAE3B,MAAMO,EAAmB,CAAOC,EAAcC,EAAcC,EAAaC,IAAeC,OAAA,OAAA,OAAA,EAAA,kBAC7F,MAAMC,EAAiBC,EAA0B,GAAGN,KAAQC,iBAC5D,GAAII,EACF,OAAOA,EAEP,IACE,MAAME,EAAW,CACfC,SAAUP,EACVQ,KAAM,OAGFC,EAAkB,QAARC,SADEC,EAAsBhB,IAAIM,EAAKK,IAC7BM,YAAI,IAAAF,OAAA,EAAAA,EAAED,QAG1B,OAFIA,GAAWA,EAAQI,OAAS,GAC9BC,EAAwB,GAAGf,KAAQC,gBAAoBS,EAASP,GAC3DO,CACT,CAAE,MAAOM,GAGP,OADAC,QAAQC,MAAMF,GACPA,CACT,CAEJ,GAEaG,EAAsB,CACjCC,EACAlB,EACAmB,IACgBjB,OAAA,OAAA,OAAA,EAAA,sBAChB,IACEkB,aAAaC,WAAW,iBACxB,MAAMC,EAAU,CACdC,QAAS,CACP,mBAAoBC,IACpB,oBAAqBC,EAAqBC,YAE5CC,OAAQ,CAAA,GAENR,IACFG,EAAQK,OAAS,CACfR,aAAa,IAGjB,MAAMS,EAAM5B,EAAMyB,EAAqBI,aACjCC,QAAgCC,EAAaC,wBAChDC,KAAKL,EAAKV,EAAaI,GACvBY,KAAMC,IACL,GAAkB,KAAdA,EAAIC,OACN,OAAOD,eAAAA,EAAKxB,OAGlB,GAAImB,EAAmBd,MACrB,OAAOc,EAAmBd,MACrB,CACL,MAAMqB,EAAkB,GAIxB,OAHAP,SAAAA,EAAoBQ,QAAS3B,IAC3B0B,EAAS1B,EAAK4B,IAAM5B,IAEf0B,CACT,CACF,CAAE,MAAOrB,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Q,EAAqB+R,wBACzClS,EAAU,CACdK,OAAQ,CAAA,EACRJ,QAAS,CACP,oBAAqBE,EAAqBC,WAC1C,mBAAoBF,MAGxB,IACE,MAAMiS,QAAyB1R,EAAaC,wBACzCtC,IAAIM,EAAKsB,GACTY,KAAMC,UACL,OAAgB,QAAT1B,EAAA0B,aAAG,EAAHA,EAAKxB,YAAI,IAAAF,OAAA,EAAAA,EAAEG,QAAS,EAAIuB,aAAG,EAAHA,EAAKxB,KAAO,KAE/C,OAAO8S,CACT,CAAE,MAAOzS,GAEPD,QAAQ6B,IAAI5B,EACd,CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunrise-upc/mobile-prod-card",
3
- "version": "12.0.2",
3
+ "version": "12.0.3",
4
4
  "description": "Starter project to create reusable functional component",
5
5
  "type": "module",
6
6
  "main": "dist/esm/index.js",