"use strict";function r(n,e,t=()=>{}){n.includes(e.key)&&t()}function w(n,e,t=()=>{}){n.includes(e.key)||t()}function s(n,e){n.key==="Enter"&&e()}function a(n,e){d(n.key)&&e()}function d(n){return[" ","Enter"].includes(n)}function f(n,e){r(["Esc","Escape"],n,e)}function c(n,e){r(["Up","ArrowUp","Down","ArrowDown"],n,e)}function l(n,e){r(["Left","ArrowLeft","Right","ArrowRight"],n,e)}function u(n,e){w(["Esc","Left","Up","Right","Down","Tab","Enter","Shift","Control","Alt","CapsLock","Escape","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Meta"],n,e)}function h(n,e){e&&n.preventDefault()}const i=[];function E(n,e){i.length===0&&window.addEventListener("resize",o),i.push(e)}function p(n,e){i.length===1&&window.removeEventListener("resize",o),i.splice(i.indexOf(e),1)}function o(n){window.removeEventListener("resize",o);const e=()=>{i.length&&(i.forEach(t=>t(n)),window.addEventListener("resize",o))};window.requestAnimationFrame?window.requestAnimationFrame(e):window.setTimeout(e,16)}function y(n=()=>{},e){return t=>{if(n(t),!t.defaultPrevented)return e(t)}}exports.addEventListener=E;exports.handleActionKeydown=a;exports.handleEnterKeydown=s;exports.handleEscapeKeydown=f;exports.handleLeftRightArrowsKeydown=l;exports.handleResize=o;exports.handleTextInput=u;exports.handleUpDownArrowsKeydown=c;exports.isActionKey=d;exports.preventDefaultIfHijax=h;exports.removeEventListener=p;exports.wrapEvent=y;
