"use strict";(self.webpackChunkwebadmin=self.webpackChunkwebadmin||[]).push([["libs_dialogs_delete-cloud-user_delete-cloud-user_component_ts"],{35048:(P,c,o)=>{o.r(c),o.d(c,{DeleteCloudUserModalContent:()=>b});var _=o(60177),n=o(89417),i=o(60802),u=o(19689),m=o(58415),p=o(40221),E=o(48233),e=o(4020),C=o(39060),M=o(90232),h=o(82529),g=o(64147),D=o(60272);const U=["deleteCloudUserForm"];function f(a,w){if(1&a){const t=e.RV6();e.j41(0,"button",16),e.bIt("click",function(){e.eBV(t);const s=e.XpG();return e.Njj(s.close())})("mousedown",function(){e.eBV(t);const s=e.XpG();return e.Njj(s.clearErrors())}),e.nrm(1,"div",17),e.k0s()}}let b=(()=>{class a extends p.f{constructor(t,r,s){super(s),this.processService=t,this.cloudService=r,this.LANG=E,this.passwordForUser="",this.passwordError=""}ngOnInit(){this.deleteCloudUser=this.processService.createProcess(()=>(this.lock(),this.cloudService.deleteCloudUser(this.passwordForUser)),{errorCodes:{forbidden:this.LANG.errorCodes.cantDeleteAccountOwningSystems,wrongParameters:()=>{this.deleteForm.form.controls.password.setErrors({passwordMissing:!0}),this.passwordError=this.LANG.passwordRequirements.missingMessage},wrongPassword:()=>{this.deleteForm.form.controls.password.setErrors({passwordWrong:!0}),this.passwordError=this.LANG.errorCodes.notAuthorized}},ignoreError:!1},t=>{"ok"===t.resultCode&&this.close(t),this.unlock()},()=>{this.unlock()})}clearErrors(){this.deleteForm.form.controls.password.setErrors({})}setPassword(t){this.passwordError=t.touched&&t.errors?.required?this.LANG.passwordRequirements.missingMessage:"",this.passwordForUser=t.value}static{this.\u0275fac=function(r){return new(r||a)(e.rXU(C.z),e.rXU(M.p),e.rXU(h.ce))}}static{this.\u0275cmp=e.VBU({type:a,selectors:[["nx-modal-delete-cloud-user-content"]],viewQuery:function(r,s){if(1&r&&e.GBs(U,5),2&r){let l;e.mGM(l=e.lsd())&&(s.deleteForm=l.first)}},features:[e.Vt3],decls:22,vars:14,consts:[["deleteCloudUserForm","ngForm"],["password","ngModel"],["name","deleteCloudUserForm","novalidate",""],[1,"modal-header"],["translate","",1,"modal-title"],["type","button","class","close","data-dismiss","modal","aria-label","Close",3,"click","mousedown",4,"ngIf"],[1,"modal-body"],[1,"form-group"],[1,"modal-paragraph"],["translate",""],["for","password","translate","",1,"label","control-label","mb-2"],["id","password","name","password","type","password","required","",1,"form-control",3,"ngModelChange","blur","ngModel"],["for","password",1,"error-label","mt-2","mb-0",2,"min-height","12px"],[1,"modal-footer"],["actionType","danger",3,"process","form","buttonText"],[3,"process","cancelFn","discardFn","id"],["type","button","data-dismiss","modal","aria-label","Close",1,"close",3,"click","mousedown"],[1,"close-content"]],template:function(r,s){if(1&r){const l=e.RV6();e.j41(0,"form",2,0)(2,"div",3)(3,"h1",4),e.EFF(4," Delete Account? "),e.k0s(),e.DNE(5,f,2,0,"button",5),e.k0s(),e.j41(6,"div",6)(7,"div",7)(8,"div",8)(9,"span",9),e.EFF(10,"Your account and all data associated with it will be permanently deleted without the possibility to restore it."),e.k0s()(),e.j41(11,"label",10),e.EFF(12,"Enter your account password to continue"),e.k0s(),e.j41(13,"input",11,1),e.bIt("ngModelChange",function(){e.eBV(l);const d=e.sdS(14);return e.Njj(s.setPassword(d))})("blur",function(){e.eBV(l);const d=e.sdS(14);return e.Njj(s.setPassword(d))}),e.k0s(),e.j41(15,"label",12),e.EFF(16),e.nI1(17,"translate"),e.k0s()()(),e.j41(18,"div",13),e.nrm(19,"nx-process-button",14),e.nI1(20,"translate"),e.nrm(21,"nx-cancel-button",15),e.k0s()()}if(2&r){const l=e.sdS(1);e.R7$(5),e.Y8G("ngIf",s.closable),e.R7$(8),e.Y8G("ngModel",s.passwordForUser),e.R7$(3),e.JRh(e.bMT(17,10,s.passwordError)),e.R7$(3),e.Y8G("process",s.deleteCloudUser)("form",l)("buttonText",e.bMT(20,12,s.LANG.dialogs.buttons.delete)),e.R7$(2),e.Y8G("process",s.deleteCloudUser)("cancelFn",s.unlock)("discardFn",s.close)("id","cancelRemoveUserBtn")}},dependencies:[_.MD,_.bT,n.YN,n.qT,n.me,n.BC,n.cb,n.YS,n.vS,n.cV,i.h,g.M,D.D,u.f,m.N],encapsulation:2})}}return a})()}}]);