!function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function d(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}function e(a){return parseFloat(a)||0}function f(a){for(var b=0;a;)b+=a.offsetTop,a=a.offsetParent;return b}function g(){function c(){a.pageXOffset!=k.left?(k.top=a.pageYOffset,k.left=a.pageXOffset,n.refreshAll()):a.pageYOffset!=k.top&&(k.top=a.pageYOffset,k.left=a.pageXOffset,l.forEach(function(a){return a._recalcPosition()}))}function d(){f=setInterval(function(){l.forEach(function(a){return a._fastCheck()})},500)}function e(){clearInterval(f)}c(),a.addEventListener("scroll",c),a.addEventListener("resize",n.refreshAll),a.addEventListener("orientationchange",n.refreshAll);var f=void 0,g=void 0,h=void 0;"hidden"in b?(g="hidden",h="visibilitychange"):"webkitHidden"in b&&(g="webkitHidden",h="webkitvisibilitychange"),h?(b[g]||d(),b.addEventListener(h,function(){b[g]?e():d()})):d()}var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=!1;a.getComputedStyle?!function(){var a=b.createElement("div");["","-webkit-","-moz-","-ms-"].some(function(b){try{a.style.position=b+"sticky"}catch(a){}return""!=a.style.position})&&(i=!0)}():i=!0;var j="undefined"!=typeof ShadowRoot,k={top:null,left:null},l=[],m=function(){function g(a){if(c(this,g),!(a instanceof HTMLElement))throw new Error("First argument must be HTMLElement");if(l.some(function(b){return b._node===a}))throw new Error("Stickyfill is already applied to this node");this._node=a,this._stickyMode=null,this._active=!1,l.push(this),this.refresh()}return h(g,[{key:"refresh",value:function(){if(!i&&!this._removed){this._active&&this._deactivate();var c=this._node,g=getComputedStyle(c);if(!isNaN(parseFloat(g.top))&&"table-cell"!=g.display&&"none"!=g.display){this._active=!0;var h=c.parentNode,k=j&&h instanceof ShadowRoot?h.host:h,l=c.getBoundingClientRect(),m=k.getBoundingClientRect(),n=getComputedStyle(k);this._parent={node:k,styles:{position:k.style.position},offsetHeight:k.offsetHeight},this._offsetToWindow={left:l.left,right:b.documentElement.clientWidth-l.right},this._offsetToParent={top:l.top-m.top-e(n.borderTopWidth),left:l.left-m.left-e(n.borderLeftWidth),right:-l.right+m.right-e(n.borderRightWidth)},this._styles={position:c.style.position,top:c.style.top,bottom:c.style.bottom,left:c.style.left,right:c.style.right,width:c.style.width,marginTop:c.style.marginTop,marginLeft:c.style.marginLeft,marginRight:c.style.marginRight};var o=e(g.top);this._limits={start:l.top+a.pageYOffset-o,end:m.top+a.pageYOffset+k.offsetHeight-e(n.borderBottomWidth)-c.offsetHeight-o-e(g.marginBottom)};var p=n.position;"absolute"!=p&&"relative"!=p&&(k.style.position="relative");var q=this._clone={};q.node=b.createElement("div"),d(q.node.style,{width:l.right-l.left+"px",height:l.bottom-l.top+"px",marginTop:g.marginTop,marginBottom:g.marginBottom,marginLeft:g.marginLeft,marginRight:g.marginRight,cssFloat:g.cssFloat,padding:0,border:0,borderSpacing:0,fontSize:"1em",position:"static"}),h.insertBefore(q.node,c),q.docOffsetTop=f(q.node),this._recalcPosition()}}}},{key:"_recalcPosition",value:function(){if(this._active&&!this._removed){var a=k.top<=this._limits.start?"start":k.top>=this._limits.end?"end":"middle";if(this._stickyMode!=a){switch(a){case"start":d(this._node.style,{position:"absolute",left:this._offsetToParent.left+"px",right:this._offsetToParent.right+"px",top:this._offsetToParent.top+"px",bottom:"auto",width:"auto",marginLeft:0,marginRight:0,marginTop:0});break;case"middle":d(this._node.style,{position:"fixed",left:this._offsetToWindow.left+"px",right:this._offsetToWindow.right+"px",top:this._styles.top,bottom:"auto",width:"auto",marginLeft:0,marginRight:0,marginTop:0});break;case"end":d(this._node.style,{position:"absolute",left:this._offsetToParent.left+"px",right:this._offsetToParent.right+"px",top:"auto",bottom:0,width:"auto",marginLeft:0,marginRight:0})}this._stickyMode=a}}}},{key:"_fastCheck",value:function(){this._active&&!this._removed&&(Math.abs(f(this._clone.node)-this._clone.docOffsetTop)>1||Math.abs(this._parent.node.offsetHeight-this._parent.offsetHeight)>1)&&this.refresh()}},{key:"_deactivate",value:function(){var a=this;this._active&&!this._removed&&(this._clone.node.parentNode.removeChild(this._clone.node),delete this._clone,d(this._node.style,this._styles),delete this._styles,l.some(function(b){return b!==a&&b._parent&&b._parent.node===a._parent.node})||d(this._parent.node.style,this._parent.styles),delete this._parent,this._stickyMode=null,this._active=!1,delete this._offsetToWindow,delete this._offsetToParent,delete this._limits)}},{key:"remove",value:function(){var a=this;this._deactivate(),l.some(function(b,c){if(b._node===a._node)return l.splice(c,1),!0}),this._removed=!0}}]),g}(),n={stickies:l,Sticky:m,addOne:function(a){if(!(a instanceof HTMLElement)){if(!a.length||!a[0])return;a=a[0]}for(var b=0;b<l.length;b++)if(l[b]._node===a)return l[b];return new m(a)},add:function(a){if(a instanceof HTMLElement&&(a=[a]),a.length){for(var b=[],c=function(c){var d=a[c];return d instanceof HTMLElement?l.some(function(a){if(a._node===d)return b.push(a),!0})?"continue":void b.push(new m(d)):(b.push(void 0),"continue")},d=0;d<a.length;d++){c(d)}return b}},refreshAll:function(){l.forEach(function(a){return a.refresh()})},removeOne:function(a){if(!(a instanceof HTMLElement)){if(!a.length||!a[0])return;a=a[0]}l.some(function(b){if(b._node===a)return b.remove(),!0})},remove:function(a){if(a instanceof HTMLElement&&(a=[a]),a.length)for(var b=function(b){var c=a[b];l.some(function(a){if(a._node===c)return a.remove(),!0})},c=0;c<a.length;c++)b(c)},removeAll:function(){for(;l.length;)l[0].remove()}};i||g(),"undefined"!=typeof module&&module.exports?module.exports=n:a.Stickyfill=n}(window,document);
(function ($){
var prevScrollTop=-1;
var $window=$(window);
$window.scroll(function (){
var scrollTop=$window.scrollTop();
var threashold=600;
var s1=(prevScrollTop > threashold);
var s2=(scrollTop > threashold);
if(s1 ^ s2){
if(s2){
$('.body').addClass('go-to-top-visible');
}else{
$('.go-to-top-common').removeClass('go-to-top-up');
$('.body').removeClass('go-to-top-visible');
}}
prevScrollTop=scrollTop;
});
$('.go-to-top-common').click(function (){
$(this).addClass('go-to-top-up');
$('body,html').animate({
scrollTop: 1
}, 800);
});
$('.go-to-toc-common').click(function (){
$('body,html').animate({
scrollTop: $('.entry-content .toc').offset().top
}, 800);
});
$('#search-menu-input').change(function (e){
var searchEdit=$('#search-menu-content .search-edit').first();
if(e.target.checked){
searchEdit.focus();
}else{
searchEdit.blur();
}});
var adminMenu=$("#admin-panel");
var adminHeight=adminMenu.outerHeight();
var adminStartPos=0;
$(window).scroll(function (){
var adminCurrentPos=$(this).scrollTop();
if(adminCurrentPos > adminStartPos){
if(adminCurrentPos >=200){
adminMenu.css("bottom", "-" + adminHeight + "px");
}}else{
adminMenu.css("bottom", 0);
}
adminStartPos=adminCurrentPos;
});
if(cocoon_localize_script_options.is_fixed_mobile_buttons_enable!=1){
var headerMenu=$('.mobile-header-menu-buttons');
var headerHight=headerMenu.outerHeight();
var headerStartPos=0;
$(window).scroll(function (){
var headerCurrentPos=$(this).scrollTop();
if(headerCurrentPos > headerStartPos){
if(headerCurrentPos >=100){
headerMenu.css('top', '-' + headerHight + 'px');
}}else{
headerMenu.css('top', 0);
}
headerStartPos=headerCurrentPos;
});
var footerMenu=$(".mobile-footer-menu-buttons");
var footerHeight=footerMenu.outerHeight();
var footerStartPos=0;
$(window).scroll(function (){
var footerCurrentPos=$(this).scrollTop();
if(footerCurrentPos > footerStartPos){
if(footerCurrentPos >=100){
footerMenu.css("bottom", "calc(-1 * (env(safe-area-inset-bottom) + " + footerHeight + "px))");
}}else if(footerCurrentPos - footerStartPos < -8){
footerMenu.css("bottom", 0);
}
footerStartPos=footerCurrentPos;
});
var headerButtons=$(".mobile-header-menu-buttons");
var footerButtons=$(".mobile-footer-menu-buttons");
headerButtons.click(function (){
headerButtons.css("z-index", "3");
footerButtons.css("z-index", "2");
});
footerButtons.click(function (){
headerButtons.css("z-index", "2");
footerButtons.css("z-index", "3");
})
}
const clickEventType=((window.ontouchstart!==null) ? 'click':'touchend');
$(document).on(clickEventType,'#comment-reply-btn, .comment-reply-link', function(){
$('#comment-reply-btn').slideUp();
const respond=document.getElementById('respond');
const styles={ inset: 'auto', position: 'static', visibility: 'visible' };
Object.entries(styles).forEach(([key, value])=> {
respond.style[key]=value;
});
$('#respond').slideDown();
});
$('.sbtn').click(function (){
var w=$(this).prev('.sform').text();
if(w) window.open('https://www.google.co.jp/search?q=' + encodeURIComponent(w), '_blank');
});
$('.sidebar-menu-content .widget_archive select').change(function (){
document.location.href=this.options[this.selectedIndex].value;
});
$('.sidebar-menu-content .widget_categories select').change(function (){
if(this.options[this.selectedIndex].value > 0){
this.parentNode.submit();
}});
function drawerCloser(selecter, checkbox){
$(selecter).click(function (){
$(checkbox).prop('checked', false);
})
}
drawerCloser('.menu-drawer .menu-item a', '#navi-menu-input');
drawerCloser('#slide-in-sidebar a', '#sidebar-menu-input');
$('.mobile-menu-buttons').each(function (){
if($(this).has('.logo-menu-button').length){
$(this).addClass('has-logo-button');
}});
$(window).on('load', function (){
$('#carousel').addClass('loaded');
});
$('.is-style-accordion > .faq > .faq-answer').hide();
$('.is-style-accordion > .faq > .faq-question').click(function (){
$(this).next('.is-style-accordion .faq-answer').slideToggle();
$(this).toggleClass('active');
});
$(document).on("change", '#sidebar-menu-input', function (){
if($(this).prop('checked')){
$('#sidebar').appendTo('#sidebar-menu-content');
$('#sidebar').attr('id', 'slide-in-sidebar');
$('#sidebar').addClass('slide-in-sidebar');
drawerCloser('#slide-in-sidebar a', '#sidebar-menu-input');
}else{
$('#sidebar').removeClass('slide-in-sidebar');
$('#slide-in-sidebar').attr('id', 'sidebar');
$('#sidebar').insertAfter('#main');
}});
var vw=window.innerWidth;
$(window).resize(function (){
if(vw!=window.innerWidth){
$('#sidebar-menu-input').prop('checked', false).change();
}
vw=window.innerWidth;
});
})(jQuery);
(function (){
var f=document.querySelectorAll(".video-click");
for (var i=0; i < f.length; ++i){
f[i].onclick=function (){
var iframe=this.getAttribute("data-iframe");
this.parentElement.innerHTML='<div class="video">' + iframe + '</div>';
}}
})();