import*as s from"react";import e from"../../../../react-focus-lock/dist/es2015/Combination.js";import{getAllFocusable as r}from"../../../utils/dist/esm/dom-query.js";import{focus as t}from"../../../utils/dist/esm/focus.js";import{__DEV__ as o}from"../../../utils/dist/esm/assertion.js";var c=o=>{var{initialFocusRef:c,finalFocusRef:u,contentRef:i,restoreFocus:n,children:a,isDisabled:l,autoFocus:m,persistentFocus:f,lockFocusAcrossFrames:F}=o,d=s.useCallback((()=>{if(null!=c&&c.current)c.current.focus();else if(null!=i&&i.current){0===r(i.current).length&&t(i.current,{nextTick:!0})}}),[c,i]),p=s.useCallback((()=>{var s;null==u||null==(s=u.current)||s.focus()}),[u]),k=n&&!u;return s.createElement(e,{crossFrame:F,persistentFocus:f,autoFocus:m,disabled:l,onActivation:d,onDeactivation:p,returnFocus:k},a)};o&&(c.displayName="FocusLock");export default c;export{c as FocusLock};
//# sourceMappingURL=index.js.map
