import { useEventListener as e } from "./useEventListener.js";
import { unref as t } from "vue";
function n(n, r) {
	let i = {
		el: void 0,
		x: 0,
		y: 0
	}, a = (e) => ({
		x: e.x,
		y: e.y,
		dx: e.x - i.x,
		dy: e.y - i.y
	});
	e(document, "mousedown", (e) => {
		e.target === t(n) && (e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault(), i.el = t(n), i.x = e.x, i.y = e.y);
	}), e(document, "mouseup", (e) => {
		i.el && (i.el = void 0, r({
			...a(e),
			stop: !0
		}, i));
	}), e(document, "mousemove", (e) => {
		i.el && r(a(e), i);
	});
}
export { n as useMouseCapture };

//# sourceMappingURL=useMouseCapture.js.map