import { getGlobalMatrix as Ie, Matrix2D as ei } from "./utils/matrix.es.js";
function zt(h) {
  if (h === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return h;
}
function di(h, t) {
  h.prototype = Object.create(t.prototype), h.prototype.constructor = h, h.__proto__ = t;
}
var v, Y, te, de, ve, bt, _e, Pt, je, Pe, ti, kt, nt, Yt, et, ce, tt, dt, ii, Lt, pt = 0, oi = function() {
  return typeof window != "undefined";
}, ni = function() {
  return v || oi() && (v = window.gsap) && v.registerPlugin && v;
}, Ee = function(t) {
  return typeof t == "function";
}, it = function(t) {
  return typeof t == "object";
}, ue = function(t) {
  return typeof t == "undefined";
}, ht = function() {
  return !1;
}, ot = "transform", Ct = "transformOrigin", Me = function(t) {
  return Math.round(t * 1e4) / 1e4;
}, Ze = Array.isArray, ct = function(t, n) {
  var i = te.createElementNS ? te.createElementNS("http://www.w3.org/1999/xhtml".replace(/^https/, "http"), t) : te.createElement(t);
  return i.style ? i : te.createElement(t);
}, Gt = 180 / Math.PI, Ae = 1e20, hi = new ei(), Se = Date.now || function() {
  return (/* @__PURE__ */ new Date()).getTime();
}, Be = [], ze = {}, pi = 0, gi = /^(?:a|input|textarea|button|select)$/i, Qt = 0, He = {}, we = {}, ri = function(t, n) {
  var i = {}, l;
  for (l in t)
    i[l] = n ? t[l] * n : t[l];
  return i;
}, xi = function(t, n) {
  for (var i in n)
    i in t || (t[i] = n[i]);
  return t;
}, Vt = function h(t, n) {
  for (var i = t.length, l; i--; )
    n ? t[i].style.touchAction = n : t[i].style.removeProperty("touch-action"), l = t[i].children, l && l.length && h(l, n);
}, li = function() {
  return Be.forEach(function(t) {
    return t();
  });
}, yi = function(t) {
  Be.push(t), Be.length === 1 && v.ticker.add(li);
}, Kt = function() {
  return !Be.length && v.ticker.remove(li);
}, Ut = function(t) {
  for (var n = Be.length; n--; )
    Be[n] === t && Be.splice(n, 1);
  v.to(Kt, {
    overwrite: !0,
    delay: 15,
    duration: 0,
    onComplete: Kt,
    data: "_draggable"
  });
}, mi = function(t, n) {
  for (var i in n)
    i in t || (t[i] = n[i]);
  return t;
}, V = function(t, n, i, l) {
  if (t.addEventListener) {
    var f = nt[n];
    l = l || (ti ? {
      passive: !1
    } : null), t.addEventListener(f || n, i, l), f && n !== f && t.addEventListener(n, i, l);
  }
}, z = function(t, n, i, l) {
  if (t.removeEventListener) {
    var f = nt[n];
    t.removeEventListener(f || n, i, l), f && n !== f && t.removeEventListener(n, i, l);
  }
}, re = function(t) {
  t.preventDefault && t.preventDefault(), t.preventManipulation && t.preventManipulation();
}, wi = function(t, n) {
  for (var i = t.length; i--; )
    if (t[i].identifier === n)
      return !0;
}, _i = function h(t) {
  Yt = t.touches && pt < t.touches.length, z(t.target, "touchend", h);
}, qt = function(t) {
  Yt = t.touches && pt < t.touches.length, V(t.target, "touchend", _i);
}, Ge = function(t) {
  return Y.pageYOffset || t.scrollTop || t.documentElement.scrollTop || t.body.scrollTop || 0;
}, Qe = function(t) {
  return Y.pageXOffset || t.scrollLeft || t.documentElement.scrollLeft || t.body.scrollLeft || 0;
}, $t = function h(t, n) {
  V(t, "scroll", n), Ve(t.parentNode) || h(t.parentNode, n);
}, Jt = function h(t, n) {
  z(t, "scroll", n), Ve(t.parentNode) || h(t.parentNode, n);
}, Ve = function(t) {
  return !t || t === de || t.nodeType === 9 || t === te.body || t === Y || !t.nodeType || !t.parentNode;
}, Zt = function(t, n) {
  var i = n === "x" ? "Width" : "Height", l = "scroll" + i, f = "client" + i;
  return Math.max(0, Ve(t) ? Math.max(de[l], ve[l]) - (Y["inner" + i] || de[f] || ve[f]) : t[l] - t[f]);
}, Dt = function h(t, n) {
  var i = Zt(t, "x"), l = Zt(t, "y");
  Ve(t) ? t = we : h(t.parentNode, n), t._gsMaxScrollX = i, t._gsMaxScrollY = l, n || (t._gsScrollX = t.scrollLeft || 0, t._gsScrollY = t.scrollTop || 0);
}, Mt = function(t, n, i) {
  var l = t.style;
  l && (ue(l[n]) && (n = je(n, t) || n), i == null ? l.removeProperty && l.removeProperty(n.replace(/([A-Z])/g, "-$1").toLowerCase()) : l[n] = i);
}, rt = function(t) {
  return Y.getComputedStyle(t instanceof Element ? t : t.host || (t.parentNode || {}).host || t);
}, Oe = {}, We = function(t) {
  if (t === Y)
    return Oe.left = Oe.top = 0, Oe.width = Oe.right = de.clientWidth || t.innerWidth || ve.clientWidth || 0, Oe.height = Oe.bottom = (t.innerHeight || 0) - 20 < de.clientHeight ? de.clientHeight : t.innerHeight || ve.clientHeight || 0, Oe;
  var n = t.ownerDocument || te, i = ue(t.pageX) ? !t.nodeType && !ue(t.left) && !ue(t.top) ? t : Pe(t)[0].getBoundingClientRect() : {
    left: t.pageX - Qe(n),
    top: t.pageY - Ge(n),
    right: t.pageX - Qe(n) + 1,
    bottom: t.pageY - Ge(n) + 1
  };
  return ue(i.right) && !ue(i.width) ? (i.right = i.left + i.width, i.bottom = i.top + i.height) : ue(i.width) && (i = {
    width: i.right - i.left,
    height: i.bottom - i.top,
    right: i.right,
    left: i.left,
    bottom: i.bottom,
    top: i.top
  }), i;
}, F = function(t, n, i) {
  var l = t.vars, f = l[i], x = t._listeners[n], c;
  return Ee(f) && (c = f.apply(l.callbackScope || t, l[i + "Params"] || [t.pointerEvent])), x && t.dispatchEvent(n) === !1 && (c = !1), c;
}, jt = function(t, n) {
  var i = Pe(t)[0], l, f, x;
  return !i.nodeType && i !== Y ? ue(t.left) ? (f = t.min || t.minX || t.minRotation || 0, l = t.min || t.minY || 0, {
    left: f,
    top: l,
    width: (t.max || t.maxX || t.maxRotation || 0) - f,
    height: (t.max || t.maxY || 0) - l
  }) : (x = {
    x: 0,
    y: 0
  }, {
    left: t.left - x.x,
    top: t.top - x.y,
    width: t.width,
    height: t.height
  }) : vi(i, n);
}, le = {}, vi = function(t, n) {
  n = Pe(n)[0];
  var i = t.getBBox && t.ownerSVGElement, l = t.ownerDocument || te, f, x, c, L, b, _, D, S, e, y, R, J, N;
  if (t === Y)
    c = Ge(l), f = Qe(l), x = f + (l.documentElement.clientWidth || t.innerWidth || l.body.clientWidth || 0), L = c + ((t.innerHeight || 0) - 20 < l.documentElement.clientHeight ? l.documentElement.clientHeight : t.innerHeight || l.body.clientHeight || 0);
  else {
    if (n === Y || ue(n))
      return t.getBoundingClientRect();
    f = c = 0, i ? (y = t.getBBox(), R = y.width, J = y.height) : (t.viewBox && (y = t.viewBox.baseVal) && (f = y.x || 0, c = y.y || 0, R = y.width, J = y.height), R || (N = rt(t), y = N.boxSizing === "border-box", R = (parseFloat(N.width) || t.clientWidth || 0) + (y ? 0 : parseFloat(N.borderLeftWidth) + parseFloat(N.borderRightWidth)), J = (parseFloat(N.height) || t.clientHeight || 0) + (y ? 0 : parseFloat(N.borderTopWidth) + parseFloat(N.borderBottomWidth)))), x = R, L = J;
  }
  return t === n ? {
    left: f,
    top: c,
    width: x - f,
    height: L - c
  } : (b = Ie(n, !0).multiply(Ie(t)), _ = b.apply({
    x: f,
    y: c
  }), D = b.apply({
    x,
    y: c
  }), S = b.apply({
    x,
    y: L
  }), e = b.apply({
    x: f,
    y: L
  }), f = Math.min(_.x, D.x, S.x, e.x), c = Math.min(_.y, D.y, S.y, e.y), {
    left: f,
    top: c,
    width: Math.max(_.x, D.x, S.x, e.x) - f,
    height: Math.max(_.y, D.y, S.y, e.y) - c
  });
}, St = function(t, n, i, l, f, x) {
  var c = {}, L, b, _;
  if (n)
    if (f !== 1 && n instanceof Array) {
      if (c.end = L = [], _ = n.length, it(n[0]))
        for (b = 0; b < _; b++)
          L[b] = ri(n[b], f);
      else
        for (b = 0; b < _; b++)
          L[b] = n[b] * f;
      i += 1.1, l -= 1.1;
    } else Ee(n) ? c.end = function(D) {
      var S = n.call(t, D), e, y;
      if (f !== 1)
        if (it(S)) {
          e = {};
          for (y in S)
            e[y] = S[y] * f;
          S = e;
        } else
          S *= f;
      return S;
    } : c.end = n;
  return (i || i === 0) && (c.max = i), (l || l === 0) && (c.min = l), x && (c.velocity = 0), c;
}, Ti = function h(t) {
  var n;
  return !t || !t.getAttribute || t === ve ? !1 : (n = t.getAttribute("data-clickable")) === "true" || n !== "false" && (gi.test(t.nodeName + "") || t.getAttribute("contentEditable") === "true") ? !0 : h(t.parentNode);
}, ut = function(t, n) {
  for (var i = t.length, l; i--; )
    l = t[i], l.ondragstart = l.onselectstart = n ? null : ht, v.set(l, {
      lazy: !0,
      userSelect: n ? "text" : "none"
    });
}, bi = function h(t) {
  if (rt(t).position === "fixed")
    return !0;
  if (t = t.parentNode, t && t.nodeType === 1)
    return h(t);
}, si, Xt, Di = function(t, n) {
  t = v.utils.toArray(t)[0], n = n || {};
  var i = document.createElement("div"), l = i.style, f = t.firstChild, x = 0, c = 0, L = t.scrollTop, b = t.scrollLeft, _ = t.scrollWidth, D = t.scrollHeight, S = 0, e = 0, y = 0, R, J, N, ke, Le, Ce;
  si && n.force3D !== !1 ? (Le = "translate3d(", Ce = "px,0px)") : ot && (Le = "translate(", Ce = "px)"), this.scrollTop = function(E, j) {
    if (!arguments.length)
      return -this.top();
    this.top(-E, j);
  }, this.scrollLeft = function(E, j) {
    if (!arguments.length)
      return -this.left();
    this.left(-E, j);
  }, this.left = function(E, j) {
    if (!arguments.length)
      return -(t.scrollLeft + c);
    var I = t.scrollLeft - b, M = c;
    if ((I > 2 || I < -2) && !j) {
      b = t.scrollLeft, v.killTweensOf(this, {
        left: 1,
        scrollLeft: 1
      }), this.left(-b), n.onKill && n.onKill();
      return;
    }
    E = -E, E < 0 ? (c = E - 0.5 | 0, E = 0) : E > e ? (c = E - e | 0, E = e) : c = 0, (c || M) && (this._skip || (l[ot] = Le + -c + "px," + -x + Ce), c + S >= 0 && (l.paddingRight = c + S + "px")), t.scrollLeft = E | 0, b = t.scrollLeft;
  }, this.top = function(E, j) {
    if (!arguments.length)
      return -(t.scrollTop + x);
    var I = t.scrollTop - L, M = x;
    if ((I > 2 || I < -2) && !j) {
      L = t.scrollTop, v.killTweensOf(this, {
        top: 1,
        scrollTop: 1
      }), this.top(-L), n.onKill && n.onKill();
      return;
    }
    E = -E, E < 0 ? (x = E - 0.5 | 0, E = 0) : E > y ? (x = E - y | 0, E = y) : x = 0, (x || M) && (this._skip || (l[ot] = Le + -c + "px," + -x + Ce)), t.scrollTop = E | 0, L = t.scrollTop;
  }, this.maxScrollTop = function() {
    return y;
  }, this.maxScrollLeft = function() {
    return e;
  }, this.disable = function() {
    for (f = i.firstChild; f; )
      ke = f.nextSibling, t.appendChild(f), f = ke;
    t === i.parentNode && t.removeChild(i);
  }, this.enable = function() {
    if (f = t.firstChild, f !== i) {
      for (; f; )
        ke = f.nextSibling, i.appendChild(f), f = ke;
      t.appendChild(i), this.calibrate();
    }
  }, this.calibrate = function(E) {
    var j = t.clientWidth === R, I, M, xe;
    L = t.scrollTop, b = t.scrollLeft, !(j && t.clientHeight === J && i.offsetHeight === N && _ === t.scrollWidth && D === t.scrollHeight && !E) && ((x || c) && (M = this.left(), xe = this.top(), this.left(-t.scrollLeft), this.top(-t.scrollTop)), I = rt(t), (!j || E) && (l.display = "block", l.width = "auto", l.paddingRight = "0px", S = Math.max(0, t.scrollWidth - t.clientWidth), S && (S += parseFloat(I.paddingLeft) + (Xt ? parseFloat(I.paddingRight) : 0))), l.display = "inline-block", l.position = "relative", l.overflow = "visible", l.verticalAlign = "top", l.boxSizing = "content-box", l.width = "100%", l.paddingRight = S + "px", Xt && (l.paddingBottom = I.paddingBottom), R = t.clientWidth, J = t.clientHeight, _ = t.scrollWidth, D = t.scrollHeight, e = t.scrollWidth - R, y = t.scrollHeight - J, N = i.offsetHeight, l.display = "block", (M || xe) && (this.left(M), this.top(xe)));
  }, this.content = i, this.element = t, this._skip = !1, this.enable();
}, Et = function(t) {
  if (oi() && document.body) {
    var n = window && window.navigator;
    Y = window, te = document, de = te.documentElement, ve = te.body, bt = ct("div"), dt = !!window.PointerEvent, _e = ct("div"), _e.style.cssText = "visibility:hidden;height:1px;top:-1px;pointer-events:none;position:relative;clear:both;cursor:grab", tt = _e.style.cursor === "grab" ? "grab" : "move", et = n && n.userAgent.toLowerCase().indexOf("android") !== -1, kt = "ontouchstart" in de && "orientation" in Y || n && (n.MaxTouchPoints > 0 || n.msMaxTouchPoints > 0), Xt = (function() {
      var i = ct("div"), l = ct("div"), f = l.style, x = ve, c;
      return f.display = "inline-block", f.position = "relative", i.style.cssText = "width:90px;height:40px;padding:10px;overflow:auto;visibility:hidden", i.appendChild(l), x.appendChild(i), c = l.offsetHeight + 18 > i.scrollHeight, x.removeChild(i), c;
    })(), nt = (function(i) {
      for (var l = i.split(","), f = ("onpointerdown" in bt ? "pointerdown,pointermove,pointerup,pointercancel" : "onmspointerdown" in bt ? "MSPointerDown,MSPointerMove,MSPointerUp,MSPointerCancel" : i).split(","), x = {}, c = 4; --c > -1; )
        x[l[c]] = f[c], x[f[c]] = l[c];
      try {
        de.addEventListener("test", null, Object.defineProperty({}, "passive", {
          get: function() {
            ti = 1;
          }
        }));
      } catch {
      }
      return x;
    })("touchstart,touchmove,touchend,touchcancel"), V(te, "touchcancel", ht), V(Y, "touchmove", ht), ve && ve.addEventListener("touchstart", ht), V(te, "contextmenu", function() {
      for (var i in ze)
        ze[i].isPressed && ze[i].endDrag();
    }), v = Pt = ni();
  }
  v ? (ce = v.plugins.inertia, ii = v.core.context || function() {
  }, je = v.utils.checkPrefix, ot = je(ot), Ct = je(Ct), Pe = v.utils.toArray, Lt = v.core.getStyleSaver, si = !!je("perspective")) : t && console.warn("Please gsap.registerPlugin(Draggable)");
}, Mi = /* @__PURE__ */ (function() {
  function h(n) {
    this._listeners = {}, this.target = n || this;
  }
  var t = h.prototype;
  return t.addEventListener = function(i, l) {
    var f = this._listeners[i] || (this._listeners[i] = []);
    ~f.indexOf(l) || f.push(l);
  }, t.removeEventListener = function(i, l) {
    var f = this._listeners[i], x = f && f.indexOf(l);
    x >= 0 && f.splice(x, 1);
  }, t.dispatchEvent = function(i) {
    var l = this, f;
    return (this._listeners[i] || []).forEach(function(x) {
      return x.call(l, {
        type: i,
        target: l.target
      }) === !1 && (f = !1);
    }), f;
  }, h;
})(), gt = /* @__PURE__ */ (function(h) {
  di(t, h);
  function t(n, i) {
    var l;
    l = h.call(this) || this, Pt || Et(1), n = Pe(n)[0], l.styles = Lt && Lt(n, "transform,left,top"), ce || (ce = v.plugins.inertia), l.vars = i = ri(i || {}), l.target = n, l.x = l.y = l.rotation = 0, l.dragResistance = parseFloat(i.dragResistance) || 0, l.edgeResistance = isNaN(i.edgeResistance) ? 1 : parseFloat(i.edgeResistance) || 0, l.lockAxis = i.lockAxis, l.autoScroll = i.autoScroll || 0, l.lockedAxis = null, l.allowEventDefault = !!i.allowEventDefault, v.getProperty(n, "x");
    var f = (i.type || "x,y").toLowerCase(), x = ~f.indexOf("x") || ~f.indexOf("y"), c = f.indexOf("rotation") !== -1, L = c ? "rotation" : x ? "x" : "left", b = x ? "y" : "top", _ = !!(~f.indexOf("x") || ~f.indexOf("left") || f === "scroll"), D = !!(~f.indexOf("y") || ~f.indexOf("top") || f === "scroll"), S = i.minimumMovement || 2, e = zt(l), y = Pe(i.trigger || i.handle || n), R = {}, J = 0, N = !1, ke = i.autoScrollMarginTop || 40, Le = i.autoScrollMarginRight || 40, Ce = i.autoScrollMarginBottom || 40, E = i.autoScrollMarginLeft || 40, j = i.clickableTest || Ti, I = 0, M = n._gsap || v.core.getCache(n), xe = bi(n), Fe = function(o, s) {
      return parseFloat(M.get(n, o, s));
    }, P = n.ownerDocument || te, ye, m, he, pe, U, G, Xe, Rt, Nt, O, A, Q, H, lt, ie, Ke, K, xt, Te, be, Ye, Ue, q, k, At, oe, se, yt, mt, Ot, ee, It, st, Bt = function(o) {
      return re(o), o.stopImmediatePropagation && o.stopImmediatePropagation(), !1;
    }, ge = function g(o) {
      if (e.autoScroll && e.isDragging && (N || K)) {
        var s = n, r = e.autoScroll * 15, a, u, d, w, p, C, T, X;
        for (N = !1, we.scrollTop = Y.pageYOffset != null ? Y.pageYOffset : P.documentElement.scrollTop != null ? P.documentElement.scrollTop : P.body.scrollTop, we.scrollLeft = Y.pageXOffset != null ? Y.pageXOffset : P.documentElement.scrollLeft != null ? P.documentElement.scrollLeft : P.body.scrollLeft, w = e.pointerX - we.scrollLeft, p = e.pointerY - we.scrollTop; s && !u; )
          u = Ve(s.parentNode), a = u ? we : s.parentNode, d = u ? {
            bottom: Math.max(de.clientHeight, Y.innerHeight || 0),
            right: Math.max(de.clientWidth, Y.innerWidth || 0),
            left: 0,
            top: 0
          } : a.getBoundingClientRect(), C = T = 0, D && (X = a._gsMaxScrollY - a.scrollTop, X < 0 ? T = X : p > d.bottom - Ce && X ? (N = !0, T = Math.min(X, r * (1 - Math.max(0, d.bottom - p) / Ce) | 0)) : p < d.top + ke && a.scrollTop && (N = !0, T = -Math.min(a.scrollTop, r * (1 - Math.max(0, p - d.top) / ke) | 0)), T && (a.scrollTop += T)), _ && (X = a._gsMaxScrollX - a.scrollLeft, X < 0 ? C = X : w > d.right - Le && X ? (N = !0, C = Math.min(X, r * (1 - Math.max(0, d.right - w) / Le) | 0)) : w < d.left + E && a.scrollLeft && (N = !0, C = -Math.min(a.scrollLeft, r * (1 - Math.max(0, w - d.left) / E) | 0)), C && (a.scrollLeft += C)), u && (C || T) && (Y.scrollTo(a.scrollLeft, a.scrollTop), Je(e.pointerX + C, e.pointerY + T)), s = a;
      }
      if (K) {
        var B = e.x, Z = e.y;
        c ? (e.deltaX = B - parseFloat(M.rotation), e.rotation = B, M.rotation = B + "deg", M.renderTransform(1, M)) : m ? (D && (e.deltaY = Z - m.top(), m.top(Z)), _ && (e.deltaX = B - m.left(), m.left(B))) : x ? (D && (e.deltaY = Z - parseFloat(M.y), M.y = Z + "px"), _ && (e.deltaX = B - parseFloat(M.x), M.x = B + "px"), M.renderTransform(1, M)) : (D && (e.deltaY = Z - parseFloat(n.style.top || 0), n.style.top = Z + "px"), _ && (e.deltaX = B - parseFloat(n.style.left || 0), n.style.left = B + "px")), Rt && !o && !yt && (yt = !0, F(e, "drag", "onDrag") === !1 && (_ && (e.x -= e.deltaX), D && (e.y -= e.deltaY), g(!0)), yt = !1);
      }
      K = !1;
    }, Re = function(o, s) {
      var r = e.x, a = e.y, u, d;
      n._gsap || (M = v.core.getCache(n)), M.uncache && v.getProperty(n, "x"), x ? (e.x = parseFloat(M.x), e.y = parseFloat(M.y)) : c ? e.x = e.rotation = parseFloat(M.rotation) : m ? (e.y = m.top(), e.x = m.left()) : (e.y = parseFloat(n.style.top || (d = rt(n)) && d.top) || 0, e.x = parseFloat(n.style.left || (d || {}).left) || 0), (Te || be || Ye) && !s && (e.isDragging || e.isThrowing) && (Ye && (He.x = e.x, He.y = e.y, u = Ye(He), u.x !== e.x && (e.x = u.x, K = !0), u.y !== e.y && (e.y = u.y, K = !0)), Te && (u = Te(e.x), u !== e.x && (e.x = u, c && (e.rotation = u), K = !0)), be && (u = be(e.y), u !== e.y && (e.y = u), K = !0)), K && ge(!0), o || (e.deltaX = e.x - r, e.deltaY = e.y - a, F(e, "throwupdate", "onThrowUpdate"));
    }, wt = function(o, s, r, a) {
      return s == null && (s = -Ae), r == null && (r = Ae), Ee(o) ? function(u) {
        var d = e.isPressed ? 1 - e.edgeResistance : 1;
        return o.call(e, (u > r ? r + (u - r) * d : u < s ? s + (u - s) * d : u) * a) * a;
      } : Ze(o) ? function(u) {
        for (var d = o.length, w = 0, p = Ae, C, T; --d > -1; )
          C = o[d], T = C - u, T < 0 && (T = -T), T < p && C >= s && C <= r && (w = d, p = T);
        return o[w];
      } : isNaN(o) ? function(u) {
        return u;
      } : function() {
        return o * a;
      };
    }, ai = function(o, s, r, a, u, d, w) {
      return d = d && d < Ae ? d * d : Ae, Ee(o) ? function(p) {
        var C = e.isPressed ? 1 - e.edgeResistance : 1, T = p.x, X = p.y, B, Z, me;
        return p.x = T = T > r ? r + (T - r) * C : T < s ? s + (T - s) * C : T, p.y = X = X > u ? u + (X - u) * C : X < a ? a + (X - a) * C : X, B = o.call(e, p), B !== p && (p.x = B.x, p.y = B.y), w !== 1 && (p.x *= w, p.y *= w), d < Ae && (Z = p.x - T, me = p.y - X, Z * Z + me * me > d && (p.x = T, p.y = X)), p;
      } : Ze(o) ? function(p) {
        for (var C = o.length, T = 0, X = Ae, B, Z, me, ne; --C > -1; )
          me = o[C], B = me.x - p.x, Z = me.y - p.y, ne = B * B + Z * Z, ne < X && (T = C, X = ne);
        return X <= d ? o[T] : p;
      } : function(p) {
        return p;
      };
    }, _t = function() {
      var o, s, r, a;
      Xe = !1, m ? (m.calibrate(), e.minX = A = -m.maxScrollLeft(), e.minY = H = -m.maxScrollTop(), e.maxX = O = e.maxY = Q = 0, Xe = !0) : i.bounds && (o = jt(i.bounds, n.parentNode), c ? (e.minX = A = o.left, e.maxX = O = o.left + o.width, e.minY = H = e.maxY = Q = 0) : !ue(i.bounds.maxX) || !ue(i.bounds.maxY) ? (o = i.bounds, e.minX = A = o.minX, e.minY = H = o.minY, e.maxX = O = o.maxX, e.maxY = Q = o.maxY) : (s = jt(n, n.parentNode), e.minX = A = Math.round(Fe(L, "px") + o.left - s.left), e.minY = H = Math.round(Fe(b, "px") + o.top - s.top), e.maxX = O = Math.round(A + (o.width - s.width)), e.maxY = Q = Math.round(H + (o.height - s.height))), A > O && (e.minX = O, e.maxX = O = A, A = e.minX), H > Q && (e.minY = Q, e.maxY = Q = H, H = e.minY), c && (e.minRotation = A, e.maxRotation = O), Xe = !0), i.liveSnap && (r = i.liveSnap === !0 ? i.snap || {} : i.liveSnap, a = Ze(r) || Ee(r), c ? (Te = wt(a ? r : r.rotation, A, O, 1), be = null) : r.points ? Ye = ai(a ? r : r.points, A, O, H, Q, r.radius, m ? -1 : 1) : (_ && (Te = wt(a ? r : r.x || r.left || r.scrollLeft, A, O, m ? -1 : 1)), D && (be = wt(a ? r : r.y || r.top || r.scrollTop, H, Q, m ? -1 : 1))));
    }, fi = function() {
      e.isThrowing = !1, F(e, "throwcomplete", "onThrowComplete");
    }, ci = function() {
      e.isThrowing = !1;
    }, vt = function(o, s) {
      var r, a, u, d;
      o && ce ? (o === !0 && (r = i.snap || i.liveSnap || {}, a = Ze(r) || Ee(r), o = {
        resistance: (i.throwResistance || i.resistance || 1e3) / (c ? 10 : 1)
      }, c ? o.rotation = St(e, a ? r : r.rotation, O, A, 1, s) : (_ && (o[L] = St(e, a ? r : r.points || r.x || r.left, O, A, m ? -1 : 1, s || e.lockedAxis === "x")), D && (o[b] = St(e, a ? r : r.points || r.y || r.top, Q, H, m ? -1 : 1, s || e.lockedAxis === "y")), (r.points || Ze(r) && it(r[0])) && (o.linkedProps = L + "," + b, o.radius = r.radius))), e.isThrowing = !0, d = isNaN(i.overshootTolerance) ? i.edgeResistance === 1 ? 0 : 1 - e.edgeResistance + 0.2 : i.overshootTolerance, o.duration || (o.duration = {
        max: Math.max(i.minDuration || 0, "maxDuration" in i ? i.maxDuration : 2),
        min: isNaN(i.minDuration) ? d === 0 || it(o) && o.resistance > 1e3 ? 0 : 0.5 : i.minDuration,
        overshoot: d
      }), e.tween = u = v.to(m || n, {
        inertia: o,
        data: "_draggable",
        inherit: !1,
        onComplete: fi,
        onInterrupt: ci,
        onUpdate: i.fastMode ? F : Re,
        onUpdateParams: i.fastMode ? [e, "onthrowupdate", "onThrowUpdate"] : r && r.radius ? [!1, !0] : []
      }), i.fastMode || (m && (m._skip = !0), u.render(1e9, !0, !0), Re(!0, !0), e.endX = e.x, e.endY = e.y, c && (e.endRotation = e.x), u.play(0), Re(!0, !0), m && (m._skip = !1))) : Xe && e.applyBounds();
    }, Ft = function(o) {
      var s = k, r;
      k = Ie(n.parentNode, !0), o && e.isPressed && !k.equals(s || new ei()) && (r = s.inverse().apply({
        x: he,
        y: pe
      }), k.apply(r, r), he = r.x, pe = r.y), k.equals(hi) && (k = null);
    }, at = function() {
      var o = 1 - e.edgeResistance, s = xe ? Qe(P) : 0, r = xe ? Ge(P) : 0, a, u, d;
      x && (M.x = Fe(L, "px") + "px", M.y = Fe(b, "px") + "px", M.renderTransform()), Ft(!1), le.x = e.pointerX - s, le.y = e.pointerY - r, k && k.apply(le, le), he = le.x, pe = le.y, K && (Je(e.pointerX, e.pointerY), ge(!0)), It = Ie(n), m ? (_t(), G = m.top(), U = m.left()) : (qe() ? (Re(!0, !0), _t()) : e.applyBounds(), c ? (a = n.ownerSVGElement ? [M.xOrigin - n.getBBox().x, M.yOrigin - n.getBBox().y] : (rt(n)[Ct] || "0 0").split(" "), Ke = e.rotationOrigin = Ie(n).apply({
        x: parseFloat(a[0]) || 0,
        y: parseFloat(a[1]) || 0
      }), Re(!0, !0), u = e.pointerX - Ke.x - s, d = Ke.y - e.pointerY + r, U = e.x, G = e.y = Math.atan2(d, u) * Gt) : (G = Fe(b, "px"), U = Fe(L, "px"))), Xe && o && (U > O ? U = O + (U - O) / o : U < A && (U = A - (A - U) / o), c || (G > Q ? G = Q + (G - Q) / o : G < H && (G = H - (H - G) / o))), e.startX = U = Me(U), e.startY = G = Me(G);
    }, qe = function() {
      return e.tween && e.tween.isActive();
    }, ui = function() {
      _e.parentNode && !qe() && !e.isDragging && _e.parentNode.removeChild(_e);
    }, $e = function(o, s) {
      var r;
      if (!ye || e.isPressed || !o || (o.type === "mousedown" || o.type === "pointerdown") && !s && Se() - I < 30 && nt[e.pointerEvent.type]) {
        ee && o && ye && re(o);
        return;
      }
      if (At = qe(), st = !1, e.pointerEvent = o, nt[o.type] ? (q = ~o.type.indexOf("touch") ? o.currentTarget || o.target : P, V(q, "touchend", ae), V(q, "touchmove", Ne), V(q, "touchcancel", ae), V(P, "touchstart", qt)) : (q = null, V(P, "mousemove", Ne)), se = null, (!dt || !q) && (V(P, "mouseup", ae), o && o.target && V(o.target, "mouseup", ae)), Ue = j.call(e, o.target) && i.dragClickables === !1 && !s, Ue) {
        V(o.target, "change", ae), F(e, "pressInit", "onPressInit"), F(e, "press", "onPress"), ut(y, !0), ee = !1;
        return;
      }
      if (oe = !q || _ === D || e.vars.allowNativeTouchScrolling === !1 || e.vars.allowContextMenu && o && (o.ctrlKey || o.which > 2) ? !1 : _ ? "y" : "x", ee = !oe && !e.allowEventDefault, ee && (re(o), V(Y, "touchforcechange", re)), o.changedTouches ? (o = lt = o.changedTouches[0], ie = o.identifier) : o.pointerId ? ie = o.pointerId : lt = ie = null, pt++, yi(ge), pe = e.pointerY = o.pageY, he = e.pointerX = o.pageX, F(e, "pressInit", "onPressInit"), (oe || e.autoScroll) && Dt(n.parentNode), n.parentNode && e.autoScroll && !m && !c && n.parentNode._gsMaxScrollX && !_e.parentNode && !n.getBBox && (_e.style.width = n.parentNode.scrollWidth + "px", n.parentNode.appendChild(_e)), at(), e.tween && e.tween.kill(), e.isThrowing = !1, v.killTweensOf(m || n, R, !0), m && v.killTweensOf(n, {
        scrollTo: 1
      }, !0), e.tween = e.lockedAxis = null, (i.zIndexBoost || !c && !m && i.zIndexBoost !== !1) && (n.style.zIndex = t.zIndex++), e.isPressed = !0, Rt = !!(i.onDrag || e._listeners.drag), Nt = !!(i.onMove || e._listeners.move), i.cursor !== !1 || i.activeCursor)
        for (r = y.length; --r > -1; )
          v.set(y[r], {
            cursor: i.activeCursor || i.cursor || (tt === "grab" ? "grabbing" : tt)
          });
      F(e, "press", "onPress");
    }, Ne = function(o) {
      var s = o, r, a, u, d, w, p;
      if (!ye || Yt || !e.isPressed || !o) {
        ee && o && ye && re(o);
        return;
      }
      if (e.pointerEvent = o, r = o.changedTouches, r) {
        if (o = r[0], o !== lt && o.identifier !== ie) {
          for (d = r.length; --d > -1 && (o = r[d]).identifier !== ie && o.target !== n; )
            ;
          if (d < 0)
            return;
        }
      } else if (o.pointerId && ie && o.pointerId !== ie)
        return;
      if (q && oe && !se && (le.x = o.pageX - (xe ? Qe(P) : 0), le.y = o.pageY - (xe ? Ge(P) : 0), k && k.apply(le, le), a = le.x, u = le.y, w = Math.abs(a - he), p = Math.abs(u - pe), (w !== p && (w > S || p > S) || et && oe === se) && (se = w > p && _ ? "x" : "y", oe && se !== oe && V(Y, "touchforcechange", re), e.vars.lockAxisOnTouchScroll !== !1 && _ && D && (e.lockedAxis = se === "x" ? "y" : "x", Ee(e.vars.onLockAxis) && e.vars.onLockAxis.call(e, s)), et && oe === se))) {
        ae(s);
        return;
      }
      !e.allowEventDefault && (!oe || se && oe !== se) && s.cancelable !== !1 ? (re(s), ee = !0) : ee && (ee = !1), e.autoScroll && (N = !0), Je(o.pageX, o.pageY, Nt);
    }, Je = function(o, s, r) {
      var a = 1 - e.dragResistance, u = 1 - e.edgeResistance, d = e.pointerX, w = e.pointerY, p = G, C = e.x, T = e.y, X = e.endX, B = e.endY, Z = e.endRotation, me = K, ne, De, $, W, Tt, fe;
      e.pointerX = o, e.pointerY = s, xe && (o -= Qe(P), s -= Ge(P)), c ? (W = Math.atan2(Ke.y - s, o - Ke.x) * Gt, Tt = e.y - W, Tt > 180 ? (G -= 360, e.y = W) : Tt < -180 && (G += 360, e.y = W), e.x !== U || Math.max(Math.abs(he - o), Math.abs(pe - s)) > S ? (e.y = W, $ = U + (G - W) * a) : $ = U) : (k && (fe = o * k.a + s * k.c + k.e, s = o * k.b + s * k.d + k.f, o = fe), De = s - pe, ne = o - he, De < S && De > -S && (De = 0), ne < S && ne > -S && (ne = 0), (e.lockAxis || e.lockedAxis) && (ne || De) && (fe = e.lockedAxis, fe || (e.lockedAxis = fe = _ && Math.abs(ne) > Math.abs(De) ? "y" : D ? "x" : null, fe && Ee(e.vars.onLockAxis) && e.vars.onLockAxis.call(e, e.pointerEvent)), fe === "y" ? De = 0 : fe === "x" && (ne = 0)), $ = Me(U + ne * a), W = Me(G + De * a)), (Te || be || Ye) && (e.x !== $ || e.y !== W && !c) && (Ye && (He.x = $, He.y = W, fe = Ye(He), $ = Me(fe.x), W = Me(fe.y)), Te && ($ = Me(Te($))), be && (W = Me(be(W)))), Xe && ($ > O ? $ = O + Math.round(($ - O) * u) : $ < A && ($ = A + Math.round(($ - A) * u)), c || (W > Q ? W = Math.round(Q + (W - Q) * u) : W < H && (W = Math.round(H + (W - H) * u)))), (e.x !== $ || e.y !== W && !c) && (c ? (e.endRotation = e.x = e.endX = $, K = !0) : (D && (e.y = e.endY = W, K = !0), _ && (e.x = e.endX = $, K = !0)), !r || F(e, "move", "onMove") !== !1 ? !e.isDragging && e.isPressed && (e.isDragging = st = !0, F(e, "dragstart", "onDragStart")) : (e.pointerX = d, e.pointerY = w, G = p, e.x = C, e.y = T, e.endX = X, e.endY = B, e.endRotation = Z, K = me));
    }, ae = function g(o, s) {
      if (!ye || !e.isPressed || o && ie != null && !s && (o.pointerId && o.pointerId !== ie && o.target !== n || o.changedTouches && !wi(o.changedTouches, ie))) {
        ee && o && ye && re(o);
        return;
      }
      e.isPressed = !1;
      var r = o, a = e.isDragging, u = e.vars.allowContextMenu && o && (o.ctrlKey || o.which > 2), d = v.delayedCall(1e-3, ui), w, p, C, T, X;
      if (q ? (z(q, "touchend", g), z(q, "touchmove", Ne), z(q, "touchcancel", g), z(P, "touchstart", qt)) : z(P, "mousemove", Ne), z(Y, "touchforcechange", re), (!dt || !q) && (z(P, "mouseup", g), o && o.target && z(o.target, "mouseup", g)), K = !1, a && (J = Qt = Se(), e.isDragging = !1), Ut(ge), Ue && !u) {
        o && (z(o.target, "change", g), e.pointerEvent = r), ut(y, !1), F(e, "release", "onRelease"), F(e, "click", "onClick"), Ue = !1;
        return;
      }
      for (p = y.length; --p > -1; )
        Mt(y[p], "cursor", i.cursor || (i.cursor !== !1 ? tt : null));
      if (pt--, o) {
        if (w = o.changedTouches, w && (o = w[0], o !== lt && o.identifier !== ie)) {
          for (p = w.length; --p > -1 && (o = w[p]).identifier !== ie && o.target !== n; )
            ;
          if (p < 0 && !s)
            return;
        }
        e.pointerEvent = r, e.pointerX = o.pageX, e.pointerY = o.pageY;
      }
      return u && r ? (re(r), ee = !0, F(e, "release", "onRelease")) : r && !a ? (ee = !1, At && (i.snap || i.bounds) && vt(i.inertia || i.throwProps), F(e, "release", "onRelease"), (!et || r.type !== "touchmove") && r.type.indexOf("cancel") === -1 && (F(e, "click", "onClick"), Se() - I < 300 && F(e, "doubleclick", "onDoubleClick"), T = r.target || n, I = Se(), X = function() {
        I !== mt && e.enabled() && !e.isPressed && !r.defaultPrevented && (T.click ? T.click() : P.createEvent && (C = P.createEvent("MouseEvents"), C.initMouseEvent("click", !0, !0, Y, 1, e.pointerEvent.screenX, e.pointerEvent.screenY, e.pointerX, e.pointerY, !1, !1, !1, !1, 0, null), T.dispatchEvent(C)));
      }, !et && !r.defaultPrevented && v.delayedCall(0.05, X))) : (vt(i.inertia || i.throwProps), !e.allowEventDefault && r && (i.dragClickables !== !1 || !j.call(e, r.target)) && a && (!oe || se && oe === se) && r.cancelable !== !1 ? (ee = !0, re(r)) : ee = !1, F(e, "release", "onRelease")), qe() && d.duration(e.tween.duration()), a && F(e, "dragend", "onDragEnd"), !0;
    }, ft = function(o) {
      if (o && e.isDragging && !m) {
        var s = o.target || n.parentNode, r = s.scrollLeft - s._gsScrollX, a = s.scrollTop - s._gsScrollY;
        (r || a) && (k ? (he -= r * k.a + a * k.c, pe -= a * k.d + r * k.b) : (he -= r, pe -= a), s._gsScrollX += r, s._gsScrollY += a, Je(e.pointerX, e.pointerY));
      }
    }, Ht = function(o) {
      var s = Se(), r = s - I < 100, a = s - J < 50, u = r && mt === I, d = e.pointerEvent && e.pointerEvent.defaultPrevented, w = r && Ot === I, p = o.isTrusted || o.isTrusted == null && r && u;
      if ((u || a && e.vars.suppressClickOnDrag !== !1) && o.stopImmediatePropagation && o.stopImmediatePropagation(), r && !(e.pointerEvent && e.pointerEvent.defaultPrevented) && (!u || p && !w)) {
        p && u && (Ot = I), mt = I;
        return;
      }
      (e.isPressed || a || r) && (!p || !o.detail || !r || d) && re(o), !r && !a && !st && (o && o.target && (e.pointerEvent = o), F(e, "click", "onClick"));
    }, Wt = function(o) {
      return k ? {
        x: o.x * k.a + o.y * k.c + k.e,
        y: o.x * k.b + o.y * k.d + k.f
      } : {
        x: o.x,
        y: o.y
      };
    };
    return xt = t.get(n), xt && xt.kill(), l.startDrag = function(g, o) {
      var s, r, a, u;
      $e(g || e.pointerEvent, !0), o && !e.hitTest(g || e.pointerEvent) && (s = We(g || e.pointerEvent), r = We(n), a = Wt({
        x: s.left + s.width / 2,
        y: s.top + s.height / 2
      }), u = Wt({
        x: r.left + r.width / 2,
        y: r.top + r.height / 2
      }), he -= a.x - u.x, pe -= a.y - u.y), e.isDragging || (e.isDragging = st = !0, F(e, "dragstart", "onDragStart"));
    }, l.drag = Ne, l.endDrag = function(g) {
      return ae(g || e.pointerEvent, !0);
    }, l.timeSinceDrag = function() {
      return e.isDragging ? 0 : (Se() - J) / 1e3;
    }, l.timeSinceClick = function() {
      return (Se() - I) / 1e3;
    }, l.hitTest = function(g, o) {
      return t.hitTest(e.target, g, o);
    }, l.getDirection = function(g, o) {
      var s = g === "velocity" && ce ? g : it(g) && !c ? "element" : "start", r, a, u, d, w, p;
      return s === "element" && (w = We(e.target), p = We(g)), r = s === "start" ? e.x - U : s === "velocity" ? ce.getVelocity(n, L) : w.left + w.width / 2 - (p.left + p.width / 2), c ? r < 0 ? "counter-clockwise" : "clockwise" : (o = o || 2, a = s === "start" ? e.y - G : s === "velocity" ? ce.getVelocity(n, b) : w.top + w.height / 2 - (p.top + p.height / 2), u = Math.abs(r / a), d = u < 1 / o ? "" : r < 0 ? "left" : "right", u < o && (d !== "" && (d += "-"), d += a < 0 ? "up" : "down"), d);
    }, l.applyBounds = function(g, o) {
      var s, r, a, u, d, w;
      if (g && i.bounds !== g)
        return i.bounds = g, e.update(!0, o);
      if (Re(!0), _t(), Xe && !qe()) {
        if (s = e.x, r = e.y, s > O ? s = O : s < A && (s = A), r > Q ? r = Q : r < H && (r = H), (e.x !== s || e.y !== r) && (a = !0, e.x = e.endX = s, c ? e.endRotation = s : e.y = e.endY = r, K = !0, ge(!0), e.autoScroll && !e.isDragging))
          for (Dt(n.parentNode), u = n, we.scrollTop = Y.pageYOffset != null ? Y.pageYOffset : P.documentElement.scrollTop != null ? P.documentElement.scrollTop : P.body.scrollTop, we.scrollLeft = Y.pageXOffset != null ? Y.pageXOffset : P.documentElement.scrollLeft != null ? P.documentElement.scrollLeft : P.body.scrollLeft; u && !w; )
            w = Ve(u.parentNode), d = w ? we : u.parentNode, D && d.scrollTop > d._gsMaxScrollY && (d.scrollTop = d._gsMaxScrollY), _ && d.scrollLeft > d._gsMaxScrollX && (d.scrollLeft = d._gsMaxScrollX), u = d;
        e.isThrowing && (a || e.endX > O || e.endX < A || e.endY > Q || e.endY < H) && vt(i.inertia || i.throwProps, a);
      }
      return e;
    }, l.update = function(g, o, s) {
      if (o && e.isPressed) {
        var r = Ie(n), a = It.apply({
          x: e.x - U,
          y: e.y - G
        }), u = Ie(n.parentNode, !0);
        u.apply({
          x: r.e - a.x,
          y: r.f - a.y
        }, a), e.x -= a.x - u.e, e.y -= a.y - u.f, ge(!0), at();
      }
      var d = e.x, w = e.y;
      return Ft(!o), g ? e.applyBounds() : (K && s && ge(!0), Re(!0)), o && (Je(e.pointerX, e.pointerY), K && ge(!0)), e.isPressed && !o && (_ && Math.abs(d - e.x) > 0.01 || D && Math.abs(w - e.y) > 0.01 && !c) && at(), e.autoScroll && (Dt(n.parentNode, e.isDragging), N = e.isDragging, ge(!0), Jt(n, ft), $t(n, ft)), e;
    }, l.enable = function(g) {
      var o = {
        lazy: !0
      }, s, r, a;
      if (i.cursor !== !1 && (o.cursor = i.cursor || tt), v.utils.checkPrefix("touchCallout") && (o.touchCallout = "none"), g !== "soft") {
        for (Vt(y, _ === D ? "none" : i.allowNativeTouchScrolling && n.scrollHeight === n.clientHeight == (n.scrollWidth === n.clientHeight) || i.allowEventDefault ? "manipulation" : _ ? "pan-y" : "pan-x"), r = y.length; --r > -1; )
          a = y[r], dt || V(a, "mousedown", $e), V(a, "touchstart", $e), V(a, "click", Ht, !0), v.set(a, o), a.getBBox && a.ownerSVGElement && _ !== D && v.set(a.ownerSVGElement, {
            touchAction: i.allowNativeTouchScrolling || i.allowEventDefault ? "manipulation" : _ ? "pan-y" : "pan-x"
          }), i.allowContextMenu || V(a, "contextmenu", Bt);
        ut(y, !1);
      }
      return $t(n, ft), ye = !0, ce && g !== "soft" && ce.track(m || n, x ? "x,y" : c ? "rotation" : "top,left"), n._gsDragID = s = n._gsDragID || "d" + pi++, ze[s] = e, m && (m.enable(), m.element._gsDragID = s), (i.bounds || c) && at(), i.bounds && e.applyBounds(), e;
    }, l.disable = function(g) {
      for (var o = e.isDragging, s = y.length, r; --s > -1; )
        Mt(y[s], "cursor", null);
      if (g !== "soft") {
        for (Vt(y, null), s = y.length; --s > -1; )
          r = y[s], Mt(r, "touchCallout", null), z(r, "mousedown", $e), z(r, "touchstart", $e), z(r, "click", Ht, !0), z(r, "contextmenu", Bt);
        ut(y, !0), q && (z(q, "touchcancel", ae), z(q, "touchend", ae), z(q, "touchmove", Ne)), z(P, "mouseup", ae), z(P, "mousemove", Ne);
      }
      return Jt(n, ft), ye = !1, ce && g !== "soft" && (ce.untrack(m || n, x ? "x,y" : c ? "rotation" : "top,left"), e.tween && e.tween.kill()), m && m.disable(), Ut(ge), e.isDragging = e.isPressed = Ue = !1, o && F(e, "dragend", "onDragEnd"), e;
    }, l.enabled = function(g, o) {
      return arguments.length ? g ? e.enable(o) : e.disable(o) : ye;
    }, l.kill = function() {
      return e.isThrowing = !1, e.tween && e.tween.kill(), e.disable(), v.set(y, {
        clearProps: "userSelect"
      }), delete ze[n._gsDragID], e;
    }, l.revert = function() {
      this.kill(), this.styles && this.styles.revert();
    }, ~f.indexOf("scroll") && (m = l.scrollProxy = new Di(n, xi({
      onKill: function() {
        e.isPressed && ae(null);
      }
    }, i)), n.style.overflowY = D && !kt ? "auto" : "hidden", n.style.overflowX = _ && !kt ? "auto" : "hidden", n = m.content), c ? R.rotation = 1 : (_ && (R[L] = 1), D && (R[b] = 1)), M.force3D = "force3D" in i ? i.force3D : !0, ii(zt(l)), l.enable(), l;
  }
  return t.register = function(i) {
    v = i, Et();
  }, t.create = function(i, l) {
    return Pt || Et(!0), Pe(i).map(function(f) {
      return new t(f, l);
    });
  }, t.get = function(i) {
    return ze[(Pe(i)[0] || {})._gsDragID];
  }, t.timeSinceDrag = function() {
    return (Se() - Qt) / 1e3;
  }, t.hitTest = function(i, l, f) {
    if (i === l)
      return !1;
    var x = We(i), c = We(l), L = x.top, b = x.left, _ = x.right, D = x.bottom, S = x.width, e = x.height, y = c.left > _ || c.right < b || c.top > D || c.bottom < L, R, J, N;
    return y || !f ? !y : (N = (f + "").indexOf("%") !== -1, f = parseFloat(f) || 0, R = {
      left: Math.max(b, c.left),
      top: Math.max(L, c.top)
    }, R.width = Math.min(_, c.right) - R.left, R.height = Math.min(D, c.bottom) - R.top, R.width < 0 || R.height < 0 ? !1 : N ? (f *= 0.01, J = R.width * R.height, J >= S * e * f || J >= c.width * c.height * f) : R.width > f && R.height > f);
  }, t;
})(Mi);
mi(gt.prototype, {
  pointerX: 0,
  pointerY: 0,
  startX: 0,
  startY: 0,
  deltaX: 0,
  deltaY: 0,
  isDragging: !1,
  isPressed: !1
});
gt.zIndex = 1e3;
gt.version = "3.13.0";
ni() && v.registerPlugin(gt);
export {
  gt as Draggable,
  gt as default
};
