@sunrise-upc/mobile-prod-card 1.2.4-beta.21 → 1.2.4-beta.23

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ /**
2
+ * A candidate for common component.
3
+ */
4
+ import React from "react";
5
+ import "./LineCheck.css";
6
+ declare const AutoComplete: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
7
+ export default AutoComplete;
@@ -7,3 +7,4 @@ export declare const fetchLineCheck: (payload: any) => Promise<{
7
7
  configEligibleBundle: string[];
8
8
  plannedUpgrade: any;
9
9
  }>;
10
+ export declare const fetchAddress: (address: any, isValid: boolean) => Promise<any>;
package/dist/cjs/index.js CHANGED
@@ -5,5 +5,5 @@
5
5
  * Copyright(c) 2015 Douglas Christopher Wilson
6
6
  * MIT Licensed
7
7
  */
8
- parse:function(e,n){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var t={},o=n||{},l=e.split(";"),i=o.decode||nt,r=0;r<l.length;r++){var d=l[r],a=d.indexOf("=");if(!(a<0)){var c=d.substring(0,a).trim();if(null==t[c]){var u=d.substring(a+1,d.length).trim();'"'===u[0]&&(u=u.slice(1,-1)),t[c]=lt(u,i)}}}return t},serialize:function(e,n,t){var o=t||{},l=o.encode||tt;if("function"!=typeof l)throw new TypeError("option encode is invalid");if(!ot.test(e))throw new TypeError("argument name is invalid");var i=l(n);if(i&&!ot.test(i))throw new TypeError("argument val is invalid");var r=e+"="+i;if(null!=o.maxAge){var d=o.maxAge-0;if(isNaN(d)||!isFinite(d))throw new TypeError("option maxAge is invalid");r+="; Max-Age="+Math.floor(d)}if(o.domain){if(!ot.test(o.domain))throw new TypeError("option domain is invalid");r+="; Domain="+o.domain}if(o.path){if(!ot.test(o.path))throw new TypeError("option path is invalid");r+="; Path="+o.path}if(o.expires){if("function"!=typeof o.expires.toUTCString)throw new TypeError("option expires is invalid");r+="; Expires="+o.expires.toUTCString()}o.httpOnly&&(r+="; HttpOnly");o.secure&&(r+="; Secure");if(o.sameSite){switch("string"==typeof o.sameSite?o.sameSite.toLowerCase():o.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return r}},nt=decodeURIComponent,tt=encodeURIComponent,ot=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function lt(e,n){try{return n(e)}catch(n){return e}}!function(e){var n=Zn&&Zn.__assign||function(){return n=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var l in n=arguments[t])Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l]);return e},n.apply(this,arguments)},t=Zn&&Zn.__rest||function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)n.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(t[o[l]]=e[o[l]])}return t};Object.defineProperty(e,"__esModule",{value:!0}),e.checkCookies=e.hasCookie=e.removeCookies=e.deleteCookie=e.setCookies=e.setCookie=e.getCookie=e.getCookies=void 0;var o=et,l=function(){return"undefined"!=typeof window},i=function(e){void 0===e&&(e="");try{var n=JSON.stringify(e);return/^[\{\[]/.test(n)?n:e}catch(n){return e}};e.getCookies=function(e){var n;if(e&&(n=e.req),!l())return n&&n.cookies?n.cookies:n&&n.headers&&n.headers.cookie?(0,o.parse)(n.headers.cookie):{};for(var t={},i=document.cookie?document.cookie.split("; "):[],r=0,d=i.length;r<d;r++){var a=i[r].split("="),c=a.slice(1).join("=");t[a[0]]=c}return t};e.getCookie=function(n,t){var o,l=(0,e.getCookies)(t)[n];if(void 0!==l)return function(e){return"true"===e||"false"!==e&&("undefined"!==e?"null"===e?null:e:void 0)}((o=l)?o.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent):o)};e.setCookie=function(e,r,d){var a,c,u;d&&(c=d.req,u=d.res,a=t(d,["req","res"]));var s=(0,o.serialize)(e,i(r),n({path:"/"},a));if(l())document.cookie=s;else if(u&&c){var m=u.getHeader("Set-Cookie");if(Array.isArray(m)||(m=m?[String(m)]:[]),u.setHeader("Set-Cookie",m.concat(s)),c&&c.cookies){var p=c.cookies;""===r?delete p[e]:p[e]=i(r)}if(c&&c.headers&&c.headers.cookie){p=(0,o.parse)(c.headers.cookie);""===r?delete p[e]:p[e]=i(r),c.headers.cookie=Object.entries(p).reduce((function(e,n){return e.concat("".concat(n[0],"=").concat(n[1],";"))}),"")}}};e.setCookies=function(n,t,o){return console.warn("[WARN]: setCookies was deprecated. It will be deleted in the new version. Use setCookie instead."),(0,e.setCookie)(n,t,o)};e.deleteCookie=function(t,o){return(0,e.setCookie)(t,"",n(n({},o),{maxAge:-1}))};e.removeCookies=function(n,t){return console.warn("[WARN]: removeCookies was deprecated. It will be deleted in the new version. Use deleteCookie instead."),(0,e.deleteCookie)(n,t)};e.hasCookie=function(n,t){return!!n&&(0,e.getCookies)(t).hasOwnProperty(n)};e.checkCookies=function(n,t){return console.warn("[WARN]: checkCookies was deprecated. It will be deleted in the new version. Use hasCookie instead."),(0,e.hasCookie)(n,t)}}(Qn);const it="catalogue-management",rt="ESHOP",dt="/v1/linecheck",at=e=>Z(void 0,void 0,void 0,(function*(){var t,o,l,i,r,d,a;const s=yield(e=>{var t;const o=null===(t=null==ge?void 0:ge.getInstance())||void 0===t?void 0:t.getBaseUrl(),l={params:{},headers:{"x-sunrise-channel":rt,"x-correlation-id":u.v4()}},i={address:e,segment:"Residential"};try{const e=`${o}${it}${dt}`;return n.ApiServiceV2.getApiServiceInstance().post(e,i,l).then((e=>{var n,t;if(200==e.status){const o=null===(t=null===(n=null==e?void 0:e.config)||void 0===n?void 0:n.headers)||void 0===t?void 0:t["x-correlation-id"];try{"undefined"!=typeof window&&localStorage.removeItem("one-commerce-linecheckcorrelationid"),"undefined"!=typeof window&&localStorage.setItem("one-commerce-linecheckcorrelationid",o)}catch(e){}return"undefined"!=typeof window&&c.remove("one-commerce-linecheckcorrelationid",{path:"/"}),"undefined"!=typeof window&&c.set("one-commerce-linecheckcorrelationid",o,{path:"/",expires:3}),{response:null==e?void 0:e.data,corelationaId:o}}return[]}))}catch(e){return e}})(e),m=yield((null===(t=null==s?void 0:s.response)||void 0===t?void 0:t.sellableProducts)||[]).map((e=>e.name)),p=[];for(const e of null===(o=null==s?void 0:s.response)||void 0===o?void 0:o.eligibleCombinations)for(const n of null==e?void 0:e.rateplans)p.push(null==n?void 0:n.name);const v=null===(i=null===(l=null==s?void 0:s.response)||void 0===l?void 0:l.eligibleSpeed)||void 0===i?void 0:i.maxSpeed,_=null===(d=null===(r=null==s?void 0:s.response)||void 0===r?void 0:r.eligibleSpeed)||void 0===d?void 0:d.plannedUpgrades,h=null===(a=null==s?void 0:s.response)||void 0===a?void 0:a.eligibleAccess;try{"undefined"!=typeof window&&localStorage.setItem("lineCheckResponse",JSON.stringify({eligibleBundle:m,configEligibleBundle:p,maxUploadDownloadSpeed:v,plannedUpgrade:_,originalLinecheckResponse:null==s?void 0:s.response}));try{"undefined"!=typeof window&&localStorage.setItem("one-commerce-access-type",JSON.stringify(h))}catch(e){}"undefined"!=typeof window&&c.set("one-commerce-access-type",JSON.stringify(h),{path:"/",expires:3})}catch(e){}return{corelationaId:s.corelationaId,lineCheckResponse:null==s?void 0:s.response,eligibleBundle:m,maxUploadDownloadSpeed:v,configEligibleBundle:p,plannedUpgrade:_}})),ct=e.forwardRef((({content:n,parentCallback:t,parentAddress:o,isAddressNotFilled:l,onChange:i,name:r,apiError:d,setApiError:a,setFetchingLineCheck:c},u)=>{var s,m,p,v;const[_,h]=e.useState(!1),[g,f]=e.useState(!1),[b,x]=e.useState(""),[y,w]=e.useState("");e.useState();const[T,E]=e.useState(!1);return e.useEffect((()=>{_&&y?"differentAddress"===r&&"function"==typeof t&&t({}):x("")}),[y,_]),e.useEffect((()=>{"function"==typeof w&&w(o)}),[]),e.createElement(e.Fragment,null,e.createElement("div",null,"Auto complete"),e.createElement("div",null,g&&e.createElement("p",{className:"errormsg errormsgMob"},null==n?void 0:n.errorMsg),!y&&l&&e.createElement("p",{className:"errormsg errormsgMob"},e.createElement("img",{src:null===(p=null===(m=null===(s=null==n?void 0:n.linecheckIcons)||void 0===s?void 0:s[0])||void 0===m?void 0:m.warning)||void 0===p?void 0:p.filename,height:"12px",width:"16px",alt:"alert"}),null==n?void 0:n.requiredFieldText),_&&!T&&e.createElement("p",{className:"secondarybutton",onClick:()=>{E(!0)}},null==n?void 0:n.noAddress,e.createElement("span",null,e.createElement("img",{src:null===(v=null==n?void 0:n.arrowIcon)||void 0===v?void 0:v.filename,height:24,width:24,alt:"right-arrow"})))))})),ut=({content:n,onSuccess:t})=>{var o,l,r,d,a,c,u,s,m,p,v,_,h,g,f,b,x,y,w,T,E;const[C,P]=e.useState(!1),k=e.useRef(null),[S,N]=e.useState({enableCheckaddress:!1}),[V,I]=e.useState(),[D,O]=e.useState(),[B,A]=e.useState(!1),[M,R]=e.useState(),[F,z]=e.useState({openIndividualLineCheck:!1,availabilityCheckClicked:!1}),[$,W]=e.useState(!1),G=L(),[j,U]=e.useState(!1),X=(e,n)=>{z(n),O(" "),I(e),""!==(null==e?void 0:e.postCode)&&""!==(null==e?void 0:e.city)&&""!==(null==e?void 0:e.houseNumber)&&""!==(null==e?void 0:e.street)&&""!==(null==e?void 0:e.concatedAddress)?N((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!0}))):N((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!1})))},H=()=>{S.enableCheckaddress?N((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!1}))):P(!1)};e.createElement("div",null,e.createElement("span",{className:"mobileTable"},e.createElement("span",{className:"changeBtn",onClick:()=>{"undefined"!=typeof window&&localStorage.removeItem("lineCheckResponse"),"undefined"!=typeof window&&Qn.deleteCookie("chAddressJson"),"undefined"!=typeof window&&Qn.deleteCookie("one-commerce-linecheckcorrelationid"),N((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!0}))),O("")},hidden:!(null==D?void 0:D.eligibleBundle)},e.createElement("span",{className:"changeTxt"},"mobile"===G?null==M?void 0:M.changeTextMob:null==M?void 0:M.changeText))));e.useEffect((()=>{var e,n,t,o,l,i,r,d,a;try{let c="undefined"!=typeof window&&Qn.getCookie("chAddressJson");const u="undefined"!=typeof window&&Qn.getCookie("one-commerce-linecheckcorrelationid");try{c=c&&JSON.parse(c)}catch(e){console.log("invalid address json")}if(c){N((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!1}))),I(null==c?void 0:c.selectedAdd);const s="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse"),m="undefined"!=typeof window&&localStorage.getItem("one-commerce-linecheckcorrelationid"),p={eligibleBundle:null!==(n=s&&(null===(e=JSON.parse(s))||void 0===e?void 0:e.eligibleBundle))&&void 0!==n?n:[],configEligibleBundle:null!==(o=s&&(null===(t=JSON.parse(s))||void 0===t?void 0:t.configEligibleBundle))&&void 0!==o?o:[],maxUploadDownloadSpeed:null!==(i=s&&(null===(l=JSON.parse(s))||void 0===l?void 0:l.maxUploadDownloadSpeed))&&void 0!==i?i:{},lineCheckRepsonse:D&&JSON.parse(null==D?void 0:D.originalLinecheckResponse),lineCheckCorrelationId:null!=m?m:"",plannedUpgrade:null!==(d=s&&(null===(r=JSON.parse(s))||void 0===r?void 0:r.plannedUpgrade))&&void 0!==d?d:{}};s&&u&&(null===(a=JSON.parse(s))||void 0===a?void 0:a.eligibleBundle)&&Object.keys(null==c?void 0:c.selectedAdd).length&&O(p)}}catch(e){}}),[M]),e.useEffect((()=>{var e,t,o,l,i;n&&("lineCheckTemplate"===(null===(t=null===(e=null==n?void 0:n.reference)||void 0===e?void 0:e.content)||void 0===t?void 0:t.component)?R(null===(l=null===(o=null==n?void 0:n.reference)||void 0===o?void 0:o.content)||void 0===l?void 0:l.linecheck[0]):R(null===(i=null==n?void 0:n.linecheck)||void 0===i?void 0:i[0]))}),[]),e.useEffect((()=>{var e,n,t;(!(null==D?void 0:D.eligibleBundle)||(null==D?void 0:D.eligibleBundle.length)<1)&&P(!1),(null===(e=null==D?void 0:D.eligibleBundle)||void 0===e?void 0:e.length)&&(0!==Object.keys(V).length&&void 0!==(null===(n=null==D?void 0:D.maxUploadDownloadSpeed)||void 0===n?void 0:n.maxBandwidthDown)||null===(t=null==D?void 0:D.maxUploadDownloadSpeed)||void 0===t||t.maxBandwidthDown)}),[null===(o=null==D?void 0:D.eligibleBundle)||void 0===o?void 0:o.length]);const q=e.useRef(null),J={linecheckResponse:D,eligibleBundle:null==D?void 0:D.eligibleBundle,lineCheckContent:M,handleSelection:X,isAddressNotFilled:C,name:"lineCheck",onChange:H,selectedAddress:V,isFetchingLineCheck:B,apiError:$,setApiError:W,setFetchingLineCheck:A};Object.assign({},J);const[K,Y]=e.useState(),[Z,Q]=e.useState(!1);return e.useEffect((()=>{var e;(null===(e=null==D?void 0:D.eligibleBundle)||void 0===e?void 0:e.length)<1?Y(null==M?void 0:M.dataText):Y(""),Q(!1)}),[]),console.log("inside linecheck v3",M),e.createElement(e.Fragment,null,e.createElement("div",{className:"row justify-content-center ",ref:q},e.createElement("div",{className:"col-12 px-0 "},e.createElement("div",{className:` ${C&&!(null==D?void 0:D.eligibleBundle)?"gradientborder":""} maincontainer`},e.createElement("div",{className:((null==D?void 0:D.eligibleBundle)?"row position-relative inputRow":"row position-relative inputrow")+" ",onClick:()=>{var e;"mobile"===G&&(null===(e=null==k?void 0:k.current)||void 0===e||e.focus(),U(!0))}},(null==D?void 0:D.eligibleBundle)&&(K||!K&&(null===(l=null==D?void 0:D.eligibleBundle)||void 0===l?void 0:l.length)>1?e.createElement("img",{src:null===(a=null===(d=null===(r=null==M?void 0:M.linecheckIcons)||void 0===r?void 0:r[0])||void 0===d?void 0:d.tick)||void 0===a?void 0:a.filename,className:"tickIcons",height:"32px",width:"32px"}):e.createElement("img",{src:null===(s=null===(u=null===(c=null==M?void 0:M.linecheckIcons)||void 0===c?void 0:c[0])||void 0===u?void 0:u.close)||void 0===s?void 0:s.filename,className:"tickIcons ",height:"32px",width:"32px"})),((null==M?void 0:M.linecheckTitle)||(null==M?void 0:M.successLinecheckTitle))&&e.createElement(e.Fragment,null,e.createElement("h4",{className:"linechecktitle"},!B&&(null==D?void 0:D.eligibleBundle)?(null===(m=null==D?void 0:D.eligibleBundle)||void 0===m?void 0:m.length)<1?null==M?void 0:M.noConnectionTitle:null==M?void 0:M.successLinecheckTitle:null==M?void 0:M.linecheckTitle)),(null==D?void 0:D.eligibleBundle)?e.createElement(e.Fragment,null,e.createElement("div",null,"Linecheck success field")):e.createElement(e.Fragment,null,e.createElement("div",{className:"horizontalDivider"}),e.createElement("div",{className:"col-1 px-0 "},(null==D?void 0:D.eligibleBundle)?e.createElement(e.Fragment,null):e.createElement("img",{src:null===(_=null===(v=null===(p=null==M?void 0:M.linecheckIcons)||void 0===p?void 0:p[0])||void 0===v?void 0:v.home)||void 0===_?void 0:_.filename,height:""+("mobile"===G?"26px":"48px"),width:""+("mobile"===G?"26px":"48px"),alt:"home",className:"homeicon"})),e.createElement("div",{className:`col-lg-8 col-md-8 col-sm-8 ${"mobile"===G&&((null==D?void 0:D.eligibleBundle)?"col-12":"col-9")} px-0`},e.createElement("div",null,e.createElement(ct,{content:M,parentCallback:X,parentAddress:null==V?void 0:V.concatedAddress,ref:k,isAddressNotFilled:C,name:"lineCheck",onChange:H,setAddressNotFilled:P,apiError:$,setApiError:W,setFetchingLineCheck:A}))),e.createElement("div",{className:"col-lg-3 col-md-3 col-sm-3 col-2 px-0 marginautodefault"},"mobile"!==G||(null==D?void 0:D.eligibleBundle)?e.createElement("button",{name:"check address button",type:"button",className:"primarybutton mobileButton",disabled:!S.enableCheckaddress,hidden:!!(null==D?void 0:D.eligibleBundle),onClick:()=>{var e;(null==S?void 0:S.enableCheckaddress)?(A(!0),"undefined"!=typeof window&&Qn.deleteCookie("chAddressJson"),"undefined"!=typeof window&&Qn.setCookie("chAddressJson",JSON.stringify({addressValue:null==V?void 0:V.concatedAddress,selectedAdd:V}),{path:"/",maxAge:259200}),V&&Object.keys(V).length>0&&at(V).then((e=>{"undefined"!=typeof window&&localStorage.setItem("LinecheckCall","true"),A(!1),O(e),W(!1),"mobile"===G&&F.openIndividualLineCheck&&U(!1)})).catch((e=>{console.log(e),W(!0),z(Object.assign(Object.assign({},F),{availabilityCheckClicked:!1})),"mobile"===G&&F.openIndividualLineCheck&&U(!0)}))):(P(!0),null===(e=null==k?void 0:k.current)||void 0===e||e.focus(),"mobile"===G&&U(!1))},style:{width:"100%",position:"relative",bottom:"10px"}},B&&!$&&""!==(null===(b=null==k?void 0:k.current)||void 0===b?void 0:b.value)?e.createElement(i.Spinner,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"}):null==M?void 0:M.buttonvalue):e.createElement("span",null,e.createElement("img",{width:52,height:52,alt:"search",src:null===(f=null===(g=null===(h=null==M?void 0:M.linecheckIcons)||void 0===h?void 0:h[0])||void 0===g?void 0:g.searchIcon)||void 0===f?void 0:f.filename})))),(null===(x=null==D?void 0:D.plannedUpgrade)||void 0===x?void 0:x.expectedSpeed)&&e.createElement(e.Fragment,null,e.createElement("div",{className:"col-lg-1 col-md-1 col-sm-1 col-12 px-0"},(null==D?void 0:D.eligibleBundle)&&e.createElement("img",{src:null===(T=null===(w=null===(y=null==M?void 0:M.linecheckIcons)||void 0===y?void 0:y[0])||void 0===w?void 0:w.upgrade)||void 0===T?void 0:T.filename,height:"32px",width:"32px",alt:"activeup"})),e.createElement("div",{className:"col-lg-8 col-md-8 col-sm-8 col-12 px-0"},(null==D?void 0:D.eligibleBundle)&&e.createElement("div",null," On Success"))))))),(null==M?void 0:M.helpText)&&!(null===(E=k.current)||void 0===E?void 0:E.value)?e.createElement("div",{className:"helpText"},!B&&(null==D?void 0:D.eligibleBundle)?"":null==M?void 0:M.helpText):"")},st=({content:n,onSuccess:t})=>{var o,l,i;const[r,d]=e.useState(!0),a=null===(i=null===(l=null===(o=null==n?void 0:n.reference)||void 0===o?void 0:o.content)||void 0===l?void 0:l.body)||void 0===i?void 0:i[0];return console.log("inside linecheck modal"),e.createElement(Yn,{modalState:r,handler:()=>{d(!r)},showFooter:!1,noCloseButton:!1,backgroundColor:"transparent",fixedWidth:"850px"},e.createElement(ut,{content:a,onSuccess:t}))},mt=({content:n,offeringData:t,uniqueId:o,storyContent:l,metadata:i,tabIndex:r,cardsLength:d,indexKey:a,constants:u,mainContent:s,address:m,eligibleBundle:p,linecheckSuccessCallBack:v})=>{var g,x,y,w,T,E,C,P,S,N,V,I,L,D,B,A,M,R,F,W,G,j,U,X,H,J,K,Z,Q,ee,ne,oe,le,ie,re,de,ae,ce,ue,se,me;const[pe,ve]=e.useState(!1),[_e,he]=e.useState(!1),[ge,fe]=e.useState({showGift:!1,cashbackAvailable:!1}),[be,xe]=e.useState([]),[we,Te]=e.useState(!1),[Pe,Se]=e.useState(!1),[Ne,Ve]=e.useState(!1),Ie=void 0!==typeof window&&document.getElementById("static-linetable"),Oe=0===(null===(g=Object.keys(n))||void 0===g?void 0:g.length),Be=null===(E=null===(T=null===(w=null===(y=null===(x=null==n?void 0:n.products)||void 0===x?void 0:x[0])||void 0===y?void 0:y.reference)||void 0===w?void 0:w.content)||void 0===T?void 0:T.product)||void 0===E?void 0:E[0],Ae=null===(V=null===(N=null===(S=null===(P=null===(C=null==n?void 0:n.promotion)||void 0===C?void 0:C[0])||void 0===P?void 0:P.reference)||void 0===S?void 0:S.content)||void 0===N?void 0:N.promoDescription)||void 0===V?void 0:V[0],Me=null==Be?void 0:Be.productId,Re=null===(I=null==f?void 0:f.getInstance())||void 0===I?void 0:I.getCartUrl(),Fe=null===(L=null==b?void 0:b.getInstance())||void 0===L?void 0:L.getAssetPath(),ze="MOBILE"===(null==l?void 0:l.pageType);let We;We=m&&(null===(D=null==p?void 0:p.eligibleBundle)||void 0===D?void 0:D.includes(Me));let Ge=void 0!==typeof window&&c.get("sunriseAuth");Ge=Ge&&JSON.parse(Ge);const je=((null==t?void 0:t[o])||[]).filter((e=>(null==e?void 0:e.id)===Me)),Ue=()=>{he(!1);!(!(null==s?void 0:s.enableExistingCustomer)||null!=Ge)?Te(!0):Ke()},He=e=>{const n=be.findIndex((n=>(null==e?void 0:e.giftGroupId)===(null==n?void 0:n.giftGroupId))),t=be;-1===n?t.push(e):t[n]=e,xe([...t])},qe=((e,n)=>{let t;return n||(t=(e||[]).filter((e=>!0===(null==e?void 0:e.enableTV)))),t})(null==Be?void 0:Be.bloks,ze),Je=null===(B=null==qe?void 0:qe[0])||void 0===B?void 0:B.tvProductId,Ke=()=>{he(!1),((e,n,t,o,l,i,r,d,a,u,s)=>{var m;if(r)e(!0),0!==(null===(m=Object.keys(o))||void 0===m?void 0:m.length)&&te(o,"",(null==i?void 0:i.promoID)?null==i?void 0:i.promoID:$,n,"mobile",t).then((e=>{var n;c.remove("one-commerce-cartId",{path:"/"}),c.set("one-commerce-cartId",null==e?void 0:e.id,{path:"/"}),c.set("cartProduct",null==i?void 0:i.id,{path:"/"}),De(ye,o,"",ke),window.location.href=null===(n=null==l?void 0:l.summaryPageUrl)||void 0===n?void 0:n.cached_url})).catch((n=>{console.log(n),e(!1)})).finally((()=>{e(!1)}));else{const r="undefined"!=typeof window&&c.get("one-commerce-linecheckcorrelationid");a&&u&&r?(e(!0),0!==o.length&&te(o,d,(null==i?void 0:i.promoID)?null==i?void 0:i.promoID:z,n,"fixnet",t).then((e=>{var n;"undefined"!=typeof window&&c.remove("one-commerce-cartId",{path:"/"}),"undefined"!=typeof window&&c.set("one-commerce-cartId",null==e?void 0:e.id,{path:"/"}),"undefined"!=typeof window&&c.set("cartProduct",null==i?void 0:i.id,{path:"/"}),"undefined"!=typeof window&&c.remove("landline"),De(ye,o,"",ke),window.location.href=null===(n=null==l?void 0:l.summaryPageUrl)||void 0===n?void 0:n.cached_url})).catch((e=>{console.log(e)})).finally((()=>{e(!1)}))):s(!0)}})(ve,Re,be,je,s,Ye,ze,Je,p,m,Ve)},Ye=$e(je,ze);e.useEffect((()=>{var e;setTimeout((()=>{((e,n)=>{k(`headingV3${e}`,n),k(`descriptionV3${e}`,n),k(`titleV3${e}`,n),k(`detailsectionv3${e}`,n),k(`product-configv3${e}`,n),k(`gift-section${e}`,n),k(`benefits-section${e}`,n),k(`order-section${e}`,n),k(`price-section${e}`,n),k(`benefits-price-section${e}`,n),k(`contract-section${e}`,n)})(r,d)}),100);const n=(e=>{let n=!1,t=!1;return null==e||e.map((e=>{var o;null===(o=null==e?void 0:e.promotionInfo)||void 0===o||o.map((e=>{(null==e?void 0:e.hardwareGift)&&(n=!0),(null==e?void 0:e.cashBack)&&(t=!0)}))})),{showGift:n,cashbackAvailable:t}})(ze?je:null===(e=null==je?void 0:je[0])||void 0===e?void 0:e.bundledOffers);fe(Object.assign({},n))}),[t]);const Ze=()=>{(null==qe?void 0:qe.length)>0&&Se(!0)};return e.createElement("div",null,pe&&Ie&&h.createPortal(e.createElement(Y,{keyParams:"loading"}),Ie),Oe&&e.createElement("div",{className:"w-75 pb-2"},e.createElement(Xe,null)),!Oe&&p&&n&&m&&!ze&&e.createElement("div",{className:Dn.selected},e.createElement("span",{style:{paddingBottom:"10px"}},We?e.createElement("span",{className:Dn.activeicon},e.createElement("img",{src:`${Fe}/icons/lineCheck-success.svg`,alt:"",width:24,height:24,className:Dn.activeicon}),e.createElement("span",null,null==u?void 0:u.subscriptionAvalTxt)):e.createElement("span",{className:Dn.inactiveicon},e.createElement("img",{src:`${Fe}/icons/cross_disabled.svg`,alt:"",width:24,height:24,className:Dn.inactiveicon}),e.createElement("span",null,null==u?void 0:u.notSubscriptionTxt)))),e.createElement("div",{className:`${ze||!1!==We?"":Dn.overlay}`,style:{flexDirection:"column"}},e.createElement("div",{className:`${Dn.bundleproductcard} ${Dn.productcontainer} ${(null===(A=null==n?void 0:n.highlightText)||void 0===A?void 0:A.length)>0&&Dn.highlightBorder}`},(null===(M=null==Be?void 0:Be.highlightText)||void 0===M?void 0:M.length)>0&&e.createElement("div",{className:`${Dn.highlightText}`},null==n?void 0:n.highlightText),(null==Ae?void 0:Ae.displayText)&&e.createElement("div",{className:`${Dn.promocontainer}`,style:{background:null==Ae?void 0:Ae.bestSellerColor}},null==Ae?void 0:Ae.displayText),e.createElement("div",{className:`${Dn.detailsection}`,id:`detailsectionv3${r}${a}`},e.createElement("div",{className:`${Dn.headersection}`},e.createElement("div",{className:`${Dn.titlesection}`},e.createElement("div",{className:`${Dn.productheader}`,id:`titleV3${r}${a}`},null==Be?void 0:Be.productName),e.createElement("div",null,(null===(R=null==Be?void 0:Be.icon)||void 0===R?void 0:R.filename)&&e.createElement("img",{className:`${Dn.imagecontainer}`,src:null===(F=null==Be?void 0:Be.icon)||void 0===F?void 0:F.filename,height:15,width:20}))),e.createElement("div",{className:`${Dn.productdescription}`,id:`descriptionV3${r}${a}`},e.createElement(q,{content:null==Be?void 0:Be.description})),e.createElement("div",{className:`${Dn.images}`},(null===(W=null==Be?void 0:Be.img)||void 0===W?void 0:W.filename)&&e.createElement("img",{className:`${Dn.imagespace} ${(null==n?void 0:n.highlightText)&&Dn.borderimage}`,alt:"cardimg",src:null===(G=null==Be?void 0:Be.img)||void 0===G?void 0:G.filename}))),e.createElement("div",{className:`${Dn.productconfig}`,id:`product-configv3${r}${a}`},Oe?e.createElement(e.Fragment,null,e.createElement("div",{className:Dn.space}),e.createElement(Xe,{stylename:Dn.skeletontittle,count:1}),e.createElement(Xe,{stylename:Dn.skeletonline,count:5}),e.createElement("div",{className:Dn.space}),e.createElement(Xe,{stylename:Dn.skeletontittle,count:1}),e.createElement(Xe,{stylename:Dn.skeletonline,count:5})):e.createElement("div",null,(null==Be?void 0:Be.bloks)&&(null===(j=null==Be?void 0:Be.bloks)||void 0===j?void 0:j.map(((n,t)=>e.createElement(Bn,{content:n,indexKey:t,constants:u,key:t,showModalPopup:Ze}))))))),e.createElement("div",{className:`${Dn.detailsection}`,id:`benefits-price-section${r}${a}`},e.createElement("div",{className:`${Dn.benefitssection}`,id:`benefits-section${r}${a}`},(null===(U=null==Be?void 0:Be.benefits)||void 0===U?void 0:U.length)>0&&e.createElement(An,{content:null==Be?void 0:Be.benefits,benefitData:Ye,constants:u})),e.createElement("br",null),e.createElement("div",{className:`${Dn.giftsection}`,id:`gift-section${r}${a}`},(null==ge?void 0:ge.showGift)&&(null===(X=null==Ae?void 0:Ae.singleGift)||void 0===X?void 0:X.map(((n,t)=>e.createElement(fn,{content:n,key:t})))),(null==ge?void 0:ge.showGift)&&(null===(H=null==Ae?void 0:Ae.giftConfig)||void 0===H?void 0:H.map(((n,t)=>e.createElement(xn,{content:n,key:t,selectedGiftItem:He,parentPoType:ze?"MOBILE":"HOME"})))),e.createElement("div",{className:`${Dn.giftsection}`,id:`cashback-section${r}${a}`},(null==Ae?void 0:Ae.cashBack)&&(null==ge?void 0:ge.cashbackAvailable)&&(null===(J=null==Ae?void 0:Ae.cashBack)||void 0===J?void 0:J.map(((n,t)=>e.createElement(Nn,{content:n,key:t})))))),e.createElement("div",{className:`${Dn.ordersection}`,id:`order-section${r}${a}`},""===(null==Ye?void 0:Ye.base)?e.createElement("div",null,e.createElement(Xe,{stylename:Dn.skeletontittle})):e.createElement("div",{className:`${Dn.flexgrid} ${Dn.pricesection} `,id:`price-section${r}${a}`},e.createElement(Mn,{priceCollection:Ye,constants:u,promoText:null==Be?void 0:Be.promoText})),e.createElement("div",{className:`${(null==l?void 0:l.swapButton)&&Dn.swapButton}`},e.createElement("div",{style:{padding:"16px 0"}},e.createElement(Rn,{isMobileFlow:ze,createCartCall:ze?Ue:Ke,constants:u,storyContent:l,showPrice:Ye,isAvailable:We,address:m})),e.createElement("div",{className:Dn.productcontractduration,id:`contract-section${r}${a}`},(null==Ye?void 0:Ye.contractDuration)?O(null===(K=null==u?void 0:u.minContractDuration)||void 0===K?void 0:K.substring(1),[null==Ye?void 0:Ye.contractDuration]):null==u?void 0:u.noContractDuration),(null===(Z=null==l?void 0:l.addSmartPhone)||void 0===Z?void 0:Z.length)>0&&e.createElement("div",{style:{textAlign:"center",padding:"4px"}},(null==l?void 0:l.swapButton)?(null==l?void 0:l.ctaLabel)&&e.createElement("div",{style:{padding:"16px 0"}},e.createElement("button",{className:"primarybutton",onClick:()=>qn(Ye,l,je)},e.createElement("span",{className:Dn.buttontext},null==l?void 0:l.ctaLabel))):e.createElement("span",{className:`${Dn.productdetailslink} ${Dn.addsmartphone}`},e.createElement("div",null,e.createElement("span",null,(null===(ne=null===(ee=null===(Q=null==l?void 0:l.addSmartPhone)||void 0===Q?void 0:Q[0])||void 0===ee?void 0:ee.buttonIcon)||void 0===ne?void 0:ne.filename)&&e.createElement("img",{src:null===(ie=null===(le=null===(oe=null==l?void 0:l.addSmartPhone)||void 0===oe?void 0:oe[0])||void 0===le?void 0:le.buttonIcon)||void 0===ie?void 0:ie.filename,width:12,height:18,alt:"icon"})),e.createElement("span",null,e.createElement("a",{onClick:()=>qn(Ye,l,je)},null===(de=null===(re=null==l?void 0:l.addSmartPhone)||void 0===re?void 0:re[0])||void 0===de?void 0:de.buttonLabel)))))),e.createElement("div",{style:{textAlign:"center",padding:"4px"}},(null===(ae=null==Be?void 0:Be.productDetails)||void 0===ae?void 0:ae.length)>0&&e.createElement("span",{className:Dn.productdetailslink,onClick:()=>{he(!_e),yn(Ce,Ee,Le(je,"",ke))}},null==u?void 0:u.productDetailsLink)),_e&&e.createElement(Hn,{content:null==Be?void 0:Be.productDetails,showProductDetail:_e,setShowProductDetail:he,constants:u,showPrice:Ye,isMobileFlow:ze,createCartCall:ze?Ue:Ke,storyContent:l,isAvailable:We,address:m}))))),Pe&&(Oe?e.createElement(Xe,null):e.createElement(Kn,{content:null==qe?void 0:qe[0],setShowModal:Se,showModal:Pe,constants:u})),we&&ze&&(null===(ce=null==s?void 0:s.loginData)||void 0===ce?void 0:ce.length)>0&&Ie&&h.createPortal(e.createElement(_.LoginModalV2,{content:null===(ue=null==s?void 0:s.loginData)||void 0===ue?void 0:ue[0],closeLogin:()=>{Te(!1)},metadata:i,onSuccess:()=>{Te(!1),Ke()}}),Ie),Ne&&!ze&&(null===(se=null==s?void 0:s.linecheckData)||void 0===se?void 0:se.length)>0&&e.createElement(st,{content:null===(me=null==s?void 0:s.linecheckData)||void 0===me?void 0:me[0],onSuccess:()=>{let e="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse");p=e&&(null===JSON||void 0===JSON?void 0:JSON.parse(e)),m="undefined"!=typeof window&&c.get("chAddressJson"),Ve(!1),"function"==typeof v&&v(),Ke()}}))},pt=({content:n,setGenericErrorModalDetails:t,metadata:o,tabIndex:l,constants:i,loginSuccess:r,activeIndex:d,mainContent:a,address:u,eligibleBundle:s,linecheckSuccessCallBack:m})=>{var p,v,_;const h=L(),g=null==n?void 0:n._uid,[b,x]=e.useState(),y=null===(p=null==f?void 0:f.getInstance())||void 0===p?void 0:p.getBaseUrl();let w=void 0!==typeof window&&c.get("sunriseAuth");w=w&&JSON.parse(w);const T="MOBILE"===(null==n?void 0:n.pageType);e.useEffect((()=>(setTimeout((()=>{E()}),100),null===window||void 0===window||window.addEventListener("resize",E),null===window||void 0===window||window.addEventListener("load",E),()=>{window.removeEventListener("resize",E),window.removeEventListener("load",E)})),[null==n?void 0:n.productList]);const E=()=>{var e;k(`productCardV3${d}`,null===(e=null==n?void 0:n.productList)||void 0===e?void 0:e.length)};e.useEffect((()=>{var e;b&&(null===(e=Object.keys(b))||void 0===e?void 0:e.length)>0&&Re("view",b[g],"",ke)}),[b]),e.useEffect((()=>{var e;b&&(null===(e=Object.keys(b))||void 0===e?void 0:e.length)>0&&!T&&(null==s?void 0:s.eligibleBundle)&&Re("available",b[g],"",ke,null==s?void 0:s.eligibleBundle)}),[s,b]);const C=()=>{var e,o;const i=[],c=null==a?void 0:a.enableExistingCustomer,u=null==a?void 0:a.subscriptionType,s=null==n?void 0:n.isReturnPromo;var m,p;if(m=null==n?void 0:n.productList,p=i,null==m||m.map((e=>{var n,t,o,l,i,r,d,a,c,u,s;const m={id:"",promoIds:[]},v=null===(i=null===(l=null===(o=null===(t=null===(n=null==e?void 0:e.products)||void 0===n?void 0:n[0])||void 0===t?void 0:t.reference)||void 0===o?void 0:o.content)||void 0===l?void 0:l.product)||void 0===i?void 0:i[0],_=null===(u=null===(c=null===(a=null===(d=null===(r=null==e?void 0:e.promotion)||void 0===r?void 0:r[0])||void 0===d?void 0:d.reference)||void 0===a?void 0:a.content)||void 0===c?void 0:c.promoDescription)||void 0===u?void 0:u[0];m.id=null==v?void 0:v.productId,null===(s=null==m?void 0:m.promoIds)||void 0===s||s.push(null==_?void 0:_.promotionId),null==p||p.push(m)})),l===d&&!(null==b?void 0:b[g])||l===d&&r)try{null===(e=oe(i,null==n?void 0:n._uid,y,c,u,s))||void 0===e||e.then((e=>{x(e),t({showPopup:!1})})).catch((e=>{var n;console.log("error---\x3e",e),t({showPopup:!0,content:null===(n=null==a?void 0:a.telesalesBlok)||void 0===n?void 0:n[0]})}))}catch(e){console.log("error---\x3e",e),t({showPopup:!0,content:null===(o=null==a?void 0:a.telesalesBlok)||void 0===o?void 0:o[0]})}};return e.useEffect((()=>{d!=l&&d||C()}),[d]),e.useEffect((()=>{(null==w?void 0:w.siteId)&&r&&C()}),[r]),e.createElement("div",null,e.createElement("div",{className:Dn.titlecontainer},(null==n?void 0:n.title)&&e.createElement("div",{className:Dn.title},null==n?void 0:n.title),(null==n?void 0:n.subTitle)&&e.createElement("div",{className:Dn.description},null==n?void 0:n.subTitle)),e.createElement("div",{className:"linetableV3"},h&&e.createElement(We,{carouselIndex:d,key:d,arrow:null==a?void 0:a.enableMobileArrows},((null===(v=null==n?void 0:n.productList)||void 0===v?void 0:v.length)&&(null==n?void 0:n.productList)||new Array((null===(_=null==n?void 0:n.productList)||void 0===_?void 0:_.length)||3).fill(1)).map(((t,r)=>{var c;return e.createElement("div",{id:`productCardV3${d}`,style:{textAlign:"center"}},e.createElement(mt,{content:t,offeringData:b,uniqueId:g,storyContent:n,metadata:o,tabIndex:l,cardsLength:null===(c=null==n?void 0:n.productList)||void 0===c?void 0:c.length,indexKey:r,constants:i,mainContent:a,linecheckSuccessCallBack:m,address:u,eligibleBundle:s}))})))))};exports.AssetPathPropConfig=b,exports.Button=({type:n,text:t,onClick:o,content:l})=>e.createElement("button",{type:"button",className:`button Button-${null==l?void 0:l.type}`,onClick:o},null==l?void 0:l.text),exports.Card=({content:n,updatedContent:t,indexKey:o,listLength:l,addToCart:i,metadata:r,modalTriggered:d,showPrice:a})=>{var c,u,s,m,p,v,_,h,g,f,b,x,y,w,T,E,C,P,S,N,V,I,L,D,O,B,A,M,R,F,z,$,W,G,j,U,X,H,J,K,Y,Z,Q,ee,ne,te,oe,le,de,ae,ce,ue,se,_e,he;const ge=Object.assign({},null!==(s=null===(u=null===(c=null==n?void 0:n.testProductReference)||void 0===c?void 0:c[0])||void 0===u?void 0:u.reference)&&void 0!==s?s:null==n?void 0:n.reference),fe={listLength:l,indexKey:o,arrowUpIcon:null===(_=null===(v=null===(p=null===(m=null==ge?void 0:ge.content)||void 0===m?void 0:m.body)||void 0===p?void 0:p[0])||void 0===v?void 0:v.arrowUp)||void 0===_?void 0:_.filename,arrowDownIcon:null===(b=null===(f=null===(g=null===(h=null==ge?void 0:ge.content)||void 0===h?void 0:h.body)||void 0===g?void 0:g[0])||void 0===f?void 0:f.arrowDown)||void 0===b?void 0:b.filename,arrowLeftRed:null===(T=null===(w=null===(y=null===(x=null==ge?void 0:ge.content)||void 0===x?void 0:x.body)||void 0===y?void 0:y[0])||void 0===w?void 0:w.arrowLeftRed)||void 0===T?void 0:T.filename},be=null!==(E=null==t?void 0:t.enableNewAddToCart)&&void 0!==E&&E,xe=e.useRef(null),ye=e.useRef(null),we=e.useMemo((()=>fe),[fe]),Te=()=>{k("linetable-card-title",l),k("linetable-card-tooltiptxt",l),k("linetable-card-bottomConatiner",l)};return e.useEffect((()=>{setTimeout((()=>{Te()}),100),null===window||void 0===window||window.addEventListener("resize",Te)}),[n]),e.createElement(ie.Provider,{value:we},e.createElement("div",{className:"linetable-card-productTeaser"},e.createElement("div",{className:"linetable-card-productContainer "},ge.content&&e.createElement(e.Fragment,null,e.createElement("div",{className:"linetable-card-titleContainer",id:`linetable-card-title${o}`,ref:xe},e.createElement("div",{className:"linetable-card-prodHeading"},null===(P=null===(C=null==ge?void 0:ge.content)||void 0===C?void 0:C.body[0])||void 0===P?void 0:P.name),e.createElement("div",{className:"linetable-card-productTitle"},e.createElement("h3",null,null===(N=null===(S=null==ge?void 0:ge.content)||void 0===S?void 0:S.body[0])||void 0===N?void 0:N.displayName),(null===(L=null===(I=null===(V=null==ge?void 0:ge.content)||void 0===V?void 0:V.body[0])||void 0===I?void 0:I.prodImage)||void 0===L?void 0:L.filename)&&e.createElement("img",{src:null===(B=null===(O=null===(D=null==ge?void 0:ge.content)||void 0===D?void 0:D.body[0])||void 0===O?void 0:O.prodImage)||void 0===B?void 0:B.filename,height:15,width:20})),e.createElement("div",{className:"linetable-card-prodDescription"},e.createElement(q,{content:null===(M=null===(A=null==ge?void 0:ge.content)||void 0===A?void 0:A.body[0])||void 0===M?void 0:M.description}))),!(null==t?void 0:t.isPrepaidFlow)&&e.createElement("hr",null)),(null==ge?void 0:ge.content)&&(null===(F=null===(R=null==ge?void 0:ge.content)||void 0===R?void 0:R.body[0])||void 0===F?void 0:F.introText)&&e.createElement(e.Fragment,null,e.createElement("div",{className:""+(be?"d-block":"d-none d-sm-block")},e.createElement("div",{className:"linetable-card-introText",id:`linetable-card-tooltiptxt${o}`,ref:ye},e.createElement(q,{content:null===($=null===(z=null==ge?void 0:ge.content)||void 0===z?void 0:z.body[0])||void 0===$?void 0:$.introText})),e.createElement("hr",null))),null===(j=(null===(G=null===(W=null==ge?void 0:ge.content)||void 0===W?void 0:W.body[0])||void 0===G?void 0:G.entitlementConfig)||[])||void 0===j?void 0:j.map(((t,o)=>e.createElement(re,{content:t,product:n,key:o,indexKey:o,showEntitleValue:be,metadata:r,modalTriggered:d}))),e.createElement("hr",null),e.createElement("div",{id:`linetable-card-bottomConatiner${o}`,className:"linetable-card-bottomConatiner"},e.createElement("div",{className:"linetable-card-productDetailSection"},(null===(J=null===(H=null===(X=null===(U=null==ge?void 0:ge.content)||void 0===U?void 0:U.body)||void 0===X?void 0:X[0])||void 0===H?void 0:H.productDetailIcon)||void 0===J?void 0:J.filename)&&e.createElement("img",{src:null===(Q=null===(Z=null===(Y=null===(K=null==ge?void 0:ge.content)||void 0===K?void 0:K.body)||void 0===Y?void 0:Y[0])||void 0===Z?void 0:Z.productDetailIcon)||void 0===Q?void 0:Q.filename,width:24,height:24}),e.createElement(pe,{content:null===(ne=null===(ee=null==ge?void 0:ge.content)||void 0===ee?void 0:ee.body)||void 0===ne?void 0:ne[0],updatedContent:t,modalTriggered:d,addToCart:i})),e.createElement("div",null,(null===(le=null===(oe=null===(te=null==ge?void 0:ge.content)||void 0===te?void 0:te.body)||void 0===oe?void 0:oe[0])||void 0===le?void 0:le.isEnablePrice)&&e.createElement(me,{content:null===(ae=null===(de=null==ge?void 0:ge.content)||void 0===de?void 0:de.body)||void 0===ae?void 0:ae[0],addToCart:i,variant:"productCard"})),e.createElement("div",null,!(null===(se=null===(ue=null===(ce=null==ge?void 0:ge.content)||void 0===ce?void 0:ce.body)||void 0===ue?void 0:ue[0])||void 0===se?void 0:se.isEnablePrice)&&!(null==t?void 0:t.staticPrice)&&e.createElement(ve,{content:null===(he=null===(_e=null==ge?void 0:ge.content)||void 0===_e?void 0:_e.body)||void 0===he?void 0:he[0],showPrice:a,addToCart:i}))))))},exports.CardEntitlement=re,exports.CarouselComp=n=>e.createElement(e.Fragment,null,e.createElement(s,{responsive:{desktop:{breakpoint:{max:7e3,min:1440},items:4},tabletLarge:{breakpoint:{max:1439,min:1024},items:3},tabletMedium:{breakpoint:{max:1023,min:768},items:2},mobile:{breakpoint:{max:767,min:0},items:1}},deviceType:"desktop",ssr:!0,renderButtonGroupOutside:!0,partialVisible:!0,swipeable:!0,autoPlay:!1,shouldResetAutoplay:!1,arrows:!0},n.children),e.createElement("p",null,"compo")),exports.LineTableBasicPropConfig=f,exports.LinecheckBasicPropConfig=ge,exports.LoginModal=({toggleFun:n})=>(e.useState(!1),e.createElement("div",{className:"loginModal"},e.createElement("div",{className:"w-100 h-100 d-flex position-relative justify-content-center align-items-center"},e.createElement("div",{className:"loginContainer"},"Hi Angles Kathirvel",e.createElement("button",{onClick:n},"Close"))))),exports.ProductTableV3=({content:t,metadata:o,setGenericErrorModalDetails:l,loginSuccess:r,lineCheckCallBack:d,tabCheckCallBack:a,changeAddressClicked:u})=>{var s,m,p;const[v,_]=e.useState(),[h,g]=e.useState(),[b,x]=e.useState(0);let y="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse"),w=y&&(null===JSON||void 0===JSON?void 0:JSON.parse(y)),T="undefined"!=typeof window&&c.get("chAddressJson");const P=null===(s=null==f?void 0:f.getInstance())||void 0===s?void 0:s.getSBUrl(),k=P+E,S=P+C,N={find_by:"uuid",language:null==o?void 0:o.lang,type:"B2C",value:null==o?void 0:o.storyId};return e.useEffect((()=>{var e,t;(e=k,t=N,Z(void 0,void 0,void 0,(function*(){try{return yield n.CMSStoryblokServiceV2.get(e,t).then((e=>{var n,t,o;const l=null===(o=null===(t=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.story)||void 0===t?void 0:t.content)||void 0===o?void 0:o.body;for(const e of l)if("productTableV2"==e.component||"productTableWithOutLC"===e.component||"prodConfigContainer"===e.component)return e})).catch((e=>{throw e}))}catch(e){return e}}))).then((e=>g(e))),((e="en",t)=>{try{return n.CMSStoryblokServiceV2.get(t,{dimension:e,per_page:1e3,type:"B2C"}).then((e=>{var n;const t={};((null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.datasource_entries)||[]).map((e=>{t[e.name]=null!=e.dimension_value?e.dimension_value:e.value}));try{localStorage.removeItem("sbstaticcontent"),localStorage.setItem("sbstaticcontent",JSON.stringify(t))}catch(e){}return t})).catch((e=>e))}catch(e){throw Error("Promise failed")}})(null==o?void 0:o.lang,S).then((e=>_(e))).catch((e=>console.log(e)))}),[]),e.useEffect((()=>{var e,n,t;const o=new URLSearchParams(null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.search),l=null==o?void 0:o.get("tabOption");h&&null!==l&&((null==h?void 0:h.productContainer)||[]).map(((e,n)=>{(null==e?void 0:e.tabId)===l&&x(n)}));const i=null===(t=null===(n=null==h?void 0:h.productContainer)||void 0===n?void 0:n[b])||void 0===t?void 0:t.tabId;null==a||a(i)}),[h]),e.useEffect((()=>{y="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse"),w=y&&(null===JSON||void 0===JSON?void 0:JSON.parse(y)),T="undefined"!=typeof window&&c.get("chAddressJson")}),[u]),e.createElement("div",{id:"reusable-linetable"},(null==h?void 0:h.productContainer)&&e.createElement(e.Fragment,null,e.createElement(ae,null,e.createElement("div",{className:`row justify-content-center ${ze.tabblock}`},(null===(m=null==h?void 0:h.productContainer)||void 0===m?void 0:m.length)>1&&e.createElement("div",{className:` ${ze.tabcontainer}`},((null==h?void 0:h.productContainer)||[]).map(((n,t)=>e.createElement("div",{className:` ${ze.tabs} ${b===t?ze.tabcontentactive:ze.tabcontentinactive}`,key:null==n?void 0:n.tabCaption},e.createElement("label",{className:` ${ze.tabcontent} `},e.createElement("input",{type:"radio",checked:b===t,onChange:()=>{x(t),null==a||a(null==n?void 0:n.tabId),yn(Ce,Ne,{click_text:null==n?void 0:n.tabCaption})}}),null==n?void 0:n.tabCaption))))))),e.createElement(ae,{resuablelineTable:!0},e.createElement("div",{className:"position-relative "},e.createElement(i.Carousel,{activeIndex:b,indicators:!1,controls:!1,interval:null,id:"pt-carousel",slide:!1},(null===(p=null==h?void 0:h.productContainer)||void 0===p?void 0:p.length)>0&&((null==h?void 0:h.productContainer)||[]).map(((n,t)=>e.createElement(i.Carousel.Item,{key:t},e.createElement(In,{content:Object.assign(Object.assign({},n),{pageType:n.pageType,dynamicProductOffer:!0,tabIndex:t,activeIndex:b,lineTableContent:h}),metadata:o,activeIndex:b,lineCheckCallBack:d,tabCheckCallBack:a,sbStaticConstants:v,address:T,eligibleBundle:w,setGenericErrorModalDetails:l,loginSuccess:r})))))))))},exports.ProductTeaser=({content:t,lineCheckCallBack:o,offerDataCallBack:l,productCallBack:i,tableSelectedTab:r})=>{var d,a,c,m,p,v,_,h;const[g,f]=e.useState([]),[b,w]=e.useState(""),[T,E]=e.useState(!1),C=null===(d=null==he?void 0:he.getInstance())||void 0===d?void 0:d.getBaseUrl(),P=L(),k=null===(a=(null==t?void 0:t.productTeaserSlides)||[])||void 0===a?void 0:a.map((e=>null==e?void 0:e.tabTitle)),N=e=>{var n,o,l,i;const r=null!==(i=null===(l=null===(o=null===(n=(null==t?void 0:t.productTeaserSlides)||[])||void 0===n?void 0:n.filter((n=>(null==n?void 0:n.tabTitle)===e)))||void 0===o?void 0:o[0])||void 0===l?void 0:l.heading)&&void 0!==i?i:"";var d,a;d=Ne,a=r,window.dataLayer.push({event:Ce,event_name:d,click_text:a})},V=[];return null===(c=(null==t?void 0:t.productTeaserSlides)||[])||void 0===c||c.forEach(((e,n)=>{var t,o;(null==e?void 0:e.productId)&&0===(null===(t=V.filter((n=>n.id===(null==e?void 0:e.productId))))||void 0===t?void 0:t.length)&&V.push({id:null==e?void 0:e.productId,promoIds:[(null==e?void 0:e.promoId)?null==e?void 0:e.promoId:(null==e?void 0:e.productType)===F?z:$]}),(null==e?void 0:e.tvProductId)&&0===(null===(o=V.filter((n=>(null==n?void 0:n.id)===(null==e?void 0:e.tvProductId))))||void 0===o?void 0:o.length)&&V.push({id:null==e?void 0:e.tvProductId,promoIds:[(null==e?void 0:e.promoId)?null==e?void 0:e.promoId:z]})})),e.useEffect((()=>{var e,t;0===(null==g?void 0:g.length)&&(e=V,t=C,Z(void 0,void 0,void 0,(function*(){try{localStorage.removeItem("entertainment");const o={headers:{"x-correlation-id":u.v4(),"x-sunrise-channel":x}},l=t+y,i=yield n.ApiServiceV2.getApiServiceInstance().post(l,e,o).then((e=>{if(200==e.status)return null==e?void 0:e.data}));if(i.error)return i.error;{const e=[];return null==i||i.forEach((n=>{e[n.id]=n})),e}}catch(e){console.log("error---\x3e",e)}}))).then((e=>{var n;e&&(null===(n=Object.keys(e))||void 0===n?void 0:n.length)>0&&f(e)})).catch((e=>{console.log("error---\x3e",e)}))}),[]),e.useEffect((()=>{var e;(null===(e=null==t?void 0:t.productTeaserSlides)||void 0===e?void 0:e.map((e=>e.productType))).map((e=>{var n,o,r,d,a,c,u,s,m,p,v,_,h;if(1==(null===(n=Object.keys(g))||void 0===n?void 0:n.length)&&"function"==typeof l&&e===W&&"function"==typeof i){const e=null===(r=null===(o=null==V?void 0:V[0])||void 0===o?void 0:o.promoIds)||void 0===r?void 0:r[0],n=null===(d=null==V?void 0:V[0])||void 0===d?void 0:d.id;l(g[n],e,b),i(n)}else if((null===(a=Object.keys(g))||void 0===a?void 0:a.length)>1&&"function"==typeof l&&e===W&&"function"==typeof i){const e=null!==(m=null===(s=null===(u=null===(c=null==V?void 0:V.filter((e=>(null==e?void 0:e.id)===b)))||void 0===c?void 0:c[0])||void 0===u?void 0:u.promoIds)||void 0===s?void 0:s[0])&&void 0!==m?m:"",n=null!==(_=null===(v=null===(p=null==V?void 0:V.filter((e=>(null==e?void 0:e.id)===b)))||void 0===p?void 0:p[0])||void 0===v?void 0:v.id)&&void 0!==_?_:"";l(g[b],e,b),i(n)}else e===F&&(null===(h=null==t?void 0:t.productTeaserSlides)||void 0===h||h.map((e=>{var n,t,o,i,r;const d=T?null==e?void 0:e.tvProductId:null==e?void 0:e.productId;if((null===(n=Object.keys(g))||void 0===n?void 0:n.length)>0&&"function"==typeof l){const e=null!==(r=null===(i=null===(o=null===(t=null==V?void 0:V.filter((e=>(null==e?void 0:e.id)===d)))||void 0===t?void 0:t[0])||void 0===o?void 0:o.promoIds)||void 0===i?void 0:i[0])&&void 0!==r?r:"";l(g[d],e)}})))}))}),[g,b,T]),e.useEffect((()=>{""!==b&&N(b)}),[b]),e.createElement("div",{className:"position-relative"},(null===(m=null==t?void 0:t.productTeaserSlides)||void 0===m?void 0:m.length)>0&&P&&e.createElement(s,{responsive:{desktop:{breakpoint:{max:7e3,min:1440},items:1},tabletLarge:{breakpoint:{max:1439,min:1024},items:1},tabletMedium:{breakpoint:{max:1023,min:768},items:1},mobile:{breakpoint:{max:767,min:0},items:1}},autoPlay:!1,shouldResetAutoplay:!1,showDots:1!==(null===(p=null==t?void 0:t.productTeaserSlides)||void 0===p?void 0:p.length),customDot:e.createElement((n=>{const{onClick:t,active:o,index:l}=n;return o&&w(k[l]),e.createElement("button",{className:o?_e.stageTeaserTabActive:_e.stageTeaserTab,onClick:()=>t()},k[l])}),null),dotListClass:_e.carousel_dot,itemClass:_e.carouselItem,ssr:!0,arrows:!1,containerClass:`${_e.carouselContainer} ${S(null===(_=null===(v=null==t?void 0:t.productTeaserSlides)||void 0===v?void 0:v[0])||void 0===_?void 0:_.gradientBackground)}`,sliderClass:_e.sliderClass,customButtonGroup:e.createElement((n=>{var o,l,i;return e.createElement(e.Fragment,null,(null===(o=null==t?void 0:t.productTeaserSlides)||void 0===o?void 0:o.length)>1&&P!==W&&e.createElement("div",{style:{textAlign:"center"}},e.createElement("button",{disabled:0===(null===(l=null==n?void 0:n.carouselState)||void 0===l?void 0:l.currentSlide),className:_e.leftArrow,onClick:n.previous}),e.createElement("button",{disabled:(null===(i=null==n?void 0:n.carouselState)||void 0===i?void 0:i.currentSlide)+1===(null==n?void 0:n.carouselState.totalItems),className:_e.rightArrow,onClick:n.next})))}),null),customTransition:"transform 1s ease",transitionDuration:500},null===(h=(null==t?void 0:t.productTeaserSlides)||[])||void 0===h?void 0:h.map(((n,l)=>e.createElement(Fe,{content:t,slides:n,index:l,offeringData:g,lineCheckCallBack:o,setEnableToggle:E,tableSelectedTab:r})))))},exports.ProductTeaserPropConfig=he,exports.StaticLineTable=({content:n,tabCheckCallBack:t,setGenericErrorModalDetails:o,metadata:l,loginSuccess:r,changeAddressClicked:d,linecheckSuccessCallBack:a})=>{var u,s,m;const[p,v]=e.useState(0),_=null===(u=null==n?void 0:n.oneEcomConstants)||void 0===u?void 0:u[0];let h="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse"),g=h&&(null===JSON||void 0===JSON?void 0:JSON.parse(h)),f="undefined"!=typeof window&&c.get("chAddressJson");return e.useEffect((()=>{var e,o,l;const i=new URLSearchParams(null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.search),r=null==i?void 0:i.get("tabOption");n&&null!==r&&((null==n?void 0:n.productContainer)||[]).map(((e,n)=>{(null==e?void 0:e.tabId)===r&&v(n)}));const d=null===(l=null===(o=null==n?void 0:n.productContainer)||void 0===o?void 0:o[p])||void 0===l?void 0:l.tabId;"function"==typeof t&&(null==t||t(d))}),[n]),e.useEffect((()=>{h="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse"),g=h&&(null===JSON||void 0===JSON?void 0:JSON.parse(h)),f="undefined"!=typeof window&&c.get("chAddressJson")}),[d]),e.createElement("div",null,e.createElement("div",{id:"static-linetable"},(null==n?void 0:n.productContainer)&&e.createElement(e.Fragment,null,e.createElement(ae,null,e.createElement("div",{className:`row justify-content-center ${Dn.tabblock}`},(null===(s=null==n?void 0:n.productContainer)||void 0===s?void 0:s.length)>1&&e.createElement("div",{className:` ${Dn.tabcontainer}`},((null==n?void 0:n.productContainer)||[]).map(((n,o)=>e.createElement("div",{className:` ${Dn.tabs} ${p===o?Dn.tabcontentactive:Dn.tabcontentinactive}`,key:null==n?void 0:n.tabCaption},e.createElement("label",{className:` ${Dn.tabcontent} `},e.createElement("input",{type:"radio",checked:p===o,onChange:()=>{v(o),"function"==typeof t&&(null==t||t(null==n?void 0:n.tabId)),yn(Ce,Ne,{click_text:null==n?void 0:n.tabCaption})}}),null==n?void 0:n.tabCaption))))))),e.createElement(ae,{resuablelineTable:!0},e.createElement("div",{className:"position-relative "},e.createElement(i.Carousel,{activeIndex:p,indicators:!1,controls:!1,interval:null,id:"pt-carousel",slide:!1},(null===(m=null==n?void 0:n.productContainer)||void 0===m?void 0:m.length)>0&&((null==n?void 0:n.productContainer)||[]).map(((t,d)=>e.createElement(i.Carousel.Item,{key:d},e.createElement(pt,{content:t,setGenericErrorModalDetails:o,metadata:l,tabIndex:d,constants:_,loginSuccess:r,activeIndex:p,mainContent:n,address:f,eligibleBundle:g,linecheckSuccessCallBack:a}))))))))))},exports.StickyProductAnchor=({content:n,offerData:t,lineCheckCallBack:o})=>{var l,i,r,d,a,u,s,m,p,v;const _=null===(l=null==f?void 0:f.getInstance())||void 0===l?void 0:l.getCartUrl(),[g,b]=e.useState(!1),[x,y]=e.useState(!1),[w,T]=e.useState("noFalconStyle"),[E,C]=e.useState("noFalconStyle"),[P,k]=e.useState(!1),S=L(),V=null===(i=null==n?void 0:n.filter((e=>(null==e?void 0:e.productId)===(null==t?void 0:t.id))))||void 0===i?void 0:i[0];let I=0;I=(null==t?void 0:t.derivedPrice)?null===(d=null===(r=null==t?void 0:t.derivedPrice)||void 0===r?void 0:r[0])||void 0===d?void 0:d.value:null===(u=null===(a=null==t?void 0:t.prices)||void 0===a?void 0:a[0])||void 0===u?void 0:u.value;const D=e=>{const n=(null==e?void 0:e.id)&&document.getElementById(null==e?void 0:e.id);k(!1),n&&n.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},O=()=>e.createElement("div",{className:Ln.priceSection},"CHF"," ",N(I),e.createElement("span",{className:Ln.priceDuration},null==V?void 0:V.monthText));e.useEffect((()=>{const e=()=>{var e;const n=document.getElementById("productTeaser");if(!n)return;const{top:t,bottom:o}=n.getBoundingClientRect(),l=(null===window||void 0===window?void 0:window.innerHeight)||document.documentElement.clientHeight;b(t<l&&o>=0);let i=document.querySelectorAll(".sticky-header2");const r=document.getElementById("stickyAnchorContainer"),d=document.querySelectorAll(".sticky-header");if(null!=d){const e=(null==d?void 0:d.length)>0?"falconStyle":"noFalconStyle";T(e)}if(null!=i){const n=null===(e=null==i?void 0:i[0])||void 0===e?void 0:e.offsetHeight;C(n>=75?"noFalconStyle2":"falconStyle2")}const a=null==r?void 0:r.offsetTop;a&&window.scrollY>a?y(!0):y(!1);const c=document.getElementById("dropDownContainer");null==c||c.offsetTop};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]);let B;try{B=null===(s=document.getElementsByTagName("header"))||void 0===s?void 0:s[0]}catch(e){}return B?e.createElement(e.Fragment,null,(null==V?void 0:V.productName)&&e.createElement(e.Fragment,null,h.createPortal(e.createElement(e.Fragment,null,e.createElement("div",{className:`${Ln.stickyAnchorContainer} ${x?Ln.offsetClass:Ln.nonOffsetClass} ${Ln[w]} ${Ln[E]}`,id:"stickyAnchorContainer"},e.createElement(ae,null,e.createElement("div",{className:Ln.productContainer},e.createElement("div",{className:Ln.productTitle},(S===U||S===W)&&e.createElement("img",{onClick:()=>{k(!P)},className:`${Ln.arrowIcon} ${P?Ln.clockwise:Ln.counterclockwise}`,src:null===(m=null==V?void 0:V.arrowUp)||void 0===m?void 0:m.filename}),e.createElement("div",null,null==V?void 0:V.productName,e.createElement("div",{className:Ln.productPrice},I>0&&(S===U||S===W)&&e.createElement(e.Fragment,null,O())))),e.createElement("div",{className:Ln.contentWrapper},S!==U&&S!==W&&e.createElement(e.Fragment,null,e.createElement("span",{className:Ln.benefitsContainer},null===(p=(null==V?void 0:V.benefits)||[])||void 0===p?void 0:p.map((n=>e.createElement("div",{className:Ln.benefits,onClick:()=>D(n)},null==n?void 0:n.title)))),I>0&&e.createElement(e.Fragment,null,O())),(null==V?void 0:V.buyBtn)&&e.createElement("button",{className:Ln.buyNowButton,onClick:(null==V?void 0:V.productType)===W?()=>{(null==t?void 0:t.id)&&Re(ye,[t],"",Te),(null==t?void 0:t.id)&&te([t],"",(null==t?void 0:t.promoId)?null==t?void 0:t.promoId:"",_,W).then((e=>{var n;c.remove("one-commerce-cartId",{path:"/"}),c.set("one-commerce-cartId",null==e?void 0:e.id,{path:"/"}),c.set("cartProduct",null==V?void 0:V.productId,{path:"/"}),window.location.href=null!==(n=null==V?void 0:V.checkoutUrl)&&void 0!==n?n:""})).catch((e=>{console.log(e)}))}:()=>{var e,n,l;const i=localStorage.getItem("lineCheckResponse"),r=i&&JSON.parse(i),d=c.get("one-commerce-linecheckcorrelationid"),a=c.get("chAddressJson"),u=null!==(e=null==V?void 0:V.productId)&&void 0!==e?e:"",s=a&&r&&(null==r?void 0:r.eligibleBundle.includes(u));r&&a&&d?s&&(0!==(null===(n=Object.keys(t))||void 0===n?void 0:n.length)&&Re(ye,[t],V,Te),0!==(null===(l=Object.keys(t))||void 0===l?void 0:l.length)&&te([t],"",(null==t?void 0:t.promoId)?null==t?void 0:t.promoId:z,_,F).then((e=>{var n;c.remove("one-commerce-cartId",{path:"/"}),c.set("one-commerce-cartId",null==e?void 0:e.id,{path:"/"}),c.set("cartProduct",u,{path:"/"}),c.remove("landline"),window.location.href=null!==(n=null==V?void 0:V.checkoutUrl)&&void 0!==n?n:""})).catch((e=>{console.log(e)}))):"function"==typeof o&&o()}},null==V?void 0:V.buyBtn))))),(null==V?void 0:V.productName)&&P&&e.createElement("div",{className:`${Ln.stickyAnchorContainer} ${x?Ln.offsetClass2:Ln.nonOffsetClass}`,id:"dropDownContainer"},e.createElement("span",{className:Ln.benefitsContainer2},null===(v=(null==V?void 0:V.benefits)||[])||void 0===v?void 0:v.map((n=>e.createElement("div",{className:Ln.subcontain,onClick:()=>D(n)},null==n?void 0:n.title)))))),B))):e.createElement(e.Fragment,null)};
8
+ parse:function(e,n){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var t={},o=n||{},l=e.split(";"),i=o.decode||nt,r=0;r<l.length;r++){var d=l[r],a=d.indexOf("=");if(!(a<0)){var c=d.substring(0,a).trim();if(null==t[c]){var u=d.substring(a+1,d.length).trim();'"'===u[0]&&(u=u.slice(1,-1)),t[c]=lt(u,i)}}}return t},serialize:function(e,n,t){var o=t||{},l=o.encode||tt;if("function"!=typeof l)throw new TypeError("option encode is invalid");if(!ot.test(e))throw new TypeError("argument name is invalid");var i=l(n);if(i&&!ot.test(i))throw new TypeError("argument val is invalid");var r=e+"="+i;if(null!=o.maxAge){var d=o.maxAge-0;if(isNaN(d)||!isFinite(d))throw new TypeError("option maxAge is invalid");r+="; Max-Age="+Math.floor(d)}if(o.domain){if(!ot.test(o.domain))throw new TypeError("option domain is invalid");r+="; Domain="+o.domain}if(o.path){if(!ot.test(o.path))throw new TypeError("option path is invalid");r+="; Path="+o.path}if(o.expires){if("function"!=typeof o.expires.toUTCString)throw new TypeError("option expires is invalid");r+="; Expires="+o.expires.toUTCString()}o.httpOnly&&(r+="; HttpOnly");o.secure&&(r+="; Secure");if(o.sameSite){switch("string"==typeof o.sameSite?o.sameSite.toLowerCase():o.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return r}},nt=decodeURIComponent,tt=encodeURIComponent,ot=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function lt(e,n){try{return n(e)}catch(n){return e}}!function(e){var n=Zn&&Zn.__assign||function(){return n=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var l in n=arguments[t])Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l]);return e},n.apply(this,arguments)},t=Zn&&Zn.__rest||function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)n.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(t[o[l]]=e[o[l]])}return t};Object.defineProperty(e,"__esModule",{value:!0}),e.checkCookies=e.hasCookie=e.removeCookies=e.deleteCookie=e.setCookies=e.setCookie=e.getCookie=e.getCookies=void 0;var o=et,l=function(){return"undefined"!=typeof window},i=function(e){void 0===e&&(e="");try{var n=JSON.stringify(e);return/^[\{\[]/.test(n)?n:e}catch(n){return e}};e.getCookies=function(e){var n;if(e&&(n=e.req),!l())return n&&n.cookies?n.cookies:n&&n.headers&&n.headers.cookie?(0,o.parse)(n.headers.cookie):{};for(var t={},i=document.cookie?document.cookie.split("; "):[],r=0,d=i.length;r<d;r++){var a=i[r].split("="),c=a.slice(1).join("=");t[a[0]]=c}return t};e.getCookie=function(n,t){var o,l=(0,e.getCookies)(t)[n];if(void 0!==l)return function(e){return"true"===e||"false"!==e&&("undefined"!==e?"null"===e?null:e:void 0)}((o=l)?o.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent):o)};e.setCookie=function(e,r,d){var a,c,u;d&&(c=d.req,u=d.res,a=t(d,["req","res"]));var s=(0,o.serialize)(e,i(r),n({path:"/"},a));if(l())document.cookie=s;else if(u&&c){var m=u.getHeader("Set-Cookie");if(Array.isArray(m)||(m=m?[String(m)]:[]),u.setHeader("Set-Cookie",m.concat(s)),c&&c.cookies){var p=c.cookies;""===r?delete p[e]:p[e]=i(r)}if(c&&c.headers&&c.headers.cookie){p=(0,o.parse)(c.headers.cookie);""===r?delete p[e]:p[e]=i(r),c.headers.cookie=Object.entries(p).reduce((function(e,n){return e.concat("".concat(n[0],"=").concat(n[1],";"))}),"")}}};e.setCookies=function(n,t,o){return console.warn("[WARN]: setCookies was deprecated. It will be deleted in the new version. Use setCookie instead."),(0,e.setCookie)(n,t,o)};e.deleteCookie=function(t,o){return(0,e.setCookie)(t,"",n(n({},o),{maxAge:-1}))};e.removeCookies=function(n,t){return console.warn("[WARN]: removeCookies was deprecated. It will be deleted in the new version. Use deleteCookie instead."),(0,e.deleteCookie)(n,t)};e.hasCookie=function(n,t){return!!n&&(0,e.getCookies)(t).hasOwnProperty(n)};e.checkCookies=function(n,t){return console.warn("[WARN]: checkCookies was deprecated. It will be deleted in the new version. Use hasCookie instead."),(0,e.hasCookie)(n,t)}}(Qn);const it="address-suggestion",rt="catalogue-management",dt="ESHOP",at="/suggest/address",ct="/v1/linecheck",ut=e=>Z(void 0,void 0,void 0,(function*(){var t,o,l,i,r,d,a;const s=yield(e=>{var t;const o=null===(t=null==ge?void 0:ge.getInstance())||void 0===t?void 0:t.getBaseUrl(),l={params:{},headers:{"x-sunrise-channel":dt,"x-correlation-id":u.v4()}},i={address:e,segment:"Residential"};try{const e=`${o}${rt}${ct}`;return n.ApiServiceV2.getApiServiceInstance().post(e,i,l).then((e=>{var n,t;if(200==e.status){const o=null===(t=null===(n=null==e?void 0:e.config)||void 0===n?void 0:n.headers)||void 0===t?void 0:t["x-correlation-id"];try{"undefined"!=typeof window&&localStorage.removeItem("one-commerce-linecheckcorrelationid"),"undefined"!=typeof window&&localStorage.setItem("one-commerce-linecheckcorrelationid",o)}catch(e){}return"undefined"!=typeof window&&c.remove("one-commerce-linecheckcorrelationid",{path:"/"}),"undefined"!=typeof window&&c.set("one-commerce-linecheckcorrelationid",o,{path:"/",expires:3}),{response:null==e?void 0:e.data,corelationaId:o}}return[]}))}catch(e){return e}})(e),m=yield((null===(t=null==s?void 0:s.response)||void 0===t?void 0:t.sellableProducts)||[]).map((e=>e.name)),p=[];for(const e of null===(o=null==s?void 0:s.response)||void 0===o?void 0:o.eligibleCombinations)for(const n of null==e?void 0:e.rateplans)p.push(null==n?void 0:n.name);const v=null===(i=null===(l=null==s?void 0:s.response)||void 0===l?void 0:l.eligibleSpeed)||void 0===i?void 0:i.maxSpeed,_=null===(d=null===(r=null==s?void 0:s.response)||void 0===r?void 0:r.eligibleSpeed)||void 0===d?void 0:d.plannedUpgrades,h=null===(a=null==s?void 0:s.response)||void 0===a?void 0:a.eligibleAccess;try{"undefined"!=typeof window&&localStorage.setItem("lineCheckResponse",JSON.stringify({eligibleBundle:m,configEligibleBundle:p,maxUploadDownloadSpeed:v,plannedUpgrade:_,originalLinecheckResponse:null==s?void 0:s.response}));try{"undefined"!=typeof window&&localStorage.setItem("one-commerce-access-type",JSON.stringify(h))}catch(e){}"undefined"!=typeof window&&c.set("one-commerce-access-type",JSON.stringify(h),{path:"/",expires:3})}catch(e){}return{corelationaId:s.corelationaId,lineCheckResponse:null==s?void 0:s.response,eligibleBundle:m,maxUploadDownloadSpeed:v,configEligibleBundle:p,plannedUpgrade:_}})),st=e.forwardRef(((n,t)=>{var o,l,i;const{inputValue:r,setInputValue:d,dropdownValue:a,placeholder:c,onChange:u,name:s,inputClassName:m,selectedData:p,minLength:v,maxLength:_,content:h,setApiError:g,setFetchingLineCheck:f}=n,[b,x]=e.useState(-1),[y,w]=e.useState(!0),[T,E]=e.useState(!1),C=L();return e.useEffect((()=>{a&&a.length>0&&(null==r?void 0:r.length)>=3?E(!0):E(!1)}),[a]),e.createElement(e.Fragment,null,e.createElement("div",{id:"dropdownselect",className:"inputcontainer form-floating"},e.createElement("input",{type:"text",disabled:!y,placeholder:c,onChange:u,name:s,onKeyDown:e=>{if(a&&Object.keys(a).length>0)if("Enter"===(null==e?void 0:e.key)||13===(null==e?void 0:e.keyCode)){if(-1===b)return;x(-1),w(!0),E(!1),d(a[b].concatedAddress),p(a[b])}else if("ArrowUp"===(null==e?void 0:e.key)||38===(null==e?void 0:e.keyCode)){if(-1===b)return void x((null==a?void 0:a.length)-1);x(b-1)}else if("ArrowDown"===(null==e?void 0:e.key)||40===(null==e?void 0:e.keyCode)){if(b===(null==a?void 0:a.length)-1)return void x(-1);x(b+1)}else x(-1)},value:r,ref:t,autoComplete:"off","aria-autocomplete":"none",className:m,spellCheck:"false",minLength:v,maxLength:_}),e.createElement("label",{htmlFor:"address",className:"input-label"},c),0!==(null==r?void 0:r.length)&&e.createElement("div",{className:"cross-icon",onClick:()=>{var e,n;(null===(e=null==t?void 0:t.current)||void 0===e?void 0:e.focus())||E(!1),d(""),null===(n=null==t?void 0:t.current)||void 0===n||n.focus(),g(!1),f(!1)}},e.createElement("img",{src:null===(i=null===(l=null===(o=null==h?void 0:h.linecheckIcons)||void 0===o?void 0:o[0])||void 0===l?void 0:l.close)||void 0===i?void 0:i.filename,height:14,width:14,alt:"cross-icon"})),T&&(null==a?void 0:a.length)&&e.createElement("ul",{className:"addresscontainer"},a.map(((n,t)=>{let o;return t===b&&(o="active"),e.createElement(e.Fragment,null,e.createElement("li",{className:"active"===o?"suggestionactive":"",key:t,onClick:e=>((e,n)=>{var t;x(-1),E(!1),w(!0),d((null==n?void 0:n.currentTarget)&&(null===(t=null==n?void 0:n.currentTarget)||void 0===t?void 0:t.innerText)),p(e)})(n,e)},n&&(null==n?void 0:n.concatedAddress)),"mobile"===C?e.createElement("span",{className:"horizontallineone"}):"")})))))})),mt=e.forwardRef((({content:t,parentCallback:o,parentAddress:l,isAddressNotFilled:i,onChange:r,name:d,apiError:a,setApiError:c,setFetchingLineCheck:s},m)=>{var p,v,_,h;const[g,f]=e.useState(!1),[b,x]=e.useState(!1),[y,w]=e.useState(""),[T,E]=e.useState(""),[C,P]=e.useState(),[k,S]=e.useState(!1);L();return e.useEffect((()=>{g&&T?"differentAddress"===d&&"function"==typeof o&&o({}):w("")}),[T,g]),e.useEffect((()=>{"function"==typeof E&&E(l)}),[]),e.createElement(e.Fragment,null,!k&&e.createElement(st,{inputValue:T||"",setInputValue:E,dropdownValue:C,placeholder:null==t?void 0:t.placeholder,ref:m,onChange:e=>{var o,l;"function"==typeof r&&r(e),"function"==typeof E&&E(null===(o=null==e?void 0:e.currentTarget)||void 0===o?void 0:o.value);const i=new RegExp(`[${null==t?void 0:t.regexp}]`).test(e.currentTarget.value);var d,a;x(i),(d=null===(l=null==e?void 0:e.currentTarget)||void 0===l?void 0:l.value,a=i,Z(void 0,void 0,void 0,(function*(){var e;if(!a&&(null==d?void 0:d.length)>=3){const t=null===(e=null==ge?void 0:ge.getInstance())||void 0===e?void 0:e.getBaseUrl(),o={params:{},headers:{"x-sunrise-channel":dt,"x-correlation-id":u.v4()},cancelToken:{}};return o.params={count:10,address:d},yield n.ApiServiceV2.getApiServiceInstance().get(`${t}${it}${at}`,o).then((e=>{var n,t;if(200==(null==e?void 0:e.status)){const o=[];return(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.items)&&(null===(t=null==e?void 0:e.data)||void 0===t||t.items.forEach((e=>{const n=e.street+" "+e.houseNumber+", "+e.postCode+" "+e.city;e.street&&e.houseNumber&&e.postCode&&e.city&&(e.concatedAddress=n,o.push(e))}))),o}})).catch((e=>{console.log("err",e)}))}}))).then((e=>{e&&(null==e?void 0:e.error)||(null==e?void 0:e.length)<=0?f(!0):(P(e),f(!1))})).catch((e=>console.log(e)))},selectedData:e=>{"function"==typeof E&&E(e.concatedAddress),"function"==typeof o&&o(e,{openIndividualLineCheck:!1,availabilityCheckClicked:!1})},inputClassName:(i?"errorfield":"")+" form-control",minLength:null==t?void 0:t.linecheckMinLength,maxLength:null==t?void 0:t.linecheckMaxLength,name:d,content:t,addressNotFound:g,setApiError:c,setFetchingLineCheck:s}),e.createElement("div",null,b&&e.createElement("p",{className:"errormsg errormsgMob"},null==t?void 0:t.errorMsg),!T&&i&&e.createElement("p",{className:"errormsg errormsgMob"},e.createElement("img",{src:null===(_=null===(v=null===(p=null==t?void 0:t.linecheckIcons)||void 0===p?void 0:p[0])||void 0===v?void 0:v.warning)||void 0===_?void 0:_.filename,height:"12px",width:"16px",alt:"alert"}),null==t?void 0:t.requiredFieldText),g&&!k&&e.createElement("p",{className:"secondarybutton",onClick:()=>{S(!0)}},null==t?void 0:t.noAddress,e.createElement("span",null,e.createElement("img",{src:null===(h=null==t?void 0:t.arrowIcon)||void 0===h?void 0:h.filename,height:24,width:24,alt:"right-arrow"})))))})),pt=({content:n,onSuccess:t})=>{var o,l,r,d,a,c,u,s,m,p,v,_,h,g,f,b,x,y,w,T,E;const[C,P]=e.useState(!1),k=e.useRef(null),[S,N]=e.useState({enableCheckaddress:!1}),[V,I]=e.useState(),[D,O]=e.useState(),[B,A]=e.useState(!1),[M,R]=e.useState(),[F,z]=e.useState({openIndividualLineCheck:!1,availabilityCheckClicked:!1}),[$,W]=e.useState(!1),G=L(),[j,U]=e.useState(!1),X=(e,n)=>{z(n),O(" "),I(e),""!==(null==e?void 0:e.postCode)&&""!==(null==e?void 0:e.city)&&""!==(null==e?void 0:e.houseNumber)&&""!==(null==e?void 0:e.street)&&""!==(null==e?void 0:e.concatedAddress)?N((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!0}))):N((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!1})))},H=()=>{S.enableCheckaddress?N((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!1}))):P(!1)};e.createElement("div",null,e.createElement("span",{className:"mobileTable"},e.createElement("span",{className:"changeBtn",onClick:()=>{"undefined"!=typeof window&&localStorage.removeItem("lineCheckResponse"),"undefined"!=typeof window&&Qn.deleteCookie("chAddressJson"),"undefined"!=typeof window&&Qn.deleteCookie("one-commerce-linecheckcorrelationid"),N((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!0}))),O("")},hidden:!(null==D?void 0:D.eligibleBundle)},e.createElement("span",{className:"changeTxt"},"mobile"===G?null==M?void 0:M.changeTextMob:null==M?void 0:M.changeText))));e.useEffect((()=>{var e,n,t,o,l,i,r,d,a;try{let c="undefined"!=typeof window&&Qn.getCookie("chAddressJson");const u="undefined"!=typeof window&&Qn.getCookie("one-commerce-linecheckcorrelationid");try{c=c&&JSON.parse(c)}catch(e){console.log("invalid address json")}if(c){N((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!1}))),I(null==c?void 0:c.selectedAdd);const s="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse"),m="undefined"!=typeof window&&localStorage.getItem("one-commerce-linecheckcorrelationid"),p={eligibleBundle:null!==(n=s&&(null===(e=JSON.parse(s))||void 0===e?void 0:e.eligibleBundle))&&void 0!==n?n:[],configEligibleBundle:null!==(o=s&&(null===(t=JSON.parse(s))||void 0===t?void 0:t.configEligibleBundle))&&void 0!==o?o:[],maxUploadDownloadSpeed:null!==(i=s&&(null===(l=JSON.parse(s))||void 0===l?void 0:l.maxUploadDownloadSpeed))&&void 0!==i?i:{},lineCheckRepsonse:D&&JSON.parse(null==D?void 0:D.originalLinecheckResponse),lineCheckCorrelationId:null!=m?m:"",plannedUpgrade:null!==(d=s&&(null===(r=JSON.parse(s))||void 0===r?void 0:r.plannedUpgrade))&&void 0!==d?d:{}};s&&u&&(null===(a=JSON.parse(s))||void 0===a?void 0:a.eligibleBundle)&&Object.keys(null==c?void 0:c.selectedAdd).length&&O(p)}}catch(e){}}),[M]),e.useEffect((()=>{var e,t,o,l,i;n&&("lineCheckTemplate"===(null===(t=null===(e=null==n?void 0:n.reference)||void 0===e?void 0:e.content)||void 0===t?void 0:t.component)?R(null===(l=null===(o=null==n?void 0:n.reference)||void 0===o?void 0:o.content)||void 0===l?void 0:l.linecheck[0]):R(null===(i=null==n?void 0:n.linecheck)||void 0===i?void 0:i[0]))}),[]),e.useEffect((()=>{var e,n,t;(!(null==D?void 0:D.eligibleBundle)||(null==D?void 0:D.eligibleBundle.length)<1)&&P(!1),(null===(e=null==D?void 0:D.eligibleBundle)||void 0===e?void 0:e.length)&&(0!==Object.keys(V).length&&void 0!==(null===(n=null==D?void 0:D.maxUploadDownloadSpeed)||void 0===n?void 0:n.maxBandwidthDown)||null===(t=null==D?void 0:D.maxUploadDownloadSpeed)||void 0===t||t.maxBandwidthDown)}),[null===(o=null==D?void 0:D.eligibleBundle)||void 0===o?void 0:o.length]);const q=e.useRef(null),J={linecheckResponse:D,eligibleBundle:null==D?void 0:D.eligibleBundle,lineCheckContent:M,handleSelection:X,isAddressNotFilled:C,name:"lineCheck",onChange:H,selectedAddress:V,isFetchingLineCheck:B,apiError:$,setApiError:W,setFetchingLineCheck:A};Object.assign({},J);const[K,Y]=e.useState(),[Z,Q]=e.useState(!1);return e.useEffect((()=>{var e;(null===(e=null==D?void 0:D.eligibleBundle)||void 0===e?void 0:e.length)<1?Y(null==M?void 0:M.dataText):Y(""),Q(!1)}),[]),console.log("inside linecheck v3",M),e.createElement(e.Fragment,null,e.createElement("div",{className:"row justify-content-center ",ref:q},e.createElement("div",{className:"col-12 px-0 "},e.createElement("div",{className:` ${C&&!(null==D?void 0:D.eligibleBundle)?"gradientborder":""} maincontainer`},e.createElement("div",{className:((null==D?void 0:D.eligibleBundle)?"row position-relative inputRow":"row position-relative inputrow")+" ",onClick:()=>{var e;"mobile"===G&&(null===(e=null==k?void 0:k.current)||void 0===e||e.focus(),U(!0))}},(null==D?void 0:D.eligibleBundle)&&(K||!K&&(null===(l=null==D?void 0:D.eligibleBundle)||void 0===l?void 0:l.length)>1?e.createElement("img",{src:null===(a=null===(d=null===(r=null==M?void 0:M.linecheckIcons)||void 0===r?void 0:r[0])||void 0===d?void 0:d.tick)||void 0===a?void 0:a.filename,className:"tickIcons",height:"32px",width:"32px"}):e.createElement("img",{src:null===(s=null===(u=null===(c=null==M?void 0:M.linecheckIcons)||void 0===c?void 0:c[0])||void 0===u?void 0:u.close)||void 0===s?void 0:s.filename,className:"tickIcons ",height:"32px",width:"32px"})),((null==M?void 0:M.linecheckTitle)||(null==M?void 0:M.successLinecheckTitle))&&e.createElement(e.Fragment,null,e.createElement("h4",{className:"linechecktitle"},!B&&(null==D?void 0:D.eligibleBundle)?(null===(m=null==D?void 0:D.eligibleBundle)||void 0===m?void 0:m.length)<1?null==M?void 0:M.noConnectionTitle:null==M?void 0:M.successLinecheckTitle:null==M?void 0:M.linecheckTitle)),(null==D?void 0:D.eligibleBundle)?e.createElement(e.Fragment,null,e.createElement("div",null,"Linecheck success field")):e.createElement(e.Fragment,null,e.createElement("div",{className:"horizontalDivider"}),e.createElement("div",{className:"col-1 px-0 "},(null==D?void 0:D.eligibleBundle)?e.createElement(e.Fragment,null):e.createElement("img",{src:null===(_=null===(v=null===(p=null==M?void 0:M.linecheckIcons)||void 0===p?void 0:p[0])||void 0===v?void 0:v.home)||void 0===_?void 0:_.filename,height:""+("mobile"===G?"26px":"48px"),width:""+("mobile"===G?"26px":"48px"),alt:"home",className:"homeicon"})),e.createElement("div",{className:`col-lg-8 col-md-8 col-sm-8 ${"mobile"===G&&((null==D?void 0:D.eligibleBundle)?"col-12":"col-9")} px-0`},e.createElement("div",null,e.createElement(mt,{content:M,parentCallback:X,parentAddress:null==V?void 0:V.concatedAddress,ref:k,isAddressNotFilled:C,name:"lineCheck",onChange:H,setAddressNotFilled:P,apiError:$,setApiError:W,setFetchingLineCheck:A}))),e.createElement("div",{className:"col-lg-3 col-md-3 col-sm-3 col-2 px-0 marginautodefault"},"mobile"!==G||(null==D?void 0:D.eligibleBundle)?e.createElement("button",{name:"check address button",type:"button",className:"primarybutton mobileButton",disabled:!S.enableCheckaddress,hidden:!!(null==D?void 0:D.eligibleBundle),onClick:()=>{var e;(null==S?void 0:S.enableCheckaddress)?(A(!0),"undefined"!=typeof window&&Qn.deleteCookie("chAddressJson"),"undefined"!=typeof window&&Qn.setCookie("chAddressJson",JSON.stringify({addressValue:null==V?void 0:V.concatedAddress,selectedAdd:V}),{path:"/",maxAge:259200}),V&&Object.keys(V).length>0&&ut(V).then((e=>{"undefined"!=typeof window&&localStorage.setItem("LinecheckCall","true"),A(!1),O(e),W(!1),"mobile"===G&&F.openIndividualLineCheck&&U(!1)})).catch((e=>{console.log(e),W(!0),z(Object.assign(Object.assign({},F),{availabilityCheckClicked:!1})),"mobile"===G&&F.openIndividualLineCheck&&U(!0)}))):(P(!0),null===(e=null==k?void 0:k.current)||void 0===e||e.focus(),"mobile"===G&&U(!1))},style:{width:"100%",position:"relative",bottom:"10px"}},B&&!$&&""!==(null===(b=null==k?void 0:k.current)||void 0===b?void 0:b.value)?e.createElement(i.Spinner,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"}):null==M?void 0:M.buttonvalue):e.createElement("span",null,e.createElement("img",{width:52,height:52,alt:"search",src:null===(f=null===(g=null===(h=null==M?void 0:M.linecheckIcons)||void 0===h?void 0:h[0])||void 0===g?void 0:g.searchIcon)||void 0===f?void 0:f.filename})))),(null===(x=null==D?void 0:D.plannedUpgrade)||void 0===x?void 0:x.expectedSpeed)&&e.createElement(e.Fragment,null,e.createElement("div",{className:"col-lg-1 col-md-1 col-sm-1 col-12 px-0"},(null==D?void 0:D.eligibleBundle)&&e.createElement("img",{src:null===(T=null===(w=null===(y=null==M?void 0:M.linecheckIcons)||void 0===y?void 0:y[0])||void 0===w?void 0:w.upgrade)||void 0===T?void 0:T.filename,height:"32px",width:"32px",alt:"activeup"})),e.createElement("div",{className:"col-lg-8 col-md-8 col-sm-8 col-12 px-0"},(null==D?void 0:D.eligibleBundle)&&e.createElement("div",null," On Success"))))))),(null==M?void 0:M.helpText)&&!(null===(E=k.current)||void 0===E?void 0:E.value)?e.createElement("div",{className:"helpText"},!B&&(null==D?void 0:D.eligibleBundle)?"":null==M?void 0:M.helpText):"")},vt=({content:n,onSuccess:t})=>{var o,l,i;const[r,d]=e.useState(!0),a=null===(i=null===(l=null===(o=null==n?void 0:n.reference)||void 0===o?void 0:o.content)||void 0===l?void 0:l.body)||void 0===i?void 0:i[0];return console.log("inside linecheck modal"),e.createElement(Yn,{modalState:r,handler:()=>{d(!r)},showFooter:!1,noCloseButton:!1,backgroundColor:"transparent",fixedWidth:"850px"},e.createElement(pt,{content:a,onSuccess:t}))},_t=({content:n,offeringData:t,uniqueId:o,storyContent:l,metadata:i,tabIndex:r,cardsLength:d,indexKey:a,constants:u,mainContent:s,address:m,eligibleBundle:p,linecheckSuccessCallBack:v})=>{var g,x,y,w,T,E,C,P,S,N,V,I,L,D,B,A,M,R,F,W,G,j,U,X,H,J,K,Z,Q,ee,ne,oe,le,ie,re,de,ae,ce,ue,se,me;const[pe,ve]=e.useState(!1),[_e,he]=e.useState(!1),[ge,fe]=e.useState({showGift:!1,cashbackAvailable:!1}),[be,xe]=e.useState([]),[we,Te]=e.useState(!1),[Pe,Se]=e.useState(!1),[Ne,Ve]=e.useState(!1),Ie=void 0!==typeof window&&document.getElementById("static-linetable"),Oe=0===(null===(g=Object.keys(n))||void 0===g?void 0:g.length),Be=null===(E=null===(T=null===(w=null===(y=null===(x=null==n?void 0:n.products)||void 0===x?void 0:x[0])||void 0===y?void 0:y.reference)||void 0===w?void 0:w.content)||void 0===T?void 0:T.product)||void 0===E?void 0:E[0],Ae=null===(V=null===(N=null===(S=null===(P=null===(C=null==n?void 0:n.promotion)||void 0===C?void 0:C[0])||void 0===P?void 0:P.reference)||void 0===S?void 0:S.content)||void 0===N?void 0:N.promoDescription)||void 0===V?void 0:V[0],Me=null==Be?void 0:Be.productId,Re=null===(I=null==f?void 0:f.getInstance())||void 0===I?void 0:I.getCartUrl(),Fe=null===(L=null==b?void 0:b.getInstance())||void 0===L?void 0:L.getAssetPath(),ze="MOBILE"===(null==l?void 0:l.pageType);let We;We=m&&(null===(D=null==p?void 0:p.eligibleBundle)||void 0===D?void 0:D.includes(Me));let Ge=void 0!==typeof window&&c.get("sunriseAuth");Ge=Ge&&JSON.parse(Ge);const je=((null==t?void 0:t[o])||[]).filter((e=>(null==e?void 0:e.id)===Me)),Ue=()=>{he(!1);!(!(null==s?void 0:s.enableExistingCustomer)||null!=Ge)?Te(!0):Ke()},He=e=>{const n=be.findIndex((n=>(null==e?void 0:e.giftGroupId)===(null==n?void 0:n.giftGroupId))),t=be;-1===n?t.push(e):t[n]=e,xe([...t])},qe=((e,n)=>{let t;return n||(t=(e||[]).filter((e=>!0===(null==e?void 0:e.enableTV)))),t})(null==Be?void 0:Be.bloks,ze),Je=null===(B=null==qe?void 0:qe[0])||void 0===B?void 0:B.tvProductId,Ke=()=>{he(!1),((e,n,t,o,l,i,r,d,a,u,s)=>{var m;if(r)e(!0),0!==(null===(m=Object.keys(o))||void 0===m?void 0:m.length)&&te(o,"",(null==i?void 0:i.promoID)?null==i?void 0:i.promoID:$,n,"mobile",t).then((e=>{var n;c.remove("one-commerce-cartId",{path:"/"}),c.set("one-commerce-cartId",null==e?void 0:e.id,{path:"/"}),c.set("cartProduct",null==i?void 0:i.id,{path:"/"}),De(ye,o,"",ke),window.location.href=null===(n=null==l?void 0:l.summaryPageUrl)||void 0===n?void 0:n.cached_url})).catch((n=>{console.log(n),e(!1)})).finally((()=>{e(!1)}));else{const r="undefined"!=typeof window&&c.get("one-commerce-linecheckcorrelationid");a&&u&&r?(e(!0),0!==o.length&&te(o,d,(null==i?void 0:i.promoID)?null==i?void 0:i.promoID:z,n,"fixnet",t).then((e=>{var n;"undefined"!=typeof window&&c.remove("one-commerce-cartId",{path:"/"}),"undefined"!=typeof window&&c.set("one-commerce-cartId",null==e?void 0:e.id,{path:"/"}),"undefined"!=typeof window&&c.set("cartProduct",null==i?void 0:i.id,{path:"/"}),"undefined"!=typeof window&&c.remove("landline"),De(ye,o,"",ke),window.location.href=null===(n=null==l?void 0:l.summaryPageUrl)||void 0===n?void 0:n.cached_url})).catch((e=>{console.log(e)})).finally((()=>{e(!1)}))):s(!0)}})(ve,Re,be,je,s,Ye,ze,Je,p,m,Ve)},Ye=$e(je,ze);e.useEffect((()=>{var e;setTimeout((()=>{((e,n)=>{k(`headingV3${e}`,n),k(`descriptionV3${e}`,n),k(`titleV3${e}`,n),k(`detailsectionv3${e}`,n),k(`product-configv3${e}`,n),k(`gift-section${e}`,n),k(`benefits-section${e}`,n),k(`order-section${e}`,n),k(`price-section${e}`,n),k(`benefits-price-section${e}`,n),k(`contract-section${e}`,n)})(r,d)}),100);const n=(e=>{let n=!1,t=!1;return null==e||e.map((e=>{var o;null===(o=null==e?void 0:e.promotionInfo)||void 0===o||o.map((e=>{(null==e?void 0:e.hardwareGift)&&(n=!0),(null==e?void 0:e.cashBack)&&(t=!0)}))})),{showGift:n,cashbackAvailable:t}})(ze?je:null===(e=null==je?void 0:je[0])||void 0===e?void 0:e.bundledOffers);fe(Object.assign({},n))}),[t]);const Ze=()=>{(null==qe?void 0:qe.length)>0&&Se(!0)};return e.createElement("div",null,pe&&Ie&&h.createPortal(e.createElement(Y,{keyParams:"loading"}),Ie),Oe&&e.createElement("div",{className:"w-75 pb-2"},e.createElement(Xe,null)),!Oe&&p&&n&&m&&!ze&&e.createElement("div",{className:Dn.selected},e.createElement("span",{style:{paddingBottom:"10px"}},We?e.createElement("span",{className:Dn.activeicon},e.createElement("img",{src:`${Fe}/icons/lineCheck-success.svg`,alt:"",width:24,height:24,className:Dn.activeicon}),e.createElement("span",null,null==u?void 0:u.subscriptionAvalTxt)):e.createElement("span",{className:Dn.inactiveicon},e.createElement("img",{src:`${Fe}/icons/cross_disabled.svg`,alt:"",width:24,height:24,className:Dn.inactiveicon}),e.createElement("span",null,null==u?void 0:u.notSubscriptionTxt)))),e.createElement("div",{className:`${ze||!1!==We?"":Dn.overlay}`,style:{flexDirection:"column"}},e.createElement("div",{className:`${Dn.bundleproductcard} ${Dn.productcontainer} ${(null===(A=null==n?void 0:n.highlightText)||void 0===A?void 0:A.length)>0&&Dn.highlightBorder}`},(null===(M=null==Be?void 0:Be.highlightText)||void 0===M?void 0:M.length)>0&&e.createElement("div",{className:`${Dn.highlightText}`},null==n?void 0:n.highlightText),(null==Ae?void 0:Ae.displayText)&&e.createElement("div",{className:`${Dn.promocontainer}`,style:{background:null==Ae?void 0:Ae.bestSellerColor}},null==Ae?void 0:Ae.displayText),e.createElement("div",{className:`${Dn.detailsection}`,id:`detailsectionv3${r}${a}`},e.createElement("div",{className:`${Dn.headersection}`},e.createElement("div",{className:`${Dn.titlesection}`},e.createElement("div",{className:`${Dn.productheader}`,id:`titleV3${r}${a}`},null==Be?void 0:Be.productName),e.createElement("div",null,(null===(R=null==Be?void 0:Be.icon)||void 0===R?void 0:R.filename)&&e.createElement("img",{className:`${Dn.imagecontainer}`,src:null===(F=null==Be?void 0:Be.icon)||void 0===F?void 0:F.filename,height:15,width:20}))),e.createElement("div",{className:`${Dn.productdescription}`,id:`descriptionV3${r}${a}`},e.createElement(q,{content:null==Be?void 0:Be.description})),e.createElement("div",{className:`${Dn.images}`},(null===(W=null==Be?void 0:Be.img)||void 0===W?void 0:W.filename)&&e.createElement("img",{className:`${Dn.imagespace} ${(null==n?void 0:n.highlightText)&&Dn.borderimage}`,alt:"cardimg",src:null===(G=null==Be?void 0:Be.img)||void 0===G?void 0:G.filename}))),e.createElement("div",{className:`${Dn.productconfig}`,id:`product-configv3${r}${a}`},Oe?e.createElement(e.Fragment,null,e.createElement("div",{className:Dn.space}),e.createElement(Xe,{stylename:Dn.skeletontittle,count:1}),e.createElement(Xe,{stylename:Dn.skeletonline,count:5}),e.createElement("div",{className:Dn.space}),e.createElement(Xe,{stylename:Dn.skeletontittle,count:1}),e.createElement(Xe,{stylename:Dn.skeletonline,count:5})):e.createElement("div",null,(null==Be?void 0:Be.bloks)&&(null===(j=null==Be?void 0:Be.bloks)||void 0===j?void 0:j.map(((n,t)=>e.createElement(Bn,{content:n,indexKey:t,constants:u,key:t,showModalPopup:Ze}))))))),e.createElement("div",{className:`${Dn.detailsection}`,id:`benefits-price-section${r}${a}`},e.createElement("div",{className:`${Dn.benefitssection}`,id:`benefits-section${r}${a}`},(null===(U=null==Be?void 0:Be.benefits)||void 0===U?void 0:U.length)>0&&e.createElement(An,{content:null==Be?void 0:Be.benefits,benefitData:Ye,constants:u})),e.createElement("br",null),e.createElement("div",{className:`${Dn.giftsection}`,id:`gift-section${r}${a}`},(null==ge?void 0:ge.showGift)&&(null===(X=null==Ae?void 0:Ae.singleGift)||void 0===X?void 0:X.map(((n,t)=>e.createElement(fn,{content:n,key:t})))),(null==ge?void 0:ge.showGift)&&(null===(H=null==Ae?void 0:Ae.giftConfig)||void 0===H?void 0:H.map(((n,t)=>e.createElement(xn,{content:n,key:t,selectedGiftItem:He,parentPoType:ze?"MOBILE":"HOME"})))),e.createElement("div",{className:`${Dn.giftsection}`,id:`cashback-section${r}${a}`},(null==Ae?void 0:Ae.cashBack)&&(null==ge?void 0:ge.cashbackAvailable)&&(null===(J=null==Ae?void 0:Ae.cashBack)||void 0===J?void 0:J.map(((n,t)=>e.createElement(Nn,{content:n,key:t})))))),e.createElement("div",{className:`${Dn.ordersection}`,id:`order-section${r}${a}`},""===(null==Ye?void 0:Ye.base)?e.createElement("div",null,e.createElement(Xe,{stylename:Dn.skeletontittle})):e.createElement("div",{className:`${Dn.flexgrid} ${Dn.pricesection} `,id:`price-section${r}${a}`},e.createElement(Mn,{priceCollection:Ye,constants:u,promoText:null==Be?void 0:Be.promoText})),e.createElement("div",{className:`${(null==l?void 0:l.swapButton)&&Dn.swapButton}`},e.createElement("div",{style:{padding:"16px 0"}},e.createElement(Rn,{isMobileFlow:ze,createCartCall:ze?Ue:Ke,constants:u,storyContent:l,showPrice:Ye,isAvailable:We,address:m})),e.createElement("div",{className:Dn.productcontractduration,id:`contract-section${r}${a}`},(null==Ye?void 0:Ye.contractDuration)?O(null===(K=null==u?void 0:u.minContractDuration)||void 0===K?void 0:K.substring(1),[null==Ye?void 0:Ye.contractDuration]):null==u?void 0:u.noContractDuration),(null===(Z=null==l?void 0:l.addSmartPhone)||void 0===Z?void 0:Z.length)>0&&e.createElement("div",{style:{textAlign:"center",padding:"4px"}},(null==l?void 0:l.swapButton)?(null==l?void 0:l.ctaLabel)&&e.createElement("div",{style:{padding:"16px 0"}},e.createElement("button",{className:"primarybutton",onClick:()=>qn(Ye,l,je)},e.createElement("span",{className:Dn.buttontext},null==l?void 0:l.ctaLabel))):e.createElement("span",{className:`${Dn.productdetailslink} ${Dn.addsmartphone}`},e.createElement("div",null,e.createElement("span",null,(null===(ne=null===(ee=null===(Q=null==l?void 0:l.addSmartPhone)||void 0===Q?void 0:Q[0])||void 0===ee?void 0:ee.buttonIcon)||void 0===ne?void 0:ne.filename)&&e.createElement("img",{src:null===(ie=null===(le=null===(oe=null==l?void 0:l.addSmartPhone)||void 0===oe?void 0:oe[0])||void 0===le?void 0:le.buttonIcon)||void 0===ie?void 0:ie.filename,width:12,height:18,alt:"icon"})),e.createElement("span",null,e.createElement("a",{onClick:()=>qn(Ye,l,je)},null===(de=null===(re=null==l?void 0:l.addSmartPhone)||void 0===re?void 0:re[0])||void 0===de?void 0:de.buttonLabel)))))),e.createElement("div",{style:{textAlign:"center",padding:"4px"}},(null===(ae=null==Be?void 0:Be.productDetails)||void 0===ae?void 0:ae.length)>0&&e.createElement("span",{className:Dn.productdetailslink,onClick:()=>{he(!_e),yn(Ce,Ee,Le(je,"",ke))}},null==u?void 0:u.productDetailsLink)),_e&&e.createElement(Hn,{content:null==Be?void 0:Be.productDetails,showProductDetail:_e,setShowProductDetail:he,constants:u,showPrice:Ye,isMobileFlow:ze,createCartCall:ze?Ue:Ke,storyContent:l,isAvailable:We,address:m}))))),Pe&&(Oe?e.createElement(Xe,null):e.createElement(Kn,{content:null==qe?void 0:qe[0],setShowModal:Se,showModal:Pe,constants:u})),we&&ze&&(null===(ce=null==s?void 0:s.loginData)||void 0===ce?void 0:ce.length)>0&&Ie&&h.createPortal(e.createElement(_.LoginModalV2,{content:null===(ue=null==s?void 0:s.loginData)||void 0===ue?void 0:ue[0],closeLogin:()=>{Te(!1)},metadata:i,onSuccess:()=>{Te(!1),Ke()}}),Ie),Ne&&!ze&&(null===(se=null==s?void 0:s.linecheckData)||void 0===se?void 0:se.length)>0&&e.createElement(vt,{content:null===(me=null==s?void 0:s.linecheckData)||void 0===me?void 0:me[0],onSuccess:()=>{let e="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse");p=e&&(null===JSON||void 0===JSON?void 0:JSON.parse(e)),m="undefined"!=typeof window&&c.get("chAddressJson"),Ve(!1),"function"==typeof v&&v(),Ke()}}))},ht=({content:n,setGenericErrorModalDetails:t,metadata:o,tabIndex:l,constants:i,loginSuccess:r,activeIndex:d,mainContent:a,address:u,eligibleBundle:s,linecheckSuccessCallBack:m})=>{var p,v,_;const h=L(),g=null==n?void 0:n._uid,[b,x]=e.useState(),y=null===(p=null==f?void 0:f.getInstance())||void 0===p?void 0:p.getBaseUrl();let w=void 0!==typeof window&&c.get("sunriseAuth");w=w&&JSON.parse(w);const T="MOBILE"===(null==n?void 0:n.pageType);e.useEffect((()=>(setTimeout((()=>{E()}),100),null===window||void 0===window||window.addEventListener("resize",E),null===window||void 0===window||window.addEventListener("load",E),()=>{window.removeEventListener("resize",E),window.removeEventListener("load",E)})),[null==n?void 0:n.productList]);const E=()=>{var e;k(`productCardV3${d}`,null===(e=null==n?void 0:n.productList)||void 0===e?void 0:e.length)};e.useEffect((()=>{var e;b&&(null===(e=Object.keys(b))||void 0===e?void 0:e.length)>0&&Re("view",b[g],"",ke)}),[b]),e.useEffect((()=>{var e;b&&(null===(e=Object.keys(b))||void 0===e?void 0:e.length)>0&&!T&&(null==s?void 0:s.eligibleBundle)&&Re("available",b[g],"",ke,null==s?void 0:s.eligibleBundle)}),[s,b]);const C=()=>{var e,o;const i=[],c=null==a?void 0:a.enableExistingCustomer,u=null==a?void 0:a.subscriptionType,s=null==n?void 0:n.isReturnPromo;var m,p;if(m=null==n?void 0:n.productList,p=i,null==m||m.map((e=>{var n,t,o,l,i,r,d,a,c,u,s;const m={id:"",promoIds:[]},v=null===(i=null===(l=null===(o=null===(t=null===(n=null==e?void 0:e.products)||void 0===n?void 0:n[0])||void 0===t?void 0:t.reference)||void 0===o?void 0:o.content)||void 0===l?void 0:l.product)||void 0===i?void 0:i[0],_=null===(u=null===(c=null===(a=null===(d=null===(r=null==e?void 0:e.promotion)||void 0===r?void 0:r[0])||void 0===d?void 0:d.reference)||void 0===a?void 0:a.content)||void 0===c?void 0:c.promoDescription)||void 0===u?void 0:u[0];m.id=null==v?void 0:v.productId,null===(s=null==m?void 0:m.promoIds)||void 0===s||s.push(null==_?void 0:_.promotionId),null==p||p.push(m)})),l===d&&!(null==b?void 0:b[g])||l===d&&r)try{null===(e=oe(i,null==n?void 0:n._uid,y,c,u,s))||void 0===e||e.then((e=>{x(e),t({showPopup:!1})})).catch((e=>{var n;console.log("error---\x3e",e),t({showPopup:!0,content:null===(n=null==a?void 0:a.telesalesBlok)||void 0===n?void 0:n[0]})}))}catch(e){console.log("error---\x3e",e),t({showPopup:!0,content:null===(o=null==a?void 0:a.telesalesBlok)||void 0===o?void 0:o[0]})}};return e.useEffect((()=>{d!=l&&d||C()}),[d]),e.useEffect((()=>{(null==w?void 0:w.siteId)&&r&&C()}),[r]),e.createElement("div",null,e.createElement("div",{className:Dn.titlecontainer},(null==n?void 0:n.title)&&e.createElement("div",{className:Dn.title},null==n?void 0:n.title),(null==n?void 0:n.subTitle)&&e.createElement("div",{className:Dn.description},null==n?void 0:n.subTitle)),e.createElement("div",{className:"linetableV3"},h&&e.createElement(We,{carouselIndex:d,key:d,arrow:null==a?void 0:a.enableMobileArrows},((null===(v=null==n?void 0:n.productList)||void 0===v?void 0:v.length)&&(null==n?void 0:n.productList)||new Array((null===(_=null==n?void 0:n.productList)||void 0===_?void 0:_.length)||3).fill(1)).map(((t,r)=>{var c;return e.createElement("div",{id:`productCardV3${d}`,style:{textAlign:"center"}},e.createElement(_t,{content:t,offeringData:b,uniqueId:g,storyContent:n,metadata:o,tabIndex:l,cardsLength:null===(c=null==n?void 0:n.productList)||void 0===c?void 0:c.length,indexKey:r,constants:i,mainContent:a,linecheckSuccessCallBack:m,address:u,eligibleBundle:s}))})))))};exports.AssetPathPropConfig=b,exports.Button=({type:n,text:t,onClick:o,content:l})=>e.createElement("button",{type:"button",className:`button Button-${null==l?void 0:l.type}`,onClick:o},null==l?void 0:l.text),exports.Card=({content:n,updatedContent:t,indexKey:o,listLength:l,addToCart:i,metadata:r,modalTriggered:d,showPrice:a})=>{var c,u,s,m,p,v,_,h,g,f,b,x,y,w,T,E,C,P,S,N,V,I,L,D,O,B,A,M,R,F,z,$,W,G,j,U,X,H,J,K,Y,Z,Q,ee,ne,te,oe,le,de,ae,ce,ue,se,_e,he;const ge=Object.assign({},null!==(s=null===(u=null===(c=null==n?void 0:n.testProductReference)||void 0===c?void 0:c[0])||void 0===u?void 0:u.reference)&&void 0!==s?s:null==n?void 0:n.reference),fe={listLength:l,indexKey:o,arrowUpIcon:null===(_=null===(v=null===(p=null===(m=null==ge?void 0:ge.content)||void 0===m?void 0:m.body)||void 0===p?void 0:p[0])||void 0===v?void 0:v.arrowUp)||void 0===_?void 0:_.filename,arrowDownIcon:null===(b=null===(f=null===(g=null===(h=null==ge?void 0:ge.content)||void 0===h?void 0:h.body)||void 0===g?void 0:g[0])||void 0===f?void 0:f.arrowDown)||void 0===b?void 0:b.filename,arrowLeftRed:null===(T=null===(w=null===(y=null===(x=null==ge?void 0:ge.content)||void 0===x?void 0:x.body)||void 0===y?void 0:y[0])||void 0===w?void 0:w.arrowLeftRed)||void 0===T?void 0:T.filename},be=null!==(E=null==t?void 0:t.enableNewAddToCart)&&void 0!==E&&E,xe=e.useRef(null),ye=e.useRef(null),we=e.useMemo((()=>fe),[fe]),Te=()=>{k("linetable-card-title",l),k("linetable-card-tooltiptxt",l),k("linetable-card-bottomConatiner",l)};return e.useEffect((()=>{setTimeout((()=>{Te()}),100),null===window||void 0===window||window.addEventListener("resize",Te)}),[n]),e.createElement(ie.Provider,{value:we},e.createElement("div",{className:"linetable-card-productTeaser"},e.createElement("div",{className:"linetable-card-productContainer "},ge.content&&e.createElement(e.Fragment,null,e.createElement("div",{className:"linetable-card-titleContainer",id:`linetable-card-title${o}`,ref:xe},e.createElement("div",{className:"linetable-card-prodHeading"},null===(P=null===(C=null==ge?void 0:ge.content)||void 0===C?void 0:C.body[0])||void 0===P?void 0:P.name),e.createElement("div",{className:"linetable-card-productTitle"},e.createElement("h3",null,null===(N=null===(S=null==ge?void 0:ge.content)||void 0===S?void 0:S.body[0])||void 0===N?void 0:N.displayName),(null===(L=null===(I=null===(V=null==ge?void 0:ge.content)||void 0===V?void 0:V.body[0])||void 0===I?void 0:I.prodImage)||void 0===L?void 0:L.filename)&&e.createElement("img",{src:null===(B=null===(O=null===(D=null==ge?void 0:ge.content)||void 0===D?void 0:D.body[0])||void 0===O?void 0:O.prodImage)||void 0===B?void 0:B.filename,height:15,width:20})),e.createElement("div",{className:"linetable-card-prodDescription"},e.createElement(q,{content:null===(M=null===(A=null==ge?void 0:ge.content)||void 0===A?void 0:A.body[0])||void 0===M?void 0:M.description}))),!(null==t?void 0:t.isPrepaidFlow)&&e.createElement("hr",null)),(null==ge?void 0:ge.content)&&(null===(F=null===(R=null==ge?void 0:ge.content)||void 0===R?void 0:R.body[0])||void 0===F?void 0:F.introText)&&e.createElement(e.Fragment,null,e.createElement("div",{className:""+(be?"d-block":"d-none d-sm-block")},e.createElement("div",{className:"linetable-card-introText",id:`linetable-card-tooltiptxt${o}`,ref:ye},e.createElement(q,{content:null===($=null===(z=null==ge?void 0:ge.content)||void 0===z?void 0:z.body[0])||void 0===$?void 0:$.introText})),e.createElement("hr",null))),null===(j=(null===(G=null===(W=null==ge?void 0:ge.content)||void 0===W?void 0:W.body[0])||void 0===G?void 0:G.entitlementConfig)||[])||void 0===j?void 0:j.map(((t,o)=>e.createElement(re,{content:t,product:n,key:o,indexKey:o,showEntitleValue:be,metadata:r,modalTriggered:d}))),e.createElement("hr",null),e.createElement("div",{id:`linetable-card-bottomConatiner${o}`,className:"linetable-card-bottomConatiner"},e.createElement("div",{className:"linetable-card-productDetailSection"},(null===(J=null===(H=null===(X=null===(U=null==ge?void 0:ge.content)||void 0===U?void 0:U.body)||void 0===X?void 0:X[0])||void 0===H?void 0:H.productDetailIcon)||void 0===J?void 0:J.filename)&&e.createElement("img",{src:null===(Q=null===(Z=null===(Y=null===(K=null==ge?void 0:ge.content)||void 0===K?void 0:K.body)||void 0===Y?void 0:Y[0])||void 0===Z?void 0:Z.productDetailIcon)||void 0===Q?void 0:Q.filename,width:24,height:24}),e.createElement(pe,{content:null===(ne=null===(ee=null==ge?void 0:ge.content)||void 0===ee?void 0:ee.body)||void 0===ne?void 0:ne[0],updatedContent:t,modalTriggered:d,addToCart:i})),e.createElement("div",null,(null===(le=null===(oe=null===(te=null==ge?void 0:ge.content)||void 0===te?void 0:te.body)||void 0===oe?void 0:oe[0])||void 0===le?void 0:le.isEnablePrice)&&e.createElement(me,{content:null===(ae=null===(de=null==ge?void 0:ge.content)||void 0===de?void 0:de.body)||void 0===ae?void 0:ae[0],addToCart:i,variant:"productCard"})),e.createElement("div",null,!(null===(se=null===(ue=null===(ce=null==ge?void 0:ge.content)||void 0===ce?void 0:ce.body)||void 0===ue?void 0:ue[0])||void 0===se?void 0:se.isEnablePrice)&&!(null==t?void 0:t.staticPrice)&&e.createElement(ve,{content:null===(he=null===(_e=null==ge?void 0:ge.content)||void 0===_e?void 0:_e.body)||void 0===he?void 0:he[0],showPrice:a,addToCart:i}))))))},exports.CardEntitlement=re,exports.CarouselComp=n=>e.createElement(e.Fragment,null,e.createElement(s,{responsive:{desktop:{breakpoint:{max:7e3,min:1440},items:4},tabletLarge:{breakpoint:{max:1439,min:1024},items:3},tabletMedium:{breakpoint:{max:1023,min:768},items:2},mobile:{breakpoint:{max:767,min:0},items:1}},deviceType:"desktop",ssr:!0,renderButtonGroupOutside:!0,partialVisible:!0,swipeable:!0,autoPlay:!1,shouldResetAutoplay:!1,arrows:!0},n.children),e.createElement("p",null,"compo")),exports.LineTableBasicPropConfig=f,exports.LinecheckBasicPropConfig=ge,exports.LoginModal=({toggleFun:n})=>(e.useState(!1),e.createElement("div",{className:"loginModal"},e.createElement("div",{className:"w-100 h-100 d-flex position-relative justify-content-center align-items-center"},e.createElement("div",{className:"loginContainer"},"Hi Angles Kathirvel",e.createElement("button",{onClick:n},"Close"))))),exports.ProductTableV3=({content:t,metadata:o,setGenericErrorModalDetails:l,loginSuccess:r,lineCheckCallBack:d,tabCheckCallBack:a,changeAddressClicked:u})=>{var s,m,p;const[v,_]=e.useState(),[h,g]=e.useState(),[b,x]=e.useState(0);let y="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse"),w=y&&(null===JSON||void 0===JSON?void 0:JSON.parse(y)),T="undefined"!=typeof window&&c.get("chAddressJson");const P=null===(s=null==f?void 0:f.getInstance())||void 0===s?void 0:s.getSBUrl(),k=P+E,S=P+C,N={find_by:"uuid",language:null==o?void 0:o.lang,type:"B2C",value:null==o?void 0:o.storyId};return e.useEffect((()=>{var e,t;(e=k,t=N,Z(void 0,void 0,void 0,(function*(){try{return yield n.CMSStoryblokServiceV2.get(e,t).then((e=>{var n,t,o;const l=null===(o=null===(t=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.story)||void 0===t?void 0:t.content)||void 0===o?void 0:o.body;for(const e of l)if("productTableV2"==e.component||"productTableWithOutLC"===e.component||"prodConfigContainer"===e.component)return e})).catch((e=>{throw e}))}catch(e){return e}}))).then((e=>g(e))),((e="en",t)=>{try{return n.CMSStoryblokServiceV2.get(t,{dimension:e,per_page:1e3,type:"B2C"}).then((e=>{var n;const t={};((null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.datasource_entries)||[]).map((e=>{t[e.name]=null!=e.dimension_value?e.dimension_value:e.value}));try{localStorage.removeItem("sbstaticcontent"),localStorage.setItem("sbstaticcontent",JSON.stringify(t))}catch(e){}return t})).catch((e=>e))}catch(e){throw Error("Promise failed")}})(null==o?void 0:o.lang,S).then((e=>_(e))).catch((e=>console.log(e)))}),[]),e.useEffect((()=>{var e,n,t;const o=new URLSearchParams(null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.search),l=null==o?void 0:o.get("tabOption");h&&null!==l&&((null==h?void 0:h.productContainer)||[]).map(((e,n)=>{(null==e?void 0:e.tabId)===l&&x(n)}));const i=null===(t=null===(n=null==h?void 0:h.productContainer)||void 0===n?void 0:n[b])||void 0===t?void 0:t.tabId;null==a||a(i)}),[h]),e.useEffect((()=>{y="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse"),w=y&&(null===JSON||void 0===JSON?void 0:JSON.parse(y)),T="undefined"!=typeof window&&c.get("chAddressJson")}),[u]),e.createElement("div",{id:"reusable-linetable"},(null==h?void 0:h.productContainer)&&e.createElement(e.Fragment,null,e.createElement(ae,null,e.createElement("div",{className:`row justify-content-center ${ze.tabblock}`},(null===(m=null==h?void 0:h.productContainer)||void 0===m?void 0:m.length)>1&&e.createElement("div",{className:` ${ze.tabcontainer}`},((null==h?void 0:h.productContainer)||[]).map(((n,t)=>e.createElement("div",{className:` ${ze.tabs} ${b===t?ze.tabcontentactive:ze.tabcontentinactive}`,key:null==n?void 0:n.tabCaption},e.createElement("label",{className:` ${ze.tabcontent} `},e.createElement("input",{type:"radio",checked:b===t,onChange:()=>{x(t),null==a||a(null==n?void 0:n.tabId),yn(Ce,Ne,{click_text:null==n?void 0:n.tabCaption})}}),null==n?void 0:n.tabCaption))))))),e.createElement(ae,{resuablelineTable:!0},e.createElement("div",{className:"position-relative "},e.createElement(i.Carousel,{activeIndex:b,indicators:!1,controls:!1,interval:null,id:"pt-carousel",slide:!1},(null===(p=null==h?void 0:h.productContainer)||void 0===p?void 0:p.length)>0&&((null==h?void 0:h.productContainer)||[]).map(((n,t)=>e.createElement(i.Carousel.Item,{key:t},e.createElement(In,{content:Object.assign(Object.assign({},n),{pageType:n.pageType,dynamicProductOffer:!0,tabIndex:t,activeIndex:b,lineTableContent:h}),metadata:o,activeIndex:b,lineCheckCallBack:d,tabCheckCallBack:a,sbStaticConstants:v,address:T,eligibleBundle:w,setGenericErrorModalDetails:l,loginSuccess:r})))))))))},exports.ProductTeaser=({content:t,lineCheckCallBack:o,offerDataCallBack:l,productCallBack:i,tableSelectedTab:r})=>{var d,a,c,m,p,v,_,h;const[g,f]=e.useState([]),[b,w]=e.useState(""),[T,E]=e.useState(!1),C=null===(d=null==he?void 0:he.getInstance())||void 0===d?void 0:d.getBaseUrl(),P=L(),k=null===(a=(null==t?void 0:t.productTeaserSlides)||[])||void 0===a?void 0:a.map((e=>null==e?void 0:e.tabTitle)),N=e=>{var n,o,l,i;const r=null!==(i=null===(l=null===(o=null===(n=(null==t?void 0:t.productTeaserSlides)||[])||void 0===n?void 0:n.filter((n=>(null==n?void 0:n.tabTitle)===e)))||void 0===o?void 0:o[0])||void 0===l?void 0:l.heading)&&void 0!==i?i:"";var d,a;d=Ne,a=r,window.dataLayer.push({event:Ce,event_name:d,click_text:a})},V=[];return null===(c=(null==t?void 0:t.productTeaserSlides)||[])||void 0===c||c.forEach(((e,n)=>{var t,o;(null==e?void 0:e.productId)&&0===(null===(t=V.filter((n=>n.id===(null==e?void 0:e.productId))))||void 0===t?void 0:t.length)&&V.push({id:null==e?void 0:e.productId,promoIds:[(null==e?void 0:e.promoId)?null==e?void 0:e.promoId:(null==e?void 0:e.productType)===F?z:$]}),(null==e?void 0:e.tvProductId)&&0===(null===(o=V.filter((n=>(null==n?void 0:n.id)===(null==e?void 0:e.tvProductId))))||void 0===o?void 0:o.length)&&V.push({id:null==e?void 0:e.tvProductId,promoIds:[(null==e?void 0:e.promoId)?null==e?void 0:e.promoId:z]})})),e.useEffect((()=>{var e,t;0===(null==g?void 0:g.length)&&(e=V,t=C,Z(void 0,void 0,void 0,(function*(){try{localStorage.removeItem("entertainment");const o={headers:{"x-correlation-id":u.v4(),"x-sunrise-channel":x}},l=t+y,i=yield n.ApiServiceV2.getApiServiceInstance().post(l,e,o).then((e=>{if(200==e.status)return null==e?void 0:e.data}));if(i.error)return i.error;{const e=[];return null==i||i.forEach((n=>{e[n.id]=n})),e}}catch(e){console.log("error---\x3e",e)}}))).then((e=>{var n;e&&(null===(n=Object.keys(e))||void 0===n?void 0:n.length)>0&&f(e)})).catch((e=>{console.log("error---\x3e",e)}))}),[]),e.useEffect((()=>{var e;(null===(e=null==t?void 0:t.productTeaserSlides)||void 0===e?void 0:e.map((e=>e.productType))).map((e=>{var n,o,r,d,a,c,u,s,m,p,v,_,h;if(1==(null===(n=Object.keys(g))||void 0===n?void 0:n.length)&&"function"==typeof l&&e===W&&"function"==typeof i){const e=null===(r=null===(o=null==V?void 0:V[0])||void 0===o?void 0:o.promoIds)||void 0===r?void 0:r[0],n=null===(d=null==V?void 0:V[0])||void 0===d?void 0:d.id;l(g[n],e,b),i(n)}else if((null===(a=Object.keys(g))||void 0===a?void 0:a.length)>1&&"function"==typeof l&&e===W&&"function"==typeof i){const e=null!==(m=null===(s=null===(u=null===(c=null==V?void 0:V.filter((e=>(null==e?void 0:e.id)===b)))||void 0===c?void 0:c[0])||void 0===u?void 0:u.promoIds)||void 0===s?void 0:s[0])&&void 0!==m?m:"",n=null!==(_=null===(v=null===(p=null==V?void 0:V.filter((e=>(null==e?void 0:e.id)===b)))||void 0===p?void 0:p[0])||void 0===v?void 0:v.id)&&void 0!==_?_:"";l(g[b],e,b),i(n)}else e===F&&(null===(h=null==t?void 0:t.productTeaserSlides)||void 0===h||h.map((e=>{var n,t,o,i,r;const d=T?null==e?void 0:e.tvProductId:null==e?void 0:e.productId;if((null===(n=Object.keys(g))||void 0===n?void 0:n.length)>0&&"function"==typeof l){const e=null!==(r=null===(i=null===(o=null===(t=null==V?void 0:V.filter((e=>(null==e?void 0:e.id)===d)))||void 0===t?void 0:t[0])||void 0===o?void 0:o.promoIds)||void 0===i?void 0:i[0])&&void 0!==r?r:"";l(g[d],e)}})))}))}),[g,b,T]),e.useEffect((()=>{""!==b&&N(b)}),[b]),e.createElement("div",{className:"position-relative"},(null===(m=null==t?void 0:t.productTeaserSlides)||void 0===m?void 0:m.length)>0&&P&&e.createElement(s,{responsive:{desktop:{breakpoint:{max:7e3,min:1440},items:1},tabletLarge:{breakpoint:{max:1439,min:1024},items:1},tabletMedium:{breakpoint:{max:1023,min:768},items:1},mobile:{breakpoint:{max:767,min:0},items:1}},autoPlay:!1,shouldResetAutoplay:!1,showDots:1!==(null===(p=null==t?void 0:t.productTeaserSlides)||void 0===p?void 0:p.length),customDot:e.createElement((n=>{const{onClick:t,active:o,index:l}=n;return o&&w(k[l]),e.createElement("button",{className:o?_e.stageTeaserTabActive:_e.stageTeaserTab,onClick:()=>t()},k[l])}),null),dotListClass:_e.carousel_dot,itemClass:_e.carouselItem,ssr:!0,arrows:!1,containerClass:`${_e.carouselContainer} ${S(null===(_=null===(v=null==t?void 0:t.productTeaserSlides)||void 0===v?void 0:v[0])||void 0===_?void 0:_.gradientBackground)}`,sliderClass:_e.sliderClass,customButtonGroup:e.createElement((n=>{var o,l,i;return e.createElement(e.Fragment,null,(null===(o=null==t?void 0:t.productTeaserSlides)||void 0===o?void 0:o.length)>1&&P!==W&&e.createElement("div",{style:{textAlign:"center"}},e.createElement("button",{disabled:0===(null===(l=null==n?void 0:n.carouselState)||void 0===l?void 0:l.currentSlide),className:_e.leftArrow,onClick:n.previous}),e.createElement("button",{disabled:(null===(i=null==n?void 0:n.carouselState)||void 0===i?void 0:i.currentSlide)+1===(null==n?void 0:n.carouselState.totalItems),className:_e.rightArrow,onClick:n.next})))}),null),customTransition:"transform 1s ease",transitionDuration:500},null===(h=(null==t?void 0:t.productTeaserSlides)||[])||void 0===h?void 0:h.map(((n,l)=>e.createElement(Fe,{content:t,slides:n,index:l,offeringData:g,lineCheckCallBack:o,setEnableToggle:E,tableSelectedTab:r})))))},exports.ProductTeaserPropConfig=he,exports.StaticLineTable=({content:n,tabCheckCallBack:t,setGenericErrorModalDetails:o,metadata:l,loginSuccess:r,changeAddressClicked:d,linecheckSuccessCallBack:a})=>{var u,s,m;const[p,v]=e.useState(0),_=null===(u=null==n?void 0:n.oneEcomConstants)||void 0===u?void 0:u[0];let h="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse"),g=h&&(null===JSON||void 0===JSON?void 0:JSON.parse(h)),f="undefined"!=typeof window&&c.get("chAddressJson");return e.useEffect((()=>{var e,o,l;const i=new URLSearchParams(null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.search),r=null==i?void 0:i.get("tabOption");n&&null!==r&&((null==n?void 0:n.productContainer)||[]).map(((e,n)=>{(null==e?void 0:e.tabId)===r&&v(n)}));const d=null===(l=null===(o=null==n?void 0:n.productContainer)||void 0===o?void 0:o[p])||void 0===l?void 0:l.tabId;"function"==typeof t&&(null==t||t(d))}),[n]),e.useEffect((()=>{h="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse"),g=h&&(null===JSON||void 0===JSON?void 0:JSON.parse(h)),f="undefined"!=typeof window&&c.get("chAddressJson")}),[d]),e.createElement("div",null,e.createElement("div",{id:"static-linetable"},(null==n?void 0:n.productContainer)&&e.createElement(e.Fragment,null,e.createElement(ae,null,e.createElement("div",{className:`row justify-content-center ${Dn.tabblock}`},(null===(s=null==n?void 0:n.productContainer)||void 0===s?void 0:s.length)>1&&e.createElement("div",{className:` ${Dn.tabcontainer}`},((null==n?void 0:n.productContainer)||[]).map(((n,o)=>e.createElement("div",{className:` ${Dn.tabs} ${p===o?Dn.tabcontentactive:Dn.tabcontentinactive}`,key:null==n?void 0:n.tabCaption},e.createElement("label",{className:` ${Dn.tabcontent} `},e.createElement("input",{type:"radio",checked:p===o,onChange:()=>{v(o),"function"==typeof t&&(null==t||t(null==n?void 0:n.tabId)),yn(Ce,Ne,{click_text:null==n?void 0:n.tabCaption})}}),null==n?void 0:n.tabCaption))))))),e.createElement(ae,{resuablelineTable:!0},e.createElement("div",{className:"position-relative "},e.createElement(i.Carousel,{activeIndex:p,indicators:!1,controls:!1,interval:null,id:"pt-carousel",slide:!1},(null===(m=null==n?void 0:n.productContainer)||void 0===m?void 0:m.length)>0&&((null==n?void 0:n.productContainer)||[]).map(((t,d)=>e.createElement(i.Carousel.Item,{key:d},e.createElement(ht,{content:t,setGenericErrorModalDetails:o,metadata:l,tabIndex:d,constants:_,loginSuccess:r,activeIndex:p,mainContent:n,address:f,eligibleBundle:g,linecheckSuccessCallBack:a}))))))))))},exports.StickyProductAnchor=({content:n,offerData:t,lineCheckCallBack:o})=>{var l,i,r,d,a,u,s,m,p,v;const _=null===(l=null==f?void 0:f.getInstance())||void 0===l?void 0:l.getCartUrl(),[g,b]=e.useState(!1),[x,y]=e.useState(!1),[w,T]=e.useState("noFalconStyle"),[E,C]=e.useState("noFalconStyle"),[P,k]=e.useState(!1),S=L(),V=null===(i=null==n?void 0:n.filter((e=>(null==e?void 0:e.productId)===(null==t?void 0:t.id))))||void 0===i?void 0:i[0];let I=0;I=(null==t?void 0:t.derivedPrice)?null===(d=null===(r=null==t?void 0:t.derivedPrice)||void 0===r?void 0:r[0])||void 0===d?void 0:d.value:null===(u=null===(a=null==t?void 0:t.prices)||void 0===a?void 0:a[0])||void 0===u?void 0:u.value;const D=e=>{const n=(null==e?void 0:e.id)&&document.getElementById(null==e?void 0:e.id);k(!1),n&&n.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},O=()=>e.createElement("div",{className:Ln.priceSection},"CHF"," ",N(I),e.createElement("span",{className:Ln.priceDuration},null==V?void 0:V.monthText));e.useEffect((()=>{const e=()=>{var e;const n=document.getElementById("productTeaser");if(!n)return;const{top:t,bottom:o}=n.getBoundingClientRect(),l=(null===window||void 0===window?void 0:window.innerHeight)||document.documentElement.clientHeight;b(t<l&&o>=0);let i=document.querySelectorAll(".sticky-header2");const r=document.getElementById("stickyAnchorContainer"),d=document.querySelectorAll(".sticky-header");if(null!=d){const e=(null==d?void 0:d.length)>0?"falconStyle":"noFalconStyle";T(e)}if(null!=i){const n=null===(e=null==i?void 0:i[0])||void 0===e?void 0:e.offsetHeight;C(n>=75?"noFalconStyle2":"falconStyle2")}const a=null==r?void 0:r.offsetTop;a&&window.scrollY>a?y(!0):y(!1);const c=document.getElementById("dropDownContainer");null==c||c.offsetTop};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]);let B;try{B=null===(s=document.getElementsByTagName("header"))||void 0===s?void 0:s[0]}catch(e){}return B?e.createElement(e.Fragment,null,(null==V?void 0:V.productName)&&e.createElement(e.Fragment,null,h.createPortal(e.createElement(e.Fragment,null,e.createElement("div",{className:`${Ln.stickyAnchorContainer} ${x?Ln.offsetClass:Ln.nonOffsetClass} ${Ln[w]} ${Ln[E]}`,id:"stickyAnchorContainer"},e.createElement(ae,null,e.createElement("div",{className:Ln.productContainer},e.createElement("div",{className:Ln.productTitle},(S===U||S===W)&&e.createElement("img",{onClick:()=>{k(!P)},className:`${Ln.arrowIcon} ${P?Ln.clockwise:Ln.counterclockwise}`,src:null===(m=null==V?void 0:V.arrowUp)||void 0===m?void 0:m.filename}),e.createElement("div",null,null==V?void 0:V.productName,e.createElement("div",{className:Ln.productPrice},I>0&&(S===U||S===W)&&e.createElement(e.Fragment,null,O())))),e.createElement("div",{className:Ln.contentWrapper},S!==U&&S!==W&&e.createElement(e.Fragment,null,e.createElement("span",{className:Ln.benefitsContainer},null===(p=(null==V?void 0:V.benefits)||[])||void 0===p?void 0:p.map((n=>e.createElement("div",{className:Ln.benefits,onClick:()=>D(n)},null==n?void 0:n.title)))),I>0&&e.createElement(e.Fragment,null,O())),(null==V?void 0:V.buyBtn)&&e.createElement("button",{className:Ln.buyNowButton,onClick:(null==V?void 0:V.productType)===W?()=>{(null==t?void 0:t.id)&&Re(ye,[t],"",Te),(null==t?void 0:t.id)&&te([t],"",(null==t?void 0:t.promoId)?null==t?void 0:t.promoId:"",_,W).then((e=>{var n;c.remove("one-commerce-cartId",{path:"/"}),c.set("one-commerce-cartId",null==e?void 0:e.id,{path:"/"}),c.set("cartProduct",null==V?void 0:V.productId,{path:"/"}),window.location.href=null!==(n=null==V?void 0:V.checkoutUrl)&&void 0!==n?n:""})).catch((e=>{console.log(e)}))}:()=>{var e,n,l;const i=localStorage.getItem("lineCheckResponse"),r=i&&JSON.parse(i),d=c.get("one-commerce-linecheckcorrelationid"),a=c.get("chAddressJson"),u=null!==(e=null==V?void 0:V.productId)&&void 0!==e?e:"",s=a&&r&&(null==r?void 0:r.eligibleBundle.includes(u));r&&a&&d?s&&(0!==(null===(n=Object.keys(t))||void 0===n?void 0:n.length)&&Re(ye,[t],V,Te),0!==(null===(l=Object.keys(t))||void 0===l?void 0:l.length)&&te([t],"",(null==t?void 0:t.promoId)?null==t?void 0:t.promoId:z,_,F).then((e=>{var n;c.remove("one-commerce-cartId",{path:"/"}),c.set("one-commerce-cartId",null==e?void 0:e.id,{path:"/"}),c.set("cartProduct",u,{path:"/"}),c.remove("landline"),window.location.href=null!==(n=null==V?void 0:V.checkoutUrl)&&void 0!==n?n:""})).catch((e=>{console.log(e)}))):"function"==typeof o&&o()}},null==V?void 0:V.buyBtn))))),(null==V?void 0:V.productName)&&P&&e.createElement("div",{className:`${Ln.stickyAnchorContainer} ${x?Ln.offsetClass2:Ln.nonOffsetClass}`,id:"dropDownContainer"},e.createElement("span",{className:Ln.benefitsContainer2},null===(v=(null==V?void 0:V.benefits)||[])||void 0===v?void 0:v.map((n=>e.createElement("div",{className:Ln.subcontain,onClick:()=>D(n)},null==n?void 0:n.title)))))),B))):e.createElement(e.Fragment,null)};
9
9
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * A candidate for common component.
3
+ */
4
+ import React from "react";
5
+ import "./LineCheck.css";
6
+ declare const AutoComplete: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
7
+ export default AutoComplete;
@@ -7,3 +7,4 @@ export declare const fetchLineCheck: (payload: any) => Promise<{
7
7
  configEligibleBundle: string[];
8
8
  plannedUpgrade: any;
9
9
  }>;
10
+ export declare const fetchAddress: (address: any, isValid: boolean) => Promise<any>;
package/dist/esm/index.js CHANGED
@@ -5,5 +5,5 @@ import e,{useState as n,useEffect as t,useRef as o,useContext as l,useMemo as i}
5
5
  * Copyright(c) 2015 Douglas Christopher Wilson
6
6
  * MIT Licensed
7
7
  */
8
- parse:function(e,n){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var t={},o=n||{},l=e.split(";"),i=o.decode||yt,r=0;r<l.length;r++){var d=l[r],a=d.indexOf("=");if(!(a<0)){var c=d.substring(0,a).trim();if(null==t[c]){var u=d.substring(a+1,d.length).trim();'"'===u[0]&&(u=u.slice(1,-1)),t[c]=Et(u,i)}}}return t},serialize:function(e,n,t){var o=t||{},l=o.encode||wt;if("function"!=typeof l)throw new TypeError("option encode is invalid");if(!Tt.test(e))throw new TypeError("argument name is invalid");var i=l(n);if(i&&!Tt.test(i))throw new TypeError("argument val is invalid");var r=e+"="+i;if(null!=o.maxAge){var d=o.maxAge-0;if(isNaN(d)||!isFinite(d))throw new TypeError("option maxAge is invalid");r+="; Max-Age="+Math.floor(d)}if(o.domain){if(!Tt.test(o.domain))throw new TypeError("option domain is invalid");r+="; Domain="+o.domain}if(o.path){if(!Tt.test(o.path))throw new TypeError("option path is invalid");r+="; Path="+o.path}if(o.expires){if("function"!=typeof o.expires.toUTCString)throw new TypeError("option expires is invalid");r+="; Expires="+o.expires.toUTCString()}o.httpOnly&&(r+="; HttpOnly");o.secure&&(r+="; Secure");if(o.sameSite){switch("string"==typeof o.sameSite?o.sameSite.toLowerCase():o.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return r}},yt=decodeURIComponent,wt=encodeURIComponent,Tt=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function Et(e,n){try{return n(e)}catch(n){return e}}!function(e){var n=ft&&ft.__assign||function(){return n=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var l in n=arguments[t])Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l]);return e},n.apply(this,arguments)},t=ft&&ft.__rest||function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)n.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(t[o[l]]=e[o[l]])}return t};Object.defineProperty(e,"__esModule",{value:!0}),e.checkCookies=e.hasCookie=e.removeCookies=e.deleteCookie=e.setCookies=e.setCookie=e.getCookie=e.getCookies=void 0;var o=xt,l=function(){return"undefined"!=typeof window},i=function(e){void 0===e&&(e="");try{var n=JSON.stringify(e);return/^[\{\[]/.test(n)?n:e}catch(n){return e}};e.getCookies=function(e){var n;if(e&&(n=e.req),!l())return n&&n.cookies?n.cookies:n&&n.headers&&n.headers.cookie?(0,o.parse)(n.headers.cookie):{};for(var t={},i=document.cookie?document.cookie.split("; "):[],r=0,d=i.length;r<d;r++){var a=i[r].split("="),c=a.slice(1).join("=");t[a[0]]=c}return t};e.getCookie=function(n,t){var o,l=(0,e.getCookies)(t)[n];if(void 0!==l)return function(e){return"true"===e||"false"!==e&&("undefined"!==e?"null"===e?null:e:void 0)}((o=l)?o.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent):o)};e.setCookie=function(e,r,d){var a,c,u;d&&(c=d.req,u=d.res,a=t(d,["req","res"]));var s=(0,o.serialize)(e,i(r),n({path:"/"},a));if(l())document.cookie=s;else if(u&&c){var m=u.getHeader("Set-Cookie");if(Array.isArray(m)||(m=m?[String(m)]:[]),u.setHeader("Set-Cookie",m.concat(s)),c&&c.cookies){var p=c.cookies;""===r?delete p[e]:p[e]=i(r)}if(c&&c.headers&&c.headers.cookie){p=(0,o.parse)(c.headers.cookie);""===r?delete p[e]:p[e]=i(r),c.headers.cookie=Object.entries(p).reduce((function(e,n){return e.concat("".concat(n[0],"=").concat(n[1],";"))}),"")}}};e.setCookies=function(n,t,o){return console.warn("[WARN]: setCookies was deprecated. It will be deleted in the new version. Use setCookie instead."),(0,e.setCookie)(n,t,o)};e.deleteCookie=function(t,o){return(0,e.setCookie)(t,"",n(n({},o),{maxAge:-1}))};e.removeCookies=function(n,t){return console.warn("[WARN]: removeCookies was deprecated. It will be deleted in the new version. Use deleteCookie instead."),(0,e.deleteCookie)(n,t)};e.hasCookie=function(n,t){return!!n&&(0,e.getCookies)(t).hasOwnProperty(n)};e.checkCookies=function(n,t){return console.warn("[WARN]: checkCookies was deprecated. It will be deleted in the new version. Use hasCookie instead."),(0,e.hasCookie)(n,t)}}(bt);const Ct="catalogue-management",Pt="ESHOP",kt="/v1/linecheck",St=e=>pe(void 0,void 0,void 0,(function*(){var n,t,o,l,i,r,a;const c=yield(e=>{var n;const t=null===(n=null==Oe?void 0:Oe.getInstance())||void 0===n?void 0:n.getBaseUrl(),o={params:{},headers:{"x-sunrise-channel":Pt,"x-correlation-id":w()}},l={address:e,segment:"Residential"};try{const e=`${t}${Ct}${kt}`;return d.getApiServiceInstance().post(e,l,o).then((e=>{var n,t;if(200==e.status){const o=null===(t=null===(n=null==e?void 0:e.config)||void 0===n?void 0:n.headers)||void 0===t?void 0:t["x-correlation-id"];try{"undefined"!=typeof window&&localStorage.removeItem("one-commerce-linecheckcorrelationid"),"undefined"!=typeof window&&localStorage.setItem("one-commerce-linecheckcorrelationid",o)}catch(e){}return"undefined"!=typeof window&&y.remove("one-commerce-linecheckcorrelationid",{path:"/"}),"undefined"!=typeof window&&y.set("one-commerce-linecheckcorrelationid",o,{path:"/",expires:3}),{response:null==e?void 0:e.data,corelationaId:o}}return[]}))}catch(e){return e}})(e),u=yield((null===(n=null==c?void 0:c.response)||void 0===n?void 0:n.sellableProducts)||[]).map((e=>e.name)),s=[];for(const e of null===(t=null==c?void 0:c.response)||void 0===t?void 0:t.eligibleCombinations)for(const n of null==e?void 0:e.rateplans)s.push(null==n?void 0:n.name);const m=null===(l=null===(o=null==c?void 0:c.response)||void 0===o?void 0:o.eligibleSpeed)||void 0===l?void 0:l.maxSpeed,p=null===(r=null===(i=null==c?void 0:c.response)||void 0===i?void 0:i.eligibleSpeed)||void 0===r?void 0:r.plannedUpgrades,v=null===(a=null==c?void 0:c.response)||void 0===a?void 0:a.eligibleAccess;try{"undefined"!=typeof window&&localStorage.setItem("lineCheckResponse",JSON.stringify({eligibleBundle:u,configEligibleBundle:s,maxUploadDownloadSpeed:m,plannedUpgrade:p,originalLinecheckResponse:null==c?void 0:c.response}));try{"undefined"!=typeof window&&localStorage.setItem("one-commerce-access-type",JSON.stringify(v))}catch(e){}"undefined"!=typeof window&&y.set("one-commerce-access-type",JSON.stringify(v),{path:"/",expires:3})}catch(e){}return{corelationaId:c.corelationaId,lineCheckResponse:null==c?void 0:c.response,eligibleBundle:u,maxUploadDownloadSpeed:m,configEligibleBundle:s,plannedUpgrade:p}})),Nt=e.forwardRef((({content:o,parentCallback:l,parentAddress:i,isAddressNotFilled:r,onChange:d,name:a,apiError:c,setApiError:u,setFetchingLineCheck:s},m)=>{var p,v,_,h;const[g,f]=n(!1),[b,x]=n(!1),[y,w]=n(""),[T,E]=n("");n();const[C,P]=n(!1);return t((()=>{g&&T?"differentAddress"===a&&"function"==typeof l&&l({}):w("")}),[T,g]),t((()=>{"function"==typeof E&&E(i)}),[]),e.createElement(e.Fragment,null,e.createElement("div",null,"Auto complete"),e.createElement("div",null,b&&e.createElement("p",{className:"errormsg errormsgMob"},null==o?void 0:o.errorMsg),!T&&r&&e.createElement("p",{className:"errormsg errormsgMob"},e.createElement("img",{src:null===(_=null===(v=null===(p=null==o?void 0:o.linecheckIcons)||void 0===p?void 0:p[0])||void 0===v?void 0:v.warning)||void 0===_?void 0:_.filename,height:"12px",width:"16px",alt:"alert"}),null==o?void 0:o.requiredFieldText),g&&!C&&e.createElement("p",{className:"secondarybutton",onClick:()=>{P(!0)}},null==o?void 0:o.noAddress,e.createElement("span",null,e.createElement("img",{src:null===(h=null==o?void 0:o.arrowIcon)||void 0===h?void 0:h.filename,height:24,width:24,alt:"right-arrow"})))))})),Vt=({content:l,onSuccess:i})=>{var r,d,a,c,u,s,m,p,v,_,h,f,b,x,y,w,T,E,C,P,k;const[S,N]=n(!1),V=o(null),[I,L]=n({enableCheckaddress:!1}),[D,O]=n(),[B,A]=n(),[R,M]=n(!1),[F,z]=n(),[$,W]=n({openIndividualLineCheck:!1,availabilityCheckClicked:!1}),[G,j]=n(!1),U=H(),[X,J]=n(!1),q=(e,n)=>{W(n),A(" "),O(e),""!==(null==e?void 0:e.postCode)&&""!==(null==e?void 0:e.city)&&""!==(null==e?void 0:e.houseNumber)&&""!==(null==e?void 0:e.street)&&""!==(null==e?void 0:e.concatedAddress)?L((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!0}))):L((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!1})))},K=()=>{I.enableCheckaddress?L((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!1}))):N(!1)};e.createElement("div",null,e.createElement("span",{className:"mobileTable"},e.createElement("span",{className:"changeBtn",onClick:()=>{"undefined"!=typeof window&&localStorage.removeItem("lineCheckResponse"),"undefined"!=typeof window&&bt.deleteCookie("chAddressJson"),"undefined"!=typeof window&&bt.deleteCookie("one-commerce-linecheckcorrelationid"),L((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!0}))),A("")},hidden:!(null==B?void 0:B.eligibleBundle)},e.createElement("span",{className:"changeTxt"},"mobile"===U?null==F?void 0:F.changeTextMob:null==F?void 0:F.changeText))));t((()=>{var e,n,t,o,l,i,r,d,a;try{let c="undefined"!=typeof window&&bt.getCookie("chAddressJson");const u="undefined"!=typeof window&&bt.getCookie("one-commerce-linecheckcorrelationid");try{c=c&&JSON.parse(c)}catch(e){console.log("invalid address json")}if(c){L((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!1}))),O(null==c?void 0:c.selectedAdd);const s="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse"),m="undefined"!=typeof window&&localStorage.getItem("one-commerce-linecheckcorrelationid"),p={eligibleBundle:null!==(n=s&&(null===(e=JSON.parse(s))||void 0===e?void 0:e.eligibleBundle))&&void 0!==n?n:[],configEligibleBundle:null!==(o=s&&(null===(t=JSON.parse(s))||void 0===t?void 0:t.configEligibleBundle))&&void 0!==o?o:[],maxUploadDownloadSpeed:null!==(i=s&&(null===(l=JSON.parse(s))||void 0===l?void 0:l.maxUploadDownloadSpeed))&&void 0!==i?i:{},lineCheckRepsonse:B&&JSON.parse(null==B?void 0:B.originalLinecheckResponse),lineCheckCorrelationId:null!=m?m:"",plannedUpgrade:null!==(d=s&&(null===(r=JSON.parse(s))||void 0===r?void 0:r.plannedUpgrade))&&void 0!==d?d:{}};s&&u&&(null===(a=JSON.parse(s))||void 0===a?void 0:a.eligibleBundle)&&Object.keys(null==c?void 0:c.selectedAdd).length&&A(p)}}catch(e){}}),[F]),t((()=>{var e,n,t,o,i;l&&("lineCheckTemplate"===(null===(n=null===(e=null==l?void 0:l.reference)||void 0===e?void 0:e.content)||void 0===n?void 0:n.component)?z(null===(o=null===(t=null==l?void 0:l.reference)||void 0===t?void 0:t.content)||void 0===o?void 0:o.linecheck[0]):z(null===(i=null==l?void 0:l.linecheck)||void 0===i?void 0:i[0]))}),[]),t((()=>{var e,n,t;(!(null==B?void 0:B.eligibleBundle)||(null==B?void 0:B.eligibleBundle.length)<1)&&N(!1),(null===(e=null==B?void 0:B.eligibleBundle)||void 0===e?void 0:e.length)&&(0!==Object.keys(D).length&&void 0!==(null===(n=null==B?void 0:B.maxUploadDownloadSpeed)||void 0===n?void 0:n.maxBandwidthDown)||null===(t=null==B?void 0:B.maxUploadDownloadSpeed)||void 0===t||t.maxBandwidthDown)}),[null===(r=null==B?void 0:B.eligibleBundle)||void 0===r?void 0:r.length]);const Y=o(null),Z={linecheckResponse:B,eligibleBundle:null==B?void 0:B.eligibleBundle,lineCheckContent:F,handleSelection:q,isAddressNotFilled:S,name:"lineCheck",onChange:K,selectedAddress:D,isFetchingLineCheck:R,apiError:G,setApiError:j,setFetchingLineCheck:M};Object.assign({},Z);const[Q,ee]=e.useState(),[ne,te]=e.useState(!1);return e.useEffect((()=>{var e;(null===(e=null==B?void 0:B.eligibleBundle)||void 0===e?void 0:e.length)<1?ee(null==F?void 0:F.dataText):ee(""),te(!1)}),[]),console.log("inside linecheck v3",F),e.createElement(e.Fragment,null,e.createElement("div",{className:"row justify-content-center ",ref:Y},e.createElement("div",{className:"col-12 px-0 "},e.createElement("div",{className:` ${S&&!(null==B?void 0:B.eligibleBundle)?"gradientborder":""} maincontainer`},e.createElement("div",{className:((null==B?void 0:B.eligibleBundle)?"row position-relative inputRow":"row position-relative inputrow")+" ",onClick:()=>{var e;"mobile"===U&&(null===(e=null==V?void 0:V.current)||void 0===e||e.focus(),J(!0))}},(null==B?void 0:B.eligibleBundle)&&(Q||!Q&&(null===(d=null==B?void 0:B.eligibleBundle)||void 0===d?void 0:d.length)>1?e.createElement("img",{src:null===(u=null===(c=null===(a=null==F?void 0:F.linecheckIcons)||void 0===a?void 0:a[0])||void 0===c?void 0:c.tick)||void 0===u?void 0:u.filename,className:"tickIcons",height:"32px",width:"32px"}):e.createElement("img",{src:null===(p=null===(m=null===(s=null==F?void 0:F.linecheckIcons)||void 0===s?void 0:s[0])||void 0===m?void 0:m.close)||void 0===p?void 0:p.filename,className:"tickIcons ",height:"32px",width:"32px"})),((null==F?void 0:F.linecheckTitle)||(null==F?void 0:F.successLinecheckTitle))&&e.createElement(e.Fragment,null,e.createElement("h4",{className:"linechecktitle"},!R&&(null==B?void 0:B.eligibleBundle)?(null===(v=null==B?void 0:B.eligibleBundle)||void 0===v?void 0:v.length)<1?null==F?void 0:F.noConnectionTitle:null==F?void 0:F.successLinecheckTitle:null==F?void 0:F.linecheckTitle)),(null==B?void 0:B.eligibleBundle)?e.createElement(e.Fragment,null,e.createElement("div",null,"Linecheck success field")):e.createElement(e.Fragment,null,e.createElement("div",{className:"horizontalDivider"}),e.createElement("div",{className:"col-1 px-0 "},(null==B?void 0:B.eligibleBundle)?e.createElement(e.Fragment,null):e.createElement("img",{src:null===(f=null===(h=null===(_=null==F?void 0:F.linecheckIcons)||void 0===_?void 0:_[0])||void 0===h?void 0:h.home)||void 0===f?void 0:f.filename,height:""+("mobile"===U?"26px":"48px"),width:""+("mobile"===U?"26px":"48px"),alt:"home",className:"homeicon"})),e.createElement("div",{className:`col-lg-8 col-md-8 col-sm-8 ${"mobile"===U&&((null==B?void 0:B.eligibleBundle)?"col-12":"col-9")} px-0`},e.createElement("div",null,e.createElement(Nt,{content:F,parentCallback:q,parentAddress:null==D?void 0:D.concatedAddress,ref:V,isAddressNotFilled:S,name:"lineCheck",onChange:K,setAddressNotFilled:N,apiError:G,setApiError:j,setFetchingLineCheck:M}))),e.createElement("div",{className:"col-lg-3 col-md-3 col-sm-3 col-2 px-0 marginautodefault"},"mobile"!==U||(null==B?void 0:B.eligibleBundle)?e.createElement("button",{name:"check address button",type:"button",className:"primarybutton mobileButton",disabled:!I.enableCheckaddress,hidden:!!(null==B?void 0:B.eligibleBundle),onClick:()=>{var e;(null==I?void 0:I.enableCheckaddress)?(M(!0),"undefined"!=typeof window&&bt.deleteCookie("chAddressJson"),"undefined"!=typeof window&&bt.setCookie("chAddressJson",JSON.stringify({addressValue:null==D?void 0:D.concatedAddress,selectedAdd:D}),{path:"/",maxAge:259200}),D&&Object.keys(D).length>0&&St(D).then((e=>{"undefined"!=typeof window&&localStorage.setItem("LinecheckCall","true"),M(!1),A(e),j(!1),"mobile"===U&&$.openIndividualLineCheck&&J(!1)})).catch((e=>{console.log(e),j(!0),W(Object.assign(Object.assign({},$),{availabilityCheckClicked:!1})),"mobile"===U&&$.openIndividualLineCheck&&J(!0)}))):(N(!0),null===(e=null==V?void 0:V.current)||void 0===e||e.focus(),"mobile"===U&&J(!1))},style:{width:"100%",position:"relative",bottom:"10px"}},R&&!G&&""!==(null===(w=null==V?void 0:V.current)||void 0===w?void 0:w.value)?e.createElement(g,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"}):null==F?void 0:F.buttonvalue):e.createElement("span",null,e.createElement("img",{width:52,height:52,alt:"search",src:null===(y=null===(x=null===(b=null==F?void 0:F.linecheckIcons)||void 0===b?void 0:b[0])||void 0===x?void 0:x.searchIcon)||void 0===y?void 0:y.filename})))),(null===(T=null==B?void 0:B.plannedUpgrade)||void 0===T?void 0:T.expectedSpeed)&&e.createElement(e.Fragment,null,e.createElement("div",{className:"col-lg-1 col-md-1 col-sm-1 col-12 px-0"},(null==B?void 0:B.eligibleBundle)&&e.createElement("img",{src:null===(P=null===(C=null===(E=null==F?void 0:F.linecheckIcons)||void 0===E?void 0:E[0])||void 0===C?void 0:C.upgrade)||void 0===P?void 0:P.filename,height:"32px",width:"32px",alt:"activeup"})),e.createElement("div",{className:"col-lg-8 col-md-8 col-sm-8 col-12 px-0"},(null==B?void 0:B.eligibleBundle)&&e.createElement("div",null," On Success"))))))),(null==F?void 0:F.helpText)&&!(null===(k=V.current)||void 0===k?void 0:k.value)?e.createElement("div",{className:"helpText"},!R&&(null==B?void 0:B.eligibleBundle)?"":null==F?void 0:F.helpText):"")},It=({content:t,onSuccess:o})=>{var l,i,r;const[d,a]=n(!0),c=null===(r=null===(i=null===(l=null==t?void 0:t.reference)||void 0===l?void 0:l.content)||void 0===i?void 0:i.body)||void 0===r?void 0:r[0];return console.log("inside linecheck modal"),e.createElement(gt,{modalState:d,handler:()=>{a(!d)},showFooter:!1,noCloseButton:!1,backgroundColor:"transparent",fixedWidth:"850px"},e.createElement(Vt,{content:c,onSuccess:o}))},Lt=({content:o,offeringData:l,uniqueId:i,storyContent:r,metadata:d,tabIndex:a,cardsLength:c,indexKey:u,constants:s,mainContent:m,address:p,eligibleBundle:v,linecheckSuccessCallBack:_})=>{var h,g,f,b,x,w,T,E,C,P,k,V,D,O,B,A,R,M,F,z,$,G,j,U,X,H,J,K,Y,Z,Q,ee,oe,le,ie,re,de,ae,ue,se,pe;const[ve,_e]=n(!1),[he,fe]=n(!1),[be,xe]=n({showGift:!1,cashbackAvailable:!1}),[ye,we]=n([]),[Te,Ee]=n(!1),[Ce,Pe]=n(!1),[ke,Se]=n(!1),Ne=void 0!==typeof window&&document.getElementById("static-linetable"),Ve=0===(null===(h=Object.keys(o))||void 0===h?void 0:h.length),Ie=null===(w=null===(x=null===(b=null===(f=null===(g=null==o?void 0:o.products)||void 0===g?void 0:g[0])||void 0===f?void 0:f.reference)||void 0===b?void 0:b.content)||void 0===x?void 0:x.product)||void 0===w?void 0:w[0],Le=null===(k=null===(P=null===(C=null===(E=null===(T=null==o?void 0:o.promotion)||void 0===T?void 0:T[0])||void 0===E?void 0:E.reference)||void 0===C?void 0:C.content)||void 0===P?void 0:P.promoDescription)||void 0===k?void 0:k[0],De=null==Ie?void 0:Ie.productId,Oe=null===(V=null==I?void 0:I.getInstance())||void 0===V?void 0:V.getCartUrl(),Be=null===(D=null==L?void 0:L.getInstance())||void 0===D?void 0:D.getAssetPath(),Ae="MOBILE"===(null==r?void 0:r.pageType);let Re;Re=p&&(null===(O=null==v?void 0:v.eligibleBundle)||void 0===O?void 0:O.includes(De));let Fe=void 0!==typeof window&&y.get("sunriseAuth");Fe=Fe&&JSON.parse(Fe);const ze=((null==l?void 0:l[i])||[]).filter((e=>(null==e?void 0:e.id)===De)),Ge=()=>{fe(!1);!(!(null==m?void 0:m.enableExistingCustomer)||null!=Fe)?Ee(!0):Je()},Ue=e=>{const n=ye.findIndex((n=>(null==e?void 0:e.giftGroupId)===(null==n?void 0:n.giftGroupId))),t=ye;-1===n?t.push(e):t[n]=e,we([...t])},Xe=((e,n)=>{let t;return n||(t=(e||[]).filter((e=>!0===(null==e?void 0:e.enableTV)))),t})(null==Ie?void 0:Ie.bloks,Ae),He=null===(B=null==Xe?void 0:Xe[0])||void 0===B?void 0:B.tvProductId,Je=()=>{fe(!1),((e,n,t,o,l,i,r,d,a,c,u)=>{var s;if(r)e(!0),0!==(null===(s=Object.keys(o))||void 0===s?void 0:s.length)&&ge(o,"",(null==i?void 0:i.promoID)?null==i?void 0:i.promoID:te,n,"mobile",t).then((e=>{var n;y.remove("one-commerce-cartId",{path:"/"}),y.set("one-commerce-cartId",null==e?void 0:e.id,{path:"/"}),y.set("cartProduct",null==i?void 0:i.id,{path:"/"}),Ke(Me,o,"",je),window.location.href=null===(n=null==l?void 0:l.summaryPageUrl)||void 0===n?void 0:n.cached_url})).catch((n=>{console.log(n),e(!1)})).finally((()=>{e(!1)}));else{const r="undefined"!=typeof window&&y.get("one-commerce-linecheckcorrelationid");a&&c&&r?(e(!0),0!==o.length&&ge(o,d,(null==i?void 0:i.promoID)?null==i?void 0:i.promoID:ne,n,"fixnet",t).then((e=>{var n;"undefined"!=typeof window&&y.remove("one-commerce-cartId",{path:"/"}),"undefined"!=typeof window&&y.set("one-commerce-cartId",null==e?void 0:e.id,{path:"/"}),"undefined"!=typeof window&&y.set("cartProduct",null==i?void 0:i.id,{path:"/"}),"undefined"!=typeof window&&y.remove("landline"),Ke(Me,o,"",je),window.location.href=null===(n=null==l?void 0:l.summaryPageUrl)||void 0===n?void 0:n.cached_url})).catch((e=>{console.log(e)})).finally((()=>{e(!1)}))):u(!0)}})(_e,Oe,ye,ze,m,Ye,Ae,He,v,p,Se)},Ye=rn(ze,Ae);t((()=>{var e;setTimeout((()=>{((e,n)=>{W(`headingV3${e}`,n),W(`descriptionV3${e}`,n),W(`titleV3${e}`,n),W(`detailsectionv3${e}`,n),W(`product-configv3${e}`,n),W(`gift-section${e}`,n),W(`benefits-section${e}`,n),W(`order-section${e}`,n),W(`price-section${e}`,n),W(`benefits-price-section${e}`,n),W(`contract-section${e}`,n)})(a,c)}),100);const n=(e=>{let n=!1,t=!1;return null==e||e.map((e=>{var o;null===(o=null==e?void 0:e.promotionInfo)||void 0===o||o.map((e=>{(null==e?void 0:e.hardwareGift)&&(n=!0),(null==e?void 0:e.cashBack)&&(t=!0)}))})),{showGift:n,cashbackAvailable:t}})(Ae?ze:null===(e=null==ze?void 0:ze[0])||void 0===e?void 0:e.bundledOffers);xe(Object.assign({},n))}),[l]);const Ze=()=>{(null==Xe?void 0:Xe.length)>0&&Pe(!0)};return e.createElement("div",null,ve&&Ne&&N(e.createElement(me,{keyParams:"loading"}),Ne),Ve&&e.createElement("div",{className:"w-75 pb-2"},e.createElement(sn,null)),!Ve&&v&&o&&p&&!Ae&&e.createElement("div",{className:Qn.selected},e.createElement("span",{style:{paddingBottom:"10px"}},Re?e.createElement("span",{className:Qn.activeicon},e.createElement("img",{src:`${Be}/icons/lineCheck-success.svg`,alt:"",width:24,height:24,className:Qn.activeicon}),e.createElement("span",null,null==s?void 0:s.subscriptionAvalTxt)):e.createElement("span",{className:Qn.inactiveicon},e.createElement("img",{src:`${Be}/icons/cross_disabled.svg`,alt:"",width:24,height:24,className:Qn.inactiveicon}),e.createElement("span",null,null==s?void 0:s.notSubscriptionTxt)))),e.createElement("div",{className:`${Ae||!1!==Re?"":Qn.overlay}`,style:{flexDirection:"column"}},e.createElement("div",{className:`${Qn.bundleproductcard} ${Qn.productcontainer} ${(null===(A=null==o?void 0:o.highlightText)||void 0===A?void 0:A.length)>0&&Qn.highlightBorder}`},(null===(R=null==Ie?void 0:Ie.highlightText)||void 0===R?void 0:R.length)>0&&e.createElement("div",{className:`${Qn.highlightText}`},null==o?void 0:o.highlightText),(null==Le?void 0:Le.displayText)&&e.createElement("div",{className:`${Qn.promocontainer}`,style:{background:null==Le?void 0:Le.bestSellerColor}},null==Le?void 0:Le.displayText),e.createElement("div",{className:`${Qn.detailsection}`,id:`detailsectionv3${a}${u}`},e.createElement("div",{className:`${Qn.headersection}`},e.createElement("div",{className:`${Qn.titlesection}`},e.createElement("div",{className:`${Qn.productheader}`,id:`titleV3${a}${u}`},null==Ie?void 0:Ie.productName),e.createElement("div",null,(null===(M=null==Ie?void 0:Ie.icon)||void 0===M?void 0:M.filename)&&e.createElement("img",{className:`${Qn.imagecontainer}`,src:null===(F=null==Ie?void 0:Ie.icon)||void 0===F?void 0:F.filename,height:15,width:20}))),e.createElement("div",{className:`${Qn.productdescription}`,id:`descriptionV3${a}${u}`},e.createElement(ce,{content:null==Ie?void 0:Ie.description})),e.createElement("div",{className:`${Qn.images}`},(null===(z=null==Ie?void 0:Ie.img)||void 0===z?void 0:z.filename)&&e.createElement("img",{className:`${Qn.imagespace} ${(null==o?void 0:o.highlightText)&&Qn.borderimage}`,alt:"cardimg",src:null===($=null==Ie?void 0:Ie.img)||void 0===$?void 0:$.filename}))),e.createElement("div",{className:`${Qn.productconfig}`,id:`product-configv3${a}${u}`},Ve?e.createElement(e.Fragment,null,e.createElement("div",{className:Qn.space}),e.createElement(sn,{stylename:Qn.skeletontittle,count:1}),e.createElement(sn,{stylename:Qn.skeletonline,count:5}),e.createElement("div",{className:Qn.space}),e.createElement(sn,{stylename:Qn.skeletontittle,count:1}),e.createElement(sn,{stylename:Qn.skeletonline,count:5})):e.createElement("div",null,(null==Ie?void 0:Ie.bloks)&&(null===(G=null==Ie?void 0:Ie.bloks)||void 0===G?void 0:G.map(((n,t)=>e.createElement(nt,{content:n,indexKey:t,constants:s,key:t,showModalPopup:Ze}))))))),e.createElement("div",{className:`${Qn.detailsection}`,id:`benefits-price-section${a}${u}`},e.createElement("div",{className:`${Qn.benefitssection}`,id:`benefits-section${a}${u}`},(null===(j=null==Ie?void 0:Ie.benefits)||void 0===j?void 0:j.length)>0&&e.createElement(tt,{content:null==Ie?void 0:Ie.benefits,benefitData:Ye,constants:s})),e.createElement("br",null),e.createElement("div",{className:`${Qn.giftsection}`,id:`gift-section${a}${u}`},(null==be?void 0:be.showGift)&&(null===(U=null==Le?void 0:Le.singleGift)||void 0===U?void 0:U.map(((n,t)=>e.createElement(An,{content:n,key:t})))),(null==be?void 0:be.showGift)&&(null===(X=null==Le?void 0:Le.giftConfig)||void 0===X?void 0:X.map(((n,t)=>e.createElement(Mn,{content:n,key:t,selectedGiftItem:Ue,parentPoType:Ae?"MOBILE":"HOME"})))),e.createElement("div",{className:`${Qn.giftsection}`,id:`cashback-section${a}${u}`},(null==Le?void 0:Le.cashBack)&&(null==be?void 0:be.cashbackAvailable)&&(null===(H=null==Le?void 0:Le.cashBack)||void 0===H?void 0:H.map(((n,t)=>e.createElement(Hn,{content:n,key:t})))))),e.createElement("div",{className:`${Qn.ordersection}`,id:`order-section${a}${u}`},""===(null==Ye?void 0:Ye.base)?e.createElement("div",null,e.createElement(sn,{stylename:Qn.skeletontittle})):e.createElement("div",{className:`${Qn.flexgrid} ${Qn.pricesection} `,id:`price-section${a}${u}`},e.createElement(ot,{priceCollection:Ye,constants:s,promoText:null==Ie?void 0:Ie.promoText})),e.createElement("div",{className:`${(null==r?void 0:r.swapButton)&&Qn.swapButton}`},e.createElement("div",{style:{padding:"16px 0"}},e.createElement(lt,{isMobileFlow:Ae,createCartCall:Ae?Ge:Je,constants:s,storyContent:r,showPrice:Ye,isAvailable:Re,address:p})),e.createElement("div",{className:Qn.productcontractduration,id:`contract-section${a}${u}`},(null==Ye?void 0:Ye.contractDuration)?q(null===(J=null==s?void 0:s.minContractDuration)||void 0===J?void 0:J.substring(1),[null==Ye?void 0:Ye.contractDuration]):null==s?void 0:s.noContractDuration),(null===(K=null==r?void 0:r.addSmartPhone)||void 0===K?void 0:K.length)>0&&e.createElement("div",{style:{textAlign:"center",padding:"4px"}},(null==r?void 0:r.swapButton)?(null==r?void 0:r.ctaLabel)&&e.createElement("div",{style:{padding:"16px 0"}},e.createElement("button",{className:"primarybutton",onClick:()=>vt(Ye,r,ze)},e.createElement("span",{className:Qn.buttontext},null==r?void 0:r.ctaLabel))):e.createElement("span",{className:`${Qn.productdetailslink} ${Qn.addsmartphone}`},e.createElement("div",null,e.createElement("span",null,(null===(Q=null===(Z=null===(Y=null==r?void 0:r.addSmartPhone)||void 0===Y?void 0:Y[0])||void 0===Z?void 0:Z.buttonIcon)||void 0===Q?void 0:Q.filename)&&e.createElement("img",{src:null===(le=null===(oe=null===(ee=null==r?void 0:r.addSmartPhone)||void 0===ee?void 0:ee[0])||void 0===oe?void 0:oe.buttonIcon)||void 0===le?void 0:le.filename,width:12,height:18,alt:"icon"})),e.createElement("span",null,e.createElement("a",{onClick:()=>vt(Ye,r,ze)},null===(re=null===(ie=null==r?void 0:r.addSmartPhone)||void 0===ie?void 0:ie[0])||void 0===re?void 0:re.buttonLabel)))))),e.createElement("div",{style:{textAlign:"center",padding:"4px"}},(null===(de=null==Ie?void 0:Ie.productDetails)||void 0===de?void 0:de.length)>0&&e.createElement("span",{className:Qn.productdetailslink,onClick:()=>{fe(!he),Fn(We,$e,qe(ze,"",je))}},null==s?void 0:s.productDetailsLink)),he&&e.createElement(pt,{content:null==Ie?void 0:Ie.productDetails,showProductDetail:he,setShowProductDetail:fe,constants:s,showPrice:Ye,isMobileFlow:Ae,createCartCall:Ae?Ge:Je,storyContent:r,isAvailable:Re,address:p}))))),Ce&&(Ve?e.createElement(sn,null):e.createElement(ht,{content:null==Xe?void 0:Xe[0],setShowModal:Pe,showModal:Ce,constants:s})),Te&&Ae&&(null===(ae=null==m?void 0:m.loginData)||void 0===ae?void 0:ae.length)>0&&Ne&&N(e.createElement(S,{content:null===(ue=null==m?void 0:m.loginData)||void 0===ue?void 0:ue[0],closeLogin:()=>{Ee(!1)},metadata:d,onSuccess:()=>{Ee(!1),Je()}}),Ne),ke&&!Ae&&(null===(se=null==m?void 0:m.linecheckData)||void 0===se?void 0:se.length)>0&&e.createElement(It,{content:null===(pe=null==m?void 0:m.linecheckData)||void 0===pe?void 0:pe[0],onSuccess:()=>{let e="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse");v=e&&(null===JSON||void 0===JSON?void 0:JSON.parse(e)),p="undefined"!=typeof window&&y.get("chAddressJson"),Se(!1),"function"==typeof _&&_(),Je()}}))},Dt=({content:o,setGenericErrorModalDetails:l,metadata:i,tabIndex:r,constants:d,loginSuccess:a,activeIndex:c,mainContent:u,address:s,eligibleBundle:m,linecheckSuccessCallBack:p})=>{var v,_,h;const g=H(),f=null==o?void 0:o._uid,[b,x]=n(),w=null===(v=null==I?void 0:I.getInstance())||void 0===v?void 0:v.getBaseUrl();let T=void 0!==typeof window&&y.get("sunriseAuth");T=T&&JSON.parse(T);const E="MOBILE"===(null==o?void 0:o.pageType);t((()=>(setTimeout((()=>{C()}),100),null===window||void 0===window||window.addEventListener("resize",C),null===window||void 0===window||window.addEventListener("load",C),()=>{window.removeEventListener("resize",C),window.removeEventListener("load",C)})),[null==o?void 0:o.productList]);const C=()=>{var e;W(`productCardV3${c}`,null===(e=null==o?void 0:o.productList)||void 0===e?void 0:e.length)};t((()=>{var e;b&&(null===(e=Object.keys(b))||void 0===e?void 0:e.length)>0&&nn("view",b[f],"",je)}),[b]),t((()=>{var e;b&&(null===(e=Object.keys(b))||void 0===e?void 0:e.length)>0&&!E&&(null==m?void 0:m.eligibleBundle)&&nn("available",b[f],"",je,null==m?void 0:m.eligibleBundle)}),[m,b]);const P=()=>{var e,n;const t=[],i=null==u?void 0:u.enableExistingCustomer,d=null==u?void 0:u.subscriptionType,s=null==o?void 0:o.isReturnPromo;var m,p;if(m=null==o?void 0:o.productList,p=t,null==m||m.map((e=>{var n,t,o,l,i,r,d,a,c,u,s;const m={id:"",promoIds:[]},v=null===(i=null===(l=null===(o=null===(t=null===(n=null==e?void 0:e.products)||void 0===n?void 0:n[0])||void 0===t?void 0:t.reference)||void 0===o?void 0:o.content)||void 0===l?void 0:l.product)||void 0===i?void 0:i[0],_=null===(u=null===(c=null===(a=null===(d=null===(r=null==e?void 0:e.promotion)||void 0===r?void 0:r[0])||void 0===d?void 0:d.reference)||void 0===a?void 0:a.content)||void 0===c?void 0:c.promoDescription)||void 0===u?void 0:u[0];m.id=null==v?void 0:v.productId,null===(s=null==m?void 0:m.promoIds)||void 0===s||s.push(null==_?void 0:_.promotionId),null==p||p.push(m)})),r===c&&!(null==b?void 0:b[f])||r===c&&a)try{null===(e=fe(t,null==o?void 0:o._uid,w,i,d,s))||void 0===e||e.then((e=>{x(e),l({showPopup:!1})})).catch((e=>{var n;console.log("error---\x3e",e),l({showPopup:!0,content:null===(n=null==u?void 0:u.telesalesBlok)||void 0===n?void 0:n[0]})}))}catch(e){console.log("error---\x3e",e),l({showPopup:!0,content:null===(n=null==u?void 0:u.telesalesBlok)||void 0===n?void 0:n[0]})}};return t((()=>{c!=r&&c||P()}),[c]),t((()=>{(null==T?void 0:T.siteId)&&a&&P()}),[a]),e.createElement("div",null,e.createElement("div",{className:Qn.titlecontainer},(null==o?void 0:o.title)&&e.createElement("div",{className:Qn.title},null==o?void 0:o.title),(null==o?void 0:o.subTitle)&&e.createElement("div",{className:Qn.description},null==o?void 0:o.subTitle)),e.createElement("div",{className:"linetableV3"},g&&e.createElement(dn,{carouselIndex:c,key:c,arrow:null==u?void 0:u.enableMobileArrows},((null===(_=null==o?void 0:o.productList)||void 0===_?void 0:_.length)&&(null==o?void 0:o.productList)||new Array((null===(h=null==o?void 0:o.productList)||void 0===h?void 0:h.length)||3).fill(1)).map(((n,t)=>{var l;return e.createElement("div",{id:`productCardV3${c}`,style:{textAlign:"center"}},e.createElement(Lt,{content:n,offeringData:b,uniqueId:f,storyContent:o,metadata:i,tabIndex:r,cardsLength:null===(l=null==o?void 0:o.productList)||void 0===l?void 0:l.length,indexKey:t,constants:d,mainContent:u,linecheckSuccessCallBack:p,address:s,eligibleBundle:m}))})))))},Ot=({content:o,tabCheckCallBack:l,setGenericErrorModalDetails:i,metadata:r,loginSuccess:d,changeAddressClicked:a,linecheckSuccessCallBack:c})=>{var u,s,m;const[p,v]=n(0),_=null===(u=null==o?void 0:o.oneEcomConstants)||void 0===u?void 0:u[0];let g="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse"),f=g&&(null===JSON||void 0===JSON?void 0:JSON.parse(g)),b="undefined"!=typeof window&&y.get("chAddressJson");return t((()=>{var e,n,t;const i=new URLSearchParams(null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.search),r=null==i?void 0:i.get("tabOption");o&&null!==r&&((null==o?void 0:o.productContainer)||[]).map(((e,n)=>{(null==e?void 0:e.tabId)===r&&v(n)}));const d=null===(t=null===(n=null==o?void 0:o.productContainer)||void 0===n?void 0:n[p])||void 0===t?void 0:t.tabId;"function"==typeof l&&(null==l||l(d))}),[o]),t((()=>{g="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse"),f=g&&(null===JSON||void 0===JSON?void 0:JSON.parse(g)),b="undefined"!=typeof window&&y.get("chAddressJson")}),[a]),e.createElement("div",null,e.createElement("div",{id:"static-linetable"},(null==o?void 0:o.productContainer)&&e.createElement(e.Fragment,null,e.createElement(Te,null,e.createElement("div",{className:`row justify-content-center ${Qn.tabblock}`},(null===(s=null==o?void 0:o.productContainer)||void 0===s?void 0:s.length)>1&&e.createElement("div",{className:` ${Qn.tabcontainer}`},((null==o?void 0:o.productContainer)||[]).map(((n,t)=>e.createElement("div",{className:` ${Qn.tabs} ${p===t?Qn.tabcontentactive:Qn.tabcontentinactive}`,key:null==n?void 0:n.tabCaption},e.createElement("label",{className:` ${Qn.tabcontent} `},e.createElement("input",{type:"radio",checked:p===t,onChange:()=>{v(t),"function"==typeof l&&(null==l||l(null==n?void 0:n.tabId)),Fn(We,Xe,{click_text:null==n?void 0:n.tabCaption})}}),null==n?void 0:n.tabCaption))))))),e.createElement(Te,{resuablelineTable:!0},e.createElement("div",{className:"position-relative "},e.createElement(h,{activeIndex:p,indicators:!1,controls:!1,interval:null,id:"pt-carousel",slide:!1},(null===(m=null==o?void 0:o.productContainer)||void 0===m?void 0:m.length)>0&&((null==o?void 0:o.productContainer)||[]).map(((n,t)=>e.createElement(h.Item,{key:t},e.createElement(Dt,{content:n,setGenericErrorModalDetails:i,metadata:r,tabIndex:t,constants:_,loginSuccess:d,activeIndex:p,mainContent:o,address:b,eligibleBundle:f,linecheckSuccessCallBack:c}))))))))))};export{L as AssetPathPropConfig,F as Button,Ve as Card,ye as CardEntitlement,Ie as CarouselComp,I as LineTableBasicPropConfig,Oe as LinecheckBasicPropConfig,z as LoginModal,Kn as ProductTableV3,on as ProductTeaser,De as ProductTeaserPropConfig,Ot as StaticLineTable,Zn as StickyProductAnchor};
8
+ parse:function(e,n){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var t={},o=n||{},l=e.split(";"),i=o.decode||yt,r=0;r<l.length;r++){var d=l[r],a=d.indexOf("=");if(!(a<0)){var c=d.substring(0,a).trim();if(null==t[c]){var u=d.substring(a+1,d.length).trim();'"'===u[0]&&(u=u.slice(1,-1)),t[c]=Et(u,i)}}}return t},serialize:function(e,n,t){var o=t||{},l=o.encode||wt;if("function"!=typeof l)throw new TypeError("option encode is invalid");if(!Tt.test(e))throw new TypeError("argument name is invalid");var i=l(n);if(i&&!Tt.test(i))throw new TypeError("argument val is invalid");var r=e+"="+i;if(null!=o.maxAge){var d=o.maxAge-0;if(isNaN(d)||!isFinite(d))throw new TypeError("option maxAge is invalid");r+="; Max-Age="+Math.floor(d)}if(o.domain){if(!Tt.test(o.domain))throw new TypeError("option domain is invalid");r+="; Domain="+o.domain}if(o.path){if(!Tt.test(o.path))throw new TypeError("option path is invalid");r+="; Path="+o.path}if(o.expires){if("function"!=typeof o.expires.toUTCString)throw new TypeError("option expires is invalid");r+="; Expires="+o.expires.toUTCString()}o.httpOnly&&(r+="; HttpOnly");o.secure&&(r+="; Secure");if(o.sameSite){switch("string"==typeof o.sameSite?o.sameSite.toLowerCase():o.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return r}},yt=decodeURIComponent,wt=encodeURIComponent,Tt=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function Et(e,n){try{return n(e)}catch(n){return e}}!function(e){var n=ft&&ft.__assign||function(){return n=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var l in n=arguments[t])Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l]);return e},n.apply(this,arguments)},t=ft&&ft.__rest||function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(o=Object.getOwnPropertySymbols(e);l<o.length;l++)n.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(t[o[l]]=e[o[l]])}return t};Object.defineProperty(e,"__esModule",{value:!0}),e.checkCookies=e.hasCookie=e.removeCookies=e.deleteCookie=e.setCookies=e.setCookie=e.getCookie=e.getCookies=void 0;var o=xt,l=function(){return"undefined"!=typeof window},i=function(e){void 0===e&&(e="");try{var n=JSON.stringify(e);return/^[\{\[]/.test(n)?n:e}catch(n){return e}};e.getCookies=function(e){var n;if(e&&(n=e.req),!l())return n&&n.cookies?n.cookies:n&&n.headers&&n.headers.cookie?(0,o.parse)(n.headers.cookie):{};for(var t={},i=document.cookie?document.cookie.split("; "):[],r=0,d=i.length;r<d;r++){var a=i[r].split("="),c=a.slice(1).join("=");t[a[0]]=c}return t};e.getCookie=function(n,t){var o,l=(0,e.getCookies)(t)[n];if(void 0!==l)return function(e){return"true"===e||"false"!==e&&("undefined"!==e?"null"===e?null:e:void 0)}((o=l)?o.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent):o)};e.setCookie=function(e,r,d){var a,c,u;d&&(c=d.req,u=d.res,a=t(d,["req","res"]));var s=(0,o.serialize)(e,i(r),n({path:"/"},a));if(l())document.cookie=s;else if(u&&c){var m=u.getHeader("Set-Cookie");if(Array.isArray(m)||(m=m?[String(m)]:[]),u.setHeader("Set-Cookie",m.concat(s)),c&&c.cookies){var p=c.cookies;""===r?delete p[e]:p[e]=i(r)}if(c&&c.headers&&c.headers.cookie){p=(0,o.parse)(c.headers.cookie);""===r?delete p[e]:p[e]=i(r),c.headers.cookie=Object.entries(p).reduce((function(e,n){return e.concat("".concat(n[0],"=").concat(n[1],";"))}),"")}}};e.setCookies=function(n,t,o){return console.warn("[WARN]: setCookies was deprecated. It will be deleted in the new version. Use setCookie instead."),(0,e.setCookie)(n,t,o)};e.deleteCookie=function(t,o){return(0,e.setCookie)(t,"",n(n({},o),{maxAge:-1}))};e.removeCookies=function(n,t){return console.warn("[WARN]: removeCookies was deprecated. It will be deleted in the new version. Use deleteCookie instead."),(0,e.deleteCookie)(n,t)};e.hasCookie=function(n,t){return!!n&&(0,e.getCookies)(t).hasOwnProperty(n)};e.checkCookies=function(n,t){return console.warn("[WARN]: checkCookies was deprecated. It will be deleted in the new version. Use hasCookie instead."),(0,e.hasCookie)(n,t)}}(bt);const Ct="address-suggestion",Pt="catalogue-management",kt="ESHOP",St="/suggest/address",Nt="/v1/linecheck",Vt=e=>pe(void 0,void 0,void 0,(function*(){var n,t,o,l,i,r,a;const c=yield(e=>{var n;const t=null===(n=null==Oe?void 0:Oe.getInstance())||void 0===n?void 0:n.getBaseUrl(),o={params:{},headers:{"x-sunrise-channel":kt,"x-correlation-id":w()}},l={address:e,segment:"Residential"};try{const e=`${t}${Pt}${Nt}`;return d.getApiServiceInstance().post(e,l,o).then((e=>{var n,t;if(200==e.status){const o=null===(t=null===(n=null==e?void 0:e.config)||void 0===n?void 0:n.headers)||void 0===t?void 0:t["x-correlation-id"];try{"undefined"!=typeof window&&localStorage.removeItem("one-commerce-linecheckcorrelationid"),"undefined"!=typeof window&&localStorage.setItem("one-commerce-linecheckcorrelationid",o)}catch(e){}return"undefined"!=typeof window&&y.remove("one-commerce-linecheckcorrelationid",{path:"/"}),"undefined"!=typeof window&&y.set("one-commerce-linecheckcorrelationid",o,{path:"/",expires:3}),{response:null==e?void 0:e.data,corelationaId:o}}return[]}))}catch(e){return e}})(e),u=yield((null===(n=null==c?void 0:c.response)||void 0===n?void 0:n.sellableProducts)||[]).map((e=>e.name)),s=[];for(const e of null===(t=null==c?void 0:c.response)||void 0===t?void 0:t.eligibleCombinations)for(const n of null==e?void 0:e.rateplans)s.push(null==n?void 0:n.name);const m=null===(l=null===(o=null==c?void 0:c.response)||void 0===o?void 0:o.eligibleSpeed)||void 0===l?void 0:l.maxSpeed,p=null===(r=null===(i=null==c?void 0:c.response)||void 0===i?void 0:i.eligibleSpeed)||void 0===r?void 0:r.plannedUpgrades,v=null===(a=null==c?void 0:c.response)||void 0===a?void 0:a.eligibleAccess;try{"undefined"!=typeof window&&localStorage.setItem("lineCheckResponse",JSON.stringify({eligibleBundle:u,configEligibleBundle:s,maxUploadDownloadSpeed:m,plannedUpgrade:p,originalLinecheckResponse:null==c?void 0:c.response}));try{"undefined"!=typeof window&&localStorage.setItem("one-commerce-access-type",JSON.stringify(v))}catch(e){}"undefined"!=typeof window&&y.set("one-commerce-access-type",JSON.stringify(v),{path:"/",expires:3})}catch(e){}return{corelationaId:c.corelationaId,lineCheckResponse:null==c?void 0:c.response,eligibleBundle:u,maxUploadDownloadSpeed:m,configEligibleBundle:s,plannedUpgrade:p}})),It=e.forwardRef(((t,o)=>{var l,i,r;const{inputValue:d,setInputValue:a,dropdownValue:c,placeholder:u,onChange:s,name:m,inputClassName:p,selectedData:v,minLength:_,maxLength:h,content:g,setApiError:f,setFetchingLineCheck:b}=t,[x,y]=n(-1),[w,T]=n(!0),[E,C]=n(!1),P=H();return e.useEffect((()=>{c&&c.length>0&&(null==d?void 0:d.length)>=3?C(!0):C(!1)}),[c]),e.createElement(e.Fragment,null,e.createElement("div",{id:"dropdownselect",className:"inputcontainer form-floating"},e.createElement("input",{type:"text",disabled:!w,placeholder:u,onChange:s,name:m,onKeyDown:e=>{if(c&&Object.keys(c).length>0)if("Enter"===(null==e?void 0:e.key)||13===(null==e?void 0:e.keyCode)){if(-1===x)return;y(-1),T(!0),C(!1),a(c[x].concatedAddress),v(c[x])}else if("ArrowUp"===(null==e?void 0:e.key)||38===(null==e?void 0:e.keyCode)){if(-1===x)return void y((null==c?void 0:c.length)-1);y(x-1)}else if("ArrowDown"===(null==e?void 0:e.key)||40===(null==e?void 0:e.keyCode)){if(x===(null==c?void 0:c.length)-1)return void y(-1);y(x+1)}else y(-1)},value:d,ref:o,autoComplete:"off","aria-autocomplete":"none",className:p,spellCheck:"false",minLength:_,maxLength:h}),e.createElement("label",{htmlFor:"address",className:"input-label"},u),0!==(null==d?void 0:d.length)&&e.createElement("div",{className:"cross-icon",onClick:()=>{var e,n;(null===(e=null==o?void 0:o.current)||void 0===e?void 0:e.focus())||C(!1),a(""),null===(n=null==o?void 0:o.current)||void 0===n||n.focus(),f(!1),b(!1)}},e.createElement("img",{src:null===(r=null===(i=null===(l=null==g?void 0:g.linecheckIcons)||void 0===l?void 0:l[0])||void 0===i?void 0:i.close)||void 0===r?void 0:r.filename,height:14,width:14,alt:"cross-icon"})),E&&(null==c?void 0:c.length)&&e.createElement("ul",{className:"addresscontainer"},c.map(((n,t)=>{let o;return t===x&&(o="active"),e.createElement(e.Fragment,null,e.createElement("li",{className:"active"===o?"suggestionactive":"",key:t,onClick:e=>((e,n)=>{var t;y(-1),C(!1),T(!0),a((null==n?void 0:n.currentTarget)&&(null===(t=null==n?void 0:n.currentTarget)||void 0===t?void 0:t.innerText)),v(e)})(n,e)},n&&(null==n?void 0:n.concatedAddress)),"mobile"===P?e.createElement("span",{className:"horizontallineone"}):"")})))))})),Lt=e.forwardRef((({content:o,parentCallback:l,parentAddress:i,isAddressNotFilled:r,onChange:a,name:c,apiError:u,setApiError:s,setFetchingLineCheck:m},p)=>{var v,_,h,g;const[f,b]=n(!1),[x,y]=n(!1),[T,E]=n(""),[C,P]=n(""),[k,S]=n(),[N,V]=n(!1);H();return t((()=>{f&&C?"differentAddress"===c&&"function"==typeof l&&l({}):E("")}),[C,f]),t((()=>{"function"==typeof P&&P(i)}),[]),e.createElement(e.Fragment,null,!N&&e.createElement(It,{inputValue:C||"",setInputValue:P,dropdownValue:k,placeholder:null==o?void 0:o.placeholder,ref:p,onChange:e=>{var n,t;"function"==typeof a&&a(e),"function"==typeof P&&P(null===(n=null==e?void 0:e.currentTarget)||void 0===n?void 0:n.value);const l=new RegExp(`[${null==o?void 0:o.regexp}]`).test(e.currentTarget.value);var i,r;y(l),(i=null===(t=null==e?void 0:e.currentTarget)||void 0===t?void 0:t.value,r=l,pe(void 0,void 0,void 0,(function*(){var e;if(!r&&(null==i?void 0:i.length)>=3){const n=null===(e=null==Oe?void 0:Oe.getInstance())||void 0===e?void 0:e.getBaseUrl(),t={params:{},headers:{"x-sunrise-channel":kt,"x-correlation-id":w()},cancelToken:{}};return t.params={count:10,address:i},yield d.getApiServiceInstance().get(`${n}${Ct}${St}`,t).then((e=>{var n,t;if(200==(null==e?void 0:e.status)){const o=[];return(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.items)&&(null===(t=null==e?void 0:e.data)||void 0===t||t.items.forEach((e=>{const n=e.street+" "+e.houseNumber+", "+e.postCode+" "+e.city;e.street&&e.houseNumber&&e.postCode&&e.city&&(e.concatedAddress=n,o.push(e))}))),o}})).catch((e=>{console.log("err",e)}))}}))).then((e=>{e&&(null==e?void 0:e.error)||(null==e?void 0:e.length)<=0?b(!0):(S(e),b(!1))})).catch((e=>console.log(e)))},selectedData:e=>{"function"==typeof P&&P(e.concatedAddress),"function"==typeof l&&l(e,{openIndividualLineCheck:!1,availabilityCheckClicked:!1})},inputClassName:(r?"errorfield":"")+" form-control",minLength:null==o?void 0:o.linecheckMinLength,maxLength:null==o?void 0:o.linecheckMaxLength,name:c,content:o,addressNotFound:f,setApiError:s,setFetchingLineCheck:m}),e.createElement("div",null,x&&e.createElement("p",{className:"errormsg errormsgMob"},null==o?void 0:o.errorMsg),!C&&r&&e.createElement("p",{className:"errormsg errormsgMob"},e.createElement("img",{src:null===(h=null===(_=null===(v=null==o?void 0:o.linecheckIcons)||void 0===v?void 0:v[0])||void 0===_?void 0:_.warning)||void 0===h?void 0:h.filename,height:"12px",width:"16px",alt:"alert"}),null==o?void 0:o.requiredFieldText),f&&!N&&e.createElement("p",{className:"secondarybutton",onClick:()=>{V(!0)}},null==o?void 0:o.noAddress,e.createElement("span",null,e.createElement("img",{src:null===(g=null==o?void 0:o.arrowIcon)||void 0===g?void 0:g.filename,height:24,width:24,alt:"right-arrow"})))))})),Dt=({content:l,onSuccess:i})=>{var r,d,a,c,u,s,m,p,v,_,h,f,b,x,y,w,T,E,C,P,k;const[S,N]=n(!1),V=o(null),[I,L]=n({enableCheckaddress:!1}),[D,O]=n(),[B,A]=n(),[R,M]=n(!1),[F,z]=n(),[$,W]=n({openIndividualLineCheck:!1,availabilityCheckClicked:!1}),[G,j]=n(!1),U=H(),[X,J]=n(!1),q=(e,n)=>{W(n),A(" "),O(e),""!==(null==e?void 0:e.postCode)&&""!==(null==e?void 0:e.city)&&""!==(null==e?void 0:e.houseNumber)&&""!==(null==e?void 0:e.street)&&""!==(null==e?void 0:e.concatedAddress)?L((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!0}))):L((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!1})))},K=()=>{I.enableCheckaddress?L((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!1}))):N(!1)};e.createElement("div",null,e.createElement("span",{className:"mobileTable"},e.createElement("span",{className:"changeBtn",onClick:()=>{"undefined"!=typeof window&&localStorage.removeItem("lineCheckResponse"),"undefined"!=typeof window&&bt.deleteCookie("chAddressJson"),"undefined"!=typeof window&&bt.deleteCookie("one-commerce-linecheckcorrelationid"),L((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!0}))),A("")},hidden:!(null==B?void 0:B.eligibleBundle)},e.createElement("span",{className:"changeTxt"},"mobile"===U?null==F?void 0:F.changeTextMob:null==F?void 0:F.changeText))));t((()=>{var e,n,t,o,l,i,r,d,a;try{let c="undefined"!=typeof window&&bt.getCookie("chAddressJson");const u="undefined"!=typeof window&&bt.getCookie("one-commerce-linecheckcorrelationid");try{c=c&&JSON.parse(c)}catch(e){console.log("invalid address json")}if(c){L((e=>Object.assign(Object.assign({},e),{enableCheckaddress:!1}))),O(null==c?void 0:c.selectedAdd);const s="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse"),m="undefined"!=typeof window&&localStorage.getItem("one-commerce-linecheckcorrelationid"),p={eligibleBundle:null!==(n=s&&(null===(e=JSON.parse(s))||void 0===e?void 0:e.eligibleBundle))&&void 0!==n?n:[],configEligibleBundle:null!==(o=s&&(null===(t=JSON.parse(s))||void 0===t?void 0:t.configEligibleBundle))&&void 0!==o?o:[],maxUploadDownloadSpeed:null!==(i=s&&(null===(l=JSON.parse(s))||void 0===l?void 0:l.maxUploadDownloadSpeed))&&void 0!==i?i:{},lineCheckRepsonse:B&&JSON.parse(null==B?void 0:B.originalLinecheckResponse),lineCheckCorrelationId:null!=m?m:"",plannedUpgrade:null!==(d=s&&(null===(r=JSON.parse(s))||void 0===r?void 0:r.plannedUpgrade))&&void 0!==d?d:{}};s&&u&&(null===(a=JSON.parse(s))||void 0===a?void 0:a.eligibleBundle)&&Object.keys(null==c?void 0:c.selectedAdd).length&&A(p)}}catch(e){}}),[F]),t((()=>{var e,n,t,o,i;l&&("lineCheckTemplate"===(null===(n=null===(e=null==l?void 0:l.reference)||void 0===e?void 0:e.content)||void 0===n?void 0:n.component)?z(null===(o=null===(t=null==l?void 0:l.reference)||void 0===t?void 0:t.content)||void 0===o?void 0:o.linecheck[0]):z(null===(i=null==l?void 0:l.linecheck)||void 0===i?void 0:i[0]))}),[]),t((()=>{var e,n,t;(!(null==B?void 0:B.eligibleBundle)||(null==B?void 0:B.eligibleBundle.length)<1)&&N(!1),(null===(e=null==B?void 0:B.eligibleBundle)||void 0===e?void 0:e.length)&&(0!==Object.keys(D).length&&void 0!==(null===(n=null==B?void 0:B.maxUploadDownloadSpeed)||void 0===n?void 0:n.maxBandwidthDown)||null===(t=null==B?void 0:B.maxUploadDownloadSpeed)||void 0===t||t.maxBandwidthDown)}),[null===(r=null==B?void 0:B.eligibleBundle)||void 0===r?void 0:r.length]);const Y=o(null),Z={linecheckResponse:B,eligibleBundle:null==B?void 0:B.eligibleBundle,lineCheckContent:F,handleSelection:q,isAddressNotFilled:S,name:"lineCheck",onChange:K,selectedAddress:D,isFetchingLineCheck:R,apiError:G,setApiError:j,setFetchingLineCheck:M};Object.assign({},Z);const[Q,ee]=e.useState(),[ne,te]=e.useState(!1);return e.useEffect((()=>{var e;(null===(e=null==B?void 0:B.eligibleBundle)||void 0===e?void 0:e.length)<1?ee(null==F?void 0:F.dataText):ee(""),te(!1)}),[]),console.log("inside linecheck v3",F),e.createElement(e.Fragment,null,e.createElement("div",{className:"row justify-content-center ",ref:Y},e.createElement("div",{className:"col-12 px-0 "},e.createElement("div",{className:` ${S&&!(null==B?void 0:B.eligibleBundle)?"gradientborder":""} maincontainer`},e.createElement("div",{className:((null==B?void 0:B.eligibleBundle)?"row position-relative inputRow":"row position-relative inputrow")+" ",onClick:()=>{var e;"mobile"===U&&(null===(e=null==V?void 0:V.current)||void 0===e||e.focus(),J(!0))}},(null==B?void 0:B.eligibleBundle)&&(Q||!Q&&(null===(d=null==B?void 0:B.eligibleBundle)||void 0===d?void 0:d.length)>1?e.createElement("img",{src:null===(u=null===(c=null===(a=null==F?void 0:F.linecheckIcons)||void 0===a?void 0:a[0])||void 0===c?void 0:c.tick)||void 0===u?void 0:u.filename,className:"tickIcons",height:"32px",width:"32px"}):e.createElement("img",{src:null===(p=null===(m=null===(s=null==F?void 0:F.linecheckIcons)||void 0===s?void 0:s[0])||void 0===m?void 0:m.close)||void 0===p?void 0:p.filename,className:"tickIcons ",height:"32px",width:"32px"})),((null==F?void 0:F.linecheckTitle)||(null==F?void 0:F.successLinecheckTitle))&&e.createElement(e.Fragment,null,e.createElement("h4",{className:"linechecktitle"},!R&&(null==B?void 0:B.eligibleBundle)?(null===(v=null==B?void 0:B.eligibleBundle)||void 0===v?void 0:v.length)<1?null==F?void 0:F.noConnectionTitle:null==F?void 0:F.successLinecheckTitle:null==F?void 0:F.linecheckTitle)),(null==B?void 0:B.eligibleBundle)?e.createElement(e.Fragment,null,e.createElement("div",null,"Linecheck success field")):e.createElement(e.Fragment,null,e.createElement("div",{className:"horizontalDivider"}),e.createElement("div",{className:"col-1 px-0 "},(null==B?void 0:B.eligibleBundle)?e.createElement(e.Fragment,null):e.createElement("img",{src:null===(f=null===(h=null===(_=null==F?void 0:F.linecheckIcons)||void 0===_?void 0:_[0])||void 0===h?void 0:h.home)||void 0===f?void 0:f.filename,height:""+("mobile"===U?"26px":"48px"),width:""+("mobile"===U?"26px":"48px"),alt:"home",className:"homeicon"})),e.createElement("div",{className:`col-lg-8 col-md-8 col-sm-8 ${"mobile"===U&&((null==B?void 0:B.eligibleBundle)?"col-12":"col-9")} px-0`},e.createElement("div",null,e.createElement(Lt,{content:F,parentCallback:q,parentAddress:null==D?void 0:D.concatedAddress,ref:V,isAddressNotFilled:S,name:"lineCheck",onChange:K,setAddressNotFilled:N,apiError:G,setApiError:j,setFetchingLineCheck:M}))),e.createElement("div",{className:"col-lg-3 col-md-3 col-sm-3 col-2 px-0 marginautodefault"},"mobile"!==U||(null==B?void 0:B.eligibleBundle)?e.createElement("button",{name:"check address button",type:"button",className:"primarybutton mobileButton",disabled:!I.enableCheckaddress,hidden:!!(null==B?void 0:B.eligibleBundle),onClick:()=>{var e;(null==I?void 0:I.enableCheckaddress)?(M(!0),"undefined"!=typeof window&&bt.deleteCookie("chAddressJson"),"undefined"!=typeof window&&bt.setCookie("chAddressJson",JSON.stringify({addressValue:null==D?void 0:D.concatedAddress,selectedAdd:D}),{path:"/",maxAge:259200}),D&&Object.keys(D).length>0&&Vt(D).then((e=>{"undefined"!=typeof window&&localStorage.setItem("LinecheckCall","true"),M(!1),A(e),j(!1),"mobile"===U&&$.openIndividualLineCheck&&J(!1)})).catch((e=>{console.log(e),j(!0),W(Object.assign(Object.assign({},$),{availabilityCheckClicked:!1})),"mobile"===U&&$.openIndividualLineCheck&&J(!0)}))):(N(!0),null===(e=null==V?void 0:V.current)||void 0===e||e.focus(),"mobile"===U&&J(!1))},style:{width:"100%",position:"relative",bottom:"10px"}},R&&!G&&""!==(null===(w=null==V?void 0:V.current)||void 0===w?void 0:w.value)?e.createElement(g,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"}):null==F?void 0:F.buttonvalue):e.createElement("span",null,e.createElement("img",{width:52,height:52,alt:"search",src:null===(y=null===(x=null===(b=null==F?void 0:F.linecheckIcons)||void 0===b?void 0:b[0])||void 0===x?void 0:x.searchIcon)||void 0===y?void 0:y.filename})))),(null===(T=null==B?void 0:B.plannedUpgrade)||void 0===T?void 0:T.expectedSpeed)&&e.createElement(e.Fragment,null,e.createElement("div",{className:"col-lg-1 col-md-1 col-sm-1 col-12 px-0"},(null==B?void 0:B.eligibleBundle)&&e.createElement("img",{src:null===(P=null===(C=null===(E=null==F?void 0:F.linecheckIcons)||void 0===E?void 0:E[0])||void 0===C?void 0:C.upgrade)||void 0===P?void 0:P.filename,height:"32px",width:"32px",alt:"activeup"})),e.createElement("div",{className:"col-lg-8 col-md-8 col-sm-8 col-12 px-0"},(null==B?void 0:B.eligibleBundle)&&e.createElement("div",null," On Success"))))))),(null==F?void 0:F.helpText)&&!(null===(k=V.current)||void 0===k?void 0:k.value)?e.createElement("div",{className:"helpText"},!R&&(null==B?void 0:B.eligibleBundle)?"":null==F?void 0:F.helpText):"")},Ot=({content:t,onSuccess:o})=>{var l,i,r;const[d,a]=n(!0),c=null===(r=null===(i=null===(l=null==t?void 0:t.reference)||void 0===l?void 0:l.content)||void 0===i?void 0:i.body)||void 0===r?void 0:r[0];return console.log("inside linecheck modal"),e.createElement(gt,{modalState:d,handler:()=>{a(!d)},showFooter:!1,noCloseButton:!1,backgroundColor:"transparent",fixedWidth:"850px"},e.createElement(Dt,{content:c,onSuccess:o}))},Bt=({content:o,offeringData:l,uniqueId:i,storyContent:r,metadata:d,tabIndex:a,cardsLength:c,indexKey:u,constants:s,mainContent:m,address:p,eligibleBundle:v,linecheckSuccessCallBack:_})=>{var h,g,f,b,x,w,T,E,C,P,k,V,D,O,B,A,R,M,F,z,$,G,j,U,X,H,J,K,Y,Z,Q,ee,oe,le,ie,re,de,ae,ue,se,pe;const[ve,_e]=n(!1),[he,fe]=n(!1),[be,xe]=n({showGift:!1,cashbackAvailable:!1}),[ye,we]=n([]),[Te,Ee]=n(!1),[Ce,Pe]=n(!1),[ke,Se]=n(!1),Ne=void 0!==typeof window&&document.getElementById("static-linetable"),Ve=0===(null===(h=Object.keys(o))||void 0===h?void 0:h.length),Ie=null===(w=null===(x=null===(b=null===(f=null===(g=null==o?void 0:o.products)||void 0===g?void 0:g[0])||void 0===f?void 0:f.reference)||void 0===b?void 0:b.content)||void 0===x?void 0:x.product)||void 0===w?void 0:w[0],Le=null===(k=null===(P=null===(C=null===(E=null===(T=null==o?void 0:o.promotion)||void 0===T?void 0:T[0])||void 0===E?void 0:E.reference)||void 0===C?void 0:C.content)||void 0===P?void 0:P.promoDescription)||void 0===k?void 0:k[0],De=null==Ie?void 0:Ie.productId,Oe=null===(V=null==I?void 0:I.getInstance())||void 0===V?void 0:V.getCartUrl(),Be=null===(D=null==L?void 0:L.getInstance())||void 0===D?void 0:D.getAssetPath(),Ae="MOBILE"===(null==r?void 0:r.pageType);let Re;Re=p&&(null===(O=null==v?void 0:v.eligibleBundle)||void 0===O?void 0:O.includes(De));let Fe=void 0!==typeof window&&y.get("sunriseAuth");Fe=Fe&&JSON.parse(Fe);const ze=((null==l?void 0:l[i])||[]).filter((e=>(null==e?void 0:e.id)===De)),Ge=()=>{fe(!1);!(!(null==m?void 0:m.enableExistingCustomer)||null!=Fe)?Ee(!0):Je()},Ue=e=>{const n=ye.findIndex((n=>(null==e?void 0:e.giftGroupId)===(null==n?void 0:n.giftGroupId))),t=ye;-1===n?t.push(e):t[n]=e,we([...t])},Xe=((e,n)=>{let t;return n||(t=(e||[]).filter((e=>!0===(null==e?void 0:e.enableTV)))),t})(null==Ie?void 0:Ie.bloks,Ae),He=null===(B=null==Xe?void 0:Xe[0])||void 0===B?void 0:B.tvProductId,Je=()=>{fe(!1),((e,n,t,o,l,i,r,d,a,c,u)=>{var s;if(r)e(!0),0!==(null===(s=Object.keys(o))||void 0===s?void 0:s.length)&&ge(o,"",(null==i?void 0:i.promoID)?null==i?void 0:i.promoID:te,n,"mobile",t).then((e=>{var n;y.remove("one-commerce-cartId",{path:"/"}),y.set("one-commerce-cartId",null==e?void 0:e.id,{path:"/"}),y.set("cartProduct",null==i?void 0:i.id,{path:"/"}),Ke(Me,o,"",je),window.location.href=null===(n=null==l?void 0:l.summaryPageUrl)||void 0===n?void 0:n.cached_url})).catch((n=>{console.log(n),e(!1)})).finally((()=>{e(!1)}));else{const r="undefined"!=typeof window&&y.get("one-commerce-linecheckcorrelationid");a&&c&&r?(e(!0),0!==o.length&&ge(o,d,(null==i?void 0:i.promoID)?null==i?void 0:i.promoID:ne,n,"fixnet",t).then((e=>{var n;"undefined"!=typeof window&&y.remove("one-commerce-cartId",{path:"/"}),"undefined"!=typeof window&&y.set("one-commerce-cartId",null==e?void 0:e.id,{path:"/"}),"undefined"!=typeof window&&y.set("cartProduct",null==i?void 0:i.id,{path:"/"}),"undefined"!=typeof window&&y.remove("landline"),Ke(Me,o,"",je),window.location.href=null===(n=null==l?void 0:l.summaryPageUrl)||void 0===n?void 0:n.cached_url})).catch((e=>{console.log(e)})).finally((()=>{e(!1)}))):u(!0)}})(_e,Oe,ye,ze,m,Ye,Ae,He,v,p,Se)},Ye=rn(ze,Ae);t((()=>{var e;setTimeout((()=>{((e,n)=>{W(`headingV3${e}`,n),W(`descriptionV3${e}`,n),W(`titleV3${e}`,n),W(`detailsectionv3${e}`,n),W(`product-configv3${e}`,n),W(`gift-section${e}`,n),W(`benefits-section${e}`,n),W(`order-section${e}`,n),W(`price-section${e}`,n),W(`benefits-price-section${e}`,n),W(`contract-section${e}`,n)})(a,c)}),100);const n=(e=>{let n=!1,t=!1;return null==e||e.map((e=>{var o;null===(o=null==e?void 0:e.promotionInfo)||void 0===o||o.map((e=>{(null==e?void 0:e.hardwareGift)&&(n=!0),(null==e?void 0:e.cashBack)&&(t=!0)}))})),{showGift:n,cashbackAvailable:t}})(Ae?ze:null===(e=null==ze?void 0:ze[0])||void 0===e?void 0:e.bundledOffers);xe(Object.assign({},n))}),[l]);const Ze=()=>{(null==Xe?void 0:Xe.length)>0&&Pe(!0)};return e.createElement("div",null,ve&&Ne&&N(e.createElement(me,{keyParams:"loading"}),Ne),Ve&&e.createElement("div",{className:"w-75 pb-2"},e.createElement(sn,null)),!Ve&&v&&o&&p&&!Ae&&e.createElement("div",{className:Qn.selected},e.createElement("span",{style:{paddingBottom:"10px"}},Re?e.createElement("span",{className:Qn.activeicon},e.createElement("img",{src:`${Be}/icons/lineCheck-success.svg`,alt:"",width:24,height:24,className:Qn.activeicon}),e.createElement("span",null,null==s?void 0:s.subscriptionAvalTxt)):e.createElement("span",{className:Qn.inactiveicon},e.createElement("img",{src:`${Be}/icons/cross_disabled.svg`,alt:"",width:24,height:24,className:Qn.inactiveicon}),e.createElement("span",null,null==s?void 0:s.notSubscriptionTxt)))),e.createElement("div",{className:`${Ae||!1!==Re?"":Qn.overlay}`,style:{flexDirection:"column"}},e.createElement("div",{className:`${Qn.bundleproductcard} ${Qn.productcontainer} ${(null===(A=null==o?void 0:o.highlightText)||void 0===A?void 0:A.length)>0&&Qn.highlightBorder}`},(null===(R=null==Ie?void 0:Ie.highlightText)||void 0===R?void 0:R.length)>0&&e.createElement("div",{className:`${Qn.highlightText}`},null==o?void 0:o.highlightText),(null==Le?void 0:Le.displayText)&&e.createElement("div",{className:`${Qn.promocontainer}`,style:{background:null==Le?void 0:Le.bestSellerColor}},null==Le?void 0:Le.displayText),e.createElement("div",{className:`${Qn.detailsection}`,id:`detailsectionv3${a}${u}`},e.createElement("div",{className:`${Qn.headersection}`},e.createElement("div",{className:`${Qn.titlesection}`},e.createElement("div",{className:`${Qn.productheader}`,id:`titleV3${a}${u}`},null==Ie?void 0:Ie.productName),e.createElement("div",null,(null===(M=null==Ie?void 0:Ie.icon)||void 0===M?void 0:M.filename)&&e.createElement("img",{className:`${Qn.imagecontainer}`,src:null===(F=null==Ie?void 0:Ie.icon)||void 0===F?void 0:F.filename,height:15,width:20}))),e.createElement("div",{className:`${Qn.productdescription}`,id:`descriptionV3${a}${u}`},e.createElement(ce,{content:null==Ie?void 0:Ie.description})),e.createElement("div",{className:`${Qn.images}`},(null===(z=null==Ie?void 0:Ie.img)||void 0===z?void 0:z.filename)&&e.createElement("img",{className:`${Qn.imagespace} ${(null==o?void 0:o.highlightText)&&Qn.borderimage}`,alt:"cardimg",src:null===($=null==Ie?void 0:Ie.img)||void 0===$?void 0:$.filename}))),e.createElement("div",{className:`${Qn.productconfig}`,id:`product-configv3${a}${u}`},Ve?e.createElement(e.Fragment,null,e.createElement("div",{className:Qn.space}),e.createElement(sn,{stylename:Qn.skeletontittle,count:1}),e.createElement(sn,{stylename:Qn.skeletonline,count:5}),e.createElement("div",{className:Qn.space}),e.createElement(sn,{stylename:Qn.skeletontittle,count:1}),e.createElement(sn,{stylename:Qn.skeletonline,count:5})):e.createElement("div",null,(null==Ie?void 0:Ie.bloks)&&(null===(G=null==Ie?void 0:Ie.bloks)||void 0===G?void 0:G.map(((n,t)=>e.createElement(nt,{content:n,indexKey:t,constants:s,key:t,showModalPopup:Ze}))))))),e.createElement("div",{className:`${Qn.detailsection}`,id:`benefits-price-section${a}${u}`},e.createElement("div",{className:`${Qn.benefitssection}`,id:`benefits-section${a}${u}`},(null===(j=null==Ie?void 0:Ie.benefits)||void 0===j?void 0:j.length)>0&&e.createElement(tt,{content:null==Ie?void 0:Ie.benefits,benefitData:Ye,constants:s})),e.createElement("br",null),e.createElement("div",{className:`${Qn.giftsection}`,id:`gift-section${a}${u}`},(null==be?void 0:be.showGift)&&(null===(U=null==Le?void 0:Le.singleGift)||void 0===U?void 0:U.map(((n,t)=>e.createElement(An,{content:n,key:t})))),(null==be?void 0:be.showGift)&&(null===(X=null==Le?void 0:Le.giftConfig)||void 0===X?void 0:X.map(((n,t)=>e.createElement(Mn,{content:n,key:t,selectedGiftItem:Ue,parentPoType:Ae?"MOBILE":"HOME"})))),e.createElement("div",{className:`${Qn.giftsection}`,id:`cashback-section${a}${u}`},(null==Le?void 0:Le.cashBack)&&(null==be?void 0:be.cashbackAvailable)&&(null===(H=null==Le?void 0:Le.cashBack)||void 0===H?void 0:H.map(((n,t)=>e.createElement(Hn,{content:n,key:t})))))),e.createElement("div",{className:`${Qn.ordersection}`,id:`order-section${a}${u}`},""===(null==Ye?void 0:Ye.base)?e.createElement("div",null,e.createElement(sn,{stylename:Qn.skeletontittle})):e.createElement("div",{className:`${Qn.flexgrid} ${Qn.pricesection} `,id:`price-section${a}${u}`},e.createElement(ot,{priceCollection:Ye,constants:s,promoText:null==Ie?void 0:Ie.promoText})),e.createElement("div",{className:`${(null==r?void 0:r.swapButton)&&Qn.swapButton}`},e.createElement("div",{style:{padding:"16px 0"}},e.createElement(lt,{isMobileFlow:Ae,createCartCall:Ae?Ge:Je,constants:s,storyContent:r,showPrice:Ye,isAvailable:Re,address:p})),e.createElement("div",{className:Qn.productcontractduration,id:`contract-section${a}${u}`},(null==Ye?void 0:Ye.contractDuration)?q(null===(J=null==s?void 0:s.minContractDuration)||void 0===J?void 0:J.substring(1),[null==Ye?void 0:Ye.contractDuration]):null==s?void 0:s.noContractDuration),(null===(K=null==r?void 0:r.addSmartPhone)||void 0===K?void 0:K.length)>0&&e.createElement("div",{style:{textAlign:"center",padding:"4px"}},(null==r?void 0:r.swapButton)?(null==r?void 0:r.ctaLabel)&&e.createElement("div",{style:{padding:"16px 0"}},e.createElement("button",{className:"primarybutton",onClick:()=>vt(Ye,r,ze)},e.createElement("span",{className:Qn.buttontext},null==r?void 0:r.ctaLabel))):e.createElement("span",{className:`${Qn.productdetailslink} ${Qn.addsmartphone}`},e.createElement("div",null,e.createElement("span",null,(null===(Q=null===(Z=null===(Y=null==r?void 0:r.addSmartPhone)||void 0===Y?void 0:Y[0])||void 0===Z?void 0:Z.buttonIcon)||void 0===Q?void 0:Q.filename)&&e.createElement("img",{src:null===(le=null===(oe=null===(ee=null==r?void 0:r.addSmartPhone)||void 0===ee?void 0:ee[0])||void 0===oe?void 0:oe.buttonIcon)||void 0===le?void 0:le.filename,width:12,height:18,alt:"icon"})),e.createElement("span",null,e.createElement("a",{onClick:()=>vt(Ye,r,ze)},null===(re=null===(ie=null==r?void 0:r.addSmartPhone)||void 0===ie?void 0:ie[0])||void 0===re?void 0:re.buttonLabel)))))),e.createElement("div",{style:{textAlign:"center",padding:"4px"}},(null===(de=null==Ie?void 0:Ie.productDetails)||void 0===de?void 0:de.length)>0&&e.createElement("span",{className:Qn.productdetailslink,onClick:()=>{fe(!he),Fn(We,$e,qe(ze,"",je))}},null==s?void 0:s.productDetailsLink)),he&&e.createElement(pt,{content:null==Ie?void 0:Ie.productDetails,showProductDetail:he,setShowProductDetail:fe,constants:s,showPrice:Ye,isMobileFlow:Ae,createCartCall:Ae?Ge:Je,storyContent:r,isAvailable:Re,address:p}))))),Ce&&(Ve?e.createElement(sn,null):e.createElement(ht,{content:null==Xe?void 0:Xe[0],setShowModal:Pe,showModal:Ce,constants:s})),Te&&Ae&&(null===(ae=null==m?void 0:m.loginData)||void 0===ae?void 0:ae.length)>0&&Ne&&N(e.createElement(S,{content:null===(ue=null==m?void 0:m.loginData)||void 0===ue?void 0:ue[0],closeLogin:()=>{Ee(!1)},metadata:d,onSuccess:()=>{Ee(!1),Je()}}),Ne),ke&&!Ae&&(null===(se=null==m?void 0:m.linecheckData)||void 0===se?void 0:se.length)>0&&e.createElement(Ot,{content:null===(pe=null==m?void 0:m.linecheckData)||void 0===pe?void 0:pe[0],onSuccess:()=>{let e="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse");v=e&&(null===JSON||void 0===JSON?void 0:JSON.parse(e)),p="undefined"!=typeof window&&y.get("chAddressJson"),Se(!1),"function"==typeof _&&_(),Je()}}))},At=({content:o,setGenericErrorModalDetails:l,metadata:i,tabIndex:r,constants:d,loginSuccess:a,activeIndex:c,mainContent:u,address:s,eligibleBundle:m,linecheckSuccessCallBack:p})=>{var v,_,h;const g=H(),f=null==o?void 0:o._uid,[b,x]=n(),w=null===(v=null==I?void 0:I.getInstance())||void 0===v?void 0:v.getBaseUrl();let T=void 0!==typeof window&&y.get("sunriseAuth");T=T&&JSON.parse(T);const E="MOBILE"===(null==o?void 0:o.pageType);t((()=>(setTimeout((()=>{C()}),100),null===window||void 0===window||window.addEventListener("resize",C),null===window||void 0===window||window.addEventListener("load",C),()=>{window.removeEventListener("resize",C),window.removeEventListener("load",C)})),[null==o?void 0:o.productList]);const C=()=>{var e;W(`productCardV3${c}`,null===(e=null==o?void 0:o.productList)||void 0===e?void 0:e.length)};t((()=>{var e;b&&(null===(e=Object.keys(b))||void 0===e?void 0:e.length)>0&&nn("view",b[f],"",je)}),[b]),t((()=>{var e;b&&(null===(e=Object.keys(b))||void 0===e?void 0:e.length)>0&&!E&&(null==m?void 0:m.eligibleBundle)&&nn("available",b[f],"",je,null==m?void 0:m.eligibleBundle)}),[m,b]);const P=()=>{var e,n;const t=[],i=null==u?void 0:u.enableExistingCustomer,d=null==u?void 0:u.subscriptionType,s=null==o?void 0:o.isReturnPromo;var m,p;if(m=null==o?void 0:o.productList,p=t,null==m||m.map((e=>{var n,t,o,l,i,r,d,a,c,u,s;const m={id:"",promoIds:[]},v=null===(i=null===(l=null===(o=null===(t=null===(n=null==e?void 0:e.products)||void 0===n?void 0:n[0])||void 0===t?void 0:t.reference)||void 0===o?void 0:o.content)||void 0===l?void 0:l.product)||void 0===i?void 0:i[0],_=null===(u=null===(c=null===(a=null===(d=null===(r=null==e?void 0:e.promotion)||void 0===r?void 0:r[0])||void 0===d?void 0:d.reference)||void 0===a?void 0:a.content)||void 0===c?void 0:c.promoDescription)||void 0===u?void 0:u[0];m.id=null==v?void 0:v.productId,null===(s=null==m?void 0:m.promoIds)||void 0===s||s.push(null==_?void 0:_.promotionId),null==p||p.push(m)})),r===c&&!(null==b?void 0:b[f])||r===c&&a)try{null===(e=fe(t,null==o?void 0:o._uid,w,i,d,s))||void 0===e||e.then((e=>{x(e),l({showPopup:!1})})).catch((e=>{var n;console.log("error---\x3e",e),l({showPopup:!0,content:null===(n=null==u?void 0:u.telesalesBlok)||void 0===n?void 0:n[0]})}))}catch(e){console.log("error---\x3e",e),l({showPopup:!0,content:null===(n=null==u?void 0:u.telesalesBlok)||void 0===n?void 0:n[0]})}};return t((()=>{c!=r&&c||P()}),[c]),t((()=>{(null==T?void 0:T.siteId)&&a&&P()}),[a]),e.createElement("div",null,e.createElement("div",{className:Qn.titlecontainer},(null==o?void 0:o.title)&&e.createElement("div",{className:Qn.title},null==o?void 0:o.title),(null==o?void 0:o.subTitle)&&e.createElement("div",{className:Qn.description},null==o?void 0:o.subTitle)),e.createElement("div",{className:"linetableV3"},g&&e.createElement(dn,{carouselIndex:c,key:c,arrow:null==u?void 0:u.enableMobileArrows},((null===(_=null==o?void 0:o.productList)||void 0===_?void 0:_.length)&&(null==o?void 0:o.productList)||new Array((null===(h=null==o?void 0:o.productList)||void 0===h?void 0:h.length)||3).fill(1)).map(((n,t)=>{var l;return e.createElement("div",{id:`productCardV3${c}`,style:{textAlign:"center"}},e.createElement(Bt,{content:n,offeringData:b,uniqueId:f,storyContent:o,metadata:i,tabIndex:r,cardsLength:null===(l=null==o?void 0:o.productList)||void 0===l?void 0:l.length,indexKey:t,constants:d,mainContent:u,linecheckSuccessCallBack:p,address:s,eligibleBundle:m}))})))))},Rt=({content:o,tabCheckCallBack:l,setGenericErrorModalDetails:i,metadata:r,loginSuccess:d,changeAddressClicked:a,linecheckSuccessCallBack:c})=>{var u,s,m;const[p,v]=n(0),_=null===(u=null==o?void 0:o.oneEcomConstants)||void 0===u?void 0:u[0];let g="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse"),f=g&&(null===JSON||void 0===JSON?void 0:JSON.parse(g)),b="undefined"!=typeof window&&y.get("chAddressJson");return t((()=>{var e,n,t;const i=new URLSearchParams(null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.search),r=null==i?void 0:i.get("tabOption");o&&null!==r&&((null==o?void 0:o.productContainer)||[]).map(((e,n)=>{(null==e?void 0:e.tabId)===r&&v(n)}));const d=null===(t=null===(n=null==o?void 0:o.productContainer)||void 0===n?void 0:n[p])||void 0===t?void 0:t.tabId;"function"==typeof l&&(null==l||l(d))}),[o]),t((()=>{g="undefined"!=typeof window&&localStorage.getItem("lineCheckResponse"),f=g&&(null===JSON||void 0===JSON?void 0:JSON.parse(g)),b="undefined"!=typeof window&&y.get("chAddressJson")}),[a]),e.createElement("div",null,e.createElement("div",{id:"static-linetable"},(null==o?void 0:o.productContainer)&&e.createElement(e.Fragment,null,e.createElement(Te,null,e.createElement("div",{className:`row justify-content-center ${Qn.tabblock}`},(null===(s=null==o?void 0:o.productContainer)||void 0===s?void 0:s.length)>1&&e.createElement("div",{className:` ${Qn.tabcontainer}`},((null==o?void 0:o.productContainer)||[]).map(((n,t)=>e.createElement("div",{className:` ${Qn.tabs} ${p===t?Qn.tabcontentactive:Qn.tabcontentinactive}`,key:null==n?void 0:n.tabCaption},e.createElement("label",{className:` ${Qn.tabcontent} `},e.createElement("input",{type:"radio",checked:p===t,onChange:()=>{v(t),"function"==typeof l&&(null==l||l(null==n?void 0:n.tabId)),Fn(We,Xe,{click_text:null==n?void 0:n.tabCaption})}}),null==n?void 0:n.tabCaption))))))),e.createElement(Te,{resuablelineTable:!0},e.createElement("div",{className:"position-relative "},e.createElement(h,{activeIndex:p,indicators:!1,controls:!1,interval:null,id:"pt-carousel",slide:!1},(null===(m=null==o?void 0:o.productContainer)||void 0===m?void 0:m.length)>0&&((null==o?void 0:o.productContainer)||[]).map(((n,t)=>e.createElement(h.Item,{key:t},e.createElement(At,{content:n,setGenericErrorModalDetails:i,metadata:r,tabIndex:t,constants:_,loginSuccess:d,activeIndex:p,mainContent:o,address:b,eligibleBundle:f,linecheckSuccessCallBack:c}))))))))))};export{L as AssetPathPropConfig,F as Button,Ve as Card,ye as CardEntitlement,Ie as CarouselComp,I as LineTableBasicPropConfig,Oe as LinecheckBasicPropConfig,z as LoginModal,Kn as ProductTableV3,on as ProductTeaser,De as ProductTeaserPropConfig,Rt as StaticLineTable,Zn as StickyProductAnchor};
9
9
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunrise-upc/mobile-prod-card",
3
- "version": "1.2.4-beta.21",
3
+ "version": "1.2.4-beta.23",
4
4
  "description": "Starter project to create reusable functional component",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",