document.addEventListener("DOMContentLoaded",()=>{const n=document.querySelectorAll("li.current");if(n.length>0){let e=n[n.length-1];e.firstChild&&(e=e.firstChild),e.scrollIntoView({block:"center"})}for(const e of document.querySelectorAll("th.head"))e.innerText===""&&(e.style.display="none");for(const e of document.getElementsByTagName("a"))e.getAttribute("href").startsWith("https://")&&e.setAttribute("target","_blank");document.getElementById("searchbox").style.display="block";const t="piccoloThemeMode";var e=localStorage.getItem(t);e?["light","dark","darkest"].indexOf(e)===-1&&(e="light",localStorage.setItem(t,e)):(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?e="dark":e="light",localStorage.setItem(t,e)),document.documentElement.dataset.mode=e;const o=PetiteVue.createApp({mode:e,handleClick(){let e=this.mode;e==="light"?this.mode="dark":e==="dark"?this.mode="darkest":e==="darkest"&&(this.mode="light"),document.documentElement.dataset.mode=this.mode,localStorage.setItem(t,this.mode),console.log(this.mode)}}),i=window.location.protocol==="file:";i||o.mount("#mode_toggle");const s=document.getElementById("languageDropdown-title");if(s&&s.addEventListener("click",function(e){e.preventDefault(),document.getElementById("languageDropdown").classList.toggle("active")}),document.getElementById("languageDropdown-en")){const e=["en","ja","ko","zh-cn","zh-tw"];for(const t of e)document.getElementById("languageDropdown-"+t).addEventListener("click",function(e){e.preventDefault(),changeLanguage(t)})}});function changeLanguage(e){const t="https://www.emeditor.org/"+e+"/"+getPageName()+".html";window.location.href=t}window.addEventListener("click",function(e){const t=document.getElementById("languageDropdown");t&&!t.contains(e.target)&&t.classList.remove("active")})