"use strict";function getNowTheme(){var t=document.body.getAttribute("data-theme");return"auto"===t?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":"dark"===t?"dark":"light"}function updateUtterancesTheme(t){var e=getNowTheme();t&&("dark"===e?t.contentWindow.postMessage({type:"set-theme",theme:"photon-dark"},"https://utteranc.es"):t.contentWindow.postMessage({type:"set-theme",theme:"github-light"},"https://utteranc.es"))}document.querySelector("span.post-comment-notloaded")&&document.querySelector("span.post-comment-notloaded").addEventListener("click",loadComment),document.querySelector(".btn .btn-scroll-top").addEventListener("click",function(){document.documentElement.scrollTop=0}),document.querySelector(".btn .btn-toggle-mode").addEventListener("click",function(){var t=getNowTheme(),e=document.body.getAttribute("data-theme"),o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";"auto"===e?(document.body.setAttribute("data-theme","light"===t?"dark":"light"),localStorage.setItem("fuji_data-theme","light"===t?"dark":"light")):"light"===e?(document.body.setAttribute("data-theme","dark"),localStorage.setItem("fuji_data-theme","dark"==o?"auto":"dark")):(document.body.setAttribute("data-theme","light"),localStorage.setItem("fuji_data-theme","light"==o?"auto":"light"));var a=document.querySelector(".post-comment");a&&document.querySelector("span.post-comment-notloaded").getAttribute("style")&&("utterances"===a.getAttribute("data-comment")&&updateUtterancesTheme(document.querySelector(".post-comment iframe")),"disqus"===a.getAttribute("data-comment")&&DISQUS.reset({reload:!0}))});