import{bb as h,cb as m,ha as r,mb as c}from"./chunk-FWZCAEAJ.js";var l=(()=>{let t=class t{constructor(){this.themes=[{id:"auto",name:"Auto",icon:"circle-half"},{id:"light",name:"Light",icon:"sun-fill"},{id:"dark",name:"Dark",icon:"moon-stars-fill"}],this._selectedTheme=m(this.themes[0]),this.selectedTheme=h(()=>this._selectedTheme()),this.currentTheme=h(()=>{let e=this._selectedTheme();return e.id==="auto"?this.getPreferredTheme():e});let s=this.themes.find(e=>e.id===localStorage.getItem("theme"));s&&this._selectedTheme.set(s),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>this._selectedTheme.set(this.getPreferredTheme())),c(()=>document.documentElement.setAttribute("data-bs-theme",this.currentTheme().id))}getPreferredTheme(){return window.matchMedia("(prefers-color-scheme: dark)").matches?this.themes[2]:this.themes[1]}setTheme(s){let e=this.themes.find(n=>n.id===s);this._selectedTheme.set(e),localStorage.setItem("theme",s)}};t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=r({token:t,factory:t.\u0275fac,providedIn:"root"});let i=t;return i})();export{l as a};
