!function(T,w,B){"use strict";w=void0!==w&&w.Math===Math?w:globalThis,T.fn.sticky=function(p){varb,e=T(this),v=T(B),x=e.selector||"",C=Date.now(),S=[],y=p,k="string"==typeofy,z=[].slice.call(arguments,1);returne.each(function(){vart,n,e,o,c=T.isPlainObject(p)?T.extend(!0,{},T.fn.sticky.settings,p):T.extend({},T.fn.sticky.settings),i=c.className,s=c.namespace,l=c.error,r="."+s,a="module-"+s,f=T(this),m=T(w),d=[w,B].indexOf(c.scrollContext)<0?v.find(c.scrollContext):T(c.scrollContext),h=f.data(a),u=this,g={initialize:function(){g.determineContainer(),g.determineContext(),g.verbose("Initializing sticky",c,t),g.save.positions(),g.checkErrors(),g.bind.events(),c.observeChanges&&g.observeChanges(),g.instantiate()},instantiate:function(){g.verbose("Storing instance of module",g),h=g,f.data(a,g)},destroy:function(){g.verbose("Destroying previous instance"),g.reset(),e&&e.disconnect(),o&&o.disconnect(),m.off("load"+r,g.event.load).off("resize"+r,g.event.resize),d.off("scrollchange"+r,g.event.scrollchange),f.removeData(a)},observeChanges:function(){"MutationObserver"inw&&(e=newMutationObserver(g.event.documentChanged),o=newMutationObserver(g.event.changed),e.observe(B,{childList:!0,subtree:!0}),o.observe(u,{childList:!0,subtree:!0}),o.observe(n[0],{childList:!0,subtree:!0}),g.debug("Setting up mutation observer",o))},determineContainer:function(){t=c.container?[w,B].indexOf(c.container)<0?v.find(c.container):T(c.container):f.offsetParent()},determineContext:function(){0===(n=c.context?[w,B].indexOf(c.context)<0?v.find(c.context):T(c.context):t).length&&g.error(l.invalidContext,c.context,f)},checkErrors:function(){g.is.hidden()&&g.error(l.visible,f),g.cache.element.height>g.cache.context.height&&(g.reset(),g.error(l.elementSize,f))},bind:{events:function(){m.on("load"+r,g.event.load).on("resize"+r,g.event.resize),d.off("scroll"+r).on("scroll"+r,g.event.scroll).on("scrollchange"+r,g.event.scrollchange)}},event:{changed:function(e){clearTimeout(g.timer),g.timer=setTimeout(function(){g.verbose("DOM tree modified, updating sticky menu",e),g.refresh()},100)},documentChanged:function(e){[].forEach.call(e,function(e){e.removedNodes&&[].forEach.call(e.removedNodes,function(e){(e===u||0<T(e).find(u).length)&&(g.debug("Element removed from DOM, tearing down events"),g.destroy())})})},load:function(){g.verbose("Page contents finished loading"),requestAnimationFrame(g.refresh)},resize:function(){g.verbose("Window resized"),requestAnimationFrame(g.refresh)},scroll:function(){requestAnimationFrame(function(){d.triggerHandler("scrollchange"+r,d.scrollTop())})},scrollchange:function(e,t){g.stick(t),c.onScroll.call(u)}},refresh:function(e){g.reset(),c.context||g.determineContext(),e&&g.determineContainer(),g.save.positions(),g.stick(),c.onReposition.call(u)},supports:{sticky:function(){vare=T("<div/>");returne.addClass(i.supported),e.css("position").match("sticky")}},save:{lastScroll:function(e){g.lastScroll=e},elementScroll:function(e){g.elementScroll=e},positions:function(){vare={height:d.height()},t={margin:{top:parseInt(f.css("margin-top"),10),bottom:parseInt(f.css("margin-bottom"),10)},offset:f.offset(),width:f.outerWidth(),height:f.outerHeight()},o={offset:n.offset(),height:n.outerHeight()};g.is.standardScroll()||(g.debug("Non-standard scroll. Removing scroll offset from element offset"),e.top=d.scrollTop(),e.left=d.scrollLeft(),t.offset.top+=e.top,o.offset.top+=e.top,t.offset.left+=e.left,o.offset.left+=e.left),g.cache={fits:t.height+c.offset<=e.height,sameHeight:t.height===o.height,scrollContext:{height:e.height},element:{margin:t.margin,top:t.offset.top-t.margin.top,left:t.offset.left,width:t.width,height:t.height,bottom:t.offset.top+t.height},context:{top:o.offset.top,height:o.height,bottom:o.offset.top+o.height}},g.set.containerSize(),g.stick(),g.debug("Caching element positions",g.cache)}},get:{direction:function(e){vart="down";returne=e||d.scrollTop(),t=g.lastScroll&&g.lastScroll>e?"up":t},scrollChange:function(e){returne=e||d.scrollTop(),g.lastScroll?e-g.lastScroll:0},currentElementScroll:function(){returng.elementScro