1"use strict";(self["webpackChunklunchbox_storefront"]=self["webpackChunklunchbox_storefront"]||[]).push([[138],{34584:function(e,t,s){const o="Something went wrong. Please try again";t.A={methods:{getCustomerId(){return localStorage.getItem("customerId")},showToaster(e){this.$store.commit("SET_TOASTER",{show:!0,message:e})},handleExpiredSession(e,t){return 403==e?.response?.data?.status&&(this.showToaster("Your session has expired. Please log in again"),"function"===typeof t&&t(),!0)}}},s.d(t,["h",0,o])},76936:function(e,t,s){s.d(t,{A:function(){return d}});var o=s(56768),a=s(95187);function r(e,t,s,r,n,i){return(0,o.uX)(),(0,o.CE)("div",{class:"shimmer",style:(0,a.Tr)({height:s.height,width:s.width,margin:s.margin,display:"block"})},null,4)}var n={props:{height:{type:String,default:"30px"},width:{type:String,default:"350px"},margin:{type:String,default:"0px 0px 0px 0px"}}},i=s(71241);const l=(0,i.A)(n,[["render",r],["__scopeId","data-v-0f9a5f6c"]]);var d=l},78098:function(e,t,s){s.r(t),s.d(t,{default:function(){return Ce}});var o=s(56768),a=s(5688),r=s(95187);const n={class:"profileContent"},i={class:"profileTop"},l={key:0,class:"inputs"},d={class:"inputWrapper"},h={class:"inputWrapper"},c={class:"inputWrapper"},u={class:"inputWrapper"},p={class:"inputWrapper"},m={key:1,class:"inputs"},f={class:"inputWrapper"},g={key:0,class:"validation"},w={class:"inputWrapper"},I={key:0,class:"validation"},b={class:"inputWrapper"},v={key:0,class:"validation"},C={key:1,class:"inputWrapper"},P={key:0,class:"validation"},L={key:1,class:"validation","data-cy":"phone-validation-error"},k={class:"inputWrapper"},y=["disabled"],E={key:0,class:"validation"},_={key:2,class:"optIn"},T={key:0,class:"checkboxWrapper"},M={key:1,class:"checkboxWrapper"},A={key:2,class:"feedback error"},$={class:"profileBottom"},N=["disabled"],S={key:0,class:"loader buttonLoader"};function D(e,t,s,D,O,x){const V=(0,o.g2)("ChangePasswordModal"),Y=(0,o.g2)("DeleteAccountModal"),W=(0,o.g2)("ShimmerView"),X=(0,o.g2)("IntlTelInput");return(0,o.uX)(),(0,o.CE)("div",n,[(0,o.bF)(a.eB,{name:"fade"},{default:(0,o.k6)(()=>[O.changePasswordModalIsOpen?((0,o.uX)(),(0,o.Wv)(V,{key:0,onCloseModal:x.changePasswordClicked},null,8,["onCloseModal"])):(0,o.Q3)("",!0)]),_:1}),(0,o.bF)(a.eB,{name:"fade"},{default:(0,o.k6)(()=>[O.deleteAccountModalIsVisible?((0,o.uX)(),(0,o.Wv)(Y,{key:0,onCloseModal:x.toggleDeleteAccount},null,8,["onCloseModal"])):(0,o.Q3)("",!0)]),_:1}),(0,o.Lk)("div",i,[t[22]||(t[22]=(0,o.Lk)("h3",null,"Profile",-1)),(0,o.Lk)("a",{onClick:t[0]||(t[0]=(...e)=>x.changePasswordClicked&&x.changePasswordClicked(...e)),class:"changePassword",href:"javascript:;"},[...t[21]||(t[21]=[(0,o.Lk)("p",null,"CHANGE PASSWORD",-1)])])]),O.loading?((0,o.uX)(),(0,o.CE)("div",l,[(0,o.Lk)("div",d,[(0,o.bF)(W,{height:"16px",width:"200px"}),(0,o.bF)(W,{height:"44px",width:"100%"})]),(0,o.Lk)("div",h,[(0,o.bF)(W,{height:"16px",width:"200px"}),(0,o.bF)(W,{height:"44px",width:"100%"})]),(0,o.Lk)("div",c,[(0,o.bF)(W,{height:"16px",width:"200px"}),(0,o.bF)(W,{height:"44px",width:"100%"})]),(0,o.Lk)("div",u,[(0,o.bF)(W,{height:"16px",width:"200px"}),(0,o.bF)(W,{height:"44px",width:"100%"})]),(0,o.Lk)("div",p,[(0,o.bF)(W,{height:"16px",width:"200px"}),(0,o.bF)(W,{height:"44px",width:"100%"})])])):(0,o.Q3)("",!0),O.customerInfo&&e.customerData&&!O.loading?((0,o.uX)(),(0,o.CE)("div",m,[(0,o.Lk)("div",f,[t[23]||(t[23]=(0,o.Lk)("label",{for:"firstName"},"First Name",-1)),(0,o.bo)((0,o.Lk)("input",{onKeyup:t[1]||(t[1]=(0,a.jR)((...e)=>x.saveChanges&&x.saveChanges(...e),["enter"])),"onUpdate:modelValue":t[2]||(t[2]=e=>O.customerInfo.first_name=e),onInput:t[3]||(t[3]=t=>e.formatNameWhileTyping(O.customerInfo.first_name)),type:"text",placeholder:"First Name",id:"firstName"},null,544),[[a.Jo,O.customerInfo.first_name]]),!0===D.v$.customerInfo.first_name.$error?((0,o.uX)(),(0,o.CE)("p",g,"Please enter your first name")):(0,o.Q3)("",!0)]),(0,o.Lk)("div",w,[t[24]||(t[24]=(0,o.Lk)("label",{for:"lastName"},"Last Name",-1)),(0,o.bo)((0,o.Lk)("input",{onKeyup:t[4]||(t[4]=(0,a.jR
1)((...e)=>x.saveChanges&&x.saveChanges(...e),["enter"])),"onUpdate:modelValue":t[5]||(t[5]=e=>O.customerInfo.last_name=e),onInput:t[6]||(t[6]=t=>e.formatLastNameWhileTyping(O.customerInfo.last_name)),type:"text",placeholder:"Last Name",id:"lastName"},null,544),[[a.Jo,O.customerInfo.last_name]]),!0===D.v$.customerInfo.last_name.$error?((0,o.uX)(),(0,o.CE)("p",I,"Please enter your last name")):(0,o.Q3)("",!0)]),(0,o.Lk)("div",b,[t[25]||(t[25]=(0,o.Lk)("label",{for:"email"},"Email",-1)),(0,o.bo)((0,o.Lk)("input",{onKeyup:t[7]||(t[7]=(0,a.jR)((...e)=>x.saveChanges&&x.saveChanges(...e),["enter"])),"onUpdate:modelValue":t[8]||(t[8]=e=>O.customerInfo.email=e),onInput:t[9]||(t[9]=t=>e.formatEmailWhileTyping(O.customerInfo.email)),type:"text",placeholder:"Email",id:"email"},null,544),[[a.Jo,O.customerInfo.email]]),D.v$.customerInfo.email.$error||!e.isValidEmail(O.customerInfo.email)?((0,o.uX)(),(0,o.CE)("p",v," Please enter a valid email address ")):(0,o.Q3)("",!0)]),D.enableInternationalPhoneInput?((0,o.uX)(),(0,o.Wv)(X,{key:0,ref:"intlPhoneInput",modelValue:O.customerInfo.phone,"onUpdate:modelValue":t[10]||(t[10]=e=>O.customerInfo.phone=e),id:"phone",label:"Phone Number",placeholder:"Phone Number","initial-country":x.initialPhoneCountry,"use-validation":!0,required:!0,onEnter:x.saveChanges,onCountryChange:x.handleCountryChange},null,8,["modelValue","initial-country","onEnter","onCountryChange"])):((0,o.uX)(),(0,o.CE)("div",C,[t[26]||(t[26]=(0,o.Lk)("label",{for:"phone"},"Phone Number",-1)),(0,o.bo)((0,o.Lk)("input",{onKeyup:t[11]||(t[11]=(0,a.jR)((...e)=>x.saveChanges&&x.saveChanges(...e),["enter"])),onInput:t[12]||(t[12]=t=>e.formatPhoneNumberWhileTyping(O.customerInfo.phone)),"onUpdate:modelValue":t[13]||(t[13]=e=>O.customerInfo.phone=e),type:"text",placeholder:"Phone Number",id:"phone"},null,544),[[a.Jo,O.customerInfo.phone]]),!0===D.v$.customerInfo.phone.$error?((0,o.uX)(),(0,o.CE)("p",P,"Please enter your cell phone number")):(0,o.Q3)("",!0),O.validPhoneNumberError?((0,o.uX)(),(0,o.CE)("p",L,(0,r.v_)(O.validPhoneNumberErrorMessage||"Please enter a valid phone number. Phone number can't start with 0 or 1"),1)):(0,o.Q3)("",!0)])),(0,o.Lk)("div",k,[t[27]||(t[27]=(0,o.Lk)("label",{for:"birthday"},"Birthday",-1)),(0,o.bo)((0,o.Lk)("input",{onKeyup:t[14]||(t[14]=(0,a.jR)((...e)=>x.saveChanges&&x.saveChanges(...e),["enter"])),"onUpdate:modelValue":t[15]||(t[15]=e=>O.customerInfo.birthdate=e),onInput:t[16]||(t[16]=(...e)=>x.formatBirthdateWhileTyping&&x.formatBirthdateWhileTyping(...e)),type:"text",placeholder:"mm/dd/yyyy",id:"birthday",disabled:e.customerData.birthdate},null,40,y),[[a.Jo,O.customerInfo.birthdate]]),O.birthdateError?((0,o.uX)(),(0,o.CE)("p",E,(0,r.v_)(O.birthdateError),1)):(0,o.Q3)("",!0)]),e.storeConfig?.email_optin||e.storeConfig?.sms_optin?((0,o.uX)(),(0,o.CE)("div",_,[e.storeConfig?.email_optin?((0,o.uX)(),(0,o.CE)("div",T,[(0,o.bo)((0,o.Lk)("input",{type:"checkbox",id:"emainOptin","onUpdate:modelValue":t[17]||(t[17]=e=>O.customerInfo.optin=e)},null,512),[[a.lH,O.customerInfo.optin]]),t[28]||(t[28]=(0,o.Lk)("label",{class:"checkboxLabel",for:"emainOptin"},"I want to receive email updates and promotions.",-1))])):(0,o.Q3)("",!0),e.storeConfig?.sms_optin?((0,o.uX)(),(0,o.CE)("div",M,[(0,o.bo)((0,o.Lk)("input",{type:"checkbox",id:"smsOptin","onUpdate:modelValue":t[18]||(t[18]=e=>O.customerInfo.sms_optin=e)},null,512),[[a.lH,O.customerInfo.sms_optin]]),t[29]||(t[29]=(0,o.Lk)("label",{class:"checkboxLabel",for:"smsOptin"},"By checking this box, you agree to receive promotional text messages about special offers, new menu items, and updates. You'll receive approximately 2-4 messages per month. Reply STOP to opt-out anytime. Message and data rates may apply.",-1))])):(0,o.Q3)("",!0)])):(0,o.Q3)("",!0)])):(0,o.Q3)("",!0),O.errorMessage?((0,o.uX)(),(0,o.CE)("p",A,(0,r.v_)(O.errorMessage),1)):(0,o.Q3)("",!0),(0,o.Lk)("div",$,[(0,o.Lk)("button",{onClick:t[19]||(t[19]=(...e)=>x.saveChanges&&x.saveChanges(...e)),disabled:e.buttonLoader,class:"saveButton"},[e.buttonLoader?((0,o.uX)(),(0,o.CE)("div",S)):(0,o.Q3)("",!0),e.buttonLoader?(0,o.Q3)("",!0):((0,o.uX)(),(0,o.CE)(o.FK,{key:1},[(0,o.eW)("SAVE CHANGES")],64))],8,N),(0,o.Lk)("a",{onClick:t[20]||(t[20]=(...e)=>x.toggleDeleteAccount&&x.toggleDeleteAccount(...e)),class:"deleteAccount",href:"javascript:;"},[...t[30]||(t[30]=[(0,o.Lk)("p",null,"DELETE ACCOUNT",-1)])])])])}s(44114);const O={class:"modalWrapper"},x={class:"inputWrapper"},V=["type"],Y={key:0,class:"validation"},W={key:1,class:"validation"},X=["src"],B={class:"inputWrapper"},U=["type"],R={key:0,class:"validation"},Q={key:1,class:"validation"},F={key:2,class:"validation"},K=["src"],q={key:0,class:"feedback error"},j=["disabled"],H={key:0,class:"loader buttonLoader"};function G(e,t,s,n,i,l){const d=(0,o.g2)("PasswordValidator");return(0,o.uX)(),(0,o.CE)("div",{onClick:t[8]||(t[8]=(0,a.D$)((...e)=>l.closeModal&&l.closeModal(...e),["self"])),class:"modalContainer"},[(0,o.Lk)("div",O,[(0,o.Lk)("div",{onClick:t[0]||(t[0]=(...e)=>l.closeModal&&l.closeModal(...e)),class:"close"},[...t[9]||(t[9]=[(0,o.Lk)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[(0,o.Lk)("path",{d:"M8.1161 6.6228L7.75908 6.97635L8.11437 7.33163L13.4572 12.6745L12.6745 13.4572L11.8466 12.6294L11.8449 12.6277L7.37718 8.11608L7.02364 7.75906L6.66835 8.11435L1.32551 13.4572L0.542786 12.6745L5.88563 7.33163L6.24062 6.97664L5.8842 6.62309L0.543158
11.32514L1.32551 0.542787L6.66835 5.88563L7.02334 6.24061L7.37689 5.88419L12.6748 0.543155L13.4572 1.32551L12.6294 2.15333L12.6277 2.15504L8.1161 6.6228ZM12.7648 13.5475C12.7649 13.5476 12.765 13.5478 12.7651 13.5479L12.7648 13.5475ZM0.452113 12.7651L0.452145 12.7651C0.452134 12.7651 0.452123 12.7651 0.452113 12.7651Z",fill:"black",stroke:"black"})],-1)])]),t[12]||(t[12]=(0,o.Lk)("h2",null,"Change Password",-1)),(0,o.Lk)("div",x,[t[10]||(t[10]=(0,o.Lk)("label",{for:"newPassword"},"New Password",-1)),(0,o.bo)((0,o.Lk)("input",{onKeyup:t[1]||(t[1]=(0,a.jR)((...e)=>l.changePassword&&l.changePassword(...e),["enter"])),"onUpdate:modelValue":t[2]||(t[2]=e=>i.newPassword=e),type:i.newPass.passwordInputType,placeholder:"New Password",id:"newPassword",class:"rr-mask"},null,40,V),[[a.hp,i.newPassword]]),0!=n.v$.newPassword.$errors.length&&"required"==n.v$.newPassword.$errors[0].$validator?((0,o.uX)(),(0,o.CE)("p",Y," Please enter your new password ")):(0,o.Q3)("",!0),!1===i.newPasswordIsValid?((0,o.uX)(),(0,o.CE)("p",W,"Please enter a valid password")):(0,o.Q3)("",!0),(0,o.Lk)("a",{onClick:t[3]||(t[3]=e=>l.togglePassword("new")),class:"passwordToggle",href:"#"},[(0,o.Lk)("img",{src:i.newPass.passwordIconPath,alt:"password"},null,8,X)]),(0,o.bF)(d,{password:i.newPassword,onValid:l.checkIfNewPasswordValid,style:{display:"none"}},null,8,["password","onValid"])]),(0,o.Lk)("div",B,[t[11]||(t[11]=(0,o.Lk)("label",{for:"confirm"},"Confirm New Password",-1)),(0,o.bo)((0,o.Lk)("input",{onKeyup:t[4]||(t[4]=(0,a.jR
1)((...e)=>l.changePassword&&l.changePassword(...e),["enter"])),"onUpdate:modelValue":t[5]||(t[5]=e=>i.confirmNewPassword=e),type:i.confirmPassword.passwordInputType,placeholder:"Confirm New Password",id:"confirm",class:"rr-mask"},null,40,U),[[a.hp,i.confirmNewPassword]]),0!=n.v$.confirmNewPassword.$errors.length&&"required"==n.v$.confirmNewPassword.$errors[0].$validator?((0,o.uX)(),(0,o.CE)("p",R," Please confirm new password ")):(0,o.Q3)("",!0),0!=n.v$.confirmNewPassword.$errors.length&&"sameAs"==n.v$.confirmNewPassword.$errors[0].$validator?((0,o.uX)(),(0,o.CE)("p",Q," Passwords do not match ")):(0,o.Q3)("",!0),!1===i.confirmPasswordIsValid?((0,o.uX)(),(0,o.CE)("p",F,"Please enter a valid password")):(0,o.Q3)("",!0),(0,o.Lk)("a",{onClick:t[6]||(t[6]=e=>l.togglePassword("confirm")),class:"passwordToggle",href:"#"},[(0,o.Lk)("img",{src:i.confirmPassword.passwordIconPath,alt:"password"},null,8,K)]),(0,o.bF)(d,{password:i.confirmNewPassword,onValid:l.checkIfConfirmPasswordValid},null,8,["password","onValid"])]),i.errorMessage?((0,o.uX)(),(0,o.CE)("p",q,(0,r.v_)(i.errorMessage),1)):(0,o.Q3)("",!0),(0,o.Lk)("button",{onClick:t[7]||(t[7]=(...e)=>l.changePassword&&l.changePassword(...e)),disabled:i.changePasswordLoading},[i.changePasswordLoading?((0,o.uX)(),(0,o.CE)("div",H)):(0,o.Q3)("",!0),i.changePasswordLoading?(0,o.Q3)("",!0):((0,o.uX)(),(0,o.CE)(o.FK,{key:1},[(0,o.eW)("UPDATE PASSWORD")],64))],8,j)])])}var Z=s(17760),J=s(99428),z=s(60782),ee=s(10957),te=s(34584),se=s(18325),oe=s(29980),ae={setup(){return{v$:(0,Z.Ay)()}},data(){return{newPassword:"",confirmNewPassword:"",newPass:{passwordInputType:"password",passwordIconPath:s(20175)},confirmPassword:{passwordInputType:"password",passwordIconPath:s(20175)},errorMessage:"",changePasswordLoading:!1,newPasswordIsValid:null,confirmPasswordIsValid:null}},validations(){return{newPassword:{required:J.mw,minLength:(0,J.Bp)(6)},confirmNewPassword:{required:J.mw,sameAs:(0,J.f4)(this.newPassword),minLength:(0,J.Bp)(6)}}},mixins:[ee.A,te.A],computed:{...(0,z.aH)(["userEmail","branding","cookies"])},methods:{...(0,z.PY)(["SET_COOKIES"]),closeModal(){this.$emit("closeModal")},checkIfNewPasswordValid(e){this.newPasswordIsValid=e},checkIfConfirmPasswordValid(e){this.confirmPasswordIsValid=e},changePassword(){if(this.v$.$touch(),this.v$.$error||null===this.newPasswordIsValid||!1===this.newPasswordIsValid||null===this.confirmPasswordIsValid||!1===this.confirmPasswordIsValid)return;this.changePasswordLoading=!0,this.errorMessage="";let e={customer_id:this.getCustomerId(),new_password:this.newPassword,reset:!1};se.A.changePassword(e).then(e=>{this.SET_COOKIES(e.data.cookies),this.login()}).catch(()=>{this.changePasswordLoading=!1,this.errorMessage=te.h})},login(){let e={username:this.userEmail,password:this.newPassword};se.A.login(e).then(e=>{localStorage.setItem("customerId",e.data.data.customer_id),localStorage.setItem("auth","Basic "+e.data.data.auth_cookie),this.SET_COOKIES(e.data.cookies),this.changePasswordLoading=!1,this.showToaster("Password changed successfully"),this.closeModal()}).catch(()=>{this.changePasswordLoading=!1,this.errorMessage=te.h})},togglePassword(e){"new"==e?"password"==this.newPass.passwordInputType?(this.newPass.passwordInputType="text",this.newPass.passwordIconPath=s(92284)):(this.newPass.passwordInputType="password",this.newPass.passwordIconPath=s(20175)):"password"==this.confirmPassword.passwordInputType?(this.confirmPassword.passwordInputType="text",this.confirmPassword.passwordIconPath=s(92284)):(this.confirmPassword.passwordInputType="password",this.confirmPassword.passwordIconPath=s(20175))}},mounted(){this.$nextTick(()=>{document.getElementById("newPassword").focus()})},components:{PasswordValidator:oe.A}},re=s(71241);const ne=(0,re.A)(ae,[["render",G],["__scopeId","data-v-296e9cec"]]);var ie=ne;function le(e,t,s,a,r,n){const i=(0,o.g2)("ConfirmDeleteModal");return(0,o.uX)(),(0,o.Wv)(i,{title:"Delete Account",confirmLabel:"DELETE ACCOUNT",errorMessage:r.errorMessage,onClose:n.closeModal,onConfirm:n.deleteAccount},{default:(0,o.k6)(()=>[...t[0]||(t[0]=[(0,o.Lk)("div",{class:"textWrapper"},[(0,o.Lk)("h4",null,"Deleting your account will do the following:"),(0,o.Lk)("p",null,"- Log you out on all devices"),(0,o.Lk)("p",null,"- Delete all of your account information")],-1)])]),_:1},8,["errorMessage","onClose","onConfirm"])}var de=s(37746),he={data(){return{errorMessage:""}},components:{ConfirmDeleteModal:de.A},mixins:[te.A],computed:{...(0,z.aH)(["customerData"])},methods:{...(0,z.PY)(["SET_LOGGED_IN","SET_BUTTON_LOADER","SET_COOKIES"]),closeModal(){this.$emit("closeModal")},deleteAccount(){this.errorMessage="",this.SET_BUTTON_LOADER(!0),se.A.deleteCustomer(this.customerData.customer_id).then(e=>{this.SET_LOGGED_IN(!1),localStorage.removeItem("customerId"),this.SET_BUTTON_LOADER(!1),this.SET_COOKIES(e.data.cookies),this.$router.push("/")}
1).catch(()=>{this.SET_BUTTON_LOADER(!1),this.errorMessage=te.h})}}};const ce=(0,re.A)(he,[["render",le],["__scopeId","data-v-519ec105"]]);var ue=ce,pe=s(76936),me=s(44618),fe=s(79281),ge=s(49148),we=s.n(ge),Ie=s(94117),be={setup(){const e=(0,Ie._P)("enable_international_phone_input",{fallback:!1});return{v$:(0,Z.Ay)(),enableInternationalPhoneInput:e}},data(){return{customerInfo:null,changePasswordModalIsOpen:!1,deleteAccountModalIsVisible:!1,loading:!0,errorMessage:"",validPhoneNumberError:!1,validPhoneNumberErrorMessage:"",birthdateError:null,phoneCountryCode:null}},validations(){return{customerInfo:{first_name:{required:J.mw},last_name:{required:J.mw},phone:{required:J.mw},email:{required:J.mw,email:J.Rp},birthdate:this.customerInfo&&this.customerInfo.birthdate?{required:J.mw,birthdateValid:this.validateBirthdate}:{}}}},mixins:[fe.A,te.A],computed:{...(0,z.aH)(["buttonLoader","customerData","branding","cookies","storeConfig"]),initialPhoneCountry(){return this.enableInternationalPhoneInput?this.phoneCountryCode?this.phoneCountryCode.toLowerCase():this.storeConfig?.country_code?this.storeConfig.country_code.toLowerCase():"us":"us"}},watch:{customerData(){this.getCustomerInfo()},"customerInfo.phone"(e){!this.customerInfo||e&&0!==e.replace(/[^\d]/g,"").length||(this.validPhoneNumberError=!1,this.validPhoneNumberErrorMessage="",this.v$&&this.v$.customerInfo&&this.v$.customerInfo.phone&&this.v$.customerInfo.phone.$reset())}},components:{ChangePasswordModal:ie,DeleteAccountModal:ue,ShimmerView:pe.A,IntlTelInput:me.A},methods:{...(0,z.PY)(["SET_BUTTON_LOADER","SET_USER_EMAIL","SET_CUSTOMER_DATA","SET_COOKIES"]),getCustomerInfo(){this.loading=!0,se.A.getCustomerInfo().then(e=>{if(this.loading=!1,this.customerInfo=e.data.data,this.customerInfo.country_code&&(this.phoneCountryCode=this.customerInfo.country_code),this.enableInternationalPhoneInput){const t=e.data.data.phone_country_code||"",s=t.replace(/\D/g,"");s&&this.customerInfo.phone&&(this.customerInfo.phone=`+${s}${this.customerInfo.phone}`),this.$nextTick(()=>{this.customerInfo.country_code&&this.$refs.intlPhoneInput&&this.$refs.intlPhoneInput.setCountry(this.customerInfo.country_code)})}else{let t=this.customerInfo.phone||"";if(e.data.data.phone_country_code&&t){const s=e.data.data.phone_country_code.replace(/\D/g,"");t.startsWith(s)&&(t=t.substring(s.length)),t.startsWith("+"+s)&&(t=t.substring(1+s.length))}t=t.replace(/\D/g,""),this.customerInfo.phone=this.formatPhoneNumber(t)||t}if(this.customerInfo.birthdate){let e=this.customerInfo.birthdate.split("-");this.customerInfo.birthdate=`${e[1]}/${e[2]}/${e[0]}`}this.SET_USER_EMAIL(this.customerInfo.email),localStorage.setItem("userEmail",this.customerInfo.email),this.SET_COOKIES(e.data.cookies)}).catch(e=>{this.loading=!1,this.handleExpiredSession(e,()=>this.$router.push("/"))})},formatBirthdateWhileTyping(e){let t=e.target.value;t=t.replace(/[^0-9/]/g,""),"deleteContentBackward"!==e.inputType&&"deleteContentForward"!==e.inputType?(t.length>2&&"/"!==t[2]&&(t=t.slice(0,2)+"/"+t.slice(2)),t.length>5&&"/"!==t[5]&&(t=t.slice(0,5)+"/"+t.slice(5)),t.length>10&&(t=t.slice(0,10)),this.customerInfo.birthdate=t):this.customerInfo.birthdate=t},changePasswordClicked(){this.changePasswordModalIsOpen=!this.changePasswordModalIsOpen},toggleDeleteAccount(){this.deleteAccountModalIsVisible=!this.deleteAccountModalIsVisible},saveChanges(){if(this.v$.$touch(),this.v$.$error)return;if(!this.isValidEmail(this.customerInfo.email))return void(this.errorMessage="Please enter a valid email address");if(this.enableInternationalPhoneInput){const e=this.$refs.intlPhoneInput;if(e&&"function"===typeof e.setTouched&&e.setTouched(!0),!e||!e.validate(!0,!0))return;const t=e.getSelectedCountryData();t&&t.iso2&&(this.phoneCountryCode=t.iso2.toUpperCase()),this.validPhoneNumberError=!1}else{if(this.v$.customerInfo.phone.$error)return;if(!this.customerInfo.phone||""===this.customerInfo.phone.trim())return void this.v$.customerInfo.phone.$touch();if(!this.isValidPhoneNumber(this.customerInfo.phone))return this.validPhoneNumberError=!0,void(this.validPhoneNumberErrorMessage="Please enter a valid phone number. Phone number can't start with 0 or 1");if(this.validPhoneNumberError=!1,this.validPhoneNumberErrorMessage="",this.customerInfo.phone.length>0&&this.customerInfo.phone.length<14)return this.validPhoneNumberError=!0,void(this.validPhoneNumberErrorMessage="Please enter a valid phone number");this.phoneCountryCode=null}if(this.errorMessage="",this.SET_BUTTON_LOADER(!0),this.customerInfo.birthdate&&this.customerInfo.birthdate.length>0&&!we()(this.customerInfo.birthdate,"MM/DD/YYYY",!0).isValid())return this.errorMessage="Birthday must be in MM/DD/YYYY format",void this.SET_BUTTON_LOADER(!1);let e=we()().format("YYYY-MM-DD");if(this.customerInfo.birthdate&&this.customerInfo.birthdate.length>0&&we()(this.customerInfo.birthdate,"MM/DD/YYYY").isAfter(e,"YYYY-MM-DD"))return this.errorMessage="Please enter a valid birthdate",void this.SET_BUTTON_LOADER(!1);let t=we()().subtract(13,"years").format("YYYY-MM-DD");if(this.customerInfo.birthdate&&this.customerInfo.birthdate.length>0&&we()(this.customerInfo.birthdate,"MM/DD/YYYY").isAfter(t,"YYYY-MM-DD"))return this.errorMessage="You must be at least 13 years old",void this.SET_BUTTON_LOADER(!1);let s="";if(this.customerInfo.birthdate){let e=this.customerInfo.birthdate.split("/");s=`${e[2]}-${e[0]}-${e[1]}`}let o="";if(this.enableInternationalPhoneInput){const e=this.$refs.intlPhoneInput;if(e&&"function"===typeof e.getNationalNumber)o=e.getNationalNumber();else{o=this.customerInfo.phone.replace(/\D/g,"");const t=e?.getSelectedCountryData();t&&t.dialCode&&o.startsWith(t.dialCode)&&(o=o.substring(t.dialCode.length))}}else o=this.customerInfo.phone.replace(/\D/g,"");let a=this.getCustomerId(),r={email:this.customerInfo.email,first_name:this.customerInfo.first_name,last_name:this.customerInfo.last_name,phone:o,birthdate:s,email_optin:!!this.storeConfig.email_optin&&this.customerInfo.optin,sms_optin:!!this.storeConfig.sms_optin&&this.customerInfo.sms_optin};this.enableInternationalPhoneInput&&this.phoneCountryCode&&(r.country_code=this.phoneCountryCode),this.customerData.birthdate&&delete r.birthdate,null===r.email_optin&&(r.email_optin=!1),null===r.sms_optin&&(r.sms_optin=!1),se.A.updateCustomer(r,a).then(e=>{this.SET_CUSTOMER_DATA(e.data.data),this.SET_BUTTON_LOADER(!1),this.SET_COOKIES(e.data.cookies),e.data.data.is_phone_verified||this.$emit("openVerifyPhoneModal"),this.showToaster("Changes saved")}
1).catch(e=>{console.log(e),this.handleExpiredSession(e,()=>this.$emit("logout")),this.SET_BUTTON_LOADER(!1),this.errorMessage=e?.response?.data?.data?.error||te.h})},validateBirthdate(e){const t=new Date(e),s=t.getFullYear();return s<1900?(this.birthdateError="Please enter a valid date of birth. Birthdays before 1900 are not accepted.",!1):(this.birthdateError=null,!0)},handleCountryChange(e){e&&e.iso2?this.phoneCountryCode=e.iso2.toUpperCase():this.phoneCountryCode=null}},created(){this.getCustomerInfo()}};const ve=(0,re.A)(be,[["render",D],["__scopeId","data-v-21244e28"]]);var Ce=ve},37746:function(e,t,s){s.d(t,{A:function(){return g}});var o=s(56768),a=s(5688),r=s(95187);const n={ref:"modalWrapper",class:"modalWrapper"},i={key:0,class:"feedback error"},l=["disabled"],d={key:0,class:"loader buttonLoader"};function h(e,t,s,h,c,u){return(0,o.uX)(),(0,o.CE)("div",{onClick:t[2]||(t[2]=(0,a.D$)((...e)=>u.closeModal&&u.closeModal(...e),["self"])),class:"modalContainer"},[(0,o.Lk)("div",n,[(0,o.Lk)("div",{onClick:t[0]||(t[0]=(...e)=>u.closeModal&&u.closeModal(...e)),class:"close"},[...t[3]||(t[3]=[(0,o.Lk)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[(0,o.Lk)("path",{d:"M8.1161 6.6228L7.75908 6.97635L8.11437 7.33163L13.4572 12.6745L12.6745 13.4572L11.8466 12.6294L11.8449 12.6277L7.37718 8.11608L7.02364 7.75906L6.66835 8.11435L1.32551 13.4572L0.542786 12.6745L5.88563 7.33163L6.24062 6.97664L5.8842 6.62309L0.543158 1.32514L1.32551 0.542787L6.66835 5.88563L7.02334 6.24061L7.37689 5.88419L12.6748 0.543155L13.4572 1.32551L12.6294 2.15333L12.6277 2.15504L8.1161 6.6228ZM12.7648 13.5475C12.7649 13.5476 12.765 13.5478 12.7651 13.5479L12.7648 13.5475ZM0.452113 12.7651L0.452145 12.7651C0.452134 12.7651 0.452123 12.7651 0.452113 12.7651Z",fill:"black",stroke:"black"})],-1)])]),(0,o.Lk)("h2",null,(0,r.v_)(s.title),1),(0,o.RG)(e.$slots,"default",{},void 0,!0),s.errorMessage?((0,o.uX)(),(0,o.CE)("p",i,(0,r.v_)(s.errorMessage),1)):(0,o.Q3)("",!0),(0,o.Lk)("button",{onClick:t[1]||(t[1]=t=>e.$emit("confirm")),disabled:e.buttonLoader},[e.buttonLoader?((0,o.uX)(),(0,o.CE)("div",d)):(0,o.Q3)("",!0),e.buttonLoader?(0,o.Q3)("",!0):((0,o.uX)(),(0,o.CE)(o.FK,{key:1},[(0,o.eW)((0,r.v_)(s.confirmLabel),1)],64))],8,l)],512)])}var c=s(60782),u=s(10957),p={props:{title:{type:String,required:!0},confirmLabel:{type:String,required:!0},errorMessage:{type:String,default:""}},emits:["close","confirm"],mixins:[u.A],computed:{...(0,c.aH)(["buttonLoader"])},methods:{closeModal(){this.$emit("close")}}},m=s(71241);const f=(0,m.A)(p,[["render",h],["__scopeId","data-v-300ec205"]]);var g=f}}]); 2//# sourceMappingURL=profile.d5da8ade.js.map
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.