/*! * jekyll-theme-chirpy v7.2.0 | © 2019 Cotes Chung | MIT Licensed | https://github.com/cotes2020/jekyll-theme-chirpy/ */ var Theme=function(){"use strict";function t(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}function e(e,i,s){return s(t(e,i))}var i;class s{static get DARK(){return"dark"}static get LIGHT(){return"light"}static get ID(){return"theme-mode"}static get visualState(){return e(s,this,o)?e(s,this,n):e(s,this,h)?this.DARK:this.LIGHT}static getThemeMapper(t,e){return{[this.LIGHT]:t,[this.DARK]:e}}static init(){this.switchable&&(t(s,this,b)._.addEventListener("change",(()=>{const i=e(s,this,n);t(s,this,c).call(this),i!==this.visualState&&t(s,this,l).call(this)})),e(s,this,o)&&(e(s,this,r)?t(s,this,a).call(this):t(s,this,u).call(this)))}static flip(){e(s,this,o)?t(s,this,c).call(this):e(s,this,h)?t(s,this,u).call(this):t(s,this,a).call(this),t(s,this,l).call(this)}}function n(e){return sessionStorage.getItem(t(i,e,g)._)}function r(t){return e(i,t,n)===t.DARK}function o(t){return null!==e(i,t,n)}function h(e){return t(i,e,b)._.matches}function a(){document.documentElement.setAttribute(t(i,this,v)._,this.DARK),sessionStorage.setItem(t(i,this,g)._,this.DARK)}function u(){document.documentElement.setAttribute(t(i,this,v)._,this.LIGHT),sessionStorage.setItem(t(i,this,g)._,this.LIGHT)}function c(){document.documentElement.removeAttribute(t(i,this,v)._),sessionStorage.removeItem(t(i,this,g)._)}function l(){window.postMessage({id:this.ID},"*")}i=s;var m,f,d,g={_:"mode"},v={_:"data-mode"},b={_:window.matchMedia("(prefers-color-scheme: dark)")};return m=s,f="switchable",d=!document.documentElement.hasAttribute(t(i,i,v)._),(f=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var s=i.call(t,e||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(f))in m?Object.defineProperty(m,f,{value:d,enumerable:!0,configurable:!0,writable:!0}):m[f]=d,s.init(),s}();