import{a as v,b as T}from"./chunk-SN34CLEC.js";import{a as u,b as C}from"./chunk-NMBI62AY.js";import{a as h,c as g}from"./chunk-4MUEJ55U.js";import{$ as I,Wa as l,Xa as A,_ as o}from"./chunk-SS6ERTE2.js";import{V as c,W as P}from"./chunk-INYFUTXB.js";import{O as p,Sd as d,na as S,oa as O,r as m,ta as n,x as i,ya as s}from"./chunk-XJKQ67XR.js";import{e as f}from"./chunk-SZAW6ZBW.js";var y,_=f(()=>{S();O();T();I();g();d();C();A();P();y=(()=>{class r extends v{constructor(e,t,a){super(),this.errorService=e,this.pamAssetServices=t,this.cachingItem=new h(a)}create(e){return new o(e)}get(e){return this.pamAssetServices.PamOtp_GetPamOtpTemplate(e)}save(e){return e.id?this.update(e).pipe(i(t=>t?.id)):this.createTemplate(e).pipe(i(t=>t?.id))}delete(e){return this.cachingItem.invalidateCache(),this.pamAssetServices.PamOtp_DeleteOtpTemplate(e).pipe(i(()=>!0))}getCredentialOtpCombineInfo(e){return this.pamAssetServices.PamOtp_GetCredentialOtpCombineInfo(e)}getList(e=!1,t=!0){return this.pamAssetServices.PamOtp_GetPamOtpTemplates(e,t)}getListAsSelectItems(e=!1){return this.cachingItem.getCache(e,this.getListAsSelectItemsInternal())}resolvePamCredentialOtp(e,t=!0){return t?this.handleError(this.pamAssetServices.PamOtp_ResolveCredentialOtp(e,!1)):this.pamAssetServices.PamOtp_ResolveCredentialOtp(e,!1)}resolvePamOtpTemplate(e){return this.pamAssetServices.PamOtp_ResolveOtp(e)}getListAsSelectItemsInternal(){return this.getList(!0,!1).pipe(i(e=>this.toSelectItems(e)))}toSelectItems(e){return e?e.map(t=>this.toSelectItem(t)):null}toSelectItem(e){return{label:e.name,value:e.id,otpTemplate:e}}createTemplate(e){return this.cachingItem.invalidateCache(),this.pamAssetServices.PamOtp_PostPamOtpTemplate(e)}update(e){return this.cachingItem.invalidateCache(),this.pamAssetServices.PamOtp_PutPamOtpTemplates(e.id,e)}handleError(e,t=null){return e.pipe(p(a=>(this.errorService.handleError(a),m(t))))}static{this.\u0275fac=function(t){return new(t||r)(s(u),s(l),s(c))}}static{this.\u0275prov=n({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})()});export{y as a,_ as b};
