import{a as v,b as I}from"./chunk-M55KBHC5.js";import{P as S,Q as j}from"./chunk-JE2X3YFA.js";import{Wj as u,Xj as P}from"./chunk-GDJMZZ4C.js";import{g as h,h as N}from"./chunk-V3J5YJ3L.js";import{Da as f,La as y}from"./chunk-2XIOYYFS.js";import{b as l,c as b}from"./chunk-YTY7HHO3.js";import{Rd as o,ka as r,na as g,sa as c,x as s,xa as a,ya as n}from"./chunk-4HFZZ7HS.js";import{e as d}from"./chunk-SZAW6ZBW.js";var D,T=d(()=>{o();P();g();I();o();b();N();j();y();D=(()=>{class i extends v{constructor(e,t,m,p){super(e,t,m),this.messageService=p,this.assetService=n(u)}hasNotificationPreferences(){return this.getNotificationPreferences().pipe(s(e=>(e.notifications||[]).length>0))}getNotificationPreferences(e=!1){return this.getCache(e,this.getNotificationPreferencesInternal()).pipe(s(t=>t[0]))}saveNotificationPreferences(e){return this.assetService.SaveNotificationPreferences(e).pipe(r(t=>this.handleSaveApiResult(t)),r(t=>this.notifyWhenSuccessful(t)),r(()=>this.invalidateCache()),s(t=>this.isSuccessful(t)))}getNotificationPreferencesInternal(){return this.assetService.GetNotificationPreferences().pipe(r(e=>this.handleGetApiResult(e)),s(e=>this.returnWhenSuccessful(e,()=>[e.data])))}notifyWhenSuccessful(e){this.isSuccessful(e)?this.messageService.add({key:"globalToast",severity:"success",summary:this.translatorService.translate("lblSavedSuccessfully"),detail:this.translatorService.translate("TheDataHasBeenSuccessfullySaved")}):this.messageService.add({key:"globalToast",severity:"error",summary:this.translatorService.translate("UnableToSave"),detail:this.translatorService.translate("lbl")})}static{this.\u0275fac=function(t){return new(t||i)(a(l),a(h),a(S),a(f))}}static{this.\u0275prov=c({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})()});export{D as a,T as b};
