import{Wj as d,Xj as G,a as m,b as j,ud as h,vd as w,wd as v,xd as R}from"./chunk-2GUKPKKM.js";import{a as u,b as T,g as S,h as A}from"./chunk-CUIDVWNH.js";import{Da as p,La as g}from"./chunk-5YPL7P3G.js";import{b as l,c as y}from"./chunk-IBUDDWQO.js";import{Sd as b,ka as a,oa as B,ta as n,x as r,ya as c}from"./chunk-XJKQ67XR.js";import{e as k}from"./chunk-SZAW6ZBW.js";var H,J=k(()=>{B();R();j();T();w();b();G();g();y();A();H=(()=>{class i extends m{constructor(e,s,o,t){super(o,t),this.assetsService=e,this.messageService=s}backupNow(){return this.assetsService.BackupNow().pipe(a(e=>this.handleApiResult(e,"BackupFailed")),a(e=>this.sendBackupToastOnSuccess(e)),r(e=>this.isSuccessful(e)))}saveBackupConfig(e){return this.assetsService.SaveBackupJob(e).pipe(a(s=>this.sendToastOnSuccess(s)),r(s=>this.handleSaveApiResult(s)))}getBackupJob(){return this.assetsService.GetBackupJob().pipe(a(e=>this.handleGetApiResult(e)),r(e=>this.returnWhenSuccessful(e,()=>new h(e.data))))}getDatabaseBackupsLogs(e,s,o){return this.assetsService.GetDatabaseBackupLogs(e,s,o).pipe(a(t=>this.handleGetApiResult(t)),r(t=>this.returnWhenSuccessful(t,()=>(t.data||[]).map(f=>new v(f)))))}sendToastOnSuccess(e){e.result===u.Success&&this.messageService.add({key:"globalToast",severity:"success",summary:this.translatorService.translate("lblSavedSuccessfully"),detail:this.translatorService.translate("TheDataHasBeenSuccessfullySaved")})}sendBackupToastOnSuccess(e){e.result===u.Success&&this.messageService.add({key:"globalToast",severity:"success",summary:this.translatorService.translate("Success"),detail:this.translatorService.translate("BackupCreated")})}static{this.\u0275fac=function(s){return new(s||i)(c(d),c(p),c(l),c(S))}}static{this.\u0275prov=n({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})()});export{H as a,J as b};
