import {I as Ie,G as Ge}from'./chunk-Ctuz9302.js';import {B as Bt,T as Tt,V as Vt,G as Gn,Z as Zt,A as An}from'./chunk-LefFgkPz.js';import {J,c9 as qn,U as RN,a5 as fh,c$ as Nn,i as S,dt as Mr,c as tS,H as ul,b2 as v,bE as ff,bI,w as wo,N as Sr,ab as LN,bc as I,f as QT,dd as kn,d2 as f3,dO as W1,X as _z,u as R,a0 as ks,e5 as Gu,z as vM,a3 as Py,a2 as Uu,e6 as zu,a1 as Ny,a4 as Sy,A as Iw,cg as J_,F as EM,bu as dy,eU as aM,c5 as bD,ad as ce}from'./main-WUGO6e7n.js';import {u,d}from'./chunk-BrIGe1dS.js';import {p,l}from'./chunk-CIbFTbhP.js';import {C,x}from'./chunk-C5G179Xd.js';import'./chunk-4Rs3CU3G.js';import'./chunk-DATJc-cZ.js';import'./chunk-22oEX_gu.js';import'./chunk-xXTLHPtB.js';import'./chunk-CJkK6c63.js';import'./chunk-Zo-A94UO.js';import'./chunk-bYPVerW8.js';import'./chunk-CMtkBVHe.js';import'./chunk-DCkN4Kxk.js';import'./chunk-BhXYzBYS.js';import'./chunk-CGM-uNoq.js';import'./chunk-WnN3EHPQ.js';import'./chunk-C-UoRr_7.js';import'./chunk-D2CgDHjp.js';import'./chunk-DgjB3m1L.js';import'./chunk-Blf_arF2.js';import'./chunk-KghqFjfJ.js';import'./chunk-BadIw3lc.js';var g,A=J(()=>{u();tS();g=(()=>{class i extends d{static{this.\u0275fac=(()=>{let e;return function(t){return (e||(e=bD(i)))(t||i)}})();}static{this.\u0275prov=ce({token:i,factory:i.\u0275fac,providedIn:"root"});}}return i})();});var ye,le=J(()=>{qn();C();Bt();A();u();p();RN();fh();Nn();S();Mr();Ie();Tt();Vt();tS();Bt();A();ul();RN();v();ye=(()=>{class i extends x{constructor(e,s,t,r,l){super(),this.privilegedAccessRisksService=e,this.editService=s,this.translator=t,this.dvlConfirmationService=r,this.longOpService=l,this.titleHeader=[{title:this.translator.translate("lblAdministration")},{title:this.translator.translate("lblPrivilegedAccessManagement"),link:"/administration/pam/"},{title:this.translator.translate("lblPrivilegedAccessRisk")}],this.privilegedAccessRisks=[];}ngOnInit(){super.ngOnInit(),this.loadPrivilegedAccessRisks();}getComponentTitle(){return this.translator.translate("lblPrivilegedAccessRisk")}loadPrivilegedAccessRisks(){this.longOpService.showIndicator(),this.privilegedAccessRisksService.getAll().pipe(ff(this.destroyed$),bI(()=>this.longOpService.hideIndicator())).subscribe(e=>{this.privilegedAccessRisks=e??[];});}addPrivilegedAccessRisk(){this.editService.create({accept:()=>this.loadPrivilegedAccessRisks()});}onEdit(e){this.editService.edit({id:e.id,options:{isReadOnly:!1},accept:()=>this.loadPrivilegedAccessRisks()});}onDelete(e){if(!e.id){let s=this.privilegedAccessRisks.indexOf(e);s!==-1&&this.privilegedAccessRisks.splice(s,1);return}this.dvlConfirmationService.confirm({intent:"danger",acceptLabel:this.translator.translate("lblDelete"),title:this.translator.translate("lblDelete"),message:this.translator.translate("DoYouReallyWantToDeleteX",e.name),accept:()=>{this.longOpService.showIndicator(),this.privilegedAccessRisksService.delete(e.id).pipe(ff(this.destroyed$),bI(()=>this.longOpService.hideIndicator())).subscribe(()=>{this.loadPrivilegedAccessRisks();});}});}ngOnDestroy(){super.ngOnDestroy();}static{this.\u0275fac=function(s){return new(s||i)(wo(Gn),wo(g),wo(Sr),wo(LN),wo(I))};}static{this.\u0275cmp=QT({type:i,selectors:[["dvls-privileged-access-risk-dashboard"]],features:[aM([{provide:d,useExisting:g},{provide:l,useExisting:Gn}]),dy],decls:8,vars:12,consts:[[3,"titlePage"],["header-right",""],["variant","icon","icon","di dvl-icon-add","showDelay","500","tooltipPosition","bottom",3,"onClick","dvlTooltip"],["variant","icon","showDelay","500","tooltipPosition","bottom","icon","di dvl-icon-refresh",3,"onClick","dvlTooltip"],[3,"onEditRow","onDeleteRow","onRefresh","items","enableTreeView"],[3,"hideProviderTypeDropdown"]],template:function(s,t){s&1&&(ks(0,"dvl-page-wrapper-v2",0),Gu(1,1),ks(2,"dvl-button",2),vM(3,"translate"),Py("onClick",function(){return t.addPrivilegedAccessRisk()}),Uu(),ks(4,"dvl-button",3),vM(5,"translate"),Py("onClick",function(){return t.loadPrivilegedAccessRisks()}),Uu(),zu(),ks(6,"dvls-privileged-access-risk-list",4),Py("onEditRow",function(l){return t.onEdit(l)})("onDeleteRow",function(l){return t.onDelete(l)})("onRefresh",function(){return t.loadPrivilegedAccessRisks()}),Uu()(),Ny(7,"dvls-privileged-access-risk-details",5)),s&2&&(Sy("titlePage",t.titleHeader),Iw(2),Sy("dvlTooltip",J_(EM(3,8,"lblAdd"))),Iw(2),Sy("dvlTooltip",J_(EM(5,10,"lblRefresh"))),Iw(2),Sy("items",t.privilegedAccessRisks)("enableTreeView",!0),Iw(),Sy("hideProviderTypeDropdown",!1));},dependencies:[kn,Ge,f3,W1,Zt,An,_z,R],encapsulation:2,changeDetection:1});}}return i})();});le();export{ye as PrivilegedAccessRiskDashboardComponent};