import { isTouchEvent as o } from "../gestures/utils/event-type.es.js";
function f(a) {
  return function(r) {
    var n = r instanceof MouseEvent, u = !n || n && r.button === 0;
    u && a(r);
  };
}
var i = { pageX: 0, pageY: 0 };
function t(a, r) {
  r === void 0 && (r = "page");
  var n = a.touches[0] || a.changedTouches[0], u = n || i;
  return {
    x: u[r + "X"],
    y: u[r + "Y"]
  };
}
function c(a, r) {
  return r === void 0 && (r = "page"), {
    x: a[r + "X"],
    y: a[r + "Y"]
  };
}
function v(a, r) {
  return r === void 0 && (r = "page"), {
    point: o(a) ? t(a, r) : c(a, r)
  };
}
var s = function(a, r) {
  r === void 0 && (r = !1);
  var n = function(u) {
    return a(u, v(u));
  };
  return r ? f(n) : n;
};
export {
  v as extractEventInfo,
  s as wrapHandler
};
//# sourceMappingURL=event-info.es.js.map
