!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){"use strict";var n,t,o,i,r={minHeight:0,elements:[],percentage:!0,userTiming:!1,pixelDepth:!0,nonInteraction:!0,gaGlobal:!1,gtmOverride:!1},l=e(window),c=[],a=!1,u=0;e.scrollDepth=function(p){function h(e,r,l,c){i?(i({event:"ScrollDistance",eventCategory:"Scroll Depth",eventAction:e,eventLabel:r,eventValue:1,eventNonInteraction:p.nonInteraction,eventTiming:c}),p.pixelDepth&&arguments.length>2&&l>u&&(u=l,i({event:"ScrollDistance",eventCategory:"Scroll Depth",eventAction:"Pixel Depth",eventLabel:d(l),eventValue:1,eventNonInteraction:p.nonInteraction,eventTiming:c})),p.userTiming&&arguments.length>3&&i({event:"ScrollTiming",eventCategory:"Scroll Depth",eventAction:e,eventLabel:r,eventTiming:c})):(n&&(window[o]("send","event","Scroll Depth",e,r,1,{nonInteraction:p.nonInteraction}),p.pixelDepth&&arguments.length>2&&l>u&&(u=l,window[o]("send","event","Scroll Depth","Pixel Depth",d(l),1,{nonInteraction:p.nonInteraction})),p.userTiming&&arguments.length>3&&window[o]("send","timing","Scroll Depth",e,c,r)),t&&(_gaq.push(["_trackEvent","Scroll Depth",e,r,1,p.nonInteraction]),p.pixelDepth&&arguments.length>2&&l>u&&(u=l,_gaq.push(["_trackEvent","Scroll Depth","Pixel Depth",d(l),1,p.nonInteraction])),p.userTiming&&arguments.length>3&&_gaq.push(["_trackTiming","Scroll Depth",e,c,r,100])))}function s(e){return{"25%":parseInt(.25*e,10),"50%":parseInt(.5*e,10),"75%":parseInt(.75*e,10),"100%":e-5}}function f(n,t,o){e.each(n,function(n,i){e.inArray(n,c)===-1&&t>=i&&(h("Percentage",n,t,o),c.push(n))})}function g(n,t,o){e.each(n,function(n,i){e.inArray(i,c)===-1&&e(i).length&&t>=e(i).offset().top&&(h("Elements",i,t,o),c.push(i))})}function d(e){return(250*Math.floor(e/250)).toString()}function v(){y()}function m(e,n){var t,o,i,r=null,l=0,c=function(){l=new Date,r=null,i=e.apply(t,o)};return function(){var a=new Date;l||(l=a);var u=n-(a-l);return t=this,o=arguments,u<=0?(clearTimeout(r),r=null,l=a,i=e.apply(t,o)):r||(r=setTimeout(c,u)),i}}function y(){a=!0,l.on("scroll.scrollDepth",m(function(){var n=e(document).height(),t=window.innerHeight?window.innerHeight:l.height(),o=l.scrollTop()+t,i=s(n),r=+new Date-D;return c.length>=p.elements.length+(p.percentage?4:0)?(l.off("scroll.scrollDepth"),void(a=!1)):(p.elements&&g(p.elements,o,r),void(p.percentage&&f(i,o,r)))},500))}var D=+new Date;p=e.extend({},r,p),e(document).height()