import{a as h,b as w}from"./chunk-SM7EQ7ST.js";import{c as m,d as j}from"./chunk-RWCAFOHA.js";import{Gk as f,Hk as J,Qd as v,Rd as R,Sd as d,Td as G}from"./chunk-BPZQKZKD.js";import{a as u,b as y}from"./chunk-6B6CBPYV.js";import{Da as S,La as A}from"./chunk-5E3JCGAH.js";import{b as l,c as T}from"./chunk-YBNTOQCK.js";import{Sa as b,be as g,ka as i,ta as p,x as r,xa as c}from"./chunk-WL5U2YIT.js";import{e as B}from"./chunk-ADEKKGI2.js";var M,O=B(()=>{b();G();w();y();R();g();J();A();T();j();M=(()=>{let t=class t extends h{constructor(e,s,n,a){super(n,a),this.assetsService=e,this.messageService=s}backupNow(){return this.assetsService.BackupNow().pipe(i(e=>this.handleApiResult(e,"BackupFailed")),i(e=>this.sendBackupToastOnSuccess(e)),r(e=>this.isSuccessful(e)))}saveBackupConfig(e){return this.assetsService.SaveBackupJob(e).pipe(i(s=>this.sendToastOnSuccess(s)),r(s=>this.handleSaveApiResult(s)))}getBackupJob(){return this.assetsService.GetBackupJob().pipe(i(e=>this.handleGetApiResult(e)),r(e=>this.returnWhenSuccessful(e,()=>new v(e.data))))}getDatabaseBackupsLogs(e,s,n){return this.assetsService.GetDatabaseBackupLogs(e,s,n).pipe(i(a=>this.handleGetApiResult(a)),r(a=>this.returnWhenSuccessful(a,()=>(a.data||[]).map(k=>new d(k)))))}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")})}};t.\u0275fac=function(s){return new(s||t)(c(f),c(S),c(l),c(m))},t.\u0275prov=p({token:t,factory:t.\u0275fac,providedIn:"root"});let o=t;return o})()});export{M as a,O as b};
