/*!
 * ScrollToPlugin 3.12.2
 * https://greensock.com
 * 
 * @license Copyright 2023, GreenSock. All rights reserved.
 * Subject to the terms at https://greensock.com/standard-license or for Club GreenSock members, the agreement issued with that membership.
 * @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 m(){return"undefined"!=typeof window}function b(){return t||m()&&(t=window.gsap)&&t.registerPlugin&&t}function p(e){return"string"==typeof e}function f(e){return"function"==typeof e}function a(e,t){var i="x"===t?"Width":"Height",a="scroll"+i,r="client"+i;return e===s||e===n||e===o?Math.max(n[a],o[a])-(s["inner"+i]||n[r]||o[r]):e[a]-e["offset"+i]}function r(e,t){var i="scroll"+("x"===t?"Left":"Top");return e===s&&(null!=e.pageXOffset?i="page"+t.toUpperCase()+"Offset":e=null!=n[i]?n:o),function(){return e[i]}}function l(e,t){if(!(e=g(e)[0])||!e.getBoundingClientRect)return console.warn("scrollTo target doesn't exist. Using 0")||{x:0,y:0};var a=e.getBoundingClientRect(),c=!t||t===s||t===o,l=c?{top:n.clientTop-(s.pageYOffset||n.scrollTop||o.scrollTop||0),left:n.clientLeft-(s.pageXOffset||n.scrollLeft||o.scrollLeft||0)}:t.getBoundingClientRect(),i={x:a.left-l.left,y:a.top-l.top};return!c&&t&&(i.x+=r(t,"x")(),i.y+=r(t,"y")()),i}function d(e,t,n,s,o){return isNaN(e)||"object"==typeof e?p(e)&&"="===e.charAt(1)?parseFloat(e.substr(2))*("-"===e.charAt(0)?-1:1)+s-o:"max"===e?a(t,n)-o:Math.min(a(t,n),l(e,t)[n]-o):parseFloat(e)-o}function u(){t=b(),m()&&t&&"undefined"!=typeof document&&document.body&&(s=window,o=document.body,n=document.documentElement,g=t.utils.toArray,t.config({autoKillThreshold:7}),v=t.config(),h=1)}var t,n,s,o,c,h,g,v,i={version:"3.12.2",name:"scrollTo",rawVars:1,register:function(n){t=n,u()},init:function(n,o,i,a,l){h||u();var m=this,g=t.getProperty(n,"scrollSnapType");m.isWin=n===s,m.target=n,m.tween=i,o=function(t,n,s,o){if(f(t)&&(t=t(n,s,o)),"object"!=typeof t)return p(t)&&"max"!==t&&"="!==t.charAt(1)?{x:t,y:t}:{y:t};if(t.nodeType)return{y:t,x:t};var i,a={};for(i in t)a[i]="onAutoKill"!==i&&f(t[i])?t[i](n,s,o):t[i];return a}(o,a,n,l),m.vars=o,m.autoKill=!!o.autoKill,m.getX=r(n,"x"),m.getY=r(n,"y"),m.x=m.xPrev=m.getX(),m.y=m.yPrev=m.getY(),c=c||t.core.globals().ScrollTrigger,"smooth"===t.getProperty(n,"scrollBehavior")&&t.set(n,{scrollBehavior:"auto"}),g&&"none"!==g&&(m.snap=1,m.snapInline=n.style.scrollSnapType,n.style.scrollSnapType="none"),null!=o.x?(m.add(m,"x",m.x,d(o.x,n,"x",m.x,o.offsetX||0),a,l),m._props.push("scrollTo_x")):m.skipX=1,null!=o.y?(m.add(m,"y",m.y,d(o.y,n,"y",m.y,o.offsetY||0),a,l),m._props.push("scrollTo_y")):m.skipY=1},render:function(t,n){for(var i,r,d,u,h,l=n._pt,o=n.target,f=n.tween,j=n.autoKill,p=n.xPrev,g=n.yPrev,m=n.isWin,y=n.snap,b=n.snapInline;l;)l.r(t,l.d),l=l._next;i=m||!n.skipX?n.getX():p,h=(r=m||!n.skipY?n.getY():g)-g,u=i-p,d=v.autoKillThreshold,n.x<0&&(n.x=0),n.y<0&&(n.y=0),j&&(!n.skipX&&(d<u||u<-d)&&i<a(o,"x")&&(n.skipX=1),!n.skipY&&(d<h||h<-d)&&r<a(o,"y")&&(n.skipY=1),n.skipX&&n.skipY&&(f.kill(),n.vars.onAutoKill&&n.vars.onAutoKill.apply(f,n.vars.onAutoKillParams||[]))),m?s.scrollTo(n.skipX?i:n.x,n.skipY?r:n.y):(n.skipY||(o.scrollTop=n.y),n.skipX||(o.scrollLeft=n.x)),!y||1!==t&&0!==t||(r=o.scrollTop,i=o.scrollLeft,b?o.style.scrollSnapType=b:o.style.removeProperty("scroll-snap-type"),o.scrollTop=r+1,o.scrollLeft=i+1,o.scrollTop=r,o.scrollLeft=i),n.xPrev=n.x,n.yPrev=n.y,c&&c.update()},kill:function(t){var n="scrollTo"===t;!n&&"scrollTo_x"!==t||(this.skipX=1),!n&&"scrollTo_y"!==t||(this.skipY=1)}};i.max=a,i.getOffset=l,i.buildGetter=r,b()&&t.registerPlugin(i),e.ScrollToPlugin=i,e.default=i,typeof window=="undefined"||window!==e?Object.defineProperty(e,"__esModule",{value:!0}):delete e.default})