import {p,l}from'./chunk-CIbFTbhP.js';import {S,R}from'./chunk-DgjB3m1L.js';import {j,h}from'./chunk-Blf_arF2.js';import {J,a6 as pi,a5 as fh,oI as Ui,c as tS,eO as Es,a7 as si,oJ as N,ah as ot,ak as Jd,al as Kv,aa as ye,eR as mh,ac as Dr,ad as ce}from'./main-WUGO6e7n.js';var y,_=J(()=>{pi();fh();p();Ui();j();tS();S();Es();si();y=(()=>{class r extends l{constructor(e,t,a){super(),this.errorService=e,this.pamAssetServices=t,this.cachingItem=new h(a);}create(e){return new N(e)}get(e){return this.pamAssetServices.PamOtp_GetPamOtpTemplate(e)}save(e){return e.id?this.update(e).pipe(ot(t=>t?.id)):this.createTemplate(e).pipe(ot(t=>t?.id))}delete(e){return this.cachingItem.invalidateCache(),this.pamAssetServices.PamOtp_DeleteOtpTemplate(e).pipe(ot(()=>!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(ot(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(Jd(a=>(this.errorService.handleError(a),Kv(t))))}static{this.\u0275fac=function(t){return new(t||r)(ye(R),ye(mh),ye(Dr))};}static{this.\u0275prov=ce({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();});export{_,y};