var i, v;
function F() {
  if (v) return i;
  v = 1;
  var s = new Error("Element already at target scroll position"), d = new Error("Scroll cancelled"), E = Math.min, u = Date.now;
  i = {
    left: o("scrollLeft"),
    top: o("scrollTop")
  };
  function o(n) {
    return function(a, l, r, e) {
      r = r || {}, typeof r == "function" && (e = r, r = {}), typeof e != "function" && (e = L);
      var S = u(), t = a[n], h = r.ease || q, w = isNaN(r.duration) ? 350 : +r.duration, c = !1;
      return t === l ? e(s, a[n]) : requestAnimationFrame(f), A;
      function A() {
        c = !0;
      }
      function f(C) {
        if (c) return e(d, a[n]);
        var N = u(), m = E(1, (N - S) / w), _ = h(m);
        a[n] = _ * (l - t) + t, m < 1 ? requestAnimationFrame(f) : requestAnimationFrame(function() {
          e(null, a[n]);
        });
      }
    };
  }
  function q(n) {
    return 0.5 * (1 - Math.cos(Math.PI * n));
  }
  function L() {
  }
  return i;
}
export {
  F as __require
};
//# sourceMappingURL=index.js.map
