"use strict";var widgetopts_fe={init:function(){var t=this;t.defaults={topSpacing:0,adminbar:0,elBefore:0,lastPos:0,endFixed:varWidgetOpts.shallNotFixed,margin_top:parseInt(varWidgetOpts.margin_top),disable_width:parseInt(varWidgetOpts.disable_width),disable_height:parseInt(varWidgetOpts.disable_height)},jQuery("#wpadminbar").length>0&&(t.defaults.adminbar=jQuery("#wpadminbar").outerHeight()),jQuery(t.defaults.endFixed).length>0&&(t.defaults.fixBoundary=jQuery(t.defaults.endFixed).offset().top+10),t.bindEvents(),t.clones=t.createSpacer(),t.onScrollHandler(),t.animationHandler(),t.linksHandler(),window.addEventListener("resize",function(){t.onResizeHandler()},!1)},winHeight:function(){return parseInt(jQuery(window).height())},docHeight:function(){return parseInt(jQuery(document).height())},scrollY:function(){return window.pageYOffset||parseInt(jQuery(window).scrollTop())},bindEvents:function(){jQuery("body")},createSpacer:function(){var t,e,i,a,s,n,d,r,o,l={};return jQuery(".widgetopts-fixed-this").length>0&&jQuery(".widgetopts-fixed-this").each(function(p){e=jQuery(this),i=e.parent(),i.hasClass("widgetopts-fixed-this")||(t=e.attr("id"),a=e.position(),s=e.outerHeight(),o=e[0].getBoundingClientRect(),n=o.width,d=parseInt(e.css("margin-bottom")),r=i.attr("data-sticky-spacer"),a.left=o.left,a.top=o.left,a.left",{id:t+"_spacer","class":e.attr("class")+" widgetopts_spacer",css:{display:"none",height:s}}).insertBefore("#"+t),i.hasClass("widgetopts-sticky-parent")||i.addClass("widgetopts-sticky-parent"))}),l},onScrollHandler:function(){function t(){!jQuery.isEmptyObject(r.clones)&&r.defaults.disable_width>0&&window.innerWidth>r.defaults.disable_width&&r.defaults.disable_height>0&&window.innerHeight>r.defaults.disable_height&&(jQuery.each(r.clones,function(t,y){i="#"+t,h[f]=t,a=jQuery(i),n=a.parent(),s=jQuery(i+"_spacer"),d=parseInt(a.css("margin-bottom")),"undefined"==typeof s.offset()||s.offset().top==y.top||s.hasClass("widgetopts_scrolled")||(o+=y.margin,y.top=a.offset().top,y.left=a.offset().left,y.height=a.outerHeight(),y.width=a[0].getBoundingClientRect().width,s.addClass("widgetopts_scrolled"),jQuery(r.defaults.endFixed).length>0&&(r.defaults.fixBoundary=jQuery(r.defaults.endFixed).offset().top)),w+=y.height+y.margin,p=parseInt(n.attr("data-sticky-height")),e=y.top-y.spacing-(r.defaults.adminbar+r.defaults.margin_top),f>0&&(e-=r.clones[h[f-1]].spacing),r.scrollY()>=e?(a.hasClass("widgetopts_stuck")||(p=p+y.height+r.defaults.margin_top,n.attr("data-sticky-height",p)),c=w-(y.height+y.margin),a.addClass("widgetopts_stuck").css({position:"fixed","z-index":90,top:c,left:y.left,width:y.width}),s.show().css({visibility:"hidden"}),f++):r.scrollY()0&&r.animationHandler(),t()})},onResizeHandler:function(){function t(){e.defaults.disable_width>0&&window.innerWidth0&&window.innerHeight0&&t.css({"animation-duration":a+"s","-webkit-animation-duration":a+"s"}),s>0&&t.css({"animation-delay":s+"s","-webkit-animation-delay":s+"s"}),isNaN(n)&&(n=0),e){case"onScreen":r.inViewport(t,.7,n)&&!t.hasClass("animated")&&t.addClass("animated "+i);break;case"enters":r.inViewport(t,0,n)&&!t.hasClass("animated")&&t.addClass("animated "+i);break;default:t.hasClass("animated")||t.addClass("animated "+i)}})},linksHandler:function(){var t,e,i,a;jQuery(".widgetopts-SO-linked").length>0&&jQuery(".widgetopts-SO-linked").each(function(){i="",a="",t=jQuery(this),e=jQuery(this).attr("id"),"undefined"!=typeof SOWidgetOptsURL[e]&&("undefined"!=typeof SOWidgetOptsURL[e].targets&&"1"==SOWidgetOptsURL[e].targets&&(i='target="_blank"'),"undefined"!=typeof SOWidgetOptsURL[e].nofollow&&"1"==SOWidgetOptsURL[e].nofollow&&(a='rel="nofollow"'),t.prepend(''))})},inViewport:function(t,e,i){var a=this,s=a.scrollY(),n=a.winHeight(),i=i||0,d=jQuery(t).height(),r=s+n,o=jQuery(t).offset().top+i,l=o+d,e=e||0;return r>=o+d*e&&l-d*e>=s}};jQuery(window).on("load",function(){widgetopts_fe.init()});