1"use strict";(self.webpackChunke_care=self.webpackChunke_care||[]).push([[3859],{73859:function(e,r,s){s.r(r),s.d(r,{UserNameChangeModule:function(){return E}});var n=s(38583),t=s(54655),a=s(32789),i=s(3172),o=s(3679),c=s(25885),m=s(37716),u=s(26684),g=s(89498),l=s(47203),h=s(39181),d=s(8481),p=s(22238),f=s(4885),v=s(98295),U=s(83166),Z=s(29006),C=s(29790);function x(e,r){if(1&e&&(m.TgZ(0,"div",2),m._UZ(1,"mat-progress-spinner",3),m.qZA()),2&e){const e=m.oxw();m.xp6(1),m.Q6J("mode",e.commonService.mode)("strokeWidth",2)("diameter",80)}}function S(e,r){1&e&&(m.ynx(0),m.TgZ(1,"p",16),m._uU(2),m.ALo(3,"translate"),m.qZA(),m.BQk()),2&e&&(m.xp6(2),m.hij(" ",m.lcZ(3,1,"passwordManage.username.title")," "))}function w(e,r){1&e&&(m.ynx(0),m.TgZ(1,"p",16),m._uU(2),m.ALo(3,"translate"),m.qZA(),m.BQk()),2&e&&(m.xp6(2),m.hij(" ",m.lcZ(3,1,"passwordManage.username.titleUsernameNotSame")," "))}function T(e,r){1&e&&(m.TgZ(0,"mat-error",18),m._uU(1),m.ALo(2,"translate"),m.qZA()),2&e&&(m.xp6(1),m.Oqu(m.lcZ(2,1,"validationMessage.requiredField")))}function q(e,r){1&e&&(m.TgZ(0,"mat-error",18),m._uU(1),m.ALo(2,"translate"),m.qZA()),2&e&&(m.xp6(1),m.Oqu(m.lcZ(2,1,"validationMessage.enterEmail")))}function A(e,r){if(1&e&&(m.ynx(0),m.YNc(1,T,3,3,"mat-error",17),m.YNc(2,q,3,3,"mat-error",17),m.BQk()),2&e){const e=m.oxw(2);m.xp6(1),m.Q6J("ngIf",e.changeUsernameForm.get("username").errors.required),m.xp6(1),m.Q6J("ngIf",e.changeUsernameForm.get("username").errors.email)}}function b(e,r){if(1&e){const e=m.EpF();m.TgZ(0,"span",19),m.NdJ("click",function(){m.CHM(e);const r=m.oxw(2);return r.hideCurrentPass=!r.hideCurrentPass}),m._UZ(1,"img",20),m.qZA()}}function y(e,r){if(1&e){const e=m.EpF();m.TgZ(0,"span",19),m.NdJ("click",function(){m.CHM(e);const r=m.oxw(2);return r.hideCurrentPass=!r.hideCurrentPass}),m._UZ(1,"img",21),m.qZA()}}function k(e,r){1&e&&(m.TgZ(0,"mat-error",18),m._uU(1),m.ALo(2,"translate"),m.qZA()),2&e&&(m.xp6(1),m.Oqu(m.lcZ(2,1,"validationMessage.requiredField")))}function I(e,r){if(1&e&&(m.ynx(0),m.YNc(1,k,3,3,"mat-error",17),m.BQk()),2&e){const e=m.oxw(2);m.xp6(1),m.Q6J("ngIf",e.changeUsernameForm.get("currentPassword").errors.required)}}function P(e,r){if(1&e){const e=m.EpF();m.TgZ(0,"div",4),m.TgZ(1,"div",5),m.TgZ(2,"form",6),m.YNc(3,S,4,3,"ng-container",7),m.YNc(4,w,4,3,"ng-container",7),m.TgZ(5,"div",8),m.TgZ(6,"mat-form-field",9),m.TgZ(7,"label"),m._uU(8),m.ALo(9,"translate"),m.qZA(),m._UZ(10,"input",10),m.qZA(),m.YNc(11,A,3,2,"ng-container",7),m.qZA(),m.TgZ(12,"div",8),m.TgZ(13,"mat-form-field",11),m.TgZ(14,"label"),m._uU(15),m.ALo(16,"translate"),m.qZA(),m._UZ(17,"input",12),m.YNc(18,b,2,0,"span",13),m.YNc(19,y,2,0,"span",13),m.qZA(),m.YNc(20,I,2,1,"ng-container",7),m.qZA(),m.TgZ(21,"div",14),m.TgZ(22,"button",15),m.NdJ("click",function(){return m.CHM(e),m.oxw().changeUsername()}),m._uU(23),m.ALo(24,"translate"),m.qZA(),m.qZA(),m.qZA(),m.qZA(),m.qZA()}if(2&e){const e=m.oxw();m.xp6(2),m.Q6J("formGroup",e.changeUsernameForm),m.xp6(1),m.Q6J("ngIf",e.eonService.eonUsername&&e.eonService.eonUsername===e.profileService.usernameClear),m.xp6(1),m.Q6J("ngIf",!e.eonService.eonUsername||e.eonService.eonUsername!==e.profileService.usernameClear),m.xp6(4),m.Oqu(m.lcZ(9,12,"passwordManage.username.newUserName")),m.xp6(3),m.Q6J("ngIf",e.changeUsernameSubmitted&&e.changeUsernameForm.get("username").errors),m.xp6(4),m.Oqu(m.lcZ(16,14,"passwordManage.username.loginPassword")),m.xp6(2),m.Q6J("type",e.hideCurrentPass?"password":"text"),m.xp6(1),m.Q6J("ngIf",e.hideCurrentPass),m.xp6(1),m.Q6J("ngIf",!e.hideCurrentPass),m.xp6(1),m.Q6J("ngIf",e.changeUsernameSubmitted&&e.changeUsernameForm.get("currentPassword").errors),m.xp6(2),m.Q6J("ladda",e.isChangeUsernameSubmitted),m.xp6(1),m.hij(" ",m.lcZ(24,16,"confirm")," ")}}let J=(()=>{class e{constructor(e,r,s,n,t,a,i,o,c){this.commonService=e,this.cryptoService=r,this.eonService=s,this.profileService=n,this.formBuilder=t,this.trs=a,this.router=i,this.dialog=o,this.location=c,this.hideCurrentPass=!0,this.isChangeUsernameSubmitted=!1,this.changeUsernameSubmitted=!1,this.commonService.isBackButtonActivated=!0,this.commonService.isPageSubtitleActivated=!1,this.commonService.setPageTitle(this.trs.trsTs("usernameChange"),"eon-as-user-name-change")}
1ngOnInit(){this.eonService.eonUsername||this.location.back(),this.changeUsernameForm=this.formBuilder.group({username:["",[o.kI.required,...this.eonService.eonUsername===this.profileService.usernameClear?[o.kI.email]:[]]],currentPassword:["",[o.kI.required]]})}changeUsername(){if(this.isChangeUsernameSubmitted=!0,this.changeUsernameSubmitted=!0,this.changeUsernameForm.invalid)this.isChangeUsernameSubmitted=!1;else{const e=this.cryptoService.encryptPassword(this.changeUsernameForm.controls.currentPassword.value),r=this.eonService.eonUsername?this.eonService.eonUsername:"";this.changeUsernameSubmitted=!1,this.eonService.changeEonUsername(e,this.changeUsernameForm.controls.username.value,r).subscribe(e=>{e.status&&"OK"===e.status?this.openConfirmationDialog("success"):this.openConfirmationDialog("error","Error occurred while changing eon username. Please try again."),this.isChangeUsernameSubmitted=!1},e=>{console.log("Error occurred while changing eon username: ",e),this.isChangeUsernameSubmitted=!1,this.handleError(e)})}}handleError(e){switch(e.status){case 405:return this.openConfirmationDialog("error",this.trs.trsTs("httpErrorCode.wrongPassword"));case 406:return this.openConfirmationDialog("error",this.trs.trsTs("httpErrorCode.changePassword406"));case 410:return this.openConfirmationDialog("error",this.trs.trsTs("httpErrorCode.existingUsername"));case 411:case 416:return this.openConfirmationDialog("error",this.trs.trsTs("httpErrorCode.usernameExist"));case 417:return this.openConfirmationDialog("error",this.trs.trsTs("httpErrorCode.changePassword417"));default:return this.openConfirmationDialog("error",this.trs.trsTs("httpErrorCode.default"))}}openConfirmationDialog(e,r){this.dialog.open(i.k,{width:"812px",hasBackdrop:!1,panelClass:["global-dialog","gd-v3","text-align-center","confirmation-dialog-v3"],data:{image:"success"===e?"assets/img/success-dialog-icon.svg":"assets/img/unsuccess-dialog-icon.svg",title:this.trs.trsTs("success"===e?"success":"messagesPages.errorTitle"),desc2:"success"===e?"SI"!==c.v.defaultLang?this.trs.trsTs("eonAccountSettingsPage.editUsernameDesc"):"":r,close:this.trs.trsTs("close")}}).afterClosed().subscribe(()=>{"success"===e&&this.router.navigate(["/service-details/eon-account-settings"])})}}return e.\u0275fac=function(r){return new(r||e)(m.Y36(u.v),m.Y36(g.$),m.Y36(l.x),m.Y36(h.H),m.Y36(o.qu),m.Y36(d.D),m.Y36(t.F0),m.Y36(p.uw),m.Y36(n.Ye))},e.\u0275cmp=m.Xpm({type:e,selectors:[["app-user-name-change"]],decls:2,vars:2,consts:[["class","page-spinner",4,"ngIf"],["class","eon-settings-pages",4,"ngIf"],[1,"page-spinner"],[3,"mode","strokeWidth","diameter"],[1,"eon-settings-pages"],[1,"container-460"],[3,"formGroup"],[4,"ngIf"],[1,"form-field-holder"],["floatLabel","never",1,"style-type-v3","mb-25"],["matInput","","autocomplete","off","type","text","formControlName","username"],["floatLabel","never",1,"style-type-v3","with-icon","mb-25"],["matInput","","autocomplete","off","type","password","formControlName","currentPassword",3,"type"],["class","eye-icon-wrap",3,"click",4,"ngIf"],[1,"text-align-center"],[1,"radius16","btn-1-v3","bg-main","ladda-fix-v3",3,"ladda","click"],[1,"global-form-description"],["class","ec-errors font-light font-size-12",4,"ngIf"],[1,"ec-errors","font-light","font-size-12"],[1,"eye-icon-wrap",3,"click"],["src","assets/img/eye-icon.svg","alt","eye-icon",1,"icon"],["src","assets/img/eye-hide-icon.svg","alt","eye-icon",1,"icon"]],template:function(e,r){1&e&&(m.YNc(0,x,2,3,"div",0),m.YNc(1,P,25,18,"div",1)),2&e&&(m.Q6J("ngIf",r.eonService.isEonUsernameLoaded),m.xp6(1),m.Q6J("ngIf",!r.eonService.isEonUsernameLoaded))},directives:[n.O5,f.Ou,o._Y,o.JL,o.sg,v.KE,U.Nt,o.Fj,o.JJ,o.u,Z.d_,v.TO],pipes:[C.X$],encapsulation:2}),e})();var Y=s(41075);const N=[{path:"",redirectTo:"user-name-change"},{path:"user-name-change",component:J}];let E=(()=>{class e{}return e.\u0275fac=function(r){return new(r||e)},e.\u0275mod=m.oAB({type:e}),e.\u0275inj=m.cJS({imports:[[n.ez,t.Bz.forChild(N),Y.m,a.p0,Z.o5.forRoot({style:"slide-down",spinnerSize:30,spinnerColor:"#000",spinnerLines:12})],t.Bz]}),e})()}}]);
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.