!function(){this.GambitSmoothScroll=function(t){var e,i={amount:150,speed:900};"undefined"==typeof t&&(t={});for(e in i)t.hasOwnProperty(e)||(t[e]=i[e]);navigator.userAgent.match(/Mobi|Android/)||(this.settings=t,this.startedAsTrackpad=!1,this.start())},GambitSmoothScroll.prototype.parent_scroll=function(t){for(var e;"BODY"!==t.tagName&&"HTML"!==t.tagName;){if(e=getComputedStyle(t),t.scrollHeight>t.clientHeight&&"hidden"!==e.overflowY&&"visible"!==e.overflowY)return t;t=t.parentNode}return!1},GambitSmoothScroll.prototype.start=function(){document.addEventListener("DOMContentLoaded",function(){window.addEventListener("wheel",this.overrideScroll.bind(this))}.bind(this))},GambitSmoothScroll.prototype.stop=function(){"undefined"!=typeof this.scrollInterval&&(this.startedAsTrackpad=!1,clearInterval(this.scrollInterval),this.scrollInterval=void 0)},GambitSmoothScroll.prototype.newScroll=function(t,e,i){var o;t!==this.isDown&&"undefined"!=typeof this.isDown&&this.stop(),this.isDown=t,this.prevScrollableElement!==e&&this.stop(),this.prevScrollableElement=e,"undefined"==typeof this.scrollInterval?(this.startingSpeed=this.settings.amount,this.scrollInterval=setInterval(function(){var t=(this.isDown?1:-1)*this.startingSpeed/15;e?e.scrollTop+=t:window.scrollBy(0,t),this.startingSpeed*=1-900/this.settings.speed/10,Math.abs(t)<1&&this.stop()}.bind(this),16.666666667)):(o=1+(i-this.prevTimestamp)/40*.7,this.startingSpeed=Math.max(this.startingSpeed*o,this.settings.amount),this.startingSpeed=Math.min(this.startingSpeed,300)),this.prevTimestamp=i},GambitSmoothScroll.prototype.overrideScroll=function(t){var e,i,o=t.wheelDelta?-t.wheelDelta/120:(t.detail||t.deltaY)/3,s=this.parent_scroll(t.target),r=function(t){return"[object SafariRemoteNotification]"===t.toString()}(!window.safari||safari.pushNotification);return r&&Math.abs(o)<1&&(o*=10),e=!1,"undefined"!=typeof window.mozInnerScreenX&&navigator.platform.indexOf("Mac")!==-1&&(this.startedAsTrackpad=!1,e=!0,t.deltaY===parseInt(t.deltaY,10))?void(this.startedAsTrackpad=!0):("undefined"!=typeof this.trackpadTimeout&&(clearTimeout(this.trackpadTimeout),this.trackpadTimeout=void 0),(Math.abs(o)<1||this.startedAsTrackpad)&&!e?(this.trackpadTimeout=setTimeout(function(){this.startedAsTrackpad=!1,this.trackpadTimeout=void 0}.bind(this),200),this.startedAsTrackpad=!0,!0):(t=t||window.event,t.preventDefault&&t.preventDefault(),t.returnValue=!1,s&&(i=(s.scrollTop+s.offsetHeight)/s.scrollHeight*100,s.scrollTop<=0&&o<0?s=null:i>=100&&o>0&&(s=null)),void this.newScroll(o>0,s,t.timeStamp)))}}();