/*! * Chirpy v5.6.1 (https://github.com/cotes2020/jekyll-theme-chirpy/) * © 2019 Cotes Chung * MIT Licensed */ !function(){"use strict";var t=$(".mode-toggle");function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var o=0;o0}},{key:"topbarLocked",value:function(){return!0===t.topbarIsLocked}},{key:"unlockTopbar",value:function(){t.topbarIsLocked=!1}},{key:"getTopbarHeight",value:function(){return R.outerHeight()}},{key:"orientationLocked",value:function(){return!0===t.orientationIsLocked}},{key:"lockOrientation",value:function(){t.orientationIsLocked=!0}},{key:"unLockOrientation",value:function(){t.orientationIsLocked=!1}}]),t}();r(V,"scrollUpCount",0),r(V,"topbarIsLocked",!1),r(V,"orientationIsLocked",!1);var A,N=$("#search-input"),D=V.getTopbarHeight(),M=0;function q(){0!==$(window).scrollTop()&&(V.lockOrientation(),V.hideTopbar())}function z(){var t=screen.orientation;t?t.onchange=function(){var e=t.type;"landscape-primary"!==e&&"landscape-secondary"!==e||q()}:$(window).on("orientationchange",(function(){$(window).width()<$(window).height()&&q()})),$(window).on("scroll",(function(){A||(A=!0)})),setInterval((function(){A&&(!function(){var t=$(window).scrollTop();if(!(Math.abs(M-t)<=D)){if(t>M)V.hideTopbar(),N.is(":focus")&&N.trigger("blur");else if(t+$(window).height()<$(document).height()){if(V.hasScrollUpTask())return;V.topbarLocked()?V.unlockTopbar():V.orientationLocked()?V.unLockOrientation():V.showTopbar()}M=t}}(),A=!1)}),250)}$(".collapse");var B=".code-header>button",J="fas fa-check",Y="timeout",F="data-title-succeed",G="data-original-title",K=2e3;function Q(t){if($(t)[0].hasAttribute(Y)){var e=$(t).attr(Y);if(Number(e)>Date.now())return!0}return!1}function W(t){$(t).attr(Y,Date.now()+K)}function X(t){$(t).removeAttr(Y)}var Z,_=$(B).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!==t.length&&t.off().on("click",(function(t){var e=$(t.target),o=e.prop("tagName")==="button".toUpperCase()?e:e.parent();modeToggle.flipMode(),o.trigger("blur")})),$("#sidebar-trigger").on("click",c.toggle),$("#mask").on("click",c.toggle),function(){if(0!==u.length&&!u.hasClass("dynamic-title")&&!f.is(":hidden")){var t=u.text().trim(),e=!1,o=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(t)&&(t=t.replace(/[0-9]/g,"").trim()),u.offset().top<$(window).scrollTop()&&f.text(t),new IntersectionObserver((function(n){if(e){var r=$(window).scrollTop(),a=o