{"version":3,"names":["isNbnAddressSuccessResponse","res","FeatureApiService","constructor","this","getFeatureFlagStatus","async","featureKeys","length","getConfig","httpHeaders","configService","getHttpHeaders","apimSubscriptionKey","keys","join","requestUrl","apiBaseURL","fetch","method","headers","then","response","ok","json","data","featureStatus","key","value","Object","entries","catch","configData","store","get","bffApiUrl","bffOcpApimSubscriptionKey","featureApiService","FeatureService","getFeatureStatus","featureFlagStatus","undefined","loadFeaturesStatus","existingFeatureStatus","combinedFeatureStatus","assign","set","featureService","Mapper","mapProductSearchRequestModel","address","productSearchRequestModel","ProductSearchRequestModel","floorNumber","floor","unitNumber","streetNumber","streetName","streetType","streetTypeSuffix","suburb","state","postcode","latitude","longitude","deliveryPointId","deliveryPointIdentifier","webCampaignId","StoreKeys","webId","mapper","dispatchCartLoadedEvent","cartResponse","_a","cartItems","itemIds","forEach","item","itemFuelType","_b","additionalData","productQualification","fuelType","FuelTypes","ELECTRICITY","DUAL","sku","GAS","elem","document","querySelector","event","CustomEvent","detail","dispatchEvent","dispatchResetCartEvent","cartHandler","onChange","cartDetails","OpenApiService","composeHttpHeaders","contentMode","requestHeaders","getConfigData","setAuthAccessToken","OpenAPI","HEADERS","RequestHeaders","compose","setBaseUrl","BASE","token","sessionStorage","getItem","SessionStorageKeys","AccessToken","TOKEN","openApiService","removeCookie","Cookies","remove","cartId","path","removeItemFromCart","itemId","CartService","deleteCart","parseInt","retrieveCart","Promise","resolve","CartUtils","cartIsExpired","abandonCart","cart","removeItem","onGuidedFlowLoad","storeCartResponse","onRemoveCartItem","find","x","cartItemId","setTimeout","getElementsByTagName","equaliseHeights","ex","responseError","ResponseError","clearCart","all","map","requestAddress","cartAddress","getAddressFromCart","isAddressSame","isSameAddress","window","setItem","JSON","stringify","ProductsSessionStorageService","getAllProducts","parse","ProductDetailsSession","saveProducts","products","saveMobileProducts","SelectedMobileProductDetails","selectedMobileProductDetails","removingLastMobileItem","productDetails","isOnlyMobileInCart","productCategory","toLowerCase","buildCacheKey","addressService","convertAddressToString","setProducts","couponCodeInRequest","sessionObject","requestType","requestCouponCode","allProducts","newAllProducts","upsertProducts","productIndex","findIndex","p","productSessionData","splice","unshift","getLatestProductsByProductCategory","getLatestProducts","storageProductSessionData","_c","couponCodeInCache","_d","isNbnMoversFlow","FeatureKey","NBN_MOVERS_ENABLED","getNbnProductsByLocationId","locationId","serviceQualification","nbn","nbnLocation","getLatestWebIdFromProducts","removeProducts","productsSessionStorageService","NbnProductService","modemProductName","isServiceNotAvailable","errorType","isHfcServiceNotAvailable","getProductSearchRequest","couponCode","productSearchRequest","defaultProductSearchRequest","nbnProductSearchApiService","getProducts","IsNBNAvailable","aemCIFIntegrationEnabled","postMessage","eventType","spaCategory","eventData","addressValidation","isAddressPresent","isNbnAvailable","IsProductAvailable","modemProduct","name","includes","siteError","attributes","toUpperCase","isHfcClass","serviceClass","serviceType","hfcClasses","some","hasNoQualifiedService","product","content","qualified","hasNoService","errorReportingService","logError","NbnServiceabilityFail","serviceTypeUnavailableSatellite","ReportErrorType","NbnServiceabilityFailed","addressUnserviceable","getProductsByAddress","getDefaultProducts","getProductsByLocationId","VoipProductDetailsSession","getVoipProduct","ModemProductDetailsSession","getModemProduct","getValidProduct","nbnProductService","ChangePlanService","isChangePlan","urlParams","URLSearchParams","location","search","QueryStringParamName","IsChangePlan","currentPlanSku","getCurrentPlanSku","startsWith","customerProfile","customerProfileService","getCustomerProfile","existingNbnProductId","getNbnProduct","hasExistingEnergy","contractData","customerData","contractsResponse","contracts","contractResult","accountContractService","getEnergyContract","_f","_e","setCustomerProfile","getLocationIdFromSelectedProduct","selectedProduct","selectedNbnProductDetails","Array","isArray","_h","_g","getSelectedProductSku","clearSelectedProduct","getChangePlanProductsForDisplay","sqProducts","filteredProducts","displayedProducts","selectedProductSku","push","filter","changePlanService","DelayMessageService","timers","timer","timeout","message","startAllTimers","startTimer","stopAllTimers","stopTimer","delayMessage","clearTimeout","delayMessageService","root","factory","module","exports","is","VERSION","not","any","toString","prototype","slice","hasOwnProperty","func","apply","call","arguments","params","getParams","i","comparator","a","b","compareVersion","version","range","string","n","match","NaN","op","args","array","boolean","char","date","domNode","object","nodeType","error","nan","number","regexp","sameType","other","tag","api","windowObject","empty","getOwnPropertyNames","existy","falsy","truthy","above","min","decimal","equal","even","finite","isFinite","infinite","Infinity","integer","negative","odd","positive","under","max","within","regexes","affirmative","alphaNumeric","caPostalCode","creditCard","dateString","email","eppPhone","hexadecimal","hexColor","ipv4","ipv6","nanpPhone","socialSecurityNumber","timeString","ukPostCode","url","usZipCode","regexpCheck","test","ip","capitalized","words","split","word","chr","charAt","endWith","target","position","indexOf","include","lowerCase","palindrome","replace","half","Math","space","charCode","charCodeAt","startWith","upperCase","days","months","day","getDay","dayLightSavingTime","january","Date","getFullYear","july","stdTimezoneOffset","getTimezoneOffset","future","now","getTime","inDateRange","start","end","stamp","inLastMonth","setMonth","getMonth","inLastWeek","setDate","getDate","inLastYear","setFullYear","inNextMonth","inNextWeek","inNextYear","leapYear","year","month","past","quarterOfYear","quarter","today","todayString","toDateString","tomorrow","tomorrowString","weekend","weekday","yesterday","yesterdayString","freeGlobal","global","freeSelf","self","thisGlobal","Function","previousIs","navigator","appVersion","userAgent","vendor","android","androidPhone","androidTablet","blackberry","chrome","desktop","mobile","tablet","edge","firefox","ie","ios","iphone","ipad","ipod","linux","mac","windowsPhone","offline","online","onLine","opera","phantom","safari","windowsTablet","touchDevice","DocumentTouch","windows","propertyCount","count","property","propertyDefined","inArray","sorted","sign","predicate","setInterfaces","options","option","interfaces","setNamespace","setRegexp","r","getElementTop","element","box","getBoundingClientRect","body","docEl","documentElement","scrollTop","pageYOffset","clientTop","top","scrollToElement","offSet","scrollTo","is.ie","is.edge","scroll","left","behavior","isNotNumber","input","num","parseFloat","isNaN","altElementSelector","primarySelector","secondarySelector","reject","observer","MutationObserver","_","disconnect","observe","childList","subtree","SpinnerService","removeSpinnerOverlay","isPageLoaded","spinnerOverlay","getElementById","removeElement","removePlansSkeletonLoader","skeletonLoader","classList","add","showPlansSkeletonLoader","spinnerService","addAddressHandler","searchNbnProductAddress","bundleService","isExplicitBundleFlow","crossSellService","loadCrossSellProducts","techTypes","tech_type","from","Set","entered_state","entered_suburb","entered_post_code","event_additional_data","alternativeServiceType","tealiumAnalyticService","createAndSendAddressData","trackProductCards","el","console","debug","finally","bundleSearchAddressJson","BundleSearchAddress","bundleSearchAddress","customerProfileHandler","currentPlan","getCurrentPlan","currentNbnPlan","AuthenticationService","authClient","auth0Service","authConfig","getAuthConfigData","saml_login_url","getSamlLoginURL","preLoginRedirectCallback","redirectUrl","getAuth0Client","initialise","getAuthConfiguration","configuration","login","redirectUri","getApiAuthToken","logout","returnRoute","loggedIn","isLoggedIn","user","getAuthenticatedUser","resetInstance","authenticationService","BannerService","getBannerTitle","dataSpa","prefix","spaBanner","spaParams","getDataSpaSearchParams","DataSpaKey","banner","defaultBanner","bundleProductList","getBundleConfig","bundle","toggleBanner","defaultBannerElem","closest","progressIndicatorElem","promoBannerElem","shouldShowPromoBanner","toggleElementDisplay","promotionPage","isPromoBannerValid","promoBanner","footer","imagePath","isPromoValid","display","style","bannerService","BundleService","isNbnMoversBundleFlow","isInternetUpdated","isElectricityUpdated","isGasUpdated","isMobileUpdated","isBundleExplicitlyRequestedByCustomer","isShowAddress","setBundleConfig","bundleConfig","BundleConfig","Map","setBundleConfigProduct","has","savedOptions","getBundleConfigProduct","isCurrentFlowOriginatingFromBridgePage","bridgePageOriginParam","BridgePageOrigin","mapBundleTileItems","bundleTileItems","BundleTileItems","energy","BundleItem","displayItems","nbnCost","mobileCost","hasVoip","hasModem","productName","_j","productDisplayAttributes","itemCount","_m","_l","_k","paymentFrequency","_q","_p","_o","paymentPlanPrice","_t","_s","_r","nbnPrice","Number","_u","price","nonCouponDiscount","getPromotionDiscount","productDiscounts","calculateDiscountedPrice","discountAmount","modem","_x","_w","_v","modemPrice","_y","modemCost","subtotal","_z","existingItem","_0","mobileItem","_3","_2","_1","mobilePrice","_4","productInfo","getBundleDiscountByCategory","category","isCouponDiscount","bundleProducts","discounts","discount","applyTo","description","frequency","Frequency","Monthly","mapMobileProductCatalogueAsCartItem","productDetail","parentCartItemId","customerType","CustomerType","residential","dataAllowance","data_allowance","contractType","contract_type","contractLengthUom","contract_length_uom","contractLengthValue","contract_length_value","Guid","newGuid","toggleStaticContent","selectedCategory","allContentElements","querySelectorAll","getAttribute","dataSpaParamValue","contentCategory","sectionElement","previousSibling","previousElementSibling","contains","validateActiveCategory","firstAvailableCategory","activeCategory","categoryPriorities","none","ConfigService","auth0","returnUrl","host","redirect_uri","domain","saml_client_id","Instance","instance","config","generalContentService","getGeneralContent","generalContent","getPostcodeRange","getWinConfig","isConfigServiceRequest","getHeaders","accessToken","e","CouponCodeService","getFromQueryString","CouponCode","setSessionStorage","resetSessionStorage","setMultipleCouponSessionStorage","coupon","currentSessionStorage","newSessionObject","couponCodeService","CrossSellService","crossSellAvailableByAddress","isBundle","searchRequest","energyRequestMapper","mapToCurrentSearchRequestModel","SearchRequestType","energyProductsResponse","energyProductSearchService","isEnergyAvailable","electricity","gas","setCrossSellFlowAvailableOnAddress","fullAddress","isCrossSellFlowAvailableOnAddress","isCrossSellFlow","bridgePageOrigin","hasAGLFunnelSQ","aglFunnelSQParam","AGLFunnelSQ","removeCrossSellProductCategory","CrossSellProductCategory","CustomerProfileService","CustomerProfile","ErrorReportingService","err","errType","newRelicAvailable","Error","errorAttributes","newrelic","noticeError","FlowService","getFlowDetails","FlowDetails","setFlowDetails","flowDetails","getLastAdded","lastAdded","getActiveCategory","setActiveCategory","getFlowError","setFlowError","newError","setFlowType","flowType","setAddressRequired","addressRequired","getFlowTypeFromStore","isGuidedFlow","isNbnMovers","flowService","ProductService","onSelectedProductForNbn","selectedAddress","eligibilityPath","isValid","errors","trackCheckYourAddressButton","ProductCategoryEnum","Nbn","customerOriginURL","href","selectedProductSessionDataJSON","addressString","guidedFlow","c","SelectedNBNProductDetails","trackPlanSelectionData","locationService","navigateToEligibility","isCampaignPage","onSelectedProductForMobile","selectedProductSessionData","onSelectedMobileProductForChangePlan","productService","setPromoInStore","registeredHandlers","removeAddressHandler","removeTelcoAccountHandler","initProductDetails","customerLocationId","getProductPromise","resetAddressStore","getVoipProducts","voipProductDetails","getModemProducts","modemProductDetails","addressStructured","addressLong","onStoreInit","PageHistory","featureFlags","nbnMoversEnabled","selectedProductString","selectedProductDetails","selectedNbnProduct","isChangingPlan","energyContractString","MobileProductSearchApiService","request","init","getMobileProduct","code","mobileProductSearchApiService","MobileProductService","productSku","mobileProducts","findProduct","prod","productResponse","mobileProductService","AccountApiService","processNbnAcccountsResponse","SPCAccountsFailed","statusText","accountApiService","AccountService","encryptedServiceId","mobileAccountResult","getMobileAccountServices","accounts","account","services","svc","accountService","existingMobileService","getServiceByEncryptedServiceId","serviceCategory","currentMobilePlan","getMobileProductBySku","productId","BundleApiService","bundleSearchPath","authenticatedBundleSearchPath","getBundleProducts","searchModel","status","getAuthenticatedBundleProducts","authService","getTokenSilently","audience","bundleApiService","BundleSearchService","getBundleRequestModel","productCategories","currentSearchRequest","couponCodes","shouldReturnDiscounts","FuelType","Dual","searchResponse","nbnProductLoaded","isTariffUpdate","isRatesPeriodToggleUpdate","saveProductsInStore","nbnProductsResponse","bundleSearchService","getAuthenticatedProducts","contractAddress","loadProductsResponseFromStore","requestModel","productResponseFromStorage","bundleSearchStore","productResponseFromSession","bundleSearchResponse","productStore","BundleSearchStore","setRequestModel","energyResponse","nbnResponse","mobileResponse","mobileProductsResponse","requestDateTime","energyStore","EnergySearchStore","productSearchResponses","productSearchResponse","targetAddressString","addressIndex","selectedTariff","searchRequestType","siteData","isDefaultRate","productWithEstimate","priceEstimates","tariffDescription","getFirstAvailableProductCategory","isAuthenticated","guidedFlowActiveCategoryHandler","handleCategoryChange","guidedFlowActiveCategory","flowTypeHandler","addressRequiredHandler","isAddressChanged","storeAddress","bundleStoreAddress","isBundleLandingPage","firstLoad","localStorageService","setRegion","addressChanged","searchProductAddress","addressInStorage","reload","navigateToProductBundle","manualAddress","bundleProductSearchStore","productsPromise","reasonCode","validatedActiveCategory","removeFlowTypeHandler","removeCartHandler","removeGuidedFlowActiveCategoryHandler","removeAddressRequiredHandler","addressInSessionStorage","flow","pathName","pathname","navigateToProductBundleLanding","initStore","focusSku","hostSpa","BUNDLE_FLOW_ENABLED","NBN_MOVERS_CROSS_SELL_ENABLED","nbn.onStoreInit","mobile.onStoreInit","bundle.onStoreInit","isBundleFlow","WindowMessageType","ErrorMessageService","getErrorMessageData","productCategoryLabel","contactUrl","errorMessageData","errorTitle","errorMessage","contactType","showFooter","icon","buttonLabel","buttonUrl","origin","forceRefresh","errorMessageExtended","secondErrorMessage","buttonOpenNewWindow","messageUrl","messageLinkText","errorMessageService","showNbnSqMessage","nbnProductDetails","isNbnMoversCrossSell","h","renderTechTypeMessage","getTechnologyTypeString","technologyType","type","NbnTechnologyTypeMessage","noService","isLoading","noHfcService","eligibleFibreUpgrade","cheapestEligiblePlan","styledAs","errText","appearance","getContent","replacements","technologyTypeString","replacePlaceholders","nbnMoversTechTypes","validTechType","isMoversFlow","featureFlag","isExistingUser","isNewCustomer","isFibreUpgrade","mismatchedTechTypeMessage","id","getCheapestFibreUpgradePlan","eligiblePlans","fibreUpgrade","sort","p1","p2","selectedAddressString","hasError","sendAnalyticsError","addressSearchCss","AddressSearch","enableLoginCta","isAddressCheck","aemSearchTitle","placeholder","alignment","autoSelectedAddress","isInternetPlansPage","checkValidationError","aglDsAddressSearchRef","addressSearch","inputAddress","focus","checkResponseError","showErrorModal","manualRef","openModal","setAddressValue","addressValue","setTextBoxValue","renderFunc","onAddressChange","validationErrors","isPersonalisedProductsLoading","showValidIcon","checkSiteError","runProductValidators","addressSearchClass","addressSearchLabelId","onManualAddressModalClose","showAddress","class","htmlFor","getNbnMoversSearchTitle","searchTitle","productCategoryText","labelId","ref","addressApiUrl","getValidationText","onAddressSelected","validSelectionMode","showSpinner","onAddressSearchBlur","heading","onAddressConfirm","setAddressString","onAddressCloseAction","manualAddressCloseAction","handleManualAddressEntryModalClosedForCIF","showLoginToMyAccount","clearNbnMoversStoredData","productText","getBoolean","addressBarTitle","addressBarPlaceholder","addressBarAlignment","aemCIFIntegration","webIDForCampaign","mode","previousWebId","loadConfig","prefillAddress","trackPrefillAddress","getNbnAddress","nbnCouponCode","mobileCouponCode","productcategory","sendProductsToAEM","isAddressEntered","addEventListener","selectedProductFromAEM","SelectedProductFromAEM","addressDetailModel","poBoxType","poBoxNumber","trimLeft","manualAddressModalElement","errorModalRef","showModal","defaultAddrNoService","selectedAddrNoService","planCategoriesForAEM","planCategories","productsForAEM","categories","questionResponseMovers","question","forceRefreshPage","render","bannerProgressIndicatorCss","BannerProgressIndicator","parseProductCategory","productCardsCss","ProductCards","mediaQueryList","matchMedia","handleDeviceChange","didRenderFunc","checkRenderPlans","isDefaultProductSearch","filterProducts","focusCardIndex","getFocusCardIndex","isSupportedProductCategory","canRenderPlans","nbnChangePlanService","getPlanCategories","isChangePlanPage","productsForDisplay","mobileChangePlanService","renderNbnMoversCrossSellFibreSubHeading","nbnMoversCrossSell","renderGuidedFlowHeading","renderPlanCategories","renderPromoDialog","promoDialogData","eligibilityCodeModal","crossSell","validateProductCategory","displayBundle","isBundleFlowEnabled","loadFeatureStatus","hideBannerAndFeature","crossSellProductCategory","addListener","isPromoModalOpen","getElementsByClassName","header","featureItems","featureParent","parentElement","disconnectedCallback","removeEventListener","removeListener","supportedProductCategories","ConfigurationError","setToAuto","equaliseSectionHeights","selector","elementArray","height","maxElementHeight","clientHeight","defaultIndex","agl_marketing_price","skuList","selectedPlanCategory","logVersion","log","Host","isOpen","isPromoModalDlsOpen","ProductCardsContainer","dataSpaCouponCode","productCardsEnergyContainerCss","ProductCardsEnergyContainer","componentDidLoad","setProductCategoryChange","dataSpaParams","offerId","className","energyProductSelected","triggerResize","Event","requestAnimationFrame","PromoBanner","getBannerContent","promoBannerDetails","slot","orientation","size","font","bundleBuilderCss","BundleBuilder","onTileClicked","action","setBundleSelection","trackBundleSelectionData","preventDefault","componentWillLoad","sessionStoreProducts","setMobilePlansFromSessionStore","mapBundleTiles","initialiseBundleSelection","on","cartListener","addProductToCartItemListener","removeProductFromCartItemListener","componentDidRender","handleCustomEvents","bundleProductType","scrollToProductCards","lastActiveCategory","retrieveCartResponse","cartWithSessionMobile","storeSelectedMobileProducts","setBundleTileItems","addProductToCartItem","initialiseCartDetails","getBundleDiscount","cartItem","removeProductFromCartItem","_cartItem","elementToScrollTo","offsetTop","getTileTheme","isProductSelected","theme","themeTint","tileTheme","cartFlagsService","CartFlagsService","getMobileProducts","_mobileProduct","_product","_productDetail","productDetailExist","_selectedProductDetail","_mobileProductInCart","cartFlags","getCartFlags","hasEnergy","appComparisonElement","getErrorState","bundleStore","result","getErrorTile","errorDescription","tileId","hoverable","getAuthenticatedEnergyTile","active","fontWeight","getTile","productFound","productTheme","productTint","_6","_5","tileBodyNoProduct","tileBodyProduct","noProduct","energyError","bottomMargin","getPaymentPlanText","toggleEnergyContainer","showContent","energyContainerSectionElem","shouldShowBundleBuilder","sessionAddress","showBundleBuilder","showErrorBoundary","flowTypeError","bundleSummaryCss","BundleSummary","monthlyTotalDiscounts","navigateToNext","selectedMobileProducts","selectedNbnProducts","selectedEnergyProducts","tealiumContext","planNames","sendEvent","ProductCategory","Mobile","product_plan_in_the_cart","planName","plans","planFeatureDisclaimer","title","Energy","navigateToUrl","setCartFlags","getBundleSummary","getEmptyBundleSummary","hasBundleProductCategories","getBundleInfo","buttonText","onClick","monthlyTotalSubText","highlightMonthlyTotalSavings","monthlyTotal","getMonthlyTotal","getAuthDiscounts","monthlyTotalSavings","cartFlag","bundleFlags","getCartFlag","CartFlagType","hasEnergyMobileSimNbnBundle","hasEnergyMobileSimBundle","hasEnergyNbnBundle","hasMobileSimNbnBundle","hasMobileSimOnly","hasNbnOnly","hasEnergyOnly","hasMobileSim","hasNbn","shift","CarbonNeutral","Modem","normaliseDiscountAmount","reduce","previousValue","currentValue","selectedProducts","authenticatedProducts","addBundleFlag","BundleSummaryDiscount","carouselButtonsCss","CarouselButtons","changeVisibility","button","visible","focusInitialCard","focusedCard","hostElement","focusedCardIndex","viewportWidth","clientWidth","carouselScroller","scrollBy","scrollLeft","calculateAndPositionCards","carouselWrapper","containerBounding","width","cardsContainer","cardsContainerWidth","allCards","cardWidth","cardMargin","cardsFit","fitCardsWidth","numberOfCards","cardsContainerMargin","edgeCardVisibleWidth","cardsWidthWithMargins","isSmallDesktopViewPortWidth","marginLeft","marginRight","firstCardFits","lastCardFits","leftButton","rightButton","overlayHeightOffset","overlayHeight","svgWidth","arrowHorizontalOffset","right","marginTop","viewPortWidth","overlayWidth","onScroll","onResize","watchHandler","moveLeft","innerHTML","LeftArrow","moveRight","RightArrow","showPagination","renderPagination","scrollToPageIndex","activePage","targetPage","visibleContainerWidth","hiddenCards","ceil","numberOfPage","paginations","paginationStyle","currentPlanInfoCss","CurrentPlanInfo","isMobileLandingPage","isMobile","renderCurrentNbnPlanInfo","renderCurrentMobilePlanInfo","serviceAddress","planFeature","features","feature","featureDescription","src","mobileServiceNumber","mobileNumber","formatAustralianMobileNumber","ErrorBoundary","setContentBasedOnErrorType","getAssetPath","errorModalCss","ErrorModal","elToBeFocused","aglDsModalRef","closeModal","handleModalClosed","redirectToMovers","getWindowLocationWithoutAddressParam","searchParams","delete","newPath","renderContact","openNewWindow","srContext","renderMessage","renderSecondMessage","hasSecondButton","secondButtonUrl","secondButtonLabel","onModalClosed","secondButtonOpenNewWindow","featuresHighlightCss","FeaturesHighlight","hostRef","elementToRender","infoTagCss","InfoTag","deserialiseContent","txt","createElement","renderContent","loginToAccountCss","LoginToAccount","navigateExistingCustomer","isAuthenticatedFlowEnabled","messageWrapperCss","MessageWrapper","EligibilityValidation","EligibilityValidationSource","EligibilityValidationSourceWithPromoCodeDls","CommonLinks","generalContentCategoryItems","techType","links","link","mobileProductCardCss","MobileProductCard","cardIdPrefix","submitButtonIdPrefix","selectedMobileProductListener","addSelectedProduct","totalProductCount","setProductAsCartItem","earliestAddedProduct","removeSelectedProduct","getProductAltCost","priceVariable","getProductCount","productCount","choosePlanButton","planCardIndex","selectedProductCount","variant","loading","viewBox","fill","xmlns","cx","cy","d","onSelectedProduct","selectedSKU","productDetailsFromSession","differentiatedPricing","eligibilityValidation","eligibilityValidationSource","SignupValidation","Sap","promoModalTriggerElementId","getFeatureIcon","featureIconPath","iconPath","altText","getInCartSku","cartService","inCartNbnProduct","getNbnProducts","inCartSku","anyStripText","stripText","setProperty","innerWidth","categoryItems","numberOfProducts","index","isProductInCart","mobileCardRender","renderContentBelowCards","displayToUser","productHeadline","displayWithoutOfferStrip","getWithoutOfferStrip","padding","elevationType","radius","stripColor","topMargin","role","hidden","unavailableHeading","unavailableContent","bundleOfferPrice","paymentFreq","priceDesc","bundleOfferText","bundleTitle","bundleOfferStrip","withoutOfferPrice","withoutOfferText","desc","featureIcon","movingFibreUpgradeMessageInfoComponentCss","MovingFibreUpgradeMessageInfo","movingHeaderInfoCss","MovingHeaderInfo","isMobileMoversLandingPage","movingAddress","updatedProductSessionData","navigateToMoversEligibility","onButtonClick","navigateToNbnMoving","hasMobile","navigateToMobileMoving","navigateToCart","hasExistingNbn","getContinueButtonText","nbnChangePlanProductCardCss","NbnChangePlanProductCard","hasValidEnergyContract","hasEnergyContract","scrollToTop","featureIconName","iconNameInitial","onChangeButtonClick","onSeePlansButtonClick","comparisonContainer","scrollIntoView","selectedProductPlan","showNbnFaq","isCurrentPlan","buttonType","hasSelectedPlan","nbnCardRender","ctaButtonsRender","bundlePriceDesc","hasHoneymoonOffer","nbnFeaturesHighlightCss","NbnFeaturesHighlight","nbnProductCardCss","NbnProductCard","addressEntered","userPromoModalDls","isPromoModalKey","comparisonContainerClass","panButtonsCss","PanButtonsComponent","autoscrolling","scrollbarWidth","pointsBetweenCards","elClientRect","itemIdPrefix","cardGutter","firstCardTriggerPoint","pointsBetweenCardsTotal","showPanButtons","checkForClosestCardToCenter","moveCards","cardInnerContainer","innerContainerId","wrapper","wrapperId","spaWrapperClientRec","spaWrapperBottom","cardInnerContainerRect","innerHeight","checkCardsCanFitViewPort","cardXPos","getCenter","duration","is.ios","is.safari","scrollToX","minBreakpointToFitCards","mql","matches","selectPanButtons","offsetLeft","isBetween","lowerValue","upperValue","obj","elemX","panel1ScrollLeft","easeInOutQuad","currentTime","startValue","changeInVal","container","to","change","increment","animateScroll","val","renderPanButtons","buttons","planCategoriesCss","PlanCategories","categorySelected","cards","renderedPlans","calculateAndSetDividerWidth","firstCard","dividerWidth","cardsWidth","buttonElement","characterData","selectedCategoryHashChanged","hashValue","hash","getSelectedCategoryByHashValue","decodeURIComponent","selectCategory","encodeURIComponent","history","replaceState","trackPlanCategoriesClick","onhashchange","selectDefaultCategory","storedCategory","unknownCategory","categoryClicked","isSelected","mappedValue","changePlanSku","containerClass","label","optional","defaultValue","pc","selected","telcoFeatureTextCss","TelcoFeatureText","telcoNewPriceTagCss","TelcoNewPriceTag","withBoldDollarAmounts","re","endsWith","parsePrice"],"sources":["./src/app/nbn/models/nbn-products-response.model.ts","./src/app/shared/services/feature/featureApi-service.ts","./src/app/shared/services/feature/feature-service.ts","./src/app/shared/mappers/mapper.ts","./src/app/bundle/store/handlers/cart.handler.ts","./src/app/shared/services/open-api/open-api.service.ts","./src/app/shared/services/cart/cart.service.ts","./src/app/bundle/store/actions/cartActions.ts","./src/app/shared/services/product-session-storage/product-session-storage.service.ts","./src/app/nbn/services/nbn-product/nbn-product.service.ts","./src/app/nbn/services/change-plan/change-plan.service.ts","./src/app/shared/services/delay-message/delay-message.service.ts","./node_modules/is_js/is.js","./src/utils/dom.helper.ts","./src/app/shared/services/spinner/spinner.service.ts","./src/app/nbn/store/handlers/address.handler.ts","./src/app/nbn/store/handlers/customerProfile.handler.ts","./src/app/shared/services/authentication/authentication.service.ts","./src/app/shared/services/banner/banner.service.ts","./src/app/shared/services/bundle/bundle.service.ts","./src/app/shared/services/config/config.service.ts","./src/app/shared/services/coupon-code/coupon-code.service.ts","./src/app/shared/services/cross-sell/cross-sell.service.ts","./src/app/shared/services/customer-profile/customerProfile-service.ts","./src/app/shared/services/error-reporting/error-reporting.service.ts","./src/app/shared/services/flow/flow-service.ts","./src/app/shared/services/productService/product.service.ts","./src/app/shared/utilities/promo.util.ts","./src/app/nbn/store/store.ts","./src/app/mobile/services/mobile-product-search-api/mobile-product-search-api.service.ts","./src/app/mobile/services/mobile-product/mobile-product.service.ts","./src/app/mobile/services/account/account-api.service.ts","./src/app/mobile/services/account/account.service.ts","./src/app/mobile/store/handlers/customerProfile.handler.ts","./src/app/mobile/store/store.ts","./src/app/bundle/services/bundle-api.service.ts","./src/app/bundle/services/bundle-search.service.ts","./src/app/bundle/store/handlers/guidedFlowActiveCategory.handler.ts","./src/app/bundle/store/handlers/flow.type.handler.ts","./src/app/bundle/store/handlers/bundle.address.handler.ts","./src/app/bundle/store/store.ts","./src/app/shared/store/init-store.ts","./src/app/shared/constants/window-message-type.enum.ts","./src/app/shared/services/error-message/error-message.service.ts","./src/app/nbn/components/nbn-technology-type-message/nbn-technology-type-message.tsx","./src/app/shared/components/address-search/address-search.scss?tag=app-address-search","./src/app/shared/components/address-search/address-search.component.tsx","./src/app/shared/components/banner-progress-indicator/banner-progress-indicator.scss?tag=app-banner-progress-indicator","./src/app/shared/components/banner-progress-indicator/banner-progress-indicator.tsx","./src/app/shared/utilities/product-category.util.ts","./src/app/shared/components/product-cards/product-cards.scss?tag=app-product-cards","./src/app/shared/components/product-cards/product-cards.tsx","./src/app/shared/components/product-cards-container/product-cards-container.tsx","./src/app/shared/components/product-cards-container/product-cards-energy-container.scss?tag=app-products-energy-container","./src/app/shared/components/product-cards-container/product-cards-energy-container.tsx","./src/app/shared/components/promo-banner/promo-banner.tsx","./src/app/bundle/components/bundle-builder/bundle-builder.scss?tag=bundle-builder","./src/app/bundle/components/bundle-builder/bundle-builder.component.tsx","./src/app/bundle/components/bundle-summary/bundle-summary.scss?tag=bundle-summary&encapsulation=shadow","./src/app/bundle/components/bundle-summary/bundle-summary.tsx","./src/app/bundle/components/bundle-summary-discount/bundle-summary-discount.tsx","./src/app/shared/components/carousel-buttons/carousel-buttons.scss?tag=carousel-buttons&encapsulation=scoped","./src/app/shared/components/carousel-buttons/carousel-buttons.tsx","./src/app/shared/components/current-plan-info/current-plan-info.scss?tag=current-plan-info&encapsulation=scoped","./src/app/shared/components/current-plan-info/current-plan-info.tsx","./src/app/shared/components/error-boundary/error-boundary.component.tsx","./src/app/shared/components/error-modal/error-modal.scss?tag=error-modal","./src/app/shared/components/error-modal/error-modal.tsx","./src/app/shared/components/features-highlight/features-highlight.scss?tag=features-highlight","./src/app/shared/components/features-highlight/features-highlight.tsx","./src/app/shared/components/info-tag/info-tag.scss?tag=info-tag","./src/app/shared/components/info-tag/info-tag.tsx","./src/app/shared/components/login-to-account/login-to-account.scss?tag=login-to-account","./src/app/shared/components/login-to-account/login-to-account.tsx","./src/app/shared/components/message-wrapper/message-wrapper.scss?tag=message-wrapper","./src/app/shared/components/message-wrapper/message-wrapper.component.tsx","./src/app/shared/constants/common.model.ts","./src/app/shared/components/common-links/common-links.tsx","./src/app/mobile/components/mobile-product-card/mobile-product-card.scss?tag=mobile-product-card&encapsulation=scoped","./src/app/mobile/components/mobile-product-card/mobile-product-card.component.tsx","./src/app/shared/components/moving-fibre-upgrade-message-info/moving-fibre-upgrade-message-info.component.scss?tag=moving-fibre-upgrade-message-info","./src/app/shared/components/moving-fibre-upgrade-message-info/moving-fibre-upgrade-message-info.component.tsx","./src/app/shared/components/moving-header-info/moving-header-info.scss?tag=moving-header-info&encapsulation=scoped","./src/app/shared/components/moving-header-info/moving-header-info.component.tsx","./src/app/nbn/components/nbn-change-plan-product-card/nbn-change-plan-product-card.scss?tag=nbn-change-plan-product-card","./src/app/nbn/components/nbn-change-plan-product-card/nbn-change-plan-product-card.component.tsx","./src/app/nbn/components/nbn-features-highlight/nbn-features-highlight.scss?tag=nbn-features-highlight","./src/app/nbn/components/nbn-features-highlight/nbn-features-highlight.tsx","./src/app/nbn/components/nbn-product-card/nbn-product-card.scss?tag=nbn-product-card","./src/app/nbn/components/nbn-product-card/nbn-product-card.component.tsx","./src/app/shared/components/pan-buttons/pan-buttons.scss?tag=pan-buttons","./src/app/shared/components/pan-buttons/pan-buttons.tsx","./src/app/shared/components/plan-categories/plan-categories.scss?tag=plan-categories&encapsulation=scoped","./src/app/shared/components/plan-categories/plan-categories.tsx","./src/app/shared/components/telco-feature-text/telco-feature-text.scss?tag=telco-feature-text&encapsulation=scoped","./src/app/shared/components/telco-feature-text/telco-feature-text.tsx","./src/app/shared/components/telco-new-price-tag/telco-new-price-tag.scss?tag=telco-new-price-tag&encapsulation=scoped","./src/app/shared/components/telco-new-price-tag/telco-new-price-tag.tsx"],"sourcesContent":["import { AddressDetailModel, ProductsResponse } from 'app/shared/models/index';\r\n\r\nexport interface NbnProductsResponse extends ProductsResponse {\r\n serviceQualification: ServiceQualification;\r\n}\r\n\r\nexport type NbnAddressResponse = NbnAddressSuccessResponse | NbnAddressErrorResponse;\r\n\r\nexport const isNbnAddressSuccessResponse = function (res: NbnAddressResponse): res is NbnAddressSuccessResponse {\r\n return 'addressLong' in res;\r\n};\r\n\r\nexport const isNbnAddressErrorResponse = function (res: NbnAddressResponse): res is NbnAddressErrorResponse {\r\n return !('addressLong' in res);\r\n};\r\n\r\nexport interface NbnAddressSuccessResponse {\r\n addressLong: string;\r\n}\r\n\r\nexport interface NbnAddressErrorResponse {\r\n code?: string;\r\n message?: string;\r\n}\r\n\r\nexport interface ServiceQualification {\r\n nbn: NbnDetails;\r\n}\r\n\r\nexport interface NbnDetails {\r\n serviceQualificationId: string;\r\n result: string;\r\n nbnLocation: NbnLocation[];\r\n serviceType: string;\r\n serviceOrderType: string;\r\n serviceClass: string;\r\n additionalData: any;\r\n alternativeServiceType?: boolean | string;\r\n}\r\n\r\nexport interface NbnLocation {\r\n locationId: string;\r\n addressLong: string;\r\n addressStructured: AddressDetailModel;\r\n}\r\n","import { store } from 'app/shared/store/store';\r\nimport { configService } from 'app/shared/services/config/config.service';\r\nimport { FeatureStatus } from 'app/shared/models/feature-status.model';\r\nimport { FeatureKey } from 'app/shared/models/feature-key';\r\n\r\nclass FeatureApiService {\r\n private apiBaseURL: string;\r\n private apimSubscriptionKey: string;\r\n\r\n private getConfig() {\r\n if (!this.apiBaseURL && !this.apimSubscriptionKey) {\r\n const configData = store.get('configData');\r\n this.apiBaseURL = configData.bffApiUrl;\r\n this.apimSubscriptionKey = configData.bffOcpApimSubscriptionKey;\r\n }\r\n }\r\n\r\n public getFeatureFlagStatus = async (featureKeys: FeatureKey[]): Promise => {\r\n if (featureKeys === null || featureKeys.length === 0) {\r\n throw 'Invalid Argument featureKeys';\r\n }\r\n\r\n this.getConfig();\r\n const httpHeaders = configService.getHttpHeaders();\r\n httpHeaders['Ocp-Apim-Subscription-Key'] = this.apimSubscriptionKey;\r\n\r\n const keys = featureKeys.join(',');\r\n const requestUrl = `${this.apiBaseURL}/feature?keys=${keys}`;\r\n\r\n return await fetch(requestUrl, {\r\n method: 'GET',\r\n headers: httpHeaders\r\n })\r\n .then((response) => {\r\n if (!response.ok) {\r\n // if error occurs, then feature is disabled by default\r\n return null;\r\n }\r\n return response.json();\r\n })\r\n .then((data) => {\r\n const featureStatus = {};\r\n for (const [key, value] of Object.entries(data)) {\r\n featureStatus[key as FeatureKey] = value as boolean;\r\n }\r\n\r\n return featureStatus;\r\n })\r\n .catch(() => {\r\n // if error occurs, then feature is disabled by default\r\n return null;\r\n });\r\n };\r\n}\r\n\r\nexport const featureApiService = new FeatureApiService();\r\n","import { store } from 'app/shared/store/store';\r\nimport { featureApiService } from 'app/shared/services/feature/featureApi-service';\r\nimport { FeatureStatus } from 'app/shared/models/feature-status.model';\r\nimport { FeatureKey } from 'app/shared/models/feature-key';\r\n\r\nclass FeatureService {\r\n public getFeatureStatus(key: FeatureKey): boolean {\r\n const featureFlagStatus: FeatureStatus = store.get('featureStatus') || {};\r\n return featureFlagStatus[key] || false;\r\n }\r\n\r\n public async loadFeatureStatus(key: FeatureKey): Promise {\r\n let featureFlagStatus: FeatureStatus = store.get('featureStatus') || {};\r\n\r\n // Check if key is 'undefined'. Don't use '!featureFlagStatus[key]' as if value is 'false' then it will invoke API search\r\n if (featureFlagStatus[key] === undefined) {\r\n featureFlagStatus = await this.loadFeaturesStatus([key]);\r\n }\r\n\r\n return featureFlagStatus && featureFlagStatus[key];\r\n }\r\n\r\n public async loadFeaturesStatus(featureKeys: FeatureKey[]): Promise {\r\n if (featureKeys === null || featureKeys.length === 0) {\r\n throw 'Invalid Argument featureKeys';\r\n }\r\n\r\n // Load requested feature flags\r\n const featureStatus = await this.getFeatureFlagStatus(featureKeys);\r\n\r\n // Update Store with Feature Flags status\r\n const existingFeatureStatus = store.get('featureStatus') || {};\r\n const combinedFeatureStatus = Object.assign(existingFeatureStatus, featureStatus);\r\n store.set('featureStatus', combinedFeatureStatus);\r\n\r\n // Return status for requested feature flags\r\n return featureStatus;\r\n }\r\n\r\n private async getFeatureFlagStatus(featureKeys: FeatureKey[]): Promise {\r\n return await featureApiService.getFeatureFlagStatus(featureKeys);\r\n }\r\n}\r\n\r\nexport const featureService = new FeatureService();\r\n","import { AddressDetailModel } from 'app/shared/models/address/address.model';\r\nimport { ProductSearchRequestModel } from 'app/shared/models/productSearchRequestModel';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { store } from 'app/shared/store/store';\r\n\r\nclass Mapper {\r\n public mapProductSearchRequestModel(address: AddressDetailModel): ProductSearchRequestModel {\r\n if (!address) {\r\n return null;\r\n }\r\n const productSearchRequestModel = new ProductSearchRequestModel();\r\n productSearchRequestModel.floorNumber = address.floor ? address.floor : null;\r\n productSearchRequestModel.unitNumber = address.unitNumber ? address.unitNumber : null;\r\n productSearchRequestModel.streetNumber = address.streetNumber ? address.streetNumber : null;\r\n productSearchRequestModel.streetName = address.streetName ? address.streetName : null;\r\n productSearchRequestModel.streetType = address.streetType ? address.streetType : null;\r\n productSearchRequestModel.streetTypeSuffix = address.streetTypeSuffix ? address.streetTypeSuffix : null;\r\n productSearchRequestModel.suburb = address.suburb ? address.suburb : null;\r\n productSearchRequestModel.state = address.state;\r\n productSearchRequestModel.postcode = address.postcode;\r\n productSearchRequestModel.latitude = address.latitude;\r\n productSearchRequestModel.longitude = address.longitude;\r\n productSearchRequestModel.deliveryPointId = address.deliveryPointIdentifier;\r\n productSearchRequestModel.webCampaignId = store.get(StoreKeys.webId) ? store.get(StoreKeys.webId) : null;\r\n return productSearchRequestModel;\r\n }\r\n}\r\n\r\nexport const mapper = new Mapper();\r\n","import { FuelTypes, RetrieveCartItem, RetrieveCartResponse } from '@aglenergy/shared-library';\r\nimport { ObservableMap } from '@stencil/store';\r\nimport { removeHandler } from 'app/shared/store/handlers/types/remove-handler';\r\nimport { State } from 'app/shared/store/models/state.model';\r\n\r\nconst dispatchCartLoadedEvent = (cartResponse: RetrieveCartResponse): void => {\r\n if (cartResponse?.cartItems?.length) {\r\n const itemIds: string[] = [];\r\n cartResponse.cartItems.forEach((item: RetrieveCartItem): void => {\r\n const itemFuelType: FuelTypes = item.additionalData?.productQualification?.fuelType;\r\n if (itemFuelType === FuelTypes.ELECTRICITY || itemFuelType === FuelTypes.DUAL) {\r\n itemIds[0] = item.sku;\r\n }\r\n if (itemFuelType === FuelTypes.GAS || itemFuelType === FuelTypes.DUAL) {\r\n itemIds[1] = item.sku;\r\n }\r\n });\r\n\r\n if (!itemIds.length) {\r\n return;\r\n }\r\n const elem = document.querySelector('#app-comparison');\r\n if (!elem) {\r\n return;\r\n }\r\n const event = new CustomEvent('cartLoaded', { detail: `{\"itemIds\": \"${itemIds}\"}` });\r\n elem.dispatchEvent(event);\r\n }\r\n};\r\n\r\nexport const dispatchResetCartEvent = (): void => {\r\n const elem = document.querySelector('#app-comparison');\r\n if (elem) {\r\n elem.dispatchEvent(new CustomEvent('cartLoaded', { detail: '{\"offerId\": \"\"}' }));\r\n }\r\n};\r\n\r\nexport const cartHandler = (store: ObservableMap): removeHandler => {\r\n return store.onChange('cart', (cartDetails) => {\r\n dispatchCartLoadedEvent(cartDetails);\r\n });\r\n};\r\n","import { OpenAPI, RequestHeaders, SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { configService } from 'app/shared/services/config/config.service';\r\n\r\nclass OpenApiService {\r\n public composeHttpHeaders(contentMode?: string): Record {\r\n let requestHeaders: Record = {\r\n 'Ocp-Apim-Subscription-Key': configService.getConfigData().bffOcpApimSubscriptionKey\r\n };\r\n\r\n if (contentMode) {\r\n requestHeaders = {\r\n ...requestHeaders,\r\n 'Content-Mode': contentMode\r\n };\r\n }\r\n\r\n this.setAuthAccessToken();\r\n OpenAPI.HEADERS = RequestHeaders.compose(requestHeaders);\r\n return OpenAPI.HEADERS;\r\n }\r\n\r\n public setBaseUrl(): void {\r\n OpenAPI.BASE = configService.getConfigData().bffApiUrl;\r\n }\r\n\r\n private setAuthAccessToken(): void {\r\n const token = sessionStorage.getItem(SessionStorageKeys.AccessToken);\r\n if (token) {\r\n OpenAPI.TOKEN = token;\r\n }\r\n }\r\n}\r\n\r\nexport const openApiService = new OpenApiService();\r\n","import { CartIdResponse, CartService, CartUtils, RetrieveCartResponse, SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport Cookies from 'js-cookie';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { store } from 'app/shared/store/store';\r\nimport { isLocalDevelopment } from 'app/shared/utilities/helper-functions';\r\nimport { openApiService } from 'app/shared/services/open-api/open-api.service';\r\n\r\nconst composeHttpHeaders = (): void => {\r\n openApiService.composeHttpHeaders();\r\n};\r\n\r\nconst removeCookie = (): void => {\r\n if (!isLocalDevelopment()) {\r\n Cookies.remove(SessionStorageKeys.cartId, { path: '/' });\r\n }\r\n};\r\n\r\nexport const removeItemFromCart = async (cartId: string, itemId: string): Promise => {\r\n return await CartService.deleteCart(cartId, parseInt(itemId, 10));\r\n};\r\n\r\nexport const retrieveCart = async (): Promise => {\r\n const cartId = Cookies.get('cartId');\r\n if (!cartId) {\r\n return Promise.resolve(null);\r\n }\r\n composeHttpHeaders();\r\n return await CartService.retrieveCart(cartId)\r\n .then((cartResponse) => {\r\n if (CartUtils.cartIsExpired(cartResponse)) {\r\n removeCookie();\r\n return null;\r\n }\r\n return cartResponse;\r\n })\r\n .catch(() => {\r\n removeCookie();\r\n return Promise.resolve(null);\r\n });\r\n};\r\n\r\nexport const abandonCart = (): void => {\r\n Cookies.remove('cartId');\r\n store.set(StoreKeys.cart, null);\r\n sessionStorage.removeItem('cart');\r\n};\r\n","import { CartResponse, SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { store } from 'app/shared/store/store';\r\nimport { dispatchResetCartEvent } from 'app/bundle/store/handlers/cart.handler';\r\nimport { ResponseError } from 'app/shared/models/response-error.error';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { abandonCart, removeItemFromCart, retrieveCart } from 'app/shared/services/cart/cart.service';\r\nimport { getAddressFromCart, isSameAddress } from 'app/shared/utilities/address.util';\r\nimport { mapper } from 'app/shared/mappers/mapper';\r\n\r\nexport const onGuidedFlowLoad = async (): Promise => {\r\n const cart = await retrieveCart();\r\n if (cart) {\r\n storeCartResponse(cart);\r\n }\r\n};\r\n\r\nexport const onRemoveCartItem = async (sku: string): Promise => {\r\n const cartDetails = store.get(StoreKeys.cart);\r\n const item = cartDetails.cartItems.find((x) => x.sku === sku);\r\n store.set('skuBeingRemoved', sku);\r\n try {\r\n await removeItemFromCart(cartDetails.cartId, item.cartItemId);\r\n store.set('retrieveTriggeredFromRemove', true);\r\n const cart = await retrieveCart();\r\n store.set('skuBeingRemoved', '');\r\n storeCartResponse(cart);\r\n setTimeout(async () => {\r\n //Forces the product cards to resync heights\r\n await (document.getElementsByTagName('app-product-cards')[0] as any)?.equaliseHeights();\r\n }, 20);\r\n } catch (ex) {\r\n store.set(StoreKeys.responseError, new ResponseError('error removing item from cart'));\r\n }\r\n};\r\n\r\nexport const clearCart = async (): Promise => {\r\n // remove all cart items when clicking on the minus button to remove the last mobile plan item (which is also the last item in cart)\r\n const cartDetails = store.get(StoreKeys.cart);\r\n try {\r\n // remove all (mobile) items in parallel, and set loading state on button for all mobile plan cards\r\n if (cartDetails?.cartItems?.length > 0) {\r\n store.set('skuBeingRemoved', 'clearCart');\r\n await Promise.all(\r\n cartDetails?.cartItems?.map((item) => {\r\n return removeItemFromCart(cartDetails.cartId, item.cartItemId);\r\n })\r\n );\r\n abandonCart();\r\n store.set('skuBeingRemoved', '');\r\n }\r\n } catch (ex) {\r\n store.set('skuBeingRemoved', '');\r\n store.set(StoreKeys.responseError, new ResponseError('error clearing cart'));\r\n }\r\n};\r\n\r\nexport const storeCartResponse = (cart: CartResponse): void => {\r\n // Compare request address and cart address\r\n const requestAddress = store.get('address');\r\n const cartAddress = getAddressFromCart(cart);\r\n const isAddressSame = isSameAddress(\r\n mapper.mapProductSearchRequestModel(requestAddress),\r\n mapper.mapProductSearchRequestModel(cartAddress)\r\n );\r\n\r\n // Abandon cart if addresses are different\r\n if (requestAddress && cartAddress && !isAddressSame) {\r\n abandonCart();\r\n dispatchResetCartEvent();\r\n } else {\r\n store.set(StoreKeys.cart, cart);\r\n window.sessionStorage.setItem(SessionStorageKeys.cart, JSON.stringify(cart));\r\n }\r\n};\r\n","import { SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { store } from 'app/shared/store/store';\r\nimport { addressService } from 'app/shared/services/address/address.service';\r\nimport { featureService } from 'app/shared/services/feature/feature-service';\r\nimport { AddressDetailModel } from 'app/shared/models/address/address.model';\r\nimport { FeatureKey } from 'app/shared/models/feature-key';\r\nimport { ProductCategory } from 'app/shared/models/product-category.model';\r\nimport { ProductSessionData, SelectedProductSessionData } from 'app/shared/models/sessionData';\r\nimport { ProductsResponse } from 'app/shared/models/product-response.model';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { clearCart } from 'app/bundle/store/actions/cartActions';\r\n\r\nclass ProductsSessionStorageService {\r\n private getAllProducts(): ProductSessionData[] {\r\n return JSON.parse(sessionStorage.getItem(SessionStorageKeys.ProductDetailsSession));\r\n }\r\n\r\n private saveProducts(products: ProductSessionData[]): void {\r\n if (products?.length > 0) {\r\n window.sessionStorage.setItem(SessionStorageKeys.ProductDetailsSession, JSON.stringify(products));\r\n }\r\n }\r\n\r\n public saveMobileProducts(products: SelectedProductSessionData): void {\r\n if (products) {\r\n window.sessionStorage.setItem(SessionStorageKeys.SelectedMobileProductDetails, JSON.stringify(products));\r\n store.set(StoreKeys.selectedMobileProductDetails, products);\r\n\r\n // Trigger clearCart when removing the last mobile plan item (which is also the last item in cart)\r\n const cartDetails = store.get(StoreKeys.cart);\r\n const removingLastMobileItem = !products?.productDetails || products?.productDetails?.length === 0;\r\n const isOnlyMobileInCart = !cartDetails?.cartItems?.find(\r\n (item) => item.additionalData?.productCategory?.toLowerCase() !== 'mobile plan'\r\n );\r\n if (removingLastMobileItem && isOnlyMobileInCart) {\r\n clearCart();\r\n }\r\n }\r\n }\r\n\r\n private buildCacheKey(address?: AddressDetailModel): string {\r\n return `${address ? addressService.convertAddressToString(address) : 'default'}`;\r\n }\r\n\r\n private setProducts(response: any, productCategory: ProductCategory, address?: AddressDetailModel | string): void {\r\n const couponCodeInRequest = store.get('couponCode') ?? null;\r\n const sessionObject: ProductSessionData = {\r\n requestType: address ? 'address' : 'default',\r\n requestCouponCode: couponCodeInRequest,\r\n key: typeof address === 'string' ? address : this.buildCacheKey(address),\r\n productCategory,\r\n response,\r\n address: typeof address === 'string' ? null : address,\r\n webCampaignId: store.get(StoreKeys.webId)\r\n };\r\n\r\n const allProducts = this.getAllProducts();\r\n let newAllProducts;\r\n if (!allProducts) {\r\n newAllProducts = [sessionObject];\r\n } else if (address) {\r\n newAllProducts = [sessionObject, ...allProducts];\r\n } else {\r\n // Add default products to end of the array\r\n newAllProducts = [...allProducts, sessionObject];\r\n }\r\n\r\n this.saveProducts(newAllProducts);\r\n }\r\n\r\n public upsertProducts(response: any, productCategory: ProductCategory, address?: AddressDetailModel | string): void {\r\n const products = this.getAllProducts();\r\n const key = typeof address === 'string' ? address : this.buildCacheKey(address);\r\n const productIndex = products?.findIndex((p) => p.key === key);\r\n\r\n if (products && productIndex !== -1) {\r\n // remove element and add to start of array\r\n const productSessionData = products.splice(productIndex, 1)[0];\r\n products.unshift(productSessionData);\r\n this.saveProducts(products);\r\n } else {\r\n this.setProducts(response, productCategory, address);\r\n }\r\n }\r\n\r\n public getLatestProductsByProductCategory(productCategory: ProductCategory): ProductSessionData {\r\n return this.getAllProducts()?.find((x) => x.productCategory === productCategory) ?? null;\r\n }\r\n\r\n public getLatestProducts(\r\n productCategory: ProductCategory,\r\n address?: AddressDetailModel\r\n ): ProductSessionData {\r\n const key = this.buildCacheKey(address);\r\n let storageProductSessionData = this.getAllProducts()?.find((x) => x.productCategory === productCategory && x.key === key) ?? null;\r\n const couponCodeInRequest = store.get('couponCode') ?? null;\r\n const couponCodeInCache = storageProductSessionData?.requestCouponCode ?? null;\r\n const isNbnMoversFlow =\r\n sessionStorage.getItem('appConfig') === 'movers' && featureService.getFeatureStatus(FeatureKey.NBN_MOVERS_ENABLED);\r\n // When couponCode has changed, clear products cache\r\n if (couponCodeInRequest !== couponCodeInCache || (isNbnMoversFlow && productCategory !== 'mobile plan')) {\r\n storageProductSessionData = null;\r\n sessionStorage.removeItem(SessionStorageKeys.ProductDetailsSession);\r\n }\r\n return storageProductSessionData;\r\n }\r\n\r\n public getNbnProductsByLocationId(locationId: string) {\r\n return (\r\n this.getAllProducts()?.find(\r\n (x) =>\r\n x.key === locationId ||\r\n (x.productCategory === 'nbn' && x.response.serviceQualification?.nbn.nbnLocation[0]?.locationId === locationId)\r\n ) ?? null\r\n );\r\n }\r\n\r\n public getLatestWebIdFromProducts(): string {\r\n const products: ProductSessionData[] = JSON.parse(sessionStorage.getItem(SessionStorageKeys.ProductDetailsSession));\r\n if (products?.length) {\r\n return products[0]?.webCampaignId;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n public removeProducts(): void {\r\n sessionStorage.removeItem(SessionStorageKeys.ProductDetailsSession);\r\n }\r\n}\r\n\r\nexport const productsSessionStorageService = new ProductsSessionStorageService();\r\n","import { AddressDetailModel } from '@aglenergy/design-system/dist/collection/components/composite/addresssearch/address.model';\r\nimport { SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { store } from 'app/shared/store/store';\r\nimport { nbnProductSearchApiService } from 'app/nbn/services/nbn-product-search-api/nbn-product-search-api.service';\r\nimport { NbnProductsResponse } from 'app/nbn/models/nbn-products-response.model';\r\nimport {\r\n NbnServiceabilityFail,\r\n ProductCatalogueProduct,\r\n ProductCategory,\r\n ProductSearchRequestModel,\r\n ProductsResponse,\r\n ReportErrorType,\r\n ResponseError\r\n} from 'app/shared/models/index';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { addressService } from 'app/shared/services/address/address.service';\r\nimport { errorReportingService } from 'app/shared/services/error-reporting/error-reporting.service';\r\nimport { mapper } from 'app/shared/mappers/mapper';\r\nimport { productsSessionStorageService } from 'app/shared/services/product-session-storage/product-session-storage.service';\r\n\r\nclass NbnProductService {\r\n private productCategory: ProductCategory = 'nbn';\r\n private modemProductName = 'AGL supplied modem';\r\n\r\n private getProductSearchRequest(address?: AddressDetailModel): ProductSearchRequestModel {\r\n const couponCode = store.get('couponCode') ?? null;\r\n if (address) {\r\n const productSearchRequest = mapper.mapProductSearchRequestModel(address);\r\n if (couponCode) {\r\n productSearchRequest.couponCode = couponCode;\r\n }\r\n return productSearchRequest;\r\n }\r\n\r\n const defaultProductSearchRequest: ProductSearchRequestModel = {\r\n couponCode,\r\n webCampaignId: store.get(StoreKeys.webId) ?? null,\r\n state: 'All'\r\n };\r\n return defaultProductSearchRequest;\r\n }\r\n\r\n private async getDefaultProducts(): Promise {\r\n const storageProductSessionData = productsSessionStorageService.getLatestProducts(this.productCategory);\r\n\r\n if (!storageProductSessionData) {\r\n return await nbnProductSearchApiService.getProducts(this.getProductSearchRequest()).then((response) => {\r\n if (this.IsNBNAvailable(response)) {\r\n productsSessionStorageService.upsertProducts(response, this.productCategory);\r\n return response;\r\n }\r\n });\r\n }\r\n return storageProductSessionData.response;\r\n }\r\n\r\n private async getProductsByAddress(address: AddressDetailModel): Promise {\r\n if (store.get(StoreKeys.aemCIFIntegrationEnabled) && addressService.convertAddressToString(address)?.length > 0) {\r\n window.postMessage(\r\n {\r\n eventType: 'address-validation-status',\r\n spaCategory: store.get('productCategory'),\r\n eventData: {\r\n addressValidation: 'started',\r\n isAddressPresent: addressService.convertAddressToString(store.get('address'))?.length > 0\r\n }\r\n },\r\n '*'\r\n );\r\n }\r\n // Get response from Storage\r\n const storageProductSessionData = productsSessionStorageService.getLatestProducts(this.productCategory, address);\r\n\r\n // Existing response in Storage\r\n if (storageProductSessionData) {\r\n productsSessionStorageService.upsertProducts(\r\n storageProductSessionData.response,\r\n storageProductSessionData.productCategory,\r\n storageProductSessionData.address\r\n );\r\n return storageProductSessionData.response;\r\n }\r\n\r\n // New address\r\n return await nbnProductSearchApiService.getProducts(this.getProductSearchRequest(address)).then((response) => {\r\n const isNbnAvailable = this.IsNBNAvailable(response);\r\n if (isNbnAvailable) {\r\n productsSessionStorageService.upsertProducts(response, this.productCategory, address);\r\n return response;\r\n }\r\n });\r\n }\r\n\r\n private IsProductAvailable(productDetails: ProductsResponse, productCategory: ProductCategory): boolean {\r\n const modemProduct =\r\n productCategory === 'modem' &&\r\n productDetails?.products?.find((item) => item.name.toLowerCase().includes(this.modemProductName.toLowerCase()));\r\n\r\n if (\r\n productDetails.siteError ||\r\n !productDetails?.products?.length ||\r\n (productCategory === 'modem' && (!modemProduct || modemProduct.attributes['agl_marketing_price'] === undefined))\r\n ) {\r\n throw new ResponseError(`${productCategory.toUpperCase()} not available.`, 'serviceNotAvailable');\r\n }\r\n return true;\r\n }\r\n\r\n private isHfcClass(serviceClass: string, serviceType: string): boolean {\r\n const hfcClasses = ['20'];\r\n return hfcClasses.some((item) => item === serviceClass) && serviceType === 'HFC';\r\n }\r\n\r\n private hasNoQualifiedService(productDetails: NbnProductsResponse): boolean {\r\n if (productDetails.serviceQualification) {\r\n return !productDetails.products?.some((product) => {\r\n return product.content && product.qualified;\r\n });\r\n }\r\n return false;\r\n }\r\n\r\n public IsNBNAvailable(productDetails: NbnProductsResponse): boolean {\r\n if (!productDetails) {\r\n return false;\r\n }\r\n if (this.hasNoService(productDetails)) {\r\n errorReportingService.logError(NbnServiceabilityFail.serviceTypeUnavailableSatellite, ReportErrorType.NbnServiceabilityFailed);\r\n throw new ResponseError('Service type is unavailable.', 'serviceNotAvailable');\r\n }\r\n\r\n if (this.hasNoQualifiedService(productDetails)) {\r\n errorReportingService.logError(NbnServiceabilityFail.addressUnserviceable, ReportErrorType.NbnServiceabilityFailed);\r\n throw new ResponseError('NBN not available.', 'serviceNotAvailable');\r\n }\r\n\r\n // This feature flag is added to disable HFC-specific error message. To get it back, just remove the feature flag.\r\n const featureFlagHfcError = false;\r\n if (productDetails.siteError) {\r\n if (\r\n featureFlagHfcError &&\r\n this.isHfcClass(productDetails.serviceQualification?.nbn?.serviceClass, productDetails.serviceQualification?.nbn?.serviceType)\r\n ) {\r\n throw new ResponseError('NBN not available.', 'hfcServiceNotAvailable');\r\n }\r\n throw new ResponseError('NBN not available.', 'serviceNotAvailable');\r\n }\r\n return true;\r\n }\r\n\r\n public hasNoService(productDetails: NbnProductsResponse): boolean {\r\n if (productDetails?.serviceQualification?.nbn?.serviceType?.toLowerCase() === 'satellite') {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n public async getProducts(address?: AddressDetailModel): Promise {\r\n if (address) {\r\n return await this.getProductsByAddress(address);\r\n }\r\n return await this.getDefaultProducts();\r\n }\r\n\r\n public async getProductsByLocationId(locationId: string): Promise {\r\n // Get response from Storage\r\n const storageProductSessionData = productsSessionStorageService.getNbnProductsByLocationId(locationId);\r\n\r\n // Existing response in Storage\r\n if (storageProductSessionData) {\r\n productsSessionStorageService.upsertProducts(\r\n storageProductSessionData.response,\r\n storageProductSessionData.productCategory,\r\n storageProductSessionData.address\r\n );\r\n return storageProductSessionData.response;\r\n }\r\n\r\n // New address\r\n return await nbnProductSearchApiService.getProductsByLocationId(locationId).then((response) => {\r\n const isNbnAvailable = this.IsNBNAvailable(response);\r\n if (isNbnAvailable) {\r\n productsSessionStorageService.upsertProducts(response, this.productCategory, locationId);\r\n return response;\r\n }\r\n });\r\n }\r\n\r\n public async getVoipProducts(state?: string): Promise {\r\n const storageProductSessionData = sessionStorage.getItem(SessionStorageKeys.VoipProductDetailsSession);\r\n\r\n if (!storageProductSessionData) {\r\n if (!state) {\r\n state = 'All';\r\n }\r\n return await nbnProductSearchApiService.getVoipProduct(state).then((response) => {\r\n if (this.IsProductAvailable(response, 'voip')) {\r\n sessionStorage.setItem(SessionStorageKeys.VoipProductDetailsSession, JSON.stringify(response));\r\n return response;\r\n }\r\n });\r\n }\r\n return await JSON.parse(storageProductSessionData);\r\n }\r\n\r\n public async getModemProducts(state?: string): Promise {\r\n const storageProductSessionData = sessionStorage.getItem(SessionStorageKeys.ModemProductDetailsSession);\r\n\r\n if (!storageProductSessionData) {\r\n if (!state) {\r\n state = 'All';\r\n }\r\n return await nbnProductSearchApiService.getModemProduct(state).then((response) => {\r\n if (this.IsProductAvailable(response, 'modem')) {\r\n sessionStorage.setItem(SessionStorageKeys.ModemProductDetailsSession, JSON.stringify(response));\r\n return response;\r\n }\r\n });\r\n }\r\n return await JSON.parse(storageProductSessionData);\r\n }\r\n\r\n public getValidProduct(productCategory: ProductCategory, productDetails: ProductsResponse): ProductCatalogueProduct {\r\n switch (productCategory) {\r\n case 'voip':\r\n return productDetails?.products[0];\r\n case 'modem':\r\n return productDetails?.products?.find((item) => item.name.toLowerCase() === this.modemProductName.toLowerCase());\r\n default:\r\n break;\r\n }\r\n return null;\r\n }\r\n\r\n public isServiceNotAvailable = (responseError: ResponseError): boolean => {\r\n return responseError?.errorType === 'serviceNotAvailable' || responseError?.errorType === 'multipleMatching';\r\n };\r\n\r\n public isHfcServiceNotAvailable = (responseError: ResponseError): boolean => {\r\n return responseError?.errorType === 'hfcServiceNotAvailable';\r\n };\r\n}\r\n\r\nexport const nbnProductService = new NbnProductService();\r\n","import { store } from 'app/shared/store/store';\r\nimport { nbnProductSearchApiService } from 'app/nbn/services/nbn-product-search-api/nbn-product-search-api.service';\r\nimport { ProductCatalogueProduct } from 'app/shared/models/product-catalogue-product.model';\r\nimport { QueryStringParamName } from 'app/shared/models/common.enums';\r\nimport { SelectedProductSessionData } from 'app/shared/models/sessionData';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { accountContractService } from 'app/energy/services/account-contracts.service';\r\nimport { customerProfileService } from 'app/shared/services/customer-profile/customerProfile-service';\r\n\r\nclass ChangePlanService {\r\n public isChangePlan(): boolean {\r\n const urlParams = new URLSearchParams(window.location.search);\r\n const isChangePlan = urlParams.get(QueryStringParamName.IsChangePlan);\r\n const currentPlanSku = this.getCurrentPlanSku();\r\n\r\n if (isChangePlan && isChangePlan.toLowerCase().startsWith('true') && currentPlanSku?.length > 0) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public getCurrentPlanSku(): string {\r\n const customerProfile = customerProfileService.getCustomerProfile();\r\n return customerProfile.existingNbnProductId;\r\n }\r\n\r\n public async getCurrentPlan(): Promise {\r\n const currentPlanSku = this.getCurrentPlanSku();\r\n if (currentPlanSku?.length > 0) return await nbnProductSearchApiService.getNbnProduct(currentPlanSku);\r\n return null;\r\n }\r\n\r\n public async hasEnergyContract(): Promise {\r\n const customerProfile = customerProfileService.getCustomerProfile();\r\n if (customerProfile != null && customerProfile.hasExistingEnergy !== undefined) {\r\n return customerProfile.hasExistingEnergy;\r\n }\r\n\r\n let contractData = store.get('contractsData');\r\n if (contractData == null || contractData.customerData?.contractsResponse?.contracts?.length == 0) {\r\n const contractResult = await accountContractService.getEnergyContract();\r\n if (contractResult) {\r\n store.set('contractsData', contractResult);\r\n }\r\n }\r\n\r\n contractData = store.get('contractsData');\r\n if (contractData) {\r\n const hasExistingEnergy = contractData.customerData?.contractsResponse?.contracts?.length > 0;\r\n if (customerProfile !== null) {\r\n // update the customer profile in the session storage key if customer profile already in session storage.\r\n customerProfile.hasExistingEnergy = hasExistingEnergy;\r\n customerProfileService.setCustomerProfile(customerProfile);\r\n }\r\n return hasExistingEnergy;\r\n }\r\n return false;\r\n }\r\n\r\n public getLocationIdFromSelectedProduct(): string {\r\n const selectedProduct: SelectedProductSessionData = store.get(StoreKeys.selectedNbnProductDetails);\r\n\r\n if (selectedProduct) {\r\n if (Array.isArray(selectedProduct.productDetails) && selectedProduct.productDetails.length == 1)\r\n return selectedProduct.productDetails[0]?.serviceQualification?.nbn?.nbnLocation[0]?.locationId;\r\n\r\n return (selectedProduct.productDetails as any)?.serviceQualification?.nbn?.nbnLocation[0]?.locationId;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n public getSelectedProductSku(): string | null {\r\n const selectedProduct: SelectedProductSessionData | null = store.get(StoreKeys.selectedNbnProductDetails);\r\n if (selectedProduct) {\r\n if (Array.isArray(selectedProduct.productDetails)) return selectedProduct.productDetails[0]?.product?.sku;\r\n return (selectedProduct.productDetails as any)?.product?.sku;\r\n }\r\n return null;\r\n }\r\n\r\n public clearSelectedProduct(): void {\r\n store.set(StoreKeys.selectedNbnProductDetails, null);\r\n }\r\n\r\n public getChangePlanProductsForDisplay(\r\n sqProducts: ProductCatalogueProduct[],\r\n filteredProducts: ProductCatalogueProduct[]\r\n ): ProductCatalogueProduct[] {\r\n // get the current plan product first\r\n let displayedProducts: ProductCatalogueProduct[] = [];\r\n const currentPlanSku = this.getCurrentPlanSku();\r\n\r\n // https://aglenergy.atlassian.net/browse/TEC-26252: changes to remove the current plan\r\n // from IPP page as per design due to incorrect pricing. Commented following code\r\n // until future notice.\r\n // const currentPlanProduct = sqProducts.find((p) => p.sku === currentPlanSku);\r\n // if (currentPlanProduct) {\r\n // displayedProducts.push(currentPlanProduct);\r\n // }\r\n\r\n const selectedProductSku = this.getSelectedProductSku();\r\n if (selectedProductSku && selectedProductSku.length > 0 && selectedProductSku !== currentPlanSku) {\r\n displayedProducts.push(sqProducts.find((p) => p.sku === selectedProductSku));\r\n } else {\r\n displayedProducts = [...displayedProducts, ...filteredProducts.filter((p) => p.sku !== currentPlanSku)];\r\n }\r\n\r\n return displayedProducts;\r\n }\r\n}\r\n\r\nexport const changePlanService = new ChangePlanService();\r\n","import { store } from 'app/shared/store/store';\r\nimport { DelayMessageTimer } from 'app/shared/models/delay-message-timer';\r\n\r\nclass DelayMessageService {\r\n private timers: DelayMessageTimer[] = null;\r\n\r\n constructor() {\r\n this.timers = [\r\n {\r\n timer: null,\r\n timeout: 15000,\r\n message: 'Things are taking a little longer than expected, please wait.'\r\n },\r\n {\r\n timer: null,\r\n timeout: 60000,\r\n message: `We're still searching - it can take a couple of minutes, please wait.`\r\n }\r\n ];\r\n }\r\n public startAllTimers(): void {\r\n this.timers.forEach((item) => {\r\n item.timer = this.startTimer(item.message, item.timeout);\r\n });\r\n }\r\n\r\n public stopAllTimers(): void {\r\n this.timers.forEach((item) => {\r\n this.stopTimer(item.timer);\r\n item.timer = null;\r\n });\r\n }\r\n\r\n public startTimer(delayMessage: string, timeout: number): NodeJS.Timeout {\r\n return setTimeout(() => {\r\n store.set('delayMessage', delayMessage);\r\n }, timeout);\r\n }\r\n\r\n public stopTimer(timer: NodeJS.Timeout): void {\r\n store.set('delayMessage', null);\r\n if (timer) {\r\n clearTimeout(timer);\r\n }\r\n }\r\n}\r\n\r\nexport const delayMessageService = new DelayMessageService();\r\n","/*!\n * is.js 0.8.0\n * Author: Aras Atasaygin\n */\n\n// AMD with global, Node, or global\n;(function(root, factory) { // eslint-disable-line no-extra-semi\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(function() {\n // Also create a global in case some scripts\n // that are loaded still are looking for\n // a global even when an AMD loader is in use.\n return (root.is = factory());\n });\n } else if (typeof exports === 'object') {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like enviroments that support module.exports,\n // like Node.\n module.exports = factory();\n } else {\n // Browser globals (root is self)\n root.is = factory();\n }\n}(this, function() {\n\n // Baseline\n /* -------------------------------------------------------------------------- */\n\n // define 'is' object and current version\n var is = {};\n is.VERSION = '0.8.0';\n\n // define interfaces\n is.not = {};\n is.all = {};\n is.any = {};\n\n // cache some methods to call later on\n var toString = Object.prototype.toString;\n var slice = Array.prototype.slice;\n var hasOwnProperty = Object.prototype.hasOwnProperty;\n\n // helper function which reverses the sense of predicate result\n function not(func) {\n return function() {\n return !func.apply(null, slice.call(arguments));\n };\n }\n\n // helper function which call predicate function per parameter and return true if all pass\n function all(func) {\n return function() {\n var params = getParams(arguments);\n var length = params.length;\n for (var i = 0; i < length; i++) {\n if (!func.call(null, params[i])) {\n return false;\n }\n }\n return true;\n };\n }\n\n // helper function which call predicate function per parameter and return true if any pass\n function any(func) {\n return function() {\n var params = getParams(arguments);\n var length = params.length;\n for (var i = 0; i < length; i++) {\n if (func.call(null, params[i])) {\n return true;\n }\n }\n return false;\n };\n }\n\n // build a 'comparator' object for various comparison checks\n var comparator = {\n '<': function(a, b) { return a < b; },\n '<=': function(a, b) { return a <= b; },\n '>': function(a, b) { return a > b; },\n '>=': function(a, b) { return a >= b; }\n }\n\n // helper function which compares a version to a range\n function compareVersion(version, range) {\n var string = (range + '');\n var n = +(string.match(/\\d+/) || NaN);\n var op = string.match(/^[<>]=?|/)[0];\n return comparator[op] ? comparator[op](version, n) : (version == n || n !== n);\n }\n\n // helper function which extracts params from arguments\n function getParams(args) {\n var params = slice.call(args);\n var length = params.length;\n if (length === 1 && is.array(params[0])) { // support array\n params = params[0];\n }\n return params;\n }\n\n // Type checks\n /* -------------------------------------------------------------------------- */\n\n // is a given value Arguments?\n is.arguments = function(value) { // fallback check is for IE\n return toString.call(value) === '[object Arguments]' ||\n (value != null && typeof value === 'object' && 'callee' in value);\n };\n\n // is a given value Array?\n is.array = Array.isArray || function(value) { // check native isArray first\n return toString.call(value) === '[object Array]';\n };\n\n // is a given value Boolean?\n is.boolean = function(value) {\n return value === true || value === false || toString.call(value) === '[object Boolean]';\n };\n\n // is a given value Char?\n is.char = function(value) {\n return is.string(value) && value.length === 1;\n };\n\n // is a given value Date Object?\n is.date = function(value) {\n return toString.call(value) === '[object Date]';\n };\n\n // is a given object a DOM node?\n is.domNode = function(object) {\n return is.object(object) && object.nodeType > 0;\n };\n\n // is a given value Error object?\n is.error = function(value) {\n return toString.call(value) === '[object Error]';\n };\n\n // is a given value function?\n is['function'] = function(value) { // fallback check is for IE\n return toString.call(value) === '[object Function]' || typeof value === 'function';\n };\n\n // is given value a pure JSON object?\n is.json = function(value) {\n return toString.call(value) === '[object Object]';\n };\n\n // is a given value NaN?\n is.nan = function(value) { // NaN is number :) Also it is the only value which does not equal itself\n return value !== value;\n };\n\n // is a given value null?\n is['null'] = function(value) {\n return value === null;\n };\n\n // is a given value number?\n is.number = function(value) {\n return is.not.nan(value) && toString.call(value) === '[object Number]';\n };\n\n // is a given value object?\n is.object = function(value) {\n return Object(value) === value;\n };\n\n // is a given value RegExp?\n is.regexp = function(value) {\n return toString.call(value) === '[object RegExp]';\n };\n\n // are given values same type?\n // prevent NaN, Number same type check\n is.sameType = function(value, other) {\n var tag = toString.call(value);\n if (tag !== toString.call(other)) {\n return false;\n }\n if (tag === '[object Number]') {\n return !is.any.nan(value, other) || is.all.nan(value, other);\n }\n return true;\n };\n // sameType method does not support 'all' and 'any' interfaces\n is.sameType.api = ['not'];\n\n // is a given value String?\n is.string = function(value) {\n return toString.call(value) === '[object String]';\n };\n\n // is a given value undefined?\n is.undefined = function(value) {\n return value === void 0;\n };\n\n // is a given value window?\n // setInterval method is only available for window object\n is.windowObject = function(value) {\n return value != null && typeof value === 'object' && 'setInterval' in value;\n };\n\n // Presence checks\n /* -------------------------------------------------------------------------- */\n\n //is a given value empty? Objects, arrays, strings\n is.empty = function(value) {\n if (is.object(value)) {\n var length = Object.getOwnPropertyNames(value).length;\n if (length === 0 || (length === 1 && is.array(value)) ||\n (length === 2 && is.arguments(value))) {\n return true;\n }\n return false;\n }\n return value === '';\n };\n\n // is a given value existy?\n is.existy = function(value) {\n return value != null;\n };\n\n // is a given value falsy?\n is.falsy = function(value) {\n return !value;\n };\n\n // is a given value truthy?\n is.truthy = not(is.falsy);\n\n // Arithmetic checks\n /* -------------------------------------------------------------------------- */\n\n // is a given number above minimum parameter?\n is.above = function(n, min) {\n return is.all.number(n, min) && n > min;\n };\n // above method does not support 'all' and 'any' interfaces\n is.above.api = ['not'];\n\n // is a given number decimal?\n is.decimal = function(n) {\n return is.number(n) && n % 1 !== 0;\n };\n\n // are given values equal? supports numbers, strings, regexes, booleans\n // TODO: Add object and array support\n is.equal = function(value, other) {\n // check 0 and -0 equity with Infinity and -Infinity\n if (is.all.number(value, other)) {\n return value === other && 1 / value === 1 / other;\n }\n // check regexes as strings too\n if (is.all.string(value, other) || is.all.regexp(value, other)) {\n return '' + value === '' + other;\n }\n if (is.all.boolean(value, other)) {\n return value === other;\n }\n return false;\n };\n // equal method does not support 'all' and 'any' interfaces\n is.equal.api = ['not'];\n\n // is a given number even?\n is.even = function(n) {\n return is.number(n) && n % 2 === 0;\n };\n\n // is a given number finite?\n is.finite = isFinite || function(n) {\n return is.not.infinite(n) && is.not.nan(n);\n };\n\n // is a given number infinite?\n is.infinite = function(n) {\n return n === Infinity || n === -Infinity;\n };\n\n // is a given number integer?\n is.integer = function(n) {\n return is.number(n) && n % 1 === 0;\n };\n\n // is a given number negative?\n is.negative = function(n) {\n return is.number(n) && n < 0;\n };\n\n // is a given number odd?\n is.odd = function(n) {\n return is.number(n) && n % 2 === 1;\n };\n\n // is a given number positive?\n is.positive = function(n) {\n return is.number(n) && n > 0;\n };\n\n // is a given number above maximum parameter?\n is.under = function(n, max) {\n return is.all.number(n, max) && n < max;\n };\n // least method does not support 'all' and 'any' interfaces\n is.under.api = ['not'];\n\n // is a given number within minimum and maximum parameters?\n is.within = function(n, min, max) {\n return is.all.number(n, min, max) && n > min && n < max;\n };\n // within method does not support 'all' and 'any' interfaces\n is.within.api = ['not'];\n\n // Regexp checks\n /* -------------------------------------------------------------------------- */\n // Steven Levithan, Jan Goyvaerts: Regular Expressions Cookbook\n // Scott Gonzalez: Email address validation\n\n // dateString match m/d/yy and mm/dd/yyyy, allowing any combination of one or two digits for the day and month, and two or four digits for the year\n // eppPhone match extensible provisioning protocol format\n // nanpPhone match north american number plan format\n // time match hours, minutes, and seconds, 24-hour clock\n var regexes = {\n affirmative: /^(?:1|t(?:rue)?|y(?:es)?|ok(?:ay)?)$/,\n alphaNumeric: /^[A-Za-z0-9]+$/,\n caPostalCode: /^(?!.*[DFIOQU])[A-VXY][0-9][A-Z]\\s?[0-9][A-Z][0-9]$/,\n creditCard: /^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/,\n dateString: /^(1[0-2]|0?[1-9])([\\/-])(3[01]|[12][0-9]|0?[1-9])(?:\\2)(?:[0-9]{2})?[0-9]{2}$/,\n email: /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i, // eslint-disable-line no-control-regex\n eppPhone: /^\\+[0-9]{1,3}\\.[0-9]{4,14}(?:x.+)?$/,\n hexadecimal: /^(?:0x)?[0-9a-fA-F]+$/,\n hexColor: /^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,\n ipv4: /^(?:(?:\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(?:\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])$/,\n ipv6: /^((?=.*::)(?!.*::.+::)(::)?([\\dA-F]{1,4}:(:|\\b)|){5}|([\\dA-F]{1,4}:){6})((([\\dA-F]{1,4}((?!\\3)::|:\\b|$))|(?!\\2\\3)){2}|(((2[0-4]|1\\d|[1-9])?\\d|25[0-5])\\.?\\b){4})$/i,\n nanpPhone: /^\\(?([0-9]{3})\\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/,\n socialSecurityNumber: /^(?!000|666)[0-8][0-9]{2}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4}$/,\n timeString: /^(2[0-3]|[01]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])$/,\n ukPostCode: /^[A-Z]{1,2}[0-9RCHNQ][0-9A-Z]?\\s?[0-9][ABD-HJLNP-UW-Z]{2}$|^[A-Z]{2}-?[0-9]{4}$/,\n url: /^(?:(?:https?|ftp):\\/\\/)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:\\/\\S*)?$/i,\n usZipCode: /^[0-9]{5}(?:-[0-9]{4})?$/\n };\n\n function regexpCheck(regexp, regexes) {\n is[regexp] = function(value) {\n return regexes[regexp].test(value);\n };\n }\n\n // create regexp checks methods from 'regexes' object\n for (var regexp in regexes) {\n if (regexes.hasOwnProperty(regexp)) {\n regexpCheck(regexp, regexes);\n }\n }\n\n // simplify IP checks by calling the regex helpers for IPv4 and IPv6\n is.ip = function(value) {\n return is.ipv4(value) || is.ipv6(value);\n };\n\n // String checks\n /* -------------------------------------------------------------------------- */\n\n // is a given string or sentence capitalized?\n is.capitalized = function(string) {\n if (is.not.string(string)) {\n return false;\n }\n var words = string.split(' ');\n for (var i = 0; i < words.length; i++) {\n var word = words[i];\n if (word.length) {\n var chr = word.charAt(0);\n if (chr !== chr.toUpperCase()) {\n return false;\n }\n }\n }\n return true;\n };\n\n // is string end with a given target parameter?\n is.endWith = function(string, target) {\n if (is.not.string(string)) {\n return false;\n }\n target += '';\n var position = string.length - target.length;\n return position >= 0 && string.indexOf(target, position) === position;\n };\n // endWith method does not support 'all' and 'any' interfaces\n is.endWith.api = ['not'];\n\n // is a given string include parameter target?\n is.include = function(string, target) {\n return string.indexOf(target) > -1;\n };\n // include method does not support 'all' and 'any' interfaces\n is.include.api = ['not'];\n\n // is a given string all lowercase?\n is.lowerCase = function(string) {\n return is.string(string) && string === string.toLowerCase();\n };\n\n // is a given string palindrome?\n is.palindrome = function(string) {\n if (is.not.string(string)) {\n return false;\n }\n string = string.replace(/[^a-zA-Z0-9]+/g, '').toLowerCase();\n var length = string.length - 1;\n for (var i = 0, half = Math.floor(length / 2); i <= half; i++) {\n if (string.charAt(i) !== string.charAt(length - i)) {\n return false;\n }\n }\n return true;\n };\n\n // is a given value space?\n // horizantal tab: 9, line feed: 10, vertical tab: 11, form feed: 12, carriage return: 13, space: 32\n is.space = function(value) {\n if (is.not.char(value)) {\n return false;\n }\n var charCode = value.charCodeAt(0);\n return (charCode > 8 && charCode < 14) || charCode === 32;\n };\n\n // is string start with a given target parameter?\n is.startWith = function(string, target) {\n return is.string(string) && string.indexOf(target) === 0;\n };\n // startWith method does not support 'all' and 'any' interfaces\n is.startWith.api = ['not'];\n\n // is a given string all uppercase?\n is.upperCase = function(string) {\n return is.string(string) && string === string.toUpperCase();\n };\n\n // Time checks\n /* -------------------------------------------------------------------------- */\n\n var days = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];\n var months = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'];\n\n // is a given dates day equal given day parameter?\n is.day = function(date, day) {\n return is.date(date) && day.toLowerCase() === days[date.getDay()];\n };\n // day method does not support 'all' and 'any' interfaces\n is.day.api = ['not'];\n\n // is a given date in daylight saving time?\n is.dayLightSavingTime = function(date) {\n var january = new Date(date.getFullYear(), 0, 1);\n var july = new Date(date.getFullYear(), 6, 1);\n var stdTimezoneOffset = Math.max(january.getTimezoneOffset(), july.getTimezoneOffset());\n return date.getTimezoneOffset() < stdTimezoneOffset;\n };\n\n // is a given date future?\n is.future = function(date) {\n var now = new Date();\n return is.date(date) && date.getTime() > now.getTime();\n };\n\n // is date within given range?\n is.inDateRange = function(date, start, end) {\n if (is.not.date(date) || is.not.date(start) || is.not.date(end)) {\n return false;\n }\n var stamp = date.getTime();\n return stamp > start.getTime() && stamp < end.getTime();\n };\n // inDateRange method does not support 'all' and 'any' interfaces\n is.inDateRange.api = ['not'];\n\n // is a given date in last month range?\n is.inLastMonth = function(date) {\n return is.inDateRange(date, new Date(new Date().setMonth(new Date().getMonth() - 1)), new Date());\n };\n\n // is a given date in last week range?\n is.inLastWeek = function(date) {\n return is.inDateRange(date, new Date(new Date().setDate(new Date().getDate() - 7)), new Date());\n };\n\n // is a given date in last year range?\n is.inLastYear = function(date) {\n return is.inDateRange(date, new Date(new Date().setFullYear(new Date().getFullYear() - 1)), new Date());\n };\n\n // is a given date in next month range?\n is.inNextMonth = function(date) {\n return is.inDateRange(date, new Date(), new Date(new Date().setMonth(new Date().getMonth() + 1)));\n };\n\n // is a given date in next week range?\n is.inNextWeek = function(date) {\n return is.inDateRange(date, new Date(), new Date(new Date().setDate(new Date().getDate() + 7)));\n };\n\n // is a given date in next year range?\n is.inNextYear = function(date) {\n return is.inDateRange(date, new Date(), new Date(new Date().setFullYear(new Date().getFullYear() + 1)));\n };\n\n // is the given year a leap year?\n is.leapYear = function(year) {\n return is.number(year) && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n };\n\n // is a given dates month equal given month parameter?\n is.month = function(date, month) {\n return is.date(date) && month.toLowerCase() === months[date.getMonth()];\n };\n // month method does not support 'all' and 'any' interfaces\n is.month.api = ['not'];\n\n // is a given date past?\n is.past = function(date) {\n var now = new Date();\n return is.date(date) && date.getTime() < now.getTime();\n };\n\n // is a given date in the parameter quarter?\n is.quarterOfYear = function(date, quarter) {\n return is.date(date) && is.number(quarter) && quarter === Math.floor((date.getMonth() + 3) / 3);\n };\n // quarterOfYear method does not support 'all' and 'any' interfaces\n is.quarterOfYear.api = ['not'];\n\n // is a given date indicate today?\n is.today = function(date) {\n var now = new Date();\n var todayString = now.toDateString();\n return is.date(date) && date.toDateString() === todayString;\n };\n\n // is a given date indicate tomorrow?\n is.tomorrow = function(date) {\n var now = new Date();\n var tomorrowString = new Date(now.setDate(now.getDate() + 1)).toDateString();\n return is.date(date) && date.toDateString() === tomorrowString;\n };\n\n // is a given date weekend?\n // 6: Saturday, 0: Sunday\n is.weekend = function(date) {\n return is.date(date) && (date.getDay() === 6 || date.getDay() === 0);\n };\n\n // is a given date weekday?\n is.weekday = not(is.weekend);\n\n // is a given dates year equal given year parameter?\n is.year = function(date, year) {\n return is.date(date) && is.number(year) && year === date.getFullYear();\n };\n // year method does not support 'all' and 'any' interfaces\n is.year.api = ['not'];\n\n // is a given date indicate yesterday?\n is.yesterday = function(date) {\n var now = new Date();\n var yesterdayString = new Date(now.setDate(now.getDate() - 1)).toDateString();\n return is.date(date) && date.toDateString() === yesterdayString;\n };\n\n // Environment checks\n /* -------------------------------------------------------------------------- */\n\n var freeGlobal = is.windowObject(typeof global == 'object' && global) && global;\n var freeSelf = is.windowObject(typeof self == 'object' && self) && self;\n var thisGlobal = is.windowObject(typeof this == 'object' && this) && this;\n var root = freeGlobal || freeSelf || thisGlobal || Function('return this')();\n\n var document = freeSelf && freeSelf.document;\n var previousIs = root.is;\n\n // store navigator properties to use later\n var navigator = freeSelf && freeSelf.navigator;\n var appVersion = (navigator && navigator.appVersion || '').toLowerCase();\n var userAgent = (navigator && navigator.userAgent || '').toLowerCase();\n var vendor = (navigator && navigator.vendor || '').toLowerCase();\n\n // is current device android?\n is.android = function() {\n return /android/.test(userAgent);\n };\n // android method does not support 'all' and 'any' interfaces\n is.android.api = ['not'];\n\n // is current device android phone?\n is.androidPhone = function() {\n return /android/.test(userAgent) && /mobile/.test(userAgent);\n };\n // androidPhone method does not support 'all' and 'any' interfaces\n is.androidPhone.api = ['not'];\n\n // is current device android tablet?\n is.androidTablet = function() {\n return /android/.test(userAgent) && !/mobile/.test(userAgent);\n };\n // androidTablet method does not support 'all' and 'any' interfaces\n is.androidTablet.api = ['not'];\n\n // is current device blackberry?\n is.blackberry = function() {\n return /blackberry/.test(userAgent) || /bb10/.test(userAgent);\n };\n // blackberry method does not support 'all' and 'any' interfaces\n is.blackberry.api = ['not'];\n\n // is current browser chrome?\n // parameter is optional\n is.chrome = function(range) {\n var match = /google inc/.test(vendor) ? userAgent.match(/(?:chrome|crios)\\/(\\d+)/) : null;\n return match !== null && compareVersion(match[1], range);\n };\n // chrome method does not support 'all' and 'any' interfaces\n is.chrome.api = ['not'];\n\n // is current device desktop?\n is.desktop = function() {\n return is.not.mobile() && is.not.tablet();\n };\n // desktop method does not support 'all' and 'any' interfaces\n is.desktop.api = ['not'];\n\n // is current browser edge?\n // parameter is optional\n is.edge = function(range) {\n var match = userAgent.match(/edge\\/(\\d+)/);\n return match !== null && compareVersion(match[1], range);\n };\n // edge method does not support 'all' and 'any' interfaces\n is.edge.api = ['not'];\n\n // is current browser firefox?\n // parameter is optional\n is.firefox = function(range) {\n var match = userAgent.match(/(?:firefox|fxios)\\/(\\d+)/);\n return match !== null && compareVersion(match[1], range);\n };\n // firefox method does not support 'all' and 'any' interfaces\n is.firefox.api = ['not'];\n\n // is current browser internet explorer?\n // parameter is optional\n is.ie = function(range) {\n var match = userAgent.match(/(?:msie |trident.+?; rv:)(\\d+)/);\n return match !== null && compareVersion(match[1], range);\n };\n // ie method does not support 'all' and 'any' interfaces\n is.ie.api = ['not'];\n\n // is current device ios?\n is.ios = function() {\n return is.iphone() || is.ipad() || is.ipod();\n };\n // ios method does not support 'all' and 'any' interfaces\n is.ios.api = ['not'];\n\n // is current device ipad?\n // parameter is optional\n is.ipad = function(range) {\n var match = userAgent.match(/ipad.+?os (\\d+)/);\n return match !== null && compareVersion(match[1], range);\n };\n // ipad method does not support 'all' and 'any' interfaces\n is.ipad.api = ['not'];\n\n // is current device iphone?\n // parameter is optional\n is.iphone = function(range) {\n // original iPhone doesn't have the os portion of the UA\n var match = userAgent.match(/iphone(?:.+?os (\\d+))?/);\n return match !== null && compareVersion(match[1] || 1, range);\n };\n // iphone method does not support 'all' and 'any' interfaces\n is.iphone.api = ['not'];\n\n // is current device ipod?\n // parameter is optional\n is.ipod = function(range) {\n var match = userAgent.match(/ipod.+?os (\\d+)/);\n return match !== null && compareVersion(match[1], range);\n };\n // ipod method does not support 'all' and 'any' interfaces\n is.ipod.api = ['not'];\n\n // is current operating system linux?\n is.linux = function() {\n return /linux/.test(appVersion);\n };\n // linux method does not support 'all' and 'any' interfaces\n is.linux.api = ['not'];\n\n // is current operating system mac?\n is.mac = function() {\n return /mac/.test(appVersion);\n };\n // mac method does not support 'all' and 'any' interfaces\n is.mac.api = ['not'];\n\n // is current device mobile?\n is.mobile = function() {\n return is.iphone() || is.ipod() || is.androidPhone() || is.blackberry() || is.windowsPhone();\n };\n // mobile method does not support 'all' and 'any' interfaces\n is.mobile.api = ['not'];\n\n // is current state offline?\n is.offline = not(is.online);\n // offline method does not support 'all' and 'any' interfaces\n is.offline.api = ['not'];\n\n // is current state online?\n is.online = function() {\n return !navigator || navigator.onLine === true;\n };\n // online method does not support 'all' and 'any' interfaces\n is.online.api = ['not'];\n\n // is current browser opera?\n // parameter is optional\n is.opera = function(range) {\n var match = userAgent.match(/(?:^opera.+?version|opr)\\/(\\d+)/);\n return match !== null && compareVersion(match[1], range);\n };\n // opera method does not support 'all' and 'any' interfaces\n is.opera.api = ['not'];\n\n // is current browser phantomjs?\n // parameter is optional\n is.phantom = function(range) {\n var match = userAgent.match(/phantomjs\\/(\\d+)/);\n return match !== null && compareVersion(match[1], range);\n };\n // phantom method does not support 'all' and 'any' interfaces\n is.phantom.api = ['not'];\n\n // is current browser safari?\n // parameter is optional\n is.safari = function(range) {\n var match = userAgent.match(/version\\/(\\d+).+?safari/);\n return match !== null && compareVersion(match[1], range);\n };\n // safari method does not support 'all' and 'any' interfaces\n is.safari.api = ['not'];\n\n // is current device tablet?\n is.tablet = function() {\n return is.ipad() || is.androidTablet() || is.windowsTablet();\n };\n // tablet method does not support 'all' and 'any' interfaces\n is.tablet.api = ['not'];\n\n // is current device supports touch?\n is.touchDevice = function() {\n return !!document && ('ontouchstart' in freeSelf ||\n ('DocumentTouch' in freeSelf && document instanceof DocumentTouch));\n };\n // touchDevice method does not support 'all' and 'any' interfaces\n is.touchDevice.api = ['not'];\n\n // is current operating system windows?\n is.windows = function() {\n return /win/.test(appVersion);\n };\n // windows method does not support 'all' and 'any' interfaces\n is.windows.api = ['not'];\n\n // is current device windows phone?\n is.windowsPhone = function() {\n return is.windows() && /phone/.test(userAgent);\n };\n // windowsPhone method does not support 'all' and 'any' interfaces\n is.windowsPhone.api = ['not'];\n\n // is current device windows tablet?\n is.windowsTablet = function() {\n return is.windows() && is.not.windowsPhone() && /touch/.test(userAgent);\n };\n // windowsTablet method does not support 'all' and 'any' interfaces\n is.windowsTablet.api = ['not'];\n\n // Object checks\n /* -------------------------------------------------------------------------- */\n\n // has a given object got parameterized count property?\n is.propertyCount = function(object, count) {\n if (is.not.object(object) || is.not.number(count)) {\n return false;\n }\n var n = 0;\n for (var property in object) {\n if (hasOwnProperty.call(object, property) && ++n > count) {\n return false;\n }\n }\n return n === count;\n };\n // propertyCount method does not support 'all' and 'any' interfaces\n is.propertyCount.api = ['not'];\n\n // is given object has parameterized property?\n is.propertyDefined = function(object, property) {\n return is.object(object) && is.string(property) && property in object;\n };\n // propertyDefined method does not support 'all' and 'any' interfaces\n is.propertyDefined.api = ['not'];\n\n // Array checks\n /* -------------------------------------------------------------------------- */\n\n // is a given item in an array?\n is.inArray = function(value, array) {\n if (is.not.array(array)) {\n return false;\n }\n for (var i = 0; i < array.length; i++) {\n if (array[i] === value) {\n return true;\n }\n }\n return false;\n };\n // inArray method does not support 'all' and 'any' interfaces\n is.inArray.api = ['not'];\n\n // is a given array sorted?\n is.sorted = function(array, sign) {\n if (is.not.array(array)) {\n return false;\n }\n var predicate = comparator[sign] || comparator['>='];\n for (var i = 1; i < array.length; i++) {\n if (!predicate(array[i], array[i - 1])) {\n return false;\n }\n }\n return true;\n };\n\n // API\n // Set 'not', 'all' and 'any' interfaces to methods based on their api property\n /* -------------------------------------------------------------------------- */\n\n function setInterfaces() {\n var options = is;\n for (var option in options) {\n if (hasOwnProperty.call(options, option) && is['function'](options[option])) {\n var interfaces = options[option].api || ['not', 'all', 'any'];\n for (var i = 0; i < interfaces.length; i++) {\n if (interfaces[i] === 'not') {\n is.not[option] = not(is[option]);\n }\n if (interfaces[i] === 'all') {\n is.all[option] = all(is[option]);\n }\n if (interfaces[i] === 'any') {\n is.any[option] = any(is[option]);\n }\n }\n }\n }\n }\n setInterfaces();\n\n // Configuration methods\n // Intentionally added after setInterfaces function\n /* -------------------------------------------------------------------------- */\n\n // change namespace of library to prevent name collisions\n // var preferredName = is.setNamespace();\n // preferredName.odd(3);\n // => true\n is.setNamespace = function() {\n root.is = previousIs;\n return this;\n };\n\n // set optional regexes to methods\n is.setRegexp = function(regexp, name) {\n for (var r in regexes) {\n if (hasOwnProperty.call(regexes, r) && (name === r)) {\n regexes[r] = regexp;\n }\n }\n };\n\n return is;\n}));\n","import * as is from 'is_js';\r\n\r\nexport const getElementTop = (element: HTMLElement): number => {\r\n if (element) {\r\n const box = element.getBoundingClientRect();\r\n const body = document.body;\r\n const docEl = document.documentElement;\r\n const scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop;\r\n const clientTop = docEl.clientTop || body.clientTop || 0;\r\n return box.top + scrollTop - clientTop;\r\n }\r\n return 0;\r\n};\r\n\r\nexport const scrollToElement = (element: HTMLElement, offSet = 0): void => {\r\n const scrollTo = getElementTop(element) - offSet;\r\n if (is.ie() === true || is.edge() === true) {\r\n window.scroll(0, scrollTo);\r\n } else {\r\n window.scroll({ top: scrollTo, left: 0, behavior: 'smooth' });\r\n }\r\n};\r\n\r\nexport const removeTags = (str: string): string => {\r\n if (!str) {\r\n return '';\r\n }\r\n return str.replace(/(<([^>]+)>)/gi, '');\r\n};\r\n\r\nexport const isNotNumber = (input: string): boolean => {\r\n const num = parseFloat(input);\r\n return isNaN(num);\r\n};\r\n\r\nexport const altElementSelector = (primarySelector: string, secondarySelector?: string): Promise => {\r\n return new Promise((resolve, reject) => {\r\n const observer = new MutationObserver((_) => {\r\n if (document.querySelector(primarySelector)) {\r\n resolve(document.querySelector(primarySelector) as HTMLElement);\r\n } else if (secondarySelector) {\r\n resolve(document.querySelector(secondarySelector) as HTMLElement);\r\n } else {\r\n reject('Neither element can be found');\r\n }\r\n observer.disconnect();\r\n });\r\n\r\n observer.observe(document.body, {\r\n childList: true,\r\n subtree: true\r\n });\r\n });\r\n};\r\n","class SpinnerService {\r\n public removeSpinnerOverlay(isPageLoaded: boolean): void {\r\n const spinnerOverlay = document.getElementById('spinnerOverlay');\r\n if (isPageLoaded && spinnerOverlay && (window as any).removeElement) {\r\n (window as any).removeElement('spinnerOverlay');\r\n }\r\n }\r\n\r\n public removePlansSkeletonLoader(): void {\r\n const skeletonLoader = document.querySelector('.product-cards-skeleton-load');\r\n if (skeletonLoader) {\r\n setTimeout(() => {\r\n skeletonLoader.classList.add('product-cards-skeleton-load--plans-almost-loaded');\r\n }, 500);\r\n setTimeout(() => {\r\n skeletonLoader.classList.add('product-cards-skeleton-load--plans-loaded');\r\n }, 800);\r\n }\r\n }\r\n\r\n public showPlansSkeletonLoader(): void {\r\n const skeletonLoader = document.querySelector('.product-cards-skeleton-load');\r\n if (skeletonLoader) {\r\n skeletonLoader.classList.remove('product-cards-skeleton-load--plans-loaded');\r\n setTimeout(() => {\r\n skeletonLoader.classList.remove('product-cards-skeleton-load--plans-almost-loaded');\r\n }, 200);\r\n }\r\n }\r\n}\r\n\r\nexport const spinnerService = new SpinnerService();\r\n","import { SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { ObservableMap } from '@stencil/store';\r\nimport { State } from 'app/shared/store/models/state.model';\r\nimport { nbnProductService } from 'app/nbn/services/nbn-product/nbn-product.service';\r\nimport { removeHandler } from 'app/shared/store/handlers/types/remove-handler';\r\nimport { tealiumAnalyticService } from 'app/shared/services/tealium/tealium-analytics.service';\r\nimport { AddressDetailModel } from 'app/shared/models/address/address.model';\r\nimport { crossSellService } from 'app/shared/services/cross-sell/cross-sell.service';\r\nimport { delayMessageService } from 'app/shared/services/delay-message/delay-message.service';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { altElementSelector, scrollToElement } from 'utils/dom.helper';\r\nimport { bundleService } from 'app/shared/services/bundle/bundle.service';\r\nimport { spinnerService } from 'app/shared/services/spinner/spinner.service';\r\n\r\nexport const addAddressHandler = (store: ObservableMap): removeHandler => {\r\n return store.onChange('address', async (address) => {\r\n await searchNbnProductAddress(store, address);\r\n });\r\n};\r\n\r\nexport const searchNbnProductAddress = async (store: ObservableMap, address: AddressDetailModel): Promise => {\r\n store.set('isPersonalisedProductsLoading', true);\r\n store.set(StoreKeys.responseError, null);\r\n delayMessageService.startAllTimers();\r\n spinnerService.showPlansSkeletonLoader();\r\n\r\n if (!bundleService.isExplicitBundleFlow()) {\r\n crossSellService.loadCrossSellProducts(address);\r\n }\r\n\r\n await nbnProductService\r\n .getProducts(address)\r\n .then((productDetails) => {\r\n const products = productDetails?.products ?? null;\r\n //Send data to analytics\r\n const techTypes = products ? products.map((x) => x.attributes.tech_type).join() : '';\r\n const eventData = techTypes ? Array.from(new Set(techTypes.split(','))).toString() : '';\r\n const data = {\r\n entered_state: address?.state,\r\n entered_suburb: address?.suburb,\r\n entered_post_code: address?.postcode,\r\n event_additional_data: `Fibre connect upgrade ${\r\n productDetails.serviceQualification?.nbn.alternativeServiceType ? 'eligible' : 'not eligible'\r\n }`\r\n };\r\n tealiumAnalyticService.createAndSendAddressData(['Address Validated'], eventData, data, 'nbn');\r\n tealiumAnalyticService.trackProductCards(products, false, 'nbn');\r\n store.set(StoreKeys.productDetails, productDetails);\r\n store.set(StoreKeys.responseError, null);\r\n\r\n if (!store.get(StoreKeys.aemCIFIntegrationEnabled)) {\r\n // scroll to cards or great news\r\n altElementSelector('message-wrapper#sq-message', 'app-product-cards').then(\r\n (el) => scrollToElement(el, 0),\r\n (r) => console.debug(r)\r\n );\r\n }\r\n })\r\n .catch((error) => {\r\n store.set(StoreKeys.responseError, error);\r\n if (store.get(StoreKeys.aemCIFIntegrationEnabled)) {\r\n window.postMessage(\r\n {\r\n eventType: 'nbn-error',\r\n spaCategory: store.get('productCategory'),\r\n eventData: {\r\n errorType: error.errorType\r\n }\r\n },\r\n '*'\r\n );\r\n }\r\n })\r\n .finally(() => {\r\n store.set('isPageLoaded', true);\r\n store.set('isPersonalisedProductsLoading', false);\r\n delayMessageService.stopAllTimers();\r\n spinnerService.removePlansSkeletonLoader();\r\n });\r\n\r\n // if bundleSearchAddress exists, set it as default address\r\n const bundleSearchAddressJson = sessionStorage.getItem(SessionStorageKeys.BundleSearchAddress);\r\n if (bundleSearchAddressJson) {\r\n const bundleSearchAddress = JSON.parse(bundleSearchAddressJson);\r\n store.set('address', bundleSearchAddress);\r\n sessionStorage.removeItem(SessionStorageKeys.BundleSearchAddress);\r\n }\r\n};\r\n","import { ObservableMap } from '@stencil/store';\r\nimport { State } from 'app/shared/store/models/state.model';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { changePlanService } from 'app/nbn/services/change-plan/change-plan.service';\r\nimport { removeHandler } from 'app/shared/store/handlers/types/remove-handler';\r\n\r\nexport const customerProfileHandler = (store: ObservableMap): removeHandler => {\r\n return store.onChange(StoreKeys.customerProfile, async (data) => {\r\n if (data.existingNbnProductId && data.existingNbnProductId?.length > 0) {\r\n const currentPlan = await changePlanService.getCurrentPlan();\r\n store.set(StoreKeys.currentNbnPlan, currentPlan);\r\n sessionStorage.setItem('nbnExistingProductDetails', JSON.stringify(currentPlan));\r\n }\r\n });\r\n};\r\n","import {\r\n Auth0Client,\r\n Auth0ClientModel,\r\n AuthConfiguration,\r\n authService as auth0Service,\r\n AuthService as Auth0Service,\r\n User\r\n} from '@aglenergy/agl.sales.authentication';\r\nimport { SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { Observable } from 'rxjs';\r\nimport { configService } from 'app/shared/services/config/config.service';\r\nimport { isLocalDevelopment } from 'app/shared/utilities/helper-functions';\r\nimport { locationService } from 'app/shared/services/location/location-service';\r\n\r\nexport class AuthenticationService {\r\n private readonly authClient: Auth0Service = auth0Service;\r\n\r\n public async getAuthConfiguration(): Promise {\r\n const authConfig: Auth0ClientModel = await configService.getAuthConfigData();\r\n return {\r\n authConfig: { ...authConfig, saml_login_url: await configService.getSamlLoginURL() },\r\n preLoginRedirectCallback: (redirectUrl) => {\r\n if (isLocalDevelopment()) {\r\n locationService.navigateToUrl(`returnPath=${redirectUrl}`);\r\n return;\r\n }\r\n }\r\n };\r\n }\r\n\r\n public getAuth0Client(): Auth0Client {\r\n return this.authClient.getAuth0Client();\r\n }\r\n\r\n public initialise(): Promise {\r\n return this.getAuthConfiguration().then((configuration) => this.authClient.initialise(configuration));\r\n }\r\n\r\n public login(redirectUri = ''): Observable {\r\n return this.authClient.login(redirectUri);\r\n }\r\n\r\n public getApiAuthToken(): Promise {\r\n return this.authClient.getApiAuthToken();\r\n }\r\n\r\n public logout(returnRoute?: string): Promise {\r\n return this.authClient.logout(returnRoute);\r\n }\r\n\r\n public get loggedIn(): boolean {\r\n return this.authClient.isLoggedIn() || !!sessionStorage.getItem(SessionStorageKeys.AccessToken);\r\n }\r\n\r\n public get user(): User {\r\n return this.authClient.getAuthenticatedUser();\r\n }\r\n\r\n public resetInstance(): void {\r\n this.authClient.resetInstance();\r\n }\r\n}\r\n\r\nexport const authenticationService = new AuthenticationService();\r\n","import { store } from 'app/shared/store/store';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { DataSpaKey } from 'app/shared/models/dataSpa';\r\nimport { getDataSpaSearchParams } from 'app/shared/utilities/helper-functions';\r\nimport { bundleService } from 'app/shared/services/bundle/bundle.service';\r\n\r\nclass BannerService {\r\n public getBannerTitle(dataSpa: string): string {\r\n let prefix = '';\r\n let spaBanner: string;\r\n if (dataSpa) {\r\n const spaParams = getDataSpaSearchParams(dataSpa);\r\n spaBanner = spaParams.get(DataSpaKey.banner);\r\n }\r\n const productCategory = store.get(StoreKeys.productCategory);\r\n const defaultBanner = productCategory === 'nbn' ? 'AGL internet plans' : 'AGL Mobile is here';\r\n if (bundleService.isExplicitBundleFlow()) {\r\n const bundleProductList = bundleService.getBundleConfig();\r\n const number = Array.from(bundleProductList.entries()).findIndex((bundle) => bundle[0] === productCategory) + 1;\r\n if (bundleProductList && number) {\r\n prefix = `Step ${number} • `;\r\n }\r\n }\r\n const banner = spaBanner && spaBanner !== '' ? spaBanner : defaultBanner;\r\n return `${prefix}${banner}`;\r\n }\r\n\r\n public toggleBanner(): void {\r\n const defaultBannerElem = document.querySelector('.headlinebanner')?.closest('section.container') as HTMLElement;\r\n const progressIndicatorElem = document\r\n .querySelector('[spa-id=\"app-banner-progress-indicator\"]')\r\n ?.closest('section.container') as HTMLElement;\r\n const promoBannerElem = document.querySelector('[spa-id=\"app-promo-banner\"]')?.closest('section.container') as HTMLElement;\r\n if (this.shouldShowPromoBanner()) {\r\n // Hide default banner and banner-progress-indicator\r\n this.toggleElementDisplay(defaultBannerElem, false);\r\n this.toggleElementDisplay(progressIndicatorElem, false);\r\n // Show promo banner\r\n this.toggleElementDisplay(promoBannerElem, true);\r\n promoBannerElem.classList.remove('vertical-padding-top');\r\n } else {\r\n // Show default banner and banner-progress-indicator\r\n this.toggleElementDisplay(defaultBannerElem, true);\r\n this.toggleElementDisplay(progressIndicatorElem, true);\r\n // Hide promo banner\r\n this.toggleElementDisplay(promoBannerElem, false);\r\n }\r\n }\r\n\r\n private shouldShowPromoBanner(): boolean {\r\n const promotionPage = store.get('promotionPage');\r\n const isPromoBannerValid =\r\n !!promotionPage?.promoBanner?.content && !!promotionPage?.promoBanner?.footer && !!promotionPage?.promoBanner?.imagePath;\r\n return promotionPage?.isPromoValid && isPromoBannerValid;\r\n }\r\n\r\n private toggleElementDisplay(element: HTMLElement, display: boolean): void {\r\n if (!element) {\r\n return;\r\n }\r\n element.style.display = display ? 'block' : 'none';\r\n }\r\n}\r\n\r\nexport const bannerService = new BannerService();\r\n","import {\r\n CartUtils,\r\n Discount,\r\n Guid,\r\n MobileProductDisplayAttributes,\r\n NbnProductDisplayAttributes,\r\n RetrieveCartItem,\r\n RetrieveCartResponse,\r\n SessionStorageKeys\r\n} from '@aglenergy/shared-library';\r\nimport { BundleConfig } from 'app/shared/models/bundle-config.model';\r\nimport { BundleConfigOptions } from 'app/shared/models/bundle-config-options.model';\r\nimport { BundleItem, BundleTileItems } from 'app/shared/models/bundle/displayCartItem.model';\r\nimport { CustomerProfile } from 'app/shared/models/customerProfile';\r\nimport { CustomerType } from 'app/shared/models/productSearchRequestModel';\r\nimport { DataSpaKey } from 'app/shared/models/dataSpa';\r\nimport { Frequency } from 'app/shared/models/contracts-api.model';\r\nimport { ProductCatalogueProduct } from 'app/shared/models/product-catalogue-product.model';\r\nimport { ProductCategory } from 'app/shared/models/product-category.model';\r\nimport { QueryStringParamName } from 'app/shared/models/common.enums';\r\nimport { customerProfileService } from 'app/shared/services/customer-profile/customerProfile-service';\r\nimport { getDataSpaSearchParams } from 'app/shared/utilities/helper-functions';\r\n\r\nclass BundleService {\r\n public isExplicitBundleFlow(): boolean {\r\n const customerProfile: CustomerProfile = customerProfileService.getCustomerProfile();\r\n const isNbnMoversBundleFlow =\r\n (customerProfile?.isInternetUpdated && customerProfile?.isElectricityUpdated) ||\r\n customerProfile?.isGasUpdated ||\r\n customerProfile?.isMobileUpdated;\r\n return !!customerProfile.isBundleExplicitlyRequestedByCustomer || isNbnMoversBundleFlow;\r\n }\r\n\r\n public isShowAddress(): boolean {\r\n const customerProfile: CustomerProfile = customerProfileService.getCustomerProfile();\r\n const isShowAddress: boolean = customerProfile.isShowAddress;\r\n return !!isShowAddress;\r\n }\r\n\r\n public setBundleConfig(bundleConfig: BundleConfig): void {\r\n sessionStorage.setItem(SessionStorageKeys.BundleConfig, JSON.stringify(Array.from(bundleConfig.entries())));\r\n }\r\n\r\n public getBundleConfig(): BundleConfig {\r\n return new Map(JSON.parse(sessionStorage.getItem(SessionStorageKeys.BundleConfig)));\r\n }\r\n\r\n public setBundleConfigProduct(productCategory: ProductCategory, options: BundleConfigOptions): void {\r\n const bundleConfig = this.getBundleConfig();\r\n\r\n if (bundleConfig.has(productCategory)) {\r\n const savedOptions = bundleConfig.get(productCategory);\r\n bundleConfig.set(productCategory, { ...savedOptions, ...options });\r\n } else {\r\n bundleConfig.set(productCategory, options);\r\n }\r\n\r\n this.setBundleConfig(bundleConfig);\r\n }\r\n\r\n public getBundleConfigProduct(productCategory: ProductCategory): BundleConfigOptions | null {\r\n const bundleConfig = this.getBundleConfig();\r\n\r\n if (bundleConfig.has(productCategory)) {\r\n return bundleConfig.get(productCategory);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n public isCurrentFlowOriginatingFromBridgePage(): boolean {\r\n const bridgePageOriginParam = new URLSearchParams(window.location.search).get(QueryStringParamName.BridgePageOrigin);\r\n return bridgePageOriginParam === 'true';\r\n }\r\n\r\n public mapBundleTileItems(cartDetails: RetrieveCartResponse): BundleTileItems {\r\n const bundleTileItems = new BundleTileItems();\r\n bundleTileItems.energy = new BundleItem();\r\n bundleTileItems.nbn = new BundleItem();\r\n bundleTileItems.mobile = new BundleItem();\r\n bundleTileItems.energy.displayItems = [];\r\n bundleTileItems.nbn.displayItems = [];\r\n bundleTileItems.mobile.displayItems = [];\r\n let nbnCost = 0;\r\n let mobileCost = 0;\r\n let hasVoip = false;\r\n let hasModem = false;\r\n if (cartDetails) {\r\n cartDetails.cartItems.map((item: RetrieveCartItem) => {\r\n switch (item.additionalData?.productCategory?.toLowerCase() as ProductCategory) {\r\n case 'energy': {\r\n const prefix = item.additionalData?.productQualification?.fuelType\r\n ? `${item.additionalData?.productQualification?.fuelType} `\r\n : '';\r\n bundleTileItems.energy.displayItems.push({\r\n productName: `${prefix}${item.additionalData?.productDisplayAttributes?.productName ?? ''}`,\r\n itemCount: 1\r\n });\r\n break;\r\n }\r\n case 'nbn': {\r\n bundleTileItems.nbn.displayItems.push({\r\n productName: item.additionalData?.productDisplayAttributes?.productName ?? '',\r\n itemCount: 1,\r\n paymentFrequency: item.additionalData?.productDisplayAttributes?.paymentFrequency ?? '',\r\n paymentPlanPrice: item.additionalData?.productDisplayAttributes?.paymentPlanPrice ?? ''\r\n });\r\n const nbnPrice = Number((item.additionalData?.productDisplayAttributes as NbnProductDisplayAttributes).price);\r\n const nonCouponDiscount = CartUtils.getPromotionDiscount(item?.productDiscounts, false);\r\n nbnCost += nonCouponDiscount ? CartUtils.calculateDiscountedPrice(nbnPrice, nonCouponDiscount?.discountAmount) : nbnPrice;\r\n break;\r\n }\r\n case 'modem': {\r\n hasModem = true;\r\n const modem = new BundleItem();\r\n modem.displayItems = [];\r\n modem.displayItems.push({ productName: item.additionalData?.productDisplayAttributes?.productName ?? '', itemCount: 1 });\r\n const nonCouponDiscount = CartUtils.getPromotionDiscount(item?.productDiscounts, false);\r\n const modemPrice = Number((item.additionalData?.productDisplayAttributes as NbnProductDisplayAttributes).price);\r\n const modemCost = nonCouponDiscount\r\n ? CartUtils.calculateDiscountedPrice(modemPrice, nonCouponDiscount?.discountAmount)\r\n : modemPrice;\r\n modem.subtotal = `${modemCost}`;\r\n bundleTileItems.modem = modem;\r\n break;\r\n }\r\n case 'voip':\r\n hasVoip = true;\r\n nbnCost += Number((item.additionalData?.productDisplayAttributes as NbnProductDisplayAttributes).price);\r\n break;\r\n case 'mobile plan': {\r\n const existingItem = bundleTileItems.mobile.displayItems?.find((mobileItem) => mobileItem.sku === item.sku);\r\n if (existingItem) {\r\n existingItem.itemCount++;\r\n } else {\r\n bundleTileItems.mobile.displayItems.push({\r\n productName: item.additionalData?.productDisplayAttributes?.productName ?? '',\r\n sku: item.sku,\r\n itemCount: 1\r\n });\r\n }\r\n const mobilePrice = Number((item.additionalData?.productDisplayAttributes as MobileProductDisplayAttributes).price);\r\n const nonCouponDiscount = CartUtils.getPromotionDiscount(item?.productDiscounts, false);\r\n mobileCost += nonCouponDiscount\r\n ? CartUtils.calculateDiscountedPrice(mobilePrice, nonCouponDiscount?.discountAmount)\r\n : mobilePrice;\r\n break;\r\n }\r\n default:\r\n break;\r\n }\r\n });\r\n if (bundleTileItems.nbn.displayItems.length) {\r\n if (hasVoip && hasModem) {\r\n bundleTileItems.nbn.displayItems[0].productInfo = '(With home phone & modem)';\r\n } else if (hasVoip) {\r\n bundleTileItems.nbn.displayItems[0].productInfo = '(With home phone)';\r\n } else if (hasModem) {\r\n bundleTileItems.nbn.displayItems[0].productInfo = '(With modem)';\r\n }\r\n }\r\n bundleTileItems.nbn.subtotal = `$${nbnCost} Per Month`;\r\n bundleTileItems.mobile.subtotal = `$${mobileCost} Per Month`;\r\n }\r\n return bundleTileItems;\r\n }\r\n\r\n public getBundleDiscountByCategory(category = 'mobile plan', isCouponDiscount = false): Discount[] | null {\r\n const bundleProducts = JSON.parse(window.sessionStorage.getItem(SessionStorageKeys.bundleProducts));\r\n if (bundleProducts?.discounts?.length) {\r\n return bundleProducts.discounts\r\n .filter((discount) => discount.productCategory.applyTo === category)\r\n .map(({ description, discountAmount }) => {\r\n return {\r\n description,\r\n discountAmount,\r\n frequency: Frequency.Monthly,\r\n isCouponDiscount\r\n };\r\n });\r\n }\r\n return null;\r\n }\r\n\r\n public mapMobileProductCatalogueAsCartItem(\r\n productDetail: ProductCatalogueProduct,\r\n productDiscounts: Discount[] = null\r\n ): RetrieveCartItem {\r\n return {\r\n productDiscounts,\r\n additionalData: {\r\n parentCartItemId: null,\r\n productCategory: 'mobile plan',\r\n productQualification: {\r\n customerType: CustomerType.residential\r\n },\r\n productDisplayAttributes: {\r\n productName: productDetail.content?.productName,\r\n price: productDetail.price,\r\n dataAllowance: productDetail.attributes.data_allowance,\r\n contractType: productDetail.attributes.contract_type,\r\n contractLengthUom: productDetail.attributes.contract_length_uom,\r\n contractLengthValue: productDetail.attributes.contract_length_value\r\n }\r\n },\r\n cartItemId: productDetail.cartItemId ?? Guid.newGuid(),\r\n sku: productDetail.sku\r\n } as unknown as RetrieveCartItem;\r\n }\r\n\r\n public toggleStaticContent(selectedCategory: 'none' | ProductCategory = 'none'): void {\r\n const allContentElements = document.querySelectorAll('agl-spa-shell');\r\n allContentElements.forEach((item) => {\r\n const dataSpa = item.getAttribute('data-spa');\r\n const dataSpaParamValue = getDataSpaSearchParams(dataSpa);\r\n const contentCategory = dataSpaParamValue?.get(DataSpaKey.contentCategory);\r\n if (contentCategory) {\r\n const sectionElement = item?.closest('section.container') as HTMLElement;\r\n if (sectionElement) {\r\n sectionElement.style.display = contentCategory === selectedCategory ? 'block' : 'none';\r\n }\r\n\r\n // Toggle separator element\r\n const previousSibling = sectionElement?.previousElementSibling as HTMLElement;\r\n if (previousSibling?.classList.contains('separator')) {\r\n previousSibling.style.display = contentCategory === selectedCategory ? 'block' : 'none';\r\n }\r\n }\r\n });\r\n }\r\n\r\n public validateActiveCategory(\r\n firstAvailableCategory: ProductCategory | 'none',\r\n activeCategory: ProductCategory | 'none'\r\n ): ProductCategory | 'none' {\r\n const categoryPriorities = { none: 0, energy: 1, nbn: 2, 'mobile plan': 3 };\r\n if (\r\n categoryPriorities[firstAvailableCategory] !== undefined &&\r\n categoryPriorities[activeCategory] !== undefined &&\r\n categoryPriorities[firstAvailableCategory] > categoryPriorities[activeCategory]\r\n ) {\r\n return firstAvailableCategory;\r\n }\r\n return activeCategory;\r\n }\r\n}\r\n\r\nexport const bundleService = new BundleService();\r\n","import { SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { store } from 'app/shared/store/store';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { ConfigModel } from 'app/shared/models/config.model';\r\nimport { PostcodeRange } from 'app/shared/models/energy/region.model';\r\nimport { ResponseError } from 'app/shared/models/response-error.error';\r\nimport { getHeaders } from 'app/shared/utilities/helper-functions';\r\nimport { generalContentService } from 'app/shared/services/general-content/general-content.service';\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\ndeclare let window: any;\r\n\r\nexport class ConfigService {\r\n private configData = null;\r\n private static instance: ConfigService;\r\n\r\n public static get Instance(): ConfigService {\r\n return this.instance || (this.instance = new this());\r\n }\r\n\r\n public getConfigData = (): ConfigModel => this.configData;\r\n\r\n public async loadConfig(host: string): Promise {\r\n this.configData = store.get('configData');\r\n\r\n if (this.configData) {\r\n return this.configData;\r\n }\r\n\r\n return await this.getConfig(host).then((config) => {\r\n store.set('configData', config);\r\n this.configData = config;\r\n generalContentService.getGeneralContent().then((res) => store.set(StoreKeys.generalContent, res.content));\r\n return config;\r\n });\r\n }\r\n\r\n public getPostcodeRange(): PostcodeRange[] {\r\n return this.getWinConfig('ausPostcodeRanges') as PostcodeRange[];\r\n }\r\n\r\n public getHttpHeaders(isConfigServiceRequest = true): HeadersInit {\r\n const httpHeaders: HeadersInit = getHeaders(isConfigServiceRequest);\r\n\r\n const accessToken = sessionStorage.getItem(SessionStorageKeys.AccessToken);\r\n if (accessToken) {\r\n httpHeaders['Authorization'] = `Bearer ${accessToken}`;\r\n }\r\n return httpHeaders;\r\n }\r\n\r\n public async getConfig(host: string): Promise {\r\n return await fetch(`${host}/assets/config.json`)\r\n .then((r) => {\r\n if (!r.ok) {\r\n throw new ResponseError(`Unable to get config`);\r\n }\r\n return r.json();\r\n })\r\n .catch((e) => {\r\n throw new ResponseError(e);\r\n });\r\n }\r\n\r\n public getSamlLoginURL = async (redirectUri?: string): Promise => {\r\n if (!this.configData) {\r\n const auth0 = await this.getAuthConfigData();\r\n this.configData = { ...this.configData, auth0 };\r\n }\r\n const returnUrl = redirectUri === '' ? `https://${window.location.host}${this.configData.auth0.redirect_uri}` : redirectUri;\r\n return `https://${this.configData.auth0.domain}/samlp/${this.configData.auth0.saml_client_id}?RelayState=ReturnUrl=${returnUrl}`;\r\n };\r\n\r\n public getAuthConfigData(): any {\r\n return this.configData.auth0;\r\n }\r\n\r\n private getWinConfig(key: string): any {\r\n if (window.config) {\r\n return window.config[key];\r\n }\r\n return null;\r\n }\r\n}\r\n\r\nexport const configService = ConfigService.Instance;\r\n","import { SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { CouponCode } from 'app/shared/models/couponCode.model';\r\n\r\nclass CouponCodeService {\r\n public getFromQueryString() {\r\n return new URLSearchParams(window.location.search).get(SessionStorageKeys.CouponCode);\r\n }\r\n\r\n public setSessionStorage(couponCode: string): void {\r\n sessionStorage.setItem(SessionStorageKeys.CouponCode, couponCode);\r\n }\r\n\r\n public resetSessionStorage(): void {\r\n sessionStorage.removeItem(SessionStorageKeys.CouponCode);\r\n }\r\n\r\n public setMultipleCouponSessionStorage(coupon: CouponCode): void {\r\n const currentSessionStorage = sessionStorage.getItem(SessionStorageKeys.CouponCode);\r\n if (currentSessionStorage) {\r\n if (currentSessionStorage.indexOf(coupon.couponCode) === -1) {\r\n const newSessionObject = `${currentSessionStorage},${coupon.couponCode}`;\r\n sessionStorage.setItem(SessionStorageKeys.CouponCode, JSON.stringify(newSessionObject));\r\n }\r\n } else {\r\n sessionStorage.setItem(SessionStorageKeys.CouponCode, coupon.couponCode);\r\n }\r\n }\r\n}\r\n\r\nexport const couponCodeService = new CouponCodeService();\r\n","import { SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { store } from 'app/shared/store/store';\r\nimport { AddressDetailModel } from 'app/shared/models/address/address.model';\r\nimport { CustomerType } from 'app/shared/models/productSearchRequestModel';\r\nimport { EnergyProductsResponse } from 'app/shared/models/product-response.model';\r\nimport { QueryStringParamName } from 'app/shared/models/common.enums';\r\nimport { SearchRequestType } from 'app/shared/models/energy/energy.enums';\r\nimport { bundleService } from 'app/shared/services/bundle/bundle.service';\r\nimport { customerProfileService } from 'app/shared/services/customer-profile/customerProfile-service';\r\nimport { energyProductSearchService } from 'app/energy/services/energy-product-search.service';\r\nimport { energyRequestMapper } from 'app/energy/mappers/energy-request.mapper';\r\n\r\nclass CrossSellService {\r\n private crossSellAvailableByAddress: { [address: string]: boolean } = {};\r\n\r\n public async loadCrossSellProducts(address: AddressDetailModel): Promise {\r\n const isBundle = store.get('isExplicitBundleFlow');\r\n if (!isBundle) {\r\n sessionStorage.removeItem(SessionStorageKeys.BundleConfig);\r\n }\r\n const searchRequest = energyRequestMapper.mapToCurrentSearchRequestModel(\r\n address,\r\n CustomerType.residential,\r\n null,\r\n SearchRequestType.address\r\n );\r\n\r\n try {\r\n const energyProductsResponse: EnergyProductsResponse = await energyProductSearchService.getProducts(searchRequest);\r\n\r\n const isEnergyAvailable = !!energyProductsResponse?.electricity?.products?.length || !!energyProductsResponse?.gas?.products?.length;\r\n if (isEnergyAvailable) {\r\n this.setCrossSellFlowAvailableOnAddress(address.fullAddress);\r\n }\r\n } catch {\r\n // Remove isBundleExplicitlyRequestedByCustomer from customerProfile, to prevent cart.spa displaying cross sell\r\n const customerProfile = customerProfileService.getCustomerProfile();\r\n delete customerProfile.isBundleExplicitlyRequestedByCustomer;\r\n customerProfileService.setCustomerProfile(customerProfile);\r\n // this is to prevent error bubble up.\r\n return;\r\n }\r\n }\r\n\r\n public setCrossSellFlowAvailableOnAddress(address: string): void {\r\n this.crossSellAvailableByAddress[address] = true;\r\n }\r\n\r\n public isCrossSellFlowAvailableOnAddress(address: string): boolean {\r\n return this.isCrossSellFlow() && !!this.crossSellAvailableByAddress[address];\r\n }\r\n\r\n public isCrossSellFlow(): boolean {\r\n const urlParams = new URLSearchParams(window.location.search);\r\n const bridgePageOrigin = urlParams.get(QueryStringParamName.BridgePageOrigin);\r\n if (bridgePageOrigin) {\r\n return false;\r\n }\r\n return this.hasAGLFunnelSQ && !bundleService.isExplicitBundleFlow();\r\n }\r\n\r\n private get hasAGLFunnelSQ(): boolean {\r\n const aglFunnelSQParam = new URLSearchParams(window.location.search).get(QueryStringParamName.AGLFunnelSQ);\r\n return sessionStorage.getItem(SessionStorageKeys.AGLFunnelSQ)?.toLowerCase() === 'true' || aglFunnelSQParam === 'true';\r\n }\r\n\r\n public removeCrossSellProductCategory(): void {\r\n sessionStorage.removeItem(SessionStorageKeys.CrossSellProductCategory);\r\n }\r\n}\r\n\r\nexport const crossSellService = new CrossSellService();\r\n","import { SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { CustomerProfile } from 'app/shared/models/customerProfile';\r\n\r\nclass CustomerProfileService {\r\n public getCustomerProfile(): CustomerProfile {\r\n const customerProfile = sessionStorage.getItem(SessionStorageKeys.CustomerProfile)\r\n ? JSON.parse(sessionStorage.getItem(SessionStorageKeys.CustomerProfile)) || {}\r\n : {};\r\n return typeof customerProfile === 'object' && customerProfile !== null ? customerProfile : {};\r\n }\r\n\r\n public setCustomerProfile(customerProfile: CustomerProfile): void {\r\n if (typeof customerProfile === 'object' && customerProfile !== null) {\r\n window.sessionStorage.setItem(SessionStorageKeys.CustomerProfile, JSON.stringify(customerProfile));\r\n }\r\n }\r\n}\r\n\r\nexport const customerProfileService = new CustomerProfileService();\r\n","import { ReportErrorType, ReportErrorAttributes } from 'app/shared/models/error-reporting';\r\ndeclare let newrelic: any;\r\n\r\nclass ErrorReportingService {\r\n public logError(err: Error | string, errType: ReportErrorType): void {\r\n if (!this.newRelicAvailable) return;\r\n const error = typeof err === 'string' ? new Error(err) : err;\r\n const errorAttributes: ReportErrorAttributes = { errorType: errType };\r\n newrelic.noticeError(error, errorAttributes);\r\n }\r\n\r\n private get newRelicAvailable(): boolean {\r\n return typeof newrelic === 'object' && typeof newrelic.noticeError === 'function';\r\n }\r\n}\r\n\r\nexport const errorReportingService = new ErrorReportingService();\r\n","import { SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { store } from 'app/shared/store/store';\r\nimport { FlowDetails, FlowType } from 'app/shared/models/flow-details.model';\r\nimport { ResponseError } from 'app/shared/models/response-error.error';\r\n\r\nexport class FlowService {\r\n public getFlowDetails(): FlowDetails {\r\n return JSON.parse(sessionStorage.getItem(SessionStorageKeys.FlowDetails)) as FlowDetails;\r\n }\r\n\r\n public setFlowDetails(flowDetails?: FlowDetails): void {\r\n if (flowDetails) {\r\n sessionStorage.setItem(SessionStorageKeys.FlowDetails, JSON.stringify(flowDetails));\r\n } else {\r\n sessionStorage.removeItem(SessionStorageKeys.FlowDetails);\r\n }\r\n }\r\n\r\n public getLastAdded(): string {\r\n const flowDetails = this.getFlowDetails();\r\n return flowDetails?.lastAdded;\r\n }\r\n\r\n public getActiveCategory(): string {\r\n const flowDetails = this.getFlowDetails();\r\n return flowDetails?.activeCategory;\r\n }\r\n\r\n public setActiveCategory(activeCategory: string): void {\r\n const flowDetails = this.getFlowDetails();\r\n if (flowDetails) {\r\n flowDetails.activeCategory = activeCategory;\r\n this.setFlowDetails(flowDetails);\r\n }\r\n }\r\n\r\n public getFlowError(): ResponseError {\r\n const flowDetails = this.getFlowDetails();\r\n return flowDetails?.error;\r\n }\r\n\r\n public setFlowError(newError: ResponseError): void {\r\n const flowDetails = this.getFlowDetails();\r\n if (flowDetails) {\r\n flowDetails.error = newError;\r\n this.setFlowDetails(flowDetails);\r\n }\r\n }\r\n\r\n public setFlowType(flowType: FlowType): void {\r\n let flowDetails = this.getFlowDetails();\r\n if (flowDetails) {\r\n flowDetails.flowType = flowType;\r\n } else {\r\n flowDetails = {\r\n flowType\r\n };\r\n }\r\n this.setFlowDetails(flowDetails);\r\n }\r\n\r\n public setAddressRequired(addressRequired: boolean): void {\r\n const flowDetails = this.getFlowDetails();\r\n if (flowDetails) {\r\n flowDetails.addressRequired = addressRequired;\r\n }\r\n this.setFlowDetails(flowDetails);\r\n }\r\n\r\n public getFlowTypeFromStore(): FlowType {\r\n const isBundle = store.get('isExplicitBundleFlow');\r\n const isGuidedFlow = store.get('isGuidedFlow');\r\n const isNbnMovers = store.get('isNbnMovers');\r\n if (isBundle && isNbnMovers && !isGuidedFlow) {\r\n return 'movers-bundle-flow';\r\n } else if (isBundle && !isGuidedFlow) {\r\n return 'bundle-flow';\r\n } else if (isGuidedFlow) {\r\n return 'guided-flow';\r\n } else if (isNbnMovers) {\r\n return 'movers-flow';\r\n }\r\n return 'default';\r\n }\r\n}\r\n\r\nexport const flowService = new FlowService();\r\n","import { ProductCategory as ProductCategoryEnum, SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { store } from 'app/shared/store/store';\r\nimport { AddressDetailModel } from 'app/shared/models/address/address.model';\r\nimport { ProductCatalogueProduct } from 'app/shared/models/product-catalogue-product.model';\r\nimport { tealiumAnalyticService } from 'app/shared/services/tealium/tealium-analytics.service';\r\nimport { CustomerProfile } from 'app/shared/models/customerProfile';\r\nimport { customerProfileService } from 'app/shared/services/customer-profile/customerProfile-service';\r\nimport { bundleService } from 'app/shared/services//bundle/bundle.service';\r\nimport { crossSellService } from 'app/shared/services/cross-sell/cross-sell.service';\r\nimport { NbnProductsResponse } from 'app/nbn/models/nbn-products-response.model';\r\nimport { SelectedProductSessionData } from 'app/shared/models/sessionData';\r\nimport { addressService } from 'app/shared/services/address/address.service';\r\nimport { couponCodeService } from 'app/shared/services/coupon-code/coupon-code.service';\r\nimport { locationService } from 'app/shared/services/location/location-service';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\n\r\nclass ProductService {\r\n public onSelectedProductForNbn(\r\n products: ProductCatalogueProduct[],\r\n selectedAddress: AddressDetailModel,\r\n sku: string,\r\n eligibilityPath?: string\r\n ): void {\r\n let isValid = true;\r\n let errors: Error[] = [] as Error[];\r\n\r\n if (!selectedAddress) {\r\n errors = [...errors, { name: 'address', message: 'No address' }];\r\n isValid = false;\r\n tealiumAnalyticService.trackCheckYourAddressButton('Check your address', ProductCategoryEnum.Nbn);\r\n }\r\n\r\n store.set('validationErrors', errors);\r\n\r\n if (isValid) {\r\n const customerProfile: CustomerProfile = customerProfileService.getCustomerProfile();\r\n if (bundleService.isExplicitBundleFlow()) {\r\n customerProfile.isBundleExplicitlyRequestedByCustomer = true;\r\n } else if (crossSellService.isCrossSellFlowAvailableOnAddress(selectedAddress.fullAddress)) {\r\n customerProfile.isBundleExplicitlyRequestedByCustomer = false;\r\n }\r\n customerProfile.customerOriginURL = window.location.href;\r\n customerProfile.customerType = 'R';\r\n customerProfileService.setCustomerProfile(customerProfile);\r\n\r\n const selectedProduct = products.find((x) => x.sku === sku);\r\n const productDetail = {\r\n product: { ...selectedProduct, webId: store.get(StoreKeys.webId) ? store.get(StoreKeys.webId) : null },\r\n serviceQualification: (store.get('productDetails') as NbnProductsResponse)?.serviceQualification\r\n };\r\n\r\n const selectedProductSessionDataJSON: SelectedProductSessionData = {\r\n address: selectedAddress,\r\n addressString: addressService.convertAddressToString(selectedAddress),\r\n productDetails: [productDetail],\r\n customerProfile\r\n };\r\n\r\n const couponCode = store.get('couponCode');\r\n const guidedFlow = store.get('isGuidedFlow');\r\n if (couponCode) {\r\n couponCodeService.setSessionStorage(couponCode);\r\n } else if (store.get('couponCodes').find((c) => c.productCategory === 'nbn')) {\r\n couponCodeService.setMultipleCouponSessionStorage(store.get('couponCodes').find((c) => c.productCategory === 'nbn'));\r\n } else if (!guidedFlow) {\r\n couponCodeService.resetSessionStorage();\r\n }\r\n\r\n window.sessionStorage.setItem(SessionStorageKeys.SelectedNBNProductDetails, JSON.stringify(selectedProductSessionDataJSON));\r\n\r\n tealiumAnalyticService.trackPlanSelectionData(selectedProduct, ProductCategoryEnum.Nbn, 'Choose this plan');\r\n\r\n locationService.navigateToEligibility(\r\n 'nbn',\r\n null,\r\n eligibilityPath,\r\n eligibilityPath === 'productswap' || store.get(StoreKeys.isCampaignPage)\r\n );\r\n }\r\n }\r\n\r\n public onSelectedProductForMobile(sku: string, products: ProductCatalogueProduct[], isGuidedFlow: boolean): void {\r\n let selectedProductSessionData = JSON.parse(window.sessionStorage.getItem(SessionStorageKeys.SelectedMobileProductDetails));\r\n const selectedProduct = products.find((x) => x.sku === sku);\r\n const customerProfile: CustomerProfile = customerProfileService.getCustomerProfile();\r\n customerProfile.customerOriginURL = window.location.href;\r\n customerProfile.customerType = 'R';\r\n customerProfileService.setCustomerProfile(customerProfile);\r\n\r\n if (selectedProductSessionData) {\r\n selectedProductSessionData.productDetails.push({\r\n product: { ...selectedProduct, webId: store.get(StoreKeys.webId) ? store.get(StoreKeys.webId) : null }\r\n });\r\n } else {\r\n selectedProductSessionData = {\r\n productDetails: [\r\n {\r\n product: { ...selectedProduct, webId: store.get(StoreKeys.webId) ? store.get(StoreKeys.webId) : null }\r\n }\r\n ],\r\n customerProfile\r\n };\r\n }\r\n\r\n if (crossSellService.isCrossSellFlow()) {\r\n customerProfile.isBundleExplicitlyRequestedByCustomer = false;\r\n customerProfileService.setCustomerProfile(customerProfile);\r\n }\r\n\r\n window.sessionStorage.setItem(SessionStorageKeys.SelectedMobileProductDetails, JSON.stringify(selectedProductSessionData));\r\n\r\n const couponCode = store.get('couponCode');\r\n if (couponCode) {\r\n couponCodeService.setSessionStorage(couponCode);\r\n } else if (store.get('couponCodes').find((c) => c.productCategory === 'mobile plan')) {\r\n couponCodeService.setMultipleCouponSessionStorage(store.get('couponCodes')?.find((c) => c.productCategory === 'mobile plan'));\r\n } else if (!isGuidedFlow) {\r\n couponCodeService.resetSessionStorage();\r\n }\r\n\r\n tealiumAnalyticService.trackPlanSelectionData(selectedProduct, 'mobile plan', 'Choose this plan');\r\n locationService.navigateToEligibility('mobile plan', null, null, store.get(StoreKeys.isCampaignPage));\r\n }\r\n\r\n public onSelectedMobileProductForChangePlan(products: ProductCatalogueProduct[], sku: string, eligibilityPath: string) {\r\n const customerProfile: CustomerProfile = customerProfileService.getCustomerProfile();\r\n const productDetails = products.find((p) => p.sku === sku);\r\n if (customerProfile && productDetails) {\r\n const selectedProduct: any = {\r\n customerProfile,\r\n productDetails: [{ product: productDetails }]\r\n };\r\n\r\n sessionStorage.setItem(SessionStorageKeys.SelectedMobileProductDetails, JSON.stringify(selectedProduct));\r\n tealiumAnalyticService.trackPlanSelectionData(selectedProduct, 'mobile plan', 'Choose this plan');\r\n locationService.navigateToEligibility('mobile plan', null, eligibilityPath, eligibilityPath === 'productswap', 'pre-cart');\r\n }\r\n }\r\n}\r\n\r\nexport const productService = new ProductService();\r\n","import { ProductsResponse } from 'app/shared/models/product-response.model';\r\nimport { store } from 'app/shared/store/store';\r\n\r\nexport const setPromoInStore = (response: ProductsResponse): void => {\r\n const isPromoValid = !!response?.promotionPage?.isPromoValid;\r\n if (isPromoValid) {\r\n store.set('promotionPage', response?.promotionPage);\r\n }\r\n};\r\n","import { SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { store } from 'app/shared/store/store';\r\nimport { nbnProductService } from 'app/nbn/services/nbn-product/nbn-product.service';\r\nimport { changePlanService } from 'app/nbn/services/change-plan/change-plan.service';\r\nimport { NbnProductsResponse } from 'app/nbn/models/nbn-products-response.model';\r\nimport { addAddressHandler } from 'app/nbn/store/handlers/address.handler';\r\nimport { customerProfileHandler } from 'app/nbn/store/handlers/customerProfile.handler';\r\nimport { bannerService, featureService, flowService, productsSessionStorageService } from 'app/shared/services/index';\r\nimport { removeHandler } from 'app/shared/store/handlers/types/remove-handler';\r\nimport { AddressDetailModel, FeatureKey, SelectedProductSessionData } from 'app/shared/models/index';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { setPromoInStore } from 'app/shared/utilities/promo.util';\r\nimport { customerProfileService } from 'app/shared/services/customer-profile/customerProfile-service';\r\n\r\nconst registeredHandlers = (): removeHandler => {\r\n const removeAddressHandler = addAddressHandler(store);\r\n const removeTelcoAccountHandler = customerProfileHandler(store);\r\n return () => {\r\n removeAddressHandler();\r\n removeTelcoAccountHandler();\r\n };\r\n};\r\n\r\nexport const initProductDetails = async (address: AddressDetailModel, customerLocationId: string): Promise => {\r\n let getProductPromise: Promise;\r\n let resetAddressStore = false;\r\n\r\n if (customerLocationId) {\r\n getProductPromise = nbnProductService.getProductsByLocationId(customerLocationId);\r\n // check if the address is already in store, otherwise reset address.\r\n resetAddressStore = !productsSessionStorageService.getNbnProductsByLocationId(customerLocationId);\r\n } else getProductPromise = nbnProductService.getProducts(address);\r\n\r\n await getProductPromise\r\n .then(async (productDetails) => {\r\n setPromoInStore(productDetails);\r\n store.set(StoreKeys.productDetails, productDetails);\r\n await nbnProductService.getVoipProducts(address?.state).then((voipProductDetails) => {\r\n store.set('voipProductDetails', voipProductDetails);\r\n });\r\n await nbnProductService.getModemProducts(address?.state).then((modemProductDetails) => {\r\n store.set('modemProductDetails', modemProductDetails);\r\n });\r\n\r\n if (resetAddressStore) {\r\n address = productDetails.serviceQualification?.nbn?.nbnLocation[0].addressStructured;\r\n if (address) {\r\n address.fullAddress = productDetails.serviceQualification?.nbn?.nbnLocation[0].addressLong;\r\n store.set('address', address);\r\n }\r\n }\r\n\r\n store.set('responseError', null);\r\n bannerService.toggleBanner();\r\n })\r\n .catch((error) => {\r\n if (error?.name === 'AbortError') {\r\n store.set('responseError', null);\r\n } else {\r\n store.set('responseError', error);\r\n }\r\n })\r\n .finally(() => {\r\n store.set('isPageLoaded', true);\r\n });\r\n};\r\n\r\nexport const onStoreInit = async (isGuidedFlow: boolean): Promise => {\r\n if (!isGuidedFlow && sessionStorage.getItem(SessionStorageKeys.FlowDetails) && flowService.getFlowDetails()?.flowType === 'guided-flow') {\r\n sessionStorage.removeItem(SessionStorageKeys.FlowDetails);\r\n sessionStorage.removeItem(SessionStorageKeys.PageHistory);\r\n }\r\n\r\n // Get feature flag\r\n const featureFlags = await featureService.loadFeaturesStatus([FeatureKey.NBN_MOVERS_ENABLED]);\r\n if (featureFlags?.nbnMoversEnabled && sessionStorage.getItem('appConfig') === 'movers') {\r\n store.set('isNbnMovers', true);\r\n }\r\n\r\n const productSessionData = productsSessionStorageService.getLatestProductsByProductCategory('nbn');\r\n if (productSessionData?.address) {\r\n productSessionData.address.fullAddress = productSessionData.key;\r\n store.set('address', productSessionData.address);\r\n }\r\n\r\n const selectedProductString = sessionStorage.getItem(SessionStorageKeys.selectedProductDetails);\r\n if (selectedProductString && selectedProductString.length > 0) {\r\n const selectedNbnProduct: SelectedProductSessionData = JSON.parse(selectedProductString);\r\n if (selectedNbnProduct) {\r\n const serviceQualification = Array.isArray(selectedNbnProduct.productDetails)\r\n ? selectedNbnProduct.productDetails[0].serviceQualification\r\n : (selectedNbnProduct.productDetails as any).serviceQualification;\r\n if (serviceQualification?.nbn) {\r\n store.set(StoreKeys.selectedNbnProductDetails, selectedNbnProduct);\r\n }\r\n }\r\n }\r\n\r\n registeredHandlers();\r\n\r\n const customerProfile = customerProfileService.getCustomerProfile();\r\n let locationId: string;\r\n const isChangingPlan = changePlanService.isChangePlan();\r\n if (customerProfile && isChangingPlan) {\r\n locationId = customerProfile.locationId;\r\n store.set(StoreKeys.customerProfile, customerProfile);\r\n }\r\n\r\n const energyContractString = sessionStorage.getItem('energyExistingContract');\r\n if (energyContractString && energyContractString.length > 0) {\r\n const contracts = JSON.parse(energyContractString);\r\n store.set('contractsData', contracts);\r\n }\r\n\r\n store.set('responseError', null);\r\n await initProductDetails(productSessionData?.address, locationId);\r\n};\r\n","import { store } from 'app/shared/store/store';\r\nimport { ProductSearchRequestModel } from 'app/shared/models/productSearchRequestModel';\r\nimport { ProductsResponse } from 'app/shared/models/product-response.model';\r\nimport { ResponseError } from 'app/shared/models/response-error.error';\r\nimport { getHeaders } from 'app/shared/utilities/helper-functions';\r\n\r\nclass MobileProductSearchApiService {\r\n public getProducts = async (request: ProductSearchRequestModel): Promise => {\r\n const configData = store.get('configData');\r\n const init = {\r\n method: 'POST',\r\n body: JSON.stringify({\r\n ...request\r\n }),\r\n headers: getHeaders()\r\n };\r\n\r\n return await fetch(`${configData.bffApiUrl}/products/mobile/search`, init)\r\n .then((response) => {\r\n if (!response.ok) {\r\n throw new ResponseError(`Unable to retrieve mobile products`);\r\n }\r\n\r\n return response.json();\r\n })\r\n .catch((error) => {\r\n throw new ResponseError(error);\r\n });\r\n };\r\n\r\n public getMobileProduct = async (sku: string): Promise => {\r\n const configData = store.get('configData');\r\n if (configData) {\r\n const httpHeaders = getHeaders();\r\n\r\n const requestUrl = `${configData.bffApiUrl}/products/mobile/sku/${sku}`;\r\n\r\n try {\r\n const response = await fetch(requestUrl, {\r\n method: 'GET',\r\n headers: httpHeaders\r\n });\r\n\r\n return await response.json();\r\n } catch (e) {\r\n const error = { code: 'NetworkError', message: e.message };\r\n throw error;\r\n }\r\n }\r\n };\r\n}\r\n\r\nexport const mobileProductSearchApiService = new MobileProductSearchApiService();\r\n","import { ProductCatalogueProduct } from '@aglenergy/shared-library';\r\nimport { store } from 'app/shared/store/store';\r\nimport { mobileProductSearchApiService } from 'app/mobile/services/mobile-product-search-api/mobile-product-search-api.service';\r\nimport { ProductCategory } from 'app/shared/models/product-category.model';\r\nimport { ProductSearchRequestModel } from 'app/shared/models/productSearchRequestModel';\r\nimport { ProductsResponse } from 'app/shared/models/product-response.model';\r\nimport { productsSessionStorageService } from 'app/shared/services/product-session-storage/product-session-storage.service';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\n\r\nclass MobileProductService {\r\n private productCategory: ProductCategory = 'mobile plan';\r\n\r\n private async getDefaultProducts(): Promise {\r\n const couponCode = store.get('couponCode') ?? null;\r\n const storageProductSessionData = productsSessionStorageService.getLatestProducts(this.productCategory);\r\n\r\n if (!storageProductSessionData) {\r\n const defaultProductSearchRequest: ProductSearchRequestModel = {\r\n couponCode,\r\n state: 'All',\r\n webCampaignId: store.get(StoreKeys.webId) ?? null\r\n };\r\n\r\n return await mobileProductSearchApiService.getProducts(defaultProductSearchRequest).then((response) => {\r\n productsSessionStorageService.upsertProducts(response, this.productCategory);\r\n return response;\r\n });\r\n }\r\n return await storageProductSessionData.response;\r\n }\r\n\r\n public async getProducts(): Promise {\r\n return await this.getDefaultProducts();\r\n }\r\n\r\n public async getMobileProductBySku(productSku: string): Promise {\r\n const mobileProducts = productsSessionStorageService.getLatestProductsByProductCategory('mobile plan');\r\n let findProduct: ProductCatalogueProduct = null;\r\n if (mobileProducts) findProduct = mobileProducts.response.products.find((prod) => prod.sku === productSku);\r\n if (!findProduct) {\r\n const productResponse = await mobileProductSearchApiService.getMobileProduct(productSku);\r\n findProduct = productResponse.products?.find((x) => x.sku === productSku);\r\n }\r\n\r\n return findProduct;\r\n }\r\n}\r\n\r\nexport const mobileProductService = new MobileProductService();\r\n","import { NbnAccountsResponse } from '@aglenergy/shared-library';\r\nimport { ReportErrorType, ResponseError } from 'app/shared/models/index';\r\nimport { store } from 'app/shared/store/store';\r\nimport { configService } from 'app/shared/services/config/config.service';\r\nimport { errorReportingService } from 'app/shared/services/error-reporting/error-reporting.service';\r\n\r\nclass AccountApiService {\r\n private apiBaseURL: string;\r\n private apimSubscriptionKey: string;\r\n\r\n private getConfig() {\r\n if (!this.apiBaseURL && !this.apimSubscriptionKey) {\r\n const configData = store.get('configData');\r\n this.apiBaseURL = configData.bffApiUrl;\r\n this.apimSubscriptionKey = configData.bffOcpApimSubscriptionKey;\r\n }\r\n }\r\n public async getMobileAccountServices(): Promise {\r\n this.getConfig();\r\n const httpHeaders = configService.getHttpHeaders(false);\r\n\r\n const requestUrl = `${this.apiBaseURL}/mobile/accounts`;\r\n\r\n const init = {\r\n method: 'GET',\r\n headers: httpHeaders\r\n };\r\n\r\n return await fetch(requestUrl, init)\r\n .then((response: Response) => {\r\n return this.processNbnAcccountsResponse(response);\r\n })\r\n .catch((error) => {\r\n throw new ResponseError(error.message, error.errorType);\r\n });\r\n }\r\n\r\n private processNbnAcccountsResponse = (response: Response): Promise => {\r\n if (!response.ok) {\r\n errorReportingService.logError('Unable to retrieve accounts from SPC', ReportErrorType.SPCAccountsFailed);\r\n throw new ResponseError(response.statusText, 'systemError');\r\n }\r\n return response.json();\r\n };\r\n}\r\n\r\nexport const accountApiService = new AccountApiService();\r\n","import { NbnService } from '@aglenergy/shared-library/dist/generated-source/api/sales/models/NbnService';\r\nimport { accountApiService } from 'app/mobile/services/account/account-api.service';\r\n\r\nclass AccountService {\r\n public async getServiceByEncryptedServiceId(encryptedServiceId: string): Promise {\r\n const mobileAccountResult = await accountApiService.getMobileAccountServices();\r\n if (mobileAccountResult.accounts.length > 0) {\r\n const account = mobileAccountResult.accounts.find((x) =>\r\n x.services.some((svc: any) => svc.encryptedServiceId === encryptedServiceId)\r\n );\r\n if (account) {\r\n return account.services.find((svc: any) => svc.encryptedServiceId === encryptedServiceId);\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n\r\nexport const accountService = new AccountService();\r\n","import { ObservableMap } from '@stencil/store';\r\nimport { State } from 'app/shared/store/models/state.model';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { accountService } from 'app/mobile/services/account/account.service';\r\nimport { changePlanService } from 'app/mobile/services/change-plan/change-plan.service';\r\nimport { mobileProductService } from 'app/mobile/services/mobile-product/mobile-product.service';\r\nimport { removeHandler } from 'app/shared/store/handlers/types/remove-handler';\r\n\r\nexport const customerProfileHandler = (store: ObservableMap): removeHandler => {\r\n return store.onChange(StoreKeys.customerProfile, async (data) => {\r\n const isChangePlan = changePlanService.isChangePlan();\r\n if (isChangePlan && data.encryptedServiceId && data.encryptedServiceId?.length > 0) {\r\n const existingMobileService = await accountService.getServiceByEncryptedServiceId(data.encryptedServiceId);\r\n if (existingMobileService && existingMobileService.serviceCategory === 'Mobile') {\r\n store.set('selectedTelcoService', existingMobileService);\r\n const currentMobilePlan: any = await mobileProductService.getMobileProductBySku(existingMobileService.productId);\r\n if (currentMobilePlan) {\r\n store.set('currentMobilePlan', currentMobilePlan);\r\n sessionStorage.setItem('mobileExistingProductDetails', JSON.stringify(currentMobilePlan));\r\n }\r\n }\r\n }\r\n });\r\n};\r\n","import { SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { store } from 'app/shared/store/store';\r\nimport { mobileProductService } from 'app/mobile/services/mobile-product/mobile-product.service';\r\nimport { ProductsResponse } from 'app/shared/models/product-response.model';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { bannerService } from 'app/shared/services/banner/banner.service';\r\nimport { customerProfileService } from 'app/shared/services/customer-profile/customerProfile-service';\r\nimport { flowService } from 'app/shared/services/flow/flow-service';\r\nimport { tealiumAnalyticService } from 'app/shared/services/tealium/tealium-analytics.service';\r\nimport { setPromoInStore } from 'app/shared/utilities/promo.util';\r\nimport { removeHandler } from 'app/shared/store/handlers/types/remove-handler';\r\nimport { customerProfileHandler } from 'app/mobile/store/handlers/customerProfile.handler';\r\n\r\nconst registeredHandlers = (): removeHandler => {\r\n const removeTelcoAccountHandler = customerProfileHandler(store);\r\n return () => {\r\n removeTelcoAccountHandler();\r\n };\r\n};\r\n\r\nexport const onStoreInit = async (isGuidedFlow: boolean): Promise => {\r\n if (!isGuidedFlow && sessionStorage.getItem(SessionStorageKeys.FlowDetails) && flowService.getFlowDetails()?.flowType === 'guided-flow') {\r\n sessionStorage.removeItem(SessionStorageKeys.FlowDetails);\r\n sessionStorage.removeItem(SessionStorageKeys.PageHistory);\r\n }\r\n store.set(StoreKeys.responseError, null);\r\n tealiumAnalyticService.trackProductCards([], true, 'mobile plan');\r\n\r\n const selectedProduct = JSON.parse(sessionStorage.getItem(SessionStorageKeys.SelectedMobileProductDetails));\r\n if (selectedProduct) {\r\n store.set('selectedMobileProductDetails', selectedProduct);\r\n }\r\n\r\n registeredHandlers();\r\n const customerProfile = customerProfileService.getCustomerProfile();\r\n store.set('customerProfile', customerProfile);\r\n\r\n await mobileProductService\r\n .getProducts()\r\n .then((productDetails: ProductsResponse) => {\r\n setPromoInStore(productDetails);\r\n store.set(StoreKeys.productDetails, productDetails);\r\n\r\n store.set(StoreKeys.responseError, null);\r\n bannerService.toggleBanner();\r\n })\r\n .catch((error) => {\r\n store.set(StoreKeys.responseError, error);\r\n })\r\n .finally(() => {\r\n store.set('isPageLoaded', true);\r\n });\r\n};\r\n","import { authService } from '@aglenergy/agl.sales.authentication';\r\nimport { store } from 'app/shared/store/store';\r\nimport { BundleSearchResponse } from 'app/shared/models/bundle-search-response.model';\r\nimport { ProductSearchRequestModel } from 'app/shared/models/productSearchRequestModel';\r\nimport { ResponseError } from 'app/shared/models/response-error.error';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { flowService } from 'app/shared/services/flow/flow-service';\r\nimport { getHeaders } from 'app/shared/utilities/helper-functions';\r\n\r\nclass BundleApiService {\r\n private bundleSearchPath = '/products/bundle/search';\r\n private authenticatedBundleSearchPath = '/products/bundle/customerSearch';\r\n\r\n public getBundleProducts = async (searchModel: ProductSearchRequestModel): Promise => {\r\n const configData = store.get('configData');\r\n const init = {\r\n method: 'POST',\r\n body: JSON.stringify({\r\n ...searchModel\r\n }),\r\n headers: getHeaders()\r\n };\r\n return await fetch(`${configData.bffApiUrl}${this.bundleSearchPath}`, init)\r\n .then((response) => {\r\n if (!response.ok) {\r\n if (response.status === 300) {\r\n throw new ResponseError(response.statusText, 'multipleMatching');\r\n } else if (response.status === 500) {\r\n throw new ResponseError(response.statusText, 'systemError');\r\n } else {\r\n throw new ResponseError(`Unable to retrieve energy products`, 'serviceNotAvailable');\r\n }\r\n }\r\n flowService.setFlowError(null);\r\n store.set(StoreKeys.responseError, null);\r\n return response.json();\r\n })\r\n .catch((error) => {\r\n if (error.errorType) {\r\n flowService.setFlowError(error);\r\n throw new ResponseError(error.message, error.errorType);\r\n } else {\r\n throw new ResponseError(error);\r\n }\r\n });\r\n };\r\n\r\n public getAuthenticatedBundleProducts = async (): Promise => {\r\n const configData = store.get('configData');\r\n const token = await authService.getAuth0Client().getTokenSilently({ audience: configData.auth0.audience });\r\n\r\n const init = {\r\n method: 'POST',\r\n headers: getHeaders(false, `Bearer ${token}`)\r\n };\r\n return await fetch(`${configData.bffApiUrl}${this.authenticatedBundleSearchPath}`, init)\r\n .then((response) => {\r\n switch (response.status) {\r\n case 200:\r\n flowService.setFlowError(null);\r\n store.set(StoreKeys.responseError, null);\r\n return response.json();\r\n case 300:\r\n store.set('addressRequired', true);\r\n throw new ResponseError(response.statusText, 'multipleMatching');\r\n case 400:\r\n store.set('addressRequired', true);\r\n throw new ResponseError(response.statusText, 'systemError');\r\n case 500:\r\n throw new ResponseError(response.statusText, 'systemError');\r\n default:\r\n throw new ResponseError(`Unable to retrieve energy products`, 'serviceNotAvailable');\r\n }\r\n })\r\n .catch((error) => {\r\n if (error.errorType) {\r\n flowService.setFlowError(error);\r\n throw new ResponseError(error.message, error.errorType);\r\n } else {\r\n throw new ResponseError(error);\r\n }\r\n });\r\n };\r\n}\r\nexport const bundleApiService = new BundleApiService();\r\n","import { SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { store } from 'app/shared/store/store';\r\nimport { bundleApiService } from 'app/bundle/services/bundle-api.service';\r\nimport { AddressDetailModel } from 'app/shared/models/address/address.model';\r\nimport { BundleSearchResponse } from 'app/shared/models/bundle-search-response.model';\r\nimport { BundleSearchStore, CurrentSearchRequestModel, EnergySearchStore } from 'app/shared/models/current-search-request.model';\r\nimport { CouponCode } from 'app/shared/models/couponCode.model';\r\nimport { CustomerType, ProductSearchRequestModel } from 'app/shared/models/productSearchRequestModel';\r\nimport { EnergyProductsResponse } from 'app/shared/models/product-response.model';\r\nimport { FuelType, SearchRequestType } from 'app/shared/models/energy/energy.enums';\r\nimport { ProductCategory } from 'app/shared/models/product-category.model';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { addressService } from 'app/shared/services/address/address.service';\r\nimport { energyProductSearchService } from 'app/energy/services/energy-product-search.service';\r\nimport { energyRequestMapper } from 'app/energy/mappers/energy-request.mapper';\r\nimport { isSameAddress } from 'app/shared/utilities/address.util';\r\nimport { nbnProductService } from 'app/nbn/services/nbn-product/nbn-product.service';\r\nimport { productsSessionStorageService } from 'app/shared/services/product-session-storage/product-session-storage.service';\r\n\r\ntype FirstAvailableProductCategory = ProductCategory | 'none';\r\n\r\nclass BundleSearchService {\r\n private getBundleRequestModel(address: AddressDetailModel): CurrentSearchRequestModel {\r\n const productCategories: ProductCategory[] = ['energy', 'nbn', 'mobile plan'];\r\n\r\n const searchRequest = energyRequestMapper.mapToCurrentSearchRequestModel(\r\n address,\r\n CustomerType.residential,\r\n productCategories,\r\n SearchRequestType.address\r\n );\r\n\r\n return searchRequest;\r\n }\r\n\r\n public getProducts(\r\n address?: AddressDetailModel,\r\n currentSearchRequest?: CurrentSearchRequestModel,\r\n couponCode?: string,\r\n couponCodes?: CouponCode[]\r\n ): Promise {\r\n let searchRequest: CurrentSearchRequestModel;\r\n if (address) {\r\n searchRequest = this.getBundleRequestModel(address);\r\n } else {\r\n searchRequest = currentSearchRequest;\r\n }\r\n\r\n searchRequest.productSearchRequestModel = { ...searchRequest.productSearchRequestModel, shouldReturnDiscounts: true };\r\n // check the fuel type and default to dual if could not find.\r\n if (!searchRequest.productSearchRequestModel?.fuelType) {\r\n searchRequest.productSearchRequestModel = { ...searchRequest.productSearchRequestModel, fuelType: FuelType.Dual };\r\n }\r\n\r\n if (couponCode) {\r\n searchRequest.productSearchRequestModel = { ...searchRequest.productSearchRequestModel, couponCode };\r\n }\r\n\r\n if (couponCodes) {\r\n //TODO: Update shared library model\r\n searchRequest.productSearchRequestModel = { ...searchRequest.productSearchRequestModel, couponCodes } as any;\r\n }\r\n\r\n // Invoke Bundle search\r\n return bundleApiService.getBundleProducts(searchRequest.productSearchRequestModel).then((searchResponse) => {\r\n searchRequest.productSearchRequestModel.nbnProductLoaded = true;\r\n\r\n // Handle Energy Search Response\r\n if (searchResponse?.energyProductsResponse !== null) {\r\n searchResponse.energyProductsResponse = Object.assign(searchResponse.energyProductsResponse, {\r\n isTariffUpdate: false,\r\n isRatesPeriodToggleUpdate: false\r\n });\r\n\r\n energyProductSearchService.saveProductsInStore(searchRequest, searchResponse?.energyProductsResponse);\r\n }\r\n\r\n // Handle Nbn Search Response\r\n if (searchResponse?.nbnProductsResponse !== null) {\r\n if (nbnProductService.hasNoService(searchResponse.nbnProductsResponse)) {\r\n searchResponse.nbnProductsResponse = null;\r\n } else {\r\n productsSessionStorageService.upsertProducts(searchResponse?.nbnProductsResponse, 'nbn', address);\r\n }\r\n }\r\n sessionStorage.setItem(SessionStorageKeys.address, JSON.stringify(address));\r\n bundleSearchService.saveProductsInStore(address, searchResponse);\r\n return searchResponse;\r\n });\r\n }\r\n\r\n public getAuthenticatedProducts(): Promise {\r\n // Invoke Bundle search\r\n return bundleApiService.getAuthenticatedBundleProducts().then((searchResponse) => {\r\n const address = {\r\n postcode: searchResponse?.contractAddress?.postcode,\r\n state: searchResponse?.contractAddress?.state,\r\n streetNumber: searchResponse?.contractAddress?.streetNumber,\r\n streetName: searchResponse?.contractAddress?.streetName,\r\n streetType: searchResponse?.contractAddress?.streetType,\r\n suburb: searchResponse?.contractAddress?.suburb,\r\n unitNumber: searchResponse?.contractAddress?.unitNumber\r\n };\r\n // Handle Nbn Search Response\r\n if (searchResponse?.nbnProductsResponse !== null) {\r\n if (nbnProductService.hasNoService(searchResponse.nbnProductsResponse)) {\r\n searchResponse.nbnProductsResponse = null;\r\n } else {\r\n productsSessionStorageService.upsertProducts(searchResponse?.nbnProductsResponse, 'nbn', address);\r\n }\r\n }\r\n sessionStorage.setItem(SessionStorageKeys.address, JSON.stringify(address));\r\n bundleSearchService.saveProductsInStore(address, searchResponse);\r\n return Promise.resolve({ ...searchResponse, address });\r\n });\r\n }\r\n\r\n public loadProductsResponseFromStore(requestModel: CurrentSearchRequestModel): BundleSearchStore | null {\r\n const request: ProductSearchRequestModel = requestModel.productSearchRequestModel;\r\n\r\n // Check Products stored in the local Store\r\n const productResponseFromStorage = store.get(StoreKeys.bundleSearchStore);\r\n if (isSameAddress(productResponseFromStorage?.request?.productSearchRequestModel, request)) {\r\n return productResponseFromStorage;\r\n }\r\n\r\n // Check Products stored in session storage\r\n const productResponseFromSession = JSON.parse(sessionStorage.getItem(SessionStorageKeys.bundleProducts)) as BundleSearchStore;\r\n if (isSameAddress(productResponseFromSession?.request?.productSearchRequestModel, request)) {\r\n store.set(StoreKeys.bundleSearchStore, productResponseFromSession);\r\n return productResponseFromSession;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n public saveProductsInStore(address: AddressDetailModel, bundleSearchResponse: BundleSearchResponse): void {\r\n const requestModel = this.getBundleRequestModel(address);\r\n const productStore: BundleSearchStore = new BundleSearchStore();\r\n\r\n // storing default tariff for elec\r\n let request = requestModel;\r\n if (bundleSearchResponse.energyProductsResponse) {\r\n request = this.setRequestModel(requestModel, bundleSearchResponse.energyProductsResponse);\r\n productStore.energyResponse = bundleSearchResponse.energyProductsResponse;\r\n }\r\n\r\n productStore.nbnResponse = bundleSearchResponse.nbnProductsResponse;\r\n productStore.mobileResponse = bundleSearchResponse.mobileProductsResponse;\r\n productStore.discounts = bundleSearchResponse.discounts;\r\n productStore.request = request;\r\n productStore.requestDateTime = new Date();\r\n productStore.address = address;\r\n store.set(StoreKeys.bundleSearchStore, productStore);\r\n\r\n const energyStore = new EnergySearchStore();\r\n energyStore.request = request;\r\n energyStore.response = productStore.energyResponse;\r\n\r\n const productSearchResponses: EnergySearchStore[] =\r\n JSON.parse(sessionStorage.getItem(SessionStorageKeys.productSearchResponse)) ?? ([] as EnergySearchStore[]);\r\n\r\n const targetAddressString = addressService.convertAddressToString(address);\r\n const addressIndex: number = productSearchResponses.length\r\n ? productSearchResponses.findIndex(\r\n (productSearchResponse: EnergySearchStore) => productSearchResponse.request.addressString === targetAddressString\r\n )\r\n : -1;\r\n\r\n if (addressIndex === -1) {\r\n productSearchResponses.push(energyStore);\r\n } else {\r\n productSearchResponses[addressIndex] = energyStore;\r\n }\r\n\r\n sessionStorage.setItem(SessionStorageKeys.productSearchResponse, JSON.stringify(productSearchResponses));\r\n sessionStorage.setItem(SessionStorageKeys.bundleProducts, JSON.stringify(productStore));\r\n }\r\n\r\n public setRequestModel(requestModel: CurrentSearchRequestModel, energyResponse: EnergyProductsResponse): CurrentSearchRequestModel {\r\n if (requestModel.selectedTariff.length === 0 && energyResponse.electricity && energyResponse.electricity.products.length > 0) {\r\n if (requestModel.searchRequestType === SearchRequestType.postcode || energyResponse.electricity.siteData.isDefaultRate) {\r\n requestModel.selectedTariff = 'Single Rate';\r\n } else {\r\n const productWithEstimate = energyResponse.electricity.products.find(\r\n (prod) => prod.priceEstimates && prod.priceEstimates.length > 0\r\n );\r\n if (productWithEstimate) {\r\n requestModel.selectedTariff = productWithEstimate.priceEstimates[0].tariffDescription;\r\n }\r\n }\r\n }\r\n return requestModel;\r\n }\r\n\r\n public getFirstAvailableProductCategory(\r\n bundleSearchResponse: BundleSearchResponse,\r\n isAuthenticated = false\r\n ): FirstAvailableProductCategory {\r\n if (\r\n bundleSearchResponse?.energyProductsResponse?.electricity?.products?.length > 0 &&\r\n !bundleSearchResponse?.energyProductsResponse?.electricity?.siteError &&\r\n !isAuthenticated\r\n ) {\r\n return 'energy';\r\n }\r\n if (\r\n bundleSearchResponse?.energyProductsResponse?.gas?.products?.length > 0 &&\r\n !bundleSearchResponse?.energyProductsResponse?.gas?.siteError &&\r\n !isAuthenticated\r\n ) {\r\n return 'energy';\r\n }\r\n\r\n if (bundleSearchResponse.nbnProductsResponse && bundleSearchResponse.nbnProductsResponse.products?.length > 0) {\r\n if (nbnProductService.IsNBNAvailable(bundleSearchResponse.nbnProductsResponse)) {\r\n return 'nbn';\r\n }\r\n }\r\n\r\n if (bundleSearchResponse.mobileProductsResponse && bundleSearchResponse.mobileProductsResponse.products?.length > 0) {\r\n return 'mobile plan';\r\n }\r\n\r\n return 'none';\r\n }\r\n}\r\n\r\nexport const bundleSearchService = new BundleSearchService();\r\n","import { SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { ObservableMap } from '@stencil/store';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { BundleSearchStore } from 'app/shared/models/current-search-request.model';\r\nimport { ProductCategory } from 'app/shared/models/product-category.model';\r\nimport { removeHandler } from 'app/shared/store/handlers/types/remove-handler';\r\nimport { State } from 'app/shared/store/models/state.model';\r\n\r\nexport const guidedFlowActiveCategoryHandler = (store: ObservableMap): removeHandler => {\r\n const activeCategory = store.get('guidedFlowActiveCategory');\r\n handleCategoryChange(activeCategory, store);\r\n if (activeCategory && activeCategory !== 'none' && !store.get('productCategory')) {\r\n store.set('productCategory', activeCategory);\r\n }\r\n return store.onChange(StoreKeys.guidedFlowActiveCategory, (category) => {\r\n if (category !== 'none') {\r\n store.set('productCategory', category);\r\n }\r\n handleCategoryChange(category, store);\r\n });\r\n};\r\n\r\nconst handleCategoryChange = (category: ProductCategory | 'none', store: ObservableMap) => {\r\n if (category === 'nbn') {\r\n const productSessionData = JSON.parse(sessionStorage.getItem(SessionStorageKeys.bundleProducts)) as BundleSearchStore;\r\n store.set('productDetails', productSessionData.nbnResponse);\r\n } else if (category === 'mobile plan') {\r\n const productSessionData = JSON.parse(sessionStorage.getItem(SessionStorageKeys.bundleProducts)) as BundleSearchStore;\r\n store.set('productDetails', productSessionData.mobileResponse);\r\n }\r\n};\r\n","import { ObservableMap } from '@stencil/store';\r\nimport { State } from 'app/shared/store/models/state.model';\r\nimport { removeHandler } from 'app/shared/store/handlers/types/remove-handler';\r\nimport { flowService } from 'app/shared/services/flow/flow-service';\r\n\r\nexport const flowTypeHandler = (store: ObservableMap): removeHandler => {\r\n return store.onChange('flowType', (flowType) => {\r\n flowService.setFlowType(flowType);\r\n });\r\n};\r\n\r\nexport const addressRequiredHandler = (store: ObservableMap): removeHandler => {\r\n return store.onChange('addressRequired', (addressRequired) => {\r\n flowService.setAddressRequired(addressRequired);\r\n });\r\n};\r\n","import { authService } from '@aglenergy/agl.sales.authentication';\r\nimport { SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { ObservableMap } from '@stencil/store';\r\nimport { dispatchResetCartEvent } from 'app/bundle/store/handlers/cart.handler';\r\nimport { bundleSearchService } from 'app/bundle/services/bundle-search.service';\r\nimport { State } from 'app/shared/store/models/state.model';\r\nimport { removeHandler } from 'app/shared/store/handlers/types/remove-handler';\r\nimport { AddressDetailModel, BundleSearchResponse, BundleSearchStore, CustomerType, ProductCategory } from 'app/shared/models/index';\r\nimport { delayMessageService } from 'app/shared/services/delay-message/delay-message.service';\r\nimport { localStorageService } from 'app/shared/services/local-storage/local-storage.service';\r\nimport { locationService } from 'app/shared/services/location/location-service';\r\nimport { energyRequestMapper } from 'app/energy/mappers/energy-request.mapper';\r\nimport { SearchRequestType } from 'app/shared/models/energy/energy.enums';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { addressService } from 'app/shared/services/address/address.service';\r\nimport { bundleService } from 'app/shared/services/bundle/bundle.service';\r\nimport { abandonCart } from 'app/shared/services/cart/cart.service';\r\n\r\nconst isAddressChanged = (store: ObservableMap): boolean => {\r\n const storeAddress = store.get('address');\r\n const bundleSearchStore = store.get(StoreKeys.bundleSearchStore);\r\n const addressString = addressService.convertAddressToString(storeAddress);\r\n const bundleStoreAddress = bundleSearchStore?.request?.addressString;\r\n return bundleStoreAddress && addressString && bundleStoreAddress !== addressString;\r\n};\r\n\r\nexport const addAddressHandler = (store: ObservableMap, isBundleLandingPage = false): removeHandler => {\r\n return store.onChange('address', async (address) => {\r\n // Reset cart in store when address is changed\r\n const firstLoad = !isBundleLandingPage && !sessionStorage.getItem(SessionStorageKeys.bundleProducts);\r\n if (firstLoad) {\r\n localStorageService.setRegion(address.state);\r\n }\r\n const addressChanged = isAddressChanged(store);\r\n if (addressChanged) {\r\n abandonCart();\r\n store.set(StoreKeys.responseError, null);\r\n localStorageService.setRegion(address.state);\r\n dispatchResetCartEvent();\r\n }\r\n await searchProductAddress(store, address, isBundleLandingPage).then(() => {\r\n const addressInStorage = window.sessionStorage.getItem(SessionStorageKeys.address);\r\n if (addressChanged || firstLoad || (!addressChanged && !isBundleLandingPage && !addressInStorage)) {\r\n window.location.reload();\r\n } else if (isBundleLandingPage && !store.get(StoreKeys.responseError)) {\r\n locationService.navigateToProductBundle();\r\n }\r\n });\r\n });\r\n};\r\n\r\nexport const searchProductAddress = async (\r\n store: ObservableMap,\r\n address: AddressDetailModel,\r\n isBundleLandingPage: boolean\r\n): Promise => {\r\n delayMessageService.startAllTimers();\r\n const productCategories: ProductCategory[] = ['energy', 'nbn', 'mobile plan'];\r\n const searchRequest = energyRequestMapper.mapToCurrentSearchRequestModel(\r\n address,\r\n CustomerType.residential,\r\n productCategories,\r\n SearchRequestType.manualAddress\r\n );\r\n const bundleProductSearchStore: BundleSearchStore = bundleSearchService.loadProductsResponseFromStore(searchRequest);\r\n if (!bundleProductSearchStore) {\r\n store.set('isPersonalisedProductsLoading', true);\r\n store.set(StoreKeys.responseError, null);\r\n const isAuthenticated = authService.isLoggedIn() && window.sessionStorage.getItem('authenticatedGuidedFlowEnabled')?.includes('true');\r\n const productsPromise =\r\n isAuthenticated && !store.get('addressRequired')\r\n ? bundleSearchService.getAuthenticatedProducts()\r\n : bundleSearchService.getProducts(address, null, store.get('couponCode'), store.get('couponCodes'));\r\n productsPromise\r\n .then((productDetails) => {\r\n const bundleProducts: BundleSearchResponse = productDetails as BundleSearchResponse;\r\n const firstAvailableCategory = bundleSearchService.getFirstAvailableProductCategory(bundleProducts, isAuthenticated);\r\n\r\n if (isBundleLandingPage && firstAvailableCategory !== 'energy') {\r\n if (firstAvailableCategory === 'nbn') {\r\n const bundleSearchStore = store.get(StoreKeys.bundleSearchStore);\r\n bundleSearchStore.energyResponse.siteError = {\r\n reasonCode: 'serviceNotAvailable',\r\n description: 'Energy not available, NBN available'\r\n };\r\n store.set(StoreKeys.bundleSearchStore, bundleSearchStore);\r\n } else {\r\n const bundleSearchStore = store.get(StoreKeys.bundleSearchStore);\r\n bundleSearchStore.energyResponse.siteError = {\r\n reasonCode: 'serviceNotAvailable',\r\n description: 'Energy not available, NBN not available'\r\n };\r\n store.set(StoreKeys.bundleSearchStore, bundleSearchStore);\r\n }\r\n } else if (store.get(StoreKeys.guidedFlowActiveCategory) == 'none') {\r\n // As long as energy is available, then will not show error modal and go to bundle builder page\r\n store.set(StoreKeys.guidedFlowActiveCategory, firstAvailableCategory);\r\n }\r\n\r\n // ToDo with another ticket\r\n //Send data to analytics\r\n /*\r\n let event = '[Selection Criteria module]';\r\n const eventData = address.postcode;\r\n const eventType = `[Fuel Type][Manually Changed]`;\r\n event = `${event}${eventType}`;\r\n const data = {\r\n entered_state: address.state,\r\n entered_suburb: address.suburb,\r\n entered_post_code: address.postcode\r\n };\r\n tealiumAnalyticService.createAndSendAddressData(['Address Validated'], eventData, data, 'bundle');\r\n tealiumAnalyticService.trackProductCards([], true, 'bundle');\r\n */\r\n })\r\n .catch((error) => {\r\n store.set(StoreKeys.responseError, error);\r\n sessionStorage.setItem(SessionStorageKeys.bundleProducts, null);\r\n if (error.errorType === 'multipleMatching') {\r\n store.set('addressRequired', true);\r\n }\r\n if (isBundleLandingPage) {\r\n locationService.navigateToProductBundle();\r\n }\r\n })\r\n .finally(() => {\r\n store.set('isPersonalisedProductsLoading', false);\r\n store.set('isPageLoaded', true);\r\n delayMessageService.stopAllTimers();\r\n });\r\n await productsPromise;\r\n } else {\r\n const bundleSearchResponse = {\r\n energyProductsResponse: bundleProductSearchStore.energyResponse,\r\n nbnProductsResponse: bundleProductSearchStore.nbnResponse,\r\n mobileProductsResponse: bundleProductSearchStore.mobileResponse\r\n };\r\n const firstAvailableCategory = bundleSearchService.getFirstAvailableProductCategory(\r\n bundleSearchResponse,\r\n store.get('isAuthenticated') && window.sessionStorage.getItem('authenticatedGuidedFlowEnabled')?.includes('true')\r\n );\r\n const guidedFlowActiveCategory = store.get(StoreKeys.guidedFlowActiveCategory);\r\n const validatedActiveCategory = bundleService.validateActiveCategory(firstAvailableCategory, guidedFlowActiveCategory);\r\n store.set(StoreKeys.guidedFlowActiveCategory, validatedActiveCategory);\r\n if (store.get(StoreKeys.guidedFlowActiveCategory) === 'none') {\r\n sessionStorage.setItem(SessionStorageKeys.bundleProducts, JSON.stringify(bundleProductSearchStore));\r\n }\r\n store.set('isPageLoaded', true);\r\n }\r\n};\r\n","import { SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { store } from 'app/shared/store/store';\r\nimport { bundleSearchService } from 'app/bundle/services/bundle-search.service';\r\nimport { guidedFlowActiveCategoryHandler } from 'app/bundle/store/handlers/guidedFlowActiveCategory.handler';\r\nimport { cartHandler } from 'app/bundle/store/handlers/cart.handler';\r\nimport { addressRequiredHandler, flowTypeHandler } from 'app/bundle/store/handlers/flow.type.handler';\r\nimport { addAddressHandler } from 'app/bundle/store/handlers/bundle.address.handler';\r\nimport { removeHandler } from 'app/shared/store/handlers/types/remove-handler';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { nbnProductService } from 'app/nbn/services/nbn-product/nbn-product.service';\r\nimport { productsSessionStorageService } from 'app/shared/services/product-session-storage/product-session-storage.service';\r\nimport { delayMessageService } from 'app/shared/services/delay-message/delay-message.service';\r\nimport { authenticationService } from 'app/shared/services/authentication/authentication.service';\r\nimport { BundleSearchResponse } from 'app/shared/models/bundle-search-response.model';\r\nimport { flowService } from 'app/shared/services/flow/flow-service';\r\nimport { isLocalDevelopment } from 'app/shared/utilities/helper-functions';\r\nimport { locationService } from 'app/shared/services/location/location-service';\r\nimport { localStorageService } from 'app/shared/services/local-storage/local-storage.service';\r\n\r\nconst registeredHandlers = (isBundleLandingPage = false): removeHandler => {\r\n const removeAddressHandler = addAddressHandler(store, isBundleLandingPage);\r\n const removeFlowTypeHandler = flowTypeHandler(store);\r\n const removeCartHandler = cartHandler(store);\r\n const removeGuidedFlowActiveCategoryHandler = guidedFlowActiveCategoryHandler(store);\r\n const removeAddressRequiredHandler = addressRequiredHandler(store);\r\n return () => {\r\n removeAddressHandler();\r\n removeFlowTypeHandler();\r\n removeCartHandler();\r\n removeGuidedFlowActiveCategoryHandler();\r\n removeAddressRequiredHandler();\r\n };\r\n};\r\n\r\nexport const onStoreInit = async (isGuidedFlow: boolean, isBundleLandingPage = false): Promise => {\r\n registeredHandlers(isBundleLandingPage);\r\n const addressInSessionStorage = sessionStorage.getItem(SessionStorageKeys.address);\r\n const address = addressInSessionStorage && addressInSessionStorage !== 'undefined' ? JSON.parse(addressInSessionStorage) : null;\r\n store.set(StoreKeys.isGuidedFlow, isGuidedFlow);\r\n if (isGuidedFlow) {\r\n const flow = flowService.getFlowDetails();\r\n const addressRequired = flow?.addressRequired;\r\n const pathName = isLocalDevelopment() ? '/apps/comparison/residential/plan-builder' : '/residential/plan-builder';\r\n store.set('addressRequired', addressRequired);\r\n store.set('flowType', 'guided-flow');\r\n\r\n if (!sessionStorage.getItem(SessionStorageKeys.bundleProducts) && window.location.pathname === pathName && !flow?.error) {\r\n locationService.navigateToProductBundleLanding();\r\n }\r\n\r\n if (!isBundleLandingPage) {\r\n const productSessionData = productsSessionStorageService.getLatestProductsByProductCategory('nbn');\r\n await nbnProductService.getVoipProducts(productSessionData?.address?.state).then((voipProductDetails) => {\r\n store.set('voipProductDetails', voipProductDetails);\r\n });\r\n await nbnProductService.getModemProducts(productSessionData?.address?.state).then((modemProductDetails) => {\r\n store.set('modemProductDetails', modemProductDetails);\r\n });\r\n const isAuthenticated = authenticationService.loggedIn;\r\n store.set('isAuthenticated', isAuthenticated);\r\n if (\r\n isAuthenticated &&\r\n window.sessionStorage.getItem('authenticatedGuidedFlowEnabled')?.includes('true') &&\r\n !store.get('addressRequired')\r\n ) {\r\n await bundleSearchService\r\n .getAuthenticatedProducts()\r\n .then((productDetails) => {\r\n const bundleProducts: BundleSearchResponse = productDetails as BundleSearchResponse;\r\n const firstAvailableCategory = bundleSearchService.getFirstAvailableProductCategory(bundleProducts, true);\r\n store.set('address', productDetails.contractAddress);\r\n if (isBundleLandingPage && firstAvailableCategory !== 'energy') {\r\n if (firstAvailableCategory === 'nbn') {\r\n const bundleSearchStore = store.get(StoreKeys.bundleSearchStore);\r\n if (bundleSearchStore) {\r\n bundleSearchStore.energyResponse.siteError = {\r\n reasonCode: 'serviceNotAvailable',\r\n description: 'Energy not available, NBN available'\r\n };\r\n store.set(StoreKeys.bundleSearchStore, bundleSearchStore);\r\n }\r\n } else {\r\n const bundleSearchStore = store.get(StoreKeys.bundleSearchStore);\r\n if (bundleSearchStore) {\r\n bundleSearchStore.energyResponse.siteError = {\r\n reasonCode: 'serviceNotAvailable',\r\n description: 'Energy not available, NBN not available'\r\n };\r\n store.set(StoreKeys.bundleSearchStore, bundleSearchStore);\r\n }\r\n }\r\n } else {\r\n // As long as energy is available, then will not show error modal and go to bundle builder page\r\n store.set(StoreKeys.guidedFlowActiveCategory, firstAvailableCategory);\r\n }\r\n })\r\n .catch((error) => {\r\n store.set(StoreKeys.responseError, error);\r\n })\r\n .finally(() => {\r\n store.set('isPersonalisedProductsLoading', false);\r\n store.set('isPageLoaded', true);\r\n delayMessageService.stopAllTimers();\r\n });\r\n }\r\n }\r\n }\r\n\r\n if (address) {\r\n store.set('address', address);\r\n localStorageService.setRegion(address.state);\r\n }\r\n // TODO: TealiumAnalytic will be added\r\n};\r\n","import { store } from 'app/shared/store/store';\r\nimport { ProductCategory } from 'app/shared/models/product-category.model';\r\nimport { ContentMode } from 'app/shared/models/content.model';\r\nimport { featureService } from 'app/shared/services/feature/feature-service';\r\nimport { FeatureKey } from 'app/shared/models/feature-key';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport * as nbn from 'app/nbn/store/store';\r\nimport * as mobile from 'app/mobile/store/store';\r\nimport * as bundle from 'app/bundle/store/store';\r\nimport { bundleService } from 'app/shared/services/bundle/bundle.service';\r\nimport { isLocalDevelopment } from 'app/shared/utilities/helper-functions';\r\n\r\nexport const initStore = async (\r\n isBundleLandingPage?: boolean,\r\n isGuidedFlow?: boolean,\r\n productCategory?: ProductCategory,\r\n contentMode?: ContentMode,\r\n focusSku?: string,\r\n hostSpa?: string\r\n): Promise => {\r\n // Get and Load feature flags in store\r\n await featureService.loadFeaturesStatus([\r\n FeatureKey.BUNDLE_FLOW_ENABLED,\r\n FeatureKey.NBN_MOVERS_ENABLED,\r\n FeatureKey.NBN_MOVERS_CROSS_SELL_ENABLED\r\n ]);\r\n\r\n /**\r\n * Once category is set we use appropriate product category services\r\n */\r\n store.set('hostSpa', hostSpa);\r\n if (productCategory) {\r\n store.set(StoreKeys.productCategory, productCategory);\r\n }\r\n\r\n store.set('contentMode', contentMode ?? 'publish');\r\n\r\n if (productCategory === 'nbn' && !isGuidedFlow) {\r\n await nbn.onStoreInit(isGuidedFlow);\r\n }\r\n if (productCategory === 'mobile plan' && !isGuidedFlow) {\r\n mobile.onStoreInit(isGuidedFlow);\r\n }\r\n\r\n if (isGuidedFlow) {\r\n bundle.onStoreInit(isGuidedFlow, isBundleLandingPage);\r\n }\r\n const isBundleFlow = bundleService.isExplicitBundleFlow();\r\n store.set('isExplicitBundleFlow', isBundleFlow);\r\n\r\n if (focusSku) {\r\n store.set('focusSku', focusSku);\r\n }\r\n if (isLocalDevelopment()) {\r\n (window as any).store = store;\r\n }\r\n};\r\n","export enum WindowMessageType {\r\n SelectedProductFromAEM = 'selectedProductFromAEM'\r\n}\r\n","import { customerProfileService } from 'app/shared/services/customer-profile/customerProfile-service';\r\nimport { ErrorMessage, ErrorType } from 'app/shared/models/errorModal.model';\r\nimport { FlowType } from 'app/shared/models/flow-details.model';\r\nimport { ProductCategory } from 'app/shared/models/product-category.model';\r\n\r\nclass ErrorMessageService {\r\n public getErrorMessageData(errorType: ErrorType, productCategory?: ProductCategory, flowType?: FlowType): ErrorMessage {\r\n productCategory = productCategory ?? 'nbn';\r\n const productCategoryLabel = productCategory === 'nbn' ? 'internet' : productCategory;\r\n // TODO: contactUrl to be updated\r\n const contactUrl = productCategory === 'nbn' ? '/help-support/contact-us' : '';\r\n const errorMessageData: ErrorMessage = {\r\n errorTitle: 'Something went wrong.',\r\n errorMessage: `Sorry, we’re having trouble showing our ${productCategoryLabel} right now. Please try again soon.`,\r\n contactType: 'redirect',\r\n contactUrl,\r\n showFooter: true,\r\n icon: 'nbn'\r\n };\r\n\r\n if (flowType === 'bundle-flow') {\r\n errorMessageData.buttonLabel = 'Continue with energy';\r\n errorMessageData.buttonUrl = '/get-connected/electricity-gas-plans/vic/comparison?cidi=hp-ql-cp';\r\n switch (errorType) {\r\n case 'serviceNotAvailable':\r\n errorMessageData.errorMessage =\r\n 'Sorry, we can’t connect an nbn service at your address right now. But we can get your energy connected.';\r\n break;\r\n case 'multipleMatching':\r\n errorMessageData.errorMessage =\r\n 'We’ve found more than one property that matches the address you entered. Please try again or continue with energy only.';\r\n break;\r\n case 'systemError':\r\n errorMessageData.errorMessage = `Sorry, we’re having trouble showing our ${productCategoryLabel} plans right now. But we can get your energy connected.`;\r\n break;\r\n default:\r\n break;\r\n }\r\n } else if (flowType === 'guided-flow') {\r\n const path = window.location.origin + window.location.pathname.replace(/\\/+$/, '');\r\n const buttonUrl = `${path}?cidi=A10846`;\r\n errorMessageData.buttonLabel = 'Try again';\r\n errorMessageData.buttonUrl = buttonUrl;\r\n errorMessageData.contactType = 'redirect';\r\n errorMessageData.forceRefresh = true;\r\n switch (errorType) {\r\n case 'multipleMatching':\r\n errorMessageData.errorMessage =\r\n 'We’ve found more than one property that matches the address you entered. Please try again or continue with energy only.';\r\n break;\r\n case 'systemError':\r\n errorMessageData.errorMessage =\r\n 'Sorry, we’re having trouble showing our plans right now. Please try again. If you have any questions or need more help, please contact us.';\r\n break;\r\n default:\r\n break;\r\n }\r\n } else if (flowType === 'movers-flow') {\r\n if (errorType === 'systemError') {\r\n errorMessageData.buttonUrl = '/apps/confirm/?#/movers/address';\r\n }\r\n\r\n switch (errorType) {\r\n case 'serviceNotAvailable':\r\n errorMessageData.errorTitle = 'Unable to connect you';\r\n errorMessageData.errorMessage = 'Unfortunately we cannot connect your address to the ';\r\n errorMessageData.errorMessageExtended =\r\n ' network at this stage. This might be because your address is not serviceable by us or by NBN Co.';\r\n errorMessageData.secondErrorMessage = 'Check your address with NBN Co to see what options are available.';\r\n errorMessageData.contactType = null;\r\n errorMessageData.buttonLabel = 'Check address';\r\n errorMessageData.buttonUrl = 'https://www.nbnco.com.au/connect-home-or-business/check-your-address?';\r\n errorMessageData.buttonOpenNewWindow = true;\r\n break;\r\n case 'multipleMatching':\r\n errorMessageData.errorMessage =\r\n 'We’ve found more than one property that matches the address you entered. Please try again or continue with energy only.';\r\n break;\r\n case 'systemError':\r\n errorMessageData.errorTitle = 'Please try again later';\r\n errorMessageData.errorMessage = `Sorry we’re having trouble showing our internet plans right now. Please try again soon.`;\r\n errorMessageData.buttonLabel = 'Try again';\r\n errorMessageData.buttonUrl = '/apps/confirm/?#/movers/address';\r\n break;\r\n default:\r\n break;\r\n }\r\n } else if (flowType === 'movers-bundle-flow') {\r\n const customerProfile = customerProfileService.getCustomerProfile();\r\n\r\n if (errorType === 'serviceNotAvailable' && customerProfile?.isMobileUpdated) {\r\n errorMessageData.buttonUrl = '/residential/mobile/moving';\r\n } else {\r\n errorMessageData.buttonUrl = '/cart?cidi=A11097';\r\n }\r\n switch (errorType) {\r\n case 'serviceNotAvailable':\r\n errorMessageData.errorTitle = 'Unable to connect internet';\r\n errorMessageData.errorMessage = 'Unfortunately, we cannot connect your new address to the ';\r\n errorMessageData.errorMessageExtended =\r\n ' service at this stage. This might be because your new address is not serviceable by us or by NBN Co.';\r\n errorMessageData.contactType = 'moversContactUs';\r\n errorMessageData.buttonLabel = 'Continue without internet';\r\n break;\r\n case 'multipleMatching':\r\n errorMessageData.errorMessage =\r\n 'We’ve found more than one property that matches the address you entered. Please try again or continue with energy only.';\r\n break;\r\n case 'systemError':\r\n errorMessageData.errorTitle = 'Please try again later';\r\n errorMessageData.errorMessage = `Sorry we’re having trouble showing our internet plans right now. Please try again soon.`;\r\n errorMessageData.buttonLabel = 'Try again';\r\n errorMessageData.buttonUrl = '/apps/confirm/?#/movers/address';\r\n break;\r\n default:\r\n break;\r\n }\r\n } else {\r\n errorMessageData.forceRefresh = true;\r\n const path = window.location.origin + window.location.pathname.replace(/\\/+$/, '');\r\n const buttonUrl = `${path}?cidi=A10846`;\r\n switch (errorType) {\r\n case 'hfcServiceNotAvailable':\r\n errorMessageData.errorMessage = `Unfortunately, because your address has an nbn HFC connection type, we’re not currently able to connect you. This is due to a global shortage of available chipsets for HFC NTD boxes experienced by nbn co. More information can be found in the section below called `;\r\n errorMessageData.contactType = 'getInTouch';\r\n errorMessageData.buttonLabel = 'Contact us';\r\n errorMessageData.buttonUrl = contactUrl;\r\n errorMessageData.buttonOpenNewWindow = true;\r\n errorMessageData.messageUrl = `${path}#hfc`;\r\n errorMessageData.messageLinkText = 'Non-serviceable HFC addresses';\r\n errorMessageData.forceRefresh = false;\r\n break;\r\n case 'serviceNotAvailable':\r\n errorMessageData.errorTitle = 'Unable to connect you';\r\n errorMessageData.errorMessage = 'Unfortunately we cannot connect your address to the ';\r\n errorMessageData.errorMessageExtended =\r\n ' network at this stage. This might be because your address is not serviceable by us or by NBN Co.';\r\n errorMessageData.secondErrorMessage = 'Check your address with NBN Co to see what options are available.';\r\n errorMessageData.contactType = null;\r\n errorMessageData.buttonLabel = 'Check address';\r\n errorMessageData.buttonUrl = 'https://www.nbnco.com.au/connect-home-or-business/check-your-address?';\r\n errorMessageData.buttonOpenNewWindow = true;\r\n break;\r\n case 'multipleMatching':\r\n errorMessageData.errorMessage = 'We’ve found more than one property that matches the address you entered.';\r\n errorMessageData.contactType = 'tryAgainOrRedirect';\r\n errorMessageData.buttonLabel = 'Try again';\r\n errorMessageData.buttonUrl = buttonUrl;\r\n break;\r\n case 'systemError':\r\n errorMessageData.errorMessage = `Sorry, we’re having trouble showing our ${productCategoryLabel} plans right now. Please try again soon.`;\r\n errorMessageData.buttonLabel = 'Try again';\r\n errorMessageData.buttonUrl = buttonUrl;\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n return errorMessageData;\r\n }\r\n}\r\n\r\nexport const errorMessageService = new ErrorMessageService();\r\n","import { FunctionalComponent, JSX, h } from '@stencil/core';\r\nimport { store } from 'app/shared/store/store';\r\nimport { getContent, replacePlaceholders } from 'app/shared/utilities/helper-functions';\r\nimport { ErrorType, FeatureKey, ProductCatalogueProduct, TechnologyTypeProps } from 'app/shared/models/index';\r\nimport { NbnProductsResponse } from 'app/nbn/models/nbn-products-response.model';\r\nimport { authenticationService, customerProfileService, featureService, tealiumAnalyticService } from 'app/shared/services/index';\r\n\r\nexport const showNbnSqMessage = (\r\n nbnProductDetails: NbnProductsResponse,\r\n address: string,\r\n isGuidedFlow: boolean,\r\n isNbnMoversCrossSell = false\r\n): JSX.Element => {\r\n const delayMessage = store.get('delayMessage');\r\n\r\n if (isGuidedFlow) {\r\n return null;\r\n }\r\n\r\n return (\r\n
{renderTechTypeMessage(nbnProductDetails, address, false, delayMessage, false, null, isGuidedFlow, isNbnMoversCrossSell)}
\r\n );\r\n};\r\n\r\nconst getTechnologyTypeString = (technologyType: string): string => {\r\n const type = technologyType ? technologyType.toUpperCase() : '';\r\n switch (type) {\r\n case 'FIBRE':\r\n return 'Fibre to the Premises';\r\n case 'FTTN':\r\n return 'Fibre to the Node';\r\n case 'FTTC':\r\n return 'Fibre to the Curb';\r\n case 'FTTB':\r\n return 'Fibre to the Building';\r\n case 'HFC':\r\n return 'Hybrid Fibre Coaxial';\r\n case 'WIRELESS':\r\n return 'Fixed Wireless';\r\n case 'LTSS':\r\n return 'Satellite';\r\n default:\r\n return undefined;\r\n }\r\n};\r\n\r\nexport const NbnTechnologyTypeMessage: FunctionalComponent = ({\r\n technologyType,\r\n noService,\r\n isLoading,\r\n delayMessage,\r\n noHfcService,\r\n isGuidedFlow = false,\r\n eligibleFibreUpgrade = false,\r\n cheapestEligiblePlan,\r\n isNbnMoversCrossSell = false\r\n}) => {\r\n const styledAs = isGuidedFlow ? 'xl' : 'lg';\r\n\r\n if (noHfcService === true && !isNbnMoversCrossSell) {\r\n const path = window.location.origin + window.location.pathname.replace(/\\/+$/, '');\r\n const errText = `Unfortunately, because your address has an nbn HFC connection type, we’re not currently able to connect you, due to a global supply shortage experienced by nbn co. More information can be found in the section below called `;\r\n return (\r\n \r\n \r\n {errText}\r\n \r\n Non-serviceable HFC addresses\r\n \r\n .\r\n \r\n \r\n );\r\n }\r\n\r\n if (noService === true && !isNbnMoversCrossSell) {\r\n return (\r\n \r\n Looks like we don't provide internet service at above address.\r\n \r\n );\r\n }\r\n\r\n if (isLoading && delayMessage && !isNbnMoversCrossSell) {\r\n return (\r\n \r\n {delayMessage}\r\n \r\n );\r\n }\r\n\r\n if (!technologyType && !isNbnMoversCrossSell) {\r\n return (\r\n \r\n See plans available at your address\r\n \r\n );\r\n }\r\n\r\n const key = eligibleFibreUpgrade ? 'sqResponseMessageFibreUpgrade' : 'sqResponseMessage';\r\n let message = getContent(key);\r\n if (!message) {\r\n return null;\r\n }\r\n\r\n const replacements = {\r\n technologyType,\r\n technologyTypeString: getTechnologyTypeString(technologyType),\r\n cheapestEligiblePlan\r\n };\r\n\r\n message = replacePlaceholders(message, replacements);\r\n\r\n const nbnMoversTechTypes = ['FTTP', 'FTTN', 'HFC', 'FIBRE', 'FTTC', 'FTTB', 'FW', 'WIRELESS'];\r\n const validTechType = nbnMoversTechTypes.includes(technologyType.toUpperCase());\r\n const isMoversFlow = sessionStorage.getItem('appConfig') === 'movers';\r\n const featureFlag = featureService.getFeatureStatus(FeatureKey.NBN_MOVERS_ENABLED);\r\n const customerProfile = customerProfileService.getCustomerProfile();\r\n const isExistingUser = !customerProfile?.isNewCustomer || authenticationService.loggedIn;\r\n const isFibreUpgrade = eligibleFibreUpgrade === 'FIBRE';\r\n\r\n const mismatchedTechTypeMessage = `\r\n
\r\n \r\n Can't see your current plan? This could mean the technology type at your new address is different to your old address. \r\n \r\n \r\n Learn more about technology types\r\n \r\n
\r\n `;\r\n\r\n if (isNbnMoversCrossSell) {\r\n return ;\r\n } else if (validTechType && isExistingUser && isMoversFlow && featureFlag && !isFibreUpgrade) {\r\n return (\r\n
\r\n \r\n \r\n
\r\n );\r\n }\r\n return ;\r\n};\r\n\r\nexport const getCheapestFibreUpgradePlan = (productDetails: NbnProductsResponse): string => {\r\n const eligiblePlans = productDetails.products.filter((p) => p?.fibreUpgrade === true);\r\n let cheapestEligiblePlan: ProductCatalogueProduct = null;\r\n if (eligiblePlans.length > 0) {\r\n cheapestEligiblePlan = eligiblePlans.sort((p1, p2) => parseInt(p1.price, 10) - parseInt(p2.price, 10))[0];\r\n return cheapestEligiblePlan.content.productName;\r\n }\r\n\r\n return 'No Fibre Connect plan found';\r\n};\r\n\r\nexport const renderTechTypeMessage = (\r\n productDetails: NbnProductsResponse,\r\n selectedAddressString: string,\r\n isLoading: boolean,\r\n delayMessage: string,\r\n hasError: boolean,\r\n errorType: ErrorType,\r\n isGuidedFlow = false,\r\n isNbnMoversCrossSell = false\r\n): JSX.Element => {\r\n if (hasError && selectedAddressString) {\r\n tealiumAnalyticService.sendAnalyticsError(\r\n '[BCP][Search][Address][Error]',\r\n null,\r\n `We don't provide internet service at above address`,\r\n 'Inline'\r\n );\r\n if (errorType === 'hfcServiceNotAvailable') {\r\n return ;\r\n }\r\n return ;\r\n } else if (isLoading && delayMessage) {\r\n return ;\r\n } else if (!productDetails?.serviceQualification) {\r\n return ;\r\n }\r\n const eligibleFibreUpgrade = productDetails.serviceQualification.nbn.alternativeServiceType;\r\n\r\n const cheapestEligiblePlan = getCheapestFibreUpgradePlan(productDetails);\r\n return (\r\n \r\n );\r\n};\r\n","/* stylelint-disable selector-type-no-unknown */\r\n.spacontainerv2 > agl-spa-shell > app-address-search {\r\n display: block;\r\n z-index: 500;\r\n margin-top: -50px;\r\n\r\n @include agl-ds-screen-size('large') {\r\n margin-top: -50px;\r\n }\r\n}\r\n\r\n.address-search {\r\n padding-top: $space-03;\r\n display: flex;\r\n flex-direction: column;\r\n box-shadow: 0 4px 12px 1px rgb(43 46 49 / 16%);\r\n border-radius: 16px;\r\n background-color: $c-neutral-08;\r\n width: 100%;\r\n\r\n @include agl-ds-screen-size('large') {\r\n width: 83%;\r\n margin: 0 auto;\r\n }\r\n\r\n &__container {\r\n padding-left: $space-02;\r\n padding-right: $space-02;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n padding-left: $space-04;\r\n padding-right: $space-04;\r\n }\r\n }\r\n\r\n &.standalone-box {\r\n border-radius: 16px;\r\n box-shadow: 0 4px 12px 1px #2b2e3129;\r\n }\r\n\r\n &__title {\r\n color: $c-neutral-01;\r\n font-size: 16px;\r\n font-weight: $font-weight-semi-bold;\r\n font-family: $font-family-02;\r\n\r\n @include agl-ds-screen-size('large') {\r\n font-size: 18px;\r\n }\r\n }\r\n\r\n &__input {\r\n width: 100%;\r\n\r\n /* stylelint-disable-next-line selector-id-pattern */\r\n #address-search-label_textBox {\r\n font-weight: $font-weight-regular;\r\n font-size: 16px;\r\n height: auto;\r\n padding-top: 12px;\r\n padding-bottom: 12px;\r\n line-height: 1.5;\r\n\r\n /* stylelint-disable-next-line selector-class-pattern */\r\n &.agl-ds-textbox-experiential__input--valid {\r\n border-bottom-color: $c-neutral-02;\r\n }\r\n }\r\n\r\n /* stylelint-disable-next-line selector-class-pattern */\r\n .loading-indicator.loading-indicator--experiential {\r\n top: 10px;\r\n }\r\n\r\n /* stylelint-disable-next-line selector-class-pattern */\r\n .text-input__icon.text-input__icon--experiential.sc-agl-ds-textbox {\r\n top: 10px;\r\n }\r\n }\r\n\r\n /* stylelint-disable-next-line selector-class-pattern */\r\n span.loading-overlay.loading-overlay--experiential {\r\n height: 40px;\r\n }\r\n\r\n &.center {\r\n margin: auto;\r\n padding-left: 16px;\r\n padding-right: 16px;\r\n width: 100%;\r\n }\r\n\r\n /* stylelint-disable-next-line selector-class-pattern */\r\n .message-container__validation-text-section {\r\n padding-left: 0;\r\n }\r\n\r\n .message-container {\r\n margin-bottom: 0;\r\n }\r\n\r\n .sq-message-container > p:last-of-type {\r\n margin-bottom: 0;\r\n }\r\n\r\n /* stylelint-disable-next-line selector-class-pattern */\r\n .agl-ds-autocomplete__dropdown--experiential {\r\n top: 50px;\r\n }\r\n\r\n /* stylelint-disable-next-line selector-class-pattern */\r\n @include agl-ds-screen-size('medium') {\r\n /* stylelint-disable-next-line selector-class-pattern */\r\n .agl-ds-autocomplete__dropdown--experiential {\r\n top: 50px;\r\n }\r\n }\r\n\r\n .sq-message-container > h2,\r\n .sq-message-container > p:first-of-type > b:first-child {\r\n background-repeat: no-repeat;\r\n background-position: left center;\r\n background-image: url(\"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M12 24C14.3734 24 16.6935 23.2962 18.6668 21.9776C20.6402 20.6591 22.1783 18.7849 23.0866 16.5922C23.9948 14.3995 24.2324 11.9867 23.7694 9.65892C23.3064 7.33115 22.1635 5.19295 20.4853 3.51472C18.8071 1.83649 16.6689 0.693605 14.3411 0.230582C12.0133 -0.232441 9.60051 0.00519943 7.4078 0.913451C5.21509 1.8217 3.34094 3.35977 2.02236 5.33316C0.703788 7.30655 0 9.62663 0 12C0.000132598 15.1826 1.26446 18.2347 3.51487 20.4851C5.76527 22.7355 8.81744 23.9999 12 24ZM11 6.00001C11 5.73479 11.1054 5.48043 11.2929 5.2929C11.4804 5.10536 11.7348 5.00001 12 5.00001C12.2652 5.00001 12.5196 5.10536 12.7071 5.2929C12.8946 5.48043 13 5.73479 13 6.00001V13C13 13.2652 12.8946 13.5196 12.7071 13.7071C12.5196 13.8946 12.2652 14 12 14C11.7348 14 11.4804 13.8946 11.2929 13.7071C11.1054 13.5196 11 13.2652 11 13V6.00001ZM12 16C12.2967 16 12.5867 16.088 12.8334 16.2528C13.08 16.4176 13.2723 16.6519 13.3858 16.926C13.4994 17.2001 13.5291 17.5017 13.4712 17.7926C13.4133 18.0836 13.2704 18.3509 13.0607 18.5607C12.8509 18.7704 12.5836 18.9133 12.2926 18.9712C12.0017 19.0291 11.7001 18.9994 11.426 18.8858C11.1519 18.7723 10.9176 18.58 10.7528 18.3334C10.588 18.0867 10.5 17.7967 10.5 17.5C10.5 17.1022 10.658 16.7207 10.9393 16.4393C11.2206 16.158 11.6022 16 12 16Z' fill='%236031A6'/%3E%3C/svg%3E\");\r\n padding-left: 32px;\r\n font-size: 18px;\r\n line-height: 24px;\r\n font-weight: 600;\r\n display: block;\r\n clear: both;\r\n margin-bottom: 8px;\r\n }\r\n}\r\n\r\n/* stylelint-disable-next-line selector-class-pattern */\r\n.address-search-techtype__container {\r\n background-color: $c-neutral-07;\r\n padding: $space-01 $space-02 $space-01 $space-02;\r\n border-radius: 0 0 16px 16px;\r\n\r\n @include agl-ds-screen-size('large') {\r\n padding-left: $space-04;\r\n padding-right: $space-04;\r\n }\r\n}\r\n","import { Component, ComponentInterface, Element, JSX, Listen, Prop, State, h } from '@stencil/core';\r\nimport { ProductCategory as ProductCategoryEnum } from '@aglenergy/shared-library';\r\n// eslint-disable-next-line import/no-unresolved\r\nimport { ModalCloseAction } from '@aglenergy/design-system/dist/types/components/core/modal/modal/modal.types';\r\nimport { NbnProductsResponse, isNbnAddressSuccessResponse } from 'app/nbn/models/nbn-products-response.model';\r\nimport { store } from 'app/shared/store/store';\r\nimport { initStore } from 'app/shared/store/init-store';\r\n\r\nimport {\r\n AddressDetailModel,\r\n ContentMode,\r\n Context,\r\n DataSpaKey,\r\n ErrorMessage,\r\n ProductCategory,\r\n ProductsResponse,\r\n ResponseError\r\n} from 'app/shared/models/index';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { WindowMessageType } from 'app/shared/constants/window-message-type.enum';\r\nimport { addressService } from 'app/shared/services/address/address.service';\r\nimport { bundleService } from 'app/shared/services/bundle/bundle.service';\r\nimport { configService } from 'app/shared/services/config/config.service';\r\nimport { errorMessageService } from 'app/shared/services/error-message/error-message.service';\r\nimport { flowService } from 'app/shared/services/flow/flow-service';\r\nimport { getDataSpaSearchParams } from 'app/shared/utilities/helper-functions';\r\nimport { nbnProductSearchApiService } from 'app/nbn/services/nbn-product-search-api/nbn-product-search-api.service';\r\nimport { nbnProductService } from 'app/nbn/services/nbn-product/nbn-product.service';\r\nimport { productService } from 'app/shared/services/productService/product.service';\r\nimport { renderTechTypeMessage } from 'app/nbn/components/nbn-technology-type-message/nbn-technology-type-message';\r\nimport { scrollToElement } from 'utils/dom.helper';\r\nimport { tealiumAnalyticService } from 'app/shared/services/tealium/tealium-analytics.service';\r\nimport { ErrorModal } from 'app/shared/components/error-modal/error-modal';\r\nimport { onGuidedFlowLoad } from 'app/bundle/store/actions/cartActions';\r\nimport { openApiService } from 'app/shared/services/open-api/open-api.service';\r\nimport { productsSessionStorageService } from 'app/shared/services';\r\n\r\n@Component({\r\n tag: 'app-address-search',\r\n styleUrl: 'address-search.scss'\r\n})\r\nexport class AddressSearch implements ComponentInterface {\r\n @Prop() public readonly dataSpa: string = null;\r\n @Prop() public readonly searchTitle: string = null;\r\n\r\n private aglDsAddressSearchRef: any;\r\n private manualRef: any;\r\n private enableLoginCta = false;\r\n private errorModalRef: ErrorModal;\r\n private hasError = false;\r\n private isAddressCheck = false;\r\n private isGuidedFlow = false;\r\n private aemSearchTitle: string = null;\r\n private placeholder: string = null;\r\n private alignment: string = null;\r\n private autoSelectedAddress: string = null;\r\n private manualAddressCloseAction: ModalCloseAction;\r\n private aemCIFIntegration: boolean;\r\n private isMoversFlow = false;\r\n private isInternetPlansPage = false;\r\n\r\n @State() private locationId: string = null;\r\n @State() private isNbnMovers = false;\r\n\r\n private get productCategory(): ProductCategory {\r\n return store.get(StoreKeys.productCategory);\r\n }\r\n private get productCategoryText(): string {\r\n const productText = this.productCategory === 'nbn' ? 'internet' : this.productCategory;\r\n return productText ? productText : '';\r\n }\r\n\r\n @Element() private el: HTMLAglDsAddressSearchElement;\r\n\r\n public async componentWillLoad(): Promise {\r\n const dataSpaParamValue = getDataSpaSearchParams(this.dataSpa);\r\n this.isGuidedFlow = dataSpaParamValue?.getBoolean(DataSpaKey.isGuidedFlow);\r\n this.enableLoginCta = dataSpaParamValue?.getBoolean(DataSpaKey.enableLoginCta);\r\n this.aemSearchTitle = dataSpaParamValue?.get(DataSpaKey.addressBarTitle);\r\n this.placeholder = dataSpaParamValue?.get(DataSpaKey.addressBarPlaceholder);\r\n this.alignment = dataSpaParamValue?.get(DataSpaKey.addressBarAlignment);\r\n this.aemCIFIntegration = dataSpaParamValue?.getBoolean(DataSpaKey.aemCIFIntegration);\r\n store.set(StoreKeys.aemCIFIntegrationEnabled, this.aemCIFIntegration);\r\n this.locationId = new URLSearchParams(window.location.search.toUpperCase()).get('LOCID');\r\n const isCampaignPage = dataSpaParamValue?.getBoolean(DataSpaKey.isCampaignPage);\r\n store.set(StoreKeys.isCampaignPage, isCampaignPage);\r\n const webIDForCampaign = new URLSearchParams(window.location.search.toUpperCase()).get('WEBID');\r\n const mode = dataSpaParamValue?.get(DataSpaKey.mode);\r\n const contentMode = dataSpaParamValue?.get(DataSpaKey.mode) as ContentMode;\r\n store.set('contentMode', contentMode ?? 'publish'); // setting this earlier before initStore as configService.loadConfig needs it for the general content call\r\n\r\n let host = '';\r\n if (mode === 'publish') {\r\n host = '/apps/comparison';\r\n } else {\r\n host = dataSpaParamValue?.get(DataSpaKey.host);\r\n }\r\n\r\n const previousWebId = productsSessionStorageService.getLatestWebIdFromProducts();\r\n\r\n if (isCampaignPage) {\r\n store.set(StoreKeys.webId, webIDForCampaign);\r\n\r\n if (previousWebId?.toUpperCase() !== webIDForCampaign?.toUpperCase()) {\r\n productsSessionStorageService.removeProducts();\r\n }\r\n } else if (previousWebId) {\r\n productsSessionStorageService.removeProducts();\r\n }\r\n\r\n this.isMoversFlow = sessionStorage.getItem('appConfig') === 'movers';\r\n\r\n if (dataSpaParamValue) {\r\n this.isNbnMovers = dataSpaParamValue.get(DataSpaKey.isNbnMovers) === 'true';\r\n this.isInternetPlansPage = dataSpaParamValue.get(DataSpaKey.isInternetPlansPage) === 'true';\r\n }\r\n\r\n if (this.locationId) {\r\n return configService.loadConfig('/apps/comparison').then(() => {\r\n store.set(StoreKeys.prefillAddress, true);\r\n tealiumAnalyticService.trackPrefillAddress('Started', 'Prefill Address from LocId', ProductCategoryEnum.Nbn);\r\n return nbnProductSearchApiService.getNbnAddress(this.locationId).then((res) => {\r\n if (isNbnAddressSuccessResponse(res)) {\r\n this.autoSelectedAddress = res.addressLong;\r\n tealiumAnalyticService.trackPrefillAddress(\r\n 'Address Validated',\r\n 'Prefill Address Validated Successfully',\r\n ProductCategoryEnum.Nbn\r\n );\r\n } else {\r\n store.set(StoreKeys.prefillAddress, false);\r\n tealiumAnalyticService.sendAnalyticsError('[BCP][Search][Address][Prepopulated][Error]', res.message, res.code, 'API');\r\n }\r\n });\r\n });\r\n }\r\n\r\n if (this.isGuidedFlow) {\r\n store.set('isGuidedFlow', this.isGuidedFlow);\r\n const couponCode = dataSpaParamValue.get(DataSpaKey.couponCode);\r\n const nbnCouponCode = dataSpaParamValue.get(DataSpaKey.nbnCouponCode);\r\n const mobileCouponCode = dataSpaParamValue.get(DataSpaKey.mobileCouponCode);\r\n if (couponCode) {\r\n store.set('couponCode', couponCode);\r\n }\r\n if (mobileCouponCode) {\r\n store.set('couponCodes', [...store.get('couponCodes'), { couponCode: mobileCouponCode, productCategory: 'mobile plan' }]);\r\n }\r\n if (nbnCouponCode) {\r\n store.set('couponCodes', [...store.get('couponCodes'), { couponCode: nbnCouponCode, productCategory: 'nbn' }]);\r\n }\r\n await configService.loadConfig(host).then(async () => {\r\n await initStore(this.enableLoginCta, this.isGuidedFlow, null, contentMode, null, host).then(() => {\r\n openApiService.setBaseUrl();\r\n onGuidedFlowLoad();\r\n });\r\n });\r\n }\r\n\r\n if (this.aemCIFIntegration) {\r\n const productCategory = dataSpaParamValue.get(DataSpaKey.productcategory) as ProductCategory;\r\n store.onChange('productDetails', (productDetails) => {\r\n this.sendProductsToAEM(productDetails, store.get('address'));\r\n });\r\n await configService.loadConfig(host).then(async () => {\r\n await initStore(false, false, productCategory, contentMode, null, host);\r\n });\r\n\r\n window.postMessage(\r\n {\r\n spaCategory: store.get(StoreKeys.productCategory),\r\n eventType: 'spa-loaded',\r\n eventData: {\r\n isAddressEntered: store.get('address') ? addressService.convertAddressToString(store.get('address'))?.length > 0 : false\r\n }\r\n },\r\n '*'\r\n );\r\n\r\n window.addEventListener('message', (event) => {\r\n const selectedProductFromAEM = event.data;\r\n const productDetails = store.get(StoreKeys.productDetails);\r\n if (selectedProductFromAEM.type === WindowMessageType.SelectedProductFromAEM && productDetails?.products.length > 0) {\r\n productService.onSelectedProductForNbn(productDetails.products, store.get('address'), event.data.data);\r\n }\r\n });\r\n }\r\n }\r\n\r\n private checkValidationError = (errors: Error[]): void => {\r\n this.hasError = false;\r\n store.set('showValidIcon', false);\r\n\r\n if (this.aglDsAddressSearchRef) {\r\n const addressSearch = this.aglDsAddressSearchRef;\r\n const inputAddress: HTMLFormElement = addressSearch.querySelector('input');\r\n\r\n if (errors && errors.length > 0) {\r\n const error = errors.filter((e) => e.name === 'address');\r\n if (error) {\r\n this.hasError = true;\r\n setTimeout(() => {\r\n inputAddress.focus();\r\n }, 1000);\r\n scrollToElement(addressSearch as HTMLElement, 50);\r\n }\r\n } else if (store.get('address')) {\r\n store.set('showValidIcon', true);\r\n }\r\n }\r\n };\r\n\r\n private checkResponseError = (responseError: ResponseError, productCategory?: ProductCategory): void => {\r\n if (responseError?.errorType === 'aborted') {\r\n return;\r\n }\r\n const flowType = flowService.getFlowTypeFromStore();\r\n if (responseError?.errorType === 'serviceNotAvailable') {\r\n const errorMessageData = errorMessageService.getErrorMessageData(responseError?.errorType, productCategory, flowType);\r\n this.showErrorModal(errorMessageData);\r\n tealiumAnalyticService.sendAnalyticsError('[BCP][Product Cards][Error]', '', 'serviceNotAvailable', 'API');\r\n } else if (responseError?.errorType === 'multipleMatching') {\r\n this.manualRef.openModal(null);\r\n\r\n tealiumAnalyticService.sendAnalyticsError('[BCP][Product Cards][Error]', '', responseError.message, 'API');\r\n } else if ((responseError || responseError?.errorType === 'systemError') && this.isAddressCheck) {\r\n if (!this.isGuidedFlow) {\r\n const errorMessageData = errorMessageService.getErrorMessageData('systemError', productCategory, flowType);\r\n this.showErrorModal(errorMessageData);\r\n }\r\n tealiumAnalyticService.sendAnalyticsError('[BCP][Product Cards][Error]', '', responseError.message, 'API');\r\n }\r\n };\r\n\r\n private checkSiteError(productDetails: ProductsResponse, productCategory: ProductCategory): void {\r\n if (productCategory !== 'energy') {\r\n if (productDetails?.siteError?.reasonCode === 'NotFound') {\r\n const flowType = flowService.getFlowTypeFromStore();\r\n const errorMessageData = errorMessageService.getErrorMessageData('serviceNotAvailable', productCategory, flowType);\r\n this.showErrorModal(errorMessageData);\r\n this.hasError = true;\r\n } else if (productDetails?.siteError?.reasonCode === 'MultipleChoices') {\r\n this.manualRef.openModal(null);\r\n }\r\n }\r\n }\r\n\r\n private setAddressString(addressDetailModel: AddressDetailModel): string {\r\n let addressString: string;\r\n if (addressDetailModel.poBoxType) {\r\n const poBoxNumber =\r\n addressDetailModel.poBoxNumber !== null && addressDetailModel.poBoxNumber !== undefined ? addressDetailModel.poBoxNumber : '';\r\n addressString =\r\n `${addressDetailModel.poBoxType} ${poBoxNumber}, ${addressDetailModel.suburb} ${addressDetailModel.state} ${addressDetailModel.postcode}`.trimLeft();\r\n } else {\r\n const unitNumber =\r\n addressDetailModel.unitNumber !== null && addressDetailModel.unitNumber !== undefined ? addressDetailModel.unitNumber : '';\r\n addressString =\r\n `${unitNumber} ${addressDetailModel.streetNumber} ${addressDetailModel.streetName} ${addressDetailModel.streetType}, ${addressDetailModel.suburb} ${addressDetailModel.state} ${addressDetailModel.postcode}`.trimLeft();\r\n }\r\n return addressString;\r\n }\r\n\r\n @Listen('addressSearchInput')\r\n public onAddressChange(): void {\r\n store.set('showValidIcon', false);\r\n }\r\n\r\n private onManualAddressModalClose() {\r\n const manualAddressModalElement = document.querySelector('#manual-entry-modal');\r\n if (manualAddressModalElement) {\r\n manualAddressModalElement.addEventListener('modalClosed', () => {\r\n if (this.manualAddressCloseAction !== 'manual') {\r\n this.aglDsAddressSearchRef.setTextBoxValue(null);\r\n this.isAddressCheck = false;\r\n store.set('address', null);\r\n store.set('showValidIcon', false);\r\n }\r\n });\r\n }\r\n }\r\n\r\n private setAddressValue = (addressValue: string): void => {\r\n tealiumAnalyticService.createAndSendAddressData(['Started'], '', '', store.get(StoreKeys.productCategory));\r\n if (this.aglDsAddressSearchRef?.setTextBoxValue) {\r\n this.aglDsAddressSearchRef?.setTextBoxValue(addressValue);\r\n }\r\n this.isAddressCheck = true;\r\n };\r\n\r\n private getNbnMoversSearchTitle(): string {\r\n if (this.isMoversFlow) {\r\n return 'Your new address';\r\n }\r\n return null;\r\n }\r\n\r\n public showErrorModal(errorMessageData: ErrorMessage): void {\r\n this.errorModalRef.errorMessageData = errorMessageData;\r\n this.errorModalRef.showModal(this.el);\r\n this.hasError = true;\r\n tealiumAnalyticService.sendAnalyticsError('[Bundle Builder][Error Popup][Shown]', null, errorMessageData.errorMessage, 'Inline');\r\n }\r\n\r\n public getValidationText(productCategory: ProductCategory, productDetails: ProductsResponse, responseError: ResponseError): string {\r\n if (productCategory === 'nbn') {\r\n const defaultAddrNoService = nbnProductService.hasNoService(productDetails as NbnProductsResponse);\r\n const selectedAddrNoService = nbnProductService.isServiceNotAvailable(responseError);\r\n return selectedAddrNoService || defaultAddrNoService ? '' : 'No address selected.';\r\n }\r\n return '';\r\n }\r\n\r\n public runProductValidators(productCategory: ProductCategory, productDetails: ProductsResponse): void {\r\n if (productCategory === 'nbn') {\r\n if (nbnProductService.hasNoService(productDetails as NbnProductsResponse)) {\r\n const errorMessageData = errorMessageService.getErrorMessageData(\r\n 'serviceNotAvailable',\r\n productCategory,\r\n flowService.getFlowTypeFromStore()\r\n );\r\n errorMessageData.showFooter = false;\r\n this.showErrorModal(errorMessageData);\r\n }\r\n }\r\n }\r\n\r\n public showAddress(): boolean {\r\n if (this.productCategory === 'nbn' || this.isGuidedFlow) {\r\n return true;\r\n } else if (bundleService.isExplicitBundleFlow()) {\r\n return bundleService.isShowAddress();\r\n }\r\n return false;\r\n }\r\n\r\n public showNbnSqMessage(nbnProductDetails: NbnProductsResponse, address: string, isGuidedFlow: boolean): JSX.Element {\r\n const delayMessage = store.get('delayMessage');\r\n\r\n if (isGuidedFlow) {\r\n return null;\r\n }\r\n\r\n if (this.isInternetPlansPage && (!nbnProductDetails || !nbnProductDetails.serviceQualification)) return null;\r\n\r\n return (\r\n
\r\n {renderTechTypeMessage(nbnProductDetails, address, false, delayMessage, false, null, isGuidedFlow)}\r\n
\r\n );\r\n }\r\n\r\n public sendProductsToAEM(productDetails: ProductsResponse, addressValue: AddressDetailModel): void {\r\n if (addressValue && this.aemCIFIntegration) {\r\n if (!productDetails?.products?.length) {\r\n return;\r\n }\r\n const planCategoriesForAEM = productDetails?.planCategories;\r\n const productsForAEM = productDetails?.products?.map((p) => ({\r\n // eslint-disable-next-line no-nested-ternary\r\n categories: p?.content === null ? [p?.fibreUpgrade === false ? 'nbn plans' : 'Fibre upgrade'] : p?.content?.planCategories,\r\n sku: p?.sku,\r\n fibreUpgrade: p?.fibreUpgrade,\r\n qualified: p?.qualified\r\n }));\r\n window.postMessage(\r\n {\r\n spaCategory: store.get('productCategory'),\r\n eventType: 'products-loaded',\r\n eventData: {\r\n planCategories: planCategoriesForAEM,\r\n products: productsForAEM\r\n }\r\n },\r\n '*'\r\n );\r\n }\r\n }\r\n\r\n private clearNbnMoversStoredData(): void {\r\n let customerProfile = JSON.parse(sessionStorage.getItem('customerProfileService'));\r\n let questionResponseMovers = JSON.parse(sessionStorage.getItem('questionResponseMovers'));\r\n\r\n customerProfile = {\r\n ...customerProfile,\r\n isGasUpdated: false,\r\n isElectricityUpdated: false,\r\n isInternetUpdated: false,\r\n isMobileUpdated: false\r\n };\r\n if (questionResponseMovers) {\r\n questionResponseMovers = questionResponseMovers.filter((question) => question.name === 'movers-new-existing');\r\n }\r\n\r\n sessionStorage.setItem('customerProfileService', JSON.stringify(customerProfile));\r\n sessionStorage.setItem('questionResponseMovers', JSON.stringify(questionResponseMovers));\r\n }\r\n\r\n private handleManualAddressEntryModalClosedForCIF(forceRefresh: boolean): void {\r\n if (forceRefresh) {\r\n window.postMessage(\r\n {\r\n eventType: 'modal-closed',\r\n spaCategory: store.get('productCategory')\r\n },\r\n '*'\r\n );\r\n this.forceRefreshPage();\r\n }\r\n }\r\n\r\n private forceRefreshPage() {\r\n window.location.reload();\r\n }\r\n\r\n private renderFunc = ({\r\n configData,\r\n onAddressChange,\r\n validationErrors,\r\n responseError,\r\n selectedAddress,\r\n productDetails,\r\n isPersonalisedProductsLoading,\r\n productCategory,\r\n showValidIcon\r\n }: Context): JSX.Element => {\r\n this.checkValidationError(validationErrors);\r\n if (selectedAddress) {\r\n this.isAddressCheck = true;\r\n }\r\n this.checkSiteError(productDetails, productCategory);\r\n this.checkResponseError(responseError, productCategory);\r\n this.runProductValidators(productCategory, productDetails);\r\n const isGuidedFlow = store.get(StoreKeys.isGuidedFlow);\r\n let selectedAddressString = selectedAddress ? addressService.convertAddressToString(selectedAddress) : this.autoSelectedAddress;\r\n let addressSearchClass = 'address-search';\r\n const addressSearchLabelId = 'address-search-label';\r\n this.onManualAddressModalClose();\r\n if (this.alignment) {\r\n addressSearchClass = `${addressSearchClass} ${this.alignment}`;\r\n }\r\n return !this.isNbnMovers ? (\r\n \r\n {this.showAddress() && (\r\n
\r\n
\r\n \r\n
\r\n {configData && (\r\n (this.aglDsAddressSearchRef = el)}\r\n type=\"experiential\"\r\n placeholder={this.placeholder ?? 'e.g. 123 Sample Street, Melbourne'}\r\n debounce-time=\"250\"\r\n base-url={configData.addressApiUrl}\r\n subscription-key={configData.bffOcpApimSubscriptionKey}\r\n manual-address-heading=\"What address do you want to connect\"\r\n validation-text={this.getValidationText(productCategory, productDetails, responseError)}\r\n has-error={this.hasError}\r\n // eslint-disable-next-line react/jsx-no-bind\r\n onAddressSelected={(event: CustomEvent) => onAddressChange(event.detail)}\r\n validSelectionMode=\"external\"\r\n showValidIcon={!isPersonalisedProductsLoading && showValidIcon}\r\n address-input-value={selectedAddressString}\r\n address-input-auto-select={this.autoSelectedAddress !== null}\r\n showSpinner={isPersonalisedProductsLoading}\r\n // eslint-disable-next-line react/jsx-no-bind\r\n onAddressSearchBlur={() => this.setAddressValue(selectedAddressString)}\r\n />\r\n )}\r\n
\r\n
\r\n (this.manualRef = element)}\r\n heading=\"We found a few matches. Please enter your address.\"\r\n default-address-detail={selectedAddressString}\r\n // eslint-disable-next-line react/jsx-no-bind\r\n onAddressConfirm={(e) => {\r\n selectedAddressString = this.setAddressString(e.detail);\r\n this.setAddressValue(selectedAddressString);\r\n onAddressChange(e.detail);\r\n }}\r\n // eslint-disable-next-line react/jsx-no-bind\r\n onAddressCloseAction={(e) => {\r\n this.manualAddressCloseAction = e.detail as ModalCloseAction;\r\n if (\r\n store.get(StoreKeys.aemCIFIntegrationEnabled) &&\r\n e.type === 'addressCloseAction' &&\r\n (e.detail === 'clickOutside' || e.detail === 'iconButton' || e.detail === 'manualReturn')\r\n ) {\r\n this.handleManualAddressEntryModalClosedForCIF(true);\r\n }\r\n }}\r\n />\r\n
\r\n
\r\n {this.enableLoginCta && this.showLoginToMyAccount()}\r\n {this.productCategory === ProductCategoryEnum.Nbn &&\r\n this.showNbnSqMessage(productDetails as NbnProductsResponse, selectedAddressString, isGuidedFlow)}\r\n
\r\n )}\r\n
\r\n ) : (\r\n \r\n {this.showAddress() && (\r\n
\r\n (this.manualRef = element)}\r\n heading=\"We found a few matches. Please enter your address.\"\r\n default-address-detail={selectedAddressString}\r\n // eslint-disable-next-line react/jsx-no-bind\r\n onAddressConfirm={(e) => {\r\n selectedAddressString = this.setAddressString(e.detail);\r\n this.setAddressValue(selectedAddressString);\r\n onAddressChange(e.detail);\r\n }}\r\n // eslint-disable-next-line react/jsx-no-bind\r\n onAddressCloseAction={(e) => {\r\n this.manualAddressCloseAction = e.detail as ModalCloseAction;\r\n if (\r\n e.type === 'addressCloseAction' &&\r\n (e.detail === 'clickOutside' || e.detail === 'iconButton' || e.detail === 'manualReturn')\r\n ) {\r\n this.clearNbnMoversStoredData();\r\n window.location.href = '/apps/confirm/?#/movers/address';\r\n }\r\n }}\r\n />\r\n
\r\n )}\r\n
\r\n );\r\n };\r\n\r\n public render(): JSX.Element {\r\n const errorMessageData = errorMessageService.getErrorMessageData('serviceNotAvailable', null, flowService.getFlowTypeFromStore());\r\n\r\n return (\r\n
\r\n (this.errorModalRef = el)} errorMessageData={errorMessageData} />\r\n \r\n
\r\n );\r\n }\r\n\r\n private showLoginToMyAccount(): JSX.Element {\r\n return ;\r\n }\r\n}\r\n",".progress-indicator-text {\r\n margin-bottom: $space-02;\r\n padding-top: $space-03;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n margin-bottom: $space-01;\r\n padding-top: $space-04;\r\n }\r\n\r\n @include agl-ds-screen-size('large') {\r\n padding-top: $space-06;\r\n }\r\n}\r\n","import { Component, ComponentInterface, JSX, Prop, h } from '@stencil/core';\r\nimport { bannerService } from 'app/shared/services/banner/banner.service';\r\n\r\n@Component({\r\n tag: 'app-banner-progress-indicator',\r\n styleUrl: 'banner-progress-indicator.scss'\r\n})\r\nexport class BannerProgressIndicator implements ComponentInterface {\r\n @Prop() public readonly dataSpa: string = null;\r\n\r\n render(): JSX.Element {\r\n return (\r\n \r\n {bannerService.getBannerTitle(this.dataSpa)}\r\n \r\n );\r\n }\r\n}\r\n","import { ProductCategory } from 'app/shared/models/product-category.model';\r\n\r\nexport const parseProductCategory = (productCategory: string): ProductCategory => {\r\n if (\r\n productCategory &&\r\n (productCategory.toLowerCase() === 'energy' ||\r\n productCategory.toLowerCase() === 'nbn' ||\r\n productCategory.toLowerCase() === 'mobile plan')\r\n ) {\r\n return productCategory as ProductCategory;\r\n }\r\n return null;\r\n};\r\n","/* Panning specific styles */\r\n.panning-wrapper {\r\n width: calc(100vw - (100vw - 100%));\r\n overflow-x: auto;\r\n -webkit-overflow-scrolling: touch; /* important for iOS */\r\n}\r\n\r\n.scroll-snap-type {\r\n /* Safari */\r\n scroll-snap-type: x mandatory; /* Safari */\r\n scroll-snap-destination: 50% 50%;\r\n}\r\n\r\n.scroll-snap {\r\n scroll-snap-align: center; /* older (Firefox/IE) */ /* older (Safari) */\r\n scroll-snap-coordinate: 50% 50%; /* older (Safari) */\r\n scroll-snap-stop: normal;\r\n}\r\n\r\n/* End of: Panning specific styles */\r\n\r\n.comparison-section-wrapper {\r\n padding-bottom: $space-07;\r\n\r\n &.panning-wrapper {\r\n background-color: $c-neutral-07;\r\n }\r\n\r\n @include agl-ds-screen-size('medium') {\r\n padding-bottom: $space-11;\r\n }\r\n\r\n @include agl-ds-screen-size('large') {\r\n padding-bottom: $space-14;\r\n }\r\n}\r\n\r\n/* stylelint-disable-next-line selector-class-pattern */\r\n.trim-space {\r\n padding-bottom: $space-00 !important;\r\n}\r\n\r\n/* stylelint-disable-next-line selector-class-pattern */\r\n.guided-flow__product-heading {\r\n font-size: 2rem;\r\n display: flex;\r\n justify-content: center;\r\n padding-top: $space-07;\r\n padding-bottom: $space-01;\r\n}\r\n\r\n.guided-flow-nbn-heading {\r\n text-align: center;\r\n margin-top: $space-07;\r\n}\r\n\r\nstrong {\r\n --font-weights-bold: 700;\r\n}\r\n","import { Build, Component, ComponentInterface, Host, JSX, Method, Prop, State, h } from '@stencil/core';\r\nimport { ProductCategory as ProductCategoryEnum } from '@aglenergy/shared-library/dist/generated-source/api/sales/models/ProductCategory';\r\nimport { SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport {\r\n AddressDetailModel,\r\n ContentMode,\r\n Context,\r\n DataSpaKey,\r\n ProductCatalogueProduct,\r\n ProductCategory,\r\n ProductSessionData,\r\n ProductsResponse,\r\n PromoDialogData,\r\n ReportErrorType\r\n} from 'app/shared/models/index';\r\nimport {\r\n bundleService,\r\n configService,\r\n couponCodeService,\r\n crossSellService,\r\n errorReportingService,\r\n featureService,\r\n productsSessionStorageService,\r\n spinnerService,\r\n tealiumAnalyticService\r\n} from 'app/shared/services/index';\r\nimport { renderTechTypeMessage, showNbnSqMessage } from 'app/nbn/components/nbn-technology-type-message/nbn-technology-type-message';\r\n\r\nimport { DataSpaSearchParams } from 'app/shared/utilities/data-spa-search-params.util';\r\nimport { FeatureKey } from 'app/shared/models/feature-key';\r\nimport { NbnProductsResponse } from 'app/nbn/models/nbn-products-response.model';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { getDataSpaSearchParams } from 'app/shared/utilities/helper-functions';\r\nimport { initStore } from 'app/shared/store/init-store';\r\nimport { isNotNumber } from 'utils/dom.helper';\r\nimport { changePlanService as mobileChangePlanService } from 'app/mobile/services/change-plan/change-plan.service';\r\nimport { changePlanService as nbnChangePlanService } from 'app/nbn/services/change-plan/change-plan.service';\r\nimport { parseProductCategory } from 'app/shared/utilities/product-category.util';\r\nimport { store } from 'app/shared/store/store';\r\n\r\n@Component({\r\n tag: 'app-product-cards',\r\n styleUrl: 'product-cards.scss'\r\n})\r\nexport class ProductCards implements ComponentInterface {\r\n @Prop() public readonly dataSpa: string = null;\r\n\r\n private spaParams: DataSpaSearchParams;\r\n private isSupportedProductCategory: boolean;\r\n private mediaQueryList: MediaQueryList = window.matchMedia('(min-width: 720px)');\r\n @State() private isGuidedFlow = false;\r\n @State() private canRenderPlans: boolean;\r\n @State() private nbnMoversCrossSell = false;\r\n @State() private productCategory: ProductCategory;\r\n @State() private isChangePlanPage = false;\r\n private eligibilityCodeModal: PromoDialogData;\r\n private products: ProductCatalogueProduct[];\r\n\r\n public async componentWillLoad(): Promise {\r\n crossSellService.removeCrossSellProductCategory();\r\n let couponCode = couponCodeService.getFromQueryString();\r\n if (this.dataSpa) {\r\n this.spaParams = getDataSpaSearchParams(this.dataSpa);\r\n const mode = this.spaParams.get(DataSpaKey.mode);\r\n let host = '';\r\n if (mode === 'publish') {\r\n host = '/apps/comparison';\r\n } else {\r\n host = this.spaParams.get(DataSpaKey.host);\r\n }\r\n this.productCategory = this.spaParams.get(DataSpaKey.productcategory) as ProductCategory;\r\n this.nbnMoversCrossSell = this.spaParams.get(DataSpaKey.nbnMoversCrossSell) === 'true';\r\n const contentMode = this.spaParams.get(DataSpaKey.mode) as ContentMode;\r\n store.set('contentMode', contentMode ?? 'publish'); // setting this earlier before initStore as configService.loadConfig needs it for the general content call\r\n const focusSku = this.spaParams.get(DataSpaKey.focusSku);\r\n const crossSell = this.spaParams.get(DataSpaKey.crossSell);\r\n const bundleProducts = new URLSearchParams(window.location.search).get('bundle');\r\n const isCampaignPage = this.spaParams.getBoolean(DataSpaKey.isCampaignPage);\r\n store.set(StoreKeys.isCampaignPage, isCampaignPage);\r\n const webIDForCampaign = new URLSearchParams(window.location.search.toUpperCase()).get('WEBID');\r\n\r\n const previousWebId = productsSessionStorageService.getLatestWebIdFromProducts();\r\n if (isCampaignPage) {\r\n store.set(StoreKeys.webId, webIDForCampaign);\r\n\r\n if (previousWebId?.toUpperCase() !== webIDForCampaign?.toUpperCase()) {\r\n productsSessionStorageService.removeProducts();\r\n }\r\n } else if (previousWebId) {\r\n productsSessionStorageService.removeProducts();\r\n }\r\n\r\n this.isGuidedFlow = !!this.spaParams.get(DataSpaKey.isGuidedFlow);\r\n // Get couponCode from data-spa if no couponCode in query string\r\n if (!this.isGuidedFlow) {\r\n if (!couponCode) {\r\n couponCode = this.spaParams.get(DataSpaKey.couponCode);\r\n }\r\n store.set('couponCode', couponCode);\r\n }\r\n store.set('focusSku', focusSku);\r\n store.set('couponCode', couponCode);\r\n\r\n this.validateProductCategory(this.productCategory);\r\n\r\n if (bundleProducts) {\r\n bundleProducts.split('-').forEach((product) => {\r\n bundleService.setBundleConfigProduct(product as ProductCategory, { displayBundle: true });\r\n });\r\n bundleService.setBundleConfigProduct(this.productCategory, { displayBundle: false }); // already in product category, no need to display on bridge page\r\n }\r\n\r\n await configService.loadConfig(host).then(async () => {\r\n if (!this.isGuidedFlow) {\r\n await initStore(false, store.get('isGuidedFlow'), this.productCategory, contentMode, focusSku, host);\r\n }\r\n });\r\n\r\n const isBundleFlowEnabled = await featureService.loadFeatureStatus(FeatureKey.BUNDLE_FLOW_ENABLED);\r\n if (isBundleFlowEnabled && bundleService.isExplicitBundleFlow()) {\r\n this.hideBannerAndFeature();\r\n }\r\n\r\n const crossSellProductCategory = parseProductCategory(crossSell);\r\n if (crossSellProductCategory) {\r\n sessionStorage.setItem(SessionStorageKeys.CrossSellProductCategory, crossSell);\r\n }\r\n } else {\r\n store.set('couponCode', couponCode);\r\n }\r\n\r\n // Run it initially\r\n this.handleDeviceChange();\r\n this.mediaQueryList.addEventListener\r\n ? this.mediaQueryList.addEventListener('change', this.handleDeviceChange)\r\n : this.mediaQueryList.addListener(this.handleDeviceChange);\r\n\r\n const productDetails = JSON.parse(window.sessionStorage.getItem(SessionStorageKeys.ProductDetailsSession));\r\n if (productDetails) this.eligibilityCodeModal = productDetails.length > 0 ? productDetails[0]?.response?.eligibilityCodeModal : null;\r\n store.onChange(StoreKeys.isPromoModalOpen, () => {\r\n if (store.get(StoreKeys.isPromoModalOpen)) {\r\n const productDetails = JSON.parse(window.sessionStorage.getItem(SessionStorageKeys.ProductDetailsSession));\r\n this.eligibilityCodeModal = productDetails.length > 0 ? productDetails[0]?.response?.eligibilityCodeModal : null;\r\n }\r\n });\r\n spinnerService.removePlansSkeletonLoader();\r\n }\r\n\r\n public hideBannerAndFeature(): void {\r\n const headers = document.getElementsByClassName('headlinebanner');\r\n if (headers && headers.length > 0) {\r\n const header = headers[0] as HTMLElement;\r\n header.style.display = 'none';\r\n }\r\n const featureItems = document.getElementsByClassName('icontextcard');\r\n if (featureItems && featureItems.length > 0) {\r\n const featureParent = (featureItems[0] as HTMLElement).parentElement;\r\n featureParent.style.display = 'none';\r\n }\r\n }\r\n\r\n public disconnectedCallback(): void {\r\n this.mediaQueryList.removeEventListener\r\n ? this.mediaQueryList.removeEventListener('change', this.handleDeviceChange)\r\n : this.mediaQueryList.removeListener(this.handleDeviceChange);\r\n }\r\n\r\n private validateProductCategory(productCategory: ProductCategory): void {\r\n const supportedProductCategories: ProductCategory[] = ['mobile plan', 'nbn'];\r\n this.isSupportedProductCategory = supportedProductCategories.includes(productCategory);\r\n if (!this.isSupportedProductCategory) {\r\n const errorMessage = 'Missing or Invalid productCategory defined in data-spa attribute';\r\n console.error(errorMessage);\r\n errorReportingService.logError(errorMessage, ReportErrorType.ConfigurationError);\r\n }\r\n }\r\n\r\n private handleDeviceChange = () => {\r\n this.equaliseHeights(true);\r\n this.equaliseHeights();\r\n };\r\n\r\n // eslint-disable-next-line require-await\r\n @Method()\r\n public async equaliseHeights(setToAuto = false): Promise {\r\n this.equaliseSectionHeights('.feature-list', setToAuto);\r\n this.equaliseSectionHeights('.bundle-price-desc', setToAuto);\r\n this.equaliseSectionHeights('.links', setToAuto);\r\n }\r\n private equaliseSectionHeights(selector: string, setToAuto = false): void {\r\n // Get all instances of the card section with specified selector\r\n const elementArray = document.querySelectorAll(selector) as NodeListOf;\r\n if (!elementArray || elementArray.length === 0) {\r\n return;\r\n }\r\n\r\n for (let i = 0; i < elementArray.length; i++) {\r\n const element = elementArray[i];\r\n element.style.height = `auto`;\r\n }\r\n if (setToAuto) {\r\n return;\r\n }\r\n\r\n let maxElementHeight = 0;\r\n for (let i = 0; i < elementArray.length; i++) {\r\n const clientHeight = elementArray[i].clientHeight;\r\n maxElementHeight = clientHeight > maxElementHeight ? clientHeight : maxElementHeight;\r\n }\r\n\r\n // apply that height to all elements\r\n if (maxElementHeight > 0) {\r\n for (let i = 0; i < elementArray.length; i++) {\r\n const element = elementArray[i];\r\n element.style.height = `${maxElementHeight}px`;\r\n }\r\n }\r\n }\r\n\r\n public getFocusCardIndex(focusSku: string, products: ProductCatalogueProduct[]): number {\r\n const defaultIndex = products.findIndex((p) => p.sku === focusSku);\r\n return defaultIndex > -1 ? defaultIndex : 0;\r\n }\r\n\r\n public filterProducts(productDetails: ProductsResponse, selectedAddress: AddressDetailModel): ProductCatalogueProduct[] {\r\n if (!productDetails || !productDetails.products || !productDetails.products.length) {\r\n return [];\r\n }\r\n let products = productDetails.products.filter((p) => !!p.content && !isNotNumber(p.attributes.agl_marketing_price));\r\n\r\n if (this.spaParams && productDetails && products.length > 0) {\r\n const productSku = this.spaParams.get('productSku');\r\n const skuList: string[] = productSku && productSku.split(',');\r\n\r\n if (skuList && skuList.length > 0) {\r\n products = products.filter((p) => skuList.includes(p.sku));\r\n }\r\n if (!selectedAddress) {\r\n tealiumAnalyticService.trackProductCards(products, true, store.get(StoreKeys.productCategory));\r\n }\r\n }\r\n const selectedCategory = store.get(StoreKeys.selectedPlanCategory);\r\n if (selectedCategory) {\r\n products = products.filter((p) => p.content.planCategories && p.content.planCategories.includes(selectedCategory));\r\n }\r\n return products;\r\n }\r\n\r\n private getPlanCategories(productDetails: ProductsResponse): string[] {\r\n if (!productDetails || productDetails.planCategories?.length === 0) {\r\n return [];\r\n }\r\n return productDetails.planCategories;\r\n }\r\n\r\n private didRenderFunc = () => {\r\n this.equaliseHeights();\r\n };\r\n\r\n private checkRenderPlans = (productDetails: ProductsResponse): boolean => {\r\n const prefillAddress = store.get(StoreKeys.prefillAddress);\r\n const isDefaultProductSearch = !(productDetails as NbnProductsResponse)?.serviceQualification;\r\n return !prefillAddress || !isDefaultProductSearch;\r\n };\r\n\r\n private renderFunc = ({ productDetails, selectedAddress, isPersonalisedProductsLoading, isPageLoaded, responseError }: Context) => {\r\n const products = this.filterProducts(productDetails, selectedAddress);\r\n this.products = products;\r\n const productCategory = store.get(StoreKeys.productCategory);\r\n const focusSku = store.get('focusSku');\r\n const focusCardIndex = this.getFocusCardIndex(focusSku, products);\r\n spinnerService.removeSpinnerOverlay(isPageLoaded);\r\n if (!this.isSupportedProductCategory) {\r\n return ;\r\n }\r\n\r\n if (isPageLoaded) {\r\n if (!products?.length && (!responseError || responseError?.errorType !== 'aborted') && focusSku) {\r\n return ;\r\n }\r\n if (productCategory === 'nbn') {\r\n this.canRenderPlans = this.checkRenderPlans(productDetails);\r\n\r\n if (!this.canRenderPlans) {\r\n return;\r\n }\r\n\r\n const isChangePlan = nbnChangePlanService.isChangePlan();\r\n if (isChangePlan) {\r\n const categories = this.getPlanCategories(store.get(StoreKeys.productDetails));\r\n this.isChangePlanPage = true;\r\n const productsForDisplay = nbnChangePlanService.getChangePlanProductsForDisplay(productDetails.products, products);\r\n return (\r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n );\r\n }\r\n if (productCategory === 'mobile plan') {\r\n this.canRenderPlans = true;\r\n\r\n const isChangePlan = mobileChangePlanService.isChangePlan();\r\n if (isChangePlan) {\r\n this.isChangePlanPage = true;\r\n const productsForDisplay = mobileChangePlanService.getChangePlanProductsForDisplay(productDetails.products, products);\r\n return (\r\n \r\n );\r\n }\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n }\r\n };\r\n\r\n private renderNbnMoversCrossSellFibreSubHeading = () => {\r\n const featureFlag = featureService.getFeatureStatus(FeatureKey.NBN_MOVERS_CROSS_SELL_ENABLED);\r\n if (featureFlag && this.productCategory === ProductCategoryEnum.Nbn && this.nbnMoversCrossSell) {\r\n const productSessionData = productsSessionStorageService.getLatestProductsByProductCategory('nbn') as ProductSessionData;\r\n const productDetails = store.get(StoreKeys.productDetails);\r\n return showNbnSqMessage(productDetails as NbnProductsResponse, productSessionData?.key, false, this.nbnMoversCrossSell);\r\n }\r\n };\r\n\r\n private renderGuidedFlowHeading = () => {\r\n const productCategory = store.get(StoreKeys.productCategory);\r\n if (productCategory === 'nbn') {\r\n const nbnProductDetails = store.get(StoreKeys.productDetails) as NbnProductsResponse;\r\n const address = store.get('address') as string;\r\n const delayMessage = store.get('delayMessage');\r\n return (\r\n
\r\n {renderTechTypeMessage(nbnProductDetails, address, false, delayMessage, false, null, true)}\r\n
\r\n );\r\n } else if (productCategory === 'mobile plan') {\r\n return (\r\n
\r\n Choose a mobile plan to add to your combined services\r\n
\r\n );\r\n }\r\n };\r\n\r\n private renderPlanCategories = () => {\r\n const categories = this.getPlanCategories(store.get(StoreKeys.productDetails));\r\n return ;\r\n };\r\n\r\n private renderPromoDialog = () => {\r\n return ;\r\n };\r\n\r\n public logVersion(): void {\r\n if (!Build.isDev) {\r\n const style = 'color: green; background: yellow;';\r\n const version = `Compare Product SPA |buildNumber: 20250319.2|buildDate: 2025-03-19 16:33:31+11:00`;\r\n setTimeout(() => console.log('%c%s', style, version), 2000);\r\n }\r\n }\r\n\r\n public render(): JSX.Element {\r\n return (\r\n \r\n \r\n {this.isGuidedFlow ? this.renderGuidedFlowHeading() : null}\r\n {this.renderNbnMoversCrossSellFibreSubHeading()}\r\n \r\n {this.canRenderPlans && this.renderPlanCategories()}\r\n \r\n \r\n \r\n {this.eligibilityCodeModal && (\r\n \r\n )}\r\n {store.get(StoreKeys.isPromoModalOpen) &&
{this.renderPromoDialog()}
}\r\n
\r\n );\r\n }\r\n}\r\n","import { Component, ComponentInterface, h, JSX, Prop } from '@stencil/core';\r\nimport { DataSpaKey } from 'app/shared/models/dataSpa';\r\nimport { store } from 'app/shared/store/store';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { getDataSpaSearchParams } from 'app/shared/utilities/helper-functions';\r\n\r\n@Component({\r\n tag: 'app-products-container',\r\n shadow: false\r\n})\r\nexport class ProductCardsContainer implements ComponentInterface {\r\n @Prop() dataSpa: string;\r\n\r\n public render(): JSX.Element {\r\n const guidedFlowActiveCategory = store.get(StoreKeys.guidedFlowActiveCategory);\r\n if (this.dataSpa) {\r\n const spaParams = getDataSpaSearchParams(this.dataSpa);\r\n const mode = spaParams.get(DataSpaKey.mode);\r\n const focusSku = spaParams.get(DataSpaKey.focusSku);\r\n const dataSpaCouponCode = spaParams.get(DataSpaKey.couponCode);\r\n const mobileCouponCode = spaParams.get(DataSpaKey.mobileCouponCode);\r\n const nbnCouponCode = spaParams.get(DataSpaKey.nbnCouponCode);\r\n let host = '';\r\n if (mode === 'publish') {\r\n host = '/apps/comparison';\r\n } else {\r\n host = spaParams.get(DataSpaKey.host);\r\n }\r\n if (guidedFlowActiveCategory && !['none', 'energy'].includes(guidedFlowActiveCategory)) {\r\n let couponCode = dataSpaCouponCode;\r\n if (mobileCouponCode && guidedFlowActiveCategory === 'mobile plan') {\r\n couponCode = mobileCouponCode;\r\n } else if (nbnCouponCode && guidedFlowActiveCategory === 'nbn') {\r\n couponCode = nbnCouponCode;\r\n }\r\n const dataSpa = `host=${host}&productcategory=${guidedFlowActiveCategory}&focusSku=${focusSku}&isGuidedFlow=true${\r\n couponCode ? `&couponCode=${couponCode}` : ''\r\n }`;\r\n return ;\r\n }\r\n return null;\r\n }\r\n }\r\n}\r\n",".product-cards-energy-container {\r\n display: block;\r\n\r\n &__show {\r\n display: block;\r\n }\r\n\r\n &__hide {\r\n display: none;\r\n }\r\n}\r\n","import { Component, ComponentInterface, JSX, Prop, State, h } from '@stencil/core';\r\n\r\nimport { store } from 'app/shared/store/store';\r\nimport { DataSpaKey } from 'app/shared/models/dataSpa';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { getDataSpaSearchParams } from 'app/shared/utilities/helper-functions';\r\n\r\n@Component({\r\n tag: 'app-products-energy-container',\r\n styleUrl: 'product-cards-energy-container.scss',\r\n shadow: false\r\n})\r\nexport class ProductCardsEnergyContainer implements ComponentInterface {\r\n @Prop() public readonly dataSpa;\r\n\r\n @State() energyProductSelected: boolean;\r\n\r\n componentDidLoad(): void {\r\n this.setProductCategoryChange();\r\n }\r\n\r\n render(): JSX.Element {\r\n let dataSpa = 'mode=publish&isGuidedFlow=true';\r\n if (this.dataSpa) {\r\n const dataSpaParams = getDataSpaSearchParams(this.dataSpa);\r\n const offerId = dataSpaParams?.get(DataSpaKey.offerId) || null;\r\n dataSpa = offerId ? `offerId=${offerId}&${dataSpa}` : dataSpa;\r\n }\r\n const className = this.energyProductSelected ? 'product-cards-energy-container__show' : 'product-cards-energy-container__hide';\r\n return ;\r\n }\r\n\r\n private triggerResize() {\r\n window.dispatchEvent(new Event('resize'));\r\n }\r\n\r\n private setProductCategoryChange(): void {\r\n store.onChange(StoreKeys.guidedFlowActiveCategory, (productCategory) => {\r\n this.energyProductSelected = productCategory === 'energy';\r\n if (this.energyProductSelected) {\r\n requestAnimationFrame(() => this.triggerResize());\r\n }\r\n });\r\n }\r\n}\r\n","import { Component, ComponentInterface, JSX, Prop, h } from '@stencil/core';\r\nimport { store } from 'app/shared/store/store';\r\nimport { PromotionPage } from 'app/shared/models/product-response.model';\r\nimport { bannerService } from 'app/shared/services/banner/banner.service';\r\n\r\n@Component({\r\n tag: 'app-promo-banner'\r\n})\r\nexport class PromoBanner implements ComponentInterface {\r\n @Prop() public readonly dataSpa: string = null;\r\n private promotionPage: PromotionPage = null;\r\n private content: string = null;\r\n private footer: string = null;\r\n private imagePath: string = null;\r\n\r\n private getBannerContent(): void {\r\n this.promotionPage = store.get('promotionPage');\r\n // Currently, BFF is not serving promotion page data, promotion page data is setup per plan in stripCoupon field\r\n if (this.promotionPage?.isPromoValid) {\r\n const promoBannerDetails = this.promotionPage?.promoBanner;\r\n this.content = promoBannerDetails?.content;\r\n this.footer = promoBannerDetails?.footer;\r\n this.imagePath = promoBannerDetails?.imagePath;\r\n }\r\n }\r\n\r\n render(): JSX.Element {\r\n this.getBannerContent();\r\n if (!this.promotionPage?.isPromoValid) {\r\n return null;\r\n }\r\n return (\r\n \r\n \r\n \r\n \r\n {this.content}\r\n \r\n \r\n {this.footer}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n",".bundle {\r\n &__intro {\r\n height: 91px;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n text-align: center;\r\n }\r\n\r\n &__container {\r\n margin: 0 auto;\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n padding: 0 $space-02 $space-01;\r\n\r\n @include agl-ds-screen-size('large') {\r\n flex-direction: row;\r\n padding: 0 50px $space-05;\r\n }\r\n }\r\n\r\n &__product {\r\n font-size: $font-size-lg-01 !important;\r\n\r\n &:not(:last-child) {\r\n margin-bottom: $space-01;\r\n }\r\n\r\n @include agl-ds-screen-size('medium') {\r\n font-size: $font-size-lg-02 !important;\r\n }\r\n\r\n @include agl-ds-screen-size('large') {\r\n flex: 0 1 280px;\r\n margin-bottom: 0;\r\n margin-right: $space-04;\r\n\r\n &:last-child {\r\n margin-right: 0;\r\n }\r\n }\r\n }\r\n\r\n &__message-tile {\r\n box-sizing: border-box;\r\n height: 100%;\r\n width: 100%;\r\n padding: 60px $space-02 0;\r\n text-align: center;\r\n }\r\n\r\n &__tile-heading {\r\n display: flex;\r\n flex-direction: row;\r\n\r\n &__left {\r\n flex: 0 0 $space-01;\r\n }\r\n\r\n &__middle {\r\n flex: 1 1 auto;\r\n padding-left: $space-01;\r\n }\r\n\r\n &__right {\r\n flex: 0 0 $space-03;\r\n text-align: right;\r\n }\r\n }\r\n\r\n &__tile-content {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: flex-start;\r\n line-height: 55px;\r\n text-align: left;\r\n padding-bottom: $space-02;\r\n min-height: 55px;\r\n\r\n @include agl-ds-screen-size('large') {\r\n min-height: 110px;\r\n text-align: left;\r\n padding-top: $space-01;\r\n padding-bottom: $space-02;\r\n }\r\n\r\n &-icon {\r\n flex: 0 0 $space-01;\r\n align-self: center;\r\n }\r\n }\r\n\r\n &__tile-content-no-heading {\r\n min-height: 180px;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n flex-direction: column;\r\n padding-bottom: $space-02;\r\n text-align: center;\r\n }\r\n\r\n &--desktop {\r\n display: none;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n display: block;\r\n }\r\n }\r\n\r\n &--mobile {\r\n display: block;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n display: none;\r\n }\r\n }\r\n}\r\n","import {\r\n CartFlagsService,\r\n Discount,\r\n ProductDiscount,\r\n RetrieveCartItem,\r\n RetrieveCartResponse,\r\n SessionStorageKeys\r\n} from '@aglenergy/shared-library';\r\nimport { ComponentInterface, Component, JSX, State, h } from '@stencil/core';\r\nimport { store } from 'app/shared/store/store';\r\nimport { BundleTileItems, DisplayItem } from 'app/shared/models/bundle/displayCartItem.model';\r\nimport { CustomerProfile } from 'app/shared/models/customerProfile';\r\nimport { ProductCategory } from 'app/shared/models/product-category.model';\r\nimport { SelectedProductSessionData } from 'app/shared/models/sessionData';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { bundleService } from 'app/shared/services/bundle/bundle.service';\r\nimport { customerProfileService } from 'app/shared/services/customer-profile/customerProfile-service';\r\nimport { flowService } from 'app/shared/services/flow/flow-service';\r\nimport { productsSessionStorageService } from 'app/shared/services/product-session-storage/product-session-storage.service';\r\nimport { tealiumAnalyticService } from 'app/shared/services/tealium/tealium-analytics.service';\r\n\r\n@Component({\r\n tag: 'bundle-builder',\r\n styleUrl: 'bundle-builder.scss'\r\n})\r\nexport class BundleBuilder implements ComponentInterface {\r\n @State() private cartDetails: RetrieveCartResponse;\r\n @State() private bundleTileItems: BundleTileItems;\r\n private cartFlagsService;\r\n private cartListener: () => void;\r\n private addProductToCartItemListener: () => void;\r\n private removeProductFromCartItemListener: () => void;\r\n\r\n public componentWillLoad(): void {\r\n bundleService.toggleStaticContent('none');\r\n const sessionStoreProducts = JSON.parse(window.sessionStorage.getItem(SessionStorageKeys.SelectedMobileProductDetails));\r\n this.setMobilePlansFromSessionStore(sessionStoreProducts);\r\n this.mapBundleTiles();\r\n this.initialiseBundleSelection();\r\n store.on('dispose', () => {\r\n this.cartListener();\r\n this.addProductToCartItemListener();\r\n this.removeProductFromCartItemListener();\r\n });\r\n }\r\n\r\n public componentDidRender(): void {\r\n this.handleCustomEvents();\r\n }\r\n\r\n public disconnectedCallback(): void {\r\n this.cartListener();\r\n this.addProductToCartItemListener();\r\n this.removeProductFromCartItemListener();\r\n }\r\n\r\n public setBundleSelection(bundleProductType: ProductCategory): void {\r\n store.set(StoreKeys.guidedFlowActiveCategory, bundleProductType);\r\n flowService.setActiveCategory(bundleProductType);\r\n this.scrollToProductCards(bundleProductType);\r\n switch (bundleProductType) {\r\n case 'energy':\r\n case 'nbn': {\r\n const nbnResponse = store.get(StoreKeys.bundleSearchStore)?.nbnResponse;\r\n store.set(StoreKeys.productDetails, nbnResponse);\r\n store.set(StoreKeys.productCategory, bundleProductType === 'energy' ? 'energy' : 'nbn');\r\n break;\r\n }\r\n case 'mobile plan': {\r\n const mobileResponse = store.get(StoreKeys.bundleSearchStore)?.mobileResponse;\r\n store.set(StoreKeys.productDetails, mobileResponse);\r\n store.set(StoreKeys.productCategory, 'mobile plan');\r\n break;\r\n }\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n private initialiseBundleSelection() {\r\n let activeCategory = 'none' as ProductCategory | 'none';\r\n const lastActiveCategory = flowService.getActiveCategory();\r\n if (lastActiveCategory) {\r\n switch (lastActiveCategory.toLowerCase()) {\r\n case 'energy':\r\n activeCategory = 'energy';\r\n break;\r\n case 'nbn':\r\n activeCategory = 'nbn';\r\n break;\r\n case 'mobile plan':\r\n case 'mobile%20plan':\r\n activeCategory = 'mobile plan';\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n store.set(StoreKeys.guidedFlowActiveCategory, activeCategory);\r\n }\r\n\r\n private mapBundleTiles(): void {\r\n this.cartListener = store.onChange(StoreKeys.cart, (retrieveCartResponse: RetrieveCartResponse) => {\r\n if (store.get('retrieveTriggeredFromRemove')) {\r\n if (retrieveCartResponse) {\r\n const cartWithSessionMobile: RetrieveCartResponse = {\r\n ...retrieveCartResponse,\r\n cartItems: [\r\n ...retrieveCartResponse.cartItems.filter((x) => x.additionalData.productCategory.toLowerCase() !== 'mobile plan'),\r\n ...this.cartDetails.cartItems.filter((x) => x.additionalData.productCategory.toLowerCase() === 'mobile plan')\r\n ]\r\n };\r\n\r\n this.cartDetails = {\r\n ...this.cartDetails,\r\n ...cartWithSessionMobile\r\n };\r\n }\r\n }\r\n\r\n if (!store.get('retrieveTriggeredFromRemove')) {\r\n this.cartDetails = {\r\n ...this.cartDetails,\r\n ...retrieveCartResponse\r\n };\r\n }\r\n this.storeSelectedMobileProducts();\r\n this.setBundleTileItems();\r\n });\r\n\r\n this.addProductToCartItemListener = store.onChange(StoreKeys.addProductToCartItem, (cartItems: RetrieveCartItem[]) => {\r\n if (cartItems?.length) {\r\n this.initialiseCartDetails();\r\n const cartDetails: RetrieveCartResponse = { ...this.cartDetails };\r\n const productDiscounts = this.getBundleDiscount();\r\n cartItems.forEach((cartItem) => {\r\n if (productDiscounts) {\r\n cartItem.productDiscounts = { ...productDiscounts } as unknown as ProductDiscount[];\r\n }\r\n });\r\n cartDetails.cartItems = [...cartDetails.cartItems, ...cartItems];\r\n this.cartDetails = { ...this.cartDetails, ...cartDetails };\r\n this.setBundleTileItems();\r\n }\r\n });\r\n\r\n this.removeProductFromCartItemListener = store.onChange(StoreKeys.removeProductFromCartItem, (cartItem: RetrieveCartItem) => {\r\n if (cartItem) {\r\n const cartDetails: RetrieveCartResponse = { ...this.cartDetails };\r\n cartDetails.cartItems = cartDetails.cartItems.filter((_cartItem) => _cartItem.cartItemId !== cartItem.cartItemId);\r\n this.cartDetails = { ...this.cartDetails, ...cartDetails };\r\n this.setBundleTileItems();\r\n }\r\n });\r\n }\r\n\r\n private setBundleTileItems(): void {\r\n this.bundleTileItems = bundleService.mapBundleTileItems(this.cartDetails);\r\n }\r\n\r\n private scrollToProductCards(productCategory: ProductCategory) {\r\n let elementToScrollTo;\r\n if (productCategory === 'energy') {\r\n elementToScrollTo = 'app-products-energy-container';\r\n } else {\r\n elementToScrollTo = 'app-products-container';\r\n }\r\n setTimeout(() => {\r\n if (document.getElementsByTagName(elementToScrollTo)?.[0]) {\r\n document.getElementsByTagName('html')[0].scroll({\r\n top: document.getElementsByTagName(elementToScrollTo)[0].offsetTop,\r\n behavior: 'smooth'\r\n });\r\n }\r\n }, 0);\r\n }\r\n private onTileClicked = (e: CustomEvent) => {\r\n let action: string;\r\n let eventData: string[] = null;\r\n switch (e.detail) {\r\n case 'addEnergyTile':\r\n this.setBundleSelection('energy');\r\n if (this.bundleTileItems?.energy?.displayItems?.length) {\r\n action = 'Edit';\r\n eventData = this.bundleTileItems.energy.displayItems.map((item: DisplayItem) => item.productName);\r\n } else {\r\n action = 'Add';\r\n }\r\n tealiumAnalyticService.trackBundleSelectionData(action, 'energy', eventData);\r\n break;\r\n case 'addInternetTile':\r\n this.setBundleSelection('nbn');\r\n if (this.bundleTileItems?.nbn?.displayItems?.length) {\r\n action = 'Edit';\r\n eventData = this.bundleTileItems.nbn.displayItems.map((item: DisplayItem) => item.productName);\r\n } else {\r\n action = 'Add';\r\n }\r\n tealiumAnalyticService.trackBundleSelectionData(action, 'nbn', eventData);\r\n break;\r\n case 'addMobileTile':\r\n this.setBundleSelection('mobile plan');\r\n if (this.bundleTileItems?.mobile?.displayItems?.length) {\r\n action = 'Edit';\r\n eventData = this.bundleTileItems.mobile.displayItems.map((item: DisplayItem) => item.productName);\r\n } else {\r\n action = 'Add';\r\n }\r\n tealiumAnalyticService.trackBundleSelectionData(action, 'mobile plan', eventData);\r\n break;\r\n default:\r\n break;\r\n }\r\n e.preventDefault();\r\n };\r\n\r\n private getTileTheme(productCategory: ProductCategory, isProductSelected: boolean, theme: string, themeTint): string {\r\n if (!isProductSelected) {\r\n return null;\r\n }\r\n let tileTheme = '';\r\n // Default theme\r\n switch (productCategory) {\r\n case 'energy':\r\n tileTheme = 'secondary01-tint-80';\r\n break;\r\n case 'nbn':\r\n case 'mobile plan':\r\n tileTheme = 'secondary04';\r\n break;\r\n }\r\n // Theme from retrieveCart\r\n if (theme) {\r\n tileTheme = `${theme}${themeTint}`;\r\n }\r\n return tileTheme;\r\n }\r\n\r\n public storeSelectedMobileProducts(): void {\r\n let selectedMobileProductDetails = JSON.parse(window.sessionStorage.getItem(SessionStorageKeys.SelectedMobileProductDetails));\r\n this.cartFlagsService = new CartFlagsService(this.cartDetails);\r\n const mobileProducts = this.cartFlagsService.getMobileProducts();\r\n /* istanbul ignore else */\r\n if (mobileProducts?.length) {\r\n const bundleProducts = JSON.parse(window.sessionStorage.getItem(SessionStorageKeys.bundleProducts));\r\n if (bundleProducts?.mobileResponse?.products?.length) {\r\n const productDetails = mobileProducts.map((_mobileProduct: RetrieveCartItem) => {\r\n let product = bundleProducts.mobileResponse.products.find((_product) => _mobileProduct.sku === _product.sku);\r\n product = { ...product, cartItemId: _mobileProduct.cartItemId };\r\n return { product };\r\n });\r\n if (!selectedMobileProductDetails) {\r\n const customerProfile: CustomerProfile = customerProfileService.getCustomerProfile();\r\n customerProfile.customerOriginURL = window.location.href;\r\n customerProfile.customerType = 'R';\r\n customerProfileService.setCustomerProfile(customerProfile);\r\n selectedMobileProductDetails = { customerProfile, productDetails };\r\n } else {\r\n productDetails.forEach((_productDetail) => {\r\n const productDetailExist = selectedMobileProductDetails.productDetails.find(\r\n (_selectedProductDetail) => _selectedProductDetail.product?.cartItemId === _productDetail?.product?.cartItemId\r\n );\r\n if (!productDetailExist) {\r\n selectedMobileProductDetails.productDetails.push(_productDetail);\r\n }\r\n });\r\n }\r\n }\r\n }\r\n\r\n // There are scenarios where mobile plans has been added in selectedMobileProducts store\r\n // but still not in the cart.\r\n if (selectedMobileProductDetails?.productDetails?.length !== mobileProducts?.length) {\r\n this.setMobilePlansFromSessionStore(selectedMobileProductDetails, mobileProducts);\r\n }\r\n if (selectedMobileProductDetails) {\r\n productsSessionStorageService.saveMobileProducts(selectedMobileProductDetails);\r\n }\r\n }\r\n\r\n private setMobilePlansFromSessionStore(sessionStoreProducts: SelectedProductSessionData, mobileProducts: RetrieveCartItem[] = []): void {\r\n if (sessionStoreProducts) {\r\n this.initialiseCartDetails();\r\n const productDiscounts: Discount[] = this.getBundleDiscount();\r\n const cartItems = [];\r\n sessionStoreProducts.productDetails.forEach((_productDetail) => {\r\n if (_productDetail) {\r\n const productDetailExist = [...mobileProducts]?.find(\r\n (_mobileProductInCart) => _mobileProductInCart?.cartItemId === _productDetail?.product?.cartItemId\r\n );\r\n if (!productDetailExist && _productDetail?.product) {\r\n const cartItem = bundleService.mapMobileProductCatalogueAsCartItem(_productDetail?.product, productDiscounts);\r\n cartItems.push(cartItem);\r\n }\r\n }\r\n });\r\n if (cartItems.length) {\r\n this.cartDetails.cartItems = [...this.cartDetails.cartItems, ...cartItems];\r\n this.setBundleTileItems();\r\n }\r\n }\r\n }\r\n\r\n private getBundleDiscount(): Discount[] {\r\n if (this.cartFlagsService) {\r\n const cartFlags = this.cartFlagsService.getCartFlags();\r\n return cartFlags?.hasEnergy ? bundleService.getBundleDiscountByCategory() : null;\r\n }\r\n return null;\r\n }\r\n\r\n private handleCustomEvents(): void {\r\n const appComparisonElement = document.querySelector('#app-comparison');\r\n if (appComparisonElement) {\r\n appComparisonElement.addEventListener('cart', (e: CustomEvent) => store.set(StoreKeys.cart, JSON.parse(e.detail)));\r\n }\r\n }\r\n\r\n private initialiseCartDetails(): void {\r\n if (!this.cartDetails) {\r\n this.cartDetails = { cartItems: [] };\r\n }\r\n }\r\n\r\n private getErrorState(product: ProductCategory): string {\r\n const bundleStore = store.get(StoreKeys.bundleSearchStore);\r\n let error = null;\r\n if (bundleStore) {\r\n switch (product) {\r\n case 'energy':\r\n error = bundleStore.energyResponse?.siteError ? 'SERVICE ERROR' : null;\r\n if (!error) {\r\n error = bundleStore.energyResponse.electricity.siteError && bundleStore.energyResponse.gas.siteError ? 'SITE ERROR' : null;\r\n }\r\n break;\r\n case 'nbn':\r\n error = bundleStore?.nbnResponse?.siteError || !bundleStore.nbnResponse?.serviceQualification?.nbn ? 'SERVICE ERROR' : null;\r\n if (!error) {\r\n error = bundleStore.nbnResponse.serviceQualification.nbn.result === 'FAIL' ? 'SITE ERROR' : null;\r\n }\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n return error;\r\n }\r\n\r\n private getErrorTile(product: ProductCategory, errorDescription: string): JSX.Element {\r\n let tileId: string;\r\n let icon: string;\r\n let heading: string;\r\n let body: string;\r\n\r\n switch (product) {\r\n case 'energy':\r\n tileId = 'energyTileDisabled';\r\n icon = '/apps/comparison/assets/icon/agl_tile_electricity--muted.svg';\r\n heading = 'Energy';\r\n if (errorDescription === 'SERVICE ERROR') {\r\n body = 'We are unable to provide an energy service at your address.';\r\n }\r\n if (errorDescription === 'SITE ERROR') {\r\n body = `We can't provide energy to your address at this time.`;\r\n }\r\n break;\r\n case 'nbn':\r\n tileId = 'internetTileDisabled';\r\n icon = '/apps/comparison/assets/icon/agl_tile_internet--muted.svg';\r\n heading = 'Internet';\r\n if (errorDescription === 'SERVICE ERROR') {\r\n body = 'We are unable to provide an internet service at your address.';\r\n }\r\n if (errorDescription === 'SITE ERROR') {\r\n body = `We can't provide internet to your address at this time.`;\r\n }\r\n break;\r\n default:\r\n tileId = 'tileDisabled';\r\n break;\r\n }\r\n return (\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n {heading}\r\n \r\n
\r\n
\r\n
\r\n \r\n {body}\r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n private getAuthenticatedEnergyTile() {\r\n const icon = '/apps/comparison/assets/icon/agl_tile_electricity--muted.svg';\r\n return (\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n Energy\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n You already have energy with us.\r\n \r\n \r\n \r\n If you would like to change your energy plan please visit \r\n \r\n My Account\r\n {' '}\r\n or call 131 245\r\n \r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n private getTile(product: ProductCategory, isAuthenticated: boolean): JSX.Element {\r\n const error = this.getErrorState(product);\r\n if (error || store.get(StoreKeys.responseError) || (error && isAuthenticated && product === 'nbn')) {\r\n return this.getErrorTile(product, error);\r\n }\r\n if (isAuthenticated && product === 'energy') {\r\n return this.getAuthenticatedEnergyTile();\r\n }\r\n let tileId: string;\r\n let productFound: boolean;\r\n let productTheme: string;\r\n let productTint: string;\r\n let displayItems: DisplayItem[];\r\n let subtotal: string;\r\n let heading: string;\r\n let icon: string;\r\n switch (product) {\r\n case 'energy':\r\n tileId = 'addEnergyTile';\r\n icon = '/apps/comparison/assets/icon/agl_tile_electricity.svg';\r\n productFound = !!this.bundleTileItems?.energy?.displayItems?.length;\r\n productTheme = this.bundleTileItems?.energy?.theme;\r\n productTint = this.bundleTileItems?.energy?.themeTint;\r\n displayItems = this.bundleTileItems?.energy?.displayItems;\r\n heading = productFound ? 'Energy' : 'Add Energy';\r\n break;\r\n case 'nbn':\r\n tileId = 'addInternetTile';\r\n icon = '/apps/comparison/assets/icon/agl_tile_internet.svg';\r\n productFound = !!this.bundleTileItems?.nbn?.displayItems?.length;\r\n productTheme = this.bundleTileItems?.nbn?.theme;\r\n productTint = this.bundleTileItems?.nbn?.themeTint;\r\n displayItems = this.bundleTileItems?.nbn?.displayItems;\r\n subtotal = this.bundleTileItems?.nbn?.subtotal;\r\n heading = productFound ? 'Internet' : 'Add Internet';\r\n break;\r\n case 'mobile plan':\r\n tileId = 'addMobileTile';\r\n icon = '/apps/comparison/assets/icon/agl_tile_mobile.svg';\r\n productFound = !!this.bundleTileItems?.mobile?.displayItems?.length;\r\n productTheme = this.bundleTileItems?.mobile?.theme;\r\n productTint = this.bundleTileItems?.mobile?.themeTint;\r\n displayItems = this.bundleTileItems?.mobile?.displayItems;\r\n subtotal = this.bundleTileItems?.mobile?.subtotal;\r\n heading = productFound ? 'Mobile' : 'Add Mobile';\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n const tileTheme = this.getTileTheme(product, productFound, productTheme, productTint);\r\n return (\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n {heading}\r\n \r\n
\r\n
\r\n {!productFound && }\r\n {productFound && (\r\n \r\n \r\n Edit\r\n \r\n \r\n )}\r\n
\r\n
\r\n
\r\n {!productFound && this.tileBodyNoProduct(product)}\r\n {productFound && this.tileBodyProduct(product, displayItems, subtotal)}\r\n
\r\n \r\n );\r\n }\r\n\r\n private tileBodyNoProduct(noProduct: ProductCategory): JSX.Element {\r\n if (noProduct === 'energy') {\r\n return (\r\n
\r\n \r\n Choose your energy plan and save on internet and mobile.\r\n \r\n
\r\n );\r\n }\r\n const energyError = this.getErrorState('energy');\r\n return (\r\n
\r\n {energyError && (\r\n
\r\n \r\n \r\n {noProduct === 'nbn'\r\n ? 'All plans come with unlimited data and no lock-in contract.'\r\n : 'All plans come with unlimited standard national talk and texts.'}\r\n \r\n \r\n
\r\n )}\r\n {!energyError && (\r\n
\r\n \r\n Get monthly discounts on selected AGL{' '}\r\n {noProduct === 'nbn' ? 'nbn' : 'mobile'} plans\r\n when you have AGL energy.\r\n \r\n
\r\n )}\r\n
\r\n );\r\n }\r\n\r\n private tileBodyProduct(product: ProductCategory, displayItems: DisplayItem[], subtotal: string) {\r\n if (product === 'energy') {\r\n return displayItems.map((item) => {\r\n return (\r\n
\r\n \r\n {item.productName}\r\n \r\n \r\n
\r\n );\r\n });\r\n } else if (product === 'nbn') {\r\n return (\r\n
\r\n
\r\n \r\n {displayItems[0].productName}\r\n \r\n \r\n {displayItems[0].productInfo}\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n {subtotal}\r\n \r\n \r\n {displayItems[0].paymentFrequency && displayItems[0].paymentPlanPrice && (\r\n \r\n {this.getPaymentPlanText(displayItems[0].paymentFrequency, displayItems[0].paymentPlanPrice)}\r\n \r\n )}\r\n
\r\n
\r\n );\r\n } else if (product === 'mobile plan') {\r\n return (\r\n
\r\n {displayItems.map((item) => {\r\n return (\r\n
\r\n
\r\n \r\n {`${item.productName} ${item.itemCount > 1 ? ` x${item.itemCount}` : ''}`}\r\n \r\n \r\n
\r\n
\r\n );\r\n })}\r\n
\r\n \r\n \r\n {subtotal}\r\n \r\n \r\n \r\n
\r\n
\r\n );\r\n }\r\n }\r\n\r\n private getPaymentPlanText(paymentFrequency: string, paymentPlanPrice: string): string {\r\n switch (paymentFrequency) {\r\n case 'outright':\r\n return 'not incl upfront cost of modem';\r\n case 'twelveMonths':\r\n return `incl ${paymentPlanPrice} each month for 12 mths`;\r\n case 'twentyFourMonths':\r\n return `incl ${paymentPlanPrice} each month for 24 mths`;\r\n default:\r\n return '';\r\n }\r\n }\r\n\r\n private toggleEnergyContainer(showContent: boolean): void {\r\n if (showContent === null) {\r\n return;\r\n }\r\n const energyContainerSectionElem = document\r\n .querySelector('[spa-id=\"app-products-energy-container\"]')\r\n ?.closest('section.container') as HTMLElement;\r\n if (energyContainerSectionElem) {\r\n energyContainerSectionElem.style.display = showContent ? 'block' : 'none';\r\n }\r\n }\r\n\r\n private shouldShowBundleBuilder(): boolean {\r\n const error = store.get('responseError');\r\n const address = store.get('address');\r\n const sessionAddress = sessionStorage.getItem(SessionStorageKeys.address);\r\n const showBundleBuilder = (address || sessionAddress) && ((!error || error.errorType !== 'systemError') as boolean);\r\n return showBundleBuilder;\r\n }\r\n\r\n private showErrorBoundary(): boolean {\r\n const error = store.get(StoreKeys.responseError);\r\n const flowTypeError = JSON.parse(sessionStorage.getItem(SessionStorageKeys.FlowDetails))?.error;\r\n return error?.errorType || flowTypeError;\r\n }\r\n\r\n public render(): JSX.Element {\r\n const showBundleBuilder = this.shouldShowBundleBuilder();\r\n this.toggleEnergyContainer(showBundleBuilder);\r\n const selectedCategory = store.get(StoreKeys.guidedFlowActiveCategory);\r\n bundleService.toggleStaticContent(selectedCategory);\r\n return (\r\n
\r\n {showBundleBuilder && (\r\n
\r\n
\r\n \r\n Here's what's available at your address:\r\n \r\n
\r\n
\r\n
\r\n {this.getTile(\r\n 'energy',\r\n store.get('isAuthenticated') && window.sessionStorage.getItem('authenticatedGuidedFlowEnabled')?.includes('true')\r\n )}\r\n
\r\n
\r\n {this.getTile(\r\n 'nbn',\r\n store.get('isAuthenticated') && window.sessionStorage.getItem('authenticatedGuidedFlowEnabled')?.includes('true')\r\n )}\r\n
\r\n
\r\n {this.getTile(\r\n 'mobile plan',\r\n store.get('isAuthenticated') && window.sessionStorage.getItem('authenticatedGuidedFlowEnabled')?.includes('true')\r\n )}\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n )}\r\n {!showBundleBuilder && this.showErrorBoundary() && }\r\n
\r\n );\r\n }\r\n}\r\n",".bundle-summary {\r\n padding: $space-02;\r\n\r\n @include agl-ds-screen-size('large') {\r\n min-width: 165px;\r\n padding: 0;\r\n }\r\n\r\n &__info,\r\n .empty-bundle {\r\n @include agl-ds-screen-size('large') {\r\n display: flex !important;\r\n flex-direction: column;\r\n }\r\n }\r\n\r\n &__info {\r\n min-height: 55px;\r\n align-items: flex-start;\r\n text-align: left;\r\n margin-bottom: 0;\r\n\r\n @include agl-ds-screen-size('large') {\r\n min-height: auto;\r\n margin-bottom: 3px !important;\r\n }\r\n }\r\n\r\n .bundled-category {\r\n @include agl-ds-screen-size('large') {\r\n margin-bottom: 2px !important;\r\n }\r\n }\r\n\r\n .empty-bundle {\r\n min-height: 55px;\r\n\r\n @include agl-ds-screen-size('large') {\r\n align-items: center;\r\n justify-content: center;\r\n min-height: 168px;\r\n }\r\n\r\n &__info {\r\n text-align: center;\r\n padding: 0 $space-01;\r\n }\r\n }\r\n\r\n &__cta {\r\n min-width: calc(100% - 32px);\r\n text-align: center;\r\n margin-bottom: $space-02;\r\n\r\n @include agl-ds-screen-size('large') {\r\n margin-bottom: 0;\r\n }\r\n }\r\n}\r\n","import {\r\n CartFlagType,\r\n CartFlags,\r\n CartFlagsService,\r\n CartUtils,\r\n ProductCategory,\r\n RetrieveCartResponse,\r\n SessionStorageKeys,\r\n RetrieveCartItem,\r\n Discount\r\n} from '@aglenergy/shared-library';\r\nimport { Component, ComponentInterface, Host, JSX, Prop, h } from '@stencil/core';\r\nimport { store } from 'app/shared/store/store';\r\nimport { BundleSearchStore } from 'app/shared/models/current-search-request.model';\r\nimport { CustomerProfile } from 'app/shared/models/customerProfile';\r\nimport { SelectedProductDetails, SelectedProductSessionData } from 'app/shared/models/sessionData';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { locationService } from 'app/shared/services/location/location-service';\r\nimport { tealiumAnalyticService } from 'app/shared/services/tealium/tealium-analytics.service';\r\n\r\n@Component({\r\n tag: 'bundle-summary',\r\n styleUrl: 'bundle-summary.scss',\r\n shadow: true\r\n})\r\nexport class BundleSummary implements ComponentInterface {\r\n @Prop() public buttonText = 'Go to Cart';\r\n @Prop() public cartDetails: RetrieveCartResponse;\r\n private monthlyTotalDiscounts = 0;\r\n private cartFlags: CartFlags;\r\n private cartFlagsService;\r\n private bundleFlags: string;\r\n private authenticatedProducts: BundleSearchStore;\r\n\r\n public navigateToNext(): void {\r\n const selectedMobileProducts: SelectedProductSessionData = JSON.parse(\r\n sessionStorage.getItem(SessionStorageKeys.SelectedMobileProductDetails)\r\n );\r\n const selectedNbnProducts: any = JSON.parse(sessionStorage.getItem(SessionStorageKeys.SelectedNBNProductDetails));\r\n const selectedEnergyProducts: CustomerProfile = JSON.parse(sessionStorage.getItem(SessionStorageKeys.CustomerProfile));\r\n const tealiumContext = ['Bundle Builder][Go to Cart][Clicked'];\r\n if (selectedMobileProducts) {\r\n const planNames: string = selectedMobileProducts.productDetails\r\n .map((productDetails: SelectedProductDetails) => productDetails.product.name)\r\n .toString();\r\n tealiumAnalyticService.sendEvent(\r\n tealiumContext,\r\n null,\r\n ProductCategory.Mobile,\r\n { product_plan_in_the_cart: planNames },\r\n 'mobile plan'\r\n );\r\n }\r\n\r\n if (selectedNbnProducts) {\r\n const planName: string = selectedNbnProducts.productDetails.product.name;\r\n tealiumAnalyticService.sendEvent(\r\n tealiumContext,\r\n null,\r\n ProductCategory.Nbn,\r\n { product_plan_in_the_cart: planName },\r\n ProductCategory.Nbn\r\n );\r\n }\r\n if (selectedEnergyProducts) {\r\n let category = '';\r\n if (selectedEnergyProducts.plans?.electricity && selectedEnergyProducts.plans?.gas) {\r\n category = 'Elec, Gas';\r\n } else if (selectedEnergyProducts.plans?.electricity) {\r\n category = 'Elec';\r\n } else if (selectedEnergyProducts.plans?.gas) {\r\n category = 'Gas';\r\n }\r\n\r\n const planName = selectedEnergyProducts.planFeatureDisclaimer?.title;\r\n tealiumAnalyticService.sendEvent(tealiumContext, null, category, { product_plan_in_the_cart: planName }, ProductCategory.Energy);\r\n }\r\n\r\n if (selectedMobileProducts) {\r\n locationService.navigateToEligibility('mobile plan', 'B100175');\r\n } else {\r\n locationService.navigateToUrl('/cart?cidi=A11097');\r\n }\r\n }\r\n\r\n public render(): JSX.Element {\r\n this.setCartFlags();\r\n return (\r\n \r\n
{this.cartDetails?.cartItems?.length ? this.getBundleSummary() : this.getEmptyBundleSummary()}
\r\n
\r\n );\r\n }\r\n\r\n private getBundleSummary(): JSX.Element {\r\n return (\r\n
\r\n \r\n {this.getBundleInfo()}\r\n
\r\n
\r\n \r\n {this.buttonText}\r\n \r\n
\r\n \r\n );\r\n }\r\n\r\n private getBundleInfo(): JSX.Element {\r\n let monthlyTotalSubText: string;\r\n let highlightMonthlyTotalSavings = this.cartFlags.hasBundleProductCategories;\r\n const monthlyTotal = this.getMonthlyTotal();\r\n if (store.get('isAuthenticated') && window.sessionStorage.getItem('authenticatedGuidedFlowEnabled')?.includes('true')) {\r\n this.getAuthDiscounts();\r\n }\r\n let monthlyTotalSavings = 'Add energy plan & save';\r\n\r\n const cartFlag = this.bundleFlags ? this.bundleFlags : this.getCartFlag();\r\n switch (cartFlag) {\r\n case CartFlagType.hasEnergyMobileSimNbnBundle:\r\n monthlyTotalSavings = `$${this.monthlyTotalDiscounts} off internet & mobile plans`;\r\n monthlyTotalSubText = '(internet & mobile) + energy';\r\n break;\r\n case CartFlagType.hasEnergyMobileSimBundle:\r\n monthlyTotalSavings = `$${this.monthlyTotalDiscounts} off mobile plan`;\r\n monthlyTotalSubText = '(mobile) + energy';\r\n break;\r\n case CartFlagType.hasEnergyNbnBundle:\r\n monthlyTotalSavings = `$${this.monthlyTotalDiscounts} off internet plan`;\r\n monthlyTotalSubText = '(internet) + energy';\r\n break;\r\n case CartFlagType.hasMobileSimNbnBundle:\r\n highlightMonthlyTotalSavings = false;\r\n monthlyTotalSubText = '(internet & mobile)';\r\n break;\r\n case CartFlagType.hasMobileSimOnly:\r\n monthlyTotalSubText = '(mobile)';\r\n break;\r\n case CartFlagType.hasNbnOnly:\r\n monthlyTotalSubText = '(internet)';\r\n break;\r\n case CartFlagType.hasEnergyOnly:\r\n default:\r\n break;\r\n }\r\n\r\n return (\r\n
\r\n {\r\n \r\n }\r\n
\r\n );\r\n }\r\n\r\n private getEmptyBundleSummary(): JSX.Element {\r\n return (\r\n
\r\n
\r\n Bundle your services and start saving.\r\n
\r\n
\r\n );\r\n }\r\n\r\n private getCartFlag(): string {\r\n return Object.entries(this.cartFlags)\r\n .filter(\r\n ([key, value]) =>\r\n ![CartFlagType.hasBundleProductCategories, CartFlagType.hasEnergy, CartFlagType.hasMobileSim, CartFlagType.hasNbn].includes(\r\n key as CartFlagType\r\n ) && value\r\n )\r\n .map(([key]) => key)\r\n ?.shift();\r\n }\r\n\r\n private getMonthlyTotal(): number {\r\n this.monthlyTotalDiscounts = 0;\r\n return [...this.cartDetails.cartItems]\r\n .filter(\r\n (cartItem) =>\r\n !!cartItem?.additionalData?.productDisplayAttributes &&\r\n ![ProductCategory.CarbonNeutral, ProductCategory.Energy, ProductCategory.Modem].includes(\r\n cartItem.additionalData.productCategory.toLowerCase() as ProductCategory\r\n )\r\n )\r\n .map((cartItem) => {\r\n const productDisplayAttributes = cartItem.additionalData.productDisplayAttributes as Partial<{ price: string }>;\r\n const nonCouponDiscount = CartUtils.getPromotionDiscount(cartItem.productDiscounts, false);\r\n if (nonCouponDiscount) {\r\n this.monthlyTotalDiscounts += CartUtils.normaliseDiscountAmount(nonCouponDiscount.discountAmount);\r\n }\r\n return CartUtils.calculateDiscountedPrice(Number(productDisplayAttributes.price), nonCouponDiscount?.discountAmount);\r\n })\r\n .reduce((previousValue, currentValue) => previousValue + currentValue, 0);\r\n }\r\n\r\n private getAuthDiscounts(): void {\r\n const selectedProducts: RetrieveCartItem[] = this.cartDetails.cartItems;\r\n this.authenticatedProducts = store.get(StoreKeys.bundleSearchStore);\r\n if (this.authenticatedProducts?.address) {\r\n this.monthlyTotalDiscounts = 0;\r\n this.addBundleFlag('clear');\r\n selectedProducts?.map((cartItem: RetrieveCartItem) => {\r\n const item = cartItem.additionalData?.productCategory.toLowerCase();\r\n this.authenticatedProducts.discounts?.map((discount: Discount) => {\r\n if (item.includes(discount.productCategory.applyTo)) {\r\n this.monthlyTotalDiscounts += discount.discountAmount ? +discount.discountAmount : 0;\r\n this.addBundleFlag(discount.productCategory.applyTo.toLowerCase());\r\n }\r\n });\r\n });\r\n }\r\n }\r\n\r\n private addBundleFlag(productCategory?: string): void {\r\n switch (productCategory) {\r\n case 'mobile plan':\r\n if (this.bundleFlags.includes('hasEnergyNbnBundle') || this.bundleFlags.includes('hasEnergyMobileSimNbnBundle')) {\r\n this.bundleFlags = 'hasEnergyMobileSimNbnBundle';\r\n } else {\r\n this.bundleFlags = 'hasEnergyMobileSimBundle';\r\n }\r\n break;\r\n case 'nbn':\r\n if (this.bundleFlags.includes('hasEnergyMobileSimBundle') || this.bundleFlags.includes('hasEnergyMobileSimNbnBundle')) {\r\n this.bundleFlags = 'hasEnergyMobileSimNbnBundle';\r\n } else {\r\n this.bundleFlags = 'hasEnergyNbnBundle';\r\n }\r\n break;\r\n case 'clear':\r\n this.bundleFlags = '';\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n private setCartFlags(): void {\r\n if (this.cartDetails) {\r\n this.cartFlagsService = new CartFlagsService(this.cartDetails);\r\n this.cartFlags = this.cartFlagsService.getCartFlags();\r\n }\r\n }\r\n}\r\n","import { Component, Host, h, JSX, Prop } from '@stencil/core';\r\n\r\n@Component({\r\n tag: 'bundle-summary-discount'\r\n})\r\nexport class BundleSummaryDiscount {\r\n @Prop() public highlightMonthlyTotalSavings = false;\r\n @Prop() public monthlyTotal: string;\r\n @Prop() public monthlyTotalSavings: string;\r\n @Prop() public monthlyTotalSubText: string;\r\n\r\n public render(): JSX.Element {\r\n return (\r\n \r\n \r\n Monthly total\r\n \r\n \r\n \r\n {this.monthlyTotal} {this.monthlyTotalSubText}\r\n \r\n \r\n \r\n Total monthly savings\r\n \r\n \r\n \r\n {this.monthlyTotalSavings}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n",":host {\r\n display: block;\r\n}\r\n\r\n/* Panning specific styles */\r\n.carousel-wrapper {\r\n width: calc(100vw - var(--scrollbar-width));\r\n display: flex;\r\n overflow-x: auto;\r\n padding-bottom: 30px;\r\n -webkit-overflow-scrolling: touch; /* important for iOS */\r\n}\r\n\r\n.scroll-snap-type {\r\n scroll-snap-type: x mandatory; /* Safari */\r\n scroll-snap-destination: 50% 50%;\r\n scroll-behavior: smooth;\r\n}\r\n\r\n.scroll-snap {\r\n scroll-snap-align: center; /* older (Firefox/IE) */\r\n scroll-snap-coordinate: 50% 50%; /* older (Safari) */\r\n scroll-snap-stop: normal;\r\n}\r\n\r\n/* End of: Panning specific styles */\r\n\r\n.gradient-overlay {\r\n position: absolute;\r\n z-index: 10;\r\n}\r\n\r\n.left-gradient-overlay {\r\n left: 0;\r\n /* stylelint-disable-next-line max-line-length */\r\n background: linear-gradient(90deg, rgb(255 255 255 / 100%) 0%, rgb(255 255 255 / 70%) 80%, rgb(255 255 255 / 0%) 100%);\r\n}\r\n\r\n.right-gradient-overlay {\r\n right: 0;\r\n /* stylelint-disable-next-line max-line-length */\r\n background: linear-gradient(90deg, rgb(255 255 255 / 0%) 0%, rgb(255 255 255 / 70%) 20%, rgb(255 255 255 / 100%) 100%);\r\n}\r\n\r\nbutton {\r\n display: none;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n display: block;\r\n background-color: transparent;\r\n cursor: pointer;\r\n\r\n &.left-button {\r\n position: absolute;\r\n z-index: 15;\r\n }\r\n\r\n &.right-button {\r\n position: absolute;\r\n z-index: 15;\r\n }\r\n\r\n &.hide {\r\n display: none;\r\n }\r\n }\r\n}\r\n\r\n.pagination-container {\r\n margin-left: auto;\r\n margin-right: auto;\r\n height: $space-04;\r\n display: flex;\r\n gap: $space-01;\r\n justify-content: center;\r\n align-items: center;\r\n\r\n .pagination-bullet,\r\n .pagination-bullet-active {\r\n transition: width 200ms ease-in-out;\r\n background: var(--colors-tint-primary-01-40);\r\n border-radius: $space-06;\r\n width: 8px;\r\n height: 8px;\r\n cursor: pointer;\r\n }\r\n\r\n .pagination-bullet-active {\r\n transition: width 200ms;\r\n background: var(--colors-primary-01);\r\n width: 24px;\r\n cursor: default;\r\n }\r\n}\r\n","import { Component, Element, Host, JSX, Prop, State, Watch, h } from '@stencil/core';\r\n\r\nimport LeftArrow from '../../../../assets/icon/left-arrow.svg';\r\nimport RightArrow from '../../../../assets/icon/right-arrow.svg';\r\n\r\n@Component({\r\n tag: 'carousel-buttons',\r\n styleUrl: 'carousel-buttons.scss',\r\n shadow: false,\r\n scoped: true\r\n})\r\nexport class CarouselButtons {\r\n @Element() private hostElement: HTMLDlsButtonElement;\r\n @Prop() public numberOfProducts: number;\r\n @Prop() public focusedCardIndex?: number;\r\n @Prop() public showPagination?: boolean;\r\n\r\n @State() public viewPortWidth = 0;\r\n @State() public cardsContainerWidth = 0;\r\n @State() public cardWidth = 0;\r\n @State() public overlayWidth = 0;\r\n @State() public cardsFit = false;\r\n @State() public scrollLeft = 0;\r\n @State() public firstCardFits = false;\r\n @State() public lastCardFits = false;\r\n\r\n private leftButton: HTMLElement;\r\n private rightButton: HTMLElement;\r\n\r\n private changeVisibility = (button: HTMLElement, visible: boolean): void => {\r\n visible ? button.classList.remove('hide') : button.classList.add('hide');\r\n };\r\n\r\n private focusInitialCard = (): void => {\r\n const focusedCard = this.hostElement.querySelectorAll('.card__wrapper')[this.focusedCardIndex];\r\n const viewportWidth = document.getElementById('carousel-wrapper').clientWidth;\r\n const shift = focusedCard?.getBoundingClientRect().x + focusedCard?.clientWidth / 2 - viewportWidth / 2;\r\n const carouselScroller = document.querySelector('#carousel-wrapper');\r\n carouselScroller.scrollBy(shift, 0);\r\n this.scrollLeft = carouselScroller.scrollLeft;\r\n };\r\n\r\n private calculateAndPositionCards = (): void => {\r\n const carouselWrapper = document.getElementById('carousel-wrapper');\r\n if (!carouselWrapper) return;\r\n const containerBounding = carouselWrapper.getBoundingClientRect();\r\n const viewportWidth = containerBounding.width;\r\n\r\n const cardsContainer = document.getElementById('card-container');\r\n const cardsContainerWidth = cardsContainer.clientWidth;\r\n\r\n const allCards = document.getElementsByClassName('card__wrapper');\r\n const cardWidth = allCards[0].getBoundingClientRect().width;\r\n\r\n const cardMargin = 32;\r\n const cardsFit = viewportWidth >= cardsContainerWidth;\r\n let fitCardsWidth = 0;\r\n let numberOfCards = 1;\r\n let cardsContainerMargin = 0;\r\n let edgeCardVisibleWidth = 0;\r\n if (cardsFit) {\r\n cardsContainerMargin = (viewportWidth - cardsContainerWidth) / 2;\r\n } else {\r\n // eslint-disable-next-line no-constant-condition\r\n while (true) {\r\n const cardsWidthWithMargins = numberOfCards * cardWidth + (numberOfCards + 1) * cardMargin;\r\n if (cardsWidthWithMargins < viewportWidth || numberOfCards <= 1) {\r\n fitCardsWidth = cardsWidthWithMargins;\r\n numberOfCards += 2;\r\n } else {\r\n break;\r\n }\r\n }\r\n edgeCardVisibleWidth = Math.max((viewportWidth - fitCardsWidth) / 2, 0);\r\n if (this.isSmallDesktopViewPortWidth) {\r\n edgeCardVisibleWidth = 0;\r\n }\r\n cardsContainerMargin = edgeCardVisibleWidth + cardMargin;\r\n }\r\n\r\n cardsContainer.style.marginLeft = `${cardsContainerMargin}px`;\r\n cardsContainer.style.marginRight = `${cardsContainerMargin}px`;\r\n\r\n let firstCardFits = cardsFit || allCards[0].getBoundingClientRect().x - cardMargin > 0;\r\n if (this.isSmallDesktopViewPortWidth) {\r\n firstCardFits = cardsFit || allCards[0].getBoundingClientRect().x > 0;\r\n }\r\n let lastCardFits = cardsFit || allCards[allCards.length - 1].getBoundingClientRect().x < viewportWidth - cardWidth - cardMargin;\r\n if (this.isSmallDesktopViewPortWidth) {\r\n lastCardFits = cardsFit || allCards[allCards.length - 1].getBoundingClientRect().x < viewportWidth - cardWidth;\r\n }\r\n\r\n this.changeVisibility(this.leftButton, !firstCardFits);\r\n this.changeVisibility(this.rightButton, !lastCardFits);\r\n\r\n const overlayHeightOffset = 5;\r\n const overlayHeight = allCards[0].getBoundingClientRect().height + overlayHeightOffset * 2;\r\n\r\n const svgWidth = 40;\r\n const arrowHorizontalOffset = edgeCardVisibleWidth + cardMargin - svgWidth / 2;\r\n document.getElementById('left-arrow-button').style.left = `${arrowHorizontalOffset}px`;\r\n document.getElementById('right-arrow-button').style.right = `${arrowHorizontalOffset}px`;\r\n document.getElementById('left-arrow-button').style.marginTop = `${overlayHeight / 4}px`;\r\n document.getElementById('right-arrow-button').style.marginTop = `${overlayHeight / 4}px`;\r\n\r\n document.getElementById('left-gradient-overlay').style.height = `${overlayHeight}px`;\r\n document.getElementById('right-gradient-overlay').style.height = `${overlayHeight}px`;\r\n document.getElementById('left-gradient-overlay').style.marginTop = `-${overlayHeightOffset}px`;\r\n document.getElementById('right-gradient-overlay').style.marginTop = `-${overlayHeightOffset}px`;\r\n document.getElementById('left-gradient-overlay').style.width = `${edgeCardVisibleWidth}px`;\r\n document.getElementById('right-gradient-overlay').style.width = `${edgeCardVisibleWidth}px`;\r\n this.viewPortWidth = viewportWidth;\r\n this.cardsContainerWidth = cardsContainerWidth;\r\n this.cardWidth = cardWidth;\r\n this.overlayWidth = edgeCardVisibleWidth;\r\n this.cardsFit = cardsFit;\r\n this.scrollLeft = carouselWrapper.scrollLeft;\r\n this.firstCardFits = firstCardFits;\r\n this.lastCardFits = lastCardFits;\r\n };\r\n\r\n private get isSmallDesktopViewPortWidth(): boolean {\r\n const carouselWrapper = document.getElementById('carousel-wrapper');\r\n if (!carouselWrapper) return;\r\n const containerBounding = carouselWrapper.getBoundingClientRect();\r\n const viewportWidth = containerBounding.width;\r\n return viewportWidth < 1300 && viewportWidth > 800;\r\n }\r\n\r\n private onScroll = (): void => {\r\n this.calculateAndPositionCards();\r\n };\r\n\r\n componentDidLoad(): void {\r\n this.leftButton = this.hostElement.querySelector('.left-button');\r\n this.rightButton = this.hostElement.querySelector('.right-button');\r\n this.calculateAndPositionCards();\r\n this.focusedCardIndex && this.focusInitialCard();\r\n }\r\n\r\n @Watch('numberOfProducts')\r\n public watchHandler(): void {\r\n setTimeout(() => {\r\n this.calculateAndPositionCards();\r\n });\r\n }\r\n\r\n componentWillLoad(): void {\r\n window.addEventListener('resize', this.onResize, true);\r\n window.addEventListener('scroll', this.onScroll, true);\r\n }\r\n\r\n private onResize = () => {\r\n this.calculateAndPositionCards();\r\n };\r\n\r\n render(): JSX.Element {\r\n return (\r\n \r\n
\r\n
this.moveLeft()} />\r\n \r\n \r\n
this.moveRight()} />\r\n \r\n
\r\n {this.showPagination && this.renderPagination()}\r\n \r\n );\r\n }\r\n\r\n private moveRight(): void {\r\n const carouselScroller = document.querySelector('#carousel-wrapper');\r\n const cardWidth = carouselScroller.querySelector('.card__wrapper').clientWidth;\r\n carouselScroller.scrollBy(cardWidth, 0);\r\n }\r\n\r\n private moveLeft(): void {\r\n const carouselScroller = document.querySelector('#carousel-wrapper');\r\n const cardWidth = carouselScroller.querySelector('.card__wrapper').clientWidth;\r\n carouselScroller.scrollBy(-cardWidth, 0);\r\n }\r\n\r\n private scrollToPageIndex(activePage: number, targetPage: number): void {\r\n if (activePage !== targetPage) {\r\n const carouselScroller = document.querySelector('#carousel-wrapper');\r\n const cardWidth = carouselScroller.querySelector('.card__wrapper').clientWidth;\r\n carouselScroller.scrollBy((targetPage - activePage) * cardWidth, 0);\r\n }\r\n }\r\n\r\n private renderPagination(): JSX.Element {\r\n if (!this.cardsFit) {\r\n const allCards = document.getElementsByClassName('card__wrapper');\r\n const visibleContainerWidth = this.viewPortWidth - 2 * this.overlayWidth;\r\n const hiddenCards = Math.ceil((this.cardsContainerWidth - visibleContainerWidth) / this.cardWidth);\r\n const numberOfPage = allCards.length == hiddenCards ? hiddenCards : hiddenCards + 1;\r\n let activePage = 0;\r\n if (this.firstCardFits) {\r\n activePage = 0;\r\n } else if (this.lastCardFits) {\r\n activePage = numberOfPage - 1;\r\n } else {\r\n activePage = Math.floor(this.scrollLeft / this.cardWidth);\r\n if (activePage === 0) activePage = 1;\r\n }\r\n\r\n const paginations = [];\r\n for (let i = 0; i < numberOfPage; i++) {\r\n paginations.push(\r\n this.scrollToPageIndex(activePage, i)}\r\n />\r\n );\r\n }\r\n\r\n const paginationStyle = { width: `${this.viewPortWidth}px` };\r\n\r\n return (\r\n
\r\n {paginations}\r\n
\r\n );\r\n }\r\n\r\n return
;\r\n }\r\n}\r\n",".current-plan-info {\r\n &__container {\r\n padding: $space-04 $space-03;\r\n width: 100%;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n font-family: $font-family-02;\r\n padding: $space-06 0;\r\n width: 100%;\r\n }\r\n }\r\n\r\n &__selection {\r\n display: inline-block;\r\n gap: $space-01;\r\n width: 100%;\r\n font-weight: $font-weight-semi-bold;\r\n padding: 0;\r\n text-align: center;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n text-align: left;\r\n flex-wrap: wrap;\r\n display: flex;\r\n }\r\n\r\n &__message {\r\n color: $neutral-01;\r\n font: $font-weight-semi-bold $font-size-lg-06 $font-family-01;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n flex-grow: 1;\r\n flex-basis: auto;\r\n font-size: $font-size-md-07;\r\n }\r\n }\r\n }\r\n\r\n &__header {\r\n border-radius: $space-01 $space-01 0 0;\r\n background-color: $neutral-06;\r\n margin-top: $space-03;\r\n width: 100%;\r\n padding: 10px;\r\n font-family: $font-family-02;\r\n font-size: 12px;\r\n text-align: center;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n padding: 10px;\r\n width: 131px;\r\n }\r\n }\r\n\r\n &-details {\r\n align-self: stretch;\r\n font-family: $font-family-02;\r\n border-radius: 0 0 $space-01 $space-01;\r\n background-color: $neutral-08;\r\n display: flex;\r\n flex-direction: column;\r\n font-size: $font-size-sm-04;\r\n justify-content: center;\r\n padding: 0 $space-01 0 $space-01;\r\n gap: $space-02;\r\n width: 100%;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n border-radius: 0 $space-01 $space-01 $space-01;\r\n padding: 0 $space-04;\r\n }\r\n\r\n &__container {\r\n justify-content: flex-start;\r\n display: flex;\r\n flex-direction: column;\r\n padding: $space-03;\r\n gap: 0;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n padding: $space-03 0;\r\n flex-direction: row;\r\n gap: $space-08;\r\n }\r\n }\r\n\r\n &__icon {\r\n width: 24px;\r\n height: 24px;\r\n margin-right: $space-01;\r\n }\r\n\r\n &__title {\r\n display: flex;\r\n flex-direction: row;\r\n font-family: $font-family-02;\r\n font-weight: $font-weight-semi-bold;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n font-size: $font-size-md-04;\r\n }\r\n }\r\n\r\n &__info,\r\n &__address {\r\n font: $font-weight-regular $font-size-sm-01 $font-family-02;\r\n color: $neutral-01;\r\n margin-top: 8px;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n font: $font-weight-regular $font-size-md-01 $font-family-02;\r\n }\r\n }\r\n\r\n &__item {\r\n min-width: 30%;\r\n }\r\n\r\n &__item:not(:first-child) {\r\n margin-top: $space-03;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n margin-top: 0;\r\n }\r\n }\r\n }\r\n\r\n &__disclaimer {\r\n width: 100%;\r\n font-family: $font-family-02;\r\n font-size: 12px;\r\n text-align: center;\r\n padding: $space-02 $space-03;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n padding: $space-01 0;\r\n text-align: left;\r\n }\r\n }\r\n}\r\n","import { Component, ComponentInterface, h, Host, JSX, Prop, State } from '@stencil/core';\r\nimport { store } from 'app/shared/store/store';\r\nimport { getDataSpaSearchParams } from 'app/shared/utilities/helper-functions';\r\nimport { DataSpaKey } from 'app/shared/models/dataSpa';\r\nimport { MobileService } from 'app/mobile/models/mobile-service.model';\r\nimport { DataSpaSearchParams } from 'app/shared/utilities/data-spa-search-params.util';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\n\r\n@Component({\r\n tag: 'current-plan-info',\r\n styleUrl: 'current-plan-info.scss',\r\n shadow: false,\r\n scoped: true\r\n})\r\nexport class CurrentPlanInfo implements ComponentInterface {\r\n @Prop() public readonly dataSpa: string = null;\r\n\r\n @State() private isMobileLandingPage = false;\r\n @State() private planName = null;\r\n @State() private planFeature = null;\r\n @State() private mobileNumber = null;\r\n\r\n private spaParams: DataSpaSearchParams;\r\n\r\n public componentWillLoad(): void {\r\n if (this.dataSpa) {\r\n this.spaParams = getDataSpaSearchParams(this.dataSpa);\r\n this.isMobileLandingPage = this.spaParams.get(DataSpaKey.isMobile) === 'true';\r\n }\r\n }\r\n\r\n render(): JSX.Element {\r\n return (\r\n \r\n
\r\n
\r\n
\r\n
\r\n

Change your {this.isMobileLandingPage ? 'SIM' : 'nbn®'} plan

\r\n
\r\n
\r\n
Your current plan
\r\n {!this.isMobileLandingPage && this.renderCurrentNbnPlanInfo()}\r\n {this.isMobileLandingPage && this.renderCurrentMobilePlanInfo()}\r\n
Any offers included in your current plan will end.
\r\n
\r\n
\r\n
\r\n );\r\n }\r\n\r\n renderCurrentNbnPlanInfo(): JSX.Element {\r\n const currentPlan = store.get(StoreKeys.currentNbnPlan);\r\n const address = store.get('address');\r\n let serviceAddress = '';\r\n if (currentPlan) {\r\n this.planName = currentPlan?.name;\r\n this.planFeature = currentPlan?.content?.features?.find(\r\n (feature) => feature.featureDescription.indexOf('Mbps') > 0\r\n )?.featureDescription;\r\n }\r\n\r\n if (address) {\r\n serviceAddress = address.fullAddress;\r\n }\r\n\r\n return (\r\n store.get(StoreKeys.currentNbnPlan) && (\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n {this.planName}\r\n
\r\n
\r\n
\r\n {serviceAddress}\r\n
\r\n
\r\n {this.planFeature && (\r\n
\r\n
\r\n \r\n
Speed
\r\n
\r\n
\r\n {this.planFeature}\r\n
\r\n
\r\n )}\r\n
\r\n
\r\n )\r\n );\r\n }\r\n\r\n renderCurrentMobilePlanInfo(): JSX.Element {\r\n const existingMobileService = store.get('selectedTelcoService') as MobileService;\r\n const currentMobilePlan = store.get(StoreKeys.currentMobilePlan);\r\n if (currentMobilePlan && existingMobileService) {\r\n this.planName = currentMobilePlan.name;\r\n if (existingMobileService.mobileServiceNumber)\r\n this.mobileNumber = this.formatAustralianMobileNumber(existingMobileService.mobileServiceNumber);\r\n }\r\n\r\n return (\r\n store.get(StoreKeys.currentMobilePlan) && (\r\n
\r\n
\r\n
\r\n
\r\n \r\n
Plan Type
\r\n
\r\n
\r\n {this.planName} Plan\r\n
\r\n
\r\n
\r\n
\r\n \r\n
Phone Number
\r\n
\r\n
\r\n {this.mobileNumber}\r\n
\r\n
\r\n
\r\n
\r\n )\r\n );\r\n }\r\n\r\n private formatAustralianMobileNumber(number: string): string {\r\n // Remove the country code '61' and add '0' at the beginning\r\n if (number.startsWith('61')) {\r\n number = `0${number.slice(2)}`;\r\n }\r\n\r\n // Format the number as '0400 123 123'\r\n return number.replace(/(\\d{4})(\\d{3})(\\d{3})/, '$1 $2 $3');\r\n }\r\n}\r\n","import { Component, ComponentInterface, JSX, getAssetPath, h } from '@stencil/core';\r\n\r\n@Component({\r\n tag: 'error-boundary',\r\n shadow: true,\r\n assetsDirs: ['../../assets']\r\n})\r\nexport class ErrorBoundary implements ComponentInterface {\r\n private title: string;\r\n private imagePath: string;\r\n private content: JSX.Element;\r\n\r\n public componentWillLoad(): void {\r\n this.setContentBasedOnErrorType();\r\n }\r\n\r\n private setContentBasedOnErrorType(): void {\r\n this.imagePath = '../assets/icon/agl_illus_dig_no_load.svg';\r\n this.title = \"Sorry, something's gone wrong.\";\r\n this.content = (\r\n \r\n We're having some issues accessing the right data. Please try reloading the page or \r\n \r\n contact us\r\n \r\n  for help.\r\n \r\n );\r\n }\r\n\r\n public render(): JSX.Element {\r\n return (\r\n \r\n \r\n \r\n \r\n {this.title}\r\n \r\n {this.content}\r\n \r\n \r\n );\r\n }\r\n}\r\n",".error-modal {\r\n $self: &;\r\n\r\n &__content {\r\n /* stylelint-disable-next-line selector-class-pattern */\r\n .error-modal__content-extra-padding {\r\n @include agl-ds-screen-size('medium') {\r\n padding-bottom: $space-06;\r\n }\r\n }\r\n\r\n display: flex;\r\n flex-flow: row;\r\n justify-content: space-between;\r\n }\r\n\r\n &__link {\r\n font-weight: $font-weight-semi-bold;\r\n }\r\n\r\n &__content-text-wrapper {\r\n padding-bottom: $space-03;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n width: 62%;\r\n padding-bottom: 0;\r\n }\r\n }\r\n\r\n &__content-image-wrapper {\r\n display: none;\r\n max-height: 192px;\r\n max-width: 264px;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n display: block;\r\n padding: 0 $space-04 $space-02 0;\r\n }\r\n\r\n @include agl-ds-screen-size('large') {\r\n padding: 0;\r\n }\r\n }\r\n\r\n &__button-wrapper {\r\n padding: $space-01 0 $space-02 0;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n padding: 0;\r\n display: flex;\r\n justify-content: space-between;\r\n }\r\n }\r\n\r\n &__first-button-container {\r\n width: 100%;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n width: 50%;\r\n }\r\n\r\n &--bottom-spacer {\r\n margin-bottom: $space-02;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n margin-bottom: 0;\r\n }\r\n }\r\n }\r\n\r\n &__second-button-container {\r\n width: 100%;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n width: 50%;\r\n display: flex;\r\n justify-content: flex-end;\r\n }\r\n }\r\n\r\n &__second-button {\r\n @include agl-ds-screen-size('medium') {\r\n max-width: 288px;\r\n width: 100%;\r\n }\r\n }\r\n\r\n &__liveperson {\r\n display: inline;\r\n }\r\n}\r\n\r\n.agl-ds-modal {\r\n &__content {\r\n min-height: 230px;\r\n overflow-y: hidden;\r\n }\r\n}\r\n","import { Component, JSX, h, Prop, Method, getAssetPath, ComponentInterface } from '@stencil/core';\r\nimport { SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { ErrorMessage } from 'app/shared/models/errorModal.model';\r\n\r\n@Component({\r\n tag: 'error-modal',\r\n styleUrl: 'error-modal.scss'\r\n})\r\nexport class ErrorModal implements ComponentInterface {\r\n @Prop() public errorMessageData: ErrorMessage;\r\n\r\n private aglDsModalRef: any;\r\n\r\n @Method()\r\n public async showModal(elToBeFocused: HTMLElement): Promise {\r\n await this.aglDsModalRef.openModal(elToBeFocused);\r\n }\r\n\r\n @Method()\r\n public async closeModal(): Promise {\r\n await this.aglDsModalRef.closeModal();\r\n }\r\n\r\n private handleModalClosed(forceRefresh: boolean, redirectToMovers = false): void {\r\n if (this.errorMessageData.errorTitle === 'Unable to connect you') {\r\n sessionStorage.removeItem(SessionStorageKeys.ProductDetailsSession);\r\n }\r\n if (redirectToMovers) {\r\n this.clearNbnMoversStoredData();\r\n window.location.href = '/apps/confirm/?#/movers/address';\r\n } else if (forceRefresh) {\r\n window.location.href = this.getWindowLocationWithoutAddressParam();\r\n }\r\n }\r\n\r\n private clearNbnMoversStoredData(): void {\r\n let customerProfile = JSON.parse(sessionStorage.getItem('customerProfileService'));\r\n let questionResponseMovers = JSON.parse(sessionStorage.getItem('questionResponseMovers'));\r\n\r\n customerProfile = {\r\n ...customerProfile,\r\n isGasUpdated: false,\r\n isElectricityUpdated: false,\r\n isInternetUpdated: false,\r\n isMobileUpdated: false\r\n };\r\n if (questionResponseMovers) {\r\n questionResponseMovers = questionResponseMovers.filter((question) => question.name === 'movers-new-existing');\r\n }\r\n\r\n sessionStorage.setItem('customerProfileService', JSON.stringify(customerProfile));\r\n sessionStorage.setItem('questionResponseMovers', JSON.stringify(questionResponseMovers));\r\n }\r\n\r\n private getWindowLocationWithoutAddressParam() {\r\n const searchParams = new URLSearchParams(window.location.search);\r\n searchParams.delete('address');\r\n searchParams.delete('locid');\r\n let newPath = window.location.pathname;\r\n if (searchParams.toString()) {\r\n newPath += `?${searchParams.toString()}`;\r\n }\r\n return newPath;\r\n }\r\n\r\n private renderContact(): JSX.Element {\r\n if (this.errorMessageData.contactType === 'redirect') {\r\n return (\r\n \r\n If you have any questions,{' '}\r\n \r\n contact us\r\n \r\n .\r\n \r\n );\r\n } else if (this.errorMessageData.contactType === 'tryAgainOrRedirect') {\r\n return (\r\n \r\n Please try again or{' '}\r\n \r\n contact us\r\n \r\n .\r\n \r\n );\r\n } else if (this.errorMessageData.contactType === 'getInTouch') {\r\n return If you have any questions, please get in touch with us.;\r\n } else if (this.errorMessageData.contactType === 'moversContactUs') {\r\n return (\r\n \r\n If you have any questions, please{' '}\r\n \r\n contact us\r\n \r\n .\r\n \r\n );\r\n }\r\n return null;\r\n }\r\n\r\n private renderMessage(): JSX.Element {\r\n if (this.errorMessageData.messageUrl && this.errorMessageData.messageLinkText) {\r\n return (\r\n \r\n {this.errorMessageData.errorMessage}\r\n this.aglDsModalRef.closeModal()}\r\n >\r\n {this.errorMessageData.messageLinkText}\r\n \r\n .\r\n \r\n );\r\n }\r\n\r\n if (this.errorMessageData.errorTitle === 'Unable to connect you' || this.errorMessageData.errorTitle === 'Unable to connect internet') {\r\n return (\r\n \r\n {this.errorMessageData.errorMessage} nbn{' '}\r\n {this.errorMessageData.errorMessageExtended}\r\n \r\n );\r\n }\r\n\r\n return {this.errorMessageData.errorMessage};\r\n }\r\n\r\n private renderSecondMessage(): JSX.Element {\r\n if (this.errorMessageData.secondErrorMessage) {\r\n return {this.errorMessageData.secondErrorMessage};\r\n }\r\n return null;\r\n }\r\n\r\n public render(): JSX.Element {\r\n const hasSecondButton = this.errorMessageData.secondButtonUrl && this.errorMessageData.secondButtonLabel;\r\n return (\r\n (this.aglDsModalRef = el)}\r\n appearance=\"centerscreen\"\r\n animation-type=\"popup\"\r\n // eslint-disable-next-line react/jsx-no-bind\r\n onModalClosed={() =>\r\n this.handleModalClosed(this.errorMessageData.forceRefresh, this.errorMessageData.buttonUrl === '/apps/confirm/?#/movers/address')\r\n }\r\n >\r\n
\r\n \r\n {this.errorMessageData.errorTitle}\r\n \r\n
\r\n
\r\n
\r\n {this.renderMessage()}\r\n {this.renderSecondMessage()}\r\n {this.renderContact()}\r\n
\r\n
\r\n \r\n
\r\n
\r\n {this.errorMessageData.showFooter && (\r\n
\r\n
\r\n \r\n \r\n {this.errorMessageData.buttonLabel}\r\n \r\n
\r\n {hasSecondButton && (\r\n
\r\n \r\n {this.errorMessageData.secondButtonLabel}\r\n \r\n
\r\n )}\r\n
\r\n
\r\n )}\r\n \r\n );\r\n }\r\n}\r\n",".container {\r\n background-color: $c-neutral-06;\r\n}\r\n\r\n.item {\r\n padding-top: $space-02;\r\n padding-bottom: $space-02;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n padding-top: $space-03;\r\n padding-bottom: $space-03;\r\n }\r\n\r\n @include agl-ds-screen-size('large') {\r\n padding-top: $space-03;\r\n padding-bottom: $space-03;\r\n }\r\n}\r\n","import { Component, JSX, h, Host, ComponentInterface } from '@stencil/core';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { ProductCategory } from 'app/shared/models/product-category.model';\r\nimport { store } from 'app/shared/store/store';\r\n\r\n@Component({\r\n tag: 'features-highlight',\r\n styleUrl: 'features-highlight.scss'\r\n})\r\nexport class FeaturesHighlight implements ComponentInterface {\r\n private productCategory: ProductCategory = store.get(StoreKeys.productCategory);\r\n public render(): JSX.Element {\r\n let elementToRender: HTMLElement;\r\n switch (this.productCategory) {\r\n case 'nbn':\r\n elementToRender = ;\r\n }\r\n\r\n return {elementToRender};\r\n }\r\n}\r\n",":host {\r\n display: block;\r\n top: 0;\r\n}\r\n\r\n.info-tag-container {\r\n top: 0;\r\n left: 0;\r\n background-color: white;\r\n}\r\n\r\n.info-tag-title {\r\n border: solid 1px #ce2a3e;\r\n background-color: #ce2a3e;\r\n padding: 2px 14px;\r\n color: white;\r\n border-radius: 8px 8px 0 0;\r\n font-weight: bold;\r\n font-size: 12px;\r\n width: max-content;\r\n}\r\n\r\n.info-tag-content {\r\n display: flex;\r\n flex-direction: column;\r\n padding: 12px 16px;\r\n gap: 12px;\r\n font-size: 16px;\r\n font-weight: normal;\r\n font-stretch: normal;\r\n font-style: normal;\r\n line-height: 1.5;\r\n letter-spacing: normal;\r\n text-align: left;\r\n background-color: white;\r\n border-radius: 0 8px 8px;\r\n border: solid 1px #ce2a3e;\r\n color: var(--neutral-00);\r\n}\r\n\r\na {\r\n font-size: 14px;\r\n}\r\n","import { Component, Host, h, Prop } from '@stencil/core';\r\n\r\n@Component({\r\n tag: 'info-tag',\r\n styleUrl: 'info-tag.scss',\r\n shadow: false,\r\n scoped: false\r\n})\r\nexport class InfoTag {\r\n @Prop() public heading: string;\r\n @Prop() public content: string;\r\n\r\n private deserialiseContent(): string {\r\n const txt = document.createElement('textarea');\r\n txt.innerHTML = this.content;\r\n return txt.value;\r\n }\r\n\r\n private renderContent(): any {\r\n return
;\r\n }\r\n\r\n render(): any {\r\n return (\r\n \r\n
\r\n
{this.heading}
\r\n
{this.renderContent()}
\r\n
\r\n
\r\n );\r\n }\r\n}\r\n",".login-to-account {\r\n margin-bottom: $space-09;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n margin-bottom: $space-15;\r\n }\r\n\r\n &__mid-text {\r\n margin-bottom: 20px;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n margin-bottom: $space-03;\r\n }\r\n }\r\n\r\n &__cta {\r\n max-width: 376px;\r\n text-align: center;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n max-width: 255px;\r\n }\r\n }\r\n}\r\n","import { Component, ComponentInterface, h, Host, JSX, Prop } from '@stencil/core';\r\nimport { store } from 'app/shared/store/store';\r\nimport { authenticationService } from 'app/shared/services/authentication/authentication.service';\r\nimport { locationService } from 'app/shared/services/location/location-service';\r\n\r\n@Component({\r\n tag: 'login-to-account',\r\n styleUrl: 'login-to-account.scss'\r\n})\r\nexport class LoginToAccount implements ComponentInterface {\r\n @Prop() public buttonText = 'Log in to your AGL account';\r\n\r\n public componentWillLoad(): void {\r\n if (this.isLoggedIn() && store.get('isAuthenticated')) {\r\n locationService.navigateToProductBundle();\r\n }\r\n }\r\n\r\n public navigateExistingCustomer(): void {\r\n authenticationService.login();\r\n }\r\n\r\n public render(): JSX.Element {\r\n return (\r\n \r\n {this.isAuthenticatedFlowEnabled() && !this.isLoggedIn() && (\r\n
\r\n \r\n \r\n
\r\n )}\r\n
\r\n );\r\n }\r\n\r\n private isLoggedIn(): boolean {\r\n return authenticationService.loggedIn;\r\n }\r\n\r\n private isAuthenticatedFlowEnabled(): boolean {\r\n return window.sessionStorage.getItem('authenticatedGuidedFlowEnabled')?.includes('true');\r\n }\r\n}\r\n",".sq-message-container {\r\n width: 100%;\r\n padding: 10px;\r\n font-family: 'Open Sans', sans-serif;\r\n}\r\n\r\n.sq-message-container h1 {\r\n font-size: 28px;\r\n font-weight: 600;\r\n}\r\n\r\n.sq-message-container h2 {\r\n font-size: 24px;\r\n font-weight: 600;\r\n}\r\n\r\n.sq-message-container h3 {\r\n font-size: 20px;\r\n}\r\n\r\n.sq-message-container p {\r\n line-height: 28px;\r\n font-weight: 400;\r\n}\r\n\r\n.sq-message-container a {\r\n font-size: $font-size-sm-01 !important;\r\n}\r\n\r\n.sq-message-container b {\r\n color: black !important;\r\n font-weight: 700;\r\n}\r\n","import { Component, ComponentInterface, h, JSX, Prop } from '@stencil/core';\r\n\r\n@Component({\r\n tag: 'message-wrapper',\r\n styleUrl: 'message-wrapper.scss',\r\n shadow: false,\r\n scoped: false\r\n})\r\nexport class MessageWrapper implements ComponentInterface {\r\n @Prop() public message: string;\r\n\r\n public render(): JSX.Element {\r\n return
;\r\n }\r\n}\r\n","export class EligibilityCodeValidationModel {\r\n public isValid?: boolean;\r\n public siteError?: SiteError;\r\n public dataToSet?: EligibilityCodeValidationDataToSetModel;\r\n}\r\n\r\nexport class EligibilityCodeValidationDataToSetModel {\r\n public eligibilityCode: string;\r\n public partnerOfferId: string;\r\n}\r\n\r\nexport class SiteError {\r\n public reasonCode: string; // code\r\n public description: string; // api's description\r\n}\r\n\r\nexport class EligibilityValidationRequest {\r\n public webId: string;\r\n public eligibilityCode: string;\r\n public firstName?: string;\r\n public lastName?: string;\r\n public validationSource: string;\r\n}\r\n\r\nexport enum EligibilityValidation {\r\n NoValidation = 'None',\r\n UpfrontValidation = 'Upfront',\r\n SignupValidation = 'Signup',\r\n CaptureOnly = 'CaptureOnly'\r\n}\r\n\r\nexport enum EligibilityValidationSource {\r\n Sap = 'SAP',\r\n Velocity = 'Velocity'\r\n}\r\n\r\nexport enum EligibilityValidationSourceWithPromoCodeDls {\r\n Velocity = 'Velocity'\r\n}\r\n","import { FunctionalComponent, h } from '@stencil/core';\r\nimport { GeneralContentCategoryItems } from 'app/shared/services/general-content/models/general-content-category-items.model';\r\n\r\nexport interface CommonLinksProps {\r\n generalContentCategoryItems: GeneralContentCategoryItems[];\r\n productCategory: string;\r\n selectedPlanCategory: string;\r\n techType: string;\r\n}\r\n\r\nexport const CommonLinks: FunctionalComponent = ({\r\n generalContentCategoryItems,\r\n productCategory,\r\n techType,\r\n selectedPlanCategory\r\n}) => {\r\n let links = [];\r\n if (productCategory === 'nbn') {\r\n if (techType === 'WIRELESS') {\r\n links = [...generalContentCategoryItems.find((x) => x.category === 'fixedWireless').links];\r\n } else if (selectedPlanCategory === 'Fibre upgrade') {\r\n links = [...generalContentCategoryItems.find((x) => x.category === 'fibreUpgrade').links];\r\n } else {\r\n links = [...generalContentCategoryItems.find((x) => x.category === 'nbn').links];\r\n }\r\n } else if (productCategory === 'mobile plan') {\r\n links = [...generalContentCategoryItems.find((x) => x.category === 'mobile').links];\r\n }\r\n return (\r\n
    \r\n {links.map((link) => (\r\n
  • \r\n \r\n {link.title}\r\n \r\n
  • \r\n ))}\r\n
\r\n );\r\n};\r\n","@import '../../../shared/components/common-links/common-links';\r\n\r\n/* Panning specific styles */\r\n.scroll-snap-type {\r\n scroll-snap-type: x mandatory; /* Safari */\r\n scroll-snap-destination: 50% 50%;\r\n}\r\n\r\n.scroll-snap {\r\n scroll-snap-align: center; /* older (Firefox/IE) */\r\n scroll-snap-coordinate: 50% 50%; /* older (Safari) */\r\n scroll-snap-stop: normal;\r\n}\r\n\r\n/* End of: Panning specific styles */\r\n\r\n.comparison-container {\r\n display: flex;\r\n justify-content: center;\r\n padding: $space-05 0 0;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n padding: $space-06 0 0;\r\n }\r\n}\r\n\r\n.card-container {\r\n display: flex;\r\n}\r\n\r\n.card {\r\n font-family: 'Open Sans', sans-serif;\r\n width: 284px;\r\n margin-right: $space-04;\r\n margin-top: $space-00;\r\n\r\n &:last-child {\r\n margin-right: 0;\r\n }\r\n\r\n @include agl-ds-screen-size('medium') {\r\n width: 384px;\r\n }\r\n\r\n &__with-space {\r\n margin-top: $space-06;\r\n }\r\n\r\n &__plan-selected {\r\n border: 2px solid #001cb0;\r\n box-sizing: border-box;\r\n box-shadow: 0 16px 32px 2px rgb(43 46 49 / 16%);\r\n }\r\n\r\n &__spacer {\r\n width: 100%;\r\n height: 2px;\r\n }\r\n\r\n &__wrapper {\r\n margin-right: $space-04;\r\n margin-top: -1px;\r\n\r\n &:last-child {\r\n margin-right: 0;\r\n }\r\n }\r\n}\r\n\r\n.cta {\r\n &--button {\r\n margin-bottom: $space-02;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n margin-bottom: $space-03;\r\n }\r\n }\r\n\r\n &--mid {\r\n padding-bottom: $space-01;\r\n }\r\n\r\n &--end {\r\n padding-bottom: $space-03;\r\n\r\n @include agl-ds-screen-size('large') {\r\n padding-bottom: $space-04;\r\n }\r\n }\r\n}\r\n\r\n.product-alt-cost {\r\n margin-top: 16px;\r\n display: block;\r\n}\r\n\r\n.product-min-cost {\r\n margin-top: 16px;\r\n display: block;\r\n}\r\n\r\n@media (min-width: 425px) {\r\n .product-min-cost {\r\n margin-top: 24px;\r\n }\r\n}\r\n\r\n.price-and-data-container {\r\n display: flex;\r\n\r\n &__price,\r\n &__data {\r\n &-description {\r\n display: block;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n margin-top: 15px;\r\n }\r\n }\r\n }\r\n\r\n &__price {\r\n flex: 0 1 65%;\r\n padding-right: $space-02;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n flex: 0 1 60%;\r\n padding-right: $space-03;\r\n }\r\n }\r\n\r\n &__data {\r\n flex: 0 1 35%;\r\n border-left: 2px solid $c-neutral-06;\r\n padding: 0 $space-02;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n flex: 0 1 40%;\r\n padding: 0 $space-03;\r\n }\r\n }\r\n\r\n &__data-unit {\r\n position: absolute;\r\n top: 96px;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n top: 124px;\r\n }\r\n }\r\n}\r\n\r\n.iterative-button {\r\n &__container {\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-around;\r\n width: 258px;\r\n height: 56px;\r\n border-radius: 59px;\r\n border: 1.5px solid #001cb0;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n width: 336px;\r\n }\r\n }\r\n\r\n &__button {\r\n width: 40px;\r\n height: 40px;\r\n border: none;\r\n background: none;\r\n padding: 0;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n width: 56px;\r\n height: 56px;\r\n }\r\n }\r\n\r\n &-circle {\r\n fill: white;\r\n transition: fill 0.5s ease-in;\r\n }\r\n\r\n &__button:hover &-circle {\r\n fill: #e6e8f7;\r\n transition: fill 1s;\r\n }\r\n\r\n &__button:active &-circle {\r\n fill: #b3bbe7;\r\n transition: fill 3s ease-out;\r\n }\r\n\r\n &__label {\r\n margin: 0 25px;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n margin: 0 50px;\r\n }\r\n }\r\n}\r\n\r\n.feature-list {\r\n margin: 15px 0 24px;\r\n}\r\n\r\n.unavailable-overlay-container {\r\n position: relative;\r\n}\r\n\r\n.unavailable-overlay {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n background-color: rgb(255 255 255 / 95%);\r\n z-index: 5;\r\n}\r\n\r\n.links {\r\n text-align: center;\r\n line-height: 200%;\r\n}\r\n\r\n.below-cards-message {\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n align-items: center;\r\n}\r\n\r\n.below-cards-message .sq-message-container {\r\n font-family: $font-family-02;\r\n margin: 0 auto;\r\n text-align: left;\r\n\r\n p {\r\n line-height: 18px;\r\n font-size: 12px;\r\n }\r\n}\r\n","import { CartFlagsService, Guid, SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { Component, ComponentInterface, h, JSX, Prop, State } from '@stencil/core';\r\nimport { store } from 'app/shared/store/store';\r\nimport { CustomerProfile } from 'app/shared/models/customerProfile';\r\nimport {\r\n ProductCatalogueContentFeature,\r\n ProductCatalogueProduct,\r\n SelectedProductDetails,\r\n SelectedProductSessionData\r\n} from 'app/shared/models/index';\r\nimport { tealiumAnalyticService } from 'app/shared/services/tealium/tealium-analytics.service';\r\nimport { crossSellService } from 'app/shared/services/cross-sell/cross-sell.service';\r\nimport { customerProfileService } from 'app/shared/services/customer-profile/customerProfile-service';\r\nimport { couponCodeService } from 'app/shared/services/coupon-code/coupon-code.service';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { bundleService } from 'app/shared/services/bundle/bundle.service';\r\nimport { productsSessionStorageService } from 'app/shared/services/product-session-storage/product-session-storage.service';\r\nimport { getWithoutOfferStrip, renderContentBelowCards } from 'app/shared/utilities/helper-functions';\r\nimport { productService } from 'app/shared/services/productService/product.service';\r\nimport { EligibilityValidation, EligibilityValidationSource } from 'app/shared/constants/common.model';\r\nimport { CommonLinks } from 'app/shared/components/common-links/common-links';\r\n\r\n@Component({\r\n tag: 'mobile-product-card',\r\n styleUrl: 'mobile-product-card.scss',\r\n scoped: true\r\n})\r\nexport class MobileProductCard implements ComponentInterface {\r\n @Prop() public products: ProductCatalogueProduct[];\r\n @Prop() public isPersonalisedProductsLoading: boolean;\r\n @Prop() public focusCardIndex: number;\r\n @State() public selectedProductSessionData: SelectedProductSessionData = JSON.parse(\r\n window.sessionStorage.getItem(SessionStorageKeys.SelectedMobileProductDetails)\r\n );\r\n @State() isGuidedFlow = false;\r\n\r\n private cardIdPrefix = 'card';\r\n private submitButtonIdPrefix = 'mobilePlanCardSubmitButton';\r\n private selectedMobileProductListener: () => void;\r\n\r\n public componentWillLoad(): Promise | void {\r\n this.selectedMobileProductListener = store.onChange(StoreKeys.selectedMobileProductDetails, (selectedMobileProductDetails) => {\r\n if (selectedMobileProductDetails) {\r\n this.selectedProductSessionData = JSON.parse(window.sessionStorage.getItem(SessionStorageKeys.SelectedMobileProductDetails));\r\n }\r\n });\r\n this.isGuidedFlow = store.get('isGuidedFlow');\r\n\r\n store.on('dispose', () => {\r\n this.selectedMobileProductListener();\r\n });\r\n }\r\n\r\n public disconnectedCallback(): void {\r\n this.selectedMobileProductListener();\r\n }\r\n\r\n public addSelectedProduct(sku: string): void {\r\n let selectedProduct = this.products.find((x) => x.sku === sku);\r\n selectedProduct = { ...selectedProduct, cartItemId: Guid.newGuid() };\r\n this.selectedProductSessionData = JSON.parse(window.sessionStorage.getItem(SessionStorageKeys.SelectedMobileProductDetails));\r\n const totalProductCount: number = this.selectedProductSessionData?.productDetails?.length\r\n ? this.selectedProductSessionData.productDetails.length\r\n : 0;\r\n\r\n const customerProfile: CustomerProfile = customerProfileService.getCustomerProfile();\r\n customerProfileService.setCustomerProfile(customerProfile);\r\n const couponCode = store.get('couponCode');\r\n if (couponCode) {\r\n couponCodeService.setSessionStorage(couponCode);\r\n } else if (store.get('couponCodes').find((c) => c.productCategory === 'mobile plan')) {\r\n couponCodeService.setMultipleCouponSessionStorage(store.get('couponCodes')?.find((c) => c.productCategory === 'mobile plan'));\r\n } else if (!this.isGuidedFlow) {\r\n couponCodeService.resetSessionStorage();\r\n }\r\n switch (true) {\r\n case totalProductCount === 0:\r\n this.selectedProductSessionData = {\r\n productDetails: [\r\n {\r\n product: selectedProduct\r\n }\r\n ],\r\n customerProfile\r\n };\r\n this.setProductAsCartItem(selectedProduct);\r\n tealiumAnalyticService.trackPlanSelectionData(selectedProduct, 'mobile plan', 'Add Plan');\r\n break;\r\n case totalProductCount < 6:\r\n this.selectedProductSessionData.productDetails.push({ product: selectedProduct });\r\n this.setProductAsCartItem(selectedProduct);\r\n tealiumAnalyticService.trackPlanSelectionData(selectedProduct, 'mobile plan', 'Add', totalProductCount);\r\n break;\r\n default: {\r\n const earliestAddedProduct = this.selectedProductSessionData.productDetails[0].product;\r\n this.removeSelectedProduct(earliestAddedProduct);\r\n this.selectedProductSessionData.productDetails.push({ product: selectedProduct });\r\n this.setProductAsCartItem(selectedProduct);\r\n tealiumAnalyticService.trackPlanSelectionData(selectedProduct, 'mobile plan', 'Add', totalProductCount);\r\n break;\r\n }\r\n }\r\n\r\n if (crossSellService.isCrossSellFlow()) {\r\n customerProfile.isBundleExplicitlyRequestedByCustomer = false;\r\n customerProfileService.setCustomerProfile(customerProfile);\r\n }\r\n }\r\n\r\n public removeSelectedProduct(product: ProductCatalogueProduct): void {\r\n this.selectedProductSessionData = JSON.parse(window.sessionStorage.getItem(SessionStorageKeys.SelectedMobileProductDetails));\r\n for (let i = 0; i < this.selectedProductSessionData.productDetails.length; ++i) {\r\n if (this.selectedProductSessionData.productDetails[i].product.sku === product.sku) {\r\n store.set(StoreKeys.removeProductFromCartItem, this.selectedProductSessionData.productDetails[i].product);\r\n this.selectedProductSessionData.productDetails.splice(i, 1);\r\n break;\r\n }\r\n }\r\n productsSessionStorageService.saveMobileProducts(this.selectedProductSessionData);\r\n\r\n tealiumAnalyticService.trackPlanSelectionData(\r\n product,\r\n 'mobile plan',\r\n 'Remove',\r\n this.selectedProductSessionData?.productDetails?.length\r\n );\r\n }\r\n\r\n public getProductAltCost(price: string, priceVariable: string): string {\r\n return `Or $${parseInt(price, 10)}${priceVariable} without AGL energy.`;\r\n }\r\n\r\n private setProductAsCartItem(selectedProductDetails: ProductCatalogueProduct): void {\r\n if (selectedProductDetails && this.isGuidedFlow) {\r\n const cartItem = bundleService.mapMobileProductCatalogueAsCartItem(selectedProductDetails);\r\n store.set(StoreKeys.addProductToCartItem, [cartItem]);\r\n productsSessionStorageService.saveMobileProducts(this.selectedProductSessionData);\r\n }\r\n }\r\n\r\n private getProductCount(selectedProduct: ProductCatalogueProduct): number {\r\n let productCount = 0;\r\n this.selectedProductSessionData?.productDetails?.forEach((product: SelectedProductDetails) =>\r\n product.product.sku == selectedProduct.sku ? ++productCount : null\r\n );\r\n return productCount;\r\n }\r\n\r\n private choosePlanButton(product: ProductCatalogueProduct, planCardIndex: number): JSX.Element {\r\n const selectedProductCount = this.getProductCount(product);\r\n if (this.isGuidedFlow && selectedProductCount == 0) {\r\n return (\r\n !this.isPersonalisedProductsLoading && this.addSelectedProduct(product.sku)}\r\n >\r\n Choose this plan\r\n \r\n );\r\n }\r\n if (this.isGuidedFlow && selectedProductCount > 0) {\r\n return (\r\n
\r\n !this.isPersonalisedProductsLoading && this.removeSelectedProduct(product)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n {selectedProductCount} SIM plan\r\n \r\n !this.isPersonalisedProductsLoading && this.addSelectedProduct(product.sku)}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n if (!this.isGuidedFlow) {\r\n return (\r\n !this.isPersonalisedProductsLoading && this.onSelectedProduct(product.sku, planCardIndex)}\r\n >\r\n Choose this plan\r\n \r\n );\r\n }\r\n }\r\n\r\n public onSelectedProduct(sku: string, planCardIndex: number): void {\r\n store.set(StoreKeys.selectedSKU, sku);\r\n const productDetailsFromSession = JSON.parse(window.sessionStorage.getItem(SessionStorageKeys.ProductDetailsSession));\r\n const differentiatedPricing =\r\n productDetailsFromSession?.length > 0 ? productDetailsFromSession[0]?.response?.products[0]?.differentiatedPricing : null;\r\n const eligibilityValidation = differentiatedPricing?.eligibilityValidation;\r\n const eligibilityValidationSource = differentiatedPricing?.eligibilityValidationSource;\r\n\r\n if (\r\n eligibilityValidation === EligibilityValidation.SignupValidation &&\r\n eligibilityValidationSource === EligibilityValidationSource.Sap\r\n ) {\r\n // This if for promo-dialog to open.\r\n store.set(StoreKeys.isPromoModalOpen, true);\r\n store.set(StoreKeys.promoModalTriggerElementId, `${this.submitButtonIdPrefix}${planCardIndex}`);\r\n } else {\r\n productService.onSelectedProductForMobile(sku, this.products, this.isGuidedFlow);\r\n }\r\n }\r\n\r\n private getFeatureIcon(featureIconPath?: string): JSX.Element {\r\n if (!featureIconPath) {\r\n return null;\r\n }\r\n return ;\r\n }\r\n\r\n public getInCartSku(): string {\r\n const cartDetails = store.get(StoreKeys.cart);\r\n if (!cartDetails) {\r\n return null;\r\n }\r\n const cartService = new CartFlagsService(cartDetails);\r\n const inCartNbnProduct = cartService.getNbnProducts()?.[0];\r\n return inCartNbnProduct ? inCartNbnProduct.sku : null;\r\n }\r\n\r\n public render(): JSX.Element {\r\n const inCartSku = this.getInCartSku();\r\n\r\n const anyStripText = this.products?.some((product) => product.content.stripText);\r\n\r\n document.documentElement.style.setProperty('--scrollbar-width', `${window.innerWidth - document.documentElement.clientWidth}px`);\r\n const productCategory = store.get(StoreKeys.productCategory);\r\n const generalContentCategoryItems = store.get(StoreKeys.generalContent).categoryItems;\r\n\r\n return (\r\n
\r\n
\r\n {this.products && (\r\n \r\n
\r\n {this.products.map((product, index) => {\r\n const isProductInCart = product.sku === inCartSku;\r\n return this.mobileCardRender(isProductInCart, anyStripText, product, index);\r\n })}\r\n
\r\n
\r\n )}\r\n
\r\n {generalContentCategoryItems !== undefined && generalContentCategoryItems.length && (\r\n \r\n )}\r\n
{renderContentBelowCards(this.products)}
\r\n
\r\n );\r\n }\r\n\r\n private mobileCardRender(isProductInCart: boolean, anyStripText: boolean, product: ProductCatalogueProduct, index: number): any {\r\n const displayToUser = product.qualified !== false;\r\n const productHeadline = product.content.productHeadline.replace(/nbn/gi, 'nbn');\r\n const displayWithoutOfferStrip = getWithoutOfferStrip(product);\r\n\r\n return (\r\n
\r\n \r\n \r\n
\r\n {product.content.productName}\r\n {productHeadline}\r\n
\r\n
\r\n \r\n
\r\n \r\n\r\n {displayWithoutOfferStrip && (\r\n \r\n )}\r\n
\r\n
\r\n {product.content?.features.map((feature: ProductCatalogueContentFeature) => {\r\n return (\r\n {this.getFeatureIcon(feature.featureIcon)}\r\n );\r\n })}\r\n
\r\n
{this.choosePlanButton(product, index)}
\r\n
\r\n {product.content.links?.map((link) => {\r\n return (\r\n
\r\n \r\n {link.title}\r\n \r\n
\r\n );\r\n })}\r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n }\r\n}\r\n",".moving-fibre-upgrade {\r\n align-self: stretch;\r\n display: flex;\r\n flex-direction: column;\r\n text-align: center;\r\n font-family: $font-family-02;\r\n padding: $space-05 $space-04 0 $space-04;\r\n\r\n &__container {\r\n font-family: $font-family-02;\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n\r\n h1 {\r\n font-size: $font-size-sm-07;\r\n font-weight: $font-weight-semi-bold;\r\n }\r\n\r\n h2 {\r\n font-size: $font-size-sm-06;\r\n font-weight: $font-weight-semi-bold;\r\n }\r\n\r\n h3 {\r\n font-size: $font-size-md-04;\r\n }\r\n\r\n p {\r\n line-height: 28px;\r\n font-weight: $font-weight-regular;\r\n }\r\n\r\n a {\r\n font-size: $font-size-sm-03 !important;\r\n }\r\n\r\n b {\r\n color: black !important;\r\n font-weight: $font-weight-bold;\r\n }\r\n}\r\n","import { Component, ComponentInterface, h, Host, JSX, Prop } from '@stencil/core';\r\n\r\n@Component({\r\n tag: 'moving-fibre-upgrade-message-info',\r\n styleUrl: 'moving-fibre-upgrade-message-info.component.scss',\r\n shadow: false,\r\n scoped: false\r\n})\r\nexport class MovingFibreUpgradeMessageInfo implements ComponentInterface {\r\n @Prop() public message: string;\r\n\r\n render(): JSX.Element {\r\n return (\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n );\r\n }\r\n}\r\n",".moving-header {\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n\r\n &__container {\r\n padding: $space-04 $space-03;\r\n align-items: center;\r\n width: 100%;\r\n display: inline-block;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n font-family: $font-family-02;\r\n padding: $space-06 0;\r\n align-items: start;\r\n display: flex;\r\n width: 100%;\r\n flex-direction: column;\r\n }\r\n }\r\n\r\n &__selection {\r\n display: inline-block;\r\n gap: $space-01;\r\n width: 100%;\r\n font-weight: $font-weight-semi-bold;\r\n padding: 0;\r\n text-align: center;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n text-align: left;\r\n flex-wrap: wrap;\r\n display: flex;\r\n }\r\n\r\n &__message {\r\n color: $neutral-01;\r\n font: $font-weight-semi-bold $font-size-lg-06 $font-family-01;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n flex-grow: 1;\r\n flex-basis: auto;\r\n font-size: $font-size-md-07;\r\n }\r\n }\r\n\r\n &__continue {\r\n display: flex;\r\n flex-direction: column;\r\n font-size: $font-size-md-01;\r\n text-align: center;\r\n line-height: 140%;\r\n justify-content: center;\r\n margin-top: $space-03;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n margin-top: 0;\r\n }\r\n\r\n &__container {\r\n border-radius: $space-08;\r\n gap: $space-01;\r\n padding: $space-01 0 $space-01 $space-02;\r\n }\r\n\r\n &__message {\r\n font-family: $font-family-02;\r\n flex-grow: 1;\r\n margin: auto 0;\r\n\r\n a {\r\n text-decoration: none !important;\r\n }\r\n }\r\n }\r\n }\r\n\r\n &__address {\r\n align-self: stretch;\r\n font-family: $font-family-02;\r\n border-radius: $space-01;\r\n background-color: $neutral-08;\r\n display: flex;\r\n margin-top: $space-03;\r\n flex-direction: column;\r\n font-size: $font-size-sm-04;\r\n justify-content: center;\r\n padding: 12px $space-02;\r\n gap: $space-02;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n padding: 0 $space-04;\r\n }\r\n\r\n &__container {\r\n justify-content: center;\r\n display: flex;\r\n flex-direction: column;\r\n padding: 12px $space-02;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n padding: $space-03 0;\r\n }\r\n }\r\n\r\n &__plan-available {\r\n font: $font-weight-semi-bold $font-size-sm-04 $font-family-02;\r\n line-height: 140%;\r\n }\r\n\r\n &__info {\r\n font: $font-weight-regular $font-size-lg-01 $font-family-02;\r\n color: $neutral-01;\r\n margin-top: 8px;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n font: $font-weight-regular $font-size-md-03 $font-family-02;\r\n }\r\n }\r\n }\r\n}\r\n","import { ProductCategory as ProductCategoryEnum, SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { Component, ComponentInterface, getAssetPath, h, Host, JSX, Prop, State } from '@stencil/core';\r\nimport { store } from 'app/shared/store/store';\r\nimport { configService } from 'app/shared/services/config/config.service';\r\nimport { customerProfileService } from 'app/shared/services/customer-profile/customerProfile-service';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { tealiumAnalyticService } from 'app/shared/services/tealium/tealium-analytics.service';\r\nimport { productsSessionStorageService } from 'app/shared/services/product-session-storage/product-session-storage.service';\r\nimport { CustomerProfile } from 'app/shared/models/customerProfile';\r\nimport { locationService } from 'app/shared/services/location/location-service';\r\nimport { getDataSpaSearchParams } from 'app/shared/utilities/helper-functions';\r\nimport { DataSpaKey } from 'app/shared/models/dataSpa';\r\nimport { DataSpaSearchParams } from 'app/shared/utilities/data-spa-search-params.util';\r\nimport { EnergySearchStore } from 'app/shared/models/current-search-request.model';\r\n\r\n@Component({\r\n tag: 'moving-header-info',\r\n styleUrl: 'moving-header-info.scss',\r\n shadow: false,\r\n scoped: true\r\n})\r\nexport class MovingHeaderInfo implements ComponentInterface {\r\n @Prop() public readonly dataSpa: string = null;\r\n\r\n @State() private customerProfile: CustomerProfile;\r\n @State() private movingAddress = null;\r\n @State() private isMobileMoversLandingPage = false;\r\n\r\n private spaParams: DataSpaSearchParams;\r\n\r\n public async componentWillLoad(): Promise {\r\n if (this.dataSpa) {\r\n this.spaParams = getDataSpaSearchParams(this.dataSpa);\r\n this.isMobileMoversLandingPage = this.spaParams.get(DataSpaKey.isMobile) === 'true';\r\n }\r\n\r\n if (!this.isMobileMoversLandingPage) {\r\n this.customerProfile = customerProfileService.getCustomerProfile();\r\n const productSessionData = productsSessionStorageService.getLatestProductsByProductCategory('nbn');\r\n const productSearchResponses: EnergySearchStore[] =\r\n JSON.parse(sessionStorage.getItem(SessionStorageKeys.productSearchResponse)) ?? ([] as EnergySearchStore[]);\r\n const searchRequest = productSearchResponses.find((response) => response?.request?.addressString);\r\n await configService.loadConfig('/apps/comparison');\r\n store.set(StoreKeys.prefillAddress, true);\r\n this.movingAddress = productSessionData?.key || searchRequest?.request?.addressString;\r\n\r\n store.onChange(StoreKeys.productDetails, () => {\r\n const updatedProductSessionData = productsSessionStorageService.getLatestProductsByProductCategory('nbn');\r\n this.movingAddress = updatedProductSessionData?.key;\r\n\r\n if (this.movingAddress === 'default') {\r\n locationService.navigateToMoversEligibility();\r\n }\r\n });\r\n\r\n tealiumAnalyticService.trackPrefillAddress('Address Validated', 'Prefill Address Validated Successfully', ProductCategoryEnum.Nbn);\r\n }\r\n }\r\n\r\n public onButtonClick(): void {\r\n if (this.isMobileMoversLandingPage && this.hasNbn()) {\r\n locationService.navigateToNbnMoving();\r\n } else if (!this.isMobileMoversLandingPage && this.hasMobile()) {\r\n locationService.navigateToMobileMoving();\r\n } else {\r\n locationService.navigateToCart();\r\n }\r\n }\r\n\r\n render(): JSX.Element {\r\n return (\r\n \r\n
\r\n
\r\n
\r\n
\r\n

Select your {this.isMobileMoversLandingPage ? 'mobile' : 'nbn'} plan

\r\n
\r\n {(!this.customerProfile?.hasExistingNbn || this.isMobileMoversLandingPage) && (\r\n
\r\n
\r\n
\r\n this.onButtonClick()}\r\n >\r\n {this.getContinueButtonText()}\r\n \r\n
\r\n
\r\n
\r\n )}\r\n
\r\n {!this.isMobileMoversLandingPage && (\r\n
\r\n
\r\n
Showing plans available at
\r\n
{this.movingAddress}
\r\n
\r\n
\r\n )}\r\n
\r\n
\r\n
\r\n );\r\n }\r\n\r\n private getContinueButtonText(): string {\r\n return `Continue without ${this.isMobileMoversLandingPage ? 'mobile' : 'internet'}`;\r\n }\r\n\r\n private hasMobile(): boolean {\r\n return this.customerProfile?.isMobileUpdated;\r\n }\r\n\r\n private hasNbn(): boolean {\r\n return this.customerProfile?.isInternetUpdated;\r\n }\r\n}\r\n","/* Panning specific styles */\r\n\r\n.scroll-snap-type {\r\n scroll-snap-type: x mandatory; /* Safari */\r\n scroll-snap-destination: 50% 50%;\r\n}\r\n\r\n.scroll-snap {\r\n scroll-snap-align: center; /* older (Firefox/IE) */\r\n scroll-snap-coordinate: 50% 50%; /* older (Safari) */\r\n scroll-snap-stop: normal;\r\n}\r\n\r\n/* End of: Panning specific styles */\r\n\r\n.change-plan-container {\r\n display: flex;\r\n justify-content: left;\r\n padding: 0;\r\n\r\n @include agl-ds-screen-size('large') {\r\n .sc-carousel-buttons {\r\n overflow-x: hidden !important;\r\n }\r\n }\r\n}\r\n\r\n.card-container {\r\n display: flex;\r\n align-items: flex-end;\r\n margin-left: 50px;\r\n}\r\n\r\n.guided-flow-nbn-heading {\r\n text-align: center;\r\n margin-top: $space-07;\r\n}\r\n\r\n.card {\r\n font-family: 'Open Sans', sans-serif;\r\n box-sizing: border-box;\r\n width: 284px;\r\n margin-right: $space-04;\r\n margin-top: $space-00;\r\n\r\n a {\r\n font-size: 14px;\r\n }\r\n\r\n &:last-child {\r\n margin-right: 0;\r\n }\r\n\r\n @include agl-ds-screen-size('medium') {\r\n width: 384px;\r\n }\r\n\r\n &__with-space {\r\n margin-top: $space-06;\r\n }\r\n\r\n &__spacer {\r\n width: 100%;\r\n height: 2px;\r\n }\r\n\r\n &__wrapper {\r\n margin-right: $space-04;\r\n\r\n &:first-child {\r\n /* stylelint-disable-next-line selector-class-pattern */\r\n .cta--empty-button-container {\r\n height: 76px;\r\n }\r\n }\r\n\r\n &:last-child {\r\n margin-right: 0;\r\n }\r\n }\r\n\r\n &__plan-selected {\r\n border: none;\r\n box-sizing: border-box;\r\n box-shadow: 0 16px 32px 2px rgb(43 46 49 / 16%);\r\n border-radius: 15px;\r\n\r\n &__strip-icon {\r\n float: right;\r\n position: relative;\r\n top: -9px;\r\n right: -9px;\r\n }\r\n\r\n .dls-card-inner.sc-dls-card {\r\n border: solid 1px $primary-01;\r\n }\r\n\r\n .dls-card-inner.radius-round02.sc-dls-card {\r\n border-radius: 0 0 15px 15px;\r\n }\r\n }\r\n}\r\n\r\n.feature-list-empty {\r\n background: $neutral-06;\r\n padding: 16px;\r\n height: 224px;\r\n border-radius: 15px;\r\n}\r\n\r\n.cta {\r\n &--button {\r\n margin-bottom: $space-02;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n margin-bottom: $space-03;\r\n }\r\n }\r\n\r\n &--mid {\r\n padding-bottom: $space-01;\r\n }\r\n\r\n &--end {\r\n padding-bottom: $space-03;\r\n\r\n @include agl-ds-screen-size('large') {\r\n padding-bottom: $space-04;\r\n }\r\n }\r\n\r\n &--container {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n flex-direction: column;\r\n gap: $space-01;\r\n margin: $space-02 $space-03;\r\n margin-bottom: $space-03;\r\n padding: 0 $space-04;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n margin-bottom: $space-04;\r\n flex-direction: row;\r\n }\r\n\r\n .sc-dls-button-h {\r\n width: auto;\r\n }\r\n }\r\n}\r\n\r\n.product-description {\r\n margin-top: 15px;\r\n display: block;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n margin-top: 35px;\r\n }\r\n}\r\n\r\n.links {\r\n text-align: center;\r\n line-height: 200%;\r\n}\r\n\r\n.responsive-spacer {\r\n margin-top: 16px;\r\n}\r\n\r\n@media (min-width: 425px) {\r\n .responsive-spacer {\r\n margin-top: 24px;\r\n }\r\n}\r\n\r\n.feature-list {\r\n margin: 15px 0 24px;\r\n}\r\n\r\n.unavailable-overlay-container {\r\n position: relative;\r\n}\r\n\r\n.unavailable-overlay {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n background-color: rgb(255 255 255 / 95%);\r\n z-index: 5;\r\n}\r\n\r\n.product-headline {\r\n font-size: 14px;\r\n font-weight: 400;\r\n}\r\n\r\n.below-cards-message {\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n\r\n.below-cards-message .sq-message-container {\r\n font-family: $font-family-02;\r\n margin: 0 auto;\r\n max-width: 1280px;\r\n padding: 0 $space-04;\r\n font-size: 14px;\r\n\r\n p {\r\n font-size: 14px;\r\n margin-bottom: $space-02;\r\n\r\n a {\r\n font-size: 14px;\r\n }\r\n }\r\n}\r\n\r\n.selected-plan-title-container {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n padding: 0 $space-04;\r\n margin-top: $space-03;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n margin-top: $space-06;\r\n }\r\n\r\n .selected-plan-title.sc-dls-h2-h .dls-title2.sc-dls-h2 {\r\n font-weight: 600;\r\n line-height: 40px;\r\n text-align: center;\r\n }\r\n\r\n .selected-plan-subtitle.sc-dls-p-h .dls-p-md.sc-dls-p {\r\n margin-top: $space-02;\r\n text-align: center;\r\n }\r\n}\r\n","import { Component, ComponentInterface, JSX, Prop, State, h } from '@stencil/core';\r\nimport { ButtonType } from '@aglenergy/design-system/dist/types/components/core/button/button.types';\r\nimport { StripColorType } from '@aglenergy/design-system-components/dist/types/components/card/static-card/card';\r\nimport { store } from 'app/shared/store/store';\r\nimport { AddressDetailModel, ProductCatalogueContentFeature, ProductCatalogueProduct } from 'app/shared/models/index';\r\nimport { changePlanService } from 'app/nbn/services/change-plan/change-plan.service';\r\nimport { productService } from 'app/shared/services/productService/product.service';\r\nimport { renderContentBelowCards } from 'app/shared/utilities/helper-functions';\r\n\r\n@Component({\r\n tag: 'nbn-change-plan-product-card',\r\n styleUrl: 'nbn-change-plan-product-card.scss'\r\n})\r\nexport class NbnChangePlanProductCard implements ComponentInterface {\r\n @Prop() public focusCardIndex: number;\r\n @Prop() public isPersonalisedProductsLoading: boolean;\r\n @Prop() public products: ProductCatalogueProduct[];\r\n @Prop() public selectedAddress: AddressDetailModel;\r\n @Prop() public productCategories?: string[];\r\n\r\n @State() private hasValidEnergyContract = false;\r\n\r\n private cardIdPrefix = 'card';\r\n\r\n public async componentWillLoad(): Promise {\r\n this.hasValidEnergyContract = await changePlanService.hasEnergyContract();\r\n }\r\n\r\n public componentDidRender(): void {\r\n this.scrollToTop();\r\n }\r\n\r\n private getFeatureIcon(featureIconName?: string): JSX.Element {\r\n if (!featureIconName) {\r\n return null;\r\n }\r\n if (featureIconName.includes('.')) {\r\n return ;\r\n }\r\n // TODO: remove decorative icon selection after cleanup\r\n const iconNameInitial = featureIconName.charAt(0);\r\n return iconNameInitial >= 'a' && iconNameInitial <= 'l' ? (\r\n \r\n ) : (\r\n \r\n );\r\n }\r\n\r\n public onChangeButtonClick(product: ProductCatalogueProduct): void {\r\n !this.isPersonalisedProductsLoading &&\r\n productService.onSelectedProductForNbn(this.products, this.selectedAddress, product.sku, 'productswap');\r\n }\r\n\r\n public onSeePlansButtonClick(): void {\r\n changePlanService.clearSelectedProduct();\r\n }\r\n\r\n private scrollToTop(): void {\r\n const comparisonContainer = document.getElementsByClassName('current-plan-info');\r\n if (comparisonContainer.length > 0) comparisonContainer[0].scrollIntoView();\r\n }\r\n\r\n public render(): JSX.Element {\r\n let anyStripText = this.products?.some((product) => product.content?.stripText);\r\n const currentPlanSku = changePlanService.getCurrentPlanSku();\r\n const selectedProductSku = changePlanService.getSelectedProductSku();\r\n let selectedProductPlan: ProductCatalogueProduct | null = null;\r\n if (selectedProductSku && currentPlanSku !== selectedProductSku) {\r\n selectedProductPlan = this.products?.find((prod) => prod.sku === selectedProductSku);\r\n }\r\n const showNbnFaq = this.productCategories?.length == 2 && store.get('selectedNbnProductDetails') === null;\r\n\r\n document.documentElement.style.setProperty('--scrollbar-width', `${window.innerWidth - document.documentElement.clientWidth}px`);\r\n return (\r\n
\r\n {selectedProductPlan && (\r\n
\r\n {`You're changing to ${selectedProductPlan.name}`}\r\n \r\n Did you see a different price before? Some offers are for new nbn connections only.\r\n \r\n
\r\n )}\r\n
\r\n {this.products && (\r\n
\r\n \r\n
\r\n {this.products.map((product, index) => {\r\n const isCurrentPlan = currentPlanSku === product.sku;\r\n anyStripText = anyStripText || isCurrentPlan;\r\n const buttonLabel = isCurrentPlan ? 'Remove plan' : 'Change to this plan';\r\n const buttonType = isCurrentPlan ? 'secondary' : 'primary';\r\n const hasSelectedPlan = selectedProductSku !== null && currentPlanSku !== selectedProductSku;\r\n return this.nbnCardRender(isCurrentPlan, anyStripText, hasSelectedPlan, product, index, buttonType, buttonLabel);\r\n })}\r\n
\r\n
\r\n {selectedProductSku && selectedProductSku !== currentPlanSku && this.ctaButtonsRender()}\r\n
\r\n )}\r\n
\r\n
\r\n You can change your plan once a month. If you upgrade your plan before the end of your monthly billing cycle, you'll just need to pay the difference between your current plan and new plan. if you move to lower speed plan, you wont receive a pro rata refund for fees paid in advance.

`}\r\n />\r\n {renderContentBelowCards(this.products)}\r\n
\r\n {showNbnFaq && }\r\n
\r\n );\r\n }\r\n\r\n private nbnCardRender(\r\n isCurrentPlan: boolean,\r\n anyStripText: boolean,\r\n hasSelectedPlan: boolean,\r\n product: ProductCatalogueProduct,\r\n index: number,\r\n buttonType: ButtonType,\r\n buttonLabel: string\r\n ): any {\r\n const displayToUser = product.qualified !== false;\r\n const productHeadline = product.content\r\n ? product.content?.productHeadline.replace(/nbn/gi, 'nbn')\r\n : `nbn ${product.attributes['download_speed']}/${product.attributes['upload_speed']}`;\r\n let stripText = product.content?.stripText;\r\n let stripColor: StripColorType = anyStripText ? 'secondary-04' : 'none';\r\n if (isCurrentPlan) {\r\n stripText = 'Current plan';\r\n stripColor = 'none';\r\n }\r\n let bundlePriceDesc = 'when you BYO modem and have AGL energy.';\r\n const hasHoneymoonOffer = product.content ? product.content.bundleOfferPrice !== product.attributes.agl_marketing_price : false;\r\n if (product.content && displayToUser) {\r\n if (!hasHoneymoonOffer) {\r\n bundlePriceDesc = product.content.bundleOfferText || bundlePriceDesc;\r\n } else if (product.fibreUpgrade) {\r\n bundlePriceDesc = product.content.bundleOfferText || bundlePriceDesc;\r\n }\r\n }\r\n\r\n return (\r\n
\r\n
\r\n {/*\r\n // https://aglenergy.atlassian.net/browse/TEC-26252: changes to remove the current plan\r\n // from IPP page as per design due to incorrect pricing. Commented following code\r\n // until future notice.\r\n isSelectedPlan && (\r\n
\r\n \r\n
\r\n )*/}\r\n \r\n
\r\n {product.content ? product.content?.productName : product.name}\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n {!this.hasValidEnergyContract && (\r\n \r\n )}\r\n
\r\n {product.content && product.content.features ? (\r\n
\r\n {product.content?.features.map((feature: ProductCatalogueContentFeature) => {\r\n return (\r\n {this.getFeatureIcon(feature.featureIcon)}\r\n );\r\n })}\r\n
\r\n ) : (\r\n
Sorry we can't show this plans features right now
\r\n )}\r\n {!isCurrentPlan && !hasSelectedPlan ? (\r\n
\r\n displayToUser && this.onChangeButtonClick(product)}\r\n >\r\n {this.selectedAddress ? buttonLabel : 'Check your address'}\r\n \r\n
\r\n ) : (\r\n
\r\n )}\r\n
\r\n {product.content?.links?.map((link) => {\r\n if (isCurrentPlan || (hasHoneymoonOffer && !product.fibreUpgrade && link.title.toLowerCase() === 'agl offer terms'))\r\n return
;\r\n return (\r\n
\r\n \r\n {link.title}\r\n \r\n
\r\n );\r\n })}\r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n private ctaButtonsRender() {\r\n const product = this.products.find((p) => p.sku === changePlanService.getSelectedProductSku());\r\n return (\r\n
\r\n this.onChangeButtonClick(product)}\r\n >\r\n {'Change to this plan'}\r\n \r\n \r\n {'See other nbn plans'}\r\n \r\n
\r\n );\r\n }\r\n}\r\n",".container {\r\n background-color: $c-neutral-06;\r\n}\r\n\r\n.item {\r\n padding-top: $space-02;\r\n padding-bottom: $space-02;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n padding-top: $space-03;\r\n padding-bottom: $space-03;\r\n }\r\n\r\n @include agl-ds-screen-size('large') {\r\n padding-top: $space-03;\r\n padding-bottom: $space-03;\r\n }\r\n}\r\n","import { Component, JSX, h, Host, getAssetPath, ComponentInterface } from '@stencil/core';\r\n\r\n@Component({\r\n tag: 'nbn-features-highlight',\r\n styleUrl: 'nbn-features-highlight.scss'\r\n})\r\nexport class NbnFeaturesHighlight implements ComponentInterface {\r\n public render(): JSX.Element {\r\n return (\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n Unlimited data\r\n \r\n \r\n \r\n \r\n Browse with peace of mind – and no excess data charges\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n Easy setup\r\n \r\n \r\n \r\n \r\n With no AGL setup fees\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n No lock-in contracts\r\n \r\n \r\n \r\n \r\n You have the flexibility to change your plan once a month, with our month-to-month plans\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n );\r\n }\r\n}\r\n","/* Panning specific styles */\r\n@import '../../../shared/components/common-links/common-links';\r\n\r\n.scroll-snap-type {\r\n scroll-snap-type: x mandatory; /* Safari */\r\n scroll-snap-destination: 50% 50%;\r\n}\r\n\r\n.scroll-snap {\r\n scroll-snap-align: center; /* older (Firefox/IE) */\r\n scroll-snap-coordinate: 50% 50%; /* older (Safari) */\r\n scroll-snap-stop: normal;\r\n}\r\n\r\n/* End of: Panning specific styles */\r\n\r\n.comparison-container {\r\n display: flex;\r\n justify-content: left;\r\n padding: $space-05 0 0;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n padding: $space-06 0 0;\r\n }\r\n}\r\n\r\n.card-container {\r\n display: flex;\r\n margin-left: 50px;\r\n}\r\n\r\n.guided-flow-nbn-heading {\r\n text-align: center;\r\n margin-top: $space-07;\r\n}\r\n\r\n.card {\r\n font-family: 'Open Sans', sans-serif;\r\n box-sizing: border-box;\r\n width: 284px;\r\n margin-right: $space-04;\r\n margin-top: $space-00;\r\n\r\n &:last-child {\r\n margin-right: 0;\r\n }\r\n\r\n @include agl-ds-screen-size('medium') {\r\n width: 384px;\r\n }\r\n\r\n &__with-space {\r\n margin-top: $space-06;\r\n }\r\n\r\n &__spacer {\r\n width: 100%;\r\n height: 2px;\r\n }\r\n\r\n &__wrapper {\r\n margin-right: $space-04;\r\n\r\n &:last-child {\r\n margin-right: 0;\r\n }\r\n }\r\n\r\n &__plan-selected {\r\n border: 2px solid #001cb0;\r\n box-sizing: border-box;\r\n box-shadow: 0 16px 32px 2px rgb(43 46 49 / 16%);\r\n border-radius: 4px;\r\n }\r\n}\r\n\r\n.cta {\r\n &--button {\r\n margin-bottom: $space-02;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n margin-bottom: $space-03;\r\n }\r\n }\r\n\r\n &--mid {\r\n padding-bottom: $space-01;\r\n }\r\n\r\n &--end {\r\n padding-bottom: $space-03;\r\n\r\n @include agl-ds-screen-size('large') {\r\n padding-bottom: $space-04;\r\n }\r\n }\r\n}\r\n\r\n.product-description {\r\n margin-top: 15px;\r\n display: block;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n margin-top: 35px;\r\n }\r\n}\r\n\r\n.links {\r\n text-align: center;\r\n line-height: 200%;\r\n}\r\n\r\n.responsive-spacer {\r\n margin-top: 16px;\r\n}\r\n\r\n@media (min-width: 425px) {\r\n .responsive-spacer {\r\n margin-top: 24px;\r\n }\r\n}\r\n\r\n.feature-list {\r\n margin: 15px 0 24px;\r\n}\r\n\r\n.unavailable-overlay-container {\r\n position: relative;\r\n}\r\n\r\n.unavailable-overlay {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n background-color: rgb(255 255 255 / 95%);\r\n z-index: 5;\r\n}\r\n\r\n.product-headline {\r\n font-size: 14px;\r\n font-weight: 400;\r\n}\r\n\r\n.below-cards-message {\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n align-items: center;\r\n\r\n p {\r\n margin-bottom: 14px !important;\r\n }\r\n}\r\n\r\n.below-cards-message .sq-message-container {\r\n font-family: $font-family-02;\r\n margin: 0 auto;\r\n max-width: 1280px;\r\n padding-left: 32px;\r\n padding-right: 32px;\r\n text-align: left;\r\n\r\n p {\r\n line-height: 18px;\r\n font-size: 12px;\r\n margin-bottom: 0;\r\n\r\n a {\r\n font-size: 12px;\r\n }\r\n }\r\n}\r\n","/* eslint-disable import/no-unresolved */\r\nimport { ButtonType } from '@aglenergy/design-system/dist/types/components/core/button/button.types';\r\nimport { CartFlagsService, ProductCategory, SessionStorageKeys } from '@aglenergy/shared-library';\r\nimport { Component, ComponentInterface, JSX, Prop, h } from '@stencil/core';\r\nimport { store } from 'app/shared/store/store';\r\nimport { AddressDetailModel, ProductCatalogueContentFeature, ProductCatalogueProduct } from 'app/shared/models/index';\r\nimport {\r\n EligibilityValidation,\r\n EligibilityValidationSource,\r\n StoreKeys,\r\n EligibilityValidationSourceWithPromoCodeDls\r\n} from 'app/shared/constants/index';\r\nimport { onRemoveCartItem } from 'app/bundle/store/actions/cartActions';\r\nimport { productService, tealiumAnalyticService } from 'app/shared/services/index';\r\nimport { getWithoutOfferStrip, renderContentBelowCards } from 'app/shared/utilities/helper-functions';\r\nimport { CommonLinks } from 'app/shared/components/common-links/common-links';\r\nimport { addressService } from 'app/shared/services/address/address.service';\r\n\r\n@Component({\r\n tag: 'nbn-product-card',\r\n styleUrl: 'nbn-product-card.scss'\r\n})\r\nexport class NbnProductCard implements ComponentInterface {\r\n @Prop() public products: ProductCatalogueProduct[];\r\n @Prop() public selectedAddress: AddressDetailModel;\r\n @Prop() public isPersonalisedProductsLoading: boolean;\r\n @Prop() public focusCardIndex: number;\r\n\r\n private cardIdPrefix = 'card';\r\n private submitButtonIdPrefix = 'nbnPlanCardSubmitButton';\r\n\r\n private getFeatureIcon(featureIconName?: string): JSX.Element {\r\n if (!featureIconName) {\r\n return null;\r\n }\r\n if (featureIconName.includes('.')) {\r\n return ;\r\n }\r\n // TODO: remove decorative icon selection after cleanup\r\n const iconNameInitial = featureIconName.charAt(0);\r\n return iconNameInitial >= 'a' && iconNameInitial <= 'l' ? (\r\n \r\n ) : (\r\n \r\n );\r\n }\r\n\r\n public getInCartSku(): string {\r\n const cartDetails = store.get(StoreKeys.cart);\r\n if (!cartDetails) {\r\n return null;\r\n }\r\n const cartService = new CartFlagsService(cartDetails);\r\n const inCartNbnProduct = cartService.getNbnProducts()?.[0];\r\n return inCartNbnProduct ? inCartNbnProduct.sku : null;\r\n }\r\n\r\n public onButtonClick(product: ProductCatalogueProduct, isProductInCart: boolean, planCardIndex: number): void {\r\n if (isProductInCart) {\r\n onRemoveCartItem(product.sku);\r\n tealiumAnalyticService.trackPlanSelectionData(product, ProductCategory.Nbn, 'Remove Plan');\r\n } else {\r\n !this.isPersonalisedProductsLoading && this.onSelectedProduct(product.sku, planCardIndex);\r\n }\r\n }\r\n\r\n public onSelectedProduct(sku: string, planCardIndex: number): void {\r\n store.set(StoreKeys.selectedSKU, sku);\r\n store.set(StoreKeys.promoModalTriggerElementId, `${this.submitButtonIdPrefix}${planCardIndex}`);\r\n\r\n const productDetailsFromSession = JSON.parse(window.sessionStorage.getItem(SessionStorageKeys.ProductDetailsSession));\r\n const differentiatedPricing =\r\n productDetailsFromSession.length > 0 ? productDetailsFromSession[0]?.response?.products[0]?.differentiatedPricing : null;\r\n const eligibilityValidation = differentiatedPricing?.eligibilityValidation;\r\n const eligibilityValidationSource = differentiatedPricing?.eligibilityValidationSource;\r\n const productCategory = store.get('productCategory') as ProductCategory;\r\n const addressEntered = store.get('address');\r\n\r\n if (\r\n eligibilityValidation === EligibilityValidation.SignupValidation &&\r\n Object.entries(EligibilityValidationSource)?.some(\r\n ([, value]) => value.toLowerCase() === (eligibilityValidationSource as string).toLowerCase()\r\n ) &&\r\n addressEntered\r\n ) {\r\n if (productCategory === ProductCategory.Nbn && addressService.convertAddressToString(addressEntered)?.length > 0) {\r\n const userPromoModalDls = Object.entries(EligibilityValidationSourceWithPromoCodeDls)?.some(\r\n ([, value]) => value.toLowerCase() === (eligibilityValidationSource as string).toLowerCase()\r\n );\r\n\r\n // This is for promo-dialog to open.\r\n const isPromoModalKey = userPromoModalDls ? StoreKeys.isPromoModalDlsOpen : StoreKeys.isPromoModalOpen;\r\n store.set(isPromoModalKey, true);\r\n }\r\n } else {\r\n productService.onSelectedProductForNbn(this.products, this.selectedAddress, sku);\r\n }\r\n }\r\n\r\n public render(): JSX.Element {\r\n const inCartSku = this.getInCartSku();\r\n\r\n const anyStripText = this.products?.some((product) => product.content.stripText);\r\n\r\n const comparisonContainerClass = 'comparison-container';\r\n const productCategory = store.get(StoreKeys.productCategory);\r\n const techType = (store.get(StoreKeys.productDetails) as any)?.serviceQualification?.nbn?.serviceType;\r\n const selectedPlanCategory = store.get(StoreKeys.selectedPlanCategory);\r\n const generalContentCategoryItems = store.get(StoreKeys.generalContent).categoryItems;\r\n document.documentElement.style.setProperty('--scrollbar-width', `${window.innerWidth - document.documentElement.clientWidth}px`);\r\n return (\r\n
\r\n
\r\n {this.products && (\r\n \r\n
\r\n {this.products.map((product, index) => {\r\n const isProductInCart = product.sku === inCartSku;\r\n const buttonLabel = isProductInCart ? 'Remove plan' : 'Choose this plan';\r\n const buttonType = isProductInCart ? 'secondary' : 'primary';\r\n return this.nbnCardRender(isProductInCart, anyStripText, product, index, buttonType, buttonLabel);\r\n })}\r\n
\r\n
\r\n )}\r\n
\r\n {generalContentCategoryItems !== undefined && generalContentCategoryItems.length && (\r\n \r\n )}\r\n
{renderContentBelowCards(this.products)}
\r\n
\r\n );\r\n }\r\n\r\n private nbnCardRender(\r\n isProductInCart: boolean,\r\n anyStripText: boolean,\r\n product: ProductCatalogueProduct,\r\n index: number,\r\n buttonType: ButtonType,\r\n buttonLabel: string\r\n ): any {\r\n const displayToUser = product.qualified !== false;\r\n const productHeadline = product.content.productHeadline.replace(/nbn/gi, 'nbn');\r\n const displayWithoutOfferStrip = getWithoutOfferStrip(product);\r\n\r\n return (\r\n
\r\n \r\n \r\n
\r\n {product.content.productName}\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n\r\n {displayWithoutOfferStrip && (\r\n \r\n )}\r\n
\r\n
\r\n {product.content?.features.map((feature: ProductCatalogueContentFeature) => {\r\n return (\r\n {this.getFeatureIcon(feature.featureIcon)}\r\n );\r\n })}\r\n
\r\n
\r\n displayToUser && this.onButtonClick(product, isProductInCart, index)}\r\n >\r\n {this.selectedAddress ? buttonLabel : 'Check your address'}\r\n \r\n
\r\n
\r\n {product.content.links?.map((link) => {\r\n return (\r\n
\r\n \r\n {link.title}\r\n \r\n
\r\n );\r\n })}\r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n }\r\n}\r\n",".pan-buttons-container {\r\n // Non-IE styles here\r\n @supports not (-ms-high-contrast: none) {\r\n width: 100%;\r\n position: fixed;\r\n left: 0;\r\n bottom: 0;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n background-color: $c-neutral-07;\r\n box-shadow: $shadow1;\r\n }\r\n\r\n // IE 11 styles here\r\n @media (-ms-high-contrast: none), (-ms-high-contrast: active) {\r\n display: none;\r\n }\r\n}\r\n\r\n.hide-pan-buttons-container {\r\n display: none;\r\n}\r\n\r\n.panning-button {\r\n height: 16px;\r\n width: 10px;\r\n cursor: pointer;\r\n opacity: 0.5;\r\n margin: 18px;\r\n}\r\n\r\n.panning-button-selected {\r\n height: 16px;\r\n width: 16px;\r\n opacity: 1;\r\n}\r\n","import { Component, JSX, h, Host, Prop, Element, Watch, ComponentInterface } from '@stencil/core';\r\nimport * as is from 'is_js';\r\n\r\n@Component({\r\n tag: 'pan-buttons',\r\n styleUrl: './pan-buttons.scss'\r\n})\r\nexport class PanButtonsComponent implements ComponentInterface {\r\n @Element() private hostElement: HTMLButtonElement;\r\n\r\n @Prop() public wrapperId: string;\r\n @Prop() public containerId: string;\r\n @Prop() public innerContainerId: string;\r\n @Prop() public itemIdPrefix: string;\r\n @Prop() public itemCount: number;\r\n @Prop() public focusCardIndex: number;\r\n\r\n private autoscrolling = false;\r\n private scrollbarWidth = 17;\r\n private wrapper: HTMLElement;\r\n private pointsBetweenCards: number[] = [0];\r\n\r\n public componentWillLoad(): void {\r\n window.addEventListener('resize', this.onResize, true);\r\n window.addEventListener('scroll', this.onScroll, true);\r\n }\r\n\r\n public componentDidRender(): void {\r\n if (this.itemCount) {\r\n this.checkForClosestCardToCenter();\r\n this.onResize();\r\n setTimeout(() => {\r\n this.moveCards(this.focusCardIndex ?? 0);\r\n });\r\n }\r\n }\r\n\r\n public disconnectedCallback(): void {\r\n window.removeEventListener('resize', this.onResize, true);\r\n window.removeEventListener('scroll', this.onScroll, true);\r\n }\r\n\r\n @Watch('itemCount')\r\n public watchHandler(): void {\r\n this.checkForClosestCardToCenter();\r\n this.onResize();\r\n setTimeout(() => {\r\n this.moveCards(this.focusCardIndex ?? 0);\r\n });\r\n }\r\n\r\n private onResize = (): void => {\r\n const elClientRect = document.getElementById(`${this.itemIdPrefix}0`);\r\n if (elClientRect) {\r\n const cardGutter = 30;\r\n const viewPortWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);\r\n let firstCardTriggerPoint = 160; // offset for small cards\r\n if (viewPortWidth > 720) {\r\n firstCardTriggerPoint = 209; // offset for large cards\r\n }\r\n let pointsBetweenCardsTotal = firstCardTriggerPoint;\r\n this.pointsBetweenCards = [0, pointsBetweenCardsTotal];\r\n for (let x = 1; x < this.itemCount - 1; x++) {\r\n pointsBetweenCardsTotal += elClientRect.getBoundingClientRect().width + cardGutter / 2;\r\n this.pointsBetweenCards.push(pointsBetweenCardsTotal);\r\n }\r\n this.pointsBetweenCards.push(9999);\r\n }\r\n this.showPanButtons();\r\n };\r\n\r\n private showPanButtons(): void {\r\n const cardInnerContainer = document.getElementById(this.innerContainerId);\r\n this.wrapper = document.getElementById(this.wrapperId);\r\n if (this.wrapper && cardInnerContainer) {\r\n const spaWrapperClientRec = this.wrapper.getBoundingClientRect();\r\n const spaWrapperBottom = spaWrapperClientRec.top + spaWrapperClientRec.height;\r\n const cardInnerContainerRect = cardInnerContainer.getBoundingClientRect();\r\n\r\n if (cardInnerContainerRect.width > window.innerWidth - this.scrollbarWidth) {\r\n if (spaWrapperBottom < window.innerHeight) {\r\n this.hostElement.classList.add('hide-pan-buttons-container');\r\n } else {\r\n this.hostElement.classList.remove('hide-pan-buttons-container');\r\n }\r\n } else {\r\n this.hostElement.classList.add('hide-pan-buttons-container');\r\n }\r\n }\r\n }\r\n\r\n private moveCards(index: number): void {\r\n if (!this.autoscrolling) {\r\n if (!this.checkCardsCanFitViewPort()) {\r\n this.wrapper = document.getElementById(this.wrapperId);\r\n const cardXPos = this.getCenter(this.itemIdPrefix + index);\r\n if (this.wrapper) {\r\n this.wrapper.classList.remove('scroll-snap-type');\r\n let duration = 1000;\r\n if (is.ios()) {\r\n duration = 400;\r\n } else if (is.safari()) {\r\n duration = 200;\r\n }\r\n this.scrollToX(this.wrapper, cardXPos, duration, index);\r\n }\r\n }\r\n }\r\n }\r\n\r\n private checkCardsCanFitViewPort(): boolean {\r\n const elem = document.getElementById(this.innerContainerId);\r\n if (elem) {\r\n const box = elem.getBoundingClientRect();\r\n const minBreakpointToFitCards = box.width;\r\n let mql: MediaQueryList[] = [];\r\n mql = [window.matchMedia(`(min-width: ${minBreakpointToFitCards}px)`)];\r\n return mql[0].matches;\r\n }\r\n return false;\r\n }\r\n\r\n private selectPanButtons(index: number): void {\r\n if (document.getElementById(`panButton${Number(this.itemCount - 1).toString()}`)) {\r\n for (let x = 0; x < this.itemCount; x++) {\r\n if (x !== index) {\r\n document.getElementById(`panButton${x}`).classList.remove('panning-button-selected');\r\n } else {\r\n document.getElementById(`panButton${x}`).classList.add('panning-button-selected');\r\n }\r\n }\r\n }\r\n }\r\n\r\n private checkForClosestCardToCenter(): void {\r\n const wrapper = document.getElementById(this.wrapperId);\r\n if (wrapper) {\r\n const offsetLeft = wrapper.scrollLeft;\r\n\r\n for (let x = 0; x < this.pointsBetweenCards.length - 1; x++) {\r\n if (this.isBetween(offsetLeft, this.pointsBetweenCards[x], this.pointsBetweenCards[x + 1])) {\r\n this.selectPanButtons(x);\r\n }\r\n }\r\n }\r\n this.showPanButtons();\r\n }\r\n\r\n private onScroll = (): void => {\r\n this.checkForClosestCardToCenter();\r\n };\r\n\r\n private isBetween(value: number, lowerValue: number, upperValue: number): boolean {\r\n return (value - lowerValue) * (value - upperValue) <= 0;\r\n }\r\n private getCenter(obj: string): number {\r\n const viewPortWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);\r\n const elem = document.getElementById(obj);\r\n this.wrapper = document.getElementById(this.wrapperId);\r\n if (elem) {\r\n const elClientRect = elem.getBoundingClientRect();\r\n const elemX = elClientRect.right - elClientRect.width / 2;\r\n const panel1ScrollLeft = this.wrapper.scrollLeft;\r\n const scrollToX = elemX - viewPortWidth / 2 + panel1ScrollLeft;\r\n return scrollToX;\r\n }\r\n return 0;\r\n }\r\n\r\n private easeInOutQuad(currentTime: number, startValue: number, changeInVal: number, duration: number): number {\r\n currentTime /= duration / 2;\r\n if (currentTime < 1) {\r\n return (changeInVal / 2) * currentTime * currentTime + startValue;\r\n }\r\n currentTime--;\r\n return (-changeInVal / 2) * (currentTime * (currentTime - 2) - 1) + startValue;\r\n }\r\n\r\n private scrollToX(container: HTMLElement, to: number, duration: number, index: number): void {\r\n const start = container.scrollLeft;\r\n const change = to - start;\r\n let currentTime = 0;\r\n const increment = 20;\r\n\r\n type AnimateScroll = () => void;\r\n\r\n const animateScroll: AnimateScroll = () => {\r\n this.autoscrolling = true;\r\n currentTime += increment;\r\n const val = this.easeInOutQuad(currentTime, start, change, duration);\r\n container.scrollLeft = val;\r\n\r\n if (currentTime < duration) {\r\n setTimeout(animateScroll, increment);\r\n } else {\r\n if (!is.ios() && !is.safari()) {\r\n this.wrapper.classList.add('scroll-snap-type');\r\n }\r\n this.autoscrolling = false;\r\n this.selectPanButtons(index);\r\n }\r\n };\r\n\r\n animateScroll();\r\n }\r\n\r\n private renderPanButtons(): JSX.Element[] {\r\n const buttons = [];\r\n for (let i = 0; i < this.itemCount; i++) {\r\n buttons.push(\r\n {\r\n this.moveCards(i);\r\n }}\r\n >\r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n return buttons;\r\n }\r\n\r\n public render(): JSX.Element {\r\n return (\r\n \r\n
\r\n {this.renderPanButtons()}\r\n
\r\n
\r\n );\r\n }\r\n}\r\n",":host {\r\n display: block;\r\n}\r\n\r\nselect {\r\n border-bottom: 0;\r\n}\r\n\r\n#categories-dropdown {\r\n width: 296px;\r\n margin-left: 2px; // line up with cards\r\n\r\n @include agl-ds-screen-size('medium') {\r\n display: none;\r\n }\r\n}\r\n\r\n.categories-container {\r\n display: flex;\r\n align-content: center;\r\n justify-content: center;\r\n padding-top: 10px;\r\n font-family: 'Open Sans', sans-serif;\r\n font-size: 16px;\r\n font-weight: 600;\r\n line-height: 1.25;\r\n\r\n &.change-plan {\r\n padding-top: 0;\r\n margin-top: $space-06;\r\n }\r\n}\r\n\r\n#categories-buttons {\r\n display: none;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n display: flex;\r\n align-content: center;\r\n justify-content: center;\r\n border-bottom: solid 1px #d8d8d8;\r\n }\r\n}\r\n\r\nbutton {\r\n background-color: transparent;\r\n padding: 12px 16px;\r\n min-width: 176px;\r\n cursor: pointer;\r\n border-radius: 8px 8px 0 0;\r\n font-size: 16px;\r\n color: black;\r\n\r\n &.selected {\r\n color: white;\r\n background-color: #001cb0;\r\n cursor: inherit;\r\n }\r\n}\r\n\r\nbutton:not(:last-child) {\r\n margin-right: 32px;\r\n}\r\n","import { ProductCategory } from '@aglenergy/shared-library';\r\nimport { Component, Host, h, Prop, JSX, State } from '@stencil/core';\r\nimport { StoreKeys } from 'app/shared/constants/store-keys.enum';\r\nimport { store } from 'app/shared/store/store';\r\nimport { changePlanService } from 'app/nbn/services/change-plan/change-plan.service';\r\nimport { tealiumAnalyticService } from 'app/shared/services/tealium/tealium-analytics.service';\r\n\r\n@Component({\r\n tag: 'plan-categories',\r\n styleUrl: 'plan-categories.scss',\r\n shadow: false,\r\n scoped: true\r\n})\r\nexport class PlanCategories {\r\n @Prop() public planCategories: string[];\r\n @State() private renderedPlans = 0;\r\n private categorySelected = '';\r\n\r\n private selectCategory(category: string) {\r\n store.set(StoreKeys.selectedPlanCategory, category);\r\n if (this.planCategories.length >= 2) {\r\n window.location.hash = encodeURIComponent(category);\r\n } else {\r\n window.history.replaceState('', document.title, window.location.pathname + window.location.search);\r\n }\r\n tealiumAnalyticService.trackPlanCategoriesClick(category, ProductCategory.Nbn);\r\n }\r\n\r\n private observer = new MutationObserver((_) => {\r\n const cards = document.querySelectorAll('.card__wrapper');\r\n if (cards.length !== this.renderedPlans) {\r\n this.calculateAndSetDividerWidth();\r\n }\r\n });\r\n\r\n private calculateAndSetDividerWidth = (): void => {\r\n const viewportWidth = document.body.clientWidth;\r\n const allCards = document.getElementsByClassName('card__wrapper');\r\n const firstCard = allCards[0];\r\n if (!firstCard) return;\r\n const cardWidth = firstCard.getBoundingClientRect().width;\r\n\r\n const cardMargin = 32;\r\n\r\n let dividerWidth = 0;\r\n let numberOfCards = 1;\r\n while (true && numberOfCards <= allCards.length) {\r\n const cardsWidth = numberOfCards * cardWidth + (numberOfCards - 1) * cardMargin;\r\n if (cardsWidth < viewportWidth) {\r\n dividerWidth = cardsWidth;\r\n numberOfCards += 2;\r\n } else {\r\n break;\r\n }\r\n }\r\n numberOfCards -= 2;\r\n if (numberOfCards >= 1 && this.planCategories.length > 1) {\r\n const buttonElement = document.getElementById('categories-buttons');\r\n if (buttonElement) {\r\n buttonElement.style.width = `${dividerWidth}px`;\r\n }\r\n }\r\n this.observer.disconnect();\r\n };\r\n\r\n componentDidLoad(): void {\r\n window.addEventListener('resize', this.onResize, true);\r\n }\r\n\r\n private onResize = () => {\r\n this.calculateAndSetDividerWidth();\r\n this.observer.observe(document.querySelector('.comparison-section-wrapper'), {\r\n childList: true,\r\n subtree: true,\r\n attributes: false,\r\n characterData: false\r\n });\r\n };\r\n\r\n componentDidRender(): void {\r\n this.calculateAndSetDividerWidth();\r\n this.observer.observe(document.querySelector('.comparison-section-wrapper'), {\r\n childList: true,\r\n subtree: true,\r\n attributes: false,\r\n characterData: false\r\n });\r\n }\r\n\r\n componentWillLoad(): void {\r\n this.selectedCategoryHashChanged();\r\n window.onhashchange = this.selectedCategoryHashChanged;\r\n }\r\n\r\n private selectedCategoryHashChanged = (): void => {\r\n const hashValue = window.location.hash.replace('#', '');\r\n const selectedCategory = this.getSelectedCategoryByHashValue(decodeURIComponent(hashValue));\r\n if (selectedCategory) {\r\n store.set(StoreKeys.selectedPlanCategory, selectedCategory);\r\n }\r\n };\r\n\r\n private getSelectedCategoryByHashValue = (hashValue: string): string => {\r\n const selectedCategory = this.planCategories.find((x) => x.toUpperCase() === hashValue.toUpperCase());\r\n return selectedCategory;\r\n };\r\n\r\n private selectDefaultCategory(): string {\r\n let selectedCategory: string;\r\n const storedCategory = store.get(StoreKeys.selectedPlanCategory);\r\n\r\n if (this.planCategories.includes('Fibre upgrade')) {\r\n selectedCategory = 'Fibre upgrade';\r\n } else if (storedCategory) {\r\n selectedCategory = storedCategory;\r\n } else {\r\n selectedCategory = this.planCategories[0];\r\n }\r\n\r\n const unknownCategory = !this.planCategories.includes(selectedCategory);\r\n if (unknownCategory) {\r\n selectedCategory = this.planCategories[0];\r\n }\r\n\r\n if (this.planCategories.length >= 2) {\r\n window.location.hash = encodeURIComponent(selectedCategory);\r\n } else {\r\n window.history.replaceState('', document.title, window.location.pathname + window.location.search);\r\n }\r\n store.set(StoreKeys.selectedPlanCategory, selectedCategory);\r\n return selectedCategory;\r\n }\r\n\r\n public categoryClicked(value: string): void {\r\n this.categorySelected = store.get('address') as string;\r\n this.selectCategory(value);\r\n }\r\n\r\n render(): JSX.Element {\r\n let selectedCategory: string;\r\n if (this.categorySelected === (store.get('address') as string)) {\r\n selectedCategory = store.get(StoreKeys.selectedPlanCategory);\r\n } else {\r\n selectedCategory = this.selectDefaultCategory();\r\n }\r\n const isSelected = (mappedValue: string): boolean => selectedCategory === mappedValue;\r\n\r\n if (!selectedCategory || !this.planCategories.includes(selectedCategory)) {\r\n selectedCategory = this.planCategories[0];\r\n }\r\n\r\n const isChangePlan = changePlanService.isChangePlan();\r\n const changePlanSku = isChangePlan ? changePlanService.getSelectedProductSku() : '';\r\n const containerClass = isChangePlan ? 'categories-container change-plan' : 'categories-container';\r\n const currentPlanSku = isChangePlan ? changePlanService.getCurrentPlanSku() : '';\r\n return (\r\n this.planCategories &&\r\n this.planCategories.length > 1 &&\r\n !(isChangePlan && changePlanSku?.length > 0 && currentPlanSku !== changePlanSku) && (\r\n \r\n
\r\n
\r\n this.categoryClicked((document.querySelector('#categories-dropdown select') as HTMLSelectElement).value)}\r\n >\r\n {this.planCategories.map((pc) => (\r\n \r\n ))}\r\n \r\n
\r\n
\r\n {this.planCategories.map((pc) => {\r\n return (\r\n this.categoryClicked(pc)}\r\n role=\"tab\"\r\n aria-label={`Show ${pc} plans`}\r\n aria-selected={`${isSelected(pc)}`}\r\n >\r\n {pc}\r\n \r\n );\r\n })}\r\n
\r\n
\r\n
\r\n )\r\n );\r\n }\r\n}\r\n",":host {\r\n display: block;\r\n}\r\n\r\n.feature-text-container {\r\n margin: 8px 0;\r\n padding: 2px;\r\n display: grid;\r\n grid-template-columns: 1fr 5fr;\r\n}\r\n\r\n.feature-icon {\r\n display: flex;\r\n align-content: flex-start;\r\n flex-direction: row;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n margin-left: 10px;\r\n }\r\n}\r\n\r\n.feature-desc {\r\n display: flex;\r\n justify-content: center;\r\n align-content: center;\r\n flex-direction: column;\r\n font-weight: normal;\r\n font-stretch: normal;\r\n font-style: normal;\r\n line-height: 1.5;\r\n font-size: 14px;\r\n}\r\n","import { Component, Host, h, ComponentInterface, Prop } from '@stencil/core';\r\n\r\n@Component({\r\n tag: 'telco-feature-text',\r\n styleUrl: 'telco-feature-text.scss',\r\n shadow: false,\r\n scoped: true\r\n})\r\nexport class TelcoFeatureText implements ComponentInterface {\r\n @Prop() public desc: string;\r\n\r\n render(): any {\r\n return (\r\n \r\n
\r\n
\r\n \r\n
\r\n
{this.desc}
\r\n
\r\n
\r\n );\r\n }\r\n}\r\n",":host {\r\n display: block;\r\n}\r\n\r\n.bundle-tag {\r\n border: solid 1px #6031a6;\r\n background-color: #6031a6;\r\n padding: 2px 8px;\r\n color: white;\r\n border-radius: 8px 8px 0 0;\r\n font-weight: bold;\r\n font-size: 12px;\r\n width: max-content;\r\n margin: 20px auto -2px 0;\r\n}\r\n\r\n.price-container {\r\n min-height: 72px;\r\n align-self: stretch;\r\n flex-grow: 0;\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 12px;\r\n padding: 16px 12px;\r\n margin: 16px 0;\r\n border-radius: 8px;\r\n background-color: #eff0f4;\r\n color: #2b2e31;\r\n font-weight: 600;\r\n font-stretch: normal;\r\n font-style: normal;\r\n line-height: 1.33;\r\n letter-spacing: normal;\r\n text-align: left;\r\n}\r\n\r\n.bundle .price-container {\r\n background-color: white;\r\n margin-top: 0;\r\n border-radius: 0 8px 8px;\r\n border: solid 1px #6031a6;\r\n color: #6031a6;\r\n}\r\n\r\n.price-value-container {\r\n font-size: 14px;\r\n font-weight: normal;\r\n width: 55px;\r\n max-width: 55px;\r\n min-width: 55px;\r\n display: inline-block;\r\n}\r\n\r\n.price-value {\r\n font-weight: 600;\r\n font-size: 22px;\r\n margin-bottom: -3.96px;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n font-size: 24px;\r\n }\r\n}\r\n\r\n.price-desc {\r\n display: flex;\r\n justify-content: center;\r\n align-content: center;\r\n flex-direction: column;\r\n font-weight: normal;\r\n width: 170.5px;\r\n border-left: solid 1px #c8cbd7;\r\n padding-left: 12.5px;\r\n font-size: 14px;\r\n\r\n @include agl-ds-screen-size('medium') {\r\n font-size: 16px;\r\n width: 219.5px;\r\n }\r\n}\r\n\r\n.bundle .price-desc {\r\n border-left-color: #a7a9b3;\r\n}\r\n","import { Component, ComponentInterface, Host, h, Prop } from '@stencil/core';\r\n\r\n@Component({\r\n tag: 'telco-new-price-tag',\r\n styleUrl: 'telco-new-price-tag.scss',\r\n shadow: false,\r\n scoped: true\r\n})\r\nexport class TelcoNewPriceTag implements ComponentInterface {\r\n @Prop() public price: string;\r\n @Prop() public paymentFreq: string;\r\n @Prop() public priceDesc: string;\r\n @Prop() public bundleTitle?: string;\r\n\r\n private withBoldDollarAmounts = (desc: string) => {\r\n const re = /\\$\\d+\\*?/g;\r\n return desc.replace(re, (match) => {\r\n if (match.endsWith('*')) {\r\n match = match.replace('*', '*');\r\n }\r\n return `${match}`;\r\n });\r\n };\r\n\r\n private parsePrice = (price: string) => {\r\n if (price.endsWith('*')) {\r\n return `$${parseInt(price, 10)}*`;\r\n }\r\n\r\n return `$${parseInt(price, 10)}`;\r\n };\r\n\r\n render(): any {\r\n return (\r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n {this.paymentFreq}\r\n
\r\n
\r\n
{/* extra div so flexbox doesn't affect description */}\r\n
\r\n
\r\n
\r\n \r\n );\r\n }\r\n}\r\n"],"mappings":"imBAQO,MAAMA,GAA8B,SAAUC,GACnD,MAAO,gBAAiBA,CAC1B,ECLA,MAAMC,GAANC,cAYSC,KAAAC,qBAAuBC,MAAOC,IACnC,GAAIA,IAAgB,MAAQA,EAAYC,SAAW,EAAG,CACpD,KAAM,8B,CAGRJ,KAAKK,YACL,MAAMC,EAAcC,EAAcC,iBAClCF,EAAY,6BAA+BN,KAAKS,oBAEhD,MAAMC,EAAOP,EAAYQ,KAAK,KAC9B,MAAMC,EAAa,GAAGZ,KAAKa,2BAA2BH,IAEtD,aAAaI,MAAMF,EAAY,CAC7BG,OAAQ,MACRC,QAASV,IAERW,MAAMC,IACL,IAAKA,EAASC,GAAI,CAEhB,OAAO,I,CAET,OAAOD,EAASE,MAAM,IAEvBH,MAAMI,IACL,MAAMC,EAAgB,GACtB,IAAK,MAAOC,EAA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