import{d}from"./chunk-MANB3PJC.js";import{f as y}from"./chunk-A4FSGNM7.js";import{F as l,tc as o,uc as a}from"./chunk-CBXQYRPM.js";import{Bc as p,Ec as u,ca as r,da as c,fa as s,la as f}from"./chunk-LVXYIJUI.js";var M=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=f({type:i})}static{this.\u0275inj=c({imports:[p]})}}return i})();var h=(()=>{class i{constructor(e){this.restService=e}getSystemSettingsForBusinessUnit(e){let t=new u;return t=t.append("businessUnitID",e),this.restService.get(l.SYSTEM_SETTINGS,t)}static{this.\u0275fac=function(t){return new(t||i)(s(d))}}static{this.\u0275prov=r({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var v=(()=>{class i{constructor(e){this.systemSettingsService=e}getSystemSettingsForBusinessUnit(e){return this.systemSettingsService.getSystemSettingsForBusinessUnit(e)}static{this.\u0275fac=function(t){return new(t||i)(s(h))}}static{this.\u0275prov=r({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var S=(()=>{class i{constructor(e,t){this.systemSettingsFacade=e,this.loggingService=t,this.systemSettingsMap=new Map}loadSystemSettings(e){return a.isNullOrUndefined(this.systemSettingsMap.get(e))?new Promise((t,g)=>{this.systemSettingsFacade.getSystemSettingsForBusinessUnit(e).subscribe({next:n=>{this.systemSettingsMap.set(e,n),t(n)},error:n=>{g(n)}})}):this.systemSettingsMap.get(e)}getSystemSetting(e){return this.getSystemSettingForBusinessUnit(e,o.getBusinessUnit().id)}getSystemSettingForBusinessUnit(e,t){return a.isNullOrUndefined(this.systemSettingsMap)||a.isNullOrUndefined(this.systemSettingsMap.get(t))?null:this.systemSettingsMap.get(t).find(g=>g.name===e)}getBooleanSettingValue(e){let t=this.getSystemSetting(e);return t.typeOfValue==="B"?t.value==="Y":(this.loggingService.error(t.name+" is not boolean"),!1)}getStringSettingValue(e){let t=this.getSystemSetting(e);return t.typeOfValue==="S"?t.value!==""?t.value:"":(this.loggingService.error(t.name+" is not string"),"")}getNumberSettingValue(e){let t=this.getSystemSetting(e);if(t.typeOfValue==="I"||t.typeOfValue==="F"||t.typeOfValue==="L")return t.value!==""?Number(t.value):void 0;this.loggingService.error(t.name+" is not a number")}clearSystemSettingsMap(){this.systemSettingsMap.clear()}static{this.\u0275fac=function(t){return new(t||i)(s(v),s(y))}}static{this.\u0275prov=r({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var b=(()=>{class i{constructor(e){this.systemSettingsManager=e}resolve(){return this.systemSettingsManager.loadSystemSettings(o.getBusinessUnit().id)}static{this.\u0275fac=function(t){return new(t||i)(s(S))}}static{this.\u0275prov=r({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{M as a,S as b,b as c};
