import {a,d}from'./chunk-C4Ue8rbb.js';import {r,s}from'./chunk-DmycXHVF.js';import {U,I,h,b,Q,f}from'./chunk-Dl0oUbq-.js';import {J,a6 as pi,c as tS,fA as rs,i2 as w,H as ul,bP as he,bK as G,bJ as F$1,aa as ye,fC as is,i3 as N,N as Sr,ad as ce,fL as x,a5 as fh,b3 as w$1,a7 as si,ag as lp,aY as qp,G as vl,fM as F$2,ah as ot,aJ as hf,al as Kv,bd as K,ac as Dr,am as Dh,b5 as HE,Y}from'./main-WUGO6e7n.js';var F,k=J(()=>{a();U();r();pi();I();tS();rs();w();ul();F=(()=>{class o{constructor(e,t,s){this.dataSourceSettingsService=e,this.dropdownHelper=t,this.translatorService=s,this.subscriptionEdited=new he,this.selectedCheckboxValuesChanged=new he,this.isSaving=!1,this.excludedActions=[h.Created,h.Executed,h.Viewed,h.Copied,h.Exported,h.Synchronized,h.ResetPasswordScheduleAdded,h.ResetPasswordScheduleDeleted,h.InvalidValue,h.DevolutionsGatewayDown];}initCheckboxValues(){let e=this.dataSourceSettingsService.dataSourceSettingsSnapshot?.excludedUserSubscriptionAction.concat(this.excludedActions);return this.dropdownHelper.initComboEnum(d,e).map(t=>G(F$1({},t),{label:this.translatorService.translate(`NotificationEventAction_${d[t.value]}`)}))}getCheckboxValuesForSessions(){let e=[h.Opened,h.Closed];return this.initCheckboxValues().filter(t=>!e.includes(t.value))}selectedValuesToFilter(e){let t=[];return e.forEach(s$1=>t.push({filterTarget:b.Action,textSearchModel:{inverseResult:!1,searchItem:s.ExactExpression},value:h[s$1.value]})),t}toggleIsSaving(){this.isSaving?setTimeout(()=>this.isSaving=!1,1e3):this.isSaving=!0;}static{this.\u0275fac=function(t){return new(t||o)(ye(is),ye(N),ye(Sr))};}static{this.\u0275prov=ce({token:o,factory:o.\u0275fac,providedIn:"root"});}}return o})();});var ge,ee=J(()=>{x();pi();U();fh();tS();ul();w$1();si();Q();lp();k();qp();vl();ge=(()=>{class o extends F$2{constructor(e,t,s,D,R,N,M,G){super(e,t,s),this.subscriptionService=D,this.assetServices=R,this.userSubscriptionEditService=N,this.connectionService=M,this.router=G,this.viewRequest=new he;}view(){this.viewRequest.next();}getUserSubscriptions(e=!1){return this.getCache(e,this.getUserSubscriptionsInternal())}getUserSubscriptionsViewModels(e=!1){return this.getUserSubscriptions(e).pipe(ot(t=>this.toViewModels(t)))}getSubscriptionConnectionId(e){let t=e.filters.find(s=>s.filterTarget===b.ID);return t?t.value:null}refreshUserSubscriptions(){this.userSubscriptionEditService.subscriptionEdited.next();}delete(e){return this.subscriptionService.delete(e)}onEntryClick(e){let t=e.filters.find(s=>s.filterTarget===b.ID)?.value;t&&this.connectionService.getPartialConnection(t).subscribe(s=>this.router.navigate([`connections/${s.repositoryId}/${s.id}`]));}toViewModels(e){return this.subscriptionService.toViewModels(e)}getUserSubscriptionsInternal(){return this.currentUserService.isLogged()?this.assetServices.GetSubscriptionsForCurrentUser().pipe(hf(e=>this.handleGetApiResult(e)),ot(e=>this.returnWhenSuccessful(e,()=>e.data??[]))):Kv([])}static{this.\u0275fac=function(t){return new(t||o)(ye(Sr),ye(K),ye(Dr),ye(f),ye(Dh),ye(F),ye(HE),ye(Y))};}static{this.\u0275prov=ce({token:o,factory:o.\u0275fac,providedIn:"root"});}}return o})();});export{F,ee as e,ge as g,k};