import{s as e}from"./p-aee8b1df.js";import{U as r,g as o,s as c}from"./p-3f9775d9.js";import{F as n,S as a}from"./p-b0b9e35d.js";const t=e=>{if("(prefers-color-scheme: dark)"!==e.media)return;const r=s();document.documentElement.setAttribute("color-scheme","auto"===r?e.matches?"dark":"light":r)},s=()=>localStorage.getItem("bce-color-scheme")||"auto";var i={file:n.inMemory(),FileManager:n,generateId:function(){return r.v4()},getColorScheme:s,getColorShade:o,setColorScheme:e=>{if("dark"===e||"light"===e)localStorage.setItem("bce-color-scheme",e),document.documentElement.setAttribute("color-scheme",e);else{localStorage.removeItem("bce-color-scheme");const e=window.matchMedia("(prefers-color-scheme: dark)");t(e)}},setColorShade:c,ScrollSpy:a},l=function(e,r){for(var o=[],c=2;c<arguments.length;c++)o[c-2]=arguments[c];if(!e.matches(r))return!1;for(var n=0,a=o;n<a.length;n++){var t=a[n],s=e.parentElement;if(!s||!s.matches(t))return!1;e=s}return!0};const f=function(){window.BCE=window.BCE||i,(()=>{const e=window.matchMedia("(prefers-color-scheme: dark)");e.addEventListener?e.addEventListener("change",t):e.addListener(t),t(e)})(),e((function(e){if(l(e,"bce-button","bce-fab"))return"fab";if(l(e,"bce-button","bce-menu"))return"menu";if(l(e,"bce-link","bce-link"))return"link";if(l(e,"bce-link","bce-nav","bce-header"))return"header";if(l(e,"bce-nav","bce-header"))return"header";if(l(e,"bce-nav","bce-side-bar"))return"sidebar";var r=e.closest("bce-root");return e.getAttribute("mode")||r&&r.mode||"regular"}))};export{f as g};