/*! * ScrollSmoother 3.11.5 * https://greensock.com * * @license Copyright 2023, GreenSock. All rights reserved. * This plugin is a membership benefit of Club GreenSock and is only authorized for use in sites/apps/products developed by individuals/companies with an active Club GreenSock membership. See https://greensock.com/club * @author: Jack Doyle, jack@greensock.com */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).window=e.window||{})}(this,function(e){"use strict";function _defineProperties(e,t){for(var r=0;rMath.abs(l)?a:l)/(1-t),u=-c*t;return 0t.end&&(s+=t.distance),n-=t.distance}o=d+s+v*((D.utils.clamp(e.start,e.end,r)-e.start-s)/(n-e.start)-c)}o=function _round(e){return Math.round(1e5*e)/1e5||0}(o+u),m.length&&!a&&m.forEach(function(e){return e(o-s)}),l?(l.resetTo("y",o,-A,!0),F&&l.progress(1)):(g.y=o+"px",g.renderTransform(1))}}})),D.core.getCache(s.trigger).stRevert=Ma,s.startY=d,s.pins=p,s.markers=m,s.ratio=i,s.autoSpeed=a,r.style.willChange="transform"),s}var n,S,e,i,b,s,a,l,c,u,r,f,h,d,g,p=t.smoothTouch,m=t.onUpdate,v=t.onStop,w=t.smooth,T=t.onFocusIn,E=t.normalizeScroll,x=t.wholePixels,C=this,P=t.effectsPrefix||"",R=V.getScrollFunc(O),k=1===V.isTouch?!0===p?.8:parseFloat(p)||0:0===w||!1===w?0:parseFloat(w)||.8,_=k&&+t.speed||1,H=0,A=0,F=1,M=W(0),I={y:0},z="undefined"!=typeof ResizeObserver&&!1!==t.autoResize&&new ResizeObserver(function(){if(!V.isRefreshing){var e=V.maxScroll(S);e<-H&&Ea(e),X.restart(!0)}});function refreshHeight(){return e=n.clientHeight,n.style.overflow="visible",J.style.height=O.innerHeight+(e-O.innerHeight)/_+"px",e-O.innerHeight}Ka(),V.addEventListener("killAll",Ka),D.delayedCall(.5,function(){return F=0}),this.scrollTop=Ea,this.scrollTo=function(e,t,r){var n=D.utils.clamp(0,V.maxScroll(O),isNaN(e)?o.offset(e,r):+e);t?u?D.to(o,{duration:k,scrollTop:n,overwrite:"auto",ease:Y}):R(n):Ea(n)},this.offset=function(e,t){var r,n=(e=K(e)[0]).style.cssText,o=V.create({trigger:e,start:t||"top top"});return b&&Ia([o]),r=o.start/_,o.kill(!1),e.style.cssText=n,D.core.getCache(e).uncache=1,r},this.content=function(e){if(arguments.length){var t=K(e||"#smooth-content")[0]||console.warn("ScrollSmoother needs a valid content element.")||J.children[0];return t!==n&&(c=(n=t).getAttribute("style")||"",z&&z.observe(n),D.set(n,{overflow:"visible",width:"100%",boxSizing:"border-box",y:"+=0"}),k||D.set(n,{clearProps:"transform"})),this}return n},this.wrapper=function(e){return arguments.length?(S=K(e||"#smooth-wrapper")[0]||function _wrap(e){var t=N.querySelector(".ScrollSmoother-wrapper");return t||((t=N.createElement("div")).classList.add("ScrollSmoother-wrapper"),e.parentNode.insertBefore(t,e),t.appendChild(e)),t}(n),l=S.getAttribute("style")||"",refreshHeight(),D.set(S,k?{overflow:"hidden",position:"fixed",height:"100%",width:"100%",top:0,left:0,right:0,bottom:0}:{overflow:"visible",position:"relative",width:"100%",height:"auto",top:"auto",bottom:"auto",left:"auto",right:"auto"}),this):S},this.effects=function(e,t){if(b=b||[],!e)return b.slice(0);(e=K(e)).forEach(function(e){for(var t=b.length;t--;)b[t].trigger===e&&b[t].kill()});t=t||{};var r,n,o=t.speed,i=t.lag,s=t.effectsPadding,a=[];for(r=0;rr._dp._time,f=H,I.y=0,k&&(1===V.isTouch&&(S.style.position="absolute"),S.scrollTop=0,1===V.isTouch&&(S.style.position="fixed"))},onRefresh:function onRefresh(e){e.animation.invalidate(),e.setPositions(e.start,refreshHeight()/_),h||Ca(e),I.y=-R()*_,Da(I.y),F||e.animation.progress(D.utils.clamp(0,1,f/_/-e.end)),h&&(e.progress-=.001,e.update()),ScrollSmoother.isRefreshing=!1},id:"ScrollSmoother",scroller:O,invalidateOnRefresh:!0,start:0,refreshPriority:-9999,end:function end(){return refreshHeight()/_},onScrubComplete:function onScrubComplete(){M.reset(),v&&v(o)},scrub:k||!0}),this.smooth=function(e){return arguments.length&&(_=(k=e||0)&&+t.speed||1,i.scrubDuration(e)),i.getTween()?i.getTween().duration():0},i.getTween()&&(i.getTween().vars.ease=t.ease||Y),this.scrollTrigger=i,t.effects&&this.effects(!0===t.effects?"[data-"+P+"speed], [data-"+P+"lag]":t.effects,{effectsPadding:t.effectsPadding}),t.sections&&this.sections(!0===t.sections?"[data-section]":t.sections),B.forEach(function(e){e.vars.scroller=S,e.revert(!1,!0),e.init(e.vars,e.animation)}),this.paused=function(e,t){return arguments.length?(!!u!==e&&(e?(i.getTween()&&i.getTween().pause(),R(-H/_),M.reset(),(r=V.normalizeScroll())&&r.disable(),(u=V.observe({preventDefault:!0,type:"wheel,touch,scroll",debounce:!1,allowClicks:!0,onChangeY:function onChangeY(){return Ea(-H)}})).nested=G(U,"wheel,touch,scroll",!0,!1!==t)):(u.nested.kill(),u.kill(),u=0,r&&r.enable(),i.progress=(-H/_-i.start)/(i.end-i.start),Ca(i))),this):!!u},this.kill=this.revert=function(){o.paused(!1),Ca(i),i.kill();for(var e=(b||[]).concat(s||[]),t=e.length;t--;)e[t].kill();V.scrollerProxy(S),V.removeEventListener("killAll",Ka),V.removeEventListener("refresh",Ja),S.style.cssText=l,n.style.cssText=c;var r=V.defaults({});r&&r.scroller===S&&V.defaults({scroller:O}),o.normalizer&&V.normalizeScroll(!1),clearInterval(a),j=null,z&&z.disconnect(),J.style.removeProperty("height"),O.removeEventListener("focusin",Ha)},this.refresh=function(e,t){return i.refresh(e,t)},E&&(this.normalizer=V.normalizeScroll(!0===E?{debounce:!0,content:!k&&n}:E)),V.config(t),"overscrollBehavior"in O.getComputedStyle(J)&&D.set([J,U],{overscrollBehavior:"none"}),"scrollBehavior"in O.getComputedStyle(J)&&D.set([J,U],{scrollBehavior:"auto"}),O.addEventListener("focusin",Ha),a=setInterval(ya,250),"loading"===N.readyState||requestAnimationFrame(function(){return V.refresh()})}r.version="3.11.5",r.create=function(e){return j&&e&&j.content()===K(e.content)[0]?j:new r(e)},r.get=function(){return j},t()&&D.registerPlugin(r),e.ScrollSmoother=r,e.default=r;if (typeof(window)==="undefined"||window!==e){Object.defineProperty(e,"__esModule",{value:!0})} else {delete e.default}});