/*! * Chirpy v6.3.0 | © 2019 Cotes Chung | MIT Licensed | https://github.com/cotes2020/jekyll-theme-chirpy/ */ !function(){"use strict";const t=$(".mode-toggle");function e(t,e,a){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var s=a.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:String(e)}(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}const a=$("body"),s="sidebar-display";class o{static toggle(){!1===o.isExpanded?a.attr(s,""):a.removeAttr(s),o.isExpanded=!o.isExpanded}}e(o,"isExpanded",!1);const r=$("#sidebar-trigger"),l=$("#search-trigger"),i=$("#search-cancel"),n=$("#main-wrapper>.container>.row"),c=$("#topbar-title"),d=$("search"),u=$("#search-result-wrapper"),f=$("#search-results"),m=$("#search-input"),p=$("#search-hints"),g=$("html,body"),b="loaded",h="unloaded",v="input-focus",C="d-flex";class y{static on(){y.offset=window.scrollY,g.scrollTop(0)}static off(){g.scrollTop(y.offset)}}e(y,"offset",0),e(y,"resultVisible",!1);class w{static on(){r.addClass(h),c.addClass(h),l.addClass(h),d.addClass(C),i.addClass(b)}static off(){i.removeClass(b),d.removeClass(C),r.removeClass(h),c.removeClass(h),l.removeClass(h)}}class T{static on(){y.resultVisible||(y.on(),u.removeClass(h),n.addClass(h),y.resultVisible=!0)}static off(){y.resultVisible&&(f.empty(),p.hasClass(h)&&p.removeClass(h),u.addClass(h),n.removeClass(h),y.off(),m.val(""),y.resultVisible=!1)}}function k(){return i.hasClass(b)}$(".collapse");$(".code-header>button").children().attr("class");class x{static get attrTimestamp(){return"data-ts"}static get attrDateFormat(){return"data-df"}static get locale(){return $("html").attr("lang").substring(0,2)}static getTimestamp(t){return Number(t.attr(x.attrTimestamp))}static getDateFormat(t){return t.attr(x.attrDateFormat)}}!function(){const t=$(window),e=$("#back-to-top");t.on("scroll",(()=>{t.scrollTop()>50?e.fadeIn():e.fadeOut()})),e.on("click",(()=>{t.scrollTop(0)}))}(),[...document.querySelectorAll('[data-bs-toggle="tooltip"]')].map((t=>new bootstrap.Tooltip(t))),0!==t.length&&t.off().on("click",(t=>{const e=$(t.target);let a=e.prop("tagName")==="button".toUpperCase()?e:e.parent();modeToggle.flipMode(),a.trigger("blur")})),$("#sidebar-trigger").on("click",o.toggle),$("#mask").on("click",o.toggle),l.on("click",(function(){w.on(),T.on(),m.trigger("focus")})),i.on("click",(function(){w.off(),T.off()})),m.on("focus",(function(){d.addClass(v)})),m.on("focusout",(function(){d.removeClass(v)})),m.on("input",(()=>{""===m.val()?k()?p.removeClass(h):T.off():(T.on(),k()&&p.addClass(h))})),dayjs.locale(x.locale),dayjs.extend(window.dayjs_plugin_localizedFormat),$("[".concat(x.attrTimestamp,"]")).each((function(){const t=dayjs.unix(x.getTimestamp($(this))),e=t.format(x.getDateFormat($(this)));$(this).text(e),$(this).removeAttr(x.attrTimestamp),$(this).removeAttr(x.attrDateFormat);const a=$(this).attr("data-bs-toggle");if(void 0===a||"tooltip"!==a)return;const s=t.format("llll");$(this).attr("data-bs-title",s),new bootstrap.Tooltip($(this))}))}();