"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../context/PresenceContext.mjs.js");exports.usePresence=function(){let r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const n=e.useContext(t.PresenceContext);if(null===n)return[!0,null];const{isPresent:s,onExitComplete:u,register:o}=n,c=e.useId();e.useEffect((()=>{if(r)return o(c)}),[r]);const i=e.useCallback((()=>r&&u&&u(c)),[c,u,r]);return!s&&u?[!1,i]:[!0]};
//# sourceMappingURL=use-presence.mjs.js.map
