!function(t,o){"use strict";"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?module.exports=o():t.Headroom=o()}(this,function(){"use strict";var t={bind:!!function(){}.bind,classList:"classList"in document.documentElement,rAF:!!(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame)};function o(t){this.callback=t,this.ticking=!1}function i(t,o){var n;o=function t(o){if(arguments.length<=0)throw new Error("Missing arguments in extend function");var i,n,e,s=o||{};for(n=1;nthis.getScrollerHeight();return o||i},toleranceExceeded:function(t,o){return Math.abs(t-this.lastKnownScrollY)>=this.tolerance[o]},shouldUnpin:function(t,o){var i=t>this.lastKnownScrollY,n=t>=this.offset;return i&&n&&o},shouldPin:function(t,o){var i=tthis.lastKnownScrollY?"down":"up",i=this.toleranceExceeded(t,o);this.isOutOfBounds(t)||(t<=this.offset?this.top():this.notTop(),t+this.getViewportHeight()>=this.getScrollerHeight()?this.bottom():this.notBottom(),this.shouldUnpin(t,i)?this.unpin():this.shouldPin(t,i)&&this.pin(),this.lastKnownScrollY=t)}},i.options={tolerance:{up:0,down:0},offset:0,scroller:window,classes:{pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",initial:"headroom"}},i.cutsTheMustard=void 0!==t&&t.rAF&&t.bind&&t.classList,i});