Current File : /home/natitnen/elitepathways.com.ng/wp-content/plugins/smoother/js/smoother.min.js
!function(){"use strict";const e={frameRate:150,animationTime:400,stepSize:100,pulseAlgorithm:!0,pulseScale:4,pulseNormalize:1,accelerationDelta:50,accelerationMax:3,keyboardSupport:!0,arrowScroll:50,fixedBackground:!0,excluded:""};let t=e;let o=!1;const n={x:0,y:0};let l,r,i,c,a=!1,s=document.documentElement,u=[];const d=/^Mac/.test(navigator.platform),m=navigator.userAgent.toLowerCase().includes("safari")&&!navigator.userAgent.toLowerCase().includes("chrome"),f=navigator.userAgent.toLowerCase().includes("firefox"),h=37,w=38,y=39,p=40,b=32,g=33,v=34,S=35,x=36,E={37:1,38:1,39:1,40:1};function k(){if(a||!document.body)return;a=!0;const e=document.body,n=document.documentElement,c=window.innerHeight,u=e.scrollHeight;if(s=document.compatMode.indexOf("CSS")>=0?n:e,l=e,t.keyboardSupport&&R("keydown",L),top!=self)o=!0;else if(ie&&u>c&&(e.offsetHeight<=c||n.offsetHeight<=c)){const t=document.createElement("div");let o;t.style.cssText="position:absolute; z-index:-10000; top:0; left:0; right:0; height:"+s.scrollHeight+"px",document.body.appendChild(t),i=function(){o||(o=setTimeout((function(){t.style.height="0",t.style.height=s.scrollHeight+"px",o=null}),500))},setTimeout(i,10),R("resize",i);const n={attributes:!0,childList:!0,characterData:!1};if(r=new G(i),r.observe(e,n),s.offsetHeight<=c){const t=document.createElement("div");t.style.clear="both",e.appendChild(t)}}t.fixedBackground||(e.style.backgroundAttachment="scroll",n.style.backgroundAttachment="scroll")}let D=[],B=!1,M=Date.now();function C(e,o,l){var r,i;if(r=(r=o)>0?1:-1,i=(i=l)>0?1:-1,(n.x!==r||n.y!==i)&&(n.x=r,n.y=i,D=[],M=0),1!==t.accelerationMax){const e=Date.now()-M;if(e<t.accelerationDelta){let n=(1+50/e)/2;n>1&&(n=Math.min(n,t.accelerationMax),o*=n,l*=n)}M=Date.now()}if(D.push({x:o,y:l,lastX:o<0?.99:-.99,lastY:l<0?.99:-.99,start:Date.now()}),B)return;const c=J(),a=e===c||e===document.body;null==e.$scrollBehavior&&function(e){const t=H(e);if(null==I[t]){const o=getComputedStyle(e,"")["scroll-behavior"];I[t]="smooth"==o}return I[t]}(e)&&(e.$scrollBehavior=e.style.scrollBehavior,e.style.scrollBehavior="auto");const s=function(n){const r=Date.now();let i=0,c=0;for(let e=0;e<D.length;e++){const o=D[e],n=r-o.start,l=n>=t.animationTime;let a=l?1:n/t.animationTime;t.pulseAlgorithm&&(a=Z(a));const s=o.x*a-o.lastX>>0,u=o.y*a-o.lastY>>0;i+=s,c+=u,o.lastX+=s,o.lastY+=u,l&&(D.splice(e,1),e--)}a?window.scrollBy(i,c):(i&&(e.scrollLeft+=i),c&&(e.scrollTop+=c)),o||l||(D=[]),D.length?U(s,e,1e3/t.frameRate+1):(B=!1,null!=e.$scrollBehavior&&(e.style.scrollBehavior=e.$scrollBehavior,e.$scrollBehavior=null))};U(s,e,0),B=!0}function T(e){if(e.wheelDeltaY?e.wheelDeltaY===-3*e.deltaY:0===e.deltaMode)return;a||k();const n=e.target;if(e.defaultPrevented||e.ctrlKey)return!0;if(F(l,"embed")||F(n,"embed")&&/\.pdf/i.test(n.src)||F(l,"object")||n.shadowRoot)return!0;let r=-e.wheelDeltaX||e.deltaX||0,i=-e.wheelDeltaY||e.deltaY||0;m&&(i*=10,Math.abs(i)>120&&(i=i>0?120:-120)),d&&(e.wheelDeltaX&&_(e.wheelDeltaX,120)&&(r=e.wheelDeltaX/Math.abs(e.wheelDeltaX)*-120),e.wheelDeltaY&&_(e.wheelDeltaY,120)&&(i=e.wheelDeltaY/Math.abs(e.wheelDeltaY)*-120)),r||i||(i=-e.wheelDelta||0),1===e.deltaMode&&(r*=40,i*=40);const s=K(n);return s?!!function(e){if(!e)return;u.length||(u=[e,e,e]);e=Math.abs(e),u.push(e),u.shift(),clearTimeout(c),c=setTimeout((function(){try{localStorage.SS_deltaBuffer=u.join(",")}catch(e){}}),1e3);const t=e>120&&W(e);let o=W(100),n=W(120);f&&d&&(n=!0);return!n&&!o&&!t}(i)||(Math.abs(r)>1.2&&(r*=t.stepSize/120),Math.abs(i)>1.2&&(i*=t.stepSize/120),C(s,r,i),e.preventDefault(),void X()):!o||!oe||(Object.defineProperty(e,"target",{value:window.frameElement}),parent.wheel(e))}function L(e){const n=e.target,r=e.ctrlKey||e.altKey||e.metaKey||e.shiftKey&&e.keyCode!==b;document.body.contains(l)||(l=document.activeElement);const i=/^(button|submit|radio|checkbox|file|color|image)$/i;if(e.defaultPrevented||/^(textarea|select|embed|object)$/i.test(n.nodeName)||F(n,"input")&&!i.test(n.type)||F(l,"video")||function(e){let t=e.target,o=!1;if(-1!=document.URL.indexOf("www.youtube.com/watch"))do{if(o=t.classList&&t.classList.contains("html5-video-controls"),o)break}while(t=t.parentNode);return o}(e)||n.isContentEditable||r)return!0;if((F(n,"button")||F(n,"input")&&i.test(n.type))&&e.keyCode===b)return!0;if(F(n,"input")&&"radio"==n.type&&E[e.keyCode])return!0;let c,a=0,s=0,u=K(l);if(!u)return!o||!oe||parent.keydown(e);let d=u.clientHeight;switch(u==document.body&&(d=window.innerHeight),e.keyCode){case w:s=-t.arrowScroll;break;case p:s=t.arrowScroll;break;case b:c=e.shiftKey?1:-1,s=-c*d*.9;break;case g:s=.9*-d;break;case v:s=.9*d;break;case x:u==document.body&&document.scrollingElement&&(u=document.scrollingElement),s=-u.scrollTop;break;case S:const o=u.scrollHeight-u.scrollTop-d;s=o>0?o+10:0;break;case h:a=-t.arrowScroll;break;case y:a=t.arrowScroll;break;default:return!0}C(u,a,s),e.preventDefault(),X()}function A(e){l=e.target}const H=function(){let e=0;return function(t){return t.uniqueID||(t.uniqueID=e++)}}();let z,Y={},O={},I={};function X(){clearTimeout(z),void 0===document.getElementById("scroller-body")&&(z=setInterval((function(){Y=O=I={}}),1e3))}function N(e,t,o){const n=o?Y:O;for(let o=e.length;o--;)n[H(e[o])]=t;return t}function q(e,t){return(t?Y:O)[H(e)]}function K(e){const t=[],n=document.body,l=s.scrollHeight;do{const r=q(e,!1);if(r)return N(t,r);if(t.push(e),l===e.scrollHeight){const e=$(s)&&$(n)||j(s);if(o&&P(s)||!o&&e)return N(t,J())}else if(P(e)&&j(e))return N(t,e)}while(e=e.parentElement)}function P(e){return e.clientHeight+10<e.scrollHeight}function $(e){return"hidden"!==getComputedStyle(e,"").getPropertyValue("overflow-y")}function j(e){const t=getComputedStyle(e,"").getPropertyValue("overflow-y");return"scroll"===t||"auto"===t}function R(e,t,o){null!==document.getElementById("scroller-body")?document.getElementById("scroller-body").addEventListener(e,t,o||!1):window.addEventListener(e,t,o||!1)}function V(e,t,o){null!==document.getElementById("scroller-body")?document.getElementById("scroller-body").addEventListener(e,t,o||!1):window.removeEventListener(e,t,o||!1)}function F(e,t){return e&&(e.nodeName||"").toLowerCase()===t.toLowerCase()}if(window.localStorage&&localStorage.SS_deltaBuffer)try{u=localStorage.SS_deltaBuffer.split(",")}catch(e){}function _(e,t){return Math.floor(e/t)==e/t}function W(e){return _(u[0],e)&&_(u[1],e)&&_(u[2],e)}var U=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e,t,o){window.setTimeout(e,o||1e3/60)},G=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,J=function(){let e=document.scrollingElement;return function(){if(!e){const t=document.createElement("div");t.style.cssText="height:10000px;width:1px;",document.body.appendChild(t);const o=document.body.scrollTop;document.documentElement.scrollTop;window.scrollBy(0,3),e=document.body.scrollTop!=o?document.body:document.documentElement,window.scrollBy(0,-3),document.body.removeChild(t)}return e}}();function Q(e){let o,n,l;return(e*=t.pulseScale)<1?o=e-(1-Math.exp(-e)):(n=Math.exp(-1),e-=1,l=1-Math.exp(-e),o=n+l*(1-n)),o*t.pulseNormalize}function Z(e){return e>=1?1:e<=0?0:(1==t.pulseNormalize&&(t.pulseNormalize/=Q(1)),Q(e))}const ee=window.navigator.userAgent,te=/Edge/.test(ee),oe=/chrome/i.test(ee)&&!te,ne=/safari/i.test(ee)&&!te,le=/mobile/i.test(ee),re=/Windows NT 6.1/i.test(ee)&&/rv:11/i.test(ee),ie=ne&&(/Version\/8/i.test(ee)||/Version\/9/i.test(ee)),ce=(oe||ne||re||window.mdSmootherAllBrowsers)&&!le;let ae=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){ae=!0}}))}catch(e){}const se=!!ae&&{passive:!1};var ue="onwheel"in document.createElement("div")?"wheel":"mousewheel";function de(o){const{anchor:n}=o;n&&document.querySelectorAll('a[href^="#"]').forEach(e=>{e.addEventListener("click",(function(e){e.preventDefault(),document.querySelector(this.getAttribute("href")).scrollIntoView({behavior:"smooth"})}))});for(let n in o)e.hasOwnProperty(n)&&(t[n]=o[n])}ue&&ce&&(R(ue,T,se),R("mousedown",A),R("load",k)),de.destroy=function(){r&&r.disconnect(),V(ue,T),V("mousedown",A),V("keydown",L),V("resize",i),V("load",k)},de.restart=function(){r&&r.observe(),R(ue,T,{passive:!1}),R("mousedown",A),R("keydown",L),R("resize",i),R("load",k)},window.SmoothScrollOptions&&de(window.SmoothScrollOptions),"function"==typeof define&&define.amd?define((function(){return de})):"object"==typeof exports?module.exports=de:window.SmoothScroll=de}();