import { focusElementTimeout as e } from "./focus.js";
import { clickOutsideElementBounds as t } from "./dom.js";
//#region src/internal/utils/keynav.ts
function n(e, t, n) {
	e.includes(t.code) && n();
}
function r(n, r) {
	let i = n.signal ? { signal: n.signal } : void 0;
	globalThis.document.addEventListener("pointerup", (e) => {
		!n.element.hidden && t(e, n.element) && t(e, n.focusElement) && r();
	}, i), n.element.addEventListener("keydown", (t) => {
		!n.element.hidden && t.code === "Escape" && (t.preventDefault(), e(n.focusElement), r());
	}, i);
}
//#endregion
export { r as createLightDismiss, n as onKeys };

//# sourceMappingURL=keynav.js.map