import{a as d,b as A,g as v,h as j}from"./chunk-UNTATDR5.js";import{B as f,C as z}from"./chunk-FYLDFXYJ.js";import{j as h,s as b}from"./chunk-KADRYNDC.js";import{b as l,c as I}from"./chunk-IOINCEV4.js";import{Gd as y,J as c,g as o,h as n,ia as s,ka as a,ma as p,na as g,sa as u,xa as r}from"./chunk-JSJB5BKT.js";import{e as S}from"./chunk-SZAW6ZBW.js";var B,F=S(()=>{p();g();A();y();b();I();j();z();B=(()=>{class i{constructor(e,t,C,m){this.messageService=e,this.translatorService=t,this.authenticationConfigurationService=C,this.serverInformationService=m,this.destroyed$=new o,this.azureConfiguration=new n(new d),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))}save(e){return e.useClientIdForCache||(e.usersRolesCacheClientId=null),this.authenticationConfigurationService.saveAzureAuthenticationConfiguration(e).pipe(s(this.destroyed$),c(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||i)(r(h),r(l),r(v),r(f))}}static{this.\u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})()});export{B as a,F as b};
