import{a as n,b as l}from"./chunk-4N5DMUBB.js";import{c as o}from"./chunk-VRBUVT76.js";import{S as a,X as c,f as e}from"./chunk-56X5LYJH.js";var y=class r{constructor(t){this.stateFactory=t;this.facilityState=this.stateFactory.create(n.facilitySwitcher)}_facilityChanged=new e;facilityChanged$=this._facilityChanged.asObservable();notifyFacilityChanged(t){this._facilityChanged.next(t)}facilityState;currentFacility(){let t=this.facilityState?.getCurrentItem();if(t!=null)return t;let i=localStorage.getItem(o.currentFacility);if(!i)return null;try{return JSON.parse(i)??null}catch{return null}}getFacilityId(){return this.currentFacility()?.id||null}static \u0275fac=function(i){return new(i||r)(c(l))};static \u0275prov=a({token:r,factory:r.\u0275fac,providedIn:"root"})};export{y as a};
