1import{a as Vt,b as Pt}from"./chunk-UC6VGVJQ.js";import{a as A}from"./chunk-WG7JFK7H.js";import{c as Ot}from"./chunk-ZDRPI3JU.js";import{a as Nt}from"./chunk-AVB27TRK.js";import{a as Ft}from"./chunk-FPHPRB3P.js";import{b as P}from"./chunk-6VKQ4C4B.js";import{Aa as Ae,G as Ee,H as ve,J as xe,K as wt,N as Te,O as Dt,Sb as Lt,W as Mt,f as yt,g as bt,h as Bt,i as Rt,j as he,l as Se,m as v,n as ge,o as Re,u as O,v as M,z as It}from"./chunk-2EGU7YKH.js";import"./chunk-XXJ5KP6J.js";import"./chunk-CAQC7JX5.js";import"./chunk-OQSEJWXG.js";import"./chunk-LB2SIPUX.js";import"./chunk-YU5IEYKE.js";import"./chunk-TNG3WTDY.js";import"./chunk-DBPN64ZI.js";import"./chunk-PXIE55XG.js";import"./chunk-76J53O4D.js";import"./chunk-7IEHGNLB.js";import{e as w,f as D}from"./chunk-P5CCJ2SN.js";import{a as At}from"./chunk-UYV2PVS2.js";import"./chunk-NEQO7ITA.js";import"./chunk-ILIGNJRC.js";import{a as xt}from"./chunk-C2LYL6UN.js";import{a as gt}from"./chunk-FM5MQBX4.js";import"./chunk-KJ2DTZTE.js";import"./chunk-3RKFVFMW.js";import"./chunk-6LRNCJRQ.js";import"./chunk-BYUXZABT.js";import{k as Et}from"./chunk-CSKO464Y.js";import{u as Tt,z as q}from"./chunk-RFZ65DFT.js";import{j as ft,m as _t,q as ht}from"./chunk-ZAELU3GP.js";import{e as St}from"./chunk-KCBWTIVH.js";import{b as R}from"./chunk-Q7LOV5U2.js";import"./chunk-GSJIPMUW.js";import"./chunk-2D6KGTZB.js";import"./chunk-ZS7OWNSY.js";import"./chunk-DIZWDXBB.js";import{E as Ce,Q as fe,U as vt,_ as _e}from"./chunk-Q4MTVQC2.js";import{b as Ct}from"./chunk-RRAYDVNW.js";import{Cb as at,Ea as ot,Id as lt,Na as rt,Nd as mt,Pd as pt,a as Be,c as Y,cb as nt,dd as ae,fd as g,hd as se,id as ce,lc as st,ld as T,ne as ut,od as le,pe as W,qe as de,rd as me,sd as pe,td as ct,xe as dt,yd as ue}from"./chunk-WGWIBZ2L.js";import{$b as S,$c as ne,Cc as ze,D as Z,Fa as f,Fc as F,Ga as _,Gb as re,Ha as Le,Ia as Ve,Ib as m,La as ye,N as Ne,Ob as E,Oc as G,Pc as H,Pd as tt,Q as Fe,Ra as Pe,Rb as Ge,Sb as He,Ta as te,Tb as a,Tc as be,Ub as n,Vb as h,Wb as We,Xb as qe,Z as b,Zb as L,ac as c,ad as Qe,ca as we,cb as k,dc as V,dd as Xe,f as X,fb as ie,gd as Je,gf as it,hb as r,ic as $e,jc as je,kc as Ye,lb as Ue,ma as De,md as Ze,pc as p,qa as Oe,qc as B,rc as C,sc as Ke,tb as N,td as et,ua as Me,ub as oe,va as ee,vb as ke,w as J,ya as s,zb as d}from"./chunk-6LP6WHZQ.js";import{a as z,b as Q}from"./chunk-5KTCK5IS.js";var I=class{constructor(l){this.configurationService=l,this._recaptchaToken$=new X,this.recaptchaSiteKey||this.configurationService.recaptchaSettings$.pipe(b(1)).subscribe(e=>{this._recaptchaSiteKey=e.siteKey})}get recaptchaSiteKey(){return this._recaptchaSiteKey}get recaptchaToken(){return this._recaptchaToken}get recaptchaToken$(){return this._recaptchaToken?J(this._recaptchaToken):this._recaptchaToken$.asObservable()}recaptchaResolved(l){this._recaptchaToken=l,this._recaptchaToken$.next(this.recaptchaToken)}};var $=(()=>{class t{#e=s(St);sendRegistrationOpenedGAEvent(){this.#e.pushTag({event:D.RegistrationStep,eventCategory:w.Account,eventAction:O.B2CCustomerRegistrationStart,eventLabel:M.B2CCustomerRegistrationStart})}sendSuccessRegistrationGAEvent(){this.#e.pushTag({event:D.RegistrationStep,eventCategory:w.Account,eventAction:O.B2CCustomerRegistrationCompletedFirstStep,eventLabel:M.B2CCustomerRegistrationStart})}sendSubmitClickedGAEvent(){this.#e.pushTag({event:D.CustomEvent,eventCategory:w.Account,eventAction:O.B2CCustomerRegistrationSubmitSecurityCode,eventLabel:M.B2CCustomerRegistrationButtonClick})}sendVerifyEmailGAEvent(){this.#e.pushTag({event:D.RegistrationStep,eventCategory:w.Account,eventAction:O.B2CCustomerRegistrationVerifyEmail,eventLabel:M.B2CCustomerRegistrationEmailVerification})}sendResendCodeGAEvent(){this.#e.pushTag({event:D.CustomEvent,eventCategory:w.Account,eventAction:O.B2CCustomerRegistrationResendCode,eventLabel:M.B2CCustomerRegistrationResendEmailCode})}sendInvalidSecurityCodeGAEvent(){this.#e.pushTag({event:D.RegistrationStepError,eventCategory:w.Account,eventAction:O.B2CCustomerRegistrationStep2Error,eventLabel:M.B2CCustomerRegistrationInvalidSecurityCode})}sendRegistrationCompletedGAEvent(){this.#e.pushTag({event:D.RegistrationStep,eventCategory:w.Account,eventAction:O.B2CCustomerRegistrationCompleted,eventLabel:M.B2CCustomerRegistrationCompleted})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=Me({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ut=(()=>{class t{constructor(){this.#e=s(Ae,{self:!0}),this.#i=s(at),this.VIEW_HEIGHT_THRESHOLD=700}#e;#i;ngOnInit(){this.#t(),this.#o()}ngOnDestroy(){this.resizeObserver?.disconnect()}#t(){let e=this.#i.innerHeight;this.#e.appendTo=e>this.VIEW_HEIGHT_THRESHOLD?"body":"self"}#o(){this.resizeObserver=new ResizeObserver(e=>{for(let i of e)if(i.target===this.#i.document.documentElement){this.#t();break}}),this.resizeObserver.observe(this.#i.document.documentElement)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275dir=ke({type:t,selectors:[["ppg-password","ppgAppendDetailsPopupBelow",""]],standalone:!1})}}return t})();var ri=["captchaRef"],Ie=t=>({"ng-invalid ng-dirty":t}),Ht=t=>({contactUsUrl:t}),ni=(t,l)=>l.name;function ai(t,l){if(t&1&&(a(0,"h2",25),p(1),n()),t&2){let e=c().$implicit;r(),B(e("USER_DETAILS"))}}function si(t,l){if(t&1&&(a(0,"p-message",26),h(1,"span",28),n()),t&2){let e=c(2).$implicit,i=c();r(),m("innerHTML",e("B2B_USER_WITH_EMAIL_ALREADY_EXISTS",F(1,Ht,i.contactUsUrl())),k)}}function ci(t,l){if(t&1&&(a(0,"p-message",27),h(1,"span",28),n()),t&2){let e=c(2).$implicit,i=c();r(),m("innerHTML",e("B2C_USER_WITH_EMAIL_ALREADY_EXISTS",F(1,Ht,i.contactUsUrl())),k)}}function li(t,l){if(t&1&&d(0,si,2,3,"p-message",26)(1,ci,2,3,"p-message",27),t&2){let e=c(2);E(e.b2bEmailExists?0:1)}}function mi(t,l){if(t&1&&(a(0,"h2",25),p(1),n()),t&2){let e=c().$implicit;r(),B(e("PASSWORD_SECTION.TITLE"))}}function pi(t,l){if(t&1&&(a(0,"div",30),h(1,"p-checkbox",31),a(2,"label",32),p(3),n()()),t&2){let e=c(2).$implicit;r(3),C(" ",e("B2C_OPT_IN_SUBSCRIPTION_CHECKBOX_TEXT")," ")}}function ui(t,l){if(t&1&&(a(0,"small",37),p(1),n()),t&2){let e=c(2).$implicit,i=c(3);re("data-test-id","createB2CAccountStep1.error."+e.name),r(),C(" ",i.resources().checkBoxError," ")}}function di(t,l){if(t&1&&(a(0,"div",33)(1,"div",34),h(2,"p-checkbox",35)(3,"label",36),n(),d(4,ui,2,2,"small",37),n()),t&2){let e=c().$implicit,i=c(3);r(2),m("formControlName",e.name)("inputId",e.name),re("data-test-id","createB2CAccountStep1.checkbox."+e.name),r(),m("innerHTML",e.label,k)("for",e.name),re("data-test-id","createB2CAccountStep1.label."+e.name),r(),E(i.checkBoxesForm.controls[e.name]!=null&&i.checkBoxesForm.controls[e.name].invalid&&(i.checkBoxesForm.controls[e.name]!=null&&i.checkBoxesForm.controls[e.name].dirty)?4:-1)}}function Ci(t,l){if(t&1&&d(0,di,5,7,"div",33),t&2){let e=l.$implicit,i=c(3);E(i.checkBoxesForm.controls!=null&&i.checkBoxesForm.controls[e.name]?0:-1)}}function fi(t,l){if(t&1&&(a(0,"p-card",24)(1,"form",29),d(2,pi,4,1,"div",30),Ge(3,Ci,1,1,null,null,ni),n()()),t&2){let e=c(2);r(),m("formGroup",e.checkBoxesForm),r(),E(e.showOptInSubscription()?2:-1),r(),He(e.checkBoxes())}}function _i(t,l){if(t&1){let e=L();a(0,"section")(1,"div",4)(2,"h1",5),p(3),n(),a(4,"div",6)(5,"div",7),p(6),n()(),a(7,"div",6)(8,"div",8)(9,"span",9),p(10,"*"),n(),p(11),G(12,"transloco"),n()(),a(13,"p-card",10),d(14,ai,2,1,"ng-template",null,0,be),a(16,"p-fluid")(17,"form",11)(18,"ppg-input-group",12)(19,"input",13),S("blur",function(){f(e);let o=c();return _(o.userDetailsformWrapper.onControlBlur("firstName"))})("valueChange",function(o){f(e);let u=c();return _(u.userDetailsformWrapper.onControlChangeValue("firstName",o))}),n()(),a(20,"ppg-input-group",14)(21,"input",15),S("blur",function(){f(e);let o=c();return _(o.userDetailsformWrapper.onControlBlur("lastName"))})("valueChange",function(o){f(e);let u=c();return _(u.userDetailsformWrapper.onControlChangeValue("lastName",o))}),n()(),a(22,"div",16),h(23,"app-phone-number-input",17),n(),a(24,"div")(25,"ppg-input-group",18)(26,"input",19),S("blur",function(){f(e);let o=c();return _(o.userDetailsformWrapper.onControlBlur("email"))})("valueChange",function(o){f(e);let u=c();return _(u.userDetailsformWrapper.onControlChangeValue("email",o))}),n()(),d(27,li,2,1),n()()()(),a(28,"p-card",20),d(29,mi,2,1,"ng-template",null,0,be),a(31,"p-fluid")(32,"form",21),h(33,"ppg-password",22)(34,"ppg-password",23),n()()(),d(35,fi,5,2,"p-card",24),n()()}if(t&2){let e,i=l.$implicit,o=c();r(3),C(" ",i("CREATE_USER_ACCOUNT_TITLE")," "),r(3),C(" ",i("CREATE_USER_ACCOUNT_DESCRIPTION")," "),r(5),C(" ",H(12,41,"B2C_CUSTOMER.REQUIRED_FIELDS")," "),r(6),m("formGroup",o.userDetailsForm),r(),m("label",i("FIRST_NAME"))("required",!0)("displaySuffix",!0),r(),m("ngClass",F(43,Ie,o.userDetailsformWrapper.isControlInvalid("firstName")))("maxLength",o.FieldRestrictions.FirstNameMaxLength)("ppgValidator",o.userDetailsformWrapper.getFormControlBy("firstName"))("fieldType",o.ERROR_FIELD_TYPE.FirstName),r(),m("label",i("LAST_NAME"))("required",!0)("displaySuffix",!0),r(),m("ngClass",F(45,Ie,o.userDetailsformWrapper.isControlInvalid("lastName")))("maxLength",o.FieldRestrictions.LastNameMaxLength)("ppgValidator",o.userDetailsformWrapper.getFormControlBy("lastName"))("fieldType",o.ERROR_FIELD_TYPE.LastName),r(2),m("formGroup",o.userDetailsForm)("label",i("PHONE_NUMBER"))("phoneControl","phoneNumber"),r(2),m("label",i("EMAIL"))("required",!0)("displaySuffix",!0),r(),m("ngClass",F(47,Ie,o.userDetailsformWrapper.isControlInvalid("email")))("maxLength",o.FieldRestrictions.EmailMaxLength)("ppgValidator",o.userDetailsformWrapper.getFormControlBy("email"))("fieldType",o.ERROR_FIELD_TYPE.Email),r(),E(o.b2bEmailExists||o.b2cEmailExists?27:-1),r(5),m("formGroup",o.userPasswordForm),r(),m("inputStyleModifier","w-full")("formGroup",o.userPasswordForm)("label",i("PASSWORD_SECTION.PASSWORD_FIELD_LABEL"))("formControlName","password")("styleModifier","w-full block"),r(),m("styleModifier","w-full block")("inputStyleModifier","w-full block")("formGroup",o.userPasswordForm)("label",i("PASSWORD_SECTION.RETYPE_PASSWORD_FIELD_LABEL"))("formControlName","repeatPassword"),r(),E((e=o.checkBoxes())!=null&&e.length?35:-1)}}function hi(t,l){if(t&1){let e=L();a(0,"re-captcha",38,1),S("resolved",function(o){f(e);let u=c();return _(u.recaptchaService.recaptchaResolved(o))}),n()}if(t&2){let e=c();m("siteKey",e.recaptchaService.recaptchaSiteKey)}}var Wt=(()=>{class t{unloadNotification(e){e.returnValue=this.doesFormContainUserData()||""}#e;#i;#t;#o;#a;#s;#c;#l;#r;#m;constructor(){this.#e=s(Ee),this.#i=s(Pe),this.#t=s(ue),this.#o=s(A),this.#a=s($),this.#s=s(R),this.#c=s(dt),this.#l=s(st),this.#r=s(Ct),this.recaptchaService=s(I),this.checkBoxesForm=this.#t.group({marketingSubscriptionOptIn:[!1]}),this.ERROR_FIELD_TYPE=he,this.contactUsUrl=Y(this.#s.contactUsUrl$),this.showOptInSubscription=Y(this.#s.marketingAutomationFeatureFlag$),this.resources=ne(()=>({checkBoxError:this.#r.getResourceByKey(rt.MULTISITE_AUTHENTICATION_POPUP_ERROR)})),this.#m=ne(()=>{let o=ot.EnduserTermsConsentsKontentAICodeNames;return this.#l.getSiteSettingValueByKey(o)}),this.checkBoxes=ne(()=>{let o=this.#m();return o?this.#d(o):[]});let e=this.#o.state.b2CCustomerRegistrationModel||{};this.userDetailsForm=this.#t.group({firstName:new T(e.firstName||"",{validators:Vt,nonNullable:!0,updateOn:"change"}),lastName:new T(e.lastName||"",{validators:Pt,nonNullable:!0,updateOn:"change"}),phoneNumber:new T(e.phoneNumber||"",{nonNullable:!0,updateOn:"blur"}),countryCode:new T(e.countryCode||"",{validators:[g.required],updateOn:"change"}),language:new T(e.language||"",{validators:[g.required],nonNullable:!0,updateOn:"change"}),email:new T(e.email||"",{validators:[g.required,P.email(),P.forbidUsingPPGEmail(),g.minLength(Se.EmailMinLength),g.maxLength(Se.EmailMaxLength)],nonNullable:!0,updateOn:"blur"})});let i=s(ht).minDigitLengthValidator;Qe(()=>{this.userDetailsForm.controls.phoneNumber.setValidators([g.required,Ft.customPhone(),i()]),this.#n()}),this.userPasswordForm=this.#t.group({password:new T("",{validators:[g.required,Nt.passwordRequirements()],nonNullable:!0,updateOn:"change"}),repeatPassword:new T("",{validators:[g.required,P.confirmPasswordMatchPassword()],nonNullable:!0,updateOn:"change"})},{validators:[P.PasswordFieldsMatch("password","repeatPassword")],updateOn:"change"}),this.userDetailsformWrapper=new Re(this.userDetailsForm),this.userPasswordFormWrapper=new Re(this.userPasswordForm)}ngOnInit(){this.#a.sendRegistrationOpenedGAEvent(),this.userDetailsformWrapper.getFormControlBy("countryCode").setValue(this.#c.countryCode()),this.userDetailsformWrapper.getFormControlBy("language").setValue(this.#c.language())}get FieldRestrictions(){return Se}moveNextAllowed(){return ge(this.userDetailsForm,!0),ge(this.userPasswordForm,!0,!0),ge(this.checkBoxesForm,!0,!0),this.b2bEmailExists=!1,this.b2cEmailExists=!1,this.isFormValid()?(this.recaptchaService.recaptchaToken||this.captchaRef.execute(),this.#p().pipe(Z(e=>[v.Created,v.BadRequest].includes(e.data.generateAndSendSecurityCodeToEmail.statusCode)))):(this.scrollToFirstInvalidInput(),J(!1))}scrollToFirstInvalidInput(){this.#i.nativeElement.querySelector(".ng-invalid")?.scrollIntoView()}isFormValid(){return this.userDetailsForm.valid&&this.userPasswordForm.valid&&this.checkBoxesForm.valid}doesFormContainUserData(){let e=["firstName","lastName","phoneNumber","email"],i=["password","repeatPassword"];return e.some(o=>this.userDetailsForm.controls[o].value)||i.some(o=>this.userPasswordForm.controls[o].value)||this.userDetailsForm.controls.language.value!=="en-US"}#p(){this.#u();let{firstName:e,lastName:i,email:o,language:u}=this.userDetailsForm.value;return this.recaptchaService.recaptchaToken$.pipe(De(x=>(this.#a.sendSuccessRegistrationGAEvent(),this.#e.generateAndSendSecurityCodeToEmail(x,{firstName:e,lastName:i,email:o,language:u}))),b(1),Oe(x=>{let{statusCode:j}=x.data.generateAndSendSecurityCodeToEmail;j===v.NotFound&&(x.error?.message=="B2B"?this.b2bEmailExists=!0:this.b2cEmailExists=!0),this.#o.setState({intermediateState:{isCodeGenerationLimitExceeded:j===v.BadRequest}})}))}#u(){let e=Object.entries(this.checkBoxesForm.value).map(i=>{if(i[1])return i[0]}
1).filter(Boolean);this.#o.setState({b2CCustomerRegistrationModel:Q(z({},this.userDetailsForm.value),{password:this.userPasswordForm.get("password").value,acceptedTermsConsents:e})})}#n(){this.checkBoxes().length&&this.checkBoxes()?.forEach(e=>{this.checkBoxesForm.controls?.[e.name]||this.checkBoxesForm.addControl(e.name,this.#t.control(!1,[g.required,g.requiredTrue]))})}#d(e){if(!e)return[];let i=o=>{let u=o.trim();return this.#r.getResourceByKey(u)};return e.split(",").filter(o=>o.trim()).map(o=>({name:o.trim(),label:i(o)??""})).filter(o=>!!o.label)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=N({type:t,selectors:[["ppg-b2c-account-information"]],viewQuery:function(i,o){if(i&1&&$e(ri,5),i&2){let u;je(u=Ye())&&(o.captchaRef=u.first)}},hostBindings:function(i,o){i&1&&S("beforeunload",function(x){return o.unloadNotification(x)},!1,ie)},standalone:!1,decls:2,vars:2,consts:[["title",""],["captchaRef","reCaptcha"],[4,"transloco","translocoRead"],["ppgRecaptchaIframeTabindex","","size","invisible",3,"siteKey"],[1,"flex","justify-content-center","flex-column","px-2"],["data-test-id","createB2CAccountStep1.headerCreateYourUserAccount"],[1,"line-height-normal"],["data-test-id","createB2CAccountStep1.stepDescription",1,"pt-0","pb-2","pl-1"],["data-test-id","createB2CAccountStep1.requiredFields",1,"pt-2","pb-4"],[1,"required"],["styleClass","ppg-form-card","data-test-id","createB2CAccountStep1.userDetailsCardWithTitle"],[1,"gap-4","flex","flex-column","pt-2",3,"formGroup"],["labelFor","firstName","data-test-id","createB2CAccountStep1.labelFirstName",3,"label","required","displaySuffix"],["type","text","pInputText","","data-test-id","createB2CAccountStep1.firstNameInput","formControlName","firstName","name","firstName","id","firstName","required","true",3,"blur","valueChange","ngClass","maxLength","ppgValidator","fieldType"],["labelFor","lastName","data-test-id","createB2CAccountStep1.labelLastName",3,"label","required","displaySuffix"],["type","text","pInputText","","data-test-id","createB2CAccountStep1.lastNameInput","formControlName","lastName","name","lastName","id","lastName","required","true",3,"blur","valueChange","ngClass","maxLength","ppgValidator","fieldType"],["data-test-id","createB2CAccountStep1.labelPhone"],["data-test-id","createB2CAccountStep1.phoneInput","ngDefaultControl","","styleModifier","w-full",3,"formGroup","label","phoneControl"],["labelFor","email","data-test-id","createB2CAccountStep1.labelEmail",3,"label","required","displaySuffix"],["type","text","pInputText","","data-test-id","createB2CAccountStep1.emailInput","formControlName","email","name","email","id","email","required","true",3,"blur","valueChange","ngClass","maxLength","ppgValidator","fieldType"],["styleClass","ppg-form-card","data-test-id","createB2CAccountStep1.passwordSectionCardWithTitle",1,"mt-4","user-password-form"],[1,"flex","flex-column","gap-4","pt-2",3,"formGroup"],["inputId","account-info-pswd","data-test-id","createB2CAccountStep1.password","ngDefaultControl","","ppgAppendDetailsPopupBelow","",3,"inputStyleModifier","formGroup","label","formControlName","styleModifier"],["inputId","account-info-repeat-pswd","data-test-id","createAccountStep1.repeatPassword","ngDefaultControl","","ppgAppendDetailsPopupBelow","",3,"styleModifier","inputStyleModifier","formGroup","label","formControlName"],["styleClass","ppg-form-card","data-test-id","createB2CAccountStep1.checkBoxesCard",1,"mt-4"],[1,"m-0","p-0"],["data-test-id","createB2CAccountStep1.b2bEmailexists","severity","error","icon","pi pi-times-circle","styleClass","w-full mt-2 inline-flex justify-content-start align-items-center border-none"],["data-test-id","createB2CAccountStep1.b2cEmailexists","severity","error","icon","pi pi-times-circle","styleClass","w-full mt-2 inline-flex justify-content-start align-items-center border-none"],[3,"innerHTML"],[1,"flex","flex-column","gap-4",3,"formGroup"],[1,"flex","flex-row","gap-2"],["formControlName","marketingSubscriptionOptIn","binary","true","inputId","marketingSubscriptionOptIn","data-test-id","createB2CAccountStep1.marketingSubscriptionOptIn"],["for","marketingSubscriptionOptIn",1,"align-items-start","step1-label"],["data-test-id","createB2CAccountStep1.checkboxContainer",1,"flex","flex-column","gap-2"],[1,"flex","align-items-start","gap-2"],["binary","true",1,"flex","align-items-start",3,"formControlName","inputId"],[1,"flex","align-items-start","step1-label","p-label","p-label-required","text-base","font-normal",3,"innerHTML","for"],[1,"p-hint","p-hint-error"],["ppgRecaptchaIframeTabindex","","size","invisible",3,"resolved","siteKey"]],template:function(i,o){i&1&&d(0,_i,36,49,"section",2)(1,hi,2,1,"re-captcha",3),i&2&&(m("translocoRead","B2C_CUSTOMER.CREATE_USER_ACCOUNT_STEP"),r(),E(!o.recaptchaService.recaptchaToken&&o.recaptchaService.recaptchaSiteKey?1:-1))},dependencies:[Je,le,ae,se,ce,ct,me,pe,ve,W,wt,Ae,vt,_e,q,Ce,Te,xe,bt,Tt,Ut,de],styles:[".user-password-form[_ngcontent-%COMP%] .p-password-panel[_ngcontent-%COMP%]{top:3.125rem}[_nghost-%COMP%] label.step1-label p{margin-top:0;margin-bottom:0}"]})}}return t})();function gi(t,l){if(t&1){let e=L();We(0),a(1,"p-button",15),S("click",function(){f(e);let o=c(2);return _(o.goToSignIn())}),n(),qe()}if(t&2){let e=c().$implicit;r(),V("label",e("GO_TO_SIGNIN_BUTTON_LABEL"))}}function Ei(t,l){if(t&1&&(a(0,"div",2)(1,"div",3),Le(),a(2,"svg",4),h(3,"use",5),n(),Ve(),a(4,"h1",6),p(5),n()(),a(6,"div",7),p(7),n(),a(8,"p-card",8)(9,"div",9),p(10),n(),a(11,"span",10),p(12),n(),a(13,"div",11),p(14),n(),a(15,"span",12),p(16),n(),a(17,"div",13),p(18),n(),d(19,gi,2,1,"ng-container",14),n()()),t&2){let e=l.$implicit,i=c();r(5),C(" ",e("TITLE")," "),r(2),B(e("DESCRIPTION")),r(),m("header",e("ACCOUNT_DETAILS_CARD")),r(2),C(" ",e("ACCOUNT_DETAILS_DESCRIPTION")," "),r(2),C(" ",e("NAME")," "),r(2),Ke(" ",i.registrationCompletedState.userFirstName," ",i.registrationCompletedState.userLastName," "),r(2),C(" ",e("EMAIL")," "),r(2),C(" ",i.registrationCompletedState.userEmail," ")}}var qt=(()=>{class t{#e=s(A);#i=s($);#t=s(At);#o=s(ft);#a=s(_t);constructor(){this.#i.sendRegistrationCompletedGAEvent(),this.registrationCompletedState=this.#e.state.b2cRegistrationCompletedModel||{}}goToSignIn(){this.#o.isMobileApp()?this.#a.invokeCSharpAction(nt.SIGN_IN):this.#t.login(!0)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=N({type:t,selectors:[["ppg-b2c-registration-success"]],standalone:!1,decls:2,vars:1,consts:[[1,"flex","flex-row","justify-content-center","pt-3","pb-2","px-2","mb-6"],["class","form-container flex flex-column justify-content-center w-30rem pt-40 pr-40 p-56 p-40 ga
1p-4",4,"transloco","translocoRead"],[1,"form-container","flex","flex-column","justify-content-center","w-30rem","pt-40","pr-40","p-56","p-40","gap-4"],[1,"flex","align-items-center","gap-2"],[1,"icon-circle-success","mt-4"],["href","assets/pds-icons.svg#check-circle-outline"],["data-test-id","createB2CAccountSuccess.pageTitle",1,"page-title","p-0","mb-0"],["data-test-id","createB2CAccountSuccess.pageDescription"],["styleClass","ppg-form-card","data-test-id","createB2CAccountSuccess.accountDetailsCard",3,"header"],["data-test-id","createB2CAccountSuccess.accountDetailsDescription",1,"pb-4"],["data-test-id","createB2CAccountSuccess.userAccountNameLabel"],["data-test-id","createB2CAccountSuccess.userAccountName",1,"font-bold","mb-2"],["data-test-id","createB2CAccountSuccess.userAccountEmailLabel"],["data-test-id","createB2CAccountSuccess.userAccountEmail",1,"font-bold"],[4,"ppgHideOnMobileAppView"],["type","button","size","large","styleClass","w-full mt-4 font-bold","iconPos","right","data-test-id","createB2CAccountSuccess.buttonGoToSignIn",3,"click","label"]],template:function(i,o){i&1&&(a(0,"div",0),d(1,Ei,20,9,"div",1),n()),i&2&&(r(),m("translocoRead","B2C_CUSTOMER.SUCCESS_REGISTERED_SCREEN"))},dependencies:[W,fe,q,gt],styles:[".icon-circle-success[_ngcontent-%COMP%]{fill:var(--p-pds-on-surface-success-medium);width:2.5rem;height:2.5rem}"]})}}return t})();var y=(function(t){return t.Default="default",t.Loading="loading",t.Success="success",t.Error="error",t.AllAttemptsUsed="all-attempts-used",t})(y||{});var K=(function(t){return t.TooManyAttempts="too-many-attempts",t.NotCorrect="not-correct",t})(K||{});var xi=t=>({url:t});function Ti(t,l){if(t&1&&(a(0,"p-message",14),p(1),n()),t&2){let e=c().$implicit;r(),C(" ",e("SENDING_NEW_CODE_MESSAGE")," ")}}function Ai(t,l){if(t&1&&(a(0,"p-message",15),p(1),n()),t&2){let e=c().$implicit;r(),B(e("SENT_CHECK_YOUR_INBOX_MESSAGE"))}}function yi(t,l){if(t&1&&(a(0,"p-message",16),p(1),n()),t&2){let e=c().$implicit;r(),B(e("FAILED_PLEASE_TRY_AGAIN_FAILED_MESSAGE"))}}function bi(t,l){if(t&1&&(a(0,"p-message",17),h(1,"span",18),n()),t&2){let e=c().$implicit,i=c();r(),m("innerHTML",e("ALL_ATTEMPTS_USED_MESSAGE",F(1,xi,i.contactUsUrl())),k)}}function Bi(t,l){if(t&1){let e=L();a(0,"section")(1,"div",1)(2,"h1",2),p(3),n(),a(4,"p",3),p(5),n(),a(6,"p",4)(7,"span",5),p(8,"*"),n(),p(9),G(10,"transloco"),n(),a(11,"p-card",6)(12,"p",7),p(13),a(14,"strong",8),p(15),n()(),a(16,"form",9)(17,"p-fluid")(18,"ppg-input-group",10)(19,"input",11),S("valueChange",function(o){f(e);let u=c();return _(u.securityCodeField.setValue(o))}),n()()(),a(20,"p-button",12),S("click",function(){f(e);let o=c();return _(o.submit())}),n(),a(21,"p-button",13),S("click",function(){f(e);let o=c();return _(o.resendCode())}),n(),a(22,"div"),d(23,Ti,2,1,"p-message",14)(24,Ai,2,1,"p-message",15)(25,yi,2,1,"p-message",16)(26,bi,2,3,"p-message",17),n()()()()()}if(t&2){let e,i=l.$implicit,o=c();r(3),B(i("VERIFY_EMAIL_TITLE")),r(2),C(" ",i("VERIFY_EMAIL_DESCRIPTION")," "),r(4),C(" ",H(10,16,"B2C_CUSTOMER.REQUIRED_FIELDS"),""),r(2),V("header",i("TITLE")),r(2),C(" ",i("DESCRIPTION"),"\xA0"),r(2),B(o.currentEmail()),r(),m("formGroup",o.securityCodeForm),r(2),V("label",i("CODE_INPUT_LABEL")),m("required",!0)("displaySuffix",!0),r(),m("ppgValidator",o.securityCodeField)("fieldType",o.ERROR_FIELD_TYPE.SecurityCode),r(),V("label",i("SUBMIT_BUTTON_LABEL")),r(),V("label",i("EMAIL_ME_NEW_CODE_BUTTON_LABEL")),m("disabled",o.resendCodeStatus()===o.RESEND_CODE_STATUS.AllAttemptsUsed),r(2),E((e=o.resendCodeStatus())===o.RESEND_CODE_STATUS.Loading?23:e===o.RESEND_CODE_STATUS.Success?24:e===o.RESEND_CODE_STATUS.Error?25:e===o.RESEND_CODE_STATUS.AllAttemptsUsed?26:-1)}}var $t=(()=>{class t{unloadNotification(e){e.returnValue=!0}#e;#i;#t;#o;#a;#s;#c;#l;#r;#m;#p;#u;#n;constructor(){this.#e=s(ue),this.#i=s(R),this.#t=s(ye),this.#o=s(A),this.#a=s(I),this.#s=s(Ee),this.#c=s(Ot),this.#l=s(ye),this.#r=s($),this.#m=s(Et),this.triggerMoveNext=new X,this.contactUsUrl=Y(this.#i.contactUsUrl$),this.#p=te(this.#o.state?.b2CCustomerRegistrationModel?.email),this.currentEmail=this.#p.asReadonly(),this.#u=te(!1),this.#n=te(this.#o.state?.intermediateState?.isCodeGenerationLimitExceeded?y.AllAttemptsUsed:y.Default),this.resendCodeStatus=this.#n.asReadonly(),this.ERROR_FIELD_TYPE=he,this.RESEND_CODE_STATUS=y,this.securityCodeField=new T("",[g.required,P.notOnlyWhiteSpaces()]),this.securityCodeForm=this.#e.group({securityCode:this.securityCodeField}),this.#o.state$.pipe(Be(this.#t)).subscribe(e=>{this.registrationState=e.b2CCustomerRegistrationModel||{}})}
1moveNextAllowed(){return this.securityCodeField.updateValueAndValidity(),this.securityCodeField.valid}submit(){this.securityCodeField.markAsDirty(),this.#r.sendSubmitClickedGAEvent();let e=+this.securityCodeField.value;if(this.moveNextAllowed()){if(this.securityCodeField.value.length!==6||isNaN(e))return this.#r.sendInvalidSecurityCodeGAEvent(),this.securityCodeField.setErrors({[K.NotCorrect]:!0});this.#s.validateSecurityCode(e,this.#p()).pipe(b(1)).subscribe(i=>{switch(i.data.validateSecurityCode.statusCode){case v.Ok:this.#r.sendVerifyEmailGAEvent(),this.submitCustomerDetails();return;case v.Forbidden:return this.#u.set(!0),this.securityCodeField.setErrors({[K.TooManyAttempts]:!0});case v.BadRequest:default:return this.#r.sendInvalidSecurityCodeGAEvent(),this.securityCodeField.setErrors({[K.NotCorrect]:!0})}})}}submitCustomerDetails(){let e=this.#m.open(Dt,{header:ut("NOTIFICATION.SPINNER.CREATING_ACCOUNT_TITLE"),width:It.Medium,closable:!1}),i=this.#d(this.registrationState);this.#c.createB2CCustomer(i).pipe(Be(this.#l),we(()=>e.close())).subscribe(o=>{o.data?.createB2CCustomer?.statusCode==v.Created&&(this.registrationCompleted={userFirstName:this.registrationState.firstName,userLastName:this.registrationState.lastName,userEmail:this.registrationState.email},this.#o.setState({b2CCustomerRegistrationModel:this.registrationState,b2cRegistrationCompletedModel:this.registrationCompleted}))})}resendCode(){if(this.#r.sendResendCodeGAEvent(),this.#n()===y.AllAttemptsUsed)return;this.#u.set(!1),this.#n.set(y.Loading);let{firstName:e,lastName:i,email:o,language:u}=this.#o.state.b2CCustomerRegistrationModel;this.#s.generateAndSendSecurityCodeToEmail(this.#a.recaptchaToken,{firstName:e,lastName:i,email:o,language:u}).pipe(b(1)).subscribe(x=>{let{statusCode:j}=x.data.generateAndSendSecurityCodeToEmail;j===v.Created?this.#n.set(y.Success):this.#n.set(y.Error),Ne(3e3).pipe(b(1)).subscribe(()=>{j===v.BadRequest&&x.error?.message?.includes("Too many requests")?this.#n.set(y.AllAttemptsUsed):this.#n.set(y.Default)})})}#d(e){let i="marketingSubscriptionOptIn";return Q(z({},e),{marketingSubscriptionOptIn:!!e.acceptedTermsConsents.find(o=>o.toUpperCase()===i.toUpperCase())})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=N({type:t,selectors:[["ppg-b2c-verify-email"]],hostBindings:function(i,o){i&1&&S("beforeunload",function(x){return o.unloadNotification(x)},!1,ie)},outputs:{triggerMoveNext:"triggerMoveNext"},standalone:!1,decls:1,vars:1,consts:[[4,"transloco","translocoRead"],[1,"flex","justify-content-center","flex-column","lg:w-30rem","px-2"],["data-test-id","createB2CAccountStep2.verifyEmailTitle",1,"my-4","p-0"],["data-test-id","createB2CAccountStep2.verifyEmailDescription",1,"p-0","mt-0","mb-5"],[1,"p-0","mt-0","mb-4"],[1,"required"],["styleClass","ppg-form-card","data-test-id","createB2CAccountStep2.securityCodeCardWithTitle",3,"header"],["data-test-id","createB2CAccountStep2.securityCodeDescription",1,"mb-4","mt-0","p-0"],[1,"u-break-all"],[3,"formGroup"],["data-test-id","createB2CAccountStep2.securityCodeGroupWithLabel","labelFor","securityCode",3,"label","required","displaySuffix"],["type","text","pInputText","","data-test-id","createB2CAccountStep2.inputSecurityCode","id","securityCode","name","securityCode","formControlName","securityCode",3,"valueChange","ppgValidator","fieldType"],["id","submit","data-test-id","createB2CAccountStep2.buttonSubmit","name","submit","type","submit","styleClass","w-full mt-4 font-bold",3,"click","label"],["id","resend","styleClass","w-full mt-3 font-bold","data-test-id","createB2CAccountStep2.buttonResend","icon","pi pi-envelope","outlined","true","iconPos","left",3,"click","disabled","label"],["data-test-id","verifyEmailStep2.messageSengingNewCode","severity","info","icon","pi pi-clock","styleClass","w-full mt-2 inline-flex justify-content-start align-items-center border-none"],["data-test-id","verifyEmailStep2.messageSentCheckYourInbox","severity","success","icon","pi pi-check","styleClass","w-full mt-2 inline-flex justify-content-start align-items-center border-none"],["data-test-id","verifyEmailStep2.messageFailedTryAgain","severity","error","icon","pi pi-times-circle","styleClass","w-full mt-2 inline-flex justify-content-start align-items-center border-none"],["data-test-id","verifyEmailStep2.messageAllAttemptsUsed","severity","error","icon","pi pi-times-circle","styleClass","w-full mt-2 inline-flex justify-content-start align-items-center border-none"],[3,"innerHTML"]],template:function(i,o){i&1&&d(0,Bi,27,18,"section",0),i&2&&m("translocoRead","B2C_CUSTOMER.VERIFY_EMAIL_ADDRESS")},dependencies:[le,ae,se,ce,me,pe,ve,W,fe,_e,q,Ce,Te,xe,de],encapsulation:2})}}return t})();var jt=[{icon:"account-circle-outline",header:"B2C_CUSTOMER.CREATE_USER_ACCOUNT_STEP.CREATE_USER_ACCOUNT_TITLE",description:"B2C_CUSTOMER.CREATE_USER_ACCOUNT_STEP.CREATE_USER_ACCOUNT_DESCRIPTION",stepName:"B2C_CUSTOMER.STEP_NAMES.CREATE_USER_ACCOUNT",component:Wt,showStepCancel:!1,showStepBack:!1,showStepNext:!0,useRecaptcha:!1,fullWidthContent:!1},{iconSource:"assets/images/verify_email.svg",header:"B2C_CUSTOMER.VERIFY_EMAIL_ADDRESS.VERIFY_EMAIL_TITLE",description:"B2C_CUSTOMER.VERIFY_EMAIL_ADDRESS.VERIFY_EMAIL_DESCRIPTION",stepName:"B2C_CUSTOMER.STEP_NAMES.VERIFY_EMAIL",component:$t,showStepCancel:!1,showStepNext:!1,showStepBack:!0,useRecaptcha:!1,fullWidthContent:!1}];function Ri(t,l){if(t&1&&h(0,"ppg-progress-stepper",0),t&2){let e=c();m("steps",e.steps)("labelHeader","B2C_CUSTOMER.STEPS_HEADER")("labelCancel","B2C_CUSTOMER.CANCEL")("labelBack","B2C_CUSTOMER.STEPPER_BUTTONS.BACK")("labelNext","B2C_CUSTOMER.STEPPER_BUTTONS.NEXT")("showStepperSteps",!1)("showButtonIcons",!1)}}function Ii(t,l){t&1&&h(0,"ppg-b2c-registration-success")}var Yt=(()=>{class t{#e;#i;#t;constructor(e){this.stateService=e,this.metaTagDescription="Create a b2c account with PPG Paints to simplify your paint-buying process. Fill out the form to get started!",this.steps=jt,this.#e=s(R),this.#i=s(tt),this.#t=s(mt),this.#e.b2CCustomerFeatureFlag$.pipe(b(1),Fe(i=>!i)).subscribe(()=>this.#t.logOut()),this.b2cCustomerRegistrationInProgress$=this.stateService.state$.pipe(Z(i=>!i?.b2cRegistrationCompletedModel?.userFirstName)),this.#i.addTags([{name:"description",content:this.metaTagDescription}])}static{this.\u0275fac=function(i){return new(i||t)(Ue(A))}}static{this.\u0275cmp=N({type:t,selectors:[["ppg-b2c-customer-form"]],standalone:!1,features:[ze([{provide:A,useFactory:()=>new A},{provide:I,useFactory:e=>new I(e),deps:[R]}])],decls:4,vars:3,consts:[["isFixedToTop","true",3,"steps","labelHeader","labelCancel","labelBack","labelNext","showStepperSteps","showButtonIcons"]],template:function(i,o){i&1&&(a(0,"div"),d(1,Ri,1,7,"ppg-progress-stepper",0),G(2,"async"),d(3,Ii,1,0,"ppg-b2c-registration-success"),n()),i&2&&(r(),E(H(2,1,o.b2cCustomerRegistrationInProgress$)?1:3))},dependencies:[Mt,qt,Ze],encapsulation:2})}}return t})();var Ni=[{path:"",component:Yt,canActivate:[pt]}],Kt=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=oe({type:t})}static{this.\u0275inj=ee({imports:[it.forChild(lt(Ni))]})}}return t})();var zt=()=>({onBeforeLoad(t){let{navigator:l}=s(Xe).defaultView,e=l.language||xt.en_US;return t.searchParams.set("hl",e),{url:t}}});var Xr=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=oe({type:t})}static{this.\u0275inj=ee({providers:[{provide:yt,useFactory:zt},R],imports:[et,Lt,Kt,Bt,Rt]})}}return t})();export{Xr as CreateB2CCustomerModule};
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.