!function(t){"undefined"!=typeof define&&define.amd?define([],t):"undefined"!=typeof module&&module.exports?module.exports=t():t()}(function(){function t(){return h?0:window.pageYOffset||document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop}function i(){return h?0:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.documentElement.clientHeight)}var o,w,e,s,n,h="undefined"==typeof window,c=!h,u={},l=[],m="visibilityChange",d="enterViewport",f="fullyEnterViewport",b="exitViewport",v="partiallyExitViewport",g="locationChange",V="stateChange",y=[m,d,f,b,v,g,V],I={top:0,bottom:0},r=function(){return h?0:window.innerHeight||document.documentElement.clientHeight};function a(){if(u.viewportTop=t(),u.viewportBottom=u.viewportTop+u.viewportHeight,u.documentHeight=i(),u.documentHeight!==o){for(e=l.length;e--;)l[e].recalculateLocation();o=u.documentHeight}}function p(){u.viewportHeight=r(),a(),H()}function k(){clearTimeout(s),s=setTimeout(p,100)}function H(){for(n=l.length;n--;)l[n].update();for(n=l.length;n--;)l[n].triggerCallbacks()}function E(t,i){var o=this;this.watchItem=t,this.offsets=i?i===+i?{top:i,bottom:i}:{top:i.top||I.top,bottom:i.bottom||I.bottom}:I,this.callbacks={};for(var e,s,n,h,c,l,r=0,a=y.length;ru.viewportBottom,this.isInViewport=this.topu.viewportTop,this.isFullyInViewport=this.top>=u.viewportTop&&this.bottom<=u.viewportBottom||this.isAboveViewport&&this.isBelowViewport},destroy:function(){var t=l.indexOf(this);l.splice(t,1);for(var i=0,o=y.length;i, you must use jQuery.")}}function F(t){w=t,a(),H()}return c&&(window.addEventListener?(window.addEventListener("scroll",F),window.addEventListener("resize",k)):(window.attachEvent("onscroll",F),window.attachEvent("onresize",k))),u.beget=u.create=function(t,i){"string"==typeof t?t=document.querySelector(t):t&&0