import{Aj as l,Bj as b,s as h,t as K}from"./chunk-5XZEGBWY.js";import{g as p,h as y}from"./chunk-AIHAZUSZ.js";import{j as n,s as f}from"./chunk-KADRYNDC.js";import{b as u,c as v}from"./chunk-IOINCEV4.js";import{Gd as S,ka as r,na as A,sa as o,x as a,xa as c}from"./chunk-JSJB5BKT.js";import{e as m}from"./chunk-SZAW6ZBW.js";var E,T=m(()=>{A();K();S();v();y();b();f();E=(()=>{class i extends h{constructor(e,t,s,d){super(e,t),this.assetService=s,this.messageService=d}generateApiKey(){return this.assetService.GenerateApiKey().pipe(r(e=>this.handleGetApiResult(e)),r(e=>this.executeBasedOnResult(e,()=>this.showToast("success","lblSuccess","YourApiKeyWasGenerated"),()=>this.showToast("error","lblError","AnUnexpectedErrorOccuredContactYourAdmin"))),a(e=>this.returnWhenSuccessful(e,()=>e.data)))}deleteApiKey(e){return this.assetService.DeleteApiKey(e).pipe(r(t=>this.handleGetApiResult(t)),r(t=>this.executeBasedOnResult(t,()=>this.showToast("success","lblSuccess","YourApiKeyWasDeleted"),()=>this.showToast("error","lblError","AnUnexpectedErrorOccuredContactYourAdmin"))),a(t=>this.returnWhenSuccessful(t,()=>!0)))}updateApiKey(e,t){return this.assetService.UpdateApiKey(e,t).pipe(r(s=>this.handleGetApiResult(s)),a(s=>this.returnWhenSuccessful(s,()=>s)))}listApiKeys(){return this.assetService.ListApiKeys().pipe(r(e=>this.handleGetApiResult(e)),a(e=>this.returnWhenSuccessful(e,()=>e.data)))}showToast(e,t,s){this.messageService.add({key:"globalToast",severity:e,summary:this.translatorService.translate(t),detail:this.translatorService.translate(s)})}static{this.\u0275fac=function(t){return new(t||i)(c(u),c(p),c(l),c(n))}}static{this.\u0275prov=o({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})()});export{E as a,T as b};
