/*! * ScrollSmoother 3.12.2 * 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;r=v())&&(n=((r=v())-(t=e.ratio<0||1Math.abs(l)?a:l)/(1-t),f=-c*t;return 0t.end&&(s+=t.distance),n-=t.distance}o=d+s+y*((I.utils.clamp(e.start,e.end,r)-e.start-s)/(n-e.start)-c)}m.length&&!a&&m.forEach(function(e){return e(o-s)}),o=function _round(e){return Math.round(1e5*e)/1e5||0}(o+f),l?(l.resetTo("y",o,-M,!0),N&&l.progress(1)):(g.y=o+"px",g.renderTransform(1))}}})),I.core.getCache(s.trigger).stRevert=Qa,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,f,r,u,h,d,g,p=t.smoothTouch,m=t.onUpdate,w=t.onStop,_=t.smooth,T=t.onFocusIn,C=t.normalizeScroll,E=t.wholePixels,R=this,x=t.effectsPrefix||"",P=V.getScrollFunc(U),k=1===V.isTouch?!0===p?.8:parseFloat(p)||0:0===_||!1===_?0:parseFloat(_)||.8,A=k&&+t.speed||1,H=0,M=0,N=1,F=Q(0),O={y:0},z="undefined"!=typeof ResizeObserver&&!1!==t.autoResize&&new ResizeObserver(function(){if(!V.isRefreshing){var e=v(S)*A;e<-H&&Ga(e),Z.restart(!0)}});function refreshHeight(){return e=n.clientHeight,n.style.overflow="visible",K.style.height=U.innerHeight+(e-U.innerHeight)/A+"px",e-U.innerHeight}Oa(),V.addEventListener("killAll",Oa),I.delayedCall(.5,function(){return N=0}),this.scrollTop=Ga,this.scrollTo=function(e,t,r){var n=I.utils.clamp(0,v(),isNaN(e)?o.offset(e,r):+e);t?f?I.to(o,{duration:k,scrollTop:n,overwrite:"auto",ease:Y}):P(n):Ga(n)},this.offset=function(e,t){var r,n=(e=q(e)[0]).style.cssText,o=V.create({trigger:e,start:t||"top top"});return b&&(N?V.refresh():Ma([o],!0)),r=o.start/A,o.kill(!1),e.style.cssText=n,I.core.getCache(e).uncache=1,r},this.content=function(e){if(arguments.length){var t=q(e||"#smooth-content")[0]||console.warn("ScrollSmoother needs a valid content element.")||K.children[0];return t!==n&&(c=(n=t).getAttribute("style")||"",z&&z.observe(n),I.set(n,{overflow:"visible",width:"100%",boxSizing:"border-box",y:"+=0"}),k||I.set(n,{clearProps:"transform"})),this}return n},this.wrapper=function(e){return arguments.length?(S=q(e||"#smooth-wrapper")[0]||function _wrap(e){var t=G.querySelector(".ScrollSmoother-wrapper");return t||((t=G.createElement("div")).classList.add("ScrollSmoother-wrapper"),e.parentNode.insertBefore(t,e),t.appendChild(e)),t}(n),l=S.getAttribute("style")||"",refreshHeight(),I.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=q(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,u=H,O.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()/A),h||Ea(e),O.y=-P()*A,Fa(O.y),N||e.animation.progress(I.utils.clamp(0,1,u/A/-e.end)),h&&(e.progress-=.001,e.update()),ScrollSmoother.isRefreshing=!1},id:"ScrollSmoother",scroller:U,invalidateOnRefresh:!0,start:0,refreshPriority:-9999,end:function end(){return refreshHeight()/A},onScrubComplete:function onScrubComplete(){F.reset(),w&&w(o)},scrub:k||!0}),this.smooth=function(e){return arguments.length&&(A=(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-"+x+"speed], [data-"+x+"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?(!!f!==e&&(e?(i.getTween()&&i.getTween().pause(),P(-H/A),F.reset(),(r=V.normalizeScroll())&&r.disable(),(f=V.observe({preventDefault:!0,type:"wheel,touch,scroll",debounce:!1,allowClicks:!0,onChangeY:function onChangeY(){return Ga(-H)}})).nested=W(j,"wheel,touch,scroll",!0,!1!==t)):(f.nested.kill(),f.kill(),f=0,r&&r.enable(),i.progress=(-H/A-i.start)/(i.end-i.start),Ea(i))),this):!!f},this.kill=this.revert=function(){o.paused(!1),Ea(i),i.kill();for(var e=(b||[]).concat(s||[]),t=e.length;t--;)e[t].kill();V.scrollerProxy(S),V.removeEventListener("killAll",Oa),V.removeEventListener("refresh",Na),S.style.cssText=l,n.style.cssText=c;var r=V.defaults({});r&&r.scroller===S&&V.defaults({scroller:U}),o.normalizer&&V.normalizeScroll(!1),clearInterval(a),J=null,z&&z.disconnect(),K.style.removeProperty("height"),U.removeEventListener("focusin",Ja)},this.refresh=function(e,t){return i.refresh(e,t)},C&&(this.normalizer=V.normalizeScroll(!0===C?{debounce:!0,content:!k&&n}:C)),V.config(t),"overscrollBehavior"in U.getComputedStyle(K)&&I.set([K,j],{overscrollBehavior:"none"}),"scrollBehavior"in U.getComputedStyle(K)&&I.set([K,j],{scrollBehavior:"auto"}),U.addEventListener("focusin",Ja),a=setInterval(Aa,250),"loading"===G.readyState||requestAnimationFrame(function(){return V.refresh()})}r.version="3.12.2",r.create=function(e){return J&&e&&J.content()===q(e.content)[0]?J:new r(e)},r.get=function(){return J},t()&&I.registerPlugin(r),e.ScrollSmoother=r,e.default=r;if (typeof(window)==="undefined"||window!==e){Object.defineProperty(e,"__esModule",{value:!0})} else {delete e.default}});