import{useContext as n,useEffect as r}from"react";import{PresenceContext as t}from"../../context/PresenceContext.js";import{useConstant as e}from"../../utils/use-constant.js";function u(){var e=n(t);if(null===e)return[!0,null];var u=e.isPresent,o=e.onExitComplete,i=e.register,c=s();r((function(){return i(c)}),[]);return!u&&o?[!1,function(){return null==o?void 0:o(c)}]:[!0]}function o(){return i(n(t))}function i(n){return null===n||n.isPresent}var c=0,f=function(){return c++},s=function(){return e(f)};export{i as isPresent,o as useIsPresent,u as usePresence};
//# sourceMappingURL=use-presence.js.map
