"use client";
import { CODE as e, KEY as t } from "./keyboard.constants.js";
import { useCallback as n } from "react";
//#region lib/ui/hooks/useKeyboardControls.ts
var r = (n) => n.key === t.ENTER || n.key === t.SPACE || n.key === t.SPACEBAR || n.code === e.ENTER || n.code === e.SPACE, i = () => {}, a = ({ up: t = i, down: a = i, left: o = i, right: s = i, start: c = i, end: l = i, activate: u = i }) => n((n) => {
	if (r(n)) return u();
	if (n.code === e.HOME) return n.preventDefault(), c();
	if (n.code === e.END) return n.preventDefault(), l();
	if (n.code === e.ARROW_UP) return n.preventDefault(), t();
	if (n.code === e.ARROW_DOWN) return n.preventDefault(), a();
	if (n.code === e.ARROW_RIGHT) return n.preventDefault(), s();
	if (n.code === e.ARROW_LEFT) return n.preventDefault(), o();
}, [
	u,
	a,
	l,
	o,
	s,
	c,
	t
]);
//#endregion
export { a as useKeyboardControls };

//# sourceMappingURL=useKeyboardControls.js.map