!function(b){function a(f,e){var g=b.proxy(this.process,this),c=b(f).is("body")?b(window):b(f),d;this.options=b.extend({},b.fn.scrollspy.defaults,e);this.$scrollElement=c.on("scroll.scroll.data-api",g);this.selector=(this.options.target||((d=b(f).attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""))||"")+" .nav li > a";this.$body=b("body").on("click.scroll.data-api",this.selector,g);this.refresh();this.process()}a.prototype={constructor:a,refresh:function(){this.targets=this.$body.find(this.selector).map(function(){var c=b(this).attr("href");return/^#\w/.test(c)&&b(c).length?c:null});this.offsets=b.map(this.targets,function(c){return b(c).position().top})},process:function(){var f=this.$scrollElement.scrollTop()+this.options.offset,e=this.offsets,c=this.targets,g=this.activeTarget,d;for(d=e.length;d--;){g!=c[d]&&f>=e[d]&&(!e[d+1]||f<=e[d+1])&&this.activate(c[d])}},activate:function(d){var c;this.activeTarget=d;this.$body.find(this.selector).parent(".active").removeClass("active");c=this.$body.find(this.selector+'[href="'+d+'"]').parent("li").addClass("active");if(c.parent(".dropdown-menu")){c.closest("li.dropdown").addClass("active")}}};b.fn.scrollspy=function(c){return this.each(function(){var f=b(this),e=f.data("scrollspy"),d=typeof c=="object"&&c;if(!e){f.data("scrollspy",(e=new a(this,d)))}if(typeof c=="string"){e[c]()}})};b.fn.scrollspy.Constructor=a;b.fn.scrollspy.defaults={offset:10};b(function(){b('[data-spy="scroll"]').each(function(){var c=b(this);c.scrollspy(c.data())})})}(window.jQuery);