function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(function(){var t,e;t=window.jQuery,e=t(window),t.fn.stick_in_parent=function(i){var o,n,r,s,a,c,l,u,p,h,d,f,g;for(null==i&&(i={}),g=i.sticky_class,c=i.inner_scrolling,f=i.recalc_every,d=i.parent,p=i.offset_top,u=i.spacer,r=i.bottoming,null==p&&(p=0),null==d&&(d=void 0),null==c&&(c=!0),null==g&&(g="is_stuck"),o=t(document),null==r&&(r=!0),h=function(t){var e,i;return window.getComputedStyle?(t[0],e=window.getComputedStyle(t[0]),i=parseFloat(e.getPropertyValue("width"))+parseFloat(e.getPropertyValue("margin-left"))+parseFloat(e.getPropertyValue("margin-right")),"border-box"!==e.getPropertyValue("box-sizing")&&(i+=parseFloat(e.getPropertyValue("border-left-width"))+parseFloat(e.getPropertyValue("border-right-width"))+parseFloat(e.getPropertyValue("padding-left"))+parseFloat(e.getPropertyValue("padding-right"))),i):t.outerWidth(!0)},s=function(i,n,s,a,l,y,k,m){var v,w,_,b,C,x,V,P,F,S,H,j;if(!i.data("sticky_kit")){if(i.data("sticky_kit",!0),C=o.height(),V=i.parent(),null!=d&&(V=V.closest(d)),!V.length)throw"failed to find stick parent";if(_=!1,v=!1,H=null!=u?u&&i.closest(u):t("<div />"),H&&H.css("position",i.css("position")),P=function(){var t,e,r;if(!m)return C=o.height(),t=parseInt(V.css("border-top-width"),10),e=parseInt(V.css("padding-top"),10),n=parseInt(V.css("padding-bottom"),10),s=V.offset().top+t+e,a=V.height(),_&&(_=!1,v=!1,null==u&&(i.insertAfter(H),H.detach()),i.css({position:"",top:"",width:"",bottom:""}).removeClass(g),r=!0),l=i.offset().top-(parseInt(i.css("margin-top"),10)||0)-p,y=i.outerHeight(!0),k=i.css("float"),H&&H.css({width:h(i),height:y,display:i.css("display"),"vertical-align":i.css("vertical-align"),float:k}),r?j():void 0},P(),y!==a)return b=void 0,x=p,S=f,j=function(){var t,h,d,w,F,j;if(!m)return d=!1,null!=S&&(S-=1)<=0&&(S=f,P(),d=!0),d||o.height()===C||(P(),d=!0),w=e.scrollTop(),null!=b&&(h=w-b),b=w,_?(r&&(F=w+y+x>a+s,v&&!F&&(v=!1,i.css({position:"fixed",bottom:"",top:x}).trigger("sticky_kit:unbottom"))),w<l&&(_=!1,x=p,null==u&&("left"!==k&&"right"!==k||i.insertAfter(H),H.detach()),t={position:"",width:"",top:""},i.css(t).removeClass(g).trigger("sticky_kit:unstick")),c&&(j=e.height(),y+p>j&&(v||(x-=h,x=Math.max(j-y,x),x=Math.min(p,x),_&&i.css({top:x+"px"}))))):w>l&&(_=!0,t={position:"fixed",top:x},t.width="border-box"===i.css("box-sizing")?i.outerWidth()+"px":i.width()+"px",i.css(t).addClass(g),null==u&&(i.after(H),"left"!==k&&"right"!==k||H.append(i)),i.trigger("sticky_kit:stick")),_&&r&&(null==F&&(F=w+y+x>a+s),!v&&F)?(v=!0,"static"===V.css("position")&&V.css({position:"relative"}),i.css({position:"absolute",bottom:n,top:"auto"}).trigger("sticky_kit:bottom")):void 0},F=function(){return P(),j()},w=function(){if(m=!0,e.off("touchmove",j),e.off("scroll",j),e.off("resize",F),t(document.body).off("sticky_kit:recalc",F),i.off("sticky_kit:detach",w),i.removeData("sticky_kit"),i.css({position:"",bottom:"",top:"",width:""}),V.position("position",""),_)return null==u&&("left"!==k&&"right"!==k||i.insertAfter(H),H.remove()),i.removeClass(g)},e.on("touchmove",j),e.on("scroll",j),e.on("resize",F),t(document.body).on("sticky_kit:recalc",F),i.on("sticky_kit:detach",w),setTimeout(j,0)}},a=0,l=this.length;a<l;a++)n=this[a],s(t(n));return this}}).call(this);var _createClass=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}();!function(t){var e=function(){function e(){_classCallCheck(this,e),this.top=20,this.setupValue(),this.initSticky()}return _createClass(e,[{key:"setupValue",value:function(){if(t("#main").outerHeight()<t("#secondary").outerHeight)return!1;this.top=20;var e=t("#wpadminbar"),i=t(".osf-sticky-active");e.length>0&&(this.top+=e.height()),i.length>0&&(this.top+=i.outerHeight())}},{key:"initSticky",value:function(){var e=this,i=t(window).width();i<992?jQuery("#secondary > .inner").trigger("sticky_kit:detach"):this._makeStickyKit(),t(window).resize(function(){i=t(window).width(),i<992?jQuery("#secondary > .inner").trigger("sticky_kit:detach"):e._makeStickyKit()})}},{key:"_makeStickyKit",value:function(){if(t("#main").outerHeight()<t("#secondary .inner").outerHeight())return!1;t("#secondary > .inner").stick_in_parent({parent:"#content > .wrap",offset_top:this.top})}}]),e}();t(document).ready(function(){new e})}(jQuery);
//# sourceMappingURL=sticky-layout.js.map
