(()=>{const e=e=>{var t;document.documentElement.setAttribute("data-theme",e),localStorage.setItem("theme",e),t="dark"===e,document.querySelectorAll(".cbb-dark-light-switcher").forEach((e=>{e.checked=t}))},t=()=>{const t=document.documentElement.getAttribute("data-theme");e("dark"===t?"light":"dark")};window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(t=>{localStorage.getItem("theme")||e(t.matches?"dark":"light")})),document.querySelectorAll(".cbb-dark-light-switcher").forEach((e=>{e.addEventListener("change",t)})),(()=>{const t=localStorage.getItem("theme"),a=window.matchMedia("(prefers-color-scheme: dark)").matches;e(t||(a?"dark":"light"))})()})();