window.addEventListener("DOMContentLoaded",e=>{let{getCookie:t,removeCookie:d,setCookie:a}=GSCookService,o=document.querySelectorAll(".gs_darkmode_switcher");for(let s=0;s<o.length;s++){let n=o[s],c=n.dataset.cookdays||30,r="darkmode",i=t(r);i&&(document.body.classList.add("darkmode"),!0!==n.checked&&(n.checked=!0)),n.addEventListener("click",function(e){setTimeout(()=>{n.checked?(document.body.classList.add("darkmode"),a(r,"on",c),n.setAttribute("data-status","on"),i="on"):(document.body.classList.remove("darkmode"),d(r),n.setAttribute("data-status","off"),i="")},0)}),n.addEventListener("keydown",function(e){let t=void 0!==e.key?e.key:e.keyCode;("Enter"===t||13===t||["Spacebar"," "].indexOf(t)>=0||32===t)&&(e.preventDefault(),this.click())})}});