import{useUpdateEffect as r}from"./use-update-effect.js";import{getActiveElement as t,contains as s}from"../../../utils/dist/esm/dom.js";import{isTabbable as i}from"../../../utils/dist/esm/tabbable.js";import{focus as e}from"../../../utils/dist/esm/focus.js";function o(o,u){var{shouldFocus:f,visible:m,focusRef:n}=u,c=f&&!m;r((()=>{if(c&&!function(r){var e=r.current;if(!e)return!1;var o=t(e);return!!o&&!s(e,o)&&!!i(o)}(o)){var r=(null==n?void 0:n.current)||o.current;r&&e(r,{nextTick:!0})}}),[c,o,n])}export{o as useFocusOnHide};
//# sourceMappingURL=use-focus-on-hide.js.map
