import{a as N}from"./chunk-KZKY3ROD.js";import{m as $,p as g,x as d}from"./chunk-ZTKV4AIV.js";import{b as l}from"./chunk-5JDCLYZA.js";import{h as I}from"./chunk-73IMXZSJ.js";import{E as r,G as s,K as h,aa as p,bb as i,cb as u,ha as f,i as a,na as m,p as n,u as o}from"./chunk-FWZCAEAJ.js";var S="soId",A=(()=>{let t=class t{constructor(){this.httpClient=m(I),this.selectedIdChange$=new a($(S)),this.selectedLoaded$=this.selectedIdChange$.pipe(s(d),p(e=>this.httpClient.get(`/config/organisation/${e}`)),h(()=>n(void 0))),this.selectedState=u({status:"UNSET"}),this.status=i(()=>this.selectedState().status),this.selectedId=i(()=>this.selectedState().selectedId),this.selected=i(()=>this.selectedState().selected),this.selectedId$=l(this.selectedId),this.selectedIdNotNull$=this.selectedId$.pipe(s(d)),this.selected$=l(this.selected),this.selectedNotNull$=this.selected$.pipe(s(d)),N(this.selectedState,r(this.selectedIdChange$.pipe(o(e=>({selectedId:e,selected:void 0,status:e?"LOADING":"UNSET"}))),this.selectedLoaded$.pipe(o(e=>({selected:e,status:"LOADED"})))))}setSelected(e){g(S,e),this.selectedIdChange$.next(e)}};t.\u0275fac=function(C){return new(C||t)},t.\u0275prov=f({token:t,factory:t.\u0275fac,providedIn:"root"});let c=t;return c})();export{S as a,A as b};
