import*as e from"react";import*as t from"react-dom";var n=!0,i=!1,r=null,a={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function o(e){e.metaKey||e.altKey||e.ctrlKey||(n=!0)}function d(){n=!1}function u(){"hidden"===this.visibilityState&&i&&(n=!0)}function s(e){var t,i,r,o=e.target;try{return o.matches(":focus-visible")}catch(e){}return n||(i=(t=o).type,!("INPUT"!==(r=t.tagName)||!a[i]||t.readOnly)||"TEXTAREA"===r&&!t.readOnly||!!t.isContentEditable)}function c(){i=!0,window.clearTimeout(r),r=window.setTimeout((function(){i=!1}),100)}function l(){var n=e.useCallback((function(e){var n,i=t.findDOMNode(e);null!=i&&((n=i.ownerDocument).addEventListener("keydown",o,!0),n.addEventListener("mousedown",d,!0),n.addEventListener("pointerdown",d,!0),n.addEventListener("touchstart",d,!0),n.addEventListener("visibilitychange",u,!0))}),[]);return"production"!==process.env.NODE_ENV&&e.useDebugValue(s),{isFocusVisible:s,onBlurVisible:c,ref:n}}export default l;
//# sourceMappingURL=useIsFocusVisible.js.map
