File manager - Edit - /usr/local/cpanel/base/frontend/jupiter/account-preferences/main.77cd45ddb2049f4b.js
Back
"use strict";(self.webpackChunkaccount_preferences=self.webpackChunkaccount_preferences||[]).push([[792],{1366:(S,G,c)=>{var T=c(345),o=c(5737),g=c(6381),v=c(7410),x=function(n){return n.ChangeLanguage="change_language",n.ChangePassword="change_password",n.ConsentPrivacy="consent_privacy",n.ContactInformation="contact_information",n.ContactPreferences="contact_preferences",n.PushNotifications="push_notifications",n.SystemNotifications="system_notifications",n}(x||{}),t=c(3953);class p{}var h=c(177),k=c(1413),F=c(6977),C=c(6697),b=c(980),a=c(9417),I=c(6354),f=c(3280),u=c(6802),D=c(2584),w=c(3658);let V=(()=>{class n{constructor(e){this.http=e}get(){return this.http.post(new f.V({namespace:"Personalization",method:"get",arguments:[new u.e("names",["common-alertList"])],config:{json:!0}})).pipe((0,I.T)(e=>{const s=e.data.personalization["common-alertList"];return s.success=(0,D.G)(s.success),s.value=JSON.parse(s.value),e}))}set(e){return this.http.post(new f.V({namespace:"Personalization",method:"set",arguments:[new u.e("personalization",e)],config:{json:!0}})).pipe((0,I.T)(s=>s))}static#t=this.\u0275fac=function(s){return new(s||n)(t.KVO(w.dF))};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),X=(()=>{class n{constructor(e,s,i,r,l){this.locale=e,this.analyticsBuilder=s,this.personalizationService=i,this.page=r,this.el=l,this.notificationEvent=new t.bkB,this.createBtn={id:"saveConsentBtn",type:"submit",buttonState:o.w.enabled},this.stop$=new k.B}ngOnInit(){this.consentAndPrivacyForm=this.analyticsBuilder.group({analyticsCheckControl:[this.getAnalyticsConsent(this.page?.analytics_info?.analytics)]}),this.consentAndPrivacyForm.valueChanges.pipe((0,F.Q)(this.stop$)).subscribe(()=>{this.createBtn.buttonState=this.consentAndPrivacyForm.valid?o.w.enabled:o.w.disabled})}getAnalyticsConsent(e){return"on"===e}saveAnalyticsPreferences(){this.createBtn.buttonState=o.w.loading;const e={analytics:this.consentAndPrivacyForm.controls.analyticsCheckControl.value?"on":"off"};this.personalizationService.set(e).pipe((0,C.s)(1),(0,b.j)(()=>this.createBtn.buttonState=o.w.enabled)).subscribe({next:s=>{if(JSON.parse(s?.data?.personalization.analytics?.success)){"on"==e?.analytics?this.triggerConsentSavedEvent(!0):this.triggerConsentSavedEvent(),this.position=JSON.parse(this.page?.systemNotification||null)?.position;const r=this.locale.maketext("Successfully updated the Consent and Privacy Preferences.");this.notificationEvent.emit({notificationMessage:r,notificationType:o._n.success})}else this.handleError()},error:s=>this.handleError()})}handleError(){const e=this.locale.maketext("Unable to update the Consent and Privacy Preferences.");this.notificationEvent.emit({notificationMessage:e,notificationType:o._n.error})}triggerConsentSavedEvent(e=!1){const s=new CustomEvent("consentPrivacySaved",{bubbles:!0,detail:{analytics:e}});this.el.nativeElement.dispatchEvent(s)}ngOnDestroy(){this.stop$?.next(),this.stop$?.complete()}static#t=this.\u0275fac=function(s){return new(s||n)(t.rXU(g.h),t.rXU(a.ze),t.rXU(V),t.rXU(p),t.rXU(t.aKT))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-acct-pref-consent-privacy"]],outputs:{notificationEvent:"notificationEvent"},features:[t.Jv_([o.JE])],decls:14,vars:8,consts:[[1,"mb-5"],["id","consentAndPrivacyForm","name","consentAndPrivacyForm",3,"ngSubmit","formGroup"],[1,"card","h-100"],[1,"card-body"],[1,"d-flex","justify-content-start","align-items-end"],[1,"ri-xl","ri-bar-chart-grouped-line","me-2"],[1,"card-title"],["data-testid","analyticsPageDescription",3,"innerHTML"],[1,"form-check","mb-4"],["data-testid","analyticsCheckbox","type","checkbox","formControlName","analyticsCheckControl","name","analyticsCheck","id","analyticsCheck",1,"form-check-input"],["for","analyticsCheck","data-testid","analyticsCheckboxLabel",3,"innerHTML"],["data-testid","analyticsSaveBtn",1,"mt-4",3,"id","type","buttonState"]],template:function(s,i){1&s&&(t.j41(0,"div",0)(1,"form",1),t.bIt("ngSubmit",function(){return i.saveAnalyticsPreferences()}),t.j41(2,"div",2)(3,"div",3)(4,"div",4),t.nrm(5,"i",5),t.j41(6,"h5",6),t.EFF(7),t.k0s()(),t.nrm(8,"p",7),t.j41(9,"div",8),t.nrm(10,"input",9)(11,"label",10),t.k0s(),t.j41(12,"cp-button",11),t.EFF(13),t.k0s()()()()()),2&s&&(t.R7$(),t.Y8G("formGroup",i.consentAndPrivacyForm),t.R7$(6),t.SpI(" ",i.locale.maketext("Consent and Privacy[comment,title]")," "),t.R7$(),t.Y8G("innerHTML",i.locale.maketext("WebPros International, LLC d.b.a cPanel is asking for your consent to participate in user activity tracking using third-party software for the purpose of understanding the performance of Webpros products. Information will be used pursuant to the [output,url,_1,cPanel and WHM Privacy Policy,title,cPanel and WHM Privacy Policy,data-testid,_2,target,_3,class,_4] and may be shared internally within the Webpros group.","https://go.cpanel.net/privacy","privacy-policy","privacy-policy","external-link"),t.npT),t.R7$(3),t.Y8G("innerHTML",i.locale.maketext("Allow tracking: By checking this box, you agree that we may collect your usage statistics. [output,url,_1,Learn more here,title,cPanel Analytics Documentation,class,_2,target,_3,id,_4,data-testid,_5].","https://go.cpanel.net/analytics","external-link","analytics","learnLink","learnAnalyticsLink"),t.npT),t.R7$(),t.Y8G("id",i.createBtn.id)("type",i.createBtn.type)("buttonState",i.createBtn.buttonState),t.R7$(),t.JRh(i.locale.maketext("Save Changes")))},dependencies:[a.qT,a.Zm,a.BC,a.cb,a.j4,a.JD,o.Qp],styles:[".red-color[_ngcontent-%COMP%]{color:#dc3545}"]})}return n})();var E=c(6799);const O=n=>({"data-testid":"systemNotificationSelectInput",autocomplete:"off","aria-label":n});let W=(()=>{class n{constructor(e,s,i,r){this.analyticsBuilder=e,this.personalizationService=s,this.locale=i,this.page=r,this.notificationEvent=new t.bkB,this.notificationListPositions=Object.values(o.Rk).map(l=>({name:l,value:l})),this.createBtn={id:"saveSystemNotificationsBtn",type:"submit",buttonState:o.w.enabled},this.stop$=new k.B}ngOnInit(){const e=JSON.parse(this.page?.systemNotification||null)?.position||o.Rk.topRight;this.systemNotificationForm=this.analyticsBuilder.group({notificationTypesControl:[{name:e,value:e},[a.k0.required]]}),this.systemNotificationForm.valueChanges.pipe((0,F.Q)(this.stop$)).subscribe(()=>{this.createBtn.buttonState=this.systemNotificationForm.valid?o.w.enabled:o.w.disabled})}saveNotifications(){this.createBtn.buttonState=o.w.loading;const e={"common-alertList":JSON.stringify({position:this.systemNotificationForm.controls.notificationTypesControl?.value?.value})};this.personalizationService.set(e).pipe((0,C.s)(1),(0,b.j)(()=>this.createBtn.buttonState=o.w.enabled)).subscribe({next:s=>{const i=s?.data?.personalization["common-alertList"];if(this.position=JSON.parse(i?.value)?.position,i?.success){const r=this.locale.maketext("Successfully updated the system notification to \u201c[_1]\u201d.",this.position);this.page.systemNotification=JSON.stringify({position:this.systemNotificationForm.controls.notificationTypesControl?.value?.value}),this.notificationEvent.emit({notificationMessage:r,notificationType:o._n.success})}else this.handleError()},error:s=>this.handleError()})}handleError(){const e=this.locale.maketext("Unable to update the system notification to \u201c[_1]\u201d.",this.position);this.notificationEvent.emit({notificationMessage:e,notificationType:o._n.error})}ngOnDestroy(){this.stop$.next(),this.stop$.complete()}static#t=this.\u0275fac=function(s){return new(s||n)(t.rXU(a.ze),t.rXU(V),t.rXU(g.h),t.rXU(p))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-acct-pref-system-notifications"]],outputs:{notificationEvent:"notificationEvent"},decls:12,vars:12,consts:[["id","systemNotificationForm","name","systemNotificationForm",3,"ngSubmit","formGroup"],[1,"card","h-100"],[1,"card-body"],[1,"d-flex","justify-content-start","align-items-end"],[1,"ri-xl","ri-notification-line","me-2"],[1,"card-title"],["data-testid","systemNotificationPageDescription",3,"innerHTML"],[1,"mb-5"],["data-testid","systemNotificationSelect","formControlName","notificationTypesControl","bindLabel","name",3,"placeholder","items","inputAttrs"],["data-testid","systemNotificationSaveButton",1,"mt-2",3,"id","type","buttonState"]],template:function(s,i){1&s&&(t.j41(0,"form",0),t.bIt("ngSubmit",function(){return i.saveNotifications()}),t.j41(1,"div",1)(2,"div",2)(3,"div",3),t.nrm(4,"i",4),t.j41(5,"h5",5),t.EFF(6),t.k0s()(),t.nrm(7,"p",6),t.j41(8,"div",7),t.nrm(9,"ng-select",8),t.k0s(),t.j41(10,"cp-button",9),t.EFF(11),t.k0s()()()()),2&s&&(t.Y8G("formGroup",i.systemNotificationForm),t.R7$(6),t.SpI(" ",i.locale.maketext("System Notifications")," "),t.R7$(),t.Y8G("innerHTML",i.locale.maketext("System notifications show you errors, warnings, and success messages. Select the interface location in the dropdown to set where you want to see system notifications. For more information about system notifications, visit the [output,url,_1,documentation,title,documentation,class,_2,target,_3,id,_4,data-testid,_5].","https://docs.cpanel.net/cpanel/preferences/account-preferences/","external-link","notification","learnLink","learnNotificationLink"),t.npT),t.R7$(2),t.Y8G("placeholder",i.locale.maketext("Select notification type[comment,label]"))("items",i.notificationListPositions)("inputAttrs",t.eq3(10,O,i.locale.maketext("Select notification type[comment,label]"))),t.R7$(),t.Y8G("id",i.createBtn.id)("type",i.createBtn.type)("buttonState",i.createBtn.buttonState),t.R7$(),t.JRh(i.locale.maketext("Save Changes")))},dependencies:[a.qT,a.BC,a.cb,a.j4,a.JD,o.Qp,E.vr]})}return n})(),Q=(()=>{class n{constructor(e,s){this.http=e,this.locale=s,this.currentLocale=this.locale.getCurrentLocale()?.replace(/_/g,"-")}setLocale(e){const s=new f.V({namespace:"Locale",method:"set_locale",arguments:[new u.e("locale",e)]});return this.http.post(s)}fetchAvailableLocaleProps(){const e=new f.V({namespace:"Locale",method:"list_locales"});return this.http.post(e).pipe((0,I.T)(s=>{const i=this.transformLanguageData(s.data);return this.sortLanguageDataByName(i)}))}transformLanguageData(e){return e.map(s=>({...s,descriptive_name:`${s.name} (${s.local_name})`}))}sortLanguageDataByName(e){return e.sort((s,i)=>s.name.localeCompare(i.name,this.currentLocale))}static#t=this.\u0275fac=function(s){return new(s||n)(t.KVO(w.dF),t.KVO(g.h))};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const J=n=>({"data-testid":"changeLanguageSelectInput",autocomplete:"off","aria-label":n});function U(n,d){1&n&&t.EFF(0),2&n&&t.SpI(" ",d.item.name," ")}function H(n,d){if(1&n&&(t.j41(0,"div",15),t.EFF(1),t.k0s()),2&n){const e=d.item;t.Y8G("lang",e.locale),t.R7$(),t.Lme(" ",e.name," (",e.local_name,") ")}}let z=(()=>{class n{constructor(e,s,i,r){this.locale=e,this.page=s,this.changeLanguageFormBuilder=i,this.changeLanguageService=r,this.notificationEvent=new t.bkB,this.buttonState=o.w.enabled,this.availableLocaleProps$=this.changeLanguageService.fetchAvailableLocaleProps(),this.successConfig={notificationMessage:this.locale.maketext("You have changed your language preferences."),notificationType:o._n.success},this.errorConfig={notificationMessage:this.locale.maketext("The system encountered an error while changing the language."),notificationType:o._n.error},this.localeProps={locale:this.locale.getCurrentLocale()||"",name:this.page.localeFullName||""}}ngOnInit(){this.changeLanguageForm=this.changeLanguageFormBuilder.group({languageTypesControl:[this.localeProps.name,a.k0.required]})}onSaveLocale(){const s=this.changeLanguageForm.get("languageTypesControl").value.locale??this.localeProps.locale;this.buttonState=o.w.loading,this.changeLanguageService.setLocale(s).pipe((0,C.s)(1),(0,b.j)(()=>this.buttonState=o.w.enabled)).subscribe({next:i=>this.notifyUser(i),error:()=>this.notifyUser()})}onSelectLocale(e){this.localeProps=e}notifyUser(e=null){this.notificationEvent.emit(e?.success?this.successConfig:this.errorConfig)}static#t=this.\u0275fac=function(s){return new(s||n)(t.rXU(g.h),t.rXU(p),t.rXU(a.ze),t.rXU(Q))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-acct-pref-change-language"]],outputs:{notificationEvent:"notificationEvent"},decls:22,vars:16,consts:[["id","changeLanguageForm","name","changeLanguageForm",3,"ngSubmit","formGroup"],[1,"card","h-100"],[1,"card-body"],[1,"d-flex","justify-content-start","align-items-end"],[1,"ri-xl","ri-translate","me-2"],[1,"card-title"],["data-testid","changeLanguagePageDescription"],[1,"mb-5"],[1,"mb-2"],[1,"text-muted","me-1"],[3,"innerHTML"],["data-testid","changeLanguageSelect","formControlName","languageTypesControl","bindLabel","descriptive_name","bindValue","name",3,"change","placeholder","items","clearable","inputAttrs"],["ng-label-tmp",""],["ng-option-tmp","","ng-label-tmp",""],["data-testid","changeLanguageSaveButton","id","changeLanguageSaveButton","type","submit",1,"mt-2",3,"buttonState"],[1,"ng-option-label",3,"lang"]],template:function(s,i){1&s&&(t.j41(0,"form",0),t.bIt("ngSubmit",function(){return i.onSaveLocale()}),t.j41(1,"div",1)(2,"div",2)(3,"div",3),t.nrm(4,"i",4),t.j41(5,"h5",5),t.EFF(6),t.k0s()(),t.j41(7,"p",6),t.EFF(8),t.k0s(),t.j41(9,"div",7)(10,"h6"),t.EFF(11),t.k0s(),t.j41(12,"p",8)(13,"span",9),t.EFF(14),t.k0s(),t.nrm(15,"span",10),t.k0s(),t.j41(16,"ng-select",11),t.nI1(17,"async"),t.bIt("change",function(l){return i.onSelectLocale(l)}),t.DNE(18,U,1,1,"ng-template",12)(19,H,2,3,"ng-template",13),t.k0s()(),t.j41(20,"cp-button",14),t.EFF(21),t.k0s()()()()),2&s&&(t.Y8G("formGroup",i.changeLanguageForm),t.R7$(6),t.SpI(" ",i.locale.maketext("Change Language")," "),t.R7$(2),t.SpI(" ",i.locale.maketext("Set your preferred language.")," "),t.R7$(3),t.JRh(i.locale.maketext("Language")),t.R7$(3),t.JRh(i.locale.maketext("Don\u2019t see your language of choice?")),t.R7$(),t.Y8G("innerHTML",i.locale.maketext("[output,url,_1,Submit a request to our roadmap,title,_2,target,_3,data-testid,_4,class,external-link].","https://go.cpanel.net/roadmap","cPanel & WHM Roadmap","requestNewLanguage","requestNewLanguageLink"),t.npT),t.R7$(),t.Y8G("placeholder",i.locale.maketext("Select language[comment,label]"))("items",t.bMT(17,12,i.availableLocaleProps$))("clearable",!1)("inputAttrs",t.eq3(14,J,i.locale.maketext("Select language[comment,label]"))),t.R7$(4),t.Y8G("buttonState",i.buttonState),t.R7$(),t.JRh(i.locale.maketext("Save Changes")))},dependencies:[a.qT,a.BC,a.cb,a.j4,a.JD,o.Qp,E.vr,E.Uq,E.ZZ,h.Jj]})}return n})();var A=c(7673),R=function(n){return n.PrimaryEmail="email",n.SecondaryEmail="second_email",n.PushBulletAccessToken="pushbullet_access_token",n}(R||{});let q=(()=>{class n{constructor(){this.page=(0,t.WQX)(p),this.http=(0,t.WQX)(w.dF),this.primaryEmail=(0,t.vPA)(this.getEmailValue(R.PrimaryEmail)),this.secondaryEmail=(0,t.vPA)(this.getEmailValue(R.SecondaryEmail))}sendRequest(e){const{newEmails:s,previousEmails:i}=e;return s.length||i.length?!s.length&&i.length?this.removeEmailAddress(e):s.length&&!i.length?this.addEmailAddress(e):s.length&&i.length?this.updateEmailAddress(e):(0,A.of)(null):(0,A.of)(null)}updateContactEmails(e){const s={newEmails:[e.primaryEmailControl,e.secondaryEmailControl].filter(Boolean),previousEmails:[this.primaryEmail(),this.secondaryEmail()].filter(Boolean),password:e.passwordControl};return this.sendRequest(s)}updateEmailAddress(e){const s=new f.V({namespace:"ContactInformation",method:"set_email_addresses",arguments:[...e.newEmails.map(i=>new u.e("address",i)),...e.previousEmails.map(i=>new u.e("old_address",i)),new u.e("password",e.password)]});return this.http.post(s)}addEmailAddress(e){const s=new f.V({namespace:"ContactInformation",method:"set_email_addresses",arguments:[...e.newEmails.map(i=>new u.e("address",i)),new u.e("password",e.password)]});return this.http.post(s)}removeEmailAddress(e){const s=new f.V({namespace:"ContactInformation",method:"unset_email_addresses",arguments:[...e.previousEmails.map(i=>new u.e("old_address",i)),new u.e("password",e.password)]});return this.http.post(s)}updateLocalEmails(e){const s=[e.primaryEmailControl,e.secondaryEmailControl].filter(Boolean);this.primaryEmail.set(s[0]||""),this.secondaryEmail.set(s[1]||"")}getEmailValue(e){return this.page.contactInfo.find(s=>s.name===e)?.value||""}static#t=this.\u0275fac=function(s){return new(s||n)};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var K=c(510),j=c(9079);let N=(()=>{class n{constructor(){this.notificationEvent=(0,t.CGW)()}sendNotification(e,s){this.notificationEvent.emit({notificationMessage:s,notificationType:e})}static#t=this.\u0275fac=function(s){return new(s||n)};static#e=this.\u0275dir=t.FsC({type:n,outputs:{notificationEvent:"notificationEvent"}})}return n})();const Z=n=>({"ng-form-validated":n});let tt=(()=>{class n extends N{constructor(){super(),this.contactInformationService=(0,t.WQX)(q),this.locale=(0,t.WQX)(g.h),this.formBuilder=(0,t.WQX)(a.ok),this.page=(0,t.WQX)(p),this.emailForm=this.initializeForm(),this.isFormSubmitted=(0,t.vPA)(!1),this.isFormInvalid=(0,t.vPA)(!0),this.primaryEmailControl=this.emailForm.get("primaryEmailControl"),this.secondaryEmailControl=this.emailForm.get("secondaryEmailControl"),this.passwordControl=this.emailForm.get("passwordControl"),this.currentPrimaryEmailControlValue=(0,j.ot)(this.getEmailControlValue$(this.primaryEmailControl)),this.currentSecondaryEmailControlValue=(0,j.ot)(this.getEmailControlValue$(this.secondaryEmailControl)),this.contactInformationSaveButton=(0,t.EWP)(()=>this.isFormSubmitted()?o.w.loading:o.w.enabled),this.isPasswordVisible=(0,t.vPA)(!1),this.passwordVisibilityTogglerClass=(0,t.EWP)(()=>this.isPasswordVisible()?"ri-eye-line":"ri-eye-off-line"),this.passwordFieldType=(0,t.EWP)(()=>this.isPasswordVisible()?"text":"password"),this.primaryEmailChanged=(0,t.EWP)(()=>this.currentPrimaryEmailControlValue()!==this.contactInformationService.primaryEmail()),this.secondaryEmailChanged=(0,t.EWP)(()=>this.currentSecondaryEmailControlValue()!==this.contactInformationService.secondaryEmail()),this.canSubmitForm=(0,t.EWP)(()=>!this.isFormInvalid()&&(this.primaryEmailChanged()||this.secondaryEmailChanged())),this.successMessage=this.locale.maketext("You have successfully updated your contact information."),this.errorMessage=this.locale.maketext("The system encountered an error while updating the contact information."),this.emailsNotChangedMessage=this.locale.maketext("No changes detected. Modify an email before saving."),(0,t.QZP)(()=>this.togglePasswordDisability()),this.updateFormStatus()}saveContactInformation(){if(!this.primaryEmailChanged()&&!this.secondaryEmailChanged()&&this.sendNotification(o._n.information,this.emailsNotChangedMessage),!this.canSubmitForm())return;this.isFormSubmitted.set(!0);const e=this.emailForm.getRawValue();this.contactInformationService.updateContactEmails(e).pipe((0,C.s)(1),(0,b.j)(()=>this.isFormSubmitted.set(!1))).subscribe({next:s=>{s?.success?(this.contactInformationService.updateLocalEmails(e),this.passwordControl.reset(),this.sendNotification(o._n.success,this.successMessage)):s?.messages[0].message.includes("password")&&this.passwordControl.setErrors({incorrectPassword:{message:this.locale.maketext("The password you entered was incorrect.")}})},error:()=>{this.sendNotification(o._n.error,this.errorMessage)}})}togglePasswordVisibility(){this.isPasswordVisible.update(e=>!e)}cancelContactInformation(e){e.preventDefault(),this.emailForm.reset({primaryEmailControl:this.contactInformationService.primaryEmail(),secondaryEmailControl:this.contactInformationService.secondaryEmail()})}initializeForm(){return new a.gE({primaryEmailControl:new a.MJ(this.contactInformationService.primaryEmail(),{validators:[v.ln.required(),v.sr.validateEmail()]}),secondaryEmailControl:new a.MJ(this.contactInformationService.secondaryEmail(),{validators:[v.sr.validateEmail()]}),passwordControl:new a.MJ("",{validators:[v.ln.required()]})})}getEmailControlValue$(e){return e.valueChanges.pipe((0,K.Z)(e.value))}togglePasswordDisability(){this.primaryEmailChanged()||this.secondaryEmailChanged()?this.passwordControl.enable():(this.passwordControl.reset(),this.passwordControl.disable())}updateFormStatus(){this.emailForm.statusChanges.subscribe(()=>this.isFormInvalid.set(this.emailForm.invalid))}static#t=this.\u0275fac=function(s){return new(s||n)};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-acct-pref-contact-information"]],features:[t.Vt3],decls:25,vars:21,consts:[[1,"mb-5"],["id","contactInformationForm","name","contactInformationForm",3,"reset","ngSubmit","formGroup","ngClass"],[1,"card","h-100"],[1,"card-body"],[1,"d-flex","justify-content-start","align-items-end"],[1,"ri-xl","ri-account-circle-line","me-2"],[1,"card-title"],["data-testid","contactInformationPageDescription",3,"innerHTML"],["labelFor","primaryEmailInput","id","primaryEmailField",1,"mb-5",3,"labelText","control","isRequired"],["input-content","",1,"input-group"],["formControlName","primaryEmailControl","type","text","id","primaryEmailInput","data-testid","primaryEmailInput",1,"form-control"],["labelFor","secondaryEmailInput","id","primaryEmailField",1,"mb-5",3,"labelText","control"],["formControlName","secondaryEmailControl","type","text","id","secondaryEmailInput","data-testid","secondaryEmailInput",1,"form-control"],["labelFor","passwordInput","id","passwordField",3,"isRequired","labelText","control"],["formControlName","passwordControl","id","passwordInput","data-testid","passwordInput",1,"form-control",3,"type"],["data-testid","passwordVisibilityButton","id","passwordVisibilityButton","type","button",1,"input-group-text","btn","btn-outline-primary",3,"click","disabled"],[3,"ngClass"],["data-testid","contactInformationSaveButton","id","contactInformationSaveButton","type","submit",1,"mt-4",3,"buttonState"],["type","reset",1,"btn","btn-link"],["data-testid","contactInformationCancelButton","id","contactInformationCancelButton",1,"btn-link"]],template:function(s,i){1&s&&(t.j41(0,"div",0)(1,"form",1),t.bIt("reset",function(l){return i.cancelContactInformation(l)})("ngSubmit",function(){return i.saveContactInformation()}),t.j41(2,"div",2)(3,"div",3)(4,"div",4),t.nrm(5,"i",5),t.j41(6,"h5",6),t.EFF(7),t.k0s()(),t.nrm(8,"p",7),t.j41(9,"cp-form-field",8)(10,"div",9),t.nrm(11,"input",10),t.k0s()(),t.j41(12,"cp-form-field",11)(13,"div",9),t.nrm(14,"input",12),t.k0s()(),t.j41(15,"cp-form-field",13)(16,"div",9),t.nrm(17,"input",14),t.j41(18,"button",15),t.bIt("click",function(){return i.togglePasswordVisibility()}),t.nrm(19,"i",16),t.k0s()()(),t.j41(20,"cp-button",17),t.EFF(21),t.k0s(),t.j41(22,"button",18)(23,"a",19),t.EFF(24),t.k0s()()()()()()),2&s&&(t.R7$(),t.Y8G("formGroup",i.emailForm)("ngClass",t.eq3(19,Z,i.emailForm.dirty)),t.R7$(6),t.SpI(" ",i.locale.maketext("Contact Information[comment,title]")," "),t.R7$(),t.Y8G("innerHTML",i.locale.maketext("Enter an email address to receive account notifications and password reset confirmations. We recommend using email addresses from different servers to avoid delivery issues if your mailbox reaches its limit."),t.npT),t.R7$(),t.Y8G("labelText",i.locale.maketext("Primary Email Address"))("control",i.primaryEmailControl)("isRequired",!0),t.R7$(3),t.Y8G("labelText",i.locale.maketext("Secondary Email Address"))("control",i.secondaryEmailControl),t.R7$(3),t.Y8G("isRequired",!0)("labelText",i.locale.maketext("Account Password"))("control",i.passwordControl),t.R7$(2),t.Y8G("type",i.passwordFieldType()),t.R7$(),t.Y8G("disabled",i.passwordControl.disabled),t.BMQ("aria-label",i.locale.maketext("Show or hide password[comment,label]")),t.R7$(),t.Y8G("ngClass",i.passwordVisibilityTogglerClass()),t.R7$(),t.Y8G("buttonState",i.contactInformationSaveButton()),t.R7$(),t.JRh(i.locale.maketext("Save Changes")),t.R7$(3),t.JRh(i.locale.maketext("Cancel")))},dependencies:[h.YU,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,o.Qp,o.KS],styles:["[_nghost-%COMP%] .btn[_ngcontent-%COMP%]{min-width:auto}"]})}return n})(),et=(()=>{class n{constructor(){this.http=(0,t.WQX)(w.dF)}updatePushNotificationsToken(e){return this.http.post(new f.V({namespace:"ContactInformation",method:"set_pushbullet_access_token",arguments:[new u.e("pushbullet_access_token",e)]}))}static#t=this.\u0275fac=function(s){return new(s||n)};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var $=c(534);let it=(()=>{class n extends N{constructor(){super(...arguments),this.locale=(0,t.WQX)(g.h),this.page=(0,t.WQX)(p),this.formBuilder=(0,t.WQX)(a.ok),this.pushNotificationsService=(0,t.WQX)(et),this.localized=function nt(n){return{successMessage:n.maketext("You have successfully updated the Pushbullet token."),errorMessage:n.maketext("The system encountered an error while updating the Pushbullet token."),tokenNotChangedMessage:n.maketext("No changes detected. Modify the Pushbullet token before saving."),showTokenValueLabel:n.maketext("Show Pushbullet token[comment,label]"),hideTokenValueLabel:n.maketext("Hide Pushbullet token[comment,label]"),formTitle:n.maketext("Push Notifications"),formDescription:n.maketext("Add your access token for Pushbullet."),pushbulletTokenFieldLabel:n.maketext("Access Token"),formSubmitButtonText:n.maketext("Save Changes"),togglePushbulletTokenVisibilityLabel:n.maketext("Show or hide Pushbullet token[comment,label]")}}(this.locale),this.currentTokenValue=this.getPushbulletTokenValue(),this.pushNotificationsForm=this.getPushbulletFormGroup(),this.pushbulletTokenField=this.pushNotificationsForm.get("pushbulletToken"),this.submitButtonState=(0,t.vPA)(o.w.enabled),this.isTokenVisible=(0,t.vPA)(!1),this.destroySubject$=new k.B,this.tokenVisibilityTogglerClass=(0,t.EWP)(()=>this.isTokenVisible()?"ri-eye-line":"ri-eye-off-line"),this.tokenVisibilityTogglerLabel=(0,t.EWP)(()=>this.isTokenVisible()?this.localized.hideTokenValueLabel:this.localized.showTokenValueLabel),this.tokenFieldType=(0,t.EWP)(()=>this.isTokenVisible()?"text":"password")}submitPushNotificationsForm(){if(!this.isTokenValueChanged())return this.sendNotification(o._n.information,this.localized.tokenNotChangedMessage);this.submitButtonState.set(o.w.loading),this.pushNotificationsService.updatePushNotificationsToken(this.pushbulletTokenField.value).pipe((0,F.Q)(this.destroySubject$),(0,b.j)(()=>this.submitButtonState.set(o.w.enabled))).subscribe({next:e=>{e?.success?(this.currentTokenValue=this.pushbulletTokenField.value,this.sendNotification(o._n.success,this.localized.successMessage)):this.sendNotification(o._n.error,this.localized.errorMessage)},error:()=>{this.sendNotification(o._n.error,this.localized.errorMessage)}})}toggleTokenVisibility(){this.isTokenVisible.update(e=>!e)}ngOnDestroy(){this.destroySubject$.next(!0),this.destroySubject$.complete()}getPushbulletFormGroup(){return this.formBuilder.group({pushbulletToken:this.currentTokenValue})}getPushbulletTokenValue(){return(this.page?.contactInfo||[]).find(({name:e})=>e===R.PushBulletAccessToken)?.value||""}isTokenValueChanged(){return this.pushbulletTokenField.value!==this.currentTokenValue}static#t=this.\u0275fac=(()=>{let e;return function(i){return(e||(e=t.xGo(n)))(i||n)}})();static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-acct-pref-push-notifications"]],features:[t.Vt3],decls:16,vars:12,consts:[[1,"mb-5"],["id","pushNotificationsForm","name","pushNotificationsForm",3,"ngSubmit","formGroup"],[1,"card","h-100"],[1,"card-body"],[1,"card-title"],["data-testid","pushNotificationsFormDescription"],["labelFor","pushbulletTokenInput","id","pushbulletTokenInputControl","data-testid","pushbulletTokenInputControl",3,"isRequired","labelText","control"],["input-content","",1,"input-group"],["formControlName","pushbulletToken","id","pushbulletTokenInput","data-testid","pushbulletTokenInput","autocomplete","off",1,"form-control",3,"type"],["data-testid","pushbulletTokenVisibilityButton","id","pushbulletTokenVisibilityButton","type","button",1,"input-group-text","btn","btn-outline-primary","token-visibility-toggler",3,"click","tooltip"],[3,"ngClass"],["data-testid","pushNotificationsSaveButton","id","pushNotificationsSaveButton","type","submit",1,"mt-4",3,"buttonState"]],template:function(s,i){1&s&&(t.j41(0,"div",0)(1,"form",1),t.bIt("ngSubmit",function(){return i.submitPushNotificationsForm()}),t.j41(2,"div",2)(3,"div",3)(4,"h5",4),t.EFF(5),t.k0s(),t.j41(6,"p",5),t.EFF(7),t.k0s(),t.j41(8,"div",0)(9,"cp-form-field",6)(10,"div",7),t.nrm(11,"input",8),t.j41(12,"button",9),t.bIt("click",function(){return i.toggleTokenVisibility()}),t.nrm(13,"i",10),t.k0s()()()(),t.j41(14,"cp-button",11),t.EFF(15),t.k0s()()()()()),2&s&&(t.R7$(),t.Y8G("formGroup",i.pushNotificationsForm),t.R7$(4),t.SpI(" ",i.localized.formTitle," "),t.R7$(2),t.SpI(" ",i.localized.formDescription," "),t.R7$(2),t.Y8G("isRequired",!1)("labelText",i.localized.pushbulletTokenFieldLabel)("control",i.pushbulletTokenField),t.R7$(2),t.Y8G("type",i.tokenFieldType()),t.R7$(),t.Y8G("tooltip",i.tokenVisibilityTogglerLabel()),t.BMQ("aria-label",i.localized.togglePushbulletTokenVisibilityLabel),t.R7$(),t.Y8G("ngClass",i.tokenVisibilityTogglerClass()),t.R7$(),t.Y8G("buttonState",i.submitButtonState()),t.R7$(),t.SpI("",i.localized.formSubmitButtonText," "))},dependencies:[h.YU,$.dg,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,o.Qp,o.KS],styles:[".token-visibility-toggler[_ngcontent-%COMP%]{min-width:auto}"]})}return n})();var m=function(n){return n.Disable="disable",n.All="all",n.FailWarnDefer="failWarnDefer",n.CertFailures="certFailures",n}(m||{});const L=["notify_autossl_expiry","notify_autossl_expiry_coverage","notify_autossl_renewal_coverage","notify_autossl_renewal_coverage_reduced"];let st=(()=>{class n{constructor(){this.http=(0,t.WQX)(w.dF),this.page=(0,t.WQX)(p),this.preferences=(0,t.vPA)(this.page.contactPreferences),this.autoSslOptions=(0,t.EWP)(()=>this.configureAutoSslOptions())}updateContactPreferences(e){return this.http.post(new f.V({namespace:"ContactInformation",method:"set_notification_preferences",arguments:[new u.e("preferences",e)],config:{json:!0}}))}mapToApiPayload(e){const s={};for(const[i,r]of Object.entries(e))"autosslNotifications"!==i&&(s[i]=r?1:0);if(this.autoSslOptions().canDisplaySslFormSection){const i=e.autosslNotifications,r=[m.All,m.FailWarnDefer,m.CertFailures].includes(i)?1:0;L.forEach(l=>s[l]=r),s.notify_autossl_renewal=i===m.All?1:0,s.notify_autossl_renewal_uncovered_domains=i===m.All||i===m.FailWarnDefer?1:0}return s}configureAutoSslOptions(){const e=this.preferences(),s=new Set(e.map(_=>_.name)),i=new Set(L),r=s.has("notify_autossl_renewal"),l=s.has("notify_autossl_renewal_uncovered_domains"),P=e.some(_=>i.has(_.name));let y=m.Disable;for(const{name:_,enabled:B}of e)"notify_autossl_renewal"===_&&B&&(y=m.All),"notify_autossl_renewal_uncovered_domains"===_&&B&&y!==m.All&&(y=m.FailWarnDefer),i.has(_)&&B&&y!==m.All&&y!==m.FailWarnDefer&&(y=m.CertFailures);return{canSetAllNotifications:r,canSetFailuresAndDeferralsNotifications:l,canSetFailures:P,initialPreset:y,canDisplaySslFormSection:r||l||P}}static#t=this.\u0275fac=function(s){return new(s||n)};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const ot=n=>({"ng-form-validated":n});function at(n,d){if(1&n&&(t.j41(0,"span",21),t.EFF(1),t.k0s()),2&n){const e=t.XpG(2).$implicit;t.R7$(),t.SpI("(",e.infotext,")")}}function rt(n,d){if(1&n&&(t.j41(0,"div",17),t.nrm(1,"input",18),t.j41(2,"label",19)(3,"span"),t.EFF(4),t.k0s(),t.DNE(5,at,2,1,"span",20),t.k0s()()),2&n){const e=t.XpG().$implicit;t.R7$(),t.Y8G("formControlName",e.name)("id",e.name+"_checkbox"),t.BMQ("data-testid",e.name+"_checkbox"),t.R7$(),t.Y8G("for",e.name+"_checkbox"),t.R7$(2),t.JRh(e.descp),t.R7$(),t.Y8G("ngIf",e.infotext.length)}}function ct(n,d){if(1&n&&(t.j41(0,"span",21),t.EFF(1),t.k0s()),2&n){const e=t.XpG(2).$implicit;t.R7$(),t.SpI("(",e.infotext,")")}}function lt(n,d){if(1&n&&(t.j41(0,"div",17),t.nrm(1,"input",18),t.j41(2,"label",19)(3,"span"),t.EFF(4),t.k0s(),t.DNE(5,ct,2,1,"span",20),t.k0s()()),2&n){const e=t.XpG().$implicit;t.R7$(),t.Y8G("formControlName",e.name)("id",e.name+"_checkbox"),t.BMQ("data-testid",e.name+"_checkbox"),t.R7$(),t.Y8G("for",e.name+"_checkbox"),t.R7$(2),t.JRh(e.descp),t.R7$(),t.Y8G("ngIf",e.infotext.length)}}function dt(n,d){if(1&n&&(t.j41(0,"div",22),t.DNE(1,lt,6,6,"div",15),t.k0s()),2&n){const e=d.$implicit,s=t.XpG().$implicit;t.R7$(),t.Y8G("ngIf",e.onchangeparent===s.name)}}function ut(n,d){if(1&n&&(t.qex(0),t.DNE(1,rt,6,6,"div",15)(2,dt,2,1,"div",16),t.bVm()),2&n){const e=d.$implicit,s=t.XpG(2);t.R7$(),t.Y8G("ngIf",!e.onchangeparent.length),t.R7$(),t.Y8G("ngForOf",s.preferences())}}function mt(n,d){if(1&n&&(t.j41(0,"div",17),t.nrm(1,"input",25),t.j41(2,"label",26),t.EFF(3),t.k0s()()),2&n){const e=t.XpG(3);t.R7$(),t.Y8G("value",e.autoSslPreset.All),t.R7$(2),t.SpI(" ",e.locale.maketext("All [asis,AutoSSL] events: failures, deferrals, and successful installations.")," ")}}function pt(n,d){if(1&n&&(t.j41(0,"div",17),t.nrm(1,"input",27),t.j41(2,"label",28),t.EFF(3),t.k0s()()),2&n){const e=t.XpG(3);t.R7$(),t.Y8G("value",e.autoSslPreset.FailWarnDefer),t.R7$(2),t.SpI(" ",e.locale.maketext("[asis,AutoSSL] failures and deferrals only. (default)")," ")}}function ht(n,d){if(1&n&&(t.j41(0,"div",23)(1,"h5",24),t.EFF(2),t.k0s(),t.DNE(3,mt,4,2,"div",15)(4,pt,4,2,"div",15),t.k0s()),2&n){const e=t.XpG(2);t.R7$(2),t.SpI(" ",e.locale.maketext("[asis,AutoSSL] Notifications")," "),t.R7$(),t.Y8G("ngIf",e.autoSslOptions().canSetAllNotifications),t.R7$(),t.Y8G("ngIf",e.autoSslOptions().canSetFailuresAndDeferralsNotifications)}}function ft(n,d){if(1&n&&(t.qex(0),t.j41(1,"div",17),t.nrm(2,"input",29),t.j41(3,"label",30),t.EFF(4),t.k0s()(),t.j41(5,"div",17),t.nrm(6,"input",31),t.j41(7,"label",32),t.EFF(8),t.k0s()(),t.bVm()),2&n){const e=t.XpG(2);t.R7$(2),t.Y8G("value",e.autoSslPreset.CertFailures),t.R7$(2),t.SpI(" ",e.locale.maketext("[asis,AutoSSL] failures only.")," "),t.R7$(2),t.Y8G("value",e.autoSslPreset.Disable),t.R7$(2),t.SpI(" ",e.locale.maketext("Disable [asis,AutoSSL] event notifications.")," ")}}function gt(n,d){if(1&n){const e=t.RV6();t.j41(0,"div",1)(1,"form",2),t.bIt("ngSubmit",function(){t.eBV(e);const i=t.XpG();return t.Njj(i.saveContactPreferences())}),t.j41(2,"div",3)(3,"div",4)(4,"div",5),t.nrm(5,"i",6),t.j41(6,"h5",7),t.EFF(7),t.k0s()(),t.j41(8,"div",8)(9,"p",9),t.EFF(10),t.k0s(),t.DNE(11,ut,3,2,"ng-container",10)(12,ht,5,3,"div",11)(13,ft,9,4,"ng-container",12),t.k0s(),t.j41(14,"div",13)(15,"cp-button",14),t.EFF(16),t.k0s()()()()()()}if(2&n){const e=t.XpG();t.R7$(),t.Y8G("formGroup",e.contactPreferencesForm)("ngClass",t.eq3(9,ot,e.contactPreferencesForm.dirty)),t.R7$(6),t.SpI(" ",e.locale.maketext("Contact Preferences")," "),t.R7$(3),t.SpI(" ",e.locale.maketext("Select which notifications you would like to receive by email. Notify me when:")," "),t.R7$(),t.Y8G("ngForOf",e.preferences()),t.R7$(),t.Y8G("ngIf",e.autoSslOptions().canDisplaySslFormSection),t.R7$(),t.Y8G("ngIf",e.autoSslOptions().canSetFailures),t.R7$(2),t.Y8G("buttonState",e.submitButtonState()),t.R7$(),t.JRh(e.locale.maketext("Save Changes"))}}let vt=(()=>{class n extends N{constructor(){super(...arguments),this.service=(0,t.WQX)(st),this.fb=(0,t.WQX)(a.ok),this.destroy$=new k.B,this.locale=(0,t.WQX)(g.h),this.autoSslPreset=m,this.initialFormData={},this.preferences=this.service.preferences,this.autoSslOptions=this.service.autoSslOptions,this.isSubmitted=(0,t.vPA)(!1),this.isInvalid=(0,t.vPA)(!1),this.submitButtonState=(0,t.EWP)(()=>this.isSubmitted()?o.w.loading:o.w.enabled),this.successMessage=this.locale.maketext("You have successfully updated your contact preferences."),this.errorMessage=this.locale.maketext("The system encountered an error while updating the contact preferences."),this.noChangesMessage=this.locale.maketext("No changes detected. Modify preferences before saving.")}ngOnInit(){this.setupForm()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}saveContactPreferences(){if(this.isSubmitted()||this.isInvalid())return;const e=this.contactPreferencesForm.getRawValue(),s=this.service.mapToApiPayload(e);if(JSON.stringify(e)===JSON.stringify(this.initialFormData))return this.sendNotification(o._n.information,this.noChangesMessage);this.isSubmitted.set(!0),this.service.updateContactPreferences(s).pipe((0,b.j)(()=>this.isSubmitted.set(!1))).subscribe({next:i=>{this.sendNotification(i.status?o._n.success:o._n.error,i.status?this.successMessage:this.errorMessage),i.status&&(this.initialFormData=this.contactPreferencesForm.getRawValue())},error:()=>{this.sendNotification(o._n.error,this.errorMessage)}})}setupForm(){const e={},{initialPreset:s,canDisplaySslFormSection:i}=this.autoSslOptions();this.preferences().forEach(r=>{e[r.name]=new a.MJ(!!r.enabled)}),i&&(e.autosslNotifications=new a.MJ(s)),this.contactPreferencesForm=this.fb.group(e),this.initialFormData=this.contactPreferencesForm.getRawValue(),this.setupParentChild(this.contactPreferencesForm,this.preferences()),this.contactPreferencesForm.statusChanges.pipe((0,F.Q)(this.destroy$)).subscribe(()=>{this.isInvalid.set(this.contactPreferencesForm.invalid)})}setupParentChild(e,s){s.forEach(i=>{if(!i.onchangeparent)return;const r=e.get(i.onchangeparent),l=e.get(i.name);!r||!l||(r.value||l.disable({emitEvent:!1}),r.valueChanges.pipe((0,F.Q)(this.destroy$)).subscribe(P=>{P?l.enable({emitEvent:!1}):(l.disable({emitEvent:!1}),l.setValue(!1,{emitEvent:!1}))}))})}static#t=this.\u0275fac=(()=>{let e;return function(i){return(e||(e=t.xGo(n)))(i||n)}})();static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-acct-pref-contact-preferences"]],features:[t.Vt3],decls:1,vars:1,consts:[["class","mb-5",4,"ngIf"],[1,"mb-5"],["id","contactPreferencesForm","name","contactPreferencesForm",3,"ngSubmit","formGroup","ngClass"],[1,"card","h-100"],[1,"card-body"],[1,"d-flex","justify-content-start","align-items-end"],[1,"ri-xl","ri-mail-line","me-2"],[1,"card-title"],[1,"mt-3","mb-4"],[1,"mb-4"],[4,"ngFor","ngForOf"],["class","form-group",4,"ngIf"],[4,"ngIf"],[1,"mt-4"],["data-testid","contactPreferencesSaveButton","id","contactPreferencesSaveButton","type","submit",1,"me-2",3,"buttonState"],["class","form-check mb-3",4,"ngIf"],["class","ms-6",4,"ngFor","ngForOf"],[1,"form-check","mb-3"],["type","checkbox",1,"form-check-input",3,"formControlName","id"],[1,"form-check-label",3,"for"],["class","ms-1",4,"ngIf"],[1,"ms-1"],[1,"ms-6"],[1,"form-group"],[1,"mt-6","mb-3"],["type","radio","formControlName","autosslNotifications","id","autosslNotificationsAll_radio","data-testid","autosslNotificationsAll_radio",1,"form-check-input",3,"value"],["for","notify_autossl_renewal_radio",1,"form-check-label"],["type","radio","formControlName","autosslNotifications","id","autosslNotificationsFailsAndDeferrals_radio","data-testid","autosslNotificationsFailsAndDeferrals_radio",1,"form-check-input",3,"value"],["for","autosslNotificationsFailsAndDeferrals_radio",1,"form-check-label"],["type","radio","formControlName","autosslNotifications","id","autosslNotificationsFailsOnly_radio","data-testid","autosslNotificationsFailsOnly_radio",1,"form-check-input",3,"value"],["for","autosslNotificationsFailsOnly_radio",1,"form-check-label"],["type","radio","formControlName","autosslNotifications","id","autosslNotificationsDisabled_radio","data-testid","autosslNotificationsDisabled_radio",1,"form-check-input",3,"value"],["for","autosslNotificationsDisabled_radio",1,"form-check-label"]],template:function(s,i){1&s&&t.DNE(0,gt,17,11,"div",0),2&s&&t.Y8G("ngIf",i.contactPreferencesForm)},dependencies:[h.YU,h.Sq,h.bT,a.qT,a.me,a.Zm,a.Fm,a.BC,a.cb,a.j4,a.JD,o.Qp],styles:[".form-check[_ngcontent-%COMP%]{margin-bottom:.75rem}.form-text[_ngcontent-%COMP%]{font-size:.85rem;margin-top:.25rem;color:var(--bs-gray-600)}h6[_ngcontent-%COMP%]{font-weight:600}"]})}return n})(),bt=(()=>{class n{constructor(){this.http=(0,t.WQX)(w.dF)}sendChangeRequest(e){const s=new f.V({namespace:"Users",method:"change_password",arguments:[new u.e("newpass",e.newPassword),new u.e("oldpass",e.currentPassword),new u.e("enabledigest",e.digestAuth?1:0)]});return this.http.post(s)}static#t=this.\u0275fac=function(s){return new(s||n)};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Y=c(1584);const yt=["captureBlur"];let _t=(()=>{class n extends N{constructor(){super(),this.destroyRef=(0,t.WQX)(t.abz),this.locale=(0,t.WQX)(g.h),this.page=(0,t.WQX)(p),this.el=(0,t.WQX)(t.aKT),this.changePasswordService=(0,t.WQX)(bt),this.nonNullableFormBuilder=(0,t.WQX)(a.Qk),this.changePasswordForm=this.nonNullableFormBuilder.group({currentPassword:["",[v.ln.required()]],newPassword:["",[v.ln.required()]],digestAuth:[!!this.page.webdav_hasdigest]}),this.currentPasswordControl=this.changePasswordForm.controls.currentPassword,this.newPasswordControl=this.changePasswordForm.controls.newPassword,this.successMessage=this.locale.maketext("You have successfully updated your password. The system will redirect you to login in [numf,5] seconds."),this.errorMessage=this.locale.maketext("The system encountered an error while updating your password."),this.badPassErrorMessage=this.locale.maketext("The password that you entered is incorrect. Try again."),this.samePassErrorMessage=this.locale.maketext("You cannot reuse the old password."),this.showPassword=this.locale.maketext("Show password."),this.hidePassword=this.locale.maketext("Hide password."),this.isFormSubmitted=new k.B,this.isRequired=!0,this.showAllHelp=!0,this.isStrengthValidationRequired=!0,this.changePasswordSaveButton=o.w.enabled,this.isPasswordVisible=(0,t.vPA)(!1),this.currentPasswordVisibilityClass=(0,t.EWP)(()=>this.isPasswordVisible()?"ri-eye-line":"ri-eye-off-line"),this.currentPasswordFieldType=(0,t.EWP)(()=>this.isPasswordVisible()?"text":"password"),this.showOrHidePasswordTooltip=(0,t.EWP)(()=>this.isPasswordVisible()?this.hidePassword:this.showPassword),this.onBlurHandler=e=>{e.stopPropagation(),this.newPasswordControl.markAsTouched()},this.onFocusHandler=e=>{"newPassword-generate-password-btn"===e.target.id?this.el.nativeElement.querySelector(".currentStrengthText")?.classList.remove("hidden"):this.checkForOverlap()}}checkForOverlap(){const s=this.el.nativeElement.querySelector("#newPasswordField_validationContainer")?.getBoundingClientRect().width>0,i=this.el.nativeElement.querySelector(".currentStrengthText");s||""===this.newPasswordControl.value?i?.classList.add("hidden"):i?.classList.remove("hidden")}ngOnInit(){const e=this.captureBlur.nativeElement;e.addEventListener("blur",this.onBlurHandler,!0),e.addEventListener("focus",this.onFocusHandler,!0)}cancelChangedPasswordAndDigest(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation();const s=this.newPasswordControl.validator;this.newPasswordControl.clearValidators(),this.newPasswordControl.updateValueAndValidity(),this.newPasswordControl.addValidators(s||(()=>null))}toggleCurrentPasswordVisibility(){this.isPasswordVisible.update(e=>!e)}saveChangedPasswordAndDigest(){if(this.changePasswordSaveButton=o.w.loading,this.changePasswordForm.invalid)return void(0,Y.O)(500).pipe((0,C.s)(1)).subscribe(()=>{this.changePasswordForm.markAllAsTouched(),this.sendError(),this.changePasswordSaveButton=o.w.enabled});const e=this.changePasswordForm.getRawValue();this.changePasswordService.sendChangeRequest(e).pipe((0,j.pQ)(this.destroyRef),(0,b.j)(()=>this.changePasswordSaveButton=o.w.enabled)).subscribe({next:s=>{s?.success?this.sendSuccess():this.sendError(s)},error:()=>{this.sendError()}})}sendSuccess(){this.sendNotification(o._n.success,this.successMessage),(0,Y.O)(5e3).pipe((0,C.s)(1)).subscribe(()=>{location.pathname="logout"}),this.currentPasswordControl.reset(),this.newPasswordControl.reset()}sendError(e){const s=e?.messages[0]?.message??"";s.toLowerCase().includes(this.badPassErrorMessage.toLowerCase())?this.currentPasswordControl.setErrors({incorrectPassword:{message:this.badPassErrorMessage}}):s.toLowerCase().includes(this.samePassErrorMessage.toLowerCase())?this.newPasswordControl.setErrors({samePassword:{message:this.samePassErrorMessage}}):this.sendNotification(o._n.error,this.errorMessage)}ngOnDestroy(){const e=this.captureBlur.nativeElement;e.removeEventListener("blur",this.onBlurHandler,!0),e.removeEventListener("focus",this.onFocusHandler,!0)}static#t=this.\u0275fac=function(s){return new(s||n)};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-acct-pref-change-password"]],viewQuery:function(s,i){if(1&s&&t.GBs(yt,7),2&s){let r;t.mGM(r=t.lsd())&&(i.captureBlur=r.first)}},features:[t.Vt3],decls:28,vars:26,consts:[["captureBlur",""],["data-testid","changePasswordForm","name","changePasswordForm",3,"ngSubmit","reset","formGroup"],[1,"card","h-100"],[1,"card-body"],[1,"d-flex","justify-content-start","align-items-end"],[1,"ri-xl","ri-lock-2-line","me-2"],[1,"card-title"],["data-testid","changePasswordDescription",3,"innerHTML"],["labelFor","accountPasswordInput","id","accountPasswordField","data-testid","accountPasswordField",3,"isRequired","labelText","control"],["input-content","",1,"input-group"],["formControlName","currentPassword","id","accountPasswordInput","data-testid","accountPasswordInput",1,"form-control",3,"type"],["data-testid","passwordVisibilityButton","type","button",1,"input-group-text","btn","btn-outline-primary",3,"click","tooltip"],[3,"ngClass"],["id","newPasswordField","data-testid","newPasswordField","labelFor","newPassword-password-input",3,"isRequired","labelText","control"],["input-content","","id","newPassword","data-testid","newPassword",3,"requiresStrengthValidation","requiredStrength","isFormSubmitted","isRequired","controlName","passwordFormGroup"],[1,"form-check","mb-4"],["type","checkbox","id","authInCheckbox","data-testid","authInCheckbox","formControlName","digestAuth","input-content","",1,"form-check-input"],["id","authInLabel","data-testid","authInLabel","for","authInCheckbox",1,"form-check-label",3,"labelText","showInfoBlock"],["data-testid","changePasswordSaveButton","id","changePasswordSaveButton","type","submit",1,"mt-4",3,"buttonState"],["type","reset","data-testid","changePasswordCancelButton",1,"btn","btn-link"]],template:function(s,i){if(1&s){const r=t.RV6();t.j41(0,"form",1),t.bIt("ngSubmit",function(){return t.eBV(r),t.Njj(i.saveChangedPasswordAndDigest())})("reset",function(P){return t.eBV(r),t.Njj(i.cancelChangedPasswordAndDigest(P))}),t.j41(1,"div",2)(2,"div",3)(3,"div",4),t.nrm(4,"i",5),t.j41(5,"h5",6),t.EFF(6),t.k0s()(),t.nrm(7,"div",7),t.j41(8,"p")(9,"strong"),t.EFF(10),t.k0s()(),t.j41(11,"cp-form-field",8)(12,"div",9),t.nrm(13,"input",10),t.j41(14,"button",11),t.bIt("click",function(){return t.eBV(r),t.Njj(i.toggleCurrentPasswordVisibility())}),t.nrm(15,"i",12),t.k0s()()(),t.j41(16,"div",null,0)(18,"cp-form-field",13),t.nrm(19,"cp-password",14),t.k0s()(),t.j41(20,"div",15),t.nrm(21,"input",16),t.j41(22,"cp-form-label",17),t.EFF(23),t.k0s()(),t.j41(24,"cp-button",18),t.EFF(25),t.k0s(),t.j41(26,"button",19),t.EFF(27),t.k0s()()()()}2&s&&(t.Y8G("formGroup",i.changePasswordForm),t.R7$(6),t.SpI(" ",i.locale.maketext("Change Password")," "),t.R7$(),t.Y8G("innerHTML",i.locale.maketext("Change your account password below. Password strength is important in web hosting. We strongly recommend using the Password Generator to create your password. For tips to keep your password safe, read our [output,url,_1,documentation,title,Change Password Documentation,class,_2].","https://go.cpanel.net/account-password","external-link"),t.npT),t.R7$(3),t.JRh(i.locale.maketext("Note: If you change your current password, you will end your session.")),t.R7$(),t.Y8G("isRequired",!0)("labelText",i.locale.maketext("Account Password"))("control",i.currentPasswordControl),t.R7$(2),t.Y8G("type",i.currentPasswordFieldType()),t.R7$(),t.Y8G("tooltip",i.showOrHidePasswordTooltip()),t.BMQ("aria-label",i.locale.maketext("Show or hide password[comment,label]")),t.R7$(),t.Y8G("ngClass",i.currentPasswordVisibilityClass()),t.R7$(3),t.Y8G("isRequired",i.isStrengthValidationRequired)("labelText",i.locale.maketext("New Password"))("control",i.newPasswordControl),t.R7$(),t.Y8G("requiresStrengthValidation",i.isStrengthValidationRequired)("requiredStrength",60)("isFormSubmitted",i.isFormSubmitted)("isRequired",i.isRequired)("controlName","newPassword")("passwordFormGroup",i.changePasswordForm),t.R7$(3),t.Y8G("labelText",i.locale.maketext("Enable Digest Authentication"))("showInfoBlock",!1),t.R7$(),t.SpI(" ",i.locale.maketext("[asis,Windows Vista\xae], [asis,Windows\xae 7], [asis,Windows\xae 8] and [asis,Windows\xae 10] require digest authentication support to be enabled in order to access your [asis,Web Disk] over a clear text/unencrypted connection. If the server has an SSL certificate signed by a recognized certificate authority and you are able to make an SSL connection over port 2078, you do not need to enable this.")," "),t.R7$(),t.Y8G("buttonState",i.changePasswordSaveButton),t.R7$(),t.JRh(i.locale.maketext("Save Password")),t.R7$(2),t.SpI(" ",i.locale.maketext("Cancel")," "))},dependencies:[h.YU,$.dg,a.qT,a.me,a.Zm,a.BC,a.cb,a.j4,a.JD,o.Qp,o.KS,o.n8,o.Wp],styles:["[_nghost-%COMP%] .btn[_ngcontent-%COMP%]{min-width:auto}[_nghost-%COMP%] .hidden{display:none}"]})}return n})(),Ct=(()=>{class n{onSubmit(){const e=`cpanel-account_preferences-set-${this.sectionName}_clicked`;window.mixpanel?.track(e,{transport:"sendBeacon"})}static#t=this.\u0275fac=function(s){return new(s||n)};static#e=this.\u0275dir=t.FsC({type:n,selectors:[["","cpAcctPrefAnalytics",""]],hostBindings:function(s,i){1&s&&t.bIt("submit",function(){return i.onSubmit()})},inputs:{sectionName:[0,"cpAcctPrefAnalytics","sectionName"]}})}return n})();function wt(n,d){if(1&n){const e=t.RV6();t.j41(0,"div")(1,"cp-acct-pref-consent-privacy",5),t.bIt("notificationEvent",function(i){t.eBV(e);const r=t.XpG();return t.Njj(r.sendNotification(i))}),t.k0s()()}if(2&n){const e=t.XpG();t.R7$(),t.Y8G("cpAcctPrefAnalytics",e.analyticsEvent.ConsentPrivacy)}}function Pt(n,d){if(1&n){const e=t.RV6();t.j41(0,"div")(1,"cp-acct-pref-contact-information",5),t.bIt("notificationEvent",function(i){t.eBV(e);const r=t.XpG();return t.Njj(r.sendNotification(i))}),t.k0s()()}if(2&n){const e=t.XpG();t.R7$(),t.Y8G("cpAcctPrefAnalytics",e.analyticsEvent.ContactInformation)}}function St(n,d){if(1&n){const e=t.RV6();t.j41(0,"div")(1,"cp-acct-pref-contact-preferences",5),t.bIt("notificationEvent",function(i){t.eBV(e);const r=t.XpG();return t.Njj(r.sendNotification(i))}),t.k0s()()}if(2&n){const e=t.XpG();t.R7$(),t.Y8G("cpAcctPrefAnalytics",e.analyticsEvent.ContactPreferences)}}function kt(n,d){if(1&n){const e=t.RV6();t.j41(0,"div",4)(1,"cp-acct-pref-change-language",5),t.bIt("notificationEvent",function(i){t.eBV(e);const r=t.XpG();return t.Njj(r.sendNotification(i))}),t.k0s()()}if(2&n){const e=t.XpG();t.R7$(),t.Y8G("cpAcctPrefAnalytics",e.analyticsEvent.ChangeLanguage)}}function Ft(n,d){if(1&n){const e=t.RV6();t.j41(0,"div",4)(1,"cp-acct-pref-push-notifications",5),t.bIt("notificationEvent",function(i){t.eBV(e);const r=t.XpG();return t.Njj(r.sendNotification(i))}),t.k0s()()}if(2&n){const e=t.XpG();t.R7$(),t.Y8G("cpAcctPrefAnalytics",e.analyticsEvent.PushNotifications)}}function Et(n,d){if(1&n){const e=t.RV6();t.j41(0,"div",4)(1,"cp-acct-pref-change-password",5),t.bIt("notificationEvent",function(i){t.eBV(e);const r=t.XpG();return t.Njj(r.sendNotification(i))}),t.k0s()()}if(2&n){const e=t.XpG();t.R7$(),t.Y8G("cpAcctPrefAnalytics",e.analyticsEvent.ChangePassword)}}function Tt(n,d){if(1&n&&(t.j41(0,"div"),t.nrm(1,"cp-notification-list",7),t.k0s()),2&n){const e=t.XpG();t.R7$(),t.Y8G("position",e.position)}}let Rt=(()=>{class n{constructor(e,s,i){this.locale=e,this.notificationService=s,this.page=i,this.title="account-preferences",this.analyticsEvent=x,v.uv.locale=this.locale}sendNotification(e){switch(this.position=JSON.parse(this.page?.systemNotification||null)?.position||o.Rk.topRight,e.notificationType){case o._n.success:this.notificationService.success(e.notificationMessage);break;case o._n.error:this.notificationService.error(e.notificationMessage);break;case o._n.information:this.notificationService.info(e.notificationMessage)}}static#t=this.\u0275fac=function(s){return new(s||n)(t.rXU(g.h),t.rXU(o.JE),t.rXU(p))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-acct-pref-root"]],decls:16,vars:9,consts:[[1,"row"],["id","cpanel",1,"mt-4"],[1,"col-md-6"],[4,"ngIf"],[1,"mb-4"],[3,"notificationEvent","cpAcctPrefAnalytics"],["class","mb-4",4,"ngIf"],[3,"position"]],template:function(s,i){1&s&&(t.j41(0,"div",0)(1,"h6"),t.EFF(2),t.k0s()(),t.j41(3,"div",1)(4,"div",0)(5,"div",2),t.DNE(6,wt,2,1,"div",3)(7,Pt,2,1,"div",3)(8,St,2,1,"div",3),t.k0s(),t.j41(9,"div",2)(10,"div",4)(11,"cp-acct-pref-system-notifications",5),t.bIt("notificationEvent",function(l){return i.sendNotification(l)}),t.k0s()(),t.DNE(12,kt,2,1,"div",6)(13,Ft,2,1,"div",6)(14,Et,2,1,"div",6),t.k0s()(),t.DNE(15,Tt,2,1,"div",3),t.k0s()),2&s&&(t.R7$(2),t.JRh(i.locale.maketext("Update your settings for cPanel.")),t.R7$(4),t.Y8G("ngIf",i.page.features.isUserAnalyticsRequiredByLeika),t.R7$(),t.Y8G("ngIf",i.page.features.updatecontact||i.page.features.updatenotificationprefs),t.R7$(),t.Y8G("ngIf",i.page.features.updatenotificationprefs),t.R7$(3),t.Y8G("cpAcctPrefAnalytics",i.analyticsEvent.SystemNotifications),t.R7$(),t.Y8G("ngIf",i.page.features.setlang),t.R7$(),t.Y8G("ngIf",i.page.features.updatecontact),t.R7$(),t.Y8G("ngIf",i.page.features.password),t.R7$(),t.Y8G("ngIf",!!i.position))},dependencies:[h.bT,o.bR,X,W,z,tt,it,vt,_t,Ct],styles:[".card{background-color:#fff}"]})}return n})();var Nt=c(8658),It=c(4580),jt=c(5992),$t=c(3824),Bt=c(8580),Gt=c(779),xt=c(3400),Vt=c(9966),At=c(7820),Lt=c(3816),Yt=c(728),M=c(1562);let Mt=(()=>{class n{static#t=this.\u0275fac=function(s){return new(s||n)};static#e=this.\u0275mod=t.$C({type:n,bootstrap:[Rt]});static#n=this.\u0275inj=t.G2t({providers:[{provide:p,useValue:window.PAGE},{provide:h.kB,deps:[p],useFactory:e=>e.pageURL},{provide:Window,useValue:window},(0,M.$R)((0,M.Sx)())],imports:[T.Bb,Nt.B,Lt.jr.forRoot(),It.h6.forRoot(),jt.G.forRoot(),Bt.zE.forRoot(),Gt.Q_.forRoot(),$.Ss.forRoot(),Vt.k0.forRoot(),At.Hq.forRoot(),xt.x6.forRoot(),$t.YN.forRoot(),h.MD,a.X1,o.tm,a.YN,Yt.wb,o.nx,o.zJ,E.MQ,o.CF,o.LT,o.Ou,o.H7,o.rY,o.E4]})}return n})();T.sG().bootstrapModule(Mt).catch(n=>console.error(n))}},S=>{S.O(0,[128,996,538],()=>S(S.s=1366)),S.O()}]);
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.05 |
proxy
|
phpinfo
|
Settings