/*! * Chirpy v5.6.1 (https://github.com/cotes2020/jekyll-theme-chirpy/) * © 2019 Cotes Chung * MIT Licensed */ !function(){"use strict";var o=$(".mode-toggle");function t(o,t){if(!(o instanceof t))throw new TypeError("Cannot call a class as a function")}function e(o,t){for(var e=0;e0}},{key:"topbarLocked",value:function(){return!0===o.topbarIsLocked}},{key:"unlockTopbar",value:function(){o.topbarIsLocked=!1}},{key:"getTopbarHeight",value:function(){return _.outerHeight()}},{key:"orientationLocked",value:function(){return!0===o.orientationIsLocked}},{key:"lockOrientation",value:function(){o.orientationIsLocked=!0}},{key:"unLockOrientation",value:function(){o.orientationIsLocked=!1}}]),o}();r(H,"scrollUpCount",0),r(H,"topbarIsLocked",!1),r(H,"orientationIsLocked",!1);var M,N=$("#search-input"),R=H.getTopbarHeight(),q=0;function A(){0!==$(window).scrollTop()&&(H.lockOrientation(),H.hideTopbar())}function Y(){var o=screen.orientation;o?o.onchange=function(){var t=o.type;"landscape-primary"!==t&&"landscape-secondary"!==t||A()}:$(window).on("orientationchange",(function(){$(window).width()<$(window).height()&&A()})),$(window).on("scroll",(function(){M||(M=!0)})),setInterval((function(){M&&(!function(){var o=$(window).scrollTop();if(!(Math.abs(q-o)<=R)){if(o>q)H.hideTopbar(),N.is(":focus")&&N.trigger("blur");else if(o+$(window).height()<$(document).height()){if(H.hasScrollUpTask())return;H.topbarLocked()?H.unlockTopbar():H.orientationLocked()?H.unLockOrientation():H.showTopbar()}q=o}}(),M=!1)}),250)}var z=$(".collapse");$(".code-header>button").children().attr("class"),$(window).on("scroll",(function(){$(window).scrollTop()>50&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()})),$("#back-to-top").on("click",(function(){return $("body,html").animate({scrollTop:0},800),!1})),$('[data-toggle="tooltip"]').tooltip(),0!==o.length&&o.off().on("click",(function(o){var t=$(o.target),e=t.prop("tagName")==="button".toUpperCase()?t:t.parent();modeToggle.flipMode(),e.trigger("blur")})),$("#sidebar-trigger").on("click",s.toggle),$("#mask").on("click",s.toggle),function(){if(0!==u.length&&!u.hasClass("dynamic-title")&&!f.is(":hidden")){var o=u.text().trim(),t=!1,e=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(o)&&(o=o.replace(/[0-9]/g,"").trim()),u.offset().top<$(window).scrollTop()&&f.text(o),new IntersectionObserver((function(n){if(t){var r=$(window).scrollTop(),a=e