import{a as l,b as x}from"./chunk-KH4HZS4S.js";import{a as g,b as B}from"./chunk-WKM7YEYY.js";import{P as d,Q as w}from"./chunk-ANSWGJBN.js";import{Aj as v,Bj as R,Ee as p,Fe as k}from"./chunk-XBRJZCAD.js";import{a as o,b as A,g as S,h as I}from"./chunk-AIHAZUSZ.js";import{j as h,s as j}from"./chunk-KADRYNDC.js";import{b as f,c as b}from"./chunk-IOINCEV4.js";import{Gd as T,O as c,ka as n,na as y,sa as u,x as a,xa as i}from"./chunk-JSJB5BKT.js";import{e as C}from"./chunk-SZAW6ZBW.js";var N,D=C(()=>{y();A();k();x();B();T();b();I();w();R();j();N=(()=>{class r extends g{constructor(t,e,s,m,E){super(t,e,s),this.assetServices=m,this.messageService=E}getEmailConfiguration(t=!1){let e=this.assetServices.GetEmailConfiguration().pipe(c(s=>this.handleCatchError(s,l)),n(s=>this.handleGetApiResult(s)),a(s=>this.isSuccessful(s)?[new p(s.data)]:[]));return this.getCache(t,e).pipe(a(s=>s[0]))}saveEmailConfiguration(t){return this.assetServices.SaveEmailConfiguration(t).pipe(c(e=>this.handleCatchError(e,l)),n(e=>this.sendToastOnSuccess(e)),n(()=>this.invalidateCache()),a(e=>this.handleSaveApiResult(e)))}testEmailConfiguration(t){return this.assetServices.TestEmailConfiguration(t).pipe(c(e=>this.handleCatchError(e,l)),a(e=>this.sendToastAfterTest(e)))}sendToastOnSuccess(t){t.result===o.Success&&this.messageService.add({key:"globalToast",severity:"success",summary:this.translatorService.translate("gbSavedSuccessfully"),detail:this.translatorService.translate("TheDataHasBeenSuccessfullySaved")})}sendToastAfterTest(t){let e=t.result===o.Success?"success":"error",s=t.result===o.Success?"EmailSent":"ErrorSendingEmail",m=t.result===o.Success?"":t.errorMessage;this.messageService.add({key:"globalToast",severity:e,summary:this.translatorService.translate(s),detail:m})}static{this.\u0275fac=function(e){return new(e||r)(i(f),i(S),i(d),i(v),i(h))}}static{this.\u0275prov=u({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})()});export{N as a,D as b};
