1(function(root,factory){if(typeof define==="function"&&define.amd){define("smoothScroll",factory(root))}else if(typeof exports==="object"){module.exports=factory(root)}else{root.smoothScroll=factory(root)}})(window||this,function(root){"use strict";var smoothScroll={};var supports=!!document.querySelector&&!!root.addEventListener;var settings;var defaults={speed:500,easing:"easeInOutCubic",offset:0,updateURL:true,callbackBefore:function(){},callbackAfter:function(){}};var forEach=function(collection,callback,scope){if(Object.prototype.toString.call(collection)==="[object Object]"){for(var prop in collection){if(Object.prototype.hasOwnProperty.call(collection,prop)){callback.call(scope,collection[prop],prop,collection)}}}else{for(var i=0,len=collection.length;i<len;i++){callback.call(scope,collection[i],i,collection)}}};var extend=function(defaults,options){var extended={};forEach(defaults,function(value,prop){extended[prop]=defaults[prop]});forEach(options,function(value,prop){extended[prop]=options[prop]});return extended};var getClosest=function(elem,selector){var firstChar=selector.charAt(0);for(;elem&&elem!==document;elem=elem.parentNode){if(firstChar==="."){if(elem.classList.contains(selector.substr(1))){return elem}}else if(firstChar==="#"){if(elem.id===selector.substr(1)){return elem}}else if(firstChar==="["){if(elem.hasAttribute(selector.substr(1,selector.length-2))){return elem}}}return false};var escapeCharacters=function(id){var string=String(id);var length=string.length;var index=-1;var codeUnit;var result="";var firstCodeUnit=string.charCodeAt(0);while(++index<length){codeUnit=string.charCodeAt(index);if(codeUnit===0){throw new InvalidCharacterError("Invalid character: the input contains U+0000.")}if(codeUnit>=1&&codeUnit<=31||codeUnit==127||index===0&&codeUnit>=48&&codeUnit<=57||index===1&&codeUnit>=48&&codeUnit<=57&&firstCodeUnit===45){result+="\\"+codeUnit.toString(16)+" ";continue}if(codeUnit>=128||codeUnit===45||codeUnit===95||codeUnit>=48&&codeUnit<=57||codeUnit>=65&&codeUnit<=90||codeUnit>=97&&codeUnit<=122){result+=string.charAt(index);continue}result+="\\"+string.charAt(index)}return result};var easingPattern=function(type,time){var pattern;if(type==="easeInQuad")pattern=time*time;if(type==="easeOutQuad")pattern=time*(2-time);if(type==="easeInOutQuad")pattern=time<.5?2*time*time:-1+(4-2*time)*time;if(type==="easeInCubic")pattern=time*time*time;if(type==="easeOutCubic")pattern=--time*time*time+1;if(type==="easeInOutCubic")pattern=time<.5?4*time*time*time:(time-1)*(2*time-2)*(2*time-2)+1;if(type==="easeInQuart")pattern=time*time*time*time;if(type==="easeOutQuart")pattern=1- --time*time*time*time;if(type==="easeInOutQuart")pattern=time<.5?8*time*time*time*time:1-8*--time*time*time*time;if(type==="easeInQuint")pattern=time*time*time*time*time;if(type==="easeOutQuint")pattern=1+--time*time*time*time*time;if(type==="easeInOutQuint")pattern=time<.5?16*time*time*time*time*time:1+16*--time*time*time*time*time;return pattern||time};var getEndLocation=function(anchor,headerHeight,offset){var location=0;if(anchor.offsetParent){do{location+=anchor.offsetTop;anchor=anchor.offsetParent}while(anchor)}location=location-headerHeight-offset;return location>=0?location:0};var getDocumentHeight=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)};var getDataOptions=function(options){return!options||!(typeof JSON==="object"&&typeof JSON.parse==="function")?{}:JSON.parse(options)};var updateUrl=function(anchor,url){if(history.pushState&&(url||url==="true")){history.pushState({pos:anchor.id},"",window.location.pathname+anchor)}};smoothScroll.animateScroll=function(toggle,anchor,options){var settings=extend(settings||defaults,options||{});var overrides=getDataOptions(toggle?toggle.getAttribute("data-options"):null);settings=extend(settings,overrides);anchor="#"+escapeCharacters(anchor.substr(1));var fixedHeader=document.querySelector("[data-scroll-header]");
1var headerHeight=fixedHeader===null?0:fixedHeader.offsetHeight+fixedHeader.offsetTop;var startLocation=root.pageYOffset;var endLocation=getEndLocation(document.querySelector(anchor),headerHeight,parseInt(settings.offset,10));var animationInterval;var distance=endLocation-startLocation;var documentHeight=getDocumentHeight();var timeLapsed=0;var percentage,position;updateUrl(anchor,settings.updateURL);var stopAnimateScroll=function(position,endLocation,animationInterval){var currentLocation=root.pageYOffset;if(position==endLocation||currentLocation==endLocation||root.innerHeight+currentLocation>=documentHeight){clearInterval(animationInterval);settings.callbackAfter(toggle,anchor)}};var loopAnimateScroll=function(){timeLapsed+=16;percentage=timeLapsed/parseInt(settings.speed,10);percentage=percentage>1?1:percentage;position=startLocation+distance*easingPattern(settings.easing,percentage);root.scrollTo(0,Math.floor(position));stopAnimateScroll(position,endLocation,animationInterval)};var startAnimateScroll=function(){settings.callbackBefore(toggle,anchor);animationInterval=setInterval(loopAnimateScroll,16)};if(root.pageYOffset===0){root.scrollTo(0,0)}startAnimateScroll()};var eventHandler=function(event){var toggle=getClosest(event.target,"[data-scroll]");if(toggle&&toggle.tagName.toLowerCase()==="a"){event.preventDefault();smoothScroll.animateScroll(toggle,toggle.hash,settings,event)}};smoothScroll.destroy=function(){if(!settings)return;document.removeEventListener("click",eventHandler,false);settings=null};
1smoothScroll.init=function(options){if(!supports)return;smoothScroll.destroy();settings=extend(defaults,options||{});document.addEventListener("click",eventHandler,false)};return smoothScroll});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.