import { _scrollers as D, Observer as Oe, _vertical as ge, _horizontal as Fe, _getTarget as ye, _getProxyProp as st, _getScrollFunc as Ct, _proxies as It, _getVelocityProp as Yn } from "./Observer.es.js";
/*!
 * ScrollTrigger 3.13.0
 * https://gsap.com
 *
 * @license Copyright 2008-2025, GreenSock. All rights reserved.
 * Subject to the terms at https://gsap.com/standard-license
 * @author: Jack Doyle, jack@greensock.com
*/
var u, wt, C, O, ke, R, qr, gr, Yt, Bt, Mt, er, ae, wr, Nr, de, sn, ln, xt, Cn, Ar, Sn, pe, Lr, kn, Tn, et, Hr, Vr, bt, Gr, _r, Wr, Or, tr = 1, fe = Date.now, Dr = fe(), De = 0, At = 0, an = function(e, n, r) {
  var t = Se(e) && (e.substr(0, 6) === "clamp(" || e.indexOf("max") > -1);
  return r["_" + n + "Clamp"] = t, t ? e.substr(6, e.length - 7) : e;
}, fn = function(e, n) {
  return n && (!Se(e) || e.substr(0, 6) !== "clamp(") ? "clamp(" + e + ")" : e;
}, Un = function s() {
  return At && requestAnimationFrame(s);
}, un = function() {
  return wr = 1;
}, cn = function() {
  return wr = 0;
}, Ye = function(e) {
  return e;
}, Ot = function(e) {
  return Math.round(e * 1e5) / 1e5 || 0;
}, Rn = function() {
  return typeof window != "undefined";
}, En = function() {
  return u || Rn() && (u = window.gsap) && u.registerPlugin && u;
}, ut = function(e) {
  return !!~qr.indexOf(e);
}, Pn = function(e) {
  return (e === "Height" ? Gr : C["inner" + e]) || ke["client" + e] || R["client" + e];
}, Mn = function(e) {
  return st(e, "getBoundingClientRect") || (ut(e) ? function() {
    return hr.width = C.innerWidth, hr.height = Gr, hr;
  } : function() {
    return Ke(e);
  });
}, Xn = function(e, n, r) {
  var t = r.d, o = r.d2, a = r.a;
  return (a = st(e, "getBoundingClientRect")) ? function() {
    return a()[t];
  } : function() {
    return (n ? Pn(o) : e["client" + o]) || 0;
  };
}, qn = function(e, n) {
  return !n || ~It.indexOf(e) ? Mn(e) : function() {
    return hr;
  };
}, Ue = function(e, n) {
  var r = n.s, t = n.d2, o = n.d, a = n.a;
  return Math.max(0, (r = "scroll" + t) && (a = st(e, r)) ? a() - Mn(e)()[o] : ut(e) ? (ke[r] || R[r]) - Pn(t) : e[r] - e["offset" + t]);
}, rr = function(e, n) {
  for (var r = 0; r < xt.length; r += 3)
    (!n || ~n.indexOf(xt[r + 1])) && e(xt[r], xt[r + 1], xt[r + 2]);
}, Se = function(e) {
  return typeof e == "string";
}, ue = function(e) {
  return typeof e == "function";
}, Dt = function(e) {
  return typeof e == "number";
}, it = function(e) {
  return typeof e == "object";
}, Pt = function(e, n, r) {
  return e && e.progress(n ? 0 : 1) && r && e.pause();
}, zr = function(e, n) {
  if (e.enabled) {
    var r = e._ctx ? e._ctx.add(function() {
      return n(e);
    }) : n(e);
    r && r.totalTime && (e.callbackAnimation = r);
  }
}, mt = Math.abs, An = "left", On = "top", Kr = "right", $r = "bottom", lt = "width", at = "height", Ft = "Right", Nt = "Left", Lt = "Top", Ht = "Bottom", Y = "padding", Me = "margin", St = "Width", Jr = "Height", X = "px", Ae = function(e) {
  return C.getComputedStyle(e);
}, Vn = function(e) {
  var n = Ae(e).position;
  e.style.position = n === "absolute" || n === "fixed" ? n : "relative";
}, pn = function(e, n) {
  for (var r in n)
    r in e || (e[r] = n[r]);
  return e;
}, Ke = function(e, n) {
  var r = n && Ae(e)[Nr] !== "matrix(1, 0, 0, 1, 0, 0)" && u.to(e, {
    x: 0,
    y: 0,
    xPercent: 0,
    yPercent: 0,
    rotation: 0,
    rotationX: 0,
    rotationY: 0,
    scale: 1,
    skewX: 0,
    skewY: 0
  }).progress(1), t = e.getBoundingClientRect();
  return r && r.progress(0).kill(), t;
}, mr = function(e, n) {
  var r = n.d2;
  return e["offset" + r] || e["client" + r] || 0;
}, Dn = function(e) {
  var n = [], r = e.labels, t = e.duration(), o;
  for (o in r)
    n.push(r[o] / t);
  return n;
}, Gn = function(e) {
  return function(n) {
    return u.utils.snap(Dn(e), n);
  };
}, Qr = function(e) {
  var n = u.utils.snap(e), r = Array.isArray(e) && e.slice(0).sort(function(t, o) {
    return t - o;
  });
  return r ? function(t, o, a) {
    a === void 0 && (a = 1e-3);
    var l;
    if (!o)
      return n(t);
    if (o > 0) {
      for (t -= a, l = 0; l < r.length; l++)
        if (r[l] >= t)
          return r[l];
      return r[l - 1];
    } else
      for (l = r.length, t += a; l--; )
        if (r[l] <= t)
          return r[l];
    return r[0];
  } : function(t, o, a) {
    a === void 0 && (a = 1e-3);
    var l = n(t);
    return !o || Math.abs(l - t) < a || l - t < 0 == o < 0 ? l : n(o < 0 ? t - e : t + e);
  };
}, Kn = function(e) {
  return function(n, r) {
    return Qr(Dn(e))(n, r.direction);
  };
}, nr = function(e, n, r, t) {
  return r.split(",").forEach(function(o) {
    return e(n, o, t);
  });
}, G = function(e, n, r, t, o) {
  return e.addEventListener(n, r, {
    passive: !t,
    capture: !!o
  });
}, V = function(e, n, r, t) {
  return e.removeEventListener(n, r, !!t);
}, ir = function(e, n, r) {
  r = r && r.wheelHandler, r && (e(n, "wheel", r), e(n, "touchmove", r));
}, dn = {
  startColor: "green",
  endColor: "red",
  indent: 0,
  fontSize: "16px",
  fontWeight: "normal"
}, or = {
  toggleActions: "play",
  anticipatePin: 0
}, vr = {
  top: 0,
  left: 0,
  center: 0.5,
  bottom: 1,
  right: 1
}, ur = function(e, n) {
  if (Se(e)) {
    var r = e.indexOf("="), t = ~r ? +(e.charAt(r - 1) + 1) * parseFloat(e.substr(r + 1)) : 0;
    ~r && (e.indexOf("%") > r && (t *= n / 100), e = e.substr(0, r - 1)), e = t + (e in vr ? vr[e] * n : ~e.indexOf("%") ? parseFloat(e) * n / 100 : parseFloat(e) || 0);
  }
  return e;
}, sr = function(e, n, r, t, o, a, l, c) {
  var v = o.startColor, F = o.endColor, P = o.fontSize, h = o.indent, f = o.fontWeight, b = O.createElement("div"), ee = ut(r) || st(r, "pinType") === "fixed", te = e.indexOf("scroller") !== -1, me = ee ? R : r, W = e.indexOf("start") !== -1, _e = W ? v : F, y = "border-color:" + _e + ";font-size:" + P + ";color:" + _e + ";font-weight:" + f + ";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";
  return y += "position:" + ((te || c) && ee ? "fixed;" : "absolute;"), (te || c || !ee) && (y += (t === ge ? Kr : $r) + ":" + (a + parseFloat(h)) + "px;"), l && (y += "box-sizing:border-box;text-align:left;width:" + l.offsetWidth + "px;"), b._isStart = W, b.setAttribute("class", "gsap-marker-" + e + (n ? " marker-" + n : "")), b.style.cssText = y, b.innerText = n || n === 0 ? e + "-" + n : e, me.children[0] ? me.insertBefore(b, me.children[0]) : me.appendChild(b), b._offset = b["offset" + t.op.d2], cr(b, 0, t, W), b;
}, cr = function(e, n, r, t) {
  var o = {
    display: "block"
  }, a = r[t ? "os2" : "p2"], l = r[t ? "p2" : "os2"];
  e._isFlipped = t, o[r.a + "Percent"] = t ? -100 : 0, o[r.a] = t ? "1px" : 0, o["border" + a + St] = 1, o["border" + l + St] = 0, o[r.p] = n + "px", u.set(e, o);
}, x = [], Yr = {}, Ut, hn = function() {
  return fe() - De > 34 && (Ut || (Ut = requestAnimationFrame($e)));
}, vt = function() {
  (!pe || !pe.isPressed || pe.startX > R.clientWidth) && (D.cache++, pe ? Ut || (Ut = requestAnimationFrame($e)) : $e(), De || pt("scrollStart"), De = fe());
}, Ir = function() {
  Tn = C.innerWidth, kn = C.innerHeight;
}, zt = function(e) {
  D.cache++, (e === !0 || !ae && !Sn && !O.fullscreenElement && !O.webkitFullscreenElement && (!Lr || Tn !== C.innerWidth || Math.abs(C.innerHeight - kn) > C.innerHeight * 0.25)) && gr.restart(!0);
}, ct = {}, $n = [], zn = function s() {
  return V(S, "scrollEnd", s) || ot(!0);
}, pt = function(e) {
  return ct[e] && ct[e].map(function(n) {
    return n();
  }) || $n;
}, Ce = [], In = function(e) {
  for (var n = 0; n < Ce.length; n += 5)
    (!e || Ce[n + 4] && Ce[n + 4].query === e) && (Ce[n].style.cssText = Ce[n + 1], Ce[n].getBBox && Ce[n].setAttribute("transform", Ce[n + 2] || ""), Ce[n + 3].uncache = 1);
}, Zr = function(e, n) {
  var r;
  for (de = 0; de < x.length; de++)
    r = x[de], r && (!n || r._ctx === n) && (e ? r.kill(1) : r.revert(!0, !0));
  _r = !0, n && In(n), n || pt("revert");
}, Bn = function(e, n) {
  D.cache++, (n || !he) && D.forEach(function(r) {
    return ue(r) && r.cacheID++ && (r.rec = 0);
  }), Se(e) && (C.history.scrollRestoration = Vr = e);
}, he, ft = 0, gn, Jn = function() {
  if (gn !== ft) {
    var e = gn = ft;
    requestAnimationFrame(function() {
      return e === ft && ot(!0);
    });
  }
}, Fn = function() {
  R.appendChild(bt), Gr = !pe && bt.offsetHeight || C.innerHeight, R.removeChild(bt);
}, _n = function(e) {
  return Yt(".gsap-marker-start, .gsap-marker-end, .gsap-marker-scroller-start, .gsap-marker-scroller-end").forEach(function(n) {
    return n.style.display = e ? "none" : "block";
  });
}, ot = function(e, n) {
  if (ke = O.documentElement, R = O.body, qr = [C, O, ke, R], De && !e && !_r) {
    G(S, "scrollEnd", zn);
    return;
  }
  Fn(), he = S.isRefreshing = !0, D.forEach(function(t) {
    return ue(t) && ++t.cacheID && (t.rec = t());
  });
  var r = pt("refreshInit");
  Cn && S.sort(), n || Zr(), D.forEach(function(t) {
    ue(t) && (t.smooth && (t.target.style.scrollBehavior = "auto"), t(0));
  }), x.slice(0).forEach(function(t) {
    return t.refresh();
  }), _r = !1, x.forEach(function(t) {
    if (t._subPinOffset && t.pin) {
      var o = t.vars.horizontal ? "offsetWidth" : "offsetHeight", a = t.pin[o];
      t.revert(!0, 1), t.adjustPinSpacing(t.pin[o] - a), t.refresh();
    }
  }), Wr = 1, _n(!0), x.forEach(function(t) {
    var o = Ue(t.scroller, t._dir), a = t.vars.end === "max" || t._endClamp && t.end > o, l = t._startClamp && t.start >= o;
    (a || l) && t.setPositions(l ? o - 1 : t.start, a ? Math.max(l ? o : t.start + 1, o) : t.end, !0);
  }), _n(!1), Wr = 0, r.forEach(function(t) {
    return t && t.render && t.render(-1);
  }), D.forEach(function(t) {
    ue(t) && (t.smooth && requestAnimationFrame(function() {
      return t.target.style.scrollBehavior = "smooth";
    }), t.rec && t(t.rec));
  }), Bn(Vr, 1), gr.pause(), ft++, he = 2, $e(2), x.forEach(function(t) {
    return ue(t.vars.onRefresh) && t.vars.onRefresh(t);
  }), he = S.isRefreshing = !1, pt("refresh");
}, Ur = 0, pr = 1, Wt, $e = function(e) {
  if (e === 2 || !he && !_r) {
    S.isUpdating = !0, Wt && Wt.update(0);
    var n = x.length, r = fe(), t = r - Dr >= 50, o = n && x[0].scroll();
    if (pr = Ur > o ? -1 : 1, he || (Ur = o), t && (De && !wr && r - De > 200 && (De = 0, pt("scrollEnd")), Mt = Dr, Dr = r), pr < 0) {
      for (de = n; de-- > 0; )
        x[de] && x[de].update(0, t);
      pr = 1;
    } else
      for (de = 0; de < n; de++)
        x[de] && x[de].update(0, t);
    S.isUpdating = !1;
  }
  Ut = 0;
}, Xr = [An, On, $r, Kr, Me + Ht, Me + Ft, Me + Lt, Me + Nt, "display", "flexShrink", "float", "zIndex", "gridColumnStart", "gridColumnEnd", "gridRowStart", "gridRowEnd", "gridArea", "justifySelf", "alignSelf", "placeSelf", "order"], dr = Xr.concat([lt, at, "boxSizing", "max" + St, "max" + Jr, "position", Me, Y, Y + Lt, Y + Ft, Y + Ht, Y + Nt]), Qn = function(e, n, r) {
  yt(r);
  var t = e._gsap;
  if (t.spacerIsNative)
    yt(t.spacerState);
  else if (e._gsap.swappedIn) {
    var o = n.parentNode;
    o && (o.insertBefore(e, n), o.removeChild(n));
  }
  e._gsap.swappedIn = !1;
}, Br = function(e, n, r, t) {
  if (!e._gsap.swappedIn) {
    for (var o = Xr.length, a = n.style, l = e.style, c; o--; )
      c = Xr[o], a[c] = r[c];
    a.position = r.position === "absolute" ? "absolute" : "relative", r.display === "inline" && (a.display = "inline-block"), l[$r] = l[Kr] = "auto", a.flexBasis = r.flexBasis || "auto", a.overflow = "visible", a.boxSizing = "border-box", a[lt] = mr(e, Fe) + X, a[at] = mr(e, ge) + X, a[Y] = l[Me] = l[On] = l[An] = "0", yt(t), l[lt] = l["max" + St] = r[lt], l[at] = l["max" + Jr] = r[at], l[Y] = r[Y], e.parentNode !== n && (e.parentNode.insertBefore(n, e), n.appendChild(e)), e._gsap.swappedIn = !0;
  }
}, Zn = /([A-Z])/g, yt = function(e) {
  if (e) {
    var n = e.t.style, r = e.length, t = 0, o, a;
    for ((e.t._gsap || u.core.getCache(e.t)).uncache = 1; t < r; t += 2)
      a = e[t + 1], o = e[t], a ? n[o] = a : n[o] && n.removeProperty(o.replace(Zn, "-$1").toLowerCase());
  }
}, lr = function(e) {
  for (var n = dr.length, r = e.style, t = [], o = 0; o < n; o++)
    t.push(dr[o], r[dr[o]]);
  return t.t = e, t;
}, jn = function(e, n, r) {
  for (var t = [], o = e.length, a = r ? 8 : 0, l; a < o; a += 2)
    l = e[a], t.push(l, l in n ? n[l] : e[a + 1]);
  return t.t = e.t, t;
}, hr = {
  left: 0,
  top: 0
}, mn = function(e, n, r, t, o, a, l, c, v, F, P, h, f, b) {
  ue(e) && (e = e(c)), Se(e) && e.substr(0, 3) === "max" && (e = h + (e.charAt(4) === "=" ? ur("0" + e.substr(3), r) : 0));
  var ee = f ? f.time() : 0, te, me, W;
  if (f && f.seek(0), isNaN(e) || (e = +e), Dt(e))
    f && (e = u.utils.mapRange(f.scrollTrigger.start, f.scrollTrigger.end, 0, h, e)), l && cr(l, r, t, !0);
  else {
    ue(n) && (n = n(c));
    var _e = (e || "0").split(" "), y, Xe, L, m;
    W = ye(n, c) || R, y = Ke(W) || {}, (!y || !y.left && !y.top) && Ae(W).display === "none" && (m = W.style.display, W.style.display = "block", y = Ke(W), m ? W.style.display = m : W.style.removeProperty("display")), Xe = ur(_e[0], y[t.d]), L = ur(_e[1] || "0", r), e = y[t.p] - v[t.p] - F + Xe + o - L, l && cr(l, L, t, r - L < 20 || l._isStart && L > 20), r -= r - L;
  }
  if (b && (c[b] = e || -1e-3, e < 0 && (e = 0)), a) {
    var Te = e + r, ze = a._isStart;
    te = "scroll" + t.d2, cr(a, Te, t, ze && Te > 20 || !ze && (P ? Math.max(R[te], ke[te]) : a.parentNode[te]) <= Te + 1), P && (v = Ke(l), P && (a.style[t.op.p] = v[t.op.p] - t.op.m - a._offset + X));
  }
  return f && W && (te = Ke(W), f.seek(h), me = Ke(W), f._caScrollDist = te[t.p] - me[t.p], e = e / f._caScrollDist * h), f && f.seek(ee), f ? e : Math.round(e);
}, ei = /(webkit|moz|length|cssText|inset)/i, vn = function(e, n, r, t) {
  if (e.parentNode !== n) {
    var o = e.style, a, l;
    if (n === R) {
      e._stOrig = o.cssText, l = Ae(e);
      for (a in l)
        !+a && !ei.test(a) && l[a] && typeof o[a] == "string" && a !== "0" && (o[a] = l[a]);
      o.top = r, o.left = t;
    } else
      o.cssText = e._stOrig;
    u.core.getCache(e).uncache = 1, n.appendChild(e);
  }
}, Nn = function(e, n, r) {
  var t = n, o = t;
  return function(a) {
    var l = Math.round(e());
    return l !== t && l !== o && Math.abs(l - t) > 3 && Math.abs(l - o) > 3 && (a = l, r && r()), o = t, t = Math.round(a), t;
  };
}, ar = function(e, n, r) {
  var t = {};
  t[n.p] = "+=" + r, u.set(e, t);
}, wn = function(e, n) {
  var r = Ct(e, n), t = "_scroll" + n.p2, o = function a(l, c, v, F, P) {
    var h = a.tween, f = c.onComplete, b = {};
    v = v || r();
    var ee = Nn(r, v, function() {
      h.kill(), a.tween = 0;
    });
    return P = F && P || 0, F = F || l - v, h && h.kill(), c[t] = l, c.inherit = !1, c.modifiers = b, b[t] = function() {
      return ee(v + F * h.ratio + P * h.ratio * h.ratio);
    }, c.onUpdate = function() {
      D.cache++, a.tween && $e();
    }, c.onComplete = function() {
      a.tween = 0, f && f.call(h);
    }, h = a.tween = u.to(e, c), h;
  };
  return e[t] = r, r.wheelHandler = function() {
    return o.tween && o.tween.kill() && (o.tween = 0);
  }, G(e, "wheel", r.wheelHandler), S.isTouch && G(e, "touchmove", r.wheelHandler), o;
}, S = /* @__PURE__ */ (function() {
  function s(n, r) {
    wt || s.register(u) || console.warn("Please gsap.registerPlugin(ScrollTrigger)"), Hr(this), this.init(n, r);
  }
  var e = s.prototype;
  return e.init = function(r, t) {
    if (this.progress = this.start = 0, this.vars && this.kill(!0, !0), !At) {
      this.update = this.refresh = this.kill = Ye;
      return;
    }
    r = pn(Se(r) || Dt(r) || r.nodeType ? {
      trigger: r
    } : r, or);
    var o = r, a = o.onUpdate, l = o.toggleClass, c = o.id, v = o.onToggle, F = o.onRefresh, P = o.scrub, h = o.trigger, f = o.pin, b = o.pinSpacing, ee = o.invalidateOnRefresh, te = o.anticipatePin, me = o.onScrubComplete, W = o.onSnapComplete, _e = o.once, y = o.snap, Xe = o.pinReparent, L = o.pinSpacer, m = o.containerAnimation, Te = o.fastScrollEnd, ze = o.preventOverlaps, d = r.horizontal || r.containerAnimation && r.horizontal !== !1 ? Fe : ge, ce = !P && P !== 0, g = ye(r.scroller || C), dt = u.core.getCache(g), re = ut(g), Re = ("pinType" in r ? r.pinType : st(g, "pinType") || re && "fixed") === "fixed", Ie = [r.onEnter, r.onLeave, r.onEnterBack, r.onLeaveBack], z = ce && r.toggleActions.split(" "), ve = "markers" in r ? r.markers : or.markers, K = re ? 0 : parseFloat(Ae(g)["border" + d.p2 + St]) || 0, i = this, ne = r.onRefreshInit && function() {
      return r.onRefreshInit(i);
    }, Xt = Xn(g, re, d), kt = qn(g, re), qe = 0, qt = 0, Ve = 0, $ = Ct(g, d), we, xe, jr, tt, ht, M, J, Ne, rt, Ee, Ge, Tt, xr, Q, Vt, Gt, br, ie, yr, Cr, Sr, Kt, gt, en, Pe, tn, kr, Tr, Rr, $t, Er, T, Jt, Je, Qe, Ze, Qt, Pr, _t;
    if (i._startClamp = i._endClamp = !1, i._dir = d, te *= 45, i.scroller = g, i.scroll = m ? m.time.bind(m) : $, tt = $(), i.vars = r, t = t || r.animation, "refreshPriority" in r && (Cn = 1, r.refreshPriority === -9999 && (Wt = i)), dt.tweenScroll = dt.tweenScroll || {
      top: wn(g, ge),
      left: wn(g, Fe)
    }, i.tweenTo = we = dt.tweenScroll[d.p], i.scrubDuration = function(p) {
      Jt = Dt(p) && p, Jt ? T ? T.duration(p) : T = u.to(t, {
        ease: "expo",
        totalProgress: "+=0",
        inherit: !1,
        duration: Jt,
        paused: !0,
        onComplete: function() {
          return me && me(i);
        }
      }) : (T && T.progress(1).kill(), T = 0);
    }, t && (t.vars.lazy = !1, t._initted && !i.isReverted || t.vars.immediateRender !== !1 && r.immediateRender !== !1 && t.duration() && t.render(0, !0, !0), i.animation = t.pause(), t.scrollTrigger = i, i.scrubDuration(P), $t = 0, c || (c = t.vars.id)), y && ((!it(y) || y.push) && (y = {
      snapTo: y
    }), "scrollBehavior" in R.style && u.set(re ? [R, ke] : g, {
      scrollBehavior: "auto"
    }), D.forEach(function(p) {
      return ue(p) && p.target === (re ? O.scrollingElement || ke : g) && (p.smooth = !1);
    }), jr = ue(y.snapTo) ? y.snapTo : y.snapTo === "labels" ? Gn(t) : y.snapTo === "labelsDirectional" ? Kn(t) : y.directional !== !1 ? function(p, E) {
      return Qr(y.snapTo)(p, fe() - qt < 500 ? 0 : E.direction);
    } : u.utils.snap(y.snapTo), Je = y.duration || {
      min: 0.1,
      max: 2
    }, Je = it(Je) ? Bt(Je.min, Je.max) : Bt(Je, Je), Qe = u.delayedCall(y.delay || Jt / 2 || 0.1, function() {
      var p = $(), E = fe() - qt < 500, _ = we.tween;
      if ((E || Math.abs(i.getVelocity()) < 10) && !_ && !wr && qe !== p) {
        var w = (p - M) / Q, q = t && !ce ? t.totalProgress() : w, k = E ? 0 : (q - Er) / (fe() - Mt) * 1e3 || 0, H = u.utils.clamp(-w, 1 - w, mt(k / 2) * k / 0.185), oe = w + (y.inertia === !1 ? 0 : H), N, I, A = y, Be = A.onStart, B = A.onInterrupt, be = A.onComplete;
        if (N = jr(oe, i), Dt(N) || (N = oe), I = Math.max(0, Math.round(M + N * Q)), p <= J && p >= M && I !== p) {
          if (_ && !_._initted && _.data <= mt(I - p))
            return;
          y.inertia === !1 && (H = N - w), we(I, {
            duration: Je(mt(Math.max(mt(oe - q), mt(N - q)) * 0.185 / k / 0.05 || 0)),
            ease: y.ease || "power3",
            data: mt(I - p),
            // record the distance so that if another snap tween occurs (conflict) we can prioritize the closest snap.
            onInterrupt: function() {
              return Qe.restart(!0) && B && B(i);
            },
            onComplete: function() {
              i.update(), qe = $(), t && !ce && (T ? T.resetTo("totalProgress", N, t._tTime / t._tDur) : t.progress(N)), $t = Er = t && !ce ? t.totalProgress() : i.progress, W && W(i), be && be(i);
            }
          }, p, H * Q, I - p - H * Q), Be && Be(i, we.tween);
        }
      } else i.isActive && qe !== p && Qe.restart(!0);
    }).pause()), c && (Yr[c] = i), h = i.trigger = ye(h || f !== !0 && f), _t = h && h._gsap && h._gsap.stRevert, _t && (_t = _t(i)), f = f === !0 ? h : ye(f), Se(l) && (l = {
      targets: h,
      className: l
    }), f && (b === !1 || b === Me || (b = !b && f.parentNode && f.parentNode.style && Ae(f.parentNode).display === "flex" ? !1 : Y), i.pin = f, xe = u.core.getCache(f), xe.spacer ? Vt = xe.pinState : (L && (L = ye(L), L && !L.nodeType && (L = L.current || L.nativeElement), xe.spacerIsNative = !!L, L && (xe.spacerState = lr(L))), xe.spacer = ie = L || O.createElement("div"), ie.classList.add("pin-spacer"), c && ie.classList.add("pin-spacer-" + c), xe.pinState = Vt = lr(f)), r.force3D !== !1 && u.set(f, {
      force3D: !0
    }), i.spacer = ie = xe.spacer, Rr = Ae(f), en = Rr[b + d.os2], Cr = u.getProperty(f), Sr = u.quickSetter(f, d.a, X), Br(f, ie, Rr), br = lr(f)), ve) {
      Tt = it(ve) ? pn(ve, dn) : dn, Ee = sr("scroller-start", c, g, d, Tt, 0), Ge = sr("scroller-end", c, g, d, Tt, 0, Ee), yr = Ee["offset" + d.op.d2];
      var rn = ye(st(g, "content") || g);
      Ne = this.markerStart = sr("start", c, rn, d, Tt, yr, 0, m), rt = this.markerEnd = sr("end", c, rn, d, Tt, yr, 0, m), m && (Pr = u.quickSetter([Ne, rt], d.a, X)), !Re && !(It.length && st(g, "fixedMarkers") === !0) && (Vn(re ? R : g), u.set([Ee, Ge], {
        force3D: !0
      }), tn = u.quickSetter(Ee, d.a, X), Tr = u.quickSetter(Ge, d.a, X));
    }
    if (m) {
      var nn = m.vars.onUpdate, Hn = m.vars.onUpdateParams;
      m.eventCallback("onUpdate", function() {
        i.update(0, 0, 1), nn && nn.apply(m, Hn || []);
      });
    }
    if (i.previous = function() {
      return x[x.indexOf(i) - 1];
    }, i.next = function() {
      return x[x.indexOf(i) + 1];
    }, i.revert = function(p, E) {
      if (!E)
        return i.kill(!0);
      var _ = p !== !1 || !i.enabled, w = ae;
      _ !== i.isReverted && (_ && (Ze = Math.max($(), i.scroll.rec || 0), Ve = i.progress, Qt = t && t.progress()), Ne && [Ne, rt, Ee, Ge].forEach(function(q) {
        return q.style.display = _ ? "none" : "block";
      }), _ && (ae = i, i.update(_)), f && (!Xe || !i.isActive) && (_ ? Qn(f, ie, Vt) : Br(f, ie, Ae(f), Pe)), _ || i.update(_), ae = w, i.isReverted = _);
    }, i.refresh = function(p, E, _, w) {
      if (!((ae || !i.enabled) && !E)) {
        if (f && p && De) {
          G(s, "scrollEnd", zn);
          return;
        }
        !he && ne && ne(i), ae = i, we.tween && !_ && (we.tween.kill(), we.tween = 0), T && T.pause(), ee && t && (t.revert({
          kill: !1
        }).invalidate(), t.getChildren && t.getChildren(!0, !0, !1).forEach(function(je) {
          return je.vars.immediateRender && je.render(0, !0, !0);
        })), i.isReverted || i.revert(!0, !0), i._subPinOffset = !1;
        var q = Xt(), k = kt(), H = m ? m.duration() : Ue(g, d), oe = Q <= 0.01 || !Q, N = 0, I = w || 0, A = it(_) ? _.end : r.end, Be = r.endTrigger || h, B = it(_) ? _.start : r.start || (r.start === 0 || !h ? 0 : f ? "0 0" : "0 100%"), be = i.pinnedContainer = r.pinnedContainer && ye(r.pinnedContainer, i), Le = h && Math.max(0, x.indexOf(i)) || 0, Z = Le, j, se, nt, Zt, le, U, He, Mr, on, Rt, We, Et, jt;
        for (ve && it(_) && (Et = u.getProperty(Ee, d.p), jt = u.getProperty(Ge, d.p)); Z-- > 0; )
          U = x[Z], U.end || U.refresh(0, 1) || (ae = i), He = U.pin, He && (He === h || He === f || He === be) && !U.isReverted && (Rt || (Rt = []), Rt.unshift(U), U.revert(!0, !0)), U !== x[Z] && (Le--, Z--);
        for (ue(B) && (B = B(i)), B = an(B, "start", i), M = mn(B, h, q, d, $(), Ne, Ee, i, k, K, Re, H, m, i._startClamp && "_startClamp") || (f ? -1e-3 : 0), ue(A) && (A = A(i)), Se(A) && !A.indexOf("+=") && (~A.indexOf(" ") ? A = (Se(B) ? B.split(" ")[0] : "") + A : (N = ur(A.substr(2), q), A = Se(B) ? B : (m ? u.utils.mapRange(0, m.duration(), m.scrollTrigger.start, m.scrollTrigger.end, M) : M) + N, Be = h)), A = an(A, "end", i), J = Math.max(M, mn(A || (Be ? "100% 0" : H), Be, q, d, $() + N, rt, Ge, i, k, K, Re, H, m, i._endClamp && "_endClamp")) || -1e-3, N = 0, Z = Le; Z--; )
          U = x[Z], He = U.pin, He && U.start - U._pinPush <= M && !m && U.end > 0 && (j = U.end - (i._startClamp ? Math.max(0, U.start) : U.start), (He === h && U.start - U._pinPush < M || He === be) && isNaN(B) && (N += j * (1 - U.progress)), He === f && (I += j));
        if (M += N, J += N, i._startClamp && (i._startClamp += N), i._endClamp && !he && (i._endClamp = J || -1e-3, J = Math.min(J, Ue(g, d))), Q = J - M || (M -= 0.01) && 1e-3, oe && (Ve = u.utils.clamp(0, 1, u.utils.normalize(M, J, Ze))), i._pinPush = I, Ne && N && (j = {}, j[d.a] = "+=" + N, be && (j[d.p] = "-=" + $()), u.set([Ne, rt], j)), f && !(Wr && i.end >= Ue(g, d)))
          j = Ae(f), Zt = d === ge, nt = $(), Kt = parseFloat(Cr(d.a)) + I, !H && J > 1 && (We = (re ? O.scrollingElement || ke : g).style, We = {
            style: We,
            value: We["overflow" + d.a.toUpperCase()]
          }, re && Ae(R)["overflow" + d.a.toUpperCase()] !== "scroll" && (We.style["overflow" + d.a.toUpperCase()] = "scroll")), Br(f, ie, j), br = lr(f), se = Ke(f, !0), Mr = Re && Ct(g, Zt ? Fe : ge)(), b ? (Pe = [b + d.os2, Q + I + X], Pe.t = ie, Z = b === Y ? mr(f, d) + Q + I : 0, Z && (Pe.push(d.d, Z + X), ie.style.flexBasis !== "auto" && (ie.style.flexBasis = Z + X)), yt(Pe), be && x.forEach(function(je) {
            je.pin === be && je.vars.pinSpacing !== !1 && (je._subPinOffset = !0);
          }), Re && $(Ze)) : (Z = mr(f, d), Z && ie.style.flexBasis !== "auto" && (ie.style.flexBasis = Z + X)), Re && (le = {
            top: se.top + (Zt ? nt - M : Mr) + X,
            left: se.left + (Zt ? Mr : nt - M) + X,
            boxSizing: "border-box",
            position: "fixed"
          }, le[lt] = le["max" + St] = Math.ceil(se.width) + X, le[at] = le["max" + Jr] = Math.ceil(se.height) + X, le[Me] = le[Me + Lt] = le[Me + Ft] = le[Me + Ht] = le[Me + Nt] = "0", le[Y] = j[Y], le[Y + Lt] = j[Y + Lt], le[Y + Ft] = j[Y + Ft], le[Y + Ht] = j[Y + Ht], le[Y + Nt] = j[Y + Nt], Gt = jn(Vt, le, Xe), he && $(0)), t ? (on = t._initted, Ar(1), t.render(t.duration(), !0, !0), gt = Cr(d.a) - Kt + Q + I, kr = Math.abs(Q - gt) > 1, Re && kr && Gt.splice(Gt.length - 2, 2), t.render(0, !0, !0), on || t.invalidate(!0), t.parent || t.totalTime(t.totalTime()), Ar(0)) : gt = Q, We && (We.value ? We.style["overflow" + d.a.toUpperCase()] = We.value : We.style.removeProperty("overflow-" + d.a));
        else if (h && $() && !m)
          for (se = h.parentNode; se && se !== R; )
            se._pinOffset && (M -= se._pinOffset, J -= se._pinOffset), se = se.parentNode;
        Rt && Rt.forEach(function(je) {
          return je.revert(!1, !0);
        }), i.start = M, i.end = J, tt = ht = he ? Ze : $(), !m && !he && (tt < Ze && $(Ze), i.scroll.rec = 0), i.revert(!1, !0), qt = fe(), Qe && (qe = -1, Qe.restart(!0)), ae = 0, t && ce && (t._initted || Qt) && t.progress() !== Qt && t.progress(Qt || 0, !0).render(t.time(), !0, !0), (oe || Ve !== i.progress || m || ee || t && !t._initted) && (t && !ce && (t._initted || Ve || t.vars.immediateRender !== !1) && t.totalProgress(m && M < -1e-3 && !Ve ? u.utils.normalize(M, J, 0) : Ve, !0), i.progress = oe || (tt - M) / Q === Ve ? 0 : Ve), f && b && (ie._pinOffset = Math.round(i.progress * gt)), T && T.invalidate(), isNaN(Et) || (Et -= u.getProperty(Ee, d.p), jt -= u.getProperty(Ge, d.p), ar(Ee, d, Et), ar(Ne, d, Et - (w || 0)), ar(Ge, d, jt), ar(rt, d, jt - (w || 0))), oe && !he && i.update(), F && !he && !xr && (xr = !0, F(i), xr = !1);
      }
    }, i.getVelocity = function() {
      return ($() - ht) / (fe() - Mt) * 1e3 || 0;
    }, i.endAnimation = function() {
      Pt(i.callbackAnimation), t && (T ? T.progress(1) : t.paused() ? ce || Pt(t, i.direction < 0, 1) : Pt(t, t.reversed()));
    }, i.labelToScroll = function(p) {
      return t && t.labels && (M || i.refresh() || M) + t.labels[p] / t.duration() * Q || 0;
    }, i.getTrailing = function(p) {
      var E = x.indexOf(i), _ = i.direction > 0 ? x.slice(0, E).reverse() : x.slice(E + 1);
      return (Se(p) ? _.filter(function(w) {
        return w.vars.preventOverlaps === p;
      }) : _).filter(function(w) {
        return i.direction > 0 ? w.end <= M : w.start >= J;
      });
    }, i.update = function(p, E, _) {
      if (!(m && !_ && !p)) {
        var w = he === !0 ? Ze : i.scroll(), q = p ? 0 : (w - M) / Q, k = q < 0 ? 0 : q > 1 ? 1 : q || 0, H = i.progress, oe, N, I, A, Be, B, be, Le;
        if (E && (ht = tt, tt = m ? $() : w, y && (Er = $t, $t = t && !ce ? t.totalProgress() : k)), te && f && !ae && !tr && De && (!k && M < w + (w - ht) / (fe() - Mt) * te ? k = 1e-4 : k === 1 && J > w + (w - ht) / (fe() - Mt) * te && (k = 0.9999)), k !== H && i.enabled) {
          if (oe = i.isActive = !!k && k < 1, N = !!H && H < 1, B = oe !== N, Be = B || !!k != !!H, i.direction = k > H ? 1 : -1, i.progress = k, Be && !ae && (I = k && !H ? 0 : k === 1 ? 1 : H === 1 ? 2 : 3, ce && (A = !B && z[I + 1] !== "none" && z[I + 1] || z[I], Le = t && (A === "complete" || A === "reset" || A in t))), ze && (B || Le) && (Le || P || !t) && (ue(ze) ? ze(i) : i.getTrailing(ze).forEach(function(nt) {
            return nt.endAnimation();
          })), ce || (T && !ae && !tr ? (T._dp._time - T._start !== T._time && T.render(T._dp._time - T._start), T.resetTo ? T.resetTo("totalProgress", k, t._tTime / t._tDur) : (T.vars.totalProgress = k, T.invalidate().restart())) : t && t.totalProgress(k, !!(ae && (qt || p)))), f) {
            if (p && b && (ie.style[b + d.os2] = en), !Re)
              Sr(Ot(Kt + gt * k));
            else if (Be) {
              if (be = !p && k > H && J + 1 > w && w + 1 >= Ue(g, d), Xe)
                if (!p && (oe || be)) {
                  var Z = Ke(f, !0), j = w - M;
                  vn(f, R, Z.top + (d === ge ? j : 0) + X, Z.left + (d === ge ? 0 : j) + X);
                } else
                  vn(f, ie);
              yt(oe || be ? Gt : br), kr && k < 1 && oe || Sr(Kt + (k === 1 && !be ? gt : 0));
            }
          }
          y && !we.tween && !ae && !tr && Qe.restart(!0), l && (B || _e && k && (k < 1 || !Or)) && Yt(l.targets).forEach(function(nt) {
            return nt.classList[oe || _e ? "add" : "remove"](l.className);
          }), a && !ce && !p && a(i), Be && !ae ? (ce && (Le && (A === "complete" ? t.pause().totalProgress(1) : A === "reset" ? t.restart(!0).pause() : A === "restart" ? t.restart(!0) : t[A]()), a && a(i)), (B || !Or) && (v && B && zr(i, v), Ie[I] && zr(i, Ie[I]), _e && (k === 1 ? i.kill(!1, 1) : Ie[I] = 0), B || (I = k === 1 ? 1 : 3, Ie[I] && zr(i, Ie[I]))), Te && !oe && Math.abs(i.getVelocity()) > (Dt(Te) ? Te : 2500) && (Pt(i.callbackAnimation), T ? T.progress(1) : Pt(t, A === "reverse" ? 1 : !k, 1))) : ce && a && !ae && a(i);
        }
        if (Tr) {
          var se = m ? w / m.duration() * (m._caScrollDist || 0) : w;
          tn(se + (Ee._isFlipped ? 1 : 0)), Tr(se);
        }
        Pr && Pr(-w / m.duration() * (m._caScrollDist || 0));
      }
    }, i.enable = function(p, E) {
      i.enabled || (i.enabled = !0, G(g, "resize", zt), re || G(g, "scroll", vt), ne && G(s, "refreshInit", ne), p !== !1 && (i.progress = Ve = 0, tt = ht = qe = $()), E !== !1 && i.refresh());
    }, i.getTween = function(p) {
      return p && we ? we.tween : T;
    }, i.setPositions = function(p, E, _, w) {
      if (m) {
        var q = m.scrollTrigger, k = m.duration(), H = q.end - q.start;
        p = q.start + H * p / k, E = q.start + H * E / k;
      }
      i.refresh(!1, !1, {
        start: fn(p, _ && !!i._startClamp),
        end: fn(E, _ && !!i._endClamp)
      }, w), i.update();
    }, i.adjustPinSpacing = function(p) {
      if (Pe && p) {
        var E = Pe.indexOf(d.d) + 1;
        Pe[E] = parseFloat(Pe[E]) + p + X, Pe[1] = parseFloat(Pe[1]) + p + X, yt(Pe);
      }
    }, i.disable = function(p, E) {
      if (i.enabled && (p !== !1 && i.revert(!0, !0), i.enabled = i.isActive = !1, E || T && T.pause(), Ze = 0, xe && (xe.uncache = 1), ne && V(s, "refreshInit", ne), Qe && (Qe.pause(), we.tween && we.tween.kill() && (we.tween = 0)), !re)) {
        for (var _ = x.length; _--; )
          if (x[_].scroller === g && x[_] !== i)
            return;
        V(g, "resize", zt), re || V(g, "scroll", vt);
      }
    }, i.kill = function(p, E) {
      i.disable(p, E), T && !E && T.kill(), c && delete Yr[c];
      var _ = x.indexOf(i);
      _ >= 0 && x.splice(_, 1), _ === de && pr > 0 && de--, _ = 0, x.forEach(function(w) {
        return w.scroller === i.scroller && (_ = 1);
      }), _ || he || (i.scroll.rec = 0), t && (t.scrollTrigger = null, p && t.revert({
        kill: !1
      }), E || t.kill()), Ne && [Ne, rt, Ee, Ge].forEach(function(w) {
        return w.parentNode && w.parentNode.removeChild(w);
      }), Wt === i && (Wt = 0), f && (xe && (xe.uncache = 1), _ = 0, x.forEach(function(w) {
        return w.pin === f && _++;
      }), _ || (xe.spacer = 0)), r.onKill && r.onKill(i);
    }, x.push(i), i.enable(!1, !1), _t && _t(i), t && t.add && !Q) {
      var Wn = i.update;
      i.update = function() {
        i.update = Wn, D.cache++, M || J || i.refresh();
      }, u.delayedCall(0.01, i.update), Q = 0.01, M = J = 0;
    } else
      i.refresh();
    f && Jn();
  }, s.register = function(r) {
    return wt || (u = r || En(), Rn() && window.document && s.enable(), wt = At), wt;
  }, s.defaults = function(r) {
    if (r)
      for (var t in r)
        or[t] = r[t];
    return or;
  }, s.disable = function(r, t) {
    At = 0, x.forEach(function(a) {
      return a[t ? "kill" : "disable"](r);
    }), V(C, "wheel", vt), V(O, "scroll", vt), clearInterval(er), V(O, "touchcancel", Ye), V(R, "touchstart", Ye), nr(V, O, "pointerdown,touchstart,mousedown", un), nr(V, O, "pointerup,touchend,mouseup", cn), gr.kill(), rr(V);
    for (var o = 0; o < D.length; o += 3)
      ir(V, D[o], D[o + 1]), ir(V, D[o], D[o + 2]);
  }, s.enable = function() {
    if (C = window, O = document, ke = O.documentElement, R = O.body, u && (Yt = u.utils.toArray, Bt = u.utils.clamp, Hr = u.core.context || Ye, Ar = u.core.suppressOverwrites || Ye, Vr = C.history.scrollRestoration || "auto", Ur = C.pageYOffset || 0, u.core.globals("ScrollTrigger", s), R)) {
      At = 1, bt = document.createElement("div"), bt.style.height = "100vh", bt.style.position = "absolute", Fn(), Un(), Oe.register(u), s.isTouch = Oe.isTouch, et = Oe.isTouch && /(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent), Lr = Oe.isTouch === 1, G(C, "wheel", vt), qr = [C, O, ke, R], u.matchMedia ? (s.matchMedia = function(v) {
        var F = u.matchMedia(), P;
        for (P in v)
          F.add(P, v[P]);
        return F;
      }, u.addEventListener("matchMediaInit", function() {
        return Zr();
      }), u.addEventListener("matchMediaRevert", function() {
        return In();
      }), u.addEventListener("matchMedia", function() {
        ot(0, 1), pt("matchMedia");
      }), u.matchMedia().add("(orientation: portrait)", function() {
        return Ir(), Ir;
      })) : console.warn("Requires GSAP 3.11.0 or later"), Ir(), G(O, "scroll", vt);
      var r = R.hasAttribute("style"), t = R.style, o = t.borderTopStyle, a = u.core.Animation.prototype, l, c;
      for (a.revert || Object.defineProperty(a, "revert", {
        value: function() {
          return this.time(-0.01, !0);
        }
      }), t.borderTopStyle = "solid", l = Ke(R), ge.m = Math.round(l.top + ge.sc()) || 0, Fe.m = Math.round(l.left + Fe.sc()) || 0, o ? t.borderTopStyle = o : t.removeProperty("border-top-style"), r || (R.setAttribute("style", ""), R.removeAttribute("style")), er = setInterval(hn, 250), u.delayedCall(0.5, function() {
        return tr = 0;
      }), G(O, "touchcancel", Ye), G(R, "touchstart", Ye), nr(G, O, "pointerdown,touchstart,mousedown", un), nr(G, O, "pointerup,touchend,mouseup", cn), Nr = u.utils.checkPrefix("transform"), dr.push(Nr), wt = fe(), gr = u.delayedCall(0.2, ot).pause(), xt = [O, "visibilitychange", function() {
        var v = C.innerWidth, F = C.innerHeight;
        O.hidden ? (sn = v, ln = F) : (sn !== v || ln !== F) && zt();
      }, O, "DOMContentLoaded", ot, C, "load", ot, C, "resize", zt], rr(G), x.forEach(function(v) {
        return v.enable(0, 1);
      }), c = 0; c < D.length; c += 3)
        ir(V, D[c], D[c + 1]), ir(V, D[c], D[c + 2]);
    }
  }, s.config = function(r) {
    "limitCallbacks" in r && (Or = !!r.limitCallbacks);
    var t = r.syncInterval;
    t && clearInterval(er) || (er = t) && setInterval(hn, t), "ignoreMobileResize" in r && (Lr = s.isTouch === 1 && r.ignoreMobileResize), "autoRefreshEvents" in r && (rr(V) || rr(G, r.autoRefreshEvents || "none"), Sn = (r.autoRefreshEvents + "").indexOf("resize") === -1);
  }, s.scrollerProxy = function(r, t) {
    var o = ye(r), a = D.indexOf(o), l = ut(o);
    ~a && D.splice(a, l ? 6 : 2), t && (l ? It.unshift(C, t, R, t, ke, t) : It.unshift(o, t));
  }, s.clearMatchMedia = function(r) {
    x.forEach(function(t) {
      return t._ctx && t._ctx.query === r && t._ctx.kill(!0, !0);
    });
  }, s.isInViewport = function(r, t, o) {
    var a = (Se(r) ? ye(r) : r).getBoundingClientRect(), l = a[o ? lt : at] * t || 0;
    return o ? a.right - l > 0 && a.left + l < C.innerWidth : a.bottom - l > 0 && a.top + l < C.innerHeight;
  }, s.positionInViewport = function(r, t, o) {
    Se(r) && (r = ye(r));
    var a = r.getBoundingClientRect(), l = a[o ? lt : at], c = t == null ? l / 2 : t in vr ? vr[t] * l : ~t.indexOf("%") ? parseFloat(t) * l / 100 : parseFloat(t) || 0;
    return o ? (a.left + c) / C.innerWidth : (a.top + c) / C.innerHeight;
  }, s.killAll = function(r) {
    if (x.slice(0).forEach(function(o) {
      return o.vars.id !== "ScrollSmoother" && o.kill();
    }), r !== !0) {
      var t = ct.killAll || [];
      ct = {}, t.forEach(function(o) {
        return o();
      });
    }
  }, s;
})();
S.version = "3.13.0";
S.saveStyles = function(s) {
  return s ? Yt(s).forEach(function(e) {
    if (e && e.style) {
      var n = Ce.indexOf(e);
      n >= 0 && Ce.splice(n, 5), Ce.push(e, e.style.cssText, e.getBBox && e.getAttribute("transform"), u.core.getCache(e), Hr());
    }
  }) : Ce;
};
S.revert = function(s, e) {
  return Zr(!s, e);
};
S.create = function(s, e) {
  return new S(s, e);
};
S.refresh = function(s) {
  return s ? zt(!0) : (wt || S.register()) && ot(!0);
};
S.update = function(s) {
  return ++D.cache && $e(s === !0 ? 2 : 0);
};
S.clearScrollMemory = Bn;
S.maxScroll = function(s, e) {
  return Ue(s, e ? Fe : ge);
};
S.getScrollFunc = function(s, e) {
  return Ct(ye(s), e ? Fe : ge);
};
S.getById = function(s) {
  return Yr[s];
};
S.getAll = function() {
  return x.filter(function(s) {
    return s.vars.id !== "ScrollSmoother";
  });
};
S.isScrolling = function() {
  return !!De;
};
S.snapDirectional = Qr;
S.addEventListener = function(s, e) {
  var n = ct[s] || (ct[s] = []);
  ~n.indexOf(e) || n.push(e);
};
S.removeEventListener = function(s, e) {
  var n = ct[s], r = n && n.indexOf(e);
  r >= 0 && n.splice(r, 1);
};
S.batch = function(s, e) {
  var n = [], r = {}, t = e.interval || 0.016, o = e.batchMax || 1e9, a = function(v, F) {
    var P = [], h = [], f = u.delayedCall(t, function() {
      F(P, h), P = [], h = [];
    }).pause();
    return function(b) {
      P.length || f.restart(!0), P.push(b.trigger), h.push(b), o <= P.length && f.progress(1);
    };
  }, l;
  for (l in e)
    r[l] = l.substr(0, 2) === "on" && ue(e[l]) && l !== "onRefreshInit" ? a(l, e[l]) : e[l];
  return ue(o) && (o = o(), G(S, "refresh", function() {
    return o = e.batchMax();
  })), Yt(s).forEach(function(c) {
    var v = {};
    for (l in r)
      v[l] = r[l];
    v.trigger = c, n.push(S.create(v));
  }), n;
};
var xn = function(e, n, r, t) {
  return n > t ? e(t) : n < 0 && e(0), r > t ? (t - n) / (r - n) : r < 0 ? n / (n - r) : 1;
}, Fr = function s(e, n) {
  n === !0 ? e.style.removeProperty("touch-action") : e.style.touchAction = n === !0 ? "auto" : n ? "pan-" + n + (Oe.isTouch ? " pinch-zoom" : "") : "none", e === ke && s(R, n);
}, fr = {
  auto: 1,
  scroll: 1
}, ti = function(e) {
  var n = e.event, r = e.target, t = e.axis, o = (n.changedTouches ? n.changedTouches[0] : n).target, a = o._gsap || u.core.getCache(o), l = fe(), c;
  if (!a._isScrollT || l - a._isScrollT > 2e3) {
    for (; o && o !== R && (o.scrollHeight <= o.clientHeight && o.scrollWidth <= o.clientWidth || !(fr[(c = Ae(o)).overflowY] || fr[c.overflowX])); )
      o = o.parentNode;
    a._isScroll = o && o !== r && !ut(o) && (fr[(c = Ae(o)).overflowY] || fr[c.overflowX]), a._isScrollT = l;
  }
  (a._isScroll || t === "x") && (n.stopPropagation(), n._gsapAllow = !0);
}, Ln = function(e, n, r, t) {
  return Oe.create({
    target: e,
    capture: !0,
    debounce: !1,
    lockAxis: !0,
    type: n,
    onWheel: t = t && ti,
    onPress: t,
    onDrag: t,
    onScroll: t,
    onEnable: function() {
      return r && G(O, Oe.eventTypes[0], yn, !1, !0);
    },
    onDisable: function() {
      return V(O, Oe.eventTypes[0], yn, !0);
    }
  });
}, ri = /(input|label|select|textarea)/i, bn, yn = function(e) {
  var n = ri.test(e.target.tagName);
  (n || bn) && (e._gsapAllow = !0, bn = n);
}, ni = function(e) {
  it(e) || (e = {}), e.preventDefault = e.isNormalizer = e.allowClicks = !0, e.type || (e.type = "wheel,touch"), e.debounce = !!e.debounce, e.id = e.id || "normalizer";
  var n = e, r = n.normalizeScrollX, t = n.momentum, o = n.allowNestedScroll, a = n.onRelease, l, c, v = ye(e.target) || ke, F = u.core.globals().ScrollSmoother, P = F && F.get(), h = et && (e.content && ye(e.content) || P && e.content !== !1 && !P.smooth() && P.content()), f = Ct(v, ge), b = Ct(v, Fe), ee = 1, te = (Oe.isTouch && C.visualViewport ? C.visualViewport.scale * C.visualViewport.width : C.outerWidth) / C.innerWidth, me = 0, W = ue(t) ? function() {
    return t(l);
  } : function() {
    return t || 2.8;
  }, _e, y, Xe = Ln(v, e.type, !0, o), L = function() {
    return y = !1;
  }, m = Ye, Te = Ye, ze = function() {
    c = Ue(v, ge), Te = Bt(et ? 1 : 0, c), r && (m = Bt(0, Ue(v, Fe))), _e = ft;
  }, d = function() {
    h._gsap.y = Ot(parseFloat(h._gsap.y) + f.offset) + "px", h.style.transform = "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, " + parseFloat(h._gsap.y) + ", 0, 1)", f.offset = f.cacheID = 0;
  }, ce = function() {
    if (y) {
      requestAnimationFrame(L);
      var ve = Ot(l.deltaY / 2), K = Te(f.v - ve);
      if (h && K !== f.v + f.offset) {
        f.offset = K - f.v;
        var i = Ot((parseFloat(h && h._gsap.y) || 0) - f.offset);
        h.style.transform = "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, " + i + ", 0, 1)", h._gsap.y = i + "px", f.cacheID = D.cache, $e();
      }
      return !0;
    }
    f.offset && d(), y = !0;
  }, g, dt, re, Re, Ie = function() {
    ze(), g.isActive() && g.vars.scrollY > c && (f() > c ? g.progress(1) && f(c) : g.resetTo("scrollY", c));
  };
  return h && u.set(h, {
    y: "+=0"
  }), e.ignoreCheck = function(z) {
    return et && z.type === "touchmove" && ce() || ee > 1.05 && z.type !== "touchstart" || l.isGesturing || z.touches && z.touches.length > 1;
  }, e.onPress = function() {
    y = !1;
    var z = ee;
    ee = Ot((C.visualViewport && C.visualViewport.scale || 1) / te), g.pause(), z !== ee && Fr(v, ee > 1.01 ? !0 : r ? !1 : "x"), dt = b(), re = f(), ze(), _e = ft;
  }, e.onRelease = e.onGestureStart = function(z, ve) {
    if (f.offset && d(), !ve)
      Re.restart(!0);
    else {
      D.cache++;
      var K = W(), i, ne;
      r && (i = b(), ne = i + K * 0.05 * -z.velocityX / 0.227, K *= xn(b, i, ne, Ue(v, Fe)), g.vars.scrollX = m(ne)), i = f(), ne = i + K * 0.05 * -z.velocityY / 0.227, K *= xn(f, i, ne, Ue(v, ge)), g.vars.scrollY = Te(ne), g.invalidate().duration(K).play(0.01), (et && g.vars.scrollY >= c || i >= c - 1) && u.to({}, {
        onUpdate: Ie,
        duration: K
      });
    }
    a && a(z);
  }, e.onWheel = function() {
    g._ts && g.pause(), fe() - me > 1e3 && (_e = 0, me = fe());
  }, e.onChange = function(z, ve, K, i, ne) {
    if (ft !== _e && ze(), ve && r && b(m(i[2] === ve ? dt + (z.startX - z.x) : b() + ve - i[1])), K) {
      f.offset && d();
      var Xt = ne[2] === K, kt = Xt ? re + z.startY - z.y : f() + K - ne[1], qe = Te(kt);
      Xt && kt !== qe && (re += qe - kt), f(qe);
    }
    (K || ve) && $e();
  }, e.onEnable = function() {
    Fr(v, r ? !1 : "x"), S.addEventListener("refresh", Ie), G(C, "resize", Ie), f.smooth && (f.target.style.scrollBehavior = "auto", f.smooth = b.smooth = !1), Xe.enable();
  }, e.onDisable = function() {
    Fr(v, !0), V(C, "resize", Ie), S.removeEventListener("refresh", Ie), Xe.kill();
  }, e.lockAxis = e.lockAxis !== !1, l = new Oe(e), l.iOS = et, et && !f() && f(1), et && u.ticker.add(Ye), Re = l._dc, g = u.to(l, {
    ease: "power4",
    paused: !0,
    inherit: !1,
    scrollX: r ? "+=0.1" : "+=0",
    scrollY: "+=0.1",
    modifiers: {
      scrollY: Nn(f, f(), function() {
        return g.pause();
      })
    },
    onUpdate: $e,
    onComplete: Re.vars.onComplete
  }), l;
};
S.sort = function(s) {
  if (ue(s))
    return x.sort(s);
  var e = C.pageYOffset || 0;
  return S.getAll().forEach(function(n) {
    return n._sortY = n.trigger ? e + n.trigger.getBoundingClientRect().top : n.start + C.innerHeight;
  }), x.sort(s || function(n, r) {
    return (n.vars.refreshPriority || 0) * -1e6 + (n.vars.containerAnimation ? 1e6 : n._sortY) - ((r.vars.containerAnimation ? 1e6 : r._sortY) + (r.vars.refreshPriority || 0) * -1e6);
  });
};
S.observe = function(s) {
  return new Oe(s);
};
S.normalizeScroll = function(s) {
  if (typeof s == "undefined")
    return pe;
  if (s === !0 && pe)
    return pe.enable();
  if (s === !1) {
    pe && pe.kill(), pe = s;
    return;
  }
  var e = s instanceof Oe ? s : ni(s);
  return pe && pe.target === e.target && pe.kill(), ut(e.target) && (pe = e), e;
};
S.core = {
  // smaller file size way to leverage in ScrollSmoother and Observer
  _getVelocityProp: Yn,
  _inputObserver: Ln,
  _scrollers: D,
  _proxies: It,
  bridge: {
    // when normalizeScroll sets the scroll position (ss = setScroll)
    ss: function() {
      De || pt("scrollStart"), De = fe();
    },
    // a way to get the _refreshing value in Observer
    ref: function() {
      return ae;
    }
  }
};
En() && u.registerPlugin(S);
export {
  S as ScrollTrigger,
  S as default
};
