1"use strict";(self.webpackChunkubc_consumer_main=self.webpackChunkubc_consumer_main||[]).push([[7740],{57740:(Ee,H,l)=>{l.r(H),l.d(H,{PrepaidCheckoutModule:()=>ke});var B=l(60177),R=l(63318),ae=l(89125),U=l(73955),re=l(51732),M=l(7901),ne=l(98300),G=l(31635),o=l(54438),L=l(89417),j=l(26215),$=l(93364),c=l(34143),C=l(50689),se=l(1807),_=l(49894),Y=l(99327),X=l(67665),J=l(27876),K=l(40200),z=l(21462),Z=l(51238),W=l(97421),F=l(82821),Q=l(35594),O=l(64258),D=l(39379),q=l(96697),le=l(5964),ce=l(40281),he=l(3067),de=l(12657),me=l(88282),ue=l(73284),pe=l(61624);const fe=["otpModal"],ge=["changeContactModal"],Se=["personalInfoDynamicForm"],ee=h=>({"toast-alert":h});function Ce(h,e){if(1&h){const t=o.RV6();o.j41(0,"div",20)(1,"lla-checkbox",21),o.bIt("clickHandler",function(r){o.eBV(t);const a=o.XpG();return o.Njj(a.onMarketingCheckboxChange(r))}),o.k0s()()}if(2&h){const t=o.XpG();o.R7$(),o.Y8G("checkboxOptions",t.marketingCheckboxOptions)("checkboxLabel",!0)("checkboxLabelTypography","label-2-regular")}}function Pe(h,e){1&h&&(o.nrm(0,"lla-alert",22),o.nI1(1,"translate"),o.nI1(2,"translate"),o.nI1(3,"translate"),o.nI1(4,"translate")),2&h&&o.Y8G("opacity",o.bMT(1,7,"PERSONAL_INFO_FORM_ERROR_ALERT.OPACITY"))("status",o.bMT(2,9,"PERSONAL_INFO_FORM_ERROR_ALERT.STATUS"))("statusIcon",o.bMT(3,11,"PERSONAL_INFO_FORM_ERROR_ALERT.ICON"))("body",o.bMT(4,13,"PERSONAL_INFO_FORM_ERROR_ALERT.BODY"))("alertClose",!0)("toastBanner",!0)("previousExistingAlert",!1)}function Ie(h,e){1&h&&o.eu8(0,23)}function Te(h,e){if(1&h){const t=o.RV6();o.j41(0,"div",24)(1,"lla-dynamic-form",25),o.bIt("clickSubmitForm",function(r){o.eBV(t);const a=o.XpG();return o.Njj(a.onChangeContactFormSubmission(r))}),o.k0s()()}if(2&h){const t=o.XpG();o.R7$(),o.Y8G("formConfiguration",t.changePhoneForm)("isC2CSidePanelFlexi",!0)}}function ve(h,e){if(1&h){const t=o.RV6();o.j41(0,"div",24)(1,"lla-dynamic-form",26),o.bIt("clickSubmitForm",function(r){o.eBV(t);const a=o.XpG();return o.Njj(a.onChangeContactFormSubmission(r))}),o.k0s()()}if(2&h){const t=o.XpG();o.R7$(),o.Y8G("formConfiguration",t.changeEmailForm)("isOTPValidation",t.isOTPValidation)}}function ye(h,e){if(1&h){const t=o.RV6();o.j41(0,"div",27)(1,"lla-alert",28),o.bIt("clickHandler",function(){o.eBV(t);const r=o.XpG();return o.Njj(r.onSavePersonalDetailsErrorClose())}),o.k0s()()}if(2&h){const t=o.XpG();o.Y8G("ngClass",o.eq3(9,ee,!t.mobileQuery.matches)),o.R7$(),o.Y8G("previousExistingAlert",!1)("toastBanner",!0)("alertClose",!0)("toastBannerAnimation",!0)("status","error")("statusIcon","alert-circle-outline")("body",t.savePersonalDetailsErrorMessage)("responsiveMarin",t.alertResponsiveMargin)}}function Oe(h,e){if(1&h&&(o.j41(0,"div",29,5),o.nrm(2,"lla-alert",30),o.k0s()),2&h){const t=o.XpG();o.Y8G("ngClass",o.eq3(8,ee,!t.mobileQuery.matches)),o.R7$(2),o.Y8G("previousExistingAlert",!1)("toastBanner",!0)("alertClose",!0)("toastBannerAnimation",!0)("status",t.toastAlert.status)("body",t.toastAlert.body)("responsiveMarin",t.alertResponsiveMargin)}}let V=class w{constructor(e,t,i,r,a,n,s,p,P,g,I,d,f,m,T,v,y){this.checkoutProgressService=e,this.marketConfigurationService=t,this.sidePanelService=i,this.translationService=r,this.billingService=a,this.checkoutService=n,this.checkoutStoreService=s,this.cartService=p,this.cartStoreService=P,this.clickToCallService=g,this.dataLayerService=I,this.formBuilder=d,this.otpCheckService=f,this.paymentSummaryService=m,this.router=T,this.media=v,this.cdr=y,this.callMeBackFormKey=c.ZM_.CALL_ME_BACK_FORM_KEY,this.personalInfoPatchValue=null,this.orderSummaryTitle="",this.continueBtnDisabled=!0,this.showFormError=!1,this.currentLocale="",this.hasCheckoutStarted=!1,this.beginCheckoutEvaluatedThisContinue=!1,this.accordionStatus=[{collapsed:!0,saved:!1,disabled:!1}],this.marketingCheckboxLabel=this.translationService.getTranslation("MOBILE_CHECKOUT.BRAINTREE_PAYMENT.MARKETING_CONSENT_CHECKBOX_LABEL"),this.marketingCheckboxOptions=[{label:this.marketingCheckboxLabel,isChecked:!1}],this.showLoaderObj={isActive:!0,background:"opacity-50",text:"LOADER_MESSAGES.VALIDATING"},this.otpInputStatus="default",this.invalidOtp=!1,this.otpModalHeading="",this.otpModalSubHeading="",this.disclaimerText="",this.disclaimerActionText="",this.subDescription="",this.subDescriptionActionText="",this.currentVerificationType="",this.changeContactModalHeading="",this.changeContactModalSubHeading="",this.disableResendLink=!1,this.customerId="",this.resetOtpForm=0,this.resendTimerSeconds=0,this.otpResendTime=40,this.resendButtonText="",this.otpInvalidError="",this.otpInputCount=6,this.otpModalPrimaryButtonLabel="",this.isPhoneVerificationRequired=!1,this.isEmailVerificationRequired=!1,this.isDisclaimerText=!0,this.isOTPValidation=!1,this.resendCount=0,this.validateOtpCount=0,this.updatedEmail="",this.updatedMobilePhone="",this.showToast=!1,this.toastAlert={status:"",body:""},this.showSavePersonalDetailsError=!1,this.savePersonalDetailsErrorMessage="",this.TOAST_ALERT_DELAY=500,this.TOAST_ALERT_SCREEN_DURATION=8e3,this.alertResponsiveMargin=0,this.isLcpr=!1,this.lcprStorePrefillApplied=!1,this.lcprFormDirty=!1,this.lcprFormBaseline="",this.requiresVerifiedContactReverification=!1,this.personalInfoFormReadyInitialized=!1,this.mobileQuery=v.matchMedia("(max-width: 840px)"),this.tabletQuery=v.matchMedia("(max-width: 1024px)")}isLoggedInUser(){try{return!(!sessionStorage.getItem("user_uid")||!sessionStorage.getItem("auth_token"))}catch{return!1}}ngOnInit(){localStorage.removeItem("personalInfoPayload"),this.seedCallMeBackFormFieldsFromGigya(),localStorage.setItem("isPrepaidCheckout","true"),this.cartStoreService.retrieveCart().subscribe(e=>{if(this.cart=e,(0,D.JC)()&&this.personalInfoForm?.formFields?.length&&this.prefillFormFieldsFromLocalStorage(),e?.entries){this.dataLayerService.basketID$.next(e?.guid??"");const i=this.marketConfigurationService.getBrandMarket()===c.emF.PUERTORICO||this.marketConfigurationService.getBrandMarket()===c.emF.LCPR;i&&localStorage.UserData&&this.tryTriggerBeginCheckoutOnLoadBeforeStoreHydrate(),i&&this.seedLcprPersonalInfoStoreFromLoginDataIfEmpty(),this.scheduleBeginCheckoutOnLoad()}}),this.isLcpr=this.marketConfigurationService.getBrandMarket()===c.emF.PUERTORICO||this.marketConfigurationService.getBrandMarket()===c.emF.LCPR,this.isLcpr&&this.subscribeToLcprPersonalInfoStoreRehydration(),this.marketingCheckboxOptions[0].isChecked="true"===localStorage.getItem("smsCallMarketingConsent"),this.setCheckoutConfiguration(),this.getFormConfiguration(),this.orderSummaryTitle=this.translationService.getTranslation("SHOPPING_CART_SUMMARY.ORDER_SUMMARY.TITLE"),this.currentLocale=this.translationService.getCurrentLocale(),this.changePhoneForm=this.marketConfigurationService.getFormConfiguration(c.xhk.CHANGE_PHONE_MODAL,c.t0f.CHANGE_PHONE_FORM),this.changeEmailForm=this.marketConfigurationService.getFormConfiguration(c.xhk.CHANGE_EMAIL_MODAL,c.t0f.CHANGE_EMAIL_FORM),this.otpModalPrimaryButtonLabel=this.translationService.getTranslation("OTP_MODAL.BUTTON_LABEL"),this.isPhoneVerificationRequired="true"===this.translationService.getTranslation("OTP_VALIDATION.CONFIG.PHONE_NUMBER.MOBILE.PREPAID"),this.isEmailVerificationRequired="true"===this.translationService.getTranslation("OTP_VALIDATION.CONFIG.EMAIL.MOBILE.PREPAID"),!this.isEmailVerificationRequired&&!this.isPhoneVerificationRequired&&(this.isPhoneVerificationRequired=!0),this.initializeOtpForm(),this.currentVerificationType=this.isPhoneVerificationRequired?"phone":"email",setTimeout(()=>{this.isLcpr&&(this.seedCallMeBackFormFieldsFromGigya(),this.seedLcprPersonalInfoStoreFromLoginDataIfEmpty()),this.prefillFormFieldsFromLocalStorage(),this.initializeLcprCompletedStepUiState()},100)}mapCartProducts(e){return e.map(t=>{const i=t.product.categories.filter(s=>
1"root"!==s.code).map(s=>s.code).join("/"),r=t.product.categories[t.product.categories.length-1].code,a=t.parentEntryNumber?e.find(s=>String(s.entryNumber)===String(t.parentEntryNumber)):void 0;let n="full payment";return t.installmentMonthValue&&"FULL"!==t.installmentMonthValue&&"ONE_TIME"!==t.installmentMonthValue&&(n=`installment ${t.installmentMonthValue}`),{totalPrice:t.totalPrice.formattedValue,price:t.cartPrice.cartPrice[0].taxIncludedAmount.formattedValue,numberOfLines:void 0,planCode:t.product.code,code:t.product.code,c2cProductName:void 0,name:t.product.name,quantity:t.quantity,isMultiline:t.product.isMultiLine,category1:i,category2:r,promoApplied:t.promoApplied,basePriceValue:t.basePrice.value,priceValue:t.totalPrice.value,keep_my_number:"PORTABILITY"===t.planType||"PORTABILITY"===t.bringYourOwnDevice?.planType,sim_option_mobile:t.simDetails||localStorage.getItem("selectedDeviceSimType")||t.bringYourOwnDevice?.simType||"eSIM",tradeIn:t.deviceTradeIn?"yes":"no",installment_option:n,parent_device_id:a?.product?.code||"",value_original:t.fullPrice?.value||t.basePrice?.value}})}hasHybrisPersonalInfoInStore(){return(0,F.eu)(this.checkoutStoreService.getPersonalInfoStep())}scheduleBeginCheckoutOnLoad(){this.isLcpr?this.checkoutService.waitForPersonalInfoRehydration().pipe((0,q.s)(1),(0,_.s)(this)).subscribe(()=>this.onLcprHybrisReadyForBeginCheckoutOnLoad()):this.tryTriggerBeginCheckoutOnLoad()}onLcprHybrisReadyForBeginCheckoutOnLoad(){(0,F.tv)()?this.hasCheckoutStarted=!0:this.tryTriggerBeginCheckoutOnLoad()}tryTriggerBeginCheckoutOnLoadBeforeStoreHydrate(){const e=String(this.cart?.guid??"");(0,F.eo)({hasCartEntries:!!this.cart?.entries,hasCheckoutStarted:this.hasCheckoutStarted,cartGuid:e})&&(this.fireBeginCheckoutJourneyOnLoad(),this.hasCheckoutStarted=!0,(0,F.mS)(e))}tryTriggerBeginCheckoutOnLoad(){const e=(0,F.VN)({hasCartEntries:!!this.cart?.entries,hasCheckoutStarted:this.hasCheckoutStarted,personalInfo:this.checkoutStoreService.getPersonalInfoStep()});if("noop"!==e){if("skip_hybris"===e)return void(this.hasCheckoutStarted=!0);"skip_guest"!==e&&(this.fireBeginCheckoutJourneyOnLoad(),this.hasCheckoutStarted=!0)}}fireBeginCheckoutJourneyOnLoad(){this.dataLayerService.beginCheckoutJourney(this.mapCartProducts(this.cart.entries),this.marketConfigurationService.getConfig(),this.marketConfigurationService.getGlobalConfiguration().currency,this.marketConfigurationService.getGlobalConfiguration().leadEvent,this.cart)}hasSavedPersonalInfoForBeginCheckout(){return!!(this.isLcpr&&this.isLcprPersonalInfoStepCompleted()&&this.lcprFormBaseline||this.hasHybrisPersonalInfoInStore())||this.hasUserDataPersonalInfoForBeginCheckout()}hasUserDataPersonalInfoForBeginCheckout(){const e=this.getUserDataPersonalInfoSnapshotForBeginCheckoutCompare();return["firstName","lastName","dateOfBirth","mobilePhone","email"].some(t=>!!String(e[t]??"").trim())}getUserDataPersonalInfoSnapshotForBeginCheckoutCompare(){try{const e=localStorage.getItem("UserData");if(!e)return this.emptyPersonalInfoSnapshotForBeginCheckoutCompare();const t=JSON.parse(e),i=t?.value??t;return{firstName:String(i?.firstName??""),lastName:String(i?.lastName??""),dateOfBirth:String(i?.dateOfBirth??""),mobilePhone:String(i?.mobilePhone??""),email:String(i?.email??"")}}catch{return this.emptyPersonalInfoSnapshotForBeginCheckoutCompare()}}emptyPersonalInfoSnapshotForBeginCheckoutCompare(){return{firstName:"",lastName:"",dateOfBirth:"",mobilePhone:"",email:""}}getSavedPersonalInfoSnapshotForBeginCheckoutCompare(){if(this.isLcpr&&this.isLcprPersonalInfoStepCompleted()&&this.lcprFormBaseline)try{return JSON.parse(this.lcprFormBaseline)}catch{}const e=this.checkoutStoreService.getPersonalInfoStep(),t={firstName:String(e.firstName??""),lastName:String(e.lastName??""),dateOfBirth:String(e.dateOfBirth??""),mobilePhone:String(e.mobilePhone??""),email:String(e.email??"")};if(this.hasHybrisPersonalInfoInStore())return t;const i=this.getUserDataPersonalInfoSnapshotForBeginCheckoutCompare();return{firstName:t.firstName||i.firstName,lastName:t.lastName||i.lastName,dateOfBirth:t.dateOfBirth||i.dateOfBirth,mobilePhone:t.mobilePhone||i.mobilePhone,email:t.email||i.email}}isPersonalInfoSameAsSavedData(e){const t=this.getSavedPersonalInfoSnapshotForBeginCheckoutCompare();return["firstName","lastName","dateOfBirth","mobilePhone","email"].every(r=>this.normalizePersonalInfoFieldForCompare(r,e?.[r])===this.normalizePersonalInfoFieldForCompare(r,t[r]))}evaluateBeginCheckoutForPersonalInfoChange(e){const t=e||this.personalInfoFormData;!t||!Object.keys(t).length||this.tryTriggerBeginCheckoutOnPersonalInfoSave(t)}tryTriggerBeginCheckoutOnPersonalInfoSave(e){if(!this.cart?.entries)return;const t=[this.mapCartProducts(this.cart.entries),this.marketConfigurationService.getConfig(),this.marketConfigurationService.getGlobalConfiguration().currency,this.marketConfigurationService.getGlobalConfiguration().leadEvent,this.cart,e];this.hasSavedPersonalInfoForBeginCheckout()?this.isPersonalInfoSameAsSavedData(e)||this.dataLayerService.beginCheckoutJourney(...t,{allowRefireOnPersonalInfoChange:!0}):localStorage.UserData||this.dataLayerService.beginCheckoutJourney(...t)}normalizePersonalInfoFieldForCompare(e,t){const i=String(t??"").trim();if(!i)return"";switch(e){case"firstName":case"lastName":case"email":default:return i.toLowerCase();case"dateOfBirth":return this.normalizeDobForSave(i).toLowerCase();case"mobilePhone":return this.normalizeMobilePhoneForSave(i).replace(/\D/g,"")}}normalizeDobForSave(e){const t=String(e||"").trim();if(!t)return"";const i=t.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(i){const[,n,s,p]=i;return`${p}-${s}-${n}`}const r=t.match(/^(\d{4})\/(\d{2})\/(\d{2})$/);if(r){const[,n,s,p]=r;return`${p}-${s}-${n}`}const a=(0,O.wk)(t);return a?a.replace(/\//g,"-"):t.replace(/\//g,"-")}normalizeMobilePhoneForSave(e){return(0,O.hi)(e)??""}setCheckoutConfiguration(){this.checkoutProgressConfig=this.checkoutProgressService.mobilePlanCheckoutConfiguration(c.XHp.PrepaidCheckout)}getFormConfiguration(){this.personalInfoForm=this.marketConfigurationService.getFormConfiguration(c.xhk.PREPAID_CHECKOUT,c.t0f.PERSONAL_INFORMATION),this.personalInfoForm||(this.personalInfoForm=this.marketConfigurationService.getFormConfiguration(c.xhk.MOBILE_CHECKOUT,c.t0f.PERSONAL_INFORMATION)),this.personalInfoForm?.buttons&&(this.personalInfoForm.buttons=[]),this.prefillFormFieldsFromLocalStorage()}prefillFormFieldsFromLocalStorage(){try{let e={};if(this.isLcpr){const t=this.checkoutStoreService.getPersonalInfoStep(),{firstName:i,lastName:r,dateOfBirth:a,mobilePhone:n,email:s}=t;if(e={...String(i||"").trim()&&{firstName:String(i).trim()},...String(r||"").trim()&&{lastName:String(r).trim()},...String(a||"").trim()&&{dateOfBirth:this.formatDobForPersonalInfoPatch(a)??String(a).trim()}
1,...String(n||"").trim()&&{mobilePhone:(0,O.hi)(n)??String(n).trim()},...String(s||"").trim()&&{email:String(s).trim()}},(0,D.JC)()){const P=(0,D.md)(),g=this.readCartUserDataNames(),I=String(P?.firstName||"").trim()||g.firstName,d=String(P?.lastName||"").trim()||g.lastName;I&&(e.firstName=I),d&&(e.lastName=d),(I||d)&&this.checkoutStoreService.updatePersonalInfoStep({...I&&{firstName:I},...d&&{lastName:d}})}(e.firstName||e.lastName||e.mobilePhone||e.email)&&this.accordionStatus[0]&&!this.accordionStatus[0].saved&&(this.accordionStatus[0].saved=!0)}else{const t=localStorage.getItem(c.ZM_.CALL_ME_BACK_FORM_KEY);if(t)try{e=JSON.parse(t)?.value||{}}catch{}}if(!Object.keys(e).length||!this.personalInfoForm?.formFields)return;if(null!=e.dateOfBirth){const t=this.formatDobForPersonalInfoPatch(e.dateOfBirth)??String(e.dateOfBirth).trim();t&&(e={...e,dateOfBirth:t})}this.syncCallMeBackFormKeyFromValues(e),this.personalInfoForm.formFields=this.personalInfoForm.formFields.map(t=>{if(!t?.key)return t;const i=e[t.key];return null!=i&&""!==String(i).trim()?{...t,value:String(i).trim()}:t}),this.personalInfoPatchValue={...e},this.patchPersonalInfoDynamicForm(e)}catch{}}readCartUserDataNames(){const e=this.cart?.userData;if(!e||"object"!=typeof e)return{firstName:"",lastName:""};const t=e;return{firstName:String(t.firstName??"").trim(),lastName:String(t.lastName??"").trim()}}formatDobForPersonalInfoPatch(e){const t=this.personalInfoForm?.formFields?.find(i=>"dateOfBirth"===i?.key);return"inputDatePicker"===String(t?.controlType||"")?(0,O.tZ)(null!=e?String(e):null):(0,O.wk)(null!=e?String(e):null)}patchPersonalInfoDynamicForm(e){if(!this.dynamicFormGroup||!e||!Object.keys(e).length)return;const t=Object.entries(e).reduce((i,[r,a])=>{if(!this.dynamicFormGroup.contains(r))return i;const n=this.dynamicFormGroup.get(r);if(n?.dirty){const s=String(n.value??"").trim();if("dateOfBirth"===r||s&&n.valid)return i}return null==a||""===String(a).trim()||(i[r]=String(a).trim()),i},{});Object.keys(t).length&&this.dynamicFormGroup.patchValue(t,{emitEvent:!0}),this.syncPrefilledPersonalInfoValidation()}syncPrefilledPersonalInfoValidation(){const e=this.dynamicFormGroup;if(!e)return;const t=this.personalInfoDynamicFormRef;["firstName","lastName","dateOfBirth","mobilePhone","email"].forEach(i=>{const r=e.get(i);if(r){if("dateOfBirth"===i&&r.dirty){const n=String(r.value??"").trim();if(!n||!/^\d{4}-\d{2}-\d{2}$/.test(n))return}r.updateValueAndValidity({emitEvent:!1}),null!=r.value&&""!==String(r.value).trim()&&r.valid&&(r.markAsDirty(),r.markAsTouched(),t?.controlStatus&&(t.controlStatus[i]={input:"success",icon:"",errorMessage:"",assistiveIcon:""}))}}),e.updateValueAndValidity({emitEvent:!0}),this.checkContinueButton(),this.cdr.detectChanges()}syncCallMeBackFormKeyFromValues(e){if(Object.keys(e).length)try{localStorage.setItem(c.ZM_.CALL_ME_BACK_FORM_KEY,JSON.stringify({value:e}))}catch{}}hasLcprStoredPersonalInfoInStore(e=this.checkoutStoreService.getPersonalInfoStep()){return!!(String(e?.firstName||"").trim()||String(e?.lastName||"").trim()||String(e?.email||"").trim()||String(e?.mobilePhone||"").trim())}subscribeToLcprPersonalInfoStoreRehydration(){const e=()=>{this.personalInfoForm?.formFields?.length&&this.hasLcprStoredPersonalInfoInStore()&&(this.prefillFormFieldsFromLocalStorage(),this.initializeLcprCompletedStepUiState(),this.lcprStorePrefillApplied=!0)};this.checkoutStoreService.retrievePersonalInfoStep().pipe((0,le.p)(t=>this.hasLcprStoredPersonalInfoInStore(t)),(0,_.s)(this)).subscribe(()=>{this.lcprStorePrefillApplied||e()}),this.checkoutService.waitForPersonalInfoRehydration().pipe((0,q.s)(1),(0,_.s)(this)).subscribe(()=>{e(),[0,150,400].forEach(t=>{setTimeout(()=>this.prefillFormFieldsFromLocalStorage(),t)})})}seedLcprPersonalInfoStoreFromLoginDataIfEmpty(){if(this.isLcpr)try{const e=localStorage.getItem(c.ZM_.CALL_ME_BACK_FORM_KEY),t=e&&JSON.parse(e)?.value||{},i=String(t?.firstName||"").trim(),r=String(t?.lastName||"").trim(),a=String(t?.email||"").trim(),n=String(t?.mobilePhone||"").trim(),s=String(t?.dateOfBirth||"").trim(),p=this.checkoutStoreService.getPersonalInfoStep(),P=this.hasLcprStoredPersonalInfoInStore(p),g=!!String(p?.dateOfBirth||"").trim();if(P)return void(!g&&s&&this.checkoutStoreService.updatePersonalInfoStep({dateOfBirth:s}));if(!(i||r||a||n))return;const{cartId:I}=(0,C.qk3)(c.ZM_.CART_ID,{});this.checkoutStoreService.updatePersonalInfoStep({...I&&{cartId:I},...this.currentLocale&&{lang:this.currentLocale},...i&&{firstName:i},...r&&{lastName:r},...a&&{email:a},...n&&{mobilePhone:n},...s&&{dateOfBirth:s}})}catch{}}isLcprPersonalInfoStepCompleted(){return!0===this.checkoutStoreService.getPersonalInfoStep()?.personalInfoStepCompleted}hasStoredVerificationType(){return!!this.getStoredVerifiedVerificationType()}getStoredVerifiedVerificationType(){const e=this.checkoutStoreService.getPersonalInfoStep()?.verificationType;return"mobile"===e||"email"===e?e:void 0}withStoredVerifiedVerificationType(e){if(this.requiresVerifiedContactReverification||this.hasStoredVerifiedContactChanged())return e;const t=this.getStoredVerifiedVerificationType();return t?(0,C.Fs8)(e,{storedVerificationType:t}):e}shouldSkipLcprPersonalInfoApisOnContinue(){return!(!this.isLcpr||!this.isLcprPersonalInfoStepCompleted()||this.hasStoredVerifiedContactChanged()||this.lcprFormDirty)}getVerifiedContactBaselineSnapshot(){if(this.lcprFormBaseline)try{return JSON.parse(this.lcprFormBaseline)}catch{}const e=this.checkoutStoreService.getPersonalInfoStep(),t=this.normalizeFormSnapshot(e),i=String(e.verifiedContact||"").trim();return"mobile"===e.verificationType&&i?t.mobilePhone=(0,O.hi)(i)??i:"email"===e.verificationType&&i&&(t.email=i),t}normalizeContactForComparison(e,t){const i=null==e?"":String(e).trim();return"email"===t?i.toLowerCase():(0,C.$oq)(i)}hasStoredVerifiedContactChanged(){const e=this.getStoredVerifiedVerificationType();if(!e)return!1;const t=this.getVerifiedContactBaselineSnapshot(),i=this.normalizeFormSnapshot(this.personalInfoFormData??this.dynamicFormGroup?.value);if("mobile"===e){const n=this.normalizeContactForComparison(t.mobilePhone,"mobile"),s=this.normalizeContactForComparison(i.mobilePhone,"mobile");return!!n&&!!s&&n!==s}const r=this.normalizeContactForComparison(t.email,"email"),a=this.normalizeContactForComparison(i.email,"email");return!!r&&!!a&&r!==a}syncCurrentVerificationTypeFromStore(){const e=this.getStoredVerifiedVerificationType();"mobile"===e?this.currentVerificationType="phone":"email"===e&&(this.currentVerificationType="email")}shouldSkipOtpVerification(){return!!this.isLoggedInUser()||!this.requiresVerifiedContactReverification&&!this.hasStoredVerifiedContactChanged()&&this.hasStoredVerificationType()}normalizeFormSnapshot(e){const t=i=>null==i?"":String(i).trim();return{firstName:t(e?.firstName),lastName:t(e?.lastName),dateOfBirth:t(e?.dateOfBirth),mobilePhone:t(e?.mobilePhone),email:t(e?.email),secondName:t(e?.secondName),secondLastName:t(e?.secondLastName??e?.motherLastName)}}captureLcprFormBaseline(e){if(!this.isLcpr||!this.isLcprPersonalInfoStepCompleted())return;const t=this.normalizeFormSnapshot(e??this.dynamicFormGroup?.value??this.personalInfoFormData);this.lcprFormBaseline=JSON.stringify(t),this.lcprFormDirty=!1}initializeLcprCompletedStepUiState(){!this.isLcpr||!this.isLcprPersonalInfoStepCompleted()||(this.accordionStatus[0]&&(this.accordionStatus[0].saved=!0,this.accordionStatus[0].disabled=!1,this.accordionStatus[0].collapsed=!1),this.captureLcprFormBaseline(),this.checkContinueButton(),this.cdr.detectChanges())}toGigyaPhone(e){if(!e)return;const t=String(e).replace(/\D/g,"");return 10===t.length?"+1"+t:11===t.length&&t.startsWith("1")?"+"+t:void 0}seedCallMeBackFormFieldsFromGigya(){try{const e=localStorage.getItem("gigya_customer_data");if(!e)return;const t=JSON.parse(e),i=t?.gigyaAccount?.profile??{},r=t?.gigyaAccount?.data??{},a=t?.customerInfo??{},n=a?.characteristic??[],s=S=>n.find(b=>(b?.name||"").toLowerCase()===S.toLowerCase())?.value,p=S=>{if(!S)return;const u=String(S).trim();if(!u)return;const b=u.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(b){const[,k,N,A]=b;return`${A}/${N}/${k}`}const te=u.match(/^(\d{4})\/(\d{2})\/(\d{2})$/);if(te){const[,k,N,A]=te;return`${A}/${N}/${k}`}let x=u.replace(/-/g,"/");const ie=x.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(ie){const[,k,N,A]=ie,oe=parseInt(k,10);return oe>=1&&oe<=12?`${N}/${k}/${A}`:x}return x},P=S=>{if(!S)return;let u=String(S).trim();if(!u)return;if(/^\(\d{3}\)\d{3}-\d{4}$/.test(u))return u;u=u.replace(/^\+/,""),u=u.replace(/^1\s*(?=\(|\d)/,"");const b=u.replace(/\D/g,"");return 10===b.length?`(${b.slice(0,3)})${b.slice(3,6)}-${b.slice(6)}`:void 0},g=S=>String(S??"").padStart(2,"0"),I=i?.birthDay&&i?.birthMonth&&i?.birthYear?`${g(i.birthDay)}/${g(i.birthMonth)}/${i.birthYear}`:void 0,d=Array.isArray(i?.phones)&&i.phones.length?i.phones.find(S=>String(S?.type||"").toLowerCase().includes("mobile"))?.number||i.phones[
10]?.number:void 0,f=String(localStorage.getItem("tmf629_msisdn")||"").trim()||void 0,m=Array.isArray(a?.contactMedium)?a.contactMedium:[],T=m.find(S=>!0===S?.preferred)||m[0],v=String(T?.characteristic?.emailAddress||"").trim()||void 0,y=s("firstName")||i?.firstName,E={firstName:y?String(y).split(" ")[0].trim():void 0,lastName:s("lastName")||i?.lastName,email:v||i?.email||r?.email||s("email"),mobilePhone:P(f||d||r?.mobileNumber||s("mobilePhone")||s("mobile_phone")||t?.gigyaAccount?.phoneNumber),dateOfBirth:(0,O.tZ)(p(s("dateOfBirth"))||p(i?.dateOfBirth)||I)};if(Object.keys(E).forEach(S=>{const u=E[S];(null==u||""===String(u).trim())&&delete E[S]}),0===Object.keys(E).length)return;localStorage.setItem(c.ZM_.CALL_ME_BACK_FORM_KEY,JSON.stringify({value:E}))}catch{}}showOrderSummary(){this.sidePanelService.dispatchSidePanel({type:c.lms.ShoppingCartOrderSummaryModal,title:this.orderSummaryTitle,showDevider:!1,data:{}})}onFormReady(e){this.dynamicFormGroup=e,this.prefillFormFieldsFromLocalStorage(),this.personalInfoFormReadyInitialized||(this.personalInfoFormReadyInitialized=!0,this.dynamicFormGroup.statusChanges.pipe((0,_.s)(this)).subscribe(()=>{this.checkContinueButton(),this.cdr.detectChanges()}),this.dynamicFormGroup.valueChanges.pipe((0,_.s)(this)).subscribe(t=>{this.isLcpr&&this.isLcprPersonalInfoStepCompleted()&&(this.lcprFormBaseline?this.lcprFormDirty=this.lcprFormBaseline!==JSON.stringify(this.normalizeFormSnapshot(t)):(this.personalInfoFormData=t,this.lcprFormDirty=this.hasStoredVerifiedContactChanged())),this.checkContinueButton(),this.cdr.detectChanges()})),this.checkContinueButton(),this.isLcpr&&this.isLcprPersonalInfoStepCompleted()&&!this.lcprFormBaseline&&this.captureLcprFormBaseline(e.value)}onSubmitPersonalInfoForm(e){this.personalInfoFormData=e,this.evaluateBeginCheckoutForPersonalInfoChange(e),this.saveForm(0),localStorage.setItem("UserData",JSON.stringify(e))}saveForm(e){this.accordionStatus[e].saved=!0,this.accordionStatus[e].collapsed=!1,this.checkContinueButton()}checkContinueButton(){this.continueBtnDisabled=!this.dynamicFormGroup?.valid}accordionOpened(e){this.accordionStatus[e].collapsed=!0,this.accordionStatus[e].saved=!1}accordionClosed(e,t){if(this.accordionStatus[e].collapsed=!1,t){const i=t===JSON.stringify(this.personalInfoFormData);this.accordionStatus[e].saved=i}}disabledBtnClick(){this.showFormError=!0,setTimeout(()=>{this.showFormError=!1},1e4)}pageSubmit(){if(this.beginCheckoutEvaluatedThisContinue=!1,!this.dynamicFormGroup?.valid)return;if(this.personalInfoFormData=this.dynamicFormGroup.value,this.isLcpr&&this.shouldSkipLcprPersonalInfoApisOnContinue())return void this.navigateLineConfiguration();this.isLcpr&&!this.beginCheckoutEvaluatedThisContinue&&(this.evaluateBeginCheckoutForPersonalInfoChange(),this.beginCheckoutEvaluatedThisContinue=!0),this.savePersonalInfo();const e={...this.dynamicFormGroup.value},t=this.marketConfigurationService.getConfig().market===c.emF.PUERTORICO,i="true"===localStorage.getItem("isPrepaidCheckout");if(t&&i&&this.isLoggedInUser()){e.mobilePhone=this.toGigyaPhone(e.mobilePhone)??e.mobilePhone;const r=localStorage.getItem("UserData"),a=r?JSON.parse(r):{};let n=null;if(!a?.gigyaAccount||!a?.customerInfo)try{const P=localStorage.getItem("gigya_customer_data");n=P?JSON.parse(P):null}catch{}const s=a?.gigyaAccount||n?.gigyaAccount||null,p=a?.customerInfo||n?.customerInfo||null;localStorage.setItem("UserData",JSON.stringify({...a,...e,...s?{gigyaAccount:s}:{},...p?{customerInfo:p}:{}}))}else localStorage.setItem("UserData",JSON.stringify(e))}formatDobForPersonalDetailsApi(e){const t=(0,O.wk)(e);return t?t.replace(/\//g,"-"):""}savePersonalInfo(){this.beginCheckoutEvaluatedThisContinue||(this.evaluateBeginCheckoutForPersonalInfoChange(),this.beginCheckoutEvaluatedThisContinue=!0),this.requiresVerifiedContactReverification=this.hasStoredVerifiedContactChanged();const{cartId:e}=(0,C.qk3)(c.ZM_.CART_ID,{}),t={firstName:this.personalInfoFormData.firstName,lastName:this.personalInfoFormData.lastName,dateOfBirth:this.formatDobForPersonalDetailsApi(this.personalInfoFormData?.dateOfBirth),mobilePhone:this.personalInfoFormData.mobilePhone,secondName:this.personalInfoFormData.secondName,motherLastName:this.personalInfoFormData.secondLastName,...this.personalInfoFormData?.email&&{email:this.personalInfoFormData.email}},i={value:{...t}};localStorage.setItem(c.ZM_.CALL_ME_BACK_FORM_KEY,JSON.stringify(i));const a="true"===localStorage.getItem("enabledTradeIn");let n={cartId:e,lang:this.currentLocale,userId:c.rK.USER_ID,fields:c.LzN.FULL,isSSNSkipped:!0,deviceTradeIn:a,...t};n=this.withStoredVerifiedVerificationType(n),this.checkoutStoreService.updatePersonalInfoStep({cartId:e,lang:this.currentLocale,firstName:t.firstName,lastName:t.lastName,dateOfBirth:t.dateOfBirth,mobilePhone:t.mobilePhone,email:t.email}),this.clickToCallService.showLoader(this.showLoaderObj),this.cartService.savePersonalDetailsRequest(n).subscribe({next:()=>{if(this.clickToCallService.hideLoader(),localStorage.setItem("personalInfoPayload",JSON.stringify(n)),this.shouldSkipOtpVerification())return this.persistPersonalInfoStepToStore(t,e),void this.navigateLineConfiguration();this.openOtpValidationModal()},error:s=>{this.clickToCallService.hideLoader(),this.showSavePersonalDetailsApiError(s)}})}extractSavePersonalDetailsErrorMessage(e){const t=e?.error,i=t?.errors?.[0]?.message,r=t?.message,a=Array.isArray(r)?r[0]:r;return String(i||a||t||e?.message||"").trim().replace(/^Error log from server:\s*/i,"").replace(/^Http failure response.*:\s*/i,"").trim()||this.translationService.getTranslation("MOBILE_CHECKOUT.PERSONAL_INFORMATION.EMAIL_ERROR")||this.translationService.getTranslation("PERSONAL_DETAILS.EMAIL_INVALID_VALIDATION_MESSAGE")||"Please check your information and try again."}persistPersonalInfoStepToStore(e,t){const i=t||e.cartId||(0,C.qk3)(c.ZM_.CART_ID,{}).cartId,r=(0,O.ov)(e.verificationType);this.checkoutStoreService.updatePersonalInfoStep({cartId:i,lang:this.currentLocale,firstName:e.firstName,lastName:e.lastName,dateOfBirth:e.dateOfBirth,mobilePhone:e.mobilePhone,email:e.email,...r&&{verificationType:r}})}onMarketingCheckboxChange(e){this.marketingCheckboxOptions[0].isChecked=e.isChecked,localStorage.setItem("smsCallMarketingConsent",e.isChecked.toString())}navigateLineConfiguration(){this.requiresVerifiedContactReverification=!1,this.isLcpr&&(this.captureLcprFormBaseline(),this.checkoutStoreService.updatePersonalInfoStep({personalInfoStepCompleted:!0})),this.checkoutProgressService.mobileFlowRedirectTo(c.XHp.LineConfiguration)}saveBillingPreferencePrepaid(e){const{cartId:t}=(0,C.qk3)(c.ZM_.CART_ID,{});if((this.cart?.entries||[]).some(a=>"e_bill"===a?.product?.code))return void e();const r=this.translationService.getCurrentLocale()?.split("-")[0];this.billingService.setBillingPreferenceCheck({users:this.cart?.userId??c.rK.USER_ID,carts:t,billingType:"e_bill",fields:"DEFAULT",language:r,lang:this.translationService.getCurrentLocale()}).subscribe({next:()=>e(),error:()=>e()})}initializeOtpForm(){this.otpInputCount=JSON.parse(this.translationService.getTranslation("OTP_MODAL.OTP_INPUT_COUNT")||"6"),this.otpResendTime=JSON.parse(this.translationService.getTranslation("OTP_MODAL.RESEND_TIME")||"40"),this.otpForm=this.formBuilder.group({otp:["",[L.k0.required,L.k0.minLength(this.otpInputCount),L.k0.maxLength(this.otpInputCount)]]})}openOtpValidationModal(e=!1){!e&&(this.requiresVerifiedContactReverification||this.hasStoredVerifiedContactChanged()||this.hasStoredVerificationType())&&this.syncCurrentVerificationTypeFromStore();const t={language:this.translationService.getCurrentLang(),journeyType:"prepaid_flow",levelRisk:"none",eventAction:"show",verification_method:"phone"===this.currentVerificationType?"SMS":"Email"};this.dataLayerService.showOrCloseOtpPopup(t),"phone"===this.currentVerificationType?this.showPhoneNumberVerificationModal():this.showEmailVerificationModal()}showPhoneNumberVerificationModal(e=!1){if(this.disableResendLink&&e)return;this.clickToCallService.showLoader(this.showLoaderObj);const i=JSON.parse(localStorage.getItem(c.ZM_.CALL_ME_BACK_FORM_KEY)||"{}")?.value?.mobilePhone||this.personalInfoFormData?.mobilePhone||"";this.otpCheckService.generateOtpForValidation({contact:this.marketConfigurationService.getPhoneCode()+(0,C.$oq)(i),deliveryMethod:"SMS",channelId:"ECOMM",businessId:this.marketConfigurationService.getGlobalConfiguration().businessId,language:Q.so[this.translationService.getCurrentLang()]}).subscribe({next:r=>{if(this.clickToCallService.hideLoader(),this.customerId=r.customerId,e){this.resendCount++,this.validateOtpCount=0,this.showToastAlert("success",this.translationService.getTranslation("OTP_VALIDATION.PHONE_NUMBER.RESEND_SUCCESS_TEXT"));const a={language:this.translationService.getCurrentLang(),journeyType:"prepaid_flow",levelRisk:"none",attemptNumbers:this.resendCount,eventAction:"resend",verification_method:"SMS"};this.dataLayerService.otpValidationEvent(a)}else this.isDisclaimerText=!0,this.otpModalHeading=this.translationService.getTranslation("OTP_VALIDATION.PHONE_NUMBER.HEADING"),this.otpModalSubHeading=this.translationService.getTranslation("OTP_VALIDATION.PHONE_NUMBER.SUB_HEADING",{phoneNumber:`<span class="b4-bold">${i}</span>`}),this.disclaimerText=this.translationService.getTranslation("OTP_VALIDATION.PHONE_NUMBER.FOOTER_TEXT"),this.disclaimerActionText=this.translationService.getTranslation("OTP_VALIDATION.PHONE_NUMBER.EMAIl_VERIFICATION"),this.subDescription=this.translationService.getTranslation("OTP_VALIDATION.PHONE_NUMBER.WRONG_CONTACT"),this.subDescriptionActionText=this.translationService.getTranslation("OTP_VALIDATION.PHONE_NUMBER.EDIT_HERE"),this.currentVerificationType="phone",this.otpModal.openDialog({autoFocus:!0,panelClass:"otpModalPanel",height:"auto",disableClose:!0});this.resetOtpModal()},error:()=>{this.clickToCallService.hideLoader()}})}showEmailVerificationModal(e=!1){if(this.disableResendLink&&e)return;this.clickToCallService.showLoader(this.showLoaderObj);const i=JSON.parse(localStorage.getItem(c.ZM_.CALL_ME_BACK_FORM_KEY)||"{}")?.value?.email||this.personalInfoFormData?.email||"";this.otpCheckService.generateOtpForValidation({contact:i,deliveryMethod:"Email",channelId:"ECOMM",businessId:this.marketConfigurationService.getGlobalConfiguration().businessId,language:Q.so[this.translationService.getCurrentLang()]}).subscribe({next:r=>{if(this.clickToCallService.hideLoader(),this.customerId=r.customerId,e){this.resendCount++,this.validateOtpCount=0,this.showToastAlert("success",this.translationService.getTranslation("OTP_VALIDATION.EMAIL.RESEND_SUCCESS_TEXT"));const a={language:this.translationService.getCurrentLang(),journeyType:"prepaid_flow",levelRisk:"none",attemptNumbers:this.resendCount,eventAction:"resend",verification_method:"Email"};this.dataLayerService.otpValidationEvent(a)}else this.isDisclaimerText=!0,this.otpModalHeading=this.translationService.getTranslation("OTP_VALIDATION.EMAIL.HEADING"),this.otpModalSubHeading=this.translationService.getTranslation("OTP_VALIDATION.EMAIL.SUB_HEADING",{email:`<span class="b4-bold">${i}</span>`}),this.disclaimerText=this.translationService.getTranslation("OTP_VALIDATION.EMAIL.FOOTER_TEXT"),this.disclaimerActionText=this.translationService.getTranslation("OTP_VALIDATION.EMAIL.SMS_VERIFICATION"),this.subDescription=this.translationService.getTranslation("OTP_VALIDATION.EMAIL.WRONG_CONTACT"),this.subDescriptionActionText=this.translationService.getTranslation("OTP_VALIDATION.EMAIL.EDIT_HERE"),this.currentVerificationType="email",this.otpModal.openDialog({autoFocus:!0,panelClass:"otpModalPanel",height:"auto",disableClose:!0});this.resetOtpModal()},error:()=>{this.clickToCallService.hideLoader()}})}resetOtpModal(){this.otpForm.reset(),this.resetOtpForm++,this.otpInputStatus="default",this.invalidOtp=!1,this.resendCount=0,this.validateOtpCount=0,this.timerSubscription?.unsubscribe(),this.timerToUpdateResendLink()}timerToUpdateResendLink(){this.timerSubscription&&!this.timerSubscription.closed&&this.timerSubscription.unsubscribe(),this.resendTimerSeconds=this.otpResendTime,this.disableResendLink=!0,this.timerSubscription=(0,se.O)(0,1e3).subscribe(e=>{this.resendTimerSeconds=this.otpResendTime-e,this.resendButtonText=this.resendTimerSeconds>0?this.translationService.getTranslation("OTP_MODAL.RESEND_TEXT",{time:this.resendTimerSeconds}):this.translationService.getTranslation("OTP_MODAL.RESEND_ACTIVE_TEXT"),this.cdr.detectChanges(),this.resendTimerSeconds<=0&&(this.disableResendLink=!1,this.timerSubscription&&!this.timerSubscription.closed&&this.timerSubscription.unsubscribe())})}validateOtpForValidation(){if(this.validateOtpCount>=3)return this.invalidOtp=!0,this.otpInputStatus="error",void(this.otpInvalidError="phone"===this.currentVerificationType?this.translationService.getTranslation("OTP_VALIDATION.PHONE_NUMBER.INVALID_OTP_ERROR_TEXT")||"Invalid code. Please resend code to try again.":this.translationService.getTranslation("OTP_VALIDATION.EMAIL.INVALID_OTP_ERROR_TEXT")||"Invalid code. Please resend code to try again.");this.invalidOtp=!1,this.otpInputStatus="default",this.clickToCallService.showLoader(this.showLoaderObj);const e=this.otpForm.value.otp;this.validateOtpCount++;const t={language:this.translationService.getCurrentLang(),journeyType:"prepaid_flow",levelRisk:"none",attemptNumbers:this.validateOtpCount,eventAction:"submit",verification_method:"phone"===this.currentVerificationType?"SMS":"Email"};this.dataLayerService.otpValidationEvent(t),this.otpCheckService.validateOtpForValidation({customerId:this.customerId,deliveryMethod:"phone"===this.currentVerificationType?"SMS":"Email",otpCode:e,businessId:this.marketConfigurationService.getGlobalConfiguration().businessId}).subscribe({next:()=>{this.clickToCallService.hideLoader(),this.otpModal.closemodalwithoutevent();const i={language:this.translationService.getCurrentLang(),journeyType:"prepaid_flow",levelRisk:"none",eventAction:"closed",verification_method:"phone"===this.currentVerificationType?"SMS":"Email"};this.dataLayerService.showOrCloseOtpPopup(i);const r={language:this.translationService.getCurrentLang(),journeyType:"prepaid_flow",levelRisk:"none",eventAction:"success_code",attemptNumbers:this.validateOtpCount,verification_method:"phone"===this.currentVerificationType?"SMS":"Email"};this.dataLayerService.otpValidationEvent(r);const a=(0,C.Fs8)(JSON.parse(localStorage.getItem("personalInfoPayload")||"{}"),{otpChannel:this.currentVerificationType}),n=JSON.parse(localStorage.getItem(c.ZM_.CALL_ME_BACK_FORM_KEY)||"{}");if("phone"===this.currentVerificationType)a.mobilePhone=this.personalInfoFormData?.mobilePhone||n?.value?.mobilePhone||a.mobilePhone;else{const s=this.personalInfoFormData?.email||n?.value?.email||a.email;a.isChangedEmail=String(a.email||"").trim().toLowerCase()!==String(s||"").trim().toLowerCase(),a.email=s}try{localStorage.setItem("personalInfoPayload",JSON.stringify(a))}catch{}this.persistPersonalInfoStepToStore({firstName:a.firstName,lastName:a.lastName,dateOfBirth:a.dateOfBirth,mobilePhone:a.mobilePhone,email:a.email,verificationType:a.verificationType},a.cartId),this.cartService.savePersonalDetailsRequest(a).subscribe({next:()=>this.saveBillingPreferencePrepaid(()=>this.navigateLineConfiguration()),error:s=>{this.clickToCallService.hideLoader(),this.showSavePersonalDetailsApiError(s)}})},error:()=>{this.clickToCallService.hideLoader(),this.invalidOtp=!0,this.otpInputStatus="error";
1const i={language:this.translationService.getCurrentLang(),journeyType:"prepaid_flow",levelRisk:"none",eventAction:"error_code",verification_method:"phone"===this.currentVerificationType?"SMS":"Email"};this.dataLayerService.otpValidationEvent(i),this.otpInvalidError=this.validateOtpCount>=3?"phone"===this.currentVerificationType?this.translationService.getTranslation("OTP_VALIDATION.PHONE_NUMBER.INVALID_OTP_ERROR_TEXT")||"Invalid code. Please resend code to try again.":this.translationService.getTranslation("OTP_VALIDATION.EMAIL.INVALID_OTP_ERROR_TEXT")||"Invalid code. Please resend code to try again.":this.translationService.getTranslation("phone"===this.currentVerificationType?"OTP_VALIDATION.PHONE_NUMBER.INVALID_OTP_ERROR_TEXT":"OTP_VALIDATION.EMAIL.INVALID_OTP_ERROR_TEXT")}})}onChangeContactFormSubmission(e){const t=localStorage.getItem(c.ZM_.CALL_ME_BACK_FORM_KEY);if(t){const i=JSON.parse(t||"");i.value={...i?.value,...e},localStorage.setItem(c.ZM_.CALL_ME_BACK_FORM_KEY,JSON.stringify(i))}else localStorage.setItem(c.ZM_.CALL_ME_BACK_FORM_KEY,JSON.stringify({value:{...this.personalInfoFormData||{},...e}}));if(e.email||e.mobilePhone){this.personalInfoFormData={...this.personalInfoFormData||{},...e};const i=JSON.parse(localStorage.getItem("personalInfoPayload")||"{}");e.mobilePhone&&(i.mobilePhone=e.mobilePhone),e.email&&(i.isChangedEmail=String(i.email||"").trim().toLowerCase()!==String(e.email||"").trim().toLowerCase(),i.email=e.email),localStorage.setItem("personalInfoPayload",JSON.stringify(i))}if(e.email||e.mobilePhone){this.personalInfoFormData={...this.personalInfoFormData||{},...e};const i=JSON.parse(localStorage.getItem("personalInfoPayload")||"{}");e.mobilePhone&&(i.mobilePhone=e.mobilePhone),e.email&&(i.isChangedEmail=String(i.email||"").trim().toLowerCase()!==String(e.email||"").trim().toLowerCase(),i.email=e.email),localStorage.setItem("personalInfoPayload",JSON.stringify(i))}this.isOTPValidation=!1,this.changeContactModal.closemodalwithoutevent(),this.openOtpValidationModal(!0)}subDescriptionActionHandler(e){this.otpModal.closemodalwithoutevent(),"phone"===this.currentVerificationType?(this.isOTPValidation=!1,this.changeContactModalHeading=this.translationService.getTranslation("OTP_VALIDATION.PHONE_NUMBER.CHANGE_CONTACT_HEADING"),this.changeContactModalSubHeading=this.translationService.getTranslation("OTP_VALIDATION.PHONE_NUMBER.CHANGE_CONTACT_SUB_HEADING"),this.changeContactModal.openDialog({autoFocus:!0,panelClass:"otpModalPanel",height:"auto",disableClose:!0})):(this.isOTPValidation=!0,this.changeContactModalHeading=this.translationService.getTranslation("OTP_VALIDATION.EMAIL.CHANGE_CONTACT_HEADING"),this.changeContactModalSubHeading=this.translationService.getTranslation("OTP_VALIDATION.EMAIL.CHANGE_CONTACT_SUB_HEADING"),this.changeContactModal.openDialog({autoFocus:!0,panelClass:"otpModalPanel",height:"auto",disableClose:!0}))}disabledResendLinkClick(){}showToastAlert(e,t,i=!0){setTimeout(()=>{this.toastAlert.status=e,this.toastAlert.body=t,this.showToast=!0},i?this.TOAST_ALERT_DELAY:0),setTimeout(()=>{this.showToast=!1},this.TOAST_ALERT_SCREEN_DURATION)}showSavePersonalDetailsApiError(e){this.savePersonalDetailsErrorMessage=this.extractSavePersonalDetailsErrorMessage(e),this.showSavePersonalDetailsError=!0,setTimeout(()=>{this.showSavePersonalDetailsError&&(this.showSavePersonalDetailsError=!1)},7e3)}onSavePersonalDetailsErrorClose(){this.showSavePersonalDetailsError=!1}ngOnDestroy(){this.hasCheckoutStarted=!1}saveDueTodayPrice(e){if(!e||!e.entries||!Array.isArray(e.entries)||0===e.entries.length)return void console.warn("\u26a0\ufe0f [Prepaid Checkout] No cart entries found");let t=0;console.log("\u{1f4b0} [Prepaid Checkout] Calculating Due Today price for prepaid plan"),e.entries.forEach(a=>{const s=(a.product||{}).categories||[],p=s.some(d=>{const f=d.code?d.code.toLowerCase():"";return"device"===f||"devices"===f||"smartphones"===f}),P=s.length>0?s[s.length-1]:{},g=P.code?P.code.toLowerCase():"",I="postpaid"===g||"prepaid"===g||"mobile"===g||g.includes("plan")||g.includes("pospago")||g.includes("prepago");if(p&&a.cartPrice&&a.cartPrice.cartPrice){let d=0;a.cartPrice.cartPrice.forEach(f=>{"RECURRING"===f.priceType&&f.taxes&&Array.isArray(f.taxes)&&f.taxes.forEac
1h(m=>{const T=parseFloat(m.value||"0");T>0&&(d+=T)})}),d>0&&(t+=d,console.log(` \u{1f4b5} [Prepaid Checkout] Added device taxes: $${d.toFixed(2)}`))}if(I){let d=0;if(a.cartPrice&&a.cartPrice.cartPrice){const m=a.cartPrice.cartPrice.find(y=>"RECURRING"===y.priceType),T=a.cartPrice.cartPrice.find(y=>"BUY"===y.priceType),v=m||T;if(v){const y=v.priceWithOutTax?.value?.formattedValue||v.priceWithTax?.value?.formattedValue||v.priceWithOutTax?.value?.value||v.priceWithTax?.value?.value||"0";d=parseFloat(String(y).replace(/[^0-9.-]/g,"")||"0"),console.log(" \u{1f4b5} [Prepaid Checkout] Plan price extraction:",{priceType:v.priceType,priceValue:y,parsedPrice:d})}}if(0===d){const m=a.totalPrice?.formattedValue||a.basePrice?.formattedValue||"$0.00";d=parseFloat(m.replace(/[^0-9.-]/g,"")||"0"),console.log(" \u{1f4b5} [Prepaid Checkout] Using fallback price:",{source:a.totalPrice?.formattedValue?"totalPrice":"basePrice",value:m,parsedPrice:d})}if(d>0&&(t+=d,console.log(` \u{1f4b5} [Prepaid Checkout] Added plan base price: $${d.toFixed(2)}`)),a.cartPrice&&a.cartPrice.cartPrice){let m=0;a.cartPrice.cartPrice.forEach(T=>{("RECURRING"===T.priceType||"BUY"===T.priceType)&&T.taxes&&Array.isArray(T.taxes)&&T.taxes.forEach(v=>{const y=parseFloat(v.value||"0");y>0&&(m+=y)})}),m>0&&(t+=m,console.log(` \u{1f4b5} [Prepaid Checkout] Added plan taxes: $${m.toFixed(2)}`))}const f=a.automaticPayOptions||"";if(f){let m=0;"AUTOPAY_CC"===f?m=5:("AUTOPAY"===f||"AUTOPAY_ACH"===f)&&(m=10),m>0&&(t-=m,console.log(` \u{1f4b5} [Prepaid Checkout] Subtracted autopay discount: -$${m.toFixed(2)}`))}}}),t=Math.max(0,t);const r=`$${t.toFixed(2)}`;this.paymentSummaryService.setDueTodayPrice(r),console.log("\u{1f4be} [Prepaid Checkout] Due today price calculated and saved:",r)}static{this.\u0275fac=function(t){return new(t||w)(o.rXU(z.p),o.rXU($.ey),o.rXU(j.J$),o.rXU(C.vXy),o.rXU(X.D),o.rXU(J._),o.rXU(K.N),o.rXU(C.$o),o.rXU(C.V60),o.rXU(R.ClickToCallService),o.rXU(C.hWh),o.rXU(L.ok),o.rXU(Z.N),o.rXU(W.m),o.rXU(M.Ix),o.rXU(Y.DY),o.rXU(o.gRc))}}static{this.\u0275cmp=o.VBU({type:w,selectors:[["lla-prepaid-checkout"]],viewQuery:function(t,i){if(1&t&&(o.GBs(fe,5),o.GBs(ge,5),o.GBs(Se,5)),2&t){let r;o.mGM(r=o.lsd())&&(i.otpModal=r.first),o.mGM(r=o.lsd())&&(i.changeContactModal=r.first),o.mGM(r=o.lsd())&&(i.personalInfoDynamicFormRef=r.first)}},standalone:!1,decls:25,vars:60,consts:[["personalInfoDynamicForm",""],["otpModal",""],["changeContactModal",""],["phoneForm",""],["emailForm",""],["toastContainer",""],["id","prepaidPersonalInfo"],[3,"clickSubmitForm","validFormStatus","accordionOpened","accordionClosed","formConfiguration","patchFormValue","autoPopulate","isCollapsed","isDisabled","isSaved"],["class","marketing-checkbox-container",4,"ngIf"],["class","disabled-alerts",3,"opacity","status","statusIcon","body","alertClose","toastBanner","previousExistingAlert",4,"ngIf"],[1,"center-align"],["types","primary","buttonSize","large",3,"clickHandler","disabledClickHandler","text","disabled","disabledClick"],[1,"center-align","show-order-summary","primary-font-regular"],[3,"click"],[3,"closeButton","isPopupOpen","isBrandLCPR","paddingBottom"],[3,"primaryButtonHandler","secondaryButtonHandler","secondaryButtonDisabledClickHandler","disclaimerActionHandler","subDescriptionActionHandler","title","isTitle","description","InputVerification","count","inputCodeType","status","reactiveInputCodeForm","isPrimaryButtonDisabled","primaryButtonLabel","showPrimaryButtonFirst","secondaryButtonLabel","secondaryButtonTypes","isSecondaryButtonDisabled","secondaryButtonBackgroundEffect","secondButton","secondaryButtonDisabledClick","showErrorText","errorText","buttonFlexDirection","isdisclaimerText","disclaimerText","disclaimerActionText","subDescription","subDescriptionActionText","resetForm"],[3,"title","isTitle","isdescription","description","marginTitle"],["dialog-content","",4,"ngIf","ngIfThen","ngIfElse"],["class","save-personal-details-toast-container",3,"ngClass",4,"ngIf"],["class","toast-container",3,"ngClass",4,"ngIf"],[1,"marketing-checkbox-container"],[3,"clickHandler","checkboxOptions","checkboxLabel","checkboxLabelTypography"],[1,"disabled-alerts",3,"opacity","status","statusIcon","body","alertClose","toastBanner","previousExistingAlert"],["dialog-content",""],[1,"change-contact-form-container"],[3,"clickSubmitForm","formConfiguration","isC2CSidePanelFlexi"],[3,"clickSubmitForm","formConfiguration","isOTPValidation"],[1,"save-personal-details-toast-container",3,"ngClass"],[3,"clickHandler","previousExistingAlert","toastBanner","alertClose","toastBannerAnimation","status","statusIcon","body","responsiveMarin"],[1,"toast-container",3,"ngClass"],[3,"previousExistingAlert","toastBanner","alertClose","toastBannerAnimation","status","body","responsiveMarin"]],template:function(t,i){if(1&t){const r=o.RV6();o.nrm(0,"div",6),o.j41(1,"lla-dynamic-form",7,0),o.bIt("clickSubmitForm",function(n){return o.eBV(r),o.Njj(i.onSubmitPersonalInfoForm(n))})("validFormStatus",function(n){return o.eBV(r),o.Njj(i.onFormReady(n))})("accordionOpened",function(){return o.eBV(r),o.Njj(i.accordionOpened(0))})("accordionClosed",function(n){return o.eBV(r),o.Njj(i.accordionClosed(0,n))}),o.k0s(),o.DNE(3,Ce,2,3,"div",8)(4,Pe,5,15,"lla-alert",9),o.j41(5,"div",10)(6,"lla-button",11),o.nI1(7,"translate"),o.bIt("clickHandler",function(){return o.eBV(r),o.Njj(i.pageSubmit())})("disabledClickHandler",function(){return o.eBV(r),o.Njj(i.disabledBtnClick())}),o.k0s()(),o.j41(8,"div",12)(9,"span",13),o.bIt("click",function(){return o.eBV(r),o.Njj(i.showOrderSummary())}),o.EFF(10),o.nI1(11,"translate"),o.k0s()(),o.j41(12,"lla-modal-base",14,1)(14,"lla-dialog",15),o.bIt("primaryButtonHandler",function(){return o.eBV(r),o.Njj(i.validateOtpForValidation())})("secondaryButtonHandler",function(){return o.eBV(r),o.Njj("phone"===i.currentVerificationType?i.showPhoneNumberVerificationModal(!0):i.showEmailVerificationModal(!0))})("secondaryButtonDisabledClickHandler",function(){return o.eBV(r),o.Njj(i.disabledResendLinkClick())})("disclaimerActionHandler",function(){return o.eBV(r),o.Njj("phone"===i.currentVerificationType?i.showEmailVerificationModal():i.showPhoneNumberVerificationModal())})("subDescriptionActionHandler",function(n){return o.eBV(r),o.Njj(i.subDescriptionActionHandler(n))}),o.k0s()(),o.j41(15,"lla-modal-base",14,2)(17,"lla-dialog",16),o.DNE(18,Ie,1,0,"ng-container",17)(19,Te,2,2,"ng-template",null,3,o.C5r)(21,ve,2,2,"ng-template",null,4,o.C5r),o.k0s()(),o.DNE(23,ye,2,11,"div",18)(24,Oe,3,10,"div",19)}if(2&t){const r=o.sdS(20),a=o.sdS(22);o.R7$(),o.Y8G("formConfiguration",i.personalInfoForm)("patchFormValue",i.personalInfoPatchValue)("autoPopulate",i.callMeBackFormKey)("isCollapsed",i.accordionStatus[0].collapsed)("isDisabled",i.accordionStatus[0].disabled)("isSaved",i.accordionStatus[0].saved),o.R7$(2),o.Y8G("ngIf",i.accordionStatus[0].collapsed),o.R7$(),o.Y8G("ngIf",i.showFormError),o.R7$(2),o.Y8G("text",o.bMT(7,56,"MOBILE_CHECKOUT.PERSONAL_INFORMATION_SUBMIT_BUTTON"))("disabled",i.continueBtnDisabled)("disabledClick",!1),o.R7$(4),o.SpI(" ",o.bMT(11,58,"MOBILE_CHECKOUT.CREDIT_CHECK.GHOST_LINK_TEXT")," "),o.R7$(2),o.Y8G("closeButton",!1)("isPopupOpen",!1)("isBrandLCPR",!0)("paddingBottom","16px"),o.R7$(2),o.Y8G("title",i.otpModalHeading)("isTitle",!0)("description",i.otpModalSubHeading)("InputVerification",!0)("count",i.otpInputCount)("inputCodeType","password")("status",i.otpInputStatus)("reactiveInputCodeForm",i.otpF
1orm)("isPrimaryButtonDisabled",(null==i.otpForm?null:i.otpForm.invalid)||i.validateOtpCount>=3)("primaryButtonLabel",i.otpModalPrimaryButtonLabel)("showPrimaryButtonFirst",!0)("secondaryButtonLabel",i.resendButtonText)("secondaryButtonTypes","secondary-link")("isSecondaryButtonDisabled",i.disableResendLink)("secondaryButtonBackgroundEffect",!1)("secondButton",!0)("secondaryButtonDisabledClick",!1)("showErrorText",i.invalidOtp)("errorText",i.otpInvalidError)("buttonFlexDirection","column")("isdisclaimerText",i.isDisclaimerText)("disclaimerText",i.disclaimerText)("disclaimerActionText",i.disclaimerActionText)("subDescription",i.subDescription)("subDescriptionActionText",i.subDescriptionActionText)("resetForm",i.resetOtpForm),o.R7$(),o.Y8G("closeButton",!1)("isPopupOpen",!1)("isBrandLCPR",!0)("paddingBottom","0px"),o.R7$(2),o.Y8G("title",i.changeContactModalHeading)("isTitle",!0)("isdescription",!0)("description",i.changeContactModalSubHeading)("marginTitle",!0),o.R7$(),o.Y8G("ngIf","phone"===i.currentVerificationType)("ngIfThen",r)("ngIfElse",a),o.R7$(5),o.Y8G("ngIf",i.showSavePersonalDetailsError),o.R7$(),o.Y8G("ngIf",i.showToast)}},dependencies:[B.YU,B.bT,ce.C,he.m,de.y,me.P,ue.X,pe.f,U.D9],styles:[".llac-call-center-container[_ngcontent-%COMP%]{border:2px solid #E9E9EA;background:#f4f4f5}@media (max-width: 599px){.llac-call-center-base-container[_ngcontent-%COMP%]{width:calc(100% - 32px);display:flex;margin:10px 16px}}.llac-call-center-base-container[_ngcontent-%COMP%] .llac-checkout-container{width:625px}@media (max-width: 599px){.llac-call-center-base-container[_ngcontent-%COMP%] .llac-checkout-container{width:100%;background-color:#fff;border-radius:16px}}.center-align[_ngcontent-%COMP%]{display:flex;justify-content:center} .disabled-alerts.llac-alert .toast-banner{width:100%;position:unset;margin:0 auto}.show-order-summary[_ngcontent-%COMP%]{margin-top:30px;cursor:pointer;margin-bottom:35px;color:#0153ba;font-weight:700;line-height:22.4px}@media (min-width: 767px){.show-order-summary[_ngcontent-%COMP%]{display:none}} .website .components-container{min-height:0px}.otp-dialog[_ngcontent-%COMP%], .otp-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%}.otp-dialog-heading[_ngcontent-%COMP%]{font-weight:700;font-size:28px;line-height:130%;color:#292c35}@media screen and (max-width: 599px){.otp-dialog-heading[_ngcontent-%COMP%]{font-size:24px}}.otp-dialog-subheading[_ngcontent-%COMP%]{font-weight:400;font-size:18px;line-height:140%;color:#292c35;margin:16px 0 24px;text-align:center}@media screen and (max-width: 599px){.otp-dialog-subheading[_ngcontent-%COMP%]{font-size:16px}}.otp-dialog-error-text[_ngcontent-%COMP%]{font-weight:400;font-size:16px;line-height:140%;color:#b32731;margin:4px 0 16px;text-align:center}@media screen and (max-width: 599px){.otp-dialog-error-text[_ngcontent-%COMP%]{font-size:14px}} .otpModalPanel .mdc-dialog__surface{border-radius:24px!important;overflow-x:hidden!important} .otpModalPanel .mdc-dialog__content{padding:24px!important}@media screen and (max-width: 599px){ .otpModalPanel .mdc-dialog__content{padding:20px 16px!important}} .otpModalPanel .otp-dialog, .otpModalPanel .otp-form{padding:0 8px}@media screen and (max-width: 599px){ .otpModalPanel .otp-dialog, .otpModalPanel .otp-form{padding:0 4px}} .otpModalPanel .llac-dialog .dialog mat-dialog-actions{padding:16px 0 0!important;margin:0!important}@media screen and (max-width: 599px){ .otpModalPanel .llac-dialog .dialog mat-dialog-actions{padding:12px 0 0!important}} .otpModalPanel .llac-dialog .dialog .secondary-button-container{margin-top:16px}@media screen and (max-width: 599px){ .otpModalPanel .llac-dialog .dialog .secondary-button-container{margin-top:12px}}.toast-container[_ngcontent-%COMP%]{position:fixed;bottom:20px;left:50%;transform:translate(-50%);z-index:1000}.toast-container.toast-alert[_ngcontent-%COMP%]{bottom:80px}.save-personal-details-toast-container[_ngcontent-%COMP%]{position:fixed;bottom:24px;right:24px;z-index:1200;max-width:643px}@media (max-width: 840px){.save-personal-details-toast-container[_ngcontent-%COMP%]{left:16px;right:16px;bottom:120px;max-width:100%}}.change-contact-form-container[_ngcontent-%COMP%]{padding:0 16px 16px}.marketing-checkbox-container[_ngcontent-%COMP%] .checkbox-container{height:auto!important}.marketing-checkbox-container[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .marketing-checkbox-container[_ngcontent-%COMP%] .mat-checkbox-label[_ngcontent-%COMP%], .marketing-checkbox-container[_ngcontent-%COMP%] .mat-list-item-content[_ngcontent-%COMP%], .marketing-checkbox-container[_ngcontent-%COMP%] .mdc-list-item__content[_ngcontent-%COMP%]{color:var(--neutral-900, #1C1D1F)!important;width:100%!important;white-space:normal!important;word-wrap:break-word!important;position:relative!important;left:0!important;padding-right:10px;padding-top:2px}.marketing-checkbox-container[_ngcontent-%COMP%] .label-fullwidth-checkbox{color:#1c1d1f!important}"]})}};V=(0,G.__decorate)([(0,_.d)(),(0,G.__metadata)("design:paramtypes",[z.p,$.ey,j.J$,C.vXy,X.D,J._,K.N,Object,Object,R.ClickToCallService,C.hWh,L.ok,Z.N,W.m,M.Ix,Y.DY,o.gRc])],V);const be=[{path:"",component:V,canActivate:[ne.uk]}];let _e=(()=>{class h{static{this.\u0275fac=function(i){return new(i||h)}}static{this.\u0275mod=o.$C({type:h})}static{this.\u0275inj=o.G2t({imports:[M.iI.forChild(be),M.iI]})}}return h})(),ke=(()=>{class h{static{this.\u0275fac=function(i){return new(i||h)}}static{this.\u0275mod=o.$C({type:h})}static{this.\u0275inj=o.G2t({imports:[B.MD,_e,ae.oW,re.I,U.h,R.DynamicFormModule]})}}return h})()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.