import { extractEventInfo as p } from "../events/event-info.es.js";
import { Feature as u } from "../../../../../../motion-dom@12.38.0/node_modules/motion-dom/dist/es/render/Feature.es.js";
import { press as c } from "../../../../../../motion-dom@12.38.0/node_modules/motion-dom/dist/es/gestures/press/index.es.js";
import { frame as f } from "../../../../../../motion-dom@12.38.0/node_modules/motion-dom/dist/es/frameloop/frame.es.js";
function s(t, e, r) {
  const { props: n } = t;
  if (t.current instanceof HTMLButtonElement && t.current.disabled)
    return;
  t.animationState && n.whileTap && t.animationState.setActive("whileTap", r === "Start");
  const a = "onTap" + (r === "End" ? "" : r), o = n[a];
  o && f.postRender(() => o(e, p(e)));
}
class E extends u {
  mount() {
    const { current: e } = this.node;
    if (!e)
      return;
    const { globalTapTarget: r, propagate: n } = this.node.props;
    this.unmount = c(e, (a, o) => (s(this.node, o, "Start"), (i, { success: m }) => s(this.node, i, m ? "End" : "Cancel")), {
      useGlobalTarget: r,
      stopPropagation: (n == null ? void 0 : n.tap) === !1
    });
  }
  unmount() {
  }
}
export {
  E as PressGesture
};
//# sourceMappingURL=press.es.js.map
