window.isRtl=window.Helpers.isRtl();window.isDarkStyle=window.Helpers.isDarkStyle();(function(){var d,m;const n=document.getElementById("navbarSupportedContent"),l=document.querySelector(".layout-navbar"),u=document.querySelectorAll(".navbar-nav .nav-link");setTimeout(function(){window.Helpers.initCustomOptionCheck()},1e3),[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map(function(e){return new bootstrap.Tooltip(e)}),isRtl&&Helpers._addClass("dropdown-menu-end",document.querySelectorAll("#layout-navbar .dropdown-menu")),window.addEventListener("scroll",e=>{window.scrollY>10?l.classList.add("navbar-active"):l.classList.remove("navbar-active")}),window.addEventListener("load",e=>{window.scrollY>10?l.classList.add("navbar-active"):l.classList.remove("navbar-active")});function r(){n.classList.remove("show")}document.addEventListener("click",function(e){n.contains(e.target)||r()}),u.forEach(e=>{e.addEventListener("click",t=>{e.classList.contains("dropdown-toggle")?t.preventDefault():r()})}),isRtl&&Helpers._addClass("dropdown-menu-end",document.querySelectorAll(".dropdown-menu"));const c=document.querySelectorAll(".nav-link.mega-dropdown");c&&c.forEach(e=>{new MegaDropdown(e)});let i=document.querySelector(".dropdown-style-switcher");const w=document.documentElement.getAttribute("data-style");let a=localStorage.getItem("templateCustomizer-"+templateName+"--Style")||(((m=(d=window.templateCustomizer)==null?void 0:d.settings)==null?void 0:m.defaultStyle)??"light");//!if there is no Customizer then use default style as light
if(window.templateCustomizer&&i){[].slice.call(i.children[1].querySelectorAll(".dropdown-item")).forEach(function(o){o.classList.remove("active"),o.addEventListener("click",function(){let s=this.getAttribute("data-theme");s==="light"?window.templateCustomizer.setStyle("light"):s==="dark"?window.templateCustomizer.setStyle("dark"):window.templateCustomizer.setStyle("system")}),setTimeout(()=>{o.getAttribute("data-theme")===w&&o.classList.add("active")},1e3)});const t=i.querySelector("i");a==="light"?(t.classList.add("bx-sun"),new bootstrap.Tooltip(t,{title:"Light Mode",fallbackPlacements:["bottom"]})):a==="dark"?(t.classList.add("bx-moon"),new bootstrap.Tooltip(t,{title:"Dark Mode",fallbackPlacements:["bottom"]})):(t.classList.add("bx-desktop"),new bootstrap.Tooltip(t,{title:"System Mode",fallbackPlacements:["bottom"]}))}p(a);function p(e){e==="system"&&(window.matchMedia("(prefers-color-scheme: dark)").matches?e="dark":e="light"),[].slice.call(document.querySelectorAll("[data-app-"+e+"-img]")).map(function(o){const s=o.getAttribute("data-app-"+e+"-img");o.src=assetsPath+"img/"+s})}})();
