import{a as m,b as k,g as C,h as w}from"./chunk-5FX4M4Q3.js";import{D as v,E as $}from"./chunk-INYFUTXB.js";import{Wj as f,Xj as F}from"./chunk-2GUKPKKM.js";import{Da as l,La as z}from"./chunk-5YPL7P3G.js";import{b as d,c as j}from"./chunk-IBUDDWQO.js";import{J as u,Sd as I,g as n,h as o,ia as s,ka as a,na as b,oa as A,ta as h,x as c,ya as i}from"./chunk-XJKQ67XR.js";import{e as y}from"./chunk-SZAW6ZBW.js";var q,x=y(()=>{b();A();k();I();z();j();w();$();F();q=(()=>{class r{constructor(e,t,S,p,g){this.messageService=e,this.translatorService=t,this.authenticationConfigurationService=S,this.serverInformationService=p,this.assetServices=g,this.destroyed$=new n,this.azureConfiguration=new o(new m),this.azureConfiguration$=this.azureConfiguration.asObservable()}ngOnDestroy(){this.destroyed$.next()}fetchAzureConfiguration(){this.authenticationConfigurationService.getAzureAuthenticationConfiguration().pipe(s(this.destroyed$),a(e=>e.useClientIdForCache=e.usersRolesCacheClientId?.length>0)).subscribe(e=>this.azureConfiguration.next(e))}isCacheEnabled(){return this.assetServices.GetAzureAuthenticationIsCacheEnabled().pipe(c(e=>!!e.data))}save(e){return e.useClientIdForCache||(e.usersRolesCacheClientId=null),this.authenticationConfigurationService.saveAzureAuthenticationConfiguration(e).pipe(s(this.destroyed$),u(t=>t),a(()=>{this.fetchAzureConfiguration(),this.serverInformationService.update()}))}testConnection(e){e.useClientIdForCache||(e.usersRolesCacheClientId=null),this.authenticationConfigurationService.testAzureSync(e).pipe(s(this.destroyed$)).subscribe(t=>{t?this.messageService.add({key:"globalToast",severity:"success",summary:this.translatorService.translate("Success"),detail:this.translatorService.translate("ConnectedSuccessfully")}):this.messageService.add({key:"globalToast",severity:"error",summary:this.translatorService.translate("Failed"),detail:this.translatorService.translate("ConnectionFailed")})})}static{this.\u0275fac=function(t){return new(t||r)(i(l),i(d),i(C),i(v),i(f))}}static{this.\u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})()});export{q as a,x as b};
