!function(t,e){"function"==typeof define&&define.amd?define([],e()):"object"==typeof exports?module.exports=e():t.StickyStates=e()}("undefined"!=typeof global?global:this.window||this.global,function(t){"use strict";function y(t,e){for(var i=0;t&&(!e||e!=t);)i+=t.offsetTop,t=t.offsetParent;return i}var g,d=!1,h={managers:[]},u={},p={elementSelector:"[data-sticky-states]",innerElementSelector:"[data-sticky-states-inner]",isEndPositionClass:"is-end-position",isStickyClass:"is-sticky",isStickyTopClass:"is-sticky--top",isStickyBottomClass:"is-sticky--bottom",isActivatedClass:"is-activated",positionAttribute:"data-sticky-position",thresholdAttribute:"data-sticky-threshold",stickyRelativeToAttribute:"data-sticky-relative-to",staticAtEndAttribute:"data-sticky-static-at-end",containerAttribute:"data-sticky-container",position:"top",threshold:0,refreshRate:50},k=function(){var i={},n=!1,t=0;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(n=arguments[0],t++);for(;t=o.breakpointInitial&&i<=o.breakpointFinal){e=document.querySelector(o.selector);break}}else e=document.querySelector(t);return e}function E(){for(var t=window.pageYOffset||document.body.scrollTop,e=0;e=i.settings.threshold,c=0,m=t>=i.settings.endThreshold,n=i.stickyElement.hasAttribute(i.settings.staticAtEndAttribute);i.relativeElement&&!!((s=i.relativeElement).offsetWidth||s.offsetHeight||s.getClientRects().length)&&h.isStickyPosition(i.relativeElement)&&(c=i.relativeElement.getBoundingClientRect().height,a=t>=i.settings.threshold-c,m=t>=i.settings.endThreshold-c),a&&l&&!m?(a=window.getComputedStyle(i.innerElement).width,i.innerElement.style.top=0t.settings.threshold&&(t.settings.endThreshold=n))},h.getInstance=function(t){for(var e,i=0;i