text: !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.StickyBottom=e():t.StickyBottom=e()}(this,function(){return function(t){function e(o){if(s[o])return s[o].exports;var i=s[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var s={};return e.m=t,e.c=s,e.i=function(t){return t},e.d=function(t,s,o){e.o(t,s)||Object.defineProperty(t,s,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var s=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(s,"a",s),s},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=7)}([function(t,e,s){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(t[o]=s[o])}return t},n=function(){function t(t,e){for(var s=0;s<e.length;s++){var o=e[s];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,s,o){return s&&t(e.prototype,s),o&&t(e,o),e}}();s(2);var r=s(1),a="getBoundingClientRect",l={TWO_STATES:"two-states",THREE_STATES:"three-states"},c=function(){function t(e){o(this,t);var s={elems:{area:".js.sticky-bottom",box:".sticky-bottom__box",boundary:".sticky-bottom__boundary"}};this.props=i({},s,e),this.state={scroll:{},rect:{}},this.onScroll=this.onScroll.bind(this),this.onResize=this.onResize.bind(this)}return n(t,[{key:"init",value:function(){var t=(0,r.qs)(this.props.elems.area);return this.elems={area:t,box:(0,r.qs)(this.props.elems.box,t),boundary:(0,r.qs)(this.props.elems.boundary,t)},this.props.debug&&(this.elems.debug=(0,r.qs)(this.props.debug)),this.props.renderingMode===l.TWO_STATES&&this.elems.area.classList.add("sticky-bottom--rendering-mode-two-states"),this.initAndUpdateDimensions(),this.updateDOM({forceUpdate:!0}),window.addEventListener("scroll",this.onScroll),window.addEventListener("resize",this.onResize),this}},{key:"initAndUpdateDimensions",value:function(){return this.state.rect=i({},this.state.rect,{area:this.elems.area[a](),box:this.elems.box[a](),boundary:this.elems.boundary[a]()}),this.state.scroll=i({},this.state.scroll,{viewHeight:(0,r.getViewHeight)(),scrollStartPosition:(0,r.getScrollPosition)(),scrollPosition:(0,r.getScrollPosition)()}),this.updateDimensions(),this}},{key:"updateDimensions",value:function(){var t="",e=this.state.scroll.stickyMode,s=this.state.rect.area,o=this.state.scroll,n=o.viewHeight,r=o.scrollStartPosition,a=o.scrollPosition,l=s.top+r,c=s.bottom+r,u=a-l,d=c-a-n;return t=s.height-n<=0?"after":u<=0&&d>=0?"before":u>=0&&d>=0?"fixed":"after",this.state.scroll=i({},this.state.scroll,{scrollPosition:a,stickyMode:t,stickyModePrev:e}),this}},{key:"updateDOM",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=e.forceUpdate,o=this.state.rect.area,i=this.state.scroll,n=i.viewHeight,a=i.stickyMode,l=i.stickyModePrev,c=function(){t.elems.debug&&(t.elems.debug.textContent="debug: state after");var e=t.elems.box;e.style.position="absolute",e.style.bottom="",e.style.left="",e.style.width="",(0,r.delCss)(t.elems.area,["sticky-bottom--is-before","sticky-bottom--is-fixed"]),(0,r.addCss)(t.elems.area,"sticky-bottom--is-after")};if("before"===a){if(!s&&l===a)return this;"two-states"===this.props.renderingMode?c():function(){t.elems.debug&&(t.elems.debug.textContent="debug: state before");var e=t.elems.box;e.style.position="absolute",e.style.bottom=o.height-n+"px",e.style.left="",e.style.width="",(0,r.delCss)(t.elems.area,["sticky-bottom--is-fixed","sticky-bottom--is-after"]),(0,r.addCss)(t.elems.area,"sticky-bottom--is-before")}()}else if("fixed"===a){if(!s&&l===a)return this;!function(){t.elems.debug&&(t.elems.debug.textContent="debug: state fixed");var e=t.elems.box;e.style.position="fixed",e.style.bottom="",e.style.left=o.left+"px",e.style.width=o.width+"px",(0,r.delCss)(t.elems.area,["sticky-bottom--is-before","sticky-bottom--is-after"]),(0,r.addCss)(t.elems.area,"sticky-bottom--is-fixed")}()}else if("after"===a){if(!s&&l===a)return this;c()}return this.elems.area.setAttribute("data-sticky-bottom-state",a||"no-state"),this.elems.area.setAttribute("data-sticky-bottom-prev-state",l||"no-prev-state"),this}},{key:"destroy",value:function(){return window.removeEventListener("scroll",this.onScroll),window.removeEventListener("resize",this.onResize),this}},{key:"onScroll",value:function(){var t=this;this.state.scroll.scrollPosition=(0,r.getScrollPosition)(),this.state.scroll.ticking||(0,r.rAF)(function(){t.updateDimensions(),t.updateDOM(),t.state.scroll.ticking=!1}),this.state.scroll.ticking=!0}},{key:"onResize",value:function(){var t=this;(0,r.rAF)(function(){t.initAndUpdateDimensions(),t.updateDOM({forceUpdate:!0})})}}]),t}();e.default=c},function(t,e,s){"use strict";function o(t,e){return(e||document).querySelector(t)}function i(t,e){return[].slice.call((e||document).querySelectorAll(t),0)}function n(t){window.requestAnimationFrame?window.requestAnimationFrame(t.bind(this)):setTimeout(t.bind(this),0)}function r(){return window.scrollY||window.pageYOffset||document.documentElement.scrollTop||0}function a(){return Math.max(window.innerHeight,0)}function l(t,e){e&&Array.isArray(e)?e.forEach(function(e){return t.classList.add(e)}):t.classList.add(e)}function c(t,e){e&&Array.isArray(e)?e.forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e)}function u(){for(var t=document.createElement("div"),e=["sticky","webkitSticky"],s=0;s<e.length;s+=1){var o=e[s];if(t.style.position=o,t.style.position===o)return o}}Object.defineProperty(e,"__esModule",{value:!0}),e.qs=o,e.qsa=i,e.rAF=n,e.getScrollPosition=r,e.getViewHeight=a,e.addCss=l,e.delCss=c,e.getStickyVendorPrefixAsString=u;e.log=console.log.bind(console)},function(t,e){},,function(t,e,s){"use strict";t.exports=s(0).default},,,function(t,e,s){t.exports=s(4)}])});